@pie-element/math-templated 7.1.11 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/module/print.js CHANGED
@@ -1 +1 @@
1
- import{_dll_debug as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_react_dom as o,_dll_mui__material as i,_dll_pie_lib__render_ui as a,_dll_mui__material_colors as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as u,_dll_react_dom_client as d}from"../../../@pie-lib/shared-module@^5.2.14/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@^5.1.4/module/index.js";import{_dll_pie_lib__math_input as h}from"../../../@pie-lib/math-edit-module@^4.2.14/module/index.js";import{_dll_pie_lib__drag as f}from"../../../@pie-lib/drag-module@^4.1.1/module/index.js";var g="object"==typeof global&&global&&global.Object===Object&&global,m="object"==typeof self&&self&&self.Object===Object&&self,v=g||m||Function("return this")(),b=v.Symbol,y=Object.prototype,w=y.hasOwnProperty,x=y.toString,_=b?b.toStringTag:void 0;var C=Object.prototype.toString;var E=b?b.toStringTag:void 0;function k(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=w.call(e,_),n=e[_];try{e[_]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(t?e[_]=n:delete e[_]),o}(e):function(e){return C.call(e)}(e)}function S(e){return null!=e&&"object"==typeof e}function A(e){return"symbol"==typeof e||S(e)&&"[object Symbol]"==k(e)}var R=Array.isArray,j=b?b.prototype:void 0,D=j?j.toString:void 0;function O(e){if("string"==typeof e)return e;if(R(e))return function(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}(e,O)+"";if(A(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var T=/\s/;var M=/^\s+/;function I(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&T.test(e.charAt(t)););return t}(e)+1).replace(M,""):e}function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var $=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,W=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(A(e))return NaN;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=I(e);var n=L.test(e);return n||W.test(e)?P(e.slice(2),n?2:8):$.test(e)?NaN:+e}function B(e){return e}function F(e){if(!N(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,q=v["__core-js_shared__"],U=(H=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var K=Function.prototype.toString;function V(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Y=/^\[object .+?Constructor\]$/,X=Function.prototype,J=Object.prototype,Q=X.toString,G=J.hasOwnProperty,Z=RegExp("^"+Q.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ee(e){return!(!N(e)||(t=e,U&&U in t))&&(F(e)?Z:Y).test(V(e));var t}function te(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ee(n)?n:void 0}var ne=te(v,"WeakMap"),re=/^(?:0|[1-9]\d*)$/;function oe(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ie(e,t){return e===t||e!=e&&t!=t}function ae(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function se(e){return null!=e&&ae(e.length)&&!F(e)}var le=Object.prototype;function ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||le)}function ue(e){return S(e)&&"[object Arguments]"==k(e)}var de=Object.prototype,pe=de.hasOwnProperty,he=de.propertyIsEnumerable,fe=ue(function(){return arguments}())?ue:function(e){return S(e)&&pe.call(e,"callee")&&!he.call(e,"callee")};var ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=ge&&"object"==typeof module&&module&&!module.nodeType&&module,ve=me&&me.exports===ge?v.Buffer:void 0,be=(ve?ve.isBuffer:void 0)||function(){return!1},ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;var we,xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,_e=xe&&"object"==typeof module&&module&&!module.nodeType&&module,Ce=_e&&_e.exports===xe&&g.process,Ee=function(){try{var e=_e&&_e.require&&_e.require("util").types;return e||Ce&&Ce.binding&&Ce.binding("util")}catch(e){}}(),ke=Ee&&Ee.isTypedArray,Se=ke?(we=ke,function(e){return we(e)}):function(e){return S(e)&&ae(e.length)&&!!ye[k(e)]},Ae=Object.prototype.hasOwnProperty;function Re(e,t){var n=R(e),r=!n&&fe(e),o=!n&&!r&&be(e),i=!n&&!r&&!o&&Se(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!Ae.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oe(c,l))||s.push(c);return s}var je=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),De=je,Oe=Object.prototype.hasOwnProperty;function Te(e){if(!ce(e))return De(e);var t=[];for(var n in Object(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Me(e){return se(e)?Re(e):Te(e)}var Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ne=/^\w*$/;function $e(e,t){if(R(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!A(e))||(Ne.test(e)||!Ie.test(e)||null!=t&&e in Object(t))}var Le=te(Object,"create");var We=Object.prototype.hasOwnProperty;var Pe=Object.prototype.hasOwnProperty;function ze(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 Be(e,t){for(var n=e.length;n--;)if(ie(e[n][0],t))return n;return-1}ze.prototype.clear=function(){this.__data__=Le?Le(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(Le){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return We.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return Le?void 0!==t[e]:Pe.call(t,e)},ze.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};var Fe=Array.prototype.splice;function He(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])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,n=Be(t,e);return!(n<0)&&(n==t.length-1?t.pop():Fe.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=Be(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return Be(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=Be(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var qe=te(v,"Map");function Ue(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 Ke(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])}}Ke.prototype.clear=function(){this.size=0,this.__data__={hash:new ze,map:new(qe||He),string:new ze}},Ke.prototype.delete=function(e){var t=Ue(this,e).delete(e);return this.size-=t?1:0,t},Ke.prototype.get=function(e){return Ue(this,e).get(e)},Ke.prototype.has=function(e){return Ue(this,e).has(e)},Ke.prototype.set=function(e,t){var n=Ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ve(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(Ve.Cache||Ke),n}Ve.Cache=Ke;var Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,Je=function(e){var t=Ve(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(Ye,function(e,n,r,o){t.push(r?o.replace(Xe,"$1"):n||e)}),t}),Qe=Je;function Ge(e,t){return R(e)?e:$e(e,t)?[e]:Qe(function(e){return null==e?"":O(e)}(e))}function Ze(e){if("string"==typeof e||A(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var n=0,r=(t=Ge(t,e)).length;null!=e&&n<r;)e=e[Ze(t[n++])];return n&&n==r?e:void 0}function tt(e,t,n){var r=null==e?void 0:et(e,t);return void 0===r?n:r}function nt(e){var t=this.__data__=new He(e);this.size=t.size}nt.prototype.clear=function(){this.__data__=new He,this.size=0},nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nt.prototype.get=function(e){return this.__data__.get(e)},nt.prototype.has=function(e){return this.__data__.has(e)},nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof He){var r=n.__data__;if(!qe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ke(r)}return n.set(e,t),this.size=n.size,this};var rt=Object.prototype.propertyIsEnumerable,ot=Object.getOwnPropertySymbols,it=ot?function(e){return null==e?[]:(e=Object(e),function(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}(ot(e),function(t){return rt.call(e,t)}))}:function(){return[]};function at(e){return function(e,t,n){var r=t(e);return R(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Me,it)}var st=te(v,"DataView"),lt=te(v,"Promise"),ct=te(v,"Set"),ut="[object Map]",dt="[object Promise]",pt="[object Set]",ht="[object WeakMap]",ft="[object DataView]",gt=V(st),mt=V(qe),vt=V(lt),bt=V(ct),yt=V(ne),wt=k;(st&&wt(new st(new ArrayBuffer(1)))!=ft||qe&&wt(new qe)!=ut||lt&&wt(lt.resolve())!=dt||ct&&wt(new ct)!=pt||ne&&wt(new ne)!=ht)&&(wt=function(e){var t=k(e),n="[object Object]"==t?e.constructor:void 0,r=n?V(n):"";if(r)switch(r){case gt:return ft;case mt:return ut;case vt:return dt;case bt:return pt;case yt:return ht}return t});var xt=wt,_t=v.Uint8Array;function Ct(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ke;++t<n;)this.add(e[t])}function Et(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)}Ct.prototype.add=Ct.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ct.prototype.has=function(e){return this.__data__.has(e)};function St(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),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=2&n?new Ct:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Et(t,function(e,t){if(!kt(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function At(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var jt=b?b.prototype:void 0,Dt=jt?jt.valueOf:void 0;var Ot=Object.prototype.hasOwnProperty;var Tt="[object Arguments]",Mt="[object Array]",It="[object Object]",Nt=Object.prototype.hasOwnProperty;function $t(e,t,n,r,o,i){var a=R(e),s=R(t),l=a?Mt:xt(e),c=s?Mt:xt(t),u=(l=l==Tt?It:l)==It,d=(c=c==Tt?It:c)==It,p=l==c;if(p&&be(e)){if(!be(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new nt),a||Se(e)?St(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 ie(+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=At;case"[object Set]":var l=1&r;if(s||(s=Rt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=St(s(e),s(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(Dt)return Dt.call(e)==Dt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&Nt.call(e,"__wrapped__"),f=d&&Nt.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new nt),o(g,m,n,r,i)}}return!!p&&(i||(i=new nt),function(e,t,n,r,o,i){var a=1&n,s=at(e),l=s.length;if(l!=at(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:Ot.call(t,u)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var f=a;++c<l;){var g=e[u=s[c]],m=t[u];if(r)var v=a?r(m,g,u,t,e,i):r(g,m,u,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){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 Lt(e,t,n,r,o){return e===t||(null==e||null==t||!S(e)&&!S(t)?e!=e&&t!=t:$t(e,t,n,r,Lt,o))}function Wt(e){return e==e&&!N(e)}function Pt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function zt(e){var t=function(e){for(var t=Me(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Wt(o)]}return t}(e);return 1==t.length&&t[0][2]?Pt(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],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new nt;if(r)var p=r(c,u,l,e,t,d);if(!(void 0===p?Lt(u,c,3,r,d):p))return!1}}return!0}(n,e,t)}}function Bt(e,t){return null!=e&&t in Object(e)}function Ft(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Ge(t,e)).length,i=!1;++r<o;){var a=Ze(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ae(o)&&oe(a,o)&&(R(e)||fe(e))}(e,t,Bt)}function Ht(e){return $e(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Ze(e)):function(e){return function(t){return et(t,e)}}(e)}function qt(e){return"function"==typeof e?e:null==e?B:"object"==typeof e?R(e)?(t=e[0],n=e[1],$e(t)&&Wt(n)?Pt(Ze(t),n):function(e){var r=tt(e,t);return void 0===r&&r===n?Ft(e,t):Lt(n,r,3)}):zt(e):Ht(e);var t,n}var Ut,Kt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[Ut?a:++r];if(!1===t(o[s],s,o))break}return e},Vt=Kt;function Yt(e,t){return e&&Vt(e,t,Me)}var Xt=function(){return v.Date.now()},Jt=Math.max,Qt=Math.min;function Gt(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!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 f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function g(){var e=Xt();if(f(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?Qt(n,i-(e-c)):n}(e))}function m(e){return s=void 0,p&&r?h(e):(r=o=void 0,a)}function v(){var e=Xt(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?h(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Jt(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:m(Xt())},v}var Zt=Object.prototype.hasOwnProperty;function en(e){if(null==e)return!0;if(se(e)&&(R(e)||"string"==typeof e||"function"==typeof e.splice||be(e)||Se(e)||fe(e)))return!e.length;var t=xt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ce(e))return!Te(e).length;for(var n in e)if(Zt.call(e,n))return!1;return!0}function tn(e,t){return Lt(e,t)}var nn,rn,on,an={"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},sn={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},ln=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},cn=ln,un=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,dn="undefined"==typeof document?{}:document.documentElement.style,pn=(nn=function(){for(var e in dn)if(un.test(e))return e.match(un)[0];return"WebkitOpacity"in dn?"Webkit":"KhtmlOpacity"in dn?"Khtml":""}(),rn=nn.toLowerCase(),{style:nn,css:"-"+rn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[nn]||cn(nn)}),hn=function(e,t){return t?t.toUpperCase():""},fn=/[-\s]+(.)?/g,gn=function(e){return e?e.replace(fn,hn):""},mn=/::/g,vn=/([A-Z]+)([A-Z][a-z])/g,bn=/([a-z\d])([A-Z])/g,yn=/_/g,wn=function(e,t){return e?e.replace(mn,"/").replace(vn,"$1_$2").replace(bn,"$1_$2").replace(yn,t||"-"):""},xn=function(e){return wn(e).toLowerCase()},_n=gn,Cn=xn,En=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},kn=ln,Sn=pn,An=an,Rn="undefined"==typeof document?{}:document.documentElement.style,jn=function(e,t){t=t||{};var n=En(_n(e)),r=Cn(e),o=on?n:r,i=Sn.style?on?Sn.style:Sn.css:"";if(n in Rn)return t.asString?o:[o];var a=o,s=An[r],l=[];if(on&&(a=kn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return on?En(_n(e)):Cn(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},Dn=Object.prototype.hasOwnProperty,On=function(e,t){return Dn.call(e,t)},Tn=Object.prototype.toString,Mn=Object.prototype.toString,In=jn,Nn=xn,$n=gn,Ln=On,Wn=function(e){return!!e&&"[object Object]"===Tn.call(e)},Pn=function(e){return"[object Function]"===Mn.apply(e)},zn=function(e,t,n,r){In(t).forEach(function(t){e[r?r(t):t]=n})},Bn={cssUnitless:sn},Fn=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||Bn).cssUnitless=t.cssUnitless||Bn.cssUnitless,r=r||{};var o,i,a,s,l,c,u,d,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,f=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},g=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?$n:Nn;for(a in e)if(Ln(e,a)){if(s=e[a],i=Nn(n?n+a:a),o=!1,d=!1,Pn(s)&&(u=s.call(p||e,s,a,i,e),Wn(u)&&null!=u.value?(s=u.value,d=u.prefix,i=u.name?Nn(u.name):i):s=u),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,d=s.prefix,s=s.value),o){if(d=d||!!m[i],c&&(s=h&&!(i in f)?s+g: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){d?zn(r,e,s,v):r[v(e)]=s});continue}d?zn(r,i,s,v):r[v(i)]=s}else Fn(s,t,i+"-",r)}return r},Hn=Fn,qn=On,Un={prefixProperties:an,cssUnitless:sn,object:Fn,string:function(e,t){e=Hn(e,t);var n,r=[];for(n in e)qn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Kn=e("@pie-lib:mask-markup:serialization"),Vn=["span"],Yn=["em","strong","u"],Xn=(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),Un.object(r,{camelize:!0,addUnits:!1});var r},Jn=["border","class","style"],Qn={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Gn=(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=Qn[r];if(o){Kn("[deserialize] mark: ",o);return{_flatten:!0,nodes:Zn(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=Jn.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=Xn(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=>Vn.includes(e)?"inline":Yn.includes(e)?"mark":"block")(r),l=Zn(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},Zn=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Gn(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},er=t,tr=n,{styled:nr}=r,{renderMath:rr}=p;const or=nr("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),ir=nr("span")(()=>({display:"inline-block",width:".75em"})),ar=["tbody","tr"],sr=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,i)=>{const s=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return a.push(er.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const o=r(e,t,n);if(o){const t="blank"===function(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}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&a.push(er.createElement(ir,{key:`spacer-${i}`})),a.push(o),void(t&&a.push(er.createElement(ir,{key:`spacer-${i}`})))}}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&&ar.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>tt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in Qn)if(Qn[e]===n.type){const n=e;a.push(er.createElement(n,{key:s},t));break}}else t.length>0&&a.push(t)}else{const o=sr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)a.push(er.createElement(or,{key:s},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(er.createElement(t,{key:s,...e.data.attributes},o)):a.push(er.createElement(t,{key:s,...e.data.attributes}))}}}),a},lr=nr("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class cr extends er.Component{constructor(e){super(e),cr.prototype.__init.call(this),this.internalContainerRef=er.createRef()}static __initStatic(){this.propTypes={renderChildren:tr.func,layout:tr.object,value:tr.object,onChange:tr.func,elementType:tr.string,containerRef:tr.oneOfType([tr.func,tr.shape({current:tr.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof rr&&rr(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=sr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return er.createElement(lr,{ref:i},o)}}cr.__initStatic();const ur=/\{\{(\d+)\}\}/g;const dr=t,pr=n;var hr;const fr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(ur,(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=Zn(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},gr=(e,t)=>((hr=class extends dr.Component{static __initStatic(){this.propTypes={markup:pr.string,layout:pr.object,value:pr.object,onChange:pr.func,customMarkMarkupComponent:pr.func,elementType:pr.string}}constructor(e){super(e),this.containerRef=dr.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||fr(n,e);return dr.createElement(cr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),hr),{useMemo:mr}=t,{useLayoutEffect:vr}=t,{useEffect:br}=t,{useRef:yr}=t,{useCallback:wr}=t,xr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function _r(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Cr(e){return"nodeType"in e}function Er(e){var t,n;return e?_r(e)?e:Cr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function kr(e){const{Document:t}=Er(e);return e instanceof t}function Sr(e){return!_r(e)&&e instanceof Er(e).HTMLElement}function Ar(e){return e instanceof Er(e).SVGElement}function Rr(e){return e?_r(e)?e.document:Cr(e)?kr(e)?e:Sr(e)||Ar(e)?e.ownerDocument:document:document:document}const jr=xr?vr:br;function Dr(e){const t=yr(e);return jr(()=>{t.current=e}),wr(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 Or(e,t){void 0===t&&(t=[e]);const n=yr(e);return jr(()=>{n.current!==e&&(n.current=e)},t),n}function Tr(e,t){const n=yr();return mr(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Mr(e){const t=Dr(e),n=yr(null),r=wr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Ir(e){const t=yr();return br(()=>{t.current=e},[e]),t.current}let Nr={};function $r(e,t){return mr(()=>{if(t)return t;const n=null==Nr[e]?0:Nr[e]+1;return Nr[e]=n,e+"-"+n},[e,t])}function Lr(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 Wr=Lr(1),Pr=Lr(-1);function zr(e){if(!e)return!1;const{KeyboardEvent:t}=Er(e.target);return t&&e instanceof t}function Br(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Er(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 Fr=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[Fr.Translate.toString(e),Fr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Hr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qr(e){return e.matches(Hr)?e:e.querySelector(Hr)}const Ur=t,{useState:Kr}=t,{useCallback:Vr}=t,Yr={display:"none"};function Xr(e){let{id:t,value:n}=e;return Ur.createElement("div",{id:t,style:Yr},n)}function Jr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Ur.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 Qr=t,{createContext:Gr}=t,{useContext:Zr}=t,{useEffect:eo}=t,{useState:to}=t,{useCallback:no}=t,{useMemo:ro}=t,{useRef:oo}=t,{memo:io}=t,{useReducer:ao}=t,{cloneElement:so}=t,{forwardRef:lo}=t,{createPortal:co}=o,{unstable_batchedUpdates:uo}=o,po=Gr(null);const ho={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 "},fo={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 go(e){let{announcements:t=fo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ho}=e;const{announce:i,announcement:a}=function(){const[e,t]=Kr("");return{announce:Vr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=$r("DndLiveRegion"),[l,c]=to(!1);if(eo(()=>{c(!0)},[]),function(e){const t=Zr(po);eo(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(ro(()=>({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 u=Qr.createElement(Qr.Fragment,null,Qr.createElement(Xr,{id:r,value:o.draggable}),Qr.createElement(Jr,{id:s,announcement:a}));return n?co(u,n):u}var mo;function vo(){}!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"}(mo||(mo={}));const bo=Object.freeze({x:0,y:0});function yo(e,t){const n=Br(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function wo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xo(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 _o=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=xo(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(wo)};function Co(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:bo}const Eo=(ko=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+ko*t.y,bottom:e.bottom+ko*t.y,left:e.left+ko*t.x,right:e.right+ko*t.x}),{...e})});var ko;function So(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 Ao={ignoreTransform:!1};function Ro(e,t){void 0===t&&(t=Ao);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Er(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=So(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)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,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 jo(e){return Ro(e,{ignoreTransform:!0})}function Do(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(kr(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Sr(o)||Ar(o))return n;if(n.includes(o))return n;const i=Er(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Er(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=Er(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Oo(e){const[t]=Do(e,1);return null!=t?t:null}function To(e){return xr&&e?_r(e)?e:Cr(e)?kr(e)||e===Rr(e).scrollingElement?window:Sr(e)?e:null:null:null}function Mo(e){return _r(e)?e.scrollX:e.scrollLeft}function Io(e){return _r(e)?e.scrollY:e.scrollTop}function No(e){return{x:Mo(e),y:Io(e)}}var $o;function Lo(e){return!(!xr||!e)&&e===document.scrollingElement}function Wo(e){const t={x:0,y:0},n=Lo(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"}($o||($o={}));const Po={x:.2,y:.2};function zo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Po);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Wo(e),h={x:0,y:0},f={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+g?(h.y=$o.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!u&&l>=t.bottom-g&&(h.y=$o.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-m?(h.x=$o.Forward,f.x=r*Math.abs((t.right-m-s)/m)):!d&&a<=t.left+m&&(h.x=$o.Backward,f.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:f}}function Bo(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 Fo(e){return e.reduce((e,t)=>Wr(e,No(t)),bo)}function Ho(e,t){if(void 0===t&&(t=Ro),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Oo(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const qo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Mo(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Io(t),0)}]];class Uo{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=Do(t),r=Fo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of qo)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 Ko{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 Vo(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 Yo,Xo;function Jo(e){e.preventDefault()}function Qo(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"}(Yo||(Yo={})),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"}(Xo||(Xo={}));const Go={start:[Xo.Space,Xo.Enter],cancel:[Xo.Esc],end:[Xo.Space,Xo.Enter,Xo.Tab]},Zo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xo.Right:return{...n,x:n.x+25};case Xo.Left:return{...n,x:n.x-25};case Xo.Down:return{...n,y:n.y+25};case Xo.Up:return{...n,y:n.y-25}}};class ei{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 Ko(Rr(t)),this.windowListeners=new Ko(Er(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Yo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ho(n),t(bo)}handleKeyDown(e){if(zr(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Go,coordinateGetter:i=Zo,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}:bo;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=Pr(u,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:d,minScroll:p}=Wo(n),h=Bo(n),f={x:Math.min(o===Xo.Right?h.right-h.width/2:h.right,Math.max(o===Xo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Xo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Xo.Down?h.top:h.top+h.height/2,u.y))},g=o===Xo.Right&&!s||o===Xo.Left&&!l,m=o===Xo.Down&&!c||o===Xo.Up&&!i;if(g&&f.x!==u.x){const e=n.scrollLeft+t.x,i=o===Xo.Right&&e<=d.x||o===Xo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Xo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&f.y!==u.y){const e=n.scrollTop+t.y,i=o===Xo.Down&&e<=d.y||o===Xo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Xo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Wr(Pr(u,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 ti(e){return Boolean(e&&"distance"in e)}function ni(e){return Boolean(e&&"delay"in e)}ei.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Go,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 ri{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Er(e);return e instanceof t?e:Rr(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=Rr(i),this.documentListeners=new Ko(this.document),this.listeners=new Ko(n),this.windowListeners=new Ko(Er(i)),this.initialCoordinates=null!=(r=Br(o))?r:bo,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(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.DragStart,Jo),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),this.windowListeners.add(Yo.ContextMenu,Jo),this.documentListeners.add(Yo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ni(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ti(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(Yo.Click,Qo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Yo.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=Br(e))?t:bo,l=Pr(r,s);if(!n&&a){if(ti(a)){if(null!=a.tolerance&&Vo(l,a.tolerance))return this.handleCancel();if(Vo(l,a.distance))return this.handleStart()}return ni(a)&&Vo(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===Xo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const oi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ii extends ri{constructor(e){const{event:t}=e,n=Rr(t.target);super(e,oi,n)}}ii.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 ai={move:{name:"mousemove"},end:{name:"mouseup"}};var si;!function(e){e[e.RightClick=2]="RightClick"}(si||(si={}));(class extends ri{constructor(e){super(e,ai,Rr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==si.RightClick&&(null==r||r({event:n}),!0)}}];const li={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var ci,ui;function di(e){let{acceleration:t,activator:n=ci.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=ui.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Ir(t);return Tr(e=>{if(n||!r||!e)return pi;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[$o.Backward]:e.x[$o.Backward]||-1===o.x,[$o.Forward]:e.x[$o.Forward]||1===o.x},y:{[$o.Backward]:e.y[$o.Backward]||-1===o.y,[$o.Forward]:e.y[$o.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[f,g]=function(){const e=yr(null);return[wr((t,n)=>{e.current=setInterval(t,n)},[]),wr(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=oo({x:0,y:0}),v=oo({x:0,y:0}),b=ro(()=>{switch(n){case ci.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ci.DraggableRect:return o}},[n,o,l]),y=oo(null),w=no(()=>{const e=y.current;if(!e)return;const t=m.current.x*v.current.x,n=m.current.y*v.current.y;e.scrollBy(t,n)},[]),x=ro(()=>s===ui.TreeOrder?[...c].reverse():c,[s,c]);eo(()=>{if(i&&c.length&&b){for(const e of x){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:s}=zo(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 g(),y.current=e,f(w,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,r,g,i,a,JSON.stringify(b),JSON.stringify(h),f,c,x,u,JSON.stringify(p)])}(class extends ri{constructor(e){super(e,li)}static setup(){return window.addEventListener(li.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(li.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"}(ci||(ci={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ui||(ui={}));const pi={x:{[$o.Backward]:!1,[$o.Forward]:!1},y:{[$o.Backward]:!1,[$o.Forward]:!1}};var hi,fi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(hi||(hi={})),function(e){e.Optimized="optimized"}(fi||(fi={}));const gi=new Map;function mi(e,t){return Tr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function vi(e){let{callback:t,disabled:n}=e;const r=Dr(t),o=ro(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return eo(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function bi(e){return new Uo(Ro(e),e)}function yi(e,t,n){void 0===t&&(t=bi);const[r,o]=to(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=Dr(t),o=ro(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return eo(()=>()=>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=vi({callback:i});return jr(()=>{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 wi=[];function xi(e,t){void 0===t&&(t=[]);const n=oo(null);return eo(()=>{n.current=null},t),eo(()=>{const t=e!==bo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Pr(e,n.current):bo}function _i(e){return ro(()=>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 Ci=[];function Ei(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Sr(t)?t:e}const ki=[{sensor:ii,options:{}},{sensor:ei,options:{}}],Si={current:{}},Ai={draggable:{measure:jo},droppable:{measure:jo,strategy:hi.WhileDragging,frequency:fi.Optimized},dragOverlay:{measure:Ro}};class Ri 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 ji={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ri,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:vo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ai,measureDroppableContainers:vo,windowRect:null,measuringScheduled:!1},Di={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vo,draggableNodes:new Map,over:null,measureDroppableContainers:vo},Oi=Gr(Di),Ti=Gr(ji);function Mi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ri}}}function Ii(e,t){switch(t.type){case mo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case mo.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 mo.DragEnd:case mo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ri(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case mo.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 Ri(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case mo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ri(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ni(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=Zr(Oi),i=Ir(r),a=Ir(null==n?void 0:n.id);return eo(()=>{if(!t&&!r&&i&&null!=a){if(!zr(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=qr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function $i(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Li=Gr({...bo,scaleX:1,scaleY:1});var Wi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Wi||(Wi={})),io(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ki,collisionDetection:u=_o,measuring:d,modifiers:p,...h}=e;const f=ao(Ii,void 0,Mi),[g,m]=f,[v,b]=function(){const[e]=to(()=>new Set),t=no(t=>(e.add(t),()=>e.delete(t)),[e]);return[no(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,w]=to(Wi.Uninitialized),x=y===Wi.Initialized,{draggable:{active:_,nodes:C,translate:E},droppable:{containers:k}}=g,S=null!=_?C.get(_):null,A=oo({initial:null,translated:null}),R=ro(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:Si,rect:A}:null},[_,S]),j=oo(null),[D,O]=to(null),[T,M]=to(null),I=Or(h,Object.values(h)),N=$r("DndDescribedBy",i),$=ro(()=>k.getEnabled(),[k]),L=ro(()=>({draggable:{...Ai.draggable,...null==W?void 0:W.draggable},droppable:{...Ai.droppable,...null==W?void 0:W.droppable},dragOverlay:{...Ai.dragOverlay,...null==W?void 0:W.dragOverlay}}),[null==(W=d)?void 0:W.draggable,null==W?void 0:W.droppable,null==W?void 0:W.dragOverlay]);var W;const{droppableRects:P,measureDroppableContainers:z,measuringScheduled:B}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=to(null),{frequency:s,measure:l,strategy:c}=o,u=oo(e),d=function(){switch(c){case hi.Always:return!1;case hi.BeforeDragging:return n;default:return!n}}(),p=Or(d),h=no(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=oo(null),g=Tr(t=>{if(d&&!n)return gi;if(!t||t===gi||u.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 Uo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return eo(()=>{u.current=e},[e]),eo(()=>{d||h()},[n,d]),eo(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),eo(()=>{d||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},s))},[s,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:x,dependencies:[E.x,E.y],config:L.droppable}),F=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Tr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,_),H=ro(()=>T?Br(T):null,[T]),q=function(){const e=!1===(null==D?void 0:D.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=x&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),U=function(e,t){return mi(e,t)}(F,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=oo(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;jr(()=>{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=Co(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=Oo(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=_?C.get(_):null,config:q.layoutShiftCompensation,initialRect:U,measure:L.draggable.measure});const K=yi(F,L.draggable.measure,U),V=yi(F?F.parentElement:null),Y=oo({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=k.getNodeFor(null==(t=Y.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=to(null),o=vi({callback:no(e=>{for(const{target:n}of e)if(Sr(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=no(e=>{const n=Ei(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Mr(i);return ro(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:L.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:F,G=x?null!=(r=J.rect)?r:K:null,Z=Boolean(J.nodeRef.current&&J.rect),ee=Co(te=Z?null:K,mi(te));var te;const ne=_i(Q?Er(Q):null),re=function(e){const t=oo(e),n=Tr(n=>e?n&&n!==wi&&e&&t.current&&e.parentNode===t.current.parentNode?n:Do(e):wi,[e]);return eo(()=>{t.current=e},[e]),n}(x?null!=X?X:F:null),oe=function(e,t){void 0===t&&(t=Ro);const[n]=e,r=_i(n?Er(n):null),[o,i]=to(Ci);function a(){i(()=>e.length?e.map(e=>Lo(e)?r:new Uo(t(e),e)):Ci)}const s=vi({callback:a});return jr(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=$i(p,{transform:{x:E.x-ee.x,y:E.y-ee.y,scaleX:1,scaleY:1},activatorEvent:T,active:R,activeNodeRect:K,containerNodeRect:V,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=H?Wr(H,E):null,se=function(e){const[t,n]=to(null),r=oo(e),o=no(e=>{const t=To(e.target);t&&n(e=>e?(e.set(t,No(t)),new Map(e)):null)},[]);return eo(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=To(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,No(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=To(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),ro(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Wr(e,t),bo):Fo(e):bo,[e,t])}(re),le=xi(se),ce=xi(se,[K]),ue=Wr(ie,le),de=G?Eo(G,ie):null,pe=R&&de?u({active:R,collisionRect:de,droppableRects:P,droppableContainers:$,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[fe,ge]=to(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Z?ie:Wr(ie,ce),null!=(o=null==fe?void 0:fe.rect)?o:null,K),ve=oo(null),be=no((e,t)=>{let{sensor:n,options:r}=t;if(null==j.current)return;const o=C.get(j.current);if(!o)return;const i=e.nativeEvent,a=new n({active:j.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=I.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=I.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=j.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=I.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};uo(()=>{null==r||r(o),w(Wi.Initializing),m({type:mo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),O(ve.current),M(i)})},onMove(e){m({type:mo.DragMove,coordinates:e})},onEnd:s(mo.DragEnd),onCancel:s(mo.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let a=null;if(t&&o){const{cancelDrop:s}=I.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===mo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=mo.DragCancel)}}j.current=null,uo(()=>{m({type:e}),w(Wi.Uninitialized),ge(null),O(null),M(null),ve.current=null;const t=e===mo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=I.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[C]),ye=no((e,t)=>(n,r)=>{const o=n.nativeEvent,i=C.get(r);if(null!==j.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},j.current=r,be(n,t))},[C,be]),we=function(e,t){return ro(()=>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){eo(()=>{if(!xr)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),jr(()=>{K&&y===Wi.Initializing&&w(Wi.Initialized)},[K,y]),eo(()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ue.x,y:ue.y},over:o};uo(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),eo(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==j.current||!t||!o)return;const{onDragOver:i}=I.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};uo(()=>{ge(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),jr(()=>{Y.current={activatorEvent:T,active:R,activeNode:F,collisionRect:de,collisions:pe,droppableRects:P,draggableNodes:C,draggingNode:Q,draggingNodeRect:G,droppableContainers:k,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:ue},A.current={initial:G,translated:de}},[R,F,pe,de,C,Q,G,P,k,fe,re,ue]),di({...q,delta:E,draggingRect:de,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=ro(()=>({active:R,activeNode:F,activeNodeRect:K,activatorEvent:T,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:P,over:fe,measureDroppableContainers:z,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:L,measuringScheduled:B,windowRect:ne}),[R,F,K,T,pe,V,J,C,k,P,fe,z,re,oe,L,B,ne]),_e=ro(()=>({activatorEvent:T,activators:we,active:R,activeNodeRect:K,ariaDescribedById:{draggable:N},dispatch:m,draggableNodes:C,over:fe,measureDroppableContainers:z}),[T,we,R,K,m,N,C,fe,z]);return Qr.createElement(po.Provider,{value:b},Qr.createElement(Oi.Provider,{value:_e},Qr.createElement(Ti.Provider,{value:xe},Qr.createElement(Li.Provider,{value:me},l)),Qr.createElement(Ni,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Qr.createElement(go,{...a,hiddenTextDescribedById:N}))});const Pi=Gr(null),zi="button";function Bi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$r("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=Zr(Oi),{role:h=zi,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=Zr(m?Li:Pi),[b,y]=Mr(),[w,x]=Mr(),_=function(e,t){return ro(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=Or(n);jr(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:w,data:C}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:ro(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==zi)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,h,g,m,f,u.draggable]),isDragging:m,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const Fi={timeout:25};function Hi(e){let{animation:t,children:n}=e;const[r,o]=to(null),[i,a]=to(null),s=Ir(n);return n||r||!s||o(s),jr(()=>{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]),Qr.createElement(Qr.Fragment,null,n,r?so(r,{ref:a}):null)}const qi={x:0,y:0,scaleX:1,scaleY:1};function Ui(e){let{children:t}=e;return Qr.createElement(Oi.Provider,{value:Di},Qr.createElement(Li.Provider,{value:qi},t))}const Ki={position:"fixed",touchAction:"none"},Vi=e=>zr(e)?"transform 250ms ease":void 0,Yi=lo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:u=Vi}=e;if(!s)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Ki,width:s.width,height:s.height,top:s.top,left:s.left,transform:Fr.Transform.toString(d),transformOrigin:o&&r?yo(r,s):void 0,transition:"function"==typeof u?u(r):u,...l};return Qr.createElement(n,{className:a,style:p,ref:t},i)}),Xi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Fr.Transform.toString(t)},{transform:Fr.Transform.toString(n)}]},sideEffects:(Ji={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Ji;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 Ji;function Qi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Dr((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Ei(i);if(!l)return;const{transform:c}=Er(i).getComputedStyle(i),u=So(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Xi,...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},u={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},d={x:s.x-c.x,y:s.y-c.y,...u},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:d}}),[h]=p,f=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(f))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...l}),m=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==g||g(),e()}})}}(t);return Ho(s,o.draggable.measure),d({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:u})})}let Gi=0;function Zi(e){return ro(()=>{if(null!=e)return Gi++,Gi},[e])}const ea=Qr.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:u,active:d,activeNodeRect:p,containerNodeRect:h,draggableNodes:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=Zr(Ti),_=Zr(Li),C=Zi(null==d?void 0:d.id),E=$i(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:_,windowRect:x}),k=mi(p),S=Qi({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return Qr.createElement(Ui,null,Qr.createElement(Hi,{animation:S},d&&C?Qr.createElement(Yi,{key:C,id:d.id,ref:A,as:s,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:E},n):null))}),ta=t,{useEffect:na}=t,{useRef:ra}=t,oa=n,{styled:ia}=r,{Chip:aa}=i,{color:sa}=a,{renderMath:la}=p;function ca(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 ua=ia("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&&{}})),da=ia(aa)(()=>({backgroundColor:sa.white(),border:`1px solid ${sa.text()}`,color:sa.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}})),pa=ia("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"},"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{fontSize:"120% !important"}}));function ha({choice:e,disabled:t,instanceId:n}){const r=ra(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Bi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return na(()=>{la(r.current)},[e.value]),ta.createElement(ua,{ref:a,style:s?{width:ca([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth])||90,height:ca([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])||32}:{},disabled:t,...i,...o},ta.createElement(da,{clickable:!1,disabled:t,ref:r,label:ta.createElement(pa,{dangerouslySetInnerHTML:{__html:e.value}})}))}ha.propTypes={choice:oa.object.isRequired,disabled:oa.bool,instanceId:oa.oneOfType([oa.string,oa.number])};const fa=t,ga=n,{DragDroppablePlaceholder:ma}=f;class va extends fa.Component{constructor(...e){super(...e),va.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:ga.bool,duplicates:ga.bool,choices:ga.arrayOf(ga.shape({label:ga.string,value:ga.string})),value:ga.object,choicePosition:ga.string.isRequired,instanceId:ga.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 Yt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,qt(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return fa.createElement("div",{style:a},fa.createElement(ma,{disabled:e,instanceId:o},i.map((t,n)=>fa.createElement(ha,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}va.__initStatic();const ba=t,{useEffect:ya}=t,{useRef:wa}=t,{useState:xa}=t,_a=n,Ca=e,{styled:Ea}=r,{Chip:ka}=i,Sa=l,{color:Aa}=a,{grey:Ra}=s,{renderMath:ja}=p;function Da(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}Ca("pie-lib:mask-markup:blank");const Oa=Ea("span")(({dragged:e,over:t})=>({border:`solid 0px ${Aa.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Ta=Ea(ka)(()=>({backgroundColor:Aa.background(),border:`2px dashed ${Aa.text()}`,touchAction:"none",color:Aa.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ra[500]}`,backgroundColor:`${Ra[300]}`},"&.correct":{border:`solid 1px ${Aa.correct()}`},"&.incorrect":{border:`solid 1px ${Aa.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Ma=Ea("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{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 Ia({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=wa(null),c=wa(null),u=wa(null),d=wa(!1),[p,h]=xa({height:0,width:0}),f=()=>{m()},g=()=>{const e=Da([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=f:setTimeout(()=>{m()},300)},m=()=>{if(c.current&&l.current&&!d.current){d.current=!0,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;const e=c.current.querySelector("img");if(e)return c.current.textContent.trim().length>0?c.current:e;return c.current})()||c.current,t=e.getBoundingClientRect(),n=12,r=2,o=1,i=(e.offsetWidth||t.width||0)+2*n+2*r+o,u=Math.max(e.offsetHeight||0,t.height||0,e.scrollHeight||0,c.current.scrollHeight||0)+2*n+2*r+o,p=parseFloat(a)||0,f=parseFloat(s)||0,g=i<=p?p:i,m=u<=f?f:u;h(e=>({width:g>p?g:e.width,height:m>f?m:e.height}));const v=`${g}px`,b=`${m}px`;l.current.style.width!==v&&(l.current.style.width=v),l.current.style.height!==b&&(l.current.style.height=b),d.current=!1}};ya(()=>{g()},[]),ya(()=>{if("undefined"==typeof IntersectionObserver||!l.current)return;const e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&m()},{threshold:0});return e.observe(l.current),()=>e.disconnect()},[]),ya(()=>{l.current&&ja(l.current)},[i,n,Da([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),ya(()=>{t?g():h({height:0,width:0})},[Da([t,"optionalAccess",e=>e.value])]),ya(()=>{n||r||(u.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const v=o&&n&&o.choice&&o.choice.value,b=t&&t.value,y=n||r?{width:Da([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Da([u,"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:p.height||t,width:p.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return ba.createElement(Ta,{clickable:!1,disabled:e,ref:l,component:"span",label:ba.createElement(ba.Fragment,null,ba.createElement(Ma,{ref:c,draggable:!0,className:Sa({over:n,hidden:v}),dangerouslySetInnerHTML:{__html:b||""}}),v&&ba.createElement(Ma,{draggable:!0,className:Sa({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:v||""}})),className:Sa({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:y})}function Na({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}){const{attributes:c,listeners:u,setNodeRef:d,transform:p,isDragging:h}=Bi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:f,isOver:g,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$r("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=Zr(Oi),u=oo({disabled:n}),d=oo(!1),p=oo(null),h=oo(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...Fi,...o},v=Or(null!=g?g:r),b=vi({callback:no(()=>{d.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):d.current=!0},[m]),disabled:f||!a}),y=no((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[w,x]=Mr(y),_=Or(t);return eo(()=>{b&&w.current&&(b.disconnect(),d.current=!1,b.observe(w.current))},[w,b]),eo(()=>(s({type:mo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:_}}),()=>s({type:mo.UnregisterDroppable,key:i,id:r})),[r]),eo(()=>{n!==u.current.disabled&&(s({type:mo.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,s]),{active:a,rect:p,isOver:(null==l?void 0:l.id)===r,node:w,over:l,setNodeRef:x}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Fr.Translate.toString(p)};return ba.createElement(Oa,{ref:e=>{d(e),f(e)},style:v,dragged:h,over:g,...c,...u},ba.createElement(Ia,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:Da([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Ia.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ia.propTypes={id:_a.oneOfType([_a.string,_a.number]),disabled:_a.bool,duplicates:_a.bool,choice:_a.object,isOver:_a.bool,dragItem:_a.object,correct:_a.bool,onChange:_a.func,emptyResponseAreaWidth:_a.oneOfType([_a.string,_a.number]),emptyResponseAreaHeight:_a.oneOfType([_a.string,_a.number]),instanceId:_a.string},Na.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Na.propTypes={id:_a.oneOfType([_a.string,_a.number]),disabled:_a.bool,duplicates:_a.bool,choice:_a.object,correct:_a.bool,onChange:_a.func,emptyResponseAreaWidth:_a.oneOfType([_a.string,_a.number]),emptyResponseAreaHeight:_a.oneOfType([_a.string,_a.number]),instanceId:_a.string};const $a=t,La=n,{DragProvider:Wa}=f;function Pa(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 za=gr("blank",e=>(t,n,r)=>{const o=Pa([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:u,emptyResponseAreaHeight:d,instanceId:p,isDragging:h}=e,f=c?s[o.id]:n[o.id],g=f&&e.choices.find(e=>e.id===f);return $a.createElement(Na,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:g,id:o.id,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h})}});class Ba extends $a.Component{constructor(e){super(e),Ba.prototype.__init.call(this),Ba.prototype.__init2.call(this),Ba.prototype.__init3.call(this),Ba.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:La.string,layout:La.object,choicesPosition:La.string,choices:La.array,value:La.object,onChange:La.func,duplicates:La.bool,disabled:La.bool,feedback:La.object,correctResponse:La.object,showCorrectAnswer:La.bool,emptyResponseAreaWidth:La.oneOfType([La.string,La.number]),emptyResponseAreaHeight:La.oneOfType([La.string,La.number]),instanceId:La.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Pa([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?$a.createElement(ha,{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=Pa([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=Pa([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===Pa([i,"optionalAccess",e=>e.type])&&Pa([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:u,emptyResponseAreaHeight:d,layout:p,instanceId:h}=this.props,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return $a.createElement(Wa,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:_o},$a.createElement("div",{ref:e=>this.rootRef=e,style:g},$a.createElement(va,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),$a.createElement(za,{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:u,emptyResponseAreaHeight:d,instanceId:h,isDragging:!!this.state.activeDragItem}),$a.createElement(ea,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Ba.__initStatic(),Ba.__initStatic2();const Fa=t,{styled:Ha}=r,qa=l,{color:Ua}=a;function Ka(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 Va,Ya;"undefined"!=typeof window&&(Va=require("@pie-lib/editable-html-tip-tap").default,Ya=Ha(Va)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ua.black()}`,"&.correct":{border:`1px solid ${Ua.correct()}`},"&.incorrect":{border:`1px solid ${Ua.incorrect()}`}})));gr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:u}=e,d=Ka([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const p=(e.choices&&d&&e.choices[d.id]||[])[0],h=a?p&&p.label:n[d.id]||"",f=s&&s[d.id],g=i&&i[d.id],m=a||"correct"===g,v=!a&&"incorrect"===g,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Fa.createElement(Ya,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?f:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Ka([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:qa({correct:m,incorrect:v})})}});var Xa=gr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Ja=t,Qa=n,{Button:Ga}=i,{InputLabel:Za}=i,{Menu:es}=i,{MenuItem:ts}=i,{ArrowDropDown:ns}=c,{ArrowDropUp:rs}=c,{Close:os}=c,{Check:is}=c,{styled:as}=r,{color:ss}=a,{renderMath:ls}=p,cs=as(Ga)(()=>({color:ss.text(),border:`1px solid ${ss.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ss.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:ss.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ss.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ss.correct(),color:`${ss.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ss.incorrectWithIcon(),color:`${ss.text()} !important`}})),us=as(es)(()=>({backgroundColor:ss.background(),border:`1px solid ${ss.correct()} !important`,"&:hover":{border:`1px solid ${ss.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ss.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ds=as(ts)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ss.text(),backgroundColor:ss.background(),"&.Mui-focusVisible":{outline:`3px solid ${ss.tertiary()}`,outlineOffset:"-1px",color:ss.text(),backgroundColor:ss.background()},"&:hover":{color:ss.text(),backgroundColor:ss.dropdownBackground()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${ss.text()} !important`,backgroundColor:`${ss.background()} !important`,"&:hover":{color:ss.text(),backgroundColor:`${ss.dropdownBackground()} !important`}}})),ps=as("span")(()=>({fontSize:"max(1rem, 14px)"})),hs=as("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),fs=as(Za)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),gs=as(is)(()=>({color:`${ss.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ss.correct()},"&.incorrect":{backgroundColor:ss.incorrectWithIcon()}})),ms=as(os)(()=>({color:`${ss.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ss.correct()},"&.incorrect":{backgroundColor:ss.incorrectWithIcon()}}));class vs extends Ja.Component{static __initStatic(){this.propTypes={id:Qa.string,value:Qa.string,disabled:Qa.bool,onChange:Qa.func,correct:Qa.bool,choices:Qa.arrayOf(Qa.shape({value:Qa.string,label:Qa.string})),showCorrectAnswer:Qa.bool,singleQuery:Qa.bool,correctValue:Qa.string}}constructor(e){super(e),vs.prototype.__init.call(this),vs.prototype.__init2.call(this),vs.prototype.__init3.call(this),vs.prototype.__init4.call(this),vs.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Ja.createRef(),this.buttonRef=Ja.createRef(),this.previewRef=Ja.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||ls(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&ls(e)}),ls(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>{const{id:t,value:n,choices:r}=this.props;let o=null;if(n){const e=(r||[]).findIndex(e=>e.value===n);e>=0&&(o=`dropdown-option-${t}-${e}`)}this.setState({anchorEl:e.currentTarget,highlightedOptionId:o})}}__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),u=`dropdown-button-${e}`,d=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const f=parseInt(e,10)+1,g=a?"Query-label":`Query-label-${f}`,m=a?"Query":`Query ${f}`;let v=null;return n&&void 0!==t&&(v=t||i?Ja.createElement(gs,{className:"correct"}):Ja.createElement(ms,{className:"incorrect"})),Ja.createElement(Ja.Fragment,null,Ja.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Ja.createElement(ds,{key:t,tabIndex:-1,"aria-hidden":"true"},Ja.createElement(ps,{dangerouslySetInnerHTML:{__html:e.label}})))),Ja.createElement(fs,{id:g,tabIndex:-1,"aria-hidden":"true"},m),Ja.createElement(cs,{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?d:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:u,role:"combobox","aria-label":`Select an option for ${m}`,"aria-labelledby":p},v,Ja.createElement(ps,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Ja.createElement(rs,null):Ja.createElement(ns,null)),Ja.createElement(us,{id:d,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":u,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return Ja.createElement(ds,{id:o,className:t.value===r?"selected":"",selected:t.value===r,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)},Ja.createElement(ps,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Ja.createElement(hs,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}vs.__initStatic();const bs=t;gr("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),u=l?c&&c.value:n[o.id];return bs.createElement(vs,{key:`${t.type}-dropdown-${o.id}`,correct:s&&s[o.id]&&"correct"===s[o.id],disabled:a||l,value:u,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 ys=t,ws=n,{styled:xs}=r,{Tooltip:_s}=i,{color:Cs}=a,{Collapsible:Es}=a,{Readable:ks}=a,{hasText:Ss}=a,{hasMedia:As}=a,{PreviewPrompt:Rs}=a,{UiLayout:js}=a,Ds=u,Os=o,{mq:Ts}=h,{HorizontalKeypad:Ms}=h,{updateSpans:Is}=h,{registerEmbed:Ns}=h,{applyStaticMath:$s}=h,{renderMath:Ls}=p;function Ws(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 Ps=xs(js)({color:Cs.text(),backgroundColor:Cs.background(),display:"inline-block"}),zs=xs("div")({width:"100%",position:"relative",backgroundColor:Cs.background(),color:Cs.text()}),Bs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Fs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Hs=xs("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}}),qs=xs("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Cs.incorrect()} !important`},...n&&{borderColor:`${Cs.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}}})),Us=xs(Ts.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Cs.text()}}}),Ks=xs("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Vs=xs("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Ys=xs("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Xs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Js=xs(Ds)(({theme:e})=>({color:Cs.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: ${Cs.text()};\n background-color: ${Cs.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: ${Cs.correct()} !important;\n }\n .incorrect {\n border-color: ${Cs.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Qs=!1;const Gs=/(\{\{\d+\}\})/gm,Zs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function el(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function tl(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]=Ws([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Gs).filter(e=>e).reduce((e,n)=>{if(n.match(Gs)){const o=rl.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},{})}}const nl={name:"smartHorizontalPlacement",enabled:!0,phase:"main",requires:["popperOffsets"],fn:({state:e})=>{const t=e.modifiersData.popperOffsets;if(!t)return;const n=window.innerWidth||document.documentElement.clientWidth,r=e.rects.popper.width,o=e.elements.reference.getBoundingClientRect().left,i=Ws([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),a=Ws([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},s=Ws([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-a.left+s,c=l-o,u=c+8,d=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=d<u?u:Math.min(Math.max(t.x,u),d)}};class rl extends ys.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:ws.object.isRequired,onSessionChange:ws.func,model:ws.object.isRequired}}constructor(e){super(e),rl.prototype.__init.call(this),rl.prototype.__init2.call(this),rl.prototype.__init3.call(this),rl.prototype.__init4.call(this),rl.prototype.__init5.call(this),rl.prototype.__init6.call(this),rl.prototype.__init7.call(this),rl.prototype.__init8.call(this),rl.prototype.__init9.call(this),rl.prototype.__init10.call(this),rl.prototype.__init11.call(this),rl.prototype.__init12.call(this),rl.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Gs,e=>{const n=rl.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:Ws([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:ys.createRef()}}UNSAFE_componentWillMount(){"undefined"!=typeof window&&(Qs||(Ns("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}]`})),Qs=!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){const i=r[t];$s(n,i&&i.value||""),e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),o.textContent="R"}}),Ls(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(Gs),u=i.match(Gs);if(!tn(c,u)){const e={},t=this.state.session.answers;(u||[]).forEach(n=>{const r=rl.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Ws([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=tn(this.props.model,e.model),r=tn(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>Ls(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Ws([this,"access",e=>e.root,"optionalAccess",e=>e.querySelectorAll,"call",e=>e(".mq-editable-field")])||[]).map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),n=()=>{t.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n})};this.setState({activeAnswerBlock:e},()=>{n(),requestAnimationFrame(n),setTimeout(n,0)})}}__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);const n=[];let r=Ws([this,"access",e=>e.input,"optionalAccess",e=>e.el,"optionalCall",e=>e()])||this.root;for(;r&&r!==document.body&&r!==document.documentElement;){(r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)&&n.push(r),r=r.parentElement}document.scrollingElement&&n.push(document.scrollingElement);const o=n.map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),i={x:window.scrollX,y:window.scrollY},a=()=>{o.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n}),window.scrollTo(i.x,i.y)};this.input.focus(),a(),requestAnimationFrame(a),setTimeout(a,0)}}__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)=>{Is(),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=Ws([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&&Ws([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Zs){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&&(Ss(t)||As(t)),o=ys.createElement(Rs,{defaultClassName:"teacher-instructions",prompt:t});return r&&ys.createElement(Fs,null,n?o:ys.createElement(Es,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=ys.createElement(Rs,{prompt:t});return t&&(Ss(t)||As(t))&&ys.createElement(Fs,null,n?r:ys.createElement(Es,{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:u,feedback:d,env:{mode:p}={},printMode:h,alwaysShowCorrect:f}=e||{},g=en(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(u),v=tl(e,this.state)||"",b=h&&!f;return ys.createElement(Hs,null,ys.createElement(Xa,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&d&&d[e],u=ys.createElement(Us,{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 ys.createElement(qs,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},ys.createElement(_s,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Ws([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"auto",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"preventOverflow",enabled:!1},{name:"flip",enabled:!1},nl]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"auto",maxWidth:"none",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&ys.createElement(Ks,{"data-keypad":!0,key:e,style:{width:el(m,c)}},ys.createElement(Ms,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?ys.createElement(Vs,null,u):ys.createElement("div",null,u)))}}))}}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:u}=e||{},d=!en(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&u;return ys.createElement(Ps,{extraCSSRules:i,ref:e=>{const t=Os.findDOMNode(e);this.root=t||this.root}},ys.createElement(zs,null,"gather"===r&&ys.createElement(Ys,null,"Math Equation Response Question"),ys.createElement(zs,null,d&&ys.createElement(Js,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&ys.createElement(Bs,null,ys.createElement(Rs,{prompt:n})),ys.createElement(ks,{false:!0},this.renderPlayerContent()),p&&ys.createElement(Xs,{className:"note",dangerouslySetInnerHTML:{__html:u}}),this.renderRationale()))}}rl.__initStatic(),rl.__initStatic2();const ol=t,{createRoot:il}=d,al=e,{renderMath:sl}=p,ll=al("pie-element:math-templated:print");class cl extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Gt(()=>{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&&ol.createElement(rl,{model:e,session:{}});this._root||(this._root=il(this)),this._root.render(t),queueMicrotask(()=>{ll("render complete - render math"),sl(this)})}else ll("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{cl as default};
1
+ import{_dll_debug as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_react_dom as o,_dll_mui__material as i,_dll_pie_lib__render_ui as a,_dll_mui__material_colors as s,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as u,_dll_react_dom_client as d}from"../../../@pie-lib/shared-module@6.0.0/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@6.0.0/module/index.js";import{_dll_pie_lib__math_input as h}from"../../../@pie-lib/math-edit-module@5.0.0/module/index.js";import{_dll_pie_lib__drag as f}from"../../../@pie-lib/drag-module@5.0.0/module/index.js";var g="object"==typeof global&&global&&global.Object===Object&&global,m="object"==typeof self&&self&&self.Object===Object&&self,v=g||m||Function("return this")(),b=v.Symbol,y=Object.prototype,w=y.hasOwnProperty,x=y.toString,_=b?b.toStringTag:void 0;var C=Object.prototype.toString;var E=b?b.toStringTag:void 0;function k(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=w.call(e,_),n=e[_];try{e[_]=void 0;var r=!0}catch(e){}var o=x.call(e);return r&&(t?e[_]=n:delete e[_]),o}(e):function(e){return C.call(e)}(e)}function S(e){return null!=e&&"object"==typeof e}function A(e){return"symbol"==typeof e||S(e)&&"[object Symbol]"==k(e)}var R=Array.isArray,j=b?b.prototype:void 0,D=j?j.toString:void 0;function O(e){if("string"==typeof e)return e;if(R(e))return function(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}(e,O)+"";if(A(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var T=/\s/;var M=/^\s+/;function I(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&T.test(e.charAt(t)););return t}(e)+1).replace(M,""):e}function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var $=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,W=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(A(e))return NaN;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=I(e);var n=L.test(e);return n||W.test(e)?P(e.slice(2),n?2:8):$.test(e)?NaN:+e}function B(e){return e}function F(e){if(!N(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,q=v["__core-js_shared__"],U=(H=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var K=Function.prototype.toString;function V(e){if(null!=e){try{return K.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var Y=/^\[object .+?Constructor\]$/,X=Function.prototype,J=Object.prototype,Q=X.toString,G=J.hasOwnProperty,Z=RegExp("^"+Q.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ee(e){return!(!N(e)||(t=e,U&&U in t))&&(F(e)?Z:Y).test(V(e));var t}function te(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ee(n)?n:void 0}var ne=te(v,"WeakMap"),re=/^(?:0|[1-9]\d*)$/;function oe(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ie(e,t){return e===t||e!=e&&t!=t}function ae(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function se(e){return null!=e&&ae(e.length)&&!F(e)}var le=Object.prototype;function ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||le)}function ue(e){return S(e)&&"[object Arguments]"==k(e)}var de=Object.prototype,pe=de.hasOwnProperty,he=de.propertyIsEnumerable,fe=ue(function(){return arguments}())?ue:function(e){return S(e)&&pe.call(e,"callee")&&!he.call(e,"callee")};var ge="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=ge&&"object"==typeof module&&module&&!module.nodeType&&module,ve=me&&me.exports===ge?v.Buffer:void 0,be=(ve?ve.isBuffer:void 0)||function(){return!1},ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;var we,xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,_e=xe&&"object"==typeof module&&module&&!module.nodeType&&module,Ce=_e&&_e.exports===xe&&g.process,Ee=function(){try{var e=_e&&_e.require&&_e.require("util").types;return e||Ce&&Ce.binding&&Ce.binding("util")}catch(e){}}(),ke=Ee&&Ee.isTypedArray,Se=ke?(we=ke,function(e){return we(e)}):function(e){return S(e)&&ae(e.length)&&!!ye[k(e)]},Ae=Object.prototype.hasOwnProperty;function Re(e,t){var n=R(e),r=!n&&fe(e),o=!n&&!r&&be(e),i=!n&&!r&&!o&&Se(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!Ae.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oe(c,l))||s.push(c);return s}var je=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),De=je,Oe=Object.prototype.hasOwnProperty;function Te(e){if(!ce(e))return De(e);var t=[];for(var n in Object(e))Oe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Me(e){return se(e)?Re(e):Te(e)}var Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ne=/^\w*$/;function $e(e,t){if(R(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!A(e))||(Ne.test(e)||!Ie.test(e)||null!=t&&e in Object(t))}var Le=te(Object,"create");var We=Object.prototype.hasOwnProperty;var Pe=Object.prototype.hasOwnProperty;function ze(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 Be(e,t){for(var n=e.length;n--;)if(ie(e[n][0],t))return n;return-1}ze.prototype.clear=function(){this.__data__=Le?Le(null):{},this.size=0},ze.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ze.prototype.get=function(e){var t=this.__data__;if(Le){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return We.call(t,e)?t[e]:void 0},ze.prototype.has=function(e){var t=this.__data__;return Le?void 0!==t[e]:Pe.call(t,e)},ze.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Le&&void 0===t?"__lodash_hash_undefined__":t,this};var Fe=Array.prototype.splice;function He(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])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,n=Be(t,e);return!(n<0)&&(n==t.length-1?t.pop():Fe.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=Be(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return Be(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=Be(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var qe=te(v,"Map");function Ue(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 Ke(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])}}Ke.prototype.clear=function(){this.size=0,this.__data__={hash:new ze,map:new(qe||He),string:new ze}},Ke.prototype.delete=function(e){var t=Ue(this,e).delete(e);return this.size-=t?1:0,t},Ke.prototype.get=function(e){return Ue(this,e).get(e)},Ke.prototype.has=function(e){return Ue(this,e).has(e)},Ke.prototype.set=function(e,t){var n=Ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ve(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(Ve.Cache||Ke),n}Ve.Cache=Ke;var Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,Je=function(e){var t=Ve(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(Ye,function(e,n,r,o){t.push(r?o.replace(Xe,"$1"):n||e)}),t}),Qe=Je;function Ge(e,t){return R(e)?e:$e(e,t)?[e]:Qe(function(e){return null==e?"":O(e)}(e))}function Ze(e){if("string"==typeof e||A(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var n=0,r=(t=Ge(t,e)).length;null!=e&&n<r;)e=e[Ze(t[n++])];return n&&n==r?e:void 0}function tt(e,t,n){var r=null==e?void 0:et(e,t);return void 0===r?n:r}function nt(e){var t=this.__data__=new He(e);this.size=t.size}nt.prototype.clear=function(){this.__data__=new He,this.size=0},nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nt.prototype.get=function(e){return this.__data__.get(e)},nt.prototype.has=function(e){return this.__data__.has(e)},nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof He){var r=n.__data__;if(!qe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ke(r)}return n.set(e,t),this.size=n.size,this};var rt=Object.prototype.propertyIsEnumerable,ot=Object.getOwnPropertySymbols,it=ot?function(e){return null==e?[]:(e=Object(e),function(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}(ot(e),function(t){return rt.call(e,t)}))}:function(){return[]};function at(e){return function(e,t,n){var r=t(e);return R(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Me,it)}var st=te(v,"DataView"),lt=te(v,"Promise"),ct=te(v,"Set"),ut="[object Map]",dt="[object Promise]",pt="[object Set]",ht="[object WeakMap]",ft="[object DataView]",gt=V(st),mt=V(qe),vt=V(lt),bt=V(ct),yt=V(ne),wt=k;(st&&wt(new st(new ArrayBuffer(1)))!=ft||qe&&wt(new qe)!=ut||lt&&wt(lt.resolve())!=dt||ct&&wt(new ct)!=pt||ne&&wt(new ne)!=ht)&&(wt=function(e){var t=k(e),n="[object Object]"==t?e.constructor:void 0,r=n?V(n):"";if(r)switch(r){case gt:return ft;case mt:return ut;case vt:return dt;case bt:return pt;case yt:return ht}return t});var xt=wt,_t=v.Uint8Array;function Ct(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ke;++t<n;)this.add(e[t])}function Et(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)}Ct.prototype.add=Ct.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ct.prototype.has=function(e){return this.__data__.has(e)};function St(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),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=2&n?new Ct:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var f=e[d],g=t[d];if(r)var m=a?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Et(t,function(e,t){if(!kt(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function At(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Rt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var jt=b?b.prototype:void 0,Dt=jt?jt.valueOf:void 0;var Ot=Object.prototype.hasOwnProperty;var Tt="[object Arguments]",Mt="[object Array]",It="[object Object]",Nt=Object.prototype.hasOwnProperty;function $t(e,t,n,r,o,i){var a=R(e),s=R(t),l=a?Mt:xt(e),c=s?Mt:xt(t),u=(l=l==Tt?It:l)==It,d=(c=c==Tt?It:c)==It,p=l==c;if(p&&be(e)){if(!be(t))return!1;a=!0,u=!1}if(p&&!u)return i||(i=new nt),a||Se(e)?St(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 ie(+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=At;case"[object Set]":var l=1&r;if(s||(s=Rt),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=St(s(e),s(t),r,o,i,a);return a.delete(e),u;case"[object Symbol]":if(Dt)return Dt.call(e)==Dt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&Nt.call(e,"__wrapped__"),f=d&&Nt.call(t,"__wrapped__");if(h||f){var g=h?e.value():e,m=f?t.value():t;return i||(i=new nt),o(g,m,n,r,i)}}return!!p&&(i||(i=new nt),function(e,t,n,r,o,i){var a=1&n,s=at(e),l=s.length;if(l!=at(t).length&&!a)return!1;for(var c=l;c--;){var u=s[c];if(!(a?u in t:Ot.call(t,u)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var f=a;++c<l;){var g=e[u=s[c]],m=t[u];if(r)var v=a?r(m,g,u,t,e,i):r(g,m,u,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){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 Lt(e,t,n,r,o){return e===t||(null==e||null==t||!S(e)&&!S(t)?e!=e&&t!=t:$t(e,t,n,r,Lt,o))}function Wt(e){return e==e&&!N(e)}function Pt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function zt(e){var t=function(e){for(var t=Me(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Wt(o)]}return t}(e);return 1==t.length&&t[0][2]?Pt(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],u=s[1];if(a&&s[2]){if(void 0===c&&!(l in e))return!1}else{var d=new nt;if(r)var p=r(c,u,l,e,t,d);if(!(void 0===p?Lt(u,c,3,r,d):p))return!1}}return!0}(n,e,t)}}function Bt(e,t){return null!=e&&t in Object(e)}function Ft(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Ge(t,e)).length,i=!1;++r<o;){var a=Ze(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ae(o)&&oe(a,o)&&(R(e)||fe(e))}(e,t,Bt)}function Ht(e){return $e(e)?function(e){return function(t){return null==t?void 0:t[e]}}(Ze(e)):function(e){return function(t){return et(t,e)}}(e)}function qt(e){return"function"==typeof e?e:null==e?B:"object"==typeof e?R(e)?(t=e[0],n=e[1],$e(t)&&Wt(n)?Pt(Ze(t),n):function(e){var r=tt(e,t);return void 0===r&&r===n?Ft(e,t):Lt(n,r,3)}):zt(e):Ht(e);var t,n}var Ut,Kt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[Ut?a:++r];if(!1===t(o[s],s,o))break}return e},Vt=Kt;function Yt(e,t){return e&&Vt(e,t,Me)}var Xt=function(){return v.Date.now()},Jt=Math.max,Qt=Math.min;function Gt(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!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 f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function g(){var e=Xt();if(f(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?Qt(n,i-(e-c)):n}(e))}function m(e){return s=void 0,p&&r?h(e):(r=o=void 0,a)}function v(){var e=Xt(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(g,t),u?h(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Jt(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:m(Xt())},v}var Zt=Object.prototype.hasOwnProperty;function en(e){if(null==e)return!0;if(se(e)&&(R(e)||"string"==typeof e||"function"==typeof e.splice||be(e)||Se(e)||fe(e)))return!e.length;var t=xt(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(ce(e))return!Te(e).length;for(var n in e)if(Zt.call(e,n))return!1;return!0}function tn(e,t){return Lt(e,t)}var nn,rn,on,an={"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},sn={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},ln=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},cn=ln,un=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,dn="undefined"==typeof document?{}:document.documentElement.style,pn=(nn=function(){for(var e in dn)if(un.test(e))return e.match(un)[0];return"WebkitOpacity"in dn?"Webkit":"KhtmlOpacity"in dn?"Khtml":""}(),rn=nn.toLowerCase(),{style:nn,css:"-"+rn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[nn]||cn(nn)}),hn=function(e,t){return t?t.toUpperCase():""},fn=/[-\s]+(.)?/g,gn=function(e){return e?e.replace(fn,hn):""},mn=/::/g,vn=/([A-Z]+)([A-Z][a-z])/g,bn=/([a-z\d])([A-Z])/g,yn=/_/g,wn=function(e,t){return e?e.replace(mn,"/").replace(vn,"$1_$2").replace(bn,"$1_$2").replace(yn,t||"-"):""},xn=function(e){return wn(e).toLowerCase()},_n=gn,Cn=xn,En=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},kn=ln,Sn=pn,An=an,Rn="undefined"==typeof document?{}:document.documentElement.style,jn=function(e,t){t=t||{};var n=En(_n(e)),r=Cn(e),o=on?n:r,i=Sn.style?on?Sn.style:Sn.css:"";if(n in Rn)return t.asString?o:[o];var a=o,s=An[r],l=[];if(on&&(a=kn(o)),"function"==typeof s){var c=s(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return on?En(_n(e)):Cn(e)})),l=l.concat(c)}return i&&l.push(i+a),l.push(o),t.asString||1==l.length?l[0]:l},Dn=Object.prototype.hasOwnProperty,On=function(e,t){return Dn.call(e,t)},Tn=Object.prototype.toString,Mn=Object.prototype.toString,In=jn,Nn=xn,$n=gn,Ln=On,Wn=function(e){return!!e&&"[object Object]"===Tn.call(e)},Pn=function(e){return"[object Function]"===Mn.apply(e)},zn=function(e,t,n,r){In(t).forEach(function(t){e[r?r(t):t]=n})},Bn={cssUnitless:sn},Fn=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||Bn).cssUnitless=t.cssUnitless||Bn.cssUnitless,r=r||{};var o,i,a,s,l,c,u,d,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,f=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},g=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?$n:Nn;for(a in e)if(Ln(e,a)){if(s=e[a],i=Nn(n?n+a:a),o=!1,d=!1,Pn(s)&&(u=s.call(p||e,s,a,i,e),Wn(u)&&null!=u.value?(s=u.value,d=u.prefix,i=u.name?Nn(u.name):i):s=u),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,d=s.prefix,s=s.value),o){if(d=d||!!m[i],c&&(s=h&&!(i in f)?s+g: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){d?zn(r,e,s,v):r[v(e)]=s});continue}d?zn(r,i,s,v):r[v(i)]=s}else Fn(s,t,i+"-",r)}return r},Hn=Fn,qn=On,Un={prefixProperties:an,cssUnitless:sn,object:Fn,string:function(e,t){e=Hn(e,t);var n,r=[];for(n in e)qn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Kn=e("@pie-lib:mask-markup:serialization"),Vn=["span"],Yn=["em","strong","u"],Xn=(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),Un.object(r,{camelize:!0,addUnits:!1});var r},Jn=["border","class","style"],Qn={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},Gn=(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=Qn[r];if(o){Kn("[deserialize] mark: ",o);return{_flatten:!0,nodes:Zn(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=Jn.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=Xn(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=>Vn.includes(e)?"inline":Yn.includes(e)?"mark":"block")(r),l=Zn(e.childNodes,t);return{object:s,type:r,data:{dataset:{...e.dataset},attributes:{...a}},nodes:l}}var n;return null},Zn=(e,t=[])=>{const n=[];for(let r=0;r<e.length;r++){const o=Gn(e[r],t);null!==o&&(o._flatten&&o.nodes?n.push(...o.nodes):n.push(o))}return n},er=t,tr=n,{styled:nr}=r,{renderMath:rr}=p;const or=nr("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),ir=nr("span")(()=>({display:"inline-block",width:".75em"})),ar=["tbody","tr"],sr=(e,t,n,r,o,i)=>{if(!t)return null;const a=[];return(e.nodes||[]).forEach((e,i)=>{const s=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return a.push(er.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),a;if(r){const o=r(e,t,n);if(o){const t="blank"===function(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}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&a.push(er.createElement(ir,{key:`spacer-${i}`})),a.push(o),void(t&&a.push(er.createElement(ir,{key:`spacer-${i}`})))}}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&&ar.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>tt(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in Qn)if(Qn[e]===n.type){const n=e;a.push(er.createElement(n,{key:s},t));break}}else t.length>0&&a.push(t)}else{const o=sr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)a.push(er.createElement(or,{key:s},o));else{const t=e.type;e.nodes&&e.nodes.length>0?a.push(er.createElement(t,{key:s,...e.data.attributes},o)):a.push(er.createElement(t,{key:s,...e.data.attributes}))}}}),a},lr=nr("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class cr extends er.Component{constructor(e){super(e),cr.prototype.__init.call(this),this.internalContainerRef=er.createRef()}static __initStatic(){this.propTypes={renderChildren:tr.func,layout:tr.object,value:tr.object,onChange:tr.func,elementType:tr.string,containerRef:tr.oneOfType([tr.func,tr.shape({current:tr.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof rr&&rr(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=sr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return er.createElement(lr,{ref:i},o)}}cr.__initStatic();const ur=/\{\{(\d+)\}\}/g;const dr=t,pr=n;var hr;const fr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(ur,(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=Zn(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},gr=(e,t)=>((hr=class extends dr.Component{static __initStatic(){this.propTypes={markup:pr.string,layout:pr.object,value:pr.object,onChange:pr.func,customMarkMarkupComponent:pr.func,elementType:pr.string}}constructor(e){super(e),this.containerRef=dr.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||fr(n,e);return dr.createElement(cr,{containerRef:this.containerRef,elementType:a,layout:s,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),hr),{useMemo:mr}=t,{useLayoutEffect:vr}=t,{useEffect:br}=t,{useRef:yr}=t,{useCallback:wr}=t,xr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function _r(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Cr(e){return"nodeType"in e}function Er(e){var t,n;return e?_r(e)?e:Cr(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function kr(e){const{Document:t}=Er(e);return e instanceof t}function Sr(e){return!_r(e)&&e instanceof Er(e).HTMLElement}function Ar(e){return e instanceof Er(e).SVGElement}function Rr(e){return e?_r(e)?e.document:Cr(e)?kr(e)?e:Sr(e)||Ar(e)?e.ownerDocument:document:document:document}const jr=xr?vr:br;function Dr(e){const t=yr(e);return jr(()=>{t.current=e}),wr(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 Or(e,t){void 0===t&&(t=[e]);const n=yr(e);return jr(()=>{n.current!==e&&(n.current=e)},t),n}function Tr(e,t){const n=yr();return mr(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Mr(e){const t=Dr(e),n=yr(null),r=wr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function Ir(e){const t=yr();return br(()=>{t.current=e},[e]),t.current}let Nr={};function $r(e,t){return mr(()=>{if(t)return t;const n=null==Nr[e]?0:Nr[e]+1;return Nr[e]=n,e+"-"+n},[e,t])}function Lr(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 Wr=Lr(1),Pr=Lr(-1);function zr(e){if(!e)return!1;const{KeyboardEvent:t}=Er(e.target);return t&&e instanceof t}function Br(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Er(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 Fr=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[Fr.Translate.toString(e),Fr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Hr="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qr(e){return e.matches(Hr)?e:e.querySelector(Hr)}const Ur=t,{useState:Kr}=t,{useCallback:Vr}=t,Yr={display:"none"};function Xr(e){let{id:t,value:n}=e;return Ur.createElement("div",{id:t,style:Yr},n)}function Jr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return Ur.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 Qr=t,{createContext:Gr}=t,{useContext:Zr}=t,{useEffect:eo}=t,{useState:to}=t,{useCallback:no}=t,{useMemo:ro}=t,{useRef:oo}=t,{memo:io}=t,{useReducer:ao}=t,{cloneElement:so}=t,{forwardRef:lo}=t,{createPortal:co}=o,{unstable_batchedUpdates:uo}=o,po=Gr(null);const ho={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 "},fo={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 go(e){let{announcements:t=fo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ho}=e;const{announce:i,announcement:a}=function(){const[e,t]=Kr("");return{announce:Vr(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=$r("DndLiveRegion"),[l,c]=to(!1);if(eo(()=>{c(!0)},[]),function(e){const t=Zr(po);eo(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(ro(()=>({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 u=Qr.createElement(Qr.Fragment,null,Qr.createElement(Xr,{id:r,value:o.draggable}),Qr.createElement(Jr,{id:s,announcement:a}));return n?co(u,n):u}var mo;function vo(){}!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"}(mo||(mo={}));const bo=Object.freeze({x:0,y:0});function yo(e,t){const n=Br(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function wo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function xo(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 _o=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=xo(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(wo)};function Co(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:bo}const Eo=(ko=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+ko*t.y,bottom:e.bottom+ko*t.y,left:e.left+ko*t.x,right:e.right+ko*t.x}),{...e})});var ko;function So(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 Ao={ignoreTransform:!1};function Ro(e,t){void 0===t&&(t=Ao);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=Er(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=So(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)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,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 jo(e){return Ro(e,{ignoreTransform:!0})}function Do(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(kr(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Sr(o)||Ar(o))return n;if(n.includes(o))return n;const i=Er(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=Er(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=Er(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Oo(e){const[t]=Do(e,1);return null!=t?t:null}function To(e){return xr&&e?_r(e)?e:Cr(e)?kr(e)||e===Rr(e).scrollingElement?window:Sr(e)?e:null:null:null}function Mo(e){return _r(e)?e.scrollX:e.scrollLeft}function Io(e){return _r(e)?e.scrollY:e.scrollTop}function No(e){return{x:Mo(e),y:Io(e)}}var $o;function Lo(e){return!(!xr||!e)&&e===document.scrollingElement}function Wo(e){const t={x:0,y:0},n=Lo(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"}($o||($o={}));const Po={x:.2,y:.2};function zo(e,t,n,r,o){let{top:i,left:a,right:s,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Po);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Wo(e),h={x:0,y:0},f={x:0,y:0},g=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+g?(h.y=$o.Backward,f.y=r*Math.abs((t.top+g-i)/g)):!u&&l>=t.bottom-g&&(h.y=$o.Forward,f.y=r*Math.abs((t.bottom-g-l)/g)),!p&&s>=t.right-m?(h.x=$o.Forward,f.x=r*Math.abs((t.right-m-s)/m)):!d&&a<=t.left+m&&(h.x=$o.Backward,f.x=r*Math.abs((t.left+m-a)/m)),{direction:h,speed:f}}function Bo(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 Fo(e){return e.reduce((e,t)=>Wr(e,No(t)),bo)}function Ho(e,t){if(void 0===t&&(t=Ro),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Oo(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const qo=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Mo(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Io(t),0)}]];class Uo{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=Do(t),r=Fo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of qo)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 Ko{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 Vo(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 Yo,Xo;function Jo(e){e.preventDefault()}function Qo(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"}(Yo||(Yo={})),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"}(Xo||(Xo={}));const Go={start:[Xo.Space,Xo.Enter],cancel:[Xo.Esc],end:[Xo.Space,Xo.Enter,Xo.Tab]},Zo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Xo.Right:return{...n,x:n.x+25};case Xo.Left:return{...n,x:n.x-25};case Xo.Down:return{...n,y:n.y+25};case Xo.Up:return{...n,y:n.y-25}}};class ei{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 Ko(Rr(t)),this.windowListeners=new Ko(Er(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Yo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ho(n),t(bo)}handleKeyDown(e){if(zr(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=Go,coordinateGetter:i=Zo,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}:bo;this.referenceCoordinates||(this.referenceCoordinates=c);const u=i(e,{active:t,context:n.current,currentCoordinates:c});if(u){const t=Pr(u,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:d,minScroll:p}=Wo(n),h=Bo(n),f={x:Math.min(o===Xo.Right?h.right-h.width/2:h.right,Math.max(o===Xo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Xo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Xo.Down?h.top:h.top+h.height/2,u.y))},g=o===Xo.Right&&!s||o===Xo.Left&&!l,m=o===Xo.Down&&!c||o===Xo.Up&&!i;if(g&&f.x!==u.x){const e=n.scrollLeft+t.x,i=o===Xo.Right&&e<=d.x||o===Xo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});r.x=i?n.scrollLeft-e:o===Xo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(m&&f.y!==u.y){const e=n.scrollTop+t.y,i=o===Xo.Down&&e<=d.y||o===Xo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});r.y=i?n.scrollTop-e:o===Xo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,Wr(Pr(u,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 ti(e){return Boolean(e&&"distance"in e)}function ni(e){return Boolean(e&&"delay"in e)}ei.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Go,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 ri{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=Er(e);return e instanceof t?e:Rr(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=Rr(i),this.documentListeners=new Ko(this.document),this.listeners=new Ko(n),this.windowListeners=new Ko(Er(i)),this.initialCoordinates=null!=(r=Br(o))?r:bo,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(Yo.Resize,this.handleCancel),this.windowListeners.add(Yo.DragStart,Jo),this.windowListeners.add(Yo.VisibilityChange,this.handleCancel),this.windowListeners.add(Yo.ContextMenu,Jo),this.documentListeners.add(Yo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ni(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ti(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(Yo.Click,Qo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Yo.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=Br(e))?t:bo,l=Pr(r,s);if(!n&&a){if(ti(a)){if(null!=a.tolerance&&Vo(l,a.tolerance))return this.handleCancel();if(Vo(l,a.distance))return this.handleStart()}return ni(a)&&Vo(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===Xo.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const oi={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ii extends ri{constructor(e){const{event:t}=e,n=Rr(t.target);super(e,oi,n)}}ii.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 ai={move:{name:"mousemove"},end:{name:"mouseup"}};var si;!function(e){e[e.RightClick=2]="RightClick"}(si||(si={}));(class extends ri{constructor(e){super(e,ai,Rr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==si.RightClick&&(null==r||r({event:n}),!0)}}];const li={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var ci,ui;function di(e){let{acceleration:t,activator:n=ci.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:a=5,order:s=ui.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=Ir(t);return Tr(e=>{if(n||!r||!e)return pi;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[$o.Backward]:e.x[$o.Backward]||-1===o.x,[$o.Forward]:e.x[$o.Forward]||1===o.x},y:{[$o.Backward]:e.y[$o.Backward]||-1===o.y,[$o.Forward]:e.y[$o.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[f,g]=function(){const e=yr(null);return[wr((t,n)=>{e.current=setInterval(t,n)},[]),wr(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=oo({x:0,y:0}),v=oo({x:0,y:0}),b=ro(()=>{switch(n){case ci.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ci.DraggableRect:return o}},[n,o,l]),y=oo(null),w=no(()=>{const e=y.current;if(!e)return;const t=m.current.x*v.current.x,n=m.current.y*v.current.y;e.scrollBy(t,n)},[]),x=ro(()=>s===ui.TreeOrder?[...c].reverse():c,[s,c]);eo(()=>{if(i&&c.length&&b){for(const e of x){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:s}=zo(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 g(),y.current=e,f(w,a),m.current=s,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,w,r,g,i,a,JSON.stringify(b),JSON.stringify(h),f,c,x,u,JSON.stringify(p)])}(class extends ri{constructor(e){super(e,li)}static setup(){return window.addEventListener(li.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(li.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"}(ci||(ci={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ui||(ui={}));const pi={x:{[$o.Backward]:!1,[$o.Forward]:!1},y:{[$o.Backward]:!1,[$o.Forward]:!1}};var hi,fi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(hi||(hi={})),function(e){e.Optimized="optimized"}(fi||(fi={}));const gi=new Map;function mi(e,t){return Tr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function vi(e){let{callback:t,disabled:n}=e;const r=Dr(t),o=ro(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return eo(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function bi(e){return new Uo(Ro(e),e)}function yi(e,t,n){void 0===t&&(t=bi);const[r,o]=to(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=Dr(t),o=ro(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return eo(()=>()=>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=vi({callback:i});return jr(()=>{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 wi=[];function xi(e,t){void 0===t&&(t=[]);const n=oo(null);return eo(()=>{n.current=null},t),eo(()=>{const t=e!==bo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Pr(e,n.current):bo}function _i(e){return ro(()=>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 Ci=[];function Ei(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Sr(t)?t:e}const ki=[{sensor:ii,options:{}},{sensor:ei,options:{}}],Si={current:{}},Ai={draggable:{measure:jo},droppable:{measure:jo,strategy:hi.WhileDragging,frequency:fi.Optimized},dragOverlay:{measure:Ro}};class Ri 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 ji={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ri,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:vo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ai,measureDroppableContainers:vo,windowRect:null,measuringScheduled:!1},Di={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vo,draggableNodes:new Map,over:null,measureDroppableContainers:vo},Oi=Gr(Di),Ti=Gr(ji);function Mi(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ri}}}function Ii(e,t){switch(t.type){case mo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case mo.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 mo.DragEnd:case mo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ri(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case mo.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 Ri(e.droppable.containers);return a.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case mo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ri(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ni(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=Zr(Oi),i=Ir(r),a=Ir(null==n?void 0:n.id);return eo(()=>{if(!t&&!r&&i&&null!=a){if(!zr(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=qr(e);if(t){t.focus();break}}})}},[r,t,o,a,i]),null}function $i(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const Li=Gr({...bo,scaleX:1,scaleY:1});var Wi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Wi||(Wi={})),io(function(e){var t,n,r,o;let{id:i,accessibility:a,autoScroll:s=!0,children:l,sensors:c=ki,collisionDetection:u=_o,measuring:d,modifiers:p,...h}=e;const f=ao(Ii,void 0,Mi),[g,m]=f,[v,b]=function(){const[e]=to(()=>new Set),t=no(t=>(e.add(t),()=>e.delete(t)),[e]);return[no(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,w]=to(Wi.Uninitialized),x=y===Wi.Initialized,{draggable:{active:_,nodes:C,translate:E},droppable:{containers:k}}=g,S=null!=_?C.get(_):null,A=oo({initial:null,translated:null}),R=ro(()=>{var e;return null!=_?{id:_,data:null!=(e=null==S?void 0:S.data)?e:Si,rect:A}:null},[_,S]),j=oo(null),[D,O]=to(null),[T,M]=to(null),I=Or(h,Object.values(h)),N=$r("DndDescribedBy",i),$=ro(()=>k.getEnabled(),[k]),L=ro(()=>({draggable:{...Ai.draggable,...null==W?void 0:W.draggable},droppable:{...Ai.droppable,...null==W?void 0:W.droppable},dragOverlay:{...Ai.dragOverlay,...null==W?void 0:W.dragOverlay}}),[null==(W=d)?void 0:W.draggable,null==W?void 0:W.droppable,null==W?void 0:W.dragOverlay]);var W;const{droppableRects:P,measureDroppableContainers:z,measuringScheduled:B}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,a]=to(null),{frequency:s,measure:l,strategy:c}=o,u=oo(e),d=function(){switch(c){case hi.Always:return!1;case hi.BeforeDragging:return n;default:return!n}}(),p=Or(d),h=no(function(e){void 0===e&&(e=[]),p.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=oo(null),g=Tr(t=>{if(d&&!n)return gi;if(!t||t===gi||u.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 Uo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return eo(()=>{u.current=e},[e]),eo(()=>{d||h()},[n,d]),eo(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),eo(()=>{d||"number"!=typeof s||null!==f.current||(f.current=setTimeout(()=>{h(),f.current=null},s))},[s,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:x,dependencies:[E.x,E.y],config:L.droppable}),F=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Tr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(C,_),H=ro(()=>T?Br(T):null,[T]),q=function(){const e=!1===(null==D?void 0:D.autoScrollEnabled),t="object"==typeof s?!1===s.enabled:!1===s,n=x&&!e&&!t;if("object"==typeof s)return{...s,enabled:n};return{enabled:n}}(),U=function(e,t){return mi(e,t)}(F,L.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=oo(!1),{x:a,y:s}="boolean"==typeof o?{x:o,y:o}:o;jr(()=>{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=Co(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=Oo(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,a,s,r,n])}({activeNode:null!=_?C.get(_):null,config:q.layoutShiftCompensation,initialRect:U,measure:L.draggable.measure});const K=yi(F,L.draggable.measure,U),V=yi(F?F.parentElement:null),Y=oo({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:k,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),X=k.getNodeFor(null==(t=Y.current.over)?void 0:t.id),J=function(e){let{measure:t}=e;const[n,r]=to(null),o=vi({callback:no(e=>{for(const{target:n}of e)if(Sr(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=no(e=>{const n=Ei(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[a,s]=Mr(i);return ro(()=>({nodeRef:a,rect:n,setRef:s}),[n,a,s])}({measure:L.dragOverlay.measure}),Q=null!=(n=J.nodeRef.current)?n:F,G=x?null!=(r=J.rect)?r:K:null,Z=Boolean(J.nodeRef.current&&J.rect),ee=Co(te=Z?null:K,mi(te));var te;const ne=_i(Q?Er(Q):null),re=function(e){const t=oo(e),n=Tr(n=>e?n&&n!==wi&&e&&t.current&&e.parentNode===t.current.parentNode?n:Do(e):wi,[e]);return eo(()=>{t.current=e},[e]),n}(x?null!=X?X:F:null),oe=function(e,t){void 0===t&&(t=Ro);const[n]=e,r=_i(n?Er(n):null),[o,i]=to(Ci);function a(){i(()=>e.length?e.map(e=>Lo(e)?r:new Uo(t(e),e)):Ci)}const s=vi({callback:a});return jr(()=>{null==s||s.disconnect(),a(),e.forEach(e=>null==s?void 0:s.observe(e))},[e]),o}(re),ie=$i(p,{transform:{x:E.x-ee.x,y:E.y-ee.y,scaleX:1,scaleY:1},activatorEvent:T,active:R,activeNodeRect:K,containerNodeRect:V,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:J.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),ae=H?Wr(H,E):null,se=function(e){const[t,n]=to(null),r=oo(e),o=no(e=>{const t=To(e.target);t&&n(e=>e?(e.set(t,No(t)),new Map(e)):null)},[]);return eo(()=>{const t=r.current;if(e!==t){i(t);const a=e.map(e=>{const t=To(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,No(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=To(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),ro(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Wr(e,t),bo):Fo(e):bo,[e,t])}(re),le=xi(se),ce=xi(se,[K]),ue=Wr(ie,le),de=G?Eo(G,ie):null,pe=R&&de?u({active:R,collisionRect:de,droppableRects:P,droppableContainers:$,pointerCoordinates:ae}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[fe,ge]=to(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(Z?ie:Wr(ie,ce),null!=(o=null==fe?void 0:fe.rect)?o:null,K),ve=oo(null),be=no((e,t)=>{let{sensor:n,options:r}=t;if(null==j.current)return;const o=C.get(j.current);if(!o)return;const i=e.nativeEvent,a=new n({active:j.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=I.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!C.get(e))return;const{onDragPending:o}=I.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=j.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:r}=I.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:A}};uo(()=>{null==r||r(o),w(Wi.Initializing),m({type:mo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),O(ve.current),M(i)})},onMove(e){m({type:mo.DragMove,coordinates:e})},onEnd:s(mo.DragEnd),onCancel:s(mo.DragCancel)});function s(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let a=null;if(t&&o){const{cancelDrop:s}=I.current;if(a={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===mo.DragEnd&&"function"==typeof s){await Promise.resolve(s(a))&&(e=mo.DragCancel)}}j.current=null,uo(()=>{m({type:e}),w(Wi.Uninitialized),ge(null),O(null),M(null),ve.current=null;const t=e===mo.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=I.current[t];null==e||e(a),v({type:t,event:a})}})}}ve.current=a},[C]),ye=no((e,t)=>(n,r)=>{const o=n.nativeEvent,i=C.get(r);if(null!==j.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(n,t.options,a)&&(o.dndKit={capturedBy:t.sensor},j.current=r,be(n,t))},[C,be]),we=function(e,t){return ro(()=>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){eo(()=>{if(!xr)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),jr(()=>{K&&y===Wi.Initializing&&w(Wi.Initialized)},[K,y]),eo(()=>{const{onDragMove:e}=I.current,{active:t,activatorEvent:n,collisions:r,over:o}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:r,delta:{x:ue.x,y:ue.y},over:o};uo(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),eo(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==j.current||!t||!o)return;const{onDragOver:i}=I.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};uo(()=>{ge(s),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),jr(()=>{Y.current={activatorEvent:T,active:R,activeNode:F,collisionRect:de,collisions:pe,droppableRects:P,draggableNodes:C,draggingNode:Q,draggingNodeRect:G,droppableContainers:k,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:ue},A.current={initial:G,translated:de}},[R,F,pe,de,C,Q,G,P,k,fe,re,ue]),di({...q,delta:E,draggingRect:de,pointerCoordinates:ae,scrollableAncestors:re,scrollableAncestorRects:oe});const xe=ro(()=>({active:R,activeNode:F,activeNodeRect:K,activatorEvent:T,collisions:pe,containerNodeRect:V,dragOverlay:J,draggableNodes:C,droppableContainers:k,droppableRects:P,over:fe,measureDroppableContainers:z,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:L,measuringScheduled:B,windowRect:ne}),[R,F,K,T,pe,V,J,C,k,P,fe,z,re,oe,L,B,ne]),_e=ro(()=>({activatorEvent:T,activators:we,active:R,activeNodeRect:K,ariaDescribedById:{draggable:N},dispatch:m,draggableNodes:C,over:fe,measureDroppableContainers:z}),[T,we,R,K,m,N,C,fe,z]);return Qr.createElement(po.Provider,{value:b},Qr.createElement(Oi.Provider,{value:_e},Qr.createElement(Ti.Provider,{value:xe},Qr.createElement(Li.Provider,{value:me},l)),Qr.createElement(Ni,{disabled:!1===(null==a?void 0:a.restoreFocus)})),Qr.createElement(go,{...a,hiddenTextDescribedById:N}))});const Pi=Gr(null),zi="button";function Bi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$r("Draggable"),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=Zr(Oi),{role:h=zi,roleDescription:f="draggable",tabIndex:g=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=Zr(m?Li:Pi),[b,y]=Mr(),[w,x]=Mr(),_=function(e,t){return ro(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(a,t),C=Or(n);jr(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:w,data:C}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:ro(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!m||h!==zi)||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,h,g,m,f,u.draggable]),isDragging:m,listeners:r?void 0:_,node:b,over:p,setNodeRef:y,setActivatorNodeRef:x,transform:v}}const Fi={timeout:25};function Hi(e){let{animation:t,children:n}=e;const[r,o]=to(null),[i,a]=to(null),s=Ir(n);return n||r||!s||o(s),jr(()=>{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]),Qr.createElement(Qr.Fragment,null,n,r?so(r,{ref:a}):null)}const qi={x:0,y:0,scaleX:1,scaleY:1};function Ui(e){let{children:t}=e;return Qr.createElement(Oi.Provider,{value:Di},Qr.createElement(Li.Provider,{value:qi},t))}const Ki={position:"fixed",touchAction:"none"},Vi=e=>zr(e)?"transform 250ms ease":void 0,Yi=lo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:a,rect:s,style:l,transform:c,transition:u=Vi}=e;if(!s)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Ki,width:s.width,height:s.height,top:s.top,left:s.left,transform:Fr.Transform.toString(d),transformOrigin:o&&r?yo(r,s):void 0,transition:"function"==typeof u?u(r):u,...l};return Qr.createElement(n,{className:a,style:p,ref:t},i)}),Xi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Fr.Transform.toString(t)},{transform:Fr.Transform.toString(n)}]},sideEffects:(Ji={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Ji;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 Ji;function Qi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Dr((e,i)=>{if(null===t)return;const a=n.get(e);if(!a)return;const s=a.node.current;if(!s)return;const l=Ei(i);if(!l)return;const{transform:c}=Er(i).getComputedStyle(i),u=So(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Xi,...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},u={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},d={x:s.x-c.x,y:s.y-c.y,...u},p=o({...l,active:i,dragOverlay:a,transform:{initial:s,final:d}}),[h]=p,f=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(f))return;const g=null==r?void 0:r({active:i,dragOverlay:a,...l}),m=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==g||g(),e()}})}}(t);return Ho(s,o.draggable.measure),d({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:u})})}let Gi=0;function Zi(e){return ro(()=>{if(null!=e)return Gi++,Gi},[e])}const ea=Qr.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:u,active:d,activeNodeRect:p,containerNodeRect:h,draggableNodes:f,droppableContainers:g,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:w,windowRect:x}=Zr(Ti),_=Zr(Li),C=Zi(null==d?void 0:d.id),E=$i(a,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:w,transform:_,windowRect:x}),k=mi(p),S=Qi({config:r,draggableNodes:f,droppableContainers:g,measuringConfiguration:b}),A=k?m.setRef:void 0;return Qr.createElement(Ui,null,Qr.createElement(Hi,{animation:S},d&&C?Qr.createElement(Yi,{key:C,id:d.id,ref:A,as:s,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:k,style:{zIndex:c,...o},transform:E},n):null))}),ta=t,{useEffect:na}=t,{useRef:ra}=t,oa=n,{styled:ia}=r,{Chip:aa}=i,{color:sa}=a,{renderMath:la}=p;function ca(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 ua=ia("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&&{}})),da=ia(aa)(()=>({backgroundColor:sa.white(),border:`1px solid ${sa.text()}`,color:sa.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}})),pa=ia("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"},"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{fontSize:"120% !important"}}));function ha({choice:e,disabled:t,instanceId:n}){const r=ra(null),{attributes:o,listeners:i,setNodeRef:a,isDragging:s}=Bi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return na(()=>{la(r.current)},[e.value]),ta.createElement(ua,{ref:a,style:s?{width:ca([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth])||90,height:ca([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])||32}:{},disabled:t,...i,...o},ta.createElement(da,{clickable:!1,disabled:t,ref:r,label:ta.createElement(pa,{dangerouslySetInnerHTML:{__html:e.value}})}))}ha.propTypes={choice:oa.object.isRequired,disabled:oa.bool,instanceId:oa.oneOfType([oa.string,oa.number])};const fa=t,ga=n,{DragDroppablePlaceholder:ma}=f;class va extends fa.Component{constructor(...e){super(...e),va.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:ga.bool,duplicates:ga.bool,choices:ga.arrayOf(ga.shape({label:ga.string,value:ga.string})),value:ga.object,choicePosition:ga.string.isRequired,instanceId:ga.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 Yt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,qt(t=>t===e.id));return void 0===n}),a={...this.getStyleForWrapper(),minWidth:"100px"};return fa.createElement("div",{style:a},fa.createElement(ma,{disabled:e,instanceId:o},i.map((t,n)=>fa.createElement(ha,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}va.__initStatic();const ba=t,{useEffect:ya}=t,{useRef:wa}=t,{useState:xa}=t,_a=n,Ca=e,{styled:Ea}=r,{Chip:ka}=i,Sa=l,{color:Aa}=a,{grey:Ra}=s,{renderMath:ja}=p;function Da(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}Ca("pie-lib:mask-markup:blank");const Oa=Ea("span")(({dragged:e,over:t})=>({border:`solid 0px ${Aa.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Ta=Ea(ka)(()=>({backgroundColor:Aa.background(),border:`2px dashed ${Aa.text()}`,touchAction:"none",color:Aa.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ra[500]}`,backgroundColor:`${Ra[300]}`},"&.correct":{border:`solid 1px ${Aa.correct()}`},"&.incorrect":{border:`solid 1px ${Aa.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Ma=Ea("span")(()=>({whiteSpace:"normal",pointerEvents:"none","& img":{display:"block",padding:"2px 0"},"& p":{marginTop:"0",marginBottom:"0"},"& mjx-frac":{fontSize:"120% !important"},"& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn":{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 Ia({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s}){const l=wa(null),c=wa(null),u=wa(null),d=wa(!1),[p,h]=xa({height:0,width:0}),f=()=>{m()},g=()=>{const e=Da([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=f:setTimeout(()=>{m()},300)},m=()=>{if(c.current&&l.current&&!d.current){d.current=!0,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;const e=c.current.querySelector("img");if(e)return c.current.textContent.trim().length>0?c.current:e;return c.current})()||c.current,t=e.getBoundingClientRect(),n=12,r=2,o=1,i=(e.offsetWidth||t.width||0)+2*n+2*r+o,u=Math.max(e.offsetHeight||0,t.height||0,e.scrollHeight||0,c.current.scrollHeight||0)+2*n+2*r+o,p=parseFloat(a)||0,f=parseFloat(s)||0,g=i<=p?p:i,m=u<=f?f:u;h(e=>({width:g>p?g:e.width,height:m>f?m:e.height}));const v=`${g}px`,b=`${m}px`;l.current.style.width!==v&&(l.current.style.width=v),l.current.style.height!==b&&(l.current.style.height=b),d.current=!1}};ya(()=>{g()},[]),ya(()=>{if("undefined"==typeof IntersectionObserver||!l.current)return;const e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&m()},{threshold:0});return e.observe(l.current),()=>e.disconnect()},[]),ya(()=>{l.current&&ja(l.current)},[i,n,Da([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),ya(()=>{t?g():h({height:0,width:0})},[Da([t,"optionalAccess",e=>e.value])]),ya(()=>{n||r||(u.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,r]);const v=o&&n&&o.choice&&o.choice.value,b=t&&t.value,y=n||r?{width:Da([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Da([u,"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:p.height||t,width:p.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return ba.createElement(Ta,{clickable:!1,disabled:e,ref:l,component:"span",label:ba.createElement(ba.Fragment,null,ba.createElement(Ma,{ref:c,draggable:!0,className:Sa({over:n,hidden:v}),dangerouslySetInnerHTML:{__html:b||""}}),v&&ba.createElement(Ma,{draggable:!0,className:Sa({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:v||""}})),className:Sa({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:y})}function Na({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}){const{attributes:c,listeners:u,setNodeRef:d,transform:p,isDragging:h}=Bi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:f,isOver:g,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$r("Droppable"),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=Zr(Oi),u=oo({disabled:n}),d=oo(!1),p=oo(null),h=oo(null),{disabled:f,updateMeasurementsFor:g,timeout:m}={...Fi,...o},v=Or(null!=g?g:r),b=vi({callback:no(()=>{d.current?(null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},m)):d.current=!0},[m]),disabled:f||!a}),y=no((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[w,x]=Mr(y),_=Or(t);return eo(()=>{b&&w.current&&(b.disconnect(),d.current=!1,b.observe(w.current))},[w,b]),eo(()=>(s({type:mo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:_}}),()=>s({type:mo.UnregisterDroppable,key:i,id:r})),[r]),eo(()=>{n!==u.current.disabled&&(s({type:mo.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,s]),{active:a,rect:p,isOver:(null==l?void 0:l.id)===r,node:w,over:l,setNodeRef:x}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Fr.Translate.toString(p)};return ba.createElement(Oa,{ref:e=>{d(e),f(e)},style:v,dragged:h,over:g,...c,...u},ba.createElement(Ia,{id:e,disabled:t,duplicates:n,choice:r,isOver:g,dragItem:Da([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:a,emptyResponseAreaHeight:s,instanceId:l}))}Ia.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ia.propTypes={id:_a.oneOfType([_a.string,_a.number]),disabled:_a.bool,duplicates:_a.bool,choice:_a.object,isOver:_a.bool,dragItem:_a.object,correct:_a.bool,onChange:_a.func,emptyResponseAreaWidth:_a.oneOfType([_a.string,_a.number]),emptyResponseAreaHeight:_a.oneOfType([_a.string,_a.number]),instanceId:_a.string},Na.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Na.propTypes={id:_a.oneOfType([_a.string,_a.number]),disabled:_a.bool,duplicates:_a.bool,choice:_a.object,correct:_a.bool,onChange:_a.func,emptyResponseAreaWidth:_a.oneOfType([_a.string,_a.number]),emptyResponseAreaHeight:_a.oneOfType([_a.string,_a.number]),instanceId:_a.string};const $a=t,La=n,{DragProvider:Wa}=f;function Pa(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 za=gr("blank",e=>(t,n,r)=>{const o=Pa([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:u,emptyResponseAreaHeight:d,instanceId:p,isDragging:h}=e,f=c?s[o.id]:n[o.id],g=f&&e.choices.find(e=>e.id===f);return $a.createElement(Na,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:a,choice:g,id:o.id,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,onChange:(e,t)=>{const o={...n};void 0===t?delete o[e]:o[e]=t,r(o)},instanceId:p,isDragging:h})}});class Ba extends $a.Component{constructor(e){super(e),Ba.prototype.__init.call(this),Ba.prototype.__init2.call(this),Ba.prototype.__init3.call(this),Ba.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:La.string,layout:La.object,choicesPosition:La.string,choices:La.array,value:La.object,onChange:La.func,duplicates:La.bool,disabled:La.bool,feedback:La.object,correctResponse:La.object,showCorrectAnswer:La.bool,emptyResponseAreaWidth:La.oneOfType([La.string,La.number]),emptyResponseAreaHeight:La.oneOfType([La.string,La.number]),instanceId:La.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Pa([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?$a.createElement(ha,{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=Pa([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=Pa([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=!!t&&!!n&&"MaskBlank"===Pa([i,"optionalAccess",e=>e.type])&&Pa([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:u,emptyResponseAreaHeight:d,layout:p,instanceId:h}=this.props,f=o||"below",g={display:"flex",minWidth:"100px",...this.getPositionDirection(f)};return $a.createElement(Wa,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:_o},$a.createElement("div",{ref:e=>this.rootRef=e,style:g},$a.createElement(va,{choicePosition:f,choices:i,value:n,duplicates:t,disabled:s,instanceId:h}),$a.createElement(za,{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:u,emptyResponseAreaHeight:d,instanceId:h,isDragging:!!this.state.activeDragItem}),$a.createElement(ea,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Ba.__initStatic(),Ba.__initStatic2();const Fa=t,{styled:Ha}=r,qa=l,{color:Ua}=a;function Ka(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 Va,Ya;"undefined"!=typeof window&&(Va=require("@pie-lib/editable-html-tip-tap").default,Ya=Ha(Va)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${Ua.black()}`,"&.correct":{border:`1px solid ${Ua.correct()}`},"&.incorrect":{border:`1px solid ${Ua.incorrect()}`}})));gr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:a,maxLength:s,spellCheck:l,pluginProps:c,onChange:u}=e,d=Ka([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const p=(e.choices&&d&&e.choices[d.id]||[])[0],h=a?p&&p.label:n[d.id]||"",f=s&&s[d.id],g=i&&i[d.id],m=a||"correct"===g,v=!a&&"incorrect"===g,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Fa.createElement(Ya,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:a||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?f:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Ka([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:qa({correct:m,incorrect:v})})}});var Xa=gr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Ja=t,Qa=n,{Button:Ga}=i,{InputLabel:Za}=i,{Menu:es}=i,{MenuItem:ts}=i,{ArrowDropDown:ns}=c,{ArrowDropUp:rs}=c,{Close:os}=c,{Check:is}=c,{styled:as}=r,{color:ss}=a,{renderMath:ls}=p,cs=as(Ga)(()=>({color:ss.text(),border:`1px solid ${ss.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ss.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:ss.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ss.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ss.correct(),color:`${ss.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ss.incorrectWithIcon(),color:`${ss.text()} !important`}})),us=as(es)(()=>({backgroundColor:ss.background(),border:`1px solid ${ss.correct()} !important`,"&:hover":{border:`1px solid ${ss.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ss.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ds=as(ts)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ss.text(),backgroundColor:ss.background(),"&.Mui-focusVisible":{outline:`3px solid ${ss.tertiary()}`,outlineOffset:"-1px",color:ss.text(),backgroundColor:ss.background()},"&:hover":{color:ss.text(),backgroundColor:ss.dropdownBackground()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${ss.text()} !important`,backgroundColor:`${ss.background()} !important`,"&:hover":{color:ss.text(),backgroundColor:`${ss.dropdownBackground()} !important`}}})),ps=as("span")(()=>({fontSize:"max(1rem, 14px)"})),hs=as("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),fs=as(Za)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),gs=as(is)(()=>({color:`${ss.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ss.correct()},"&.incorrect":{backgroundColor:ss.incorrectWithIcon()}})),ms=as(os)(()=>({color:`${ss.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ss.correct()},"&.incorrect":{backgroundColor:ss.incorrectWithIcon()}}));class vs extends Ja.Component{static __initStatic(){this.propTypes={id:Qa.string,value:Qa.string,disabled:Qa.bool,onChange:Qa.func,correct:Qa.bool,choices:Qa.arrayOf(Qa.shape({value:Qa.string,label:Qa.string})),showCorrectAnswer:Qa.bool,singleQuery:Qa.bool,correctValue:Qa.string}}constructor(e){super(e),vs.prototype.__init.call(this),vs.prototype.__init2.call(this),vs.prototype.__init3.call(this),vs.prototype.__init4.call(this),vs.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Ja.createRef(),this.buttonRef=Ja.createRef(),this.previewRef=Ja.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||ls(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&ls(e)}),ls(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>{const{id:t,value:n,choices:r}=this.props;let o=null;if(n){const e=(r||[]).findIndex(e=>e.value===n);e>=0&&(o=`dropdown-option-${t}-${e}`)}this.setState({anchorEl:e.currentTarget,highlightedOptionId:o})}}__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),u=`dropdown-button-${e}`,d=`dropdown-menu-${e}`,p=`dropdown-value-${e}`;let h;this.elementRefs=[],n&&void 0!==t&&(h=t||i?"disabledCorrect":"disabledIncorrect");const f=parseInt(e,10)+1,g=a?"Query-label":`Query-label-${f}`,m=a?"Query":`Query ${f}`;let v=null;return n&&void 0!==t&&(v=t||i?Ja.createElement(gs,{className:"correct"}):Ja.createElement(ms,{className:"incorrect"})),Ja.createElement(Ja.Fragment,null,Ja.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Ja.createElement(ds,{key:t,tabIndex:-1,"aria-hidden":"true"},Ja.createElement(ps,{dangerouslySetInnerHTML:{__html:e.label}})))),Ja.createElement(fs,{id:g,tabIndex:-1,"aria-hidden":"true"},m),Ja.createElement(cs,{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?d:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:h,disabled:n,id:u,role:"combobox","aria-label":`Select an option for ${m}`,"aria-labelledby":p},v,Ja.createElement(ps,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:s||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Ja.createElement(rs,null):Ja.createElement(ns,null)),Ja.createElement(us,{id:d,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":u,role:"listbox",disablePadding:!0}}},(o||[]).map((t,n)=>{const o=`dropdown-option-${e}-${n}`;return Ja.createElement(ds,{id:o,className:t.value===r?"selected":"",selected:t.value===r,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)},Ja.createElement(ps,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Ja.createElement(hs,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}vs.__initStatic();const bs=t;gr("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),u=l?c&&c.value:n[o.id];return bs.createElement(vs,{key:`${t.type}-dropdown-${o.id}`,correct:s&&s[o.id]&&"correct"===s[o.id],disabled:a||l,value:u,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 ys=t,ws=n,{styled:xs}=r,{Tooltip:_s}=i,{color:Cs}=a,{Collapsible:Es}=a,{Readable:ks}=a,{hasText:Ss}=a,{hasMedia:As}=a,{PreviewPrompt:Rs}=a,{UiLayout:js}=a,Ds=u,Os=o,{mq:Ts}=h,{HorizontalKeypad:Ms}=h,{updateSpans:Is}=h,{registerEmbed:Ns}=h,{applyStaticMath:$s}=h,{renderMath:Ls}=p;function Ws(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 Ps=xs(js)({color:Cs.text(),backgroundColor:Cs.background(),display:"inline-block"}),zs=xs("div")({width:"100%",position:"relative",backgroundColor:Cs.background(),color:Cs.text()}),Bs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Fs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Hs=xs("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}}),qs=xs("div")(({theme:e,$incorrect:t,$correct:n,$showCorrectness:r,$correctAnswerShown:o})=>({maxWidth:"fit-content",...t&&{borderColor:`${Cs.incorrect()} !important`},...n&&{borderColor:`${Cs.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}}})),Us=xs(Ts.Static)({"& > .mq-root-block":{"& > .mq-editable-field":{borderColor:Cs.text()}}}),Ks=xs("div")(({theme:e})=>({zIndex:10,minWidth:"400px",marginTop:e.spacing(2)})),Vs=xs("div")(({theme:e})=>({marginBottom:e.spacing(1),pointerEvents:"none"})),Ys=xs("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"}),Xs=xs("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Js=xs(Ds)(({theme:e})=>({color:Cs.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: ${Cs.text()};\n background-color: ${Cs.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: ${Cs.correct()} !important;\n }\n .incorrect {\n border-color: ${Cs.incorrect()} !important;\n }\n `,document.head.appendChild(t)}}let Qs=!1;const Gs=/(\{\{\d+\}\})/gm,Zs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function el(e=[],t){return 30*Math.floor(e.length/5)+("miscellaneous"===t?600:500)}function tl(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]=Ws([n,"optionalAccess",e=>e[t],"optionalAccess",e=>e.answer]),e),{});return o.split(Gs).filter(e=>e).reduce((e,n)=>{if(n.match(Gs)){const o=rl.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},{})}}const nl={name:"smartHorizontalPlacement",enabled:!0,phase:"main",requires:["popperOffsets"],fn:({state:e})=>{const t=e.modifiersData.popperOffsets;if(!t)return;const n=window.innerWidth||document.documentElement.clientWidth,r=e.rects.popper.width,o=e.elements.reference.getBoundingClientRect().left,i=Ws([e,"access",e=>e.elements,"access",e=>e.popper,"optionalAccess",e=>e.offsetParent]),a=Ws([i,"optionalAccess",e=>e.getBoundingClientRect,"optionalCall",e=>e()])||{left:0},s=Ws([i,"optionalAccess",e=>e.scrollLeft])||0,l=o-a.left+s,c=l-o,u=c+8,d=c+n-r-8;t.x=o+r<=n?l:l-r,t.x=d<u?u:Math.min(Math.max(t.x,u),d)}};class rl extends ys.Component{static __initStatic(){this.getResponseKey=e=>(e||"").replaceAll("{{","").replaceAll("}}","")}static __initStatic2(){this.propTypes={session:ws.object.isRequired,onSessionChange:ws.func,model:ws.object.isRequired}}constructor(e){super(e),rl.prototype.__init.call(this),rl.prototype.__init2.call(this),rl.prototype.__init3.call(this),rl.prototype.__init4.call(this),rl.prototype.__init5.call(this),rl.prototype.__init6.call(this),rl.prototype.__init7.call(this),rl.prototype.__init8.call(this),rl.prototype.__init9.call(this),rl.prototype.__init10.call(this),rl.prototype.__init11.call(this),rl.prototype.__init12.call(this),rl.prototype.__init13.call(this);const t={},{model:n,session:r}=e||{},{markup:o,alwaysShowCorrect:i}=n||{},{answers:a}=r||{};o&&(o||"").replace(Gs,e=>{const n=rl.getResponseKey(e),r=a&&a[`r${n}`];t[`r${n}`]={value:Ws([r,"optionalAccess",e=>e.value])||""}}),this.state={session:{...e.session,answers:t},activeAnswerBlock:"",showCorrect:i||!1,tooltipContainerRef:ys.createRef()}}UNSAFE_componentWillMount(){"undefined"!=typeof window&&(Qs||(Ns("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}]`})),Qs=!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){const i=r[t];$s(n,i&&i.value||""),e.view&&(n.parentElement.parentElement.classList.remove("correct"),n.parentElement.parentElement.classList.remove("incorrect")),o.textContent="R"}}),Ls(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(Gs),u=i.match(Gs);if(!tn(c,u)){const e={},t=this.state.session.answers;(u||[]).forEach(n=>{const r=rl.getResponseKey(n),o=t&&t[`r${r}`];e[`r${r}`]={value:Ws([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=tn(this.props.model,e.model),r=tn(this.state,t);return!n||!r}componentDidMount(){this.handleAnswerBlockDomUpdate(),setTimeout(()=>Ls(this.root),100)}componentDidUpdate(){this.handleAnswerBlockDomUpdate()}__init2(){this.onSubFieldFocus=e=>{const t=Array.from(Ws([this,"access",e=>e.root,"optionalAccess",e=>e.querySelectorAll,"call",e=>e(".mq-editable-field")])||[]).map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),n=()=>{t.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n})};this.setState({activeAnswerBlock:e},()=>{n(),requestAnimationFrame(n),setTimeout(n,0)})}}__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);const n=[];let r=Ws([this,"access",e=>e.input,"optionalAccess",e=>e.el,"optionalCall",e=>e()])||this.root;for(;r&&r!==document.body&&r!==document.documentElement;){(r.scrollWidth>r.clientWidth||r.scrollHeight>r.clientHeight)&&n.push(r),r=r.parentElement}document.scrollingElement&&n.push(document.scrollingElement);const o=n.map(e=>({el:e,left:e.scrollLeft,top:e.scrollTop})),i={x:window.scrollX,y:window.scrollY},a=()=>{o.forEach(({el:e,left:t,top:n})=>{e.scrollLeft=t,e.scrollTop=n}),window.scrollTo(i.x,i.y)};this.input.focus(),a(),requestAnimationFrame(a),setTimeout(a,0)}}__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)=>{Is(),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=Ws([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&&Ws([o,"optionalAccess",e=>e.attributes,"access",e=>e["data-keypad"]])||this.setState({activeAnswerBlock:""})}}setTooltipRef(e){setTimeout(()=>{if(e&&Zs){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&&(Ss(t)||As(t)),o=ys.createElement(Rs,{defaultClassName:"teacher-instructions",prompt:t});return r&&ys.createElement(Fs,null,n?o:ys.createElement(Es,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},o))}}__init12(){this.renderRationale=()=>{const{model:e}=this.props,{rationale:t,animationsDisabled:n}=e||{},r=ys.createElement(Rs,{prompt:t});return t&&(Ss(t)||As(t))&&ys.createElement(Fs,null,n?r:ys.createElement(Es,{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:u,feedback:d,env:{mode:p}={},printMode:h,alwaysShowCorrect:f}=e||{},g=en(l),m=function(e=[]){return e.map(e=>({name:e,latex:e,write:e,label:e}))}(u),v=tl(e,this.state)||"",b=h&&!f;return ys.createElement(Hs,null,ys.createElement(Xa,{disabled:a,markup:e.markup,value:{},customMarkMarkupComponent:e=>{const l="evaluate"===p&&d&&d[e],u=ys.createElement(Us,{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 ys.createElement(qs,{ref:o,$incorrect:!g&&!l&&!n,$correct:!g&&(l||n),$showCorrectness:!g&&a&&i&&!s,$correctAnswerShown:n},ys.createElement(_s,{ref:e=>this.setTooltipRef(e),enterTouchDelay:0,interactive:!0,open:t===`r${e}`,slotProps:{popper:{container:Ws([o,"optionalAccess",e=>e.current])||void 0,placement:"bottom-start",sx:{backgroundColor:"transparent",width:"auto",opacity:1,"& .MuiTooltip-arrow":{display:"none"}},modifiers:[{name:"preventOverflow",enabled:!1},{name:"flip",enabled:!1},nl]},tooltip:{sx:{fontSize:"initial",backgroundColor:"transparent",width:"auto",maxWidth:"none",marginTop:0,paddingTop:0,boxShadow:"none"}}},title:Object.keys(r.answers).map(e=>e===t&&!(n||a)&&ys.createElement(Ks,{"data-keypad":!0,key:e,style:{width:el(m,c)}},ys.createElement(Ms,{additionalKeys:m,mode:c||6,onClick:this.onClick}))||null)},b?ys.createElement(Vs,null,u):ys.createElement("div",null,u)))}}))}}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:u}=e||{},d=!en(s)&&a&&"correct"!==a.correctness,p=(t||"view"===r&&"instructor"===o)&&c&&u;return ys.createElement(Ps,{extraCSSRules:i,ref:e=>{const t=Os.findDOMNode(e);this.root=t||this.root}},ys.createElement(zs,null,"gather"===r&&ys.createElement(Ys,null,"Math Equation Response Question"),ys.createElement(zs,null,d&&ys.createElement(Js,{language:l,show:!0,toggled:t,onToggle:this.toggleShowCorrect})),this.renderTeacherInstructions(),n&&ys.createElement(Bs,null,ys.createElement(Rs,{prompt:n})),ys.createElement(ks,{false:!0},this.renderPlayerContent()),p&&ys.createElement(Xs,{className:"note",dangerouslySetInnerHTML:{__html:u}}),this.renderRationale()))}}rl.__initStatic(),rl.__initStatic2();const ol=t,{createRoot:il}=d,al=e,{renderMath:sl}=p,ll=al("pie-element:math-templated:print");class cl extends HTMLElement{constructor(){super(),this._options=null,this._model=null,this._session=[],this._root=null,this._rerender=Gt(()=>{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&&ol.createElement(rl,{model:e,session:{}});this._root||(this._root=il(this)),this._root.render(t),queueMicrotask(()=>{ll("render complete - render math"),sl(this)})}else ll("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{cl as default};
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "7.1.11",
7
+ "version": "7.2.0",
8
8
  "description": "",
9
9
  "dependencies": {
10
10
  "@emotion/react": "^11.14.0",
@@ -12,18 +12,18 @@
12
12
  "@mui/icons-material": "^7.3.4",
13
13
  "@mui/material": "^7.3.4",
14
14
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/correct-answer-toggle": "4.0.5",
16
- "@pie-lib/mask-markup": "3.0.15",
15
+ "@pie-lib/correct-answer-toggle": "4.0.6",
16
+ "@pie-lib/mask-markup": "3.0.16",
17
17
  "@pie-lib/math-input": "8.1.1",
18
18
  "@pie-lib/math-rendering": "5.1.0",
19
- "@pie-lib/render-ui": "6.1.3",
19
+ "@pie-lib/render-ui": "7.0.0",
20
20
  "prop-types": "^15.8.1",
21
21
  "react": "18.3.1",
22
22
  "react-dom": "18.3.1"
23
23
  },
24
24
  "author": "",
25
25
  "license": "ISC",
26
- "gitHead": "0f939adae5927fe0a54d21a4a98e224775562406",
26
+ "gitHead": "e299866c75466c3c3f12469e783c129c800f24fb",
27
27
  "scripts": {
28
28
  "postpublish": "../../scripts/postpublish"
29
29
  },