@pie-element/match-list 7.1.2-next.7 → 7.1.2-next.8
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/dist/browser/delivery/index.js +52 -51
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/delivery/answer-area.js +2 -2
- package/dist/delivery/answer.d.ts +5 -0
- package/dist/delivery/answer.js +37 -33
- package/dist/delivery/main.js +4 -7
- package/dist/index.iife.js +1 -1
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -149,4 +149,4 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
149
149
|
To pick up a draggable item, press the space bar.
|
|
150
150
|
While dragging, use the arrow keys to move the item.
|
|
151
151
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
152
|
-
`},Kp={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 qp(e){let{announcements:t=Kp,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Gp}=e,{announce:a,announcement:o}=Vp(),s=Dp(`DndLiveRegion`),[c,l]=(0,R.useState)(!1);if((0,R.useEffect)(()=>{l(!0)},[]),Up((0,R.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=R.createElement(R.Fragment,null,R.createElement(zp,{id:r,value:i.draggable}),R.createElement(Bp,{id:s,announcement:o}));return n?(0,ys.createPortal)(u,n):u}var Jp;(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`})(Jp||={});function Yp(){}var Xp=Object.freeze({x:0,y:0});function Zp(e,t){let n=Pp(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Qp(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $p(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function em(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var tm=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=em(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Qp)};function nm(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function rm(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Xp}function im(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var am=im(1);function om(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function sm(e,t,n){let r=om(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var cm={ignoreTransform:!1};function lm(e,t){t===void 0&&(t=cm);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=mp(e).getComputedStyle(e);t&&(n=sm(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function um(e){return lm(e,{ignoreTransform:!0})}function dm(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fm(e,t){return t===void 0&&(t=mp(e).getComputedStyle(e)),t.position===`fixed`}function pm(e,t){t===void 0&&(t=mp(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function mm(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(hp(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!gp(i)||_p(i)||n.includes(i))return n;let a=mp(e).getComputedStyle(i);return i!==e&&pm(i,a)&&n.push(i),fm(i,a)?n:r(i.parentNode)}return e?r(e):n}function hm(e){let[t]=mm(e,1);return t??null}function gm(e){return!dp||!e?null:fp(e)?e:pp(e)?hp(e)||e===vp(e).scrollingElement?window:gp(e)?e:null:null}function _m(e){return fp(e)?e.scrollX:e.scrollLeft}function vm(e){return fp(e)?e.scrollY:e.scrollTop}function ym(e){return{x:_m(e),y:vm(e)}}var bm;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(bm||={});function xm(e){return!dp||!e?!1:e===document.scrollingElement}function Sm(e){let t={x:0,y:0},n=xm(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Cm={x:.2,y:.2};function wm(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Cm);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Sm(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=bm.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=bm.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=bm.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=bm.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Tm(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Em(e){return e.reduce((e,t)=>kp(e,ym(t)),Xp)}function Dm(e){return e.reduce((e,t)=>e+_m(t),0)}function Om(e){return e.reduce((e,t)=>e+vm(t),0)}function km(e,t){if(t===void 0&&(t=lm),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);hm(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Am=[[`x`,[`left`,`right`],Dm],[`y`,[`top`,`bottom`],Om]],jm=class{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;let n=mm(t),r=Em(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Am)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Mm=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Nm(e){let{EventTarget:t}=mp(e);return e instanceof t?e:vp(e)}function Pm(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var Fm;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Fm||={});function Im(e){e.preventDefault()}function Lm(e){e.stopPropagation()}var Q;(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`})(Q||={});var Rm={start:[Q.Space,Q.Enter],cancel:[Q.Esc],end:[Q.Space,Q.Enter,Q.Tab]},zm=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Q.Right:return{...n,x:n.x+25};case Q.Left:return{...n,x:n.x-25};case Q.Down:return{...n,y:n.y+25};case Q.Up:return{...n,y:n.y-25}}},Bm=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Mm(vp(t)),this.windowListeners=new Mm(mp(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fm.Resize,this.handleCancel),this.windowListeners.add(Fm.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fm.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&km(n),t(Xp)}handleKeyDown(e){if(Mp(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Rm,coordinateGetter:a=zm,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Xp;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Ap(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Sm(n),p=Tm(n),m={x:Math.min(i===Q.Right?p.right-p.width/2:p.right,Math.max(i===Q.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Q.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Q.Down?p.top:p.top+p.height/2,u.y))},h=i===Q.Right&&!s||i===Q.Left&&!c,g=i===Q.Down&&!l||i===Q.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Q.Right&&e<=d.x||i===Q.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===Q.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Q.Down&&e<=d.y||i===Q.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===Q.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,kp(Ap(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Bm.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Rm,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Vm(e){return!!(e&&`distance`in e)}function Hm(e){return!!(e&&`delay`in e)}var Um=class{constructor(e,t,n){n===void 0&&(n=Nm(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;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=vp(i),this.documentListeners=new Mm(this.document),this.listeners=new Mm(n),this.windowListeners=new Mm(mp(i)),this.initialCoordinates=Pp(r)??Xp,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(){let{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(Fm.Resize,this.handleCancel),this.windowListeners.add(Fm.DragStart,Im),this.windowListeners.add(Fm.VisibilityChange,this.handleCancel),this.windowListeners.add(Fm.ContextMenu,Im),this.documentListeners.add(Fm.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hm(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Vm(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Fm.Click,Lm,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fm.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Pp(e)??Xp,s=Ap(n,o);if(!t&&a){if(Vm(a)){if(a.tolerance!=null&&Pm(s,a.tolerance))return this.handleCancel();if(Pm(s,a.distance))return this.handleStart()}if(Hm(a)&&Pm(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Q.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Wm={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Gm=class extends Um{constructor(e){let{event:t}=e,n=vp(t.target);super(e,Wm,n)}};Gm.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Km={move:{name:`mousemove`},end:{name:`mouseup`}},qm;(function(e){e[e.RightClick=2]=`RightClick`})(qm||={});var Jm=class extends Um{constructor(e){super(e,Km,vp(e.event.target))}};Jm.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===qm.RightClick?!1:(r?.({event:n}),!0)}}];var Ym={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Xm=class extends Um{constructor(e){super(e,Ym)}static setup(){return window.addEventListener(Ym.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ym.move.name,e)};function e(){}}};Xm.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Zm;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Zm||={});var Qm;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Qm||={});function $m(e){let{acceleration:t,activator:n=Zm.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Qm.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=th({delta:d,disabled:!a}),[m,h]=xp(),g=(0,R.useRef)({x:0,y:0}),_=(0,R.useRef)({x:0,y:0}),v=(0,R.useMemo)(()=>{switch(n){case Zm.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Zm.DraggableRect:return i}},[n,i,c]),y=(0,R.useRef)(null),b=(0,R.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,R.useMemo)(()=>s===Qm.TreeOrder?[...l].reverse():l,[s,l]);(0,R.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=wm(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var eh={x:{[bm.Backward]:!1,[bm.Forward]:!1},y:{[bm.Backward]:!1,[bm.Forward]:!1}};function th(e){let{delta:t,disabled:n}=e,r=Tp(t);return Cp(e=>{if(n||!r||!e)return eh;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[bm.Backward]:e.x[bm.Backward]||i.x===-1,[bm.Forward]:e.x[bm.Forward]||i.x===1},y:{[bm.Backward]:e.y[bm.Backward]||i.y===-1,[bm.Forward]:e.y[bm.Forward]||i.y===1}}},[n,t,r])}function nh(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Cp(e=>t==null?null:r??e??null,[r,t])}function rh(e,t){return(0,R.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var ih;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(ih||={});var ah;(function(e){e.Optimized=`optimized`})(ah||={});var oh=new Map;function sh(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,R.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,R.useRef)(e),d=g(),f=Sp(d),p=(0,R.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,R.useRef)(null),h=Cp(t=>{if(d&&!n)return oh;if(!t||t===oh||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new jm(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,R.useEffect)(()=>{u.current=e},[e]),(0,R.useEffect)(()=>{d||p()},[n,d]),(0,R.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,R.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case ih.Always:return!1;case ih.BeforeDragging:return n;default:return!n}}}function ch(e,t){return Cp(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function lh(e,t){return ch(e,t)}function uh(e){let{callback:t,disabled:n}=e,r=bp(t),i=(0,R.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,R.useEffect)(()=>()=>i?.disconnect(),[i]),i}function dh(e){let{callback:t,disabled:n}=e,r=bp(t),i=(0,R.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,R.useEffect)(()=>()=>i?.disconnect(),[i]),i}function fh(e){return new jm(lm(e),e)}function ph(e,t,n){t===void 0&&(t=fh);let[r,i]=(0,R.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=uh({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=dh({callback:a});return yp(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function mh(e){return rm(e,ch(e))}var hh=[];function gh(e){let t=(0,R.useRef)(e),n=Cp(n=>e?n&&n!==hh&&e&&t.current&&e.parentNode===t.current.parentNode?n:mm(e):hh,[e]);return(0,R.useEffect)(()=>{t.current=e},[e]),n}function _h(e){let[t,n]=(0,R.useState)(null),r=(0,R.useRef)(e),i=(0,R.useCallback)(e=>{let t=gm(e.target);t&&n(e=>e?(e.set(t,ym(t)),new Map(e)):null)},[]);return(0,R.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=gm(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,ym(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{gm(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,R.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>kp(e,t),Xp):Em(e):Xp,[e,t])}function vh(e,t){t===void 0&&(t=[]);let n=(0,R.useRef)(null);return(0,R.useEffect)(()=>{n.current=null},t),(0,R.useEffect)(()=>{let t=e!==Xp;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ap(e,n.current):Xp}function yh(e){(0,R.useEffect)(()=>{if(!dp)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function bh(e,t){return(0,R.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function xh(e){return(0,R.useMemo)(()=>e?dm(e):null,[e])}var Sh=[];function Ch(e,t){t===void 0&&(t=lm);let[n]=e,r=xh(n?mp(n):null),[i,a]=(0,R.useState)(Sh);function o(){a(()=>e.length?e.map(e=>xm(e)?r:new jm(t(e),e)):Sh)}let s=dh({callback:o});return yp(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function wh(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return gp(t)?t:e}function Th(e){let{measure:t}=e,[n,r]=(0,R.useState)(null),i=dh({callback:(0,R.useCallback)(e=>{for(let{target:n}of e)if(gp(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=wp((0,R.useCallback)(e=>{let n=wh(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,R.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Eh=[{sensor:Gm,options:{}},{sensor:Bm,options:{}}],Dh={current:{}},Oh={draggable:{measure:um},droppable:{measure:um,strategy:ih.WhileDragging,frequency:ah.Optimized},dragOverlay:{measure:lm}},kh=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Ah={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Oh,measureDroppableContainers:Yp,windowRect:null,measuringScheduled:!1},jh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Yp,draggableNodes:new Map,over:null,measureDroppableContainers:Yp},Mh=(0,R.createContext)(jh),Nh=(0,R.createContext)(Ah);function Ph(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kh}}}function Fh(e,t){switch(t.type){case Jp.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Jp.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Jp.DragEnd:case Jp.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Jp.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new kh(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Jp.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new kh(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Jp.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new kh(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Ih(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,R.useContext)(Mh),a=Tp(r),o=Tp(n?.id);return(0,R.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Mp(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Lp(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Lh(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Rh(e){return(0,R.useMemo)(()=>({draggable:{...Oh.draggable,...e?.draggable},droppable:{...Oh.droppable,...e?.droppable},dragOverlay:{...Oh.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function zh(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,R.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;yp(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=rm(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=hm(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Bh=(0,R.createContext)({...Xp,scaleX:1,scaleY:1}),Vh;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Vh||={});var Hh=(0,R.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Eh,collisionDetection:o=tm,measuring:s,modifiers:c,...l}=e,[u,d]=(0,R.useReducer)(Fh,void 0,Ph),[f,p]=Wp(),[m,h]=(0,R.useState)(Vh.Uninitialized),g=m===Vh.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,R.useRef)({initial:null,translated:null}),C=(0,R.useMemo)(()=>_==null?null:{id:_,data:x?.data??Dh,rect:S},[_,x]),w=(0,R.useRef)(null),[T,E]=(0,R.useState)(null),[D,O]=(0,R.useState)(null),k=Sp(l,Object.values(l)),ee=Dp(`DndDescribedBy`,t),A=(0,R.useMemo)(()=>b.getEnabled(),[b]),j=Rh(s),{droppableRects:te,measureDroppableContainers:M,measuringScheduled:ne}=sh(A,{dragging:g,dependencies:[y.x,y.y],config:j.droppable}),N=nh(v,_),re=(0,R.useMemo)(()=>D?Pp(D):null,[D]),ie=je(),P=lh(N,j.draggable.measure);zh({activeNode:_==null?null:v.get(_),config:ie.layoutShiftCompensation,initialRect:P,measure:j.draggable.measure});let ae=ph(N,j.draggable.measure,P),F=ph(N?N.parentElement:null),oe=(0,R.useRef)({activatorEvent:null,active:null,activeNode:N,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=Th({measure:j.dragOverlay.measure}),le=ce.nodeRef.current??N,ue=g?ce.rect??ae:null,de=!!(ce.nodeRef.current&&ce.rect),fe=mh(de?null:ae),pe=xh(le?mp(le):null),me=gh(g?se??N:null),he=Ch(me),I=Lh(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:ae,containerNodeRect:F,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),L=re?kp(re,y):null,ge=_h(me),_e=vh(ge),ve=vh(ge,[ae]),ye=kp(I,_e),be=ue?am(ue,I):null,xe=C&&be?o({active:C,collisionRect:be,droppableRects:te,droppableContainers:A,pointerCoordinates:L}):null,Se=$p(xe,`id`),[Ce,we]=(0,R.useState)(null),Te=nm(de?I:kp(I,ve),Ce?.rect??null,ae),Ee=(0,R.useRef)(null),De=(0,R.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,ys.unstable_batchedUpdates)(()=>{r?.(i),h(Vh.Initializing),d({type:Jp.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Ee.current),O(a)})},onMove(e){d({type:Jp.DragMove,coordinates:e})},onEnd:s(Jp.DragEnd),onCancel:s(Jp.DragCancel)});Ee.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Jp.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Jp.DragCancel)}w.current=null,(0,ys.unstable_batchedUpdates)(()=>{d({type:e}),h(Vh.Uninitialized),we(null),E(null),O(null),Ee.current=null;let t=e===Jp.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Oe=rh(a,(0,R.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,De(n,t))},[v,De]));yh(a),yp(()=>{ae&&m===Vh.Initializing&&h(Vh.Initialized)},[ae,m]),(0,R.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:ye.x,y:ye.y},over:i};(0,ys.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[ye.x,ye.y]),(0,R.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(Se),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,ys.unstable_batchedUpdates)(()=>{we(s),a?.(c),f({type:`onDragOver`,event:c})})},[Se]),yp(()=>{oe.current={activatorEvent:D,active:C,activeNode:N,collisionRect:be,collisions:xe,droppableRects:te,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:Ce,scrollableAncestors:me,scrollAdjustedTranslate:ye},S.current={initial:ue,translated:be}},[C,N,xe,be,v,le,ue,te,b,Ce,me,ye]),$m({...ie,delta:y,draggingRect:be,pointerCoordinates:L,scrollableAncestors:me,scrollableAncestorRects:he});let ke=(0,R.useMemo)(()=>({active:C,activeNode:N,activeNodeRect:ae,activatorEvent:D,collisions:xe,containerNodeRect:F,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:te,over:Ce,measureDroppableContainers:M,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:j,measuringScheduled:ne,windowRect:pe}),[C,N,ae,D,xe,F,ce,v,b,te,Ce,M,me,he,j,ne,pe]),Ae=(0,R.useMemo)(()=>({activatorEvent:D,activators:Oe,active:C,activeNodeRect:ae,ariaDescribedById:{draggable:ee},dispatch:d,draggableNodes:v,over:Ce,measureDroppableContainers:M}),[D,Oe,C,ae,d,ee,v,Ce,M]);return R.createElement(Hp.Provider,{value:p},R.createElement(Mh.Provider,{value:Ae},R.createElement(Nh.Provider,{value:ke},R.createElement(Bh.Provider,{value:Te},i)),R.createElement(Ih,{disabled:n?.restoreFocus===!1})),R.createElement(qp,{...n,hiddenTextDescribedById:ee}));function je(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Uh=(0,R.createContext)(null),Wh=`button`,Gh=`Draggable`;function Kh(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Dp(Gh),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,R.useContext)(Mh),{role:p=Wh,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,R.useContext)(g?Bh:Uh),[v,y]=wp(),[b,x]=wp(),S=bh(o,t),C=Sp(n);return yp(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,R.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Wh?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function qh(){return(0,R.useContext)(Nh)}var Jh=`Droppable`,Yh={timeout:25};function Xh(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Dp(Jh),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,R.useContext)(Mh),u=(0,R.useRef)({disabled:n}),d=(0,R.useRef)(!1),f=(0,R.useRef)(null),p=(0,R.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Yh,...i},_=Sp(h??r),v=dh({callback:(0,R.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=wp((0,R.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Sp(t);return(0,R.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,R.useEffect)(()=>(s({type:Jp.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Jp.UnregisterDroppable,key:a,id:r})),[r]),(0,R.useEffect)(()=>{n!==u.current.disabled&&(s({type:Jp.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Zh(e){let{animation:t,children:n}=e,[r,i]=(0,R.useState)(null),[a,o]=(0,R.useState)(null),s=Tp(n);return!n&&!r&&s&&i(s),yp(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),R.createElement(R.Fragment,null,n,r?(0,R.cloneElement)(r,{ref:o}):null)}var Qh={x:0,y:0,scaleX:1,scaleY:1};function $h(e){let{children:t}=e;return R.createElement(Mh.Provider,{value:jh},R.createElement(Bh.Provider,{value:Qh},t))}var eg={position:`fixed`,touchAction:`none`},tg=e=>Mp(e)?`transform 250ms ease`:void 0,ng=(0,R.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=tg}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...eg,width:s.width,height:s.height,top:s.top,left:s.left,transform:Fp.Transform.toString(d),transformOrigin:i&&r?Zp(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return R.createElement(n,{className:o,style:f,ref:t},a)}),rg={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Fp.Transform.toString(t)},{transform:Fp.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function ig(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return bp((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=wh(a);if(!c)return;let{transform:l}=mp(a).getComputedStyle(a),u=om(l);if(!u)return;let d=typeof t==`function`?t:ag(t);return km(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function ag(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...rg,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var og=0;function sg(e){return(0,R.useMemo)(()=>{if(e!=null)return og++,og},[e])}var cg=R.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=qh(),S=(0,R.useContext)(Bh),C=sg(d?.id),w=Lh(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=ch(f),E=ig({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return R.createElement($h,null,R.createElement(Zh,{animation:E},d&&C?R.createElement(ng,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),lg=Object.prototype;function ug(e){return typeof e==`object`&&!!e}function dg(e){return Array.isArray(e)?e:typeof e==`number`?[e]:e.replace(/\[(\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function fg(e){return t=>vg(t,e)}function pg(e){return t=>ug(t)?Object.entries(e).every(([e,n])=>xg(t[e],n)):!1}function mg(e){return typeof e==`function`?e:typeof e==`string`?fg(e):ug(e)?pg(e):(e=>e)}function hg(e){if(!ug(e))return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>hg(e));let t={};for(let[n,r]of Object.entries(e))t[n]=hg(r);return t}function gg(e,t){let n=mg(t),r=Array.isArray(e)?e.entries():Object.entries(e??{});for(let[t,i]of r)if(n(i,t,e))return i}function _g(e,t){let n=mg(t);for(let[t,r]of Object.entries(e??{}))if(n(r,t,e))return t}function vg(e,t,n){if(!Array.isArray(t)&&e!=null&&Object.prototype.hasOwnProperty.call(Object(e),t)){let r=e[t];return r===void 0?n:r}let r=e;for(let e of dg(t)){if(r==null)return n;r=r[e]}return r===void 0?n:r}function yg(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:!ug(e)||Object.keys(e).length===0}function bg(e,t,n){let r=n?.(e,t);if(r!==void 0)return!!r;if(Object.is(e,t))return!0;if(!ug(e)||!ug(t))return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,r)=>bg(e,t[r],n));let i=Object.keys(e),a=Object.keys(t);return i.length===a.length&&i.every(r=>lg.hasOwnProperty.call(t,r)&&bg(e[r],t[r],n))}function xg(e,t){return bg(e,t)}function Sg(e){return e===void 0}function Cg(e,t,n){let r=n,i=Array.isArray(e)?e.entries():Object.entries(e??{});for(let[n,a]of i)r=t(r,a,n,e);return r}var wg=0;function Tg(e=``){return wg+=1,`${e}${wg}`}var Eg=(e,t,n)=>{if(!e||e.length<=1||t===void 0||n===void 0)throw Error(`swap requires a non-empty array, fromIndex, toIndex: ${e}, ${t} ${n}`);let r=hg(e),i=e[n];return r[n]=r[t],r[t]=i,r},Dg={flex:1};function Og({id:e,children:t,disabled:n,classes:r,isVerticalPool:i,minHeight:a}){let{setNodeRef:o,isOver:s}=Xh({id:e,disabled:n});return(0,B.jsx)(`div`,{ref:o,style:Dg,children:(0,B.jsx)(up,{disabled:n,isOver:s,choiceBoard:!0,className:r,isVerticalPool:i,minHeight:a,children:t})})}Og.propTypes={id:y.oneOfType([y.string,y.number]).isRequired,children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired,disabled:y.bool,classes:y.object,isVerticalPool:y.bool,minHeight:y.number};function kg({id:e,children:t,disabled:n,onRemoveAnswer:r,...i}){return(0,B.jsx)(Og,{id:e,disabled:n,...i,children:t})}kg.propTypes={id:y.oneOfType([y.string,y.number]).isRequired,children:y.node,disabled:y.bool,onRemoveAnswer:y.func};function Ag(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var jg=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:Ag(n,t,i)},Mg=25,Ng=(e,{active:t,context:n,currentCoordinates:r})=>{let{code:i}=e,a=i===`Tab`,o=i===Q.Down||i===Q.Up||i===Q.Left||i===Q.Right;if(!a&&!o)return;if(e.preventDefault(),o)switch(i){case Q.Down:return{...r,y:r.y+Mg};case Q.Up:return{...r,y:r.y-Mg};case Q.Right:return{...r,x:r.x+Mg};case Q.Left:return{...r,x:r.x-Mg};default:return r}let{droppableRects:s,droppableContainers:c,collisionRect:l}=n;if(!s||s.size===0)return r;let u=t?.data?.current,d=u?.promptId==null?void 0:`drop-${u.promptId}`,f=[];for(let[e,t]of c){if(t?.disabled||e===d)continue;let n=s.get(e);if(!n)continue;let r={x:n.left+n.width/2,y:n.top+n.height/2},i={x:n.left,y:n.top+n.height/2};f.push({id:e,rect:n,dropPosition:i,center:r})}if(f.length===0)return r;let p=e.shiftKey;f.sort((e,t)=>Math.abs(e.center.y-t.center.y)>10?e.center.y-t.center.y:e.center.x-t.center.x);let m=l?{x:l.left+l.width/2,y:l.top+l.height/2}:r,h=f.findIndex(e=>m.x>=e.rect.left&&m.x<=e.rect.right&&m.y>=e.rect.top&&m.y<=e.rect.bottom);if(h===-1){let e=1/0;for(let t=0;t<f.length;t++){let n=Pg(r,f[t].dropPosition);n<e&&(e=n,h=t)}}return f[p?(h-1+f.length)%f.length:(h+1)%f.length].dropPosition},Pg=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),Fg=`height ease-in 300ms, opacity ease-in 300ms`,Ig=K(`div`)(()=>({position:`relative`,height:0,overflow:`hidden`,display:`flex`,visibility:`hidden`,width:0,"&.enter":{transition:Fg,opacity:1,height:`auto`,width:`auto`,visibility:`visible`,minHeight:`25px`},"&.enter-done":{height:`auto`,visibility:`visible`,width:`auto`,minHeight:`25px`},"&.exit":{transition:Fg,opacity:0,height:0,visibility:`visible`,width:0},"&.exit-done":{opacity:0,visibility:`hidden`,height:0,width:0}})),Lg=e=>{let{show:t,children:n,className:r}=e,i=(0,R.useRef)(null);return(0,B.jsx)(ks,{nodeRef:i,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:`enter`,enterDone:`enter-done`,exit:`exit`,exitDone:`exit-done`},children:(0,B.jsx)(Ig,{ref:i,className:r,children:n})})};Lg.propTypes={show:y.bool.isRequired,className:y.string,children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired};var $=e=>typeof e==`string`,Rg=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},zg=e=>e==null?``:``+e,Bg=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Vg=/###/g,Hg=e=>e&&e.indexOf(`###`)>-1?e.replace(Vg,`.`):e,Ug=e=>!e||$(e),Wg=(e,t,n)=>{let r=$(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Ug(e))return{};let t=Hg(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Ug(e)?{}:{obj:e,k:Hg(r[i])}},Gg=(e,t,n)=>{let{obj:r,k:i}=Wg(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Wg(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Wg(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Kg=(e,t,n,r)=>{let{obj:i,k:a}=Wg(e,t,Object);i[a]=i[a]||[],i[a].push(n)},qg=(e,t)=>{let{obj:n,k:r}=Wg(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Jg=(e,t,n)=>{let r=qg(e,n);return r===void 0?qg(t,n):r},Yg=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?$(e[r])||e[r]instanceof String||$(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Yg(e[r],t[r],n):e[r]=t[r]);return e},Xg=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Zg={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Qg=e=>$(e)?e.replace(/[&<>"'\/]/g,e=>Zg[e]):e,$g=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},e_=[` `,`,`,`?`,`!`,`;`],t_=new $g(20),n_=(e,t,n)=>{t||=``,n||=``;let r=e_.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=t_.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},r_=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},i_=e=>e?.replace(/_/g,`-`),a_={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},o_=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||a_,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:($(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},s_=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},c_=class extends s_{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):$(n)&&i?o.push(...n.split(i)):o.push(n)));let s=qg(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!$(n)?s:r_(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Gg(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)($(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=qg(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Yg(s,n,i):s={...s,...n},Gg(this.data,o,s),a.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 this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},l_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},u_=Symbol(`i18next/PATH_KEY`);function d_(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===u_?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function f_(e,t){let{[u_]:n}=e(d_()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var p_={},m_=e=>!$(e)&&typeof e!=`boolean`&&typeof e!=`number`,h_=class e extends s_{constructor(e,t={}){super(),Bg([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=o_.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=m_(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!n_(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:$(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:$(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=f_(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?f_(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!$(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=m_(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!($(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:m_(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&$(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,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=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`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,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=$(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!$(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=$(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=l_.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return $(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?f_(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!$(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&($(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!p_[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(p_[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!$(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},g_=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=o_.create(`languageUtils`)}getScriptPartFromCode(e){if(e=i_(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=i_(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if($(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}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(this.options.load===`languageOnly`||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;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),$(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return $(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):$(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},__={zero:0,one:1,two:2,few:3,many:4,other:5},v_={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},y_=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=o_.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=i_(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),v_;if(!e.match(/-|_/))return v_;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.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||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>__[e]-__[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},b_=(e,t,n,r=`.`,i=!0)=>{let a=Jg(e,t,n);return!a&&i&&$(n)&&(a=r_(e,n,r),a===void 0&&(a=r_(t,n,r))),a},x_=e=>e.replace(/\$/g,`$$$$`),S_=class{constructor(e={}){this.logger=o_.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Qg:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?Xg(i):a||`{{`,this.suffix=o?Xg(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?Xg(d):f||Xg(`$t(`),this.nestingSuffix=p?Xg(p):m||Xg(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=b_(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(b_(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>x_(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?x_(this.escape(e)):x_(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=$(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!$(a)&&!this.useRawValueToEscape&&(a=zg(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${Xg(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!$(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!$(i))return i;$(i)||(i=zg(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},C_=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},w_=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(i_(r),i),t[o]=s),s(n)}},T_=e=>(t,n,r)=>e(i_(n),r)(t),E_=class{constructor(e={}){this.logger=o_.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?w_:T_;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let 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()]=w_(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=C_(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},D_=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},O_=class extends s_{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=o_.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Kg(n.loaded,[i],a),D_(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();$(e)&&(e=this.languageUtils.toResolveHierarchy(e)),$(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.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=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){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!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},k_=()=>({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(typeof e[1]==`object`&&(t=e[1]),$(e[1])&&(t.defaultValue=e[1]),$(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let 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}),A_=e=>($(e.ns)&&(e.ns=[e.ns]),$(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),$(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),j_=()=>{},M_=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},N_=`__i18next_supportNoticeShown`,P_=()=>!!(typeof globalThis<`u`&&globalThis[N_]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env),F_=()=>{typeof globalThis<`u`&&(globalThis[N_]=!0)},I_=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),L_=class e extends s_{constructor(e={},t){if(super(),this.options=A_(e),this.services={},this.logger=o_,this.modules={external:[]},M_(this),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,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&($(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=k_();this.options={...n,...this.options,...A_(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!I_(this)&&!P_()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),F_());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?o_.init(r(this.modules.logger),this.options):o_.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:E_;let t=new g_(this.options);this.store=new c_(this.options.resources,this.options);let i=this.services;i.logger=o_,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new y_(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)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new S_(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new O_(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new h_(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||=j_,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(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)});let i=Rg(),a=()=>{let 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?a():setTimeout(a,0),i}loadResources(e,t=j_){let n=t,r=$(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(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){let r=Rg();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=j_,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&l_.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&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++){let 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;let n=Rg();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=$(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes($(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=f_(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=f_(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=f_(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return $(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...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;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Rg();return this.options.ns?($(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){let n=Rg();$(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new g_(k_());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=j_){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new c_(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...k_().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new S_(n)}return a.translator=new h_(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();L_.createInstance,L_.dir,L_.init,L_.loadResources,L_.reloadResources,L_.use,L_.changeLanguage,L_.getFixedT,L_.t,L_.exists,L_.setDefaultNamespace,L_.hasLoadedNamespace,L_.loadNamespaces,L_.loadLanguages,L_.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 R_={translator:{...L_,t:(e,t)=>{let{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`;break;default:break}return L_.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]};function z_(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function B_(e,t){return!e||z_(e)?e:z_(e.default)?e.default:t&&z_(e[t])?e[t]:t&&z_(e[t]?.default)?e[t].default:e}var V_=B_(Mf,`Readable`)||B_(W_.Readable,`Readable`),H_=cp,U_=H_.default,W_=U_&&typeof U_==`object`?U_:H_,{translator:G_}=R_,K_={WebkitTouchCallout:`none`,WebkitUserSelect:`none`,KhtmlUserSelect:`none`,MozUserSelect:`none`,msUserSelect:`none`,userSelect:`none`},q_=K(`div`)(()=>({width:`100%`,cursor:`pointer`})),J_=K(`div`)(()=>({margin:`0 auto`,textAlign:`center`,display:`flex`})),Y_=K(`div`)(()=>({width:`fit-content`,minWidth:`140px`,alignSelf:`center`,verticalAlign:`middle`,color:`var(--correct-answer-toggle-label-color, ${yl()})`,fontWeight:`normal`,...K_})),X_=K(`div`)(()=>({position:`absolute`,width:`25px`,"&.enter":{opacity:`0`},"&.enter-active":{opacity:`1`,transition:`opacity 0.3s ease-in`},"&.exit":{opacity:`1`},"&.exit-active":{opacity:`0`,transition:`opacity 0.3s ease-in`}})),Z_=K(`div`)(()=>({width:`25px`,marginRight:`5px`,display:`flex`,alignItems:`center`})),Q_=class e extends R.Component{static propTypes={onToggle:y.func,toggled:y.bool,show:y.bool,hideMessage:y.string,showMessage:y.string,className:y.string,language:y.string};static defaultProps={showMessage:`Show correct answer`,hideMessage:`Hide correct answer`,show:!1,toggled:!1};constructor(t){super(t),this.state={show:t.show},this.openIconRef=R.createRef(),this.closedIconRef=R.createRef(),e.defaultProps={...e.defaultProps,showMessage:G_.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:G_.t(`common:hideCorrectAnswer`,{lng:t.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(t){this.setState({show:t.show}),t.language!==this.props?.language&&(e.defaultProps={...e.defaultProps,showMessage:G_.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:G_.t(`common:hideCorrectAnswer`,{lng:t.language})})}render(){let{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return(0,B.jsx)(q_,{className:e,children:(0,B.jsx)(Lg,{show:this.state.show,children:(0,B.jsxs)(J_,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this),children:[(0,B.jsxs)(Z_,{children:[(0,B.jsx)(ks,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,B.jsx)(X_,{ref:this.openIconRef,children:(0,B.jsx)(Lo,{open:t},`correct-open`)})}),(0,B.jsx)(ks,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,B.jsx)(X_,{ref:this.closedIconRef,children:(0,B.jsx)(Lo,{open:t},`correct-closed`)})})]}),(0,B.jsx)(V_,{false:!0,children:(0,B.jsx)(Y_,{"aria-hidden":!this.state.show,children:t?n:r})})]})})})}},$_=el((0,B.jsx)(`path`,{d:`m7 10 5 5 5-5z`}),`ArrowDropDown`),ev=K(`div`)({display:`inline-block`,position:`relative`,width:`100%`}),tv=K(`span`)(({isRight:e})=>({backgroundColor:Kl(),bottom:e?20:19,content:`""`,display:`block`,height:1,left:20,position:`absolute`,width:`100%`})),nv=class extends R.Component{static propTypes={direction:y.string};render(){let{direction:e}=this.props;return(0,B.jsxs)(ev,{style:e===`left`?{}:{transform:`rotate(180deg)`},children:[(0,B.jsx)($_,{style:{transform:`rotate(90deg)`,color:Kl(),fontSize:40}}),(0,B.jsx)(tv,{isRight:e!==`left`})]})}},rv=_(`pie-elements:match-title:answer`),iv=K(`div`)(({theme:e})=>({width:`100%`,fontSize:`18px`,textAlign:`center`,color:`rgba(${e.palette.common.black}, 0.6)`})),av=({index:e,isOver:t,disabled:n,type:r})=>(0,B.jsx)(up,{extraStyles:{display:`flex`,padding:`0`,alignItems:`center`,justifyContent:`center`,height:`40px`},disabled:n,isOver:t,type:r,children:e!==void 0&&(0,B.jsx)(iv,{children:e})});av.propTypes={index:y.number,isOver:y.bool,disabled:y.bool,type:y.string};var ov=K(`div`)(({isDragging:e,isSelected:t,isOver:n,disabled:r,outcome:i})=>({color:yl(),backgroundColor:eu(),border:`1px solid ${i===`correct`?Sl():i===`incorrect`?El():Kl()}`,cursor:r?`not-allowed`:`pointer`,width:`100%`,padding:`10px`,boxSizing:`border-box`,overflow:`hidden`,transition:`opacity 200ms linear`,wordBreak:`break-word`,opacity:(e||t)&&!r?.5:n&&!r?.2:1,touchAction:`none`})),sv=e=>{let{isDragging:t,isSelected:n,isOver:r,title:i,disabled:a,empty:o,outcome:s,guideIndex:c,type:l}=e;return o?(0,B.jsx)(av,{index:c,isOver:r,disabled:a,type:l}):(0,B.jsx)(ov,{isDragging:t,isSelected:n,isOver:r,disabled:a,outcome:s,dangerouslySetInnerHTML:{__html:i}})},cv=K(`div`)(({correct:e,theme:t})=>({boxSizing:`border-box`,minHeight:40,minWidth:`200px`,overflow:`hidden`,margin:t.spacing(.5),padding:`0px`,textAlign:`center`,height:`initial`,border:e===!0?`1px solid var(--feedback-correct-bg-color, ${Sl()})`:e===!1?`1px solid var(--feedback-incorrect-bg-color, ${El()})`:`none`})),lv=class extends R.Component{static propTypes={className:y.string,isDragging:y.bool,isSelected:y.bool,id:y.any,title:y.string,isOver:y.bool,empty:y.bool,type:y.string,disabled:y.bool,correct:y.bool};componentDidMount(){this.ref&&this.ref.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0})}componentWillUnmount(){this.ref&&this.ref.removeEventListener(`touchstart`,this.handleTouchStart)}handleTouchStart=e=>{};render(){let{id:e,title:t,isDragging:n=!1,isSelected:r=!1,className:i,disabled:a,isOver:o=!1,type:s,correct:c}=this.props;return rv(`[render], props: `,this.props),(0,B.jsx)(cv,{correct:c,className:i,ref:e=>this.ref=e,children:(0,B.jsx)(sv,{title:t,id:e,isOver:o,empty:yg(t),isDragging:n,isSelected:r,disabled:a,type:s})})}};function uv(e){let{id:t,instanceId:n,promptId:r,draggable:i=!0,disabled:a=!1,type:o,selectedAnswer:s,onSelectClick:c,onPlacementClick:l}=e,u=`${o||`answer`}-${t}`,d=r==null?void 0:`drop-${r}`,f={type:o||`answer`,id:t,instanceId:n,value:e.title,promptId:r},p=d?{type:`drop-zone`,promptId:r,instanceId:n}:void 0,{attributes:m,listeners:h,setNodeRef:g,transform:_,transition:v,isDragging:y}=Kh({id:u,data:f,disabled:!i||a,attributes:{tabIndex:i&&!a?0:-1}}),b=Xh({id:d,data:p,disabled:a||!d}),x=b.setNodeRef,S=b.isOver,[C,w]=(0,R.useState)(!1),T=!!s,E=S||T&&C&&!a,D=!!s&&s.type===f.type&&s.id===f.id&&s.promptId===f.promptId,O=_?`translate3d(${_.x}px, ${_.y}px, 0)`:void 0;if(d){let t=()=>{a||(D?c?.(f):s?l?.(p):i&&c?.(f))},n=!i&&!a;return(0,B.jsx)(`div`,{ref:x,role:`button`,tabIndex:n?0:-1,onClick:t,onKeyDown:n?e=>{(e.code===`Space`||e.code===`Enter`)&&(e.preventDefault(),t())}:void 0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),style:{flex:1,opacity:y||D?.5:1,backgroundColor:y||D||E?`rgba(0,0,0,0.05)`:`transparent`,cursor:T&&!a?`pointer`:void 0},children:(0,B.jsx)(`div`,{ref:g,...h,...m,style:{transform:O,transition:v},children:(0,B.jsx)(lv,{...e,isDragging:y,isSelected:D,isOver:E})})})}let k=e=>{a||(e.stopPropagation(),c?.(f))};return(0,B.jsx)(`div`,{ref:g,...h,...m,onClick:k,style:{transform:O,transition:v,cursor:a?`not-allowed`:`grab`,opacity:y||D?.5:1,touchAction:i&&!a?`none`:`auto`},children:(0,B.jsx)(lv,{...e,isDragging:y,isSelected:D,isOver:!1})})}uv.propTypes={id:y.any,instanceId:y.string,promptId:y.any,title:y.string,draggable:y.bool,disabled:y.bool,type:y.string,selectedAnswer:y.object,onSelectClick:y.func,onPlacementClick:y.func};var dv=200,fv=K(`div`)({alignItems:`normal`,display:`flex`,flexShrink:0,height:40,margin:`10px 20px`}),pv=K(`div`)(({theme:e})=>({alignItems:`flex-start`,display:`flex`,flex:1,flexDirection:`column`,justifyContent:`space-between`,marginTop:e.spacing(2),marginBottom:e.spacing(2)})),mv=K(`div`)(()=>({border:`1px solid ${Kl()}`,boxSizing:`border-box`,flex:1,margin:`10px 0`,minHeight:40,minWidth:dv,overflow:`hidden`,padding:10,textAlign:`center`,width:`100%`,wordBreak:`break-word`})),hv=K(`div`)({alignItems:`center`,display:`flex`,justifyContent:`space-between`,width:`100%`}),gv=class extends R.Component{static propTypes={session:y.object.isRequired,showCorrect:y.bool.isRequired,disabled:y.bool.isRequired,onSessionChange:y.func,onRemoveAnswer:y.func,instanceId:y.string.isRequired,model:y.object.isRequired,prompt:y.string,selectedAnswer:y.object,onChoiceClick:y.func,onPlacementClick:y.func};getAnswerFromSession=e=>{let{model:t,session:n,showCorrect:r}=this.props,{config:i}=t,a=r?i.prompts.find(t=>t.id===e).relatedAnswer:n.value&&n.value[e];return i.answers.find(e=>e.id===a)||{}};getCorrectOrIncorrectMap=()=>{let{model:e,session:t,showCorrect:n}=this.props,{config:r}=e,i=t.value||r.prompts.reduce((e,t)=>(e[t.id]=void 0,e),{});if(e.mode!==`evaluate`)return{};if(n)return r.prompts.reduce((e,t)=>(e[t.id]=!0,e),{});let a=r.prompts.reduce((e,t)=>(Sg(t.relatedAnswer)||(e[t.id]=t.relatedAnswer),e),{});return Cg(i,(e,t,n)=>(e[n]=a[n]===i[n],e),{})};buildRows=()=>{let{model:e}=this.props,{config:t}=e;return(t.prompts||[]).map(e=>{let t=this.getAnswerFromSession(e.id);return{...e,sessionAnswer:t}})};render(){let{disabled:e,instanceId:t,onRemoveAnswer:n,selectedAnswer:r,onChoiceClick:i,onPlacementClick:a}=this.props,o=this.buildRows(),s=this.getCorrectOrIncorrectMap();return(0,B.jsx)(pv,{children:o.map(({sessionAnswer:o,title:c,id:l},u)=>(0,B.jsxs)(hv,{children:[(0,B.jsx)(mv,{dangerouslySetInnerHTML:{__html:c}}),(0,B.jsxs)(fv,{children:[(0,B.jsx)(nv,{direction:`left`}),(0,B.jsx)(nv,{})]}),(0,B.jsx)(uv,{className:`answer`,index:u,promptId:l,correct:s[l],draggable:!yg(o),disabled:e,instanceId:t,id:o.id,title:o.title,type:`target`,onRemoveChoice:()=>n(l),selectedAnswer:r,onSelectClick:i,onPlacementClick:a},u)]},u))})}},_v=K(`div`)(({theme:e})=>({alignItems:`center`,display:`flex`,flexDirection:`row`,flexWrap:`wrap`,justifyContent:`space-between`,marginTop:e.spacing(1),marginBottom:e.spacing(1),minHeight:50,transition:`background-color 200ms ease`}));function vv({id:e,disabled:t,children:n,onPlacementClick:r,...i}){let{setNodeRef:a,isOver:o}=Xh({id:e||`choices-pool`,data:{type:`choices-pool`},disabled:t});return(0,B.jsx)(_v,{ref:a,onClick:()=>{t||r?.({type:`choices-pool`})},style:{backgroundColor:o?`rgba(0,0,0,0.05)`:`transparent`},...i,children:(0,B.jsx)(kg,{id:e,disabled:t,children:n})})}vv.propTypes={id:y.oneOfType([y.string,y.number]),disabled:y.bool,children:y.node,onPlacementClick:y.func};var yv=K(`div`)(({theme:e})=>({marginBottom:e.spacing(2)})),bv=class extends R.Component{static propTypes={session:y.object.isRequired,instanceId:y.string.isRequired,model:y.object.isRequired,disabled:y.bool.isRequired,onRemoveAnswer:y.func,selectedAnswer:y.object,onChoiceClick:y.func,onPlacementClick:y.func};render(){let{model:e,disabled:t,session:n,instanceId:r,onRemoveAnswer:i,selectedAnswer:a,onChoiceClick:o,onPlacementClick:s}=this.props,{config:c}=e,{duplicates:l}=c,u=c.answers.filter(e=>l||yg(n)||!n.value||Sg(gg(n.value,t=>t===e.id))).map(e=>(0,B.jsx)(uv,{instanceId:r,draggable:!0,disabled:t,session:n,type:`choice`,selectedAnswer:a,onSelectClick:o,...e},e.id));return(0,B.jsx)(yv,{children:(0,B.jsx)(vv,{id:`choices-pool`,disabled:t,onRemoveAnswer:i,onPlacementClick:s,children:u})})}};function xv(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function Sv(e,t){return!e||xv(e)?e:xv(e.default)?e.default:t&&xv(e[t])?e[t]:t&&xv(e[t]?.default)?e[t].default:e}var Cv=Sv(jf,`PreviewPrompt`)||Sv(Dv.PreviewPrompt,`PreviewPrompt`),wv=Sv(Cu,`Feedback`)||Sv(Dv.Feedback,`Feedback`),Tv=cp,Ev=Tv.default,Dv=Ev&&typeof Ev==`object`?Ev:Tv,Ov=250,kv=[{sensor:Gm,options:{activationConstraint:{distance:8}}},{sensor:Bm,options:{coordinateGetter:Ng,keyboardCodes:{start:[Q.Space,Q.Enter],cancel:[Q.Esc],end:[Q.Space,Q.Enter]}}}],Av=K(`div`)({display:`flex`,flexDirection:`column`,justifyContent:`center`,color:yl(),backgroundColor:Bl()}),jv=K(`div`)({width:`100%`,overflowX:`auto`,overflowY:`hidden`}),Mv=K(`div`)({display:`flex`,flexDirection:`column`,minWidth:`min-content`}),Nv=class extends R.Component{static propTypes={session:y.object.isRequired,onSessionChange:y.func,model:y.object.isRequired,prompt:y.string};constructor(e){super(e),this.instanceId=Tg(),this.state={showCorrectAnswer:!1,draggingElement:null,selectedAnswer:null},this.lastDragEndAt=0}onRemoveAnswer(e){let{session:t,onSessionChange:n}=this.props;t.value[e]=void 0,n(t)}onDragStart=e=>{let{active:t}=e;if(t?.data?.current){let e=null,n=t.node?.current;if(n){let{width:t,height:r}=n.getBoundingClientRect();e={width:t,height:r}}this.setState({draggingElement:{...t.data.current,rect:e}}),this.selectAnswer(t.data.current)}};onDragCancel=()=>{this.setState({draggingElement:null}),this.cancelSelection(),this.lastDragEndAt=Date.now()};placeAnswer=(e,t)=>{if(!e||!t)return;let{session:n,onSessionChange:r,model:i}=this.props,{config:{duplicates:a}}=i;if(Sg(n.value)&&(n.value={}),t.type===`choices-pool`&&e.promptId!==void 0){n.value[e.promptId]=void 0,r(n);return}let o=e.id,s=e.promptId;if(t.type===`drop-zone`&&t.promptId!=null){let i=t.promptId;if(e.type===`choice`&&i!==void 0){let e=_g(n.value,e=>e===o);e&&!a?n.value=Eg(n.value,e,i):n.value[i]=o}else if(e.type===`target`&&s!=null&&s!==i){let e=n.value[i]!=null;if(e&&!a){let e=n.value[i];n.value[i]=o,n.value[s]=e}else e||(n.value[i]=o,delete n.value[s])}r(n)}};onPlaceAnswer=e=>{this.setState({draggingElement:null});let{active:t,over:n}=e;if(!t)return;let r=t.data.current,i=n?.data.current;r&&(this.placeAnswer(r,i),this.cancelSelection(),this.lastDragEndAt=Date.now())};isSameAnswer=(e,t)=>!!e&&!!t&&e.type===t.type&&e.id===t.id&&e.promptId===t.promptId;selectAnswer=e=>{this.setState({selectedAnswer:e})};toggleAnswerSelection=e=>{this.setState(t=>({selectedAnswer:this.isSameAnswer(t.selectedAnswer,e)?null:e}))};cancelSelection=()=>{this.setState({selectedAnswer:null})};endAnyLiveKeyboardDrag=()=>{document.dispatchEvent(new KeyboardEvent(`keydown`,{code:`Escape`,bubbles:!0,cancelable:!0}))};placeSelectedAnswer=e=>{let{selectedAnswer:t}=this.state;t&&(this.placeAnswer(t,e),this.cancelSelection(),this.endAnyLiveKeyboardDrag(),this.lastDragEndAt=Date.now())};isClickSoonAfterDragEnd=()=>Date.now()-this.lastDragEndAt<Ov;onChoiceClick=e=>{this.isClickSoonAfterDragEnd()||this.toggleAnswerSelection(e)};onPlacementClick=e=>{this.isClickSoonAfterDragEnd()||this.placeSelectedAnswer(e)};toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})};renderDragOverlay=()=>{let{draggingElement:e}=this.state;return e?(0,B.jsx)(lv,{id:e.id,title:e.value,disabled:!1,isDragging:!1,style:e.rect?{width:e.rect.width,height:e.rect.height,boxSizing:`border-box`}:{}}):null};render(){let{showCorrectAnswer:e}=this.state,{model:t,session:n}=this.props,{config:r,mode:i}=t,{prompt:a,language:o}=r;return(0,B.jsxs)(Hh,{sensors:kv,collisionDetection:tm,onDragStart:this.onDragStart,onDragEnd:this.onPlaceAnswer,onDragCancel:this.onDragCancel,modifiers:[jg],accessibility:{screenReaderInstructions:{draggable:`Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel. You can also click an answer choice to select it, then click a response area to place it there.`}},children:[(0,B.jsxs)(Av,{children:[(0,B.jsx)(Cv,{className:`prompt`,prompt:a}),(0,B.jsx)(Q_,{show:i===`evaluate`,toggled:e,onToggle:this.toggleShowCorrect,language:o}),(0,B.jsx)(jv,{children:(0,B.jsxs)(Mv,{children:[(0,B.jsx)(gv,{instanceId:this.instanceId,model:t,session:n,onRemoveAnswer:e=>this.onRemoveAnswer(e),disabled:i!==`gather`,showCorrect:e,selectedAnswer:this.state.selectedAnswer,onChoiceClick:this.onChoiceClick,onPlacementClick:this.onPlacementClick}),(0,B.jsx)(bv,{instanceId:this.instanceId,model:t,session:n,disabled:i!==`gather`,onRemoveAnswer:e=>this.onRemoveAnswer(e),selectedAnswer:this.state.selectedAnswer,onChoiceClick:this.onChoiceClick,onPlacementClick:this.onPlacementClick})]})}),t.correctness&&t.feedback&&!e&&(0,B.jsx)(wv,{correctness:t.correctness.correctness,feedback:t.feedback})]}),(0,B.jsx)(cg,{children:this.renderDragOverlay()})]})}};(class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}});var Pv=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},Fv=g(),Iv=_(`pie-ui:graph-lines`),Lv=(e,t)=>{if(!e)return!1;let n=e.value,r=!0;return n&&(t.config.prompts||[]).forEach(e=>{Number.isFinite(n[e.id])||(r=!1)}),r},Rv=class extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}sessionChanged(e){this._session.value=e.value,this.dispatchEvent(new Pv(this.tagName.toLowerCase(),Lv(this._session,this._model))),Iv(`session: `,this._session),this._render()}connectedCallback(){this._render()}_render(){if(!this._model||!this._session)return;let e=R.createElement(Nv,{model:this._model,session:this._session,onSessionChange:this.sessionChanged.bind(this)});this._root||=(0,Fv.createRoot)(this),this._root.render(e),queueMicrotask(()=>{Yu(this)})}disconnectedCallback(){this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`match-list-element`)&&customElements.define(`match-list-element`,Rv),Rv})();
|
|
152
|
+
`},Kp={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 qp(e){let{announcements:t=Kp,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Gp}=e,{announce:a,announcement:o}=Vp(),s=Dp(`DndLiveRegion`),[c,l]=(0,R.useState)(!1);if((0,R.useEffect)(()=>{l(!0)},[]),Up((0,R.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=R.createElement(R.Fragment,null,R.createElement(zp,{id:r,value:i.draggable}),R.createElement(Bp,{id:s,announcement:o}));return n?(0,ys.createPortal)(u,n):u}var Jp;(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`})(Jp||={});function Yp(){}var Xp=Object.freeze({x:0,y:0});function Zp(e,t){let n=Pp(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function Qp(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $p(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function em(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var tm=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=em(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Qp)};function nm(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function rm(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Xp}function im(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var am=im(1);function om(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function sm(e,t,n){let r=om(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var cm={ignoreTransform:!1};function lm(e,t){t===void 0&&(t=cm);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=mp(e).getComputedStyle(e);t&&(n=sm(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function um(e){return lm(e,{ignoreTransform:!0})}function dm(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function fm(e,t){return t===void 0&&(t=mp(e).getComputedStyle(e)),t.position===`fixed`}function pm(e,t){t===void 0&&(t=mp(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function mm(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(hp(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!gp(i)||_p(i)||n.includes(i))return n;let a=mp(e).getComputedStyle(i);return i!==e&&pm(i,a)&&n.push(i),fm(i,a)?n:r(i.parentNode)}return e?r(e):n}function hm(e){let[t]=mm(e,1);return t??null}function gm(e){return!dp||!e?null:fp(e)?e:pp(e)?hp(e)||e===vp(e).scrollingElement?window:gp(e)?e:null:null}function _m(e){return fp(e)?e.scrollX:e.scrollLeft}function vm(e){return fp(e)?e.scrollY:e.scrollTop}function ym(e){return{x:_m(e),y:vm(e)}}var bm;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(bm||={});function xm(e){return!dp||!e?!1:e===document.scrollingElement}function Sm(e){let t={x:0,y:0},n=xm(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Cm={x:.2,y:.2};function wm(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Cm);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Sm(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=bm.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=bm.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=bm.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=bm.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Tm(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Em(e){return e.reduce((e,t)=>kp(e,ym(t)),Xp)}function Dm(e){return e.reduce((e,t)=>e+_m(t),0)}function Om(e){return e.reduce((e,t)=>e+vm(t),0)}function km(e,t){if(t===void 0&&(t=lm),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);hm(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Am=[[`x`,[`left`,`right`],Dm],[`y`,[`top`,`bottom`],Om]],jm=class{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;let n=mm(t),r=Em(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Am)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Mm=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Nm(e){let{EventTarget:t}=mp(e);return e instanceof t?e:vp(e)}function Pm(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var Fm;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Fm||={});function Im(e){e.preventDefault()}function Lm(e){e.stopPropagation()}var Q;(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`})(Q||={});var Rm={start:[Q.Space,Q.Enter],cancel:[Q.Esc],end:[Q.Space,Q.Enter,Q.Tab]},zm=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Q.Right:return{...n,x:n.x+25};case Q.Left:return{...n,x:n.x-25};case Q.Down:return{...n,y:n.y+25};case Q.Up:return{...n,y:n.y-25}}},Bm=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Mm(vp(t)),this.windowListeners=new Mm(mp(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Fm.Resize,this.handleCancel),this.windowListeners.add(Fm.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Fm.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&km(n),t(Xp)}handleKeyDown(e){if(Mp(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Rm,coordinateGetter:a=zm,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Xp;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Ap(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Sm(n),p=Tm(n),m={x:Math.min(i===Q.Right?p.right-p.width/2:p.right,Math.max(i===Q.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Q.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Q.Down?p.top:p.top+p.height/2,u.y))},h=i===Q.Right&&!s||i===Q.Left&&!c,g=i===Q.Down&&!l||i===Q.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Q.Right&&e<=d.x||i===Q.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===Q.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Q.Down&&e<=d.y||i===Q.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===Q.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,kp(Ap(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Bm.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Rm,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Vm(e){return!!(e&&`distance`in e)}function Hm(e){return!!(e&&`delay`in e)}var Um=class{constructor(e,t,n){n===void 0&&(n=Nm(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;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=vp(i),this.documentListeners=new Mm(this.document),this.listeners=new Mm(n),this.windowListeners=new Mm(mp(i)),this.initialCoordinates=Pp(r)??Xp,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(){let{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(Fm.Resize,this.handleCancel),this.windowListeners.add(Fm.DragStart,Im),this.windowListeners.add(Fm.VisibilityChange,this.handleCancel),this.windowListeners.add(Fm.ContextMenu,Im),this.documentListeners.add(Fm.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hm(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Vm(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Fm.Click,Lm,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Fm.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Pp(e)??Xp,s=Ap(n,o);if(!t&&a){if(Vm(a)){if(a.tolerance!=null&&Pm(s,a.tolerance))return this.handleCancel();if(Pm(s,a.distance))return this.handleStart()}if(Hm(a)&&Pm(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Q.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Wm={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Gm=class extends Um{constructor(e){let{event:t}=e,n=vp(t.target);super(e,Wm,n)}};Gm.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Km={move:{name:`mousemove`},end:{name:`mouseup`}},qm;(function(e){e[e.RightClick=2]=`RightClick`})(qm||={});var Jm=class extends Um{constructor(e){super(e,Km,vp(e.event.target))}};Jm.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===qm.RightClick?!1:(r?.({event:n}),!0)}}];var Ym={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},Xm=class extends Um{constructor(e){super(e,Ym)}static setup(){return window.addEventListener(Ym.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ym.move.name,e)};function e(){}}};Xm.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var Zm;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(Zm||={});var Qm;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Qm||={});function $m(e){let{acceleration:t,activator:n=Zm.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=Qm.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=th({delta:d,disabled:!a}),[m,h]=xp(),g=(0,R.useRef)({x:0,y:0}),_=(0,R.useRef)({x:0,y:0}),v=(0,R.useMemo)(()=>{switch(n){case Zm.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Zm.DraggableRect:return i}},[n,i,c]),y=(0,R.useRef)(null),b=(0,R.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,R.useMemo)(()=>s===Qm.TreeOrder?[...l].reverse():l,[s,l]);(0,R.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=wm(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var eh={x:{[bm.Backward]:!1,[bm.Forward]:!1},y:{[bm.Backward]:!1,[bm.Forward]:!1}};function th(e){let{delta:t,disabled:n}=e,r=Tp(t);return Cp(e=>{if(n||!r||!e)return eh;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[bm.Backward]:e.x[bm.Backward]||i.x===-1,[bm.Forward]:e.x[bm.Forward]||i.x===1},y:{[bm.Backward]:e.y[bm.Backward]||i.y===-1,[bm.Forward]:e.y[bm.Forward]||i.y===1}}},[n,t,r])}function nh(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Cp(e=>t==null?null:r??e??null,[r,t])}function rh(e,t){return(0,R.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var ih;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(ih||={});var ah;(function(e){e.Optimized=`optimized`})(ah||={});var oh=new Map;function sh(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,R.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,R.useRef)(e),d=g(),f=Sp(d),p=(0,R.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,R.useRef)(null),h=Cp(t=>{if(d&&!n)return oh;if(!t||t===oh||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new jm(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,R.useEffect)(()=>{u.current=e},[e]),(0,R.useEffect)(()=>{d||p()},[n,d]),(0,R.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,R.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case ih.Always:return!1;case ih.BeforeDragging:return n;default:return!n}}}function ch(e,t){return Cp(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function lh(e,t){return ch(e,t)}function uh(e){let{callback:t,disabled:n}=e,r=bp(t),i=(0,R.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,R.useEffect)(()=>()=>i?.disconnect(),[i]),i}function dh(e){let{callback:t,disabled:n}=e,r=bp(t),i=(0,R.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,R.useEffect)(()=>()=>i?.disconnect(),[i]),i}function fh(e){return new jm(lm(e),e)}function ph(e,t,n){t===void 0&&(t=fh);let[r,i]=(0,R.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=uh({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=dh({callback:a});return yp(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function mh(e){return rm(e,ch(e))}var hh=[];function gh(e){let t=(0,R.useRef)(e),n=Cp(n=>e?n&&n!==hh&&e&&t.current&&e.parentNode===t.current.parentNode?n:mm(e):hh,[e]);return(0,R.useEffect)(()=>{t.current=e},[e]),n}function _h(e){let[t,n]=(0,R.useState)(null),r=(0,R.useRef)(e),i=(0,R.useCallback)(e=>{let t=gm(e.target);t&&n(e=>e?(e.set(t,ym(t)),new Map(e)):null)},[]);return(0,R.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=gm(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,ym(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{gm(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,R.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>kp(e,t),Xp):Em(e):Xp,[e,t])}function vh(e,t){t===void 0&&(t=[]);let n=(0,R.useRef)(null);return(0,R.useEffect)(()=>{n.current=null},t),(0,R.useEffect)(()=>{let t=e!==Xp;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Ap(e,n.current):Xp}function yh(e){(0,R.useEffect)(()=>{if(!dp)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function bh(e,t){return(0,R.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function xh(e){return(0,R.useMemo)(()=>e?dm(e):null,[e])}var Sh=[];function Ch(e,t){t===void 0&&(t=lm);let[n]=e,r=xh(n?mp(n):null),[i,a]=(0,R.useState)(Sh);function o(){a(()=>e.length?e.map(e=>xm(e)?r:new jm(t(e),e)):Sh)}let s=dh({callback:o});return yp(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function wh(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return gp(t)?t:e}function Th(e){let{measure:t}=e,[n,r]=(0,R.useState)(null),i=dh({callback:(0,R.useCallback)(e=>{for(let{target:n}of e)if(gp(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=wp((0,R.useCallback)(e=>{let n=wh(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,R.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Eh=[{sensor:Gm,options:{}},{sensor:Bm,options:{}}],Dh={current:{}},Oh={draggable:{measure:um},droppable:{measure:um,strategy:ih.WhileDragging,frequency:ah.Optimized},dragOverlay:{measure:lm}},kh=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Ah={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new kh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Oh,measureDroppableContainers:Yp,windowRect:null,measuringScheduled:!1},jh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Yp,draggableNodes:new Map,over:null,measureDroppableContainers:Yp},Mh=(0,R.createContext)(jh),Nh=(0,R.createContext)(Ah);function Ph(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new kh}}}function Fh(e,t){switch(t.type){case Jp.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Jp.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Jp.DragEnd:case Jp.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Jp.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new kh(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Jp.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new kh(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Jp.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new kh(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Ih(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,R.useContext)(Mh),a=Tp(r),o=Tp(n?.id);return(0,R.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Mp(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Lp(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Lh(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Rh(e){return(0,R.useMemo)(()=>({draggable:{...Oh.draggable,...e?.draggable},droppable:{...Oh.droppable,...e?.droppable},dragOverlay:{...Oh.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function zh(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,R.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;yp(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=rm(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=hm(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Bh=(0,R.createContext)({...Xp,scaleX:1,scaleY:1}),Vh;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Vh||={});var Hh=(0,R.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Eh,collisionDetection:o=tm,measuring:s,modifiers:c,...l}=e,[u,d]=(0,R.useReducer)(Fh,void 0,Ph),[f,p]=Wp(),[m,h]=(0,R.useState)(Vh.Uninitialized),g=m===Vh.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,R.useRef)({initial:null,translated:null}),C=(0,R.useMemo)(()=>_==null?null:{id:_,data:x?.data??Dh,rect:S},[_,x]),w=(0,R.useRef)(null),[T,E]=(0,R.useState)(null),[D,O]=(0,R.useState)(null),k=Sp(l,Object.values(l)),ee=Dp(`DndDescribedBy`,t),A=(0,R.useMemo)(()=>b.getEnabled(),[b]),j=Rh(s),{droppableRects:te,measureDroppableContainers:M,measuringScheduled:ne}=sh(A,{dragging:g,dependencies:[y.x,y.y],config:j.droppable}),N=nh(v,_),re=(0,R.useMemo)(()=>D?Pp(D):null,[D]),ie=je(),P=lh(N,j.draggable.measure);zh({activeNode:_==null?null:v.get(_),config:ie.layoutShiftCompensation,initialRect:P,measure:j.draggable.measure});let ae=ph(N,j.draggable.measure,P),F=ph(N?N.parentElement:null),oe=(0,R.useRef)({activatorEvent:null,active:null,activeNode:N,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=Th({measure:j.dragOverlay.measure}),le=ce.nodeRef.current??N,ue=g?ce.rect??ae:null,de=!!(ce.nodeRef.current&&ce.rect),fe=mh(de?null:ae),pe=xh(le?mp(le):null),me=gh(g?se??N:null),he=Ch(me),I=Lh(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:ae,containerNodeRect:F,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),L=re?kp(re,y):null,ge=_h(me),_e=vh(ge),ve=vh(ge,[ae]),ye=kp(I,_e),be=ue?am(ue,I):null,xe=C&&be?o({active:C,collisionRect:be,droppableRects:te,droppableContainers:A,pointerCoordinates:L}):null,Se=$p(xe,`id`),[Ce,we]=(0,R.useState)(null),Te=nm(de?I:kp(I,ve),Ce?.rect??null,ae),Ee=(0,R.useRef)(null),De=(0,R.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,ys.unstable_batchedUpdates)(()=>{r?.(i),h(Vh.Initializing),d({type:Jp.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Ee.current),O(a)})},onMove(e){d({type:Jp.DragMove,coordinates:e})},onEnd:s(Jp.DragEnd),onCancel:s(Jp.DragCancel)});Ee.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Jp.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Jp.DragCancel)}w.current=null,(0,ys.unstable_batchedUpdates)(()=>{d({type:e}),h(Vh.Uninitialized),we(null),E(null),O(null),Ee.current=null;let t=e===Jp.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Oe=rh(a,(0,R.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,De(n,t))},[v,De]));yh(a),yp(()=>{ae&&m===Vh.Initializing&&h(Vh.Initialized)},[ae,m]),(0,R.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:ye.x,y:ye.y},over:i};(0,ys.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[ye.x,ye.y]),(0,R.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(Se),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,ys.unstable_batchedUpdates)(()=>{we(s),a?.(c),f({type:`onDragOver`,event:c})})},[Se]),yp(()=>{oe.current={activatorEvent:D,active:C,activeNode:N,collisionRect:be,collisions:xe,droppableRects:te,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:Ce,scrollableAncestors:me,scrollAdjustedTranslate:ye},S.current={initial:ue,translated:be}},[C,N,xe,be,v,le,ue,te,b,Ce,me,ye]),$m({...ie,delta:y,draggingRect:be,pointerCoordinates:L,scrollableAncestors:me,scrollableAncestorRects:he});let ke=(0,R.useMemo)(()=>({active:C,activeNode:N,activeNodeRect:ae,activatorEvent:D,collisions:xe,containerNodeRect:F,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:te,over:Ce,measureDroppableContainers:M,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:j,measuringScheduled:ne,windowRect:pe}),[C,N,ae,D,xe,F,ce,v,b,te,Ce,M,me,he,j,ne,pe]),Ae=(0,R.useMemo)(()=>({activatorEvent:D,activators:Oe,active:C,activeNodeRect:ae,ariaDescribedById:{draggable:ee},dispatch:d,draggableNodes:v,over:Ce,measureDroppableContainers:M}),[D,Oe,C,ae,d,ee,v,Ce,M]);return R.createElement(Hp.Provider,{value:p},R.createElement(Mh.Provider,{value:Ae},R.createElement(Nh.Provider,{value:ke},R.createElement(Bh.Provider,{value:Te},i)),R.createElement(Ih,{disabled:n?.restoreFocus===!1})),R.createElement(qp,{...n,hiddenTextDescribedById:ee}));function je(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Uh=(0,R.createContext)(null),Wh=`button`,Gh=`Draggable`;function Kh(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Dp(Gh),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,R.useContext)(Mh),{role:p=Wh,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,R.useContext)(g?Bh:Uh),[v,y]=wp(),[b,x]=wp(),S=bh(o,t),C=Sp(n);return yp(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,R.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Wh?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function qh(){return(0,R.useContext)(Nh)}var Jh=`Droppable`,Yh={timeout:25};function Xh(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Dp(Jh),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,R.useContext)(Mh),u=(0,R.useRef)({disabled:n}),d=(0,R.useRef)(!1),f=(0,R.useRef)(null),p=(0,R.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...Yh,...i},_=Sp(h??r),v=dh({callback:(0,R.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=wp((0,R.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Sp(t);return(0,R.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,R.useEffect)(()=>(s({type:Jp.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Jp.UnregisterDroppable,key:a,id:r})),[r]),(0,R.useEffect)(()=>{n!==u.current.disabled&&(s({type:Jp.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function Zh(e){let{animation:t,children:n}=e,[r,i]=(0,R.useState)(null),[a,o]=(0,R.useState)(null),s=Tp(n);return!n&&!r&&s&&i(s),yp(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),R.createElement(R.Fragment,null,n,r?(0,R.cloneElement)(r,{ref:o}):null)}var Qh={x:0,y:0,scaleX:1,scaleY:1};function $h(e){let{children:t}=e;return R.createElement(Mh.Provider,{value:jh},R.createElement(Bh.Provider,{value:Qh},t))}var eg={position:`fixed`,touchAction:`none`},tg=e=>Mp(e)?`transform 250ms ease`:void 0,ng=(0,R.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=tg}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...eg,width:s.width,height:s.height,top:s.top,left:s.left,transform:Fp.Transform.toString(d),transformOrigin:i&&r?Zp(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return R.createElement(n,{className:o,style:f,ref:t},a)}),rg={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Fp.Transform.toString(t)},{transform:Fp.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function ig(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return bp((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=wh(a);if(!c)return;let{transform:l}=mp(a).getComputedStyle(a),u=om(l);if(!u)return;let d=typeof t==`function`?t:ag(t);return km(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function ag(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...rg,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var og=0;function sg(e){return(0,R.useMemo)(()=>{if(e!=null)return og++,og},[e])}var cg=R.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=qh(),S=(0,R.useContext)(Bh),C=sg(d?.id),w=Lh(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:S,windowRect:x}),T=ch(f),E=ig({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),D=T?g.setRef:void 0;return R.createElement($h,null,R.createElement(Zh,{animation:E},d&&C?R.createElement(ng,{key:C,id:d.id,ref:D,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:T,style:{zIndex:l,...i},transform:w},n):null))}),lg=Object.prototype;function ug(e){return typeof e==`object`&&!!e}function dg(e){return Array.isArray(e)?e:typeof e==`number`?[e]:e.replace(/\[(\d+)\]/g,`.$1`).split(`.`).filter(Boolean)}function fg(e){return t=>vg(t,e)}function pg(e){return t=>ug(t)?Object.entries(e).every(([e,n])=>xg(t[e],n)):!1}function mg(e){return typeof e==`function`?e:typeof e==`string`?fg(e):ug(e)?pg(e):(e=>e)}function hg(e){if(!ug(e))return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>hg(e));let t={};for(let[n,r]of Object.entries(e))t[n]=hg(r);return t}function gg(e,t){let n=mg(t),r=Array.isArray(e)?e.entries():Object.entries(e??{});for(let[t,i]of r)if(n(i,t,e))return i}function _g(e,t){let n=mg(t);for(let[t,r]of Object.entries(e??{}))if(n(r,t,e))return t}function vg(e,t,n){if(!Array.isArray(t)&&e!=null&&Object.prototype.hasOwnProperty.call(Object(e),t)){let r=e[t];return r===void 0?n:r}let r=e;for(let e of dg(t)){if(r==null)return n;r=r[e]}return r===void 0?n:r}function yg(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:!ug(e)||Object.keys(e).length===0}function bg(e,t,n){let r=n?.(e,t);if(r!==void 0)return!!r;if(Object.is(e,t))return!0;if(!ug(e)||!ug(t))return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime();if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,r)=>bg(e,t[r],n));let i=Object.keys(e),a=Object.keys(t);return i.length===a.length&&i.every(r=>lg.hasOwnProperty.call(t,r)&&bg(e[r],t[r],n))}function xg(e,t){return bg(e,t)}function Sg(e){return e===void 0}function Cg(e,t,n){let r=n,i=Array.isArray(e)?e.entries():Object.entries(e??{});for(let[n,a]of i)r=t(r,a,n,e);return r}var wg=0;function Tg(e=``){return wg+=1,`${e}${wg}`}var Eg=(e,t,n)=>{if(!e||e.length<=1||t===void 0||n===void 0)throw Error(`swap requires a non-empty array, fromIndex, toIndex: ${e}, ${t} ${n}`);let r=hg(e),i=e[n];return r[n]=r[t],r[t]=i,r},Dg={flex:1};function Og({id:e,children:t,disabled:n,classes:r,isVerticalPool:i,minHeight:a}){let{setNodeRef:o,isOver:s}=Xh({id:e,disabled:n});return(0,B.jsx)(`div`,{ref:o,style:Dg,children:(0,B.jsx)(up,{disabled:n,isOver:s,choiceBoard:!0,className:r,isVerticalPool:i,minHeight:a,children:t})})}Og.propTypes={id:y.oneOfType([y.string,y.number]).isRequired,children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired,disabled:y.bool,classes:y.object,isVerticalPool:y.bool,minHeight:y.number};function kg({id:e,children:t,disabled:n,onRemoveAnswer:r,...i}){return(0,B.jsx)(Og,{id:e,disabled:n,...i,children:t})}kg.propTypes={id:y.oneOfType([y.string,y.number]).isRequired,children:y.node,disabled:y.bool,onRemoveAnswer:y.func};function Ag(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}var jg=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e,i=r[0];return!t||!i?n:Ag(n,t,i)},Mg=25,Ng=(e,{active:t,context:n,currentCoordinates:r})=>{let{code:i}=e,a=i===`Tab`,o=i===Q.Down||i===Q.Up||i===Q.Left||i===Q.Right;if(!a&&!o)return;if(e.preventDefault(),o)switch(i){case Q.Down:return{...r,y:r.y+Mg};case Q.Up:return{...r,y:r.y-Mg};case Q.Right:return{...r,x:r.x+Mg};case Q.Left:return{...r,x:r.x-Mg};default:return r}let{droppableRects:s,droppableContainers:c,collisionRect:l}=n;if(!s||s.size===0)return r;let u=t?.data?.current,d=u?.promptId==null?void 0:`drop-${u.promptId}`,f=[];for(let[e,t]of c){if(t?.disabled||e===d)continue;let n=s.get(e);if(!n)continue;let r={x:n.left+n.width/2,y:n.top+n.height/2},i={x:n.left,y:n.top+n.height/2};f.push({id:e,rect:n,dropPosition:i,center:r})}if(f.length===0)return r;let p=e.shiftKey;f.sort((e,t)=>Math.abs(e.center.y-t.center.y)>10?e.center.y-t.center.y:e.center.x-t.center.x);let m=l?{x:l.left+l.width/2,y:l.top+l.height/2}:r,h=f.findIndex(e=>m.x>=e.rect.left&&m.x<=e.rect.right&&m.y>=e.rect.top&&m.y<=e.rect.bottom);if(h===-1){let e=1/0;for(let t=0;t<f.length;t++){let n=Pg(r,f[t].dropPosition);n<e&&(e=n,h=t)}}return f[p?(h-1+f.length)%f.length:(h+1)%f.length].dropPosition},Pg=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),Fg=`height ease-in 300ms, opacity ease-in 300ms`,Ig=K(`div`)(()=>({position:`relative`,height:0,overflow:`hidden`,display:`flex`,visibility:`hidden`,width:0,"&.enter":{transition:Fg,opacity:1,height:`auto`,width:`auto`,visibility:`visible`,minHeight:`25px`},"&.enter-done":{height:`auto`,visibility:`visible`,width:`auto`,minHeight:`25px`},"&.exit":{transition:Fg,opacity:0,height:0,visibility:`visible`,width:0},"&.exit-done":{opacity:0,visibility:`hidden`,height:0,width:0}})),Lg=e=>{let{show:t,children:n,className:r}=e,i=(0,R.useRef)(null);return(0,B.jsx)(ks,{nodeRef:i,in:t,appear:!0,mountOnEnter:!1,timeout:300,classNames:{enter:`enter`,enterDone:`enter-done`,exit:`exit`,exitDone:`exit-done`},children:(0,B.jsx)(Ig,{ref:i,className:r,children:n})})};Lg.propTypes={show:y.bool.isRequired,className:y.string,children:y.oneOfType([y.arrayOf(y.node),y.node]).isRequired};var $=e=>typeof e==`string`,Rg=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},zg=e=>e==null?``:``+e,Bg=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Vg=/###/g,Hg=e=>e&&e.indexOf(`###`)>-1?e.replace(Vg,`.`):e,Ug=e=>!e||$(e),Wg=(e,t,n)=>{let r=$(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Ug(e))return{};let t=Hg(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Ug(e)?{}:{obj:e,k:Hg(r[i])}},Gg=(e,t,n)=>{let{obj:r,k:i}=Wg(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=Wg(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Wg(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Kg=(e,t,n,r)=>{let{obj:i,k:a}=Wg(e,t,Object);i[a]=i[a]||[],i[a].push(n)},qg=(e,t)=>{let{obj:n,k:r}=Wg(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Jg=(e,t,n)=>{let r=qg(e,n);return r===void 0?qg(t,n):r},Yg=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?$(e[r])||e[r]instanceof String||$(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Yg(e[r],t[r],n):e[r]=t[r]);return e},Xg=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Zg={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},Qg=e=>$(e)?e.replace(/[&<>"'\/]/g,e=>Zg[e]):e,$g=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},e_=[` `,`,`,`?`,`!`,`;`],t_=new $g(20),n_=(e,t,n)=>{t||=``,n||=``;let r=e_.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=t_.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},r_=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},i_=e=>e?.replace(/_/g,`-`),a_={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},o_=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||a_,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:($(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},s_=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},c_=class extends s_{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):$(n)&&i?o.push(...n.split(i)):o.push(n)));let s=qg(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!$(n)?s:r_(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),Gg(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)($(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=qg(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Yg(s,n,i):s={...s,...n},Gg(this.data,o,s),a.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 this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},l_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},u_=Symbol(`i18next/PATH_KEY`);function d_(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===u_?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function f_(e,t){let{[u_]:n}=e(d_()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var p_={},m_=e=>!$(e)&&typeof e!=`boolean`&&typeof e!=`number`,h_=class e extends s_{constructor(e,t={}){super(),Bg([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=o_.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=m_(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!n_(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:$(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:$(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=f_(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?f_(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!$(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=m_(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!($(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:m_(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&$(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,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=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`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,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=$(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!$(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=$(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=l_.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return $(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?f_(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!$(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&($(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!p_[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(p_[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" 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(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!$(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},g_=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=o_.create(`languageUtils`)}getScriptPartFromCode(e){if(e=i_(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=i_(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if($(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}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(this.options.load===`languageOnly`||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;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),$(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return $(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):$(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},__={zero:0,one:1,two:2,few:3,many:4,other:5},v_={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},y_=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=o_.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=i_(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),v_;if(!e.match(/-|_/))return v_;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.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||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>__[e]-__[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},b_=(e,t,n,r=`.`,i=!0)=>{let a=Jg(e,t,n);return!a&&i&&$(n)&&(a=r_(e,n,r),a===void 0&&(a=r_(t,n,r))),a},x_=e=>e.replace(/\$/g,`$$$$`),S_=class{constructor(e={}){this.logger=o_.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Qg:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?Xg(i):a||`{{`,this.suffix=o?Xg(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?Xg(d):f||Xg(`$t(`),this.nestingSuffix=p?Xg(p):m||Xg(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=b_(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(b_(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>x_(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?x_(this.escape(e)):x_(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=$(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else!$(a)&&!this.useRawValueToEscape&&(a=zg(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${Xg(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!$(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!$(i))return i;$(i)||(i=zg(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},C_=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},w_=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(i_(r),i),t[o]=s),s(n)}},T_=e=>(t,n,r)=>e(i_(n),r)(t),E_=class{constructor(e={}){this.logger=o_.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?w_:T_;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let 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()]=w_(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=C_(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},D_=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},O_=class extends s_{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=o_.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{Kg(n.loaded,[i],a),D_(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();$(e)&&(e=this.languageUtils.toResolveHierarchy(e)),$(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.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=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){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!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},k_=()=>({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(typeof e[1]==`object`&&(t=e[1]),$(e[1])&&(t.defaultValue=e[1]),$(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let 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}),A_=e=>($(e.ns)&&(e.ns=[e.ns]),$(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),$(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),j_=()=>{},M_=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},N_=`__i18next_supportNoticeShown`,P_=()=>!!(typeof globalThis<`u`&&globalThis[N_]||typeof process<`u`&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`&&process.env),F_=()=>{typeof globalThis<`u`&&(globalThis[N_]=!0)},I_=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),L_=class e extends s_{constructor(e={},t){if(super(),this.options=A_(e),this.services={},this.logger=o_,this.modules={external:[]},M_(this),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,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&($(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=k_();this.options={...n,...this.options,...A_(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!I_(this)&&!P_()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),F_());let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?o_.init(r(this.modules.logger),this.options):o_.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:E_;let t=new g_(this.options);this.store=new c_(this.options.resources,this.options);let i=this.services;i.logger=o_,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new y_(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)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new S_(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new O_(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new h_(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||=j_,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(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)});let i=Rg(),a=()=>{let 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?a():setTimeout(a,0),i}loadResources(e,t=j_){let n=t,r=$(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(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){let r=Rg();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=j_,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&l_.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&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++){let 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;let n=Rg();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=$(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes($(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=f_(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=f_(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=f_(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return $(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...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;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Rg();return this.options.ns?($(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){let n=Rg();$(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`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`.split(`.`),n=this.services?.languageUtils||new g_(k_());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=j_){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new c_(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...k_().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new S_(n)}return a.translator=new h_(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();L_.createInstance,L_.dir,L_.init,L_.loadResources,L_.reloadResources,L_.use,L_.changeLanguage,L_.getFixedT,L_.t,L_.exists,L_.setDefaultNamespace,L_.hasLoadedNamespace,L_.loadNamespaces,L_.loadLanguages,L_.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 R_={translator:{...L_,t:(e,t)=>{let{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`;break;default:break}return L_.t(e,{lng:n,...t})}},languageOptions:[{value:`en_US`,label:`English (US)`},{value:`es_ES`,label:`Spanish`}]};function z_(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function B_(e,t){return!e||z_(e)?e:z_(e.default)?e.default:t&&z_(e[t])?e[t]:t&&z_(e[t]?.default)?e[t].default:e}var V_=B_(Mf,`Readable`)||B_(W_.Readable,`Readable`),H_=cp,U_=H_.default,W_=U_&&typeof U_==`object`?U_:H_,{translator:G_}=R_,K_={WebkitTouchCallout:`none`,WebkitUserSelect:`none`,KhtmlUserSelect:`none`,MozUserSelect:`none`,msUserSelect:`none`,userSelect:`none`},q_=K(`div`)(()=>({width:`100%`,cursor:`pointer`})),J_=K(`div`)(()=>({margin:`0 auto`,textAlign:`center`,display:`flex`})),Y_=K(`div`)(()=>({width:`fit-content`,minWidth:`140px`,alignSelf:`center`,verticalAlign:`middle`,color:`var(--correct-answer-toggle-label-color, ${yl()})`,fontWeight:`normal`,...K_})),X_=K(`div`)(()=>({position:`absolute`,width:`25px`,"&.enter":{opacity:`0`},"&.enter-active":{opacity:`1`,transition:`opacity 0.3s ease-in`},"&.exit":{opacity:`1`},"&.exit-active":{opacity:`0`,transition:`opacity 0.3s ease-in`}})),Z_=K(`div`)(()=>({width:`25px`,marginRight:`5px`,display:`flex`,alignItems:`center`})),Q_=class e extends R.Component{static propTypes={onToggle:y.func,toggled:y.bool,show:y.bool,hideMessage:y.string,showMessage:y.string,className:y.string,language:y.string};static defaultProps={showMessage:`Show correct answer`,hideMessage:`Hide correct answer`,show:!1,toggled:!1};constructor(t){super(t),this.state={show:t.show},this.openIconRef=R.createRef(),this.closedIconRef=R.createRef(),e.defaultProps={...e.defaultProps,showMessage:G_.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:G_.t(`common:hideCorrectAnswer`,{lng:t.language})}}onClick(){this.props.onToggle(!this.props.toggled)}onTouch(e){e.preventDefault(),this.props.onToggle(!this.props.toggled)}UNSAFE_componentWillReceiveProps(t){this.setState({show:t.show}),t.language!==this.props?.language&&(e.defaultProps={...e.defaultProps,showMessage:G_.t(`common:showCorrectAnswer`,{lng:t.language}),hideMessage:G_.t(`common:hideCorrectAnswer`,{lng:t.language})})}render(){let{className:e,toggled:t,hideMessage:n,showMessage:r}=this.props;return(0,B.jsx)(q_,{className:e,children:(0,B.jsx)(Lg,{show:this.state.show,children:(0,B.jsxs)(J_,{onClick:this.onClick.bind(this),onTouchEnd:this.onTouch.bind(this),children:[(0,B.jsxs)(Z_,{children:[(0,B.jsx)(ks,{nodeRef:this.openIconRef,timeout:400,in:t,exit:!t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,B.jsx)(X_,{ref:this.openIconRef,children:(0,B.jsx)(Lo,{open:t},`correct-open`)})}),(0,B.jsx)(ks,{nodeRef:this.closedIconRef,timeout:5e3,in:!t,exit:t,classNames:{enter:`enter`,enterActive:`enter-active`,exit:`exit`,exitActive:`exit-active`},children:(0,B.jsx)(X_,{ref:this.closedIconRef,children:(0,B.jsx)(Lo,{open:t},`correct-closed`)})})]}),(0,B.jsx)(V_,{false:!0,children:(0,B.jsx)(Y_,{"aria-hidden":!this.state.show,children:t?n:r})})]})})})}},$_=el((0,B.jsx)(`path`,{d:`m7 10 5 5 5-5z`}),`ArrowDropDown`),ev=K(`div`)({display:`inline-block`,position:`relative`,width:`100%`}),tv=K(`span`)(({isRight:e})=>({backgroundColor:Kl(),bottom:e?20:19,content:`""`,display:`block`,height:1,left:20,position:`absolute`,width:`100%`})),nv=class extends R.Component{static propTypes={direction:y.string};render(){let{direction:e}=this.props;return(0,B.jsxs)(ev,{style:e===`left`?{}:{transform:`rotate(180deg)`},children:[(0,B.jsx)($_,{style:{transform:`rotate(90deg)`,color:Kl(),fontSize:40}}),(0,B.jsx)(tv,{isRight:e!==`left`})]})}},rv=_(`pie-elements:match-title:answer`),iv=K(`div`)(({theme:e})=>({width:`100%`,fontSize:`18px`,textAlign:`center`,color:`rgba(${e.palette.common.black}, 0.6)`})),av=({index:e,isOver:t,disabled:n,type:r})=>(0,B.jsx)(up,{extraStyles:{display:`flex`,padding:`0`,alignItems:`center`,justifyContent:`center`,height:`40px`},disabled:n,isOver:t,type:r,children:e!==void 0&&(0,B.jsx)(iv,{children:e})});av.propTypes={index:y.number,isOver:y.bool,disabled:y.bool,type:y.string};var ov=K(`div`)(({isDragging:e,isSelected:t,isOver:n,disabled:r,outcome:i})=>({color:yl(),backgroundColor:eu(),border:`1px solid ${i===`correct`?Sl():i===`incorrect`?El():Kl()}`,cursor:r?`not-allowed`:`pointer`,width:`100%`,padding:`10px`,boxSizing:`border-box`,overflow:`hidden`,transition:`opacity 200ms linear`,wordBreak:`break-word`,opacity:(e||t)&&!r?.5:n&&!r?.2:1,touchAction:`none`})),sv=e=>{let{isDragging:t,isSelected:n,isOver:r,title:i,disabled:a,empty:o,outcome:s,guideIndex:c,type:l}=e;return o?(0,B.jsx)(av,{index:c,isOver:r,disabled:a,type:l}):(0,B.jsx)(ov,{isDragging:t,isSelected:n,isOver:r,disabled:a,outcome:s,dangerouslySetInnerHTML:{__html:i}})},cv=K(`div`)(({correct:e,theme:t})=>({boxSizing:`border-box`,minHeight:40,minWidth:`200px`,overflow:`hidden`,margin:t.spacing(.5),padding:`0px`,textAlign:`center`,height:`initial`,border:e===!0?`1px solid var(--feedback-correct-bg-color, ${Sl()})`:e===!1?`1px solid var(--feedback-incorrect-bg-color, ${El()})`:`none`})),lv=class extends R.Component{static propTypes={className:y.string,isDragging:y.bool,isSelected:y.bool,id:y.any,title:y.string,isOver:y.bool,empty:y.bool,type:y.string,disabled:y.bool,correct:y.bool};componentDidMount(){this.ref&&this.ref.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0})}componentWillUnmount(){this.ref&&this.ref.removeEventListener(`touchstart`,this.handleTouchStart)}handleTouchStart=e=>{};render(){let{id:e,title:t,isDragging:n=!1,isSelected:r=!1,className:i,disabled:a,isOver:o=!1,type:s,correct:c}=this.props;return rv(`[render], props: `,this.props),(0,B.jsx)(cv,{correct:c,className:i,ref:e=>this.ref=e,children:(0,B.jsx)(sv,{title:t,id:e,isOver:o,empty:yg(t),isDragging:n,isSelected:r,disabled:a,type:s})})}},uv=({type:e,id:t,promptId:n})=>n==null?`${e||`answer`}-${t}`:`${e||`answer`}-prompt-${n}`;function dv(e){let{id:t,instanceId:n,promptId:r,draggable:i=!0,disabled:a=!1,type:o,selectedAnswer:s,onSelectClick:c,onPlacementClick:l}=e,u=uv({type:o,id:t,promptId:r}),d=r==null?void 0:`drop-${r}`,f={type:o||`answer`,id:t,instanceId:n,value:e.title,promptId:r},p=d?{type:`drop-zone`,promptId:r,instanceId:n}:void 0,{attributes:m,listeners:h,setNodeRef:g,transform:_,transition:v,isDragging:y}=Kh({id:u,data:f,disabled:!i||a,attributes:{tabIndex:i&&!a?0:-1}}),b=Xh({id:d,data:p,disabled:a||!d}),x=b.setNodeRef,S=b.isOver,[C,w]=(0,R.useState)(!1),T=!!s,E=S||T&&C&&!a,D=!!s&&s.type===f.type&&s.id===f.id&&s.promptId===f.promptId,O=_?`translate3d(${_.x}px, ${_.y}px, 0)`:void 0;if(d){let t=()=>{a||(D?c?.(f):s?l?.(p):i&&c?.(f))},n=!i&&!a;return(0,B.jsx)(`div`,{ref:x,role:`button`,tabIndex:n?0:-1,onClick:t,onKeyDown:n?e=>{(e.code===`Space`||e.code===`Enter`)&&(e.preventDefault(),t())}:void 0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),style:{flex:1,opacity:y||D?.5:1,backgroundColor:y||D||E?`rgba(0,0,0,0.05)`:`transparent`,cursor:T&&!a?`pointer`:void 0},children:(0,B.jsx)(`div`,{ref:g,...h,...m,style:{transform:O,transition:v},children:(0,B.jsx)(lv,{...e,isDragging:y,isSelected:D,isOver:E})})})}let k=e=>{a||(e.stopPropagation(),c?.(f))};return(0,B.jsx)(`div`,{ref:g,...h,...m,onClick:k,style:{transform:O,transition:v,cursor:a?`not-allowed`:`grab`,opacity:y||D?.5:1,touchAction:i&&!a?`none`:`auto`},children:(0,B.jsx)(lv,{...e,isDragging:y,isSelected:D,isOver:!1})})}dv.propTypes={id:y.any,instanceId:y.string,promptId:y.any,title:y.string,draggable:y.bool,disabled:y.bool,type:y.string,selectedAnswer:y.object,onSelectClick:y.func,onPlacementClick:y.func};var fv=200,pv=K(`div`)({alignItems:`normal`,display:`flex`,flexShrink:0,height:40,margin:`10px 20px`}),mv=K(`div`)(({theme:e})=>({alignItems:`flex-start`,display:`flex`,flex:1,flexDirection:`column`,justifyContent:`space-between`,marginTop:e.spacing(2),marginBottom:e.spacing(2)})),hv=K(`div`)(()=>({border:`1px solid ${Kl()}`,boxSizing:`border-box`,flex:1,margin:`10px 0`,minHeight:40,minWidth:fv,overflow:`hidden`,padding:10,textAlign:`center`,width:`100%`,wordBreak:`break-word`})),gv=K(`div`)({alignItems:`center`,display:`flex`,justifyContent:`space-between`,width:`100%`}),_v=class extends R.Component{static propTypes={session:y.object.isRequired,showCorrect:y.bool.isRequired,disabled:y.bool.isRequired,onSessionChange:y.func,onRemoveAnswer:y.func,instanceId:y.string.isRequired,model:y.object.isRequired,prompt:y.string,selectedAnswer:y.object,onChoiceClick:y.func,onPlacementClick:y.func};getAnswerFromSession=e=>{let{model:t,session:n,showCorrect:r}=this.props,{config:i}=t,a=r?i.prompts.find(t=>t.id===e).relatedAnswer:n.value&&n.value[e];return i.answers.find(e=>e.id===a)||{}};getCorrectOrIncorrectMap=()=>{let{model:e,session:t,showCorrect:n}=this.props,{config:r}=e,i=t.value||r.prompts.reduce((e,t)=>(e[t.id]=void 0,e),{});if(e.mode!==`evaluate`)return{};if(n)return r.prompts.reduce((e,t)=>(e[t.id]=!0,e),{});let a=r.prompts.reduce((e,t)=>(Sg(t.relatedAnswer)||(e[t.id]=t.relatedAnswer),e),{});return Cg(i,(e,t,n)=>(e[n]=a[n]===i[n],e),{})};buildRows=()=>{let{model:e}=this.props,{config:t}=e;return(t.prompts||[]).map(e=>{let t=this.getAnswerFromSession(e.id);return{...e,sessionAnswer:t}})};render(){let{disabled:e,instanceId:t,onRemoveAnswer:n,selectedAnswer:r,onChoiceClick:i,onPlacementClick:a}=this.props,o=this.buildRows(),s=this.getCorrectOrIncorrectMap();return(0,B.jsx)(mv,{children:o.map(({sessionAnswer:o,title:c,id:l},u)=>(0,B.jsxs)(gv,{children:[(0,B.jsx)(hv,{dangerouslySetInnerHTML:{__html:c}}),(0,B.jsxs)(pv,{children:[(0,B.jsx)(nv,{direction:`left`}),(0,B.jsx)(nv,{})]}),(0,B.jsx)(dv,{className:`answer`,index:u,promptId:l,correct:s[l],draggable:!yg(o),disabled:e,instanceId:t,id:o.id,title:o.title,type:`target`,onRemoveChoice:()=>n(l),selectedAnswer:r,onSelectClick:i,onPlacementClick:a})]},l))})}},vv=K(`div`)(({theme:e})=>({alignItems:`center`,display:`flex`,flexDirection:`row`,flexWrap:`wrap`,justifyContent:`space-between`,marginTop:e.spacing(1),marginBottom:e.spacing(1),minHeight:50,transition:`background-color 200ms ease`}));function yv({id:e,disabled:t,children:n,onPlacementClick:r,...i}){let{setNodeRef:a,isOver:o}=Xh({id:e||`choices-pool`,data:{type:`choices-pool`},disabled:t});return(0,B.jsx)(vv,{ref:a,onClick:()=>{t||r?.({type:`choices-pool`})},style:{backgroundColor:o?`rgba(0,0,0,0.05)`:`transparent`},...i,children:(0,B.jsx)(kg,{id:e,disabled:t,children:n})})}yv.propTypes={id:y.oneOfType([y.string,y.number]),disabled:y.bool,children:y.node,onPlacementClick:y.func};var bv=K(`div`)(({theme:e})=>({marginBottom:e.spacing(2)})),xv=class extends R.Component{static propTypes={session:y.object.isRequired,instanceId:y.string.isRequired,model:y.object.isRequired,disabled:y.bool.isRequired,onRemoveAnswer:y.func,selectedAnswer:y.object,onChoiceClick:y.func,onPlacementClick:y.func};render(){let{model:e,disabled:t,session:n,instanceId:r,onRemoveAnswer:i,selectedAnswer:a,onChoiceClick:o,onPlacementClick:s}=this.props,{config:c}=e,{duplicates:l}=c,u=c.answers.filter(e=>l||yg(n)||!n.value||Sg(gg(n.value,t=>t===e.id))).map(e=>(0,B.jsx)(dv,{instanceId:r,draggable:!0,disabled:t,session:n,type:`choice`,selectedAnswer:a,onSelectClick:o,...e},e.id));return(0,B.jsx)(bv,{children:(0,B.jsx)(yv,{id:`choices-pool`,disabled:t,onRemoveAnswer:i,onPlacementClick:s,children:u})})}};function Sv(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function Cv(e,t){return!e||Sv(e)?e:Sv(e.default)?e.default:t&&Sv(e[t])?e[t]:t&&Sv(e[t]?.default)?e[t].default:e}var wv=Cv(jf,`PreviewPrompt`)||Cv(Ov.PreviewPrompt,`PreviewPrompt`),Tv=Cv(Cu,`Feedback`)||Cv(Ov.Feedback,`Feedback`),Ev=cp,Dv=Ev.default,Ov=Dv&&typeof Dv==`object`?Dv:Ev,kv=250,Av=[{sensor:Gm,options:{activationConstraint:{distance:8}}},{sensor:Bm,options:{coordinateGetter:Ng,keyboardCodes:{start:[Q.Space,Q.Enter],cancel:[Q.Esc],end:[Q.Space,Q.Enter]}}}],jv=K(`div`)({display:`flex`,flexDirection:`column`,justifyContent:`center`,color:yl(),backgroundColor:Bl()}),Mv=K(`div`)({width:`100%`,overflowX:`auto`,overflowY:`hidden`}),Nv=K(`div`)({display:`flex`,flexDirection:`column`,minWidth:`min-content`}),Pv=class extends R.Component{static propTypes={session:y.object.isRequired,onSessionChange:y.func,model:y.object.isRequired,prompt:y.string};constructor(e){super(e),this.instanceId=Tg(),this.state={showCorrectAnswer:!1,draggingElement:null,selectedAnswer:null},this.lastDragEndAt=0}onRemoveAnswer(e){let{session:t,onSessionChange:n}=this.props;t.value[e]=void 0,n(t)}onDragStart=e=>{let{active:t}=e;if(t?.data?.current){let e=null,n=t.node?.current;if(n){let{width:t,height:r}=n.getBoundingClientRect();e={width:t,height:r}}this.setState({draggingElement:{...t.data.current,rect:e}}),this.selectAnswer(t.data.current)}};onDragCancel=()=>{this.setState({draggingElement:null}),this.cancelSelection(),this.lastDragEndAt=Date.now()};placeAnswer=(e,t)=>{if(!e||!t)return;let{session:n,onSessionChange:r,model:i}=this.props,{config:{duplicates:a}}=i;if(Sg(n.value)&&(n.value={}),t.type===`choices-pool`&&e.promptId!==void 0){n.value[e.promptId]=void 0,r(n);return}let o=e.id,s=e.promptId;if(t.type===`drop-zone`&&t.promptId!=null){let i=t.promptId;if(e.type===`choice`&&i!==void 0){let e=_g(n.value,e=>e===o);e&&!a?n.value=Eg(n.value,e,i):n.value[i]=o}else if(e.type===`target`&&s!=null&&s!==i)if(n.value[i]!=null&&!a){let e=n.value[i];n.value[i]=o,n.value[s]=e}else n.value[i]=o,delete n.value[s];r(n)}};onPlaceAnswer=e=>{this.setState({draggingElement:null});let{active:t,over:n}=e;if(!t)return;let r=t.data.current,i=n?.data.current;r&&(this.placeAnswer(r,i),this.cancelSelection(),this.lastDragEndAt=Date.now())};isSameAnswer=(e,t)=>!!e&&!!t&&e.type===t.type&&e.id===t.id&&e.promptId===t.promptId;selectAnswer=e=>{this.setState({selectedAnswer:e})};toggleAnswerSelection=e=>{this.setState(t=>({selectedAnswer:this.isSameAnswer(t.selectedAnswer,e)?null:e}))};cancelSelection=()=>{this.setState({selectedAnswer:null})};endAnyLiveKeyboardDrag=()=>{document.dispatchEvent(new KeyboardEvent(`keydown`,{code:`Escape`,bubbles:!0,cancelable:!0}))};placeSelectedAnswer=e=>{let{selectedAnswer:t}=this.state;t&&(this.placeAnswer(t,e),this.cancelSelection(),this.endAnyLiveKeyboardDrag(),this.lastDragEndAt=Date.now())};isClickSoonAfterDragEnd=()=>Date.now()-this.lastDragEndAt<kv;onChoiceClick=e=>{this.isClickSoonAfterDragEnd()||this.toggleAnswerSelection(e)};onPlacementClick=e=>{this.isClickSoonAfterDragEnd()||this.placeSelectedAnswer(e)};toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})};renderDragOverlay=()=>{let{draggingElement:e}=this.state;return e?(0,B.jsx)(lv,{id:e.id,title:e.value,disabled:!1,isDragging:!1,style:e.rect?{width:e.rect.width,height:e.rect.height,boxSizing:`border-box`}:{}}):null};render(){let{showCorrectAnswer:e}=this.state,{model:t,session:n}=this.props,{config:r,mode:i}=t,{prompt:a,language:o}=r;return(0,B.jsxs)(Hh,{sensors:Av,collisionDetection:tm,onDragStart:this.onDragStart,onDragEnd:this.onPlaceAnswer,onDragCancel:this.onDragCancel,modifiers:[jg],accessibility:{screenReaderInstructions:{draggable:`Press Space or Enter to pick up this answer choice. Once picked up, use Tab or Shift+Tab to cycle through response areas, or use arrow keys to move it freely. Press Space or Enter to drop, or Escape to cancel. You can also click an answer choice to select it, then click a response area to place it there.`}},children:[(0,B.jsxs)(jv,{children:[(0,B.jsx)(wv,{className:`prompt`,prompt:a}),(0,B.jsx)(Q_,{show:i===`evaluate`,toggled:e,onToggle:this.toggleShowCorrect,language:o}),(0,B.jsx)(Mv,{children:(0,B.jsxs)(Nv,{children:[(0,B.jsx)(_v,{instanceId:this.instanceId,model:t,session:n,onRemoveAnswer:e=>this.onRemoveAnswer(e),disabled:i!==`gather`,showCorrect:e,selectedAnswer:this.state.selectedAnswer,onChoiceClick:this.onChoiceClick,onPlacementClick:this.onPlacementClick}),(0,B.jsx)(xv,{instanceId:this.instanceId,model:t,session:n,disabled:i!==`gather`,onRemoveAnswer:e=>this.onRemoveAnswer(e),selectedAnswer:this.state.selectedAnswer,onChoiceClick:this.onChoiceClick,onPlacementClick:this.onPlacementClick})]})}),t.correctness&&t.feedback&&!e&&(0,B.jsx)(Tv,{correctness:t.correctness.correctness,feedback:t.feedback})]}),(0,B.jsx)(cg,{children:this.renderDragOverlay()})]})}};(class e extends CustomEvent{static{this.TYPE=`model-set`}constructor(t,n,r){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t,hasModel:r}}),this.component=t,this.complete=n}});var Fv=class e extends CustomEvent{static{this.TYPE=`session-changed`}constructor(t,n){super(e.TYPE,{bubbles:!0,composed:!0,detail:{complete:n,component:t}}),this.component=t,this.complete=n}},Iv=g(),Lv=_(`pie-ui:graph-lines`),Rv=(e,t)=>{if(!e)return!1;let n=e.value,r=!0;return n&&(t.config.prompts||[]).forEach(e=>{Number.isFinite(n[e.id])||(r=!1)}),r},zv=class extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}sessionChanged(e){this._session.value=e.value,this.dispatchEvent(new Fv(this.tagName.toLowerCase(),Rv(this._session,this._model))),Lv(`session: `,this._session),this._render()}connectedCallback(){this._render()}_render(){if(!this._model||!this._session)return;let e=R.createElement(Pv,{model:this._model,session:this._session,onSessionChange:this.sessionChanged.bind(this)});this._root||=(0,Iv.createRoot)(this),this._root.render(e),queueMicrotask(()=>{Yu(this)})}disconnectedCallback(){this._root&&=(this._root.unmount(),null)}};return typeof window<`u`&&!customElements.get(`match-list-element`)&&customElements.define(`match-list-element`,zv),zv})();
|