@pie-element/math-templated 6.1.0-next.0 → 6.1.1-next.2

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