@pie-element/explicit-constructed-response 11.1.0-next.28 → 11.1.1-next.11

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/element.js CHANGED
@@ -1 +1 @@
1
- import{_dll_debug as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_react_dom as o,_dll_mui__material as i,_dll_pie_lib__render_ui as s,_dll_mui__material_colors as a,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as u,_dll_react_dom_client as d}from"../../../@pie-lib/shared-module@^5.2.2/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@^5.0.7/module/index.js";import{_dll_pie_lib__drag as h}from"../../../@pie-lib/drag-module@^4.0.7/module/index.js";var g={};Object.defineProperty(g,"__esModule",{value:!0});class f extends CustomEvent{constructor(e,t,n){super(f.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}f.TYPE="model-set";var m=g.ModelSetEvent=f;class v extends CustomEvent{constructor(e,t){super(v.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}v.TYPE="session-changed";var b=g.SessionChangedEvent=v,y="object"==typeof global&&global&&global.Object===Object&&global,x="object"==typeof self&&self&&self.Object===Object&&self,w=y||x||Function("return this")(),C=w.Symbol,S=Object.prototype,k=S.hasOwnProperty,A=S.toString,_=C?C.toStringTag:void 0;var O=Object.prototype.toString;var E=C?C.toStringTag:void 0;function R(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=k.call(e,_),n=e[_];try{e[_]=void 0;var r=!0}catch(e){}var o=A.call(e);return r&&(t?e[_]=n:delete e[_]),o}(e):function(e){return O.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function j(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==R(e)}var N=Array.isArray,D=C?C.prototype:void 0,P=D?D.toString:void 0;function T(e){if("string"==typeof e)return e;if(N(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,T)+"";if(j(e))return P?P.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var $=/\s/;var M=/^\s+/;function I(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&$.test(e.charAt(t)););return t}(e)+1).replace(M,""):e}function z(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var F=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,B=/^0o[0-7]+$/i,H=parseInt;function V(e){if("number"==typeof e)return e;if(j(e))return NaN;if(z(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=z(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=I(e);var n=W.test(e);return n||B.test(e)?H(e.slice(2),n?2:8):F.test(e)?NaN:+e}function U(e){return e}function K(e){if(!z(e))return!1;var t=R(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var q,Y=w["__core-js_shared__"],J=(q=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var X=Function.prototype.toString;function Q(e){if(null!=e){try{return X.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var G=/^\[object .+?Constructor\]$/,Z=Function.prototype,ee=Object.prototype,te=Z.toString,ne=ee.hasOwnProperty,re=RegExp("^"+te.call(ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(e){return!(!z(e)||(t=e,J&&J in t))&&(K(e)?re:G).test(Q(e));var t}function ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(n)?n:void 0}var se=ie(w,"WeakMap"),ae=/^(?:0|[1-9]\d*)$/;function le(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function ce(e,t){return e===t||e!=e&&t!=t}function ue(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function de(e){return null!=e&&ue(e.length)&&!K(e)}var pe=Object.prototype;function he(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||pe)}function ge(e){return L(e)&&"[object Arguments]"==R(e)}var fe=Object.prototype,me=fe.hasOwnProperty,ve=fe.propertyIsEnumerable,be=ge(function(){return arguments}())?ge:function(e){return L(e)&&me.call(e,"callee")&&!ve.call(e,"callee")};var ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,xe=ye&&"object"==typeof module&&module&&!module.nodeType&&module,we=xe&&xe.exports===ye?w.Buffer:void 0,Ce=(we?we.isBuffer:void 0)||function(){return!1},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var ke,Ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,_e=Ae&&"object"==typeof module&&module&&!module.nodeType&&module,Oe=_e&&_e.exports===Ae&&y.process,Ee=function(){try{var e=_e&&_e.require&&_e.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch(e){}}(),Re=Ee&&Ee.isTypedArray,Le=Re?(ke=Re,function(e){return ke(e)}):function(e){return L(e)&&ue(e.length)&&!!Se[R(e)]},je=Object.prototype.hasOwnProperty;function Ne(e,t){var n=N(e),r=!n&&be(e),o=!n&&!r&&Ce(e),i=!n&&!r&&!o&&Le(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=a.length;for(var c in e)!t&&!je.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||le(c,l))||a.push(c);return a}var De=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Pe=De,Te=Object.prototype.hasOwnProperty;function $e(e){if(!he(e))return Pe(e);var t=[];for(var n in Object(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Me(e){return de(e)?Ne(e):$e(e)}var Ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ze=/^\w*$/;function Fe(e,t){if(N(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!j(e))||(ze.test(e)||!Ie.test(e)||null!=t&&e in Object(t))}var We=ie(Object,"create");var Be=Object.prototype.hasOwnProperty;var He=Object.prototype.hasOwnProperty;function Ve(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 Ue(e,t){for(var n=e.length;n--;)if(ce(e[n][0],t))return n;return-1}Ve.prototype.clear=function(){this.__data__=We?We(null):{},this.size=0},Ve.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ve.prototype.get=function(e){var t=this.__data__;if(We){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Be.call(t,e)?t[e]:void 0},Ve.prototype.has=function(e){var t=this.__data__;return We?void 0!==t[e]:He.call(t,e)},Ve.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 Ke=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=Ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,!0)},qe.prototype.get=function(e){var t=this.__data__,n=Ue(t,e);return n<0?void 0:t[n][1]},qe.prototype.has=function(e){return Ue(this.__data__,e)>-1},qe.prototype.set=function(e,t){var n=this.__data__,r=Ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ye=ie(w,"Map");function Je(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 Xe(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])}}Xe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Ye||qe),string:new Ve}},Xe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Xe.prototype.get=function(e){return Je(this,e).get(e)},Xe.prototype.has=function(e){return Je(this,e).has(e)},Xe.prototype.set=function(e,t){var n=Je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Qe(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 s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Qe.Cache||Xe),n}Qe.Cache=Xe;var Ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/\\(\\)?/g,et=function(e){var t=Qe(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(Ge,function(e,n,r,o){t.push(r?o.replace(Ze,"$1"):n||e)}),t}),tt=et;function nt(e,t){return N(e)?e:Fe(e,t)?[e]:tt(function(e){return null==e?"":T(e)}(e))}function rt(e){if("string"==typeof e||j(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ot(e,t){for(var n=0,r=(t=nt(t,e)).length;null!=e&&n<r;)e=e[rt(t[n++])];return n&&n==r?e:void 0}function it(e,t,n){var r=null==e?void 0:ot(e,t);return void 0===r?n:r}function st(e){var t=this.__data__=new qe(e);this.size=t.size}st.prototype.clear=function(){this.__data__=new qe,this.size=0},st.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},st.prototype.get=function(e){return this.__data__.get(e)},st.prototype.has=function(e){return this.__data__.has(e)},st.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qe){var r=n.__data__;if(!Ye||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xe(r)}return n.set(e,t),this.size=n.size,this};var at=Object.prototype.propertyIsEnumerable,lt=Object.getOwnPropertySymbols,ct=lt?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 s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(lt(e),function(t){return at.call(e,t)}))}:function(){return[]};function ut(e){return function(e,t,n){var r=t(e);return N(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Me,ct)}var dt=ie(w,"DataView"),pt=ie(w,"Promise"),ht=ie(w,"Set"),gt="[object Map]",ft="[object Promise]",mt="[object Set]",vt="[object WeakMap]",bt="[object DataView]",yt=Q(dt),xt=Q(Ye),wt=Q(pt),Ct=Q(ht),St=Q(se),kt=R;(dt&&kt(new dt(new ArrayBuffer(1)))!=bt||Ye&&kt(new Ye)!=gt||pt&&kt(pt.resolve())!=ft||ht&&kt(new ht)!=mt||se&&kt(new se)!=vt)&&(kt=function(e){var t=R(e),n="[object Object]"==t?e.constructor:void 0,r=n?Q(n):"";if(r)switch(r){case yt:return bt;case xt:return gt;case wt:return ft;case Ct:return mt;case St:return vt}return t});var At=kt,_t=w.Uint8Array;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xe;++t<n;)this.add(e[t])}function Et(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Rt(e,t){return e.has(t)}Ot.prototype.add=Ot.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ot.prototype.has=function(e){return this.__data__.has(e)};function Lt(e,t,n,r,o,i){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))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 Ot:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var g=e[d],f=t[d];if(r)var m=s?r(f,g,d,t,e,i):r(g,f,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Et(t,function(e,t){if(!Rt(h,t)&&(g===e||o(g,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(g!==f&&!o(g,f,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Nt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Dt=C?C.prototype:void 0,Pt=Dt?Dt.valueOf:void 0;var Tt=Object.prototype.hasOwnProperty;var $t="[object Arguments]",Mt="[object Array]",It="[object Object]",zt=Object.prototype.hasOwnProperty;function Ft(e,t,n,r,o,i){var s=N(e),a=N(t),l=s?Mt:At(e),c=a?Mt:At(t),u=(l=l==$t?It:l)==It,d=(c=c==$t?It:c)==It,p=l==c;if(p&&Ce(e)){if(!Ce(t))return!1;s=!0,u=!1}if(p&&!u)return i||(i=new st),s||Le(e)?Lt(e,t,n,r,o,i):function(e,t,n,r,o,i,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new _t(e),new _t(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ce(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=jt;case"[object Set]":var l=1&r;if(a||(a=Nt),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Lt(a(e),a(t),r,o,i,s);return s.delete(e),u;case"[object Symbol]":if(Pt)return Pt.call(e)==Pt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&zt.call(e,"__wrapped__"),g=d&&zt.call(t,"__wrapped__");if(h||g){var f=h?e.value():e,m=g?t.value():t;return i||(i=new st),o(f,m,n,r,i)}}return!!p&&(i||(i=new st),function(e,t,n,r,o,i){var s=1&n,a=ut(e),l=a.length;if(l!=ut(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:Tt.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 g=s;++c<l;){var f=e[u=a[c]],m=t[u];if(r)var v=s?r(m,f,u,t,e,i):r(f,m,u,e,t,i);if(!(void 0===v?f===m||o(f,m,n,r,i):v)){h=!1;break}g||(g="constructor"==u)}if(h&&!g){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||!L(e)&&!L(t)?e!=e&&t!=t:Ft(e,t,n,r,Wt,o))}function Bt(e){return e==e&&!z(e)}function Ht(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Vt(e){var t=function(e){for(var t=Me(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Bt(o)]}return t}(e);return 1==t.length&&t[0][2]?Ht(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;for(e=Object(e);o--;){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var l=(a=n[o])[0],c=e[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var d=new st;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 Ut(e,t){return null!=e&&t in Object(e)}function Kt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=nt(t,e)).length,i=!1;++r<o;){var s=rt(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ue(o)&&le(s,o)&&(N(e)||be(e))}(e,t,Ut)}function qt(e){return Fe(e)?function(e){return function(t){return null==t?void 0:t[e]}}(rt(e)):function(e){return function(t){return ot(t,e)}}(e)}function Yt(e){return"function"==typeof e?e:null==e?U:"object"==typeof e?N(e)?(t=e[0],n=e[1],Fe(t)&&Bt(n)?Ht(rt(t),n):function(e){var r=it(e,t);return void 0===r&&r===n?Kt(e,t):Wt(n,r,3)}):Vt(e):qt(e);var t,n}var Jt,Xt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),s=i.length;s--;){var a=i[Jt?s:++r];if(!1===t(o[a],a,o))break}return e},Qt=Xt;function Gt(e,t){return e&&Qt(e,t,Me)}var Zt=function(){return w.Date.now()},en=Math.max,tn=Math.min;function nn(e,t,n){var r,o,i,s,a,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,s=e.apply(i,n)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function f(){var e=Zt();if(g(e))return m(e);a=setTimeout(f,function(e){var n=t-(e-l);return d?tn(n,i-(e-c)):n}(e))}function m(e){return a=void 0,p&&r?h(e):(r=o=void 0,s)}function v(){var e=Zt(),n=g(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),u?h(e):s}(l);if(d)return clearTimeout(a),a=setTimeout(f,t),h(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=V(t)||0,z(n)&&(u=!!n.leading,i=(d="maxWait"in n)?en(V(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},v.flush=function(){return void 0===a?s:m(Zt())},v}var rn=Object.prototype.hasOwnProperty;var on,sn,an,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,gn=(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":""}(),sn=on.toLowerCase(),{style:on,css:"-"+sn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[on]||dn(on)}),fn=function(e,t){return t?t.toUpperCase():""},mn=/[-\s]+(.)?/g,vn=function(e){return e?e.replace(mn,fn):""},bn=/::/g,yn=/([A-Z]+)([A-Z][a-z])/g,xn=/([a-z\d])([A-Z])/g,wn=/_/g,Cn=function(e,t){return e?e.replace(bn,"/").replace(yn,"$1_$2").replace(xn,"$1_$2").replace(wn,t||"-"):""},Sn=function(e){return Cn(e).toLowerCase()},kn=vn,An=Sn,_n=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},On=un,En=gn,Rn=ln,Ln="undefined"==typeof document?{}:document.documentElement.style,jn=function(e,t){t=t||{};var n=_n(kn(e)),r=An(e),o=an?n:r,i=En.style?an?En.style:En.css:"";if(n in Ln)return t.asString?o:[o];var s=o,a=Rn[r],l=[];if(an&&(s=On(o)),"function"==typeof a){var c=a(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return an?_n(kn(e)):An(e)})),l=l.concat(c)}return i&&l.push(i+s),l.push(o),t.asString||1==l.length?l[0]:l},Nn=Object.prototype.hasOwnProperty,Dn=function(e,t){return Nn.call(e,t)},Pn=Object.prototype.toString,Tn=Object.prototype.toString,$n=jn,Mn=Sn,In=vn,zn=Dn,Fn=function(e){return!!e&&"[object Object]"===Pn.call(e)},Wn=function(e){return"[object Function]"===Tn.apply(e)},Bn=function(e,t,n,r){$n(t).forEach(function(t){e[r?r(t):t]=n})},Hn={cssUnitless:cn},Vn=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,s,a,l,c,u,d,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,g=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},f=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?In:Mn;for(s in e)if(zn(e,s)){if(a=e[s],i=Mn(n?n+s:s),o=!1,d=!1,Wn(a)&&(u=a.call(p||e,a,s,i,e),Fn(u)&&null!=u.value?(a=u.value,d=u.prefix,i=u.name?Mn(u.name):i):a=u),c="number"==(l=typeof a)||"string"==l&&""!=a&&1*a==a,null==a||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=a.value&&a.prefix&&(o=!0,d=a.prefix,a=a.value),o){if(d=d||!!m[i],c&&(a=h&&!(i in g)?a+f:a+""),"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?Bn(r,e,a,v):r[v(e)]=a});continue}d?Bn(r,i,a,v):r[v(i)]=a}else Vn(a,t,i+"-",r)}return r},Un=Vn,Kn=Dn,qn={prefixProperties:ln,cssUnitless:cn,object:Vn,string:function(e,t){e=Un(e,t);var n,r=[];for(n in e)Kn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Yn=e("@pie-lib:mask-markup:serialization"),Jn=["span"],Xn=["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),qn.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 s=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}),a=(e=>Jn.includes(e)?"inline":Xn.includes(e)?"mark":"block")(r),l=tr(e.childNodes,t);return{object:a,type:r,data:{dataset:{...e.dataset},attributes:{...s}},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=t,rr=n,{styled:or}=r,{renderMath:ir}=p;const sr=or("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),ar=or("span")(()=>({display:"inline-block",width:".75em"})),lr=["tbody","tr"],cr=(e,t,n,r,o,i)=>{if(!t)return null;const s=[];return(e.nodes||[]).forEach((e,i)=>{const a=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return s.push(nr.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),s;if(r){const o=r(e,t,n);if(o){const t="blank"===function(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&s.push(nr.createElement(ar,{key:`spacer-${i}`})),s.push(o),void(t&&s.push(nr.createElement(ar,{key:`spacer-${i}`})))}}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&lr.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>it(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;s.push(nr.createElement(n,{key:a},t));break}}else t.length>0&&s.push(t)}else{const o=cr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)s.push(nr.createElement(sr,{key:a},o));else{const t=e.type;e.nodes&&e.nodes.length>0?s.push(nr.createElement(t,{key:a,...e.data.attributes},o)):s.push(nr.createElement(t,{key:a,...e.data.attributes}))}}}),s},ur=or("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class dr extends nr.Component{constructor(e){super(e),dr.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=cr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return nr.createElement(ur,{ref:i},o)}}dr.__initStatic();const pr=/\{\{(\d+)\}\}/g;const hr=t,gr=n;var fr;const mr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(pr,(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},vr=(e,t)=>((fr=class extends hr.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=hr.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:s}=this.props,a=r||mr(n,e);return hr.createElement(dr,{containerRef:this.containerRef,elementType:s,layout:a,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),fr),{useMemo:br}=t,{useLayoutEffect:yr}=t,{useEffect:xr}=t,{useRef:wr}=t,{useCallback:Cr}=t,Sr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function kr(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Ar(e){return"nodeType"in e}function _r(e){var t,n;return e?kr(e)?e:Ar(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Or(e){const{Document:t}=_r(e);return e instanceof t}function Er(e){return!kr(e)&&e instanceof _r(e).HTMLElement}function Rr(e){return e instanceof _r(e).SVGElement}function Lr(e){return e?kr(e)?e.document:Ar(e)?Or(e)?e:Er(e)||Rr(e)?e.ownerDocument:document:document:document}const jr=Sr?yr:xr;function Nr(e){const t=wr(e);return jr(()=>{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 Dr(e,t){void 0===t&&(t=[e]);const n=wr(e);return jr(()=>{n.current!==e&&(n.current=e)},t),n}function Pr(e,t){const n=wr();return br(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Tr(e){const t=Nr(e),n=wr(null),r=Cr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function $r(e){const t=wr();return xr(()=>{t.current=e},[e]),t.current}let Mr={};function Ir(e,t){return br(()=>{if(t)return t;const n=null==Mr[e]?0:Mr[e]+1;return Mr[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 Fr=zr(1),Wr=zr(-1);function Br(e){if(!e)return!1;const{KeyboardEvent:t}=_r(e.target);return t&&e instanceof t}function Hr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=_r(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 Vr=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[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ur="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kr(e){return e.matches(Ur)?e:e.querySelector(Ur)}const qr=t,{useState:Yr}=t,{useCallback:Jr}=t,Xr={display:"none"};function Qr(e){let{id:t,value:n}=e;return qr.createElement("div",{id:t,style:Xr},n)}function Gr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return qr.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 Zr=t,{createContext:eo}=t,{useContext:to}=t,{useEffect:no}=t,{useState:ro}=t,{useCallback:oo}=t,{useMemo:io}=t,{useRef:so}=t,{memo:ao}=t,{useReducer:lo}=t,{cloneElement:co}=t,{forwardRef:uo}=t,{createPortal:po}=o,{unstable_batchedUpdates:ho}=o,go=eo(null);const fo={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 "},mo={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 vo(e){let{announcements:t=mo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=fo}=e;const{announce:i,announcement:s}=function(){const[e,t]=Yr("");return{announce:Jr(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Ir("DndLiveRegion"),[l,c]=ro(!1);if(no(()=>{c(!0)},[]),function(e){const t=to(go);no(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(io(()=>({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=Zr.createElement(Zr.Fragment,null,Zr.createElement(Qr,{id:r,value:o.draggable}),Zr.createElement(Gr,{id:a,announcement:s}));return n?po(u,n):u}var bo;function yo(){}!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"}(bo||(bo={}));const xo=Object.freeze({x:0,y:0});function wo(e,t){const n=Hr(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 So(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),s=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=s*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const ko=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=So(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Co)};function Ao(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:xo}const _o=(Oo=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+Oo*t.y,bottom:e.bottom+Oo*t.y,left:e.left+Oo*t.x,right:e.right+Oo*t.x}),{...e})});var Oo;function Eo(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 Ro={ignoreTransform:!1};function Lo(e,t){void 0===t&&(t=Ro);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=_r(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Eo(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(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:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function jo(e){return Lo(e,{ignoreTransform:!0})}function No(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Or(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Er(o)||Rr(o))return n;if(n.includes(o))return n;const i=_r(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=_r(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=_r(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Do(e){const[t]=No(e,1);return null!=t?t:null}function Po(e){return Sr&&e?kr(e)?e:Ar(e)?Or(e)||e===Lr(e).scrollingElement?window:Er(e)?e:null:null:null}function To(e){return kr(e)?e.scrollX:e.scrollLeft}function $o(e){return kr(e)?e.scrollY:e.scrollTop}function Mo(e){return{x:To(e),y:$o(e)}}var Io;function zo(e){return!(!Sr||!e)&&e===document.scrollingElement}function Fo(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"}(Io||(Io={}));const Wo={x:.2,y:.2};function Bo(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Wo);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Fo(e),h={x:0,y:0},g={x:0,y:0},f=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+f?(h.y=Io.Backward,g.y=r*Math.abs((t.top+f-i)/f)):!u&&l>=t.bottom-f&&(h.y=Io.Forward,g.y=r*Math.abs((t.bottom-f-l)/f)),!p&&a>=t.right-m?(h.x=Io.Forward,g.x=r*Math.abs((t.right-m-a)/m)):!d&&s<=t.left+m&&(h.x=Io.Backward,g.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:g}}function Ho(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 Vo(e){return e.reduce((e,t)=>Fr(e,Mo(t)),xo)}function Uo(e,t){if(void 0===t&&(t=Lo),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Do(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ko=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+To(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+$o(t),0)}]];class qo{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=No(t),r=Vo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Ko)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),s=r[e]-t;return this.rect[i]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yo{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 Xo,Qo;function Go(e){e.preventDefault()}function Zo(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"}(Xo||(Xo={})),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"}(Qo||(Qo={}));const ei={start:[Qo.Space,Qo.Enter],cancel:[Qo.Esc],end:[Qo.Space,Qo.Enter,Qo.Tab]},ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qo.Right:return{...n,x:n.x+25};case Qo.Left:return{...n,x:n.x-25};case Qo.Down:return{...n,y:n.y+25};case Qo.Up:return{...n,y:n.y-25}}};class ni{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 Yo(Lr(t)),this.windowListeners=new Yo(_r(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xo.Resize,this.handleCancel),this.windowListeners.add(Xo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Uo(n),t(xo)}handleKeyDown(e){if(Br(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ei,coordinateGetter:i=ti,scrollBehavior:s="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))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=Wr(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:d,minScroll:p}=Fo(n),h=Ho(n),g={x:Math.min(o===Qo.Right?h.right-h.width/2:h.right,Math.max(o===Qo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Qo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Qo.Down?h.top:h.top+h.height/2,u.y))},f=o===Qo.Right&&!a||o===Qo.Left&&!l,m=o===Qo.Down&&!c||o===Qo.Up&&!i;if(f&&g.x!==u.x){const e=n.scrollLeft+t.x,i=o===Qo.Right&&e<=d.x||o===Qo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=i?n.scrollLeft-e:o===Qo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(m&&g.y!==u.y){const e=n.scrollTop+t.y,i=o===Qo.Down&&e<=d.y||o===Qo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=i?n.scrollTop-e:o===Qo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,Fr(Wr(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 ri(e){return Boolean(e&&"distance"in e)}function oi(e){return Boolean(e&&"delay"in e)}ni.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ei,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ii{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=_r(e);return e instanceof t?e:Lr(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=Lr(i),this.documentListeners=new Yo(this.document),this.listeners=new Yo(n),this.windowListeners=new Yo(_r(i)),this.initialCoordinates=null!=(r=Hr(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(Xo.Resize,this.handleCancel),this.windowListeners.add(Xo.DragStart,Go),this.windowListeners.add(Xo.VisibilityChange,this.handleCancel),this.windowListeners.add(Xo.ContextMenu,Go),this.documentListeners.add(Xo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(oi(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ri(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(Xo.Click,Zo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xo.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const a=null!=(t=Hr(e))?t:xo,l=Wr(r,a);if(!n&&s){if(ri(s)){if(null!=s.tolerance&&Jo(l,s.tolerance))return this.handleCancel();if(Jo(l,s.distance))return this.handleStart()}return oi(s)&&Jo(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),i(a)}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===Qo.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 ai extends ii{constructor(e){const{event:t}=e,n=Lr(t.target);super(e,si,n)}}ai.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 li={move:{name:"mousemove"},end:{name:"mouseup"}};var ci;!function(e){e[e.RightClick=2]="RightClick"}(ci||(ci={}));(class extends ii{constructor(e){super(e,li,Lr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ci.RightClick&&(null==r||r({event:n}),!0)}}];const ui={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var di,pi;function hi(e){let{acceleration:t,activator:n=di.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=pi.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=$r(t);return Pr(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:{[Io.Backward]:e.x[Io.Backward]||-1===o.x,[Io.Forward]:e.x[Io.Forward]||1===o.x},y:{[Io.Backward]:e.y[Io.Backward]||-1===o.y,[Io.Forward]:e.y[Io.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[g,f]=function(){const e=wr(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=io(()=>{switch(n){case di.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case di.DraggableRect:return o}},[n,o,l]),y=so(null),x=oo(()=>{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)},[]),w=io(()=>a===pi.TreeOrder?[...c].reverse():c,[a,c]);no(()=>{if(i&&c.length&&b){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:a}=Bo(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return f(),y.current=e,g(x,s),m.current=a,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},f()}else f()},[t,x,r,f,i,s,JSON.stringify(b),JSON.stringify(h),g,c,w,u,JSON.stringify(p)])}(class extends ii{constructor(e){super(e,ui)}static setup(){return window.addEventListener(ui.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ui.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"}(di||(di={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(pi||(pi={}));const gi={x:{[Io.Backward]:!1,[Io.Forward]:!1},y:{[Io.Backward]:!1,[Io.Forward]:!1}};var fi,mi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(fi||(fi={})),function(e){e.Optimized="optimized"}(mi||(mi={}));const vi=new Map;function bi(e,t){return Pr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function yi(e){let{callback:t,disabled:n}=e;const r=Nr(t),o=io(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return no(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function xi(e){return new qo(Lo(e),e)}function wi(e,t,n){void 0===t&&(t=xi);const[r,o]=ro(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 s=function(e){let{callback:t,disabled:n}=e;const r=Nr(t),o=io(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return no(()=>()=>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}}}}),a=yi({callback:i});return jr(()=>{i(),e?(null==a||a.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==s||s.disconnect())},[e]),r}const Ci=[];function Si(e,t){void 0===t&&(t=[]);const n=so(null);return no(()=>{n.current=null},t),no(()=>{const t=e!==xo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Wr(e,n.current):xo}function ki(e){return io(()=>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 Ai=[];function _i(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Er(t)?t:e}const Oi=[{sensor:ai,options:{}},{sensor:ni,options:{}}],Ei={current:{}},Ri={draggable:{measure:jo},droppable:{measure:jo,strategy:fi.WhileDragging,frequency:mi.Optimized},dragOverlay:{measure:Lo}};class Li extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ji={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Li,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ri,measureDroppableContainers:yo,windowRect:null,measuringScheduled:!1},Ni={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yo,draggableNodes:new Map,over:null,measureDroppableContainers:yo},Di=eo(Ni),Pi=eo(ji);function Ti(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Li}}}function $i(e,t){switch(t.type){case bo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case bo.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 bo.DragEnd:case bo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case bo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Li(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case bo.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Li(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case bo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Li(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Mi(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=to(Di),i=$r(r),s=$r(null==n?void 0:n.id);return no(()=>{if(!t&&!r&&i&&null!=s){if(!Br(i))return;if(document.activeElement===i.target)return;const e=o.get(s);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=Kr(e);if(t){t.focus();break}}})}},[r,t,o,s,i]),null}function Ii(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const zi=eo({...xo,scaleX:1,scaleY:1});var Fi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Fi||(Fi={})),ao(function(e){var t,n,r,o;let{id:i,accessibility:s,autoScroll:a=!0,children:l,sensors:c=Oi,collisionDetection:u=ko,measuring:d,modifiers:p,...h}=e;const g=lo($i,void 0,Ti),[f,m]=g,[v,b]=function(){const[e]=ro(()=>new Set),t=oo(t=>(e.add(t),()=>e.delete(t)),[e]);return[oo(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,x]=ro(Fi.Uninitialized),w=y===Fi.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:A}}=f,_=null!=C?S.get(C):null,O=so({initial:null,translated:null}),E=io(()=>{var e;return null!=C?{id:C,data:null!=(e=null==_?void 0:_.data)?e:Ei,rect:O}:null},[C,_]),R=so(null),[L,j]=ro(null),[N,D]=ro(null),P=Dr(h,Object.values(h)),T=Ir("DndDescribedBy",i),$=io(()=>A.getEnabled(),[A]),M=io(()=>({draggable:{...Ri.draggable,...null==I?void 0:I.draggable},droppable:{...Ri.droppable,...null==I?void 0:I.droppable},dragOverlay:{...Ri.dragOverlay,...null==I?void 0:I.dragOverlay}}),[null==(I=d)?void 0:I.draggable,null==I?void 0:I.droppable,null==I?void 0:I.dragOverlay]);var I;const{droppableRects:z,measureDroppableContainers:F,measuringScheduled:W}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=ro(null),{frequency:a,measure:l,strategy:c}=o,u=so(e),d=function(){switch(c){case fi.Always:return!1;case fi.BeforeDragging:return n;default:return!n}}(),p=Dr(d),h=oo(function(e){void 0===e&&(e=[]),p.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),g=so(null),f=Pr(t=>{if(d&&!n)return vi;if(!t||t===vi||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 qo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return no(()=>{u.current=e},[e]),no(()=>{d||h()},[n,d]),no(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),no(()=>{d||"number"!=typeof a||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},a))},[a,d,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:w,dependencies:[k.x,k.y],config:M.droppable}),B=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Pr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(S,C),H=io(()=>N?Hr(N):null,[N]),V=function(){const e=!1===(null==L?void 0:L.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=w&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),U=function(e,t){return bi(e,t)}(B,M.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=so(!1),{x:s,y:a}="boolean"==typeof o?{x:o,y:o}:o;jr(()=>{if(!s&&!a||!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=Ao(n(e),r);if(s||(o.x=0),a||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Do(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,s,a,r,n])}({activeNode:null!=C?S.get(C):null,config:V.layoutShiftCompensation,initialRect:U,measure:M.draggable.measure});const K=wi(B,M.draggable.measure,U),q=wi(B?B.parentElement:null),Y=so({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=A.getNodeFor(null==(t=Y.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=ro(null),o=yi({callback:oo(e=>{for(const{target:n}of e)if(Er(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=oo(e=>{const n=_i(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[s,a]=Tr(i);return io(()=>({nodeRef:s,rect:n,setRef:a}),[n,s,a])}({measure:M.dragOverlay.measure}),Q=null!=(n=X.nodeRef.current)?n:B,G=w?null!=(r=X.rect)?r:K:null,Z=Boolean(X.nodeRef.current&&X.rect),ee=Ao(te=Z?null:K,bi(te));var te;const ne=ki(Q?_r(Q):null),re=function(e){const t=so(e),n=Pr(n=>e?n&&n!==Ci&&e&&t.current&&e.parentNode===t.current.parentNode?n:No(e):Ci,[e]);return no(()=>{t.current=e},[e]),n}(w?null!=J?J:B:null),oe=function(e,t){void 0===t&&(t=Lo);const[n]=e,r=ki(n?_r(n):null),[o,i]=ro(Ai);function s(){i(()=>e.length?e.map(e=>zo(e)?r:new qo(t(e),e)):Ai)}const a=yi({callback:s});return jr(()=>{null==a||a.disconnect(),s(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),o}(re),ie=Ii(p,{transform:{x:k.x-ee.x,y:k.y-ee.y,scaleX:1,scaleY:1},activatorEvent:N,active:E,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:X.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),se=H?Fr(H,k):null,ae=function(e){const[t,n]=ro(null),r=so(e),o=oo(e=>{const t=Po(e.target);t&&n(e=>e?(e.set(t,Mo(t)),new Map(e)):null)},[]);return no(()=>{const t=r.current;if(e!==t){i(t);const s=e.map(e=>{const t=Po(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Mo(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=Po(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),io(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Fr(e,t),xo):Vo(e):xo,[e,t])}(re),le=Si(ae),ce=Si(ae,[K]),ue=Fr(ie,le),de=G?_o(G,ie):null,pe=E&&de?u({active:E,collisionRect:de,droppableRects:z,droppableContainers:$,pointerCoordinates:se}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[ge,fe]=ro(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:Fr(ie,ce),null!=(o=null==ge?void 0:ge.rect)?o:null,K),ve=so(null),be=oo((e,t)=>{let{sensor:n,options:r}=t;if(null==R.current)return;const o=S.get(R.current);if(!o)return;const i=e.nativeEvent,s=new n({active:R.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=P.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!S.get(e))return;const{onDragPending:o}=P.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=R.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:r}=P.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:O}};ho(()=>{null==r||r(o),x(Fi.Initializing),m({type:bo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),j(ve.current),D(i)})},onMove(e){m({type:bo.DragMove,coordinates:e})},onEnd:a(bo.DragEnd),onCancel:a(bo.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let s=null;if(t&&o){const{cancelDrop:a}=P.current;if(s={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===bo.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=bo.DragCancel)}}R.current=null,ho(()=>{m({type:e}),x(Fi.Uninitialized),fe(null),j(null),D(null),ve.current=null;const t=e===bo.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=P.current[t];null==e||e(s),v({type:t,event:s})}})}}ve.current=s},[S]),ye=oo((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==R.current||!i||o.dndKit||o.defaultPrevented)return;const s={active:i};!0===e(n,t.options,s)&&(o.dndKit={capturedBy:t.sensor},R.current=r,be(n,t))},[S,be]),xe=function(e,t){return io(()=>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){no(()=>{if(!Sr)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),jr(()=>{K&&y===Fi.Initializing&&x(Fi.Initialized)},[K,y]),no(()=>{const{onDragMove:e}=P.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};ho(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),no(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==R.current||!t||!o)return;const{onDragOver:i}=P.current,s=r.get(he),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};ho(()=>{fe(a),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),jr(()=>{Y.current={activatorEvent:N,active:E,activeNode:B,collisionRect:de,collisions:pe,droppableRects:z,draggableNodes:S,draggingNode:Q,draggingNodeRect:G,droppableContainers:A,over:ge,scrollableAncestors:re,scrollAdjustedTranslate:ue},O.current={initial:G,translated:de}},[E,B,pe,de,S,Q,G,z,A,ge,re,ue]),hi({...V,delta:k,draggingRect:de,pointerCoordinates:se,scrollableAncestors:re,scrollableAncestorRects:oe});const we=io(()=>({active:E,activeNode:B,activeNodeRect:K,activatorEvent:N,collisions:pe,containerNodeRect:q,dragOverlay:X,draggableNodes:S,droppableContainers:A,droppableRects:z,over:ge,measureDroppableContainers:F,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:M,measuringScheduled:W,windowRect:ne}),[E,B,K,N,pe,q,X,S,A,z,ge,F,re,oe,M,W,ne]),Ce=io(()=>({activatorEvent:N,activators:xe,active:E,activeNodeRect:K,ariaDescribedById:{draggable:T},dispatch:m,draggableNodes:S,over:ge,measureDroppableContainers:F}),[N,xe,E,K,m,T,S,ge,F]);return Zr.createElement(go.Provider,{value:b},Zr.createElement(Di.Provider,{value:Ce},Zr.createElement(Pi.Provider,{value:we},Zr.createElement(zi.Provider,{value:me},l)),Zr.createElement(Mi,{disabled:!1===(null==s?void 0:s.restoreFocus)})),Zr.createElement(vo,{...s,hiddenTextDescribedById:T}))});const Wi=eo(null),Bi="button";function Hi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ir("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=to(Di),{role:h=Bi,roleDescription:g="draggable",tabIndex:f=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=to(m?zi:Wi),[b,y]=Tr(),[x,w]=Tr(),C=function(e,t){return io(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(s,t),S=Dr(n);jr(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:S}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:io(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!m||h!==Bi)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,h,f,m,g,u.draggable]),isDragging:m,listeners:r?void 0:C,node:b,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:v}}const Vi={timeout:25};function Ui(e){let{animation:t,children:n}=e;const[r,o]=ro(null),[i,s]=ro(null),a=$r(n);return n||r||!a||o(a),jr(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),Zr.createElement(Zr.Fragment,null,n,r?co(r,{ref:s}):null)}const Ki={x:0,y:0,scaleX:1,scaleY:1};function qi(e){let{children:t}=e;return Zr.createElement(Di.Provider,{value:Ni},Zr.createElement(zi.Provider,{value:Ki},t))}const Yi={position:"fixed",touchAction:"none"},Ji=e=>Br(e)?"transform 250ms ease":void 0,Xi=uo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:u=Ji}=e;if(!a)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Yi,width:a.width,height:a.height,top:a.top,left:a.left,transform:Vr.Transform.toString(d),transformOrigin:o&&r?wo(r,a):void 0,transition:"function"==typeof u?u(r):u,...l};return Zr.createElement(n,{className:s,style:p,ref:t},i)}),Qi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(n)}]},sideEffects:(Gi={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Gi;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 Gi;function Zi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Nr((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const l=_i(i);if(!l)return;const{transform:c}=_r(i).getComputedStyle(i),u=Eo(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Qi,...e};return e=>{let{active:i,dragOverlay:s,transform:a,...l}=e;if(!t)return;const c={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},u={scaleX:1!==a.scaleX?i.rect.width*a.scaleX/s.rect.width:1,scaleY:1!==a.scaleY?i.rect.height*a.scaleY/s.rect.height:1},d={x:a.x-c.x,y:a.y-c.y,...u},p=o({...l,active:i,dragOverlay:s,transform:{initial:a,final:d}}),[h]=p,g=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(g))return;const f=null==r?void 0:r({active:i,dragOverlay:s,...l}),m=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==f||f(),e()}})}}(t);return Uo(a,o.draggable.measure),d({active:{id:e,data:s.data,node:a,rect:o.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:u})})}let es=0;function ts(e){return io(()=>{if(null!=e)return es++,es},[e])}const ns=Zr.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:f,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=to(Pi),C=to(zi),S=ts(null==d?void 0:d.id),k=Ii(s,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:C,windowRect:w}),A=bi(p),_=Zi({config:r,draggableNodes:g,droppableContainers:f,measuringConfiguration:b}),O=A?m.setRef:void 0;return Zr.createElement(qi,null,Zr.createElement(Ui,{animation:_},d&&S?Zr.createElement(Xi,{key:S,id:d.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:A,style:{zIndex:c,...o},transform:k},n):null))}),rs=t,{useEffect:os}=t,{useRef:is}=t,ss=n,{styled:as}=r,{Chip:ls}=i,{color:cs}=s,{renderMath:us}=p;function ds(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const ps=as("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&&{}})),hs=as(ls)(()=>({backgroundColor:cs.white(),border:`1px solid ${cs.text()}`,color:cs.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}})),gs=as("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function fs({choice:e,disabled:t,instanceId:n}){const r=is(null),{attributes:o,listeners:i,setNodeRef:s,isDragging:a}=Hi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return os(()=>{us(r.current)},[e.value]),rs.createElement(ps,{ref:s,style:a?{width:ds([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:ds([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},rs.createElement(hs,{clickable:!1,disabled:t,ref:r,label:rs.createElement(gs,{dangerouslySetInnerHTML:{__html:e.value}})}))}fs.propTypes={choice:ss.object.isRequired,disabled:ss.bool,instanceId:ss.oneOfType([ss.string,ss.number])};const ms=t,vs=n,{DragDroppablePlaceholder:bs}=h;class ys extends ms.Component{constructor(...e){super(...e),ys.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:vs.bool,duplicates:vs.bool,choices:vs.arrayOf(vs.shape({label:vs.string,value:vs.string})),value:vs.object,choicePosition:vs.string.isRequired,instanceId:vs.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 Gt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Yt(t=>t===e.id));return void 0===n}),s={...this.getStyleForWrapper(),minWidth:"100px"};return ms.createElement("div",{style:s},ms.createElement(bs,{disabled:e,instanceId:o},i.map((t,n)=>ms.createElement(fs,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}ys.__initStatic();const xs=t,{useEffect:ws}=t,{useRef:Cs}=t,{useState:Ss}=t,ks=n,As=e,{styled:_s}=r,{Chip:Os}=i,Es=l,{color:Rs}=s,{grey:Ls}=a,{renderMath:js}=p;function Ns(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}As("pie-lib:mask-markup:blank");const Ds=_s("span")(({dragged:e,over:t})=>({border:`solid 0px ${Rs.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Ps=_s(Os)(()=>({backgroundColor:Rs.background(),border:`2px dashed ${Rs.text()}`,touchAction:"none",color:Rs.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ls[500]}`,backgroundColor:`${Ls[300]}`},"&.correct":{border:`solid 1px ${Rs.correct()}`},"&.incorrect":{border:`solid 1px ${Rs.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Ts=_s("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 $s({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a}){const l=Cs(null),c=Cs(null),u=Cs(null),[d,p]=Ss({height:0,width:0}),h=()=>{f()},g=()=>{const e=Ns([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto",l.current.style.height="auto",l.current.offsetHeight;const e=(()=>{if(!c.current)return null;if(c.current.querySelector("mjx-container")&&c.current.parentElement)return c.current.parentElement;return c.current.querySelector("img")||c.current})()||c.current,t=e.getBoundingClientRect(),n=(t.width||e.offsetWidth||0)+24,r=Math.max(t.height||0,e.offsetHeight||0,e.scrollHeight||0,c.current.scrollHeight||0)+24,o=parseFloat(s)||0,i=parseFloat(a)||0,u=n<=o?o:n,d=r<=i?i:r;p(e=>({width:u>o?u:e.width,height:d>i?d:e.height})),l.current.style.width=`${u}px`,l.current.style.height=`${d}px`}};ws(()=>{g()},[]),ws(()=>{l.current&&js(l.current)},[n,Ns([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),ws(()=>{t?g():p({height:0,width:0})},[t]),ws(()=>{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:Ns([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Ns([u,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(s))?0:parseFloat(s),t=isNaN(parseFloat(a))?0:parseFloat(a);return{...{height:d.height||t,width:d.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return xs.createElement(Ps,{clickable:!1,disabled:e,ref:l,component:"span",label:xs.createElement(xs.Fragment,null,xs.createElement(Ts,{ref:c,draggable:!0,className:Es({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&xs.createElement(Ts,{draggable:!0,className:Es({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Es({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function Ms({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}){const{attributes:c,listeners:u,setNodeRef:d,transform:p,isDragging:h}=Hi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:g,isOver:f,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ir("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=to(Di),u=so({disabled:n}),d=so(!1),p=so(null),h=so(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...Vi,...o},v=Dr(null!=f?f:r),b=yi({callback:oo(()=>{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:g||!s}),y=oo((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[x,w]=Tr(y),C=Dr(t);return no(()=>{b&&x.current&&(b.disconnect(),d.current=!1,b.observe(x.current))},[x,b]),no(()=>(a({type:bo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:C}}),()=>a({type:bo.UnregisterDroppable,key:i,id:r})),[r]),no(()=>{n!==u.current.disabled&&(a({type:bo.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:s,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Vr.Translate.toString(p)};return xs.createElement(Ds,{ref:e=>{d(e),g(e)},style:v,dragged:h,over:f,...c,...u},xs.createElement($s,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:Ns([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}))}$s.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},$s.propTypes={id:ks.oneOfType([ks.string,ks.number]),disabled:ks.bool,duplicates:ks.bool,choice:ks.object,isOver:ks.bool,dragItem:ks.object,correct:ks.bool,onChange:ks.func,emptyResponseAreaWidth:ks.oneOfType([ks.string,ks.number]),emptyResponseAreaHeight:ks.oneOfType([ks.string,ks.number]),instanceId:ks.string},Ms.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Ms.propTypes={id:ks.oneOfType([ks.string,ks.number]),disabled:ks.bool,duplicates:ks.bool,choice:ks.object,correct:ks.bool,onChange:ks.func,emptyResponseAreaWidth:ks.oneOfType([ks.string,ks.number]),emptyResponseAreaHeight:ks.oneOfType([ks.string,ks.number]),instanceId:ks.string};const Is=t,zs=n,{DragProvider:Fs}=h;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 Bs=vr("blank",e=>(t,n,r)=>{const o=Ws([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:s,correctResponse:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:p,isDragging:h}=e,g=c?a[o.id]:n[o.id],f=g&&e.choices.find(e=>e.id===g);return Is.createElement(Ms,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:s,choice:f,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 Hs extends Is.Component{constructor(e){super(e),Hs.prototype.__init.call(this),Hs.prototype.__init2.call(this),Hs.prototype.__init3.call(this),Hs.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:zs.string,layout:zs.object,choicesPosition:zs.string,choices:zs.array,value:zs.object,onChange:zs.func,duplicates:zs.bool,disabled:zs.bool,feedback:zs.object,correctResponse:zs.object,showCorrectAnswer:zs.bool,emptyResponseAreaWidth:zs.oneOfType([zs.string,zs.number]),emptyResponseAreaHeight:zs.oneOfType([zs.string,zs.number]),instanceId:zs.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Ws([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?Is.createElement(fs,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:r,value:o}=this.props,i=Ws([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=Ws([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=!!t&&!!n&&"MaskBlank"===Ws([i,"optionalAccess",e=>e.type])&&Ws([s,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:a?null:void 0}),!a||!r)return;const l=i,c=s.id;if(!0===s.toChoiceBoard){if(!l.fromChoice&&l.id){const e={...o};delete e[l.id],r(e)}}else if(!0===l.fromChoice){if(c&&"drag-in-the-blank-droppable"!==c){const e={...o};e[c]=l.choice.id,r(e)}}else if(l.id&&l.id!==c){const e={...o};e[c]=l.choice.id,delete e[l.id],r(e)}}}__init4(){this.getPositionDirection=e=>{let t,n,r;switch(e){case"left":t="row",r="center";break;case"right":t="row-reverse",n="flex-end",r="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:r}}}render(){const{markup:e,duplicates:t,value:n,onChange:r,choicesPosition:o,choices:i,correctResponse:s,disabled:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,layout:p,instanceId:h}=this.props,g=o||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(g)};return Is.createElement(Fs,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:ko},Is.createElement("div",{ref:e=>this.rootRef=e,style:f},Is.createElement(ys,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:a,instanceId:h}),Is.createElement(Bs,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:a,duplicates:t,feedback:l,correctResponse:s,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:h,isDragging:!!this.state.activeDragItem}),Is.createElement(ns,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Hs.__initStatic(),Hs.__initStatic2();const Vs=t,{styled:Us}=r,Ks=l,{color:qs}=s;function Ys(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 Js,Xs;"undefined"!=typeof window&&(Js=require("@pie-lib/editable-html-tip-tap").default,Xs=Us(Js)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${qs.black()}`,"&.correct":{border:`1px solid ${qs.correct()}`},"&.incorrect":{border:`1px solid ${qs.incorrect()}`}})));var Qs=vr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:s,maxLength:a,spellCheck:l,pluginProps:c,onChange:u}=e,d=Ys([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const p=(e.choices&&d&&e.choices[d.id]||[])[0],h=s?p&&p.label:n[d.id]||"",g=a&&a[d.id],f=i&&i[d.id],m=s||"correct"===f,v=!s&&"incorrect"===f,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Vs.createElement(Xs,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:s||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?g:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Ys([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Ks({correct:m,incorrect:v})})}});vr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Gs=t,Zs=n,{Button:ea}=i,{InputLabel:ta}=i,{Menu:na}=i,{MenuItem:ra}=i,{ArrowDropDown:oa}=c,{ArrowDropUp:ia}=c,{Close:sa}=c,{Check:aa}=c,{styled:la}=r,{color:ca}=s,{renderMath:ua}=p,da=la(ea)(()=>({color:ca.text(),border:`1px solid ${ca.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ca.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:ca.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ca.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ca.correct(),color:`${ca.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ca.incorrectWithIcon(),color:`${ca.text()} !important`}})),pa=la(na)(()=>({backgroundColor:ca.background(),border:`1px solid ${ca.correct()} !important`,"&:hover":{border:`1px solid ${ca.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ca.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ha=la(ra)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ca.text(),backgroundColor:ca.background(),"&.Mui-focusVisible":{outline:`3px solid ${ca.tertiary()}`,outlineOffset:"-1px",color:ca.text(),backgroundColor:ca.background()},"&:hover":{color:ca.text(),backgroundColor:ca.dropdownBackground()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${ca.text()} !important`,backgroundColor:`${ca.background()} !important`,"&:hover":{color:ca.text(),backgroundColor:`${ca.dropdownBackground()} !important`}}})),ga=la("span")(()=>({fontSize:"max(1rem, 14px)"})),fa=la("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),ma=la(ta)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),va=la(aa)(()=>({color:`${ca.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ca.correct()},"&.incorrect":{backgroundColor:ca.incorrectWithIcon()}})),ba=la(sa)(()=>({color:`${ca.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ca.correct()},"&.incorrect":{backgroundColor:ca.incorrectWithIcon()}}));class ya extends Gs.Component{static __initStatic(){this.propTypes={id:Zs.string,value:Zs.string,disabled:Zs.bool,onChange:Zs.func,correct:Zs.bool,choices:Zs.arrayOf(Zs.shape({value:Zs.string,label:Zs.string})),showCorrectAnswer:Zs.bool,singleQuery:Zs.bool,correctValue:Zs.string}}constructor(e){super(e),ya.prototype.__init.call(this),ya.prototype.__init2.call(this),ya.prototype.__init3.call(this),ya.prototype.__init4.call(this),ya.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Gs.createRef(),this.buttonRef=Gs.createRef(),this.previewRef=Gs.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||ua(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&ua(e)}),ua(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:s,correctValue:a}=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 g=parseInt(e,10)+1,f=s?"Query-label":`Query-label-${g}`,m=s?"Query":`Query ${g}`;let v=null;return n&&void 0!==t&&(v=t||i?Gs.createElement(va,{className:"correct"}):Gs.createElement(ba,{className:"incorrect"})),Gs.createElement(Gs.Fragment,null,Gs.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Gs.createElement(ha,{key:t,tabIndex:-1,"aria-hidden":"true"},Gs.createElement(ga,{dangerouslySetInnerHTML:{__html:e.label}})))),Gs.createElement(ma,{id:f,tabIndex:-1,"aria-hidden":"true"},m),Gs.createElement(da,{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,Gs.createElement(ga,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:a||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Gs.createElement(ia,null):Gs.createElement(oa,null)),Gs.createElement(pa,{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 Gs.createElement(ha,{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)},Gs.createElement(ga,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Gs.createElement(fa,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}ya.__initStatic();const xa=t;function wa(e,t){return null!=e?e:t()}function Ca(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}vr("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:s,feedback:a,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),u=l?c&&c.value:n[o.id];return xa.createElement(ya,{key:`${t.type}-dropdown-${o.id}`,correct:a&&a[o.id]&&"correct"===a[o.id],disabled:s||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 Sa=e=>"string"==typeof e,ka=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Aa=e=>null==e?"":""+e,_a=/###/g,Oa=e=>e&&e.indexOf("###")>-1?e.replace(_a,"."):e,Ea=e=>!e||Sa(e),Ra=(e,t,n)=>{const r=Sa(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Ea(e))return{};const t=Oa(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Ea(e)?{}:{obj:e,k:Oa(r[o])}},La=(e,t,n)=>{const{obj:r,k:o}=Ra(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=Ra(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Ra(e,s,Object),Ca([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},ja=(e,t)=>{const{obj:n,k:r}=Ra(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Na=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Sa(e[r])||e[r]instanceof String||Sa(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Na(e[r],t[r],n):e[r]=t[r]);return e},Da=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pa={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Ta=e=>Sa(e)?e.replace(/[&<>"'\/]/g,e=>Pa[e]):e;const $a=[" ",",","?","!",";"],Ma=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ia=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let s=e;s<r.length;++s)if(s!==e&&(i+=n),i+=r[s],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;e+=s-e+1;break}o=t}return o},za=e=>Ca([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),Fa={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Ca([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Wa{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fa,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Sa(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Wa(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Wa(this.logger,e)}}var Ba=new Wa;class Ha{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class Va extends Ha{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):Sa(n)&&o?s.push(...n.split(o)):s.push(n)));const a=ja(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Sa(n)?Ia(Ca([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):a}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),La(this.data,s,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(Sa(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=n,n=t,t=s[1]),this.addNamespaces(t);let a=ja(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Na(a,n,o):a={...a,...n},La(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Ua={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=wa(Ca([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,o)]),()=>t)}),t}};const Ka=Symbol("i18next/PATH_KEY");function qa(e,t){const{[Ka]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(Ca([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===Ka?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(wa(Ca([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const Ya={},Ja=e=>!Sa(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Xa extends Ha{constructor(e,t={}){var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(r[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Ba.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===Ca([r,"optionalAccess",e=>e.res]))return!1;const o=Ja(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=$a.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Ma.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Sa(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Sa(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=qa(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],r),l=a[a.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Ca([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return d?o?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:s;const p=this.resolve(e,r);let h=Ca([p,"optionalAccess",e=>e.res]);const g=Ca([p,"optionalAccess",e=>e.usedKey])||s,f=Ca([p,"optionalAccess",e=>e.exactUsedKey])||s,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!Sa(r.count),y=Xa.hasDefaultValue(r),x=b?this.pluralResolver.getSuffix(u,r.count,r):"",w=r.ordinal&&b?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",C=b&&!r.ordinal&&0===r.count,S=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${w}`]||r.defaultValue;let k=h;v&&!h&&y&&(k=S);const A=Ja(k),_=Object.prototype.toString.apply(k);if(!(v&&k&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(_)<0)||Sa(m)&&Array.isArray(k))if(v&&Sa(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&y&&(t=!0,h=S),this.isValidLookup(h)||(o=!0,h=s);const a=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,d=y&&S!==h&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,s,d?S:h),i){const e=this.resolve(s,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=y&&n!==h?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):Ca([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,r[`defaultValue${t}`]||S)})}):n(e,s,S))}h=this.extendTranslation(h,e,r,p,n),o&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}${c}${s}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?h:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,k,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(i){const e=Array.isArray(k),t=e?[]:{},n=e?f:g;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const o=`${n}${i}${e}`;t[e]=y&&!h?this.translate(o,{...r,defaultValue:Ja(S)?S[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...r,joinArrays:!1,ns:a}),t[e]===o&&(t[e]=k[e])}h=t}}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(Ca([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Sa(e)&&(void 0!==Ca([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let a=n.replace&&!Sa(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>Ca([o,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=Sa(i)?[i]:i;return null!=e&&Ca([s,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=Ua.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,s;return Sa(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;r=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!Sa(t.count),d=u&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(Sa(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(s=e,Ya[`${h[0]}-${e}`]||!Ca([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ca([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(s)])||(Ya[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(r=>{if(this.isValidLookup(n))return;i=r;const s=[l];if(Ca([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(o)&&s.push(l+e.replace(o,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),u&&(t.ordinal&&0===e.indexOf(o)&&s.push(r+e.replace(o,this.options.pluralSeparator)),s.push(r+e),d&&s.push(r+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:s}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return Ca([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Sa(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class Qa{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ba.create("languageUtils")}getScriptPartFromCode(e){if(!(e=za(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=za(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Sa(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Sa(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Sa(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Sa(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const Ga={zero:0,one:1,two:2,few:3,many:4,other:5},Za={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class el{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ba.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=za("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Za;if(!e.match(/-|_/))return Za;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),Ca([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Ga[e]-Ga[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const tl=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=ja(e,n);return void 0!==r?r:ja(t,n)})(e,t,n);return!i&&o&&Sa(n)&&(i=Ia(e,n,r),void 0===i&&(i=Ia(t,n,r))),i},nl=e=>e.replace(/\$/g,"$$$$");class rl{constructor(e={}){this.logger=Ba.create("interpolator"),this.options=e,this.format=Ca([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Ta,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Da(o):i||"{{",this.suffix=s?Da(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Da(d):p||Da("$t("),this.nestingSuffix=h?Da(h):g||Da(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Ca([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=tl(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(tl(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=Ca([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,u=void 0!==Ca([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>nl(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?nl(this.escape(e)):nl(e)}].forEach(t=>{for(s=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,r);i=Sa(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(u){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Sa(i)||this.useRawValueToEscape||(i=Aa(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const s=o.match(/'/g),a=o.match(/"/g);(wa(Ca([s,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let a=[];i={...n},i=i.replace&&!Sa(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(a=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(s.call(this,r[1].trim(),i),i),o&&r[0]===e&&!Sa(o))return o;Sa(o)||(o=Aa(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),a.length&&(o=a.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const ol=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=t[s];return a||(a=e(za(r),o),t[s]=a),a(n)}},il=e=>(t,n,r)=>e(za(n),r)(t);class sl{constructor(e={}){this.logger=Ba.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ol:il;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ol(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const s=Ca([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},a=s.locale||s.lng||r.locale||r.lng||n;t=this.formats[o](e,a,{...i,...r,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class al extends Ha{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Ba.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],Ca([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const o={},i={},s={},a={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))}),r||(s[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=Ra(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"==typeof n.then?n.then(e=>s(null,e)).catch(s):s(null,n)}catch(e){s(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Sa(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Sa(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},s=()=>{}){if(!Ca([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ca([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(Ca([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,r,a):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else l(e,t,n,r,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const ll=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Sa(e[1])&&(t.defaultValue=e[1]),Sa(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),cl=e=>(Sa(e.ns)&&(e.ns=[e.ns]),Sa(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Sa(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Ca([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),ul=()=>{};class dl extends Ha{constructor(e={},t){var n;if(super(),this.options=cl(e),this.services={},this.logger=Ba,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Sa(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ll();var r;this.options={...n,...this.options,...cl(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(Ca([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ca([r,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ca([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>Ca([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Ca([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Ba.init(o(this.modules.logger),this.options):Ba.init(null,this.options),e=this.modules.formatter?this.modules.formatter:sl;const t=new Qa(this.options);this.store=new Va(this.options.resources,this.options);const r=this.services;r.logger=Ba,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new el(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(r.formatter=o(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new rl(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new al(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new Xa(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ul),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=ka(),s=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e,t=ul){let n=t;const r=Sa(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Ca([r,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}Ca([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=ka();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=ul),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ua.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=ka();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Sa(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Sa(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),Ca([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const s=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=qa(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=qa(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return Sa(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return Ca([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Ca([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=ka();return this.options.ns?(Sa(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=ka();Sa(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Ca([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=Ca([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new Qa(ll());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new dl(e,t);return n.createInstance=dl.createInstance,n}cloneInstance(e={},t=ul){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new dl(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new Va(e,r),o.services.resourceStore=o.store}if(e.interpolation){const t={...ll().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new rl(n)}return o.translator=new Xa(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pl=dl.createInstance();pl.createInstance,pl.dir,pl.init,pl.loadResources,pl.reloadResources,pl.use,pl.changeLanguage,pl.getFixedT,pl.t,pl.exists,pl.setDefaultNamespace,pl.hasLoadedNamespace,pl.loadNamespaces,pl.loadLanguages;pl.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var hl={translator:{...pl,t:(e,t)=>{const{lng:n}=t;switch(n){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return pl.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const gl=t,fl=n,ml=u,{color:vl}=s,{Collapsible:bl}=s,{hasText:yl}=s,{hasMedia:xl}=s,{PreviewPrompt:wl}=s,{UiLayout:Cl}=s,{styled:Sl}=r,{translator:kl}=hl,Al=Sl(Cl)(({alwaysShowCorrect:e})=>({color:vl.text(),backgroundColor:vl.background(),...e&&{"& *":{borderColor:`${vl.text()} !important`}}})),_l=Sl("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ol=Sl("div")(({theme:e})=>({marginBottom:e.spacing(2)})),El=Sl("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"});class Rl extends gl.Component{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)}static __initStatic(){this.propTypes={alwaysShowCorrect:fl.bool,animationsDisabled:fl.bool,disabled:fl.bool,displayType:fl.string,feedback:fl.object,language:fl.string,markup:fl.string,maxLengthPerChoice:fl.array,maxLengthPerChoiceEnabled:fl.bool,mode:fl.string,note:fl.string,onChange:fl.func,playerSpellCheckEnabled:fl.bool,prompt:fl.string,rationale:fl.string,role:fl.string,showNote:fl.bool,teacherInstructions:fl.string,value:fl.object,responseAreaInputConfiguration:fl.object,model:fl.object.isRequired}}static __initStatic2(){this.defaultProps={value:{}}}__init(){this.state={showCorrectAnswer:this.props.alwaysShowCorrect||!1}}__init2(){this.getChangeSession=e=>e&&e.every((e,t,n)=>e===n[0]&&1===e)?this.props.onChange:nn(this.props.onChange,200,{maxWait:200})}UNSAFE_componentWillReceiveProps(e){const{maxLengthPerChoice:t,language:n}=this.props;let{note:r}=this.props;var o,i;(function(e){if(null==e)return!0;if(de(e)&&(N(e)||"string"==typeof e||"function"==typeof e.splice||Ce(e)||Le(e)||be(e)))return!e.length;var t=At(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(he(e))return!$e(e).length;for(var n in e)if(rn.call(e,n))return!1;return!0})(e.feedback)&&this.setState({showCorrectAnswer:!1}),e.alwaysShowCorrect&&this.setState({showCorrectAnswer:!0}),t&&(o=t,i=e.maxLengthPerChoice,!Wt(o,i))&&(this.changeSession=this.getChangeSession(e.maxLengthPerChoice)),r&&n&&n!==e.language&&r===kl.t("common:commonCorrectAnswerWithAlternates",{lng:n})&&(r=kl.t("common:commonCorrectAnswerWithAlternates",{lng:e.language}))}__init3(){this.toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})}}__init4(){this.changeSession=this.getChangeSession(this.props.maxLengthPerChoice)}__init5(){this.onChange=e=>{this.changeSession(e)}}render(){const{showCorrectAnswer:e}=this.state,{alwaysShowCorrect:t,animationsDisabled:n,mode:r,displayType:o,role:i,language:s,maxLengthPerChoice:a,maxLengthPerChoiceEnabled:l,note:c,playerSpellCheckEnabled:u,prompt:d,rationale:p,showNote:h,teacherInstructions:g,responseAreaInputConfiguration:f,model:m,value:v}=this.props,{extraCSSRules:b}=m||{},y=(e||"view"===r&&"instructor"===i)&&h&&c,x=gl.createElement(wl,{defaultClassName:"teacher-instructions",prompt:g}),w=gl.createElement(wl,{prompt:p}),C=p&&(yl(p)||xl(p)),S=g&&(yl(g)||xl(g));return gl.createElement(Al,{extraCSSRules:b,alwaysShowCorrect:t,style:{display:`${o}`}},"gather"===r&&gl.createElement(El,null,"Fill in the Blank Question"),S&&gl.createElement(Ol,null,n?x:gl.createElement(bl,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},x)),d&&gl.createElement(wl,{prompt:d}),!t&&"evaluate"===r&&gl.createElement(ml,{show:!0,toggled:e,onToggle:this.toggleShowCorrect,language:s}),gl.createElement(Qs,{...this.props,onChange:this.onChange,showCorrectAnswer:e,value:v,maxLength:a,adjustedLimit:l,spellCheck:u,pluginProps:f}),y&&gl.createElement(_l,{dangerouslySetInnerHTML:{__html:c}}),C&&gl.createElement(Ol,null,n?w:gl.createElement(bl,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},w)))}}Rl.__initStatic(),Rl.__initStatic2();const Ll=t,{createRoot:jl}=d,{renderMath:Nl}=p;class Dl extends HTMLElement{constructor(){super(),Dl.prototype.__init.call(this),Dl.prototype.__init2.call(this),Dl.prototype.__init3.call(this),this._model=null,this._session=null,this._root=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}set model(e){this._model=e,this.dispatchEvent(new m(this.tagName.toLowerCase(),this.session&&!!this.session.value,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}__init(){this._render=()=>{if(this._model&&this._session){let e=Ll.createElement(Rl,{choices:this._model.choices,disabled:this._model.disabled,displayType:this._model.displayType,feedback:this._model.feedback,language:this._model.language,markup:this._model.markup,maxLengthPerChoice:this._model.maxLengthPerChoice,maxLengthPerChoiceEnabled:this._model.maxLengthPerChoiceEnabled,mode:this._model.mode,note:this._model.note,onChange:this.changeSession,playerSpellCheckEnabled:this._model.playerSpellCheckEnabled,prompt:this._model.prompt,rationale:this._model.rationale,role:this._model.role,showNote:this._model.showNote,teacherInstructions:this._model.teacherInstructions,value:this._session.value,responseAreaInputConfiguration:this._model.responseAreaInputConfiguration});this._root||(this._root=jl(this)),this._root.render(e),queueMicrotask(()=>{Nl(this)})}}}__init2(){this.dispatchChangedEvent=()=>{this.dispatchEvent(new b(this.tagName.toLowerCase(),this.session&&!!this.session.value))}}__init3(){this.changeSession=e=>{this.session.value=e,this.dispatchChangedEvent(),this._render()}}connectedCallback(){this.setAttribute("aria-label","Fill in the Blank Question"),this.setAttribute("role","region"),this._render()}disconnectedCallback(){this._root&&this._root.unmount()}}export{Dl as default};
1
+ import{_dll_debug as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as r,_dll_react_dom as o,_dll_mui__material as i,_dll_pie_lib__render_ui as s,_dll_mui__material_colors as a,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as u,_dll_react_dom_client as d}from"../../../@pie-lib/shared-module@^5.2.3/module/index.js";import{_dll_pie_lib__math_rendering as p}from"../../../@pie-lib/math-rendering-module@^5.0.8/module/index.js";import{_dll_pie_lib__drag as h}from"../../../@pie-lib/drag-module@^4.0.8/module/index.js";var g={};Object.defineProperty(g,"__esModule",{value:!0});class f extends CustomEvent{constructor(e,t,n){super(f.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}f.TYPE="model-set";var m=g.ModelSetEvent=f;class v extends CustomEvent{constructor(e,t){super(v.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}v.TYPE="session-changed";var b=g.SessionChangedEvent=v,y="object"==typeof global&&global&&global.Object===Object&&global,x="object"==typeof self&&self&&self.Object===Object&&self,w=y||x||Function("return this")(),C=w.Symbol,S=Object.prototype,k=S.hasOwnProperty,A=S.toString,_=C?C.toStringTag:void 0;var O=Object.prototype.toString;var E=C?C.toStringTag:void 0;function R(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=k.call(e,_),n=e[_];try{e[_]=void 0;var r=!0}catch(e){}var o=A.call(e);return r&&(t?e[_]=n:delete e[_]),o}(e):function(e){return O.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function j(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==R(e)}var N=Array.isArray,D=C?C.prototype:void 0,P=D?D.toString:void 0;function T(e){if("string"==typeof e)return e;if(N(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,T)+"";if(j(e))return P?P.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}var $=/\s/;var I=/^\s+/;function M(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&$.test(e.charAt(t)););return t}(e)+1).replace(I,""):e}function z(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var F=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,B=/^0o[0-7]+$/i,H=parseInt;function V(e){if("number"==typeof e)return e;if(j(e))return NaN;if(z(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=z(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=M(e);var n=W.test(e);return n||B.test(e)?H(e.slice(2),n?2:8):F.test(e)?NaN:+e}function U(e){return e}function K(e){if(!z(e))return!1;var t=R(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var q,Y=w["__core-js_shared__"],J=(q=/[^.]+$/.exec(Y&&Y.keys&&Y.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var X=Function.prototype.toString;function Q(e){if(null!=e){try{return X.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var G=/^\[object .+?Constructor\]$/,Z=Function.prototype,ee=Object.prototype,te=Z.toString,ne=ee.hasOwnProperty,re=RegExp("^"+te.call(ne).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(e){return!(!z(e)||(t=e,J&&J in t))&&(K(e)?re:G).test(Q(e));var t}function ie(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(n)?n:void 0}var se=ie(w,"WeakMap"),ae=/^(?:0|[1-9]\d*)$/;function le(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function ce(e,t){return e===t||e!=e&&t!=t}function ue(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function de(e){return null!=e&&ue(e.length)&&!K(e)}var pe=Object.prototype;function he(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||pe)}function ge(e){return L(e)&&"[object Arguments]"==R(e)}var fe=Object.prototype,me=fe.hasOwnProperty,ve=fe.propertyIsEnumerable,be=ge(function(){return arguments}())?ge:function(e){return L(e)&&me.call(e,"callee")&&!ve.call(e,"callee")};var ye="object"==typeof exports&&exports&&!exports.nodeType&&exports,xe=ye&&"object"==typeof module&&module&&!module.nodeType&&module,we=xe&&xe.exports===ye?w.Buffer:void 0,Ce=(we?we.isBuffer:void 0)||function(){return!1},Se={};Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var ke,Ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,_e=Ae&&"object"==typeof module&&module&&!module.nodeType&&module,Oe=_e&&_e.exports===Ae&&y.process,Ee=function(){try{var e=_e&&_e.require&&_e.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch(e){}}(),Re=Ee&&Ee.isTypedArray,Le=Re?(ke=Re,function(e){return ke(e)}):function(e){return L(e)&&ue(e.length)&&!!Se[R(e)]},je=Object.prototype.hasOwnProperty;function Ne(e,t){var n=N(e),r=!n&&be(e),o=!n&&!r&&Ce(e),i=!n&&!r&&!o&&Le(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=a.length;for(var c in e)!t&&!je.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||le(c,l))||a.push(c);return a}var De=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Pe=De,Te=Object.prototype.hasOwnProperty;function $e(e){if(!he(e))return Pe(e);var t=[];for(var n in Object(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ie(e){return de(e)?Ne(e):$e(e)}var Me=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ze=/^\w*$/;function Fe(e,t){if(N(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!j(e))||(ze.test(e)||!Me.test(e)||null!=t&&e in Object(t))}var We=ie(Object,"create");var Be=Object.prototype.hasOwnProperty;var He=Object.prototype.hasOwnProperty;function Ve(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 Ue(e,t){for(var n=e.length;n--;)if(ce(e[n][0],t))return n;return-1}Ve.prototype.clear=function(){this.__data__=We?We(null):{},this.size=0},Ve.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ve.prototype.get=function(e){var t=this.__data__;if(We){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Be.call(t,e)?t[e]:void 0},Ve.prototype.has=function(e){var t=this.__data__;return We?void 0!==t[e]:He.call(t,e)},Ve.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 Ke=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=Ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,!0)},qe.prototype.get=function(e){var t=this.__data__,n=Ue(t,e);return n<0?void 0:t[n][1]},qe.prototype.has=function(e){return Ue(this.__data__,e)>-1},qe.prototype.set=function(e,t){var n=this.__data__,r=Ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ye=ie(w,"Map");function Je(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 Xe(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])}}Xe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Ye||qe),string:new Ve}},Xe.prototype.delete=function(e){var t=Je(this,e).delete(e);return this.size-=t?1:0,t},Xe.prototype.get=function(e){return Je(this,e).get(e)},Xe.prototype.has=function(e){return Je(this,e).has(e)},Xe.prototype.set=function(e,t){var n=Je(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Qe(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 s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Qe.Cache||Xe),n}Qe.Cache=Xe;var Ge=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/\\(\\)?/g,et=function(e){var t=Qe(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(Ge,function(e,n,r,o){t.push(r?o.replace(Ze,"$1"):n||e)}),t}),tt=et;function nt(e,t){return N(e)?e:Fe(e,t)?[e]:tt(function(e){return null==e?"":T(e)}(e))}function rt(e){if("string"==typeof e||j(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ot(e,t){for(var n=0,r=(t=nt(t,e)).length;null!=e&&n<r;)e=e[rt(t[n++])];return n&&n==r?e:void 0}function it(e,t,n){var r=null==e?void 0:ot(e,t);return void 0===r?n:r}function st(e){var t=this.__data__=new qe(e);this.size=t.size}st.prototype.clear=function(){this.__data__=new qe,this.size=0},st.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},st.prototype.get=function(e){return this.__data__.get(e)},st.prototype.has=function(e){return this.__data__.has(e)},st.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qe){var r=n.__data__;if(!Ye||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xe(r)}return n.set(e,t),this.size=n.size,this};var at=Object.prototype.propertyIsEnumerable,lt=Object.getOwnPropertySymbols,ct=lt?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 s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(lt(e),function(t){return at.call(e,t)}))}:function(){return[]};function ut(e){return function(e,t,n){var r=t(e);return N(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,ct)}var dt=ie(w,"DataView"),pt=ie(w,"Promise"),ht=ie(w,"Set"),gt="[object Map]",ft="[object Promise]",mt="[object Set]",vt="[object WeakMap]",bt="[object DataView]",yt=Q(dt),xt=Q(Ye),wt=Q(pt),Ct=Q(ht),St=Q(se),kt=R;(dt&&kt(new dt(new ArrayBuffer(1)))!=bt||Ye&&kt(new Ye)!=gt||pt&&kt(pt.resolve())!=ft||ht&&kt(new ht)!=mt||se&&kt(new se)!=vt)&&(kt=function(e){var t=R(e),n="[object Object]"==t?e.constructor:void 0,r=n?Q(n):"";if(r)switch(r){case yt:return bt;case xt:return gt;case wt:return ft;case Ct:return mt;case St:return vt}return t});var At=kt,_t=w.Uint8Array;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xe;++t<n;)this.add(e[t])}function Et(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Rt(e,t){return e.has(t)}Ot.prototype.add=Ot.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ot.prototype.has=function(e){return this.__data__.has(e)};function Lt(e,t,n,r,o,i){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))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 Ot:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var g=e[d],f=t[d];if(r)var m=s?r(f,g,d,t,e,i):r(g,f,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Et(t,function(e,t){if(!Rt(h,t)&&(g===e||o(g,e,n,r,i)))return h.push(t)})){p=!1;break}}else if(g!==f&&!o(g,f,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Nt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Dt=C?C.prototype:void 0,Pt=Dt?Dt.valueOf:void 0;var Tt=Object.prototype.hasOwnProperty;var $t="[object Arguments]",It="[object Array]",Mt="[object Object]",zt=Object.prototype.hasOwnProperty;function Ft(e,t,n,r,o,i){var s=N(e),a=N(t),l=s?It:At(e),c=a?It:At(t),u=(l=l==$t?Mt:l)==Mt,d=(c=c==$t?Mt:c)==Mt,p=l==c;if(p&&Ce(e)){if(!Ce(t))return!1;s=!0,u=!1}if(p&&!u)return i||(i=new st),s||Le(e)?Lt(e,t,n,r,o,i):function(e,t,n,r,o,i,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new _t(e),new _t(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ce(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=jt;case"[object Set]":var l=1&r;if(a||(a=Nt),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=Lt(a(e),a(t),r,o,i,s);return s.delete(e),u;case"[object Symbol]":if(Pt)return Pt.call(e)==Pt.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var h=u&&zt.call(e,"__wrapped__"),g=d&&zt.call(t,"__wrapped__");if(h||g){var f=h?e.value():e,m=g?t.value():t;return i||(i=new st),o(f,m,n,r,i)}}return!!p&&(i||(i=new st),function(e,t,n,r,o,i){var s=1&n,a=ut(e),l=a.length;if(l!=ut(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:Tt.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 g=s;++c<l;){var f=e[u=a[c]],m=t[u];if(r)var v=s?r(m,f,u,t,e,i):r(f,m,u,e,t,i);if(!(void 0===v?f===m||o(f,m,n,r,i):v)){h=!1;break}g||(g="constructor"==u)}if(h&&!g){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||!L(e)&&!L(t)?e!=e&&t!=t:Ft(e,t,n,r,Wt,o))}function Bt(e){return e==e&&!z(e)}function Ht(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Vt(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,Bt(o)]}return t}(e);return 1==t.length&&t[0][2]?Ht(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;for(e=Object(e);o--;){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var l=(a=n[o])[0],c=e[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var d=new st;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 Ut(e,t){return null!=e&&t in Object(e)}function Kt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=nt(t,e)).length,i=!1;++r<o;){var s=rt(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&ue(o)&&le(s,o)&&(N(e)||be(e))}(e,t,Ut)}function qt(e){return Fe(e)?function(e){return function(t){return null==t?void 0:t[e]}}(rt(e)):function(e){return function(t){return ot(t,e)}}(e)}function Yt(e){return"function"==typeof e?e:null==e?U:"object"==typeof e?N(e)?(t=e[0],n=e[1],Fe(t)&&Bt(n)?Ht(rt(t),n):function(e){var r=it(e,t);return void 0===r&&r===n?Kt(e,t):Wt(n,r,3)}):Vt(e):qt(e);var t,n}var Jt,Xt=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),s=i.length;s--;){var a=i[Jt?s:++r];if(!1===t(o[a],a,o))break}return e},Qt=Xt;function Gt(e,t){return e&&Qt(e,t,Ie)}var Zt=function(){return w.Date.now()},en=Math.max,tn=Math.min;function nn(e,t,n){var r,o,i,s,a,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,s=e.apply(i,n)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function f(){var e=Zt();if(g(e))return m(e);a=setTimeout(f,function(e){var n=t-(e-l);return d?tn(n,i-(e-c)):n}(e))}function m(e){return a=void 0,p&&r?h(e):(r=o=void 0,s)}function v(){var e=Zt(),n=g(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),u?h(e):s}(l);if(d)return clearTimeout(a),a=setTimeout(f,t),h(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=V(t)||0,z(n)&&(u=!!n.leading,i=(d="maxWait"in n)?en(V(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0},v.flush=function(){return void 0===a?s:m(Zt())},v}var rn=Object.prototype.hasOwnProperty;var on,sn,an,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,gn=(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":""}(),sn=on.toLowerCase(),{style:on,css:"-"+sn+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[on]||dn(on)}),fn=function(e,t){return t?t.toUpperCase():""},mn=/[-\s]+(.)?/g,vn=function(e){return e?e.replace(mn,fn):""},bn=/::/g,yn=/([A-Z]+)([A-Z][a-z])/g,xn=/([a-z\d])([A-Z])/g,wn=/_/g,Cn=function(e,t){return e?e.replace(bn,"/").replace(yn,"$1_$2").replace(xn,"$1_$2").replace(wn,t||"-"):""},Sn=function(e){return Cn(e).toLowerCase()},kn=vn,An=Sn,_n=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},On=un,En=gn,Rn=ln,Ln="undefined"==typeof document?{}:document.documentElement.style,jn=function(e,t){t=t||{};var n=_n(kn(e)),r=An(e),o=an?n:r,i=En.style?an?En.style:En.css:"";if(n in Ln)return t.asString?o:[o];var s=o,a=Rn[r],l=[];if(an&&(s=On(o)),"function"==typeof a){var c=a(o,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return an?_n(kn(e)):An(e)})),l=l.concat(c)}return i&&l.push(i+s),l.push(o),t.asString||1==l.length?l[0]:l},Nn=Object.prototype.hasOwnProperty,Dn=function(e,t){return Nn.call(e,t)},Pn=Object.prototype.toString,Tn=Object.prototype.toString,$n=jn,In=Sn,Mn=vn,zn=Dn,Fn=function(e){return!!e&&"[object Object]"===Pn.call(e)},Wn=function(e){return"[object Function]"===Tn.apply(e)},Bn=function(e,t,n,r){$n(t).forEach(function(t){e[r?r(t):t]=n})},Hn={cssUnitless:cn},Vn=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,s,a,l,c,u,d,p=t.scope||{},h=null!=t.addUnits?t.addUnits:!p||null==p.addUnits||p.addUnits,g=(null!=t.cssUnitless?t.cssUnitless:p?p.cssUnitless:null)||{},f=(t.cssUnit||p?p.cssUnit:null)||"px",m=t.prefixProperties||(p?p.prefixProperties:null)||{},v=t.camelize?Mn:In;for(s in e)if(zn(e,s)){if(a=e[s],i=In(n?n+s:s),o=!1,d=!1,Wn(a)&&(u=a.call(p||e,a,s,i,e),Fn(u)&&null!=u.value?(a=u.value,d=u.prefix,i=u.name?In(u.name):i):a=u),c="number"==(l=typeof a)||"string"==l&&""!=a&&1*a==a,null==a||null==i||""===i)continue;if((c||"string"==l)&&(o=!0),!o&&null!=a.value&&a.prefix&&(o=!0,d=a.prefix,a=a.value),o){if(d=d||!!m[i],c&&(a=h&&!(i in g)?a+f:a+""),"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?Bn(r,e,a,v):r[v(e)]=a});continue}d?Bn(r,i,a,v):r[v(i)]=a}else Vn(a,t,i+"-",r)}return r},Un=Vn,Kn=Dn,qn={prefixProperties:ln,cssUnitless:cn,object:Vn,string:function(e,t){e=Un(e,t);var n,r=[];for(n in e)Kn(e,n)&&r.push(n+": "+e[n]);return r.join("; ")}};const Yn=e("@pie-lib:mask-markup:serialization"),Jn=["span"],Xn=["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),qn.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 s=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}),a=(e=>Jn.includes(e)?"inline":Xn.includes(e)?"mark":"block")(r),l=tr(e.childNodes,t);return{object:a,type:r,data:{dataset:{...e.dataset},attributes:{...s}},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=t,rr=n,{styled:or}=r,{renderMath:ir}=p;const sr=or("div")(({theme:e})=>({paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5)})),ar=or("span")(()=>({display:"inline-block",width:".75em"})),lr=["tbody","tr"],cr=(e,t,n,r,o,i)=>{if(!t)return null;const s=[];return(e.nodes||[]).forEach((e,i)=>{const a=e.type?`${e.type}-${i}`:`${i}`;if(e.isMath)return s.push(nr.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),s;if(r){const o=r(e,t,n);if(o){const t="blank"===function(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([e,"access",e=>e.data,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.component]);return t&&s.push(nr.createElement(ar,{key:`spacer-${i}`})),s.push(o),void(t&&s.push(nr.createElement(ar,{key:`spacer-${i}`})))}}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,r=((e,t)=>{const n=""===t.trim(),r=e&&e.type;return n&&lr.includes(r)?void 0:t})(o,n);return r?e+r:e},""),n=(e=>{const t=e.leaves.find(e=>it(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;s.push(nr.createElement(n,{key:a},t));break}}else t.length>0&&s.push(t)}else{const o=cr(e,t,n,r,e);if("p"===e.type||"paragraph"===e.type)s.push(nr.createElement(sr,{key:a},o));else{const t=e.type;e.nodes&&e.nodes.length>0?s.push(nr.createElement(t,{key:a,...e.data.attributes},o)):s.push(nr.createElement(t,{key:a,...e.data.attributes}))}}}),s},ur=or("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class dr extends nr.Component{constructor(e){super(e),dr.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=cr(t,e,this.handleChange,this.props.renderChildren,null),i=r||this.internalContainerRef;return nr.createElement(ur,{ref:i},o)}}dr.__initStatic();const pr=/\{\{(\d+)\}\}/g;const hr=t,gr=n;var fr;const mr=(e,t)=>{const{markup:n}=(o=t,(r=e)?{markup:r.replace(pr,(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},vr=(e,t)=>((fr=class extends hr.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=hr.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:s}=this.props,a=r||mr(n,e);return hr.createElement(dr,{containerRef:this.containerRef,elementType:s,layout:a,value:o,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),fr),{useMemo:br}=t,{useLayoutEffect:yr}=t,{useEffect:xr}=t,{useRef:wr}=t,{useCallback:Cr}=t,Sr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function kr(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Ar(e){return"nodeType"in e}function _r(e){var t,n;return e?kr(e)?e:Ar(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Or(e){const{Document:t}=_r(e);return e instanceof t}function Er(e){return!kr(e)&&e instanceof _r(e).HTMLElement}function Rr(e){return e instanceof _r(e).SVGElement}function Lr(e){return e?kr(e)?e.document:Ar(e)?Or(e)?e:Er(e)||Rr(e)?e.ownerDocument:document:document:document}const jr=Sr?yr:xr;function Nr(e){const t=wr(e);return jr(()=>{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 Dr(e,t){void 0===t&&(t=[e]);const n=wr(e);return jr(()=>{n.current!==e&&(n.current=e)},t),n}function Pr(e,t){const n=wr();return br(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Tr(e){const t=Nr(e),n=wr(null),r=Cr(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function $r(e){const t=wr();return xr(()=>{t.current=e},[e]),t.current}let Ir={};function Mr(e,t){return br(()=>{if(t)return t;const n=null==Ir[e]?0:Ir[e]+1;return Ir[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 Fr=zr(1),Wr=zr(-1);function Br(e){if(!e)return!1;const{KeyboardEvent:t}=_r(e.target);return t&&e instanceof t}function Hr(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=_r(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 Vr=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[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ur="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kr(e){return e.matches(Ur)?e:e.querySelector(Ur)}const qr=t,{useState:Yr}=t,{useCallback:Jr}=t,Xr={display:"none"};function Qr(e){let{id:t,value:n}=e;return qr.createElement("div",{id:t,style:Xr},n)}function Gr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return qr.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 Zr=t,{createContext:eo}=t,{useContext:to}=t,{useEffect:no}=t,{useState:ro}=t,{useCallback:oo}=t,{useMemo:io}=t,{useRef:so}=t,{memo:ao}=t,{useReducer:lo}=t,{cloneElement:co}=t,{forwardRef:uo}=t,{createPortal:po}=o,{unstable_batchedUpdates:ho}=o,go=eo(null);const fo={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 "},mo={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 vo(e){let{announcements:t=mo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=fo}=e;const{announce:i,announcement:s}=function(){const[e,t]=Yr("");return{announce:Jr(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=Mr("DndLiveRegion"),[l,c]=ro(!1);if(no(()=>{c(!0)},[]),function(e){const t=to(go);no(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(io(()=>({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=Zr.createElement(Zr.Fragment,null,Zr.createElement(Qr,{id:r,value:o.draggable}),Zr.createElement(Gr,{id:a,announcement:s}));return n?po(u,n):u}var bo;function yo(){}!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"}(bo||(bo={}));const xo=Object.freeze({x:0,y:0});function wo(e,t){const n=Hr(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 So(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),s=o-r,a=i-n;if(r<o&&n<i){const n=t.width*t.height,r=e.width*e.height,o=s*a;return Number((o/(n+r-o)).toFixed(4))}return 0}const ko=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=So(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(Co)};function Ao(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:xo}const _o=(Oo=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+Oo*t.y,bottom:e.bottom+Oo*t.y,left:e.left+Oo*t.x,right:e.right+Oo*t.x}),{...e})});var Oo;function Eo(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 Ro={ignoreTransform:!1};function Lo(e,t){void 0===t&&(t=Ro);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:r}=_r(e).getComputedStyle(e);t&&(n=function(e,t,n){const r=Eo(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),c=e.top-a-(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:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function jo(e){return Lo(e,{ignoreTransform:!0})}function No(e,t){const n=[];return e?function r(o){if(null!=t&&n.length>=t)return n;if(!o)return n;if(Or(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Er(o)||Rr(o))return n;if(n.includes(o))return n;const i=_r(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=_r(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=_r(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?n:r(o.parentNode)}(e):n}function Do(e){const[t]=No(e,1);return null!=t?t:null}function Po(e){return Sr&&e?kr(e)?e:Ar(e)?Or(e)||e===Lr(e).scrollingElement?window:Er(e)?e:null:null:null}function To(e){return kr(e)?e.scrollX:e.scrollLeft}function $o(e){return kr(e)?e.scrollY:e.scrollTop}function Io(e){return{x:To(e),y:$o(e)}}var Mo;function zo(e){return!(!Sr||!e)&&e===document.scrollingElement}function Fo(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"}(Mo||(Mo={}));const Wo={x:.2,y:.2};function Bo(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;void 0===r&&(r=10),void 0===o&&(o=Wo);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=Fo(e),h={x:0,y:0},g={x:0,y:0},f=t.height*o.y,m=t.width*o.x;return!c&&i<=t.top+f?(h.y=Mo.Backward,g.y=r*Math.abs((t.top+f-i)/f)):!u&&l>=t.bottom-f&&(h.y=Mo.Forward,g.y=r*Math.abs((t.bottom-f-l)/f)),!p&&a>=t.right-m?(h.x=Mo.Forward,g.x=r*Math.abs((t.right-m-a)/m)):!d&&s<=t.left+m&&(h.x=Mo.Backward,g.x=r*Math.abs((t.left+m-s)/m)),{direction:h,speed:g}}function Ho(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 Vo(e){return e.reduce((e,t)=>Fr(e,Io(t)),xo)}function Uo(e,t){if(void 0===t&&(t=Lo),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Do(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ko=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+To(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+$o(t),0)}]];class qo{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=No(t),r=Vo(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,o]of Ko)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=o(n),s=r[e]-t;return this.rect[i]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Yo{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 Xo,Qo;function Go(e){e.preventDefault()}function Zo(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"}(Xo||(Xo={})),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"}(Qo||(Qo={}));const ei={start:[Qo.Space,Qo.Enter],cancel:[Qo.Esc],end:[Qo.Space,Qo.Enter,Qo.Tab]},ti=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Qo.Right:return{...n,x:n.x+25};case Qo.Left:return{...n,x:n.x-25};case Qo.Down:return{...n,y:n.y+25};case Qo.Up:return{...n,y:n.y-25}}};class ni{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 Yo(Lr(t)),this.windowListeners=new Yo(_r(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xo.Resize,this.handleCancel),this.windowListeners.add(Xo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Uo(n),t(xo)}handleKeyDown(e){if(Br(e)){const{active:t,context:n,options:r}=this.props,{keyboardCodes:o=ei,coordinateGetter:i=ti,scrollBehavior:s="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))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=Wr(u,c),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(const n of o){const o=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:d,minScroll:p}=Fo(n),h=Ho(n),g={x:Math.min(o===Qo.Right?h.right-h.width/2:h.right,Math.max(o===Qo.Right?h.left:h.left+h.width/2,u.x)),y:Math.min(o===Qo.Down?h.bottom-h.height/2:h.bottom,Math.max(o===Qo.Down?h.top:h.top+h.height/2,u.y))},f=o===Qo.Right&&!a||o===Qo.Left&&!l,m=o===Qo.Down&&!c||o===Qo.Up&&!i;if(f&&g.x!==u.x){const e=n.scrollLeft+t.x,i=o===Qo.Right&&e<=d.x||o===Qo.Left&&e>=p.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});r.x=i?n.scrollLeft-e:o===Qo.Right?n.scrollLeft-d.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(m&&g.y!==u.y){const e=n.scrollTop+t.y,i=o===Qo.Down&&e<=d.y||o===Qo.Up&&e>=p.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});r.y=i?n.scrollTop-e:o===Qo.Down?n.scrollTop-d.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,Fr(Wr(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 ri(e){return Boolean(e&&"distance"in e)}function oi(e){return Boolean(e&&"delay"in e)}ni.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ei,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ii{constructor(e,t,n){var r;void 0===n&&(n=function(e){const{EventTarget:t}=_r(e);return e instanceof t?e:Lr(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=Lr(i),this.documentListeners=new Yo(this.document),this.listeners=new Yo(n),this.windowListeners=new Yo(_r(i)),this.initialCoordinates=null!=(r=Hr(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(Xo.Resize,this.handleCancel),this.windowListeners.add(Xo.DragStart,Go),this.windowListeners.add(Xo.VisibilityChange,this.handleCancel),this.windowListeners.add(Xo.ContextMenu,Go),this.documentListeners.add(Xo.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(oi(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(ri(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(Xo.Click,Zo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xo.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const a=null!=(t=Hr(e))?t:xo,l=Wr(r,a);if(!n&&s){if(ri(s)){if(null!=s.tolerance&&Jo(l,s.tolerance))return this.handleCancel();if(Jo(l,s.distance))return this.handleStart()}return oi(s)&&Jo(l,s.tolerance)?this.handleCancel():void this.handlePending(s,l)}e.cancelable&&e.preventDefault(),i(a)}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===Qo.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 ai extends ii{constructor(e){const{event:t}=e,n=Lr(t.target);super(e,si,n)}}ai.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 li={move:{name:"mousemove"},end:{name:"mouseup"}};var ci;!function(e){e[e.RightClick=2]="RightClick"}(ci||(ci={}));(class extends ii{constructor(e){super(e,li,Lr(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ci.RightClick&&(null==r||r({event:n}),!0)}}];const ui={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var di,pi;function hi(e){let{acceleration:t,activator:n=di.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=pi.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const h=function(e){let{delta:t,disabled:n}=e;const r=$r(t);return Pr(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:{[Mo.Backward]:e.x[Mo.Backward]||-1===o.x,[Mo.Forward]:e.x[Mo.Forward]||1===o.x},y:{[Mo.Backward]:e.y[Mo.Backward]||-1===o.y,[Mo.Forward]:e.y[Mo.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[g,f]=function(){const e=wr(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=io(()=>{switch(n){case di.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case di.DraggableRect:return o}},[n,o,l]),y=so(null),x=oo(()=>{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)},[]),w=io(()=>a===pi.TreeOrder?[...c].reverse():c,[a,c]);no(()=>{if(i&&c.length&&b){for(const e of w){if(!1===(null==r?void 0:r(e)))continue;const n=c.indexOf(e),o=u[n];if(!o)continue;const{direction:i,speed:a}=Bo(e,o,b,t,p);for(const e of["x","y"])h[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0)return f(),y.current=e,g(x,s),m.current=a,void(v.current=i)}m.current={x:0,y:0},v.current={x:0,y:0},f()}else f()},[t,x,r,f,i,s,JSON.stringify(b),JSON.stringify(h),g,c,w,u,JSON.stringify(p)])}(class extends ii{constructor(e){super(e,ui)}static setup(){return window.addEventListener(ui.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ui.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"}(di||(di={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(pi||(pi={}));const gi={x:{[Mo.Backward]:!1,[Mo.Forward]:!1},y:{[Mo.Backward]:!1,[Mo.Forward]:!1}};var fi,mi;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(fi||(fi={})),function(e){e.Optimized="optimized"}(mi||(mi={}));const vi=new Map;function bi(e,t){return Pr(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function yi(e){let{callback:t,disabled:n}=e;const r=Nr(t),o=io(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return no(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function xi(e){return new qo(Lo(e),e)}function wi(e,t,n){void 0===t&&(t=xi);const[r,o]=ro(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 s=function(e){let{callback:t,disabled:n}=e;const r=Nr(t),o=io(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return no(()=>()=>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}}}}),a=yi({callback:i});return jr(()=>{i(),e?(null==a||a.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==s||s.disconnect())},[e]),r}const Ci=[];function Si(e,t){void 0===t&&(t=[]);const n=so(null);return no(()=>{n.current=null},t),no(()=>{const t=e!==xo;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Wr(e,n.current):xo}function ki(e){return io(()=>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 Ai=[];function _i(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Er(t)?t:e}const Oi=[{sensor:ai,options:{}},{sensor:ni,options:{}}],Ei={current:{}},Ri={draggable:{measure:jo},droppable:{measure:jo,strategy:fi.WhileDragging,frequency:mi.Optimized},dragOverlay:{measure:Lo}};class Li extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const ji={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Li,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ri,measureDroppableContainers:yo,windowRect:null,measuringScheduled:!1},Ni={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yo,draggableNodes:new Map,over:null,measureDroppableContainers:yo},Di=eo(Ni),Pi=eo(ji);function Ti(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Li}}}function $i(e,t){switch(t.type){case bo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case bo.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 bo.DragEnd:case bo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case bo.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Li(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case bo.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Li(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case bo.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Li(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ii(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=to(Di),i=$r(r),s=$r(null==n?void 0:n.id);return no(()=>{if(!t&&!r&&i&&null!=s){if(!Br(i))return;if(document.activeElement===i.target)return;const e=o.get(s);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=Kr(e);if(t){t.focus();break}}})}},[r,t,o,s,i]),null}function Mi(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}const zi=eo({...xo,scaleX:1,scaleY:1});var Fi;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Fi||(Fi={})),ao(function(e){var t,n,r,o;let{id:i,accessibility:s,autoScroll:a=!0,children:l,sensors:c=Oi,collisionDetection:u=ko,measuring:d,modifiers:p,...h}=e;const g=lo($i,void 0,Ti),[f,m]=g,[v,b]=function(){const[e]=ro(()=>new Set),t=oo(t=>(e.add(t),()=>e.delete(t)),[e]);return[oo(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[y,x]=ro(Fi.Uninitialized),w=y===Fi.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:A}}=f,_=null!=C?S.get(C):null,O=so({initial:null,translated:null}),E=io(()=>{var e;return null!=C?{id:C,data:null!=(e=null==_?void 0:_.data)?e:Ei,rect:O}:null},[C,_]),R=so(null),[L,j]=ro(null),[N,D]=ro(null),P=Dr(h,Object.values(h)),T=Mr("DndDescribedBy",i),$=io(()=>A.getEnabled(),[A]),I=io(()=>({draggable:{...Ri.draggable,...null==M?void 0:M.draggable},droppable:{...Ri.droppable,...null==M?void 0:M.droppable},dragOverlay:{...Ri.dragOverlay,...null==M?void 0:M.dragOverlay}}),[null==(M=d)?void 0:M.draggable,null==M?void 0:M.droppable,null==M?void 0:M.dragOverlay]);var M;const{droppableRects:z,measureDroppableContainers:F,measuringScheduled:W}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=ro(null),{frequency:a,measure:l,strategy:c}=o,u=so(e),d=function(){switch(c){case fi.Always:return!1;case fi.BeforeDragging:return n;default:return!n}}(),p=Dr(d),h=oo(function(e){void 0===e&&(e=[]),p.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),g=so(null),f=Pr(t=>{if(d&&!n)return vi;if(!t||t===vi||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 qo(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,l]);return no(()=>{u.current=e},[e]),no(()=>{d||h()},[n,d]),no(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),no(()=>{d||"number"!=typeof a||null!==g.current||(g.current=setTimeout(()=>{h(),g.current=null},a))},[a,d,h,...r]),{droppableRects:f,measureDroppableContainers:h,measuringScheduled:null!=i}}($,{dragging:w,dependencies:[k.x,k.y],config:I.droppable}),B=function(e,t){const n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return Pr(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(S,C),H=io(()=>N?Hr(N):null,[N]),V=function(){const e=!1===(null==L?void 0:L.autoScrollEnabled),t="object"==typeof a?!1===a.enabled:!1===a,n=w&&!e&&!t;if("object"==typeof a)return{...a,enabled:n};return{enabled:n}}(),U=function(e,t){return bi(e,t)}(B,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=so(!1),{x:s,y:a}="boolean"==typeof o?{x:o,y:o}:o;jr(()=>{if(!s&&!a||!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=Ao(n(e),r);if(s||(o.x=0),a||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=Do(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,s,a,r,n])}({activeNode:null!=C?S.get(C):null,config:V.layoutShiftCompensation,initialRect:U,measure:I.draggable.measure});const K=wi(B,I.draggable.measure,U),q=wi(B?B.parentElement:null),Y=so({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=A.getNodeFor(null==(t=Y.current.over)?void 0:t.id),X=function(e){let{measure:t}=e;const[n,r]=ro(null),o=yi({callback:oo(e=>{for(const{target:n}of e)if(Er(n)){r(e=>{const r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=oo(e=>{const n=_i(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[s,a]=Tr(i);return io(()=>({nodeRef:s,rect:n,setRef:a}),[n,s,a])}({measure:I.dragOverlay.measure}),Q=null!=(n=X.nodeRef.current)?n:B,G=w?null!=(r=X.rect)?r:K:null,Z=Boolean(X.nodeRef.current&&X.rect),ee=Ao(te=Z?null:K,bi(te));var te;const ne=ki(Q?_r(Q):null),re=function(e){const t=so(e),n=Pr(n=>e?n&&n!==Ci&&e&&t.current&&e.parentNode===t.current.parentNode?n:No(e):Ci,[e]);return no(()=>{t.current=e},[e]),n}(w?null!=J?J:B:null),oe=function(e,t){void 0===t&&(t=Lo);const[n]=e,r=ki(n?_r(n):null),[o,i]=ro(Ai);function s(){i(()=>e.length?e.map(e=>zo(e)?r:new qo(t(e),e)):Ai)}const a=yi({callback:s});return jr(()=>{null==a||a.disconnect(),s(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),o}(re),ie=Mi(p,{transform:{x:k.x-ee.x,y:k.y-ee.y,scaleX:1,scaleY:1},activatorEvent:N,active:E,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:X.rect,scrollableAncestors:re,scrollableAncestorRects:oe,windowRect:ne}),se=H?Fr(H,k):null,ae=function(e){const[t,n]=ro(null),r=so(e),o=oo(e=>{const t=Po(e.target);t&&n(e=>e?(e.set(t,Io(t)),new Map(e)):null)},[]);return no(()=>{const t=r.current;if(e!==t){i(t);const s=e.map(e=>{const t=Po(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,Io(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=Po(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),io(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Fr(e,t),xo):Vo(e):xo,[e,t])}(re),le=Si(ae),ce=Si(ae,[K]),ue=Fr(ie,le),de=G?_o(G,ie):null,pe=E&&de?u({active:E,collisionRect:de,droppableRects:z,droppableContainers:$,pointerCoordinates:se}):null,he=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(pe,"id"),[ge,fe]=ro(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:Fr(ie,ce),null!=(o=null==ge?void 0:ge.rect)?o:null,K),ve=so(null),be=oo((e,t)=>{let{sensor:n,options:r}=t;if(null==R.current)return;const o=S.get(R.current);if(!o)return;const i=e.nativeEvent,s=new n({active:R.current,activeNode:o,event:i,options:r,context:Y,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=P.current,n={id:e};null==t||t(n),v({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!S.get(e))return;const{onDragPending:o}=P.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),v({type:"onDragPending",event:i})},onStart(e){const t=R.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:r}=P.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:O}};ho(()=>{null==r||r(o),x(Fi.Initializing),m({type:bo.DragStart,initialCoordinates:e,active:t}),v({type:"onDragStart",event:o}),j(ve.current),D(i)})},onMove(e){m({type:bo.DragMove,coordinates:e})},onEnd:a(bo.DragEnd),onCancel:a(bo.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=Y.current;let s=null;if(t&&o){const{cancelDrop:a}=P.current;if(s={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===bo.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=bo.DragCancel)}}R.current=null,ho(()=>{m({type:e}),x(Fi.Uninitialized),fe(null),j(null),D(null),ve.current=null;const t=e===bo.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=P.current[t];null==e||e(s),v({type:t,event:s})}})}}ve.current=s},[S]),ye=oo((e,t)=>(n,r)=>{const o=n.nativeEvent,i=S.get(r);if(null!==R.current||!i||o.dndKit||o.defaultPrevented)return;const s={active:i};!0===e(n,t.options,s)&&(o.dndKit={capturedBy:t.sensor},R.current=r,be(n,t))},[S,be]),xe=function(e,t){return io(()=>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){no(()=>{if(!Sr)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(c),jr(()=>{K&&y===Fi.Initializing&&x(Fi.Initialized)},[K,y]),no(()=>{const{onDragMove:e}=P.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};ho(()=>{null==e||e(i),v({type:"onDragMove",event:i})})},[ue.x,ue.y]),no(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=Y.current;if(!e||null==R.current||!t||!o)return;const{onDragOver:i}=P.current,s=r.get(he),a=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};ho(()=>{fe(a),null==i||i(l),v({type:"onDragOver",event:l})})},[he]),jr(()=>{Y.current={activatorEvent:N,active:E,activeNode:B,collisionRect:de,collisions:pe,droppableRects:z,draggableNodes:S,draggingNode:Q,draggingNodeRect:G,droppableContainers:A,over:ge,scrollableAncestors:re,scrollAdjustedTranslate:ue},O.current={initial:G,translated:de}},[E,B,pe,de,S,Q,G,z,A,ge,re,ue]),hi({...V,delta:k,draggingRect:de,pointerCoordinates:se,scrollableAncestors:re,scrollableAncestorRects:oe});const we=io(()=>({active:E,activeNode:B,activeNodeRect:K,activatorEvent:N,collisions:pe,containerNodeRect:q,dragOverlay:X,draggableNodes:S,droppableContainers:A,droppableRects:z,over:ge,measureDroppableContainers:F,scrollableAncestors:re,scrollableAncestorRects:oe,measuringConfiguration:I,measuringScheduled:W,windowRect:ne}),[E,B,K,N,pe,q,X,S,A,z,ge,F,re,oe,I,W,ne]),Ce=io(()=>({activatorEvent:N,activators:xe,active:E,activeNodeRect:K,ariaDescribedById:{draggable:T},dispatch:m,draggableNodes:S,over:ge,measureDroppableContainers:F}),[N,xe,E,K,m,T,S,ge,F]);return Zr.createElement(go.Provider,{value:b},Zr.createElement(Di.Provider,{value:Ce},Zr.createElement(Pi.Provider,{value:we},Zr.createElement(zi.Provider,{value:me},l)),Zr.createElement(Ii,{disabled:!1===(null==s?void 0:s.restoreFocus)})),Zr.createElement(vo,{...s,hiddenTextDescribedById:T}))});const Wi=eo(null),Bi="button";function Hi(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Mr("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=to(Di),{role:h=Bi,roleDescription:g="draggable",tabIndex:f=0}=null!=o?o:{},m=(null==l?void 0:l.id)===t,v=to(m?zi:Wi),[b,y]=Tr(),[x,w]=Tr(),C=function(e,t){return io(()=>e.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[e,t])}(s,t),S=Dr(n);jr(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:S}),()=>{const e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:io(()=>({role:h,tabIndex:f,"aria-disabled":r,"aria-pressed":!(!m||h!==Bi)||void 0,"aria-roledescription":g,"aria-describedby":u.draggable}),[r,h,f,m,g,u.draggable]),isDragging:m,listeners:r?void 0:C,node:b,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:v}}const Vi={timeout:25};function Ui(e){let{animation:t,children:n}=e;const[r,o]=ro(null),[i,s]=ro(null),a=$r(n);return n||r||!a||o(a),jr(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),Zr.createElement(Zr.Fragment,null,n,r?co(r,{ref:s}):null)}const Ki={x:0,y:0,scaleX:1,scaleY:1};function qi(e){let{children:t}=e;return Zr.createElement(Di.Provider,{value:Ni},Zr.createElement(zi.Provider,{value:Ki},t))}const Yi={position:"fixed",touchAction:"none"},Ji=e=>Br(e)?"transform 250ms ease":void 0,Xi=uo((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:u=Ji}=e;if(!a)return null;const d=o?c:{...c,scaleX:1,scaleY:1},p={...Yi,width:a.width,height:a.height,top:a.top,left:a.left,transform:Vr.Transform.toString(d),transformOrigin:o&&r?wo(r,a):void 0,transition:"function"==typeof u?u(r):u,...l};return Zr.createElement(n,{className:s,style:p,ref:t},i)}),Qi={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(n)}]},sideEffects:(Gi={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const r={},{styles:o,className:i}=Gi;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 Gi;function Zi(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return Nr((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const l=_i(i);if(!l)return;const{transform:c}=_r(i).getComputedStyle(i),u=Eo(c);if(!u)return;const d="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Qi,...e};return e=>{let{active:i,dragOverlay:s,transform:a,...l}=e;if(!t)return;const c={x:s.rect.left-i.rect.left,y:s.rect.top-i.rect.top},u={scaleX:1!==a.scaleX?i.rect.width*a.scaleX/s.rect.width:1,scaleY:1!==a.scaleY?i.rect.height*a.scaleY/s.rect.height:1},d={x:a.x-c.x,y:a.y-c.y,...u},p=o({...l,active:i,dragOverlay:s,transform:{initial:a,final:d}}),[h]=p,g=p[p.length-1];if(JSON.stringify(h)===JSON.stringify(g))return;const f=null==r?void 0:r({active:i,dragOverlay:s,...l}),m=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==f||f(),e()}})}}(t);return Uo(a,o.draggable.measure),d({active:{id:e,data:s.data,node:a,rect:o.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(l)},droppableContainers:r,measuringConfiguration:o,transform:u})})}let es=0;function ts(e){return io(()=>{if(null!=e)return es++,es},[e])}const ns=Zr.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:f,dragOverlay:m,over:v,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=to(Pi),C=to(zi),S=ts(null==d?void 0:d.id),k=Mi(s,{activatorEvent:u,active:d,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:m.rect,over:v,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:C,windowRect:w}),A=bi(p),_=Zi({config:r,draggableNodes:g,droppableContainers:f,measuringConfiguration:b}),O=A?m.setRef:void 0;return Zr.createElement(qi,null,Zr.createElement(Ui,{animation:_},d&&S?Zr.createElement(Xi,{key:S,id:d.id,ref:O,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:A,style:{zIndex:c,...o},transform:k},n):null))}),rs=t,{useEffect:os}=t,{useRef:is}=t,ss=n,{styled:as}=r,{Chip:ls}=i,{color:cs}=s,{renderMath:us}=p;function ds(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const ps=as("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&&{}})),hs=as(ls)(()=>({backgroundColor:cs.white(),border:`1px solid ${cs.text()}`,color:cs.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}})),gs=as("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function fs({choice:e,disabled:t,instanceId:n}){const r=is(null),{attributes:o,listeners:i,setNodeRef:s,isDragging:a}=Hi({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return os(()=>{us(r.current)},[e.value]),rs.createElement(ps,{ref:s,style:a?{width:ds([r,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:ds([r,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...o},rs.createElement(hs,{clickable:!1,disabled:t,ref:r,label:rs.createElement(gs,{dangerouslySetInnerHTML:{__html:e.value}})}))}fs.propTypes={choice:ss.object.isRequired,disabled:ss.bool,instanceId:ss.oneOfType([ss.string,ss.number])};const ms=t,vs=n,{DragDroppablePlaceholder:bs}=h;class ys extends ms.Component{constructor(...e){super(...e),ys.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:vs.bool,duplicates:vs.bool,choices:vs.arrayOf(vs.shape({label:vs.string,value:vs.string})),value:vs.object,choicePosition:vs.string.isRequired,instanceId:vs.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 Gt(e,function(e,r,o){if(t(e,r,o))return n=r,!1}),n}(r,Yt(t=>t===e.id));return void 0===n}),s={...this.getStyleForWrapper(),minWidth:"100px"};return ms.createElement("div",{style:s},ms.createElement(bs,{disabled:e,instanceId:o},i.map((t,n)=>ms.createElement(fs,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:o}))))}}ys.__initStatic();const xs=t,{useEffect:ws}=t,{useRef:Cs}=t,{useState:Ss}=t,ks=n,As=e,{styled:_s}=r,{Chip:Os}=i,Es=l,{color:Rs}=s,{grey:Ls}=a,{renderMath:js}=p;function Ns(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}As("pie-lib:mask-markup:blank");const Ds=_s("span")(({dragged:e,over:t})=>({border:`solid 0px ${Rs.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),Ps=_s(Os)(()=>({backgroundColor:Rs.background(),border:`2px dashed ${Rs.text()}`,touchAction:"none",color:Rs.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ls[500]}`,backgroundColor:`${Ls[300]}`},"&.correct":{border:`solid 1px ${Rs.correct()}`},"&.incorrect":{border:`solid 1px ${Rs.incorrect()}`},"&.Mui-disabled":{opacity:1}})),Ts=_s("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 $s({disabled:e,choice:t,isOver:n,isDragging:r,dragItem:o,correct:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a}){const l=Cs(null),c=Cs(null),u=Cs(null),[d,p]=Ss({height:0,width:0}),h=()=>{f()},g=()=>{const e=Ns([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=h:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto",l.current.style.height="auto",l.current.offsetHeight;const e=(()=>{if(!c.current)return null;if(c.current.querySelector("mjx-container")&&c.current.parentElement)return c.current.parentElement;return c.current.querySelector("img")||c.current})()||c.current,t=e.getBoundingClientRect(),n=(t.width||e.offsetWidth||0)+24,r=Math.max(t.height||0,e.offsetHeight||0,e.scrollHeight||0,c.current.scrollHeight||0)+24,o=parseFloat(s)||0,i=parseFloat(a)||0,u=n<=o?o:n,d=r<=i?i:r;p(e=>({width:u>o?u:e.width,height:d>i?d:e.height})),l.current.style.width=`${u}px`,l.current.style.height=`${d}px`}};ws(()=>{g()},[]),ws(()=>{l.current&&js(l.current)},[n,Ns([o,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),ws(()=>{t?g():p({height:0,width:0})},[t]),ws(()=>{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:Ns([u,"access",e=>e.current,"optionalAccess",e=>e.width]),height:Ns([u,"access",e=>e.current,"optionalAccess",e=>e.height])}:(()=>{const e=isNaN(parseFloat(s))?0:parseFloat(s),t=isNaN(parseFloat(a))?0:parseFloat(a);return{...{height:d.height||t,width:d.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return xs.createElement(Ps,{clickable:!1,disabled:e,ref:l,component:"span",label:xs.createElement(xs.Fragment,null,xs.createElement(Ts,{ref:c,draggable:!0,className:Es({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:v||""}}),m&&xs.createElement(Ts,{draggable:!0,className:Es({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Es({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:b})}function Is({id:e,disabled:t,duplicates:n,choice:r,correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}){const{attributes:c,listeners:u,setNodeRef:d,transform:p,isDragging:h}=Hi({id:`mask-blank-drag-${e}`,disabled:t||!r,data:{id:e,choice:r,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:g,isOver:f,active:m}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Mr("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=to(Di),u=so({disabled:n}),d=so(!1),p=so(null),h=so(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...Vi,...o},v=Dr(null!=f?f:r),b=yi({callback:oo(()=>{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:g||!s}),y=oo((e,t)=>{b&&(t&&(b.unobserve(t),d.current=!1),e&&b.observe(e))},[b]),[x,w]=Tr(y),C=Dr(t);return no(()=>{b&&x.current&&(b.disconnect(),d.current=!1,b.observe(x.current))},[x,b]),no(()=>(a({type:bo.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:p,data:C}}),()=>a({type:bo.UnregisterDroppable,key:i,id:r})),[r]),no(()=>{n!==u.current.disabled&&(a({type:bo.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:s,rect:p,isOver:(null==l?void 0:l.id)===r,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),v={transform:Vr.Translate.toString(p)};return xs.createElement(Ds,{ref:e=>{d(e),g(e)},style:v,dragged:h,over:f,...c,...u},xs.createElement($s,{id:e,disabled:t,duplicates:n,choice:r,isOver:f,dragItem:Ns([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:o,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}))}$s.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},$s.propTypes={id:ks.oneOfType([ks.string,ks.number]),disabled:ks.bool,duplicates:ks.bool,choice:ks.object,isOver:ks.bool,dragItem:ks.object,correct:ks.bool,onChange:ks.func,emptyResponseAreaWidth:ks.oneOfType([ks.string,ks.number]),emptyResponseAreaHeight:ks.oneOfType([ks.string,ks.number]),instanceId:ks.string},Is.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},Is.propTypes={id:ks.oneOfType([ks.string,ks.number]),disabled:ks.bool,duplicates:ks.bool,choice:ks.object,correct:ks.bool,onChange:ks.func,emptyResponseAreaWidth:ks.oneOfType([ks.string,ks.number]),emptyResponseAreaHeight:ks.oneOfType([ks.string,ks.number]),instanceId:ks.string};const Ms=t,zs=n,{DragProvider:Fs}=h;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 Bs=vr("blank",e=>(t,n,r)=>{const o=Ws([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===o.component){const{disabled:i,duplicates:s,correctResponse:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:p,isDragging:h}=e,g=c?a[o.id]:n[o.id],f=g&&e.choices.find(e=>e.id===g);return Ms.createElement(Is,{key:`${t.type}-${o.id}`,correct:c||l&&l[o.id],disabled:i,duplicates:s,choice:f,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 Hs extends Ms.Component{constructor(e){super(e),Hs.prototype.__init.call(this),Hs.prototype.__init2.call(this),Hs.prototype.__init3.call(this),Hs.prototype.__init4.call(this),this.state={activeDragItem:null,dropAnimation:void 0}}static __initStatic(){this.propTypes={markup:zs.string,layout:zs.object,choicesPosition:zs.string,choices:zs.array,value:zs.object,onChange:zs.func,duplicates:zs.bool,disabled:zs.bool,feedback:zs.object,correctResponse:zs.object,showCorrectAnswer:zs.bool,emptyResponseAreaWidth:zs.oneOfType([zs.string,zs.number]),emptyResponseAreaHeight:zs.oneOfType([zs.string,zs.number]),instanceId:zs.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;Ws([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current,dropAnimation:void 0})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?Ms.createElement(fs,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:r,value:o}=this.props,i=Ws([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),s=Ws([n,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),a=!!t&&!!n&&"MaskBlank"===Ws([i,"optionalAccess",e=>e.type])&&Ws([s,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")]);if(this.setState({activeDragItem:null,dropAnimation:a?null:void 0}),!a||!r)return;const l=i,c=s.id;if(!0===s.toChoiceBoard){if(!l.fromChoice&&l.id){const e={...o};delete e[l.id],r(e)}}else if(!0===l.fromChoice){if(c&&"drag-in-the-blank-droppable"!==c){const e={...o};e[c]=l.choice.id,r(e)}}else if(l.id&&l.id!==c){const e={...o};e[c]=l.choice.id,delete e[l.id],r(e)}}}__init4(){this.getPositionDirection=e=>{let t,n,r;switch(e){case"left":t="row",r="center";break;case"right":t="row-reverse",n="flex-end",r="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:r}}}render(){const{markup:e,duplicates:t,value:n,onChange:r,choicesPosition:o,choices:i,correctResponse:s,disabled:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,layout:p,instanceId:h}=this.props,g=o||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(g)};return Ms.createElement(Fs,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:ko},Ms.createElement("div",{ref:e=>this.rootRef=e,style:f},Ms.createElement(ys,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:a,instanceId:h}),Ms.createElement(Bs,{elementType:"drag-in-the-blank",markup:e,layout:p,value:n,choices:i,onChange:r,disabled:a,duplicates:t,feedback:l,correctResponse:s,showCorrectAnswer:c,emptyResponseAreaWidth:u,emptyResponseAreaHeight:d,instanceId:h,isDragging:!!this.state.activeDragItem}),Ms.createElement(ns,{style:{pointerEvents:"none"},dropAnimation:this.state.dropAnimation},this.renderDragOverlay())))}}Hs.__initStatic(),Hs.__initStatic2();const Vs=t,{styled:Us}=r,Ks=l,{color:qs}=s;function Ys(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 Js,Xs;"undefined"!=typeof window&&(Js=require("@pie-lib/editable-html-tip-tap").default,Xs=Us(Js)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${qs.black()}`,"&.correct":{border:`1px solid ${qs.correct()}`},"&.incorrect":{border:`1px solid ${qs.incorrect()}`}})));var Qs=vr("input",e=>(t,n)=>{const{adjustedLimit:r,disabled:o,feedback:i,showCorrectAnswer:s,maxLength:a,spellCheck:l,pluginProps:c,onChange:u}=e,d=Ys([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===d.component){const p=(e.choices&&d&&e.choices[d.id]||[])[0],h=s?p&&p.label:n[d.id]||"",g=a&&a[d.id],f=i&&i[d.id],m=s||"correct"===f,v=!s&&"incorrect"===f,b=e=>{const t={...n,[d.id]:e};u(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return Vs.createElement(Xs,{id:d.id,key:`${t.type}-input-${d.id}`,disabled:s||o,disableUnderline:!0,onChange:b,markup:h||"",charactersLimit:r?g:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,adjustWidthForLimit:!0,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!Ys([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:Ks({correct:m,incorrect:v})})}});vr("input",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("input"===o.component)return e.customMarkMarkupComponent(o.id)});const Gs=t,Zs=n,{Button:ea}=i,{InputLabel:ta}=i,{Menu:na}=i,{MenuItem:ra}=i,{ArrowDropDown:oa}=c,{ArrowDropUp:ia}=c,{Close:sa}=c,{Check:aa}=c,{styled:la}=r,{color:ca}=s,{renderMath:ua}=p,da=la(ea)(()=>({color:ca.text(),border:`1px solid ${ca.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:ca.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"24px"},"& svg":{position:"absolute",right:"4px",top:"calc(50% - 12px)",pointerEvents:"none",color:ca.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${ca.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:ca.correct(),color:`${ca.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:ca.incorrectWithIcon(),color:`${ca.text()} !important`}})),pa=la(na)(()=>({backgroundColor:ca.background(),border:`1px solid ${ca.correct()} !important`,"&:hover":{border:`1px solid ${ca.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${ca.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),ha=la(ra)(()=>({height:24,overflow:"hidden",fontSize:"1rem",fontWeight:400,fontFamily:"inherit",lineHeight:"1.5em",whiteSpace:"nowrap",color:ca.text(),backgroundColor:ca.background(),"&.Mui-focusVisible":{outline:`3px solid ${ca.tertiary()}`,outlineOffset:"-1px",color:ca.text(),backgroundColor:ca.background()},"&:hover":{color:ca.text(),backgroundColor:ca.dropdownBackground()},boxSizing:"border-box",padding:"16px 8px",borderRadius:"4px","&.selected":{color:`${ca.text()} !important`,backgroundColor:`${ca.background()} !important`,"&:hover":{color:ca.text(),backgroundColor:`${ca.dropdownBackground()} !important`}}})),ga=la("span")(()=>({fontSize:"max(1rem, 14px)"})),fa=la("span")(()=>({fontSize:"max(1rem, 14px)",flexShrink:0,paddingLeft:"8px"})),ma=la(ta)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),va=la(aa)(()=>({color:`${ca.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ca.correct()},"&.incorrect":{backgroundColor:ca.incorrectWithIcon()}})),ba=la(sa)(()=>({color:`${ca.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:ca.correct()},"&.incorrect":{backgroundColor:ca.incorrectWithIcon()}}));class ya extends Gs.Component{static __initStatic(){this.propTypes={id:Zs.string,value:Zs.string,disabled:Zs.bool,onChange:Zs.func,correct:Zs.bool,choices:Zs.arrayOf(Zs.shape({value:Zs.string,label:Zs.string})),showCorrectAnswer:Zs.bool,singleQuery:Zs.bool,correctValue:Zs.string}}constructor(e){super(e),ya.prototype.__init.call(this),ya.prototype.__init2.call(this),ya.prototype.__init3.call(this),ya.prototype.__init4.call(this),ya.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=Gs.createRef(),this.buttonRef=Gs.createRef(),this.previewRef=Gs.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||ua(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&ua(e)}),ua(n),this.setState({menuWidth:e}))}}__init(){this.handleClick=e=>{const{id:t,value:n,choices:r}=this.props;let o=null;if(n){const e=(r||[]).findIndex(e=>e.value===n);e>=0&&(o=`dropdown-option-${t}-${e}`)}this.setState({anchorEl:e.currentTarget,highlightedOptionId:o})}}__init2(){this.handleClose=()=>{const{value:e}=this.props;this.setState({anchorEl:null,previewValue:null,highlightedOptionId:null}),!e&&this.previewRef.current&&(this.previewRef.current.innerHTML="")}}__init3(){this.handleHighlight=e=>{const t={highlightedOptionId:`dropdown-option-${this.props.id}-${e}`};this.props.value||(t.previewValue=this.props.choices[e].value),this.setState(t)}}__init4(){this.handleSelect=(e,t)=>{this.props.onChange(this.props.id,e),this.handleHighlight(t),this.handleClose()}}__init5(){this.handleHover=e=>{if(this.props.value)return;const t=`dropdown-option-${this.props.id}-${e}`,n=this.state.previewValue;this.setState({highlightedOptionId:t,previewValue:n},()=>{const t=this.elementRefs[e],n=this.previewRef.current;t&&n&&(n.innerHTML=t.innerHTML)})}}getLabel(e,t){const n=(e||[]).find(e=>e.value===t);return n?n.label.trim():void 0}render(){const{id:e,correct:t,disabled:n,value:r,choices:o,showCorrectAnswer:i,singleQuery:s,correctValue:a}=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 g=parseInt(e,10)+1,f=s?"Query-label":`Query-label-${g}`,m=s?"Query":`Query ${g}`;let v=null;return n&&void 0!==t&&(v=t||i?Gs.createElement(va,{className:"correct"}):Gs.createElement(ba,{className:"incorrect"})),Gs.createElement(Gs.Fragment,null,Gs.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(o||[]).map((e,t)=>Gs.createElement(ha,{key:t,tabIndex:-1,"aria-hidden":"true"},Gs.createElement(ga,{dangerouslySetInnerHTML:{__html:e.label}})))),Gs.createElement(ma,{id:f,tabIndex:-1,"aria-hidden":"true"},m),Gs.createElement(da,{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,Gs.createElement(ga,{id:p,ref:this.previewRef,dangerouslySetInnerHTML:{__html:a||(c&&this.state.previewValue?this.getLabel(o,this.state.previewValue):this.getLabel(o,r)||"")}}),c?Gs.createElement(ia,null):Gs.createElement(oa,null)),Gs.createElement(pa,{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 Gs.createElement(ha,{id:o,className:t.value===r?"selected":"",selected:t.value===r,key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===o?"true":void 0,onMouseOver:()=>this.handleHover(n)},Gs.createElement(ga,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),Gs.createElement(fa,{dangerouslySetInnerHTML:{__html:t.value===r?" &check;":""}}))})))}}ya.__initStatic();const xa=t;function wa(e,t){return null!=e?e:t()}function Ca(e){let t,n=e[0],r=1;for(;r<e.length;){const o=e[r],i=e[r+1];if(r+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=i(n)):"call"!==o&&"optionalCall"!==o||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}vr("dropdown",e=>(t,n,r)=>{const o=t.data&&t.data.dataset||{};if("dropdown"===o.component){const{choices:i,disabled:s,feedback:a,showCorrectAnswer:l}=e,c=i&&i[o.id]&&i[o.id].find(e=>e.correct),u=l?c&&c.value:n[o.id];return xa.createElement(ya,{key:`${t.type}-dropdown-${o.id}`,correct:a&&a[o.id]&&"correct"===a[o.id],disabled:s||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 Sa=e=>"string"==typeof e,ka=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Aa=e=>null==e?"":""+e,_a=/###/g,Oa=e=>e&&e.indexOf("###")>-1?e.replace(_a,"."):e,Ea=e=>!e||Sa(e),Ra=(e,t,n)=>{const r=Sa(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Ea(e))return{};const t=Oa(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Ea(e)?{}:{obj:e,k:Oa(r[o])}},La=(e,t,n)=>{const{obj:r,k:o}=Ra(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=Ra(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Ra(e,s,Object),Ca([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},ja=(e,t)=>{const{obj:n,k:r}=Ra(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Na=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Sa(e[r])||e[r]instanceof String||Sa(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Na(e[r],t[r],n):e[r]=t[r]);return e},Da=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pa={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Ta=e=>Sa(e)?e.replace(/[&<>"'\/]/g,e=>Pa[e]):e;const $a=[" ",",","?","!",";"],Ia=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ma=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let s=e;s<r.length;++s)if(s!==e&&(i+=n),i+=r[s],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;e+=s-e+1;break}o=t}return o},za=e=>Ca([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),Fa={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Ca([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Wa{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fa,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(Sa(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Wa(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Wa(this.logger,e)}}var Ba=new Wa;class Ha{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[e,...t])})}}}class Va extends Ha{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):Sa(n)&&o?s.push(...n.split(o)):s.push(n)));const a=ja(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Sa(n)?Ma(Ca([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):a}addResource(e,t,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),r=t,t=s[1]),this.addNamespaces(t),La(this.data,s,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const r in n)(Sa(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),r=n,n=t,t=s[1]),this.addNamespaces(t);let a=ja(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Na(a,n,o):a={...a,...n},La(this.data,s,a),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Ua={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=wa(Ca([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,r,o)]),()=>t)}),t}};const Ka=Symbol("i18next/PATH_KEY");function qa(e,t){const{[Ka]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,o)=>(Ca([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===Ka?e:(e.push(o),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(wa(Ca([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const Ya={},Ja=e=>!Sa(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Xa extends Ha{constructor(e,t={}){var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(r[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Ba.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);if(void 0===Ca([r,"optionalAccess",e=>e.res]))return!1;const o=Ja(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=$a.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=Ia.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Sa(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:Sa(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=qa(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],r),l=a[a.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Ca([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return d?o?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:s;const p=this.resolve(e,r);let h=Ca([p,"optionalAccess",e=>e.res]);const g=Ca([p,"optionalAccess",e=>e.usedKey])||s,f=Ca([p,"optionalAccess",e=>e.exactUsedKey])||s,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!Sa(r.count),y=Xa.hasDefaultValue(r),x=b?this.pluralResolver.getSuffix(u,r.count,r):"",w=r.ordinal&&b?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",C=b&&!r.ordinal&&0===r.count,S=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${x}`]||r[`defaultValue${w}`]||r.defaultValue;let k=h;v&&!h&&y&&(k=S);const A=Ja(k),_=Object.prototype.toString.apply(k);if(!(v&&k&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(_)<0)||Sa(m)&&Array.isArray(k))if(v&&Sa(m)&&Array.isArray(h))h=h.join(m),h&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&y&&(t=!0,h=S),this.isValidLookup(h)||(o=!0,h=s);const a=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,d=y&&S!==h&&this.options.updateMissing;if(o||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,s,d?S:h),i){const e=this.resolve(s,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const o=y&&n!==h?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,o,d,r):Ca([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,o,d,r),this.emit("missingKey",e,l,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,r[`defaultValue${t}`]||S)})}):n(e,s,S))}h=this.extendTranslation(h,e,r,p,n),o&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}${c}${s}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?h:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,k,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(i){const e=Array.isArray(k),t=e?[]:{},n=e?f:g;for(const e in k)if(Object.prototype.hasOwnProperty.call(k,e)){const o=`${n}${i}${e}`;t[e]=y&&!h?this.translate(o,{...r,defaultValue:Ja(S)?S[e]:void 0,joinArrays:!1,ns:a}):this.translate(o,{...r,joinArrays:!1,ns:a}),t[e]===o&&(t[e]=k[e])}h=t}}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(Ca([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Sa(e)&&(void 0!==Ca([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let a=n.replace&&!Sa(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),e=this.interpolator.interpolate(e,a,n.lng||this.language||r.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>Ca([o,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=Sa(i)?[i]:i;return null!=e&&Ca([s,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=Ua.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,s;return Sa(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;r=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!Sa(t.count),d=u&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(Sa(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(s=e,Ya[`${h[0]}-${e}`]||!Ca([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ca([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(s)])||(Ya[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(r=>{if(this.isValidLookup(n))return;i=r;const s=[l];if(Ca([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(o)&&s.push(l+e.replace(o,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+n)),p){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),u&&(t.ordinal&&0===e.indexOf(o)&&s.push(r+e.replace(o,this.options.pluralSeparator)),s.push(r+e),d&&s.push(r+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:s}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return Ca([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Sa(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class Qa{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ba.create("languageUtils")}getScriptPartFromCode(e){if(!(e=za(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=za(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Sa(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Sa(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Sa(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Sa(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}const Ga={zero:0,one:1,two:2,few:3,many:4,other:5},Za={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class el{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ba.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=za("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Za;if(!e.match(/-|_/))return Za;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),Ca([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Ga[e]-Ga[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const tl=(e,t,n,r=".",o=!0)=>{let i=((e,t,n)=>{const r=ja(e,n);return void 0!==r?r:ja(t,n)})(e,t,n);return!i&&o&&Sa(n)&&(i=Ma(e,n,r),void 0===i&&(i=Ma(t,n,r))),i},nl=e=>e.replace(/\$/g,"$$$$");class rl{constructor(e={}){this.logger=Ba.create("interpolator"),this.options=e,this.format=Ca([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:h,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Ta,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Da(o):i||"{{",this.suffix=s?Da(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Da(d):p||Da("$t("),this.nestingSuffix=h?Da(h):g||Da(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Ca([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const o=tl(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(tl(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const c=Ca([r,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,u=void 0!==Ca([r,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>nl(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?nl(this.escape(e)):nl(e)}].forEach(t=>{for(s=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,o,r);i=Sa(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(u){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Sa(i)||this.useRawValueToEscape||(i=Aa(i));const a=t.safeValue(i);if(e=e.replace(o[0],a),u?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i;const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;e=r[0],o=this.interpolate(o,i);const s=o.match(/'/g),a=o.match(/"/g);(wa(Ca([s,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let a=[];i={...n},i=i.replace&&!Sa(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(a=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),o=t(s.call(this,r[1].trim(),i),i),o&&r[0]===e&&!Sa(o))return o;Sa(o)||(o=Aa(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),a.length&&(o=a.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}const ol=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=t[s];return a||(a=e(za(r),o),t[s]=a),a(n)}},il=e=>(t,n,r)=>e(za(n),r)(t);class sl{constructor(e={}){this.logger=Ba.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ol:il;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ol(t)}format(e,t,n,r={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const s=Ca([r,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[r.interpolationkey]])||{},a=s.locale||s.lng||r.locale||r.lng||n;t=this.formats[o](e,a,{...i,...r,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class al extends Ha{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Ba.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],Ca([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,r.backend,r)])}queueLoad(e,t,n,r){const o={},i={},s={},a={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const s=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))}),r||(s[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const s={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=Ra(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{s[e]||(s[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{const n=a(e,t);n&&"function"==typeof n.then?n.then(e=>s(null,e)).catch(s):s(null,n)}catch(e){s(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Sa(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Sa(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},s=()=>{}){if(!Ca([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ca([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(Ca([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...i,isUpdate:o},l=this.backend.create.bind(this.backend);if(l.length<6)try{let o;o=5===l.length?l(e,t,n,r,a):l(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else l(e,t,n,r,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const ll=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Sa(e[1])&&(t.defaultValue=e[1]),Sa(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),cl=e=>(Sa(e.ns)&&(e.ns=[e.ns]),Sa(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Sa(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Ca([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),ul=()=>{};class dl extends Ha{constructor(e={},t){var n;if(super(),this.options=cl(e),this.services={},this.logger=Ba,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Sa(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ll();var r;this.options={...n,...this.options,...cl(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(Ca([r=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ca([r,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ca([r,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&r.options.backend.backends.some(e=>Ca([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Ca([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Ba.init(o(this.modules.logger),this.options):Ba.init(null,this.options),e=this.modules.formatter?this.modules.formatter:sl;const t=new Qa(this.options);this.store=new Va(this.options.resources,this.options);const r=this.services;r.logger=Ba,r.resourceStore=this.store,r.languageUtils=t,r.pluralResolver=new el(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(r.formatter=o(e),r.formatter.init&&r.formatter.init(r,this.options),this.options.interpolation.format=r.formatter.format.bind(r.formatter)),r.interpolator=new rl(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new al(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init&&r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new Xa(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ul),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=ka(),s=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e,t=ul){let n=t;const r=Sa(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Ca([r,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(r)t(r);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}Ca([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=ka();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=ul),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ua.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=ka();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Sa(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Sa(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),Ca([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const s=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=qa(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=qa(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return Sa(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return Ca([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Ca([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=ka();return this.options.ns?(Sa(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=ka();Sa(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Ca([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=Ca([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new Qa(ll());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new dl(e,t);return n.createInstance=dl.createInstance,n}cloneInstance(e={},t=ul){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new dl(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});o.store=new Va(e,r),o.services.resourceStore=o.store}if(e.interpolation){const t={...ll().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new rl(n)}return o.translator=new Xa(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pl=dl.createInstance();pl.createInstance,pl.dir,pl.init,pl.loadResources,pl.reloadResources,pl.use,pl.changeLanguage,pl.getFixedT,pl.t,pl.exists,pl.setDefaultNamespace,pl.hasLoadedNamespace,pl.loadNamespaces,pl.loadLanguages;pl.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var hl={translator:{...pl,t:(e,t)=>{const{lng:n}=t;switch(n){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return pl.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const gl=t,fl=n,ml=u,{color:vl}=s,{Collapsible:bl}=s,{hasText:yl}=s,{hasMedia:xl}=s,{PreviewPrompt:wl}=s,{UiLayout:Cl}=s,{styled:Sl}=r,{translator:kl}=hl,Al=Sl(Cl)(({alwaysShowCorrect:e})=>({color:vl.text(),backgroundColor:vl.background(),...e&&{"& *":{borderColor:`${vl.text()} !important`}}})),_l=Sl("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Ol=Sl("div")(({theme:e})=>({marginBottom:e.spacing(2)})),El=Sl("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"});class Rl extends gl.Component{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)}static __initStatic(){this.propTypes={alwaysShowCorrect:fl.bool,animationsDisabled:fl.bool,disabled:fl.bool,displayType:fl.string,feedback:fl.object,language:fl.string,markup:fl.string,maxLengthPerChoice:fl.array,maxLengthPerChoiceEnabled:fl.bool,mode:fl.string,note:fl.string,onChange:fl.func,playerSpellCheckEnabled:fl.bool,prompt:fl.string,rationale:fl.string,role:fl.string,showNote:fl.bool,teacherInstructions:fl.string,value:fl.object,responseAreaInputConfiguration:fl.object,model:fl.object.isRequired}}static __initStatic2(){this.defaultProps={value:{}}}__init(){this.state={showCorrectAnswer:this.props.alwaysShowCorrect||!1}}__init2(){this.getChangeSession=e=>e&&e.every((e,t,n)=>e===n[0]&&1===e)?this.props.onChange:nn(this.props.onChange,200,{maxWait:200})}UNSAFE_componentWillReceiveProps(e){const{maxLengthPerChoice:t,language:n}=this.props;let{note:r}=this.props;var o,i;(function(e){if(null==e)return!0;if(de(e)&&(N(e)||"string"==typeof e||"function"==typeof e.splice||Ce(e)||Le(e)||be(e)))return!e.length;var t=At(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(he(e))return!$e(e).length;for(var n in e)if(rn.call(e,n))return!1;return!0})(e.feedback)&&this.setState({showCorrectAnswer:!1}),e.alwaysShowCorrect&&this.setState({showCorrectAnswer:!0}),t&&(o=t,i=e.maxLengthPerChoice,!Wt(o,i))&&(this.changeSession=this.getChangeSession(e.maxLengthPerChoice)),r&&n&&n!==e.language&&r===kl.t("common:commonCorrectAnswerWithAlternates",{lng:n})&&(r=kl.t("common:commonCorrectAnswerWithAlternates",{lng:e.language}))}__init3(){this.toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})}}__init4(){this.changeSession=this.getChangeSession(this.props.maxLengthPerChoice)}__init5(){this.onChange=e=>{this.changeSession(e)}}render(){const{showCorrectAnswer:e}=this.state,{alwaysShowCorrect:t,animationsDisabled:n,mode:r,displayType:o,role:i,language:s,maxLengthPerChoice:a,maxLengthPerChoiceEnabled:l,note:c,playerSpellCheckEnabled:u,prompt:d,rationale:p,showNote:h,teacherInstructions:g,responseAreaInputConfiguration:f,model:m,value:v}=this.props,{extraCSSRules:b}=m||{},y=(e||"view"===r&&"instructor"===i)&&h&&c,x=gl.createElement(wl,{defaultClassName:"teacher-instructions",prompt:g}),w=gl.createElement(wl,{prompt:p}),C=p&&(yl(p)||xl(p)),S=g&&(yl(g)||xl(g));return gl.createElement(Al,{extraCSSRules:b,alwaysShowCorrect:t,style:{display:`${o}`}},"gather"===r&&gl.createElement(El,null,"Fill in the Blank Question"),S&&gl.createElement(Ol,null,n?x:gl.createElement(bl,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},x)),d&&gl.createElement(wl,{prompt:d}),!t&&"evaluate"===r&&gl.createElement(ml,{show:!0,toggled:e,onToggle:this.toggleShowCorrect,language:s}),gl.createElement(Qs,{...this.props,onChange:this.onChange,showCorrectAnswer:e,value:v,maxLength:a,adjustedLimit:l,spellCheck:u,pluginProps:f}),y&&gl.createElement(_l,{dangerouslySetInnerHTML:{__html:c}}),C&&gl.createElement(Ol,null,n?w:gl.createElement(bl,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},w)))}}Rl.__initStatic(),Rl.__initStatic2();const Ll=t,{createRoot:jl}=d,{renderMath:Nl}=p;class Dl extends HTMLElement{constructor(){super(),Dl.prototype.__init.call(this),Dl.prototype.__init2.call(this),Dl.prototype.__init3.call(this),this._model=null,this._session=null,this._root=null}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}set model(e){this._model=e,this.dispatchEvent(new m(this.tagName.toLowerCase(),this.session&&!!this.session.value,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}__init(){this._render=()=>{if(this._model&&this._session){let e=Ll.createElement(Rl,{choices:this._model.choices,disabled:this._model.disabled,displayType:this._model.displayType,feedback:this._model.feedback,language:this._model.language,markup:this._model.markup,maxLengthPerChoice:this._model.maxLengthPerChoice,maxLengthPerChoiceEnabled:this._model.maxLengthPerChoiceEnabled,mode:this._model.mode,note:this._model.note,onChange:this.changeSession,playerSpellCheckEnabled:this._model.playerSpellCheckEnabled,prompt:this._model.prompt,rationale:this._model.rationale,role:this._model.role,showNote:this._model.showNote,teacherInstructions:this._model.teacherInstructions,value:this._session.value,responseAreaInputConfiguration:this._model.responseAreaInputConfiguration});this._root||(this._root=jl(this)),this._root.render(e),queueMicrotask(()=>{Nl(this)})}}}__init2(){this.dispatchChangedEvent=()=>{this.dispatchEvent(new b(this.tagName.toLowerCase(),this.session&&!!this.session.value))}}__init3(){this.changeSession=e=>{this.session.value=e,this.dispatchChangedEvent(),this._render()}}connectedCallback(){this.setAttribute("aria-label","Fill in the Blank Question"),this.setAttribute("role","region"),this._render()}disconnectedCallback(){this._root&&this._root.unmount()}}export{Dl as default};