fansunited-widget-poll 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/poll-manager.es.js +1 -1
- package/poll-manager.umd.js +1 -1
package/package.json
CHANGED
package/poll-manager.es.js
CHANGED
|
@@ -74963,7 +74963,7 @@ const _ke = [10, 15, 20, 25, 50], kke = (t) => {
|
|
|
74963
74963
|
]
|
|
74964
74964
|
}
|
|
74965
74965
|
) }), hl = "###", pB = (t, e, n) => j(void 0, null, function* () {
|
|
74966
|
-
let i = "https://translation.googleapis.com/language/translate/v2?key=
|
|
74966
|
+
let i = "https://translation.googleapis.com/language/translate/v2?key=AIzaSyB6JILBJiJ0Z2pxw0-nudOpRAzqFk6D6Lw";
|
|
74967
74967
|
return i += "&q=" + encodeURIComponent(t), i += `&target=${qp[e].key || "en"}`, n && (i += `&source=${n}`), i += "&format=text", yield fetch(i, {
|
|
74968
74968
|
method: "GET",
|
|
74969
74969
|
headers: {
|
package/poll-manager.umd.js
CHANGED
|
@@ -2631,7 +2631,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2631
2631
|
To pick up a draggable item, press the space bar.
|
|
2632
2632
|
While dragging, use the arrow keys to move the item.
|
|
2633
2633
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
2634
|
-
`},eSe={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function tSe(t){let{announcements:e=eSe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ZIe}=t;const{announce:a,announcement:o}=JIe(),s=Ud("DndLiveRegion"),[c,u]=G.useState(!1);if(G.useEffect(()=>{u(!0)},[]),QIe(G.useMemo(()=>({onDragStart(f){let{active:p}=f;a(e.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;e.onDragMove&&a(e.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;a(e.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;a(e.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;a(e.onDragCancel({active:p,over:h}))}}),[a,e])),!c)return null;const d=G.createElement(G.Fragment,null,G.createElement(YIe,{id:r,value:i.draggable}),G.createElement(KIe,{id:s,announcement:o}));return n?Mt.createPortal(d,n):d}var Gn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Gn||(Gn={}));function lg(){}function wF(t,e){return G.useMemo(()=>({sensor:t,options:e!=null?e:{}}),[t,e])}function nSe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return G.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Ni=Object.freeze({x:0,y:0});function rSe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function iSe(t,e){const n=sg(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function aSe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function oSe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function CF(t){let{left:e,top:n,height:r,width:i}=t;return[{x:e,y:n},{x:e+i,y:n},{x:e,y:n+r},{x:e+i,y:n+r}]}function IF(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}const sSe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=CF(e),a=[];for(const o of r){const{id:s}=o,c=n.get(s);if(c){const u=CF(c),d=i.reduce((p,h,g)=>p+rSe(u[g],h),0),f=Number((d/4).toFixed(4));a.push({id:s,data:{droppableContainer:o,value:f}})}}return a.sort(aSe)};function lSe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),a=Math.min(e.top+e.height,t.top+t.height),o=i-r,s=a-n;if(r<i&&n<a){const c=e.width*e.height,u=t.width*t.height,d=o*s,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const cSe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=[];for(const a of r){const{id:o}=a,s=n.get(o);if(s){const c=lSe(s,e);c>0&&i.push({id:o,data:{droppableContainer:a,value:c}})}}return i.sort(oSe)};function uSe(t,e,n){return Ae(ue({},t),{scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1})}function SF(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ni}function dSe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((a,o)=>Ae(ue({},a),{top:a.top+t*o.y,bottom:a.bottom+t*o.y,left:a.left+t*o.x,right:a.right+t*o.x}),ue({},e))}}const fSe=dSe(1);function _F(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function pSe(t,e,n){const r=_F(e);if(!r)return t;const{scaleX:i,scaleY:a,x:o,y:s}=r,c=t.left-o-(1-i)*parseFloat(n),u=t.top-s-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?t.width/i:t.width,f=a?t.height/a:t.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const hSe={ignoreTransform:!1};function vc(t,e){e===void 0&&(e=hSe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:d}=vr(t).getComputedStyle(t);u&&(n=pSe(n,u,d))}const{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 kF(t){return vc(t,{ignoreTransform:!0})}function mSe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function gSe(t,e){return e===void 0&&(e=vr(t).getComputedStyle(t)),e.position==="fixed"}function vSe(t,e){e===void 0&&(e=vr(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const i=e[r];return typeof i=="string"?n.test(i):!1})}function cg(t,e){const n=[];function r(i){if(e!=null&&n.length>=e||!i)return n;if(ZC(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Bd(i)||vF(i)||n.includes(i))return n;const a=vr(t).getComputedStyle(i);return i!==t&&vSe(i,a)&&n.push(i),gSe(i,a)?n:r(i.parentNode)}return t?r(t):n}function TF(t){const[e]=cg(t,1);return e!=null?e:null}function t1(t){return!ng||!t?null:hc(t)?t:XC(t)?ZC(t)||t===mc(t).scrollingElement?window:Bd(t)?t:null:null}function AF(t){return hc(t)?t.scrollX:t.scrollLeft}function PF(t){return hc(t)?t.scrollY:t.scrollTop}function n1(t){return{x:AF(t),y:PF(t)}}var tr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(tr||(tr={}));function EF(t){return!ng||!t?!1:t===document.scrollingElement}function OF(t){const e={x:0,y:0},n=EF(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},i=t.scrollTop<=e.y,a=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,s=t.scrollLeft>=r.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:r,minScroll:e}}const ySe={x:.2,y:.2};function bSe(t,e,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=ySe);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=OF(t),h={x:0,y:0},g={x:0,y:0},m={height:e.height*i.y,width:e.width*i.x};return!u&&a<=e.top+m.height?(h.y=tr.Backward,g.y=r*Math.abs((e.top+m.height-a)/m.height)):!d&&c>=e.bottom-m.height&&(h.y=tr.Forward,g.y=r*Math.abs((e.bottom-m.height-c)/m.height)),!p&&s>=e.right-m.width?(h.x=tr.Forward,g.x=r*Math.abs((e.right-m.width-s)/m.width)):!f&&o<=e.left+m.width&&(h.x=tr.Backward,g.x=r*Math.abs((e.left+m.width-o)/m.width)),{direction:h,speed:g}}function xSe(t){if(t===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:e,left:n,right:r,bottom:i}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:i,width:t.clientWidth,height:t.clientHeight}}function RF(t){return t.reduce((e,n)=>gc(e,n1(n)),Ni)}function wSe(t){return t.reduce((e,n)=>e+AF(n),0)}function CSe(t){return t.reduce((e,n)=>e+PF(n),0)}function MF(t,e){if(e===void 0&&(e=vc),!t)return;const{top:n,left:r,bottom:i,right:a}=e(t);TF(t)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const ISe=[["x",["left","right"],wSe],["y",["top","bottom"],CSe]];class r1{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=cg(n),i=RF(r);this.rect=ue({},e),this.width=e.width,this.height=e.height;for(const[a,o,s]of ISe)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=s(r),d=i[a]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Wd{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var i;(i=this.target)==null||i.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function SSe(t){const{EventTarget:e}=vr(t);return t instanceof e?t:mc(t)}function i1(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(Gu(n,2)+Gu(r,2))>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var bi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(bi||(bi={}));function DF(t){t.preventDefault()}function _Se(t){t.stopPropagation()}var _t;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(_t||(_t={}));const $F={start:[_t.Space,_t.Enter],cancel:[_t.Esc],end:[_t.Space,_t.Enter,_t.Tab]},kSe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case _t.Right:return Ae(ue({},n),{x:n.x+25});case _t.Left:return Ae(ue({},n),{x:n.x-25});case _t.Down:return Ae(ue({},n),{y:n.y+25});case _t.Up:return Ae(ue({},n),{y:n.y-25})}};class a1{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Wd(mc(n)),this.windowListeners=new Wd(vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bi.Resize,this.handleCancel),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&MF(r),n(Ni)}handleKeyDown(e){if(og(e)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:a=$F,coordinateGetter:o=kSe,scrollBehavior:s="smooth"}=i,{code:c}=e;if(a.end.includes(c)){this.handleEnd(e);return}if(a.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:Ni;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(e,{active:n,context:r.current,currentCoordinates:d});if(f){const p=Vd(f,d),h={x:0,y:0},{scrollableAncestors:g}=r.current;for(const m of g){const v=e.code,{isTop:b,isRight:x,isLeft:y,isBottom:C,maxScroll:w,minScroll:I}=OF(m),_=xSe(m),T={x:Math.min(v===_t.Right?_.right-_.width/2:_.right,Math.max(v===_t.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(v===_t.Down?_.bottom-_.height/2:_.bottom,Math.max(v===_t.Down?_.top:_.top+_.height/2,f.y))},O=v===_t.Right&&!x||v===_t.Left&&!y,A=v===_t.Down&&!C||v===_t.Up&&!b;if(O&&T.x!==f.x){const k=m.scrollLeft+p.x,S=v===_t.Right&&k<=w.x||v===_t.Left&&k>=I.x;if(S&&!p.y){m.scrollTo({left:k,behavior:s});return}S?h.x=m.scrollLeft-k:h.x=v===_t.Right?m.scrollLeft-w.x:m.scrollLeft-I.x,h.x&&m.scrollBy({left:-h.x,behavior:s});break}else if(A&&T.y!==f.y){const k=m.scrollTop+p.y,S=v===_t.Down&&k<=w.y||v===_t.Up&&k>=I.y;if(S&&!p.x){m.scrollTo({top:k,behavior:s});return}S?h.y=m.scrollTop-k:h.y=v===_t.Down?m.scrollTop-w.y:m.scrollTop-I.y,h.y&&m.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(e,gc(Vd(f,this.referenceCoordinates),h))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}a1.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=$F,onActivation:i}=e,{active:a}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const s=a.activatorNode.current;return s&&t.target!==s?!1:(t.preventDefault(),i==null||i({event:t.nativeEvent}),!0)}return!1}}];function LF(t){return!!(t&&"distance"in t)}function FF(t){return!!(t&&"delay"in t)}class o1{constructor(e,n,r){var i;r===void 0&&(r=SSe(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=n;const{event:a}=e,{target:o}=a;this.props=e,this.events=n,this.document=mc(o),this.documentListeners=new Wd(this.document),this.listeners=new Wd(r),this.windowListeners=new Wd(vr(o)),this.initialCoordinates=(i=sg(a))!=null?i:Ni,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=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(bi.Resize,this.handleCancel),this.windowListeners.add(bi.DragStart,DF),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),this.windowListeners.add(bi.ContextMenu,DF),this.documentListeners.add(bi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FF(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(LF(n)){this.handlePending(n);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,n){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(bi.Click,_Se,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:i,props:a}=this,{onMove:o,options:{activationConstraint:s}}=a;if(!i)return;const c=(n=sg(e))!=null?n:Ni,u=Vd(i,c);if(!r&&s){if(LF(s)){if(s.tolerance!=null&&i1(u,s.tolerance))return this.handleCancel();if(i1(u,s.distance))return this.handleStart()}if(FF(s)&&i1(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===_t.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const TSe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class s1 extends o1{constructor(e){const{event:n}=e,r=mc(n.target);super(e,TSe,r)}}s1.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ASe={move:{name:"mousemove"},end:{name:"mouseup"}};var l1;(function(t){t[t.RightClick=2]="RightClick"})(l1||(l1={}));class PSe extends o1{constructor(e){super(e,ASe,mc(e.event.target))}}PSe.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===l1.RightClick?!1:(r==null||r({event:n}),!0)}}];const c1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ESe extends o1{constructor(e){super(e,c1)}static setup(){return window.addEventListener(c1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(c1.move.name,e)};function e(){}}}ESe.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var qd;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(qd||(qd={}));var ug;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(ug||(ug={}));function OSe(t){let{acceleration:e,activator:n=qd.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=ug.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=t;const h=MSe({delta:f,disabled:!a}),[g,m]=UIe(),v=G.useRef({x:0,y:0}),b=G.useRef({x:0,y:0}),x=G.useMemo(()=>{switch(n){case qd.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case qd.DraggableRect:return i}},[n,i,c]),y=G.useRef(null),C=G.useCallback(()=>{const I=y.current;if(!I)return;const _=v.current.x*b.current.x,T=v.current.y*b.current.y;I.scrollBy(_,T)},[]),w=G.useMemo(()=>s===ug.TreeOrder?[...u].reverse():u,[s,u]);G.useEffect(()=>{if(!a||!u.length||!x){m();return}for(const I of w){if((r==null?void 0:r(I))===!1)continue;const _=u.indexOf(I),T=d[_];if(!T)continue;const{direction:O,speed:A}=bSe(I,T,x,e,p);for(const k of["x","y"])h[k][O[k]]||(A[k]=0,O[k]=0);if(A.x>0||A.y>0){m(),y.current=I,g(C,o),v.current=A,b.current=O;return}}v.current={x:0,y:0},b.current={x:0,y:0},m()},[e,C,r,m,a,o,JSON.stringify(x),JSON.stringify(h),g,u,w,d,JSON.stringify(p)])}const RSe={x:{[tr.Backward]:!1,[tr.Forward]:!1},y:{[tr.Backward]:!1,[tr.Forward]:!1}};function MSe(t){let{delta:e,disabled:n}=t;const r=ag(e);return Hd(i=>{if(n||!r||!i)return RSe;const a={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[tr.Backward]:i.x[tr.Backward]||a.x===-1,[tr.Forward]:i.x[tr.Forward]||a.x===1},y:{[tr.Backward]:i.y[tr.Backward]||a.y===-1,[tr.Forward]:i.y[tr.Forward]||a.y===1}}},[n,e,r])}function DSe(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Hd(i=>{var a;return e==null?null:(a=r!=null?r:i)!=null?a:null},[r,e])}function $Se(t,e){return G.useMemo(()=>t.reduce((n,r)=>{const{sensor:i}=r,a=i.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...a]},[]),[t,e])}var Gd;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Gd||(Gd={}));var u1;(function(t){t.Optimized="optimized"})(u1||(u1={}));const NF=new Map;function LSe(t,e){let{dragging:n,dependencies:r,config:i}=e;const[a,o]=G.useState(null),{frequency:s,measure:c,strategy:u}=i,d=G.useRef(t),f=v(),p=zd(f),h=G.useCallback(function(b){b===void 0&&(b=[]),!p.current&&o(x=>x===null?b:x.concat(b.filter(y=>!x.includes(y))))},[p]),g=G.useRef(null),m=Hd(b=>{if(f&&!n)return NF;if(!b||b===NF||d.current!==t||a!=null){const x=new Map;for(let y of t){if(!y)continue;if(a&&a.length>0&&!a.includes(y.id)&&y.rect.current){x.set(y.id,y.rect.current);continue}const C=y.node.current,w=C?new r1(c(C),C):null;y.rect.current=w,w&&x.set(y.id,w)}return x}return b},[t,a,n,f,c]);return G.useEffect(()=>{d.current=t},[t]),G.useEffect(()=>{f||h()},[n,f]),G.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),G.useEffect(()=>{f||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,f,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:a!=null};function v(){switch(u){case Gd.Always:return!1;case Gd.BeforeDragging:return n;default:return!n}}}function d1(t,e){return Hd(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function FSe(t,e){return d1(t,e)}function NSe(t){let{callback:e,disabled:n}=t;const r=rg(e),i=G.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return G.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function dg(t){let{callback:e,disabled:n}=t;const r=rg(e),i=G.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return G.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function jSe(t){return new r1(vc(t),t)}function jF(t,e,n){e===void 0&&(e=jSe);const[r,i]=G.useState(null);function a(){i(c=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=c!=null?c:n)!=null?u:null}const d=e(t);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=NSe({callback(c){if(t)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(t)){a();break}}}}),s=dg({callback:a});return Fi(()=>{a(),t?(s==null||s.observe(t),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[t]),r}function BSe(t){const e=d1(t);return SF(t,e)}const BF=[];function zSe(t){const e=G.useRef(t),n=Hd(r=>t?r&&r!==BF&&t&&e.current&&t.parentNode===e.current.parentNode?r:cg(t):BF,[t]);return G.useEffect(()=>{e.current=t},[t]),n}function HSe(t){const[e,n]=G.useState(null),r=G.useRef(t),i=G.useCallback(a=>{const o=t1(a.target);o&&n(s=>s?(s.set(o,n1(o)),new Map(s)):null)},[]);return G.useEffect(()=>{const a=r.current;if(t!==a){o(a);const s=t.map(c=>{const u=t1(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,n1(u)]):null}).filter(c=>c!=null);n(s.length?new Map(s):null),r.current=t}return()=>{o(t),o(a)};function o(s){s.forEach(c=>{const u=t1(c);u==null||u.removeEventListener("scroll",i)})}},[i,t]),G.useMemo(()=>t.length?e?Array.from(e.values()).reduce((a,o)=>gc(a,o),Ni):RF(t):Ni,[t,e])}function zF(t,e){e===void 0&&(e=[]);const n=G.useRef(null);return G.useEffect(()=>{n.current=null},e),G.useEffect(()=>{const r=t!==Ni;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Vd(t,n.current):Ni}function USe(t){G.useEffect(()=>{if(!ng)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function VSe(t,e){return G.useMemo(()=>t.reduce((n,r)=>{let{eventName:i,handler:a}=r;return n[i]=o=>{a(o,e)},n},{}),[t,e])}function HF(t){return G.useMemo(()=>t?mSe(t):null,[t])}const UF=[];function WSe(t,e){e===void 0&&(e=vc);const[n]=t,r=HF(n?vr(n):null),[i,a]=G.useState(UF);function o(){a(()=>t.length?t.map(c=>EF(c)?r:new r1(e(c),c)):UF)}const s=dg({callback:o});return Fi(()=>{s==null||s.disconnect(),o(),t.forEach(c=>s==null?void 0:s.observe(c))},[t]),i}function VF(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Bd(e)?e:t}function qSe(t){let{measure:e}=t;const[n,r]=G.useState(null),i=G.useCallback(u=>{for(const{target:d}of u)if(Bd(d)){r(f=>{const p=e(d);return f?Ae(ue({},f),{width:p.width,height:p.height}):p});break}},[e]),a=dg({callback:i}),o=G.useCallback(u=>{const d=VF(u);a==null||a.disconnect(),d&&(a==null||a.observe(d)),r(d?e(d):null)},[e,a]),[s,c]=ig(o);return G.useMemo(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}const GSe=[{sensor:s1,options:{}},{sensor:a1,options:{}}],YSe={current:{}},fg={draggable:{measure:kF},droppable:{measure:kF,strategy:Gd.WhileDragging,frequency:u1.Optimized},dragOverlay:{measure:vc}};class Yd extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const KSe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:lg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fg,measureDroppableContainers:lg,windowRect:null,measuringScheduled:!1},WF={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:lg,draggableNodes:new Map,over:null,measureDroppableContainers:lg},Kd=G.createContext(WF),qF=G.createContext(KSe);function JSe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yd}}}function QSe(t,e){switch(e.type){case Gn.DragStart:return Ae(ue({},t),{draggable:Ae(ue({},t.draggable),{initialCoordinates:e.initialCoordinates,active:e.active})});case Gn.DragMove:return t.draggable.active==null?t:Ae(ue({},t),{draggable:Ae(ue({},t.draggable),{translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}})});case Gn.DragEnd:case Gn.DragCancel:return Ae(ue({},t),{draggable:Ae(ue({},t.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case Gn.RegisterDroppable:{const{element:n}=e,{id:r}=n,i=new Yd(t.droppable.containers);return i.set(r,n),Ae(ue({},t),{droppable:Ae(ue({},t.droppable),{containers:i})})}case Gn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=e,a=t.droppable.containers.get(n);if(!a||r!==a.key)return t;const o=new Yd(t.droppable.containers);return o.set(n,Ae(ue({},a),{disabled:i})),Ae(ue({},t),{droppable:Ae(ue({},t.droppable),{containers:o})})}case Gn.UnregisterDroppable:{const{id:n,key:r}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new Yd(t.droppable.containers);return a.delete(n),Ae(ue({},t),{droppable:Ae(ue({},t.droppable),{containers:a})})}default:return t}}function XSe(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:i}=G.useContext(Kd),a=ag(r),o=ag(n==null?void 0:n.id);return G.useEffect(()=>{if(!e&&!r&&a&&o!=null){if(!og(a)||document.activeElement===a.target)return;const s=i.get(o);if(!s)return;const{activatorNode:c,node:u}=s;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=qIe(d);if(f){f.focus();break}}})}},[r,e,i,o,a]),null}function GF(t,e){let n=e,{transform:r}=n,i=hn(n,["transform"]);return t!=null&&t.length?t.reduce((a,o)=>o(ue({transform:a},i)),r):r}function ZSe(t){return G.useMemo(()=>({draggable:ue(ue({},fg.draggable),t==null?void 0:t.draggable),droppable:ue(ue({},fg.droppable),t==null?void 0:t.droppable),dragOverlay:ue(ue({},fg.dragOverlay),t==null?void 0:t.dragOverlay)}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function e_e(t){let{activeNode:e,measure:n,initialRect:r,config:i=!0}=t;const a=G.useRef(!1),{x:o,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Fi(()=>{if(!o&&!s||!e){a.current=!1;return}if(a.current||!r)return;const c=e==null?void 0:e.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=SF(u,r);if(o||(d.x=0),s||(d.y=0),a.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=TF(c);f&&f.scrollBy({top:d.y,left:d.x})}},[e,o,s,r,n])}const pg=G.createContext(Ae(ue({},Ni),{scaleX:1,scaleY:1}));var Lo;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Lo||(Lo={}));const t_e=G.memo(function(t){var e,n,r,i;let a=t,{id:o,accessibility:s,autoScroll:c=!0,children:u,sensors:d=GSe,collisionDetection:f=cSe,measuring:p,modifiers:h}=a,g=hn(a,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const m=G.useReducer(QSe,void 0,JSe),[v,b]=m,[x,y]=XIe(),[C,w]=G.useState(Lo.Uninitialized),I=C===Lo.Initialized,{draggable:{active:_,nodes:T,translate:O},droppable:{containers:A}}=v,k=_!=null?T.get(_):null,S=G.useRef({initial:null,translated:null}),E=G.useMemo(()=>{var wt;return _!=null?{id:_,data:(wt=k==null?void 0:k.data)!=null?wt:YSe,rect:S}:null},[_,k]),M=G.useRef(null),[R,F]=G.useState(null),[B,H]=G.useState(null),V=zd(g,Object.values(g)),U=Ud("DndDescribedBy",o),D=G.useMemo(()=>A.getEnabled(),[A]),z=ZSe(p),{droppableRects:W,measureDroppableContainers:q,measuringScheduled:X}=LSe(D,{dragging:I,dependencies:[O.x,O.y],config:z.droppable}),K=DSe(T,_),Q=G.useMemo(()=>B?sg(B):null,[B]),Y=St(),J=FSe(K,z.draggable.measure);e_e({activeNode:_!=null?T.get(_):null,config:Y.layoutShiftCompensation,initialRect:J,measure:z.draggable.measure});const Z=jF(K,z.draggable.measure,J),oe=jF(K?K.parentElement:null),ae=G.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=A.getNodeFor((e=ae.current.over)==null?void 0:e.id),Pe=qSe({measure:z.dragOverlay.measure}),me=(n=Pe.nodeRef.current)!=null?n:K,ve=I?(r=Pe.rect)!=null?r:Z:null,he=!!(Pe.nodeRef.current&&Pe.rect),ie=BSe(he?null:Z),se=HF(me?vr(me):null),de=zSe(I?xe!=null?xe:K:null),be=WSe(de),pe=GF(h,{transform:{x:O.x-ie.x,y:O.y-ie.y,scaleX:1,scaleY:1},activatorEvent:B,active:E,activeNodeRect:Z,containerNodeRect:oe,draggingNodeRect:ve,over:ae.current.over,overlayNodeRect:Pe.rect,scrollableAncestors:de,scrollableAncestorRects:be,windowRect:se}),ke=Q?gc(Q,O):null,Be=HSe(de),Ue=zF(Be),ut=zF(Be,[Z]),at=gc(pe,Ue),ye=ve?fSe(ve,pe):null,Oe=E&&ye?f({active:E,collisionRect:ye,droppableRects:W,droppableContainers:D,pointerCoordinates:ke}):null,Te=IF(Oe,"id"),[Ve,Re]=G.useState(null),De=he?pe:gc(pe,ut),Ke=uSe(De,(i=Ve==null?void 0:Ve.rect)!=null?i:null,Z),qe=G.useRef(null),Rt=G.useCallback((wt,kt)=>{let{sensor:ee,options:re}=kt;if(M.current==null)return;const ce=T.get(M.current);if(!ce)return;const fe=wt.nativeEvent,Me=new ee({active:M.current,activeNode:ce,event:fe,options:re,context:ae,onAbort(Qe){if(!T.get(Qe))return;const{onDragAbort:We}=V.current,ot={id:Qe};We==null||We(ot),x({type:"onDragAbort",event:ot})},onPending(Qe,We,ot,Ge){if(!T.get(Qe))return;const{onDragPending:Xe}=V.current,vt={id:Qe,constraint:We,initialCoordinates:ot,offset:Ge};Xe==null||Xe(vt),x({type:"onDragPending",event:vt})},onStart(Qe){const We=M.current;if(We==null)return;const ot=T.get(We);if(!ot)return;const{onDragStart:Ge}=V.current,Xe={activatorEvent:fe,active:{id:We,data:ot.data,rect:S}};Mt.unstable_batchedUpdates(()=>{Ge==null||Ge(Xe),w(Lo.Initializing),b({type:Gn.DragStart,initialCoordinates:Qe,active:We}),x({type:"onDragStart",event:Xe}),F(qe.current),H(fe)})},onMove(Qe){b({type:Gn.DragMove,coordinates:Qe})},onEnd:ze(Gn.DragEnd),onCancel:ze(Gn.DragCancel)});qe.current=Me;function ze(Qe){return function(){return ne(this,null,function*(){const{active:We,collisions:ot,over:Ge,scrollAdjustedTranslate:Xe}=ae.current;let vt=null;if(We&&Xe){const{cancelDrop:jn}=V.current;vt={activatorEvent:fe,active:We,collisions:ot,delta:Xe,over:Ge},Qe===Gn.DragEnd&&typeof jn=="function"&&(yield Promise.resolve(jn(vt)))&&(Qe=Gn.DragCancel)}M.current=null,Mt.unstable_batchedUpdates(()=>{b({type:Qe}),w(Lo.Uninitialized),Re(null),F(null),H(null),qe.current=null;const jn=Qe===Gn.DragEnd?"onDragEnd":"onDragCancel";if(vt){const Bn=V.current[jn];Bn==null||Bn(vt),x({type:jn,event:vt})}})})}}},[T]),bt=G.useCallback((wt,kt)=>(ee,re)=>{const ce=ee.nativeEvent,fe=T.get(re);if(M.current!==null||!fe||ce.dndKit||ce.defaultPrevented)return;const Me={active:fe};wt(ee,kt.options,Me)===!0&&(ce.dndKit={capturedBy:kt.sensor},M.current=re,Rt(ee,kt))},[T,Rt]),En=$Se(d,bt);USe(d),Fi(()=>{Z&&C===Lo.Initializing&&w(Lo.Initialized)},[Z,C]),G.useEffect(()=>{const{onDragMove:wt}=V.current,{active:kt,activatorEvent:ee,collisions:re,over:ce}=ae.current;if(!kt||!ee)return;const fe={active:kt,activatorEvent:ee,collisions:re,delta:{x:at.x,y:at.y},over:ce};Mt.unstable_batchedUpdates(()=>{wt==null||wt(fe),x({type:"onDragMove",event:fe})})},[at.x,at.y]),G.useEffect(()=>{const{active:wt,activatorEvent:kt,collisions:ee,droppableContainers:re,scrollAdjustedTranslate:ce}=ae.current;if(!wt||M.current==null||!kt||!ce)return;const{onDragOver:fe}=V.current,Me=re.get(Te),ze=Me&&Me.rect.current?{id:Me.id,rect:Me.rect.current,data:Me.data,disabled:Me.disabled}:null,Qe={active:wt,activatorEvent:kt,collisions:ee,delta:{x:ce.x,y:ce.y},over:ze};Mt.unstable_batchedUpdates(()=>{Re(ze),fe==null||fe(Qe),x({type:"onDragOver",event:Qe})})},[Te]),Fi(()=>{ae.current={activatorEvent:B,active:E,activeNode:K,collisionRect:ye,collisions:Oe,droppableRects:W,draggableNodes:T,draggingNode:me,draggingNodeRect:ve,droppableContainers:A,over:Ve,scrollableAncestors:de,scrollAdjustedTranslate:at},S.current={initial:ve,translated:ye}},[E,K,Oe,ye,T,me,ve,W,A,Ve,de,at]),OSe(Ae(ue({},Y),{delta:O,draggingRect:ye,pointerCoordinates:ke,scrollableAncestors:de,scrollableAncestorRects:be}));const rn=G.useMemo(()=>({active:E,activeNode:K,activeNodeRect:Z,activatorEvent:B,collisions:Oe,containerNodeRect:oe,dragOverlay:Pe,draggableNodes:T,droppableContainers:A,droppableRects:W,over:Ve,measureDroppableContainers:q,scrollableAncestors:de,scrollableAncestorRects:be,measuringConfiguration:z,measuringScheduled:X,windowRect:se}),[E,K,Z,B,Oe,oe,Pe,T,A,W,Ve,q,de,be,z,X,se]),Ft=G.useMemo(()=>({activatorEvent:B,activators:En,active:E,activeNodeRect:Z,ariaDescribedById:{draggable:U},dispatch:b,draggableNodes:T,over:Ve,measureDroppableContainers:q}),[B,En,E,Z,b,U,T,Ve,q]);return G.createElement(xF.Provider,{value:y},G.createElement(Kd.Provider,{value:Ft},G.createElement(qF.Provider,{value:rn},G.createElement(pg.Provider,{value:Ke},u)),G.createElement(XSe,{disabled:(s==null?void 0:s.restoreFocus)===!1})),G.createElement(tSe,Ae(ue({},s),{hiddenTextDescribedById:U})));function St(){const wt=(R==null?void 0:R.autoScrollEnabled)===!1,kt=typeof c=="object"?c.enabled===!1:c===!1,ee=I&&!wt&&!kt;return typeof c=="object"?Ae(ue({},c),{enabled:ee}):{enabled:ee}}}),n_e=G.createContext(null),YF="button",r_e="Draggable";function i_e(t){let{id:e,data:n,disabled:r=!1,attributes:i}=t;const a=Ud(r_e),{activators:o,activatorEvent:s,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=G.useContext(Kd),{role:h=YF,roleDescription:g="draggable",tabIndex:m=0}=i!=null?i:{},v=(c==null?void 0:c.id)===e,b=G.useContext(v?pg:n_e),[x,y]=ig(),[C,w]=ig(),I=VSe(o,e),_=zd(n);Fi(()=>(f.set(e,{id:e,key:a,node:x,activatorNode:C,data:_}),()=>{const O=f.get(e);O&&O.key===a&&f.delete(e)}),[f,e]);const T=G.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":v&&h===YF?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,m,v,g,d.draggable]);return{active:c,activatorEvent:s,activeNodeRect:u,attributes:T,isDragging:v,listeners:r?void 0:I,node:x,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:b}}function KF(){return G.useContext(qF)}const a_e="Droppable",o_e={timeout:25};function s_e(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=t;const a=Ud(a_e),{active:o,dispatch:s,over:c,measureDroppableContainers:u}=G.useContext(Kd),d=G.useRef({disabled:n}),f=G.useRef(!1),p=G.useRef(null),h=G.useRef(null),{disabled:g,updateMeasurementsFor:m,timeout:v}=ue(ue({},o_e),i),b=zd(m!=null?m:r),x=G.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},v)},[v]),y=dg({callback:x,disabled:g||!o}),C=G.useCallback((T,O)=>{y&&(O&&(y.unobserve(O),f.current=!1),T&&y.observe(T))},[y]),[w,I]=ig(C),_=zd(e);return G.useEffect(()=>{!y||!w.current||(y.disconnect(),f.current=!1,y.observe(w.current))},[w,y]),G.useEffect(()=>(s({type:Gn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:w,rect:p,data:_}}),()=>s({type:Gn.UnregisterDroppable,key:a,id:r})),[r]),G.useEffect(()=>{n!==d.current.disabled&&(s({type:Gn.SetDroppableDisabled,id:r,key:a,disabled:n}),d.current.disabled=n)},[r,a,n,s]),{active:o,rect:p,isOver:(c==null?void 0:c.id)===r,node:w,over:c,setNodeRef:I}}function l_e(t){let{animation:e,children:n}=t;const[r,i]=G.useState(null),[a,o]=G.useState(null),s=ag(n);return!n&&!r&&s&&i(s),Fi(()=>{if(!a)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){i(null);return}Promise.resolve(e(u,a)).then(()=>{i(null)})},[e,r,a]),G.createElement(G.Fragment,null,n,r?G.cloneElement(r,{ref:o}):null)}const c_e={x:0,y:0,scaleX:1,scaleY:1};function u_e(t){let{children:e}=t;return G.createElement(Kd.Provider,{value:WF},G.createElement(pg.Provider,{value:c_e},e))}const d_e={position:"fixed",touchAction:"none"},f_e=t=>og(t)?"transform 250ms ease":void 0,p_e=G.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:u,transition:d=f_e}=t;if(!s)return null;const f=i?u:Ae(ue({},u),{scaleX:1,scaleY:1}),p=ue(Ae(ue({},d_e),{width:s.width,height:s.height,top:s.top,left:s.left,transform:$o.Transform.toString(f),transformOrigin:i&&r?iSe(r,s):void 0,transition:typeof d=="function"?d(r):d}),c);return G.createElement(n,{className:o,style:p,ref:e},a)}),JF=t=>e=>{let{active:n,dragOverlay:r}=e;const i={},{styles:a,className:o}=t;if(a!=null&&a.active)for(const[s,c]of Object.entries(a.active))c!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,c));if(a!=null&&a.dragOverlay)for(const[s,c]of Object.entries(a.dragOverlay))c!==void 0&&r.node.style.setProperty(s,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[s,c]of Object.entries(i))n.node.style.setProperty(s,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},h_e=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:$o.Transform.toString(e)},{transform:$o.Transform.toString(n)}]},m_e={duration:250,easing:"ease",keyframes:h_e,sideEffects:JF({styles:{active:{opacity:"0"}}})};function g_e(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=t;return rg((a,o)=>{if(e===null)return;const s=n.get(a);if(!s)return;const c=s.node.current;if(!c)return;const u=VF(o);if(!u)return;const{transform:d}=vr(o).getComputedStyle(o),f=_F(d);if(!f)return;const p=typeof e=="function"?e:v_e(e);return MF(c,i.draggable.measure),p({active:{id:a,data:s.data,node:c,rect:i.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function v_e(t){const{duration:e,easing:n,sideEffects:r,keyframes:i}=ue(ue({},m_e),t);return a=>{let o=a,{active:s,dragOverlay:c,transform:u}=o,d=hn(o,["active","dragOverlay","transform"]);if(!e)return;const f={x:c.rect.left-s.rect.left,y:c.rect.top-s.rect.top},p={scaleX:u.scaleX!==1?s.rect.width*u.scaleX/c.rect.width:1,scaleY:u.scaleY!==1?s.rect.height*u.scaleY/c.rect.height:1},h=ue({x:u.x-f.x,y:u.y-f.y},p),g=i(Ae(ue({},d),{active:s,dragOverlay:c,transform:{initial:u,final:h}})),[m]=g,v=g[g.length-1];if(JSON.stringify(m)===JSON.stringify(v))return;const b=r==null?void 0:r(ue({active:s,dragOverlay:c},d)),x=c.node.animate(g,{duration:e,easing:n,fill:"forwards"});return new Promise(y=>{x.onfinish=()=>{b==null||b(),y()}})}}let QF=0;function y_e(t){return G.useMemo(()=>{if(t!=null)return QF++,QF},[t])}const b_e=G.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s="div",className:c,zIndex:u=999}=t;const{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:m,dragOverlay:v,over:b,measuringConfiguration:x,scrollableAncestors:y,scrollableAncestorRects:C,windowRect:w}=KF(),I=G.useContext(pg),_=y_e(f==null?void 0:f.id),T=GF(o,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:v.rect,over:b,overlayNodeRect:v.rect,scrollableAncestors:y,scrollableAncestorRects:C,transform:I,windowRect:w}),O=d1(p),A=g_e({config:r,draggableNodes:g,droppableContainers:m,measuringConfiguration:x}),k=O?v.setRef:void 0;return G.createElement(u_e,null,G.createElement(l_e,{animation:A},f&&_?G.createElement(p_e,{key:_,id:f.id,ref:k,as:s,activatorEvent:d,adjustScale:e,className:c,transition:a,rect:O,style:ue({zIndex:u},i),transform:T},n):null))});function f1(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function x_e(t,e){return t.reduce((n,r,i)=>{const a=e.get(r);return a&&(n[i]=a),n},Array(t.length))}function hg(t){return t!==null&&t>=0}function w_e(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function C_e(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const XF=t=>{let{rects:e,activeIndex:n,overIndex:r,index:i}=t;const a=f1(e,r,n),o=e[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},ZF="Sortable",eN=G.createContext({activeIndex:-1,containerId:ZF,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:XF,disabled:{draggable:!1,droppable:!1}});function I_e(t){let{children:e,id:n,items:r,strategy:i=XF,disabled:a=!1}=t;const{active:o,dragOverlay:s,droppableRects:c,over:u,measureDroppableContainers:d}=KF(),f=Ud(ZF,n),p=s.rect!==null,h=G.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),g=o!=null,m=o?h.indexOf(o.id):-1,v=u?h.indexOf(u.id):-1,b=G.useRef(h),x=!w_e(h,b.current),y=v!==-1&&m===-1||x,C=C_e(a);Fi(()=>{x&&g&&d(h)},[x,h,g,d]),G.useEffect(()=>{b.current=h},[h]);const w=G.useMemo(()=>({activeIndex:m,containerId:f,disabled:C,disableTransforms:y,items:h,overIndex:v,useDragOverlay:p,sortedRects:x_e(h,c),strategy:i}),[m,f,C.draggable,C.droppable,y,h,v,c,p,i]);return G.createElement(eN.Provider,{value:w},e)}const S_e=t=>{let{id:e,items:n,activeIndex:r,overIndex:i}=t;return f1(n,r,i).indexOf(e)},__e=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:u}=t;return!u||!r||s!==a&&i===o?!1:n?!0:o!==i&&e===c},k_e={duration:200,easing:"ease"},tN="transform",T_e=$o.Transition.toString({property:tN,duration:0,easing:"linear"}),A_e={roleDescription:"sortable"};function P_e(t){let{disabled:e,index:n,node:r,rect:i}=t;const[a,o]=G.useState(null),s=G.useRef(n);return Fi(()=>{if(!e&&n!==s.current&&r.current){const c=i.current;if(c){const u=vc(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}n!==s.current&&(s.current=n)},[e,n,r,i]),G.useEffect(()=>{a&&o(null)},[a]),a}function E_e(t){let{animateLayoutChanges:e=__e,attributes:n,disabled:r,data:i,getNewIndex:a=S_e,id:o,strategy:s,resizeObserverConfig:c,transition:u=k_e}=t;const{items:d,containerId:f,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:m,overIndex:v,useDragOverlay:b,strategy:x}=G.useContext(eN),y=O_e(r,h),C=d.indexOf(o),w=G.useMemo(()=>ue({sortable:{containerId:f,index:C,items:d}},i),[f,i,C,d]),I=G.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:_,node:T,isOver:O,setNodeRef:A}=s_e({id:o,data:w,disabled:y.droppable,resizeObserverConfig:ue({updateMeasurementsFor:I},c)}),{active:k,activatorEvent:S,activeNodeRect:E,attributes:M,setNodeRef:R,listeners:F,isDragging:B,over:H,setActivatorNodeRef:V,transform:U}=i_e({id:o,data:w,attributes:ue(ue({},A_e),n),disabled:y.draggable}),D=HIe(A,R),z=!!k,W=z&&!g&&hg(p)&&hg(v),q=!b&&B,X=q&&W?U:null,K=s!=null?s:x,Q=W?X!=null?X:K({rects:m,activeNodeRect:E,activeIndex:p,overIndex:v,index:C}):null,Y=hg(p)&&hg(v)?a({id:o,items:d,activeIndex:p,overIndex:v}):C,J=k==null?void 0:k.id,Z=G.useRef({activeId:J,items:d,newIndex:Y,containerId:f}),oe=d!==Z.current.items,ae=e({active:k,containerId:f,isDragging:B,isSorting:z,id:o,index:C,items:d,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:u,wasDragging:Z.current.activeId!=null}),xe=P_e({disabled:!ae,index:C,node:T,rect:_});return G.useEffect(()=>{z&&Z.current.newIndex!==Y&&(Z.current.newIndex=Y),f!==Z.current.containerId&&(Z.current.containerId=f),d!==Z.current.items&&(Z.current.items=d)},[z,Y,f,d]),G.useEffect(()=>{if(J===Z.current.activeId)return;if(J!=null&&Z.current.activeId==null){Z.current.activeId=J;return}const me=setTimeout(()=>{Z.current.activeId=J},50);return()=>clearTimeout(me)},[J]),{active:k,activeIndex:p,attributes:M,data:w,rect:_,index:C,newIndex:Y,items:d,isOver:O,isSorting:z,isDragging:B,listeners:F,node:T,overIndex:v,over:H,setNodeRef:D,setActivatorNodeRef:V,setDroppableNodeRef:A,setDraggableNodeRef:R,transform:xe!=null?xe:Q,transition:Pe()};function Pe(){if(xe||oe&&Z.current.newIndex===C)return T_e;if(!(q&&!og(S)||!u)&&(z||ae))return $o.Transition.toString(Ae(ue({},u),{property:tN}))}}function O_e(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}function mg(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const R_e=[_t.Down,_t.Right,_t.Up,_t.Left],M_e=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=e;if(R_e.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=i.get(f.id);if(p)switch(t.code){case _t.Down:r.top<p.top&&c.push(f);break;case _t.Up:r.top>p.top&&c.push(f);break;case _t.Left:r.left>p.left&&c.push(f);break;case _t.Right:r.left<p.left&&c.push(f);break}});const u=sSe({collisionRect:r,droppableRects:i,droppableContainers:c});let d=IF(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const f=a.get(n.id),p=a.get(d),h=p?i.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&h&&f&&p){const m=cg(g).some((C,w)=>s[w]!==C),v=nN(f,p),b=D_e(f,p),x=m||!v?{x:0,y:0}:{x:b?r.width-h.width:0,y:b?r.height-h.height:0},y={x:h.left,y:h.top};return x.x&&x.y?y:Vd(y,x)}}}};function nN(t,e){return!mg(t)||!mg(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function D_e(t,e){return!mg(t)||!mg(e)||!nN(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const $_e=Wn($.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),rN=G.createContext({attributes:{},listeners:void 0,ref(){}}),L_e=()=>{const{attributes:t,listeners:e,ref:n}=G.useContext(rN);return $.jsx(yt,Ae(ue(ue({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},t),e),{ref:n,children:$.jsx($_e,{})}))},iN=({children:t,id:e,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:a="plain"})=>{const{attributes:o,isDragging:s,listeners:c,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:p}=E_e({id:e}),h=G.useMemo(()=>({attributes:o,listeners:c,ref:d}),[o,c,d]),g={opacity:s?.6:void 0,transform:$o.Translate.toString(f),transition:p};return $.jsx(rN.Provider,{value:h,children:$.jsx(os,{variant:a,ref:u,style:g,startAction:i?$.jsx(L_e,{}):$.jsx($.Fragment,{}),endAction:i?$.jsx(Mn,{title:n,children:$.jsx(yt,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:$.jsx(DO,{})})}):$.jsx($.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:t})})},F_e={sideEffects:JF({styles:{active:{opacity:"0.6"}}})},N_e=({children:t})=>$.jsx(b_e,{dropAnimation:F_e,children:t}),j_e=({entities:t=[],labels:e,setEntities:n,removeItem:r})=>{const[i,a]=G.useState(null),o=G.useMemo(()=>t.find(c=>c.id===(i==null?void 0:i.id)),[i,t]),s=nSe(wF(s1),wF(a1,{coordinateGetter:M_e}));return $.jsxs(t_e,{sensors:s,onDragStart:({active:c})=>{a(c)},onDragEnd:({active:c,over:u})=>{if(u&&c.id!==(u==null?void 0:u.id)){const d=t.findIndex(({id:p})=>p===c.id),f=t.findIndex(({id:p})=>p===u.id);n(f1(t,d,f))}a(null)},onDragCancel:()=>{a(null)},children:[$.jsx(I_e,{items:t,children:$.jsx(_0,{sx:{gap:"10px"},children:t.map(c=>$.jsxs(iN,{id:c.id,variant:"outlined",removeItem:()=>r(c.id),tooltipTitle:e.removeEntity,children:[$.jsx(Je,{ml:2,children:c.title||c.name}),c.type&&$.jsx(oi,{color:Y1e(c.type),sx:{marginLeft:2},children:K1e(c.type)})]},`sortable-item-${c.id}`))})}),$.jsx(N_e,{children:o?$.jsx($.Fragment,{children:t.map(c=>$.jsx(iN,{id:c.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:e.removeEntity},`sortable-overlay-item-${c.id}`))}):$.jsx($.Fragment,{})})]})},B_e=t=>$.jsxs(Dt,{size:"sm",children:[$.jsx(Bt,{children:t.labels.itemsPerPage}),$.jsx(hr,{value:t.value,size:"sm",onChange:t.onChange,sx:{minHeight:"37px"},children:t.options.map((e,n)=>$.jsx(Hn,{value:e,children:e},`items-per-page-${e}-${n}`))})]}),z_e={Login:Mxe,InformationInput:Ed,RichText:Vw,HeaderButtons:sye,MarketSelection:Yxe,Accordion:Wpe,DynamicFields:_ye,BasicSelect:Gpe,BooleanSwitch:vCe,Branding:oye,ProfileSearchSelect:mCe,RangeCalendar:Iye,CompetitionSearchSelect:pCe,Related:Xxe,Images:cxe,Duration:Cye,DatePickerComponent:Od,Flags:axe,Spinner:eg,Tags:DL,Toast:er,AdContent:qpe,Match:Kxe,Winners:rIe,CompetitionsSearchSelect:hCe,TeamsSearchSelect:gCe,CustomSelect:hwe,Schedule:swe,NoPermissionCard:Sye,CustomFlatpickrCalendar:TC,ContextSelectFilter:aIe,NumberInput:OIe,EntityContext:NIe,MiniGamesImages:BIe,AuthRequirement:zIe,SortableList:j_e,ItemsPerPageFilter:B_e},aN=G.createContext(null),H_e=({children:t})=>$.jsx(aN.Provider,{value:z_e,children:t}),U_e=()=>{const t=G.useContext(aN);if(!t)throw new Error("useComponentContext must be used within a ComponentProvider");return t},oN=425,sN=1024,V_e=()=>{const[t,e]=G.useState(window.innerWidth<=sN),[n,r]=G.useState(window.innerWidth<=oN);return G.useLayoutEffect(()=>{const i=()=>{e(window.innerWidth<=sN),r(window.innerWidth<=oN)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:t,isPhone:n}},Nn={APIProvider:aue,AuthProvider:oue,AuthContext:HM,ComponentProvider:H_e,useComponentContext:U_e,useAPIContext:or,useIsMobile:V_e};class lN{constructor(){l(this,"types",[]);l(this,"languageConfig",null);l(this,"authRequirement",null)}}class W_e{constructor(e){l(this,"userNotFound");l(this,"clientFeaturesNotFoundMessage");l(this,"featureDisabled");l(this,"noPermissionMessage");l(this,"tryAgainButton");l(this,"signOut");l(this,"timeFormat");l(this,"getPollsErrorMessage");l(this,"title");l(this,"noPollsFound");l(this,"status");l(this,"votes");l(this,"creationDate");l(this,"actions");l(this,"pageNo");l(this,"back");l(this,"create");l(this,"edit");l(this,"save");l(this,"preview");l(this,"close");l(this,"sortBy");l(this,"sortByAscending");l(this,"sortByDescending");l(this,"language");l(this,"languageDescription");l(this,"contextEntityTag");l(this,"typeContextTagNamePlaceholder");l(this,"itemsPerPage");l(this,"showMoreImages");l(this,"hideMoreImages");l(this,"uploadImage");l(this,"copyUrl");l(this,"add");l(this,"configuration");l(this,"minimumVotes");l(this,"alternativeTitle");l(this,"description");l(this,"images");l(this,"branding");l(this,"urls");l(this,"primaryUrl");l(this,"secondaryUrl");l(this,"privacyPolicyUrl");l(this,"termsAndConditionsUrl");l(this,"additionalUrl");l(this,"colors");l(this,"primaryColor");l(this,"secondaryColor");l(this,"contentColor");l(this,"backgroundColor");l(this,"borderColor");l(this,"additionalColor");l(this,"mainLogo");l(this,"mobileLogo");l(this,"backgroundImage");l(this,"mobileBackgroundImage");l(this,"additionalImage");l(this,"embedCode");l(this,"embedCodePlaceholder");l(this,"rules");l(this,"adContent");l(this,"adContentPlaceholder");l(this,"mainImage");l(this,"coverImage");l(this,"mobileImage");l(this,"clearImage");l(this,"viewImage");l(this,"cropImage");l(this,"aspectRatio");l(this,"crop");l(this,"reset");l(this,"sportal365Images");l(this,"search");l(this,"delete");l(this,"fromDate");l(this,"toDate");l(this,"active");l(this,"inactive");l(this,"expired");l(this,"repeatedValueMessage");l(this,"flags");l(this,"flagsPlaceholder");l(this,"labels");l(this,"customFields");l(this,"keyDynamicFields");l(this,"valueDynamicFields");l(this,"options");l(this,"optionNumber");l(this,"optionsDescription");l(this,"context");l(this,"content");l(this,"tags");l(this,"campaign");l(this,"id");l(this,"label");l(this,"type");l(this,"typeDescription");l(this,"deleteLabel");l(this,"deletePollTitle");l(this,"deletePollDescription");l(this,"previewPoll");l(this,"hideFilters");l(this,"showFilters");l(this,"previous");l(this,"next");l(this,"clear");l(this,"getFootballEntitiesErrorMessage");l(this,"titleRequiredFieldValidationMessage");l(this,"optionsFieldValidationMessage");l(this,"tagsInvalidFieldValidationMessage");l(this,"getPollErrorMessage");l(this,"deletePollMessage");l(this,"deletePollErrorMessage");l(this,"createPollMessage");l(this,"createPollErrorMessage");l(this,"updatePollMessage");l(this,"updatePollErrorMessage");l(this,"uploadingImageMessage");l(this,"generateSignedInUrlErrorMessage");l(this,"uploadingImageErrorMessage");l(this,"encryptingImageErrorMessage");l(this,"searchSportal365ImagesErrorMessage");l(this,"managePollTitle");l(this,"managePollDescription");l(this,"addOption");l(this,"removeOption");l(this,"urlCopiedToClipboardMessage");l(this,"imageDeletedMessage");l(this,"imageResetMessage");l(this,"authRequirement");l(this,"authRequirementDescription");l(this,"free");l(this,"lead");l(this,"registered");l(this,"optionDescriptionExplanation");l(this,"additionalFields");l(this,"addDescription");l(this,"addImages");l(this,"schedule");l(this,"scheduledTaskNotAvailable");l(this,"createScheduledTaskMessage");l(this,"createScheduledTaskErrorMessage");l(this,"updateScheduledTaskMessage");l(this,"updateScheduledTaskErrorMessage");l(this,"deleteScheduledTaskMessage");l(this,"deleteScheduledTaskErrorMessage");l(this,"name");l(this,"changeStatusTo");l(this,"at");l(this,"deleteScheduledTaskModalTitle");l(this,"deleteScheduledTaskModalParagraph");l(this,"languagesModalTitle");l(this,"languagesModalDescription");l(this,"languagesModalSave");l(this,"languageParentText");l(this,"pollTranslationErrorMessage");l(this,"translateTo");l(this,"additionalInformation");l(this,"voting");l(this,"reports");l(this,"option");l(this,"exports");l(this,"exportUsersData");l(this,"category");l(this,"action");l(this,"exportAllUsers");l(this,"exportAllUsersDescription");l(this,"usersExportMessage");l(this,"usersExportErrorMessage");l(this,"participations");l(this,"performanceByDay");l(this,"exportUsersForOption");l(this,"exportAllUsersForOption");l(this,"exportForOption");this.userNotFound=e&&e.userNotFound?e.userNotFound:"User not found. Please try again",this.clientFeaturesNotFoundMessage=(e==null?void 0:e.clientFeaturesNotFoundMessage)||"There was a problem fetching client's configuration. Please check again your API key and client ID. For more information contact Fans United staff.",this.featureDisabled=e&&e.featureDisabled?e.featureDisabled:"Feature disabled!",this.noPermissionMessage=e&&e.noPermissionMessage?e.noPermissionMessage:"You have no permission for this feature!",this.tryAgainButton=e&&e.tryAgainButton?e.tryAgainButton:"Try again",this.signOut=e&&e.signOut?e.signOut:"Sign out",this.noPollsFound=e&&e.noPollsFound?e.noPollsFound:"No polls games were found. You can create one by clicking the button 'Create'",this.timeFormat=e&&e.timeFormat?e.timeFormat:"DD.MM.YYYY, HH:mm",this.getPollsErrorMessage=e&&e.getPollsErrorMessage?e.getPollsErrorMessage:"There was a problem with fetching list of polls",this.title=e&&e.title?e.title:"Title",this.status=e&&e.status?e.status:"Status",this.votes=(e==null?void 0:e.votes)||"Votes",this.creationDate=e&&e.creationDate?e.creationDate:"Created at",this.actions=e&&e.actions?e.actions:"Actions",this.pageNo=e&&e.pageNo?e.pageNo:"Page No",this.back=e&&e.back?e.back:"Back",this.create=e&&e.create?e.create:"Create",this.edit=e&&e.edit?e.edit:"Edit",this.save=e&&e.save?e.save:"Save",this.preview=e&&e.preview?e.preview:"Preview",this.close=e&&e.close?e.close:"Close",this.sortBy=(e==null?void 0:e.sortBy)||"Sort by:",this.sortByAscending=(e==null?void 0:e.sortByAscending)||"Sort by created at field in ascending order",this.sortByDescending=(e==null?void 0:e.sortByDescending)||"Sort by created at field in descending order",this.language=(e==null?void 0:e.language)||"Language",this.languageDescription=(e==null?void 0:e.languageDescription)||"Select the language for your Poll. You can manage language selection by configuring available languages in language configuration. It cannot be changed if multilingual feature is in use.",this.contextEntityTag=(e==null?void 0:e.contextEntityTag)||"Context entity tag",this.typeContextTagNamePlaceholder=(e==null?void 0:e.typeContextTagNamePlaceholder)||"Type context tag name...",this.itemsPerPage=(e==null?void 0:e.itemsPerPage)||"Items per page",this.showMoreImages=(e==null?void 0:e.showMoreImages)||"Show more images",this.hideMoreImages=(e==null?void 0:e.hideMoreImages)||"Hide more images",this.uploadImage=(e==null?void 0:e.uploadImage)||"Upload image",this.copyUrl=(e==null?void 0:e.copyUrl)||"Copy URL",this.add=(e==null?void 0:e.add)||"Add",this.configuration=(e==null?void 0:e.configuration)||"Configuration",this.minimumVotes=(e==null?void 0:e.minimumVotes)||"Minimum votes",this.alternativeTitle=e&&e.alternativeTitle?e.alternativeTitle:"Alternative title",this.description=e&&e.description?e.description:"Description",this.images=e&&e.images?e.images:"Images",this.branding=(e==null?void 0:e.branding)||"Branding",this.urls=(e==null?void 0:e.urls)||"URLs",this.primaryUrl=(e==null?void 0:e.primaryUrl)||"Primary URL",this.secondaryUrl=(e==null?void 0:e.secondaryUrl)||"Secondary URL",this.privacyPolicyUrl=(e==null?void 0:e.privacyPolicyUrl)||"Privacy Policy URL",this.termsAndConditionsUrl=(e==null?void 0:e.termsAndConditionsUrl)||"Terms and Conditions URL",this.additionalUrl=(e==null?void 0:e.additionalUrl)||"Additional URL",this.colors=(e==null?void 0:e.colors)||"Colors",this.primaryColor=(e==null?void 0:e.primaryColor)||"Primary Color",this.secondaryColor=(e==null?void 0:e.secondaryColor)||"Secondary Color",this.contentColor=(e==null?void 0:e.contentColor)||"Content Color",this.backgroundColor=(e==null?void 0:e.backgroundColor)||"Background Color",this.borderColor=(e==null?void 0:e.borderColor)||"Border Color",this.additionalColor=(e==null?void 0:e.additionalColor)||"Additional Color",this.mainLogo=(e==null?void 0:e.mainLogo)||"Main Logo",this.mobileLogo=(e==null?void 0:e.mobileLogo)||"Mobile Logo",this.backgroundImage=(e==null?void 0:e.backgroundImage)||"Background Image",this.mobileBackgroundImage=(e==null?void 0:e.mobileBackgroundImage)||"Mobile Background Image",this.additionalImage=(e==null?void 0:e.additionalImage)||"Additional Image",this.embedCode=(e==null?void 0:e.embedCode)||"Embed Code",this.embedCodePlaceholder=(e==null?void 0:e.embedCodePlaceholder)||"Place your embed code here",this.rules=e&&e.rules?e.rules:"Rules",this.adContent=e&&e.adContent?e.adContent:"Ad content",this.adContentPlaceholder=e&&e.adContentPlaceholder?e.adContentPlaceholder:"Place your ad content",this.mainImage=e&&e.mainImage?e.mainImage:"Main",this.coverImage=e&&e.coverImage?e.coverImage:"Cover",this.mobileImage=e&&e.mobileImage?e.mobileImage:"Mobile",this.active=e&&e.active?e.active:"Active",this.inactive=e&&e.inactive?e.inactive:"Inactive",this.expired=e&&e.expired?e.expired:"Expired",this.optionsDescription=(e==null?void 0:e.optionsDescription)||"Describe the options that users will select from the poll. Ensure to provide a minimum of 2 options. Title for each is required",this.repeatedValueMessage=e&&e.repeatedValueMessage?e.repeatedValueMessage:"You have entered a repeated value. Please enter a different one.",this.flags=e&&e.flags?e.flags:"Flags",this.flagsPlaceholder=e&&e.flagsPlaceholder?e.flagsPlaceholder:"Type your flag and hit enter",this.labels=e&&e.labels?e.labels:"Labels",this.customFields=e&&e.customFields?e.customFields:"Custom fields",this.keyDynamicFields=e&&e.keyDynamicFields?e.keyDynamicFields:"Key",this.valueDynamicFields=e&&e.valueDynamicFields?e.valueDynamicFields:"Value",this.options=e&&e.options?e.options:"Options",this.optionNumber=e&&e.optionNumber?e.optionNumber:"Option number",this.context=e&&e.context?e.context:"Context",this.content=e&&e.content?e.content:"Content",this.tags=e&&e.tags?e.tags:"Tags",this.campaign=e&&e.campaign?e.campaign:"Campaign",this.id=e&&e.id?e.id:"ID",this.label=e&&e.label?e.label:"Label",this.type=e&&e.type?e.type:"Type",this.typeDescription=e&&e.typeDescription?e.typeDescription:"Select the poll type. You can set the types in our Management Portal by going to Features, then clicking on the Poll page",this.previewPoll=e&&e.previewPoll?e.previewPoll:"Preview poll",this.deletePollTitle=(e==null?void 0:e.deletePollTitle)||"Delete Poll",this.deletePollDescription=(e==null?void 0:e.deletePollDescription)||"Are you sure you want to delete",this.deleteLabel=e&&e.deleteLabel?e.deleteLabel:"Delete",this.hideFilters=e&&e.hideFilters?e.hideFilters:"Hide filters",this.showFilters=e&&e.showFilters?e.showFilters:"Show filters",this.previous=e&&e.previous?e.previous:"Previous",this.next=e&&e.next?e.next:"Next",this.clear=e&&e.clear?e.clear:"Clear",this.getFootballEntitiesErrorMessage=e&&e.getFootballEntitiesErrorMessage?e.getFootballEntitiesErrorMessage:"There was a problem with fetching football's data",this.createPollMessage=e&&e.createPollMessage?e.createPollMessage:"You have successfully created poll",this.createPollErrorMessage=e&&e.createPollErrorMessage?e.createPollErrorMessage:"There was a problem creating poll. Please try again",this.titleRequiredFieldValidationMessage=e&&e.titleRequiredFieldValidationMessage?e.titleRequiredFieldValidationMessage:"Title field is required!",this.optionsFieldValidationMessage=(e==null?void 0:e.optionsFieldValidationMessage)||"Options must have titles",this.tagsInvalidFieldValidationMessage=e&&e.tagsInvalidFieldValidationMessage?e.tagsInvalidFieldValidationMessage:"Tag entity is required!",this.getPollErrorMessage=e&&e.getPollErrorMessage?e.getPollErrorMessage:"There was a problem with fetching poll data. Please try again",this.deletePollMessage=e&&e.deletePollMessage?e.deletePollMessage:"You have successfully deleted poll",this.deletePollErrorMessage=e&&e.deletePollErrorMessage?e.deletePollErrorMessage:"There was a problem with deleting poll. Please try again",this.updatePollMessage=e&&e.updatePollMessage?e.updatePollMessage:"You have successfully updated the poll",this.updatePollErrorMessage=e&&e.updatePollErrorMessage?e.updatePollErrorMessage:"There was a problem updating the poll. Please try again",this.uploadingImageMessage=e&&e.uploadingImageMessage?e.uploadingImageMessage:"You have successfully uploaded image",this.generateSignedInUrlErrorMessage=e&&e.generateSignedInUrlErrorMessage?e.generateSignedInUrlErrorMessage:"There was a problem generating signed in URL to store the image in bucket. Please try again",this.uploadingImageErrorMessage=e&&e.uploadingImageErrorMessage?e.uploadingImageErrorMessage:"There was a problem with uploading image to bucket. Please try again",this.encryptingImageErrorMessage=e&&e.encryptingImageErrorMessage?e.encryptingImageErrorMessage:"There was a problem with encrypting image before uploading it to bucket. Please try again",this.searchSportal365ImagesErrorMessage=e&&e.searchSportal365ImagesErrorMessage?e.searchSportal365ImagesErrorMessage:"There was a problem with searching images from Sportal 365 API. Please try again",this.managePollTitle=(e==null?void 0:e.managePollTitle)||"Manage Poll",this.managePollDescription=(e==null?void 0:e.managePollDescription)||"Manage your Poll here",this.addOption=(e==null?void 0:e.addOption)||"Add option",this.removeOption=(e==null?void 0:e.removeOption)||"Remove option",this.clearImage=(e==null?void 0:e.clearImage)||"Clear image",this.viewImage=(e==null?void 0:e.viewImage)||"View image",this.cropImage=(e==null?void 0:e.cropImage)||"Crop image",this.urlCopiedToClipboardMessage=(e==null?void 0:e.urlCopiedToClipboardMessage)||"URL copied to clipboard",this.imageDeletedMessage=(e==null?void 0:e.imageDeletedMessage)||"Image deleted",this.imageResetMessage=(e==null?void 0:e.imageResetMessage)||"The initial size of the image has been restored",this.aspectRatio=(e==null?void 0:e.aspectRatio)||"Aspect ratio",this.crop=(e==null?void 0:e.crop)||"Crop",this.reset=(e==null?void 0:e.reset)||"Reset",this.sportal365Images=(e==null?void 0:e.sportal365Images)||"Sportal365 Images",this.search=(e==null?void 0:e.search)||"Search",this.delete=(e==null?void 0:e.delete)||"Delete",this.fromDate=(e==null?void 0:e.fromDate)||"From Date",this.toDate=(e==null?void 0:e.toDate)||"To Date",this.authRequirement=(e==null?void 0:e.authRequirement)||"Auth Requirement",this.authRequirementDescription=(e==null?void 0:e.authRequirementDescription)||"Choose the type of authentication to be used.",this.free=(e==null?void 0:e.free)||"Free",this.lead=(e==null?void 0:e.lead)||"Lead",this.registered=(e==null?void 0:e.registered)||"Registered",this.optionDescriptionExplanation=(e==null?void 0:e.optionDescriptionExplanation)||"This optional field allows you to provide users with more information about the option",this.additionalFields=(e==null?void 0:e.additionalFields)||"Additional fields",this.addDescription=(e==null?void 0:e.addDescription)||"Add description",this.addImages=(e==null?void 0:e.addImages)||"Add images",this.schedule=(e==null?void 0:e.schedule)||"Schedule",this.scheduledTaskNotAvailable=(e==null?void 0:e.scheduledTaskNotAvailable)||"To configure scheduled tasks you need to first create your poll",this.createScheduledTaskMessage=(e==null?void 0:e.createScheduledTaskMessage)||"You have successfully created scheduled task",this.createScheduledTaskErrorMessage=(e==null?void 0:e.createScheduledTaskErrorMessage)||"An error occurred while creating scheduled task. Please try again later",this.updateScheduledTaskMessage=(e==null?void 0:e.updateScheduledTaskMessage)||"You have successfully updated scheduled task",this.updateScheduledTaskErrorMessage=(e==null?void 0:e.updateScheduledTaskErrorMessage)||"An error occurred while updating scheduled task. Please try again later",this.deleteScheduledTaskMessage=(e==null?void 0:e.deleteScheduledTaskMessage)||"You have successfully deleted scheduled task",this.deleteScheduledTaskErrorMessage=(e==null?void 0:e.deleteScheduledTaskErrorMessage)||"An error occurred while deleting scheduled task. Please try again later",this.name=(e==null?void 0:e.name)||"Name",this.changeStatusTo=(e==null?void 0:e.changeStatusTo)||"Change status to:",this.at=(e==null?void 0:e.at)||"At:",this.deleteScheduledTaskModalTitle=(e==null?void 0:e.deleteScheduledTaskModalTitle)||"Delete scheduled task",this.deleteScheduledTaskModalParagraph=(e==null?void 0:e.deleteScheduledTaskModalParagraph)||"Are you sure you want to delete the following scheduled task: ",this.languagesModalTitle=(e==null?void 0:e.languagesModalTitle)||"Select Languages",this.languagesModalDescription=(e==null?void 0:e.languagesModalDescription)||"Select the languages this poll is going to be translated in.",this.languagesModalSave=(e==null?void 0:e.languagesModalSave)||"Save language preference",this.pollTranslationErrorMessage=(e==null?void 0:e.pollTranslationErrorMessage)||"An error occurred while translating the poll.",this.languageParentText=(e==null?void 0:e.languageParentText)||"This poll is a translated version of",this.translateTo=(e==null?void 0:e.translateTo)||"Translate to _language_",this.additionalInformation=(e==null?void 0:e.additionalInformation)||"Additional information",this.voting=(e==null?void 0:e.voting)||"Voting",this.reports=(e==null?void 0:e.reports)||"Reports",this.option=(e==null?void 0:e.option)||"Option",this.exports=(e==null?void 0:e.exports)||"Exports",this.exportUsersData=(e==null?void 0:e.exportUsersData)||"Export users data",this.category=(e==null?void 0:e.category)||"Category",this.action=(e==null?void 0:e.action)||"Action",this.exportAllUsers=(e==null?void 0:e.exportAllUsers)||"Export all users",this.exportAllUsersDescription=(e==null?void 0:e.exportAllUsersDescription)||"Export all users who voted in the poll.",this.usersExportMessage=(e==null?void 0:e.usersExportMessage)||"Users have been exported successfully",this.usersExportErrorMessage=(e==null?void 0:e.usersExportErrorMessage)||"There was a problem with exporting users. Please try again",this.participations=(e==null?void 0:e.participations)||"Participations",this.performanceByDay=(e==null?void 0:e.performanceByDay)||"Performance by day",this.exportUsersForOption=(e==null?void 0:e.exportUsersForOption)||"Export users voted for option",this.exportAllUsersForOption=(e==null?void 0:e.exportAllUsersForOption)||"Export all users who voted for option",this.exportForOption=(e==null?void 0:e.exportForOption)||"Export for option"}}const Zt=G.createContext(null),q_e=({labels:t,children:e})=>{const n=new W_e(t);return L.jsx(Zt.Provider,{value:n,children:e})},Fo=G.createContext(null),G_e=({features:t,children:e})=>L.jsx(Fo.Provider,{value:t,children:e}),Y_e=({children:t})=>L.jsx(Ne,{width:"100%",sx:{backgroundColor:"#fff"},children:t});function $t(t){const e=G.useContext(t);if(e===void 0)throw new Error("Context was used outside of its Provider");return e}const K_e=t=>{const e=$t(Zt);return L.jsxs(Ne,{p:2,children:[L.jsx(Je,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:L.jsx(jre,{fontSize:"inherit"}),onClick:t.onClickBack,children:e.back}),L.jsx(Je,{level:"h3",children:e.managePollTitle}),L.jsx(na,{children:e.managePollDescription})]})};class cN{constructor(){l(this,"isValid",!0);l(this,"message","");l(this,"validate",(e,n)=>{this.validateRequiredFields(e,n),this.isValid&&(this.validateOptions(e.options,n),this.validateContext(e.context,n))});l(this,"validateRequiredFields",(e,n)=>{e.title||(this.isValid=!1,this.message=n.titleRequiredFieldValidationMessage)});l(this,"validateOptions",(e,n)=>{e.forEach(r=>{r.title||(this.isValid=!1,this.message=n.optionsFieldValidationMessage)})});l(this,"validateContext",(e,n)=>{e&&e.tags.forEach(r=>{r.id||(this.isValid=!1,this.message=n.tagsInvalidFieldValidationMessage)})})}}class J_e{constructor(){l(this,"id","");l(this,"title",null);l(this,"alternative_title",null);l(this,"description",null);l(this,"auth_requirement",null);l(this,"type",null);l(this,"language",null);l(this,"total_votes",null);l(this,"rules",null);l(this,"ad_content",null);l(this,"labels",null);l(this,"branding",null);l(this,"embed_code",null);l(this,"custom_fields",null);l(this,"images",null);l(this,"status","INACTIVE");l(this,"flags",[]);l(this,"context",null);l(this,"options",[]);l(this,"related",[])}}class p1{constructor(){l(this,"createNewRequestBody",e=>{if(!e){const n=new J_e;return n.options=this.constructEmptyCreateOptions(),n}return e.branding=this.reconstructBranding(le({},e.branding)),e.context=this.createContext(le({},e.context)),le({},e)});l(this,"finalizeNewRequestBody",(e,n)=>(e.images&&(e.images=this.reconstructImages(le({},e.images))),e.branding&&(e.branding=this.reconstructBranding(le({},e.branding))),e.context&&(e.context=this.reconstructContext(le({},e.context))),e.language=e.language||n.languageConfig.default_language,e.auth_requirement=e.auth_requirement||n.authRequirement,delete e.id,e));l(this,"reconstructImages",e=>this.isObjectValuesEmpty(e)?null:e);l(this,"reconstructBranding",e=>(e.urls||(e.urls={primary_url:"",secondary_url:"",privacy_policy_url:"",terms_and_conditions_url:"",additional_url:""}),e.colors||(e.colors={primary_color:"",secondary_color:"",content_color:"",background_color:"",border_color:"",additional_color:""}),e.images||(e.images={main_logo:"",mobile_logo:"",background_image:"",mobile_background_image:"",additional_image:""}),e));l(this,"reconstructContext",e=>(e.content&&this.isObjectValuesEmpty(e.content)&&(e.content=null),e.tags=e.tags.filter(n=>n.id),e.campaign&&this.isObjectValuesEmpty(e.campaign)&&(e.campaign=null),!e.content&&!e.tags.length&&!e.campaign?null:e));l(this,"createImagesModel",()=>({main:"",cover:"",mobile:""}));l(this,"createContext",e=>e?(e.content||(e.content={id:"",label:"",type:""}),e.tags||(e.tags=[]),e.campaign||(e.campaign={id:"",label:""}),e):{content:{id:"",label:"",type:""},tags:[],campaign:{id:"",label:""}});l(this,"isObjectValuesEmpty",e=>Object.values(e).every(n=>!n));l(this,"constructOptions",e=>e&&e.length?(e.forEach(n=>{n.images||(n.images=this.createImagesModel())}),Array.from(e)):this.constructEmptyCreateOptions());l(this,"constructEmptyCreateOptions",()=>{const e=[];for(let r=0;r<2;r++)e.push({title:"",description:"",images:this.createImagesModel()});return e});l(this,"constructEmptyOption",e=>({id:e,title:"",description:"",images:this.createImagesModel(),votes:0}))}}const gg=t=>(t==null?void 0:t.main)||(t==null?void 0:t.cover)||(t==null?void 0:t.mobile),Q_e=({isOpen:t,requestBody:e,handleClose:n})=>{const r=$t(Zt);return L.jsx(gl,{open:t,onClose:n,children:L.jsxs(vl,{children:[L.jsxs(ml,{children:[L.jsx(Hre,{}),r.previewPoll]}),L.jsx(vo,{}),L.jsxs(hl,{children:[L.jsx(Je,{fontWeight:"500",mb:1,children:e.title}),L.jsx(Qp,{variant:"plain",sx:{mb:1},children:gg(e.images)?L.jsx("img",{src:gg(e.images),alt:"main-image"}):L.jsx(MO,{})}),L.jsx(Je,{mb:1,children:L.jsx("article",{dangerouslySetInnerHTML:{__html:e.description}})}),L.jsx(vo,{sx:{mb:1}}),e.options.map((i,a)=>L.jsx(si,{sx:{mb:1},children:L.jsx(ta,{children:L.jsxs(us,{direction:"row",spacing:2,children:[L.jsx(Qp,{variant:"plain",sx:{minWidth:200},children:gg(i.images)?L.jsx("img",{src:gg(i.images),alt:`option-${a}-image`}):L.jsx(MO,{})}),L.jsxs(us,{children:[L.jsxs(Je,{level:"title-md",alignContent:"center",children:[a+1,". ",i.title]}),L.jsx(Je,{level:"body-md",alignContent:"center",children:L.jsx("article",{dangerouslySetInnerHTML:{__html:i.description}})})]})]})})},a))]}),L.jsx(Pu,{children:L.jsx(yt,{variant:"plain",color:"neutral",onClick:i=>{i.stopPropagation(),n()},children:r.close})})]})})},X_e={colors:{primary_color:"",secondary_color:"",content_color:"",background_color:"",border_color:"",additional_color:""},urls:{primary_url:"",secondary_url:"",privacy_policy_url:"",terms_and_conditions_url:"",additional_url:""},images:{main_logo:"",mobile_logo:"",background_image:"",mobile_background_image:"",additional_image:""}},pt={ar:{key:"ar",name:"Arabic"},bg:{key:"bg",name:"Bulgarian"},da:{key:"da",name:"Danish"},de:{key:"de",name:"German"},en:{key:"en",name:"English"},el:{key:"el",name:"Greek"},es:{key:"es",name:"Spanish"},fr:{key:"fr",name:"French"},hu:{key:"hu",name:"Hungarian"},it:{key:"it",name:"Italian"},nl:{key:"nl",name:"Dutch"},pt:{key:"pt",name:"Portuguese"},"pt-br":{key:"pt-br",name:"Brazilian(Portuguese)"},ro:{key:"ro",name:"Romanian"},sk:{key:"sk",name:"Slovak"},sr:{key:"sr",name:"Serbian"},sv:{key:"sv",name:"Swedish"},sw:{key:"sw",name:"Swahili"}},vg={ar:pt.ar,"ar-dz":pt.ar,"ar-bh":pt.ar,"ar-eg":pt.ar,"ar-iq":pt.ar,"ar-jo":pt.ar,"ar-kw":pt.ar,"ar-lb":pt.ar,"ar-ly":pt.ar,"ar-ma":pt.ar,"ar-om":pt.ar,"ar-qa":pt.ar,"ar-sa":pt.ar,"ar-sy":pt.ar,"ar-tn":pt.ar,"ar-ae":pt.ar,"ar-ye":pt.ar,bg:pt.bg,da:pt.da,de:pt.de,en:pt.en,"en-gb":pt.en,"en-us":pt.en,el:pt.el,es:pt.es,fr:pt.fr,hu:pt.hu,it:pt.it,nl:pt.nl,pt:pt.pt,"pt-br":pt["pt-br"],ro:pt.ro,sk:pt.sk,sr:pt.sr,sv:pt.sv,sw:pt.sw};var Ps=(t=>(t.SHOW_DESCRIPTION="show_description",t.SHOW_IMAGES="show_images",t))(Ps||{});const Z_e=[10,15,20,25,50],eke=t=>{const e=$t(Zt),{RichText:n,Images:r}=Nn.useComponentContext(),i=o=>{t.option.images=o,t.onChange(t.option)},a=o=>{t.option.description=o};if(t.field===Ps.SHOW_IMAGES)return L.jsx(r,{labels:e,defaultValue:t.option.images,onChange:i});if(t.field===Ps.SHOW_DESCRIPTION)return L.jsx(Ne,{mb:1,children:L.jsx(n,{label:e.description,property:"mini_games_explanation",defaultValue:t.option.description||"",placeholder:"",description:e.optionDescriptionExplanation,onChange:a})})},tke=(t,e)=>t?!e.title:!0,nke=t=>{const[e,n]=G.useState(tke(t.isEditMode,t.option)),r=$t(Zt),i=(o,s)=>{n(s)},a=o=>{o.persist(),t.option.title=o.target.value,t.onChange(t.option)};return L.jsxs(I0,{sx:{p:0,overflow:"hidden"},expanded:e,onChange:i,children:[L.jsx(P0,{variant:"soft",sx:{px:3},children:t.option.title||`${r.optionNumber}: ${t.optionNumber}`}),L.jsx(S0,{sx:{"& > div":{pb:0}},children:L.jsxs(si,{variant:"plain",sx:{borderRadius:0},children:[L.jsxs(ta,{children:[L.jsxs(Dt,{sx:{mb:1},children:[L.jsx(Bt,{required:!0,children:r.title}),L.jsx(ea,{size:"lg",name:"title",type:"text",value:t.option.title,onChange:a,required:!0})]}),t.additionalFields.map(o=>L.jsx(eke,{option:t.option,field:o,onChange:t.onChange},`option-id-${t.option.id?t.option.id:Math.random()}-field-${o}`))]}),L.jsxs(TE,{variant:"plain",children:[L.jsx(vo,{inset:"context"}),L.jsx(ta,{orientation:"horizontal",sx:{display:"flex",justifyContent:"flex-end"},children:L.jsx(yt,{startDecorator:L.jsx(px,{}),variant:"outlined",color:"danger",size:"sm",onClick:t.onDelete,disabled:t.disableDelete||t.isPollVoted,children:r.removeOption})})]})]})})]})},rke=({label:t,values:e,allValues:n,valuesMap:r,showAll:i,showAllLabel:a,onChange:o,toggleShowAll:s})=>{const c=(u,d)=>{u.persist();let f=[...e];if(u.target.checked){f.push(d),o(f);return}f=e.filter(p=>p!==d),o(f)};return L.jsxs(Ne,{sx:{my:2},children:[L.jsx(Je,{level:"body-xs",mb:1,fontWeight:"bold",children:t}),L.jsxs(_0,{orientation:"horizontal",wrap:!0,sx:{"--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(u=>L.jsxs(os,{children:[e.includes(u)&&L.jsx(Bre,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),L.jsx($0,{checked:e.includes(u),variant:e.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[u]||"N/A",onChange:d=>c(d,u),slotProps:{action:({checked:d})=>({sx:d?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${t}-${u}`)),i===!1?L.jsx(os,{children:L.jsx(Ou,{onClick:s,children:a})}):L.jsx(L.Fragment,{})]})]})},uN=new p1,ike=2,ake=t=>{const e=[];return t.some(n=>n.description)&&e.push(Ps.SHOW_DESCRIPTION),t.some(n=>n.images&&(n.images.main||n.images.mobile||n.images.cover))&&e.push(Ps.SHOW_IMAGES),e},oke=({isEditMode:t,isPollVoted:e,options:n,onChange:r})=>{const[i,a]=G.useState(ake(n)),o=$t(Zt),s=uN.constructOptions(n),c=()=>{const p=uN.constructEmptyOption(`${s.length+1}`);f([...s,p])},u=(p,h)=>{const g=Array.from(s);g[h]=p,f(g)},d=p=>{const h=s.filter(g=>g.id!==p);f(h)},f=p=>{r(p)};return L.jsxs(Ne,{mb:2,children:[L.jsxs(Ne,{mb:2,children:[L.jsxs(Dt,{children:[L.jsx(Bt,{color:"primary",children:o.options}),L.jsx(na,{children:o.optionsDescription})]}),L.jsx(rke,{label:o.additionalFields,values:i,allValues:[Ps.SHOW_DESCRIPTION,Ps.SHOW_IMAGES],valuesMap:{show_description:o.addDescription,show_images:o.addImages},onChange:p=>a(p)}),L.jsx(Ne,{my:2,flex:"flex",alignItems:"center",children:L.jsx(yt,{variant:"outlined",onClick:c,startDecorator:L.jsx(Nre,{}),sx:{mr:2},children:o.addOption})})]}),L.jsx(k0,{variant:"outlined",sx:{borderRadius:"5px"},children:s.map((p,h)=>L.jsx(nke,{option:p,optionNumber:h+1,isEditMode:t,isPollVoted:e,additionalFields:i,disableDelete:s.length<=ike,onDelete:()=>d(p.id),onChange:g=>u(g,h)},p.id))})]})},ske=({isEditMode:t,requestBody:e,onRequestBodyUpdate:n,parentTitle:r,onParentSelect:i})=>{const a=$t(Zt),{InformationInput:o,RichText:s}=Nn.useComponentContext(),c=p=>{p.persist();const h=p.target.value?p.target.value:null;n(je(le({},e),{title:h}))},u=p=>{p.persist();const h=p.target.value?p.target.value:null;n(je(le({},e),{alternative_title:h}))},d=p=>{n(je(le({},e),{description:p}))},f=p=>{n(je(le({},e),{options:p}))};return L.jsxs(Ne,{sx:{width:{xs:"100%",sm:"70%"}},mr:{sm:2},children:[r&&L.jsx(DK,{variant:"outlined",color:"primary",startDecorator:L.jsx(zre,{}),sx:{mb:2,cursor:"pointer"},onClick:i,children:`${a.languageParentText} "${r}"`}),L.jsx(o,{label:a.title,placeholder:"",defaultValue:e.title||"",value:e.title||"",required:!0,onChange:c}),L.jsx(o,{label:a.alternativeTitle,placeholder:"",defaultValue:e.alternative_title||"",value:e.alternative_title||"",required:!1,onChange:u}),L.jsx(s,{label:a.description,placeholder:"",property:"description",value:e.description,defaultValue:e.description,onChange:d}),L.jsx(oke,{isEditMode:t,isPollVoted:e.total_votes>0,options:e.options,onChange:f})]})},lke=t=>{const e=$t(Zt),n={ACTIVE:e.active,INACTIVE:e.inactive,EXPIRED:e.expired},r=(i,a)=>{t.onChange(a||"")};return L.jsxs(Dt,{size:"sm",sx:{mb:2},children:[L.jsx(Bt,{color:"primary",children:e.status}),L.jsx(hr,{value:t.defaultValue,onChange:r,sx:{minHeight:"37px"},children:Object.keys(n).map((i,a)=>L.jsx(Hn,{value:i,children:n[i]},`status-select-${i}-${a}`))})]})},cke=({defaultValue:t,onChange:e})=>{const{types:n}=$t(Fo),r=$t(Zt),i=G.useRef(null);return L.jsxs(Dt,{size:"sm",sx:{mb:2},children:[L.jsx(Bt,{children:r.type}),L.jsx(hr,je(le({value:t,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,o)=>e(o),sx:{minHeight:"37px"}},t&&{endDecorator:L.jsx(Rn,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;e(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:L.jsx(fx,{})}),indicator:null}),{children:n.map(a=>L.jsx(Hn,{value:a.id,children:a.label},a.id))})),L.jsx(na,{children:r.typeDescription})]})},uke=t=>{const e=$t(Zt),n=$t(Fo),r=n.languageConfig.default_language?[n.languageConfig.default_language,...n.languageConfig.available_languages]:n.languageConfig.available_languages;return L.jsxs(Dt,{sx:{mb:2},children:[L.jsx(Bt,{children:e.language}),L.jsx(hr,{disabled:t.isReadOnly,value:t.isPollVoted?t.defaultValue:t.defaultValue||n.languageConfig.default_language,onChange:(i,a)=>t.onChange(a),children:r.map(i=>L.jsx(Hn,{value:i,children:pt[i].name},`language-select-${i}`))}),L.jsx(na,{children:e.languageDescription})]})},dke=t=>{var u;const e=$t(Zt),n=$t(Fo),{AuthRequirement:r}=Nn.useComponentContext(),i=(u=t.requestBody.related)==null?void 0:u.some(d=>d.entity_relationship==="translatedFrom"),a=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{status:d}))},o=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{type:d}))},s=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{language:d}))},c=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{auth_requirement:d}))};return L.jsxs(L.Fragment,{children:[t.requestBody.id?L.jsxs(Dt,{size:"sm",sx:{mb:2},children:[L.jsx(Bt,{color:"primary",children:e.id}),L.jsx(ea,{size:"md",readOnly:!0,variant:"outlined",color:"neutral",name:"id",value:t.requestBody.id,sx:{opacity:.5,borderRadius:"md"}})]}):L.jsx(L.Fragment,{}),L.jsx(lke,{defaultValue:t.requestBody.status||"INACTIVE",onChange:a}),L.jsx(uke,{isReadOnly:t.isMultilingual||i,isPollVoted:t.isPollVoted,defaultValue:t.requestBody.language,onChange:s}),L.jsx(cke,{defaultValue:t.requestBody.type,onChange:o}),L.jsx(r,{defaultValue:t.requestBody.auth_requirement||n.authRequirement,onChange:c,labels:e})]})},fke=new p1,pke=t=>{const e=$t(Zt),{RichText:n,Accordion:r,DynamicFields:i,Branding:a,Images:o,Flags:s,EntityContext:c,Schedule:u}=Nn.useComponentContext(),d=y=>{y.persist(),t.onRequestBodyUpdate(je(le({},t.requestBody),{ad_content:y.target.value||null}))},f=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{branding:y}))},p=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{context:y}))},h=y=>{y=Object.keys(y).length?y:null,t.onRequestBodyUpdate(je(le({},t.requestBody),{custom_fields:y}))},g=y=>{y.persist(),t.onRequestBodyUpdate(je(le({},t.requestBody),{embed_code:y.target.value||null}))},m=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{flags:y.length?y:null}))},v=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{images:y}))},b=y=>{y=Object.keys(y).length?y:null,t.onRequestBodyUpdate(je(le({},t.requestBody),{labels:y}))},x=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{rules:y||null}))};return L.jsxs(Ne,{sx:{width:{xs:"100%",sm:"30%"}},children:[L.jsx(r,{label:e.adContent,children:L.jsx(W0,{value:t.requestBody.ad_content,minRows:"7",onChange:d,placeholder:e.adContentPlaceholder,sx:{marginBottom:"16px",resize:"vertical",backgroundColor:"#fff","&::before":{border:"1.5px solid var(--Textarea-focusedHighlight)",transform:"scaleX(0)",left:"2.5px",right:"2.5px",bottom:0,top:"unset",transition:"transform .15s cubic-bezier(0.1,0.9,0.2,1)",borderRadius:0,borderBottomLeftRadius:"64px 20px",borderBottomRightRadius:"64px 20px"},"&:focus-within::before":{transform:"scaleX(1)"}}})}),L.jsx(r,{label:e.branding,children:L.jsx(a,{labels:e,defaultValue:t.requestBody.branding||le({},X_e),onChange:f})}),L.jsx(r,{label:e.configuration,children:L.jsx(dke,{requestBody:t.requestBody,isMultilingual:t.isMultilingual,isPollVoted:t.isPollVoted,onRequestBodyUpdate:t.onRequestBodyUpdate})}),L.jsx(r,{label:e.context,children:L.jsx(c,{labels:e,context:t.requestBody.context||fke.createContext(null),onChange:p})}),L.jsx(r,{label:e.customFields,children:L.jsx(i,{labels:e,type:e.customFields,defaultValue:t.requestBody.custom_fields,onChange:h})}),L.jsx(r,{label:e.embedCode,children:L.jsx(W0,{value:t.requestBody.embed_code,minRows:"5",onChange:g,placeholder:e.embedCodePlaceholder,sx:{marginBottom:"16px",resize:"vertical",backgroundColor:"#fff","&::before":{border:"1.5px solid var(--Textarea-focusedHighlight)",transform:"scaleX(0)",left:"2.5px",right:"2.5px",bottom:0,top:"unset",transition:"transform .15s cubic-bezier(0.1,0.9,0.2,1)",borderRadius:0,borderBottomLeftRadius:"64px 20px",borderBottomRightRadius:"64px 20px"},"&:focus-within::before":{transform:"scaleX(1)"}}})}),L.jsx(r,{label:e.flags,children:L.jsx(s,{labels:e,flags:t.requestBody.flags||[],onChange:m})}),L.jsx(r,{label:e.images,children:L.jsx(o,{labels:e,defaultValue:t.requestBody.images,onChange:v})}),L.jsx(r,{label:e.labels,children:L.jsx(i,{labels:e,type:e.labels,defaultValue:t.requestBody.labels,onChange:b})}),L.jsx(r,{label:e.rules,children:L.jsx(n,{property:"rules",defaultValue:t.requestBody.rules,onChange:x})}),L.jsx(r,{label:e.schedule,children:t.requestBody.id?L.jsx(u,{labels:e,entityId:t.requestBody.id,entityType:"POLL"}):L.jsx(Je,{children:e.scheduledTaskNotAvailable})})]})},hke=t=>{const[e,n]=G.useState([]),r=$t(Zt),i=$t(Fo);G.useEffect(()=>{n(t.languages)},[t.languages]);const a=()=>{t.onClose()},o=d=>{let f=[...e];e.includes(d)?f=f.filter(p=>p!==d):f.push(d),f.includes(t.mainLanguage)||f.unshift(t.mainLanguage),n(f)},s=()=>{t.onSubmit(e)},c=e.length!==t.languages.length||e.some(d=>!t.languages.includes(d)),u=[...i.languageConfig.available_languages,i.languageConfig.default_language].filter(d=>d!==t.mainLanguage);return L.jsx(L.Fragment,{children:L.jsx(gl,{onClick:d=>{d.stopPropagation()},open:t.isOpen,onClose:a,children:L.jsxs(vl,{sx:{width:500,minWidth:250,overflowY:"scroll"},children:[L.jsx(ml,{children:r.languagesModalTitle}),L.jsx(na,{children:r.languagesModalDescription}),L.jsxs(hl,{sx:{maxHeight:140,overflowY:"scroll",overflowX:"hidden"},children:[L.jsx($0,{sx:{my:.5,"& .MuiCheckbox-checkbox":{backgroundColor:"white","&:hover":{backgroundColor:"#f0f4f8"}},"& .MuiCheckbox-checkbox.Mui-checked":{backgroundColor:"#0066CC"}},disabled:!0,checked:!0,label:pt[t.mainLanguage].name},"default-language"),u.map(d=>L.jsx($0,{sx:{my:.5},checked:e.includes(d),label:pt[d].name,onChange:()=>o(d)},d))]}),L.jsxs(Pu,{children:[L.jsx(yt,{disabled:!c,loading:t.isLoadingTranslations,variant:"solid",color:"primary",onClick:s,children:r.languagesModalSave}),L.jsx(yt,{variant:"plain",color:"neutral",onClick:a,children:r.close})]})]})})})},mke=t=>L.jsx(V0,{"aria-label":"Languages",defaultValue:0,onChange:(e,n)=>t.onTabChange(Number(n)),children:L.jsxs(U0,{sx:{display:"flex",justifyContent:"space-between"},children:[L.jsx(Ne,{sx:{display:"flex"},children:t.languages.map(e=>e&&L.jsx(yl,{disableIndicator:!0,children:pt[e].name},e))}),L.jsx(yt,{variant:"plain",color:"neutral",onClick:t.onLanguageButtonClick,children:L.jsx($O,{})})]})}),yc="###",dN=(t,e,n)=>j(this,null,function*(){let i="https://translation.googleapis.com/language/translate/v2?key=undefined";return i+="&q="+encodeURIComponent(t),i+=`&target=${vg[e].key||"en"}`,n&&(i+=`&source=${n}`),i+="&format=text",yield fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(o=>o.json())}),gke=(t,e,n=null)=>j(this,null,function*(){let r=[],i=[];return t.forEach(a=>{let o=a.title+(a.description?yc+a.description:"");const s=dN(o,e,n).then(c=>{const d=c.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(yc);r.push(je(le({},a),{title:d[0],description:a.description?d[1]:null}))});i.push(s)}),yield Promise.all(i),r}),fN=(t,e,n=null)=>j(this,null,function*(){let r=[],i=[];return t.forEach(a=>{let o=a.title?a.title:"";o+=yc+(a.alternative_title?a.alternative_title:" "),o+=yc+(a.description?a.description:" "),o+=yc+(a.rules?a.rules:" ");const s=dN(o,e,n),c=gke(a.options,e,n);i.push(Promise.all([s,c]).then(([u,d])=>{const p=u.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(yc);r.push(je(le({},a),{title:p[0],alternative_title:a.alternative_title?p[1]:null,description:a.description?p[2]:null,rules:a.rules?p[3]:null,options:d}))}))}),yield Promise.all(i),r}),Es=new p1,vke=({pollById:t,relatedPolls:e,relatedParentTitle:n,setPollById:r,onClickBack:i,loadParent:a})=>{const[o,s]=G.useState(Es.createNewRequestBody(t)),[c,u]=G.useState(!1),[d,f]=G.useState(!1),[p,h]=G.useState(!1),[g,m]=G.useState(!1),[v,b]=G.useState([]),[x,y]=G.useState(!1),[C,w]=G.useState(null),[I,_]=G.useState({}),[T,O]=G.useState([]),[A,k]=G.useState(!1),[S,E]=G.useState(!1),[M,R]=G.useState(""),[F,B]=G.useState("danger"),{https:H}=Nn.useAPIContext(),{Toast:V}=Nn.useComponentContext(),U=$t(Zt),D=$t(Fo),z=!!t,W=(t==null?void 0:t.total_votes)>0,q=v.length>1,X=q&&I[C]?I[C]:o,K=(me,ve)=>{E(!0),R(ve),B(me)};G.useEffect(()=>{t&&s(t)},[t]),G.useEffect(()=>{if((e==null?void 0:e.length)>0){b([t.language,...e.map(ve=>ve.language)]);let me={};e.forEach(ve=>{me[ve.language]=Es.createNewRequestBody(ve)}),me[t.language]=t,_(me),w(t.language)}},[e]);const Q=me=>{w(v[me])},Y=me=>j(this,null,function*(){k(!0);const ve={},he={},ie=[];me.forEach(de=>{if(v.includes(de))ve[de]=I[de];else{const be=je(le({},X),{language:de,status:D.languageConfig.translation_rules[de].game_status||"INACTIVE"});(!z||z&&de!==o.language)&&delete be.id,he[de]=be}}),v.filter(de=>!me.includes(de)).map(de=>{I[de].id&&ie.push(je(le({},I[de]),{status:"INACTIVE"}))}),O(ie),b(me),w((t==null?void 0:t.language)||D.languageConfig.default_language);const se=[];Object.keys(he).forEach(de=>{se.push(fN([he[de]],de).then(be=>{he[de]=je(le({},he[de]),{title:be[0].title,alternative_title:be[0].alternative_title,description:be[0].description,options:be[0].options,rules:be[0].rules})}).catch(()=>{K("danger",U.pollTranslationErrorMessage),k(!1)}))}),Promise.all(se).then(()=>{_(le(le({},ve),he)),w((t==null?void 0:t.language)||D.languageConfig.default_language),k(!1),y(!1)}).catch(()=>{K("danger",U.pollTranslationErrorMessage),k(!1)})}),J=me=>{const ve=X.language||D.languageConfig.default_language;q&&me===C||!q&&me===ve?h(!0):f(!0),fN([X],me||vg[me].key).then(he=>{const ie=je(le({},X),{title:he[0].title,alternative_title:he[0].alternative_title,description:he[0].description,options:he[0].options,rules:he[0].rules});q?_(se=>je(le({},se),{[C]:ie})):s(ie),h(!1),f(!1)}).catch(()=>{K("danger",U.pollTranslationErrorMessage),h(!1),f(!1)})},Z=()=>j(this,null,function*(){q?ae():oe()}),oe=()=>j(this,null,function*(){const me=new cN;if(u(!0),me.validate(X,U),!me.isValid){K("danger",me.message),u(!1);return}const ve=[];T.forEach(se=>{ve.push(H.updatePoll(se.id,le({},se)).then(()=>H.deletePoll(se.id)))}),Promise.all(ve).then(()=>O([]));const he=Es.finalizeNewRequestBody(le({},X),D);let ie=null;if(z?ie=yield H.updatePoll(t.id,le({},he)):ie=yield H.createPoll(le({},he)),ie.ok){u(!1),K("success",z?U.updatePollMessage:U.createPollMessage);const se=yield ie.json();r(se.data)}else K("danger",z?U.updatePollErrorMessage:U.createPollErrorMessage),console.error(z?U.updatePollErrorMessage:U.createPollErrorMessage,yield ie.json()),u(!1)}),ae=()=>j(this,null,function*(){const me=new cN;u(!0);for(const de of Object.values(I))if(me.validate(de,U),!me.isValid){u(!1),K("danger",me.message),me.isValid=!0,me.message="";return}const ve=Object.values(I).filter(de=>de.language!==(z?t.language:D.languageConfig.default_language)),he=[];let ie=t;if(!z){const de=Es.finalizeNewRequestBody(le({},Object.values(I).filter(pe=>pe.language===D.languageConfig.default_language)[0]),D),be=yield H.createPoll(le({},de));if(be.ok)ie=(yield be.json()).data;else{u(!1),console.error(U.createPollErrorMessage,yield be.json()),K("danger",U.createPollErrorMessage);return}}T.forEach(de=>{he.push(H.updatePoll(de.id,le({},de)).then(()=>H.deletePoll(de.id)))});const se={};ve.forEach(de=>{const be=Es.finalizeNewRequestBody(le({},de),D);be.auth_requirement=de.auth_requirement||D.authRequirement,be.related=[{entity_type:"poll",entity_relationship:"translatedFrom",entity_id:ie.id}];const pe=de.id?H.updatePoll(de.id,le({},be)):H.createPoll(le({},be));he.push(pe.then(ke=>{if(ke.ok)return ke.json();throw new Error}).then(ke=>se[de.language]=ke.data))}),Promise.all(he).then(()=>{O([]);const de=z?le({},Object.values(I).filter(ke=>ke.id===t.id)[0]):ie,be=Es.finalizeNewRequestBody(le({},de),D),pe=Object.values(se).map(ke=>({entity_type:"poll",entity_relationship:"translatedTo",entity_id:ke.id}));be.related=pe,H.updatePoll((t==null?void 0:t.id)||ie.id,le({},be)).then(ke=>{if(ke.ok)return ke.json();throw new Error}).then(ke=>{r(ke.data),se[ke.data.language||D.languageConfig.default_language]=ke.data,Object.keys(se).forEach(Be=>se[Be]=Es.createNewRequestBody(se[Be])),_(le({},se)),u(!1),K("success",z?U.updatePollMessage:U.createPollMessage)})}).catch(de=>{console.log(de),u(!1),console.error(U.updatePollErrorMessage),K("danger",U.updatePollErrorMessage)})}),xe=me=>{q?_(ve=>je(le({},ve),{[C]:me})):s(me)},Pe=()=>{var me;if(z&&D.languageConfig.default_language){const ve=t.language||D.languageConfig.default_language,he=q?C:ve,ie=[...D.languageConfig.available_languages,D.languageConfig.default_language].filter(se=>se!==he);return he==="en"&&D.languageConfig.available_languages.length===0?void 0:L.jsxs(OQ,{sx:{mr:1},children:[L.jsx(yt,{onClick:()=>J(he),loading:p,children:U.translateTo.replace("_language_",vg[he].name)}),((me=D.languageConfig.available_languages)==null?void 0:me.length)>0&&L.jsxs(xP,{children:[L.jsx(ME,{slots:{root:Rn},loading:d,children:L.jsx($O,{})}),L.jsx(RE,{placement:"top",sx:{maxHeight:200},children:ie.map(se=>L.jsx(N0,{onClick:()=>J(se),children:vg[se].name},se))})]})]})}};return L.jsxs(L.Fragment,{children:[L.jsx(K_e,{onClickBack:i}),L.jsxs(si,{variant:"plain",children:[D.languageConfig.available_languages.length>0&&L.jsx(mke,{languages:q?v:[X.language||D.languageConfig.default_language],onTabChange:Q,onLanguageButtonClick:()=>y(!0)}),L.jsxs(us,{direction:{xs:"column",sm:"row"},children:[L.jsx(ske,{isEditMode:z,requestBody:X,onRequestBodyUpdate:xe,parentTitle:n,onParentSelect:a}),L.jsx(pke,{requestBody:X,onRequestBodyUpdate:xe,isPollVoted:W,isMultilingual:q})]}),L.jsxs(Ne,{display:"flex",flexDirection:"row",justifyContent:"center",my:3,children:[Pe(),L.jsx(yt,{variant:"outlined",color:"neutral",onClick:()=>m(!0),sx:{mr:1},children:U.preview}),L.jsx(yt,{variant:"solid",color:"primary",onClick:Z,loading:c,children:U.save})]})]}),L.jsx(Q_e,{isOpen:g,requestBody:X,handleClose:()=>m(!1)}),L.jsx(V,{showToast:S,color:F,message:M,hideToast:()=>E(!S)}),D.languageConfig.default_language&&L.jsx(hke,{isOpen:x,mainLanguage:(o==null?void 0:o.language)||D.languageConfig.default_language,languages:v,isLoadingTranslations:A,onSubmit:Y,onClose:()=>y(!1)})]})};class yke{constructor(){l(this,"sortOrder","DESC");l(this,"status","");l(this,"language","");l(this,"flags",[]);l(this,"entityIds",[]);l(this,"minVotes",0);l(this,"limit",20)}}const bke=({filters:t,options:e,setOptions:n,setFilters:r,handleResetData:i})=>{const a=$t(Zt),o=$t(Fo),{Flags:s,ContextSelectFilter:c,NumberInput:u,ItemsPerPageFilter:d}=Nn.useComponentContext(),f=G.useRef(null),p=(O,A)=>{r(k=>je(le({},k),{status:A}))},h=O=>{r(A=>je(le({},A),{minVotes:O}))},g=O=>{r(A=>je(le({},A),{flags:O}))},m=(O,A)=>{r(k=>je(le({},k),{language:A}))},v=(O,A)=>{const k=A;r(S=>je(le({},S),{sortOrder:k}))},b=(O,A)=>{r(k=>je(le({},k),{limit:A}))},x=()=>L.jsx(Ar,{xs:2,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.status}),L.jsxs(hr,je(le({value:t.status,size:"sm",placeholder:"Filter by status",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:p,sx:{minHeight:"37px"}},t.status&&{endDecorator:L.jsx(Rn,{variant:"plain",color:"neutral",onMouseDown:O=>{O.stopPropagation()},onClick:()=>{var O;r(A=>je(le({},A),{status:""})),(O=f.current)==null||O.focusVisible()},sx:{width:"18px",height:"18px"},children:L.jsx(fx,{})}),indicator:null}),{children:[L.jsx(Hn,{value:"ACTIVE",children:a.active}),L.jsx(Hn,{value:"INACTIVE",children:a.inactive}),L.jsx(Hn,{value:"EXPIRED",children:a.expired})]}))]})}),y=()=>{const O=o.languageConfig.default_language&&Array.isArray(o.languageConfig.available_languages)?[o.languageConfig.default_language,...o.languageConfig.available_languages]:[];return L.jsx(Ar,{xs:2.5,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.language}),L.jsx(hr,je(le({value:t.language,size:"sm",placeholder:"Filter by language",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:m,sx:{minHeight:"37px"}},t.language&&{endDecorator:L.jsx(Rn,{variant:"plain",color:"neutral",onMouseDown:A=>{A.stopPropagation()},onClick:()=>{var A;r(k=>je(le({},k),{language:""})),(A=f.current)==null||A.focusVisible()},sx:{width:"18px",height:"18px"},children:L.jsx(fx,{})}),indicator:null}),{children:O.map(A=>L.jsx(Hn,{value:A,children:pt[A].name},A))}))]})})},C=()=>L.jsx(Ar,{xs:1.5,children:L.jsx(Dt,{size:"sm",children:L.jsx(u,{sx:{minHeight:"37px"},label:a.minimumVotes,defaultValue:t.minVotes,onChange:h})})}),w=()=>L.jsx(Ar,{xs:2,children:L.jsx(d,{labels:a,value:t.limit,onChange:b,options:Z_e})}),I=()=>L.jsx(Ar,{xs:4,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.sortBy}),L.jsxs(hr,{value:t.sortOrder,size:"sm",onChange:v,sx:{minHeight:"37px"},children:[L.jsx(Hn,{value:"ASC",children:a.sortByAscending}),L.jsx(Hn,{value:"DESC",children:a.sortByDescending})]})]})}),_=()=>L.jsx(Ar,{xs:3,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.flags}),L.jsx(s,{labels:a,flags:t.flags,onChange:g})]})}),T=()=>L.jsx(Ar,{xs:4,children:L.jsx(Ne,{sx:{fontFamily:"sans-serif"},children:L.jsx(c,{labels:a,options:e,setOptions:n,setFilters:r,handleResetData:i})})});return L.jsx(Ne,{mb:2,children:L.jsxs(Ar,{container:!0,spacing:2,children:[x(),y(),C(),w(),I(),_(),T()]})})},xke=({children:t})=>L.jsx("section",{style:{marginRight:"auto",marginLeft:"auto",padding:"8px"},children:L.jsx(Ne,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:L.jsx(Ne,{width:"100%",children:t})})}),wke=t=>{const e=$t(Zt);return L.jsx("tfoot",{children:L.jsx("tr",{children:L.jsx("td",{colSpan:8,children:L.jsxs(Ne,{sx:{display:"flex",alignItems:"center",gap:2,justifyContent:"flex-end"},children:[L.jsxs(Je,{textAlign:"center",children:[e.pageNo," ",t.pageCount]}),L.jsxs(Ne,{sx:{display:"flex",gap:1},children:[L.jsx(Rn,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disablePreviousPage,onClick:t.goToPreviousPage,sx:{bgcolor:"background.surface"},children:L.jsx(Vre,{})}),L.jsx(Rn,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disableNextPage,onClick:t.goToNextPage,sx:{bgcolor:"background.surface"},children:L.jsx(Wre,{})})]})]})})})})};var yg={exports:{}},Cke=yg.exports,pN;function Ike(){return pN||(pN=1,function(t,e){(function(n,r){t.exports=r()})(Cke,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",o="second",s="minute",c="hour",u="day",d="week",f="month",p="quarter",h="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var R=["th","st","nd","rd"],F=M%100;return"["+M+(R[(F-20)%10]||R[F]||R[0])+"]"}},y=function(M,R,F){var B=String(M);return!B||B.length>=R?M:""+Array(R+1-B.length).join(F)+M},C={s:y,z:function(M){var R=-M.utcOffset(),F=Math.abs(R),B=Math.floor(F/60),H=F%60;return(R<=0?"+":"-")+y(B,2,"0")+":"+y(H,2,"0")},m:function M(R,F){if(R.date()<F.date())return-M(F,R);var B=12*(F.year()-R.year())+(F.month()-R.month()),H=R.clone().add(B,f),V=F-H<0,U=R.clone().add(B+(V?-1:1),f);return+(-(B+(F-H)/(V?H-U:U-H))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:f,y:h,w:d,d:u,D:g,h:c,m:s,s:o,ms:a,Q:p}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},w="en",I={};I[w]=x;var _="$isDayjsObject",T=function(M){return M instanceof S||!(!M||!M[_])},O=function M(R,F,B){var H;if(!R)return w;if(typeof R=="string"){var V=R.toLowerCase();I[V]&&(H=V),F&&(I[V]=F,H=V);var U=R.split("-");if(!H&&U.length>1)return M(U[0])}else{var D=R.name;I[D]=R,H=D}return!B&&H&&(w=H),H||!B&&w},A=function(M,R){if(T(M))return M.clone();var F=typeof R=="object"?R:{};return F.date=M,F.args=arguments,new S(F)},k=C;k.l=O,k.i=T,k.w=function(M,R){return A(M,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var S=function(){function M(F){this.$L=O(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var R=M.prototype;return R.parse=function(F){this.$d=function(B){var H=B.date,V=B.utc;if(H===null)return new Date(NaN);if(k.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var U=H.match(v);if(U){var D=U[2]-1||0,z=(U[7]||"0").substring(0,3);return V?new Date(Date.UTC(U[1],D,U[3]||1,U[4]||0,U[5]||0,U[6]||0,z)):new Date(U[1],D,U[3]||1,U[4]||0,U[5]||0,U[6]||0,z)}}return new Date(H)}(F),this.init()},R.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},R.$utils=function(){return k},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(F,B){var H=A(F);return this.startOf(B)<=H&&H<=this.endOf(B)},R.isAfter=function(F,B){return A(F)<this.startOf(B)},R.isBefore=function(F,B){return this.endOf(B)<A(F)},R.$g=function(F,B,H){return k.u(F)?this[B]:this.set(H,F)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(F,B){var H=this,V=!!k.u(B)||B,U=k.p(F),D=function(J,Z){var oe=k.w(H.$u?Date.UTC(H.$y,Z,J):new Date(H.$y,Z,J),H);return V?oe:oe.endOf(u)},z=function(J,Z){return k.w(H.toDate()[J].apply(H.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Z)),H)},W=this.$W,q=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(U){case h:return V?D(1,0):D(31,11);case f:return V?D(1,q):D(0,q+1);case d:var Q=this.$locale().weekStart||0,Y=(W<Q?W+7:W)-Q;return D(V?X-Y:X+(6-Y),q);case u:case g:return z(K+"Hours",0);case c:return z(K+"Minutes",1);case s:return z(K+"Seconds",2);case o:return z(K+"Milliseconds",3);default:return this.clone()}},R.endOf=function(F){return this.startOf(F,!1)},R.$set=function(F,B){var H,V=k.p(F),U="set"+(this.$u?"UTC":""),D=(H={},H[u]=U+"Date",H[g]=U+"Date",H[f]=U+"Month",H[h]=U+"FullYear",H[c]=U+"Hours",H[s]=U+"Minutes",H[o]=U+"Seconds",H[a]=U+"Milliseconds",H)[V],z=V===u?this.$D+(B-this.$W):B;if(V===f||V===h){var W=this.clone().set(g,1);W.$d[D](z),W.init(),this.$d=W.set(g,Math.min(this.$D,W.daysInMonth())).$d}else D&&this.$d[D](z);return this.init(),this},R.set=function(F,B){return this.clone().$set(F,B)},R.get=function(F){return this[k.p(F)]()},R.add=function(F,B){var H,V=this;F=Number(F);var U=k.p(B),D=function(q){var X=A(V);return k.w(X.date(X.date()+Math.round(q*F)),V)};if(U===f)return this.set(f,this.$M+F);if(U===h)return this.set(h,this.$y+F);if(U===u)return D(1);if(U===d)return D(7);var z=(H={},H[s]=r,H[c]=i,H[o]=n,H)[U]||1,W=this.$d.getTime()+F*z;return k.w(W,this)},R.subtract=function(F,B){return this.add(-1*F,B)},R.format=function(F){var B=this,H=this.$locale();if(!this.isValid())return H.invalidDate||m;var V=F||"YYYY-MM-DDTHH:mm:ssZ",U=k.z(this),D=this.$H,z=this.$m,W=this.$M,q=H.weekdays,X=H.months,K=H.meridiem,Q=function(Z,oe,ae,xe){return Z&&(Z[oe]||Z(B,V))||ae[oe].slice(0,xe)},Y=function(Z){return k.s(D%12||12,Z,"0")},J=K||function(Z,oe,ae){var xe=Z<12?"AM":"PM";return ae?xe.toLowerCase():xe};return V.replace(b,function(Z,oe){return oe||function(ae){switch(ae){case"YY":return String(B.$y).slice(-2);case"YYYY":return k.s(B.$y,4,"0");case"M":return W+1;case"MM":return k.s(W+1,2,"0");case"MMM":return Q(H.monthsShort,W,X,3);case"MMMM":return Q(X,W);case"D":return B.$D;case"DD":return k.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return Q(H.weekdaysMin,B.$W,q,2);case"ddd":return Q(H.weekdaysShort,B.$W,q,3);case"dddd":return q[B.$W];case"H":return String(D);case"HH":return k.s(D,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return J(D,z,!0);case"A":return J(D,z,!1);case"m":return String(z);case"mm":return k.s(z,2,"0");case"s":return String(B.$s);case"ss":return k.s(B.$s,2,"0");case"SSS":return k.s(B.$ms,3,"0");case"Z":return U}return null}(Z)||U.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(F,B,H){var V,U=this,D=k.p(B),z=A(F),W=(z.utcOffset()-this.utcOffset())*r,q=this-z,X=function(){return k.m(U,z)};switch(D){case h:V=X()/12;break;case f:V=X();break;case p:V=X()/3;break;case d:V=(q-W)/6048e5;break;case u:V=(q-W)/864e5;break;case c:V=q/i;break;case s:V=q/r;break;case o:V=q/n;break;default:V=q}return H?V:k.a(V)},R.daysInMonth=function(){return this.endOf(f).$D},R.$locale=function(){return I[this.$L]},R.locale=function(F,B){if(!F)return this.$L;var H=this.clone(),V=O(F,B,!0);return V&&(H.$L=V),H},R.clone=function(){return k.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},M}(),E=S.prototype;return A.prototype=E,[["$ms",a],["$s",o],["$m",s],["$H",c],["$W",u],["$M",f],["$y",h],["$D",g]].forEach(function(M){E[M[1]]=function(R){return this.$g(R,M[0],M[1])}}),A.extend=function(M,R){return M.$i||(M(R,S,A),M.$i=!0),A},A.locale=O,A.isDayjs=T,A.unix=function(M){return A(1e3*M)},A.en=I[w],A.Ls=I,A.p={},A})}(yg)),yg.exports}var Ske=Ike();const bg=Yo(Ske),_ke=t=>{const[e,n]=G.useState(!1),[r,i]=G.useState(!1),[a,o]=G.useState(""),[s,c]=G.useState("success"),{https:u}=Nn.useAPIContext(),{Toast:d}=Nn.useComponentContext(),f=$t(Zt),p=(m,v)=>{c(m),o(v),i(!0)},h=()=>{o(""),i(!1)},g=m=>j(this,null,function*(){if(m.stopPropagation(),n(!0),(yield u.deletePoll(t.poll.id)).ok){p("success",f.deletePollMessage),n(!1),t.onClose(m),t.onDelete();return}p("danger",f.deletePollErrorMessage),n(!1)});return L.jsxs(L.Fragment,{children:[L.jsx(gl,{open:t.isOpen,onClose:t.onClose,children:L.jsxs(vl,{children:[L.jsxs(ml,{children:[L.jsx(Yre,{}),f.deletePollTitle]}),L.jsx(vo,{}),L.jsx(hl,{children:L.jsxs(Je,{children:[f.deletePollDescription," ",L.jsx(Je,{fontWeight:"bold",children:t.poll.title}),"?"]})}),L.jsxs(Pu,{children:[L.jsx(yt,{loading:e,variant:"solid",color:"danger",onClick:g,children:f.deleteLabel}),L.jsx(yt,{variant:"plain",color:"neutral",onClick:m=>{m.stopPropagation(),t.onClose(m)},children:f.close})]})]})}),L.jsx(d,{showToast:r,color:s,message:a,hideToast:h})]})},kke=({poll:t,onClickEdit:e,onDelete:n})=>{const[r,i]=G.useState(!1),a=$t(Zt),o=s=>{s.stopPropagation(),i(!r)};return L.jsxs(L.Fragment,{children:[L.jsxs(xP,{children:[L.jsx(ME,{slots:{root:Rn},slotProps:{root:{variant:"plain",color:"neutral",size:"sm"}},onClick:s=>s.stopPropagation(),children:L.jsx(Gre,{})}),L.jsxs(RE,{size:"sm",sx:{minWidth:140},onClick:s=>s.stopPropagation(),children:[L.jsx(N0,{onClick:e,children:a.edit}),L.jsx(vo,{}),L.jsx(N0,{color:"danger",onClick:o,disabled:t.status!=="INACTIVE",children:a.deleteLabel})]})]}),L.jsx(_ke,{isOpen:r,poll:t,onDelete:n,onClose:s=>{s.stopPropagation(),i(!1)}})]})};class Tke{constructor(){l(this,"registered",{from_date:"",to_date:""});l(this,"interests",{ids:[],type:""});l(this,"either_or",{ids:[],type:"",min_points:0});l(this,"classic_quiz",{ids:[],type:"",min_success_rate:0});l(this,"poll",{ids:[],type:"ALL",option_ids:[]});l(this,"single_predictions",{ids:[],type:""});l(this,"top_x",{ids:[],type:""});l(this,"match_quiz",{ids:[],type:""})}}const Ake=({poll:t})=>{const[e,n]=G.useState(null),[r,i]=G.useState(!1),[a,o]=G.useState("success"),[s,c]=G.useState(""),u=$t(Zt),{https:d}=Nn.useAPIContext(),{Toast:f}=Nn.useComponentContext(),p=(m,v)=>{o(m),c(v),i(!0)},h=m=>j(this,null,function*(){n(m);const v=new Tke;v.poll.ids=[t.id],m!=="all"&&(v.poll.option_ids=[m]);const b=yield d.exportUsers(v);if(b.ok){const x=yield b.blob(),y=URL.createObjectURL(x),C=document.createElement("a");C.href=y,C.download=`poll_${t.id}_${m}_exported_users.csv`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(y),n(null),p("success",u.usersExportMessage)}else console.error(yield b.json()),n(null),p("danger",u.usersExportErrorMessage)}),g=()=>{const m=[];return t.options.forEach(v=>{m.push(L.jsxs("tr",{children:[L.jsxs("td",{children:[L.jsx(Je,{level:"body-sm",fontWeight:"600",children:`${u.exportUsersForOption} ${v.title}`}),L.jsx(Je,{level:"body-xs",color:"neutral",children:`${u.exportAllUsersForOption} ${v.title}`})]}),L.jsx("td",{children:L.jsx(yt,{loading:e===v.id,onClick:()=>h(v.id),children:`${u.exportForOption} ${v.title}`})})]},`option-${v.title}`))}),m.push(L.jsxs("tr",{children:[L.jsxs("td",{children:[L.jsx(Je,{level:"body-sm",fontWeight:"600",children:u.exportAllUsers}),L.jsx(Je,{level:"body-xs",color:"neutral",children:u.exportAllUsersDescription})]}),L.jsx("td",{children:L.jsx(yt,{loading:e==="all",onClick:()=>h("all"),children:u.exportAllUsers})})]},"all-users")),m};return L.jsxs(si,{variant:"soft",sx:{borderRadius:0,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)"},children:[L.jsx(ta,{children:L.jsxs(Ne,{mb:1,children:[L.jsx(Ne,{display:"flex",alignItems:"center",mb:1,children:L.jsx(Je,{level:"body-lg",sx:{mx:"auto"},children:u.exportUsersData})}),L.jsx(j0,{sx:{overflowX:"auto",minWidth:"700px"},children:L.jsxs(Du,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:u.category}),L.jsx("th",{children:u.action})]})}),L.jsx("tbody",{children:g()})]})})]})}),L.jsx(f,{showToast:r,color:a,message:s,hideToast:()=>i(!1)})]})},Pke=({poll:t})=>{const e=$t(Zt);return L.jsx(L.Fragment,{children:L.jsx(j0,{variant:"soft",sx:{p:2,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)",cursor:"default","&hover":{backgroundColor:"transparent"}},children:L.jsxs(Du,{hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > tfoot > tr > td":{pt:2,px:0}},children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:e.option}),L.jsx("th",{children:e.votes})]})}),L.jsx("tbody",{children:t.options.sort((n,r)=>r.votes-n.votes).map(n=>L.jsxs("tr",{children:[L.jsx("td",{children:n.title}),L.jsx("td",{children:n.votes})]},`option-${n.id}`))})]})})})},h1="DEFAULT_X_AXIS_KEY",m1="DEFAULT_Y_AXIS_KEY",Eke={top:50,bottom:50,left:50,right:50},hN=P.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),Oke=(t,e)=>n=>t?t.fade==="series"?n.seriesId===(e==null?void 0:e.seriesId)&&n.dataIndex!==(e==null?void 0:e.dataIndex):t.fade==="global"?n.seriesId!==(e==null?void 0:e.seriesId)||n.dataIndex!==(e==null?void 0:e.dataIndex):!1:!1,Rke=(t,e)=>n=>t?t.highlight==="series"?n.seriesId===(e==null?void 0:e.seriesId):t.highlight==="item"?n.dataIndex===(e==null?void 0:e.dataIndex)&&n.seriesId===(e==null?void 0:e.seriesId):!1:!1,Mke=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function Dke(t,e,n=Mke){return t.type==="pie"?N({},t,{data:t.data.map((r,i)=>N({color:n[i%n.length]},r))}):N({color:n[e%n.length]},t)}const $ke=({series:t,colors:e,seriesFormatters:n,dataset:r})=>{const i={};t.forEach((o,s)=>{var d;const{id:c=`auto-generated-id-${s}`,type:u}=o;if(i[u]===void 0&&(i[u]={series:{},seriesOrder:[]}),((d=i[u])==null?void 0:d.series[c])!==void 0)throw new Error(`MUI X: series' id "${c}" is not unique.`);i[u].series[c]=N({id:c},Dke(o,s,e)),i[u].seriesOrder.push(c)});const a={};return Object.keys(n).forEach(o=>{var c,u;const s=i[o];s!==void 0&&(a[o]=(u=(c=n[o])==null?void 0:c.call(n,s,r))!=null?u:i[o])}),a};function No({props:t,name:e}){return Fne({props:t,name:e,defaultTheme:lx,themeId:cx})}const Lke=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],Fke=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],Nke=t=>t==="dark"?Fke:Lke,mN=P.createContext({isInitialized:!1,data:{}}),Jd=P.createContext({isInitialized:!1,data:{colorProcessors:{},seriesFormatters:{},xExtremumGetters:{},yExtremumGetters:{},rotationExtremumGetters:{},radiusExtremumGetters:{}}}),gN=(t,e)=>e==="x"?{x:t,y:null}:{x:null,y:t},vN=t=>{var c;const{axis:e,getFilters:n,isDefaultAxis:r}=t,i=n==null?void 0:n({currentAxisId:e.id,isDefaultAxis:r}),a=i?(c=e.data)==null?void 0:c.filter((u,d)=>i({x:null,y:null},d)):e.data,o=Math.min(...a!=null?a:[]),s=Math.max(...a!=null?a:[]);return[o,s]},yN=t=>e=>{const{series:n,axis:r,getFilters:i,isDefaultAxis:a}=e;return Object.keys(n).filter(o=>{var c;const s=(c=n[o].yAxisId)!=null?c:n[o].yAxisKey;return s===r.id||a&&s===void 0}).reduce((o,s)=>{var p,h,g;const{stackedData:c}=n[s],u=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:a,seriesXAxisId:(p=n[s].xAxisId)!=null?p:n[s].xAxisKey,seriesYAxisId:(h=n[s].yAxisId)!=null?h:n[s].yAxisKey}),[d,f]=(g=c==null?void 0:c.reduce((m,v,b)=>u&&(!u(gN(v[0],t),b)||!u(gN(v[1],t),b))?m:[Math.min(...v,m[0]),Math.max(...v,m[1])],[1/0,-1/0]))!=null?g:[1/0,-1/0];return[Math.min(d,o[0]),Math.max(f,o[1])]},[1/0,-1/0])},jke=t=>Object.keys(t.series).some(n=>t.series[n].layout==="horizontal")?yN("x")(t):vN(t),Bke=t=>Object.keys(t.series).some(n=>t.series[n].layout==="horizontal")?vN(t):yN("y")(t);function ji(t){return function(){return t}}const g1=2*Math.PI;function bN(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function zke(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Hke(t){return t}function Uke(){var t=Hke,e=zke,n=null,r=ji(0),i=ji(g1),a=ji(0);function o(s){var c,u=(s=bN(s)).length,d,f,p=0,h=new Array(u),g=new Array(u),m=+r.apply(this,arguments),v=Math.min(g1,Math.max(-g1,i.apply(this,arguments)-m)),b,x=Math.min(Math.abs(v)/u,a.apply(this,arguments)),y=x*(v<0?-1:1),C;for(c=0;c<u;++c)(C=g[h[c]=c]=+t(s[c],c,s))>0&&(p+=C);for(e!=null?h.sort(function(w,I){return e(g[w],g[I])}):n!=null&&h.sort(function(w,I){return n(s[w],s[I])}),c=0,f=p?(v-u*y)/p:0;c<u;++c,m=b)d=h[c],C=g[d],b=m+(C>0?C*f:0)+y,g[d]={data:s[d],index:c,value:C,startAngle:m,endAngle:b,padAngle:x};return g}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:ji(+s),o):t},o.sortValues=function(s){return arguments.length?(e=s,n=null,o):e},o.sort=function(s){return arguments.length?(n=s,e=null,o):n},o.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ji(+s),o):r},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ji(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:ji(+s),o):a},o}function bc(t,e){if((o=t.length)>1)for(var n=1,r,i,a=t[e[0]],o,s=a.length;n<o;++n)for(i=a,a=t[e[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function xc(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Vke(t,e){return t[e]}function Wke(t){const e=[];return e.key=t,e}function xN(){var t=ji([]),e=xc,n=bc,r=Vke;function i(a){var o=Array.from(t.apply(this,arguments),Wke),s,c=o.length,u=-1,d;for(const f of a)for(s=0,++u;s<c;++s)(o[s][u]=[0,+r(f,o[s].key,u,a)]).data=f;for(s=0,d=bN(e(o));s<c;++s)o[d[s]].index=s;return n(o,d),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:ji(Array.from(a)),i):t},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ji(+a),i):r},i.order=function(a){return arguments.length?(e=a==null?xc:typeof a=="function"?a:ji(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(n=a==null?bc:a,i):n},i}function qke(t,e){if((r=t.length)>0){for(var n,r,i=0,a=t[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=t[n][i][1]||0;if(o)for(n=0;n<r;++n)t[n][i][1]/=o}bc(t,e)}}function Gke(t,e){if((c=t.length)>0)for(var n,r=0,i,a,o,s,c,u=t[e[0]].length;r<u;++r)for(o=s=0,n=0;n<c;++n)(a=(i=t[e[n]][r])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function Yke(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=t[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}bc(t,e)}}function Kke(t,e){if(!(!((o=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,u=0;s<o;++s){for(var d=t[e[s]],f=d[r][1]||0,p=d[r-1][1]||0,h=(f-p)/2,g=0;g<s;++g){var m=t[e[g]],v=m[r][1]||0,b=m[r-1][1]||0;h+=v-b}c+=f,u+=h*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,bc(t,e)}}function wN(t){var e=t.map(Jke);return xc(t).sort(function(n,r){return e[n]-e[r]})}function Jke(t){for(var e=-1,n=0,r=t.length,i,a=-1/0;++e<r;)(i=+t[e][1])>a&&(a=i,n=e);return n}function CN(t){var e=t.map(IN);return xc(t).sort(function(n,r){return e[n]-e[r]})}function IN(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function Qke(t){return CN(t).reverse()}function Xke(t){var e=t.length,n,r,i=t.map(IN),a=wN(t),o=0,s=0,c=[],u=[];for(n=0;n<e;++n)r=a[n],o<s?(o+=i[r],c.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(c)}function Zke(t){return xc(t).reverse()}const v1={appearance:wN,ascending:CN,descending:Qke,insideOut:Xke,none:xc,reverse:Zke},y1={expand:qke,diverging:Gke,none:bc,silhouette:Yke,wiggle:Kke},SN=t=>{const{series:e,seriesOrder:n,defaultStrategy:r}=t,i=[],a={};return n.forEach(o=>{var d,f;const{stack:s,stackOrder:c,stackOffset:u}=e[o];s===void 0?i.push({ids:[o],stackingOrder:v1.none,stackingOffset:y1.none}):a[s]===void 0?(a[s]=i.length,i.push({ids:[o],stackingOrder:v1[(d=c!=null?c:r==null?void 0:r.stackOrder)!=null?d:"none"],stackingOffset:y1[(f=u!=null?u:r==null?void 0:r.stackOffset)!=null?f:"diverging"]})):(i[a[s]].ids.push(o),c!==void 0&&(i[a[s]].stackingOrder=v1[c]),u!==void 0&&(i[a[s]].stackingOffset=y1[u]))}),i};function _N(t,e){const n={};return Object.keys(t).forEach(r=>{var i;n[r]=N({},t[r],{valueFormatter:(i=t[r].valueFormatter)!=null?i:e})}),n}const eTe=(t,e)=>{const{seriesOrder:n,series:r}=t,i=SN(t),a=e!=null?e:[];n.forEach(s=>{const c=r[s].data;if(c!==void 0)c.forEach((u,d)=>{a.length<=d?a.push({[s]:u}):a[d][s]=u});else if(e===void 0)throw new Error([`MUI X: bar series with id='${s}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
2634
|
+
`},eSe={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function tSe(t){let{announcements:e=eSe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ZIe}=t;const{announce:a,announcement:o}=JIe(),s=Ud("DndLiveRegion"),[c,u]=G.useState(!1);if(G.useEffect(()=>{u(!0)},[]),QIe(G.useMemo(()=>({onDragStart(f){let{active:p}=f;a(e.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;e.onDragMove&&a(e.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;a(e.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;a(e.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;a(e.onDragCancel({active:p,over:h}))}}),[a,e])),!c)return null;const d=G.createElement(G.Fragment,null,G.createElement(YIe,{id:r,value:i.draggable}),G.createElement(KIe,{id:s,announcement:o}));return n?Mt.createPortal(d,n):d}var Gn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Gn||(Gn={}));function lg(){}function wF(t,e){return G.useMemo(()=>({sensor:t,options:e!=null?e:{}}),[t,e])}function nSe(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return G.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Ni=Object.freeze({x:0,y:0});function rSe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function iSe(t,e){const n=sg(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function aSe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function oSe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function CF(t){let{left:e,top:n,height:r,width:i}=t;return[{x:e,y:n},{x:e+i,y:n},{x:e,y:n+r},{x:e+i,y:n+r}]}function IF(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}const sSe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=CF(e),a=[];for(const o of r){const{id:s}=o,c=n.get(s);if(c){const u=CF(c),d=i.reduce((p,h,g)=>p+rSe(u[g],h),0),f=Number((d/4).toFixed(4));a.push({id:s,data:{droppableContainer:o,value:f}})}}return a.sort(aSe)};function lSe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),a=Math.min(e.top+e.height,t.top+t.height),o=i-r,s=a-n;if(r<i&&n<a){const c=e.width*e.height,u=t.width*t.height,d=o*s,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const cSe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=[];for(const a of r){const{id:o}=a,s=n.get(o);if(s){const c=lSe(s,e);c>0&&i.push({id:o,data:{droppableContainer:a,value:c}})}}return i.sort(oSe)};function uSe(t,e,n){return Ae(ue({},t),{scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1})}function SF(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ni}function dSe(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((a,o)=>Ae(ue({},a),{top:a.top+t*o.y,bottom:a.bottom+t*o.y,left:a.left+t*o.x,right:a.right+t*o.x}),ue({},e))}}const fSe=dSe(1);function _F(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function pSe(t,e,n){const r=_F(e);if(!r)return t;const{scaleX:i,scaleY:a,x:o,y:s}=r,c=t.left-o-(1-i)*parseFloat(n),u=t.top-s-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?t.width/i:t.width,f=a?t.height/a:t.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const hSe={ignoreTransform:!1};function vc(t,e){e===void 0&&(e=hSe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:d}=vr(t).getComputedStyle(t);u&&(n=pSe(n,u,d))}const{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 kF(t){return vc(t,{ignoreTransform:!0})}function mSe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function gSe(t,e){return e===void 0&&(e=vr(t).getComputedStyle(t)),e.position==="fixed"}function vSe(t,e){e===void 0&&(e=vr(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{const i=e[r];return typeof i=="string"?n.test(i):!1})}function cg(t,e){const n=[];function r(i){if(e!=null&&n.length>=e||!i)return n;if(ZC(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Bd(i)||vF(i)||n.includes(i))return n;const a=vr(t).getComputedStyle(i);return i!==t&&vSe(i,a)&&n.push(i),gSe(i,a)?n:r(i.parentNode)}return t?r(t):n}function TF(t){const[e]=cg(t,1);return e!=null?e:null}function t1(t){return!ng||!t?null:hc(t)?t:XC(t)?ZC(t)||t===mc(t).scrollingElement?window:Bd(t)?t:null:null}function AF(t){return hc(t)?t.scrollX:t.scrollLeft}function PF(t){return hc(t)?t.scrollY:t.scrollTop}function n1(t){return{x:AF(t),y:PF(t)}}var tr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(tr||(tr={}));function EF(t){return!ng||!t?!1:t===document.scrollingElement}function OF(t){const e={x:0,y:0},n=EF(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},i=t.scrollTop<=e.y,a=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,s=t.scrollLeft>=r.x;return{isTop:i,isLeft:a,isBottom:o,isRight:s,maxScroll:r,minScroll:e}}const ySe={x:.2,y:.2};function bSe(t,e,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=ySe);const{isTop:u,isBottom:d,isLeft:f,isRight:p}=OF(t),h={x:0,y:0},g={x:0,y:0},m={height:e.height*i.y,width:e.width*i.x};return!u&&a<=e.top+m.height?(h.y=tr.Backward,g.y=r*Math.abs((e.top+m.height-a)/m.height)):!d&&c>=e.bottom-m.height&&(h.y=tr.Forward,g.y=r*Math.abs((e.bottom-m.height-c)/m.height)),!p&&s>=e.right-m.width?(h.x=tr.Forward,g.x=r*Math.abs((e.right-m.width-s)/m.width)):!f&&o<=e.left+m.width&&(h.x=tr.Backward,g.x=r*Math.abs((e.left+m.width-o)/m.width)),{direction:h,speed:g}}function xSe(t){if(t===document.scrollingElement){const{innerWidth:a,innerHeight:o}=window;return{top:0,left:0,right:a,bottom:o,width:a,height:o}}const{top:e,left:n,right:r,bottom:i}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:i,width:t.clientWidth,height:t.clientHeight}}function RF(t){return t.reduce((e,n)=>gc(e,n1(n)),Ni)}function wSe(t){return t.reduce((e,n)=>e+AF(n),0)}function CSe(t){return t.reduce((e,n)=>e+PF(n),0)}function MF(t,e){if(e===void 0&&(e=vc),!t)return;const{top:n,left:r,bottom:i,right:a}=e(t);TF(t)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const ISe=[["x",["left","right"],wSe],["y",["top","bottom"],CSe]];class r1{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=cg(n),i=RF(r);this.rect=ue({},e),this.width=e.width,this.height=e.height;for(const[a,o,s]of ISe)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=s(r),d=i[a]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Wd{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var i;(i=this.target)==null||i.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function SSe(t){const{EventTarget:e}=vr(t);return t instanceof e?t:mc(t)}function i1(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(Gu(n,2)+Gu(r,2))>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var bi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(bi||(bi={}));function DF(t){t.preventDefault()}function _Se(t){t.stopPropagation()}var _t;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(_t||(_t={}));const $F={start:[_t.Space,_t.Enter],cancel:[_t.Esc],end:[_t.Space,_t.Enter,_t.Tab]},kSe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case _t.Right:return Ae(ue({},n),{x:n.x+25});case _t.Left:return Ae(ue({},n),{x:n.x-25});case _t.Down:return Ae(ue({},n),{y:n.y+25});case _t.Up:return Ae(ue({},n),{y:n.y-25})}};class a1{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Wd(mc(n)),this.windowListeners=new Wd(vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bi.Resize,this.handleCancel),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&MF(r),n(Ni)}handleKeyDown(e){if(og(e)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:a=$F,coordinateGetter:o=kSe,scrollBehavior:s="smooth"}=i,{code:c}=e;if(a.end.includes(c)){this.handleEnd(e);return}if(a.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:Ni;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(e,{active:n,context:r.current,currentCoordinates:d});if(f){const p=Vd(f,d),h={x:0,y:0},{scrollableAncestors:g}=r.current;for(const m of g){const v=e.code,{isTop:b,isRight:x,isLeft:y,isBottom:C,maxScroll:w,minScroll:I}=OF(m),_=xSe(m),T={x:Math.min(v===_t.Right?_.right-_.width/2:_.right,Math.max(v===_t.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(v===_t.Down?_.bottom-_.height/2:_.bottom,Math.max(v===_t.Down?_.top:_.top+_.height/2,f.y))},O=v===_t.Right&&!x||v===_t.Left&&!y,A=v===_t.Down&&!C||v===_t.Up&&!b;if(O&&T.x!==f.x){const k=m.scrollLeft+p.x,S=v===_t.Right&&k<=w.x||v===_t.Left&&k>=I.x;if(S&&!p.y){m.scrollTo({left:k,behavior:s});return}S?h.x=m.scrollLeft-k:h.x=v===_t.Right?m.scrollLeft-w.x:m.scrollLeft-I.x,h.x&&m.scrollBy({left:-h.x,behavior:s});break}else if(A&&T.y!==f.y){const k=m.scrollTop+p.y,S=v===_t.Down&&k<=w.y||v===_t.Up&&k>=I.y;if(S&&!p.x){m.scrollTo({top:k,behavior:s});return}S?h.y=m.scrollTop-k:h.y=v===_t.Down?m.scrollTop-w.y:m.scrollTop-I.y,h.y&&m.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(e,gc(Vd(f,this.referenceCoordinates),h))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}a1.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=$F,onActivation:i}=e,{active:a}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const s=a.activatorNode.current;return s&&t.target!==s?!1:(t.preventDefault(),i==null||i({event:t.nativeEvent}),!0)}return!1}}];function LF(t){return!!(t&&"distance"in t)}function FF(t){return!!(t&&"delay"in t)}class o1{constructor(e,n,r){var i;r===void 0&&(r=SSe(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=n;const{event:a}=e,{target:o}=a;this.props=e,this.events=n,this.document=mc(o),this.documentListeners=new Wd(this.document),this.listeners=new Wd(r),this.windowListeners=new Wd(vr(o)),this.initialCoordinates=(i=sg(a))!=null?i:Ni,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=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(bi.Resize,this.handleCancel),this.windowListeners.add(bi.DragStart,DF),this.windowListeners.add(bi.VisibilityChange,this.handleCancel),this.windowListeners.add(bi.ContextMenu,DF),this.documentListeners.add(bi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FF(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(LF(n)){this.handlePending(n);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,n){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(bi.Click,_Se,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:i,props:a}=this,{onMove:o,options:{activationConstraint:s}}=a;if(!i)return;const c=(n=sg(e))!=null?n:Ni,u=Vd(i,c);if(!r&&s){if(LF(s)){if(s.tolerance!=null&&i1(u,s.tolerance))return this.handleCancel();if(i1(u,s.distance))return this.handleStart()}if(FF(s)&&i1(u,s.tolerance))return this.handleCancel();this.handlePending(s,u);return}e.cancelable&&e.preventDefault(),o(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===_t.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const TSe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class s1 extends o1{constructor(e){const{event:n}=e,r=mc(n.target);super(e,TSe,r)}}s1.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const ASe={move:{name:"mousemove"},end:{name:"mouseup"}};var l1;(function(t){t[t.RightClick=2]="RightClick"})(l1||(l1={}));class PSe extends o1{constructor(e){super(e,ASe,mc(e.event.target))}}PSe.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===l1.RightClick?!1:(r==null||r({event:n}),!0)}}];const c1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ESe extends o1{constructor(e){super(e,c1)}static setup(){return window.addEventListener(c1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(c1.move.name,e)};function e(){}}}ESe.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var qd;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(qd||(qd={}));var ug;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(ug||(ug={}));function OSe(t){let{acceleration:e,activator:n=qd.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=ug.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=t;const h=MSe({delta:f,disabled:!a}),[g,m]=UIe(),v=G.useRef({x:0,y:0}),b=G.useRef({x:0,y:0}),x=G.useMemo(()=>{switch(n){case qd.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case qd.DraggableRect:return i}},[n,i,c]),y=G.useRef(null),C=G.useCallback(()=>{const I=y.current;if(!I)return;const _=v.current.x*b.current.x,T=v.current.y*b.current.y;I.scrollBy(_,T)},[]),w=G.useMemo(()=>s===ug.TreeOrder?[...u].reverse():u,[s,u]);G.useEffect(()=>{if(!a||!u.length||!x){m();return}for(const I of w){if((r==null?void 0:r(I))===!1)continue;const _=u.indexOf(I),T=d[_];if(!T)continue;const{direction:O,speed:A}=bSe(I,T,x,e,p);for(const k of["x","y"])h[k][O[k]]||(A[k]=0,O[k]=0);if(A.x>0||A.y>0){m(),y.current=I,g(C,o),v.current=A,b.current=O;return}}v.current={x:0,y:0},b.current={x:0,y:0},m()},[e,C,r,m,a,o,JSON.stringify(x),JSON.stringify(h),g,u,w,d,JSON.stringify(p)])}const RSe={x:{[tr.Backward]:!1,[tr.Forward]:!1},y:{[tr.Backward]:!1,[tr.Forward]:!1}};function MSe(t){let{delta:e,disabled:n}=t;const r=ag(e);return Hd(i=>{if(n||!r||!i)return RSe;const a={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[tr.Backward]:i.x[tr.Backward]||a.x===-1,[tr.Forward]:i.x[tr.Forward]||a.x===1},y:{[tr.Backward]:i.y[tr.Backward]||a.y===-1,[tr.Forward]:i.y[tr.Forward]||a.y===1}}},[n,e,r])}function DSe(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Hd(i=>{var a;return e==null?null:(a=r!=null?r:i)!=null?a:null},[r,e])}function $Se(t,e){return G.useMemo(()=>t.reduce((n,r)=>{const{sensor:i}=r,a=i.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...a]},[]),[t,e])}var Gd;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Gd||(Gd={}));var u1;(function(t){t.Optimized="optimized"})(u1||(u1={}));const NF=new Map;function LSe(t,e){let{dragging:n,dependencies:r,config:i}=e;const[a,o]=G.useState(null),{frequency:s,measure:c,strategy:u}=i,d=G.useRef(t),f=v(),p=zd(f),h=G.useCallback(function(b){b===void 0&&(b=[]),!p.current&&o(x=>x===null?b:x.concat(b.filter(y=>!x.includes(y))))},[p]),g=G.useRef(null),m=Hd(b=>{if(f&&!n)return NF;if(!b||b===NF||d.current!==t||a!=null){const x=new Map;for(let y of t){if(!y)continue;if(a&&a.length>0&&!a.includes(y.id)&&y.rect.current){x.set(y.id,y.rect.current);continue}const C=y.node.current,w=C?new r1(c(C),C):null;y.rect.current=w,w&&x.set(y.id,w)}return x}return b},[t,a,n,f,c]);return G.useEffect(()=>{d.current=t},[t]),G.useEffect(()=>{f||h()},[n,f]),G.useEffect(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),G.useEffect(()=>{f||typeof s!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},s))},[s,f,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:a!=null};function v(){switch(u){case Gd.Always:return!1;case Gd.BeforeDragging:return n;default:return!n}}}function d1(t,e){return Hd(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function FSe(t,e){return d1(t,e)}function NSe(t){let{callback:e,disabled:n}=t;const r=rg(e),i=G.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return G.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function dg(t){let{callback:e,disabled:n}=t;const r=rg(e),i=G.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return G.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function jSe(t){return new r1(vc(t),t)}function jF(t,e,n){e===void 0&&(e=jSe);const[r,i]=G.useState(null);function a(){i(c=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=c!=null?c:n)!=null?u:null}const d=e(t);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=NSe({callback(c){if(t)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(t)){a();break}}}}),s=dg({callback:a});return Fi(()=>{a(),t?(s==null||s.observe(t),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[t]),r}function BSe(t){const e=d1(t);return SF(t,e)}const BF=[];function zSe(t){const e=G.useRef(t),n=Hd(r=>t?r&&r!==BF&&t&&e.current&&t.parentNode===e.current.parentNode?r:cg(t):BF,[t]);return G.useEffect(()=>{e.current=t},[t]),n}function HSe(t){const[e,n]=G.useState(null),r=G.useRef(t),i=G.useCallback(a=>{const o=t1(a.target);o&&n(s=>s?(s.set(o,n1(o)),new Map(s)):null)},[]);return G.useEffect(()=>{const a=r.current;if(t!==a){o(a);const s=t.map(c=>{const u=t1(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,n1(u)]):null}).filter(c=>c!=null);n(s.length?new Map(s):null),r.current=t}return()=>{o(t),o(a)};function o(s){s.forEach(c=>{const u=t1(c);u==null||u.removeEventListener("scroll",i)})}},[i,t]),G.useMemo(()=>t.length?e?Array.from(e.values()).reduce((a,o)=>gc(a,o),Ni):RF(t):Ni,[t,e])}function zF(t,e){e===void 0&&(e=[]);const n=G.useRef(null);return G.useEffect(()=>{n.current=null},e),G.useEffect(()=>{const r=t!==Ni;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Vd(t,n.current):Ni}function USe(t){G.useEffect(()=>{if(!ng)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function VSe(t,e){return G.useMemo(()=>t.reduce((n,r)=>{let{eventName:i,handler:a}=r;return n[i]=o=>{a(o,e)},n},{}),[t,e])}function HF(t){return G.useMemo(()=>t?mSe(t):null,[t])}const UF=[];function WSe(t,e){e===void 0&&(e=vc);const[n]=t,r=HF(n?vr(n):null),[i,a]=G.useState(UF);function o(){a(()=>t.length?t.map(c=>EF(c)?r:new r1(e(c),c)):UF)}const s=dg({callback:o});return Fi(()=>{s==null||s.disconnect(),o(),t.forEach(c=>s==null?void 0:s.observe(c))},[t]),i}function VF(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Bd(e)?e:t}function qSe(t){let{measure:e}=t;const[n,r]=G.useState(null),i=G.useCallback(u=>{for(const{target:d}of u)if(Bd(d)){r(f=>{const p=e(d);return f?Ae(ue({},f),{width:p.width,height:p.height}):p});break}},[e]),a=dg({callback:i}),o=G.useCallback(u=>{const d=VF(u);a==null||a.disconnect(),d&&(a==null||a.observe(d)),r(d?e(d):null)},[e,a]),[s,c]=ig(o);return G.useMemo(()=>({nodeRef:s,rect:n,setRef:c}),[n,s,c])}const GSe=[{sensor:s1,options:{}},{sensor:a1,options:{}}],YSe={current:{}},fg={draggable:{measure:kF},droppable:{measure:kF,strategy:Gd.WhileDragging,frequency:u1.Optimized},dragOverlay:{measure:vc}};class Yd extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const KSe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:lg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fg,measureDroppableContainers:lg,windowRect:null,measuringScheduled:!1},WF={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:lg,draggableNodes:new Map,over:null,measureDroppableContainers:lg},Kd=G.createContext(WF),qF=G.createContext(KSe);function JSe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yd}}}function QSe(t,e){switch(e.type){case Gn.DragStart:return Ae(ue({},t),{draggable:Ae(ue({},t.draggable),{initialCoordinates:e.initialCoordinates,active:e.active})});case Gn.DragMove:return t.draggable.active==null?t:Ae(ue({},t),{draggable:Ae(ue({},t.draggable),{translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}})});case Gn.DragEnd:case Gn.DragCancel:return Ae(ue({},t),{draggable:Ae(ue({},t.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case Gn.RegisterDroppable:{const{element:n}=e,{id:r}=n,i=new Yd(t.droppable.containers);return i.set(r,n),Ae(ue({},t),{droppable:Ae(ue({},t.droppable),{containers:i})})}case Gn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=e,a=t.droppable.containers.get(n);if(!a||r!==a.key)return t;const o=new Yd(t.droppable.containers);return o.set(n,Ae(ue({},a),{disabled:i})),Ae(ue({},t),{droppable:Ae(ue({},t.droppable),{containers:o})})}case Gn.UnregisterDroppable:{const{id:n,key:r}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new Yd(t.droppable.containers);return a.delete(n),Ae(ue({},t),{droppable:Ae(ue({},t.droppable),{containers:a})})}default:return t}}function XSe(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:i}=G.useContext(Kd),a=ag(r),o=ag(n==null?void 0:n.id);return G.useEffect(()=>{if(!e&&!r&&a&&o!=null){if(!og(a)||document.activeElement===a.target)return;const s=i.get(o);if(!s)return;const{activatorNode:c,node:u}=s;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=qIe(d);if(f){f.focus();break}}})}},[r,e,i,o,a]),null}function GF(t,e){let n=e,{transform:r}=n,i=hn(n,["transform"]);return t!=null&&t.length?t.reduce((a,o)=>o(ue({transform:a},i)),r):r}function ZSe(t){return G.useMemo(()=>({draggable:ue(ue({},fg.draggable),t==null?void 0:t.draggable),droppable:ue(ue({},fg.droppable),t==null?void 0:t.droppable),dragOverlay:ue(ue({},fg.dragOverlay),t==null?void 0:t.dragOverlay)}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function e_e(t){let{activeNode:e,measure:n,initialRect:r,config:i=!0}=t;const a=G.useRef(!1),{x:o,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Fi(()=>{if(!o&&!s||!e){a.current=!1;return}if(a.current||!r)return;const c=e==null?void 0:e.node.current;if(!c||c.isConnected===!1)return;const u=n(c),d=SF(u,r);if(o||(d.x=0),s||(d.y=0),a.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=TF(c);f&&f.scrollBy({top:d.y,left:d.x})}},[e,o,s,r,n])}const pg=G.createContext(Ae(ue({},Ni),{scaleX:1,scaleY:1}));var Lo;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Lo||(Lo={}));const t_e=G.memo(function(t){var e,n,r,i;let a=t,{id:o,accessibility:s,autoScroll:c=!0,children:u,sensors:d=GSe,collisionDetection:f=cSe,measuring:p,modifiers:h}=a,g=hn(a,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const m=G.useReducer(QSe,void 0,JSe),[v,b]=m,[x,y]=XIe(),[C,w]=G.useState(Lo.Uninitialized),I=C===Lo.Initialized,{draggable:{active:_,nodes:T,translate:O},droppable:{containers:A}}=v,k=_!=null?T.get(_):null,S=G.useRef({initial:null,translated:null}),E=G.useMemo(()=>{var wt;return _!=null?{id:_,data:(wt=k==null?void 0:k.data)!=null?wt:YSe,rect:S}:null},[_,k]),M=G.useRef(null),[R,F]=G.useState(null),[B,H]=G.useState(null),V=zd(g,Object.values(g)),U=Ud("DndDescribedBy",o),D=G.useMemo(()=>A.getEnabled(),[A]),z=ZSe(p),{droppableRects:W,measureDroppableContainers:q,measuringScheduled:X}=LSe(D,{dragging:I,dependencies:[O.x,O.y],config:z.droppable}),K=DSe(T,_),Q=G.useMemo(()=>B?sg(B):null,[B]),Y=St(),J=FSe(K,z.draggable.measure);e_e({activeNode:_!=null?T.get(_):null,config:Y.layoutShiftCompensation,initialRect:J,measure:z.draggable.measure});const Z=jF(K,z.draggable.measure,J),oe=jF(K?K.parentElement:null),ae=G.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=A.getNodeFor((e=ae.current.over)==null?void 0:e.id),Pe=qSe({measure:z.dragOverlay.measure}),me=(n=Pe.nodeRef.current)!=null?n:K,ve=I?(r=Pe.rect)!=null?r:Z:null,he=!!(Pe.nodeRef.current&&Pe.rect),ie=BSe(he?null:Z),se=HF(me?vr(me):null),de=zSe(I?xe!=null?xe:K:null),be=WSe(de),pe=GF(h,{transform:{x:O.x-ie.x,y:O.y-ie.y,scaleX:1,scaleY:1},activatorEvent:B,active:E,activeNodeRect:Z,containerNodeRect:oe,draggingNodeRect:ve,over:ae.current.over,overlayNodeRect:Pe.rect,scrollableAncestors:de,scrollableAncestorRects:be,windowRect:se}),ke=Q?gc(Q,O):null,Be=HSe(de),Ue=zF(Be),ut=zF(Be,[Z]),at=gc(pe,Ue),ye=ve?fSe(ve,pe):null,Oe=E&&ye?f({active:E,collisionRect:ye,droppableRects:W,droppableContainers:D,pointerCoordinates:ke}):null,Te=IF(Oe,"id"),[Ve,Re]=G.useState(null),De=he?pe:gc(pe,ut),Ke=uSe(De,(i=Ve==null?void 0:Ve.rect)!=null?i:null,Z),qe=G.useRef(null),Rt=G.useCallback((wt,kt)=>{let{sensor:ee,options:re}=kt;if(M.current==null)return;const ce=T.get(M.current);if(!ce)return;const fe=wt.nativeEvent,Me=new ee({active:M.current,activeNode:ce,event:fe,options:re,context:ae,onAbort(Qe){if(!T.get(Qe))return;const{onDragAbort:We}=V.current,ot={id:Qe};We==null||We(ot),x({type:"onDragAbort",event:ot})},onPending(Qe,We,ot,Ge){if(!T.get(Qe))return;const{onDragPending:Xe}=V.current,vt={id:Qe,constraint:We,initialCoordinates:ot,offset:Ge};Xe==null||Xe(vt),x({type:"onDragPending",event:vt})},onStart(Qe){const We=M.current;if(We==null)return;const ot=T.get(We);if(!ot)return;const{onDragStart:Ge}=V.current,Xe={activatorEvent:fe,active:{id:We,data:ot.data,rect:S}};Mt.unstable_batchedUpdates(()=>{Ge==null||Ge(Xe),w(Lo.Initializing),b({type:Gn.DragStart,initialCoordinates:Qe,active:We}),x({type:"onDragStart",event:Xe}),F(qe.current),H(fe)})},onMove(Qe){b({type:Gn.DragMove,coordinates:Qe})},onEnd:ze(Gn.DragEnd),onCancel:ze(Gn.DragCancel)});qe.current=Me;function ze(Qe){return function(){return ne(this,null,function*(){const{active:We,collisions:ot,over:Ge,scrollAdjustedTranslate:Xe}=ae.current;let vt=null;if(We&&Xe){const{cancelDrop:jn}=V.current;vt={activatorEvent:fe,active:We,collisions:ot,delta:Xe,over:Ge},Qe===Gn.DragEnd&&typeof jn=="function"&&(yield Promise.resolve(jn(vt)))&&(Qe=Gn.DragCancel)}M.current=null,Mt.unstable_batchedUpdates(()=>{b({type:Qe}),w(Lo.Uninitialized),Re(null),F(null),H(null),qe.current=null;const jn=Qe===Gn.DragEnd?"onDragEnd":"onDragCancel";if(vt){const Bn=V.current[jn];Bn==null||Bn(vt),x({type:jn,event:vt})}})})}}},[T]),bt=G.useCallback((wt,kt)=>(ee,re)=>{const ce=ee.nativeEvent,fe=T.get(re);if(M.current!==null||!fe||ce.dndKit||ce.defaultPrevented)return;const Me={active:fe};wt(ee,kt.options,Me)===!0&&(ce.dndKit={capturedBy:kt.sensor},M.current=re,Rt(ee,kt))},[T,Rt]),En=$Se(d,bt);USe(d),Fi(()=>{Z&&C===Lo.Initializing&&w(Lo.Initialized)},[Z,C]),G.useEffect(()=>{const{onDragMove:wt}=V.current,{active:kt,activatorEvent:ee,collisions:re,over:ce}=ae.current;if(!kt||!ee)return;const fe={active:kt,activatorEvent:ee,collisions:re,delta:{x:at.x,y:at.y},over:ce};Mt.unstable_batchedUpdates(()=>{wt==null||wt(fe),x({type:"onDragMove",event:fe})})},[at.x,at.y]),G.useEffect(()=>{const{active:wt,activatorEvent:kt,collisions:ee,droppableContainers:re,scrollAdjustedTranslate:ce}=ae.current;if(!wt||M.current==null||!kt||!ce)return;const{onDragOver:fe}=V.current,Me=re.get(Te),ze=Me&&Me.rect.current?{id:Me.id,rect:Me.rect.current,data:Me.data,disabled:Me.disabled}:null,Qe={active:wt,activatorEvent:kt,collisions:ee,delta:{x:ce.x,y:ce.y},over:ze};Mt.unstable_batchedUpdates(()=>{Re(ze),fe==null||fe(Qe),x({type:"onDragOver",event:Qe})})},[Te]),Fi(()=>{ae.current={activatorEvent:B,active:E,activeNode:K,collisionRect:ye,collisions:Oe,droppableRects:W,draggableNodes:T,draggingNode:me,draggingNodeRect:ve,droppableContainers:A,over:Ve,scrollableAncestors:de,scrollAdjustedTranslate:at},S.current={initial:ve,translated:ye}},[E,K,Oe,ye,T,me,ve,W,A,Ve,de,at]),OSe(Ae(ue({},Y),{delta:O,draggingRect:ye,pointerCoordinates:ke,scrollableAncestors:de,scrollableAncestorRects:be}));const rn=G.useMemo(()=>({active:E,activeNode:K,activeNodeRect:Z,activatorEvent:B,collisions:Oe,containerNodeRect:oe,dragOverlay:Pe,draggableNodes:T,droppableContainers:A,droppableRects:W,over:Ve,measureDroppableContainers:q,scrollableAncestors:de,scrollableAncestorRects:be,measuringConfiguration:z,measuringScheduled:X,windowRect:se}),[E,K,Z,B,Oe,oe,Pe,T,A,W,Ve,q,de,be,z,X,se]),Ft=G.useMemo(()=>({activatorEvent:B,activators:En,active:E,activeNodeRect:Z,ariaDescribedById:{draggable:U},dispatch:b,draggableNodes:T,over:Ve,measureDroppableContainers:q}),[B,En,E,Z,b,U,T,Ve,q]);return G.createElement(xF.Provider,{value:y},G.createElement(Kd.Provider,{value:Ft},G.createElement(qF.Provider,{value:rn},G.createElement(pg.Provider,{value:Ke},u)),G.createElement(XSe,{disabled:(s==null?void 0:s.restoreFocus)===!1})),G.createElement(tSe,Ae(ue({},s),{hiddenTextDescribedById:U})));function St(){const wt=(R==null?void 0:R.autoScrollEnabled)===!1,kt=typeof c=="object"?c.enabled===!1:c===!1,ee=I&&!wt&&!kt;return typeof c=="object"?Ae(ue({},c),{enabled:ee}):{enabled:ee}}}),n_e=G.createContext(null),YF="button",r_e="Draggable";function i_e(t){let{id:e,data:n,disabled:r=!1,attributes:i}=t;const a=Ud(r_e),{activators:o,activatorEvent:s,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=G.useContext(Kd),{role:h=YF,roleDescription:g="draggable",tabIndex:m=0}=i!=null?i:{},v=(c==null?void 0:c.id)===e,b=G.useContext(v?pg:n_e),[x,y]=ig(),[C,w]=ig(),I=VSe(o,e),_=zd(n);Fi(()=>(f.set(e,{id:e,key:a,node:x,activatorNode:C,data:_}),()=>{const O=f.get(e);O&&O.key===a&&f.delete(e)}),[f,e]);const T=G.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":v&&h===YF?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,m,v,g,d.draggable]);return{active:c,activatorEvent:s,activeNodeRect:u,attributes:T,isDragging:v,listeners:r?void 0:I,node:x,over:p,setNodeRef:y,setActivatorNodeRef:w,transform:b}}function KF(){return G.useContext(qF)}const a_e="Droppable",o_e={timeout:25};function s_e(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=t;const a=Ud(a_e),{active:o,dispatch:s,over:c,measureDroppableContainers:u}=G.useContext(Kd),d=G.useRef({disabled:n}),f=G.useRef(!1),p=G.useRef(null),h=G.useRef(null),{disabled:g,updateMeasurementsFor:m,timeout:v}=ue(ue({},o_e),i),b=zd(m!=null?m:r),x=G.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},v)},[v]),y=dg({callback:x,disabled:g||!o}),C=G.useCallback((T,O)=>{y&&(O&&(y.unobserve(O),f.current=!1),T&&y.observe(T))},[y]),[w,I]=ig(C),_=zd(e);return G.useEffect(()=>{!y||!w.current||(y.disconnect(),f.current=!1,y.observe(w.current))},[w,y]),G.useEffect(()=>(s({type:Gn.RegisterDroppable,element:{id:r,key:a,disabled:n,node:w,rect:p,data:_}}),()=>s({type:Gn.UnregisterDroppable,key:a,id:r})),[r]),G.useEffect(()=>{n!==d.current.disabled&&(s({type:Gn.SetDroppableDisabled,id:r,key:a,disabled:n}),d.current.disabled=n)},[r,a,n,s]),{active:o,rect:p,isOver:(c==null?void 0:c.id)===r,node:w,over:c,setNodeRef:I}}function l_e(t){let{animation:e,children:n}=t;const[r,i]=G.useState(null),[a,o]=G.useState(null),s=ag(n);return!n&&!r&&s&&i(s),Fi(()=>{if(!a)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){i(null);return}Promise.resolve(e(u,a)).then(()=>{i(null)})},[e,r,a]),G.createElement(G.Fragment,null,n,r?G.cloneElement(r,{ref:o}):null)}const c_e={x:0,y:0,scaleX:1,scaleY:1};function u_e(t){let{children:e}=t;return G.createElement(Kd.Provider,{value:WF},G.createElement(pg.Provider,{value:c_e},e))}const d_e={position:"fixed",touchAction:"none"},f_e=t=>og(t)?"transform 250ms ease":void 0,p_e=G.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:u,transition:d=f_e}=t;if(!s)return null;const f=i?u:Ae(ue({},u),{scaleX:1,scaleY:1}),p=ue(Ae(ue({},d_e),{width:s.width,height:s.height,top:s.top,left:s.left,transform:$o.Transform.toString(f),transformOrigin:i&&r?iSe(r,s):void 0,transition:typeof d=="function"?d(r):d}),c);return G.createElement(n,{className:o,style:p,ref:e},a)}),JF=t=>e=>{let{active:n,dragOverlay:r}=e;const i={},{styles:a,className:o}=t;if(a!=null&&a.active)for(const[s,c]of Object.entries(a.active))c!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,c));if(a!=null&&a.dragOverlay)for(const[s,c]of Object.entries(a.dragOverlay))c!==void 0&&r.node.style.setProperty(s,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[s,c]of Object.entries(i))n.node.style.setProperty(s,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},h_e=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:$o.Transform.toString(e)},{transform:$o.Transform.toString(n)}]},m_e={duration:250,easing:"ease",keyframes:h_e,sideEffects:JF({styles:{active:{opacity:"0"}}})};function g_e(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=t;return rg((a,o)=>{if(e===null)return;const s=n.get(a);if(!s)return;const c=s.node.current;if(!c)return;const u=VF(o);if(!u)return;const{transform:d}=vr(o).getComputedStyle(o),f=_F(d);if(!f)return;const p=typeof e=="function"?e:v_e(e);return MF(c,i.draggable.measure),p({active:{id:a,data:s.data,node:c,rect:i.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function v_e(t){const{duration:e,easing:n,sideEffects:r,keyframes:i}=ue(ue({},m_e),t);return a=>{let o=a,{active:s,dragOverlay:c,transform:u}=o,d=hn(o,["active","dragOverlay","transform"]);if(!e)return;const f={x:c.rect.left-s.rect.left,y:c.rect.top-s.rect.top},p={scaleX:u.scaleX!==1?s.rect.width*u.scaleX/c.rect.width:1,scaleY:u.scaleY!==1?s.rect.height*u.scaleY/c.rect.height:1},h=ue({x:u.x-f.x,y:u.y-f.y},p),g=i(Ae(ue({},d),{active:s,dragOverlay:c,transform:{initial:u,final:h}})),[m]=g,v=g[g.length-1];if(JSON.stringify(m)===JSON.stringify(v))return;const b=r==null?void 0:r(ue({active:s,dragOverlay:c},d)),x=c.node.animate(g,{duration:e,easing:n,fill:"forwards"});return new Promise(y=>{x.onfinish=()=>{b==null||b(),y()}})}}let QF=0;function y_e(t){return G.useMemo(()=>{if(t!=null)return QF++,QF},[t])}const b_e=G.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s="div",className:c,zIndex:u=999}=t;const{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:m,dragOverlay:v,over:b,measuringConfiguration:x,scrollableAncestors:y,scrollableAncestorRects:C,windowRect:w}=KF(),I=G.useContext(pg),_=y_e(f==null?void 0:f.id),T=GF(o,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:v.rect,over:b,overlayNodeRect:v.rect,scrollableAncestors:y,scrollableAncestorRects:C,transform:I,windowRect:w}),O=d1(p),A=g_e({config:r,draggableNodes:g,droppableContainers:m,measuringConfiguration:x}),k=O?v.setRef:void 0;return G.createElement(u_e,null,G.createElement(l_e,{animation:A},f&&_?G.createElement(p_e,{key:_,id:f.id,ref:k,as:s,activatorEvent:d,adjustScale:e,className:c,transition:a,rect:O,style:ue({zIndex:u},i),transform:T},n):null))});function f1(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function x_e(t,e){return t.reduce((n,r,i)=>{const a=e.get(r);return a&&(n[i]=a),n},Array(t.length))}function hg(t){return t!==null&&t>=0}function w_e(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function C_e(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const XF=t=>{let{rects:e,activeIndex:n,overIndex:r,index:i}=t;const a=f1(e,r,n),o=e[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},ZF="Sortable",eN=G.createContext({activeIndex:-1,containerId:ZF,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:XF,disabled:{draggable:!1,droppable:!1}});function I_e(t){let{children:e,id:n,items:r,strategy:i=XF,disabled:a=!1}=t;const{active:o,dragOverlay:s,droppableRects:c,over:u,measureDroppableContainers:d}=KF(),f=Ud(ZF,n),p=s.rect!==null,h=G.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),g=o!=null,m=o?h.indexOf(o.id):-1,v=u?h.indexOf(u.id):-1,b=G.useRef(h),x=!w_e(h,b.current),y=v!==-1&&m===-1||x,C=C_e(a);Fi(()=>{x&&g&&d(h)},[x,h,g,d]),G.useEffect(()=>{b.current=h},[h]);const w=G.useMemo(()=>({activeIndex:m,containerId:f,disabled:C,disableTransforms:y,items:h,overIndex:v,useDragOverlay:p,sortedRects:x_e(h,c),strategy:i}),[m,f,C.draggable,C.droppable,y,h,v,c,p,i]);return G.createElement(eN.Provider,{value:w},e)}const S_e=t=>{let{id:e,items:n,activeIndex:r,overIndex:i}=t;return f1(n,r,i).indexOf(e)},__e=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:u}=t;return!u||!r||s!==a&&i===o?!1:n?!0:o!==i&&e===c},k_e={duration:200,easing:"ease"},tN="transform",T_e=$o.Transition.toString({property:tN,duration:0,easing:"linear"}),A_e={roleDescription:"sortable"};function P_e(t){let{disabled:e,index:n,node:r,rect:i}=t;const[a,o]=G.useState(null),s=G.useRef(n);return Fi(()=>{if(!e&&n!==s.current&&r.current){const c=i.current;if(c){const u=vc(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}n!==s.current&&(s.current=n)},[e,n,r,i]),G.useEffect(()=>{a&&o(null)},[a]),a}function E_e(t){let{animateLayoutChanges:e=__e,attributes:n,disabled:r,data:i,getNewIndex:a=S_e,id:o,strategy:s,resizeObserverConfig:c,transition:u=k_e}=t;const{items:d,containerId:f,activeIndex:p,disabled:h,disableTransforms:g,sortedRects:m,overIndex:v,useDragOverlay:b,strategy:x}=G.useContext(eN),y=O_e(r,h),C=d.indexOf(o),w=G.useMemo(()=>ue({sortable:{containerId:f,index:C,items:d}},i),[f,i,C,d]),I=G.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:_,node:T,isOver:O,setNodeRef:A}=s_e({id:o,data:w,disabled:y.droppable,resizeObserverConfig:ue({updateMeasurementsFor:I},c)}),{active:k,activatorEvent:S,activeNodeRect:E,attributes:M,setNodeRef:R,listeners:F,isDragging:B,over:H,setActivatorNodeRef:V,transform:U}=i_e({id:o,data:w,attributes:ue(ue({},A_e),n),disabled:y.draggable}),D=HIe(A,R),z=!!k,W=z&&!g&&hg(p)&&hg(v),q=!b&&B,X=q&&W?U:null,K=s!=null?s:x,Q=W?X!=null?X:K({rects:m,activeNodeRect:E,activeIndex:p,overIndex:v,index:C}):null,Y=hg(p)&&hg(v)?a({id:o,items:d,activeIndex:p,overIndex:v}):C,J=k==null?void 0:k.id,Z=G.useRef({activeId:J,items:d,newIndex:Y,containerId:f}),oe=d!==Z.current.items,ae=e({active:k,containerId:f,isDragging:B,isSorting:z,id:o,index:C,items:d,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:u,wasDragging:Z.current.activeId!=null}),xe=P_e({disabled:!ae,index:C,node:T,rect:_});return G.useEffect(()=>{z&&Z.current.newIndex!==Y&&(Z.current.newIndex=Y),f!==Z.current.containerId&&(Z.current.containerId=f),d!==Z.current.items&&(Z.current.items=d)},[z,Y,f,d]),G.useEffect(()=>{if(J===Z.current.activeId)return;if(J!=null&&Z.current.activeId==null){Z.current.activeId=J;return}const me=setTimeout(()=>{Z.current.activeId=J},50);return()=>clearTimeout(me)},[J]),{active:k,activeIndex:p,attributes:M,data:w,rect:_,index:C,newIndex:Y,items:d,isOver:O,isSorting:z,isDragging:B,listeners:F,node:T,overIndex:v,over:H,setNodeRef:D,setActivatorNodeRef:V,setDroppableNodeRef:A,setDraggableNodeRef:R,transform:xe!=null?xe:Q,transition:Pe()};function Pe(){if(xe||oe&&Z.current.newIndex===C)return T_e;if(!(q&&!og(S)||!u)&&(z||ae))return $o.Transition.toString(Ae(ue({},u),{property:tN}))}}function O_e(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}function mg(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const R_e=[_t.Down,_t.Right,_t.Up,_t.Left],M_e=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=e;if(R_e.includes(t.code)){if(t.preventDefault(),!n||!r)return;const c=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=i.get(f.id);if(p)switch(t.code){case _t.Down:r.top<p.top&&c.push(f);break;case _t.Up:r.top>p.top&&c.push(f);break;case _t.Left:r.left>p.left&&c.push(f);break;case _t.Right:r.left<p.left&&c.push(f);break}});const u=sSe({collisionRect:r,droppableRects:i,droppableContainers:c});let d=IF(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const f=a.get(n.id),p=a.get(d),h=p?i.get(p.id):null,g=p==null?void 0:p.node.current;if(g&&h&&f&&p){const m=cg(g).some((C,w)=>s[w]!==C),v=nN(f,p),b=D_e(f,p),x=m||!v?{x:0,y:0}:{x:b?r.width-h.width:0,y:b?r.height-h.height:0},y={x:h.left,y:h.top};return x.x&&x.y?y:Vd(y,x)}}}};function nN(t,e){return!mg(t)||!mg(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function D_e(t,e){return!mg(t)||!mg(e)||!nN(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const $_e=Wn($.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),rN=G.createContext({attributes:{},listeners:void 0,ref(){}}),L_e=()=>{const{attributes:t,listeners:e,ref:n}=G.useContext(rN);return $.jsx(yt,Ae(ue(ue({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},t),e),{ref:n,children:$.jsx($_e,{})}))},iN=({children:t,id:e,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:a="plain"})=>{const{attributes:o,isDragging:s,listeners:c,setNodeRef:u,setActivatorNodeRef:d,transform:f,transition:p}=E_e({id:e}),h=G.useMemo(()=>({attributes:o,listeners:c,ref:d}),[o,c,d]),g={opacity:s?.6:void 0,transform:$o.Translate.toString(f),transition:p};return $.jsx(rN.Provider,{value:h,children:$.jsx(os,{variant:a,ref:u,style:g,startAction:i?$.jsx(L_e,{}):$.jsx($.Fragment,{}),endAction:i?$.jsx(Mn,{title:n,children:$.jsx(yt,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:$.jsx(DO,{})})}):$.jsx($.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:t})})},F_e={sideEffects:JF({styles:{active:{opacity:"0.6"}}})},N_e=({children:t})=>$.jsx(b_e,{dropAnimation:F_e,children:t}),j_e=({entities:t=[],labels:e,setEntities:n,removeItem:r})=>{const[i,a]=G.useState(null),o=G.useMemo(()=>t.find(c=>c.id===(i==null?void 0:i.id)),[i,t]),s=nSe(wF(s1),wF(a1,{coordinateGetter:M_e}));return $.jsxs(t_e,{sensors:s,onDragStart:({active:c})=>{a(c)},onDragEnd:({active:c,over:u})=>{if(u&&c.id!==(u==null?void 0:u.id)){const d=t.findIndex(({id:p})=>p===c.id),f=t.findIndex(({id:p})=>p===u.id);n(f1(t,d,f))}a(null)},onDragCancel:()=>{a(null)},children:[$.jsx(I_e,{items:t,children:$.jsx(_0,{sx:{gap:"10px"},children:t.map(c=>$.jsxs(iN,{id:c.id,variant:"outlined",removeItem:()=>r(c.id),tooltipTitle:e.removeEntity,children:[$.jsx(Je,{ml:2,children:c.title||c.name}),c.type&&$.jsx(oi,{color:Y1e(c.type),sx:{marginLeft:2},children:K1e(c.type)})]},`sortable-item-${c.id}`))})}),$.jsx(N_e,{children:o?$.jsx($.Fragment,{children:t.map(c=>$.jsx(iN,{id:c.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:e.removeEntity},`sortable-overlay-item-${c.id}`))}):$.jsx($.Fragment,{})})]})},B_e=t=>$.jsxs(Dt,{size:"sm",children:[$.jsx(Bt,{children:t.labels.itemsPerPage}),$.jsx(hr,{value:t.value,size:"sm",onChange:t.onChange,sx:{minHeight:"37px"},children:t.options.map((e,n)=>$.jsx(Hn,{value:e,children:e},`items-per-page-${e}-${n}`))})]}),z_e={Login:Mxe,InformationInput:Ed,RichText:Vw,HeaderButtons:sye,MarketSelection:Yxe,Accordion:Wpe,DynamicFields:_ye,BasicSelect:Gpe,BooleanSwitch:vCe,Branding:oye,ProfileSearchSelect:mCe,RangeCalendar:Iye,CompetitionSearchSelect:pCe,Related:Xxe,Images:cxe,Duration:Cye,DatePickerComponent:Od,Flags:axe,Spinner:eg,Tags:DL,Toast:er,AdContent:qpe,Match:Kxe,Winners:rIe,CompetitionsSearchSelect:hCe,TeamsSearchSelect:gCe,CustomSelect:hwe,Schedule:swe,NoPermissionCard:Sye,CustomFlatpickrCalendar:TC,ContextSelectFilter:aIe,NumberInput:OIe,EntityContext:NIe,MiniGamesImages:BIe,AuthRequirement:zIe,SortableList:j_e,ItemsPerPageFilter:B_e},aN=G.createContext(null),H_e=({children:t})=>$.jsx(aN.Provider,{value:z_e,children:t}),U_e=()=>{const t=G.useContext(aN);if(!t)throw new Error("useComponentContext must be used within a ComponentProvider");return t},oN=425,sN=1024,V_e=()=>{const[t,e]=G.useState(window.innerWidth<=sN),[n,r]=G.useState(window.innerWidth<=oN);return G.useLayoutEffect(()=>{const i=()=>{e(window.innerWidth<=sN),r(window.innerWidth<=oN)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:t,isPhone:n}},Nn={APIProvider:aue,AuthProvider:oue,AuthContext:HM,ComponentProvider:H_e,useComponentContext:U_e,useAPIContext:or,useIsMobile:V_e};class lN{constructor(){l(this,"types",[]);l(this,"languageConfig",null);l(this,"authRequirement",null)}}class W_e{constructor(e){l(this,"userNotFound");l(this,"clientFeaturesNotFoundMessage");l(this,"featureDisabled");l(this,"noPermissionMessage");l(this,"tryAgainButton");l(this,"signOut");l(this,"timeFormat");l(this,"getPollsErrorMessage");l(this,"title");l(this,"noPollsFound");l(this,"status");l(this,"votes");l(this,"creationDate");l(this,"actions");l(this,"pageNo");l(this,"back");l(this,"create");l(this,"edit");l(this,"save");l(this,"preview");l(this,"close");l(this,"sortBy");l(this,"sortByAscending");l(this,"sortByDescending");l(this,"language");l(this,"languageDescription");l(this,"contextEntityTag");l(this,"typeContextTagNamePlaceholder");l(this,"itemsPerPage");l(this,"showMoreImages");l(this,"hideMoreImages");l(this,"uploadImage");l(this,"copyUrl");l(this,"add");l(this,"configuration");l(this,"minimumVotes");l(this,"alternativeTitle");l(this,"description");l(this,"images");l(this,"branding");l(this,"urls");l(this,"primaryUrl");l(this,"secondaryUrl");l(this,"privacyPolicyUrl");l(this,"termsAndConditionsUrl");l(this,"additionalUrl");l(this,"colors");l(this,"primaryColor");l(this,"secondaryColor");l(this,"contentColor");l(this,"backgroundColor");l(this,"borderColor");l(this,"additionalColor");l(this,"mainLogo");l(this,"mobileLogo");l(this,"backgroundImage");l(this,"mobileBackgroundImage");l(this,"additionalImage");l(this,"embedCode");l(this,"embedCodePlaceholder");l(this,"rules");l(this,"adContent");l(this,"adContentPlaceholder");l(this,"mainImage");l(this,"coverImage");l(this,"mobileImage");l(this,"clearImage");l(this,"viewImage");l(this,"cropImage");l(this,"aspectRatio");l(this,"crop");l(this,"reset");l(this,"sportal365Images");l(this,"search");l(this,"delete");l(this,"fromDate");l(this,"toDate");l(this,"active");l(this,"inactive");l(this,"expired");l(this,"repeatedValueMessage");l(this,"flags");l(this,"flagsPlaceholder");l(this,"labels");l(this,"customFields");l(this,"keyDynamicFields");l(this,"valueDynamicFields");l(this,"options");l(this,"optionNumber");l(this,"optionsDescription");l(this,"context");l(this,"content");l(this,"tags");l(this,"campaign");l(this,"id");l(this,"label");l(this,"type");l(this,"typeDescription");l(this,"deleteLabel");l(this,"deletePollTitle");l(this,"deletePollDescription");l(this,"previewPoll");l(this,"hideFilters");l(this,"showFilters");l(this,"previous");l(this,"next");l(this,"clear");l(this,"getFootballEntitiesErrorMessage");l(this,"titleRequiredFieldValidationMessage");l(this,"optionsFieldValidationMessage");l(this,"tagsInvalidFieldValidationMessage");l(this,"getPollErrorMessage");l(this,"deletePollMessage");l(this,"deletePollErrorMessage");l(this,"createPollMessage");l(this,"createPollErrorMessage");l(this,"updatePollMessage");l(this,"updatePollErrorMessage");l(this,"uploadingImageMessage");l(this,"generateSignedInUrlErrorMessage");l(this,"uploadingImageErrorMessage");l(this,"encryptingImageErrorMessage");l(this,"searchSportal365ImagesErrorMessage");l(this,"managePollTitle");l(this,"managePollDescription");l(this,"addOption");l(this,"removeOption");l(this,"urlCopiedToClipboardMessage");l(this,"imageDeletedMessage");l(this,"imageResetMessage");l(this,"authRequirement");l(this,"authRequirementDescription");l(this,"free");l(this,"lead");l(this,"registered");l(this,"optionDescriptionExplanation");l(this,"additionalFields");l(this,"addDescription");l(this,"addImages");l(this,"schedule");l(this,"scheduledTaskNotAvailable");l(this,"createScheduledTaskMessage");l(this,"createScheduledTaskErrorMessage");l(this,"updateScheduledTaskMessage");l(this,"updateScheduledTaskErrorMessage");l(this,"deleteScheduledTaskMessage");l(this,"deleteScheduledTaskErrorMessage");l(this,"name");l(this,"changeStatusTo");l(this,"at");l(this,"deleteScheduledTaskModalTitle");l(this,"deleteScheduledTaskModalParagraph");l(this,"languagesModalTitle");l(this,"languagesModalDescription");l(this,"languagesModalSave");l(this,"languageParentText");l(this,"pollTranslationErrorMessage");l(this,"translateTo");l(this,"additionalInformation");l(this,"voting");l(this,"reports");l(this,"option");l(this,"exports");l(this,"exportUsersData");l(this,"category");l(this,"action");l(this,"exportAllUsers");l(this,"exportAllUsersDescription");l(this,"usersExportMessage");l(this,"usersExportErrorMessage");l(this,"participations");l(this,"performanceByDay");l(this,"exportUsersForOption");l(this,"exportAllUsersForOption");l(this,"exportForOption");this.userNotFound=e&&e.userNotFound?e.userNotFound:"User not found. Please try again",this.clientFeaturesNotFoundMessage=(e==null?void 0:e.clientFeaturesNotFoundMessage)||"There was a problem fetching client's configuration. Please check again your API key and client ID. For more information contact Fans United staff.",this.featureDisabled=e&&e.featureDisabled?e.featureDisabled:"Feature disabled!",this.noPermissionMessage=e&&e.noPermissionMessage?e.noPermissionMessage:"You have no permission for this feature!",this.tryAgainButton=e&&e.tryAgainButton?e.tryAgainButton:"Try again",this.signOut=e&&e.signOut?e.signOut:"Sign out",this.noPollsFound=e&&e.noPollsFound?e.noPollsFound:"No polls games were found. You can create one by clicking the button 'Create'",this.timeFormat=e&&e.timeFormat?e.timeFormat:"DD.MM.YYYY, HH:mm",this.getPollsErrorMessage=e&&e.getPollsErrorMessage?e.getPollsErrorMessage:"There was a problem with fetching list of polls",this.title=e&&e.title?e.title:"Title",this.status=e&&e.status?e.status:"Status",this.votes=(e==null?void 0:e.votes)||"Votes",this.creationDate=e&&e.creationDate?e.creationDate:"Created at",this.actions=e&&e.actions?e.actions:"Actions",this.pageNo=e&&e.pageNo?e.pageNo:"Page No",this.back=e&&e.back?e.back:"Back",this.create=e&&e.create?e.create:"Create",this.edit=e&&e.edit?e.edit:"Edit",this.save=e&&e.save?e.save:"Save",this.preview=e&&e.preview?e.preview:"Preview",this.close=e&&e.close?e.close:"Close",this.sortBy=(e==null?void 0:e.sortBy)||"Sort by:",this.sortByAscending=(e==null?void 0:e.sortByAscending)||"Sort by created at field in ascending order",this.sortByDescending=(e==null?void 0:e.sortByDescending)||"Sort by created at field in descending order",this.language=(e==null?void 0:e.language)||"Language",this.languageDescription=(e==null?void 0:e.languageDescription)||"Select the language for your Poll. You can manage language selection by configuring available languages in language configuration. It cannot be changed if multilingual feature is in use.",this.contextEntityTag=(e==null?void 0:e.contextEntityTag)||"Context entity tag",this.typeContextTagNamePlaceholder=(e==null?void 0:e.typeContextTagNamePlaceholder)||"Type context tag name...",this.itemsPerPage=(e==null?void 0:e.itemsPerPage)||"Items per page",this.showMoreImages=(e==null?void 0:e.showMoreImages)||"Show more images",this.hideMoreImages=(e==null?void 0:e.hideMoreImages)||"Hide more images",this.uploadImage=(e==null?void 0:e.uploadImage)||"Upload image",this.copyUrl=(e==null?void 0:e.copyUrl)||"Copy URL",this.add=(e==null?void 0:e.add)||"Add",this.configuration=(e==null?void 0:e.configuration)||"Configuration",this.minimumVotes=(e==null?void 0:e.minimumVotes)||"Minimum votes",this.alternativeTitle=e&&e.alternativeTitle?e.alternativeTitle:"Alternative title",this.description=e&&e.description?e.description:"Description",this.images=e&&e.images?e.images:"Images",this.branding=(e==null?void 0:e.branding)||"Branding",this.urls=(e==null?void 0:e.urls)||"URLs",this.primaryUrl=(e==null?void 0:e.primaryUrl)||"Primary URL",this.secondaryUrl=(e==null?void 0:e.secondaryUrl)||"Secondary URL",this.privacyPolicyUrl=(e==null?void 0:e.privacyPolicyUrl)||"Privacy Policy URL",this.termsAndConditionsUrl=(e==null?void 0:e.termsAndConditionsUrl)||"Terms and Conditions URL",this.additionalUrl=(e==null?void 0:e.additionalUrl)||"Additional URL",this.colors=(e==null?void 0:e.colors)||"Colors",this.primaryColor=(e==null?void 0:e.primaryColor)||"Primary Color",this.secondaryColor=(e==null?void 0:e.secondaryColor)||"Secondary Color",this.contentColor=(e==null?void 0:e.contentColor)||"Content Color",this.backgroundColor=(e==null?void 0:e.backgroundColor)||"Background Color",this.borderColor=(e==null?void 0:e.borderColor)||"Border Color",this.additionalColor=(e==null?void 0:e.additionalColor)||"Additional Color",this.mainLogo=(e==null?void 0:e.mainLogo)||"Main Logo",this.mobileLogo=(e==null?void 0:e.mobileLogo)||"Mobile Logo",this.backgroundImage=(e==null?void 0:e.backgroundImage)||"Background Image",this.mobileBackgroundImage=(e==null?void 0:e.mobileBackgroundImage)||"Mobile Background Image",this.additionalImage=(e==null?void 0:e.additionalImage)||"Additional Image",this.embedCode=(e==null?void 0:e.embedCode)||"Embed Code",this.embedCodePlaceholder=(e==null?void 0:e.embedCodePlaceholder)||"Place your embed code here",this.rules=e&&e.rules?e.rules:"Rules",this.adContent=e&&e.adContent?e.adContent:"Ad content",this.adContentPlaceholder=e&&e.adContentPlaceholder?e.adContentPlaceholder:"Place your ad content",this.mainImage=e&&e.mainImage?e.mainImage:"Main",this.coverImage=e&&e.coverImage?e.coverImage:"Cover",this.mobileImage=e&&e.mobileImage?e.mobileImage:"Mobile",this.active=e&&e.active?e.active:"Active",this.inactive=e&&e.inactive?e.inactive:"Inactive",this.expired=e&&e.expired?e.expired:"Expired",this.optionsDescription=(e==null?void 0:e.optionsDescription)||"Describe the options that users will select from the poll. Ensure to provide a minimum of 2 options. Title for each is required",this.repeatedValueMessage=e&&e.repeatedValueMessage?e.repeatedValueMessage:"You have entered a repeated value. Please enter a different one.",this.flags=e&&e.flags?e.flags:"Flags",this.flagsPlaceholder=e&&e.flagsPlaceholder?e.flagsPlaceholder:"Type your flag and hit enter",this.labels=e&&e.labels?e.labels:"Labels",this.customFields=e&&e.customFields?e.customFields:"Custom fields",this.keyDynamicFields=e&&e.keyDynamicFields?e.keyDynamicFields:"Key",this.valueDynamicFields=e&&e.valueDynamicFields?e.valueDynamicFields:"Value",this.options=e&&e.options?e.options:"Options",this.optionNumber=e&&e.optionNumber?e.optionNumber:"Option number",this.context=e&&e.context?e.context:"Context",this.content=e&&e.content?e.content:"Content",this.tags=e&&e.tags?e.tags:"Tags",this.campaign=e&&e.campaign?e.campaign:"Campaign",this.id=e&&e.id?e.id:"ID",this.label=e&&e.label?e.label:"Label",this.type=e&&e.type?e.type:"Type",this.typeDescription=e&&e.typeDescription?e.typeDescription:"Select the poll type. You can set the types in our Management Portal by going to Features, then clicking on the Poll page",this.previewPoll=e&&e.previewPoll?e.previewPoll:"Preview poll",this.deletePollTitle=(e==null?void 0:e.deletePollTitle)||"Delete Poll",this.deletePollDescription=(e==null?void 0:e.deletePollDescription)||"Are you sure you want to delete",this.deleteLabel=e&&e.deleteLabel?e.deleteLabel:"Delete",this.hideFilters=e&&e.hideFilters?e.hideFilters:"Hide filters",this.showFilters=e&&e.showFilters?e.showFilters:"Show filters",this.previous=e&&e.previous?e.previous:"Previous",this.next=e&&e.next?e.next:"Next",this.clear=e&&e.clear?e.clear:"Clear",this.getFootballEntitiesErrorMessage=e&&e.getFootballEntitiesErrorMessage?e.getFootballEntitiesErrorMessage:"There was a problem with fetching football's data",this.createPollMessage=e&&e.createPollMessage?e.createPollMessage:"You have successfully created poll",this.createPollErrorMessage=e&&e.createPollErrorMessage?e.createPollErrorMessage:"There was a problem creating poll. Please try again",this.titleRequiredFieldValidationMessage=e&&e.titleRequiredFieldValidationMessage?e.titleRequiredFieldValidationMessage:"Title field is required!",this.optionsFieldValidationMessage=(e==null?void 0:e.optionsFieldValidationMessage)||"Options must have titles",this.tagsInvalidFieldValidationMessage=e&&e.tagsInvalidFieldValidationMessage?e.tagsInvalidFieldValidationMessage:"Tag entity is required!",this.getPollErrorMessage=e&&e.getPollErrorMessage?e.getPollErrorMessage:"There was a problem with fetching poll data. Please try again",this.deletePollMessage=e&&e.deletePollMessage?e.deletePollMessage:"You have successfully deleted poll",this.deletePollErrorMessage=e&&e.deletePollErrorMessage?e.deletePollErrorMessage:"There was a problem with deleting poll. Please try again",this.updatePollMessage=e&&e.updatePollMessage?e.updatePollMessage:"You have successfully updated the poll",this.updatePollErrorMessage=e&&e.updatePollErrorMessage?e.updatePollErrorMessage:"There was a problem updating the poll. Please try again",this.uploadingImageMessage=e&&e.uploadingImageMessage?e.uploadingImageMessage:"You have successfully uploaded image",this.generateSignedInUrlErrorMessage=e&&e.generateSignedInUrlErrorMessage?e.generateSignedInUrlErrorMessage:"There was a problem generating signed in URL to store the image in bucket. Please try again",this.uploadingImageErrorMessage=e&&e.uploadingImageErrorMessage?e.uploadingImageErrorMessage:"There was a problem with uploading image to bucket. Please try again",this.encryptingImageErrorMessage=e&&e.encryptingImageErrorMessage?e.encryptingImageErrorMessage:"There was a problem with encrypting image before uploading it to bucket. Please try again",this.searchSportal365ImagesErrorMessage=e&&e.searchSportal365ImagesErrorMessage?e.searchSportal365ImagesErrorMessage:"There was a problem with searching images from Sportal 365 API. Please try again",this.managePollTitle=(e==null?void 0:e.managePollTitle)||"Manage Poll",this.managePollDescription=(e==null?void 0:e.managePollDescription)||"Manage your Poll here",this.addOption=(e==null?void 0:e.addOption)||"Add option",this.removeOption=(e==null?void 0:e.removeOption)||"Remove option",this.clearImage=(e==null?void 0:e.clearImage)||"Clear image",this.viewImage=(e==null?void 0:e.viewImage)||"View image",this.cropImage=(e==null?void 0:e.cropImage)||"Crop image",this.urlCopiedToClipboardMessage=(e==null?void 0:e.urlCopiedToClipboardMessage)||"URL copied to clipboard",this.imageDeletedMessage=(e==null?void 0:e.imageDeletedMessage)||"Image deleted",this.imageResetMessage=(e==null?void 0:e.imageResetMessage)||"The initial size of the image has been restored",this.aspectRatio=(e==null?void 0:e.aspectRatio)||"Aspect ratio",this.crop=(e==null?void 0:e.crop)||"Crop",this.reset=(e==null?void 0:e.reset)||"Reset",this.sportal365Images=(e==null?void 0:e.sportal365Images)||"Sportal365 Images",this.search=(e==null?void 0:e.search)||"Search",this.delete=(e==null?void 0:e.delete)||"Delete",this.fromDate=(e==null?void 0:e.fromDate)||"From Date",this.toDate=(e==null?void 0:e.toDate)||"To Date",this.authRequirement=(e==null?void 0:e.authRequirement)||"Auth Requirement",this.authRequirementDescription=(e==null?void 0:e.authRequirementDescription)||"Choose the type of authentication to be used.",this.free=(e==null?void 0:e.free)||"Free",this.lead=(e==null?void 0:e.lead)||"Lead",this.registered=(e==null?void 0:e.registered)||"Registered",this.optionDescriptionExplanation=(e==null?void 0:e.optionDescriptionExplanation)||"This optional field allows you to provide users with more information about the option",this.additionalFields=(e==null?void 0:e.additionalFields)||"Additional fields",this.addDescription=(e==null?void 0:e.addDescription)||"Add description",this.addImages=(e==null?void 0:e.addImages)||"Add images",this.schedule=(e==null?void 0:e.schedule)||"Schedule",this.scheduledTaskNotAvailable=(e==null?void 0:e.scheduledTaskNotAvailable)||"To configure scheduled tasks you need to first create your poll",this.createScheduledTaskMessage=(e==null?void 0:e.createScheduledTaskMessage)||"You have successfully created scheduled task",this.createScheduledTaskErrorMessage=(e==null?void 0:e.createScheduledTaskErrorMessage)||"An error occurred while creating scheduled task. Please try again later",this.updateScheduledTaskMessage=(e==null?void 0:e.updateScheduledTaskMessage)||"You have successfully updated scheduled task",this.updateScheduledTaskErrorMessage=(e==null?void 0:e.updateScheduledTaskErrorMessage)||"An error occurred while updating scheduled task. Please try again later",this.deleteScheduledTaskMessage=(e==null?void 0:e.deleteScheduledTaskMessage)||"You have successfully deleted scheduled task",this.deleteScheduledTaskErrorMessage=(e==null?void 0:e.deleteScheduledTaskErrorMessage)||"An error occurred while deleting scheduled task. Please try again later",this.name=(e==null?void 0:e.name)||"Name",this.changeStatusTo=(e==null?void 0:e.changeStatusTo)||"Change status to:",this.at=(e==null?void 0:e.at)||"At:",this.deleteScheduledTaskModalTitle=(e==null?void 0:e.deleteScheduledTaskModalTitle)||"Delete scheduled task",this.deleteScheduledTaskModalParagraph=(e==null?void 0:e.deleteScheduledTaskModalParagraph)||"Are you sure you want to delete the following scheduled task: ",this.languagesModalTitle=(e==null?void 0:e.languagesModalTitle)||"Select Languages",this.languagesModalDescription=(e==null?void 0:e.languagesModalDescription)||"Select the languages this poll is going to be translated in.",this.languagesModalSave=(e==null?void 0:e.languagesModalSave)||"Save language preference",this.pollTranslationErrorMessage=(e==null?void 0:e.pollTranslationErrorMessage)||"An error occurred while translating the poll.",this.languageParentText=(e==null?void 0:e.languageParentText)||"This poll is a translated version of",this.translateTo=(e==null?void 0:e.translateTo)||"Translate to _language_",this.additionalInformation=(e==null?void 0:e.additionalInformation)||"Additional information",this.voting=(e==null?void 0:e.voting)||"Voting",this.reports=(e==null?void 0:e.reports)||"Reports",this.option=(e==null?void 0:e.option)||"Option",this.exports=(e==null?void 0:e.exports)||"Exports",this.exportUsersData=(e==null?void 0:e.exportUsersData)||"Export users data",this.category=(e==null?void 0:e.category)||"Category",this.action=(e==null?void 0:e.action)||"Action",this.exportAllUsers=(e==null?void 0:e.exportAllUsers)||"Export all users",this.exportAllUsersDescription=(e==null?void 0:e.exportAllUsersDescription)||"Export all users who voted in the poll.",this.usersExportMessage=(e==null?void 0:e.usersExportMessage)||"Users have been exported successfully",this.usersExportErrorMessage=(e==null?void 0:e.usersExportErrorMessage)||"There was a problem with exporting users. Please try again",this.participations=(e==null?void 0:e.participations)||"Participations",this.performanceByDay=(e==null?void 0:e.performanceByDay)||"Performance by day",this.exportUsersForOption=(e==null?void 0:e.exportUsersForOption)||"Export users voted for option",this.exportAllUsersForOption=(e==null?void 0:e.exportAllUsersForOption)||"Export all users who voted for option",this.exportForOption=(e==null?void 0:e.exportForOption)||"Export for option"}}const Zt=G.createContext(null),q_e=({labels:t,children:e})=>{const n=new W_e(t);return L.jsx(Zt.Provider,{value:n,children:e})},Fo=G.createContext(null),G_e=({features:t,children:e})=>L.jsx(Fo.Provider,{value:t,children:e}),Y_e=({children:t})=>L.jsx(Ne,{width:"100%",sx:{backgroundColor:"#fff"},children:t});function $t(t){const e=G.useContext(t);if(e===void 0)throw new Error("Context was used outside of its Provider");return e}const K_e=t=>{const e=$t(Zt);return L.jsxs(Ne,{p:2,children:[L.jsx(Je,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:L.jsx(jre,{fontSize:"inherit"}),onClick:t.onClickBack,children:e.back}),L.jsx(Je,{level:"h3",children:e.managePollTitle}),L.jsx(na,{children:e.managePollDescription})]})};class cN{constructor(){l(this,"isValid",!0);l(this,"message","");l(this,"validate",(e,n)=>{this.validateRequiredFields(e,n),this.isValid&&(this.validateOptions(e.options,n),this.validateContext(e.context,n))});l(this,"validateRequiredFields",(e,n)=>{e.title||(this.isValid=!1,this.message=n.titleRequiredFieldValidationMessage)});l(this,"validateOptions",(e,n)=>{e.forEach(r=>{r.title||(this.isValid=!1,this.message=n.optionsFieldValidationMessage)})});l(this,"validateContext",(e,n)=>{e&&e.tags.forEach(r=>{r.id||(this.isValid=!1,this.message=n.tagsInvalidFieldValidationMessage)})})}}class J_e{constructor(){l(this,"id","");l(this,"title",null);l(this,"alternative_title",null);l(this,"description",null);l(this,"auth_requirement",null);l(this,"type",null);l(this,"language",null);l(this,"total_votes",null);l(this,"rules",null);l(this,"ad_content",null);l(this,"labels",null);l(this,"branding",null);l(this,"embed_code",null);l(this,"custom_fields",null);l(this,"images",null);l(this,"status","INACTIVE");l(this,"flags",[]);l(this,"context",null);l(this,"options",[]);l(this,"related",[])}}class p1{constructor(){l(this,"createNewRequestBody",e=>{if(!e){const n=new J_e;return n.options=this.constructEmptyCreateOptions(),n}return e.branding=this.reconstructBranding(le({},e.branding)),e.context=this.createContext(le({},e.context)),le({},e)});l(this,"finalizeNewRequestBody",(e,n)=>(e.images&&(e.images=this.reconstructImages(le({},e.images))),e.branding&&(e.branding=this.reconstructBranding(le({},e.branding))),e.context&&(e.context=this.reconstructContext(le({},e.context))),e.language=e.language||n.languageConfig.default_language,e.auth_requirement=e.auth_requirement||n.authRequirement,delete e.id,e));l(this,"reconstructImages",e=>this.isObjectValuesEmpty(e)?null:e);l(this,"reconstructBranding",e=>(e.urls||(e.urls={primary_url:"",secondary_url:"",privacy_policy_url:"",terms_and_conditions_url:"",additional_url:""}),e.colors||(e.colors={primary_color:"",secondary_color:"",content_color:"",background_color:"",border_color:"",additional_color:""}),e.images||(e.images={main_logo:"",mobile_logo:"",background_image:"",mobile_background_image:"",additional_image:""}),e));l(this,"reconstructContext",e=>(e.content&&this.isObjectValuesEmpty(e.content)&&(e.content=null),e.tags=e.tags.filter(n=>n.id),e.campaign&&this.isObjectValuesEmpty(e.campaign)&&(e.campaign=null),!e.content&&!e.tags.length&&!e.campaign?null:e));l(this,"createImagesModel",()=>({main:"",cover:"",mobile:""}));l(this,"createContext",e=>e?(e.content||(e.content={id:"",label:"",type:""}),e.tags||(e.tags=[]),e.campaign||(e.campaign={id:"",label:""}),e):{content:{id:"",label:"",type:""},tags:[],campaign:{id:"",label:""}});l(this,"isObjectValuesEmpty",e=>Object.values(e).every(n=>!n));l(this,"constructOptions",e=>e&&e.length?(e.forEach(n=>{n.images||(n.images=this.createImagesModel())}),Array.from(e)):this.constructEmptyCreateOptions());l(this,"constructEmptyCreateOptions",()=>{const e=[];for(let r=0;r<2;r++)e.push({title:"",description:"",images:this.createImagesModel()});return e});l(this,"constructEmptyOption",e=>({id:e,title:"",description:"",images:this.createImagesModel(),votes:0}))}}const gg=t=>(t==null?void 0:t.main)||(t==null?void 0:t.cover)||(t==null?void 0:t.mobile),Q_e=({isOpen:t,requestBody:e,handleClose:n})=>{const r=$t(Zt);return L.jsx(gl,{open:t,onClose:n,children:L.jsxs(vl,{children:[L.jsxs(ml,{children:[L.jsx(Hre,{}),r.previewPoll]}),L.jsx(vo,{}),L.jsxs(hl,{children:[L.jsx(Je,{fontWeight:"500",mb:1,children:e.title}),L.jsx(Qp,{variant:"plain",sx:{mb:1},children:gg(e.images)?L.jsx("img",{src:gg(e.images),alt:"main-image"}):L.jsx(MO,{})}),L.jsx(Je,{mb:1,children:L.jsx("article",{dangerouslySetInnerHTML:{__html:e.description}})}),L.jsx(vo,{sx:{mb:1}}),e.options.map((i,a)=>L.jsx(si,{sx:{mb:1},children:L.jsx(ta,{children:L.jsxs(us,{direction:"row",spacing:2,children:[L.jsx(Qp,{variant:"plain",sx:{minWidth:200},children:gg(i.images)?L.jsx("img",{src:gg(i.images),alt:`option-${a}-image`}):L.jsx(MO,{})}),L.jsxs(us,{children:[L.jsxs(Je,{level:"title-md",alignContent:"center",children:[a+1,". ",i.title]}),L.jsx(Je,{level:"body-md",alignContent:"center",children:L.jsx("article",{dangerouslySetInnerHTML:{__html:i.description}})})]})]})})},a))]}),L.jsx(Pu,{children:L.jsx(yt,{variant:"plain",color:"neutral",onClick:i=>{i.stopPropagation(),n()},children:r.close})})]})})},X_e={colors:{primary_color:"",secondary_color:"",content_color:"",background_color:"",border_color:"",additional_color:""},urls:{primary_url:"",secondary_url:"",privacy_policy_url:"",terms_and_conditions_url:"",additional_url:""},images:{main_logo:"",mobile_logo:"",background_image:"",mobile_background_image:"",additional_image:""}},pt={ar:{key:"ar",name:"Arabic"},bg:{key:"bg",name:"Bulgarian"},da:{key:"da",name:"Danish"},de:{key:"de",name:"German"},en:{key:"en",name:"English"},el:{key:"el",name:"Greek"},es:{key:"es",name:"Spanish"},fr:{key:"fr",name:"French"},hu:{key:"hu",name:"Hungarian"},it:{key:"it",name:"Italian"},nl:{key:"nl",name:"Dutch"},pt:{key:"pt",name:"Portuguese"},"pt-br":{key:"pt-br",name:"Brazilian(Portuguese)"},ro:{key:"ro",name:"Romanian"},sk:{key:"sk",name:"Slovak"},sr:{key:"sr",name:"Serbian"},sv:{key:"sv",name:"Swedish"},sw:{key:"sw",name:"Swahili"}},vg={ar:pt.ar,"ar-dz":pt.ar,"ar-bh":pt.ar,"ar-eg":pt.ar,"ar-iq":pt.ar,"ar-jo":pt.ar,"ar-kw":pt.ar,"ar-lb":pt.ar,"ar-ly":pt.ar,"ar-ma":pt.ar,"ar-om":pt.ar,"ar-qa":pt.ar,"ar-sa":pt.ar,"ar-sy":pt.ar,"ar-tn":pt.ar,"ar-ae":pt.ar,"ar-ye":pt.ar,bg:pt.bg,da:pt.da,de:pt.de,en:pt.en,"en-gb":pt.en,"en-us":pt.en,el:pt.el,es:pt.es,fr:pt.fr,hu:pt.hu,it:pt.it,nl:pt.nl,pt:pt.pt,"pt-br":pt["pt-br"],ro:pt.ro,sk:pt.sk,sr:pt.sr,sv:pt.sv,sw:pt.sw};var Ps=(t=>(t.SHOW_DESCRIPTION="show_description",t.SHOW_IMAGES="show_images",t))(Ps||{});const Z_e=[10,15,20,25,50],eke=t=>{const e=$t(Zt),{RichText:n,Images:r}=Nn.useComponentContext(),i=o=>{t.option.images=o,t.onChange(t.option)},a=o=>{t.option.description=o};if(t.field===Ps.SHOW_IMAGES)return L.jsx(r,{labels:e,defaultValue:t.option.images,onChange:i});if(t.field===Ps.SHOW_DESCRIPTION)return L.jsx(Ne,{mb:1,children:L.jsx(n,{label:e.description,property:"mini_games_explanation",defaultValue:t.option.description||"",placeholder:"",description:e.optionDescriptionExplanation,onChange:a})})},tke=(t,e)=>t?!e.title:!0,nke=t=>{const[e,n]=G.useState(tke(t.isEditMode,t.option)),r=$t(Zt),i=(o,s)=>{n(s)},a=o=>{o.persist(),t.option.title=o.target.value,t.onChange(t.option)};return L.jsxs(I0,{sx:{p:0,overflow:"hidden"},expanded:e,onChange:i,children:[L.jsx(P0,{variant:"soft",sx:{px:3},children:t.option.title||`${r.optionNumber}: ${t.optionNumber}`}),L.jsx(S0,{sx:{"& > div":{pb:0}},children:L.jsxs(si,{variant:"plain",sx:{borderRadius:0},children:[L.jsxs(ta,{children:[L.jsxs(Dt,{sx:{mb:1},children:[L.jsx(Bt,{required:!0,children:r.title}),L.jsx(ea,{size:"lg",name:"title",type:"text",value:t.option.title,onChange:a,required:!0})]}),t.additionalFields.map(o=>L.jsx(eke,{option:t.option,field:o,onChange:t.onChange},`option-id-${t.option.id?t.option.id:Math.random()}-field-${o}`))]}),L.jsxs(TE,{variant:"plain",children:[L.jsx(vo,{inset:"context"}),L.jsx(ta,{orientation:"horizontal",sx:{display:"flex",justifyContent:"flex-end"},children:L.jsx(yt,{startDecorator:L.jsx(px,{}),variant:"outlined",color:"danger",size:"sm",onClick:t.onDelete,disabled:t.disableDelete||t.isPollVoted,children:r.removeOption})})]})]})})]})},rke=({label:t,values:e,allValues:n,valuesMap:r,showAll:i,showAllLabel:a,onChange:o,toggleShowAll:s})=>{const c=(u,d)=>{u.persist();let f=[...e];if(u.target.checked){f.push(d),o(f);return}f=e.filter(p=>p!==d),o(f)};return L.jsxs(Ne,{sx:{my:2},children:[L.jsx(Je,{level:"body-xs",mb:1,fontWeight:"bold",children:t}),L.jsxs(_0,{orientation:"horizontal",wrap:!0,sx:{"--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(u=>L.jsxs(os,{children:[e.includes(u)&&L.jsx(Bre,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),L.jsx($0,{checked:e.includes(u),variant:e.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[u]||"N/A",onChange:d=>c(d,u),slotProps:{action:({checked:d})=>({sx:d?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${t}-${u}`)),i===!1?L.jsx(os,{children:L.jsx(Ou,{onClick:s,children:a})}):L.jsx(L.Fragment,{})]})]})},uN=new p1,ike=2,ake=t=>{const e=[];return t.some(n=>n.description)&&e.push(Ps.SHOW_DESCRIPTION),t.some(n=>n.images&&(n.images.main||n.images.mobile||n.images.cover))&&e.push(Ps.SHOW_IMAGES),e},oke=({isEditMode:t,isPollVoted:e,options:n,onChange:r})=>{const[i,a]=G.useState(ake(n)),o=$t(Zt),s=uN.constructOptions(n),c=()=>{const p=uN.constructEmptyOption(`${s.length+1}`);f([...s,p])},u=(p,h)=>{const g=Array.from(s);g[h]=p,f(g)},d=p=>{const h=s.filter(g=>g.id!==p);f(h)},f=p=>{r(p)};return L.jsxs(Ne,{mb:2,children:[L.jsxs(Ne,{mb:2,children:[L.jsxs(Dt,{children:[L.jsx(Bt,{color:"primary",children:o.options}),L.jsx(na,{children:o.optionsDescription})]}),L.jsx(rke,{label:o.additionalFields,values:i,allValues:[Ps.SHOW_DESCRIPTION,Ps.SHOW_IMAGES],valuesMap:{show_description:o.addDescription,show_images:o.addImages},onChange:p=>a(p)}),L.jsx(Ne,{my:2,flex:"flex",alignItems:"center",children:L.jsx(yt,{variant:"outlined",onClick:c,startDecorator:L.jsx(Nre,{}),sx:{mr:2},children:o.addOption})})]}),L.jsx(k0,{variant:"outlined",sx:{borderRadius:"5px"},children:s.map((p,h)=>L.jsx(nke,{option:p,optionNumber:h+1,isEditMode:t,isPollVoted:e,additionalFields:i,disableDelete:s.length<=ike,onDelete:()=>d(p.id),onChange:g=>u(g,h)},p.id))})]})},ske=({isEditMode:t,requestBody:e,onRequestBodyUpdate:n,parentTitle:r,onParentSelect:i})=>{const a=$t(Zt),{InformationInput:o,RichText:s}=Nn.useComponentContext(),c=p=>{p.persist();const h=p.target.value?p.target.value:null;n(je(le({},e),{title:h}))},u=p=>{p.persist();const h=p.target.value?p.target.value:null;n(je(le({},e),{alternative_title:h}))},d=p=>{n(je(le({},e),{description:p}))},f=p=>{n(je(le({},e),{options:p}))};return L.jsxs(Ne,{sx:{width:{xs:"100%",sm:"70%"}},mr:{sm:2},children:[r&&L.jsx(DK,{variant:"outlined",color:"primary",startDecorator:L.jsx(zre,{}),sx:{mb:2,cursor:"pointer"},onClick:i,children:`${a.languageParentText} "${r}"`}),L.jsx(o,{label:a.title,placeholder:"",defaultValue:e.title||"",value:e.title||"",required:!0,onChange:c}),L.jsx(o,{label:a.alternativeTitle,placeholder:"",defaultValue:e.alternative_title||"",value:e.alternative_title||"",required:!1,onChange:u}),L.jsx(s,{label:a.description,placeholder:"",property:"description",value:e.description,defaultValue:e.description,onChange:d}),L.jsx(oke,{isEditMode:t,isPollVoted:e.total_votes>0,options:e.options,onChange:f})]})},lke=t=>{const e=$t(Zt),n={ACTIVE:e.active,INACTIVE:e.inactive,EXPIRED:e.expired},r=(i,a)=>{t.onChange(a||"")};return L.jsxs(Dt,{size:"sm",sx:{mb:2},children:[L.jsx(Bt,{color:"primary",children:e.status}),L.jsx(hr,{value:t.defaultValue,onChange:r,sx:{minHeight:"37px"},children:Object.keys(n).map((i,a)=>L.jsx(Hn,{value:i,children:n[i]},`status-select-${i}-${a}`))})]})},cke=({defaultValue:t,onChange:e})=>{const{types:n}=$t(Fo),r=$t(Zt),i=G.useRef(null);return L.jsxs(Dt,{size:"sm",sx:{mb:2},children:[L.jsx(Bt,{children:r.type}),L.jsx(hr,je(le({value:t,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,o)=>e(o),sx:{minHeight:"37px"}},t&&{endDecorator:L.jsx(Rn,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;e(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:L.jsx(fx,{})}),indicator:null}),{children:n.map(a=>L.jsx(Hn,{value:a.id,children:a.label},a.id))})),L.jsx(na,{children:r.typeDescription})]})},uke=t=>{const e=$t(Zt),n=$t(Fo),r=n.languageConfig.default_language?[n.languageConfig.default_language,...n.languageConfig.available_languages]:n.languageConfig.available_languages;return L.jsxs(Dt,{sx:{mb:2},children:[L.jsx(Bt,{children:e.language}),L.jsx(hr,{disabled:t.isReadOnly,value:t.isPollVoted?t.defaultValue:t.defaultValue||n.languageConfig.default_language,onChange:(i,a)=>t.onChange(a),children:r.map(i=>L.jsx(Hn,{value:i,children:pt[i].name},`language-select-${i}`))}),L.jsx(na,{children:e.languageDescription})]})},dke=t=>{var u;const e=$t(Zt),n=$t(Fo),{AuthRequirement:r}=Nn.useComponentContext(),i=(u=t.requestBody.related)==null?void 0:u.some(d=>d.entity_relationship==="translatedFrom"),a=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{status:d}))},o=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{type:d}))},s=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{language:d}))},c=d=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{auth_requirement:d}))};return L.jsxs(L.Fragment,{children:[t.requestBody.id?L.jsxs(Dt,{size:"sm",sx:{mb:2},children:[L.jsx(Bt,{color:"primary",children:e.id}),L.jsx(ea,{size:"md",readOnly:!0,variant:"outlined",color:"neutral",name:"id",value:t.requestBody.id,sx:{opacity:.5,borderRadius:"md"}})]}):L.jsx(L.Fragment,{}),L.jsx(lke,{defaultValue:t.requestBody.status||"INACTIVE",onChange:a}),L.jsx(uke,{isReadOnly:t.isMultilingual||i,isPollVoted:t.isPollVoted,defaultValue:t.requestBody.language,onChange:s}),L.jsx(cke,{defaultValue:t.requestBody.type,onChange:o}),L.jsx(r,{defaultValue:t.requestBody.auth_requirement||n.authRequirement,onChange:c,labels:e})]})},fke=new p1,pke=t=>{const e=$t(Zt),{RichText:n,Accordion:r,DynamicFields:i,Branding:a,Images:o,Flags:s,EntityContext:c,Schedule:u}=Nn.useComponentContext(),d=y=>{y.persist(),t.onRequestBodyUpdate(je(le({},t.requestBody),{ad_content:y.target.value||null}))},f=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{branding:y}))},p=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{context:y}))},h=y=>{y=Object.keys(y).length?y:null,t.onRequestBodyUpdate(je(le({},t.requestBody),{custom_fields:y}))},g=y=>{y.persist(),t.onRequestBodyUpdate(je(le({},t.requestBody),{embed_code:y.target.value||null}))},m=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{flags:y.length?y:null}))},v=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{images:y}))},b=y=>{y=Object.keys(y).length?y:null,t.onRequestBodyUpdate(je(le({},t.requestBody),{labels:y}))},x=y=>{t.onRequestBodyUpdate(je(le({},t.requestBody),{rules:y||null}))};return L.jsxs(Ne,{sx:{width:{xs:"100%",sm:"30%"}},children:[L.jsx(r,{label:e.adContent,children:L.jsx(W0,{value:t.requestBody.ad_content,minRows:"7",onChange:d,placeholder:e.adContentPlaceholder,sx:{marginBottom:"16px",resize:"vertical",backgroundColor:"#fff","&::before":{border:"1.5px solid var(--Textarea-focusedHighlight)",transform:"scaleX(0)",left:"2.5px",right:"2.5px",bottom:0,top:"unset",transition:"transform .15s cubic-bezier(0.1,0.9,0.2,1)",borderRadius:0,borderBottomLeftRadius:"64px 20px",borderBottomRightRadius:"64px 20px"},"&:focus-within::before":{transform:"scaleX(1)"}}})}),L.jsx(r,{label:e.branding,children:L.jsx(a,{labels:e,defaultValue:t.requestBody.branding||le({},X_e),onChange:f})}),L.jsx(r,{label:e.configuration,children:L.jsx(dke,{requestBody:t.requestBody,isMultilingual:t.isMultilingual,isPollVoted:t.isPollVoted,onRequestBodyUpdate:t.onRequestBodyUpdate})}),L.jsx(r,{label:e.context,children:L.jsx(c,{labels:e,context:t.requestBody.context||fke.createContext(null),onChange:p})}),L.jsx(r,{label:e.customFields,children:L.jsx(i,{labels:e,type:e.customFields,defaultValue:t.requestBody.custom_fields,onChange:h})}),L.jsx(r,{label:e.embedCode,children:L.jsx(W0,{value:t.requestBody.embed_code,minRows:"5",onChange:g,placeholder:e.embedCodePlaceholder,sx:{marginBottom:"16px",resize:"vertical",backgroundColor:"#fff","&::before":{border:"1.5px solid var(--Textarea-focusedHighlight)",transform:"scaleX(0)",left:"2.5px",right:"2.5px",bottom:0,top:"unset",transition:"transform .15s cubic-bezier(0.1,0.9,0.2,1)",borderRadius:0,borderBottomLeftRadius:"64px 20px",borderBottomRightRadius:"64px 20px"},"&:focus-within::before":{transform:"scaleX(1)"}}})}),L.jsx(r,{label:e.flags,children:L.jsx(s,{labels:e,flags:t.requestBody.flags||[],onChange:m})}),L.jsx(r,{label:e.images,children:L.jsx(o,{labels:e,defaultValue:t.requestBody.images,onChange:v})}),L.jsx(r,{label:e.labels,children:L.jsx(i,{labels:e,type:e.labels,defaultValue:t.requestBody.labels,onChange:b})}),L.jsx(r,{label:e.rules,children:L.jsx(n,{property:"rules",defaultValue:t.requestBody.rules,onChange:x})}),L.jsx(r,{label:e.schedule,children:t.requestBody.id?L.jsx(u,{labels:e,entityId:t.requestBody.id,entityType:"POLL"}):L.jsx(Je,{children:e.scheduledTaskNotAvailable})})]})},hke=t=>{const[e,n]=G.useState([]),r=$t(Zt),i=$t(Fo);G.useEffect(()=>{n(t.languages)},[t.languages]);const a=()=>{t.onClose()},o=d=>{let f=[...e];e.includes(d)?f=f.filter(p=>p!==d):f.push(d),f.includes(t.mainLanguage)||f.unshift(t.mainLanguage),n(f)},s=()=>{t.onSubmit(e)},c=e.length!==t.languages.length||e.some(d=>!t.languages.includes(d)),u=[...i.languageConfig.available_languages,i.languageConfig.default_language].filter(d=>d!==t.mainLanguage);return L.jsx(L.Fragment,{children:L.jsx(gl,{onClick:d=>{d.stopPropagation()},open:t.isOpen,onClose:a,children:L.jsxs(vl,{sx:{width:500,minWidth:250,overflowY:"scroll"},children:[L.jsx(ml,{children:r.languagesModalTitle}),L.jsx(na,{children:r.languagesModalDescription}),L.jsxs(hl,{sx:{maxHeight:140,overflowY:"scroll",overflowX:"hidden"},children:[L.jsx($0,{sx:{my:.5,"& .MuiCheckbox-checkbox":{backgroundColor:"white","&:hover":{backgroundColor:"#f0f4f8"}},"& .MuiCheckbox-checkbox.Mui-checked":{backgroundColor:"#0066CC"}},disabled:!0,checked:!0,label:pt[t.mainLanguage].name},"default-language"),u.map(d=>L.jsx($0,{sx:{my:.5},checked:e.includes(d),label:pt[d].name,onChange:()=>o(d)},d))]}),L.jsxs(Pu,{children:[L.jsx(yt,{disabled:!c,loading:t.isLoadingTranslations,variant:"solid",color:"primary",onClick:s,children:r.languagesModalSave}),L.jsx(yt,{variant:"plain",color:"neutral",onClick:a,children:r.close})]})]})})})},mke=t=>L.jsx(V0,{"aria-label":"Languages",defaultValue:0,onChange:(e,n)=>t.onTabChange(Number(n)),children:L.jsxs(U0,{sx:{display:"flex",justifyContent:"space-between"},children:[L.jsx(Ne,{sx:{display:"flex"},children:t.languages.map(e=>e&&L.jsx(yl,{disableIndicator:!0,children:pt[e].name},e))}),L.jsx(yt,{variant:"plain",color:"neutral",onClick:t.onLanguageButtonClick,children:L.jsx($O,{})})]})}),yc="###",dN=(t,e,n)=>j(this,null,function*(){let i="https://translation.googleapis.com/language/translate/v2?key=AIzaSyB6JILBJiJ0Z2pxw0-nudOpRAzqFk6D6Lw";return i+="&q="+encodeURIComponent(t),i+=`&target=${vg[e].key||"en"}`,n&&(i+=`&source=${n}`),i+="&format=text",yield fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(o=>o.json())}),gke=(t,e,n=null)=>j(this,null,function*(){let r=[],i=[];return t.forEach(a=>{let o=a.title+(a.description?yc+a.description:"");const s=dN(o,e,n).then(c=>{const d=c.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(yc);r.push(je(le({},a),{title:d[0],description:a.description?d[1]:null}))});i.push(s)}),yield Promise.all(i),r}),fN=(t,e,n=null)=>j(this,null,function*(){let r=[],i=[];return t.forEach(a=>{let o=a.title?a.title:"";o+=yc+(a.alternative_title?a.alternative_title:" "),o+=yc+(a.description?a.description:" "),o+=yc+(a.rules?a.rules:" ");const s=dN(o,e,n),c=gke(a.options,e,n);i.push(Promise.all([s,c]).then(([u,d])=>{const p=u.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(yc);r.push(je(le({},a),{title:p[0],alternative_title:a.alternative_title?p[1]:null,description:a.description?p[2]:null,rules:a.rules?p[3]:null,options:d}))}))}),yield Promise.all(i),r}),Es=new p1,vke=({pollById:t,relatedPolls:e,relatedParentTitle:n,setPollById:r,onClickBack:i,loadParent:a})=>{const[o,s]=G.useState(Es.createNewRequestBody(t)),[c,u]=G.useState(!1),[d,f]=G.useState(!1),[p,h]=G.useState(!1),[g,m]=G.useState(!1),[v,b]=G.useState([]),[x,y]=G.useState(!1),[C,w]=G.useState(null),[I,_]=G.useState({}),[T,O]=G.useState([]),[A,k]=G.useState(!1),[S,E]=G.useState(!1),[M,R]=G.useState(""),[F,B]=G.useState("danger"),{https:H}=Nn.useAPIContext(),{Toast:V}=Nn.useComponentContext(),U=$t(Zt),D=$t(Fo),z=!!t,W=(t==null?void 0:t.total_votes)>0,q=v.length>1,X=q&&I[C]?I[C]:o,K=(me,ve)=>{E(!0),R(ve),B(me)};G.useEffect(()=>{t&&s(t)},[t]),G.useEffect(()=>{if((e==null?void 0:e.length)>0){b([t.language,...e.map(ve=>ve.language)]);let me={};e.forEach(ve=>{me[ve.language]=Es.createNewRequestBody(ve)}),me[t.language]=t,_(me),w(t.language)}},[e]);const Q=me=>{w(v[me])},Y=me=>j(this,null,function*(){k(!0);const ve={},he={},ie=[];me.forEach(de=>{if(v.includes(de))ve[de]=I[de];else{const be=je(le({},X),{language:de,status:D.languageConfig.translation_rules[de].game_status||"INACTIVE"});(!z||z&&de!==o.language)&&delete be.id,he[de]=be}}),v.filter(de=>!me.includes(de)).map(de=>{I[de].id&&ie.push(je(le({},I[de]),{status:"INACTIVE"}))}),O(ie),b(me),w((t==null?void 0:t.language)||D.languageConfig.default_language);const se=[];Object.keys(he).forEach(de=>{se.push(fN([he[de]],de).then(be=>{he[de]=je(le({},he[de]),{title:be[0].title,alternative_title:be[0].alternative_title,description:be[0].description,options:be[0].options,rules:be[0].rules})}).catch(()=>{K("danger",U.pollTranslationErrorMessage),k(!1)}))}),Promise.all(se).then(()=>{_(le(le({},ve),he)),w((t==null?void 0:t.language)||D.languageConfig.default_language),k(!1),y(!1)}).catch(()=>{K("danger",U.pollTranslationErrorMessage),k(!1)})}),J=me=>{const ve=X.language||D.languageConfig.default_language;q&&me===C||!q&&me===ve?h(!0):f(!0),fN([X],me||vg[me].key).then(he=>{const ie=je(le({},X),{title:he[0].title,alternative_title:he[0].alternative_title,description:he[0].description,options:he[0].options,rules:he[0].rules});q?_(se=>je(le({},se),{[C]:ie})):s(ie),h(!1),f(!1)}).catch(()=>{K("danger",U.pollTranslationErrorMessage),h(!1),f(!1)})},Z=()=>j(this,null,function*(){q?ae():oe()}),oe=()=>j(this,null,function*(){const me=new cN;if(u(!0),me.validate(X,U),!me.isValid){K("danger",me.message),u(!1);return}const ve=[];T.forEach(se=>{ve.push(H.updatePoll(se.id,le({},se)).then(()=>H.deletePoll(se.id)))}),Promise.all(ve).then(()=>O([]));const he=Es.finalizeNewRequestBody(le({},X),D);let ie=null;if(z?ie=yield H.updatePoll(t.id,le({},he)):ie=yield H.createPoll(le({},he)),ie.ok){u(!1),K("success",z?U.updatePollMessage:U.createPollMessage);const se=yield ie.json();r(se.data)}else K("danger",z?U.updatePollErrorMessage:U.createPollErrorMessage),console.error(z?U.updatePollErrorMessage:U.createPollErrorMessage,yield ie.json()),u(!1)}),ae=()=>j(this,null,function*(){const me=new cN;u(!0);for(const de of Object.values(I))if(me.validate(de,U),!me.isValid){u(!1),K("danger",me.message),me.isValid=!0,me.message="";return}const ve=Object.values(I).filter(de=>de.language!==(z?t.language:D.languageConfig.default_language)),he=[];let ie=t;if(!z){const de=Es.finalizeNewRequestBody(le({},Object.values(I).filter(pe=>pe.language===D.languageConfig.default_language)[0]),D),be=yield H.createPoll(le({},de));if(be.ok)ie=(yield be.json()).data;else{u(!1),console.error(U.createPollErrorMessage,yield be.json()),K("danger",U.createPollErrorMessage);return}}T.forEach(de=>{he.push(H.updatePoll(de.id,le({},de)).then(()=>H.deletePoll(de.id)))});const se={};ve.forEach(de=>{const be=Es.finalizeNewRequestBody(le({},de),D);be.auth_requirement=de.auth_requirement||D.authRequirement,be.related=[{entity_type:"poll",entity_relationship:"translatedFrom",entity_id:ie.id}];const pe=de.id?H.updatePoll(de.id,le({},be)):H.createPoll(le({},be));he.push(pe.then(ke=>{if(ke.ok)return ke.json();throw new Error}).then(ke=>se[de.language]=ke.data))}),Promise.all(he).then(()=>{O([]);const de=z?le({},Object.values(I).filter(ke=>ke.id===t.id)[0]):ie,be=Es.finalizeNewRequestBody(le({},de),D),pe=Object.values(se).map(ke=>({entity_type:"poll",entity_relationship:"translatedTo",entity_id:ke.id}));be.related=pe,H.updatePoll((t==null?void 0:t.id)||ie.id,le({},be)).then(ke=>{if(ke.ok)return ke.json();throw new Error}).then(ke=>{r(ke.data),se[ke.data.language||D.languageConfig.default_language]=ke.data,Object.keys(se).forEach(Be=>se[Be]=Es.createNewRequestBody(se[Be])),_(le({},se)),u(!1),K("success",z?U.updatePollMessage:U.createPollMessage)})}).catch(de=>{console.log(de),u(!1),console.error(U.updatePollErrorMessage),K("danger",U.updatePollErrorMessage)})}),xe=me=>{q?_(ve=>je(le({},ve),{[C]:me})):s(me)},Pe=()=>{var me;if(z&&D.languageConfig.default_language){const ve=t.language||D.languageConfig.default_language,he=q?C:ve,ie=[...D.languageConfig.available_languages,D.languageConfig.default_language].filter(se=>se!==he);return he==="en"&&D.languageConfig.available_languages.length===0?void 0:L.jsxs(OQ,{sx:{mr:1},children:[L.jsx(yt,{onClick:()=>J(he),loading:p,children:U.translateTo.replace("_language_",vg[he].name)}),((me=D.languageConfig.available_languages)==null?void 0:me.length)>0&&L.jsxs(xP,{children:[L.jsx(ME,{slots:{root:Rn},loading:d,children:L.jsx($O,{})}),L.jsx(RE,{placement:"top",sx:{maxHeight:200},children:ie.map(se=>L.jsx(N0,{onClick:()=>J(se),children:vg[se].name},se))})]})]})}};return L.jsxs(L.Fragment,{children:[L.jsx(K_e,{onClickBack:i}),L.jsxs(si,{variant:"plain",children:[D.languageConfig.available_languages.length>0&&L.jsx(mke,{languages:q?v:[X.language||D.languageConfig.default_language],onTabChange:Q,onLanguageButtonClick:()=>y(!0)}),L.jsxs(us,{direction:{xs:"column",sm:"row"},children:[L.jsx(ske,{isEditMode:z,requestBody:X,onRequestBodyUpdate:xe,parentTitle:n,onParentSelect:a}),L.jsx(pke,{requestBody:X,onRequestBodyUpdate:xe,isPollVoted:W,isMultilingual:q})]}),L.jsxs(Ne,{display:"flex",flexDirection:"row",justifyContent:"center",my:3,children:[Pe(),L.jsx(yt,{variant:"outlined",color:"neutral",onClick:()=>m(!0),sx:{mr:1},children:U.preview}),L.jsx(yt,{variant:"solid",color:"primary",onClick:Z,loading:c,children:U.save})]})]}),L.jsx(Q_e,{isOpen:g,requestBody:X,handleClose:()=>m(!1)}),L.jsx(V,{showToast:S,color:F,message:M,hideToast:()=>E(!S)}),D.languageConfig.default_language&&L.jsx(hke,{isOpen:x,mainLanguage:(o==null?void 0:o.language)||D.languageConfig.default_language,languages:v,isLoadingTranslations:A,onSubmit:Y,onClose:()=>y(!1)})]})};class yke{constructor(){l(this,"sortOrder","DESC");l(this,"status","");l(this,"language","");l(this,"flags",[]);l(this,"entityIds",[]);l(this,"minVotes",0);l(this,"limit",20)}}const bke=({filters:t,options:e,setOptions:n,setFilters:r,handleResetData:i})=>{const a=$t(Zt),o=$t(Fo),{Flags:s,ContextSelectFilter:c,NumberInput:u,ItemsPerPageFilter:d}=Nn.useComponentContext(),f=G.useRef(null),p=(O,A)=>{r(k=>je(le({},k),{status:A}))},h=O=>{r(A=>je(le({},A),{minVotes:O}))},g=O=>{r(A=>je(le({},A),{flags:O}))},m=(O,A)=>{r(k=>je(le({},k),{language:A}))},v=(O,A)=>{const k=A;r(S=>je(le({},S),{sortOrder:k}))},b=(O,A)=>{r(k=>je(le({},k),{limit:A}))},x=()=>L.jsx(Ar,{xs:2,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.status}),L.jsxs(hr,je(le({value:t.status,size:"sm",placeholder:"Filter by status",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:p,sx:{minHeight:"37px"}},t.status&&{endDecorator:L.jsx(Rn,{variant:"plain",color:"neutral",onMouseDown:O=>{O.stopPropagation()},onClick:()=>{var O;r(A=>je(le({},A),{status:""})),(O=f.current)==null||O.focusVisible()},sx:{width:"18px",height:"18px"},children:L.jsx(fx,{})}),indicator:null}),{children:[L.jsx(Hn,{value:"ACTIVE",children:a.active}),L.jsx(Hn,{value:"INACTIVE",children:a.inactive}),L.jsx(Hn,{value:"EXPIRED",children:a.expired})]}))]})}),y=()=>{const O=o.languageConfig.default_language&&Array.isArray(o.languageConfig.available_languages)?[o.languageConfig.default_language,...o.languageConfig.available_languages]:[];return L.jsx(Ar,{xs:2.5,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.language}),L.jsx(hr,je(le({value:t.language,size:"sm",placeholder:"Filter by language",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:m,sx:{minHeight:"37px"}},t.language&&{endDecorator:L.jsx(Rn,{variant:"plain",color:"neutral",onMouseDown:A=>{A.stopPropagation()},onClick:()=>{var A;r(k=>je(le({},k),{language:""})),(A=f.current)==null||A.focusVisible()},sx:{width:"18px",height:"18px"},children:L.jsx(fx,{})}),indicator:null}),{children:O.map(A=>L.jsx(Hn,{value:A,children:pt[A].name},A))}))]})})},C=()=>L.jsx(Ar,{xs:1.5,children:L.jsx(Dt,{size:"sm",children:L.jsx(u,{sx:{minHeight:"37px"},label:a.minimumVotes,defaultValue:t.minVotes,onChange:h})})}),w=()=>L.jsx(Ar,{xs:2,children:L.jsx(d,{labels:a,value:t.limit,onChange:b,options:Z_e})}),I=()=>L.jsx(Ar,{xs:4,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.sortBy}),L.jsxs(hr,{value:t.sortOrder,size:"sm",onChange:v,sx:{minHeight:"37px"},children:[L.jsx(Hn,{value:"ASC",children:a.sortByAscending}),L.jsx(Hn,{value:"DESC",children:a.sortByDescending})]})]})}),_=()=>L.jsx(Ar,{xs:3,children:L.jsxs(Dt,{size:"sm",children:[L.jsx(Bt,{children:a.flags}),L.jsx(s,{labels:a,flags:t.flags,onChange:g})]})}),T=()=>L.jsx(Ar,{xs:4,children:L.jsx(Ne,{sx:{fontFamily:"sans-serif"},children:L.jsx(c,{labels:a,options:e,setOptions:n,setFilters:r,handleResetData:i})})});return L.jsx(Ne,{mb:2,children:L.jsxs(Ar,{container:!0,spacing:2,children:[x(),y(),C(),w(),I(),_(),T()]})})},xke=({children:t})=>L.jsx("section",{style:{marginRight:"auto",marginLeft:"auto",padding:"8px"},children:L.jsx(Ne,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:L.jsx(Ne,{width:"100%",children:t})})}),wke=t=>{const e=$t(Zt);return L.jsx("tfoot",{children:L.jsx("tr",{children:L.jsx("td",{colSpan:8,children:L.jsxs(Ne,{sx:{display:"flex",alignItems:"center",gap:2,justifyContent:"flex-end"},children:[L.jsxs(Je,{textAlign:"center",children:[e.pageNo," ",t.pageCount]}),L.jsxs(Ne,{sx:{display:"flex",gap:1},children:[L.jsx(Rn,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disablePreviousPage,onClick:t.goToPreviousPage,sx:{bgcolor:"background.surface"},children:L.jsx(Vre,{})}),L.jsx(Rn,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disableNextPage,onClick:t.goToNextPage,sx:{bgcolor:"background.surface"},children:L.jsx(Wre,{})})]})]})})})})};var yg={exports:{}},Cke=yg.exports,pN;function Ike(){return pN||(pN=1,function(t,e){(function(n,r){t.exports=r()})(Cke,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",o="second",s="minute",c="hour",u="day",d="week",f="month",p="quarter",h="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var R=["th","st","nd","rd"],F=M%100;return"["+M+(R[(F-20)%10]||R[F]||R[0])+"]"}},y=function(M,R,F){var B=String(M);return!B||B.length>=R?M:""+Array(R+1-B.length).join(F)+M},C={s:y,z:function(M){var R=-M.utcOffset(),F=Math.abs(R),B=Math.floor(F/60),H=F%60;return(R<=0?"+":"-")+y(B,2,"0")+":"+y(H,2,"0")},m:function M(R,F){if(R.date()<F.date())return-M(F,R);var B=12*(F.year()-R.year())+(F.month()-R.month()),H=R.clone().add(B,f),V=F-H<0,U=R.clone().add(B+(V?-1:1),f);return+(-(B+(F-H)/(V?H-U:U-H))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:f,y:h,w:d,d:u,D:g,h:c,m:s,s:o,ms:a,Q:p}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},w="en",I={};I[w]=x;var _="$isDayjsObject",T=function(M){return M instanceof S||!(!M||!M[_])},O=function M(R,F,B){var H;if(!R)return w;if(typeof R=="string"){var V=R.toLowerCase();I[V]&&(H=V),F&&(I[V]=F,H=V);var U=R.split("-");if(!H&&U.length>1)return M(U[0])}else{var D=R.name;I[D]=R,H=D}return!B&&H&&(w=H),H||!B&&w},A=function(M,R){if(T(M))return M.clone();var F=typeof R=="object"?R:{};return F.date=M,F.args=arguments,new S(F)},k=C;k.l=O,k.i=T,k.w=function(M,R){return A(M,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var S=function(){function M(F){this.$L=O(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var R=M.prototype;return R.parse=function(F){this.$d=function(B){var H=B.date,V=B.utc;if(H===null)return new Date(NaN);if(k.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var U=H.match(v);if(U){var D=U[2]-1||0,z=(U[7]||"0").substring(0,3);return V?new Date(Date.UTC(U[1],D,U[3]||1,U[4]||0,U[5]||0,U[6]||0,z)):new Date(U[1],D,U[3]||1,U[4]||0,U[5]||0,U[6]||0,z)}}return new Date(H)}(F),this.init()},R.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},R.$utils=function(){return k},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(F,B){var H=A(F);return this.startOf(B)<=H&&H<=this.endOf(B)},R.isAfter=function(F,B){return A(F)<this.startOf(B)},R.isBefore=function(F,B){return this.endOf(B)<A(F)},R.$g=function(F,B,H){return k.u(F)?this[B]:this.set(H,F)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(F,B){var H=this,V=!!k.u(B)||B,U=k.p(F),D=function(J,Z){var oe=k.w(H.$u?Date.UTC(H.$y,Z,J):new Date(H.$y,Z,J),H);return V?oe:oe.endOf(u)},z=function(J,Z){return k.w(H.toDate()[J].apply(H.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(Z)),H)},W=this.$W,q=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(U){case h:return V?D(1,0):D(31,11);case f:return V?D(1,q):D(0,q+1);case d:var Q=this.$locale().weekStart||0,Y=(W<Q?W+7:W)-Q;return D(V?X-Y:X+(6-Y),q);case u:case g:return z(K+"Hours",0);case c:return z(K+"Minutes",1);case s:return z(K+"Seconds",2);case o:return z(K+"Milliseconds",3);default:return this.clone()}},R.endOf=function(F){return this.startOf(F,!1)},R.$set=function(F,B){var H,V=k.p(F),U="set"+(this.$u?"UTC":""),D=(H={},H[u]=U+"Date",H[g]=U+"Date",H[f]=U+"Month",H[h]=U+"FullYear",H[c]=U+"Hours",H[s]=U+"Minutes",H[o]=U+"Seconds",H[a]=U+"Milliseconds",H)[V],z=V===u?this.$D+(B-this.$W):B;if(V===f||V===h){var W=this.clone().set(g,1);W.$d[D](z),W.init(),this.$d=W.set(g,Math.min(this.$D,W.daysInMonth())).$d}else D&&this.$d[D](z);return this.init(),this},R.set=function(F,B){return this.clone().$set(F,B)},R.get=function(F){return this[k.p(F)]()},R.add=function(F,B){var H,V=this;F=Number(F);var U=k.p(B),D=function(q){var X=A(V);return k.w(X.date(X.date()+Math.round(q*F)),V)};if(U===f)return this.set(f,this.$M+F);if(U===h)return this.set(h,this.$y+F);if(U===u)return D(1);if(U===d)return D(7);var z=(H={},H[s]=r,H[c]=i,H[o]=n,H)[U]||1,W=this.$d.getTime()+F*z;return k.w(W,this)},R.subtract=function(F,B){return this.add(-1*F,B)},R.format=function(F){var B=this,H=this.$locale();if(!this.isValid())return H.invalidDate||m;var V=F||"YYYY-MM-DDTHH:mm:ssZ",U=k.z(this),D=this.$H,z=this.$m,W=this.$M,q=H.weekdays,X=H.months,K=H.meridiem,Q=function(Z,oe,ae,xe){return Z&&(Z[oe]||Z(B,V))||ae[oe].slice(0,xe)},Y=function(Z){return k.s(D%12||12,Z,"0")},J=K||function(Z,oe,ae){var xe=Z<12?"AM":"PM";return ae?xe.toLowerCase():xe};return V.replace(b,function(Z,oe){return oe||function(ae){switch(ae){case"YY":return String(B.$y).slice(-2);case"YYYY":return k.s(B.$y,4,"0");case"M":return W+1;case"MM":return k.s(W+1,2,"0");case"MMM":return Q(H.monthsShort,W,X,3);case"MMMM":return Q(X,W);case"D":return B.$D;case"DD":return k.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return Q(H.weekdaysMin,B.$W,q,2);case"ddd":return Q(H.weekdaysShort,B.$W,q,3);case"dddd":return q[B.$W];case"H":return String(D);case"HH":return k.s(D,2,"0");case"h":return Y(1);case"hh":return Y(2);case"a":return J(D,z,!0);case"A":return J(D,z,!1);case"m":return String(z);case"mm":return k.s(z,2,"0");case"s":return String(B.$s);case"ss":return k.s(B.$s,2,"0");case"SSS":return k.s(B.$ms,3,"0");case"Z":return U}return null}(Z)||U.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(F,B,H){var V,U=this,D=k.p(B),z=A(F),W=(z.utcOffset()-this.utcOffset())*r,q=this-z,X=function(){return k.m(U,z)};switch(D){case h:V=X()/12;break;case f:V=X();break;case p:V=X()/3;break;case d:V=(q-W)/6048e5;break;case u:V=(q-W)/864e5;break;case c:V=q/i;break;case s:V=q/r;break;case o:V=q/n;break;default:V=q}return H?V:k.a(V)},R.daysInMonth=function(){return this.endOf(f).$D},R.$locale=function(){return I[this.$L]},R.locale=function(F,B){if(!F)return this.$L;var H=this.clone(),V=O(F,B,!0);return V&&(H.$L=V),H},R.clone=function(){return k.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},M}(),E=S.prototype;return A.prototype=E,[["$ms",a],["$s",o],["$m",s],["$H",c],["$W",u],["$M",f],["$y",h],["$D",g]].forEach(function(M){E[M[1]]=function(R){return this.$g(R,M[0],M[1])}}),A.extend=function(M,R){return M.$i||(M(R,S,A),M.$i=!0),A},A.locale=O,A.isDayjs=T,A.unix=function(M){return A(1e3*M)},A.en=I[w],A.Ls=I,A.p={},A})}(yg)),yg.exports}var Ske=Ike();const bg=Yo(Ske),_ke=t=>{const[e,n]=G.useState(!1),[r,i]=G.useState(!1),[a,o]=G.useState(""),[s,c]=G.useState("success"),{https:u}=Nn.useAPIContext(),{Toast:d}=Nn.useComponentContext(),f=$t(Zt),p=(m,v)=>{c(m),o(v),i(!0)},h=()=>{o(""),i(!1)},g=m=>j(this,null,function*(){if(m.stopPropagation(),n(!0),(yield u.deletePoll(t.poll.id)).ok){p("success",f.deletePollMessage),n(!1),t.onClose(m),t.onDelete();return}p("danger",f.deletePollErrorMessage),n(!1)});return L.jsxs(L.Fragment,{children:[L.jsx(gl,{open:t.isOpen,onClose:t.onClose,children:L.jsxs(vl,{children:[L.jsxs(ml,{children:[L.jsx(Yre,{}),f.deletePollTitle]}),L.jsx(vo,{}),L.jsx(hl,{children:L.jsxs(Je,{children:[f.deletePollDescription," ",L.jsx(Je,{fontWeight:"bold",children:t.poll.title}),"?"]})}),L.jsxs(Pu,{children:[L.jsx(yt,{loading:e,variant:"solid",color:"danger",onClick:g,children:f.deleteLabel}),L.jsx(yt,{variant:"plain",color:"neutral",onClick:m=>{m.stopPropagation(),t.onClose(m)},children:f.close})]})]})}),L.jsx(d,{showToast:r,color:s,message:a,hideToast:h})]})},kke=({poll:t,onClickEdit:e,onDelete:n})=>{const[r,i]=G.useState(!1),a=$t(Zt),o=s=>{s.stopPropagation(),i(!r)};return L.jsxs(L.Fragment,{children:[L.jsxs(xP,{children:[L.jsx(ME,{slots:{root:Rn},slotProps:{root:{variant:"plain",color:"neutral",size:"sm"}},onClick:s=>s.stopPropagation(),children:L.jsx(Gre,{})}),L.jsxs(RE,{size:"sm",sx:{minWidth:140},onClick:s=>s.stopPropagation(),children:[L.jsx(N0,{onClick:e,children:a.edit}),L.jsx(vo,{}),L.jsx(N0,{color:"danger",onClick:o,disabled:t.status!=="INACTIVE",children:a.deleteLabel})]})]}),L.jsx(_ke,{isOpen:r,poll:t,onDelete:n,onClose:s=>{s.stopPropagation(),i(!1)}})]})};class Tke{constructor(){l(this,"registered",{from_date:"",to_date:""});l(this,"interests",{ids:[],type:""});l(this,"either_or",{ids:[],type:"",min_points:0});l(this,"classic_quiz",{ids:[],type:"",min_success_rate:0});l(this,"poll",{ids:[],type:"ALL",option_ids:[]});l(this,"single_predictions",{ids:[],type:""});l(this,"top_x",{ids:[],type:""});l(this,"match_quiz",{ids:[],type:""})}}const Ake=({poll:t})=>{const[e,n]=G.useState(null),[r,i]=G.useState(!1),[a,o]=G.useState("success"),[s,c]=G.useState(""),u=$t(Zt),{https:d}=Nn.useAPIContext(),{Toast:f}=Nn.useComponentContext(),p=(m,v)=>{o(m),c(v),i(!0)},h=m=>j(this,null,function*(){n(m);const v=new Tke;v.poll.ids=[t.id],m!=="all"&&(v.poll.option_ids=[m]);const b=yield d.exportUsers(v);if(b.ok){const x=yield b.blob(),y=URL.createObjectURL(x),C=document.createElement("a");C.href=y,C.download=`poll_${t.id}_${m}_exported_users.csv`,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(y),n(null),p("success",u.usersExportMessage)}else console.error(yield b.json()),n(null),p("danger",u.usersExportErrorMessage)}),g=()=>{const m=[];return t.options.forEach(v=>{m.push(L.jsxs("tr",{children:[L.jsxs("td",{children:[L.jsx(Je,{level:"body-sm",fontWeight:"600",children:`${u.exportUsersForOption} ${v.title}`}),L.jsx(Je,{level:"body-xs",color:"neutral",children:`${u.exportAllUsersForOption} ${v.title}`})]}),L.jsx("td",{children:L.jsx(yt,{loading:e===v.id,onClick:()=>h(v.id),children:`${u.exportForOption} ${v.title}`})})]},`option-${v.title}`))}),m.push(L.jsxs("tr",{children:[L.jsxs("td",{children:[L.jsx(Je,{level:"body-sm",fontWeight:"600",children:u.exportAllUsers}),L.jsx(Je,{level:"body-xs",color:"neutral",children:u.exportAllUsersDescription})]}),L.jsx("td",{children:L.jsx(yt,{loading:e==="all",onClick:()=>h("all"),children:u.exportAllUsers})})]},"all-users")),m};return L.jsxs(si,{variant:"soft",sx:{borderRadius:0,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)"},children:[L.jsx(ta,{children:L.jsxs(Ne,{mb:1,children:[L.jsx(Ne,{display:"flex",alignItems:"center",mb:1,children:L.jsx(Je,{level:"body-lg",sx:{mx:"auto"},children:u.exportUsersData})}),L.jsx(j0,{sx:{overflowX:"auto",minWidth:"700px"},children:L.jsxs(Du,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:u.category}),L.jsx("th",{children:u.action})]})}),L.jsx("tbody",{children:g()})]})})]})}),L.jsx(f,{showToast:r,color:a,message:s,hideToast:()=>i(!1)})]})},Pke=({poll:t})=>{const e=$t(Zt);return L.jsx(L.Fragment,{children:L.jsx(j0,{variant:"soft",sx:{p:2,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)",cursor:"default","&hover":{backgroundColor:"transparent"}},children:L.jsxs(Du,{hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > tfoot > tr > td":{pt:2,px:0}},children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:e.option}),L.jsx("th",{children:e.votes})]})}),L.jsx("tbody",{children:t.options.sort((n,r)=>r.votes-n.votes).map(n=>L.jsxs("tr",{children:[L.jsx("td",{children:n.title}),L.jsx("td",{children:n.votes})]},`option-${n.id}`))})]})})})},h1="DEFAULT_X_AXIS_KEY",m1="DEFAULT_Y_AXIS_KEY",Eke={top:50,bottom:50,left:50,right:50},hN=P.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),Oke=(t,e)=>n=>t?t.fade==="series"?n.seriesId===(e==null?void 0:e.seriesId)&&n.dataIndex!==(e==null?void 0:e.dataIndex):t.fade==="global"?n.seriesId!==(e==null?void 0:e.seriesId)||n.dataIndex!==(e==null?void 0:e.dataIndex):!1:!1,Rke=(t,e)=>n=>t?t.highlight==="series"?n.seriesId===(e==null?void 0:e.seriesId):t.highlight==="item"?n.dataIndex===(e==null?void 0:e.dataIndex)&&n.seriesId===(e==null?void 0:e.seriesId):!1:!1,Mke=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function Dke(t,e,n=Mke){return t.type==="pie"?N({},t,{data:t.data.map((r,i)=>N({color:n[i%n.length]},r))}):N({color:n[e%n.length]},t)}const $ke=({series:t,colors:e,seriesFormatters:n,dataset:r})=>{const i={};t.forEach((o,s)=>{var d;const{id:c=`auto-generated-id-${s}`,type:u}=o;if(i[u]===void 0&&(i[u]={series:{},seriesOrder:[]}),((d=i[u])==null?void 0:d.series[c])!==void 0)throw new Error(`MUI X: series' id "${c}" is not unique.`);i[u].series[c]=N({id:c},Dke(o,s,e)),i[u].seriesOrder.push(c)});const a={};return Object.keys(n).forEach(o=>{var c,u;const s=i[o];s!==void 0&&(a[o]=(u=(c=n[o])==null?void 0:c.call(n,s,r))!=null?u:i[o])}),a};function No({props:t,name:e}){return Fne({props:t,name:e,defaultTheme:lx,themeId:cx})}const Lke=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],Fke=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],Nke=t=>t==="dark"?Fke:Lke,mN=P.createContext({isInitialized:!1,data:{}}),Jd=P.createContext({isInitialized:!1,data:{colorProcessors:{},seriesFormatters:{},xExtremumGetters:{},yExtremumGetters:{},rotationExtremumGetters:{},radiusExtremumGetters:{}}}),gN=(t,e)=>e==="x"?{x:t,y:null}:{x:null,y:t},vN=t=>{var c;const{axis:e,getFilters:n,isDefaultAxis:r}=t,i=n==null?void 0:n({currentAxisId:e.id,isDefaultAxis:r}),a=i?(c=e.data)==null?void 0:c.filter((u,d)=>i({x:null,y:null},d)):e.data,o=Math.min(...a!=null?a:[]),s=Math.max(...a!=null?a:[]);return[o,s]},yN=t=>e=>{const{series:n,axis:r,getFilters:i,isDefaultAxis:a}=e;return Object.keys(n).filter(o=>{var c;const s=(c=n[o].yAxisId)!=null?c:n[o].yAxisKey;return s===r.id||a&&s===void 0}).reduce((o,s)=>{var p,h,g;const{stackedData:c}=n[s],u=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:a,seriesXAxisId:(p=n[s].xAxisId)!=null?p:n[s].xAxisKey,seriesYAxisId:(h=n[s].yAxisId)!=null?h:n[s].yAxisKey}),[d,f]=(g=c==null?void 0:c.reduce((m,v,b)=>u&&(!u(gN(v[0],t),b)||!u(gN(v[1],t),b))?m:[Math.min(...v,m[0]),Math.max(...v,m[1])],[1/0,-1/0]))!=null?g:[1/0,-1/0];return[Math.min(d,o[0]),Math.max(f,o[1])]},[1/0,-1/0])},jke=t=>Object.keys(t.series).some(n=>t.series[n].layout==="horizontal")?yN("x")(t):vN(t),Bke=t=>Object.keys(t.series).some(n=>t.series[n].layout==="horizontal")?vN(t):yN("y")(t);function ji(t){return function(){return t}}const g1=2*Math.PI;function bN(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function zke(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Hke(t){return t}function Uke(){var t=Hke,e=zke,n=null,r=ji(0),i=ji(g1),a=ji(0);function o(s){var c,u=(s=bN(s)).length,d,f,p=0,h=new Array(u),g=new Array(u),m=+r.apply(this,arguments),v=Math.min(g1,Math.max(-g1,i.apply(this,arguments)-m)),b,x=Math.min(Math.abs(v)/u,a.apply(this,arguments)),y=x*(v<0?-1:1),C;for(c=0;c<u;++c)(C=g[h[c]=c]=+t(s[c],c,s))>0&&(p+=C);for(e!=null?h.sort(function(w,I){return e(g[w],g[I])}):n!=null&&h.sort(function(w,I){return n(s[w],s[I])}),c=0,f=p?(v-u*y)/p:0;c<u;++c,m=b)d=h[c],C=g[d],b=m+(C>0?C*f:0)+y,g[d]={data:s[d],index:c,value:C,startAngle:m,endAngle:b,padAngle:x};return g}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:ji(+s),o):t},o.sortValues=function(s){return arguments.length?(e=s,n=null,o):e},o.sort=function(s){return arguments.length?(n=s,e=null,o):n},o.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:ji(+s),o):r},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:ji(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:ji(+s),o):a},o}function bc(t,e){if((o=t.length)>1)for(var n=1,r,i,a=t[e[0]],o,s=a.length;n<o;++n)for(i=a,a=t[e[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function xc(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Vke(t,e){return t[e]}function Wke(t){const e=[];return e.key=t,e}function xN(){var t=ji([]),e=xc,n=bc,r=Vke;function i(a){var o=Array.from(t.apply(this,arguments),Wke),s,c=o.length,u=-1,d;for(const f of a)for(s=0,++u;s<c;++s)(o[s][u]=[0,+r(f,o[s].key,u,a)]).data=f;for(s=0,d=bN(e(o));s<c;++s)o[d[s]].index=s;return n(o,d),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:ji(Array.from(a)),i):t},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:ji(+a),i):r},i.order=function(a){return arguments.length?(e=a==null?xc:typeof a=="function"?a:ji(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(n=a==null?bc:a,i):n},i}function qke(t,e){if((r=t.length)>0){for(var n,r,i=0,a=t[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=t[n][i][1]||0;if(o)for(n=0;n<r;++n)t[n][i][1]/=o}bc(t,e)}}function Gke(t,e){if((c=t.length)>0)for(var n,r=0,i,a,o,s,c,u=t[e[0]].length;r<u;++r)for(o=s=0,n=0;n<c;++n)(a=(i=t[e[n]][r])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function Yke(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=t[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}bc(t,e)}}function Kke(t,e){if(!(!((o=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,u=0;s<o;++s){for(var d=t[e[s]],f=d[r][1]||0,p=d[r-1][1]||0,h=(f-p)/2,g=0;g<s;++g){var m=t[e[g]],v=m[r][1]||0,b=m[r-1][1]||0;h+=v-b}c+=f,u+=h*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,bc(t,e)}}function wN(t){var e=t.map(Jke);return xc(t).sort(function(n,r){return e[n]-e[r]})}function Jke(t){for(var e=-1,n=0,r=t.length,i,a=-1/0;++e<r;)(i=+t[e][1])>a&&(a=i,n=e);return n}function CN(t){var e=t.map(IN);return xc(t).sort(function(n,r){return e[n]-e[r]})}function IN(t){for(var e=0,n=-1,r=t.length,i;++n<r;)(i=+t[n][1])&&(e+=i);return e}function Qke(t){return CN(t).reverse()}function Xke(t){var e=t.length,n,r,i=t.map(IN),a=wN(t),o=0,s=0,c=[],u=[];for(n=0;n<e;++n)r=a[n],o<s?(o+=i[r],c.push(r)):(s+=i[r],u.push(r));return u.reverse().concat(c)}function Zke(t){return xc(t).reverse()}const v1={appearance:wN,ascending:CN,descending:Qke,insideOut:Xke,none:xc,reverse:Zke},y1={expand:qke,diverging:Gke,none:bc,silhouette:Yke,wiggle:Kke},SN=t=>{const{series:e,seriesOrder:n,defaultStrategy:r}=t,i=[],a={};return n.forEach(o=>{var d,f;const{stack:s,stackOrder:c,stackOffset:u}=e[o];s===void 0?i.push({ids:[o],stackingOrder:v1.none,stackingOffset:y1.none}):a[s]===void 0?(a[s]=i.length,i.push({ids:[o],stackingOrder:v1[(d=c!=null?c:r==null?void 0:r.stackOrder)!=null?d:"none"],stackingOffset:y1[(f=u!=null?u:r==null?void 0:r.stackOffset)!=null?f:"diverging"]})):(i[a[s]].ids.push(o),c!==void 0&&(i[a[s]].stackingOrder=v1[c]),u!==void 0&&(i[a[s]].stackingOffset=y1[u]))}),i};function _N(t,e){const n={};return Object.keys(t).forEach(r=>{var i;n[r]=N({},t[r],{valueFormatter:(i=t[r].valueFormatter)!=null?i:e})}),n}const eTe=(t,e)=>{const{seriesOrder:n,series:r}=t,i=SN(t),a=e!=null?e:[];n.forEach(s=>{const c=r[s].data;if(c!==void 0)c.forEach((u,d)=>{a.length<=d?a.push({[s]:u}):a[d][s]=u});else if(e===void 0)throw new Error([`MUI X: bar series with id='${s}' has no data.`,"Either provide a data property to the series or use the dataset prop."].join(`
|
|
2635
2635
|
`))});const o={};return i.forEach(s=>{const{ids:c,stackingOffset:u,stackingOrder:d}=s,f=xN().keys(c.map(p=>{const h=r[p].dataKey;return r[p].data===void 0&&h!==void 0?h:p})).value((p,h)=>{var g;return(g=p[h])!=null?g:0}).order(d).offset(u)(a);c.forEach((p,h)=>{const g=r[p].dataKey;o[p]=N({layout:"vertical"},r[p],{data:g?e.map(m=>{const v=m[g];return typeof v!="number"?0:v}):r[p].data,stackedData:f[h].map(([m,v])=>[m,v])})})}),{seriesOrder:n,stackingGroups:i,series:_N(o,s=>s==null?"":s.toLocaleString())}},kN=(t,e,n)=>{const r=t.layout==="vertical",i=r?e==null?void 0:e.colorScale:n==null?void 0:n.colorScale,a=r?n==null?void 0:n.colorScale:e==null?void 0:e.colorScale,o=r?e==null?void 0:e.data:n==null?void 0:n.data;return a?s=>{const c=t.data[s],u=c===null?t.color:a(c);return u===null?t.color:u}:i&&o?s=>{const c=o[s],u=c===null?t.color:i(c);return u===null?t.color:u}:()=>t.color},tTe={seriesType:"bar",seriesFormatter:eTe,colorProcessor:kN,xExtremumGetter:jke,yExtremumGetter:Bke},xg=(t,e)=>[e[0]===null?t[0]:Math.min(t[0],e[0]),e[1]===null?t[1]:Math.max(t[1],e[1])],nTe={seriesType:"scatter",seriesFormatter:({series:t,seriesOrder:e},n)=>({series:Object.fromEntries(Object.entries(t).map(([i,a])=>{var u,d,f;const o=a==null?void 0:a.datasetKeys,s=["x","y","id"].filter(p=>typeof(o==null?void 0:o[p])!="string");if(a!=null&&a.datasetKeys&&s.length>0)throw new Error([`MUI X: scatter series with id='${i}' has incomplete datasetKeys.`,`Properties ${s.map(p=>`"${p}"`).join(", ")} are missing.`].join(`
|
|
2636
2636
|
`));const c=o?(d=n==null?void 0:n.map(p=>{var h,g;return{x:(h=p[o.x])!=null?h:null,y:(g=p[o.y])!=null?g:null,z:o.z&&p[o.z],id:p[o.id]}}))!=null?d:[]:(u=a.data)!=null?u:[];return[i,N({},a,{data:c,valueFormatter:(f=a.valueFormatter)!=null?f:p=>`(${p.x}, ${p.y})`})]})),seriesOrder:e}),colorProcessor:(t,e,n,r)=>{const i=r==null?void 0:r.colorScale,a=n==null?void 0:n.colorScale,o=e==null?void 0:e.colorScale;return i?s=>{var d,f;if(((d=r==null?void 0:r.data)==null?void 0:d[s])!==void 0){const p=i((f=r==null?void 0:r.data)==null?void 0:f[s]);if(p!==null)return p}const c=t.data[s],u=c===null?t.color:i(c.z);return u===null?t.color:u}:a?s=>{const c=t.data[s],u=c===null?t.color:a(c.y);return u===null?t.color:u}:o?s=>{const c=t.data[s],u=c===null?t.color:o(c.x);return u===null?t.color:u}:()=>t.color},xExtremumGetter:t=>{const{series:e,axis:n,isDefaultAxis:r,getFilters:i}=t;return Object.keys(e).filter(a=>{var s;const o=(s=e[a].xAxisId)!=null?s:e[a].xAxisKey;return o===n.id||o===void 0&&r}).reduce((a,o)=>{var u,d,f;const s=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:(u=e[o].xAxisId)!=null?u:e[o].xAxisKey,seriesYAxisId:(d=e[o].yAxisId)!=null?d:e[o].yAxisKey}),c=(f=e[o].data)==null?void 0:f.reduce((p,h,g)=>s&&!s(h,g)?p:xg(p,[h.x,h.x]),[1/0,-1/0]);return xg(a,c!=null?c:[1/0,-1/0])},[1/0,-1/0])},yExtremumGetter:t=>{const{series:e,axis:n,isDefaultAxis:r,getFilters:i}=t;return Object.keys(e).filter(a=>{var s;const o=(s=e[a].yAxisId)!=null?s:e[a].yAxisKey;return o===n.id||o===void 0&&r}).reduce((a,o)=>{var u,d,f;const s=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:(u=e[o].xAxisId)!=null?u:e[o].xAxisKey,seriesYAxisId:(d=e[o].yAxisId)!=null?d:e[o].yAxisKey}),c=(f=e[o].data)==null?void 0:f.reduce((p,h,g)=>s&&!s(h,g)?p:xg(p,[h.y,h.y]),[1/0,-1/0]);return xg(a,c!=null?c:[1/0,-1/0])},[1/0,-1/0])}},rTe=t=>{var i,a;const{axis:e}=t,n=Math.min(...(i=e.data)!=null?i:[]),r=Math.max(...(a=e.data)!=null?a:[]);return[n,r]};function iTe(t,e,n){return e.reduce((r,i,a)=>{const[o,s]=t(i);return n&&(!n({y:o,x:null},a)||!n({y:s,x:null},a))?r:[Math.min(o,s,r[0]),Math.max(o,s,r[1])]},[1/0,-1/0])}const aTe={seriesType:"line",colorProcessor:(t,e,n)=>{const r=n==null?void 0:n.colorScale,i=e==null?void 0:e.colorScale;return r?a=>{const o=t.data[a],s=o===null?t.color:r(o);return s===null?t.color:s}:i?a=>{var c;const o=(c=e.data)==null?void 0:c[a],s=o===null?t.color:i(o);return s===null?t.color:s}:()=>t.color},seriesFormatter:(t,e)=>{const{seriesOrder:n,series:r}=t,i=SN(N({},t,{defaultStrategy:{stackOffset:"none"}})),a=e!=null?e:[];n.forEach(s=>{const c=r[s].data;c!==void 0&&c.forEach((u,d)=>{a.length<=d?a.push({[s]:u}):a[d][s]=u})});const o={};return i.forEach(s=>{const{ids:c,stackingOrder:u,stackingOffset:d}=s,f=xN().keys(c.map(p=>{const h=r[p].dataKey;return r[p].data===void 0&&h!==void 0?h:p})).value((p,h)=>{var g;return(g=p[h])!=null?g:0}).order(u).offset(d)(a);c.forEach((p,h)=>{const g=r[p].dataKey;o[p]=N({},r[p],{data:g?e.map(m=>{const v=m[g];return typeof v!="number"?null:v}):r[p].data,stackedData:f[h].map(([m,v])=>[m,v])})})}),{seriesOrder:n,stackingGroups:i,series:_N(o,s=>s==null?"":s.toLocaleString())}},xExtremumGetter:rTe,yExtremumGetter:t=>{const{series:e,axis:n,isDefaultAxis:r,getFilters:i}=t;return Object.keys(e).filter(a=>{var s;const o=(s=e[a].yAxisId)!=null?s:e[a].yAxisKey;return o===n.id||r&&o===void 0}).reduce((a,o)=>{var m,v;const{area:s,stackedData:c}=e[o],u=s!==void 0,d=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:(m=e[o].xAxisId)!=null?m:e[o].xAxisKey,seriesYAxisId:(v=e[o].yAxisId)!=null?v:e[o].yAxisKey}),f=u&&n.scaleType!=="log"&&typeof e[o].baseline!="string"?b=>b:b=>[b[1],b[1]],p=iTe(f,c,d),[h,g]=p;return[Math.min(h,a[0]),Math.max(g,a[1])]},[1/0,-1/0])}};function Ka(t,e){return typeof t=="function"?t(e):t}const oTe=(t="none")=>{if(typeof t=="function")return t;switch(t){case"none":return null;case"desc":return(e,n)=>n-e;case"asc":return(e,n)=>e-n;default:return null}},sTe=[tTe,nTe,aTe,{seriesType:"pie",colorProcessor:t=>e=>t.data[e].color,seriesFormatter:t=>{const{seriesOrder:e,series:n}=t,r={};return e.forEach(i=>{var o,s,c,u;const a=Uke().startAngle(2*Math.PI*((o=n[i].startAngle)!=null?o:0)/360).endAngle(2*Math.PI*((s=n[i].endAngle)!=null?s:360)/360).padAngle(2*Math.PI*((c=n[i].paddingAngle)!=null?c:0)/360).sortValues(oTe((u=n[i].sortingValues)!=null?u:"none"))(n[i].data.map(d=>d.value));r[i]=N({valueFormatter:d=>d.value.toLocaleString()},n[i],{data:n[i].data.map((d,f)=>{var p;return N({},d,{id:(p=d.id)!=null?p:`auto-generated-pie-id-${i}-${f}`},a[f])}).map((d,f)=>{var p,h,g;return N({},d,{formattedValue:(g=(h=(p=n[i]).valueFormatter)==null?void 0:h.call(p,N({},d,{label:Ka(d.label,"arc")}),{dataIndex:f}))!=null?g:d.value.toLocaleString()})})})}),{seriesOrder:e,series:r}}}];function lTe(t){const e=t!=null?t:sTe,n={},r={},i={},a={},o={},s={};for(let c=0;c<e.length;c+=1){const u=e[c],d=u.seriesType;n[d]=u.seriesFormatter,r[d]=u.colorProcessor,u.xExtremumGetter&&(i[d]=u.xExtremumGetter),u.yExtremumGetter&&(a[d]=u.yExtremumGetter),u.rotationExtremumGetter&&(o[d]=u.rotationExtremumGetter),u.radiusExtremumGetter&&(s[d]=u.radiusExtremumGetter)}return{seriesFormatters:n,colorProcessors:r,xExtremumGetters:i,yExtremumGetters:a,rotationExtremumGetters:o,radiusExtremumGetters:s}}function cTe(t){const{children:e,plugins:n}=t,r=P.useMemo(()=>({isInitialized:!0,data:lTe(n)}),[n]);return L.jsx(Jd.Provider,{value:r,children:e})}function TN(t){const{isInitialized:e,data:n}=P.useContext(Jd);if(!e)throw new Error(["MUI X: Could not find the plugin context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
|
|
2637
2637
|
`));return n.colorProcessors}function uTe(t){const{isInitialized:e,data:n}=P.useContext(Jd);if(!e)throw new Error(["MUI X: Could not find the plugin context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
|