@pie-element/explicit-constructed-response 10.0.0-next.43 → 10.1.1-next.1
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/CHANGELOG.md +1029 -2481
- package/configure/CHANGELOG.md +749 -2062
- package/configure/lib/alternateResponses.js +7 -10
- package/configure/lib/alternateResponses.js.map +1 -1
- package/configure/lib/alternateSection.js +4 -6
- package/configure/lib/alternateSection.js.map +1 -1
- package/configure/lib/defaults.js +3 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +6 -7
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +8 -11
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/markupUtils.js +2 -3
- package/configure/lib/markupUtils.js.map +1 -1
- package/configure/package.json +6 -6
- package/controller/CHANGELOG.md +610 -1571
- package/controller/lib/index.js +12 -15
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +4 -4
- package/lib/main.js +4 -6
- package/lib/main.js.map +1 -1
- package/lib/print.js +2 -2
- package/lib/print.js.map +1 -1
- package/package.json +9 -9
- package/module/configure.js +0 -1
- package/module/controller.js +0 -8320
- package/module/demo.js +0 -45
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -18
- package/module/print-demo.js +0 -83
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/module/demo.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
var generate = {};
|
|
6
|
-
|
|
7
|
-
const choice = (l, v) => ({ label: l, value: v });
|
|
8
|
-
|
|
9
|
-
const markup = '<p>The {{0}} <br> jumped {{1}} <br> the {{2}}</p>';
|
|
10
|
-
|
|
11
|
-
generate.model = (id, element) => ({
|
|
12
|
-
id,
|
|
13
|
-
element,
|
|
14
|
-
markup,
|
|
15
|
-
disabled: false,
|
|
16
|
-
choices: {
|
|
17
|
-
0: [choice('cow', '0'), choice('cattle', '1'), choice('calf', '2')],
|
|
18
|
-
1: [choice('over', '0'), choice('past', '1'), choice('beyond', '2')],
|
|
19
|
-
2: [choice('moon', '0')],
|
|
20
|
-
},
|
|
21
|
-
maxLengthPerChoice: [7, 10, 4],
|
|
22
|
-
prompt: 'Complete the sentence',
|
|
23
|
-
promptEnabled: true,
|
|
24
|
-
toolbarEditorPosition: 'bottom',
|
|
25
|
-
rubricEnabled: false,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const { model } = generate;
|
|
29
|
-
|
|
30
|
-
var config = {
|
|
31
|
-
elements: {
|
|
32
|
-
'explicit-constructed-response': '../..',
|
|
33
|
-
},
|
|
34
|
-
models: [model('1', 'explicit-constructed-response')],
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
38
|
-
customElements.whenDefined("demo-el").then(() => {
|
|
39
|
-
config.models.forEach((m) => {
|
|
40
|
-
const de = document.createElement("demo-el");
|
|
41
|
-
document.body.appendChild(de);
|
|
42
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
43
|
-
de.model = m;
|
|
44
|
-
});
|
|
45
|
-
});
|
package/module/element.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_react_dom as e,_dll_debug as t,_dll_react as n,_dll_prop_types as o,_dll_mui__material_styles as r,_dll_lodash as i,_dll_mui__material as s,_dll_pie_lib__render_ui as a,_dll_classnames as l,_dll_mui__icons_material as c,_dll_pie_lib__correct_answer_toggle as d}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_pie_lib__drag as h}from"../../../@pie-lib/drag-module@^3.0.5/module/index.js";var p,g=e;p=g.createRoot,g.hydrateRoot;var f={};Object.defineProperty(f,"__esModule",{value:!0});class m extends CustomEvent{constructor(e,t,n){super(m.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}m.TYPE="model-set";var b=f.ModelSetEvent=m;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 y,x,w,C=f.SessionChangedEvent=v,S={"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},k={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},A=function(e){return e.length?e.charAt(0).toUpperCase()+e.substring(1):e},R=A,E=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,O="undefined"==typeof document?{}:document.documentElement.style,L=(y=function(){for(var e in O)if(E.test(e))return e.match(E)[0];return"WebkitOpacity"in O?"Webkit":"KhtmlOpacity"in O?"Khtml":""}(),x=y.toLowerCase(),{style:y,css:"-"+x+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[y]||R(y)}),N=function(e,t){return t?t.toUpperCase():""},D=/[-\s]+(.)?/g,_=function(e){return e?e.replace(D,N):""},P=/::/g,T=/([A-Z]+)([A-Z][a-z])/g,$=/([a-z\d])([A-Z])/g,j=/_/g,I=function(e,t){return e?e.replace(P,"/").replace(T,"$1_$2").replace($,"$1_$2").replace(j,t||"-"):""},M=function(e){return I(e).toLowerCase()},F=_,z=M,W=function(e){return e.length?e.charAt(0).toLowerCase()+e.substring(1):e},B=A,H=L,V=S,U="undefined"==typeof document?{}:document.documentElement.style,K=function(e,t){t=t||{};var n=W(F(e)),o=z(e),r=w?n:o,i=H.style?w?H.style:H.css:"";if(n in U)return t.asString?r:[r];var s=r,a=V[o],l=[];if(w&&(s=B(r)),"function"==typeof a){var c=a(r,i)||[];c&&!Array.isArray(c)&&(c=[c]),c.length&&(c=c.map(function(e){return w?W(F(e)):z(e)})),l=l.concat(c)}return i&&l.push(i+s),l.push(r),t.asString||1==l.length?l[0]:l},q=Object.prototype.hasOwnProperty,Y=function(e,t){return q.call(e,t)},J=Object.prototype.toString,X=Object.prototype.toString,Q=K,G=M,Z=_,ee=Y,te=function(e){return!!e&&"[object Object]"===J.call(e)},ne=function(e){return"[object Function]"===X.apply(e)},oe=function(e,t,n,o){Q(t).forEach(function(t){e[o?o(t):t]=n})},re={cssUnitless:k},ie=function(e,t,n,o){"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||re).cssUnitless=t.cssUnitless||re.cssUnitless,o=o||{};var r,i,s,a,l,c,d,u,h=t.scope||{},p=null!=t.addUnits?t.addUnits:!h||null==h.addUnits||h.addUnits,g=(null!=t.cssUnitless?t.cssUnitless:h?h.cssUnitless:null)||{},f=(t.cssUnit||h?h.cssUnit:null)||"px",m=t.prefixProperties||(h?h.prefixProperties:null)||{},b=t.camelize?Z:G;for(s in e)if(ee(e,s)){if(a=e[s],i=G(n?n+s:s),r=!1,u=!1,ne(a)&&(d=a.call(h||e,a,s,i,e),te(d)&&null!=d.value?(a=d.value,u=d.prefix,i=d.name?G(d.name):i):a=d),c="number"==(l=typeof a)||"string"==l&&""!=a&&1*a==a,null==a||null==i||""===i)continue;if((c||"string"==l)&&(r=!0),!r&&null!=a.value&&a.prefix&&(r=!0,u=a.prefix,a=a.value),r){if(u=u||!!m[i],c&&(a=p&&!(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 o={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};n in o?(i=[],o[n].forEach(function(e){i.push("border"+e+t)})):i="border"+n+t}),Array.isArray(i))){i.forEach(function(e){u?oe(o,e,a,b):o[b(e)]=a});continue}u?oe(o,i,a,b):o[b(i)]=a}else ie(a,t,i+"-",o)}return o},se=ie,ae=Y,le={prefixProperties:S,cssUnitless:k,object:ie,string:function(e,t){e=se(e,t);var n,o=[];for(n in e)ae(e,n)&&o.push(n+": "+e[n]);return o.join("; ")}};const ce=t("@pie-lib:mask-markup:serialization"),de=["span"],ue=["em","strong","u"],he=(e,t)=>{const n=e.getAttribute(t);return o=(e=>{const t=/([\w-]*)\s*:\s*([^;]*)/g;let n;const o={};for(;n=t.exec(e);)o[n[1]]=n[2].trim();return o})(n),le.object(o,{camelize:!0,addUnits:!1});var o},pe=["border","class","style"],ge={b:"bold",em:"italic",u:"underline",s:"strikethrough",code:"code",strong:"strong"},fe=(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 o=e.tagName.toLowerCase(),r=ge[o];if(r){ce("[deserialize] mark: ",r);return{_flatten:!0,nodes:me(e.childNodes,[...t,r])}}if("math"===o)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 o=e.attributes[n];t[o.name]=o.value}return t})(e)||{};"audio"===o&&""===i.controls&&(i.controls=!0);const s=pe.reduce((n=e,(e,t)=>{if(!n.getAttribute)return e;if(n.getAttribute(t))switch(t){case"style":e.style=he(n,t);break;case"class":e.className=((e,t,n)=>{const o=e.getAttribute(n);return delete t.class,o})(n,e,t);break;default:e[t]=n.getAttribute(t)}return e}),{...i}),a=(e=>de.includes(e)?"inline":ue.includes(e)?"mark":"block")(o),l=me(e.childNodes,t);return{object:a,type:o,data:{dataset:{...e.dataset},attributes:{...s}},nodes:l}}var n;return null},me=(e,t=[])=>{const n=[];for(let o=0;o<e.length;o++){const r=fe(e[o],t);null!==r&&(r._flatten&&r.nodes?n.push(...r.nodes):n.push(r))}return n},be=n,ve=o,{get:ye}=i,{styled:xe}=r,{renderMath:we}=u;function Ce(e){let t,n=e[0],o=1;for(;o<e.length;){const r=e[o],i=e[o+1];if(o+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=i(n)):"call"!==r&&"optionalCall"!==r||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const Se=xe("div")(({theme:e})=>({paddingTop:e.spacing(2),paddingBottom:e.spacing(2)})),ke=xe("span")(()=>({display:"inline-block",width:".75em"})),Ae=["tbody","tr"],Re=(e,t,n,o,r,i)=>{if(!t)return null;const s=[];return(e.nodes||[]).forEach((e,a)=>{const l=e.type?`${e.type}-${a}`:`${a}`;if(e.isMath)return s.push(be.createElement("span",{dangerouslySetInnerHTML:{__html:`<math displaystyle="true">${e.nodes[0].innerHTML}</math>`}})),s;if(o){const l=o(e,t,n);if(l)return s.push(l),void("td"!==Ce([r,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&s.push(be.createElement(ke,{key:`spacer-${a}`})))}if("text"===e.object){const t=e.leaves.reduce((e,t)=>{const n=t.text,o=((e,t)=>{const n=""===t.trim(),o=e&&e.type;return n&&Ae.includes(o)?void 0:t})(r,n);return o?e+o:e},""),n=(e=>{const t=e.leaves.find(e=>ye(e,"marks",[]).length);return t?t.marks[0]:null})(e);if(n){let e;for(e in ge)if(ge[e]===n.type){const n=e;s.push(be.createElement(n,{key:l},t));break}}else t.length>0&&(s.push(t),"td"!==Ce([r,"optionalAccess",e=>e.type])&&"drag-in-the-blank"===i&&s.push(be.createElement(ke,{key:`spacer-${a}`})))}else{const r=Re(e,t,n,o,e,i);if("p"===e.type||"paragraph"===e.type)s.push(be.createElement(Se,{key:l},r));else{const t=e.type;e.nodes&&e.nodes.length>0?s.push(be.createElement(t,{key:l,...e.data.attributes},r)):s.push(be.createElement(t,{key:l,...e.data.attributes}))}}}),s},Ee=xe("div")(()=>({display:"initial","&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:"8px 12px",textAlign:"left"}}));class Oe extends be.Component{constructor(e){super(e),Oe.prototype.__init.call(this),this.internalContainerRef=be.createRef()}static __initStatic(){this.propTypes={renderChildren:ve.func,layout:ve.object,value:ve.object,onChange:ve.func,elementType:ve.string,containerRef:ve.oneOfType([ve.func,ve.shape({current:ve.instanceOf(Element)})])}}componentDidMount(){const e=this.props.containerRef||this.internalContainerRef;e.current&&"function"==typeof we&&we(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:o}=this.props,r=Re(t,e,this.handleChange,this.props.renderChildren,null,n),i=o||this.internalContainerRef;return be.createElement(Ee,{ref:i},r)}}Oe.__initStatic();const Le=/\{\{(\d+)\}\}/g;const Ne=n,De=o;var _e;const Pe=(e,t)=>{const{markup:n}=(r=t,(o=e)?{markup:o.replace(Le,(e,t)=>`<span data-component="${r}" data-id="${t}"></span>`)}:{markup:""});var o,r;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=me(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},Te=(e,t)=>((_e=class extends Ne.Component{static __initStatic(){this.propTypes={markup:De.string,layout:De.object,value:De.object,onChange:De.func,customMarkMarkupComponent:De.func,elementType:De.string}}constructor(e){super(e),this.containerRef=Ne.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:o,value:r,onChange:i,elementType:s}=this.props,a=o||Pe(n,e);return Ne.createElement(Oe,{containerRef:this.containerRef,elementType:s,layout:a,value:r,onChange:i,renderChildren:t(this.props)})}}).__initStatic(),_e),{useMemo:$e}=n,{useLayoutEffect:je}=n,{useEffect:Ie}=n,{useRef:Me}=n,{useCallback:Fe}=n,ze="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function We(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Be(e){return"nodeType"in e}function He(e){var t,n;return e?We(e)?e:Be(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ve(e){const{Document:t}=He(e);return e instanceof t}function Ue(e){return!We(e)&&e instanceof He(e).HTMLElement}function Ke(e){return e instanceof He(e).SVGElement}function qe(e){return e?We(e)?e.document:Be(e)?Ve(e)?e:Ue(e)||Ke(e)?e.ownerDocument:document:document:document}const Ye=ze?je:Ie;function Je(e){const t=Me(e);return Ye(()=>{t.current=e}),Fe(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}function Xe(e,t){void 0===t&&(t=[e]);const n=Me(e);return Ye(()=>{n.current!==e&&(n.current=e)},t),n}function Qe(e,t){const n=Me();return $e(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Ge(e){const t=Je(e),n=Me(null),o=Fe(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function Ze(e){const t=Me();return Ie(()=>{t.current=e},[e]),t.current}let et={};function tt(e,t){return $e(()=>{if(t)return t;const n=null==et[e]?0:et[e]+1;return et[e]=n,e+"-"+n},[e,t])}function nt(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t},{...t})}}const ot=nt(1),rt=nt(-1);function it(e){if(!e)return!1;const{KeyboardEvent:t}=He(e.target);return t&&e instanceof t}function st(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=He(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 at=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[at.Translate.toString(e),at.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),lt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ct(e){return e.matches(lt)?e:e.querySelector(lt)}const dt=n,{useState:ut}=n,{useCallback:ht}=n,pt={display:"none"};function gt(e){let{id:t,value:n}=e;return dt.createElement("div",{id:t,style:pt},n)}function ft(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;return dt.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":o,"aria-atomic":!0},n)}const mt=n,{createContext:bt}=n,{useContext:vt}=n,{useEffect:yt}=n,{useState:xt}=n,{useCallback:wt}=n,{useMemo:Ct}=n,{useRef:St}=n,{memo:kt}=n,{useReducer:At}=n,{cloneElement:Rt}=n,{forwardRef:Et}=n,{createPortal:Ot}=e,{unstable_batchedUpdates:Lt}=e,Nt=bt(null);const Dt={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 "},_t={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 Pt(e){let{announcements:t=_t,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=Dt}=e;const{announce:i,announcement:s}=function(){const[e,t]=ut("");return{announce:ht(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=tt("DndLiveRegion"),[l,c]=xt(!1);if(yt(()=>{c(!0)},[]),function(e){const t=vt(Nt);yt(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}(Ct(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:o}=e;t.onDragMove&&i(t.onDragMove({active:n,over:o}))},onDragOver(e){let{active:n,over:o}=e;i(t.onDragOver({active:n,over:o}))},onDragEnd(e){let{active:n,over:o}=e;i(t.onDragEnd({active:n,over:o}))},onDragCancel(e){let{active:n,over:o}=e;i(t.onDragCancel({active:n,over:o}))}}),[i,t])),!l)return null;const d=mt.createElement(mt.Fragment,null,mt.createElement(gt,{id:o,value:r.draggable}),mt.createElement(ft,{id:a,announcement:s}));return n?Ot(d,n):d}var Tt;function $t(){}!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"}(Tt||(Tt={}));const jt=Object.freeze({x:0,y:0});function It(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mt(e,t){const n=st(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function Ft(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function zt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function Wt(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Bt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=Wt(t,t.left,t.top),i=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=It(Wt(o),r);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(Ft)};function Ht(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=r-o,a=i-n;if(o<r&&n<i){const n=t.width*t.height,o=e.width*e.height,r=s*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const Vt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,i=n.get(o);if(i){const n=Ht(i,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(zt)};function Ut(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:jt}const Kt=(qt=1,function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return n.reduce((e,t)=>({...e,top:e.top+qt*t.y,bottom:e.bottom+qt*t.y,left:e.left+qt*t.x,right:e.right+qt*t.x}),{...e})});var qt;function Yt(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 Jt={ignoreTransform:!1};function Xt(e,t){void 0===t&&(t=Jt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=He(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=Yt(t);if(!o)return e;const{scaleX:r,scaleY:i,x:s,y:a}=o,l=e.left-s-(1-r)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(n,t,o))}const{top:o,left:r,width:i,height:s,bottom:a,right:l}=n;return{top:o,left:r,width:i,height:s,bottom:a,right:l}}function Qt(e){return Xt(e,{ignoreTransform:!0})}function Gt(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(Ve(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Ue(r)||Ke(r))return n;if(n.includes(r))return n;const i=He(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=He(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const o=t[e];return"string"==typeof o&&n.test(o)})}(r,i)&&n.push(r),function(e,t){return void 0===t&&(t=He(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?n:o(r.parentNode)}(e):n}function Zt(e){const[t]=Gt(e,1);return null!=t?t:null}function en(e){return ze&&e?We(e)?e:Be(e)?Ve(e)||e===qe(e).scrollingElement?window:Ue(e)?e:null:null:null}function tn(e){return We(e)?e.scrollX:e.scrollLeft}function nn(e){return We(e)?e.scrollY:e.scrollTop}function on(e){return{x:tn(e),y:nn(e)}}var rn;function sn(e){return!(!ze||!e)&&e===document.scrollingElement}function an(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(rn||(rn={}));const ln={x:.2,y:.2};function cn(e,t,n,o,r){let{top:i,left:s,right:a,bottom:l}=n;void 0===o&&(o=10),void 0===r&&(r=ln);const{isTop:c,isBottom:d,isLeft:u,isRight:h}=an(e),p={x:0,y:0},g={x:0,y:0},f=t.height*r.y,m=t.width*r.x;return!c&&i<=t.top+f?(p.y=rn.Backward,g.y=o*Math.abs((t.top+f-i)/f)):!d&&l>=t.bottom-f&&(p.y=rn.Forward,g.y=o*Math.abs((t.bottom-f-l)/f)),!h&&a>=t.right-m?(p.x=rn.Forward,g.x=o*Math.abs((t.right-m-a)/m)):!u&&s<=t.left+m&&(p.x=rn.Backward,g.x=o*Math.abs((t.left+m-s)/m)),{direction:p,speed:g}}function dn(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:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function un(e){return e.reduce((e,t)=>ot(e,on(t)),jt)}function hn(e,t){if(void 0===t&&(t=Xt),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);Zt(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const pn=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+tn(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+nn(t),0)}]];class gn{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=Gt(t),o=un(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of pn)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(n),s=o[e]-t;return this.rect[i]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class fn{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 o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function mn(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var bn,vn;function yn(e){e.preventDefault()}function xn(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"}(bn||(bn={})),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"}(vn||(vn={}));const wn={start:[vn.Space,vn.Enter],cancel:[vn.Esc],end:[vn.Space,vn.Enter,vn.Tab]},Cn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case vn.Right:return{...n,x:n.x+25};case vn.Left:return{...n,x:n.x-25};case vn.Down:return{...n,y:n.y+25};case vn.Up:return{...n,y:n.y-25}}};class Sn{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 fn(qe(t)),this.windowListeners=new fn(He(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bn.Resize,this.handleCancel),this.windowListeners.add(bn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&hn(n),t(jt)}handleKeyDown(e){if(it(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=wn,coordinateGetter:i=Cn,scrollBehavior:s="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:jt;this.referenceCoordinates||(this.referenceCoordinates=c);const d=i(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=rt(d,c),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:i,isRight:a,isLeft:l,isBottom:c,maxScroll:u,minScroll:h}=an(n),p=dn(n),g={x:Math.min(r===vn.Right?p.right-p.width/2:p.right,Math.max(r===vn.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===vn.Down?p.bottom-p.height/2:p.bottom,Math.max(r===vn.Down?p.top:p.top+p.height/2,d.y))},f=r===vn.Right&&!a||r===vn.Left&&!l,m=r===vn.Down&&!c||r===vn.Up&&!i;if(f&&g.x!==d.x){const e=n.scrollLeft+t.x,i=r===vn.Right&&e<=u.x||r===vn.Left&&e>=h.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:s});o.x=i?n.scrollLeft-e:r===vn.Right?n.scrollLeft-u.x:n.scrollLeft-h.x,o.x&&n.scrollBy({left:-o.x,behavior:s});break}if(m&&g.y!==d.y){const e=n.scrollTop+t.y,i=r===vn.Down&&e<=u.y||r===vn.Up&&e>=h.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:s});o.y=i?n.scrollTop-e:r===vn.Down?n.scrollTop-u.y:n.scrollTop-h.y,o.y&&n.scrollBy({top:-o.y,behavior:s});break}}this.handleMove(e,ot(rt(d,this.referenceCoordinates),o))}}}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 kn(e){return Boolean(e&&"distance"in e)}function An(e){return Boolean(e&&"delay"in e)}Sn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=wn,onActivation:r}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(o.start.includes(s)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Rn{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=He(e);return e instanceof t?e:qe(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:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=qe(i),this.documentListeners=new fn(this.document),this.listeners=new fn(n),this.windowListeners=new fn(He(i)),this.initialCoordinates=null!=(o=st(r))?o:jt,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(bn.Resize,this.handleCancel),this.windowListeners.add(bn.DragStart,yn),this.windowListeners.add(bn.VisibilityChange,this.handleCancel),this.windowListeners.add(bn.ContextMenu,yn),this.documentListeners.add(bn.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(An(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(kn(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:o}=this.props;o(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(bn.Click,xn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bn.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:i,options:{activationConstraint:s}}=r;if(!o)return;const a=null!=(t=st(e))?t:jt,l=rt(o,a);if(!n&&s){if(kn(s)){if(null!=s.tolerance&&mn(l,s.tolerance))return this.handleCancel();if(mn(l,s.distance))return this.handleStart()}return An(s)&&mn(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===vn.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const En={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class On extends Rn{constructor(e){const{event:t}=e,n=qe(t.target);super(e,En,n)}}On.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Ln={move:{name:"mousemove"},end:{name:"mouseup"}};var Nn;!function(e){e[e.RightClick=2]="RightClick"}(Nn||(Nn={}));(class extends Rn{constructor(e){super(e,Ln,qe(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==Nn.RightClick&&(null==o||o({event:n}),!0)}}];const Dn={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var _n,Pn;function Tn(e){let{acceleration:t,activator:n=_n.Pointer,canScroll:o,draggingRect:r,enabled:i,interval:s=5,order:a=Pn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:h}=e;const p=function(e){let{delta:t,disabled:n}=e;const o=Ze(t);return Qe(e=>{if(n||!o||!e)return $n;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[rn.Backward]:e.x[rn.Backward]||-1===r.x,[rn.Forward]:e.x[rn.Forward]||1===r.x},y:{[rn.Backward]:e.y[rn.Backward]||-1===r.y,[rn.Forward]:e.y[rn.Forward]||1===r.y}}},[n,t,o])}({delta:u,disabled:!i}),[g,f]=function(){const e=Me(null);return[Fe((t,n)=>{e.current=setInterval(t,n)},[]),Fe(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),m=St({x:0,y:0}),b=St({x:0,y:0}),v=Ct(()=>{switch(n){case _n.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case _n.DraggableRect:return r}},[n,r,l]),y=St(null),x=wt(()=>{const e=y.current;if(!e)return;const t=m.current.x*b.current.x,n=m.current.y*b.current.y;e.scrollBy(t,n)},[]),w=Ct(()=>a===Pn.TreeOrder?[...c].reverse():c,[a,c]);yt(()=>{if(i&&c.length&&v){for(const e of w){if(!1===(null==o?void 0:o(e)))continue;const n=c.indexOf(e),r=d[n];if(!r)continue;const{direction:i,speed:a}=cn(e,r,v,t,h);for(const e of["x","y"])p[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(b.current=i)}m.current={x:0,y:0},b.current={x:0,y:0},f()}else f()},[t,x,o,f,i,s,JSON.stringify(v),JSON.stringify(p),g,c,w,d,JSON.stringify(h)])}(class extends Rn{constructor(e){super(e,Dn)}static setup(){return window.addEventListener(Dn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Dn.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(_n||(_n={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Pn||(Pn={}));const $n={x:{[rn.Backward]:!1,[rn.Forward]:!1},y:{[rn.Backward]:!1,[rn.Forward]:!1}};var jn,In;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(jn||(jn={})),function(e){e.Optimized="optimized"}(In||(In={}));const Mn=new Map;function Fn(e,t){return Qe(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function zn(e){let{callback:t,disabled:n}=e;const o=Je(t),r=Ct(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(o)},[n]);return yt(()=>()=>null==r?void 0:r.disconnect(),[r]),r}function Wn(e){return new gn(Xt(e),e)}function Bn(e,t,n){void 0===t&&(t=Wn);const[o,r]=xt(null);function i(){r(o=>{if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=o?o:n)?r:null;const i=t(e);return JSON.stringify(o)===JSON.stringify(i)?o:i})}const s=function(e){let{callback:t,disabled:n}=e;const o=Je(t),r=Ct(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(o)},[o,n]);return yt(()=>()=>null==r?void 0:r.disconnect(),[r]),r}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){i();break}}}}),a=zn({callback:i});return Ye(()=>{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]),o}const Hn=[];function Vn(e,t){void 0===t&&(t=[]);const n=St(null);return yt(()=>{n.current=null},t),yt(()=>{const t=e!==jt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?rt(e,n.current):jt}function Un(e){return Ct(()=>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 Kn=[];function qn(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ue(t)?t:e}const Yn=[{sensor:On,options:{}},{sensor:Sn,options:{}}],Jn={current:{}},Xn={draggable:{measure:Qt},droppable:{measure:Qt,strategy:jn.WhileDragging,frequency:In.Optimized},dragOverlay:{measure:Xt}};class Qn 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 Gn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Qn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$t},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xn,measureDroppableContainers:$t,windowRect:null,measuringScheduled:!1},Zn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$t,draggableNodes:new Map,over:null,measureDroppableContainers:$t},eo=bt(Zn),to=bt(Gn);function no(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Qn}}}function oo(e,t){switch(t.type){case Tt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Tt.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 Tt.DragEnd:case Tt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Tt.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Qn(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case Tt.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const s=new Qn(e.droppable.containers);return s.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:s}}}case Tt.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new Qn(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function ro(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=vt(eo),i=Ze(o),s=Ze(null==n?void 0:n.id);return yt(()=>{if(!t&&!o&&i&&null!=s){if(!it(i))return;if(document.activeElement===i.target)return;const e=r.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=ct(e);if(t){t.focus();break}}})}},[o,t,r,s,i]),null}function io(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...o}),n):n}const so=bt({...jt,scaleX:1,scaleY:1});var ao;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(ao||(ao={})),kt(function(e){var t,n,o,r;let{id:i,accessibility:s,autoScroll:a=!0,children:l,sensors:c=Yn,collisionDetection:d=Vt,measuring:u,modifiers:h,...p}=e;const g=At(oo,void 0,no),[f,m]=g,[b,v]=function(){const[e]=xt(()=>new Set),t=wt(t=>(e.add(t),()=>e.delete(t)),[e]);return[wt(t=>{let{type:n,event:o}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)})},[e]),t]}(),[y,x]=xt(ao.Uninitialized),w=y===ao.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:A}}=f,R=null!=C?S.get(C):null,E=St({initial:null,translated:null}),O=Ct(()=>{var e;return null!=C?{id:C,data:null!=(e=null==R?void 0:R.data)?e:Jn,rect:E}:null},[C,R]),L=St(null),[N,D]=xt(null),[_,P]=xt(null),T=Xe(p,Object.values(p)),$=tt("DndDescribedBy",i),j=Ct(()=>A.getEnabled(),[A]),I=Ct(()=>({draggable:{...Xn.draggable,...null==M?void 0:M.draggable},droppable:{...Xn.droppable,...null==M?void 0:M.droppable},dragOverlay:{...Xn.dragOverlay,...null==M?void 0:M.dragOverlay}}),[null==(M=u)?void 0:M.draggable,null==M?void 0:M.droppable,null==M?void 0:M.dragOverlay]);var M;const{droppableRects:F,measureDroppableContainers:z,measuringScheduled:W}=function(e,t){let{dragging:n,dependencies:o,config:r}=t;const[i,s]=xt(null),{frequency:a,measure:l,strategy:c}=r,d=St(e),u=function(){switch(c){case jn.Always:return!1;case jn.BeforeDragging:return n;default:return!n}}(),h=Xe(u),p=wt(function(e){void 0===e&&(e=[]),h.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),g=St(null),f=Qe(t=>{if(u&&!n)return Mn;if(!t||t===Mn||d.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new gn(l(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t},[e,i,n,u,l]);return yt(()=>{d.current=e},[e]),yt(()=>{u||p()},[n,u]),yt(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),yt(()=>{u||"number"!=typeof a||null!==g.current||(g.current=setTimeout(()=>{p(),g.current=null},a))},[a,u,p,...o]),{droppableRects:f,measureDroppableContainers:p,measuringScheduled:null!=i}}(j,{dragging:w,dependencies:[k.x,k.y],config:I.droppable}),B=function(e,t){const n=null!=t?e.get(t):void 0,o=n?n.node.current:null;return Qe(e=>{var n;return null==t?null:null!=(n=null!=o?o:e)?n:null},[o,t])}(S,C),H=Ct(()=>_?st(_):null,[_]),V=function(){const e=!1===(null==N?void 0:N.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 Fn(e,t)}(B,I.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const i=St(!1),{x:s,y:a}="boolean"==typeof r?{x:r,y:r}:r;Ye(()=>{if(!s&&!a||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Ut(n(e),o);if(s||(r.x=0),a||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Zt(e);t&&t.scrollBy({top:r.y,left:r.x})}},[t,s,a,o,n])}({activeNode:null!=C?S.get(C):null,config:V.layoutShiftCompensation,initialRect:U,measure:I.draggable.measure});const K=Bn(B,I.draggable.measure,U),q=Bn(B?B.parentElement:null),Y=St({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:F,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,o]=xt(null),r=zn({callback:wt(e=>{for(const{target:n}of e)if(Ue(n)){o(e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o});break}},[t])}),i=wt(e=>{const n=qn(e);null==r||r.disconnect(),n&&(null==r||r.observe(n)),o(n?t(n):null)},[t,r]),[s,a]=Ge(i);return Ct(()=>({nodeRef:s,rect:n,setRef:a}),[n,s,a])}({measure:I.dragOverlay.measure}),Q=null!=(n=X.nodeRef.current)?n:B,G=w?null!=(o=X.rect)?o:K:null,Z=Boolean(X.nodeRef.current&&X.rect),ee=Ut(te=Z?null:K,Fn(te));var te;const ne=Un(Q?He(Q):null),oe=function(e){const t=St(e),n=Qe(n=>e?n&&n!==Hn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Gt(e):Hn,[e]);return yt(()=>{t.current=e},[e]),n}(w?null!=J?J:B:null),re=function(e,t){void 0===t&&(t=Xt);const[n]=e,o=Un(n?He(n):null),[r,i]=xt(Kn);function s(){i(()=>e.length?e.map(e=>sn(e)?o:new gn(t(e),e)):Kn)}const a=zn({callback:s});return Ye(()=>{null==a||a.disconnect(),s(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),r}(oe),ie=io(h,{transform:{x:k.x-ee.x,y:k.y-ee.y,scaleX:1,scaleY:1},activatorEvent:_,active:O,activeNodeRect:K,containerNodeRect:q,draggingNodeRect:G,over:Y.current.over,overlayNodeRect:X.rect,scrollableAncestors:oe,scrollableAncestorRects:re,windowRect:ne}),se=H?ot(H,k):null,ae=function(e){const[t,n]=xt(null),o=St(e),r=wt(e=>{const t=en(e.target);t&&n(e=>e?(e.set(t,on(t)),new Map(e)):null)},[]);return yt(()=>{const t=o.current;if(e!==t){i(t);const s=e.map(e=>{const t=en(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,on(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),o.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{const t=en(e);null==t||t.removeEventListener("scroll",r)})}},[r,e]),Ct(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ot(e,t),jt):un(e):jt,[e,t])}(oe),le=Vn(ae),ce=Vn(ae,[K]),de=ot(ie,le),ue=G?Kt(G,ie):null,he=O&&ue?d({active:O,collisionRect:ue,droppableRects:F,droppableContainers:j,pointerCoordinates:se}):null,pe=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(he,"id"),[ge,fe]=xt(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:ot(ie,ce),null!=(r=null==ge?void 0:ge.rect)?r:null,K),be=St(null),ve=wt((e,t)=>{let{sensor:n,options:o}=t;if(null==L.current)return;const r=S.get(L.current);if(!r)return;const i=e.nativeEvent,s=new n({active:L.current,activeNode:r,event:i,options:o,context:Y,onAbort(e){if(!S.get(e))return;const{onDragAbort:t}=T.current,n={id:e};null==t||t(n),b({type:"onDragAbort",event:n})},onPending(e,t,n,o){if(!S.get(e))return;const{onDragPending:r}=T.current,i={id:e,constraint:t,initialCoordinates:n,offset:o};null==r||r(i),b({type:"onDragPending",event:i})},onStart(e){const t=L.current;if(null==t)return;const n=S.get(t);if(!n)return;const{onDragStart:o}=T.current,r={activatorEvent:i,active:{id:t,data:n.data,rect:E}};Lt(()=>{null==o||o(r),x(ao.Initializing),m({type:Tt.DragStart,initialCoordinates:e,active:t}),b({type:"onDragStart",event:r}),D(be.current),P(i)})},onMove(e){m({type:Tt.DragMove,coordinates:e})},onEnd:a(Tt.DragEnd),onCancel:a(Tt.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=Y.current;let s=null;if(t&&r){const{cancelDrop:a}=T.current;if(s={activatorEvent:i,active:t,collisions:n,delta:r,over:o},e===Tt.DragEnd&&"function"==typeof a){await Promise.resolve(a(s))&&(e=Tt.DragCancel)}}L.current=null,Lt(()=>{m({type:e}),x(ao.Uninitialized),fe(null),D(null),P(null),be.current=null;const t=e===Tt.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=T.current[t];null==e||e(s),b({type:t,event:s})}})}}be.current=s},[S]),ye=wt((e,t)=>(n,o)=>{const r=n.nativeEvent,i=S.get(o);if(null!==L.current||!i||r.dndKit||r.defaultPrevented)return;const s={active:i};!0===e(n,t.options,s)&&(r.dndKit={capturedBy:t.sensor},L.current=o,ve(n,t))},[S,ve]),xe=function(e,t){return Ct(()=>e.reduce((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(c,ye);!function(e){yt(()=>{if(!ze)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),Ye(()=>{K&&y===ao.Initializing&&x(ao.Initialized)},[K,y]),yt(()=>{const{onDragMove:e}=T.current,{active:t,activatorEvent:n,collisions:o,over:r}=Y.current;if(!t||!n)return;const i={active:t,activatorEvent:n,collisions:o,delta:{x:de.x,y:de.y},over:r};Lt(()=>{null==e||e(i),b({type:"onDragMove",event:i})})},[de.x,de.y]),yt(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=Y.current;if(!e||null==L.current||!t||!r)return;const{onDragOver:i}=T.current,s=o.get(pe),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:r.x,y:r.y},over:a};Lt(()=>{fe(a),null==i||i(l),b({type:"onDragOver",event:l})})},[pe]),Ye(()=>{Y.current={activatorEvent:_,active:O,activeNode:B,collisionRect:ue,collisions:he,droppableRects:F,draggableNodes:S,draggingNode:Q,draggingNodeRect:G,droppableContainers:A,over:ge,scrollableAncestors:oe,scrollAdjustedTranslate:de},E.current={initial:G,translated:ue}},[O,B,he,ue,S,Q,G,F,A,ge,oe,de]),Tn({...V,delta:k,draggingRect:ue,pointerCoordinates:se,scrollableAncestors:oe,scrollableAncestorRects:re});const we=Ct(()=>({active:O,activeNode:B,activeNodeRect:K,activatorEvent:_,collisions:he,containerNodeRect:q,dragOverlay:X,draggableNodes:S,droppableContainers:A,droppableRects:F,over:ge,measureDroppableContainers:z,scrollableAncestors:oe,scrollableAncestorRects:re,measuringConfiguration:I,measuringScheduled:W,windowRect:ne}),[O,B,K,_,he,q,X,S,A,F,ge,z,oe,re,I,W,ne]),Ce=Ct(()=>({activatorEvent:_,activators:xe,active:O,activeNodeRect:K,ariaDescribedById:{draggable:$},dispatch:m,draggableNodes:S,over:ge,measureDroppableContainers:z}),[_,xe,O,K,m,$,S,ge,z]);return mt.createElement(Nt.Provider,{value:v},mt.createElement(eo.Provider,{value:Ce},mt.createElement(to.Provider,{value:we},mt.createElement(so.Provider,{value:me},l)),mt.createElement(ro,{disabled:!1===(null==s?void 0:s.restoreFocus)})),mt.createElement(Pt,{...s,hiddenTextDescribedById:$}))});const lo=bt(null),co="button";function uo(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e;const i=tt("Draggable"),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:h}=vt(eo),{role:p=co,roleDescription:g="draggable",tabIndex:f=0}=null!=r?r:{},m=(null==l?void 0:l.id)===t,b=vt(m?so:lo),[v,y]=Ge(),[x,w]=Ge(),C=function(e,t){return Ct(()=>e.reduce((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e},{}),[e,t])}(s,t),S=Xe(n);Ye(()=>(u.set(t,{id:t,key:i,node:v,activatorNode:x,data:S}),()=>{const e=u.get(t);e&&e.key===i&&u.delete(t)}),[u,t]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:Ct(()=>({role:p,tabIndex:f,"aria-disabled":o,"aria-pressed":!(!m||p!==co)||void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[o,p,f,m,g,d.draggable]),isDragging:m,listeners:o?void 0:C,node:v,over:h,setNodeRef:y,setActivatorNodeRef:w,transform:b}}const ho={timeout:25};function po(e){let{animation:t,children:n}=e;const[o,r]=xt(null),[i,s]=xt(null),a=Ze(n);return n||o||!a||r(a),Ye(()=>{if(!i)return;const e=null==o?void 0:o.key,n=null==o?void 0:o.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{r(null)}):r(null)},[t,o,i]),mt.createElement(mt.Fragment,null,n,o?Rt(o,{ref:s}):null)}const go={x:0,y:0,scaleX:1,scaleY:1};function fo(e){let{children:t}=e;return mt.createElement(eo.Provider,{value:Zn},mt.createElement(so.Provider,{value:go},t))}const mo={position:"fixed",touchAction:"none"},bo=e=>it(e)?"transform 250ms ease":void 0,vo=Et((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:s,rect:a,style:l,transform:c,transition:d=bo}=e;if(!a)return null;const u=r?c:{...c,scaleX:1,scaleY:1},h={...mo,width:a.width,height:a.height,top:a.top,left:a.left,transform:at.Transform.toString(u),transformOrigin:r&&o?Mt(o,a):void 0,transition:"function"==typeof d?d(o):d,...l};return mt.createElement(n,{className:s,style:h,ref:t},i)}),yo={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:at.Transform.toString(t)},{transform:at.Transform.toString(n)}]},sideEffects:(xo={styles:{active:{opacity:"0"}}},e=>{let{active:t,dragOverlay:n}=e;const o={},{styles:r,className:i}=xo;if(null!=r&&r.active)for(const[e,n]of Object.entries(r.active))void 0!==n&&(o[e]=t.node.style.getPropertyValue(e),t.node.style.setProperty(e,n));if(null!=r&&r.dragOverlay)for(const[e,t]of Object.entries(r.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(o))t.node.style.setProperty(e,n);null!=i&&i.active&&t.node.classList.remove(i.active)}})};var xo;function wo(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:r}=e;return Je((e,i)=>{if(null===t)return;const s=n.get(e);if(!s)return;const a=s.node.current;if(!a)return;const l=qn(i);if(!l)return;const{transform:c}=He(i).getComputedStyle(i),d=Yt(c);if(!d)return;const u="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:o,keyframes:r}={...yo,...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},d={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},u={x:a.x-c.x,y:a.y-c.y,...d},h=r({...l,active:i,dragOverlay:s,transform:{initial:a,final:u}}),[p]=h,g=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(g))return;const f=null==o?void 0:o({active:i,dragOverlay:s,...l}),m=s.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{m.onfinish=()=>{null==f||f(),e()}})}}(t);return hn(a,r.draggable.measure),u({active:{id:e,data:s.data,node:a,rect:r.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:i,rect:r.dragOverlay.measure(l)},droppableContainers:o,measuringConfiguration:r,transform:d})})}let Co=0;function So(e){return Ct(()=>{if(null!=e)return Co++,Co},[e])}const ko=mt.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:u,activeNodeRect:h,containerNodeRect:p,draggableNodes:g,droppableContainers:f,dragOverlay:m,over:b,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:x,windowRect:w}=vt(to),C=vt(so),S=So(null==u?void 0:u.id),k=io(s,{activatorEvent:d,active:u,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:m.rect,over:b,overlayNodeRect:m.rect,scrollableAncestors:y,scrollableAncestorRects:x,transform:C,windowRect:w}),A=Fn(h),R=wo({config:o,draggableNodes:g,droppableContainers:f,measuringConfiguration:v}),E=A?m.setRef:void 0;return mt.createElement(fo,null,mt.createElement(po,{animation:R},u&&S?mt.createElement(vo,{key:S,id:u.id,ref:E,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:A,style:{zIndex:c,...r},transform:k},n):null))}),Ao=n,{useEffect:Ro}=n,{useRef:Eo}=n,Oo=o,{styled:Lo}=r,{Chip:No}=s,{color:Do}=a,{renderMath:_o}=u;function Po(e){let t,n=e[0],o=1;for(;o<e.length;){const r=e[o],i=e[o+1];if(o+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=i(n)):"call"!==r&&"optionalCall"!==r||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const To=Lo("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&&{}})),$o=Lo(No)(()=>({backgroundColor:Do.white(),border:`1px solid ${Do.text()}`,color:Do.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}})),jo=Lo("span")(()=>({whiteSpace:"normal","& img":{display:"block",padding:"2px 0"},"& mjx-frac":{fontSize:"120% !important"}}));function Io({choice:e,disabled:t,instanceId:n}){const o=Eo(null),{attributes:r,listeners:i,setNodeRef:s,isDragging:a}=uo({id:`choice-${e.id}`,data:{choice:e,instanceId:n,fromChoice:!0,type:"MaskBlank"},disabled:t});return Ro(()=>{_o(o.current)},[e.value]),Ao.createElement(To,{ref:s,style:a?{width:Po([o,"access",e=>e.current,"optionalAccess",e=>e.offsetWidth]),height:Po([o,"access",e=>e.current,"optionalAccess",e=>e.offsetHeight])}:{},disabled:t,...i,...r},Ao.createElement($o,{clickable:!1,disabled:t,ref:o,label:Ao.createElement(jo,{dangerouslySetInnerHTML:{__html:e.value}})}))}Io.propTypes={choice:Oo.object.isRequired,disabled:Oo.bool,instanceId:Oo.oneOfType([Oo.string,Oo.number])};const Mo=n,Fo=o,{findKey:zo}=i,{DragDroppablePlaceholder:Wo}=h;class Bo extends Mo.Component{constructor(...e){super(...e),Bo.prototype.__init.call(this)}static __initStatic(){this.propTypes={disabled:Fo.bool,duplicates:Fo.bool,choices:Fo.arrayOf(Fo.shape({label:Fo.string,value:Fo.string})),value:Fo.object,choicePosition:Fo.string.isRequired,instanceId:Fo.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:o,instanceId:r}=this.props,i=n.filter(e=>{if(!0===t)return!0;return void 0===zo(o,t=>t===e.id)}),s={...this.getStyleForWrapper(),minWidth:"100px"};return Mo.createElement("div",{style:s},Mo.createElement(Wo,{disabled:e,instanceId:r},i.map((t,n)=>Mo.createElement(Io,{key:`${t.value}-${n}`,disabled:e,choice:t,instanceId:r}))))}}Bo.__initStatic();var Ho={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};const Vo=n,{useRef:Uo}=n,{useState:Ko}=n,{useEffect:qo}=n,Yo=o,Jo=t,{styled:Xo}=r,{Chip:Qo}=s,Go=l,{color:Zo}=a,{renderMath:er}=u;function tr(e){let t,n=e[0],o=1;for(;o<e.length;){const r=e[o],i=e[o+1];if(o+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=i(n)):"call"!==r&&"optionalCall"!==r||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}Jo("pie-lib:mask-markup:blank");const nr=Xo("span")(({dragged:e,over:t})=>({border:`solid 0px ${Zo.primary()}`,minWidth:"200px",touchAction:"none",overflow:"hidden",whiteSpace:"nowrap",opacity:1,...t&&{whiteSpace:"nowrap",overflow:"hidden"},...e&&{opacity:.5}})),or=Xo(Qo)(()=>({backgroundColor:Zo.background(),border:`2px dashed ${Zo.text()}`,color:Zo.text(),fontSize:"inherit",maxWidth:"374px",position:"relative",borderRadius:"3px","&.over":{whiteSpace:"nowrap",overflow:"hidden"},"&.parentOver":{border:`1px solid ${Ho[500]}`,backgroundColor:`${Ho[300]}`},"&.correct":{border:`solid 1px ${Zo.correct()}`},"&.incorrect":{border:`solid 1px ${Zo.incorrect()}`},"&.Mui-disabled":{opacity:1}})),rr=Xo("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"}}));function ir({disabled:e,choice:t,isOver:n,isDragging:o,dragItem:r,correct:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a}){const l=Uo(null),c=Uo(null),d=Uo(null),[u,h]=Ko({height:0,width:0}),p=()=>{f()},g=()=>{const e=tr([c,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e("img")]);e?e.onload=p:setTimeout(()=>{f()},300)},f=()=>{if(c.current&&l.current){l.current.style.width="auto";const e=(c.current.offsetWidth||0)+24,t=(c.current.offsetHeight||0)+24,n=parseFloat(s)||0,o=parseFloat(a)||0,r=e<=n?n:e,i=t<=o?o:t;h(e=>({width:r>n?r:e.width,height:i>o?i:e.height})),l.current.style.width=`${r}px`,l.current.style.height=`${i}px`}};qo(()=>{g()},[]),qo(()=>{l.current&&er(l.current)},[n,tr([r,"optionalAccess",e=>e.choice,"optionalAccess",e=>e.value])]),qo(()=>{t?g():h({height:0,width:0})},[t]),qo(()=>{n||o||(d.current={width:l.current.offsetWidth,height:l.current.offsetHeight})},[t,n,o]);const m=r&&n&&r.choice&&r.choice.value,b=t&&t.value,v=n||o?{width:tr([d,"access",e=>e.current,"optionalAccess",e=>e.width]),height:tr([d,"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:u.height||t,width:u.width||e},...e?{}:{minWidth:90},...t?{}:{minHeight:32}}})();return Vo.createElement(or,{clickable:!1,disabled:e,ref:l,component:"span",label:Vo.createElement(Vo.Fragment,null,Vo.createElement(rr,{ref:c,draggable:!0,className:Go({over:n,hidden:m}),dangerouslySetInnerHTML:{__html:b||""}}),m&&Vo.createElement(rr,{draggable:!0,className:Go({over:n,dragged:!0}),dangerouslySetInnerHTML:{__html:m||""}})),className:Go({over:n,parentOver:n,correct:void 0!==i&&i,incorrect:void 0!==i&&!i}),variant:e?"outlined":void 0,style:v})}function sr({id:e,disabled:t,duplicates:n,choice:o,correct:r,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}){const{attributes:c,listeners:d,setNodeRef:u,transform:h,isDragging:p}=uo({id:`mask-blank-drag-${e}`,disabled:t||!o,data:{id:e,choice:o,instanceId:l,fromChoice:!1,type:"MaskBlank"}}),{setNodeRef:g,isOver:f,active:m}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e;const i=tt("Droppable"),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=vt(eo),d=St({disabled:n}),u=St(!1),h=St(null),p=St(null),{disabled:g,updateMeasurementsFor:f,timeout:m}={...ho,...r},b=Xe(null!=f?f:o),v=zn({callback:wt(()=>{u.current?(null!=p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),p.current=null},m)):u.current=!0},[m]),disabled:g||!s}),y=wt((e,t)=>{v&&(t&&(v.unobserve(t),u.current=!1),e&&v.observe(e))},[v]),[x,w]=Ge(y),C=Xe(t);return yt(()=>{v&&x.current&&(v.disconnect(),u.current=!1,v.observe(x.current))},[x,v]),yt(()=>(a({type:Tt.RegisterDroppable,element:{id:o,key:i,disabled:n,node:x,rect:h,data:C}}),()=>a({type:Tt.UnregisterDroppable,key:i,id:o})),[o]),yt(()=>{n!==d.current.disabled&&(a({type:Tt.SetDroppableDisabled,id:o,key:i,disabled:n}),d.current.disabled=n)},[o,i,n,a]),{active:s,rect:h,isOver:(null==l?void 0:l.id)===o,node:x,over:l,setNodeRef:w}}({id:`mask-blank-drop-${e}`,data:{id:e,accepts:["MaskBlank"],instanceId:l}}),b={transform:at.Translate.toString(h)};return Vo.createElement(nr,{ref:e=>{u(e),g(e)},style:b,dragged:p,over:f,...c,...d},Vo.createElement(ir,{id:e,disabled:t,duplicates:n,choice:o,isOver:f,dragItem:tr([m,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current]),correct:r,onChange:i,emptyResponseAreaWidth:s,emptyResponseAreaHeight:a,instanceId:l}))}ir.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},ir.propTypes={id:Yo.oneOfType([Yo.string,Yo.number]),disabled:Yo.bool,duplicates:Yo.bool,choice:Yo.object,isOver:Yo.bool,dragItem:Yo.object,correct:Yo.bool,onChange:Yo.func,emptyResponseAreaWidth:Yo.oneOfType([Yo.string,Yo.number]),emptyResponseAreaHeight:Yo.oneOfType([Yo.string,Yo.number]),instanceId:Yo.string},sr.defaultProps={emptyResponseAreaWidth:0,emptyResponseAreaHeight:0},sr.propTypes={id:Yo.oneOfType([Yo.string,Yo.number]),disabled:Yo.bool,duplicates:Yo.bool,choice:Yo.object,correct:Yo.bool,onChange:Yo.func,emptyResponseAreaWidth:Yo.oneOfType([Yo.string,Yo.number]),emptyResponseAreaHeight:Yo.oneOfType([Yo.string,Yo.number]),instanceId:Yo.string};const ar=n,lr=o,{DragProvider:cr}=h;function dr(e){let t,n=e[0],o=1;for(;o<e.length;){const r=e[o],i=e[o+1];if(o+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=i(n)):"call"!==r&&"optionalCall"!==r||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}const ur=Te("blank",e=>(t,n,o)=>{const r=dr([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("blank"===r.component){const{disabled:i,duplicates:s,correctResponse:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:h,isDragging:p}=e,g=c?a[r.id]:n[r.id],f=g&&e.choices.find(e=>e.id===g);return ar.createElement(sr,{key:`${t.type}-${r.id}`,correct:c||l&&l[r.id],disabled:i,duplicates:s,choice:f,id:r.id,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,onChange:(e,t)=>{const r={...n};void 0===t?delete r[e]:r[e]=t,o(r)},instanceId:h,isDragging:p})}});class hr extends ar.Component{constructor(e){super(e),hr.prototype.__init.call(this),hr.prototype.__init2.call(this),hr.prototype.__init3.call(this),hr.prototype.__init4.call(this),this.state={activeDragItem:null}}static __initStatic(){this.propTypes={markup:lr.string,layout:lr.object,choicesPosition:lr.string,choices:lr.array,value:lr.object,onChange:lr.func,duplicates:lr.bool,disabled:lr.bool,feedback:lr.object,correctResponse:lr.object,showCorrectAnswer:lr.bool,emptyResponseAreaWidth:lr.oneOfType([lr.string,lr.number]),emptyResponseAreaHeight:lr.oneOfType([lr.string,lr.number]),instanceId:lr.string}}static __initStatic2(){this.defaultProps={instanceId:"drag-in-the-blank"}}__init(){this.handleDragStart=e=>{const{active:t}=e;dr([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.current])&&this.setState({activeDragItem:t.data.current})}}__init2(){this.renderDragOverlay=()=>{const{activeDragItem:e}=this.state;return e&&"MaskBlank"===e.type?ar.createElement(Io,{disabled:e.disabled,choice:e.choice,instanceId:e.instanceId}):null}}__init3(){this.handleDragEnd=e=>{const{active:t,over:n}=e,{onChange:o,value:r}=this.props;if(this.setState({activeDragItem:null}),!n||!t||!o)return;const i=t.data.current,s=n.data.current;if("MaskBlank"===dr([i,"optionalAccess",e=>e.type])&&dr([s,"optionalAccess",e=>e.accepts,"optionalAccess",e=>e.includes,"call",e=>e("MaskBlank")])){const e=i,t=s.id;if(!0===s.toChoiceBoard){if(!e.fromChoice&&e.id){const t={...r};delete t[e.id],o(t)}}else if(!0===e.fromChoice){if(t&&"drag-in-the-blank-droppable"!==t){const n={...r};n[t]=e.choice.id,o(n)}}else if(e.id&&e.id!==t){const n={...r};n[t]=e.choice.id,delete n[e.id],o(n)}}}}__init4(){this.getPositionDirection=e=>{let t,n,o;switch(e){case"left":t="row",o="center";break;case"right":t="row-reverse",n="flex-end",o="center";break;case"below":t="column-reverse";break;default:t="column"}return{flexDirection:t,justifyContent:n,alignItems:o}}}render(){const{markup:e,duplicates:t,value:n,onChange:o,choicesPosition:r,choices:i,correctResponse:s,disabled:a,feedback:l,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,layout:h,instanceId:p}=this.props,g=r||"below",f={display:"flex",minWidth:"100px",...this.getPositionDirection(g)};return ar.createElement(cr,{onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd,collisionDetection:Bt},ar.createElement("div",{ref:e=>this.rootRef=e,style:f},ar.createElement(Bo,{choicePosition:g,choices:i,value:n,duplicates:t,disabled:a,instanceId:p}),ar.createElement(ur,{elementType:"drag-in-the-blank",markup:e,layout:h,value:n,choices:i,onChange:o,disabled:a,duplicates:t,feedback:l,correctResponse:s,showCorrectAnswer:c,emptyResponseAreaWidth:d,emptyResponseAreaHeight:u,instanceId:p,isDragging:!!this.state.activeDragItem}),ar.createElement(ko,{style:{pointerEvents:"none"}},this.renderDragOverlay())))}}hr.__initStatic(),hr.__initStatic2();const pr=n,{styled:gr}=r,fr=l,{color:mr}=a;function br(e){let t,n=e[0],o=1;for(;o<e.length;){const r=e[o],i=e[o+1];if(o+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=i(n)):"call"!==r&&"optionalCall"!==r||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}let vr,yr;"undefined"!=typeof window&&(vr=require("@pie-lib/editable-html-tip-tap").default,yr=gr(vr)(()=>({display:"inline-block",verticalAlign:"middle",margin:"4px",borderRadius:"4px",border:`1px solid ${mr.black()}`,"&.correct":{border:`1px solid ${mr.correct()}`},"&.incorrect":{border:`1px solid ${mr.incorrect()}`}})));var xr=Te("input",e=>(t,n)=>{const{adjustedLimit:o,disabled:r,feedback:i,showCorrectAnswer:s,maxLength:a,spellCheck:l,pluginProps:c,onChange:d}=e,u=br([t,"access",e=>e.data,"optionalAccess",e=>e.dataset])||{};if("input"===u.component){const h=(e.choices&&u&&e.choices[u.id]||[])[0],p=s?h&&h.label:n[u.id]||"",g=a&&a[u.id],f=i&&i[u.id],m=s||"correct"===f,b=!s&&"incorrect"===f,v=e=>{const t={...n,[u.id]:e};d(t)},y=e=>{if("Enter"===e.key||13===e.keyCode)return!0};return pr.createElement(yr,{id:u.id,key:`${t.type}-input-${u.id}`,disabled:s||r,disableUnderline:!0,onChange:v,markup:p||"",charactersLimit:o?g:25,activePlugins:["languageCharacters"],pluginProps:c,languageCharactersProps:[{language:"spanish"}],spellCheck:l,width:`calc(${g}em + 32px)`,onKeyDown:y,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",noBorder:!0,isHidden:!!br([c,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])},className:fr({correct:m,incorrect:b})})}});Te("input",e=>(t,n,o)=>{const r=t.data&&t.data.dataset||{};if("input"===r.component)return e.customMarkMarkupComponent(r.id)});const wr=n,Cr=o,{Button:Sr}=s,{InputLabel:kr}=s,{Menu:Ar}=s,{MenuItem:Rr}=s,{ArrowDropDown:Er}=c,{ArrowDropUp:Or}=c,{Close:Lr}=c,{Check:Nr}=c,{styled:Dr}=r,{color:_r}=a,{renderMath:Pr}=u,Tr=Dr(Sr)(()=>({color:_r.text(),border:`1px solid ${_r.borderGray()}`,borderRadius:"4px",justifyContent:"space-between",backgroundColor:_r.background(),position:"relative",height:"45px",width:"fit-content",margin:"2px",textTransform:"none","& span":{paddingRight:"5px"},"& svg":{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:_r.text(),marginLeft:"5px"},"&.Mui-focused":{outline:`3px solid ${_r.tertiary()}`,outlineOffset:"2px",borderWidth:"3px"},"&.disabledCorrect":{borderWidth:"2px",borderColor:_r.correct(),color:`${_r.text()} !important`},"&.disabledIncorrect":{borderWidth:"2px",borderColor:_r.incorrectWithIcon(),color:`${_r.text()} !important`}})),$r=Dr(Ar)(()=>({backgroundColor:_r.background(),border:`1px solid ${_r.correct()} !important`,"&:hover":{border:`1px solid ${_r.text()} `,borderColor:"initial"},"&:focus":{border:`1px solid ${_r.text()}`,borderColor:"initial"},"& .MuiList-root":{padding:0}})),jr=Dr(Rr)(()=>({color:_r.text(),backgroundColor:_r.background(),"&.Mui-focused":{outline:`3px solid ${_r.tertiary()}`,outlineOffset:"-1px",color:_r.text(),backgroundColor:_r.background()},"&:hover":{color:_r.text(),backgroundColor:_r.dropdownBackground()},boxSizing:"border-box",padding:"25px",borderRadius:"4px","&.selected":{color:`${_r.text()} !important`,backgroundColor:`${_r.background()} !important`,"&:hover":{color:_r.text(),backgroundColor:`${_r.dropdownBackground()} !important`}}})),Ir=Dr("span")(()=>({fontSize:"max(1rem, 14px)"})),Mr=Dr("span")(()=>({fontSize:"max(1rem, 14px)",position:"absolute",right:"10px"})),Fr=Dr(kr)(()=>({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"})),zr=Dr(Nr)(()=>({color:`${_r.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:_r.correct()},"&.incorrect":{backgroundColor:_r.incorrectWithIcon()}})),Wr=Dr(Lr)(()=>({color:`${_r.white()} !important`,position:"absolute",top:"-8px !important",left:"-8px",marginLeft:"0 !important",borderRadius:"50%",fontSize:"16px",padding:"2px","&.correct":{backgroundColor:_r.correct()},"&.incorrect":{backgroundColor:_r.incorrectWithIcon()}}));class Br extends wr.Component{static __initStatic(){this.propTypes={id:Cr.string,value:Cr.string,disabled:Cr.bool,onChange:Cr.func,correct:Cr.bool,choices:Cr.arrayOf(Cr.shape({value:Cr.string,label:Cr.string})),showCorrectAnswer:Cr.bool,singleQuery:Cr.bool,correctValue:Cr.string}}constructor(e){super(e),Br.prototype.__init.call(this),Br.prototype.__init2.call(this),Br.prototype.__init3.call(this),Br.prototype.__init4.call(this),Br.prototype.__init5.call(this),this.state={anchorEl:null,highlightedOptionId:null,menuWidth:null,previewValue:null},this.hiddenRef=wr.createRef(),this.buttonRef=wr.createRef(),this.previewRef=wr.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"),o=e.querySelector('[data-math-handled="true"]');!t||o&&n||Pr(e)}),n){const e=n.clientWidth;e!==this.state.menuWidth&&(this.elementRefs.forEach(e=>{e&&Pr(e)}),Pr(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:o,choices:r,showCorrectAnswer:i,singleQuery:s,correctValue:a}=this.props,{anchorEl:l}=this.state,c=Boolean(l),d=`dropdown-button-${e}`,u=`dropdown-menu-${e}`,h=`dropdown-value-${e}`;let p;this.elementRefs=[],n&&void 0!==t&&(p=t||i?"disabledCorrect":"disabledIncorrect");const g=parseInt(e,10)+1,f=s?"Query-label":`Query-label-${g}`,m=s?"Query":`Query ${g}`;let b=null;return n&&void 0!==t&&(b=t||i?wr.createElement(zr,{className:"correct"}):wr.createElement(Wr,{className:"incorrect"})),wr.createElement(wr.Fragment,null,wr.createElement("div",{ref:this.hiddenRef,style:{position:"absolute",visibility:"hidden",top:0,left:0},tabIndex:-1,"aria-hidden":"true"},(r||[]).map((e,t)=>wr.createElement(jr,{key:t,tabIndex:-1,"aria-hidden":"true"},wr.createElement(Ir,{dangerouslySetInnerHTML:{__html:e.label}})))),wr.createElement(Fr,{id:f,tabIndex:-1,"aria-hidden":"true"},m),wr.createElement(Tr,{ref:this.buttonRef,style:{...this.state.menuWidth&&{minWidth:`calc(${this.state.menuWidth}px + 8px)`},borderWidth:c?"2px":"1px",transition:"border-width 0.2s ease-in-out"},"aria-controls":c?u:void 0,"aria-haspopup":"listbox","aria-expanded":c?"true":void 0,"aria-activedescendant":this.state.highlightedOptionId,onClick:this.handleClick,className:p,disabled:n,id:d,role:"combobox","aria-label":`Select an option for ${m}`,"aria-labelledby":h},b,wr.createElement(Ir,{id:h,ref:this.previewRef,dangerouslySetInnerHTML:{__html:a||(c&&this.state.previewValue?this.getLabel(r,this.state.previewValue):this.getLabel(r,o)||"")}}),c?wr.createElement(Or,null):wr.createElement(Er,null)),wr.createElement($r,{id:u,anchorEl:l,keepMounted:!0,open:c,onClose:this.handleClose,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},transitionDuration:{enter:225,exit:195},slotProps:{paper:this.state.menuWidth?{style:{minWidth:this.state.menuWidth,padding:"4px"}}:void 0,list:{"aria-labelledby":d,role:"listbox",disablePadding:!0}}},(r||[]).map((t,n)=>{const r=`dropdown-option-${e}-${n}`;return wr.createElement(jr,{id:r,className:t.value===o?"selected":"",key:`${t.label}-${n}`,value:t.value,onClick:()=>this.handleSelect(t.value,n),role:"option","aria-selected":this.state.highlightedOptionId===r?"true":void 0,onMouseOver:()=>this.handleHover(n)},wr.createElement(Ir,{ref:e=>this.elementRefs[n]=e,dangerouslySetInnerHTML:{__html:t.label}}),wr.createElement(Mr,{dangerouslySetInnerHTML:{__html:t.value===o?" ✓":""}}))})))}}Br.__initStatic();const Hr=n;function Vr(e,t){return null!=e?e:t()}function Ur(e){let t,n=e[0],o=1;for(;o<e.length;){const r=e[o],i=e[o+1];if(o+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=i(n)):"call"!==r&&"optionalCall"!==r||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}Te("dropdown",e=>(t,n,o)=>{const r=t.data&&t.data.dataset||{};if("dropdown"===r.component){const{choices:i,disabled:s,feedback:a,showCorrectAnswer:l}=e,c=i&&i[r.id]&&i[r.id].find(e=>e.correct),d=l?c&&c.value:n[r.id];return Hr.createElement(Br,{key:`${t.type}-dropdown-${r.id}`,correct:a&&a[r.id]&&"correct"===a[r.id],disabled:s||l,value:d,correctValue:l?c&&c.label:void 0,id:r.id,onChange:o,choices:i[r.id],showCorrectAnswer:l,singleQuery:1==Object.keys(i).length})}});const Kr=e=>"string"==typeof e,qr=()=>{let e,t;const n=new Promise((n,o)=>{e=n,t=o});return n.resolve=e,n.reject=t,n},Yr=e=>null==e?"":""+e,Jr=/###/g,Xr=e=>e&&e.indexOf("###")>-1?e.replace(Jr,"."):e,Qr=e=>!e||Kr(e),Gr=(e,t,n)=>{const o=Kr(t)?t.split("."):t;let r=0;for(;r<o.length-1;){if(Qr(e))return{};const t=Xr(o[r]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return Qr(e)?{}:{obj:e,k:Xr(o[r])}},Zr=(e,t,n)=>{const{obj:o,k:r}=Gr(e,t,Object);if(void 0!==o||1===t.length)return void(o[r]=n);let i=t[t.length-1],s=t.slice(0,t.length-1),a=Gr(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Gr(e,s,Object),Ur([a,"optionalAccess",e=>e.obj])&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},ei=(e,t)=>{const{obj:n,k:o}=Gr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,o))return n[o]},ti=(e,t,n)=>{for(const o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?Kr(e[o])||e[o]instanceof String||Kr(t[o])||t[o]instanceof String?n&&(e[o]=t[o]):ti(e[o],t[o],n):e[o]=t[o]);return e},ni=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var oi={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ri=e=>Kr(e)?e.replace(/[&<>"'\/]/g,e=>oi[e]):e;const ii=[" ",",","?","!",";"],si=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),ai=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const o=t.split(n);let r=e;for(let e=0;e<o.length;){if(!r||"object"!=typeof r)return;let t,i="";for(let s=e;s<o.length;++s)if(s!==e&&(i+=n),i+=o[s],t=r[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<o.length-1)continue;e+=s-e+1;break}r=t}return r},li=e=>Ur([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),ci={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Ur([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class di{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ci,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,o){return o&&!this.debug?null:(Kr(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new di(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new di(this.logger,e)}}var ui=new di;class hi{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 o=0;o<n;o++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,o])=>{for(let r=0;r<o;r++)n.apply(n,[e,...t])})}}}class pi extends hi{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,o={}){const r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,i=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],n&&(Array.isArray(n)?s.push(...n):Kr(n)&&r?s.push(...n.split(r)):s.push(n)));const a=ei(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Kr(n)?ai(Ur([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,r):a}addResource(e,t,n,o,r={silent:!1}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let s=[e,t];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),o=t,t=s[1]),this.addNamespaces(t),Zr(this.data,s,o),r.silent||this.emit("added",e,t,n,o)}addResources(e,t,n,o={silent:!1}){for(const o in n)(Kr(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});o.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,o,r,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),o=n,n=t,t=s[1]),this.addNamespaces(t);let a=ei(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?ti(a,n,r):a={...a,...n},Zr(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 gi={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,o,r){return e.forEach(e=>{t=Vr(Ur([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,o,r)]),()=>t)}),t}};const fi=Symbol("i18next/PATH_KEY");function mi(e,t){const{[fi]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(o,r)=>(Ur([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),r===fi?e:(e.push(r),n=Proxy.revocable(o,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(Vr(Ur([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const bi={},vi=e=>!Kr(e)&&"boolean"!=typeof e&&"number"!=typeof e;class yi extends hi{constructor(e,t={}){var n,o;super(),n=e,o=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(o[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=ui.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const o=this.resolve(e,n);if(void 0===Ur([o,"optionalAccess",e=>e.res]))return!1;const r=vi(o.res);return!1!==n.returnObjects||!r}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=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 o=ii.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===o.length)return!0;const r=si.getRegExp(`(${o.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!r.test(e);if(!i){const t=e.indexOf(n);t>0&&!r.test(e.substring(0,t))&&(i=!0)}return i})(e,n,o));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Kr(r)?[r]:r};const i=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(i[0])>-1)&&(r=i.shift()),e=i.join(o)}return{key:e,namespaces:Kr(r)?[r]:r}}translate(e,t,n){let o="object"==typeof t?{...t}:t;if("object"!=typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof o&&(o={...o}),o||(o={}),null==e)return"";"function"==typeof e&&(e=mi(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);const r=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(e[e.length-1],o),l=a[a.length-1];let c=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=o.lng||this.language,u=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Ur([d,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return u?r?{res:`${l}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:`${l}${c}${s}`:r?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(o)}:s;const h=this.resolve(e,o);let p=Ur([h,"optionalAccess",e=>e.res]);const g=Ur([h,"optionalAccess",e=>e.usedKey])||s,f=Ur([h,"optionalAccess",e=>e.exactUsedKey])||s,m=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!Kr(o.count),y=yi.hasDefaultValue(o),x=v?this.pluralResolver.getSuffix(d,o.count,o):"",w=o.ordinal&&v?this.pluralResolver.getSuffix(d,o.count,{ordinal:!1}):"",C=v&&!o.ordinal&&0===o.count,S=C&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${x}`]||o[`defaultValue${w}`]||o.defaultValue;let k=p;b&&!p&&y&&(k=S);const A=vi(k),R=Object.prototype.toString.apply(k);if(!(b&&k&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(R)<0)||Kr(m)&&Array.isArray(k))if(b&&Kr(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,o,n));else{let t=!1,r=!1;!this.isValidLookup(p)&&y&&(t=!0,p=S),this.isValidLookup(p)||(r=!0,p=s);const a=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:p,u=y&&S!==p&&this.options.updateMissing;if(r||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,s,u?S:p),i){const e=this.resolve(s,{...o,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,o.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(o.lng||this.language):e.push(o.lng||this.language);const n=(e,t,n)=>{const r=y&&n!==p?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,u,o):Ur([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,l,t,r,u,o),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,o);C&&o[`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,o[`defaultValue${t}`]||S)})}):n(e,s,S))}p=this.extendTranslation(p,e,o,h,n),r&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${l}${c}${s}`),(r||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${s}`:s,t?p:void 0,o))}else{if(!o.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,{...o,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return r?(h.res=e,h.usedParams=this.getUsedParamsDetails(o),h):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 r=`${n}${i}${e}`;t[e]=y&&!p?this.translate(r,{...o,defaultValue:vi(S)?S[e]:void 0,joinArrays:!1,ns:a}):this.translate(r,{...o,joinArrays:!1,ns:a}),t[e]===r&&(t[e]=k[e])}p=t}}return r?(h.res=p,h.usedParams=this.getUsedParamsDetails(o),h):p}extendTranslation(e,t,n,o,r){if(Ur([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i=Kr(e)&&(void 0!==Ur([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&&!Kr(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||o.usedLng,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>Ur([r,"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=Kr(i)?[i]:i;return null!=e&&Ur([s,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=gi.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,o,r,i,s;return Kr(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(e,t),l=a.key;o=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!Kr(t.count),u=d&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Kr(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(s=e,bi[`${p[0]}-${e}`]||!Ur([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ur([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(s)])||(bi[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${p.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!!!")),p.forEach(o=>{if(this.isValidLookup(n))return;i=o;const s=[l];if(Ur([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(s,l,o,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(o,t.count,t));const n=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(r)&&s.push(l+e.replace(r,this.options.pluralSeparator)),s.push(l+e),u&&s.push(l+n)),h){const o=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(o),d&&(t.ordinal&&0===e.indexOf(r)&&s.push(o+e.replace(r,this.options.pluralSeparator)),s.push(o+e),u&&s.push(o+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(r=a,n=this.getResource(o,e,a,t))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,o={}){return Ur([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Kr(e.replace);let o=n?e.replace:e;if(n&&void 0!==e.count&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const e of t)delete o[e]}return o}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 xi{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ui.create("languageUtils")}getScriptPartFromCode(e){if(!(e=li(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=li(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Kr(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 o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find(e=>e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:e.indexOf("-")>0&&o.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.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)),Kr(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),o=[],r=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Kr(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):Kr(e)&&r(this.formatLanguageCode(e)),n.forEach(e=>{o.indexOf(e)<0&&r(this.formatLanguageCode(e))}),o}}const wi={zero:0,one:1,two:2,few:3,many:4,other:5},Ci={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Si{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ui.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=li("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:o});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let i;try{i=new Intl.PluralRules(n,{type:o})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ci;if(!e.match(/-|_/))return Ci;const o=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(o,t)}return this.pluralRulesCache[r]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),Ur([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)=>wi[e]-wi[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const ki=(e,t,n,o=".",r=!0)=>{let i=((e,t,n)=>{const o=ei(e,n);return void 0!==o?o:ei(t,n)})(e,t,n);return!i&&r&&Kr(n)&&(i=ai(e,n,o),void 0===i&&(i=ai(t,n,o))),i},Ai=e=>e.replace(/\$/g,"$$$$");class Ri{constructor(e={}){this.logger=ui.create("interpolator"),this.options=e,this.format=Ur([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:o,prefix:r,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:ri,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==o&&o,this.prefix=r?ni(r):i||"{{",this.suffix=s?ni(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=u?ni(u):h||ni("$t("),this.nestingSuffix=p?ni(p):g||ni(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Ur([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,o){let r,i,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const r=ki(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,n,{...o,...t,interpolationkey:e}):r}const r=e.split(this.formatSeparator),i=r.shift().trim(),s=r.join(this.formatSeparator).trim();return this.format(ki(t,a,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...o,...t,interpolationkey:i})};this.resetRegExp();const c=Ur([o,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,d=void 0!==Ur([o,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Ai(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Ai(this.escape(e)):Ai(e)}].forEach(t=>{for(s=0;r=t.regex.exec(e);){const n=r[1].trim();if(i=l(n),void 0===i)if("function"==typeof c){const t=c(e,r,o);i=Kr(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))i="";else{if(d){i=r[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else Kr(i)||this.useRawValueToEscape||(i=Yr(i));const a=t.safeValue(i);if(e=e.replace(r[0],a),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t,n={}){let o,r,i;const s=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const o=e.split(new RegExp(`${n}[ ]*{`));let r=`{${o[1]}`;e=o[0],r=this.interpolate(r,i);const s=r.match(/'/g),a=r.match(/"/g);(Vr(Ur([s,"optionalAccess",e=>e.length]),()=>0)%2==0&&!a||a.length%2!=0)&&(r=r.replace(/'/g,'"'));try{i=JSON.parse(r),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${r}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let a=[];i={...n},i=i.replace&&!Kr(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const l=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==l&&(a=o[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),o[1]=o[1].slice(0,l)),r=t(s.call(this,o[1].trim(),i),i),r&&o[0]===e&&!Kr(r))return r;Kr(r)||(r=Yr(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),a.length&&(r=a.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()}),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}const Ei=e=>{const t={};return(n,o,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const s=o+JSON.stringify(i);let a=t[s];return a||(a=e(li(o),r),t[s]=a),a(n)}},Oi=e=>(t,n,o)=>e(li(n),o)(t);class Li{constructor(e={}){this.logger=ui.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Ei:Oi;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()]=Ei(t)}format(e,t,n,o={}){const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(e=>e.indexOf(")")>-1)){const e=r.findIndex(e=>e.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,e)].join(this.formatSeparator)}const i=r.reduce((e,t)=>{const{formatName:r,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const o=e.split("(");t=o[0].toLowerCase().trim();const r=o[1].substring(0,o[1].length-1);"currency"===t&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):"relativetime"===t&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(e=>{if(e){const[t,...o]=e.split(":"),r=o.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=r),"false"===r&&(n[i]=!1),"true"===r&&(n[i]=!0),isNaN(r)||(n[i]=parseInt(r,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[r]){let t=e;try{const s=Ur([o,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[o.interpolationkey]])||{},a=s.locale||s.lng||o.locale||o.lng||n;t=this.formats[r](e,a,{...i,...o,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e},e);return i}}class Ni extends hi{constructor(e,t,n,o={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=ui.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],Ur([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,o.backend,o)])}queueLoad(e,t,n,o){const r={},i={},s={},a={};return e.forEach(e=>{let o=!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,o=!1,void 0===i[s]&&(i[s]=!0),void 0===r[s]&&(r[s]=!0),void 0===a[t]&&(a[t]=!0)))}),o||(s[e]=!0)}),(Object.keys(r).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(r),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const o=e.split("|"),r=o[0],i=o[1];t&&this.emit("failedLoading",r,i,t),!t&&n&&this.store.addResourceBundle(r,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:o,k:r}=Gr(e,t,Object);o[r]=o[r]||[],o[r].push(n)})(n.loaded,[r],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,o=0,r=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:o,wait:r,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&&o<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,o+1,2*r,i)},r):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={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Kr(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Kr(t)&&(t=[t]);const r=this.queueLoad(e,t,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.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("|"),o=n[0],r=n[1];this.read(o,r,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${r} for language ${o} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${r} for language ${o}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,o,r,i={},s=()=>{}){if(!Ur([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Ur([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(Ur([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const a={...i,isUpdate:r},l=this.backend.create.bind(this.backend);if(l.length<6)try{let r;r=5===l.length?l(e,t,n,o,a):l(e,t,n,o),r&&"function"==typeof r.then?r.then(e=>s(null,e)).catch(s):s(null,r)}catch(e){s(e)}else l(e,t,n,o,s,a)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}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 Di=()=>({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]),Kr(e[1])&&(t.defaultValue=e[1]),Kr(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}),_i=e=>(Kr(e.ns)&&(e.ns=[e.ns]),Kr(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Kr(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Ur([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),Pi=()=>{};class Ti extends hi{constructor(e={},t){var n;if(super(),this.options=_i(e),this.services={},this.logger=ui,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&&(Kr(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Di();var o;this.options={...n,...this.options,..._i(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||(Ur([o=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Ur([o,"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||Ur([o,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&o.options.backend.backends.some(e=>Ur([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Ur([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 r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?ui.init(r(this.modules.logger),this.options):ui.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Li;const t=new xi(this.options);this.store=new pi(this.options.resources,this.options);const o=this.services;o.logger=ui,o.resourceStore=this.store,o.languageUtils=t,o.pluralResolver=new Si(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||(o.formatter=r(e),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new Ri(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new Ni(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new yi(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=Pi),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=qr(),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=Pi){let n=t;const o=Kr(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Ur([o,"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(o)t(o);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}Ur([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 o=qr();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=Pi),this.services.backendConnector.reload(e,t,e=>{o.resolve(),n(e)}),o}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&&gi.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=qr();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,i)=>{i?this.isLanguageChangingTo===e&&(o(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(r,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Kr(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Kr(t)?[t]:t);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),Ur([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{r(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 o=(e,t,...r)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(r)):{...t},i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const s=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=mi(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=mi(e,{...this.options,...t})),a=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(a,i)};return Kr(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return Ur([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Ur([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],o=!!this.options&&this.options.fallbackLng,r=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)||o&&!i(r,e)))}loadNamespaces(e,t){const n=qr();return this.options.ns?(Kr(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=qr();Kr(e)&&(e=[e]);const o=this.options.preload||[],r=e.filter(e=>o.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=o.concat(r),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Ur([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=Ur([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new xi(Di());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 Ti(e,t);return n.createInstance=Ti.createInstance,n}cloneInstance(e={},t=Pi){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},r=new Ti(o);void 0===e.debug&&void 0===e.prefix||(r.logger=r.logger.clone(e));if(["store","services","language"].forEach(e=>{r[e]=this[e]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},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,o)=>(n[o]={...e[t][o]},n),e[t]),e),{});r.store=new pi(e,o),r.services.resourceStore=r.store}if(e.interpolation){const t={...Di().interpolation,...this.options.interpolation,...e.interpolation},n={...o,interpolation:t};r.services.interpolator=new Ri(n)}return r.translator=new yi(r.services,o),r.translator.on("*",(e,...t)=>{r.emit(e,...t)}),r.init(o,t),r.translator.options=o,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const $i=Ti.createInstance();$i.createInstance,$i.dir,$i.init,$i.loadResources,$i.reloadResources,$i.use,$i.changeLanguage,$i.getFixedT,$i.t,$i.exists,$i.setDefaultNamespace,$i.hasLoadedNamespace,$i.loadNamespaces,$i.loadLanguages;$i.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 ji={translator:{...$i,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 $i.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const Ii=n,Mi=o,{debounce:Fi}=i,{isEmpty:zi}=i,{isEqual:Wi}=i,Bi=d,{color:Hi}=a,{Collapsible:Vi}=a,{hasText:Ui}=a,{hasMedia:Ki}=a,{PreviewPrompt:qi}=a,{UiLayout:Yi}=a,{styled:Ji}=r,{translator:Xi}=ji,Qi=Ji(Yi)(({alwaysShowCorrect:e})=>({color:Hi.text(),backgroundColor:Hi.background(),...e&&{"& *":{borderColor:`${Hi.text()} !important`}}})),Gi=Ji("div")(({theme:e})=>({marginBottom:e.spacing(2)})),Zi=Ji("div")(({theme:e})=>({marginBottom:e.spacing(2)})),es=Ji("h2")({position:"absolute",left:"-10000px",top:"auto",width:"1px",height:"1px",overflow:"hidden"});class ts extends Ii.Component{constructor(...e){super(...e),ts.prototype.__init.call(this),ts.prototype.__init2.call(this),ts.prototype.__init3.call(this),ts.prototype.__init4.call(this),ts.prototype.__init5.call(this)}static __initStatic(){this.propTypes={alwaysShowCorrect:Mi.bool,animationsDisabled:Mi.bool,disabled:Mi.bool,displayType:Mi.string,feedback:Mi.object,language:Mi.string,markup:Mi.string,maxLengthPerChoice:Mi.array,maxLengthPerChoiceEnabled:Mi.bool,mode:Mi.string,note:Mi.string,onChange:Mi.func,playerSpellCheckEnabled:Mi.bool,prompt:Mi.string,rationale:Mi.string,role:Mi.string,showNote:Mi.bool,teacherInstructions:Mi.string,value:Mi.object,responseAreaInputConfiguration:Mi.object,model:Mi.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:Fi(this.props.onChange,200,{maxWait:200})}UNSAFE_componentWillReceiveProps(e){const{maxLengthPerChoice:t,language:n}=this.props;let{note:o}=this.props;zi(e.feedback)&&this.setState({showCorrectAnswer:!1}),e.alwaysShowCorrect&&this.setState({showCorrectAnswer:!0}),t&&!Wi(t,e.maxLengthPerChoice)&&(this.changeSession=this.getChangeSession(e.maxLengthPerChoice)),o&&n&&n!==e.language&&o===Xi.t("common:commonCorrectAnswerWithAlternates",{lng:n})&&(o=Xi.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:o,displayType:r,role:i,language:s,maxLengthPerChoice:a,maxLengthPerChoiceEnabled:l,note:c,playerSpellCheckEnabled:d,prompt:u,rationale:h,showNote:p,teacherInstructions:g,responseAreaInputConfiguration:f,model:m,value:b}=this.props,{extraCSSRules:v}=m||{},y=(e||"view"===o&&"instructor"===i)&&p&&c,x=Ii.createElement(qi,{defaultClassName:"teacher-instructions",prompt:g}),w=Ii.createElement(qi,{prompt:h}),C=h&&(Ui(h)||Ki(h)),S=g&&(Ui(g)||Ki(g));return Ii.createElement(Qi,{extraCSSRules:v,alwaysShowCorrect:t,style:{display:`${r}`}},"gather"===o&&Ii.createElement(es,null,"Fill in the Blank Question"),S&&Ii.createElement(Zi,null,n?x:Ii.createElement(Vi,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},x)),u&&Ii.createElement(qi,{prompt:u}),!t&&Ii.createElement(Bi,{show:"evaluate"===o,toggled:e,onToggle:this.toggleShowCorrect,language:s}),Ii.createElement(xr,{...this.props,onChange:this.onChange,showCorrectAnswer:e,value:b,maxLength:a,adjustedLimit:l,spellCheck:d,pluginProps:f}),y&&Ii.createElement(Gi,{dangerouslySetInnerHTML:{__html:c}}),C&&Ii.createElement(Zi,null,n?w:Ii.createElement(Vi,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},w)))}}ts.__initStatic(),ts.__initStatic2();const ns=n,{renderMath:os}=u;class rs extends HTMLElement{constructor(){super(),rs.prototype.__init.call(this),rs.prototype.__init2.call(this),rs.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 b(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=ns.createElement(ts,{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=p(this)),this._root.render(e),queueMicrotask(()=>{os(this)})}}}__init2(){this.dispatchChangedEvent=()=>{this.dispatchEvent(new C(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{rs as default};
|
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/explicit-constructed-response@10.0.0-beta.1</title>
|
|
6
|
-
<script
|
|
7
|
-
type="module"
|
|
8
|
-
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
12
|
-
rel="stylesheet"
|
|
13
|
-
/>
|
|
14
|
-
<style>
|
|
15
|
-
html, body {
|
|
16
|
-
font-family: 'Roboto', sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
<script type="module" src="./demo.js"></script>
|
|
20
|
-
</head>
|
|
21
|
-
</html>
|
package/module/manifest.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pie-element/explicit-constructed-response",
|
|
3
|
-
"version": "10.0.0-beta.1",
|
|
4
|
-
"modules": [
|
|
5
|
-
{
|
|
6
|
-
"name": "@pie-lib/shared-module",
|
|
7
|
-
"version": "^3.0.5"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"name": "@pie-lib/math-rendering-module",
|
|
11
|
-
"version": "^4.0.5"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "@pie-lib/drag-module",
|
|
15
|
-
"version": "^3.0.5"
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
package/module/print-demo.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
const choice = (l, v) => ({ label: l, value: v });
|
|
6
|
-
|
|
7
|
-
const markup = '<p>The {{0}} <br> jumped {{1}} <br> the {{2}}</p>';
|
|
8
|
-
|
|
9
|
-
generate.model = (id, element) => ({
|
|
10
|
-
id,
|
|
11
|
-
element,
|
|
12
|
-
markup,
|
|
13
|
-
disabled: false,
|
|
14
|
-
choices: {
|
|
15
|
-
0: [choice('cow', '0'), choice('cattle', '1'), choice('calf', '2')],
|
|
16
|
-
1: [choice('over', '0'), choice('past', '1'), choice('beyond', '2')],
|
|
17
|
-
2: [choice('moon', '0')],
|
|
18
|
-
},
|
|
19
|
-
maxLengthPerChoice: [7, 10, 4],
|
|
20
|
-
prompt: 'Complete the sentence',
|
|
21
|
-
promptEnabled: true,
|
|
22
|
-
toolbarEditorPosition: 'bottom',
|
|
23
|
-
rubricEnabled: false,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const { model } = generate;
|
|
27
|
-
|
|
28
|
-
var config = {
|
|
29
|
-
elements: {
|
|
30
|
-
'explicit-constructed-response': '../..',
|
|
31
|
-
},
|
|
32
|
-
models: [model('1', 'explicit-constructed-response')],
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// new init - just shows off print!
|
|
36
|
-
|
|
37
|
-
const init = async () => {
|
|
38
|
-
console.log('define the element...');
|
|
39
|
-
await Promise.all(
|
|
40
|
-
config.models.map(async (m) => {
|
|
41
|
-
try {
|
|
42
|
-
const printTag = `${m.element}-print`;
|
|
43
|
-
if (customElements.get(printTag)) {
|
|
44
|
-
return true;
|
|
45
|
-
} else {
|
|
46
|
-
customElements.define(printTag, PrintElement);
|
|
47
|
-
await customElements.whenDefined(printTag);
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
} catch (e) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
console.log('now apply the model...');
|
|
57
|
-
config.models.forEach((m) => {
|
|
58
|
-
const printTag = `${m.element}-print`;
|
|
59
|
-
const h3s = document.createElement('h3');
|
|
60
|
-
h3s.textContent = 'student mode';
|
|
61
|
-
document.body.appendChild(h3s);
|
|
62
|
-
const de = document.createElement(printTag);
|
|
63
|
-
document.body.appendChild(de);
|
|
64
|
-
de.options = {};
|
|
65
|
-
de.model = m;
|
|
66
|
-
|
|
67
|
-
const h3 = document.createElement('h3');
|
|
68
|
-
h3.textContent = 'instructor mode';
|
|
69
|
-
document.body.appendChild(h3);
|
|
70
|
-
const instr = document.createElement(printTag);
|
|
71
|
-
document.body.appendChild(instr);
|
|
72
|
-
instr.options = { mode: 'instructor' };
|
|
73
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
init()
|
|
78
|
-
.then(() => {
|
|
79
|
-
console.log('ready');
|
|
80
|
-
})
|
|
81
|
-
.catch((e) => {
|
|
82
|
-
console.error(e);
|
|
83
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/explicit-constructed-response@10.0.0-beta.1</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
<script type="module" src="./print-demo.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body></body>
|
|
18
|
-
</html>
|