fansunited-widget-either-or 2.6.2 → 2.7.0
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/either-or-manager.umd.js
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
`&&(C.value+=" ");const w=y.boxSizing,I=kf(y.paddingBottom)+kf(y.paddingTop),_=kf(y.borderBottomWidth)+kf(y.borderTopWidth),T=C.scrollHeight;C.value="x";const O=C.scrollHeight;let P=T;o&&(P=Math.max(Number(o)*O,P)),i&&(P=Math.min(Number(i)*O,P)),P=Math.max(P,O);const k=P+(w==="border-box"?I+_:0),S=Math.abs(P-T)<=1;return{outerHeightStyle:k,overflowing:S}},[i,o,e.placeholder]),m=R.useCallback(()=>{const b=g();if(yQ(b))return;const x=b.outerHeightStyle,y=d.current;p.current!==x&&(p.current=x,y.style.height=`${x}px`),y.style.overflow=b.overflowing?"hidden":""},[g]);li(()=>{const b=()=>{m()};let x;const y=fY(b),C=d.current,w=Nu(C);w.addEventListener("resize",y);let I;return typeof ResizeObserver!="undefined"&&(I=new ResizeObserver(b),I.observe(C)),()=>{y.clear(),cancelAnimationFrame(x),w.removeEventListener("resize",y),I&&I.disconnect()}},[g,m]),li(()=>{m()});const v=b=>{u||m(),n&&n(b)};return E.jsxs(R.Fragment,{children:[E.jsx("textarea",j({value:s,onChange:v,ref:h,rows:o,style:a},c)),E.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:j({},vQ.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function dO(t){return typeof t.normalize!="undefined"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function xQ(t={}){const{ignoreAccents:e=!0,ignoreCase:r=!0,limit:n,matchFrom:i="any",stringify:o,trim:a=!1}=t;return(s,{inputValue:c,getOptionLabel:u})=>{let d=a?c.trim():c;r&&(d=d.toLowerCase()),e&&(d=dO(d));const h=d?s.filter(p=>{let f=(o||u)(p);return r&&(f=f.toLowerCase()),e&&(f=dO(f)),i==="start"?f.indexOf(d)===0:f.indexOf(d)>-1}):s;return typeof n=="number"?h.slice(0,n):h}}function Af(t,e){for(let r=0;r<t.length;r+=1)if(e(t[r]))return r;return-1}const wQ=xQ(),CQ=5,IQ=t=>{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))},SQ=[];function _Q(t){const{unstable_isActiveElementInListbox:e=IQ,unstable_classNamePrefix:r="Mui",autoComplete:n=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:a=!1,clearOnBlur:s=!t.freeSolo,clearOnEscape:c=!1,componentName:u="useAutocomplete",defaultValue:d=t.multiple?SQ:null,disableClearable:h=!1,disableCloseOnSelect:p=!1,disabled:f,disabledItemsFocusable:g=!1,disableListWrap:m=!1,filterOptions:v=wQ,filterSelectedOptions:b=!1,freeSolo:x=!1,getOptionDisabled:y,getOptionKey:C,getOptionLabel:w=Pe=>{var Ie;return(Ie=Pe.label)!=null?Ie:Pe},groupBy:I,handleHomeEndKeys:_=!t.freeSolo,id:T,includeInputInList:O=!1,inputValue:P,isOptionEqualToValue:k=(Pe,Ie)=>Pe===Ie,multiple:S=!1,onChange:M,onClose:$,onHighlightChange:D,onInputChange:N,onOpen:z,open:U,openOnFocus:V=!1,options:q,readOnly:F=!1,selectOnFocus:B=!t.freeSolo,value:H}=t,G=Sa(T);let Z=w;Z=Pe=>{const Ie=w(Pe);return typeof Ie!="string"?String(Ie):Ie};const Y=R.useRef(!1),Q=R.useRef(!0),K=R.useRef(null),X=R.useRef(null),[ee,ae]=R.useState(null),[oe,Ce]=R.useState(-1),be=i?0:-1,ge=R.useRef(be),[ve,fe]=Al({controlled:H,default:d,name:u}),[ne,le]=Al({controlled:P,default:"",name:u,state:"inputValue"}),[he,ye]=R.useState(!1),pe=R.useCallback((Pe,Ie)=>{if(!(S?ve.length<Ie.length:Ie!==null)&&!s)return;let ut;if(S)ut="";else if(Ie==null)ut="";else{const Dt=Z(Ie);ut=typeof Dt=="string"?Dt:""}ne!==ut&&(le(ut),N&&N(Pe,ut,"reset"))},[Z,ne,S,N,le,s,ve]),[Le,He]=Al({controlled:U,default:!1,name:u,state:"open"}),[Ve,pt]=R.useState(!0),ot=!S&&ve!=null&&ne===Z(ve),we=Le&&!F,Ee=we?v(q.filter(Pe=>!(b&&(S?ve:[ve]).some(Ie=>Ie!==null&&k(Pe,Ie)))),{inputValue:ot&&Ve?"":ne,getOptionLabel:Z}):[],Ae=AY({filteredOptions:Ee,value:ve,inputValue:ne});R.useEffect(()=>{const Pe=ve!==Ae.value;he&&!Pe||x&&!Pe||pe(null,ve)},[ve,pe,he,Ae.value,x]);const We=Le&&Ee.length>0&&!F,Me=ci(Pe=>{Pe===-1?K.current.focus():ee.querySelector(`[data-tag-index="${Pe}"]`).focus()});R.useEffect(()=>{S&&oe>ve.length-1&&(Ce(-1),Me(-1))},[ve,S,oe,Me]);function $e(Pe,Ie){if(!X.current||Pe<0||Pe>=Ee.length)return-1;let Ke=Pe;for(;;){const ut=X.current.querySelector(`[data-option-index="${Ke}"]`),Dt=g?!1:!ut||ut.disabled||ut.getAttribute("aria-disabled")==="true";if(ut&&ut.hasAttribute("tabindex")&&!Dt)return Ke;if(Ie==="next"?Ke=(Ke+1)%Ee.length:Ke=(Ke-1+Ee.length)%Ee.length,Ke===Pe)return-1}}const Je=ci(({event:Pe,index:Ie,reason:Ke="auto"})=>{if(ge.current=Ie,Ie===-1?K.current.removeAttribute("aria-activedescendant"):K.current.setAttribute("aria-activedescendant",`${G}-option-${Ie}`),D&&D(Pe,Ie===-1?null:Ee[Ie],Ke),!X.current)return;const ut=X.current.querySelector(`[role="option"].${r}-focused`);ut&&(ut.classList.remove(`${r}-focused`),ut.classList.remove(`${r}-focusVisible`));let Dt=X.current;if(X.current.getAttribute("role")!=="listbox"&&(Dt=X.current.parentElement.querySelector('[role="listbox"]')),!Dt)return;if(Ie===-1){Dt.scrollTop=0;return}const cr=X.current.querySelector(`[data-option-index="${Ie}"]`);if(cr&&(cr.classList.add(`${r}-focused`),Ke==="keyboard"&&cr.classList.add(`${r}-focusVisible`),Dt.scrollHeight>Dt.clientHeight&&Ke!=="mouse"&&Ke!=="touch")){const pr=cr,Hn=Dt.clientHeight+Dt.scrollTop,iu=pr.offsetTop+pr.offsetHeight;iu>Hn?Dt.scrollTop=iu-Dt.clientHeight:pr.offsetTop-pr.offsetHeight*(I?1.3:0)<Dt.scrollTop&&(Dt.scrollTop=pr.offsetTop-pr.offsetHeight*(I?1.3:0))}}),Ge=ci(({event:Pe,diff:Ie,direction:Ke="next",reason:ut="auto"})=>{if(!we)return;const cr=$e((()=>{const pr=Ee.length-1;if(Ie==="reset")return be;if(Ie==="start")return 0;if(Ie==="end")return pr;const Hn=ge.current+Ie;return Hn<0?Hn===-1&&O?-1:m&&ge.current!==-1||Math.abs(Ie)>1?0:pr:Hn>pr?Hn===pr+1&&O?-1:m||Math.abs(Ie)>1?pr:0:Hn})(),Ke);if(Je({index:cr,reason:ut,event:Pe}),n&&Ie!=="reset")if(cr===-1)K.current.value=ne;else{const pr=Z(Ee[cr]);K.current.value=pr,pr.toLowerCase().indexOf(ne.toLowerCase())===0&&ne.length>0&&K.current.setSelectionRange(ne.length,pr.length)}}),Nt=()=>{const Pe=(Ie,Ke)=>{const ut=Ie?Z(Ie):"",Dt=Ke?Z(Ke):"";return ut===Dt};if(ge.current!==-1&&Ae.filteredOptions&&Ae.filteredOptions.length!==Ee.length&&Ae.inputValue===ne&&(S?ve.length===Ae.value.length&&Ae.value.every((Ie,Ke)=>Z(ve[Ke])===Z(Ie)):Pe(Ae.value,ve))){const Ie=Ae.filteredOptions[ge.current];if(Ie)return Af(Ee,Ke=>Z(Ke)===Z(Ie))}return-1},It=R.useCallback(()=>{if(!we)return;const Pe=Nt();if(Pe!==-1){ge.current=Pe;return}const Ie=S?ve[0]:ve;if(Ee.length===0||Ie==null){Ge({diff:"reset"});return}if(X.current){if(Ie!=null){const Ke=Ee[ge.current];if(S&&Ke&&Af(ve,Dt=>k(Ke,Dt))!==-1)return;const ut=Af(Ee,Dt=>k(Dt,Ie));ut===-1?Ge({diff:"reset"}):Je({index:ut});return}if(ge.current>=Ee.length-1){Je({index:Ee.length-1});return}Je({index:ge.current})}},[Ee.length,S?!1:ve,b,Ge,Je,we,ne,S]),Br=ci(Pe=>{lf(X,Pe),Pe&&It()});R.useEffect(()=>{It()},[It]);const hr=Pe=>{Le||(He(!0),pt(!0),z&&z(Pe))},Ht=(Pe,Ie)=>{Le&&(He(!1),$&&$(Pe,Ie))},Ot=(Pe,Ie,Ke,ut)=>{if(S){if(ve.length===Ie.length&&ve.every((Dt,cr)=>Dt===Ie[cr]))return}else if(ve===Ie)return;M&&M(Pe,Ie,Ke,ut),fe(Ie)},Tt=R.useRef(!1),Mt=(Pe,Ie,Ke="selectOption",ut="options")=>{let Dt=Ke,cr=Ie;if(S){cr=Array.isArray(ve)?ve.slice():[];const pr=Af(cr,Hn=>k(Ie,Hn));pr===-1?cr.push(Ie):ut!=="freeSolo"&&(cr.splice(pr,1),Dt="removeOption")}pe(Pe,cr),Ot(Pe,cr,Dt,{option:Ie}),!p&&(!Pe||!Pe.ctrlKey&&!Pe.metaKey)&&Ht(Pe,Dt),(a===!0||a==="touch"&&Tt.current||a==="mouse"&&!Tt.current)&&K.current.blur()};function te(Pe,Ie){if(Pe===-1)return-1;let Ke=Pe;for(;;){if(Ie==="next"&&Ke===ve.length||Ie==="previous"&&Ke===-1)return-1;const ut=ee.querySelector(`[data-tag-index="${Ke}"]`);if(!ut||!ut.hasAttribute("tabindex")||ut.disabled||ut.getAttribute("aria-disabled")==="true")Ke+=Ie==="next"?1:-1;else return Ke}}const ie=(Pe,Ie)=>{if(!S)return;ne===""&&Ht(Pe,"toggleInput");let Ke=oe;oe===-1?ne===""&&Ie==="previous"&&(Ke=ve.length-1):(Ke+=Ie==="next"?1:-1,Ke<0&&(Ke=0),Ke===ve.length&&(Ke=-1)),Ke=te(Ke,Ie),Ce(Ke),Me(Ke)},ue=Pe=>{Y.current=!0,le(""),N&&N(Pe,"","clear"),Ot(Pe,S?[]:null,"clear")},de=Pe=>Ie=>{if(Pe.onKeyDown&&Pe.onKeyDown(Ie),!Ie.defaultMuiPrevented&&(oe!==-1&&["ArrowLeft","ArrowRight"].indexOf(Ie.key)===-1&&(Ce(-1),Me(-1)),Ie.which!==229))switch(Ie.key){case"Home":we&&_&&(Ie.preventDefault(),Ge({diff:"start",direction:"next",reason:"keyboard",event:Ie}));break;case"End":we&&_&&(Ie.preventDefault(),Ge({diff:"end",direction:"previous",reason:"keyboard",event:Ie}));break;case"PageUp":Ie.preventDefault(),Ge({diff:-5,direction:"previous",reason:"keyboard",event:Ie}),hr(Ie);break;case"PageDown":Ie.preventDefault(),Ge({diff:CQ,direction:"next",reason:"keyboard",event:Ie}),hr(Ie);break;case"ArrowDown":Ie.preventDefault(),Ge({diff:1,direction:"next",reason:"keyboard",event:Ie}),hr(Ie);break;case"ArrowUp":Ie.preventDefault(),Ge({diff:-1,direction:"previous",reason:"keyboard",event:Ie}),hr(Ie);break;case"ArrowLeft":ie(Ie,"previous");break;case"ArrowRight":ie(Ie,"next");break;case"Enter":if(ge.current!==-1&&we){const Ke=Ee[ge.current],ut=y?y(Ke):!1;if(Ie.preventDefault(),ut)return;Mt(Ie,Ke,"selectOption"),n&&K.current.setSelectionRange(K.current.value.length,K.current.value.length)}else x&&ne!==""&&ot===!1&&(S&&Ie.preventDefault(),Mt(Ie,ne,"createOption","freeSolo"));break;case"Escape":we?(Ie.preventDefault(),Ie.stopPropagation(),Ht(Ie,"escape")):c&&(ne!==""||S&&ve.length>0)&&(Ie.preventDefault(),Ie.stopPropagation(),ue(Ie));break;case"Backspace":if(S&&!F&&ne===""&&ve.length>0){const Ke=oe===-1?ve.length-1:oe,ut=ve.slice();ut.splice(Ke,1),Ot(Ie,ut,"removeOption",{option:ve[Ke]})}break;case"Delete":if(S&&!F&&ne===""&&ve.length>0&&oe!==-1){const Ke=oe,ut=ve.slice();ut.splice(Ke,1),Ot(Ie,ut,"removeOption",{option:ve[Ke]})}break}},De=Pe=>{ye(!0),V&&!Y.current&&hr(Pe)},Ue=Pe=>{if(e(X)){K.current.focus();return}ye(!1),Q.current=!0,Y.current=!1,o&&ge.current!==-1&&we?Mt(Pe,Ee[ge.current],"blur"):o&&x&&ne!==""?Mt(Pe,ne,"blur","freeSolo"):s&&pe(Pe,ve),Ht(Pe,"blur")},Qe=Pe=>{const Ie=Pe.target.value;ne!==Ie&&(le(Ie),pt(!1),N&&N(Pe,Ie,"input")),Ie===""?!h&&!S&&Ot(Pe,null,"clear"):hr(Pe)},qe=Pe=>{const Ie=Number(Pe.currentTarget.getAttribute("data-option-index"));ge.current!==Ie&&Je({event:Pe,index:Ie,reason:"mouse"})},at=Pe=>{Je({event:Pe,index:Number(Pe.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Tt.current=!0},Ye=Pe=>{const Ie=Number(Pe.currentTarget.getAttribute("data-option-index"));Mt(Pe,Ee[Ie],"selectOption"),Tt.current=!1},Xe=Pe=>Ie=>{const Ke=ve.slice();Ke.splice(Pe,1),Ot(Ie,Ke,"removeOption",{option:ve[Pe]})},wt=Pe=>{Le?Ht(Pe,"toggleInput"):hr(Pe)},Yr=Pe=>{Pe.currentTarget.contains(Pe.target)&&Pe.target.getAttribute("id")!==G&&Pe.preventDefault()},Kr=Pe=>{Pe.currentTarget.contains(Pe.target)&&(K.current.focus(),B&&Q.current&&K.current.selectionEnd-K.current.selectionStart===0&&K.current.select(),Q.current=!1)},ma=Pe=>{!f&&(ne===""||!Le)&&wt(Pe)};let Ri=x&&ne.length>0;Ri=Ri||(S?ve.length>0:ve!==null);let nu=Ee;return I&&(nu=Ee.reduce((Pe,Ie,Ke)=>{const ut=I(Ie);return Pe.length>0&&Pe[Pe.length-1].group===ut?Pe[Pe.length-1].options.push(Ie):Pe.push({key:Ke,index:Ke,group:ut,options:[Ie]}),Pe},[])),f&&he&&Ue(),{getRootProps:(Pe={})=>j({"aria-owns":We?`${G}-listbox`:null},Pe,{onKeyDown:de(Pe),onMouseDown:Yr,onClick:Kr}),getInputLabelProps:()=>({id:`${G}-label`,htmlFor:G}),getInputProps:()=>({id:G,value:ne,onBlur:Ue,onFocus:De,onChange:Qe,onMouseDown:ma,"aria-activedescendant":we?"":null,"aria-autocomplete":n?"both":"list","aria-controls":We?`${G}-listbox`:void 0,"aria-expanded":We,autoComplete:"off",ref:K,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:f}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ue}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:wt}),getTagProps:({index:Pe})=>j({key:Pe,"data-tag-index":Pe,tabIndex:-1},!F&&{onDelete:Xe(Pe)}),getListboxProps:()=>({role:"listbox",id:`${G}-listbox`,"aria-labelledby":`${G}-label`,ref:Br,onMouseDown:Pe=>{Pe.preventDefault()}}),getOptionProps:({index:Pe,option:Ie})=>{var Ke;const ut=(S?ve:[ve]).some(cr=>cr!=null&&k(Ie,cr)),Dt=y?y(Ie):!1;return{key:(Ke=C==null?void 0:C(Ie))!=null?Ke:Z(Ie),tabIndex:-1,role:"option",id:`${G}-option-${Pe}`,onMouseMove:qe,onClick:Ye,onTouchStart:at,"data-option-index":Pe,"aria-disabled":Dt,"aria-selected":ut}},id:G,inputValue:ne,value:ve,dirty:Ri,expanded:we&&ee,popupOpen:we,focused:he||oe!==-1,anchorEl:ee,setAnchorEl:ae,focusedTag:oe,groupedOptions:nu}}function TQ(t){return et("MuiAccordion",t)}const kQ=tt("MuiAccordion",["root","expanded","disabled"]),AQ=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],PQ=["component","slots","slotProps"],EQ=["component"];function Se(t,e){const{className:r,elementType:n,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=e,c=Fe(e,AQ),{component:u,slots:d={[t]:void 0},slotProps:h={[t]:void 0}}=o,p=Fe(o,PQ),f=d[t]||n,g=wE(h[t],i),m=IE(j({className:r},c,{externalForwardedProps:t==="root"?p:void 0,externalSlotProps:g})),{props:{component:v},internalRef:b}=m,x=Fe(m.props,EQ),y=Rn(b,g==null?void 0:g.ref,e.ref),C=a?a(x):{},w=j({},i,C),I=t==="root"?v||u:v,_=xE(f,j({},t==="root"&&!u&&!d[t]&&s,t!=="root"&&!d[t]&&s,x,I&&{as:I},{ref:y}),w);return Object.keys(C).forEach(T=>{delete _[T]}),[f,_]}const $x=R.createContext({});function OQ(t){return et("MuiListItem",t)}const Pf=tt("MuiListItem",["root","startAction","endAction","nested","nesting","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]),Ef=R.createContext(!1),Ml=R.createContext(!1),hO=R.createContext(!1),Lx=R.createContext(void 0),pO=R.createContext(void 0),Of=R.createContext(void 0),RQ=["component","className","children","nested","sticky","variant","color","startAction","endAction","role","slots","slotProps"],MQ=t=>{const{sticky:e,nested:r,nesting:n,variant:i,color:o}=t,a={root:["root",r&&"nested",n&&"nesting",e&&"sticky",o&&`color${ke(o)}`,i&&`variant${ke(i)}`],startAction:["startAction"],endAction:["endAction"]};return nt(a,OQ,{})},Fx=xe("li")(({theme:t,ownerState:e})=>{var r;return[!e.nested&&{"--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItemButton-marginBlock":"calc(-1 * var(--ListItem-paddingY))",alignItems:"center",gap:"var(--ListItem-gap)",marginInline:"var(--ListItem-marginInline)"},e.nested&&{"--NestedList-marginRight":"calc(-1 * var(--ListItem-paddingRight))","--NestedList-marginLeft":"calc(-1 * var(--ListItem-paddingLeft))","--NestedListItem-paddingLeft":"calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItem-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",flexDirection:"column"},j({"--unstable_actionRadius":"calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"},e.startAction&&{"--unstable_startActionWidth":"2rem"},e.endAction&&{"--unstable_endActionWidth":"2.5rem"},{boxSizing:"border-box",borderRadius:"var(--ListItem-radius)",display:"var(--_ListItem-display)","&:not([hidden])":{"--_ListItem-display":"var(--_List-markerDisplay, flex)"},flex:"none",listStyleType:"var(--_List-markerType, disc)",position:"relative",paddingBlockStart:e.nested?0:"var(--ListItem-paddingY)",paddingBlockEnd:e.nested?0:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)"},e["data-first-child"]===void 0&&j({},e.row?{marginInlineStart:"var(--List-gap)"}:{marginBlockStart:"var(--List-gap)"}),e.row&&e.wrap&&{marginInlineStart:"var(--List-gap)",marginBlockStart:"var(--List-gap)"},{minBlockSize:"var(--ListItem-minHeight)"},e.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:`var(--ListItem-stickyBackground, ${t.vars.palette.background.body})`},{[`.${Pf.nested} > &`]:{"--_ListItem-display":"flex"}}),(r=t.variants[e.variant])==null?void 0:r[e.color]]}),DQ=xe(Fx,{name:"JoyListItem",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$Q=xe("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(t,e)=>e.startAction})(({ownerState:t})=>({display:"inherit",position:"absolute",top:t.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",left:0,transform:"translate(var(--ListItem-startActionTranslateX), -50%)",zIndex:1})),LQ=xe("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(t,e)=>e.startAction})(({ownerState:t})=>({display:"inherit",position:"absolute",top:t.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",right:0,transform:"translate(var(--ListItem-endActionTranslateX), -50%)"})),ka=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListItem"}),i=R.useContext(Of),o=R.useContext(Lx),a=R.useContext(Ml),s=R.useContext(hO),c=R.useContext(Ef),{component:u,className:d,children:h,nested:p=!1,sticky:f=!1,variant:g="plain",color:m="neutral",startAction:v,endAction:b,role:x,slots:y={},slotProps:C={}}=n,w=Fe(n,RQ),[I,_]=R.useState(""),[T,O]=(o==null?void 0:o.split(":"))||["",""],P=u||(T&&!T.match(/^(ul|ol|menu)$/)?"div":void 0);let k=i==="menu"?"none":void 0;o&&(k={menu:"none",menubar:"none",group:"presentation"}[O]),x&&(k=x);const S=j({},n,{sticky:f,startAction:v,endAction:b,row:a,wrap:s,variant:g,color:m,nesting:c,nested:p,component:P,role:k}),M=MQ(S),$=j({},w,{component:P,slots:y,slotProps:C}),[D,N]=Se("root",{additionalProps:{role:k},ref:r,className:ft(M.root,d),elementType:DQ,externalForwardedProps:$,ownerState:S}),[z,U]=Se("startAction",{className:M.startAction,elementType:$Q,externalForwardedProps:$,ownerState:S}),[V,q]=Se("endAction",{className:M.endAction,elementType:LQ,externalForwardedProps:$,ownerState:S});return E.jsx(pO.Provider,{value:_,children:E.jsx(Ef.Provider,{value:p?I||!0:!1,children:E.jsxs(D,j({},N,{children:[v&&E.jsx(z,j({},U,{children:v})),R.Children.map(h,(F,B)=>{var H;return R.isValidElement(F)?R.cloneElement(F,j({},B===0&&{"data-first-child":""},kl(F,["ListItem"])&&{component:((H=F.props)==null?void 0:H.component)||"div"})):F}),b&&E.jsx(V,j({},q,{children:b}))]}))})})});ka.muiName="ListItem";function FQ(t){return et("MuiAccordionDetails",t)}const Ku=tt("MuiAccordionDetails",["root","content","expanded"]),NQ=["accordionId","component","color","children","defaultExpanded","disabled","expanded","onChange","variant","slots","slotProps"],jQ=t=>{const{variant:e,color:r,expanded:n,disabled:i}=t,o={root:["root",n&&"expanded",i&&"disabled",r&&`color${ke(r)}`,e&&`variant${ke(e)}`]};return nt(o,TQ,{})},BQ=xe(Fx,{name:"JoyAccordion",slot:"Root",overridesResolver:(t,e)=>e.root})({borderBottom:"var(--Accordion-borderBottom)","&[data-first-child]":{"--ListItem-radius":"var(--unstable_List-childRadius) var(--unstable_List-childRadius) 0 0"},"&[data-last-child]":{"--ListItem-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)",'& [aria-expanded="true"]':{"--ListItem-radius":"0"},[`& .${Ku.root}`]:{"--AccordionDetails-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)"}},"&:not([data-first-child]):not([data-last-child])":{"--ListItem-radius":"0"}}),Nx=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAccordion"}),{accordionId:i,component:o="div",color:a="neutral",children:s,defaultExpanded:c=!1,disabled:u=!1,expanded:d,onChange:h,variant:p="plain",slots:f={},slotProps:g={}}=n,m=Fe(n,NQ),v=Ia(i),[b,x]=cE({controlled:d,default:c,name:"Accordion",state:"expanded"}),y=R.useCallback(P=>{x(!b),h&&h(P,!b)},[b,h,x]),C=R.useMemo(()=>({accordionId:v,expanded:b,disabled:u,toggle:y}),[v,b,u,y]),w=j({},m,{component:o,slots:f,slotProps:g}),I=j({},n,{component:o,color:a,variant:p,expanded:b,disabled:u,nested:!0}),_=jQ(I),[T,O]=Se("root",{ref:r,className:_.root,elementType:BQ,externalForwardedProps:w,ownerState:I});return E.jsx($x.Provider,{value:C,children:E.jsx(T,j({},O,{children:R.Children.map(s,(P,k)=>R.isValidElement(P)&&k===0?R.cloneElement(P,{"data-first-child":""}):P)}))})}),zQ=["component","children","color","variant","slots","slotProps"],UQ=t=>{const{expanded:e}=t;return nt({root:["root",e&&"expanded"],content:["content",e&&"expanded"]},FQ,{})},HQ=xe("div",{name:"JoyAccordionDetails",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{var r;return j({overflow:"hidden",borderRadius:"var(--AccordionDetails-radius)",display:"grid",gridTemplateRows:"1fr",marginInline:"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",transition:"var(--AccordionDetails-transition)"},(r=e.variants[t.variant])==null?void 0:r[t.color],{[`&:not(.${Ku.expanded})`]:{gridTemplateRows:"0fr"}})}),VQ=xe("div",{name:"JoyAccordionDetails",slot:"Content",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",overflow:"hidden",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",paddingBlockStart:"calc(var(--ListItem-paddingY) / 2)",paddingBlockEnd:"calc(2.5 * var(--ListItem-paddingY))",transition:"var(--AccordionDetails-transition)",[`&:not(.${Ku.expanded})`]:{paddingBlock:0}}),jx=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAccordionDetails"}),{component:i="div",children:o,color:a="neutral",variant:s="plain",slots:c={},slotProps:u={}}=n,d=Fe(n,zQ),{accordionId:h,expanded:p=!1}=R.useContext($x),f=R.useRef(null),g=Rn(f,r);R.useEffect(()=>{f.current&&f.current.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])').forEach(_=>{if(p){const T=_.getAttribute("data-prev-tabindex"),O=_.getAttribute("tabindex");O&&T&&(_.setAttribute("tabindex",T),_.removeAttribute("data-prev-tabindex")),!T&&!O&&_.removeAttribute("tabindex")}else _.setAttribute("data-prev-tabindex",_.getAttribute("tabindex")||""),_.setAttribute("tabindex","-1")})},[p]);const m=j({},d,{component:i,slots:c,slotProps:u}),v=j({},n,{component:i,color:a,variant:s,expanded:p,nesting:!0}),b=UQ(v),[x,y]=Se("root",{ref:g,className:b.root,elementType:HQ,externalForwardedProps:m,additionalProps:{id:`${h}-details`,"aria-labelledby":`${h}-summary`,role:"region",hidden:p?void 0:!0},ownerState:v}),[C,w]=Se("content",{className:b.content,elementType:VQ,externalForwardedProps:m,ownerState:v});return E.jsx(x,j({},y,{children:E.jsx(C,j({},w,{children:o}))}))});function WQ(t){return et("MuiAccordionGroup",t)}tt("MuiAccordionGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const Rf={"--NestedList-marginRight":"0px","--NestedList-marginLeft":"0px","--NestedListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px"};function Dl(t){const{children:e,nested:r,row:n=!1,wrap:i=!1}=t,o=E.jsx(Ml.Provider,{value:n,children:E.jsx(hO.Provider,{value:i,children:R.Children.map(e,(a,s)=>R.isValidElement(a)?R.cloneElement(a,j({},s===0&&{"data-first-child":""},s===R.Children.count(e)-1&&{"data-last-child":""})):a)})});return r===void 0?o:E.jsx(Ef.Provider,{value:r,children:o})}const Mo=({theme:t,ownerState:e},r)=>{let n={};function i(o){if(typeof o=="function"){const a=o(t);i(a)}else Array.isArray(o)?o.forEach(a=>{typeof a!="boolean"&&i(a)}):typeof o=="object"&&(n=j({},n,o))}return e.sx&&(i(e.sx),r.forEach(o=>{const a=n[o];if(typeof a=="string"||typeof a=="number")if(o==="borderRadius")if(typeof a=="number")n[o]=`${a}px`;else{var s;n[o]=((s=t.vars)==null?void 0:s.radius[a])||a}else["p","padding","m","margin"].indexOf(o)!==-1&&typeof a=="number"?n[o]=t.spacing(a):n[o]=a;else typeof a=="function"?n[o]=a(t):n[o]=void 0})),n};function qQ(t){return et("MuiList",t)}const GQ=tt("MuiList",["root","nesting","scoped","sizeSm","sizeMd","sizeLg","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]),YQ=R.createContext(void 0),KQ=["component","className","children","size","orientation","wrap","variant","color","role","slots","slotProps"],JQ=t=>{const{variant:e,color:r,size:n,nesting:i,orientation:o,instanceSize:a}=t,s={root:["root",o,e&&`variant${ke(e)}`,r&&`color${ke(r)}`,!a&&!i&&n&&`size${ke(n)}`,a&&`size${ke(a)}`,i&&"nesting"]};return nt(s,qQ,{})},$l=xe("ul")(({theme:t,ownerState:e})=>{var r;const{p:n,padding:i,borderRadius:o}=Mo({theme:t,ownerState:e},["p","padding","borderRadius"]);function a(s){return s==="sm"?{"--ListDivider-gap":"0.25rem","--ListItem-minHeight":"2rem","--ListItem-paddingY":"3px","--ListItem-paddingX":e.marker?"3px":"0.5rem","--ListItem-gap":"0.5rem","--ListItemDecorator-size":e.orientation==="horizontal"?"1.5rem":"2rem","--Icon-fontSize":t.vars.fontSize.lg}:s==="md"?{"--ListDivider-gap":"0.375rem","--ListItem-minHeight":"2.25rem","--ListItem-paddingY":"0.25rem","--ListItem-paddingX":e.marker?"0.25rem":"0.75rem","--ListItem-gap":"0.625rem","--ListItemDecorator-size":e.orientation==="horizontal"?"1.75rem":"2.5rem","--Icon-fontSize":t.vars.fontSize.xl}:s==="lg"?{"--ListDivider-gap":"0.5rem","--ListItem-minHeight":"2.75rem","--ListItem-paddingY":"0.375rem","--ListItem-paddingX":e.marker?"0.5rem":"1rem","--ListItem-gap":"0.75rem","--ListItemDecorator-size":e.orientation==="horizontal"?"2.25rem":"3rem","--Icon-fontSize":t.vars.fontSize.xl2}:{}}return[e.nesting&&j({},a(e.instanceSize),{"--ListItem-paddingRight":"var(--ListItem-paddingX)","--ListItem-paddingLeft":"var(--NestedListItem-paddingLeft)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px",padding:0},e.marker&&{paddingInlineStart:"calc(3ch - var(--_List-markerDeduct, 0px))"},{marginInlineStart:"var(--NestedList-marginLeft)",marginInlineEnd:"var(--NestedList-marginRight)",marginBlockStart:"var(--List-gap)",marginBlockEnd:"initial"}),!e.nesting&&j({},a(e.size),{"--List-gap":"0px","--List-nestedInsetStart":"0px","--ListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItem-paddingRight":"var(--ListItem-paddingX)"},e.marker&&{"--_List-markerDeduct":"1ch"},{"--unstable_List-childRadius":"calc(max(var(--List-radius) - var(--List-padding), min(var(--List-padding) / 2, var(--List-radius) / 2)) - var(--variant-borderWidth, 0px))","--ListItem-radius":"var(--unstable_List-childRadius)","--ListItem-startActionTranslateX":"calc(0.5 * var(--ListItem-paddingLeft))","--ListItem-endActionTranslateX":"calc(-0.5 * var(--ListItem-paddingRight))",margin:"initial"},t.typography[`body-${e.size}`],e.orientation==="horizontal"?j({},e.wrap?{padding:"var(--List-padding)",marginInlineStart:"calc(-1 * var(--List-gap))",marginBlockStart:"calc(-1 * var(--List-gap))"}:{paddingInline:"var(--List-padding, var(--ListDivider-gap))",paddingBlock:"var(--List-padding)"}):{paddingBlock:"var(--List-padding, var(--ListDivider-gap))",paddingInline:"var(--List-padding)"},e.marker&&{paddingInlineStart:"3ch"}),j({boxSizing:"border-box",borderRadius:"var(--List-radius)",listStyle:"none",display:"flex",flexDirection:e.orientation==="horizontal"?"row":"column"},e.wrap&&{flexWrap:"wrap"},e.marker&&{"--_List-markerDisplay":"list-item","--_List-markerType":e.marker,lineHeight:"calc(var(--ListItem-minHeight) - 2 * var(--ListItem-paddingY))"},{flexGrow:1,position:"relative"},(r=t.variants[e.variant])==null?void 0:r[e.color],{"--unstable_List-borderWidth":"var(--variant-borderWidth, 0px)"},o!==void 0&&{"--List-radius":o},n!==void 0&&{"--List-padding":n},i!==void 0&&{"--List-padding":i})]}),QQ=xe($l,{name:"JoyList",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Mf=R.forwardRef(function(e,r){var n;const i=R.useContext(Ef),o=R.useContext(Of),a=R.useContext(YQ),s=Ze({props:e,name:"JoyList"}),{component:c,className:u,children:d,size:h,orientation:p="vertical",wrap:f=!1,variant:g="plain",color:m="neutral",role:v,slots:b={},slotProps:x={}}=s,y=Fe(s,KQ),C=h||((n=e.size)!=null?n:"md");let w;o&&(w="group"),a&&(w="presentation"),v&&(w=v);const I=j({},s,{instanceSize:e.size,size:C,nesting:i,orientation:p,wrap:f,variant:g,color:m,role:w}),_=JQ(I),T=j({},y,{component:c,slots:b,slotProps:x}),[O,P]=Se("root",{ref:r,className:ft(_.root,u),elementType:QQ,externalForwardedProps:T,ownerState:I,additionalProps:{as:c,role:w,"aria-labelledby":typeof i=="string"?i:void 0}});return E.jsx(O,j({},P,{children:E.jsx(Lx.Provider,{value:`${typeof c=="string"?c:""}:${w||""}`,children:E.jsx(Dl,{row:p==="horizontal",wrap:f,children:d})})}))}),XQ=["component","color","children","disableDivider","variant","transition","size","slots","slotProps"],ZQ=t=>{const{variant:e,color:r,size:n}=t,i={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`,n&&`size${ke(n)}`]};return nt(i,WQ,{})},eX=xe($l,{name:"JoyAccordionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{let r={};return e.transition&&(typeof e.transition=="string"&&(r={"--AccordionDetails-transition":`grid-template-rows ${e.transition}, padding-block ${e.transition}`}),typeof e.transition=="object"&&(r={"--AccordionDetails-transition":`grid-template-rows ${e.transition.initial}, padding-block ${e.transition.initial}`,[`& .${Ku.root}.${Ku.expanded}`]:{"--AccordionDetails-transition":`grid-template-rows ${e.transition.expanded}, padding-block ${e.transition.expanded}`}})),j({"--List-padding":"0px","--ListDivider-gap":"0px"},r,!e.disableDivider&&{[`& .${kQ.root}:not([data-last-child])`]:{"--Accordion-borderBottom":`1px solid ${t.vars.palette.divider}`}})}),Bx=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAccordionGroup"}),{component:i="div",color:o="neutral",children:a,disableDivider:s=!1,variant:c="plain",transition:u="0.2s ease",size:d="md",slots:h={},slotProps:p={}}=n,f=Fe(n,XQ),g=j({},f,{component:i,slots:h,slotProps:p}),m=j({},n,{component:i,color:o,disableDivider:s,variant:c,transition:u,size:d}),v=ZQ(m),[b,x]=Se("root",{ref:r,className:v.root,elementType:eX,externalForwardedProps:g,ownerState:m});return E.jsx(b,j({},x,{children:E.jsx(Dl,{children:a})}))});function tX(t){return et("MuiAccordionSummary",t)}const zx=tt("MuiAccordionSummary",["root","button","indicator","disabled","expanded"]),Df=tt("MuiListItemButton",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","variantPlain","variantSoft","variantOutlined","variantSolid"]),Ux=R.createContext("horizontal"),Ll=xe("div")(({theme:t,ownerState:e})=>{var r,n,i,o,a,s;return j({"--Icon-margin":"initial","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",font:"inherit",display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",gap:"var(--ListItem-gap)"},e.orientation==="vertical"&&{flexDirection:"column",justifyContent:"center"},{textAlign:"initial",textDecoration:"initial",backgroundColor:"initial",cursor:"pointer",marginInline:"var(--ListItemButton-marginInline)",marginBlock:"var(--ListItemButton-marginBlock)"},e["data-first-child"]===void 0&&{marginInlineStart:e.row?"var(--List-gap)":void 0,marginBlockStart:e.row?void 0:"var(--List-gap)"},{paddingBlock:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px))",paddingInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItem-startActionWidth, var(--unstable_startActionWidth, 0px)))",paddingInlineEnd:"calc(var(--ListItem-paddingRight) + var(--ListItem-endActionWidth, var(--unstable_endActionWidth, 0px)))",minBlockSize:"var(--ListItem-minHeight)",border:"1px solid transparent",borderRadius:"var(--ListItem-radius)",flex:"var(--unstable_ListItem-flex, none)",fontSize:"inherit",lineHeight:"inherit",minInlineSize:0,[t.focus.selector]:j({},t.focus.default,{zIndex:1})},(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:active":(n=t.variants[`${e.variant}Active`])==null?void 0:n[e.color],[`.${Pf.root} > &`]:{"--unstable_ListItem-flex":"1 0 0%"},[`&.${Df.selected}`]:j({},(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color],{"--Icon-color":"currentColor"}),[`&:not(.${Df.selected}, [aria-selected="true"])`]:{"&:hover":(o=t.variants[`${e.variant}Hover`])==null?void 0:o[e.color],"&:active":(a=t.variants[`${e.variant}Active`])==null?void 0:a[e.color]},[`&.${Df.disabled}`]:j({},(s=t.variants[`${e.variant}Disabled`])==null?void 0:s[e.color])})});xe(Ll,{name:"JoyListItemButton",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>j({},!t.row&&{[`&.${Df.selected}`]:{fontWeight:e.vars.fontWeight.md}}));function rX(t){return et("MuiSvgIcon",t)}tt("MuiSvgIcon",["root","colorInherit","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","fontSizeInherit","fontSizeXs","fontSizeSm","fontSizeMd","fontSizeLg","fontSizeXl","fontSizeXl2","fontSizeXl3","fontSizeXl4","sizeSm","sizeMd","sizeLg"]);const nX=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox","size","slots","slotProps"],iX=t=>{const{color:e,size:r,fontSize:n}=t,i={root:["root",e&&e!=="inherit"&&`color${ke(e)}`,r&&`size${ke(r)}`,n&&`fontSize${ke(n)}`]};return nt(i,rX,{})},fO={sm:"xl",md:"xl2",lg:"xl3"},oX=xe("svg",{name:"JoySvgIcon",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;return j({},e.instanceSize&&{"--Icon-fontSize":t.vars.fontSize[fO[e.instanceSize]]},e.instanceFontSize&&e.instanceFontSize!=="inherit"&&{"--Icon-fontSize":t.vars.fontSize[e.instanceFontSize]},{userSelect:"none",margin:"var(--Icon-margin)",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,fontSize:`var(--Icon-fontSize, ${t.vars.fontSize[fO[e.size]]||"unset"})`},e.fontSize&&e.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${t.fontSize[e.fontSize]})`},!e.htmlColor&&j({color:`var(--Icon-color, ${t.vars.palette.text.icon})`},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&t.vars.palette[e.color]&&{color:`rgba(${(r=t.vars.palette[e.color])==null?void 0:r.mainChannel} / 1)`}))}),mO=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoySvgIcon"}),{children:i,className:o,color:a,component:s="svg",fontSize:c,htmlColor:u,inheritViewBox:d=!1,titleAccess:h,viewBox:p="0 0 24 24",size:f="md",slots:g={},slotProps:m={}}=n,v=Fe(n,nX),b=R.isValidElement(i)&&i.type==="svg",x=j({},n,{color:a,component:s,size:f,instanceSize:e.size,fontSize:c,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:p,hasSvgAsChild:b}),y=iX(x),C=j({},v,{component:s,slots:g,slotProps:m}),[w,I]=Se("root",{ref:r,className:ft(y.root,o),elementType:oX,externalForwardedProps:C,ownerState:x,additionalProps:j({color:u,focusable:!1},h&&{role:"img"},!h&&{"aria-hidden":!0},!d&&{viewBox:p},b&&i.props)});return E.jsxs(w,j({},I,{children:[b?i.props.children:i,h?E.jsx("title",{children:h}):null]}))});function Aa(t,e){function r(n,i){return E.jsx(mO,j({"data-testid":`${e}Icon`,ref:i},n,{children:t}))}return r.muiName=mO.muiName,R.memo(R.forwardRef(r))}const aX=Aa(E.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");var gO;const sX=["component","color","children","indicator","variant","slots","slotProps"],lX=t=>{const{disabled:e,expanded:r}=t;return nt({root:["root",e&&"disabled",r&&"expanded"],button:["button",e&&"disabled",r&&"expanded"],indicator:["indicator",e&&"disabled",r&&"expanded"]},tX,{})},cX=xe(Fx,{name:"JoyAccordionSummary",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({fontWeight:t.vars.fontWeight.md,gap:"calc(var(--ListItem-paddingX, 0.75rem) + 0.25rem)",[`&.${zx.expanded}`]:{"--Icon-color":"currentColor"}})),uX=xe(Ll,{name:"JoyAccordionSummary",slot:"Button",overridesResolver:(t,e)=>e.button})({gap:"inherit",fontWeight:"inherit",justifyContent:"space-between",font:"inherit","&:focus-visible":{zIndex:1},[`.${zx.root} &`]:{"--unstable_ListItem-flex":"1 0 0%"}}),dX=xe("span",{name:"JoyAccordionSummary",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})({display:"inline-flex",[`&.${zx.expanded}`]:{transform:"rotate(180deg)"}}),Hx=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAccordionSummary"}),{component:i="div",color:o="neutral",children:a,indicator:s=gO||(gO=E.jsx(aX,{})),variant:c="plain",slots:u={},slotProps:d={}}=n,h=Fe(n,sX),{accordionId:p,disabled:f=!1,expanded:g=!1,toggle:m}=R.useContext($x),v=j({},h,{component:i,slots:u,slotProps:d}),b=j({},n,{component:i,color:o,disabled:f,expanded:g,variant:c}),x=P=>{if(m&&m(P),typeof d.button=="function"){var k,S;(k=d.button(b))==null||(S=k.onClick)==null||S.call(k,P)}else{var M,$;(M=d.button)==null||($=M.onClick)==null||$.call(M,P)}},y=lX(b),[C,w]=Se("root",{ref:r,className:y.root,elementType:cX,externalForwardedProps:v,ownerState:b}),[I,_]=Se("button",{ref:r,className:y.button,elementType:uX,externalForwardedProps:v,additionalProps:{component:"button",id:`${p}-summary`,"aria-expanded":g?"true":"false","aria-controls":`${p}-details`,disabled:f,type:"button",onClick:x},ownerState:b}),[T,O]=Se("indicator",{ref:r,className:y.indicator,elementType:dX,externalForwardedProps:v,ownerState:b});return E.jsx(C,j({},w,{children:E.jsxs(I,j({},_,{children:[a,s&&E.jsx(T,j({},O,{children:s}))]}))}))}),Vx=t=>e=>`--${t?`${t}-`:""}${e.replace(/^--/,"")}`,Fl="data-skip-inverted-colors",vO=`& :not([${Fl}], [${Fl}] *)`,yO=t=>{var e,r,n,i,o,a,s,c,u,d,h,p,f,g,m,v,b,x,y,C,w,I;const _=Vx(t.cssVarPrefix);return{"--variant-plainColor":"var(--variant-plainColor) !important","--variant-plainHoverColor":"var(--variant-plainHoverColor) !important","--variant-plainHoverBg":"var(--variant-plainHoverBg) !important","--variant-plainActiveBg":"var(--variant-plainActiveBg) !important","--variant-plainDisabledColor":"var(--variant-plainDisabledColor) !important","--variant-outlinedColor":"var(--variant-outlinedColor) !important","--variant-outlinedBorder":"var(--variant-outlinedBorder) !important","--variant-outlinedHoverColor":"var(--variant-outlinedHoverColor) !important","--variant-outlinedHoverBorder":"var(--variant-outlinedHoverBorder) !important","--variant-outlinedHoverBg":"var(--variant-outlinedHoverBg) !important","--variant-outlinedActiveBg":"var(--variant-outlinedActiveBg) !important","--variant-outlinedDisabledColor":"var(--variant-outlinedDisabledColor) !important","--variant-outlinedDisabledBorder":"var(--variant-outlinedDisabledBorder) !important","--variant-softColor":"var(--variant-softColor) !important","--variant-softHoverColor":"var(--variant-softHoverColor) !important","--variant-softBg":"var(--variant-softBg) !important","--variant-softHoverBg":"var(--variant-softHoverBg) !important","--variant-softActiveBg":"var(--variant-softActiveBg) !important","--variant-softActiveColor":"var(--variant-softActiveColor) !important","--variant-softDisabledColor":"var(--variant-softDisabledColor) !important","--variant-softDisabledBg":"var(--variant-softDisabledBg) !important","--variant-solidColor":"var(--variant-solidColor) !important","--variant-solidBg":"var(--variant-solidBg) !important","--variant-solidHoverBg":"var(--variant-solidHoverBg) !important","--variant-solidActiveBg":"var(--variant-solidActiveBg) !important","--variant-solidDisabledColor":"var(--variant-solidDisabledColor) !important","--variant-solidDisabledBg":"var(--variant-solidDisabledBg) !important","--Badge-ringColor":"var(--Badge-ringColor) !important",colorScheme:"unset",[t.getColorSchemeSelector("light")]:{[_("--palette-focusVisible")]:`${(e=t.colorSchemes.light)==null?void 0:e.palette.focusVisible} !important`,[_("--palette-background-body")]:`${(r=t.colorSchemes.light)==null?void 0:r.palette.background.body} !important`,[_("--palette-background-surface")]:`${(n=t.colorSchemes.light)==null?void 0:n.palette.background.surface} !important`,[_("--palette-background-popup")]:`${(i=t.colorSchemes.light)==null?void 0:i.palette.background.popup} !important`,[_("--palette-background-level1")]:`${(o=t.colorSchemes.light)==null?void 0:o.palette.background.level1} !important`,[_("--palette-background-level2")]:`${(a=t.colorSchemes.light)==null?void 0:a.palette.background.level2} !important`,[_("--palette-background-level3")]:`${(s=t.colorSchemes.light)==null?void 0:s.palette.background.level3} !important`,[_("--palette-text-primary")]:`${(c=t.colorSchemes.light)==null?void 0:c.palette.text.primary} !important`,[_("--palette-text-secondary")]:`${(u=t.colorSchemes.light)==null?void 0:u.palette.text.secondary} !important`,[_("--palette-text-tertiary")]:`${(d=t.colorSchemes.light)==null?void 0:d.palette.text.tertiary} !important`,[_("--palette-divider")]:`${(h=t.colorSchemes.light)==null?void 0:h.palette.divider} !important`},[t.getColorSchemeSelector("dark")]:{[_("--palette-focusVisible")]:`${(p=t.colorSchemes.dark)==null?void 0:p.palette.focusVisible} !important`,[_("--palette-background-body")]:`${(f=t.colorSchemes.dark)==null?void 0:f.palette.background.body} !important`,[_("--palette-background-surface")]:`${(g=t.colorSchemes.dark)==null?void 0:g.palette.background.surface} !important`,[_("--palette-background-popup")]:`${(m=t.colorSchemes.dark)==null?void 0:m.palette.background.popup} !important`,[_("--palette-background-level1")]:`${(v=t.colorSchemes.dark)==null?void 0:v.palette.background.level1} !important`,[_("--palette-background-level2")]:`${(b=t.colorSchemes.dark)==null?void 0:b.palette.background.level2} !important`,[_("--palette-background-level3")]:`${(x=t.colorSchemes.dark)==null?void 0:x.palette.background.level3} !important`,[_("--palette-text-primary")]:`${(y=t.colorSchemes.dark)==null?void 0:y.palette.text.primary} !important`,[_("--palette-text-secondary")]:`${(C=t.colorSchemes.dark)==null?void 0:C.palette.text.secondary} !important`,[_("--palette-text-tertiary")]:`${(w=t.colorSchemes.dark)==null?void 0:w.palette.text.tertiary} !important`,[_("--palette-divider")]:`${(I=t.colorSchemes.dark)==null?void 0:I.palette.divider} !important`}}};function hX(t){return t.theme!==void 0}const Ju=t=>e=>{const r=hX(e)?e.theme:e,n=ax(r.cssVarPrefix),i=Vx(r.cssVarPrefix),o=a=>{const s=a.split("-");return n(a,r.palette[s[1]][s[2]])};return{[vO]:{"--Badge-ringColor":o(`palette-${t}-solidBg`),"--Icon-color":"currentColor",[`${r.getColorSchemeSelector("light")}, ${r.getColorSchemeSelector("dark")}`]:{colorScheme:"dark",[i("--palette-focusVisible")]:o(`palette-${t}-200`),[i("--palette-background-body")]:"rgba(0 0 0 / 0.1)",[i("--palette-background-surface")]:"rgba(0 0 0 / 0.06)",[i("--palette-background-popup")]:o(`palette-${t}-700`),[i("--palette-background-level1")]:`rgba(${o(`palette-${t}-darkChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${t}-darkChannel`)} / 0.36)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${t}-darkChannel`)} / 0.6)`,[i("--palette-text-primary")]:o("palette-common-white"),[i("--palette-text-secondary")]:o(`palette-${t}-200`),[i("--palette-text-tertiary")]:o(`palette-${t}-300`),[i("--palette-text-icon")]:o(`palette-${t}-200`),[i("--palette-divider")]:`rgba(${o(`palette-${t}-lightChannel`)} / 0.32)`,"--variant-plainColor":o(`palette-${t}-50`),"--variant-plainHoverColor":"#fff","--variant-plainHoverBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${t}-lightChannel`)} / 0.72)`,"--variant-outlinedColor":o(`palette-${t}-50`),"--variant-outlinedBorder":`rgba(${o(`palette-${t}-lightChannel`)} / 0.5)`,"--variant-outlinedHoverColor":"#fff","--variant-outlinedHoverBorder":o(`palette-${t}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${t}-lightChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":"rgba(255 255 255 / 0.2)","--variant-softColor":o("palette-common-white"),"--variant-softHoverColor":o("palette-common-white"),"--variant-softBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.24)`,"--variant-softHoverBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.36)`,"--variant-softActiveBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.16)`,"--variant-softActiveColor":"#fff","--variant-softDisabledColor":`rgba(${o(`palette-${t}-lightChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.1)`,"--variant-solidColor":o(`palette-${t}-${t==="neutral"?"600":"500"}`),"--variant-solidBg":o("palette-common-white"),"--variant-solidHoverBg":o("palette-common-white"),"--variant-solidActiveBg":o(`palette-${t}-100`),"--variant-solidDisabledColor":`rgba(${o(`palette-${t}-lightChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.1)`}},[`&, & [${Fl}]`]:yO(r)}},Qu=t=>e=>{const{theme:r=e}=e,n=ax(r.cssVarPrefix),i=Vx(r.cssVarPrefix),o=a=>{const s=a.split("-");return n(a,r.palette[s[1]][s[2]])};return{[vO]:{"--Badge-ringColor":o(`palette-${t}-softBg`),"--Icon-color":"currentColor",[r.getColorSchemeSelector("dark")]:{[i("--palette-focusVisible")]:o(`palette-${t}-300`),[i("--palette-background-body")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.4)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.6)`,[i("--palette-text-primary")]:o(`palette-${t}-100`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${t}-lightChannel`)} / 0.72)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${t}-lightChannel`)} / 0.6)`,[i("--palette-text-icon")]:`rgba(${o(`palette-${t}-lightChannel`)} / 0.6)`,[i("--palette-divider")]:`rgba(${o(`palette-${t}-lightChannel`)} / 0.2)`,"--variant-plainColor":`rgba(${o(`palette-${t}-lightChannel`)} / 1)`,"--variant-plainHoverColor":o(`palette-${t}-50`),"--variant-plainHoverBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.16)`,"--variant-plainActiveBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.72)`,"--variant-outlinedColor":`rgba(${o(`palette-${t}-lightChannel`)} / 1)`,"--variant-outlinedHoverColor":o(`palette-${t}-50`),"--variant-outlinedBg":"initial","--variant-outlinedBorder":`rgba(${o(`palette-${t}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverBorder":o(`palette-${t}-600`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.16)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${t}-mainChannel`)} / 0.2)`,"--variant-softColor":o(`palette-${t}-200`),"--variant-softBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.24)`,"--variant-softHoverColor":"#fff","--variant-softHoverBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.32)`,"--variant-softActiveBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.48)`,"--variant-softDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.12)`,"--variant-solidColor":"#fff","--variant-solidBg":o(`palette-${t}-500`),"--variant-solidHoverColor":"#fff","--variant-solidHoverBg":o(`palette-${t}-600`),"--variant-solidActiveBg":o(`palette-${t}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.12)`},[r.getColorSchemeSelector("light")]:{[i("--palette-focusVisible")]:o(`palette-${t}-500`),[i("--palette-background-body")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.32)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.48)`,[i("--palette-text-primary")]:o(`palette-${t}-700`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${t}-darkChannel`)} / 0.8)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${t}-darkChannel`)} / 0.68)`,[i("--palette-text-icon")]:o(`palette-${t}-500`),[i("--palette-divider")]:`rgba(${o(`palette-${t}-mainChannel`)} / 0.32)`,"--variant-plainColor":`rgba(${o(`palette-${t}-darkChannel`)} / 0.8)`,"--variant-plainHoverColor":`rgba(${o(`palette-${t}-darkChannel`)} / 1)`,"--variant-plainHoverBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.24)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.6)`,"--variant-outlinedColor":`rgba(${o(`palette-${t}-mainChannel`)} / 1)`,"--variant-outlinedBorder":`rgba(${o(`palette-${t}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverColor":o(`palette-${t}-600`),"--variant-outlinedHoverBorder":o(`palette-${t}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.24)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.6)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${t}-mainChannel`)} / 0.12)`,"--variant-softColor":o(`palette-${t}-600`),"--variant-softBg":`rgba(${o(`palette-${t}-lightChannel`)} / 0.8)`,"--variant-softHoverColor":o(`palette-${t}-700`),"--variant-softHoverBg":o(`palette-${t}-200`),"--variant-softActiveBg":o(`palette-${t}-300`),"--variant-softDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.6)`,"--variant-softDisabledBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.08)`,"--variant-solidColor":o("palette-common-white"),"--variant-solidBg":o(`palette-${t}-${t==="neutral"?"700":"500"}`),"--variant-solidHoverColor":o("palette-common-white"),"--variant-solidHoverBg":o(`palette-${t}-600`),"--variant-solidActiveBg":o(`palette-${t}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${t}-mainChannel`)} / 0.6)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${t}-mainChannel`)} / 0.08)`}},[`&, & [${Fl}]`]:yO(r)}};function pX(t){return et("MuiAlert",t)}tt("MuiAlert",["root","startDecorator","endDecorator","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);const fX=["children","className","color","invertedColors","role","variant","size","startDecorator","endDecorator","component","slots","slotProps"],mX=t=>{const{variant:e,color:r,size:n}=t,i={root:["root",n&&`size${ke(n)}`,r&&`color${ke(r)}`,e&&`variant${ke(e)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(i,pX,{})},gX=xe("div",{name:"JoyAlert",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;const{p:n,padding:i,borderRadius:o}=Mo({theme:t,ownerState:e},["p","padding","borderRadius"]);return[j({"--Alert-radius":t.vars.radius.sm,"--Alert-decoratorChildRadius":"max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))","--Button-minHeight":"var(--Alert-decoratorChildHeight)","--IconButton-size":"var(--Alert-decoratorChildHeight)","--Button-radius":"var(--Alert-decoratorChildRadius)","--IconButton-radius":"var(--Alert-decoratorChildRadius)","--Icon-color":"currentColor"},e.size==="sm"&&{"--Alert-padding":"0.5rem","--Alert-decoratorChildHeight":"1.5rem","--Icon-fontSize":t.vars.fontSize.xl,gap:"0.5rem"},e.size==="md"&&{"--Alert-padding":"0.75rem","--Alert-decoratorChildHeight":"2rem","--Icon-fontSize":t.vars.fontSize.xl,gap:"0.625rem"},e.size==="lg"&&{"--Alert-padding":"1rem","--Alert-decoratorChildHeight":"2.375rem","--Icon-fontSize":t.vars.fontSize.xl2,gap:"0.875rem"},{backgroundColor:t.vars.palette.background.surface,display:"flex",position:"relative",alignItems:"center",padding:"var(--Alert-padding)",borderRadius:"var(--Alert-radius)"},t.typography[`body-${{sm:"xs",md:"sm",lg:"md"}[e.size]}`],{fontWeight:t.vars.fontWeight.md},e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(r=t.variants[e.variant])==null?void 0:r[e.color]),n!==void 0&&{"--Alert-padding":n},i!==void 0&&{"--Alert-padding":i},o!==void 0&&{"--Alert-radius":o}]}),vX=xe("span",{name:"JoyAlert",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({display:"inherit",flex:"none"}),yX=xe("span",{name:"JoyAlert",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({display:"inherit",flex:"none",marginLeft:"auto"}),Wx=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAlert"}),{children:i,className:o,color:a="neutral",invertedColors:s=!1,role:c="alert",variant:u="soft",size:d="md",startDecorator:h,endDecorator:p,component:f,slots:g={},slotProps:m={}}=n,v=Fe(n,fX),b=j({},n,{color:a,invertedColors:s,variant:u,size:d}),x=mX(b),y=j({},v,{component:f,slots:g,slotProps:m}),[C,w]=Se("root",{ref:r,className:ft(x.root,o),elementType:gX,externalForwardedProps:y,ownerState:b,additionalProps:{role:c}}),[I,_]=Se("startDecorator",{className:x.startDecorator,elementType:vX,externalForwardedProps:y,ownerState:b}),[T,O]=Se("endDecorator",{className:x.endDecorator,elementType:yX,externalForwardedProps:y,ownerState:b});return E.jsxs(C,j({},w,{children:[h&&E.jsx(I,j({},_,{children:h})),i,p&&E.jsx(T,j({},O,{children:p}))]}))});function bX(t){return et("MuiAspectRatio",t)}tt("MuiAspectRatio",["root","content","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const xX=["children","ratio","minHeight","maxHeight","objectFit","color","variant","component","flex","slots","slotProps"],wX=t=>{const{variant:e,color:r}=t,n={root:["root"],content:["content",e&&`variant${ke(e)}`,r&&`color${ke(r)}`]};return nt(n,bX,{})},CX=xe("div",{name:"JoyAspectRatio",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{const r=typeof t.minHeight=="number"?`${t.minHeight}px`:t.minHeight,n=typeof t.maxHeight=="number"?`${t.maxHeight}px`:t.maxHeight;return{"--AspectRatio-paddingBottom":`clamp(var(--AspectRatio-minHeight), calc(100% / (${t.ratio})), var(--AspectRatio-maxHeight))`,"--AspectRatio-maxHeight":n||"9999px","--AspectRatio-minHeight":r||"0px","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,borderRadius:"var(--AspectRatio-radius)",display:t.flex?"flex":"block",flex:t.flex?1:"initial",flexDirection:"column",margin:"var(--AspectRatio-margin)"}}),IX=xe("div",{name:"JoyAspectRatio",slot:"Content",overridesResolver:(t,e)=>e.content})(({theme:t,ownerState:e})=>{var r;return j({flex:1,position:"relative",borderRadius:"inherit",height:0,paddingBottom:"calc(var(--AspectRatio-paddingBottom) - 2 * var(--variant-borderWidth, 0px))",overflow:"hidden",transition:"inherit","& [data-first-child]":{display:"flex",justifyContent:"center",alignItems:"center",boxSizing:"border-box",position:"absolute",width:"100%",height:"100%",objectFit:e.objectFit,margin:0,padding:0,"& > img":{width:"100%",height:"100%",objectFit:e.objectFit}}},t.typography["body-md"],(r=t.variants[e.variant])==null?void 0:r[e.color])}),$f=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAspectRatio"}),{children:i,ratio:o="16 / 9",minHeight:a,maxHeight:s,objectFit:c="cover",color:u="neutral",variant:d="soft",component:h,flex:p=!1,slots:f={},slotProps:g={}}=n,m=Fe(n,xX),v=j({},n,{flex:p,minHeight:a,maxHeight:s,objectFit:c,ratio:o,color:u,variant:d}),b=wX(v),x=j({},m,{component:h,slots:f,slotProps:g}),[y,C]=Se("root",{ref:r,className:b.root,elementType:CX,externalForwardedProps:x,ownerState:v}),[w,I]=Se("content",{className:b.content,elementType:IX,externalForwardedProps:x,ownerState:v});return E.jsx(y,j({},C,{children:E.jsx(w,j({},I,{children:R.Children.map(i,(_,T)=>T===0&&R.isValidElement(_)?R.cloneElement(_,{"data-first-child":""}):_)}))}))}),bO=Aa(E.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),SX=Aa(E.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),xO=R.createContext(void 0);function Cs(t,e){let r=e,n=t;return t==="outlined"&&(r="neutral",n="plain"),t==="plain"&&(r="neutral"),{variant:n,color:r}}function Lf(t,e,r=!1){const n=R.useContext(xO),[i,o]=typeof n=="string"?n.split(":"):[],a=Cs(i||void 0,o||void 0);return a.variant=t||a.variant,a.color=e||(r?o:a.color),a}function Ff({children:t,color:e,variant:r}){return E.jsx(xO.Provider,{value:`${r||""}:${e||""}`,children:t})}function _X(t){return et("MuiIconButton",t)}const qx=tt("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]),Nf=R.createContext({}),wO=R.createContext(void 0);function TX(t){return et("MuiCircularProgress",t)}tt("MuiCircularProgress",["root","determinate","svg","track","progress","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let kX=t=>t,CO;const AX=["color","backgroundColor"],PX=["children","className","color","size","variant","thickness","determinate","value","component","slots","slotProps"],EX=gs({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(270deg)"}}),OX=t=>{const{determinate:e,color:r,variant:n,size:i}=t,o={root:["root",e&&"determinate",r&&`color${ke(r)}`,n&&`variant${ke(n)}`,i&&`size${ke(i)}`],svg:["svg"],track:["track"],progress:["progress"]};return nt(o,TX,{})};function Nl(t,e){return`var(--CircularProgress-${t}Thickness, var(--CircularProgress-thickness, ${e}))`}const RX=xe("span",{name:"JoyCircularProgress",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{var r,n,i,o;const a=((r=e.variants[t.variant])==null?void 0:r[t.color])||{},{color:s,backgroundColor:c}=a,u=Fe(a,AX);return j({"--Icon-fontSize":"calc(0.4 * var(--_root-size))","--CircularProgress-trackColor":c,"--CircularProgress-progressColor":s,"--CircularProgress-percent":t.value,"--CircularProgress-linecap":"round"},t.size==="sm"&&{"--_root-size":"var(--CircularProgress-size, 24px)","--_track-thickness":Nl("track","3px"),"--_progress-thickness":Nl("progress","3px")},t.instanceSize==="sm"&&{"--CircularProgress-size":"24px"},t.size==="md"&&{"--_track-thickness":Nl("track","6px"),"--_progress-thickness":Nl("progress","6px"),"--_root-size":"var(--CircularProgress-size, 40px)"},t.instanceSize==="md"&&{"--CircularProgress-size":"40px"},t.size==="lg"&&{"--_track-thickness":Nl("track","8px"),"--_progress-thickness":Nl("progress","8px"),"--_root-size":"var(--CircularProgress-size, 64px)"},t.instanceSize==="lg"&&{"--CircularProgress-size":"64px"},t.thickness&&{"--_track-thickness":`${t.thickness}px`,"--_progress-thickness":`${t.thickness}px`},{"--_thickness-diff":"calc(var(--_track-thickness) - var(--_progress-thickness))","--_inner-size":"calc(var(--_root-size) - 2 * var(--variant-borderWidth, 0px))","--_outlined-inset":"max(var(--_track-thickness), var(--_progress-thickness))",width:"var(--_root-size)",height:"var(--_root-size)",borderRadius:"var(--_root-size)",margin:"var(--CircularProgress-margin)",boxSizing:"border-box",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"relative",color:s},t.children&&{fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.md,fontSize:"calc(0.2 * var(--_root-size))"},u,t.variant==="outlined"&&{"&::before":j({content:'""',display:"block",position:"absolute",borderRadius:"inherit",top:"var(--_outlined-inset)",left:"var(--_outlined-inset)",right:"var(--_outlined-inset)",bottom:"var(--_outlined-inset)"},u)},t.variant==="soft"&&{"--CircularProgress-trackColor":e.variants.soft.neutral.backgroundColor,"--CircularProgress-progressColor":(n=e.variants.solid)==null?void 0:n[t.color].backgroundColor},t.variant==="solid"&&{"--CircularProgress-trackColor":(i=e.variants.softHover)==null?void 0:i[t.color].backgroundColor,"--CircularProgress-progressColor":(o=e.variants.solid)==null?void 0:o[t.color].backgroundColor})}),MX=xe("svg",{name:"JoyCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({width:"inherit",height:"inherit",display:"inherit",boxSizing:"inherit",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))"}),DX=xe("circle",{name:"JoyCircularProgress",slot:"track",overridesResolver:(t,e)=>e.track})({cx:"50%",cy:"50%",r:"calc(var(--_inner-size) / 2 - var(--_track-thickness) / 2 + min(0px, var(--_thickness-diff) / 2))",fill:"transparent",strokeWidth:"var(--_track-thickness)",stroke:"var(--CircularProgress-trackColor)"}),$X=xe("circle",{name:"JoyCircularProgress",slot:"progress",overridesResolver:(t,e)=>e.progress})({"--_progress-radius":"calc(var(--_inner-size) / 2 - var(--_progress-thickness) / 2 - max(0px, var(--_thickness-diff) / 2))","--_progress-length":"calc(2 * 3.1415926535 * var(--_progress-radius))",cx:"50%",cy:"50%",r:"var(--_progress-radius)",fill:"transparent",strokeWidth:"var(--_progress-thickness)",stroke:"var(--CircularProgress-progressColor)",strokeLinecap:"var(--CircularProgress-linecap, round)",strokeDasharray:"var(--_progress-length)",strokeDashoffset:"calc(var(--_progress-length) - var(--CircularProgress-percent) * var(--_progress-length) / 100)",transformOrigin:"center",transform:"rotate(-90deg)"},({ownerState:t})=>!t.determinate&&ba(CO||(CO=kX`
|
|
68
68
|
animation: var(--CircularProgress-circulation, 0.8s linear 0s infinite normal none running)
|
|
69
69
|
${0};
|
|
70
|
-
`),EX)),Kn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:s="md",variant:c="soft",thickness:u,determinate:d=!1,value:h=d?0:25,component:p,slots:f={},slotProps:g={}}=n,m=Fe(n,PX),v=j({},n,{color:a,size:s,variant:c,thickness:u,value:h,determinate:d,instanceSize:e.size}),b=OX(v),x=j({},m,{component:p,slots:f,slotProps:g}),[y,C]=Se("root",{ref:r,className:ft(b.root,o),elementType:RX,externalForwardedProps:x,ownerState:v,additionalProps:j({role:"progressbar",style:{"--CircularProgress-percent":h}},h&&d&&{"aria-valuenow":Math.round(typeof h=="number"?h:Number(h||0))})}),[w,I]=Se("svg",{className:b.svg,elementType:MX,externalForwardedProps:x,ownerState:v}),[_,T]=Se("track",{className:b.track,elementType:DX,externalForwardedProps:x,ownerState:v}),[O,P]=Se("progress",{className:b.progress,elementType:$X,externalForwardedProps:x,ownerState:v});return E.jsxs(y,j({},C,{children:[E.jsxs(w,j({},I,{children:[E.jsx(_,j({},T)),E.jsx(O,j({},P))]})),i]}))}),LX=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],FX=t=>{const{color:e,disabled:r,focusVisible:n,focusVisibleClassName:i,size:o,variant:a,loading:s}=t,c={root:["root",r&&"disabled",n&&"focusVisible",a&&`variant${ke(a)}`,e&&`color${ke(e)}`,o&&`size${ke(o)}`,s&&"loading"],loadingIndicator:["loadingIndicator"]},u=nt(c,_X,{});return n&&i&&(u.root+=` ${i}`),u},Xu=xe("button")(({theme:t,ownerState:e})=>{var r,n,i,o;return[j({"--Icon-margin":"initial","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon},e.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[e.instanceSize]},e.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:t.vars.fontSize.sm,paddingInline:"2px"},e.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:t.vars.fontSize.md,paddingInline:"0.25rem"},e.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:t.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${t.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[t.focus.selector]:j({"--Icon-color":"currentColor"},t.focus.default)}),j({},(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:hover":{"@media (hover: hover)":j({"--Icon-color":"currentColor"},(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color])},'&:active, &[aria-pressed="true"]':j({"--Icon-color":"currentColor"},(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color]),"&:disabled":(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]})]}),NX=xe(Xu,{name:"JoyIconButton",slot:"Root",overridesResolver:(t,e)=>e.root})({}),jX=xe("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>e.loadingIndicator})(({theme:t,ownerState:e})=>{var r,n;return j({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color},e.disabled&&{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color})}),ur=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyIconButton"}),{children:o,action:a,component:s="button",color:c="neutral",disabled:u,variant:d="plain",loading:h=!1,loadingIndicator:p,size:f="md",slots:g={},slotProps:m={}}=i,v=Fe(i,LX),b=R.useContext(Nf),x=R.useContext(wO),y=e.variant||b.variant||d,C=e.size||b.size||f,w=e.color||b.color||c,I=(n=e.loading||e.disabled)!=null?n:b.disabled||h||u,_=R.useRef(null),T=Rn(_,r),{focusVisible:O,setFocusVisible:P,getRootProps:k}=ao(j({},i,{disabled:I,rootRef:T})),S=p!=null?p:E.jsx(Kn,{color:w,thickness:{sm:2,md:3,lg:4}[C]||3});R.useImperativeHandle(a,()=>({focusVisible:()=>{var B;P(!0),(B=_.current)==null||B.focus()}}),[P]);const M=j({},i,{component:s,color:w,disabled:I,variant:y,loading:h,size:C,focusVisible:O,instanceSize:e.size}),$=FX(M),D=B=>{var H;let G=i.onClick;if(typeof m.root=="function"?G=m.root(M).onClick:m.root&&(G=m.root.onClick),(H=G)==null||H(B),x){var Z;(Z=x.onClick)==null||Z.call(x,B,i.value)}};let N=i["aria-pressed"];typeof m.root=="function"?N=m.root(M)["aria-pressed"]:m.root&&(N=m.root["aria-pressed"]),x!=null&&x.value&&(Array.isArray(x.value)?N=x.value.indexOf(i.value)!==-1:N=x.value===i.value);const z=j({},v,{component:s,slots:g,slotProps:m}),[U,V]=Se("root",{ref:r,className:$.root,elementType:NX,getSlotProps:k,externalForwardedProps:z,ownerState:M,additionalProps:{onClick:D,"aria-pressed":N}}),[q,F]=Se("loadingIndicator",{className:$.loadingIndicator,elementType:jX,externalForwardedProps:z,ownerState:M});return E.jsx(U,j({},V,{children:h?E.jsx(q,j({},F,{children:S})):o}))});ur.muiName="IconButton";function BX(t){return et("MuiChip",t)}const Gx=tt("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),IO=R.createContext({disabled:void 0,variant:void 0,color:void 0}),zX=["children","className","color","onClick","disabled","size","variant","startDecorator","endDecorator","component","slots","slotProps"],UX=t=>{const{disabled:e,size:r,color:n,clickable:i,variant:o,focusVisible:a}=t,s={root:["root",e&&"disabled",n&&`color${ke(n)}`,r&&`size${ke(r)}`,o&&`variant${ke(o)}`,i&&"clickable"],action:["action",e&&"disabled",a&&"focusVisible"],label:["label",r&&`label${ke(r)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(s,BX,{})},HX=xe("div",{name:"JoyChip",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i;const o=(r=t.variants[e.variant])==null?void 0:r[e.color],{borderRadius:a}=Mo({theme:t,ownerState:e},["borderRadius"]);return[j({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--Icon-color":"currentColor","--unstable_actionRadius":"var(--_Chip-radius)"},e.size==="sm"&&{"--Chip-paddingInline":"0.375rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.sm,"--_Chip-minHeight":"var(--Chip-minHeight, 1.25rem)",gap:"3px"},e.size==="md"&&{"--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 0.25rem - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.md,"--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",gap:"0.25rem"},e.size==="lg"&&{"--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 0.375rem - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.lg,"--_Chip-minHeight":"var(--Chip-minHeight, 1.75rem)",gap:"0.375rem"},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",maxWidth:"max-content",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box"},t.typography[`body-${{sm:"xs",md:"sm",lg:"md"}[e.size]}`],{fontWeight:t.vars.fontWeight.md,[`&.${Gx.disabled}`]:{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color}}),...e.clickable?[{"--variant-borderWidth":"0px",color:o==null?void 0:o.color}]:[j({backgroundColor:t.vars.palette.background.surface},o,{[`&.${Gx.disabled}`]:(i=t.variants[`${e.variant}Disabled`])==null?void 0:i[e.color]})],a!==void 0&&{"--_Chip-radius":a}]}),VX=xe("span",{name:"JoyChip",slot:"Label",overridesResolver:(t,e)=>e.label})(({ownerState:t})=>j({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},t.clickable&&{zIndex:1,pointerEvents:"none"})),WX=xe("button",{name:"JoyChip",slot:"Action",overridesResolver:(t,e)=>e.action})(({theme:t,ownerState:e})=>{var r,n,i,o;return[{"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,width:"100%",border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[t.focus.selector]:t.focus.default},j({backgroundColor:t.vars.palette.background.surface},(r=t.variants[e.variant])==null?void 0:r[e.color]),{"&:hover":{"@media (hover: hover)":(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color]}},{"&:active":(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color]},{[`&.${Gx.disabled}`]:(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]}]}),qX=xe("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--IconButton-margin":"0 calc(-1 * var(--Chip-paddingInline) / 3) 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",order:0,zIndex:1,pointerEvents:"none"}),GX=xe("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--IconButton-margin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 calc(-1 * var(--Chip-paddingInline) / 3)","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",order:2,zIndex:1,pointerEvents:"none"}),dn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyChip"}),{children:i,className:o,color:a="neutral",onClick:s,disabled:c=!1,size:u="md",variant:d="soft",startDecorator:h,endDecorator:p,component:f,slots:g={},slotProps:m={}}=n,v=Fe(n,zX),b=!!s||!!m.action,x=j({},n,{disabled:c,size:u,color:a,variant:d,clickable:b,focusVisible:!1}),y=typeof m.action=="function"?m.action(x):m.action,C=R.useRef(null),{focusVisible:w,getRootProps:I}=ao(j({},y,{disabled:c,rootRef:C}));x.focusVisible=w;const _=UX(x),T=j({},v,{component:f,slots:g,slotProps:m}),[O,P]=Se("root",{ref:r,className:ft(_.root,o),elementType:HX,externalForwardedProps:T,ownerState:x}),[k,S]=Se("label",{className:_.label,elementType:VX,externalForwardedProps:T,ownerState:x}),M=Ia(S.id),[$,D]=Se("action",{className:_.action,elementType:WX,externalForwardedProps:T,ownerState:x,getSlotProps:I,additionalProps:{"aria-labelledby":M,as:y==null?void 0:y.component,onClick:s}}),[N,z]=Se("startDecorator",{className:_.startDecorator,elementType:qX,externalForwardedProps:T,ownerState:x}),[U,V]=Se("endDecorator",{className:_.endDecorator,elementType:GX,externalForwardedProps:T,ownerState:x}),q=R.useMemo(()=>({disabled:c}),[c]);return E.jsx(IO.Provider,{value:q,children:E.jsx(Ff,{variant:d,color:a,children:E.jsxs(O,j({},P,{children:[b&&E.jsx($,j({},D)),E.jsx(k,j({},S,{id:M,children:i})),h&&E.jsx(N,j({},z,{children:h})),p&&E.jsx(U,j({},V,{children:p}))]}))})})}),YX=Aa(E.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Cancel");function KX(t){return et("MuiChipDelete",t)}tt("MuiChipDelete",["root","disabled","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSolid","variantSoft","variantOutlined"]);var SO;const JX=["children","variant","color","disabled","onKeyDown","onDelete","onClick","component","slots","slotProps"],QX=["onDelete"],XX=t=>{const{focusVisible:e,variant:r,color:n,disabled:i}=t,o={root:["root",i&&"disabled",e&&"focusVisible",r&&`variant${ke(r)}`,n&&`color${ke(n)}`]};return nt(o,KX,{})},ZX=xe(Xu,{name:"JoyChipDelete",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({"--IconButton-size":"var(--Chip-deleteSize, 2rem)","--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.3)",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:t.vars.fontSize.sm,paddingInline:"2px",pointerEvents:"visible",borderRadius:"var(--Chip-deleteRadius, 50%)",zIndex:1,padding:0})),Pa=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyChipDelete"}),{children:i,variant:o="plain",color:a="neutral",disabled:s,onKeyDown:c,onDelete:u,onClick:d,component:h,slots:p={},slotProps:f={}}=n,g=Fe(n,JX),m=R.useContext(IO),{variant:v=o,color:b=a}=Lf(e.variant,e.color,!0),x=e.color||b,y=s!=null?s:m.disabled,C=R.useRef(null),w=Rn(C,r),{focusVisible:I,getRootProps:_}=ao(j({},n,{disabled:y,rootRef:w})),T=j({},n,{disabled:y,variant:v,color:x,focusVisible:I}),O=XX(T),P=j({},g,{component:h,slots:p,slotProps:f}),k=N=>{!y&&u&&u(N),d&&d(N)},S=N=>{["Backspace","Enter","Delete"].includes(N.key)&&(N.preventDefault(),!y&&u&&u(N)),c&&c(N)},[M,$]=Se("root",{ref:r,elementType:ZX,getSlotProps:_,externalForwardedProps:P,ownerState:T,additionalProps:{as:h,onKeyDown:S,onClick:k},className:O.root}),D=Fe($,QX);return E.jsx(M,j({},D,{children:i!=null?i:SO||(SO=E.jsx(YX,{}))}))});function eZ(t){return et("MuiInput",t)}const _O=tt("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),Ea=R.createContext(void 0),tZ=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function TO(t,e){var r;const n=R.useContext(Ea),{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:s,autoFocus:c,className:u,defaultValue:d,disabled:h,disabledInProp:p,error:f,id:g,name:m,onClick:v,onChange:b,onKeyDown:x,onKeyUp:y,onFocus:C,onBlur:w,placeholder:I,readOnly:_,required:T,type:O,value:P}=t,k=Fe(t,tZ),{getRootProps:S,getInputProps:M,focused:$,error:D,disabled:N}=YY({disabled:(r=p!=null?p:n==null?void 0:n.disabled)!=null?r:h,defaultValue:d,error:f,onBlur:w,onClick:v,onChange:b,onFocus:C,required:T!=null?T:n==null?void 0:n.required,value:P}),z={[e.disabled]:N,[e.error]:D,[e.focused]:$,[e.formControl]:!!n,[u]:u},U={[e.disabled]:N};return j({formControl:n,propsToForward:{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:s,autoFocus:c,disabled:N,id:g,onKeyDown:x,onKeyUp:y,name:m,placeholder:I,readOnly:_,type:O},rootStateClasses:z,inputStateClasses:U,getRootProps:S,getInputProps:M,focused:$,error:D,disabled:N},k)}const rZ=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],nZ=t=>{const{disabled:e,fullWidth:r,variant:n,color:i,size:o}=t,a={root:["root",e&&"disabled",r&&"fullWidth",n&&`variant${ke(n)}`,i&&`color${ke(i)}`,o&&`size${ke(o)}`],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(a,eZ,{})},kO=xe("div")(({theme:t,ownerState:e})=>{var r,n,i,o,a,s;const c=(r=t.variants[`${e.variant}`])==null?void 0:r[e.color];return[j({"--Input-radius":t.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":t.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":t.vars.focus.thickness,"--Input-focusedHighlight":(n=t.vars.palette[e.color==="neutral"?"primary":e.color])==null?void 0:n[500],[`&:not([${Fl}])`]:j({},e.instanceColor&&{"--_Input-focusedHighlight":(i=t.vars.palette[e.instanceColor==="neutral"?"primary":e.instanceColor])==null?void 0:i[500]},{"--Input-focusedHighlight":`var(--_Input-focusedHighlight, ${t.vars.palette.focusVisible})`})},e.size==="sm"&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},e.size==="md"&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},e.size==="lg"&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},e.variant!=="plain"&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},e.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},t.typography[`body-${e.size}`],c,{backgroundColor:(o=c==null?void 0:c.backgroundColor)!=null?o:t.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":j({},(a=t.variants[`${e.variant}Hover`])==null?void 0:a[e.color],{backgroundColor:null}),[`&.${_O.disabled}`]:(s=t.variants[`${e.variant}Disabled`])==null?void 0:s[e.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),AO=xe("input")(({ownerState:t})=>({border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":j({paddingInline:"var(--Input-paddingInline)"},!t.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!t.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}})),PO=xe("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),EO=xe("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),iZ=xe(kO,{name:"JoyInput",slot:"Root",overridesResolver:(t,e)=>e.root})({}),oZ=xe(AO,{name:"JoyInput",slot:"Input",overridesResolver:(t,e)=>e.input})({}),aZ=xe(PO,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({}),sZ=xe(EO,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({}),Do=R.forwardRef(function(e,r){var n,i,o,a,s,c;const u=Ze({props:e,name:"JoyInput"}),d=TO(j({},u,{disabledInProp:e.disabled}),_O),{propsToForward:h,rootStateClasses:p,inputStateClasses:f,getRootProps:g,getInputProps:m,formControl:v,focused:b,error:x=!1,disabled:y,fullWidth:C=!1,size:w="md",color:I="neutral",variant:_="outlined",startDecorator:T,endDecorator:O,component:P,slots:k={},slotProps:S={}}=d,M=Fe(d,rZ),$=(n=(i=e.error)!=null?i:v==null?void 0:v.error)!=null?n:x,D=(o=(a=e.size)!=null?a:v==null?void 0:v.size)!=null?o:w,N=(s=e.color)!=null?s:$?"danger":(c=v==null?void 0:v.color)!=null?c:I,z=j({instanceColor:$?"danger":e.color},u,{fullWidth:C,color:N,disabled:y,error:$,focused:b,size:D,variant:_}),U=nZ(z),V=j({},M,{component:P,slots:k,slotProps:S}),[q,F]=Se("root",{ref:r,className:[U.root,p],elementType:iZ,getSlotProps:g,externalForwardedProps:V,ownerState:z}),[B,H]=Se("input",j({},v&&{additionalProps:{id:v.htmlFor,"aria-describedby":v["aria-describedby"]}},{className:[U.input,f],elementType:oZ,getSlotProps:m,internalForwardedProps:h,externalForwardedProps:V,ownerState:z})),[G,Z]=Se("startDecorator",{className:U.startDecorator,elementType:aZ,externalForwardedProps:V,ownerState:z}),[Y,Q]=Se("endDecorator",{className:U.endDecorator,elementType:sZ,externalForwardedProps:V,ownerState:z});return E.jsxs(q,j({},F,{children:[T&&E.jsx(G,j({},Z,{children:T})),E.jsx(B,j({},H)),O&&E.jsx(Y,j({},Q,{children:O}))]}))});function lZ(t){return et("MuiListSubheader",t)}tt("MuiListSubheader",["root","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const cZ=["component","className","children","id","sticky","variant","color","slots","slotProps"],uZ=t=>{const{variant:e,color:r,sticky:n}=t,i={root:["root",n&&"sticky",r&&`color${ke(r)}`,e&&`variant${ke(e)}`]};return nt(i,lZ,{})},dZ=xe("div",{name:"JoyListSubheader",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;return j({boxSizing:"border-box",display:"flex",alignItems:"center",marginInline:"var(--ListItem-marginInline)",paddingBlock:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",minBlockSize:"var(--ListItem-minHeight)"},t.typography["body-xs"],{fontSize:"max(0.75em, 0.625rem)",textTransform:"uppercase",letterSpacing:"0.1em"},e.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:"var(--ListItem-stickyBackground)"},{color:e.color?`var(--_Link-color, rgba(${(r=t.vars.palette[e.color])==null?void 0:r.mainChannel} / 1))`:t.vars.palette.text.tertiary},e.instanceColor&&{[`&:not([${Fl}])`]:{"--_Link-color":t.vars.palette.text.secondary}},(n=t.variants[e.variant])==null?void 0:n[e.color])}),hZ=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListSubheader"}),{component:i,className:o,children:a,id:s,sticky:c=!1,variant:u,color:d,slots:h={},slotProps:p={}}=n,f=Fe(n,cZ),g=Ia(s),m=R.useContext(pO);R.useEffect(()=>{m&&m(g||"")},[m,g]);const v=j({instanceColor:e.color},n,{id:g,sticky:c,variant:u,color:u?d!=null?d:"neutral":d}),b=uZ(v),x=j({},f,{component:i,slots:h,slotProps:p}),[y,C]=Se("root",{ref:r,className:ft(b.root,o),elementType:dZ,externalForwardedProps:x,ownerState:v,additionalProps:{as:i,id:g}});return E.jsx(y,j({},C,{children:a}))});function pZ(t){return et("MuiAutocomplete",t)}const Oa=tt("MuiAutocomplete",["root","wrapper","input","startDecorator","endDecorator","formControl","focused","disabled","error","multiple","limitTag","hasPopupIcon","hasClearIcon","clearIndicator","popupIndicator","popupIndicatorOpen","listbox","option","loading","noOptions","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]),OO=xe($l)(({theme:t,ownerState:e})=>{var r;const n=(r=t.variants[e.variant])==null?void 0:r[e.color];return j({"--focus-outline-offset":`calc(${t.vars.focus.thickness} * -1)`,"--ListItem-stickyBackground":(n==null?void 0:n.backgroundColor)||(n==null?void 0:n.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Rf,{boxShadow:t.shadow.md,borderRadius:`var(--List-radius, ${t.vars.radius.sm})`},!(n!=null&&n.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup},{zIndex:t.vars.zIndex.popup,overflow:"auto",maxHeight:"40vh",position:"relative","&:empty":{visibility:"hidden"},[`& .${Pf.nested}, & .${Pf.nested} .${GQ.root}`]:{position:"initial"}})});xe(OO,{name:"JoyAutocompleteListbox",slot:"Root",overridesResolver:(t,e)=>e.root})({});function fZ(t){return et("MuiAutocompleteOption",t)}tt("MuiAutocompleteOption",["root","focused","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const mZ=["children","component","color","variant","className","slots","slotProps"],gZ=t=>{const{color:e,variant:r}=t,n={root:["root",e&&`color${ke(e)}`,r&&`variant${ke(r)}`]};return nt(n,fZ,{})},RO=xe(Ll)(({theme:t,ownerState:e})=>{var r,n;return{'&[aria-disabled="true"]':(r=t.variants[`${e.variant}Disabled`])==null?void 0:r[e.color],'&[aria-selected="true"]':j({},(n=t.variants[`${e.variant}Active`])==null?void 0:n[e.color],{fontWeight:t.vars.fontWeight.md})}}),vZ=xe(RO,{name:"JoyAutocompleteOption",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Is=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAutocompleteOption"}),{children:i,component:o="li",color:a="neutral",variant:s="plain",className:c,slots:u={},slotProps:d={}}=n,h=Fe(n,mZ),{variant:p=s,color:f=a}=Lf(e.variant,e.color),g=j({},n,{component:o,color:f,variant:p}),m=gZ(g),v=j({},h,{component:o,slots:u,slotProps:d}),[b,x]=Se("root",{ref:r,className:ft(m.root,c),elementType:vZ,externalForwardedProps:v,ownerState:g,additionalProps:{as:o,role:"option"}});return E.jsx(b,j({},x,{children:i}))});var MO,DO;const yZ=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoHighlight","autoSelect","autoFocus","blurOnSelect","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","defaultValue","disableCloseOnSelect","disabledItemsFocusable","disableListWrap","disableClearable","disabled","endDecorator","error","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","handleHomeEndKeys","includeInputInList","isOptionEqualToValue","groupBy","id","inputValue","limitTags","loading","loadingText","multiple","name","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","placeholder","popupIcon","readOnly","renderGroup","renderOption","renderTags","required","type","startDecorator","size","color","variant","value","component","selectOnFocus","slots","slotProps"],bZ=["onDelete"],xZ=["key"],wZ=["onBlur","onFocus","onMouseDown"],CZ=["key"],IZ=t=>t.current!==null&&t.current.contains(document.activeElement),SZ=t=>{var e;return(e=t.label)!=null?e:t},_Z=t=>`+${t}`,TZ=t=>E.jsxs(ka,{nested:!0,children:[E.jsx(hZ,{sticky:!0,children:t.group}),E.jsx(Mf,{children:t.children})]},t.key),kZ=t=>{const{disabled:e,focused:r,hasClearIcon:n,hasPopupIcon:i,popupOpen:o,variant:a,color:s,size:c,multiple:u}=t,d={root:["root",r&&"focused",n&&"hasClearIcon",i&&"hasPopupIcon",a&&`variant${ke(a)}`,s&&`color${ke(s)}`,c&&`size${ke(c)}`],wrapper:["wrapper",u&&"multiple"],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",o&&"popupIndicatorOpen",e&&"disabled"],listbox:["listbox"],option:["option"],loading:["loading"],noOptions:["noOptions"],limitTag:["limitTag"]};return nt(d,pZ,{})},AZ=xe(kO,{name:"JoyAutocomplete",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({},t.size==="sm"&&{"--Autocomplete-wrapperGap":"3px"},t.size==="md"&&{"--Autocomplete-wrapperGap":"3px"},t.size==="lg"&&{"--Autocomplete-wrapperGap":"4px"},{"@media (pointer: fine)":{[`&:hover .${Oa.clearIndicator}`]:{visibility:"visible"}}},t.multiple&&!t.startDecorator&&{paddingInlineStart:0})),PZ=xe("div",{name:"JoyAutocomplete",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>({flex:1,minWidth:0,display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--Autocomplete-wrapperGap)",[`&.${Oa.multiple}`]:j({paddingBlock:"var(--Autocomplete-wrapperGap)"},!t.startDecorator&&{paddingInlineStart:"var(--Autocomplete-wrapperGap)"},!t.endDecorator&&{paddingInlineEnd:"var(--Autocomplete-wrapperGap)"})})),EZ=xe(AO,{name:"JoyAutocomplete",slot:"Input",overridesResolver:(t,e)=>e.input})(({ownerState:t})=>j({minWidth:30,minHeight:"var(--Chip-minHeight)"},t.multiple&&{marginInlineStart:"calc(var(--Autocomplete-wrapperGap) * 2.5)"})),OZ=xe(PO,{name:"JoyAutocomplete",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({}),RZ=xe(EO,{name:"JoyAutocomplete",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})(({ownerState:t})=>j({},(t.hasClearIcon||t.hasPopupIcon)&&{"--Button-margin":"0px","--IconButton-margin":"0px","--Icon-margin":"0px"})),MZ=xe(Xu,{name:"JoyAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})(({ownerState:t})=>j({alignSelf:"center"},!t.hasPopupIcon&&{marginInlineEnd:"calc(var(--Input-decoratorChildOffset) * -1)"},{marginInlineStart:"calc(var(--_Input-paddingBlock) / 2)",visibility:t.focused?"visible":"hidden"})),DZ=xe(Xu,{name:"JoyAutocomplete",slot:"PopupIndicator",overridesResolver:(t,e)=>e.popupIndicator})({alignSelf:"center",marginInlineStart:"calc(var(--_Input-paddingBlock) / 2)",marginInlineEnd:"calc(var(--Input-decoratorChildOffset) * -1)",[`&.${Oa.popupIndicatorOpen}`]:{transform:"rotate(180deg)","--Icon-color":"currentColor"}}),$Z=xe(OO,{name:"JoyAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({zIndex:`var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`})),LZ=xe(RO,{name:"JoyAutocomplete",slot:"Option",overridesResolver:(t,e)=>e.option})({}),FZ=xe(ka,{name:"JoyAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary})),NZ=xe(ka,{name:"JoyAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary})),jZ=xe("div",{name:"JoyAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})({marginInlineStart:"calc(var(--Input-paddingInline) / 2)",marginBlockStart:"var(--_Input-paddingBlock)"}),Ss=R.forwardRef(function(e,r){var n,i,o,a,s,c,u;const d=Ze({props:e,name:"JoyAutocomplete"}),{"aria-describedby":h,"aria-label":p,"aria-labelledby":f,autoFocus:g,clearIcon:m=MO||(MO=E.jsx(bO,{fontSize:"md"})),clearText:v="Clear",closeText:b="Close",disableClearable:x=!1,disabled:y,endDecorator:C,error:w=!1,forcePopupIcon:I="auto",freeSolo:_=!1,getLimitTagsText:T=_Z,getOptionLabel:O=SZ,groupBy:P,id:k,limitTags:S=-1,loading:M=!1,loadingText:$="Loading…",multiple:D=!1,name:N,noOptionsText:z="No options",openText:U="Open",placeholder:V,popupIcon:q=DO||(DO=E.jsx(SX,{})),readOnly:F=!1,renderGroup:B=TZ,renderOption:H,renderTags:G,required:Z,type:Y,startDecorator:Q,size:K="md",color:X="neutral",variant:ee="outlined",component:ae,slots:oe={},slotProps:Ce={}}=d,be=Fe(d,yZ),ge=R.useContext(Ea),ve=(n=(i=e.error)!=null?i:ge==null?void 0:ge.error)!=null?n:w,fe=(o=(a=e.size)!=null?a:ge==null?void 0:ge.size)!=null?o:K,ne=(s=e.color)!=null?s:ve?"danger":(c=ge==null?void 0:ge.color)!=null?c:X,le=(u=y!=null?y:ge==null?void 0:ge.disabled)!=null?u:!1,{getRootProps:he,getInputProps:ye,getPopupIndicatorProps:pe,getClearProps:Le,getTagProps:He,getListboxProps:Ve,getOptionProps:pt,value:ot,dirty:we,popupOpen:Ee,focused:Ae,focusedTag:We,anchorEl:Me,setAnchorEl:$e,inputValue:Je,groupedOptions:Ge}=_Q(j({},d,{id:k!=null?k:ge==null?void 0:ge.htmlFor,componentName:"Autocomplete",unstable_classNamePrefix:"Mui",unstable_isActiveElementInListbox:IZ})),{onMouseDown:Nt}=ye(),{onClick:It}=he(),Br=!x&&!le&&we&&!F,hr=(!_||I===!0)&&I!==!1,Ht=j({instanceColor:e.color},d,{value:ot,disabled:le,focused:Ae,getOptionLabel:O,hasOptions:!!Ge.length,hasClearIcon:Br,hasPopupIcon:hr,inputFocused:We===-1,popupOpen:Ee,size:fe,color:ne,variant:ee}),Ot=kZ(Ht),Tt=j({},be,{component:ae,slots:oe,slotProps:Ce});let Mt;if(D&&ot.length>0){const mt=Mi=>{const sn=He(Mi),{onDelete:Zi}=sn,cs=Fe(sn,bZ);return j({disabled:le,size:fe,onClick:Zi},cs)};G?Mt=G(ot,mt,Ht):Mt=ot.map((Mi,sn)=>{const Zi=mt({index:sn}),{key:cs}=Zi,u_=Fe(Zi,xZ);return E.jsx(dn,{size:fe,variant:"soft",color:"neutral",endDecorator:E.jsx(Pa,j({},u_),cs),sx:{minWidth:0},children:O(Mi)},sn)})}const te=Rn(r,$e),ie={[Oa.disabled]:le,[Oa.error]:ve,[Oa.focused]:Ae,[Oa.formControl]:!!ge},[ue,de]=Se("root",{ref:te,className:[Ot.root,ie],elementType:AZ,externalForwardedProps:Tt,ownerState:Ht,getSlotProps:he,additionalProps:{onClick:mt=>{It&&It(mt),mt.currentTarget===mt.target&&Nt&&Nt(mt)}}}),[De,Ue]=Se("wrapper",{className:Ot.wrapper,elementType:PZ,externalForwardedProps:Tt,ownerState:Ht}),Qe={[Oa.disabled]:le},[qe,at]=Se("input",{className:[Ot.input,Qe],elementType:EZ,getSlotProps:mt=>{const Mi=ye(),{onBlur:sn,onFocus:Zi,onMouseDown:cs}=Mi,u_=Fe(Mi,wZ);return j({},u_,{onBlur:us=>{var ds;sn==null||sn(us),(ds=mt.onBlur)==null||ds.call(mt,us)},onFocus:us=>{var ds;Zi==null||Zi(us),(ds=mt.onFocus)==null||ds.call(mt,us)},onMouseDown:us=>{var ds;cs==null||cs(us),(ds=mt.onMouseDown)==null||ds.call(mt,us)}})},externalForwardedProps:Tt,ownerState:Ht,additionalProps:{autoFocus:g,placeholder:V,name:N,readOnly:F,disabled:le,required:Z!=null?Z:ge==null?void 0:ge.required,type:Y,"aria-invalid":ve||void 0,"aria-label":p,"aria-labelledby":f,"aria-describedby":h!=null?h:ge==null?void 0:ge["aria-describedby"]}}),[Ye,Xe]=Se("startDecorator",{className:Ot.startDecorator,elementType:OZ,externalForwardedProps:Tt,ownerState:Ht}),[wt,Yr]=Se("endDecorator",{className:Ot.endDecorator,elementType:RZ,externalForwardedProps:Tt,ownerState:Ht}),[Kr,ma]=Se("clearIndicator",{className:Ot.clearIndicator,elementType:MZ,getSlotProps:Le,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:mt=>({size:mt.size||fe,variant:mt.variant||Cs(ee,ne).variant||"plain",color:mt.color||Cs(ee,ne).color||"neutral",disableColorInversion:!!e.color}),additionalProps:{"aria-label":v,title:v}}),[Ri,nu]=Se("popupIndicator",{className:Ot.popupIndicator,elementType:DZ,getSlotProps:pe,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:mt=>({size:mt.size||fe,variant:mt.variant||Cs(ee,ne).variant||"plain",color:mt.color||Cs(ee,ne).color||"neutral",disableColorInversion:!!e.color}),additionalProps:{disabled:le,"aria-label":Ee?b:U,title:Ee?b:U,type:"button"}}),[Pe,Ie]=Se("listbox",{className:Ot.listbox,elementType:$Z,getSlotProps:Ve,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:mt=>({size:mt.size||fe,variant:mt.variant||ee,color:mt.color||ne,disableColorInversion:!mt.disablePortal}),additionalProps:{anchorEl:Me,open:Ee,style:Me?{width:Me.clientWidth}:{}}}),[Ke,ut]=Se("loading",{className:Ot.loading,elementType:FZ,externalForwardedProps:Tt,ownerState:Ht}),[Dt,cr]=Se("noOptions",{className:Ot.noOptions,elementType:NZ,externalForwardedProps:Tt,ownerState:Ht,additionalProps:{role:"presentation",onMouseDown:mt=>{mt.preventDefault()}}}),[pr,Hn]=Se("limitTag",{className:Ot.limitTag,elementType:jZ,externalForwardedProps:Tt,ownerState:Ht});if(S>-1&&Array.isArray(Mt)){const mt=Mt.length-S;!Ae&&mt>0&&(Mt=Mt.splice(0,S),Mt.push(E.jsx(pr,j({},Hn,{children:T(mt)}),Mt.length)))}const[iu,rNe]=Se("option",{className:Ot.option,elementType:LZ,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:mt=>({variant:mt.variant||Cs(ee,ne).variant||"plain",color:mt.color||Cs(ee,ne).color||"neutral",disableColorInversion:!Ie.disablePortal}),additionalProps:{as:"li"}}),nNe=H||((mt,Mi)=>{const{key:sn}=mt,Zi=Fe(mt,CZ);return E.jsx(iu,j({},Zi,{children:O(Mi)}),sn)}),_U=(mt,Mi)=>{const sn=pt({option:mt,index:Mi});return nNe(j({},rNe,sn),mt,{selected:!!sn["aria-selected"],inputValue:Je,ownerState:Ht})},iNe=R.useMemo(()=>[{name:"offset",options:{offset:[0,4]}},...Ie.modifiers||[]],[Ie.modifiers]);let TU=null;if(Me){var kU;TU=E.jsx(Ff,{variant:ee,color:ne,children:E.jsx(Dl,{nested:!0,children:E.jsxs(Pe,j({},Ie,{className:ft(Ie.className),modifiers:iNe},!((kU=d.slots)!=null&&kU.listbox)&&{as:bf,slots:{root:Ie.as||"ul"}},{children:[Ge.map((mt,Mi)=>{if(P){const sn=mt;return B({key:String(sn.key),group:sn.group,children:sn.options.map((Zi,cs)=>_U(Zi,sn.index+cs))})}return _U(mt,Mi)}),M&&Ge.length===0?E.jsx(Ke,j({},ut,{children:$})):null,Ge.length===0&&!_&&!M?E.jsx(Dt,j({},cr,{children:z})):null]}))})})}return E.jsxs(R.Fragment,{children:[E.jsxs(ue,j({},de,{children:[Q&&E.jsx(Ye,j({},Xe,{children:Q})),E.jsxs(De,j({},Ue,{children:[Mt,E.jsx(qe,j({},at))]})),C&&E.jsx(wt,j({},Yr,{children:C})),Br?E.jsx(Kr,j({},ma,{children:m})):null,hr?E.jsx(Ri,j({},nu,{children:q})):null]})),TU]})}),BZ=Aa(E.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function zZ(t){return et("MuiAvatar",t)}tt("MuiAvatar",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","fallback","sizeSm","sizeMd","sizeLg","img","variantOutlined","variantSoft","variantSolid"]);const UZ=R.createContext(void 0);xe("div",{name:"JoyAvatarGroup",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>j({},t.size==="sm"&&{"--AvatarGroup-gap":"-0.375rem","--Avatar-ringSize":"2px"},t.size==="md"&&{"--AvatarGroup-gap":"-0.5rem","--Avatar-ringSize":"2px"},t.size==="lg"&&{"--AvatarGroup-gap":"-0.625rem","--Avatar-ringSize":"4px"},{"--Avatar-ring":`0 0 0 var(--Avatar-ringSize) var(--Avatar-ringColor, ${e.vars.palette.background.surface})`,"--Avatar-marginInlineStart":"var(--AvatarGroup-gap)",display:"flex",marginInlineStart:"calc(-1 * var(--AvatarGroup-gap))"}));const HZ=["alt","color","size","variant","src","srcSet","children","component","slots","slotProps"],VZ=t=>{const{size:e,variant:r,color:n,src:i,srcSet:o}=t,a={root:["root",r&&`variant${ke(r)}`,n&&`color${ke(n)}`,e&&`size${ke(e)}`],img:[(i||o)&&"img"],fallback:["fallback"]};return nt(a,zZ,{})},WZ=xe("div",{name:"JoyAvatar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;return j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon},t.typography[`title-${e.size}`],e.size==="sm"&&{width:"var(--Avatar-size, 2rem)",height:"var(--Avatar-size, 2rem)",fontSize:"calc(var(--Avatar-size, 2rem) * 0.4375)"},e.size==="md"&&{width:"var(--Avatar-size, 2.5rem)",height:"var(--Avatar-size, 2.5rem)",fontSize:"calc(var(--Avatar-size, 2.5rem) * 0.4)"},e.size==="lg"&&{width:"var(--Avatar-size, 3rem)",height:"var(--Avatar-size, 3rem)",fontSize:"calc(var(--Avatar-size, 3rem) * 0.375)"},{marginInlineStart:"var(--Avatar-marginInlineStart)",boxShadow:"var(--Avatar-ring)",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:1,overflow:"hidden",borderRadius:"var(--Avatar-radius, 50%)",userSelect:"none"},(r=t.variants[e.variant])==null?void 0:r[e.color])}),qZ=xe("img",{name:"JoyAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),GZ=xe(BZ,{name:"JoyAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"64%",height:"64%"});function YZ({crossOrigin:t,referrerPolicy:e,src:r,srcSet:n}){const[i,o]=R.useState(!1);return R.useEffect(()=>{if(!r&&!n)return;o(!1);let a=!0;const s=new Image;return s.onload=()=>{a&&o("loaded")},s.onerror=()=>{a&&o("error")},s.crossOrigin=t,s.referrerPolicy=e,r&&(s.src=r),n&&(s.srcset=n),()=>{a=!1}},[t,e,r,n]),i}const Sn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAvatar"}),i=R.useContext(UZ),{alt:o,color:a="neutral",size:s="md",variant:c="soft",src:u,srcSet:d,children:h,component:p,slots:f={},slotProps:g={}}=n,m=Fe(n,HZ),v=e.variant||(i==null?void 0:i.variant)||c,b=e.color||(i==null?void 0:i.color)||a,x=e.size||(i==null?void 0:i.size)||s;let y=null;const C=j({},n,{color:b,size:x,variant:v,grouped:!!i}),w=VZ(C),I=j({},m,{component:p,slots:f,slotProps:g}),[_,T]=Se("root",{ref:r,className:w.root,elementType:WZ,externalForwardedProps:I,ownerState:C}),[O,P]=Se("img",{additionalProps:{alt:o,src:u,srcSet:d},className:w.img,elementType:qZ,externalForwardedProps:I,ownerState:C}),[k,S]=Se("fallback",{className:w.fallback,elementType:GZ,externalForwardedProps:I,ownerState:C}),M=YZ(j({},P,{src:u,srcSet:d}));return(u||d)&&M!=="error"?y=E.jsx(O,j({},P)):h!=null?y=h:o?y=o[0]:y=E.jsx(k,j({},S)),E.jsx(_,j({},T,{children:y}))}),KZ=gE("MuiBox",["root"]),Oe=q7({themeId:K0,defaultTheme:px,defaultClassName:KZ.root,generateClassName:fE.generate});function JZ(t){return et("MuiTypography",t)}tt("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const QZ=["color","textColor"],XZ=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],Zu=R.createContext(!1),Yx=R.createContext(!1),ZZ=t=>{const{gutterBottom:e,noWrap:r,level:n,color:i,variant:o}=t,a={root:["root",n,e&&"gutterBottom",r&&"noWrap",i&&`color${ke(i)}`,o&&`variant${ke(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(a,JZ,{})},eee=xe("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),tee=xe("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(t,e)=>e.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),ree=xe("span",{name:"JoyTypography",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i,o,a;const s=e.level!=="inherit"?(r=t.typography[e.level])==null?void 0:r.lineHeight:"1";return j({"--Icon-fontSize":`calc(1em * ${s})`},e.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},e.nesting?{display:"inline"}:j({display:"block"},e.unstable_hasSkeleton&&{position:"relative"}),(e.startDecorator||e.endDecorator)&&j({display:"flex",alignItems:"center"},e.nesting&&j({display:"inline-flex"},e.startDecorator&&{verticalAlign:"bottom"})),e.level&&e.level!=="inherit"&&t.typography[e.level],{fontSize:`var(--Typography-fontSize, ${e.level&&e.level!=="inherit"&&(n=(i=t.typography[e.level])==null?void 0:i.fontSize)!=null?n:"inherit"})`},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.color&&{color:`var(--variant-plainColor, rgba(${(o=t.vars.palette[e.color])==null?void 0:o.mainChannel} / 1))`},e.variant&&j({borderRadius:t.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!e.nesting&&{marginInline:"-0.25em"},(a=t.variants[e.variant])==null?void 0:a[e.color]))}),$O={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},ze=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyTypography"}),{color:o,textColor:a}=i,s=Fe(i,QZ),c=R.useContext(Zu),u=R.useContext(Yx),d=$u(j({},s,{color:a})),{component:h,gutterBottom:p=!1,noWrap:f=!1,level:g="body-md",levelMapping:m=$O,children:v,endDecorator:b,startDecorator:x,variant:y,slots:C={},slotProps:w={}}=d,I=Fe(d,XZ),_=(n=e.color)!=null?n:y?o!=null?o:"neutral":o,T=c||u?e.level||"inherit":g,O=kl(v,["Skeleton"]),P=h||(c?"span":m[T]||$O[T]||"span"),k=j({},d,{level:T,component:P,color:_,gutterBottom:p,noWrap:f,nesting:c,variant:y,unstable_hasSkeleton:O}),S=ZZ(k),M=j({},I,{component:P,slots:C,slotProps:w}),[$,D]=Se("root",{ref:r,className:S.root,elementType:ree,externalForwardedProps:M,ownerState:k}),[N,z]=Se("startDecorator",{className:S.startDecorator,elementType:eee,externalForwardedProps:M,ownerState:k}),[U,V]=Se("endDecorator",{className:S.endDecorator,elementType:tee,externalForwardedProps:M,ownerState:k});return E.jsx(Zu.Provider,{value:!0,children:E.jsxs($,j({},D,{children:[x&&E.jsx(N,j({},z,{children:x})),O?R.cloneElement(v,{variant:v.props.variant||"inline"}):v,b&&E.jsx(U,j({},V,{children:b}))]}))})});ze.muiName="Typography";function nee(t){return et("MuiButton",t)}const Ra=tt("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),iee=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],oee=t=>{const{color:e,disabled:r,focusVisible:n,focusVisibleClassName:i,fullWidth:o,size:a,variant:s,loading:c}=t,u={root:["root",r&&"disabled",n&&"focusVisible",o&&"fullWidth",s&&`variant${ke(s)}`,e&&`color${ke(e)}`,a&&`size${ke(a)}`,c&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},d=nt(u,nee,{});return n&&i&&(d.root+=` ${i}`),d},aee=xe("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),see=xe("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),lee=xe("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(t,e)=>e.loadingIndicatorCenter})(({theme:t,ownerState:e})=>{var r,n;return j({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color},e.disabled&&{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color})}),LO=({theme:t,ownerState:e})=>{var r,n,i,o;return[j({"--Icon-margin":"initial","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon},e.size==="sm"&&{"--Icon-fontSize":t.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:t.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},e.size==="md"&&{"--Icon-fontSize":t.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:t.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},e.size==="lg"&&{"--Icon-fontSize":t.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:t.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${t.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.lg,lineHeight:t.vars.lineHeight.md},e.fullWidth&&{width:"100%"},{[t.focus.selector]:t.focus.default}),j({},(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:hover":{"@media (hover: hover)":(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color]},'&:active, &[aria-pressed="true"]':(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color],[`&.${Ra.disabled}`]:(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]},e.loadingPosition==="center"&&{[`&.${Ra.loading}`]:{color:"transparent"}})]},cee=xe("button",{name:"JoyButton",slot:"Root",overridesResolver:(t,e)=>e.root})(LO),lt=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyButton"}),{children:o,action:a,color:s="primary",variant:c="solid",size:u="md",fullWidth:d=!1,startDecorator:h,endDecorator:p,loading:f=!1,loadingPosition:g="center",loadingIndicator:m,disabled:v,component:b,slots:x={},slotProps:y={}}=i,C=Fe(i,iee),w=R.useContext(Nf),I=R.useContext(wO),_=e.variant||w.variant||c,T=e.size||w.size||u,O=e.color||w.color||s,P=(n=e.loading||e.disabled)!=null?n:w.disabled||f||v,k=R.useRef(null),S=Rn(k,r),{focusVisible:M,setFocusVisible:$,getRootProps:D}=ao(j({},i,{disabled:P,rootRef:S})),N=m!=null?m:E.jsx(Kn,{color:O,thickness:{sm:2,md:3,lg:4}[T]||3});R.useImperativeHandle(a,()=>({focusVisible:()=>{var ee;$(!0),(ee=k.current)==null||ee.focus()}}),[$]);const z=j({},i,{color:O,fullWidth:d,variant:_,size:T,focusVisible:M,loading:f,loadingPosition:g,disabled:P}),U=oee(z),V=ee=>{var ae;let oe=i.onClick;if(typeof y.root=="function"?oe=y.root(z).onClick:y.root&&(oe=y.root.onClick),(ae=oe)==null||ae(ee),I){var Ce;(Ce=I.onClick)==null||Ce.call(I,ee,i.value)}};let q=i["aria-pressed"];typeof y.root=="function"?q=y.root(z)["aria-pressed"]:y.root&&(q=y.root["aria-pressed"]),I!=null&&I.value&&(Array.isArray(I.value)?q=I.value.indexOf(i.value)!==-1:q=I.value===i.value);const F=j({},C,{component:b,slots:x,slotProps:y}),[B,H]=Se("root",{ref:r,className:U.root,elementType:cee,externalForwardedProps:F,getSlotProps:D,ownerState:z,additionalProps:{onClick:V,"aria-pressed":q}}),[G,Z]=Se("startDecorator",{className:U.startDecorator,elementType:aee,externalForwardedProps:F,ownerState:z}),[Y,Q]=Se("endDecorator",{className:U.endDecorator,elementType:see,externalForwardedProps:F,ownerState:z}),[K,X]=Se("loadingIndicatorCenter",{className:U.loadingIndicatorCenter,elementType:lee,externalForwardedProps:F,ownerState:z});return E.jsxs(B,j({},H,{children:[(h||f&&g==="start")&&E.jsx(G,j({},Z,{children:f&&g==="start"?N:h})),o,f&&g==="center"&&E.jsx(K,j({},X,{children:N})),(p||f&&g==="end")&&E.jsx(Y,j({},Q,{children:f&&g==="end"?N:p}))]}))});lt.muiName="Button";function uee(t){return et("MuiButtonGroup",t)}tt("MuiButtonGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);const dee=["buttonFlex","className","component","disabled","size","color","variant","children","orientation","slots","slotProps","spacing"],hee=t=>{const{size:e,variant:r,color:n,orientation:i}=t,o={root:["root",i,r&&`variant${ke(r)}`,n&&`color${ke(n)}`,e&&`size${ke(e)}`]};return nt(o,uee,{})},pee=xe("div")(({theme:t,ownerState:e})=>{var r,n,i;const{borderRadius:o}=Mo({theme:t,ownerState:e},["borderRadius"]),a=e.orientation==="vertical"?"var(--ButtonGroup-radius) var(--ButtonGroup-radius) var(--unstable_childRadius) var(--unstable_childRadius)":"var(--ButtonGroup-radius) var(--unstable_childRadius) var(--unstable_childRadius) var(--ButtonGroup-radius)",s=e.orientation==="vertical"?"var(--unstable_childRadius) var(--unstable_childRadius) var(--ButtonGroup-radius) var(--ButtonGroup-radius)":"var(--unstable_childRadius) var(--ButtonGroup-radius) var(--ButtonGroup-radius) var(--unstable_childRadius)",c=e.orientation==="vertical"?"calc(var(--ButtonGroup-separatorSize) * -1) 0 0 0":"0 0 0 calc(var(--ButtonGroup-separatorSize) * -1)",u={};bs(t.breakpoints,e.spacing,(f,g)=>{if(g!==null){var m;f(u,{"--ButtonGroup-connected":g.toString().match(/^0(?!\.)/)?"1":"0",gap:typeof g=="string"?g:(m=t.spacing)==null?void 0:m.call(t,g)})}});const d=(r=t.variants.outlined)==null?void 0:r[e.color],h=(n=t.variants.outlinedDisabled)==null?void 0:n[e.color],p=(i=t.variants.outlinedHover)==null?void 0:i[e.color];return[j({"--ButtonGroup-separatorSize":e.variant==="outlined"?"1px":"calc(var(--ButtonGroup-connected) * 1px)","--ButtonGroup-separatorColor":d==null?void 0:d.borderColor,"--ButtonGroup-radius":t.vars.radius.sm,"--Divider-inset":"0.5rem","--unstable_childRadius":"calc((1 - var(--ButtonGroup-connected)) * var(--ButtonGroup-radius) - var(--variant-borderWidth, 0px))"},u,{display:"flex",borderRadius:"var(--ButtonGroup-radius)",flexDirection:e.orientation==="vertical"?"column":"row","& > [data-first-child]":j({"--Button-radius":a,"--IconButton-radius":a},e.orientation==="horizontal"&&{borderRight:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},e.orientation==="vertical"&&{borderBottom:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > :not([data-first-child]):not([data-last-child]):not(:only-child)":j({"--Button-radius":"var(--unstable_childRadius)","--IconButton-radius":"var(--unstable_childRadius)",borderRadius:"var(--unstable_childRadius)"},e.orientation==="horizontal"&&{borderLeft:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)",borderRight:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},e.orientation==="vertical"&&{borderTop:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)",borderBottom:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > [data-last-child]":j({"--Button-radius":s,"--IconButton-radius":s},e.orientation==="horizontal"&&{borderLeft:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},e.orientation==="vertical"&&{borderTop:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > :only-child":{"--Button-radius":"var(--ButtonGroup-radius)","--IconButton-radius":"var(--ButtonGroup-radius)"},"& > :not([data-first-child]):not(:only-child)":{"--Button-margin":c,"--IconButton-margin":c},[`& .${Ra.root}, & .${qx.root}`]:j({"&:not(:disabled)":{zIndex:1},"&:disabled":{"--ButtonGroup-separatorColor":h==null?void 0:h.borderColor}},e.variant==="outlined"&&{"&:hover":{"--ButtonGroup-separatorColor":p==null?void 0:p.borderColor}},{[`&:hover, ${t.focus.selector}`]:{zIndex:2}})},e.buttonFlex&&{[`& > *:not(.${qx.root})`]:{flex:e.buttonFlex},[`& > :not(button) > .${Ra.root}`]:{width:"100%"}}),o!==void 0&&{"--ButtonGroup-radius":o}]}),fee=xe(pee,{name:"JoyButtonGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({}),mee=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyButtonGroup"}),{buttonFlex:i,className:o,component:a="div",disabled:s=!1,size:c="md",color:u="neutral",variant:d="outlined",children:h,orientation:p="horizontal",slots:f={},slotProps:g={},spacing:m=0}=n,v=Fe(n,dee),b=j({},n,{buttonFlex:i,color:u,component:a,orientation:p,spacing:m,size:c,variant:d}),x=hee(b),y=j({},v,{component:a,slots:f,slotProps:g}),[C,w]=Se("root",{ref:r,className:ft(x.root,o),elementType:fee,externalForwardedProps:y,additionalProps:{role:"group"},ownerState:b}),I=R.useMemo(()=>({variant:d,color:u,size:c,disabled:s}),[d,u,c,s]);return E.jsx(C,j({},w,{children:E.jsx(Nf.Provider,{value:I,children:R.Children.map(h,(_,T)=>{if(!R.isValidElement(_))return _;const O={};if(kl(_,["Divider"])){var P,k;const S=_.props;O.inset=(P=S==null?void 0:S.inset)!=null?P:"context";const M=p==="vertical"?"horizontal":"vertical";O.orientation=(k=S==null?void 0:S.orientation)!=null?k:M,O.role="presentation",O.component="span"}return R.Children.count(h)>1&&(T===0&&(O["data-first-child"]=""),T===R.Children.count(h)-1&&(O["data-last-child"]="")),R.cloneElement(_,O)})})}))});function gee(t){return et("MuiCard",t)}const _s=tt("MuiCard",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),vee=["className","color","component","invertedColors","size","variant","children","orientation","slots","slotProps"],yee=t=>{const{size:e,variant:r,color:n,orientation:i}=t,o={root:["root",i,r&&`variant${ke(r)}`,n&&`color${ke(n)}`,e&&`size${ke(e)}`]};return nt(o,gee,{})},FO=xe("div")(({theme:t,ownerState:e})=>{var r;const{p:n,padding:i,borderRadius:o}=Mo({theme:t,ownerState:e},["p","padding","borderRadius"]);return[j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--Card-childRadius":"max((var(--Card-radius) - var(--variant-borderWidth, 0px)) - var(--Card-padding), min(var(--Card-padding) / 2, (var(--Card-radius) - var(--variant-borderWidth, 0px)) / 2))","--AspectRatio-radius":"var(--Card-childRadius)","--unstable_actionMargin":"calc(-1 * var(--variant-borderWidth, 0px))","--unstable_actionRadius":"var(--Card-radius)","--CardCover-radius":"calc(var(--Card-radius) - var(--variant-borderWidth, 0px))","--CardOverflow-offset":"calc(-1 * var(--Card-padding))","--CardOverflow-radius":"calc(var(--Card-radius) - var(--variant-borderWidth, 0px))","--Divider-inset":"calc(-1 * var(--Card-padding))"},e.size==="sm"&&{"--Card-radius":t.vars.radius.sm,"--Card-padding":"0.625rem",gap:"0.5rem"},e.size==="md"&&{"--Card-radius":t.vars.radius.md,"--Card-padding":"1rem",gap:"0.75rem 1rem"},e.size==="lg"&&{"--Card-radius":t.vars.radius.lg,"--Card-padding":"1.5rem",gap:"1rem 1.5rem"},{padding:"var(--Card-padding)",borderRadius:"var(--Card-radius)",backgroundColor:t.vars.palette.background.surface,position:"relative",display:"flex",flexDirection:e.orientation==="horizontal"?"row":"column"},t.typography[`body-${e.size}`],e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(r=t.variants[e.variant])==null?void 0:r[e.color]),n!==void 0&&{"--Card-padding":n},i!==void 0&&{"--Card-padding":i},o!==void 0&&{"--Card-radius":o}]}),bee=xe(FO,{name:"JoyCard",slot:"Root",overridesResolver:(t,e)=>e.root})({}),hn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCard"}),{className:i,color:o="neutral",component:a="div",invertedColors:s=!1,size:c="md",variant:u="outlined",children:d,orientation:h="vertical",slots:p={},slotProps:f={}}=n,g=Fe(n,vee),m=j({},n,{color:o,component:a,orientation:h,size:c,variant:u,invertedColors:s}),v=yee(m),b=j({},g,{component:a,slots:p,slotProps:f}),[x,y]=Se("root",{ref:r,className:ft(v.root,i),elementType:bee,externalForwardedProps:b,ownerState:m});return E.jsx(x,j({},y,{children:R.Children.map(d,(C,w)=>{if(!R.isValidElement(C))return C;const I={};if(kl(C,["Divider"])){var _,T;const O=C.props;I.inset=(_=O==null?void 0:O.inset)!=null?_:"context";const P=h==="vertical"?"horizontal":"vertical";I.orientation=(T=O==null?void 0:O.orientation)!=null?T:P}return w===0&&(I["data-first-child"]=""),w===R.Children.count(d)-1&&(I["data-last-child"]=""),R.cloneElement(C,I)})}))});function xee(t){return et("MuiCardOverflow",t)}const Kx=tt("MuiCardOverflow",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);function wee(t){return et("MuiDivider",t)}const Cee=tt("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]),NO=xe("div")(({ownerState:t})=>{var e;return j({"--Button-radius":"var(--Card-childRadius)","--IconButton-radius":"var(--Card-childRadius)",display:"flex"},((e=t.orientation)==null?void 0:e.startsWith("horizontal"))&&{alignItems:"center"},{flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal-reverse"&&{flexDirection:"row-reverse"},{zIndex:1,gap:"calc(0.625 * var(--Card-padding))",padding:"var(--unstable_padding)","--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 0 0",[`.${Kx.root} > &`]:{"--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 var(--Card-padding)"},[`.${_s.root} > .${Cee.root} + &`]:{"--unstable_padding":"0"}},t.buttonFlex?{[`& > :not(.${qx.root})`]:{flex:t.buttonFlex},[`& > :not(button) > .${Ra.root}`]:{width:"100%"}}:{[`& > .${Ra.root}:only-child`]:{flex:"auto"}})});xe(NO,{name:"JoyCardActions",slot:"Root",overridesResolver:(t,e)=>e.root})({});function Iee(t){return et("MuiCardContent",t)}tt("MuiCardContent",["root"]);const See=["className","component","children","orientation","slots","slotProps"],_ee=()=>nt({root:["root"]},Iee,{}),jO=xe("div")(({ownerState:t})=>({display:"flex",flexDirection:t.orientation==="horizontal"?"row":"column",flex:9999,zIndex:1,columnGap:"var(--Card-padding)",rowGap:"max(2px, calc(0.1875 * var(--Card-padding)))",padding:"var(--unstable_padding)",[`.${Kx.root} > &`]:{"--unstable_padding":"calc(var(--Card-padding) * 0.75) 0px"}})),Tee=xe(jO,{name:"JoyCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$n=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCardContent"}),{className:i,component:o="div",children:a,orientation:s="vertical",slots:c={},slotProps:u={}}=n,d=Fe(n,See),h=j({},d,{component:o,slots:c,slotProps:u}),p=j({},n,{component:o,orientation:s}),f=_ee(),[g,m]=Se("root",{ref:r,className:ft(f.root,i),elementType:Tee,externalForwardedProps:h,ownerState:p});return E.jsx(g,j({},m,{children:a}))});function kee(t){return et("MuiModalDialog",t)}const BO=tt("MuiModalDialog",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","layoutCenter","layoutFullscreen"]),Aee=["className","component","children","color","variant","slots","slotProps"],Pee=t=>{const{variant:e,color:r}=t,n={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`]};return nt(n,xee,{})},Eee=xe("div",{name:"JoyCardOverflow",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;const n="calc(var(--CardOverflow-radius) - var(--variant-borderWidth, 0px))";return j({alignSelf:"stretch",position:"relative",display:"flex",flexDirection:"var(--_CardOverflow-flexDirection)",margin:"var(--_CardOverflow-margin)",borderRadius:"var(--_CardOverflow-radius)",padding:"var(--_CardOverflow-padding)",[`.${_s.vertical} &, .${_s.horizontal} .${_s.vertical} &, .${BO.root} &`]:{"--_CardOverflow-flexDirection":"column","--AspectRatio-margin":"0 calc(-1 * var(--Card-padding))","--_CardOverflow-margin":"0 var(--CardOverflow-offset)","--_CardOverflow-padding":"0 var(--Card-padding)","&[data-first-child]":{"--AspectRatio-radius":`${n} ${n} 0 0`,"--_CardOverflow-radius":"var(--CardOverflow-radius) var(--CardOverflow-radius) 0 0","--_CardOverflow-margin":"var(--CardOverflow-offset) var(--CardOverflow-offset) 0"},"&[data-last-child]":{"--AspectRatio-radius":`0 0 ${n} ${n}`,"--_CardOverflow-radius":"0 0 var(--CardOverflow-radius) var(--CardOverflow-radius)","--_CardOverflow-margin":"0 var(--CardOverflow-offset) var(--CardOverflow-offset)"},"&[data-last-child][data-first-child]":{"--AspectRatio-radius":n,"--_CardOverflow-margin":"var(--CardOverflow-offset)"},[`& > .${Ra.root}:only-child`]:{zIndex:1,width:"calc(100% + -2 * var(--CardOverflow-offset))","--Button-margin":"0 var(--CardOverflow-offset)","--Button-radius":"0 0 var(--CardOverflow-radius) var(--CardOverflow-radius)"}},[`.${_s.horizontal} &, .${_s.vertical} .${_s.horizontal} &`]:{"--_CardOverflow-flexDirection":"row","--AspectRatio-margin":"calc(-1 * var(--Card-padding)) 0px","--_CardOverflow-margin":"var(--CardOverflow-offset) 0px","--_CardOverflow-padding":"var(--Card-padding) 0px","&[data-first-child]":{"--AspectRatio-radius":`${n} 0 0 ${n}`,"--_CardOverflow-radius":"var(--CardOverflow-radius) 0 0 var(--CardOverflow-radius)","--_CardOverflow-margin":"var(--CardOverflow-offset) 0px var(--CardOverflow-offset) var(--CardOverflow-offset)"},"&[data-last-child]":{"--AspectRatio-radius":`0 ${n} ${n} 0`,"--_CardOverflow-radius":"0 var(--CardOverflow-radius) var(--CardOverflow-radius) 0","--_CardOverflow-margin":"var(--CardOverflow-offset) var(--CardOverflow-offset) var(--CardOverflow-offset) 0px"},"&[data-last-child][data-first-child]":{"--AspectRatio-radius":n,"--_CardOverflow-margin":"var(--CardOverflow-offset)"},[`& > .${Ra.root}:only-child`]:{height:"calc(100% + -2 * var(--CardOverflow-offset))","--Button-margin":"var(--CardOverflow-offset) 0","--Button-radius":"0 var(--CardOverflow-radius) var(--CardOverflow-radius) 0"}}},(r=t.variants[e.variant])==null?void 0:r[e.color])}),jf=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCardOverflow"}),{className:i,component:o="div",children:a,color:s="neutral",variant:c="plain",slots:u={},slotProps:d={}}=n,h=Fe(n,Aee),p=j({},n,{component:o,color:s,variant:c}),f=Pee(p),g=j({},h,{component:o,slots:u,slotProps:d}),[m,v]=Se("root",{ref:r,className:ft(f.root,i),elementType:Eee,externalForwardedProps:g,ownerState:p});return E.jsx(m,j({},v,{children:a}))});jf.muiName="CardOverflow";function Oee(t){return et("MuiCheckbox",t)}const jl=tt("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),Ree=Aa(E.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),Mee=Aa(E.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),Dee=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],$ee=t=>{const{checked:e,disabled:r,disableIcon:n,focusVisible:i,color:o,variant:a,size:s,indeterminate:c}=t,u={root:["root",e&&"checked",r&&"disabled",i&&"focusVisible",a&&`variant${ke(a)}`,o&&`color${ke(o)}`,s&&`size${ke(s)}`],checkbox:["checkbox",e&&"checked",c&&"indeterminate",r&&"disabled"],action:["action",e&&"checked",n&&r&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return nt(u,Oee,{})},Lee=xe("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{var r,n,i;return j({"--Icon-fontSize":"var(--Checkbox-size)"},t.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:e.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},t.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:e.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},t.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:e.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:t.overlay?"initial":"relative",display:"inline-flex",fontFamily:e.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:e.vars.palette.text.primary,[`&.${jl.disabled}`]:{color:(r=e.variants.plainDisabled)==null||(r=r[t.color])==null?void 0:r.color}},t.disableIcon&&{color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color,[`&.${jl.disabled}`]:{color:(i=e.variants[`${t.variant}Disabled`])==null||(i=i[t.color])==null?void 0:i.color}})}),Fee=xe("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(t,e)=>e.checkbox})(({theme:t,ownerState:e})=>{var r,n,i,o,a;const s=(r=t.variants[`${e.variant}`])==null?void 0:r[e.color];return[j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${t.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},e.disableIcon&&{display:"contents"},{[`&.${jl.checked}, &.${jl.indeterminate}`]:{"--Icon-color":"currentColor"}}),...e.disableIcon?[]:[j({},s,{backgroundColor:(n=s==null?void 0:s.backgroundColor)!=null?n:t.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=t.variants[`${e.variant}Hover`])==null?void 0:i[e.color]}},{"&:active":(o=t.variants[`${e.variant}Active`])==null?void 0:o[e.color]},{[`&.${jl.disabled}`]:(a=t.variants[`${e.variant}Disabled`])==null?void 0:a[e.color]}]]}),Nee=xe("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(t,e)=>e.action})(({theme:t,ownerState:e})=>{var r,n,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${e.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[t.focus.selector]:t.focus.default},...e.disableIcon?[(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:hover":(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color]},{"&:active":(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color]},{[`&.${jl.disabled}`]:(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]}]:[]]}),jee=xe("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(t,e)=>e.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),Bee=xe("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(t,e)=>e.label})(({ownerState:t})=>j({flex:1,minWidth:0},t.disableIcon&&{zIndex:1,pointerEvents:"none"})),zee=E.jsx(Ree,{}),Uee=E.jsx(Mee,{}),ed=R.forwardRef(function(e,r){var n,i,o,a,s;const c=Ze({props:e,name:"JoyCheckbox"}),{checked:u,uncheckedIcon:d,checkedIcon:h=zee,label:p,defaultChecked:f,disabled:g,disableIcon:m=!1,overlay:v,id:b,indeterminate:x=!1,indeterminateIcon:y=Uee,name:C,onBlur:w,onChange:I,onFocus:_,onFocusVisible:T,readOnly:O,required:P,value:k,color:S,variant:M,size:$="md",component:D,slots:N={},slotProps:z={}}=c,U=Fe(c,Dee),V=R.useContext(Ea),q=(n=(i=e.disabled)!=null?i:V==null?void 0:V.disabled)!=null?n:g,F=(o=(a=e.size)!=null?a:V==null?void 0:V.size)!=null?o:$,B=Ia(b!=null?b:V==null?void 0:V.htmlFor),H={checked:u,defaultChecked:f,disabled:q,onBlur:w,onChange:I,onFocus:_,onFocusVisible:T},{getInputProps:G,checked:Z,disabled:Y,focusVisible:Q}=lO(H),K=Z||x,ae=K?M||"solid":M||"outlined",oe=e.color||(V!=null&&V.error?"danger":(s=V==null?void 0:V.color)!=null?s:S),ge=j({},c,{checked:Z,disabled:Y,disableIcon:m,overlay:v,focusVisible:Q,color:K?oe||"primary":oe||"neutral",variant:ae,size:F}),ve=$ee(ge),fe=j({},U,{component:D,slots:N,slotProps:z}),[ne,le]=Se("root",{ref:r,className:ve.root,elementType:Lee,externalForwardedProps:fe,ownerState:ge}),[he,ye]=Se("checkbox",{className:ve.checkbox,elementType:Fee,externalForwardedProps:fe,ownerState:ge}),[pe,Le]=Se("action",{className:ve.action,elementType:Nee,externalForwardedProps:fe,ownerState:ge}),[He,Ve]=Se("input",{additionalProps:j({id:B,name:C,value:k,readOnly:O,role:void 0,required:P!=null?P:V==null?void 0:V.required,"aria-describedby":V==null?void 0:V["aria-describedby"]},x&&{"aria-checked":"mixed"}),className:ve.input,elementType:jee,externalForwardedProps:fe,getSlotProps:G,ownerState:ge}),[pt,ot]=Se("label",{additionalProps:{htmlFor:B},className:ve.label,elementType:Bee,externalForwardedProps:fe,ownerState:ge});let we=d;return m?we=null:x?we=y:Z&&(we=h),E.jsxs(ne,j({},le,{children:[E.jsxs(he,j({},ye,{children:[E.jsx(pe,j({},Le,{children:E.jsx(He,j({},Ve))})),we]})),p&&E.jsx(Zu.Provider,{value:!0,children:E.jsx(pt,j({},ot,{children:p}))})]}))});function Hee(t){return et("MuiDialogActions",t)}tt("MuiDialogActions",["root"]);const Vee=["component","children","buttonFlex","orientation","slots","slotProps"],Wee=()=>nt({root:["root"]},Hee,{}),qee=xe(NO,{name:"JoyDialogActions",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Bl=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDialogActions"}),{component:i="div",children:o,buttonFlex:a,orientation:s="horizontal-reverse",slots:c={},slotProps:u={}}=n,d=Fe(n,Vee),h=j({},d,{component:i,slots:c,slotProps:u}),p=j({},n,{component:i,buttonFlex:a,orientation:s}),f=Wee(),[g,m]=Se("root",{ref:r,className:f.root,elementType:qee,externalForwardedProps:h,ownerState:p});return E.jsx(g,j({},m,{children:o}))});function Gee(t){return et("MuiDialogContent",t)}tt("MuiDialogContent",["root"]);const Bf=R.createContext(void 0);function Yee(t){return et("MuiDialogTitle",t)}const Kee=tt("MuiDialogTitle",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),Jee=["component","children","orientation","slots","slotProps"],Qee=()=>nt({root:["root"]},Gee,{}),Xee=xe(jO,{name:"JoyDialogContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({color:`var(--DialogContent-color, ${t.vars.palette.text.tertiary})`,overflow:"auto",margin:"var(--unstable_DialogContent-margin)",[`.${BO.root} > .${Kee.root} + &`]:{"--unstable_DialogContent-margin":"-0.375em 0 0 0"}})),Ts=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDialogContent"}),i=R.useContext(Bf),{component:o="div",children:a,orientation:s="vertical",slots:c={},slotProps:u={}}=n,d=Fe(n,Jee),h=j({},d,{component:o,slots:c,slotProps:u}),p=j({},n,{component:o,orientation:s}),f=Qee(),[g,m]=Se("root",{ref:r,className:f.root,elementType:Xee,externalForwardedProps:h,ownerState:p,additionalProps:{id:i==null?void 0:i.describedBy}});return E.jsx(g,j({},m,{children:a}))}),Jx=R.createContext(void 0),Zee=["component","children","variant","color","level","slots","slotProps"],ete=t=>{const{level:e,color:r,variant:n}=t,i={root:["root",e,r&&`color${ke(r)}`,n&&`variant${ke(n)}`]};return nt(i,Yee,{})},tte=xe("h2",{name:"JoyDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;const i=e.level!=="inherit"?(r=t.typography[e.level])==null?void 0:r.lineHeight:"1";return j({"--Icon-fontSize":`calc(1em * ${i})`},e.color&&{"--Icon-color":"currentColor"},{display:"flex",gap:"clamp(4px, 0.375em, 0.75rem)",margin:"var(--unstable_DialogTitle-margin, 0px)"},e.level&&e.level!=="inherit"&&t.typography[e.level],{color:"inherit"},e.variant&&j({borderRadius:t.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},(n=t.variants[e.variant])==null?void 0:n[e.color]),{[`.${Kx.root} > &`]:{"--unstable_DialogTitle-margin":"var(--Card-padding) 0"}})}),rte={sm:"title-md",md:"title-lg",lg:"h4"},ks=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDialogTitle"}),i=R.useContext(Jx),o=R.useContext(Bf),{component:a="h2",children:s,variant:c,color:u,level:d=rte[i||"md"],slots:h={},slotProps:p={}}=n,f=Fe(n,Zee),g=e.color||(c?u!=null?u:"neutral":u),m=j({},f,{component:a,slots:h,slotProps:p}),v=j({},n,{component:a,color:g,variant:c,level:d}),b=ete(v),[x,y]=Se("root",{ref:r,className:b.root,elementType:tte,externalForwardedProps:m,ownerState:v,additionalProps:{id:o==null?void 0:o.labelledBy}});return E.jsx(x,j({},y,{children:s}))}),nte=["className","children","component","inset","orientation","role","slots","slotProps"],ite=t=>{const{orientation:e,inset:r}=t,n={root:["root",e,r&&`inset${ke(r)}`]};return nt(n,wee,{})},zO=xe("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({"--Divider-thickness":"1px","--Divider-lineColor":t.vars.palette.divider},e.inset==="none"&&{"--_Divider-inset":"0px"},e.inset==="context"&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:e.orientation==="vertical"?"initial":"var(--_Divider-inset)",marginBlock:e.orientation==="vertical"?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},e.children?j({"--Divider-gap":t.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:e.orientation==="vertical"?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0},t.typography["body-sm"],{"&::before, &::after":{position:"relative",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:e.orientation==="vertical"?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:e.orientation==="vertical"?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:e.orientation==="vertical"?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:e.orientation==="vertical"?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}):{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)"})),Ni=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDivider"}),{className:i,children:o,component:a=o!=null?"div":"hr",inset:s,orientation:c="horizontal",role:u=a!=="hr"?"separator":void 0,slots:d={},slotProps:h={}}=n,p=Fe(n,nte),f=j({},n,{inset:s,role:u,orientation:c,component:a}),g=ite(f),m=j({},p,{component:a,slots:d,slotProps:h}),[v,b]=Se("root",{ref:r,className:ft(g.root,i),elementType:zO,externalForwardedProps:m,ownerState:f,additionalProps:j({as:a,role:u},u==="separator"&&c==="vertical"&&{"aria-orientation":"vertical"})});return E.jsx(v,j({},b,{children:o}))});Ni.muiName="Divider";function ote(t){return et("MuiModal",t)}tt("MuiModal",["root","hidden","backdrop"]);const UO=R.createContext(void 0),ate=["children","container","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onClose","onKeyDown","open","component","slots","slotProps"],ste=t=>{const{open:e}=t;return nt({root:["root",!e&&"hidden"],backdrop:["backdrop"]},ote,{})},lte=xe("div")(({ownerState:t,theme:e})=>j({"--unstable_popup-zIndex":`calc(${e.vars.zIndex.modal} + 1)`,'& ~ [role="listbox"]':{"--unstable_popup-zIndex":`calc(${e.vars.zIndex.modal} + 1)`},position:"fixed",zIndex:e.vars.zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&{visibility:"hidden"})),cte=xe(lte,{name:"JoyModal",slot:"Root",overridesResolver:(t,e)=>e.root})({}),ute=xe("div")(({theme:t})=>({zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:t.vars.palette.background.backdrop,WebkitTapHighlightColor:"transparent",backdropFilter:"blur(8px)"})),dte=xe(ute,{name:"JoyModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({}),As=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyModal"}),{children:i,container:o,disableAutoFocus:a=!1,disableEnforceFocus:s=!1,disableEscapeKeyDown:c=!1,disablePortal:u=!1,disableRestoreFocus:d=!1,disableScrollLock:h=!1,hideBackdrop:p=!1,keepMounted:f=!1,onClose:g,open:m,component:v,slots:b={},slotProps:x={}}=n,y=Fe(n,ate),C=j({},n,{disableAutoFocus:a,disableEnforceFocus:s,disableEscapeKeyDown:c,disablePortal:u,disableRestoreFocus:d,disableScrollLock:h,hideBackdrop:p,keepMounted:f}),{getRootProps:w,getBackdropProps:I,rootRef:_,portalRef:T,isTopModal:O}=OK(j({},C,{rootRef:r})),P=ste(C),k=j({},y,{component:v,slots:b,slotProps:x}),[S,M]=Se("root",{ref:_,className:P.root,elementType:cte,externalForwardedProps:k,getSlotProps:w,ownerState:C}),[$,D]=Se("backdrop",{className:P.backdrop,elementType:dte,externalForwardedProps:k,getSlotProps:I,ownerState:C});return!f&&!m?null:E.jsx(UO.Provider,{value:g,children:E.jsx(LE,{ref:T,container:o,disablePortal:u,children:E.jsxs(S,j({},M,{children:[p?null:E.jsx($,j({},D)),E.jsx(WY,{disableEnforceFocus:s,disableAutoFocus:a,disableRestoreFocus:d,isEnabled:O,open:m,children:R.Children.only(i)&&R.cloneElement(i,j({},i.props.tabIndex===void 0&&{tabIndex:-1}))})]}))})})});function hte(t){return et("MuiFormControl",t)}const Qx=tt("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);function pte(t){return et("MuiSwitch",t)}const td=tt("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),fte=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],mte=t=>{const{disabled:e,error:r,size:n,color:i,orientation:o}=t,a={root:["root",o,e&&"disabled",r&&"error",i&&`color${ke(i)}`,n&&`size${ke(n)}`]};return nt(a,hte,{})},gte=xe("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i;return j({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":e.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":t.vars.palette.danger[500]},e.size==="sm"&&{"--FormLabel-fontSize":t.vars.fontSize.xs,"--FormLabel-lineHeight":t.vars.lineHeight.xl,"--FormLabel-margin":e.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":t.vars.fontSize.xs,"--FormHelperText-lineHeight":t.vars.lineHeight.xl},e.size==="md"&&{"--FormLabel-fontSize":t.vars.fontSize.sm,"--FormLabel-lineHeight":t.vars.lineHeight.sm,"--FormLabel-margin":e.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":t.vars.fontSize.sm,"--FormHelperText-lineHeight":t.vars.lineHeight.sm},e.size==="lg"&&{"--FormLabel-fontSize":t.vars.fontSize.md,"--FormLabel-lineHeight":t.vars.lineHeight.md,"--FormLabel-margin":e.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":t.vars.fontSize.sm,"--FormHelperText-lineHeight":t.vars.lineHeight.sm},e.color&&{"--FormHelperText-color":(r=t.vars.palette[e.color])==null?void 0:r[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${Qx.error}`]:{"--FormHelperText-color":t.vars.palette.danger[500]},[`&.${Qx.disabled}`]:{"--FormLabel-color":(n=t.variants.plainDisabled)==null||(n=n[e.color||"neutral"])==null?void 0:n.color,"--FormHelperText-color":(i=t.variants.plainDisabled)==null||(i=i[e.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:e.orientation==="horizontal"?"row":"column"},e.orientation==="horizontal"&&{[`& > label ~ .${td.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),kt=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:s=!1,required:c=!1,error:u=!1,color:d,size:h="md",orientation:p="vertical",slots:f={},slotProps:g={}}=n,m=Fe(n,fte),v=Ia(i),[b,x]=R.useState(null),y=j({},n,{id:v,component:a,color:d,disabled:s,error:u,required:c,size:h,orientation:p});let C;const w=mte(y),[I,_]=Se("root",{ref:r,className:ft(w.root,o),elementType:gte,externalForwardedProps:j({},m,{component:a,slots:f,slotProps:g}),ownerState:y}),T=R.useMemo(()=>({disabled:s,required:c,error:u,color:d,size:h,htmlFor:v,labelId:`${v}-label`,"aria-describedby":b?`${v}-helper-text`:void 0,setHelperText:x,registerEffect:C}),[d,s,u,b,v,C,c,h]);return E.jsx(Ea.Provider,{value:T,children:E.jsx(I,j({},_))})});function vte(t){return et("MuiFormHelperText",t)}tt("MuiFormHelperText",["root"]);function yte(t){return et("MuiFormLabel",t)}const bte=tt("MuiFormLabel",["root","asterisk"]),xte=["children","component","slots","slotProps"],wte=()=>nt({root:["root"]},vte,{}),Cte=xe("div",{name:"JoyFormHelperText",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({"--Icon-fontSize":"calc(var(--FormHelperText-lineHeight) * 1em)",display:"flex",alignItems:"center",gap:"2px",fontFamily:t.vars.fontFamily.body,fontSize:`var(--FormHelperText-fontSize, ${t.vars.fontSize.sm})`,lineHeight:`var(--FormHelperText-lineHeight, ${t.vars.lineHeight.sm})`,color:`var(--FormHelperText-color, ${t.vars.palette.text.tertiary})`,margin:"var(--FormHelperText-margin, 0px)",[`.${bte.root} + &`]:{"--FormHelperText-margin":"0px"},[`.${Qx.error} &`]:{"--Icon-color":"currentColor"}})),pi=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyFormHelperText"}),{children:i,component:o,slots:a={},slotProps:s={}}=n,c=Fe(n,xte),u=R.useRef(null),d=Rn(u,r),h=R.useContext(Ea),p=h==null?void 0:h.setHelperText;R.useEffect(()=>(p==null||p(u.current),()=>{p==null||p(null)}),[p]);const f=wte(),g=j({},c,{component:o,slots:a,slotProps:s}),[m,v]=Se("root",{ref:d,elementType:Cte,externalForwardedProps:g,ownerState:n,additionalProps:{as:o,id:h==null?void 0:h["aria-describedby"]},className:f.root});return E.jsx(m,j({},v,{children:i}))}),Ite=["children","component","htmlFor","id","slots","slotProps"],Ste=()=>nt({root:["root"],asterisk:["asterisk"]},yte,{}),_te=xe("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:t.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${t.vars.fontSize.sm})`,fontWeight:t.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${t.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${t.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),Tte=xe("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})({color:"var(--FormLabel-asteriskColor)"}),Pt=R.forwardRef(function(e,r){var n,i;const o=Ze({props:e,name:"JoyFormLabel"}),{children:a,component:s="label",htmlFor:c,id:u,slots:d={},slotProps:h={}}=o,p=Fe(o,Ite),f=R.useContext(Ea),g=(n=(i=e.required)!=null?i:f==null?void 0:f.required)!=null?n:!1,m=j({},o,{required:g}),v=Ste(),b=j({},p,{component:s,slots:d,slotProps:h}),[x,y]=Se("root",{additionalProps:{htmlFor:c!=null?c:f==null?void 0:f.htmlFor,id:u!=null?u:f==null?void 0:f.labelId},ref:r,className:v.root,elementType:_te,externalForwardedProps:b,ownerState:m}),[C,w]=Se("asterisk",{additionalProps:{"aria-hidden":!0},className:v.asterisk,elementType:Tte,externalForwardedProps:b,ownerState:m});return E.jsxs(x,j({},y,{children:[a,g&&E.jsxs(C,j({},w,{children:[" ","*"]}))]}))}),yr=P9({createStyledComponent:xe("div",{name:"JoyGrid",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>Ze({props:t,name:"JoyGrid"})});function kte(t){return et("MuiLink",t)}const HO=tt("MuiLink",["root","disabled","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","variantPlain","variantOutlined","variantSoft","variantSolid","underlineNone","underlineHover","underlineAlways","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","startDecorator","endDecorator"]),Ate=["color","textColor","variant"],Pte=["children","disabled","onBlur","onFocus","level","overlay","underline","endDecorator","startDecorator","component","slots","slotProps"],Ete=t=>{const{level:e,color:r,variant:n,underline:i,focusVisible:o,disabled:a}=t,s={root:["root",r&&`color${ke(r)}`,a&&"disabled",o&&"focusVisible",e,i&&`underline${ke(i)}`,n&&`variant${ke(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(s,kte,{})},Ote=xe("span",{name:"JoyLink",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})(({ownerState:t})=>{var e;return j({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Link-gap, 0.375em), 0.75rem)"},typeof t.startDecorator!="string"&&(t.alignItems==="flex-start"||((e=t.sx)==null?void 0:e.alignItems)==="flex-start")&&{marginTop:"2px"})}),Rte=xe("span",{name:"JoyLink",slot:"endDecorator",overridesResolver:(t,e)=>e.endDecorator})(({ownerState:t})=>{var e;return j({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Link-gap, 0.25em), 0.5rem)"},typeof t.startDecorator!="string"&&(t.alignItems==="flex-start"||((e=t.sx)==null?void 0:e.alignItems)==="flex-start")&&{marginTop:"2px"})}),Mte=xe("a",{name:"JoyLink",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i,o,a,s,c;return[j({"--Icon-fontSize":"1.25em","--Icon-color":"currentColor","--CircularProgress-size":"1.25em","--CircularProgress-thickness":"3px"},e.level&&e.level!=="inherit"&&t.typography[e.level],e.level==="inherit"&&{font:"inherit"},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{"@media (hover: hover)":{textDecorationLine:"underline"}}},e.underline==="always"&&{textDecoration:"underline"},e.startDecorator&&{verticalAlign:"bottom"},{textDecorationThickness:"max(0.08em, 1px)",textUnderlineOffset:"0.15em",display:"inline-flex",alignItems:"center",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:t.vars.radius.xs,padding:0,cursor:"pointer",textDecorationColor:`var(--variant-outlinedBorder, rgba(${(r=t.vars.palette[e.color])==null?void 0:r.mainChannel} / var(--Link-underlineOpacity, 0.72)))`},e.variant?j({paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!e.nesting&&{marginInline:"-0.25em"}):{color:`var(--variant-plainColor, rgba(${(n=t.vars.palette[e.color])==null?void 0:n.mainChannel} / 1))`,[`&.${HO.disabled}`]:{pointerEvents:"none",color:`var(--variant-plainDisabledColor, rgba(${(i=t.vars.palette[e.color])==null?void 0:i.mainChannel} / 0.6))`}},{userSelect:e.component==="button"?"none":void 0,MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"}},e.overlay?{position:"initial","&::after":{content:'""',display:"block",position:"absolute",top:0,left:0,bottom:0,right:0,borderRadius:"var(--unstable_actionRadius, inherit)",margin:"var(--unstable_actionMargin)"},[`${t.focus.selector}`]:{"&::after":t.focus.default}}:{position:"relative",[t.focus.selector]:t.focus.default}),e.variant&&j({},(o=t.variants[e.variant])==null?void 0:o[e.color],{"&:hover":{"@media (hover: hover)":(a=t.variants[`${e.variant}Hover`])==null?void 0:a[e.color]},"&:active":(s=t.variants[`${e.variant}Active`])==null?void 0:s[e.color],[`&.${HO.disabled}`]:(c=t.variants[`${e.variant}Disabled`])==null?void 0:c[e.color]})]}),Ps=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyLink"}),{color:i="primary",textColor:o,variant:a}=n,s=Fe(n,Ate),c=R.useContext(Zu),u=R.useContext(Yx),d=$u(j({},s,{color:o})),{children:h,disabled:p=!1,onBlur:f,onFocus:g,level:m="body-md",overlay:v=!1,underline:b="hover",endDecorator:x,startDecorator:y,component:C,slots:w={},slotProps:I={}}=d,_=Fe(d,Pte),T=c||u?e.level||"inherit":m,{isFocusVisibleRef:O,onBlur:P,onFocus:k,ref:S}=hE(),[M,$]=R.useState(!1),D=Rn(r,S),N=Q=>{P(Q),O.current===!1&&$(!1),f&&f(Q)},z=Q=>{k(Q),O.current===!0&&$(!0),g&&g(Q)},U=j({},d,{color:i,disabled:p,focusVisible:M,underline:b,variant:a,level:T,overlay:v,nesting:c}),V=Ete(U),q=j({},_,{component:C,slots:w,slotProps:I}),[F,B]=Se("root",{additionalProps:{onBlur:N,onFocus:z},ref:D,className:V.root,elementType:Mte,externalForwardedProps:q,ownerState:U}),[H,G]=Se("startDecorator",{className:V.startDecorator,elementType:Ote,externalForwardedProps:q,ownerState:U}),[Z,Y]=Se("endDecorator",{className:V.endDecorator,elementType:Rte,externalForwardedProps:q,ownerState:U});return E.jsx(Zu.Provider,{value:!0,children:E.jsxs(F,j({},B,{children:[y&&E.jsx(H,j({},G,{children:y})),kl(h,["Skeleton"])?R.cloneElement(h,{variant:h.props.variant||"inline"}):h,x&&E.jsx(Z,j({},Y,{children:x}))]}))})});function Dte(t){return et("MuiListDivider",t)}tt("MuiListDivider",["root","insetGutter","insetStartDecorator","insetStartContent","horizontal","vertical"]);const $te=["component","role","className","children","inset","orientation","slots","slotProps"],Lte=t=>{const{orientation:e,inset:r}=t,n={root:["root",e,r&&r!=="context"&&`inset${ke(r)}`]};return nt(n,Dte,{})},Fte=xe(zO,{name:"JoyListDivider",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({},t.inset==="context"&&{"--Divider-inset":"calc(-1 * var(--List-padding))"},t.row&&j({marginInline:"var(--ListDivider-gap)"},t.inset==="gutter"&&{marginBlock:"var(--ListItem-paddingY)"},t["data-first-child"]===void 0&&{marginInlineStart:"calc(var(--List-gap) + var(--ListDivider-gap))"}),!t.row&&j({},t["data-first-child"]===void 0&&{marginBlockStart:"calc(var(--List-gap) + var(--ListDivider-gap))"},{marginBlockEnd:"var(--ListDivider-gap)"},t.inset==="gutter"&&{marginInlineStart:"var(--ListItem-paddingLeft)",marginInlineEnd:"var(--ListItem-paddingRight)"},t.inset==="startDecorator"&&{marginInlineStart:"var(--ListItem-paddingLeft)"},t.inset==="startContent"&&{marginInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItemDecorator-size))"}))),Nte=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListDivider"}),i=R.useContext(Ml),o=R.useContext(Lx),{component:a,role:s,className:c,children:u,inset:d="context",orientation:h,slots:p={},slotProps:f={}}=n,g=Fe(n,$te),[m]=(o==null?void 0:o.split(":"))||["",""],v=a||(m&&!m.match(/^(ul|ol|menu)$/)?"div":"li"),b=s||(v==="li"?"separator":void 0),x=h||(i?"vertical":"horizontal"),y=j({},n,{inset:d,row:i,orientation:x,component:v,role:b}),C=Lte(y),w=j({},g,{component:v,slots:p,slotProps:f}),[I,_]=Se("root",{ref:r,className:ft(C.root,c),elementType:Fte,externalForwardedProps:w,ownerState:y,additionalProps:j({as:v,role:b},b==="separator"&&x==="vertical"&&{"aria-orientation":"vertical"})});return E.jsx(I,j({},_,{children:u}))});function jte(t){return et("MuiListItemDecorator",t)}tt("MuiListItemDecorator",["root"]);const Bte=["component","className","children","slots","slotProps"],zte=()=>nt({root:["root"]},jte,{}),Ute=xe("span",{name:"JoyListItemDecorator",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({boxSizing:"border-box",display:"inline-flex",alignItems:`var(--unstable_ListItemDecorator-alignItems, ${t.parentOrientation==="horizontal"?"center":"initial"})`},t.parentOrientation==="horizontal"?{minInlineSize:"var(--ListItemDecorator-size)",marginInlineEnd:"calc(-1 * var(--ListItem-gap))"}:{minBlockSize:"var(--ListItemDecorator-size)",justifyContent:"center",marginBlockEnd:"calc(-1 * var(--ListItem-gap))"})),rd=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListItemDecorator"}),{component:i,className:o,children:a,slots:s={},slotProps:c={}}=n,u=Fe(n,Bte),d=R.useContext(Ux),h=j({parentOrientation:d},n),p=zte(),f=j({},u,{component:i,slots:s,slotProps:c}),[g,m]=Se("root",{ref:r,className:ft(p.root,o),elementType:Ute,externalForwardedProps:f,ownerState:h});return E.jsx(g,j({},m,{children:a}))});function Hte(t){return et("MuiMenu",t)}tt("MuiMenu",["root","listbox","expanded","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const Vte=["actions","children","color","component","disablePortal","keepMounted","id","invertedColors","onItemsChange","modifiers","variant","size","slots","slotProps"],Wte=t=>{const{open:e,variant:r,color:n,size:i}=t,o={root:["root",e&&"expanded",r&&`variant${ke(r)}`,n&&`color${ke(n)}`,i&&`size${ke(i)}`],listbox:["listbox"]};return nt(o,Hte,{})},VO=xe($l,{name:"JoyMenu",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;const i=(r=t.variants[e.variant])==null?void 0:r[e.color];return[j({"--focus-outline-offset":`calc(${t.vars.focus.thickness} * -1)`,"--ListItem-stickyBackground":(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Rf,{borderRadius:`var(--List-radius, ${t.vars.radius.sm})`,boxShadow:t.shadow.md,overflow:"auto",zIndex:`var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`},!(i!=null&&i.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup},e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(n=t.variants[e.variant])==null?void 0:n[e.color])]}),WO=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyMenu"}),{actions:o,children:a,color:s="neutral",component:c,disablePortal:u=!1,keepMounted:d=!1,id:h,invertedColors:p=!1,onItemsChange:f,modifiers:g,variant:m="outlined",size:v="md",slots:b={},slotProps:x={}}=i,y=Fe(i,Vte),{contextValue:C,getListboxProps:w,dispatch:I,open:_,triggerElement:T}=mK({onItemsChange:f,id:h,listboxRef:r});R.useImperativeHandle(o,()=>({dispatch:I,resetHighlight:()=>I({type:Zt.resetHighlight,event:null})}),[I]);const O=j({},i,{disablePortal:u,invertedColors:p,color:s,variant:m,size:v,open:_,nesting:!1,row:!1}),P=Wte(O),k=j({},y,{component:c,slots:b,slotProps:x}),S=R.useMemo(()=>[{name:"offset",options:{offset:[0,4]}},...g||[]],[g]),M=SE({elementType:VO,getSlotProps:w,externalForwardedProps:k,externalSlotProps:{},ownerState:O,additionalProps:{anchorEl:T,open:_&&T!==null,disablePortal:u,keepMounted:d,modifiers:S},className:P.root});return E.jsx(VO,j({},M,!((n=i.slots)!=null&&n.root)&&{as:bf,slots:{root:c||"ul"}},{children:E.jsx(gK,{value:C,children:E.jsx(Ff,{variant:p?void 0:m,color:s,children:E.jsx(Of.Provider,{value:"menu",children:E.jsx(Dl,{nested:!0,children:a})})})})}))});function qte(t){return et("MuiMenuButton",t)}tt("MuiMenuButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);const Gte=["children","color","component","disabled","endDecorator","loading","loadingPosition","loadingIndicator","size","slotProps","slots","startDecorator","variant"],Yte=t=>{const{color:e,disabled:r,fullWidth:n,size:i,variant:o,loading:a}=t,s={root:["root",r&&"disabled",n&&"fullWidth",o&&`variant${ke(o)}`,e&&`color${ke(e)}`,i&&`size${ke(i)}`,a&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]};return nt(s,qte,{})},Kte=xe("button",{name:"JoyMenuButton",slot:"Root",overridesResolver:(t,e)=>e.root})(LO),Jte=xe("span",{name:"JoyMenuButton",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Qte=xe("span",{name:"JoyMenuButton",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),Xte=xe("span",{name:"JoyMenuButton",slot:"LoadingCenter",overridesResolver:(t,e)=>e.loadingIndicatorCenter})(({theme:t,ownerState:e})=>{var r,n;return j({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color},e.disabled&&{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color})}),qO=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyMenuButton"}),{children:o,color:a="neutral",component:s,disabled:c=!1,endDecorator:u,loading:d=!1,loadingPosition:h="center",loadingIndicator:p,size:f="md",slotProps:g={},slots:m={},startDecorator:v,variant:b="outlined"}=i,x=Fe(i,Gte),y=R.useContext(Nf),C=e.variant||y.variant||b,w=e.size||y.size||f,I=(n=e.disabled)!=null?n:y.disabled||c||d,{getRootProps:_,open:T,active:O}=yK({rootRef:r,disabled:I}),P=p!=null?p:E.jsx(Kn,{color:a,thickness:{sm:2,md:3,lg:4}[w]||3}),k=j({},i,{active:O,color:a,disabled:I,open:T,size:w,variant:C}),S=Yte(k),M=j({},x,{component:s,slots:m,slotProps:g}),[$,D]=Se("root",{elementType:Kte,getSlotProps:_,externalForwardedProps:M,ref:r,ownerState:k,className:S.root}),[N,z]=Se("startDecorator",{className:S.startDecorator,elementType:Jte,externalForwardedProps:M,ownerState:k}),[U,V]=Se("endDecorator",{className:S.endDecorator,elementType:Qte,externalForwardedProps:M,ownerState:k}),[q,F]=Se("loadingIndicatorCenter",{className:S.loadingIndicatorCenter,elementType:Xte,externalForwardedProps:M,ownerState:k});return E.jsxs($,j({},D,{children:[(v||d&&h==="start")&&E.jsx(N,j({},z,{children:d&&h==="start"?P:v})),o,d&&h==="center"&&E.jsx(q,j({},F,{children:P})),(u||d&&h==="end")&&E.jsx(U,j({},V,{children:d&&h==="end"?P:u}))]}))});function Zte(t){return et("MuiMenuItem",t)}tt("MuiMenuItem",["root","focusVisible","disabled","selected","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const ere=["children","disabled","component","selected","color","orientation","variant","slots","slotProps","id"],tre=t=>{const{focusVisible:e,disabled:r,selected:n,color:i,variant:o}=t,a={root:["root",e&&"focusVisible",r&&"disabled",n&&"selected",i&&`color${ke(i)}`,o&&`variant${ke(o)}`]};return nt(a,Zte,{})},rre=xe(Ll,{name:"JoyMenuItem",slot:"Root",overridesResolver:(t,e)=>e.root})({}),nre=R.memo(R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyMenuItem"}),i=R.useContext(Ml),{children:o,disabled:a=!1,component:s="li",selected:c=!1,color:u="neutral",orientation:d="horizontal",variant:h="plain",slots:p={},slotProps:f={},id:g}=n,m=Fe(n,ere),{variant:v=h,color:b=u}=Lf(e.variant,e.color),{getRootProps:x,disabled:y,focusVisible:C}=wK({id:g,disabled:a,rootRef:r}),w=j({},n,{component:s,color:b,disabled:y,focusVisible:C,orientation:d,selected:c,row:i,variant:v}),I=tre(w),_=j({},m,{component:s,slots:p,slotProps:f}),[T,O]=Se("root",{ref:r,elementType:rre,getSlotProps:x,externalForwardedProps:_,className:I.root,ownerState:w});return E.jsx(Ux.Provider,{value:d,children:E.jsx(T,j({},O,{children:o}))})})),Xx=R.forwardRef(function(e,r){const{contextValue:n,id:i}=CK(e.id);return E.jsx(_a.Provider,{value:n,children:E.jsx(nre,j({},e,{id:i,ref:r}))})});function ire(t){return et("MuiModalClose",t)}tt("MuiModalClose",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);var GO;const ore=["component","color","variant","size","onClick","slots","slotProps"],are=t=>{const{variant:e,color:r,disabled:n,focusVisible:i,size:o}=t,a={root:["root",n&&"disabled",i&&"focusVisible",e&&`variant${ke(e)}`,r&&`color${ke(r)}`,o&&`size${ke(o)}`]};return nt(a,ire,{})},sre=xe(Xu,{name:"JoyModalClose",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{var r;return j({},t.size==="sm"&&{"--IconButton-size":"1.75rem"},t.size==="md"&&{"--IconButton-size":"2rem"},t.size==="lg"&&{"--IconButton-size":"2.25rem"},{position:"absolute",zIndex:1,top:"var(--ModalClose-inset, 0.625rem)",right:"var(--ModalClose-inset, 0.625rem)",borderRadius:`var(--ModalClose-radius, ${e.vars.radius.sm})`},!((r=e.variants[t.variant])!=null&&(r=r[t.color])!=null&&r.backgroundColor)&&{color:e.vars.palette.text.secondary})}),lre={plain:"plain",outlined:"plain",soft:"soft",solid:"solid"},YO=R.forwardRef(function(e,r){var n,i,o,a,s,c;const u=Ze({props:e,name:"JoyModalClose"}),{component:d="button",color:h="neutral",variant:p="plain",size:f="md",onClick:g,slots:m={},slotProps:v={}}=u,b=Fe(u,ore),x=R.useContext(UO),y=R.useContext(Bf),C=(n=(i=e.variant)!=null?i:lre[y==null?void 0:y.variant])!=null?n:p,w=(o=(a=e.color)!=null?a:y==null?void 0:y.color)!=null?o:h,I=R.useContext(Jx),_=(s=(c=e.size)!=null?c:I)!=null?s:f,{focusVisible:T,getRootProps:O}=ao(j({},u,{rootRef:r})),P=j({},u,{color:w,component:d,variant:C,size:_,focusVisible:T}),k=are(P),[S,M]=Se("root",{ref:r,elementType:sre,getSlotProps:O,externalForwardedProps:j({onClick:$=>{x==null||x($,"closeClick"),g==null||g($)}},b,{component:d,slots:m,slotProps:v}),className:k.root,ownerState:P});return E.jsx(S,j({},M,{children:GO||(GO=E.jsx(bO,{}))}))}),cre=["className","children","invertedColors","orientation","color","component","variant","size","layout","maxWidth","minWidth","slots","slotProps"],ure=t=>{const{variant:e,color:r,size:n,layout:i}=t,o={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`,n&&`size${ke(n)}`,i&&`layout${ke(i)}`]};return nt(o,kee,{})};function KO(t,e){var r,n;return e&&(r=t.breakpoints)!=null&&r.values[e]?`${(n=t.breakpoints)==null?void 0:n.values[e]}px`:e}const dre=xe(FO,{name:"JoyModalDialog",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({"--ModalDialog-minWidth":typeof e.minWidth=="number"?`${e.minWidth}px`:KO(t,e.minWidth),"--ModalDialog-maxWidth":typeof e.maxWidth=="number"?`${e.maxWidth}px`:KO(t,e.maxWidth),"--ModalClose-radius":"max((var(--Card-radius) - var(--variant-borderWidth, 0px)) - var(--ModalClose-inset), min(var(--ModalClose-inset) / 2, (var(--Card-radius) - var(--variant-borderWidth, 0px)) / 2))"},e.variant==="solid"&&{"--DialogContent-color":"currentColor"},e.size==="sm"&&{"--Card-padding":"1rem","--ModalDialog-titleOffset":t.spacing(.25),"--ModalDialog-descriptionOffset":t.spacing(.25),"--ModalClose-inset":"0.375rem"},e.size==="md"&&{"--Card-padding":"1.25rem","--ModalDialog-titleOffset":t.spacing(.25),"--ModalDialog-descriptionOffset":t.spacing(.75),"--ModalClose-inset":"0.5rem"},e.size==="lg"&&{"--Card-padding":"1.5rem","--ModalDialog-titleOffset":t.spacing(.5),"--ModalDialog-descriptionOffset":t.spacing(1),"--ModalClose-inset":"0.625rem"},{boxSizing:"border-box",boxShadow:t.shadow.md,minWidth:"min(calc(100vw - 2 * var(--Card-padding)), var(--ModalDialog-minWidth, 300px))",outline:0,position:"absolute"},e.layout==="fullscreen"&&{top:0,left:0,right:0,bottom:0,border:0,borderRadius:0},e.layout==="center"&&{top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"min(calc(100vw - 2 * var(--Card-padding)), var(--ModalDialog-maxWidth, 100vw))",maxHeight:"calc(100% - 2 * var(--Card-padding))"},{[`& [id="${e["aria-labelledby"]}"]`]:{"--Typography-margin":"calc(-1 * var(--ModalDialog-titleOffset)) 0 var(--ModalDialog-gap) 0","--Typography-fontSize":"1.125em",[`& + [id="${e["aria-describedby"]}"]`]:{"--unstable_ModalDialog-descriptionOffset":"calc(-1 * var(--ModalDialog-descriptionOffset))"}},[`& [id="${e["aria-describedby"]}"]`]:{"--Typography-fontSize":"1em","--Typography-margin":"var(--unstable_ModalDialog-descriptionOffset, var(--ModalDialog-gap)) 0 0 0","&:not(:last-child)":{"--Typography-margin":"var(--unstable_ModalDialog-descriptionOffset, var(--ModalDialog-gap)) 0 var(--ModalDialog-gap) 0"}}})),Es=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyModalDialog"}),{className:i,children:o,invertedColors:a=!1,orientation:s="vertical",color:c="neutral",component:u="div",variant:d="outlined",size:h="md",layout:p="center",maxWidth:f,minWidth:g,slots:m={},slotProps:v={}}=n,b=Fe(n,cre),x=j({},n,{color:c,component:u,maxWidth:f,minWidth:g,layout:p,size:h,variant:d,invertedColors:a}),y=ure(x),C=j({},b,{component:u,slots:m,slotProps:v}),w=Ia(),I=Ia(),_=R.useMemo(()=>({variant:d,color:c,labelledBy:w,describedBy:I}),[c,d,w,I]),[T,O]=Se("root",{ref:r,className:ft(y.root,i),elementType:dre,externalForwardedProps:C,ownerState:x,additionalProps:{as:u,role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":I}});return E.jsx(Jx.Provider,{value:h,children:E.jsx(Bf.Provider,{value:_,children:E.jsx(T,j({},O,{children:R.Children.map(o,(P,k)=>{if(!R.isValidElement(P))return P;const S={};if(kl(P,["Divider"])){var M,$;const D=P.props;S.inset=(M=D==null?void 0:D.inset)!=null?M:"context";const N=s==="vertical"?"horizontal":"vertical";S.orientation=($=D==null?void 0:D.orientation)!=null?$:N}return k===0&&(S["data-first-child"]=""),k===R.Children.count(o)-1&&(S["data-last-child"]=""),R.cloneElement(P,S)})}))})})});function hre(t){return et("MuiOption",t)}const pre=tt("MuiOption",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","highlighted","variantPlain","variantSoft","variantOutlined","variantSolid"]),fre=["component","children","disabled","value","label","variant","color","slots","slotProps"],mre=t=>{const{disabled:e,highlighted:r,selected:n}=t;return nt({root:["root",e&&"disabled",r&&"highlighted",n&&"selected"]},hre,{})},gre=xe(Ll,{name:"JoyOption",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;const n=(r=t.variants[`${e.variant}Hover`])==null?void 0:r[e.color];return{[`&.${pre.highlighted}:not([aria-selected="true"])`]:{backgroundColor:n==null?void 0:n.backgroundColor}}}),vre=R.memo(R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyOption"}),{component:o="li",children:a,disabled:s=!1,value:c,label:u,variant:d="plain",color:h="neutral",slots:p={},slotProps:f={}}=i,g=Fe(i,fre),m=R.useContext(Ml),{variant:v=d,color:b=h}=Lf(e.variant,e.color),x=R.useRef(null),y=Rn(x,r),C=u!=null?u:typeof a=="string"?a:(n=x.current)==null?void 0:n.innerText,{getRootProps:w,selected:I,highlighted:_,index:T}=RK({disabled:s,label:C,value:c,rootRef:y}),O=j({},i,{disabled:s,selected:I,highlighted:_,index:T,component:o,variant:v,color:b,row:m}),P=mre(O),k=j({},g,{component:o,slots:p,slotProps:f}),[S,M]=Se("root",{ref:r,getSlotProps:w,elementType:gre,externalForwardedProps:k,className:P.root,ownerState:O});return E.jsx(S,j({},M,{children:a}))})),qt=R.forwardRef(function(e,r){const{contextValue:n}=MK(e.value);return E.jsx(_a.Provider,{value:n,children:E.jsx(vre,j({},e,{ref:r}))})}),yre=Aa(E.jsx("path",{d:"m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z"}),"Unfold");function bre(t){return et("MuiSelect",t)}const co=tt("MuiSelect",["root","button","indicator","startDecorator","endDecorator","popper","listbox","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","focusVisible","disabled","expanded","multiple"]);var JO;const xre=["action","autoFocus","children","defaultValue","defaultListboxOpen","disabled","getSerializedValue","placeholder","listboxId","listboxOpen","onChange","onListboxOpenChange","onClose","renderValue","required","value","size","variant","color","startDecorator","endDecorator","indicator","aria-describedby","aria-label","aria-labelledby","id","name","multiple","slots","slotProps"];function wre(t){var e;return Array.isArray(t)?E.jsx(R.Fragment,{children:t.map(r=>r.label).join(", ")}):(e=t==null?void 0:t.label)!=null?e:""}const Cre=[{name:"offset",options:{offset:[0,4]}},{name:"equalWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`}}],Ire=t=>{const{color:e,disabled:r,focusVisible:n,size:i,variant:o,open:a,multiple:s}=t,c={root:["root",r&&"disabled",n&&"focusVisible",a&&"expanded",o&&`variant${ke(o)}`,e&&`color${ke(e)}`,i&&`size${ke(i)}`,s&&"multiple"],button:["button"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],indicator:["indicator",a&&"expanded"],listbox:["listbox",a&&"expanded",r&&"disabled"]};return nt(c,bre,{})},Sre=xe("div",{name:"JoySelect",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i,o,a;const s=(r=t.variants[`${e.variant}`])==null?void 0:r[e.color],{borderRadius:c}=Mo({theme:t,ownerState:e},["borderRadius"]);return[j({"--Select-radius":t.vars.radius.sm,"--Select-gap":"0.5rem","--Select-placeholderOpacity":.64,"--Select-decoratorColor":t.vars.palette.text.icon,"--Select-focusedThickness":t.vars.focus.thickness,"--Select-focusedHighlight":(n=t.vars.palette[e.color==="neutral"?"primary":e.color])==null?void 0:n[500],'&:not([data-inverted-colors="false"])':j({},e.instanceColor&&{"--_Select-focusedHighlight":(i=t.vars.palette[e.instanceColor==="neutral"?"primary":e.instanceColor])==null?void 0:i[500]},{"--Select-focusedHighlight":t.vars.palette.focusVisible}),"--Select-indicatorColor":s!=null&&s.backgroundColor?s==null?void 0:s.color:t.vars.palette.text.tertiary},e.size==="sm"&&{"--Select-minHeight":"2rem","--Select-paddingInline":"0.5rem","--Select-decoratorChildHeight":"min(1.5rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},e.size==="md"&&{"--Select-minHeight":"2.25rem","--Select-paddingInline":"0.75rem","--Select-decoratorChildHeight":"min(1.75rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},e.size==="lg"&&{"--Select-minHeight":"2.75rem","--Select-paddingInline":"1rem","--Select-decoratorChildHeight":"min(2.375rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--Select-decoratorChildOffset":"min(calc(var(--Select-paddingInline) - (var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2), var(--Select-paddingInline))","--_Select-paddingBlock":"max((var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2, 0px)","--Select-decoratorChildRadius":"max(var(--Select-radius) - var(--variant-borderWidth, 0px) - var(--_Select-paddingBlock), min(var(--_Select-paddingBlock) + var(--variant-borderWidth, 0px), var(--Select-radius) / 2))","--Button-minHeight":"var(--Select-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Select-decoratorChildHeight)","--Button-radius":"var(--Select-decoratorChildRadius)","--IconButton-radius":"var(--Select-decoratorChildRadius)",boxSizing:"border-box"},e.variant!=="plain"&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Select-minHeight)",position:"relative",display:"flex",alignItems:"center",borderRadius:"var(--Select-radius)",cursor:"pointer"},!(s!=null&&s.backgroundColor)&&{backgroundColor:t.vars.palette.background.surface},e.size&&{paddingBlock:{sm:2,md:3,lg:4}[e.size]},{paddingInline:"var(--Select-paddingInline)"},t.typography[`body-${e.size}`],s,{"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)"},[`&.${co.focusVisible}`]:{"--Select-indicatorColor":s==null?void 0:s.color,"&::before":{boxShadow:"inset 0 0 0 var(--Select-focusedThickness) var(--Select-focusedHighlight)"}},[`&.${co.disabled}`]:{"--Select-indicatorColor":"inherit"}}),{"&:hover":(o=t.variants[`${e.variant}Hover`])==null?void 0:o[e.color],[`&.${co.disabled}`]:(a=t.variants[`${e.variant}Disabled`])==null?void 0:a[e.color]},c!==void 0&&{"--Select-radius":c}]}),_re=xe("button",{name:"JoySelect",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({border:0,outline:0,background:"none",padding:0,fontSize:"inherit",color:"inherit",alignSelf:"stretch",display:"flex",alignItems:"center",flex:1,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap",overflow:"hidden"},(t.value===null||t.value===void 0)&&{opacity:"var(--Select-placeholderOpacity)"},{"&::before":{content:'""',display:"block",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",borderRadius:"var(--Select-radius)"}})),Tre=xe($l,{name:"JoySelect",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t,ownerState:e})=>{var r;const n=(r=t.variants[e.variant])==null?void 0:r[e.color];return j({"--focus-outline-offset":`calc(${t.vars.focus.thickness} * -1)`,"--ListItem-stickyBackground":(n==null?void 0:n.backgroundColor)||(n==null?void 0:n.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Rf,{minWidth:"max-content",maxHeight:"44vh",overflow:"auto",outline:0,boxShadow:t.shadow.md,borderRadius:`var(--List-radius, ${t.vars.radius.sm})`,zIndex:`var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`},!(n!=null&&n.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup})}),kre=xe("span",{name:"JoySelect",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Button-margin":"0 0 0 calc(var(--Select-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Select-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Select-paddingInline) / -4)",display:"inherit",alignItems:"center",color:"var(--Select-decoratorColor)",marginInlineEnd:"var(--Select-gap)"}),Are=xe("span",{name:"JoySelect",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--Button-margin":"0 calc(var(--Select-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Select-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Select-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",color:"var(--Select-decoratorColor)",marginInlineStart:"var(--Select-gap)"}),Pre=xe("span",{name:"JoySelect",slot:"Indicator"})(({ownerState:t,theme:e})=>j({},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2},{"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,display:"inherit",alignItems:"center",marginInlineStart:"var(--Select-gap)",marginInlineEnd:"calc(var(--Select-paddingInline) / -4)",[`.${co.endDecorator} + &`]:{marginInlineStart:"calc(var(--Select-gap) / 2)"},[`&.${co.expanded}, .${co.disabled} > &`]:{"--Icon-color":"currentColor"}})),br=R.forwardRef(function(e,r){var n,i,o,a,s,c,u;const d=Ze({props:e,name:"JoySelect"}),h=d,{action:p,autoFocus:f,children:g,defaultValue:m,defaultListboxOpen:v=!1,disabled:b,getSerializedValue:x,placeholder:y,listboxId:C,listboxOpen:w,onChange:I,onListboxOpenChange:_,onClose:T,renderValue:O,required:P=!1,value:k,size:S="md",variant:M="outlined",color:$="neutral",startDecorator:D,endDecorator:N,indicator:z=JO||(JO=E.jsx(yre,{})),"aria-describedby":U,"aria-label":V,"aria-labelledby":q,id:F,name:B,multiple:H=!1,slots:G={},slotProps:Z={}}=h,Y=Fe(h,xre),Q=R.useContext(Ea),K=(n=(i=e.disabled)!=null?i:Q==null?void 0:Q.disabled)!=null?n:b,X=(o=(a=e.size)!=null?a:Q==null?void 0:Q.size)!=null?o:S,ee=(s=e.color)!=null?s:Q!=null&&Q.error?"danger":(c=Q==null?void 0:Q.color)!=null?c:$,ae=O!=null?O:wre,[oe,Ce]=R.useState(null),be=R.useRef(null),ge=R.useRef(null),ve=Rn(r,be);R.useImperativeHandle(p,()=>({focusVisible:()=>{var ue;(ue=ge.current)==null||ue.focus()}}),[]),R.useEffect(()=>{Ce(be.current)},[]),R.useEffect(()=>{f&&ge.current.focus()},[f]);const fe=R.useCallback(ue=>{_==null||_(ue),ue||T==null||T()},[T,_]),{buttonActive:ne,buttonFocusVisible:le,contextValue:he,disabled:ye,getButtonProps:pe,getListboxProps:Le,getHiddenInputProps:He,getOptionMetadata:Ve,open:pt,value:ot}=QJ({buttonRef:ge,defaultOpen:v,defaultValue:m,disabled:K,getSerializedValue:x,listboxId:C,multiple:H,name:B,required:P,onChange:I,onOpenChange:fe,open:w,value:k}),we=j({},d,{active:ne,defaultListboxOpen:v,disabled:ye,focusVisible:le,open:pt,renderValue:ae,value:ot,size:X,variant:M,color:ee}),Ee=Ire(we),Ae=j({},Y,{slots:G,slotProps:Z}),We=R.useMemo(()=>{let ue;if(H)ue=ot.map(De=>Ve(De)).filter(De=>De!==void 0);else{var de;ue=(de=Ve(ot))!=null?de:null}return ue},[Ve,ot,H]),[Me,$e]=Se("root",{ref:ve,className:Ee.root,elementType:Sre,externalForwardedProps:Ae,ownerState:we}),[Je,Ge]=Se("button",{additionalProps:{"aria-describedby":U!=null?U:Q==null?void 0:Q["aria-describedby"],"aria-label":V,"aria-labelledby":q!=null?q:Q==null?void 0:Q.labelId,"aria-required":P?"true":void 0,id:F!=null?F:Q==null?void 0:Q.htmlFor,name:B},className:Ee.button,elementType:_re,externalForwardedProps:Ae,getSlotProps:pe,ownerState:we}),[Nt,It]=Se("listbox",{additionalProps:{anchorEl:oe,open:pt,placement:"bottom",keepMounted:!0},className:Ee.listbox,elementType:Tre,externalForwardedProps:Ae,getSlotProps:Le,ownerState:j({},we,{nesting:!1,row:!1,wrap:!1}),getSlotOwnerState:ue=>({size:ue.size||X,variant:ue.variant||M,color:ue.color||(ue.disablePortal?ee:$),disableColorInversion:!ue.disablePortal})}),[Br,hr]=Se("startDecorator",{className:Ee.startDecorator,elementType:kre,externalForwardedProps:Ae,ownerState:we}),[Ht,Ot]=Se("endDecorator",{className:Ee.endDecorator,elementType:Are,externalForwardedProps:Ae,ownerState:we}),[Tt,Mt]=Se("indicator",{className:Ee.indicator,elementType:Pre,externalForwardedProps:Ae,ownerState:we}),te=R.useMemo(()=>[...Cre,...It.modifiers||[]],[It.modifiers]);let ie=y;return(Array.isArray(We)&&We.length>0||!Array.isArray(We)&&We)&&(ie=ae(We)),E.jsxs(R.Fragment,{children:[E.jsxs(Me,j({},$e,{children:[D&&E.jsx(Br,j({},hr,{children:D})),E.jsx(Je,j({},Ge,{children:ie})),N&&E.jsx(Ht,j({},Ot,{children:N})),z&&E.jsx(Tt,j({},Mt,{children:z})),E.jsx("input",j({},He()))]})),oe&&E.jsx(Nt,j({},It,{className:ft(It.className),modifiers:te},!((u=d.slots)!=null&&u.listbox)&&{as:bf,slots:{root:It.as||"ul"}},{children:E.jsx(XJ,{value:he,children:E.jsx(Ff,{variant:M,color:$,children:E.jsx(Of.Provider,{value:"select",children:E.jsx(Dl,{nested:!0,children:g})})})})}))]})});function Ere(t){return et("MuiSheet",t)}tt("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const Ore=["className","color","component","variant","invertedColors","slots","slotProps"],Rre=t=>{const{variant:e,color:r}=t,n={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`]};return nt(n,Ere,{})},Mre=xe("div",{name:"JoySheet",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;const i=(r=t.variants[e.variant])==null?void 0:r[e.color],{borderRadius:o,bgcolor:a,backgroundColor:s,background:c}=Mo({theme:t,ownerState:e},["borderRadius","bgcolor","backgroundColor","background"]),u=Ca(t,`palette.${a}`)||a||Ca(t,`palette.${s}`)||s||c||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.surface;return[j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--ListItem-stickyBackground":u==="transparent"?"initial":u,"--Sheet-background":u==="transparent"?"initial":u},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:t.vars.palette.background.surface,position:"relative"}),j({},t.typography["body-md"],e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(n=t.variants[e.variant])==null?void 0:n[e.color],i)]}),zl=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:s="plain",invertedColors:c=!1,slots:u={},slotProps:d={}}=n,h=Fe(n,Ore),p=j({},n,{color:o,component:a,invertedColors:c,variant:s}),f=Rre(p),g=j({},h,{component:a,slots:u,slotProps:d}),[m,v]=Se("root",{ref:r,className:ft(f.root,i),elementType:Mre,externalForwardedProps:g,ownerState:p});return E.jsx(m,j({},v))});function Dre(t){return et("MuiSkeleton",t)}tt("MuiSkeleton",["root","variantOverlay","variantCircular","variantRectangular","variantText","variantInline","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs"]);const $re=["className","component","children","animation","overlay","loading","variant","level","height","width","sx","slots","slotProps"];let nd=t=>t,QO,XO,ZO,eR,tR;const Lre=t=>{const{variant:e,level:r}=t,n={root:["root",e&&`variant${ke(e)}`,r&&`level${ke(r)}`]};return nt(n,Dre,{})},rR=gs(QO||(QO=nd`
|
|
70
|
+
`),EX)),Kn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:s="md",variant:c="soft",thickness:u,determinate:d=!1,value:h=d?0:25,component:p,slots:f={},slotProps:g={}}=n,m=Fe(n,PX),v=j({},n,{color:a,size:s,variant:c,thickness:u,value:h,determinate:d,instanceSize:e.size}),b=OX(v),x=j({},m,{component:p,slots:f,slotProps:g}),[y,C]=Se("root",{ref:r,className:ft(b.root,o),elementType:RX,externalForwardedProps:x,ownerState:v,additionalProps:j({role:"progressbar",style:{"--CircularProgress-percent":h}},h&&d&&{"aria-valuenow":Math.round(typeof h=="number"?h:Number(h||0))})}),[w,I]=Se("svg",{className:b.svg,elementType:MX,externalForwardedProps:x,ownerState:v}),[_,T]=Se("track",{className:b.track,elementType:DX,externalForwardedProps:x,ownerState:v}),[O,P]=Se("progress",{className:b.progress,elementType:$X,externalForwardedProps:x,ownerState:v});return E.jsxs(y,j({},C,{children:[E.jsxs(w,j({},I,{children:[E.jsx(_,j({},T)),E.jsx(O,j({},P))]})),i]}))}),LX=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],FX=t=>{const{color:e,disabled:r,focusVisible:n,focusVisibleClassName:i,size:o,variant:a,loading:s}=t,c={root:["root",r&&"disabled",n&&"focusVisible",a&&`variant${ke(a)}`,e&&`color${ke(e)}`,o&&`size${ke(o)}`,s&&"loading"],loadingIndicator:["loadingIndicator"]},u=nt(c,_X,{});return n&&i&&(u.root+=` ${i}`),u},Xu=xe("button")(({theme:t,ownerState:e})=>{var r,n,i,o;return[j({"--Icon-margin":"initial","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon},e.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[e.instanceSize]},e.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:t.vars.fontSize.sm,paddingInline:"2px"},e.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:t.vars.fontSize.md,paddingInline:"0.25rem"},e.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:t.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${t.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[t.focus.selector]:j({"--Icon-color":"currentColor"},t.focus.default)}),j({},(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:hover":{"@media (hover: hover)":j({"--Icon-color":"currentColor"},(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color])},'&:active, &[aria-pressed="true"]':j({"--Icon-color":"currentColor"},(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color]),"&:disabled":(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]})]}),NX=xe(Xu,{name:"JoyIconButton",slot:"Root",overridesResolver:(t,e)=>e.root})({}),jX=xe("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(t,e)=>e.loadingIndicator})(({theme:t,ownerState:e})=>{var r,n;return j({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color},e.disabled&&{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color})}),ur=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyIconButton"}),{children:o,action:a,component:s="button",color:c="neutral",disabled:u,variant:d="plain",loading:h=!1,loadingIndicator:p,size:f="md",slots:g={},slotProps:m={}}=i,v=Fe(i,LX),b=R.useContext(Nf),x=R.useContext(wO),y=e.variant||b.variant||d,C=e.size||b.size||f,w=e.color||b.color||c,I=(n=e.loading||e.disabled)!=null?n:b.disabled||h||u,_=R.useRef(null),T=Rn(_,r),{focusVisible:O,setFocusVisible:P,getRootProps:k}=ao(j({},i,{disabled:I,rootRef:T})),S=p!=null?p:E.jsx(Kn,{color:w,thickness:{sm:2,md:3,lg:4}[C]||3});R.useImperativeHandle(a,()=>({focusVisible:()=>{var B;P(!0),(B=_.current)==null||B.focus()}}),[P]);const M=j({},i,{component:s,color:w,disabled:I,variant:y,loading:h,size:C,focusVisible:O,instanceSize:e.size}),$=FX(M),D=B=>{var H;let G=i.onClick;if(typeof m.root=="function"?G=m.root(M).onClick:m.root&&(G=m.root.onClick),(H=G)==null||H(B),x){var Z;(Z=x.onClick)==null||Z.call(x,B,i.value)}};let N=i["aria-pressed"];typeof m.root=="function"?N=m.root(M)["aria-pressed"]:m.root&&(N=m.root["aria-pressed"]),x!=null&&x.value&&(Array.isArray(x.value)?N=x.value.indexOf(i.value)!==-1:N=x.value===i.value);const z=j({},v,{component:s,slots:g,slotProps:m}),[U,V]=Se("root",{ref:r,className:$.root,elementType:NX,getSlotProps:k,externalForwardedProps:z,ownerState:M,additionalProps:{onClick:D,"aria-pressed":N}}),[q,F]=Se("loadingIndicator",{className:$.loadingIndicator,elementType:jX,externalForwardedProps:z,ownerState:M});return E.jsx(U,j({},V,{children:h?E.jsx(q,j({},F,{children:S})):o}))});ur.muiName="IconButton";function BX(t){return et("MuiChip",t)}const Gx=tt("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]),IO=R.createContext({disabled:void 0,variant:void 0,color:void 0}),zX=["children","className","color","onClick","disabled","size","variant","startDecorator","endDecorator","component","slots","slotProps"],UX=t=>{const{disabled:e,size:r,color:n,clickable:i,variant:o,focusVisible:a}=t,s={root:["root",e&&"disabled",n&&`color${ke(n)}`,r&&`size${ke(r)}`,o&&`variant${ke(o)}`,i&&"clickable"],action:["action",e&&"disabled",a&&"focusVisible"],label:["label",r&&`label${ke(r)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(s,BX,{})},HX=xe("div",{name:"JoyChip",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i;const o=(r=t.variants[e.variant])==null?void 0:r[e.color],{borderRadius:a}=Mo({theme:t,ownerState:e},["borderRadius"]);return[j({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--Icon-color":"currentColor","--unstable_actionRadius":"var(--_Chip-radius)"},e.size==="sm"&&{"--Chip-paddingInline":"0.375rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.sm,"--_Chip-minHeight":"var(--Chip-minHeight, 1.25rem)",gap:"3px"},e.size==="md"&&{"--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 0.25rem - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.md,"--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",gap:"0.25rem"},e.size==="lg"&&{"--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 0.375rem - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.lg,"--_Chip-minHeight":"var(--Chip-minHeight, 1.75rem)",gap:"0.375rem"},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",maxWidth:"max-content",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box"},t.typography[`body-${{sm:"xs",md:"sm",lg:"md"}[e.size]}`],{fontWeight:t.vars.fontWeight.md,[`&.${Gx.disabled}`]:{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color}}),...e.clickable?[{"--variant-borderWidth":"0px",color:o==null?void 0:o.color}]:[j({backgroundColor:t.vars.palette.background.surface},o,{[`&.${Gx.disabled}`]:(i=t.variants[`${e.variant}Disabled`])==null?void 0:i[e.color]})],a!==void 0&&{"--_Chip-radius":a}]}),VX=xe("span",{name:"JoyChip",slot:"Label",overridesResolver:(t,e)=>e.label})(({ownerState:t})=>j({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},t.clickable&&{zIndex:1,pointerEvents:"none"})),WX=xe("button",{name:"JoyChip",slot:"Action",overridesResolver:(t,e)=>e.action})(({theme:t,ownerState:e})=>{var r,n,i,o;return[{"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,width:"100%",border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[t.focus.selector]:t.focus.default},j({backgroundColor:t.vars.palette.background.surface},(r=t.variants[e.variant])==null?void 0:r[e.color]),{"&:hover":{"@media (hover: hover)":(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color]}},{"&:active":(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color]},{[`&.${Gx.disabled}`]:(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]}]}),qX=xe("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--IconButton-margin":"0 calc(-1 * var(--Chip-paddingInline) / 3) 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",order:0,zIndex:1,pointerEvents:"none"}),GX=xe("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--IconButton-margin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 calc(-1 * var(--Chip-paddingInline) / 3)","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",order:2,zIndex:1,pointerEvents:"none"}),dn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyChip"}),{children:i,className:o,color:a="neutral",onClick:s,disabled:c=!1,size:u="md",variant:d="soft",startDecorator:h,endDecorator:p,component:f,slots:g={},slotProps:m={}}=n,v=Fe(n,zX),b=!!s||!!m.action,x=j({},n,{disabled:c,size:u,color:a,variant:d,clickable:b,focusVisible:!1}),y=typeof m.action=="function"?m.action(x):m.action,C=R.useRef(null),{focusVisible:w,getRootProps:I}=ao(j({},y,{disabled:c,rootRef:C}));x.focusVisible=w;const _=UX(x),T=j({},v,{component:f,slots:g,slotProps:m}),[O,P]=Se("root",{ref:r,className:ft(_.root,o),elementType:HX,externalForwardedProps:T,ownerState:x}),[k,S]=Se("label",{className:_.label,elementType:VX,externalForwardedProps:T,ownerState:x}),M=Ia(S.id),[$,D]=Se("action",{className:_.action,elementType:WX,externalForwardedProps:T,ownerState:x,getSlotProps:I,additionalProps:{"aria-labelledby":M,as:y==null?void 0:y.component,onClick:s}}),[N,z]=Se("startDecorator",{className:_.startDecorator,elementType:qX,externalForwardedProps:T,ownerState:x}),[U,V]=Se("endDecorator",{className:_.endDecorator,elementType:GX,externalForwardedProps:T,ownerState:x}),q=R.useMemo(()=>({disabled:c}),[c]);return E.jsx(IO.Provider,{value:q,children:E.jsx(Ff,{variant:d,color:a,children:E.jsxs(O,j({},P,{children:[b&&E.jsx($,j({},D)),E.jsx(k,j({},S,{id:M,children:i})),h&&E.jsx(N,j({},z,{children:h})),p&&E.jsx(U,j({},V,{children:p}))]}))})})}),YX=Aa(E.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Cancel");function KX(t){return et("MuiChipDelete",t)}tt("MuiChipDelete",["root","disabled","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSolid","variantSoft","variantOutlined"]);var SO;const JX=["children","variant","color","disabled","onKeyDown","onDelete","onClick","component","slots","slotProps"],QX=["onDelete"],XX=t=>{const{focusVisible:e,variant:r,color:n,disabled:i}=t,o={root:["root",i&&"disabled",e&&"focusVisible",r&&`variant${ke(r)}`,n&&`color${ke(n)}`]};return nt(o,KX,{})},ZX=xe(Xu,{name:"JoyChipDelete",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({"--IconButton-size":"var(--Chip-deleteSize, 2rem)","--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.3)",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:t.vars.fontSize.sm,paddingInline:"2px",pointerEvents:"visible",borderRadius:"var(--Chip-deleteRadius, 50%)",zIndex:1,padding:0})),Pa=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyChipDelete"}),{children:i,variant:o="plain",color:a="neutral",disabled:s,onKeyDown:c,onDelete:u,onClick:d,component:h,slots:p={},slotProps:f={}}=n,g=Fe(n,JX),m=R.useContext(IO),{variant:v=o,color:b=a}=Lf(e.variant,e.color,!0),x=e.color||b,y=s!=null?s:m.disabled,C=R.useRef(null),w=Rn(C,r),{focusVisible:I,getRootProps:_}=ao(j({},n,{disabled:y,rootRef:w})),T=j({},n,{disabled:y,variant:v,color:x,focusVisible:I}),O=XX(T),P=j({},g,{component:h,slots:p,slotProps:f}),k=N=>{!y&&u&&u(N),d&&d(N)},S=N=>{["Backspace","Enter","Delete"].includes(N.key)&&(N.preventDefault(),!y&&u&&u(N)),c&&c(N)},[M,$]=Se("root",{ref:r,elementType:ZX,getSlotProps:_,externalForwardedProps:P,ownerState:T,additionalProps:{as:h,onKeyDown:S,onClick:k},className:O.root}),D=Fe($,QX);return E.jsx(M,j({},D,{children:i!=null?i:SO||(SO=E.jsx(YX,{}))}))});function eZ(t){return et("MuiInput",t)}const _O=tt("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),Ea=R.createContext(void 0),tZ=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function TO(t,e){var r;const n=R.useContext(Ea),{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:s,autoFocus:c,className:u,defaultValue:d,disabled:h,disabledInProp:p,error:f,id:g,name:m,onClick:v,onChange:b,onKeyDown:x,onKeyUp:y,onFocus:C,onBlur:w,placeholder:I,readOnly:_,required:T,type:O,value:P}=t,k=Fe(t,tZ),{getRootProps:S,getInputProps:M,focused:$,error:D,disabled:N}=YY({disabled:(r=p!=null?p:n==null?void 0:n.disabled)!=null?r:h,defaultValue:d,error:f,onBlur:w,onClick:v,onChange:b,onFocus:C,required:T!=null?T:n==null?void 0:n.required,value:P}),z={[e.disabled]:N,[e.error]:D,[e.focused]:$,[e.formControl]:!!n,[u]:u},U={[e.disabled]:N};return j({formControl:n,propsToForward:{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:s,autoFocus:c,disabled:N,id:g,onKeyDown:x,onKeyUp:y,name:m,placeholder:I,readOnly:_,type:O},rootStateClasses:z,inputStateClasses:U,getRootProps:S,getInputProps:M,focused:$,error:D,disabled:N},k)}const rZ=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],nZ=t=>{const{disabled:e,fullWidth:r,variant:n,color:i,size:o}=t,a={root:["root",e&&"disabled",r&&"fullWidth",n&&`variant${ke(n)}`,i&&`color${ke(i)}`,o&&`size${ke(o)}`],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(a,eZ,{})},kO=xe("div")(({theme:t,ownerState:e})=>{var r,n,i,o,a,s;const c=(r=t.variants[`${e.variant}`])==null?void 0:r[e.color];return[j({"--Input-radius":t.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":t.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":t.vars.focus.thickness,"--Input-focusedHighlight":(n=t.vars.palette[e.color==="neutral"?"primary":e.color])==null?void 0:n[500],[`&:not([${Fl}])`]:j({},e.instanceColor&&{"--_Input-focusedHighlight":(i=t.vars.palette[e.instanceColor==="neutral"?"primary":e.instanceColor])==null?void 0:i[500]},{"--Input-focusedHighlight":`var(--_Input-focusedHighlight, ${t.vars.palette.focusVisible})`})},e.size==="sm"&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},e.size==="md"&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},e.size==="lg"&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},e.variant!=="plain"&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},e.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},t.typography[`body-${e.size}`],c,{backgroundColor:(o=c==null?void 0:c.backgroundColor)!=null?o:t.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":j({},(a=t.variants[`${e.variant}Hover`])==null?void 0:a[e.color],{backgroundColor:null}),[`&.${_O.disabled}`]:(s=t.variants[`${e.variant}Disabled`])==null?void 0:s[e.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),AO=xe("input")(({ownerState:t})=>({border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":j({paddingInline:"var(--Input-paddingInline)"},!t.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!t.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}})),PO=xe("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),EO=xe("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),iZ=xe(kO,{name:"JoyInput",slot:"Root",overridesResolver:(t,e)=>e.root})({}),oZ=xe(AO,{name:"JoyInput",slot:"Input",overridesResolver:(t,e)=>e.input})({}),aZ=xe(PO,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({}),sZ=xe(EO,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({}),Do=R.forwardRef(function(e,r){var n,i,o,a,s,c;const u=Ze({props:e,name:"JoyInput"}),d=TO(j({},u,{disabledInProp:e.disabled}),_O),{propsToForward:h,rootStateClasses:p,inputStateClasses:f,getRootProps:g,getInputProps:m,formControl:v,focused:b,error:x=!1,disabled:y,fullWidth:C=!1,size:w="md",color:I="neutral",variant:_="outlined",startDecorator:T,endDecorator:O,component:P,slots:k={},slotProps:S={}}=d,M=Fe(d,rZ),$=(n=(i=e.error)!=null?i:v==null?void 0:v.error)!=null?n:x,D=(o=(a=e.size)!=null?a:v==null?void 0:v.size)!=null?o:w,N=(s=e.color)!=null?s:$?"danger":(c=v==null?void 0:v.color)!=null?c:I,z=j({instanceColor:$?"danger":e.color},u,{fullWidth:C,color:N,disabled:y,error:$,focused:b,size:D,variant:_}),U=nZ(z),V=j({},M,{component:P,slots:k,slotProps:S}),[q,F]=Se("root",{ref:r,className:[U.root,p],elementType:iZ,getSlotProps:g,externalForwardedProps:V,ownerState:z}),[B,H]=Se("input",j({},v&&{additionalProps:{id:v.htmlFor,"aria-describedby":v["aria-describedby"]}},{className:[U.input,f],elementType:oZ,getSlotProps:m,internalForwardedProps:h,externalForwardedProps:V,ownerState:z})),[G,Z]=Se("startDecorator",{className:U.startDecorator,elementType:aZ,externalForwardedProps:V,ownerState:z}),[Y,Q]=Se("endDecorator",{className:U.endDecorator,elementType:sZ,externalForwardedProps:V,ownerState:z});return E.jsxs(q,j({},F,{children:[T&&E.jsx(G,j({},Z,{children:T})),E.jsx(B,j({},H)),O&&E.jsx(Y,j({},Q,{children:O}))]}))});function lZ(t){return et("MuiListSubheader",t)}tt("MuiListSubheader",["root","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const cZ=["component","className","children","id","sticky","variant","color","slots","slotProps"],uZ=t=>{const{variant:e,color:r,sticky:n}=t,i={root:["root",n&&"sticky",r&&`color${ke(r)}`,e&&`variant${ke(e)}`]};return nt(i,lZ,{})},dZ=xe("div",{name:"JoyListSubheader",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;return j({boxSizing:"border-box",display:"flex",alignItems:"center",marginInline:"var(--ListItem-marginInline)",paddingBlock:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",minBlockSize:"var(--ListItem-minHeight)"},t.typography["body-xs"],{fontSize:"max(0.75em, 0.625rem)",textTransform:"uppercase",letterSpacing:"0.1em"},e.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:"var(--ListItem-stickyBackground)"},{color:e.color?`var(--_Link-color, rgba(${(r=t.vars.palette[e.color])==null?void 0:r.mainChannel} / 1))`:t.vars.palette.text.tertiary},e.instanceColor&&{[`&:not([${Fl}])`]:{"--_Link-color":t.vars.palette.text.secondary}},(n=t.variants[e.variant])==null?void 0:n[e.color])}),hZ=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListSubheader"}),{component:i,className:o,children:a,id:s,sticky:c=!1,variant:u,color:d,slots:h={},slotProps:p={}}=n,f=Fe(n,cZ),g=Ia(s),m=R.useContext(pO);R.useEffect(()=>{m&&m(g||"")},[m,g]);const v=j({instanceColor:e.color},n,{id:g,sticky:c,variant:u,color:u?d!=null?d:"neutral":d}),b=uZ(v),x=j({},f,{component:i,slots:h,slotProps:p}),[y,C]=Se("root",{ref:r,className:ft(b.root,o),elementType:dZ,externalForwardedProps:x,ownerState:v,additionalProps:{as:i,id:g}});return E.jsx(y,j({},C,{children:a}))});function pZ(t){return et("MuiAutocomplete",t)}const Oa=tt("MuiAutocomplete",["root","wrapper","input","startDecorator","endDecorator","formControl","focused","disabled","error","multiple","limitTag","hasPopupIcon","hasClearIcon","clearIndicator","popupIndicator","popupIndicatorOpen","listbox","option","loading","noOptions","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]),OO=xe($l)(({theme:t,ownerState:e})=>{var r;const n=(r=t.variants[e.variant])==null?void 0:r[e.color];return j({"--focus-outline-offset":`calc(${t.vars.focus.thickness} * -1)`,"--ListItem-stickyBackground":(n==null?void 0:n.backgroundColor)||(n==null?void 0:n.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Rf,{boxShadow:t.shadow.md,borderRadius:`var(--List-radius, ${t.vars.radius.sm})`},!(n!=null&&n.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup},{zIndex:t.vars.zIndex.popup,overflow:"auto",maxHeight:"40vh",position:"relative","&:empty":{visibility:"hidden"},[`& .${Pf.nested}, & .${Pf.nested} .${GQ.root}`]:{position:"initial"}})});xe(OO,{name:"JoyAutocompleteListbox",slot:"Root",overridesResolver:(t,e)=>e.root})({});function fZ(t){return et("MuiAutocompleteOption",t)}tt("MuiAutocompleteOption",["root","focused","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const mZ=["children","component","color","variant","className","slots","slotProps"],gZ=t=>{const{color:e,variant:r}=t,n={root:["root",e&&`color${ke(e)}`,r&&`variant${ke(r)}`]};return nt(n,fZ,{})},RO=xe(Ll)(({theme:t,ownerState:e})=>{var r,n;return{'&[aria-disabled="true"]':(r=t.variants[`${e.variant}Disabled`])==null?void 0:r[e.color],'&[aria-selected="true"]':j({},(n=t.variants[`${e.variant}Active`])==null?void 0:n[e.color],{fontWeight:t.vars.fontWeight.md})}}),vZ=xe(RO,{name:"JoyAutocompleteOption",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Is=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAutocompleteOption"}),{children:i,component:o="li",color:a="neutral",variant:s="plain",className:c,slots:u={},slotProps:d={}}=n,h=Fe(n,mZ),{variant:p=s,color:f=a}=Lf(e.variant,e.color),g=j({},n,{component:o,color:f,variant:p}),m=gZ(g),v=j({},h,{component:o,slots:u,slotProps:d}),[b,x]=Se("root",{ref:r,className:ft(m.root,c),elementType:vZ,externalForwardedProps:v,ownerState:g,additionalProps:{as:o,role:"option"}});return E.jsx(b,j({},x,{children:i}))});var MO,DO;const yZ=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoHighlight","autoSelect","autoFocus","blurOnSelect","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","defaultValue","disableCloseOnSelect","disabledItemsFocusable","disableListWrap","disableClearable","disabled","endDecorator","error","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","handleHomeEndKeys","includeInputInList","isOptionEqualToValue","groupBy","id","inputValue","limitTags","loading","loadingText","multiple","name","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","placeholder","popupIcon","readOnly","renderGroup","renderOption","renderTags","required","type","startDecorator","size","color","variant","value","component","selectOnFocus","slots","slotProps"],bZ=["onDelete"],xZ=["key"],wZ=["onBlur","onFocus","onMouseDown"],CZ=["key"],IZ=t=>t.current!==null&&t.current.contains(document.activeElement),SZ=t=>{var e;return(e=t.label)!=null?e:t},_Z=t=>`+${t}`,TZ=t=>E.jsxs(ka,{nested:!0,children:[E.jsx(hZ,{sticky:!0,children:t.group}),E.jsx(Mf,{children:t.children})]},t.key),kZ=t=>{const{disabled:e,focused:r,hasClearIcon:n,hasPopupIcon:i,popupOpen:o,variant:a,color:s,size:c,multiple:u}=t,d={root:["root",r&&"focused",n&&"hasClearIcon",i&&"hasPopupIcon",a&&`variant${ke(a)}`,s&&`color${ke(s)}`,c&&`size${ke(c)}`],wrapper:["wrapper",u&&"multiple"],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",o&&"popupIndicatorOpen",e&&"disabled"],listbox:["listbox"],option:["option"],loading:["loading"],noOptions:["noOptions"],limitTag:["limitTag"]};return nt(d,pZ,{})},AZ=xe(kO,{name:"JoyAutocomplete",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({},t.size==="sm"&&{"--Autocomplete-wrapperGap":"3px"},t.size==="md"&&{"--Autocomplete-wrapperGap":"3px"},t.size==="lg"&&{"--Autocomplete-wrapperGap":"4px"},{"@media (pointer: fine)":{[`&:hover .${Oa.clearIndicator}`]:{visibility:"visible"}}},t.multiple&&!t.startDecorator&&{paddingInlineStart:0})),PZ=xe("div",{name:"JoyAutocomplete",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>({flex:1,minWidth:0,display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--Autocomplete-wrapperGap)",[`&.${Oa.multiple}`]:j({paddingBlock:"var(--Autocomplete-wrapperGap)"},!t.startDecorator&&{paddingInlineStart:"var(--Autocomplete-wrapperGap)"},!t.endDecorator&&{paddingInlineEnd:"var(--Autocomplete-wrapperGap)"})})),EZ=xe(AO,{name:"JoyAutocomplete",slot:"Input",overridesResolver:(t,e)=>e.input})(({ownerState:t})=>j({minWidth:30,minHeight:"var(--Chip-minHeight)"},t.multiple&&{marginInlineStart:"calc(var(--Autocomplete-wrapperGap) * 2.5)"})),OZ=xe(PO,{name:"JoyAutocomplete",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({}),RZ=xe(EO,{name:"JoyAutocomplete",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})(({ownerState:t})=>j({},(t.hasClearIcon||t.hasPopupIcon)&&{"--Button-margin":"0px","--IconButton-margin":"0px","--Icon-margin":"0px"})),MZ=xe(Xu,{name:"JoyAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})(({ownerState:t})=>j({alignSelf:"center"},!t.hasPopupIcon&&{marginInlineEnd:"calc(var(--Input-decoratorChildOffset) * -1)"},{marginInlineStart:"calc(var(--_Input-paddingBlock) / 2)",visibility:t.focused?"visible":"hidden"})),DZ=xe(Xu,{name:"JoyAutocomplete",slot:"PopupIndicator",overridesResolver:(t,e)=>e.popupIndicator})({alignSelf:"center",marginInlineStart:"calc(var(--_Input-paddingBlock) / 2)",marginInlineEnd:"calc(var(--Input-decoratorChildOffset) * -1)",[`&.${Oa.popupIndicatorOpen}`]:{transform:"rotate(180deg)","--Icon-color":"currentColor"}}),$Z=xe(OO,{name:"JoyAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({zIndex:`var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`})),LZ=xe(RO,{name:"JoyAutocomplete",slot:"Option",overridesResolver:(t,e)=>e.option})({}),FZ=xe(ka,{name:"JoyAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary})),NZ=xe(ka,{name:"JoyAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary})),jZ=xe("div",{name:"JoyAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})({marginInlineStart:"calc(var(--Input-paddingInline) / 2)",marginBlockStart:"var(--_Input-paddingBlock)"}),Ss=R.forwardRef(function(e,r){var n,i,o,a,s,c,u;const d=Ze({props:e,name:"JoyAutocomplete"}),{"aria-describedby":h,"aria-label":p,"aria-labelledby":f,autoFocus:g,clearIcon:m=MO||(MO=E.jsx(bO,{fontSize:"md"})),clearText:v="Clear",closeText:b="Close",disableClearable:x=!1,disabled:y,endDecorator:C,error:w=!1,forcePopupIcon:I="auto",freeSolo:_=!1,getLimitTagsText:T=_Z,getOptionLabel:O=SZ,groupBy:P,id:k,limitTags:S=-1,loading:M=!1,loadingText:$="Loading…",multiple:D=!1,name:N,noOptionsText:z="No options",openText:U="Open",placeholder:V,popupIcon:q=DO||(DO=E.jsx(SX,{})),readOnly:F=!1,renderGroup:B=TZ,renderOption:H,renderTags:G,required:Z,type:Y,startDecorator:Q,size:K="md",color:X="neutral",variant:ee="outlined",component:ae,slots:oe={},slotProps:Ce={}}=d,be=Fe(d,yZ),ge=R.useContext(Ea),ve=(n=(i=e.error)!=null?i:ge==null?void 0:ge.error)!=null?n:w,fe=(o=(a=e.size)!=null?a:ge==null?void 0:ge.size)!=null?o:K,ne=(s=e.color)!=null?s:ve?"danger":(c=ge==null?void 0:ge.color)!=null?c:X,le=(u=y!=null?y:ge==null?void 0:ge.disabled)!=null?u:!1,{getRootProps:he,getInputProps:ye,getPopupIndicatorProps:pe,getClearProps:Le,getTagProps:He,getListboxProps:Ve,getOptionProps:pt,value:ot,dirty:we,popupOpen:Ee,focused:Ae,focusedTag:We,anchorEl:Me,setAnchorEl:$e,inputValue:Je,groupedOptions:Ge}=_Q(j({},d,{id:k!=null?k:ge==null?void 0:ge.htmlFor,componentName:"Autocomplete",unstable_classNamePrefix:"Mui",unstable_isActiveElementInListbox:IZ})),{onMouseDown:Nt}=ye(),{onClick:It}=he(),Br=!x&&!le&&we&&!F,hr=(!_||I===!0)&&I!==!1,Ht=j({instanceColor:e.color},d,{value:ot,disabled:le,focused:Ae,getOptionLabel:O,hasOptions:!!Ge.length,hasClearIcon:Br,hasPopupIcon:hr,inputFocused:We===-1,popupOpen:Ee,size:fe,color:ne,variant:ee}),Ot=kZ(Ht),Tt=j({},be,{component:ae,slots:oe,slotProps:Ce});let Mt;if(D&&ot.length>0){const gt=Mi=>{const sn=He(Mi),{onDelete:Zi}=sn,cs=Fe(sn,bZ);return j({disabled:le,size:fe,onClick:Zi},cs)};G?Mt=G(ot,gt,Ht):Mt=ot.map((Mi,sn)=>{const Zi=gt({index:sn}),{key:cs}=Zi,u_=Fe(Zi,xZ);return E.jsx(dn,{size:fe,variant:"soft",color:"neutral",endDecorator:E.jsx(Pa,j({},u_),cs),sx:{minWidth:0},children:O(Mi)},sn)})}const te=Rn(r,$e),ie={[Oa.disabled]:le,[Oa.error]:ve,[Oa.focused]:Ae,[Oa.formControl]:!!ge},[ue,de]=Se("root",{ref:te,className:[Ot.root,ie],elementType:AZ,externalForwardedProps:Tt,ownerState:Ht,getSlotProps:he,additionalProps:{onClick:gt=>{It&&It(gt),gt.currentTarget===gt.target&&Nt&&Nt(gt)}}}),[De,Ue]=Se("wrapper",{className:Ot.wrapper,elementType:PZ,externalForwardedProps:Tt,ownerState:Ht}),Qe={[Oa.disabled]:le},[qe,at]=Se("input",{className:[Ot.input,Qe],elementType:EZ,getSlotProps:gt=>{const Mi=ye(),{onBlur:sn,onFocus:Zi,onMouseDown:cs}=Mi,u_=Fe(Mi,wZ);return j({},u_,{onBlur:us=>{var ds;sn==null||sn(us),(ds=gt.onBlur)==null||ds.call(gt,us)},onFocus:us=>{var ds;Zi==null||Zi(us),(ds=gt.onFocus)==null||ds.call(gt,us)},onMouseDown:us=>{var ds;cs==null||cs(us),(ds=gt.onMouseDown)==null||ds.call(gt,us)}})},externalForwardedProps:Tt,ownerState:Ht,additionalProps:{autoFocus:g,placeholder:V,name:N,readOnly:F,disabled:le,required:Z!=null?Z:ge==null?void 0:ge.required,type:Y,"aria-invalid":ve||void 0,"aria-label":p,"aria-labelledby":f,"aria-describedby":h!=null?h:ge==null?void 0:ge["aria-describedby"]}}),[Ye,Xe]=Se("startDecorator",{className:Ot.startDecorator,elementType:OZ,externalForwardedProps:Tt,ownerState:Ht}),[wt,Yr]=Se("endDecorator",{className:Ot.endDecorator,elementType:RZ,externalForwardedProps:Tt,ownerState:Ht}),[Kr,ma]=Se("clearIndicator",{className:Ot.clearIndicator,elementType:MZ,getSlotProps:Le,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:gt=>({size:gt.size||fe,variant:gt.variant||Cs(ee,ne).variant||"plain",color:gt.color||Cs(ee,ne).color||"neutral",disableColorInversion:!!e.color}),additionalProps:{"aria-label":v,title:v}}),[Ri,nu]=Se("popupIndicator",{className:Ot.popupIndicator,elementType:DZ,getSlotProps:pe,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:gt=>({size:gt.size||fe,variant:gt.variant||Cs(ee,ne).variant||"plain",color:gt.color||Cs(ee,ne).color||"neutral",disableColorInversion:!!e.color}),additionalProps:{disabled:le,"aria-label":Ee?b:U,title:Ee?b:U,type:"button"}}),[Pe,Ie]=Se("listbox",{className:Ot.listbox,elementType:$Z,getSlotProps:Ve,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:gt=>({size:gt.size||fe,variant:gt.variant||ee,color:gt.color||ne,disableColorInversion:!gt.disablePortal}),additionalProps:{anchorEl:Me,open:Ee,style:Me?{width:Me.clientWidth}:{}}}),[Ke,ut]=Se("loading",{className:Ot.loading,elementType:FZ,externalForwardedProps:Tt,ownerState:Ht}),[Dt,cr]=Se("noOptions",{className:Ot.noOptions,elementType:NZ,externalForwardedProps:Tt,ownerState:Ht,additionalProps:{role:"presentation",onMouseDown:gt=>{gt.preventDefault()}}}),[pr,Hn]=Se("limitTag",{className:Ot.limitTag,elementType:jZ,externalForwardedProps:Tt,ownerState:Ht});if(S>-1&&Array.isArray(Mt)){const gt=Mt.length-S;!Ae&>>0&&(Mt=Mt.splice(0,S),Mt.push(E.jsx(pr,j({},Hn,{children:T(gt)}),Mt.length)))}const[iu,rNe]=Se("option",{className:Ot.option,elementType:LZ,externalForwardedProps:Tt,ownerState:Ht,getSlotOwnerState:gt=>({variant:gt.variant||Cs(ee,ne).variant||"plain",color:gt.color||Cs(ee,ne).color||"neutral",disableColorInversion:!Ie.disablePortal}),additionalProps:{as:"li"}}),nNe=H||((gt,Mi)=>{const{key:sn}=gt,Zi=Fe(gt,CZ);return E.jsx(iu,j({},Zi,{children:O(Mi)}),sn)}),_U=(gt,Mi)=>{const sn=pt({option:gt,index:Mi});return nNe(j({},rNe,sn),gt,{selected:!!sn["aria-selected"],inputValue:Je,ownerState:Ht})},iNe=R.useMemo(()=>[{name:"offset",options:{offset:[0,4]}},...Ie.modifiers||[]],[Ie.modifiers]);let TU=null;if(Me){var kU;TU=E.jsx(Ff,{variant:ee,color:ne,children:E.jsx(Dl,{nested:!0,children:E.jsxs(Pe,j({},Ie,{className:ft(Ie.className),modifiers:iNe},!((kU=d.slots)!=null&&kU.listbox)&&{as:bf,slots:{root:Ie.as||"ul"}},{children:[Ge.map((gt,Mi)=>{if(P){const sn=gt;return B({key:String(sn.key),group:sn.group,children:sn.options.map((Zi,cs)=>_U(Zi,sn.index+cs))})}return _U(gt,Mi)}),M&&Ge.length===0?E.jsx(Ke,j({},ut,{children:$})):null,Ge.length===0&&!_&&!M?E.jsx(Dt,j({},cr,{children:z})):null]}))})})}return E.jsxs(R.Fragment,{children:[E.jsxs(ue,j({},de,{children:[Q&&E.jsx(Ye,j({},Xe,{children:Q})),E.jsxs(De,j({},Ue,{children:[Mt,E.jsx(qe,j({},at))]})),C&&E.jsx(wt,j({},Yr,{children:C})),Br?E.jsx(Kr,j({},ma,{children:m})):null,hr?E.jsx(Ri,j({},nu,{children:q})):null]})),TU]})}),BZ=Aa(E.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function zZ(t){return et("MuiAvatar",t)}tt("MuiAvatar",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","fallback","sizeSm","sizeMd","sizeLg","img","variantOutlined","variantSoft","variantSolid"]);const UZ=R.createContext(void 0);xe("div",{name:"JoyAvatarGroup",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>j({},t.size==="sm"&&{"--AvatarGroup-gap":"-0.375rem","--Avatar-ringSize":"2px"},t.size==="md"&&{"--AvatarGroup-gap":"-0.5rem","--Avatar-ringSize":"2px"},t.size==="lg"&&{"--AvatarGroup-gap":"-0.625rem","--Avatar-ringSize":"4px"},{"--Avatar-ring":`0 0 0 var(--Avatar-ringSize) var(--Avatar-ringColor, ${e.vars.palette.background.surface})`,"--Avatar-marginInlineStart":"var(--AvatarGroup-gap)",display:"flex",marginInlineStart:"calc(-1 * var(--AvatarGroup-gap))"}));const HZ=["alt","color","size","variant","src","srcSet","children","component","slots","slotProps"],VZ=t=>{const{size:e,variant:r,color:n,src:i,srcSet:o}=t,a={root:["root",r&&`variant${ke(r)}`,n&&`color${ke(n)}`,e&&`size${ke(e)}`],img:[(i||o)&&"img"],fallback:["fallback"]};return nt(a,zZ,{})},WZ=xe("div",{name:"JoyAvatar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;return j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon},t.typography[`title-${e.size}`],e.size==="sm"&&{width:"var(--Avatar-size, 2rem)",height:"var(--Avatar-size, 2rem)",fontSize:"calc(var(--Avatar-size, 2rem) * 0.4375)"},e.size==="md"&&{width:"var(--Avatar-size, 2.5rem)",height:"var(--Avatar-size, 2.5rem)",fontSize:"calc(var(--Avatar-size, 2.5rem) * 0.4)"},e.size==="lg"&&{width:"var(--Avatar-size, 3rem)",height:"var(--Avatar-size, 3rem)",fontSize:"calc(var(--Avatar-size, 3rem) * 0.375)"},{marginInlineStart:"var(--Avatar-marginInlineStart)",boxShadow:"var(--Avatar-ring)",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:1,overflow:"hidden",borderRadius:"var(--Avatar-radius, 50%)",userSelect:"none"},(r=t.variants[e.variant])==null?void 0:r[e.color])}),qZ=xe("img",{name:"JoyAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),GZ=xe(BZ,{name:"JoyAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"64%",height:"64%"});function YZ({crossOrigin:t,referrerPolicy:e,src:r,srcSet:n}){const[i,o]=R.useState(!1);return R.useEffect(()=>{if(!r&&!n)return;o(!1);let a=!0;const s=new Image;return s.onload=()=>{a&&o("loaded")},s.onerror=()=>{a&&o("error")},s.crossOrigin=t,s.referrerPolicy=e,r&&(s.src=r),n&&(s.srcset=n),()=>{a=!1}},[t,e,r,n]),i}const Sn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyAvatar"}),i=R.useContext(UZ),{alt:o,color:a="neutral",size:s="md",variant:c="soft",src:u,srcSet:d,children:h,component:p,slots:f={},slotProps:g={}}=n,m=Fe(n,HZ),v=e.variant||(i==null?void 0:i.variant)||c,b=e.color||(i==null?void 0:i.color)||a,x=e.size||(i==null?void 0:i.size)||s;let y=null;const C=j({},n,{color:b,size:x,variant:v,grouped:!!i}),w=VZ(C),I=j({},m,{component:p,slots:f,slotProps:g}),[_,T]=Se("root",{ref:r,className:w.root,elementType:WZ,externalForwardedProps:I,ownerState:C}),[O,P]=Se("img",{additionalProps:{alt:o,src:u,srcSet:d},className:w.img,elementType:qZ,externalForwardedProps:I,ownerState:C}),[k,S]=Se("fallback",{className:w.fallback,elementType:GZ,externalForwardedProps:I,ownerState:C}),M=YZ(j({},P,{src:u,srcSet:d}));return(u||d)&&M!=="error"?y=E.jsx(O,j({},P)):h!=null?y=h:o?y=o[0]:y=E.jsx(k,j({},S)),E.jsx(_,j({},T,{children:y}))}),KZ=gE("MuiBox",["root"]),Oe=q7({themeId:K0,defaultTheme:px,defaultClassName:KZ.root,generateClassName:fE.generate});function JZ(t){return et("MuiTypography",t)}tt("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const QZ=["color","textColor"],XZ=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],Zu=R.createContext(!1),Yx=R.createContext(!1),ZZ=t=>{const{gutterBottom:e,noWrap:r,level:n,color:i,variant:o}=t,a={root:["root",n,e&&"gutterBottom",r&&"noWrap",i&&`color${ke(i)}`,o&&`variant${ke(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(a,JZ,{})},eee=xe("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),tee=xe("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(t,e)=>e.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),ree=xe("span",{name:"JoyTypography",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i,o,a;const s=e.level!=="inherit"?(r=t.typography[e.level])==null?void 0:r.lineHeight:"1";return j({"--Icon-fontSize":`calc(1em * ${s})`},e.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},e.nesting?{display:"inline"}:j({display:"block"},e.unstable_hasSkeleton&&{position:"relative"}),(e.startDecorator||e.endDecorator)&&j({display:"flex",alignItems:"center"},e.nesting&&j({display:"inline-flex"},e.startDecorator&&{verticalAlign:"bottom"})),e.level&&e.level!=="inherit"&&t.typography[e.level],{fontSize:`var(--Typography-fontSize, ${e.level&&e.level!=="inherit"&&(n=(i=t.typography[e.level])==null?void 0:i.fontSize)!=null?n:"inherit"})`},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.color&&{color:`var(--variant-plainColor, rgba(${(o=t.vars.palette[e.color])==null?void 0:o.mainChannel} / 1))`},e.variant&&j({borderRadius:t.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!e.nesting&&{marginInline:"-0.25em"},(a=t.variants[e.variant])==null?void 0:a[e.color]))}),$O={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},ze=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyTypography"}),{color:o,textColor:a}=i,s=Fe(i,QZ),c=R.useContext(Zu),u=R.useContext(Yx),d=$u(j({},s,{color:a})),{component:h,gutterBottom:p=!1,noWrap:f=!1,level:g="body-md",levelMapping:m=$O,children:v,endDecorator:b,startDecorator:x,variant:y,slots:C={},slotProps:w={}}=d,I=Fe(d,XZ),_=(n=e.color)!=null?n:y?o!=null?o:"neutral":o,T=c||u?e.level||"inherit":g,O=kl(v,["Skeleton"]),P=h||(c?"span":m[T]||$O[T]||"span"),k=j({},d,{level:T,component:P,color:_,gutterBottom:p,noWrap:f,nesting:c,variant:y,unstable_hasSkeleton:O}),S=ZZ(k),M=j({},I,{component:P,slots:C,slotProps:w}),[$,D]=Se("root",{ref:r,className:S.root,elementType:ree,externalForwardedProps:M,ownerState:k}),[N,z]=Se("startDecorator",{className:S.startDecorator,elementType:eee,externalForwardedProps:M,ownerState:k}),[U,V]=Se("endDecorator",{className:S.endDecorator,elementType:tee,externalForwardedProps:M,ownerState:k});return E.jsx(Zu.Provider,{value:!0,children:E.jsxs($,j({},D,{children:[x&&E.jsx(N,j({},z,{children:x})),O?R.cloneElement(v,{variant:v.props.variant||"inline"}):v,b&&E.jsx(U,j({},V,{children:b}))]}))})});ze.muiName="Typography";function nee(t){return et("MuiButton",t)}const Ra=tt("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),iee=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],oee=t=>{const{color:e,disabled:r,focusVisible:n,focusVisibleClassName:i,fullWidth:o,size:a,variant:s,loading:c}=t,u={root:["root",r&&"disabled",n&&"focusVisible",o&&"fullWidth",s&&`variant${ke(s)}`,e&&`color${ke(e)}`,a&&`size${ke(a)}`,c&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},d=nt(u,nee,{});return n&&i&&(d.root+=` ${i}`),d},aee=xe("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),see=xe("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),lee=xe("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(t,e)=>e.loadingIndicatorCenter})(({theme:t,ownerState:e})=>{var r,n;return j({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color},e.disabled&&{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color})}),LO=({theme:t,ownerState:e})=>{var r,n,i,o;return[j({"--Icon-margin":"initial","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon},e.size==="sm"&&{"--Icon-fontSize":t.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:t.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},e.size==="md"&&{"--Icon-fontSize":t.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:t.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},e.size==="lg"&&{"--Icon-fontSize":t.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:t.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${t.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.lg,lineHeight:t.vars.lineHeight.md},e.fullWidth&&{width:"100%"},{[t.focus.selector]:t.focus.default}),j({},(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:hover":{"@media (hover: hover)":(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color]},'&:active, &[aria-pressed="true"]':(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color],[`&.${Ra.disabled}`]:(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]},e.loadingPosition==="center"&&{[`&.${Ra.loading}`]:{color:"transparent"}})]},cee=xe("button",{name:"JoyButton",slot:"Root",overridesResolver:(t,e)=>e.root})(LO),lt=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyButton"}),{children:o,action:a,color:s="primary",variant:c="solid",size:u="md",fullWidth:d=!1,startDecorator:h,endDecorator:p,loading:f=!1,loadingPosition:g="center",loadingIndicator:m,disabled:v,component:b,slots:x={},slotProps:y={}}=i,C=Fe(i,iee),w=R.useContext(Nf),I=R.useContext(wO),_=e.variant||w.variant||c,T=e.size||w.size||u,O=e.color||w.color||s,P=(n=e.loading||e.disabled)!=null?n:w.disabled||f||v,k=R.useRef(null),S=Rn(k,r),{focusVisible:M,setFocusVisible:$,getRootProps:D}=ao(j({},i,{disabled:P,rootRef:S})),N=m!=null?m:E.jsx(Kn,{color:O,thickness:{sm:2,md:3,lg:4}[T]||3});R.useImperativeHandle(a,()=>({focusVisible:()=>{var ee;$(!0),(ee=k.current)==null||ee.focus()}}),[$]);const z=j({},i,{color:O,fullWidth:d,variant:_,size:T,focusVisible:M,loading:f,loadingPosition:g,disabled:P}),U=oee(z),V=ee=>{var ae;let oe=i.onClick;if(typeof y.root=="function"?oe=y.root(z).onClick:y.root&&(oe=y.root.onClick),(ae=oe)==null||ae(ee),I){var Ce;(Ce=I.onClick)==null||Ce.call(I,ee,i.value)}};let q=i["aria-pressed"];typeof y.root=="function"?q=y.root(z)["aria-pressed"]:y.root&&(q=y.root["aria-pressed"]),I!=null&&I.value&&(Array.isArray(I.value)?q=I.value.indexOf(i.value)!==-1:q=I.value===i.value);const F=j({},C,{component:b,slots:x,slotProps:y}),[B,H]=Se("root",{ref:r,className:U.root,elementType:cee,externalForwardedProps:F,getSlotProps:D,ownerState:z,additionalProps:{onClick:V,"aria-pressed":q}}),[G,Z]=Se("startDecorator",{className:U.startDecorator,elementType:aee,externalForwardedProps:F,ownerState:z}),[Y,Q]=Se("endDecorator",{className:U.endDecorator,elementType:see,externalForwardedProps:F,ownerState:z}),[K,X]=Se("loadingIndicatorCenter",{className:U.loadingIndicatorCenter,elementType:lee,externalForwardedProps:F,ownerState:z});return E.jsxs(B,j({},H,{children:[(h||f&&g==="start")&&E.jsx(G,j({},Z,{children:f&&g==="start"?N:h})),o,f&&g==="center"&&E.jsx(K,j({},X,{children:N})),(p||f&&g==="end")&&E.jsx(Y,j({},Q,{children:f&&g==="end"?N:p}))]}))});lt.muiName="Button";function uee(t){return et("MuiButtonGroup",t)}tt("MuiButtonGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);const dee=["buttonFlex","className","component","disabled","size","color","variant","children","orientation","slots","slotProps","spacing"],hee=t=>{const{size:e,variant:r,color:n,orientation:i}=t,o={root:["root",i,r&&`variant${ke(r)}`,n&&`color${ke(n)}`,e&&`size${ke(e)}`]};return nt(o,uee,{})},pee=xe("div")(({theme:t,ownerState:e})=>{var r,n,i;const{borderRadius:o}=Mo({theme:t,ownerState:e},["borderRadius"]),a=e.orientation==="vertical"?"var(--ButtonGroup-radius) var(--ButtonGroup-radius) var(--unstable_childRadius) var(--unstable_childRadius)":"var(--ButtonGroup-radius) var(--unstable_childRadius) var(--unstable_childRadius) var(--ButtonGroup-radius)",s=e.orientation==="vertical"?"var(--unstable_childRadius) var(--unstable_childRadius) var(--ButtonGroup-radius) var(--ButtonGroup-radius)":"var(--unstable_childRadius) var(--ButtonGroup-radius) var(--ButtonGroup-radius) var(--unstable_childRadius)",c=e.orientation==="vertical"?"calc(var(--ButtonGroup-separatorSize) * -1) 0 0 0":"0 0 0 calc(var(--ButtonGroup-separatorSize) * -1)",u={};bs(t.breakpoints,e.spacing,(f,g)=>{if(g!==null){var m;f(u,{"--ButtonGroup-connected":g.toString().match(/^0(?!\.)/)?"1":"0",gap:typeof g=="string"?g:(m=t.spacing)==null?void 0:m.call(t,g)})}});const d=(r=t.variants.outlined)==null?void 0:r[e.color],h=(n=t.variants.outlinedDisabled)==null?void 0:n[e.color],p=(i=t.variants.outlinedHover)==null?void 0:i[e.color];return[j({"--ButtonGroup-separatorSize":e.variant==="outlined"?"1px":"calc(var(--ButtonGroup-connected) * 1px)","--ButtonGroup-separatorColor":d==null?void 0:d.borderColor,"--ButtonGroup-radius":t.vars.radius.sm,"--Divider-inset":"0.5rem","--unstable_childRadius":"calc((1 - var(--ButtonGroup-connected)) * var(--ButtonGroup-radius) - var(--variant-borderWidth, 0px))"},u,{display:"flex",borderRadius:"var(--ButtonGroup-radius)",flexDirection:e.orientation==="vertical"?"column":"row","& > [data-first-child]":j({"--Button-radius":a,"--IconButton-radius":a},e.orientation==="horizontal"&&{borderRight:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},e.orientation==="vertical"&&{borderBottom:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > :not([data-first-child]):not([data-last-child]):not(:only-child)":j({"--Button-radius":"var(--unstable_childRadius)","--IconButton-radius":"var(--unstable_childRadius)",borderRadius:"var(--unstable_childRadius)"},e.orientation==="horizontal"&&{borderLeft:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)",borderRight:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},e.orientation==="vertical"&&{borderTop:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)",borderBottom:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > [data-last-child]":j({"--Button-radius":s,"--IconButton-radius":s},e.orientation==="horizontal"&&{borderLeft:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},e.orientation==="vertical"&&{borderTop:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > :only-child":{"--Button-radius":"var(--ButtonGroup-radius)","--IconButton-radius":"var(--ButtonGroup-radius)"},"& > :not([data-first-child]):not(:only-child)":{"--Button-margin":c,"--IconButton-margin":c},[`& .${Ra.root}, & .${qx.root}`]:j({"&:not(:disabled)":{zIndex:1},"&:disabled":{"--ButtonGroup-separatorColor":h==null?void 0:h.borderColor}},e.variant==="outlined"&&{"&:hover":{"--ButtonGroup-separatorColor":p==null?void 0:p.borderColor}},{[`&:hover, ${t.focus.selector}`]:{zIndex:2}})},e.buttonFlex&&{[`& > *:not(.${qx.root})`]:{flex:e.buttonFlex},[`& > :not(button) > .${Ra.root}`]:{width:"100%"}}),o!==void 0&&{"--ButtonGroup-radius":o}]}),fee=xe(pee,{name:"JoyButtonGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({}),mee=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyButtonGroup"}),{buttonFlex:i,className:o,component:a="div",disabled:s=!1,size:c="md",color:u="neutral",variant:d="outlined",children:h,orientation:p="horizontal",slots:f={},slotProps:g={},spacing:m=0}=n,v=Fe(n,dee),b=j({},n,{buttonFlex:i,color:u,component:a,orientation:p,spacing:m,size:c,variant:d}),x=hee(b),y=j({},v,{component:a,slots:f,slotProps:g}),[C,w]=Se("root",{ref:r,className:ft(x.root,o),elementType:fee,externalForwardedProps:y,additionalProps:{role:"group"},ownerState:b}),I=R.useMemo(()=>({variant:d,color:u,size:c,disabled:s}),[d,u,c,s]);return E.jsx(C,j({},w,{children:E.jsx(Nf.Provider,{value:I,children:R.Children.map(h,(_,T)=>{if(!R.isValidElement(_))return _;const O={};if(kl(_,["Divider"])){var P,k;const S=_.props;O.inset=(P=S==null?void 0:S.inset)!=null?P:"context";const M=p==="vertical"?"horizontal":"vertical";O.orientation=(k=S==null?void 0:S.orientation)!=null?k:M,O.role="presentation",O.component="span"}return R.Children.count(h)>1&&(T===0&&(O["data-first-child"]=""),T===R.Children.count(h)-1&&(O["data-last-child"]="")),R.cloneElement(_,O)})})}))});function gee(t){return et("MuiCard",t)}const _s=tt("MuiCard",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),vee=["className","color","component","invertedColors","size","variant","children","orientation","slots","slotProps"],yee=t=>{const{size:e,variant:r,color:n,orientation:i}=t,o={root:["root",i,r&&`variant${ke(r)}`,n&&`color${ke(n)}`,e&&`size${ke(e)}`]};return nt(o,gee,{})},FO=xe("div")(({theme:t,ownerState:e})=>{var r;const{p:n,padding:i,borderRadius:o}=Mo({theme:t,ownerState:e},["p","padding","borderRadius"]);return[j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--Card-childRadius":"max((var(--Card-radius) - var(--variant-borderWidth, 0px)) - var(--Card-padding), min(var(--Card-padding) / 2, (var(--Card-radius) - var(--variant-borderWidth, 0px)) / 2))","--AspectRatio-radius":"var(--Card-childRadius)","--unstable_actionMargin":"calc(-1 * var(--variant-borderWidth, 0px))","--unstable_actionRadius":"var(--Card-radius)","--CardCover-radius":"calc(var(--Card-radius) - var(--variant-borderWidth, 0px))","--CardOverflow-offset":"calc(-1 * var(--Card-padding))","--CardOverflow-radius":"calc(var(--Card-radius) - var(--variant-borderWidth, 0px))","--Divider-inset":"calc(-1 * var(--Card-padding))"},e.size==="sm"&&{"--Card-radius":t.vars.radius.sm,"--Card-padding":"0.625rem",gap:"0.5rem"},e.size==="md"&&{"--Card-radius":t.vars.radius.md,"--Card-padding":"1rem",gap:"0.75rem 1rem"},e.size==="lg"&&{"--Card-radius":t.vars.radius.lg,"--Card-padding":"1.5rem",gap:"1rem 1.5rem"},{padding:"var(--Card-padding)",borderRadius:"var(--Card-radius)",backgroundColor:t.vars.palette.background.surface,position:"relative",display:"flex",flexDirection:e.orientation==="horizontal"?"row":"column"},t.typography[`body-${e.size}`],e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(r=t.variants[e.variant])==null?void 0:r[e.color]),n!==void 0&&{"--Card-padding":n},i!==void 0&&{"--Card-padding":i},o!==void 0&&{"--Card-radius":o}]}),bee=xe(FO,{name:"JoyCard",slot:"Root",overridesResolver:(t,e)=>e.root})({}),hn=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCard"}),{className:i,color:o="neutral",component:a="div",invertedColors:s=!1,size:c="md",variant:u="outlined",children:d,orientation:h="vertical",slots:p={},slotProps:f={}}=n,g=Fe(n,vee),m=j({},n,{color:o,component:a,orientation:h,size:c,variant:u,invertedColors:s}),v=yee(m),b=j({},g,{component:a,slots:p,slotProps:f}),[x,y]=Se("root",{ref:r,className:ft(v.root,i),elementType:bee,externalForwardedProps:b,ownerState:m});return E.jsx(x,j({},y,{children:R.Children.map(d,(C,w)=>{if(!R.isValidElement(C))return C;const I={};if(kl(C,["Divider"])){var _,T;const O=C.props;I.inset=(_=O==null?void 0:O.inset)!=null?_:"context";const P=h==="vertical"?"horizontal":"vertical";I.orientation=(T=O==null?void 0:O.orientation)!=null?T:P}return w===0&&(I["data-first-child"]=""),w===R.Children.count(d)-1&&(I["data-last-child"]=""),R.cloneElement(C,I)})}))});function xee(t){return et("MuiCardOverflow",t)}const Kx=tt("MuiCardOverflow",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);function wee(t){return et("MuiDivider",t)}const Cee=tt("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]),NO=xe("div")(({ownerState:t})=>{var e;return j({"--Button-radius":"var(--Card-childRadius)","--IconButton-radius":"var(--Card-childRadius)",display:"flex"},((e=t.orientation)==null?void 0:e.startsWith("horizontal"))&&{alignItems:"center"},{flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal-reverse"&&{flexDirection:"row-reverse"},{zIndex:1,gap:"calc(0.625 * var(--Card-padding))",padding:"var(--unstable_padding)","--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 0 0",[`.${Kx.root} > &`]:{"--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 var(--Card-padding)"},[`.${_s.root} > .${Cee.root} + &`]:{"--unstable_padding":"0"}},t.buttonFlex?{[`& > :not(.${qx.root})`]:{flex:t.buttonFlex},[`& > :not(button) > .${Ra.root}`]:{width:"100%"}}:{[`& > .${Ra.root}:only-child`]:{flex:"auto"}})});xe(NO,{name:"JoyCardActions",slot:"Root",overridesResolver:(t,e)=>e.root})({});function Iee(t){return et("MuiCardContent",t)}tt("MuiCardContent",["root"]);const See=["className","component","children","orientation","slots","slotProps"],_ee=()=>nt({root:["root"]},Iee,{}),jO=xe("div")(({ownerState:t})=>({display:"flex",flexDirection:t.orientation==="horizontal"?"row":"column",flex:9999,zIndex:1,columnGap:"var(--Card-padding)",rowGap:"max(2px, calc(0.1875 * var(--Card-padding)))",padding:"var(--unstable_padding)",[`.${Kx.root} > &`]:{"--unstable_padding":"calc(var(--Card-padding) * 0.75) 0px"}})),Tee=xe(jO,{name:"JoyCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$n=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCardContent"}),{className:i,component:o="div",children:a,orientation:s="vertical",slots:c={},slotProps:u={}}=n,d=Fe(n,See),h=j({},d,{component:o,slots:c,slotProps:u}),p=j({},n,{component:o,orientation:s}),f=_ee(),[g,m]=Se("root",{ref:r,className:ft(f.root,i),elementType:Tee,externalForwardedProps:h,ownerState:p});return E.jsx(g,j({},m,{children:a}))});function kee(t){return et("MuiModalDialog",t)}const BO=tt("MuiModalDialog",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","layoutCenter","layoutFullscreen"]),Aee=["className","component","children","color","variant","slots","slotProps"],Pee=t=>{const{variant:e,color:r}=t,n={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`]};return nt(n,xee,{})},Eee=xe("div",{name:"JoyCardOverflow",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;const n="calc(var(--CardOverflow-radius) - var(--variant-borderWidth, 0px))";return j({alignSelf:"stretch",position:"relative",display:"flex",flexDirection:"var(--_CardOverflow-flexDirection)",margin:"var(--_CardOverflow-margin)",borderRadius:"var(--_CardOverflow-radius)",padding:"var(--_CardOverflow-padding)",[`.${_s.vertical} &, .${_s.horizontal} .${_s.vertical} &, .${BO.root} &`]:{"--_CardOverflow-flexDirection":"column","--AspectRatio-margin":"0 calc(-1 * var(--Card-padding))","--_CardOverflow-margin":"0 var(--CardOverflow-offset)","--_CardOverflow-padding":"0 var(--Card-padding)","&[data-first-child]":{"--AspectRatio-radius":`${n} ${n} 0 0`,"--_CardOverflow-radius":"var(--CardOverflow-radius) var(--CardOverflow-radius) 0 0","--_CardOverflow-margin":"var(--CardOverflow-offset) var(--CardOverflow-offset) 0"},"&[data-last-child]":{"--AspectRatio-radius":`0 0 ${n} ${n}`,"--_CardOverflow-radius":"0 0 var(--CardOverflow-radius) var(--CardOverflow-radius)","--_CardOverflow-margin":"0 var(--CardOverflow-offset) var(--CardOverflow-offset)"},"&[data-last-child][data-first-child]":{"--AspectRatio-radius":n,"--_CardOverflow-margin":"var(--CardOverflow-offset)"},[`& > .${Ra.root}:only-child`]:{zIndex:1,width:"calc(100% + -2 * var(--CardOverflow-offset))","--Button-margin":"0 var(--CardOverflow-offset)","--Button-radius":"0 0 var(--CardOverflow-radius) var(--CardOverflow-radius)"}},[`.${_s.horizontal} &, .${_s.vertical} .${_s.horizontal} &`]:{"--_CardOverflow-flexDirection":"row","--AspectRatio-margin":"calc(-1 * var(--Card-padding)) 0px","--_CardOverflow-margin":"var(--CardOverflow-offset) 0px","--_CardOverflow-padding":"var(--Card-padding) 0px","&[data-first-child]":{"--AspectRatio-radius":`${n} 0 0 ${n}`,"--_CardOverflow-radius":"var(--CardOverflow-radius) 0 0 var(--CardOverflow-radius)","--_CardOverflow-margin":"var(--CardOverflow-offset) 0px var(--CardOverflow-offset) var(--CardOverflow-offset)"},"&[data-last-child]":{"--AspectRatio-radius":`0 ${n} ${n} 0`,"--_CardOverflow-radius":"0 var(--CardOverflow-radius) var(--CardOverflow-radius) 0","--_CardOverflow-margin":"var(--CardOverflow-offset) var(--CardOverflow-offset) var(--CardOverflow-offset) 0px"},"&[data-last-child][data-first-child]":{"--AspectRatio-radius":n,"--_CardOverflow-margin":"var(--CardOverflow-offset)"},[`& > .${Ra.root}:only-child`]:{height:"calc(100% + -2 * var(--CardOverflow-offset))","--Button-margin":"var(--CardOverflow-offset) 0","--Button-radius":"0 var(--CardOverflow-radius) var(--CardOverflow-radius) 0"}}},(r=t.variants[e.variant])==null?void 0:r[e.color])}),jf=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyCardOverflow"}),{className:i,component:o="div",children:a,color:s="neutral",variant:c="plain",slots:u={},slotProps:d={}}=n,h=Fe(n,Aee),p=j({},n,{component:o,color:s,variant:c}),f=Pee(p),g=j({},h,{component:o,slots:u,slotProps:d}),[m,v]=Se("root",{ref:r,className:ft(f.root,i),elementType:Eee,externalForwardedProps:g,ownerState:p});return E.jsx(m,j({},v,{children:a}))});jf.muiName="CardOverflow";function Oee(t){return et("MuiCheckbox",t)}const jl=tt("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),Ree=Aa(E.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),Mee=Aa(E.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),Dee=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],$ee=t=>{const{checked:e,disabled:r,disableIcon:n,focusVisible:i,color:o,variant:a,size:s,indeterminate:c}=t,u={root:["root",e&&"checked",r&&"disabled",i&&"focusVisible",a&&`variant${ke(a)}`,o&&`color${ke(o)}`,s&&`size${ke(s)}`],checkbox:["checkbox",e&&"checked",c&&"indeterminate",r&&"disabled"],action:["action",e&&"checked",n&&r&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return nt(u,Oee,{})},Lee=xe("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{var r,n,i;return j({"--Icon-fontSize":"var(--Checkbox-size)"},t.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:e.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},t.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:e.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},t.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:e.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:t.overlay?"initial":"relative",display:"inline-flex",fontFamily:e.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:e.vars.palette.text.primary,[`&.${jl.disabled}`]:{color:(r=e.variants.plainDisabled)==null||(r=r[t.color])==null?void 0:r.color}},t.disableIcon&&{color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color,[`&.${jl.disabled}`]:{color:(i=e.variants[`${t.variant}Disabled`])==null||(i=i[t.color])==null?void 0:i.color}})}),Fee=xe("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(t,e)=>e.checkbox})(({theme:t,ownerState:e})=>{var r,n,i,o,a;const s=(r=t.variants[`${e.variant}`])==null?void 0:r[e.color];return[j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${t.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},e.disableIcon&&{display:"contents"},{[`&.${jl.checked}, &.${jl.indeterminate}`]:{"--Icon-color":"currentColor"}}),...e.disableIcon?[]:[j({},s,{backgroundColor:(n=s==null?void 0:s.backgroundColor)!=null?n:t.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=t.variants[`${e.variant}Hover`])==null?void 0:i[e.color]}},{"&:active":(o=t.variants[`${e.variant}Active`])==null?void 0:o[e.color]},{[`&.${jl.disabled}`]:(a=t.variants[`${e.variant}Disabled`])==null?void 0:a[e.color]}]]}),Nee=xe("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(t,e)=>e.action})(({theme:t,ownerState:e})=>{var r,n,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${e.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[t.focus.selector]:t.focus.default},...e.disableIcon?[(r=t.variants[e.variant])==null?void 0:r[e.color],{"&:hover":(n=t.variants[`${e.variant}Hover`])==null?void 0:n[e.color]},{"&:active":(i=t.variants[`${e.variant}Active`])==null?void 0:i[e.color]},{[`&.${jl.disabled}`]:(o=t.variants[`${e.variant}Disabled`])==null?void 0:o[e.color]}]:[]]}),jee=xe("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(t,e)=>e.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),Bee=xe("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(t,e)=>e.label})(({ownerState:t})=>j({flex:1,minWidth:0},t.disableIcon&&{zIndex:1,pointerEvents:"none"})),zee=E.jsx(Ree,{}),Uee=E.jsx(Mee,{}),ed=R.forwardRef(function(e,r){var n,i,o,a,s;const c=Ze({props:e,name:"JoyCheckbox"}),{checked:u,uncheckedIcon:d,checkedIcon:h=zee,label:p,defaultChecked:f,disabled:g,disableIcon:m=!1,overlay:v,id:b,indeterminate:x=!1,indeterminateIcon:y=Uee,name:C,onBlur:w,onChange:I,onFocus:_,onFocusVisible:T,readOnly:O,required:P,value:k,color:S,variant:M,size:$="md",component:D,slots:N={},slotProps:z={}}=c,U=Fe(c,Dee),V=R.useContext(Ea),q=(n=(i=e.disabled)!=null?i:V==null?void 0:V.disabled)!=null?n:g,F=(o=(a=e.size)!=null?a:V==null?void 0:V.size)!=null?o:$,B=Ia(b!=null?b:V==null?void 0:V.htmlFor),H={checked:u,defaultChecked:f,disabled:q,onBlur:w,onChange:I,onFocus:_,onFocusVisible:T},{getInputProps:G,checked:Z,disabled:Y,focusVisible:Q}=lO(H),K=Z||x,ae=K?M||"solid":M||"outlined",oe=e.color||(V!=null&&V.error?"danger":(s=V==null?void 0:V.color)!=null?s:S),ge=j({},c,{checked:Z,disabled:Y,disableIcon:m,overlay:v,focusVisible:Q,color:K?oe||"primary":oe||"neutral",variant:ae,size:F}),ve=$ee(ge),fe=j({},U,{component:D,slots:N,slotProps:z}),[ne,le]=Se("root",{ref:r,className:ve.root,elementType:Lee,externalForwardedProps:fe,ownerState:ge}),[he,ye]=Se("checkbox",{className:ve.checkbox,elementType:Fee,externalForwardedProps:fe,ownerState:ge}),[pe,Le]=Se("action",{className:ve.action,elementType:Nee,externalForwardedProps:fe,ownerState:ge}),[He,Ve]=Se("input",{additionalProps:j({id:B,name:C,value:k,readOnly:O,role:void 0,required:P!=null?P:V==null?void 0:V.required,"aria-describedby":V==null?void 0:V["aria-describedby"]},x&&{"aria-checked":"mixed"}),className:ve.input,elementType:jee,externalForwardedProps:fe,getSlotProps:G,ownerState:ge}),[pt,ot]=Se("label",{additionalProps:{htmlFor:B},className:ve.label,elementType:Bee,externalForwardedProps:fe,ownerState:ge});let we=d;return m?we=null:x?we=y:Z&&(we=h),E.jsxs(ne,j({},le,{children:[E.jsxs(he,j({},ye,{children:[E.jsx(pe,j({},Le,{children:E.jsx(He,j({},Ve))})),we]})),p&&E.jsx(Zu.Provider,{value:!0,children:E.jsx(pt,j({},ot,{children:p}))})]}))});function Hee(t){return et("MuiDialogActions",t)}tt("MuiDialogActions",["root"]);const Vee=["component","children","buttonFlex","orientation","slots","slotProps"],Wee=()=>nt({root:["root"]},Hee,{}),qee=xe(NO,{name:"JoyDialogActions",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Bl=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDialogActions"}),{component:i="div",children:o,buttonFlex:a,orientation:s="horizontal-reverse",slots:c={},slotProps:u={}}=n,d=Fe(n,Vee),h=j({},d,{component:i,slots:c,slotProps:u}),p=j({},n,{component:i,buttonFlex:a,orientation:s}),f=Wee(),[g,m]=Se("root",{ref:r,className:f.root,elementType:qee,externalForwardedProps:h,ownerState:p});return E.jsx(g,j({},m,{children:o}))});function Gee(t){return et("MuiDialogContent",t)}tt("MuiDialogContent",["root"]);const Bf=R.createContext(void 0);function Yee(t){return et("MuiDialogTitle",t)}const Kee=tt("MuiDialogTitle",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),Jee=["component","children","orientation","slots","slotProps"],Qee=()=>nt({root:["root"]},Gee,{}),Xee=xe(jO,{name:"JoyDialogContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({color:`var(--DialogContent-color, ${t.vars.palette.text.tertiary})`,overflow:"auto",margin:"var(--unstable_DialogContent-margin)",[`.${BO.root} > .${Kee.root} + &`]:{"--unstable_DialogContent-margin":"-0.375em 0 0 0"}})),Ts=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDialogContent"}),i=R.useContext(Bf),{component:o="div",children:a,orientation:s="vertical",slots:c={},slotProps:u={}}=n,d=Fe(n,Jee),h=j({},d,{component:o,slots:c,slotProps:u}),p=j({},n,{component:o,orientation:s}),f=Qee(),[g,m]=Se("root",{ref:r,className:f.root,elementType:Xee,externalForwardedProps:h,ownerState:p,additionalProps:{id:i==null?void 0:i.describedBy}});return E.jsx(g,j({},m,{children:a}))}),Jx=R.createContext(void 0),Zee=["component","children","variant","color","level","slots","slotProps"],ete=t=>{const{level:e,color:r,variant:n}=t,i={root:["root",e,r&&`color${ke(r)}`,n&&`variant${ke(n)}`]};return nt(i,Yee,{})},tte=xe("h2",{name:"JoyDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;const i=e.level!=="inherit"?(r=t.typography[e.level])==null?void 0:r.lineHeight:"1";return j({"--Icon-fontSize":`calc(1em * ${i})`},e.color&&{"--Icon-color":"currentColor"},{display:"flex",gap:"clamp(4px, 0.375em, 0.75rem)",margin:"var(--unstable_DialogTitle-margin, 0px)"},e.level&&e.level!=="inherit"&&t.typography[e.level],{color:"inherit"},e.variant&&j({borderRadius:t.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},(n=t.variants[e.variant])==null?void 0:n[e.color]),{[`.${Kx.root} > &`]:{"--unstable_DialogTitle-margin":"var(--Card-padding) 0"}})}),rte={sm:"title-md",md:"title-lg",lg:"h4"},ks=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDialogTitle"}),i=R.useContext(Jx),o=R.useContext(Bf),{component:a="h2",children:s,variant:c,color:u,level:d=rte[i||"md"],slots:h={},slotProps:p={}}=n,f=Fe(n,Zee),g=e.color||(c?u!=null?u:"neutral":u),m=j({},f,{component:a,slots:h,slotProps:p}),v=j({},n,{component:a,color:g,variant:c,level:d}),b=ete(v),[x,y]=Se("root",{ref:r,className:b.root,elementType:tte,externalForwardedProps:m,ownerState:v,additionalProps:{id:o==null?void 0:o.labelledBy}});return E.jsx(x,j({},y,{children:s}))}),nte=["className","children","component","inset","orientation","role","slots","slotProps"],ite=t=>{const{orientation:e,inset:r}=t,n={root:["root",e,r&&`inset${ke(r)}`]};return nt(n,wee,{})},zO=xe("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({"--Divider-thickness":"1px","--Divider-lineColor":t.vars.palette.divider},e.inset==="none"&&{"--_Divider-inset":"0px"},e.inset==="context"&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:e.orientation==="vertical"?"initial":"var(--_Divider-inset)",marginBlock:e.orientation==="vertical"?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},e.children?j({"--Divider-gap":t.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:e.orientation==="vertical"?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0},t.typography["body-sm"],{"&::before, &::after":{position:"relative",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:e.orientation==="vertical"?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:e.orientation==="vertical"?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:e.orientation==="vertical"?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:e.orientation==="vertical"?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}):{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)"})),Ni=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyDivider"}),{className:i,children:o,component:a=o!=null?"div":"hr",inset:s,orientation:c="horizontal",role:u=a!=="hr"?"separator":void 0,slots:d={},slotProps:h={}}=n,p=Fe(n,nte),f=j({},n,{inset:s,role:u,orientation:c,component:a}),g=ite(f),m=j({},p,{component:a,slots:d,slotProps:h}),[v,b]=Se("root",{ref:r,className:ft(g.root,i),elementType:zO,externalForwardedProps:m,ownerState:f,additionalProps:j({as:a,role:u},u==="separator"&&c==="vertical"&&{"aria-orientation":"vertical"})});return E.jsx(v,j({},b,{children:o}))});Ni.muiName="Divider";function ote(t){return et("MuiModal",t)}tt("MuiModal",["root","hidden","backdrop"]);const UO=R.createContext(void 0),ate=["children","container","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onClose","onKeyDown","open","component","slots","slotProps"],ste=t=>{const{open:e}=t;return nt({root:["root",!e&&"hidden"],backdrop:["backdrop"]},ote,{})},lte=xe("div")(({ownerState:t,theme:e})=>j({"--unstable_popup-zIndex":`calc(${e.vars.zIndex.modal} + 1)`,'& ~ [role="listbox"]':{"--unstable_popup-zIndex":`calc(${e.vars.zIndex.modal} + 1)`},position:"fixed",zIndex:e.vars.zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&{visibility:"hidden"})),cte=xe(lte,{name:"JoyModal",slot:"Root",overridesResolver:(t,e)=>e.root})({}),ute=xe("div")(({theme:t})=>({zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:t.vars.palette.background.backdrop,WebkitTapHighlightColor:"transparent",backdropFilter:"blur(8px)"})),dte=xe(ute,{name:"JoyModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({}),As=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyModal"}),{children:i,container:o,disableAutoFocus:a=!1,disableEnforceFocus:s=!1,disableEscapeKeyDown:c=!1,disablePortal:u=!1,disableRestoreFocus:d=!1,disableScrollLock:h=!1,hideBackdrop:p=!1,keepMounted:f=!1,onClose:g,open:m,component:v,slots:b={},slotProps:x={}}=n,y=Fe(n,ate),C=j({},n,{disableAutoFocus:a,disableEnforceFocus:s,disableEscapeKeyDown:c,disablePortal:u,disableRestoreFocus:d,disableScrollLock:h,hideBackdrop:p,keepMounted:f}),{getRootProps:w,getBackdropProps:I,rootRef:_,portalRef:T,isTopModal:O}=OK(j({},C,{rootRef:r})),P=ste(C),k=j({},y,{component:v,slots:b,slotProps:x}),[S,M]=Se("root",{ref:_,className:P.root,elementType:cte,externalForwardedProps:k,getSlotProps:w,ownerState:C}),[$,D]=Se("backdrop",{className:P.backdrop,elementType:dte,externalForwardedProps:k,getSlotProps:I,ownerState:C});return!f&&!m?null:E.jsx(UO.Provider,{value:g,children:E.jsx(LE,{ref:T,container:o,disablePortal:u,children:E.jsxs(S,j({},M,{children:[p?null:E.jsx($,j({},D)),E.jsx(WY,{disableEnforceFocus:s,disableAutoFocus:a,disableRestoreFocus:d,isEnabled:O,open:m,children:R.Children.only(i)&&R.cloneElement(i,j({},i.props.tabIndex===void 0&&{tabIndex:-1}))})]}))})})});function hte(t){return et("MuiFormControl",t)}const Qx=tt("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);function pte(t){return et("MuiSwitch",t)}const td=tt("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),fte=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],mte=t=>{const{disabled:e,error:r,size:n,color:i,orientation:o}=t,a={root:["root",o,e&&"disabled",r&&"error",i&&`color${ke(i)}`,n&&`size${ke(n)}`]};return nt(a,hte,{})},gte=xe("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i;return j({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":e.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":t.vars.palette.danger[500]},e.size==="sm"&&{"--FormLabel-fontSize":t.vars.fontSize.xs,"--FormLabel-lineHeight":t.vars.lineHeight.xl,"--FormLabel-margin":e.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":t.vars.fontSize.xs,"--FormHelperText-lineHeight":t.vars.lineHeight.xl},e.size==="md"&&{"--FormLabel-fontSize":t.vars.fontSize.sm,"--FormLabel-lineHeight":t.vars.lineHeight.sm,"--FormLabel-margin":e.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":t.vars.fontSize.sm,"--FormHelperText-lineHeight":t.vars.lineHeight.sm},e.size==="lg"&&{"--FormLabel-fontSize":t.vars.fontSize.md,"--FormLabel-lineHeight":t.vars.lineHeight.md,"--FormLabel-margin":e.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":t.vars.fontSize.sm,"--FormHelperText-lineHeight":t.vars.lineHeight.sm},e.color&&{"--FormHelperText-color":(r=t.vars.palette[e.color])==null?void 0:r[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${Qx.error}`]:{"--FormHelperText-color":t.vars.palette.danger[500]},[`&.${Qx.disabled}`]:{"--FormLabel-color":(n=t.variants.plainDisabled)==null||(n=n[e.color||"neutral"])==null?void 0:n.color,"--FormHelperText-color":(i=t.variants.plainDisabled)==null||(i=i[e.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:e.orientation==="horizontal"?"row":"column"},e.orientation==="horizontal"&&{[`& > label ~ .${td.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),kt=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:s=!1,required:c=!1,error:u=!1,color:d,size:h="md",orientation:p="vertical",slots:f={},slotProps:g={}}=n,m=Fe(n,fte),v=Ia(i),[b,x]=R.useState(null),y=j({},n,{id:v,component:a,color:d,disabled:s,error:u,required:c,size:h,orientation:p});let C;const w=mte(y),[I,_]=Se("root",{ref:r,className:ft(w.root,o),elementType:gte,externalForwardedProps:j({},m,{component:a,slots:f,slotProps:g}),ownerState:y}),T=R.useMemo(()=>({disabled:s,required:c,error:u,color:d,size:h,htmlFor:v,labelId:`${v}-label`,"aria-describedby":b?`${v}-helper-text`:void 0,setHelperText:x,registerEffect:C}),[d,s,u,b,v,C,c,h]);return E.jsx(Ea.Provider,{value:T,children:E.jsx(I,j({},_))})});function vte(t){return et("MuiFormHelperText",t)}tt("MuiFormHelperText",["root"]);function yte(t){return et("MuiFormLabel",t)}const bte=tt("MuiFormLabel",["root","asterisk"]),xte=["children","component","slots","slotProps"],wte=()=>nt({root:["root"]},vte,{}),Cte=xe("div",{name:"JoyFormHelperText",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({"--Icon-fontSize":"calc(var(--FormHelperText-lineHeight) * 1em)",display:"flex",alignItems:"center",gap:"2px",fontFamily:t.vars.fontFamily.body,fontSize:`var(--FormHelperText-fontSize, ${t.vars.fontSize.sm})`,lineHeight:`var(--FormHelperText-lineHeight, ${t.vars.lineHeight.sm})`,color:`var(--FormHelperText-color, ${t.vars.palette.text.tertiary})`,margin:"var(--FormHelperText-margin, 0px)",[`.${bte.root} + &`]:{"--FormHelperText-margin":"0px"},[`.${Qx.error} &`]:{"--Icon-color":"currentColor"}})),pi=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyFormHelperText"}),{children:i,component:o,slots:a={},slotProps:s={}}=n,c=Fe(n,xte),u=R.useRef(null),d=Rn(u,r),h=R.useContext(Ea),p=h==null?void 0:h.setHelperText;R.useEffect(()=>(p==null||p(u.current),()=>{p==null||p(null)}),[p]);const f=wte(),g=j({},c,{component:o,slots:a,slotProps:s}),[m,v]=Se("root",{ref:d,elementType:Cte,externalForwardedProps:g,ownerState:n,additionalProps:{as:o,id:h==null?void 0:h["aria-describedby"]},className:f.root});return E.jsx(m,j({},v,{children:i}))}),Ite=["children","component","htmlFor","id","slots","slotProps"],Ste=()=>nt({root:["root"],asterisk:["asterisk"]},yte,{}),_te=xe("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:t.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${t.vars.fontSize.sm})`,fontWeight:t.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${t.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${t.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),Tte=xe("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})({color:"var(--FormLabel-asteriskColor)"}),Pt=R.forwardRef(function(e,r){var n,i;const o=Ze({props:e,name:"JoyFormLabel"}),{children:a,component:s="label",htmlFor:c,id:u,slots:d={},slotProps:h={}}=o,p=Fe(o,Ite),f=R.useContext(Ea),g=(n=(i=e.required)!=null?i:f==null?void 0:f.required)!=null?n:!1,m=j({},o,{required:g}),v=Ste(),b=j({},p,{component:s,slots:d,slotProps:h}),[x,y]=Se("root",{additionalProps:{htmlFor:c!=null?c:f==null?void 0:f.htmlFor,id:u!=null?u:f==null?void 0:f.labelId},ref:r,className:v.root,elementType:_te,externalForwardedProps:b,ownerState:m}),[C,w]=Se("asterisk",{additionalProps:{"aria-hidden":!0},className:v.asterisk,elementType:Tte,externalForwardedProps:b,ownerState:m});return E.jsxs(x,j({},y,{children:[a,g&&E.jsxs(C,j({},w,{children:[" ","*"]}))]}))}),yr=P9({createStyledComponent:xe("div",{name:"JoyGrid",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>Ze({props:t,name:"JoyGrid"})});function kte(t){return et("MuiLink",t)}const HO=tt("MuiLink",["root","disabled","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","variantPlain","variantOutlined","variantSoft","variantSolid","underlineNone","underlineHover","underlineAlways","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","startDecorator","endDecorator"]),Ate=["color","textColor","variant"],Pte=["children","disabled","onBlur","onFocus","level","overlay","underline","endDecorator","startDecorator","component","slots","slotProps"],Ete=t=>{const{level:e,color:r,variant:n,underline:i,focusVisible:o,disabled:a}=t,s={root:["root",r&&`color${ke(r)}`,a&&"disabled",o&&"focusVisible",e,i&&`underline${ke(i)}`,n&&`variant${ke(n)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return nt(s,kte,{})},Ote=xe("span",{name:"JoyLink",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})(({ownerState:t})=>{var e;return j({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Link-gap, 0.375em), 0.75rem)"},typeof t.startDecorator!="string"&&(t.alignItems==="flex-start"||((e=t.sx)==null?void 0:e.alignItems)==="flex-start")&&{marginTop:"2px"})}),Rte=xe("span",{name:"JoyLink",slot:"endDecorator",overridesResolver:(t,e)=>e.endDecorator})(({ownerState:t})=>{var e;return j({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Link-gap, 0.25em), 0.5rem)"},typeof t.startDecorator!="string"&&(t.alignItems==="flex-start"||((e=t.sx)==null?void 0:e.alignItems)==="flex-start")&&{marginTop:"2px"})}),Mte=xe("a",{name:"JoyLink",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i,o,a,s,c;return[j({"--Icon-fontSize":"1.25em","--Icon-color":"currentColor","--CircularProgress-size":"1.25em","--CircularProgress-thickness":"3px"},e.level&&e.level!=="inherit"&&t.typography[e.level],e.level==="inherit"&&{font:"inherit"},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{"@media (hover: hover)":{textDecorationLine:"underline"}}},e.underline==="always"&&{textDecoration:"underline"},e.startDecorator&&{verticalAlign:"bottom"},{textDecorationThickness:"max(0.08em, 1px)",textUnderlineOffset:"0.15em",display:"inline-flex",alignItems:"center",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:t.vars.radius.xs,padding:0,cursor:"pointer",textDecorationColor:`var(--variant-outlinedBorder, rgba(${(r=t.vars.palette[e.color])==null?void 0:r.mainChannel} / var(--Link-underlineOpacity, 0.72)))`},e.variant?j({paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!e.nesting&&{marginInline:"-0.25em"}):{color:`var(--variant-plainColor, rgba(${(n=t.vars.palette[e.color])==null?void 0:n.mainChannel} / 1))`,[`&.${HO.disabled}`]:{pointerEvents:"none",color:`var(--variant-plainDisabledColor, rgba(${(i=t.vars.palette[e.color])==null?void 0:i.mainChannel} / 0.6))`}},{userSelect:e.component==="button"?"none":void 0,MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"}},e.overlay?{position:"initial","&::after":{content:'""',display:"block",position:"absolute",top:0,left:0,bottom:0,right:0,borderRadius:"var(--unstable_actionRadius, inherit)",margin:"var(--unstable_actionMargin)"},[`${t.focus.selector}`]:{"&::after":t.focus.default}}:{position:"relative",[t.focus.selector]:t.focus.default}),e.variant&&j({},(o=t.variants[e.variant])==null?void 0:o[e.color],{"&:hover":{"@media (hover: hover)":(a=t.variants[`${e.variant}Hover`])==null?void 0:a[e.color]},"&:active":(s=t.variants[`${e.variant}Active`])==null?void 0:s[e.color],[`&.${HO.disabled}`]:(c=t.variants[`${e.variant}Disabled`])==null?void 0:c[e.color]})]}),Ps=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyLink"}),{color:i="primary",textColor:o,variant:a}=n,s=Fe(n,Ate),c=R.useContext(Zu),u=R.useContext(Yx),d=$u(j({},s,{color:o})),{children:h,disabled:p=!1,onBlur:f,onFocus:g,level:m="body-md",overlay:v=!1,underline:b="hover",endDecorator:x,startDecorator:y,component:C,slots:w={},slotProps:I={}}=d,_=Fe(d,Pte),T=c||u?e.level||"inherit":m,{isFocusVisibleRef:O,onBlur:P,onFocus:k,ref:S}=hE(),[M,$]=R.useState(!1),D=Rn(r,S),N=Q=>{P(Q),O.current===!1&&$(!1),f&&f(Q)},z=Q=>{k(Q),O.current===!0&&$(!0),g&&g(Q)},U=j({},d,{color:i,disabled:p,focusVisible:M,underline:b,variant:a,level:T,overlay:v,nesting:c}),V=Ete(U),q=j({},_,{component:C,slots:w,slotProps:I}),[F,B]=Se("root",{additionalProps:{onBlur:N,onFocus:z},ref:D,className:V.root,elementType:Mte,externalForwardedProps:q,ownerState:U}),[H,G]=Se("startDecorator",{className:V.startDecorator,elementType:Ote,externalForwardedProps:q,ownerState:U}),[Z,Y]=Se("endDecorator",{className:V.endDecorator,elementType:Rte,externalForwardedProps:q,ownerState:U});return E.jsx(Zu.Provider,{value:!0,children:E.jsxs(F,j({},B,{children:[y&&E.jsx(H,j({},G,{children:y})),kl(h,["Skeleton"])?R.cloneElement(h,{variant:h.props.variant||"inline"}):h,x&&E.jsx(Z,j({},Y,{children:x}))]}))})});function Dte(t){return et("MuiListDivider",t)}tt("MuiListDivider",["root","insetGutter","insetStartDecorator","insetStartContent","horizontal","vertical"]);const $te=["component","role","className","children","inset","orientation","slots","slotProps"],Lte=t=>{const{orientation:e,inset:r}=t,n={root:["root",e,r&&r!=="context"&&`inset${ke(r)}`]};return nt(n,Dte,{})},Fte=xe(zO,{name:"JoyListDivider",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({},t.inset==="context"&&{"--Divider-inset":"calc(-1 * var(--List-padding))"},t.row&&j({marginInline:"var(--ListDivider-gap)"},t.inset==="gutter"&&{marginBlock:"var(--ListItem-paddingY)"},t["data-first-child"]===void 0&&{marginInlineStart:"calc(var(--List-gap) + var(--ListDivider-gap))"}),!t.row&&j({},t["data-first-child"]===void 0&&{marginBlockStart:"calc(var(--List-gap) + var(--ListDivider-gap))"},{marginBlockEnd:"var(--ListDivider-gap)"},t.inset==="gutter"&&{marginInlineStart:"var(--ListItem-paddingLeft)",marginInlineEnd:"var(--ListItem-paddingRight)"},t.inset==="startDecorator"&&{marginInlineStart:"var(--ListItem-paddingLeft)"},t.inset==="startContent"&&{marginInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItemDecorator-size))"}))),Nte=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListDivider"}),i=R.useContext(Ml),o=R.useContext(Lx),{component:a,role:s,className:c,children:u,inset:d="context",orientation:h,slots:p={},slotProps:f={}}=n,g=Fe(n,$te),[m]=(o==null?void 0:o.split(":"))||["",""],v=a||(m&&!m.match(/^(ul|ol|menu)$/)?"div":"li"),b=s||(v==="li"?"separator":void 0),x=h||(i?"vertical":"horizontal"),y=j({},n,{inset:d,row:i,orientation:x,component:v,role:b}),C=Lte(y),w=j({},g,{component:v,slots:p,slotProps:f}),[I,_]=Se("root",{ref:r,className:ft(C.root,c),elementType:Fte,externalForwardedProps:w,ownerState:y,additionalProps:j({as:v,role:b},b==="separator"&&x==="vertical"&&{"aria-orientation":"vertical"})});return E.jsx(I,j({},_,{children:u}))});function jte(t){return et("MuiListItemDecorator",t)}tt("MuiListItemDecorator",["root"]);const Bte=["component","className","children","slots","slotProps"],zte=()=>nt({root:["root"]},jte,{}),Ute=xe("span",{name:"JoyListItemDecorator",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({boxSizing:"border-box",display:"inline-flex",alignItems:`var(--unstable_ListItemDecorator-alignItems, ${t.parentOrientation==="horizontal"?"center":"initial"})`},t.parentOrientation==="horizontal"?{minInlineSize:"var(--ListItemDecorator-size)",marginInlineEnd:"calc(-1 * var(--ListItem-gap))"}:{minBlockSize:"var(--ListItemDecorator-size)",justifyContent:"center",marginBlockEnd:"calc(-1 * var(--ListItem-gap))"})),rd=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyListItemDecorator"}),{component:i,className:o,children:a,slots:s={},slotProps:c={}}=n,u=Fe(n,Bte),d=R.useContext(Ux),h=j({parentOrientation:d},n),p=zte(),f=j({},u,{component:i,slots:s,slotProps:c}),[g,m]=Se("root",{ref:r,className:ft(p.root,o),elementType:Ute,externalForwardedProps:f,ownerState:h});return E.jsx(g,j({},m,{children:a}))});function Hte(t){return et("MuiMenu",t)}tt("MuiMenu",["root","listbox","expanded","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const Vte=["actions","children","color","component","disablePortal","keepMounted","id","invertedColors","onItemsChange","modifiers","variant","size","slots","slotProps"],Wte=t=>{const{open:e,variant:r,color:n,size:i}=t,o={root:["root",e&&"expanded",r&&`variant${ke(r)}`,n&&`color${ke(n)}`,i&&`size${ke(i)}`],listbox:["listbox"]};return nt(o,Hte,{})},VO=xe($l,{name:"JoyMenu",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;const i=(r=t.variants[e.variant])==null?void 0:r[e.color];return[j({"--focus-outline-offset":`calc(${t.vars.focus.thickness} * -1)`,"--ListItem-stickyBackground":(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Rf,{borderRadius:`var(--List-radius, ${t.vars.radius.sm})`,boxShadow:t.shadow.md,overflow:"auto",zIndex:`var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`},!(i!=null&&i.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup},e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(n=t.variants[e.variant])==null?void 0:n[e.color])]}),WO=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyMenu"}),{actions:o,children:a,color:s="neutral",component:c,disablePortal:u=!1,keepMounted:d=!1,id:h,invertedColors:p=!1,onItemsChange:f,modifiers:g,variant:m="outlined",size:v="md",slots:b={},slotProps:x={}}=i,y=Fe(i,Vte),{contextValue:C,getListboxProps:w,dispatch:I,open:_,triggerElement:T}=mK({onItemsChange:f,id:h,listboxRef:r});R.useImperativeHandle(o,()=>({dispatch:I,resetHighlight:()=>I({type:Zt.resetHighlight,event:null})}),[I]);const O=j({},i,{disablePortal:u,invertedColors:p,color:s,variant:m,size:v,open:_,nesting:!1,row:!1}),P=Wte(O),k=j({},y,{component:c,slots:b,slotProps:x}),S=R.useMemo(()=>[{name:"offset",options:{offset:[0,4]}},...g||[]],[g]),M=SE({elementType:VO,getSlotProps:w,externalForwardedProps:k,externalSlotProps:{},ownerState:O,additionalProps:{anchorEl:T,open:_&&T!==null,disablePortal:u,keepMounted:d,modifiers:S},className:P.root});return E.jsx(VO,j({},M,!((n=i.slots)!=null&&n.root)&&{as:bf,slots:{root:c||"ul"}},{children:E.jsx(gK,{value:C,children:E.jsx(Ff,{variant:p?void 0:m,color:s,children:E.jsx(Of.Provider,{value:"menu",children:E.jsx(Dl,{nested:!0,children:a})})})})}))});function qte(t){return et("MuiMenuButton",t)}tt("MuiMenuButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);const Gte=["children","color","component","disabled","endDecorator","loading","loadingPosition","loadingIndicator","size","slotProps","slots","startDecorator","variant"],Yte=t=>{const{color:e,disabled:r,fullWidth:n,size:i,variant:o,loading:a}=t,s={root:["root",r&&"disabled",n&&"fullWidth",o&&`variant${ke(o)}`,e&&`color${ke(e)}`,i&&`size${ke(i)}`,a&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]};return nt(s,qte,{})},Kte=xe("button",{name:"JoyMenuButton",slot:"Root",overridesResolver:(t,e)=>e.root})(LO),Jte=xe("span",{name:"JoyMenuButton",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Qte=xe("span",{name:"JoyMenuButton",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),Xte=xe("span",{name:"JoyMenuButton",slot:"LoadingCenter",overridesResolver:(t,e)=>e.loadingIndicatorCenter})(({theme:t,ownerState:e})=>{var r,n;return j({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color},e.disabled&&{color:(n=t.variants[`${e.variant}Disabled`])==null||(n=n[e.color])==null?void 0:n.color})}),qO=R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyMenuButton"}),{children:o,color:a="neutral",component:s,disabled:c=!1,endDecorator:u,loading:d=!1,loadingPosition:h="center",loadingIndicator:p,size:f="md",slotProps:g={},slots:m={},startDecorator:v,variant:b="outlined"}=i,x=Fe(i,Gte),y=R.useContext(Nf),C=e.variant||y.variant||b,w=e.size||y.size||f,I=(n=e.disabled)!=null?n:y.disabled||c||d,{getRootProps:_,open:T,active:O}=yK({rootRef:r,disabled:I}),P=p!=null?p:E.jsx(Kn,{color:a,thickness:{sm:2,md:3,lg:4}[w]||3}),k=j({},i,{active:O,color:a,disabled:I,open:T,size:w,variant:C}),S=Yte(k),M=j({},x,{component:s,slots:m,slotProps:g}),[$,D]=Se("root",{elementType:Kte,getSlotProps:_,externalForwardedProps:M,ref:r,ownerState:k,className:S.root}),[N,z]=Se("startDecorator",{className:S.startDecorator,elementType:Jte,externalForwardedProps:M,ownerState:k}),[U,V]=Se("endDecorator",{className:S.endDecorator,elementType:Qte,externalForwardedProps:M,ownerState:k}),[q,F]=Se("loadingIndicatorCenter",{className:S.loadingIndicatorCenter,elementType:Xte,externalForwardedProps:M,ownerState:k});return E.jsxs($,j({},D,{children:[(v||d&&h==="start")&&E.jsx(N,j({},z,{children:d&&h==="start"?P:v})),o,d&&h==="center"&&E.jsx(q,j({},F,{children:P})),(u||d&&h==="end")&&E.jsx(U,j({},V,{children:d&&h==="end"?P:u}))]}))});function Zte(t){return et("MuiMenuItem",t)}tt("MuiMenuItem",["root","focusVisible","disabled","selected","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const ere=["children","disabled","component","selected","color","orientation","variant","slots","slotProps","id"],tre=t=>{const{focusVisible:e,disabled:r,selected:n,color:i,variant:o}=t,a={root:["root",e&&"focusVisible",r&&"disabled",n&&"selected",i&&`color${ke(i)}`,o&&`variant${ke(o)}`]};return nt(a,Zte,{})},rre=xe(Ll,{name:"JoyMenuItem",slot:"Root",overridesResolver:(t,e)=>e.root})({}),nre=R.memo(R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyMenuItem"}),i=R.useContext(Ml),{children:o,disabled:a=!1,component:s="li",selected:c=!1,color:u="neutral",orientation:d="horizontal",variant:h="plain",slots:p={},slotProps:f={},id:g}=n,m=Fe(n,ere),{variant:v=h,color:b=u}=Lf(e.variant,e.color),{getRootProps:x,disabled:y,focusVisible:C}=wK({id:g,disabled:a,rootRef:r}),w=j({},n,{component:s,color:b,disabled:y,focusVisible:C,orientation:d,selected:c,row:i,variant:v}),I=tre(w),_=j({},m,{component:s,slots:p,slotProps:f}),[T,O]=Se("root",{ref:r,elementType:rre,getSlotProps:x,externalForwardedProps:_,className:I.root,ownerState:w});return E.jsx(Ux.Provider,{value:d,children:E.jsx(T,j({},O,{children:o}))})})),Xx=R.forwardRef(function(e,r){const{contextValue:n,id:i}=CK(e.id);return E.jsx(_a.Provider,{value:n,children:E.jsx(nre,j({},e,{id:i,ref:r}))})});function ire(t){return et("MuiModalClose",t)}tt("MuiModalClose",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);var GO;const ore=["component","color","variant","size","onClick","slots","slotProps"],are=t=>{const{variant:e,color:r,disabled:n,focusVisible:i,size:o}=t,a={root:["root",n&&"disabled",i&&"focusVisible",e&&`variant${ke(e)}`,r&&`color${ke(r)}`,o&&`size${ke(o)}`]};return nt(a,ire,{})},sre=xe(Xu,{name:"JoyModalClose",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>{var r;return j({},t.size==="sm"&&{"--IconButton-size":"1.75rem"},t.size==="md"&&{"--IconButton-size":"2rem"},t.size==="lg"&&{"--IconButton-size":"2.25rem"},{position:"absolute",zIndex:1,top:"var(--ModalClose-inset, 0.625rem)",right:"var(--ModalClose-inset, 0.625rem)",borderRadius:`var(--ModalClose-radius, ${e.vars.radius.sm})`},!((r=e.variants[t.variant])!=null&&(r=r[t.color])!=null&&r.backgroundColor)&&{color:e.vars.palette.text.secondary})}),lre={plain:"plain",outlined:"plain",soft:"soft",solid:"solid"},YO=R.forwardRef(function(e,r){var n,i,o,a,s,c;const u=Ze({props:e,name:"JoyModalClose"}),{component:d="button",color:h="neutral",variant:p="plain",size:f="md",onClick:g,slots:m={},slotProps:v={}}=u,b=Fe(u,ore),x=R.useContext(UO),y=R.useContext(Bf),C=(n=(i=e.variant)!=null?i:lre[y==null?void 0:y.variant])!=null?n:p,w=(o=(a=e.color)!=null?a:y==null?void 0:y.color)!=null?o:h,I=R.useContext(Jx),_=(s=(c=e.size)!=null?c:I)!=null?s:f,{focusVisible:T,getRootProps:O}=ao(j({},u,{rootRef:r})),P=j({},u,{color:w,component:d,variant:C,size:_,focusVisible:T}),k=are(P),[S,M]=Se("root",{ref:r,elementType:sre,getSlotProps:O,externalForwardedProps:j({onClick:$=>{x==null||x($,"closeClick"),g==null||g($)}},b,{component:d,slots:m,slotProps:v}),className:k.root,ownerState:P});return E.jsx(S,j({},M,{children:GO||(GO=E.jsx(bO,{}))}))}),cre=["className","children","invertedColors","orientation","color","component","variant","size","layout","maxWidth","minWidth","slots","slotProps"],ure=t=>{const{variant:e,color:r,size:n,layout:i}=t,o={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`,n&&`size${ke(n)}`,i&&`layout${ke(i)}`]};return nt(o,kee,{})};function KO(t,e){var r,n;return e&&(r=t.breakpoints)!=null&&r.values[e]?`${(n=t.breakpoints)==null?void 0:n.values[e]}px`:e}const dre=xe(FO,{name:"JoyModalDialog",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({"--ModalDialog-minWidth":typeof e.minWidth=="number"?`${e.minWidth}px`:KO(t,e.minWidth),"--ModalDialog-maxWidth":typeof e.maxWidth=="number"?`${e.maxWidth}px`:KO(t,e.maxWidth),"--ModalClose-radius":"max((var(--Card-radius) - var(--variant-borderWidth, 0px)) - var(--ModalClose-inset), min(var(--ModalClose-inset) / 2, (var(--Card-radius) - var(--variant-borderWidth, 0px)) / 2))"},e.variant==="solid"&&{"--DialogContent-color":"currentColor"},e.size==="sm"&&{"--Card-padding":"1rem","--ModalDialog-titleOffset":t.spacing(.25),"--ModalDialog-descriptionOffset":t.spacing(.25),"--ModalClose-inset":"0.375rem"},e.size==="md"&&{"--Card-padding":"1.25rem","--ModalDialog-titleOffset":t.spacing(.25),"--ModalDialog-descriptionOffset":t.spacing(.75),"--ModalClose-inset":"0.5rem"},e.size==="lg"&&{"--Card-padding":"1.5rem","--ModalDialog-titleOffset":t.spacing(.5),"--ModalDialog-descriptionOffset":t.spacing(1),"--ModalClose-inset":"0.625rem"},{boxSizing:"border-box",boxShadow:t.shadow.md,minWidth:"min(calc(100vw - 2 * var(--Card-padding)), var(--ModalDialog-minWidth, 300px))",outline:0,position:"absolute"},e.layout==="fullscreen"&&{top:0,left:0,right:0,bottom:0,border:0,borderRadius:0},e.layout==="center"&&{top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"min(calc(100vw - 2 * var(--Card-padding)), var(--ModalDialog-maxWidth, 100vw))",maxHeight:"calc(100% - 2 * var(--Card-padding))"},{[`& [id="${e["aria-labelledby"]}"]`]:{"--Typography-margin":"calc(-1 * var(--ModalDialog-titleOffset)) 0 var(--ModalDialog-gap) 0","--Typography-fontSize":"1.125em",[`& + [id="${e["aria-describedby"]}"]`]:{"--unstable_ModalDialog-descriptionOffset":"calc(-1 * var(--ModalDialog-descriptionOffset))"}},[`& [id="${e["aria-describedby"]}"]`]:{"--Typography-fontSize":"1em","--Typography-margin":"var(--unstable_ModalDialog-descriptionOffset, var(--ModalDialog-gap)) 0 0 0","&:not(:last-child)":{"--Typography-margin":"var(--unstable_ModalDialog-descriptionOffset, var(--ModalDialog-gap)) 0 var(--ModalDialog-gap) 0"}}})),Es=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoyModalDialog"}),{className:i,children:o,invertedColors:a=!1,orientation:s="vertical",color:c="neutral",component:u="div",variant:d="outlined",size:h="md",layout:p="center",maxWidth:f,minWidth:g,slots:m={},slotProps:v={}}=n,b=Fe(n,cre),x=j({},n,{color:c,component:u,maxWidth:f,minWidth:g,layout:p,size:h,variant:d,invertedColors:a}),y=ure(x),C=j({},b,{component:u,slots:m,slotProps:v}),w=Ia(),I=Ia(),_=R.useMemo(()=>({variant:d,color:c,labelledBy:w,describedBy:I}),[c,d,w,I]),[T,O]=Se("root",{ref:r,className:ft(y.root,i),elementType:dre,externalForwardedProps:C,ownerState:x,additionalProps:{as:u,role:"dialog","aria-modal":"true","aria-labelledby":w,"aria-describedby":I}});return E.jsx(Jx.Provider,{value:h,children:E.jsx(Bf.Provider,{value:_,children:E.jsx(T,j({},O,{children:R.Children.map(o,(P,k)=>{if(!R.isValidElement(P))return P;const S={};if(kl(P,["Divider"])){var M,$;const D=P.props;S.inset=(M=D==null?void 0:D.inset)!=null?M:"context";const N=s==="vertical"?"horizontal":"vertical";S.orientation=($=D==null?void 0:D.orientation)!=null?$:N}return k===0&&(S["data-first-child"]=""),k===R.Children.count(o)-1&&(S["data-last-child"]=""),R.cloneElement(P,S)})}))})})});function hre(t){return et("MuiOption",t)}const pre=tt("MuiOption",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","highlighted","variantPlain","variantSoft","variantOutlined","variantSolid"]),fre=["component","children","disabled","value","label","variant","color","slots","slotProps"],mre=t=>{const{disabled:e,highlighted:r,selected:n}=t;return nt({root:["root",e&&"disabled",r&&"highlighted",n&&"selected"]},hre,{})},gre=xe(Ll,{name:"JoyOption",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r;const n=(r=t.variants[`${e.variant}Hover`])==null?void 0:r[e.color];return{[`&.${pre.highlighted}:not([aria-selected="true"])`]:{backgroundColor:n==null?void 0:n.backgroundColor}}}),vre=R.memo(R.forwardRef(function(e,r){var n;const i=Ze({props:e,name:"JoyOption"}),{component:o="li",children:a,disabled:s=!1,value:c,label:u,variant:d="plain",color:h="neutral",slots:p={},slotProps:f={}}=i,g=Fe(i,fre),m=R.useContext(Ml),{variant:v=d,color:b=h}=Lf(e.variant,e.color),x=R.useRef(null),y=Rn(x,r),C=u!=null?u:typeof a=="string"?a:(n=x.current)==null?void 0:n.innerText,{getRootProps:w,selected:I,highlighted:_,index:T}=RK({disabled:s,label:C,value:c,rootRef:y}),O=j({},i,{disabled:s,selected:I,highlighted:_,index:T,component:o,variant:v,color:b,row:m}),P=mre(O),k=j({},g,{component:o,slots:p,slotProps:f}),[S,M]=Se("root",{ref:r,getSlotProps:w,elementType:gre,externalForwardedProps:k,className:P.root,ownerState:O});return E.jsx(S,j({},M,{children:a}))})),qt=R.forwardRef(function(e,r){const{contextValue:n}=MK(e.value);return E.jsx(_a.Provider,{value:n,children:E.jsx(vre,j({},e,{ref:r}))})}),yre=Aa(E.jsx("path",{d:"m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z"}),"Unfold");function bre(t){return et("MuiSelect",t)}const co=tt("MuiSelect",["root","button","indicator","startDecorator","endDecorator","popper","listbox","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","focusVisible","disabled","expanded","multiple"]);var JO;const xre=["action","autoFocus","children","defaultValue","defaultListboxOpen","disabled","getSerializedValue","placeholder","listboxId","listboxOpen","onChange","onListboxOpenChange","onClose","renderValue","required","value","size","variant","color","startDecorator","endDecorator","indicator","aria-describedby","aria-label","aria-labelledby","id","name","multiple","slots","slotProps"];function wre(t){var e;return Array.isArray(t)?E.jsx(R.Fragment,{children:t.map(r=>r.label).join(", ")}):(e=t==null?void 0:t.label)!=null?e:""}const Cre=[{name:"offset",options:{offset:[0,4]}},{name:"equalWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`}}],Ire=t=>{const{color:e,disabled:r,focusVisible:n,size:i,variant:o,open:a,multiple:s}=t,c={root:["root",r&&"disabled",n&&"focusVisible",a&&"expanded",o&&`variant${ke(o)}`,e&&`color${ke(e)}`,i&&`size${ke(i)}`,s&&"multiple"],button:["button"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],indicator:["indicator",a&&"expanded"],listbox:["listbox",a&&"expanded",r&&"disabled"]};return nt(c,bre,{})},Sre=xe("div",{name:"JoySelect",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n,i,o,a;const s=(r=t.variants[`${e.variant}`])==null?void 0:r[e.color],{borderRadius:c}=Mo({theme:t,ownerState:e},["borderRadius"]);return[j({"--Select-radius":t.vars.radius.sm,"--Select-gap":"0.5rem","--Select-placeholderOpacity":.64,"--Select-decoratorColor":t.vars.palette.text.icon,"--Select-focusedThickness":t.vars.focus.thickness,"--Select-focusedHighlight":(n=t.vars.palette[e.color==="neutral"?"primary":e.color])==null?void 0:n[500],'&:not([data-inverted-colors="false"])':j({},e.instanceColor&&{"--_Select-focusedHighlight":(i=t.vars.palette[e.instanceColor==="neutral"?"primary":e.instanceColor])==null?void 0:i[500]},{"--Select-focusedHighlight":t.vars.palette.focusVisible}),"--Select-indicatorColor":s!=null&&s.backgroundColor?s==null?void 0:s.color:t.vars.palette.text.tertiary},e.size==="sm"&&{"--Select-minHeight":"2rem","--Select-paddingInline":"0.5rem","--Select-decoratorChildHeight":"min(1.5rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},e.size==="md"&&{"--Select-minHeight":"2.25rem","--Select-paddingInline":"0.75rem","--Select-decoratorChildHeight":"min(1.75rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},e.size==="lg"&&{"--Select-minHeight":"2.75rem","--Select-paddingInline":"1rem","--Select-decoratorChildHeight":"min(2.375rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--Select-decoratorChildOffset":"min(calc(var(--Select-paddingInline) - (var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2), var(--Select-paddingInline))","--_Select-paddingBlock":"max((var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2, 0px)","--Select-decoratorChildRadius":"max(var(--Select-radius) - var(--variant-borderWidth, 0px) - var(--_Select-paddingBlock), min(var(--_Select-paddingBlock) + var(--variant-borderWidth, 0px), var(--Select-radius) / 2))","--Button-minHeight":"var(--Select-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Select-decoratorChildHeight)","--Button-radius":"var(--Select-decoratorChildRadius)","--IconButton-radius":"var(--Select-decoratorChildRadius)",boxSizing:"border-box"},e.variant!=="plain"&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Select-minHeight)",position:"relative",display:"flex",alignItems:"center",borderRadius:"var(--Select-radius)",cursor:"pointer"},!(s!=null&&s.backgroundColor)&&{backgroundColor:t.vars.palette.background.surface},e.size&&{paddingBlock:{sm:2,md:3,lg:4}[e.size]},{paddingInline:"var(--Select-paddingInline)"},t.typography[`body-${e.size}`],s,{"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)"},[`&.${co.focusVisible}`]:{"--Select-indicatorColor":s==null?void 0:s.color,"&::before":{boxShadow:"inset 0 0 0 var(--Select-focusedThickness) var(--Select-focusedHighlight)"}},[`&.${co.disabled}`]:{"--Select-indicatorColor":"inherit"}}),{"&:hover":(o=t.variants[`${e.variant}Hover`])==null?void 0:o[e.color],[`&.${co.disabled}`]:(a=t.variants[`${e.variant}Disabled`])==null?void 0:a[e.color]},c!==void 0&&{"--Select-radius":c}]}),_re=xe("button",{name:"JoySelect",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({border:0,outline:0,background:"none",padding:0,fontSize:"inherit",color:"inherit",alignSelf:"stretch",display:"flex",alignItems:"center",flex:1,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap",overflow:"hidden"},(t.value===null||t.value===void 0)&&{opacity:"var(--Select-placeholderOpacity)"},{"&::before":{content:'""',display:"block",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",borderRadius:"var(--Select-radius)"}})),Tre=xe($l,{name:"JoySelect",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t,ownerState:e})=>{var r;const n=(r=t.variants[e.variant])==null?void 0:r[e.color];return j({"--focus-outline-offset":`calc(${t.vars.focus.thickness} * -1)`,"--ListItem-stickyBackground":(n==null?void 0:n.backgroundColor)||(n==null?void 0:n.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Rf,{minWidth:"max-content",maxHeight:"44vh",overflow:"auto",outline:0,boxShadow:t.shadow.md,borderRadius:`var(--List-radius, ${t.vars.radius.sm})`,zIndex:`var(--unstable_popup-zIndex, ${t.vars.zIndex.popup})`},!(n!=null&&n.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup})}),kre=xe("span",{name:"JoySelect",slot:"StartDecorator",overridesResolver:(t,e)=>e.startDecorator})({"--Button-margin":"0 0 0 calc(var(--Select-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Select-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Select-paddingInline) / -4)",display:"inherit",alignItems:"center",color:"var(--Select-decoratorColor)",marginInlineEnd:"var(--Select-gap)"}),Are=xe("span",{name:"JoySelect",slot:"EndDecorator",overridesResolver:(t,e)=>e.endDecorator})({"--Button-margin":"0 calc(var(--Select-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Select-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Select-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",color:"var(--Select-decoratorColor)",marginInlineStart:"var(--Select-gap)"}),Pre=xe("span",{name:"JoySelect",slot:"Indicator"})(({ownerState:t,theme:e})=>j({},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2},{"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,display:"inherit",alignItems:"center",marginInlineStart:"var(--Select-gap)",marginInlineEnd:"calc(var(--Select-paddingInline) / -4)",[`.${co.endDecorator} + &`]:{marginInlineStart:"calc(var(--Select-gap) / 2)"},[`&.${co.expanded}, .${co.disabled} > &`]:{"--Icon-color":"currentColor"}})),br=R.forwardRef(function(e,r){var n,i,o,a,s,c,u;const d=Ze({props:e,name:"JoySelect"}),h=d,{action:p,autoFocus:f,children:g,defaultValue:m,defaultListboxOpen:v=!1,disabled:b,getSerializedValue:x,placeholder:y,listboxId:C,listboxOpen:w,onChange:I,onListboxOpenChange:_,onClose:T,renderValue:O,required:P=!1,value:k,size:S="md",variant:M="outlined",color:$="neutral",startDecorator:D,endDecorator:N,indicator:z=JO||(JO=E.jsx(yre,{})),"aria-describedby":U,"aria-label":V,"aria-labelledby":q,id:F,name:B,multiple:H=!1,slots:G={},slotProps:Z={}}=h,Y=Fe(h,xre),Q=R.useContext(Ea),K=(n=(i=e.disabled)!=null?i:Q==null?void 0:Q.disabled)!=null?n:b,X=(o=(a=e.size)!=null?a:Q==null?void 0:Q.size)!=null?o:S,ee=(s=e.color)!=null?s:Q!=null&&Q.error?"danger":(c=Q==null?void 0:Q.color)!=null?c:$,ae=O!=null?O:wre,[oe,Ce]=R.useState(null),be=R.useRef(null),ge=R.useRef(null),ve=Rn(r,be);R.useImperativeHandle(p,()=>({focusVisible:()=>{var ue;(ue=ge.current)==null||ue.focus()}}),[]),R.useEffect(()=>{Ce(be.current)},[]),R.useEffect(()=>{f&&ge.current.focus()},[f]);const fe=R.useCallback(ue=>{_==null||_(ue),ue||T==null||T()},[T,_]),{buttonActive:ne,buttonFocusVisible:le,contextValue:he,disabled:ye,getButtonProps:pe,getListboxProps:Le,getHiddenInputProps:He,getOptionMetadata:Ve,open:pt,value:ot}=QJ({buttonRef:ge,defaultOpen:v,defaultValue:m,disabled:K,getSerializedValue:x,listboxId:C,multiple:H,name:B,required:P,onChange:I,onOpenChange:fe,open:w,value:k}),we=j({},d,{active:ne,defaultListboxOpen:v,disabled:ye,focusVisible:le,open:pt,renderValue:ae,value:ot,size:X,variant:M,color:ee}),Ee=Ire(we),Ae=j({},Y,{slots:G,slotProps:Z}),We=R.useMemo(()=>{let ue;if(H)ue=ot.map(De=>Ve(De)).filter(De=>De!==void 0);else{var de;ue=(de=Ve(ot))!=null?de:null}return ue},[Ve,ot,H]),[Me,$e]=Se("root",{ref:ve,className:Ee.root,elementType:Sre,externalForwardedProps:Ae,ownerState:we}),[Je,Ge]=Se("button",{additionalProps:{"aria-describedby":U!=null?U:Q==null?void 0:Q["aria-describedby"],"aria-label":V,"aria-labelledby":q!=null?q:Q==null?void 0:Q.labelId,"aria-required":P?"true":void 0,id:F!=null?F:Q==null?void 0:Q.htmlFor,name:B},className:Ee.button,elementType:_re,externalForwardedProps:Ae,getSlotProps:pe,ownerState:we}),[Nt,It]=Se("listbox",{additionalProps:{anchorEl:oe,open:pt,placement:"bottom",keepMounted:!0},className:Ee.listbox,elementType:Tre,externalForwardedProps:Ae,getSlotProps:Le,ownerState:j({},we,{nesting:!1,row:!1,wrap:!1}),getSlotOwnerState:ue=>({size:ue.size||X,variant:ue.variant||M,color:ue.color||(ue.disablePortal?ee:$),disableColorInversion:!ue.disablePortal})}),[Br,hr]=Se("startDecorator",{className:Ee.startDecorator,elementType:kre,externalForwardedProps:Ae,ownerState:we}),[Ht,Ot]=Se("endDecorator",{className:Ee.endDecorator,elementType:Are,externalForwardedProps:Ae,ownerState:we}),[Tt,Mt]=Se("indicator",{className:Ee.indicator,elementType:Pre,externalForwardedProps:Ae,ownerState:we}),te=R.useMemo(()=>[...Cre,...It.modifiers||[]],[It.modifiers]);let ie=y;return(Array.isArray(We)&&We.length>0||!Array.isArray(We)&&We)&&(ie=ae(We)),E.jsxs(R.Fragment,{children:[E.jsxs(Me,j({},$e,{children:[D&&E.jsx(Br,j({},hr,{children:D})),E.jsx(Je,j({},Ge,{children:ie})),N&&E.jsx(Ht,j({},Ot,{children:N})),z&&E.jsx(Tt,j({},Mt,{children:z})),E.jsx("input",j({},He()))]})),oe&&E.jsx(Nt,j({},It,{className:ft(It.className),modifiers:te},!((u=d.slots)!=null&&u.listbox)&&{as:bf,slots:{root:It.as||"ul"}},{children:E.jsx(XJ,{value:he,children:E.jsx(Ff,{variant:M,color:$,children:E.jsx(Of.Provider,{value:"select",children:E.jsx(Dl,{nested:!0,children:g})})})})}))]})});function Ere(t){return et("MuiSheet",t)}tt("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const Ore=["className","color","component","variant","invertedColors","slots","slotProps"],Rre=t=>{const{variant:e,color:r}=t,n={root:["root",e&&`variant${ke(e)}`,r&&`color${ke(r)}`]};return nt(n,Ere,{})},Mre=xe("div",{name:"JoySheet",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>{var r,n;const i=(r=t.variants[e.variant])==null?void 0:r[e.color],{borderRadius:o,bgcolor:a,backgroundColor:s,background:c}=Mo({theme:t,ownerState:e},["borderRadius","bgcolor","backgroundColor","background"]),u=Ca(t,`palette.${a}`)||a||Ca(t,`palette.${s}`)||s||c||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.surface;return[j({"--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--ListItem-stickyBackground":u==="transparent"?"initial":u,"--Sheet-background":u==="transparent"?"initial":u},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:t.vars.palette.background.surface,position:"relative"}),j({},t.typography["body-md"],e.variant==="solid"&&e.color&&e.invertedColors&&Ju(e.color)(t),e.variant==="soft"&&e.color&&e.invertedColors&&Qu(e.color)(t),(n=t.variants[e.variant])==null?void 0:n[e.color],i)]}),zl=R.forwardRef(function(e,r){const n=Ze({props:e,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:s="plain",invertedColors:c=!1,slots:u={},slotProps:d={}}=n,h=Fe(n,Ore),p=j({},n,{color:o,component:a,invertedColors:c,variant:s}),f=Rre(p),g=j({},h,{component:a,slots:u,slotProps:d}),[m,v]=Se("root",{ref:r,className:ft(f.root,i),elementType:Mre,externalForwardedProps:g,ownerState:p});return E.jsx(m,j({},v))});function Dre(t){return et("MuiSkeleton",t)}tt("MuiSkeleton",["root","variantOverlay","variantCircular","variantRectangular","variantText","variantInline","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs"]);const $re=["className","component","children","animation","overlay","loading","variant","level","height","width","sx","slots","slotProps"];let nd=t=>t,QO,XO,ZO,eR,tR;const Lre=t=>{const{variant:e,level:r}=t,n={root:["root",e&&`variant${ke(e)}`,r&&`level${ke(r)}`]};return nt(n,Dre,{})},rR=gs(QO||(QO=nd`
|
|
71
71
|
0% {
|
|
72
72
|
opacity: 1;
|
|
73
73
|
}
|
|
@@ -3636,7 +3636,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3636
3636
|
data-poll-url="${c}"`:"",g=`<div
|
|
3637
3637
|
data-component="fu-widget"
|
|
3638
3638
|
data-content-type="list"${d}${h}${p}${f}
|
|
3639
|
-
></div>`,m=({title:b})=>A.jsx(Et,{title:b,sx:{maxWidth:300},children:A.jsx(Ac,{color:"primary"})}),v=()=>A.jsxs(hn,{sx:{pb:1,mb:3},children:[A.jsx(wo,{label:e.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:A.jsx(m,{title:e.quizzesInfoMessage}),onChange:b=>o(b.target.value)}),A.jsx(wo,{label:e.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:A.jsx(m,{title:e.eitherOrsInfoMessage}),onChange:b=>s(b.target.value)}),A.jsx(wo,{label:e.pollURL,placeholder:"",defaultValue:c,required:!1,size:"md",endDecorator:A.jsx(m,{title:e.pollsInfoMessage}),onChange:b=>u(b.target.value)})]});return A.jsxs(Oe,{mt:1,children:[A.jsx(ov,{defaultValue:r,label:e.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:b=>{b===!1&&(o(""),s(""),u("")),n(b)}}),r&&v(),A.jsxs(Oe,{position:"relative",mb:1,children:[A.jsx(zf,{value:g,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:b=>b.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),A.jsx(Et,{title:e.copyToClipboard,children:A.jsx(lt,{onClick:()=>{navigator.clipboard.writeText(g)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:A.jsx(rm,{})})})]}),A.jsx(Wx,{variant:"outlined",color:"primary",startDecorator:A.jsx(Ac,{}),sx:{mb:1,width:"fit-content"},children:A.jsxs(ze,{color:"primary",fontSize:14,fontWeight:500,children:[e.divElementTextInfo,A.jsx(Ps,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},bB=t=>(t==null?void 0:t.map(e=>({id:e.id,value:e.nickname?e.nickname:e.name||`No name ${e.id.slice(0,5)}`,label:e.nickname?e.nickname:e.name||`No name ${e.id.slice(0,5)}`,avatar:e.avatar})))||[],_Ee=({labels:t,ids:e,onChange:r})=>{const[n,i]=W.useState([]),[o,a]=W.useState([]),[s,c]=W.useState(""),[u,d]=W.useState("name"),[h,p]=W.useState(!1),[f,g]=W.useState(!1),{sdk:m}=qr(),v=!0,b=()=>g(!f),x=(I,_)=>{i(_);const T=_.map(O=>O.id);r(T&&T.length?T:null)},y=3;W.useEffect(()=>{!s&&e&&e.length&&m.profile.getByIds(e,void 0,v).then(I=>{i(bB(I))}).catch(I=>{b(),console.error(I),i([])})},[]);const C=W.useMemo(()=>Xs((I,_)=>{p(!0),m.profile.getByIds(_==="id"?[I]:[],_==="name"?I:void 0,v).then(T=>{a([...bB(T)]),p(!1)}).catch(T=>{console.error(T),b(),a([]),p(!1)})},300),[]);W.useEffect(()=>{if(!s||s.length<y){a([]);return}return C(s,u),()=>C.cancel()},[s,C,u]);const w=(I,_)=>I.map((T,O)=>{var P;return A.jsx(dn,{variant:"solid",endDecorator:A.jsx(Pa,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>_({index:O}).onClick(k),children:A.jsx(Ms,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:A.jsxs(Oe,{display:"flex",alignItems:"center",mr:1,children:[A.jsx(Sn,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(P=T.avatar)!=null?P:jr.avatar}),A.jsx(ze,{children:T.label})]})},T.id)});return A.jsxs(A.Fragment,{children:[A.jsx(Oe,{sx:{marginBottom:"16px"},children:A.jsx(Ss,{forcePopupIcon:!1,multiple:!0,loading:h,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(I,_)=>I.id===_.id,endDecorator:A.jsxs(A.Fragment,{children:[h&&A.jsx(Kn,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),A.jsx(Ni,{orientation:"vertical"}),A.jsxs(br,{variant:"plain",value:u,onChange:(I,_)=>d(_),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[A.jsx(qt,{value:"name",children:t.searchByName}),A.jsx(qt,{value:"id",children:t.searchById})]})]}),placeholder:n.length>0?"":t.excludedProfilesPlaceholder,options:o,filterOptions:I=>I.filter(_=>!n.some(T=>T.value===_.value)),onInputChange:(I,_)=>{c(_)},onChange:x,getOptionKey:I=>I.id,value:n,renderTags:w,renderOption:(I,_)=>{var T;return A.jsx(Is,me(se({},I),{children:A.jsxs(Oe,{display:"flex",alignItems:"center",mr:1,children:[A.jsx(Sn,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(T=_.avatar)!=null?T:jr.avatar}),A.jsx(ze,{children:_.label})]})}))}})}),A.jsx(Nr,{showToast:f,message:t.searchProfilesErrorMessage,color:"danger",hideToast:b})]})},TEe={Login:oSe,InformationInput:wo,RichText:bI,HeaderButtons:Mwe,MarketSelection:xSe,Accordion:yye,DynamicFields:Qwe,BasicSelect:xye,BooleanSwitch:ov,Branding:Rwe,ProfileSearchSelect:z_e,RangeCalendar:Kwe,CompetitionSearchSelect:j_e,Related:SSe,Images:$1e,Duration:Ywe,DatePickerComponent:ah,Flags:O1e,Spinner:iv,Tags:zN,Toast:Nr,AdContent:bye,Match:wSe,Winners:Pke,CompetitionsSearchSelect:B_e,TeamsSearchSelect:U_e,CustomSelect:BSe,Schedule:MSe,NoPermissionCard:Jwe,CustomFlatpickrCalendar:r1,ContextSelectFilter:Oke,NumberInput:nAe,EntityContext:uAe,MiniGamesImages:hAe,AuthRequirement:pAe,SortableList:iEe,ItemsPerPageFilter:oEe,ImageCard:hh,RelatedRelationship:bEe,ExportUsersLeads:xEe,SignOutButton:mF,BasicSortableList:CEe,WidgetEmbedCode:IEe,WidgetListEmbedCode:SEe,AdvancedProfileSearchSelect:_Ee},xB=W.createContext(null),kEe=({children:t})=>A.jsx(xB.Provider,{value:TEe,children:t}),AEe=()=>{const t=W.useContext(xB);if(!t)throw new Error("useComponentContext must be used within a ComponentProvider");return t},wB=425,CB=1024,PEe=()=>{const[t,e]=W.useState(window.innerWidth<=CB),[r,n]=W.useState(window.innerWidth<=wB);return W.useLayoutEffect(()=>{const i=()=>{e(window.innerWidth<=CB),n(window.innerWidth<=wB)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:t,isPhone:r}},er={APIProvider:Rfe,AuthProvider:Mfe,AuthContext:K$,ComponentProvider:kEe,useComponentContext:AEe,useAPIContext:qr,useIsMobile:PEe};class IB{constructor(){l(this,"types",[]);l(this,"languageConfig",null);l(this,"authRequirement",null)}}class EEe{constructor(e){l(this,"userNotFound");l(this,"signOut");l(this,"timeFormat");l(this,"getEitherOrsErrorMessage");l(this,"title");l(this,"noGamesFound");l(this,"status");l(this,"totalParticipations");l(this,"finishedParticipations");l(this,"users");l(this,"averageStartedParticipations");l(this,"averageFinishedParticipations");l(this,"creationDate");l(this,"actions");l(this,"create");l(this,"edit");l(this,"save");l(this,"preview");l(this,"previewGame");l(this,"close");l(this,"filterBy");l(this,"sortBy");l(this,"clearStatus");l(this,"contextEntityTag");l(this,"typeContextTagNamePlaceholder");l(this,"showMoreImages");l(this,"hideMoreImages");l(this,"uploadImage");l(this,"groupByStatus");l(this,"copyUrl");l(this,"copied");l(this,"add");l(this,"configuration");l(this,"description");l(this,"descriptionPlaceholder");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,"rules");l(this,"rulesPlaceholder");l(this,"adContent");l(this,"adContentPlaceholder");l(this,"optionImages");l(this,"imagePlaceholder");l(this,"main");l(this,"cover");l(this,"mobile");l(this,"active");l(this,"inactive");l(this,"statusDescription");l(this,"winningCondition");l(this,"winningConditionDescription");l(this,"more");l(this,"less");l(this,"time");l(this,"timeDescription");l(this,"lives");l(this,"livesDescription");l(this,"points");l(this,"pointsDescription");l(this,"streakThreshold");l(this,"pointsCorrectSteps");l(this,"pointsCorrectStepsPlaceholder");l(this,"pointsScore");l(this,"pointsScorePlaceholder");l(this,"optionsValue");l(this,"optionsValuePlaceholder");l(this,"repeatedValueMessage");l(this,"flags");l(this,"flagsPlaceholder");l(this,"labels");l(this,"customFields");l(this,"dynamicFieldsDescription");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,"entity");l(this,"campaign");l(this,"id");l(this,"label");l(this,"type");l(this,"typeDescription");l(this,"deleteLabel");l(this,"hideFilters");l(this,"showFilters");l(this,"previous");l(this,"next");l(this,"exportAllUsers");l(this,"getFootballEntitiesErrorMessage");l(this,"titleRequiredFieldValidationMessage");l(this,"livesFieldValidationMessage");l(this,"timeFieldValidationMessage");l(this,"pointsFieldValidationMessage");l(this,"optionsFieldValidationMessage");l(this,"tagsInvalidFieldValidationMessage");l(this,"getEitherOrErrorMessage");l(this,"deleteEitherOrMessage");l(this,"deleteEitherOrErrorMessage");l(this,"createEitherOrMessage");l(this,"createEitherOrErrorMessage");l(this,"updateEitherOrMessage");l(this,"updateEitherOrErrorMessage");l(this,"updateEitherOrTranslationErrorMessage");l(this,"uploadingImageMessage");l(this,"generateSignedInUrlErrorMessage");l(this,"uploadingImageErrorMessage");l(this,"encryptingImageErrorMessage");l(this,"searchSportal365ImagesErrorMessage");l(this,"usersExportMessage");l(this,"usersExportErrorMessage");l(this,"createFromTemplate");l(this,"browseEitherOrGames");l(this,"noTemplateGamesFound");l(this,"expand");l(this,"import");l(this,"translateAndImport");l(this,"clientFeaturesNotFoundMessage");l(this,"featureDisabled");l(this,"noPermissionMessage");l(this,"tryAgainButton");l(this,"expired");l(this,"sortByCreatedAtAsc");l(this,"sortByCreatedAtDesc");l(this,"sortByUpdatedAtAsc");l(this,"sortByUpdatedAtDesc");l(this,"itemsPerPage");l(this,"pageNo");l(this,"additionalInformation");l(this,"deleteEitherOrTitle");l(this,"deleteEitherOrDescription");l(this,"manageEitherOrTitle");l(this,"manageEitherOrDescription");l(this,"back");l(this,"alternativeTitle");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,"urlCopiedToClipboardMessage");l(this,"imageDeletedMessage");l(this,"imageResetMessage");l(this,"authRequirement");l(this,"authRequirementDescription");l(this,"free");l(this,"lead");l(this,"registered");l(this,"language");l(this,"languageDescription");l(this,"addOption");l(this,"removeOption");l(this,"addImages");l(this,"additionalFields");l(this,"addPoint");l(this,"removePoint");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,"reports");l(this,"exports");l(this,"exportUsersData");l(this,"category");l(this,"action");l(this,"exportAllUsersDescription");l(this,"participations");l(this,"standings");l(this,"noStandingsAvailable");l(this,"standingsErrorMessage");l(this,"participationOverview");l(this,"performanceByDay");l(this,"chartErrorMessage");l(this,"exportUsersForOption");l(this,"exportAllUsersForOption");l(this,"exportForOption");l(this,"languagesModalTitle");l(this,"languagesModalDescription");l(this,"languagesModalSave");l(this,"languageParentText");l(this,"gameTranslationErrorMessage");l(this,"translateTo");l(this,"exportUsersWithMinPoints");l(this,"exportUsersWithMinPointsDescription");l(this,"exportUsersLeads");l(this,"exportAllUsersLeads");l(this,"exportAllUsersLeadsDescription");l(this,"usersLeadsExportMessage");l(this,"usersLeadsExportErrorMessage");l(this,"related");l(this,"relationship");l(this,"relatedEntitiesErrorMessage");l(this,"widgetEmbedCodeTitle");l(this,"configureLeads");l(this,"configureLeadsDisabledMessage");l(this,"leadPosition");l(this,"addCampaignInfo");l(this,"campaignIdInfoMessage");l(this,"campaignNameInfoMessage");l(this,"copyToClipboard");l(this,"divElementTextInfo");l(this,"widgetEmbedCodeNotAvailable");this.userNotFound=(e==null?void 0: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==null?void 0:e.featureDisabled)||"Feature disabled!",this.noPermissionMessage=(e==null?void 0:e.noPermissionMessage)||"You have no permission for this feature!",this.tryAgainButton=(e==null?void 0:e.tryAgainButton)||"Try again",this.signOut=(e==null?void 0:e.signOut)||"Sign out",this.noGamesFound=(e==null?void 0:e.noGamesFound)||"No Either/Or games were found. You can create one by clicking the button 'Create'",this.timeFormat=(e==null?void 0:e.timeFormat)||"DD.MM.YYYY, HH:mm",this.getEitherOrsErrorMessage=(e==null?void 0:e.getEitherOrsErrorMessage)||"There was a problem with fetching list of Either/Or games",this.title=e&&e.title?e.title:"Title",this.status=e&&e.status?e.status:"Status",this.totalParticipations=(e==null?void 0:e.totalParticipations)||"Total participations",this.finishedParticipations=(e==null?void 0:e.finishedParticipations)||"Finished participations",this.users=(e==null?void 0:e.users)||"Users",this.averageStartedParticipations=(e==null?void 0:e.averageStartedParticipations)||"Average started participations",this.averageFinishedParticipations=(e==null?void 0:e.averageFinishedParticipations)||"Average finished participations",this.creationDate=e&&e.creationDate?e.creationDate:"Created at",this.actions=e&&e.actions?e.actions:"Actions",this.language=(e==null?void 0:e.language)||"Language",this.languageDescription=(e==null?void 0:e.languageDescription)||"Select the language for your game. You can manage language selection by configuring available languages in language configuration. It cannot be changed if multilingual feature is in use.",this.sortByCreatedAtAsc=(e==null?void 0:e.sortByCreatedAtAsc)||"Sort by created at field in ascending order",this.sortByCreatedAtDesc=(e==null?void 0:e.sortByCreatedAtDesc)||"Sort by created at field in descending order",this.sortByUpdatedAtAsc=(e==null?void 0:e.sortByUpdatedAtAsc)||"Sort by updated at field in ascending order",this.sortByUpdatedAtDesc=(e==null?void 0:e.sortByUpdatedAtDesc)||"Sort by updated at field in descending order",this.itemsPerPage=(e==null?void 0:e.itemsPerPage)||"Items per page",this.pageNo=(e==null?void 0:e.pageNo)||"Page No",this.additionalInformation=(e==null?void 0:e.additionalInformation)||"Additional information",this.exports=(e==null?void 0:e.exports)||"Exports",this.reports=(e==null?void 0:e.reports)||"Reports",this.standings=(e==null?void 0:e.standings)||"Standings",this.noStandingsAvailable=(e==null?void 0:e.noStandingsAvailable)||"No standings available.",this.standingsErrorMessage=(e==null?void 0:e.standingsErrorMessage)||"There was a problem with fetching information about either/or game standings. Please try again",this.participations=(e==null?void 0:e.participations)||"Participations",this.participationOverview=(e==null?void 0:e.participationOverview)||"Participation Overview",this.performanceByDay=(e==null?void 0:e.performanceByDay)||"Performance by day",this.chartErrorMessage=(e==null?void 0:e.chartErrorMessage)||"There was a problem with fetching information about either/or game participation. Please try again",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 participated in the game.",this.exportUsersWithMinPoints=(e==null?void 0:e.exportUsersWithMinPoints)||"Export all users with at least _minPoints_ points",this.exportUsersWithMinPointsDescription=(e==null?void 0:e.exportUsersWithMinPointsDescription)||"Exports the users who got at least _minPoints_ points in the game.",this.usersExportMessage=(e==null?void 0:e.usersExportMessage)||"All users have been exported successfully",this.usersExportErrorMessage=(e==null?void 0:e.usersExportErrorMessage)||"There was a problem with exporting users. Please try again",this.createFromTemplate=(e==null?void 0:e.createFromTemplate)||"Create from template",this.browseEitherOrGames=(e==null?void 0:e.browseEitherOrGames)||"Browse Either/Or Games",this.noTemplateGamesFound=(e==null?void 0:e.noTemplateGamesFound)||"No Either/Or games were found.",this.expand=(e==null?void 0:e.expand)||"Expand",this.import=(e==null?void 0:e.import)||"Import",this.translateAndImport=(e==null?void 0:e.translateAndImport)||"Translate to _language_ and Import",this.manageEitherOrTitle=(e==null?void 0:e.manageEitherOrTitle)||"Manage Either/Or",this.manageEitherOrDescription=(e==null?void 0:e.manageEitherOrDescription)||"Manage your Either/Or game here",this.back=(e==null?void 0:e.back)||"Back",this.alternativeTitle=(e==null?void 0:e.alternativeTitle)||"Alternative title",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.previewGame=e&&e.previewGame?e.previewGame:"Preview Either/Or",this.close=e&&e.close?e.close:"Close",this.sortBy=(e==null?void 0:e.sortBy)||"Sort by:",this.contextEntityTag=(e==null?void 0:e.contextEntityTag)||"Context entity tag",this.typeContextTagNamePlaceholder=(e==null?void 0:e.typeContextTagNamePlaceholder)||"Type context tag name...",this.getFootballEntitiesErrorMessage=(e==null?void 0:e.getFootballEntitiesErrorMessage)||"There was a problem with fetching football's data",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.groupByStatus=(e==null?void 0:e.groupByStatus)||"Group by status",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.description=e&&e.description?e.description:"Description",this.descriptionPlaceholder=e&&e.descriptionPlaceholder?e.descriptionPlaceholder:"Describe your Either/Or",this.images=e&&e.images?e.images:"Images",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 in Either/Or",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.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.winningCondition=(e==null?void 0:e.winningCondition)||"Winning condition",this.winningConditionDescription=(e==null?void 0:e.winningConditionDescription)||"Winning condition determines the correct choice out of a pair of options presented to the user. When is set to 'More,' the user must select the option that has a greater value to win. Conversely, if is set to 'Less,' the winning choice is the one with the lesser value",this.more=(e==null?void 0:e.more)||"More",this.less=(e==null?void 0:e.less)||"Less",this.time=e&&e.time?e.time:"Time",this.timeDescription=e&&e.timeDescription?e.timeDescription:"Enter the time limit for answering questions by users. Time is in seconds",this.lives=(e==null?void 0:e.lives)||"Lives",this.livesDescription=(e==null?void 0:e.livesDescription)||"Enter how many lives the user will have during a game",this.points=(e==null?void 0:e.points)||"Points",this.pointsDescription=(e==null?void 0:e.pointsDescription)||"Set the threshold of consecutive correct answers after which points are awarded and define the amount of points received from this step onwards. Valid value for correct steps is between 0-50 and for score 1-100",this.streakThreshold=(e==null?void 0:e.streakThreshold)||"Streak threshold",this.pointsCorrectSteps=(e==null?void 0:e.pointsCorrectSteps)||"Correct steps",this.pointsScore=(e==null?void 0:e.pointsScore)||"Score",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 game",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.optionsDescription=(e==null?void 0:e.optionsDescription)||"Describe the options that users will select from during the game. Ensure to provide a minimum of 5 and a maximum of 100 options",this.optionsValue=(e==null?void 0:e.optionsValue)||"Value",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.entity=e&&e.entity?e.entity:"Entity",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 Either/Or type. You can manage different types by configuring them in the settings",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.createEitherOrMessage=e&&(e==null?void 0:e.createEitherOrMessage)||"You have successfully created Either/Or",this.createEitherOrErrorMessage=(e==null?void 0:e.createEitherOrErrorMessage)||"There was a problem creating Either/Or. Please try again",this.titleRequiredFieldValidationMessage=(e==null?void 0:e.titleRequiredFieldValidationMessage)||"Title field is required!",this.livesFieldValidationMessage=(e==null?void 0:e.livesFieldValidationMessage)||"The value for 'lives' field is invalid. The valid one is withing the range of 1-20",this.timeFieldValidationMessage=(e==null?void 0:e.timeFieldValidationMessage)||"The value for 'time' field is invalid. The valid one is withing the range of 1-20",this.pointsFieldValidationMessage=(e==null?void 0:e.pointsFieldValidationMessage)||"Points contain value where score or correct steps is an invalid one",this.optionsFieldValidationMessage=(e==null?void 0:e.optionsFieldValidationMessage)||"Options must not contain any repeated IDs",this.tagsInvalidFieldValidationMessage=(e==null?void 0:e.tagsInvalidFieldValidationMessage)||"Tag entity is required!",this.getEitherOrErrorMessage=(e==null?void 0:e.getEitherOrErrorMessage)||"There was a problem with fetching Either/Or data. Please try again",this.deleteEitherOrMessage=(e==null?void 0:e.deleteEitherOrMessage)||"You have successfully deleted Either/Or",this.deleteEitherOrErrorMessage=(e==null?void 0:e.deleteEitherOrErrorMessage)||"There was a problem with deleting Either/Or. Please try again",this.updateEitherOrMessage=(e==null?void 0:e.updateEitherOrMessage)||"You have successfully updated Either/Or",this.updateEitherOrErrorMessage=(e==null?void 0:e.updateEitherOrErrorMessage)||"There was a problem updating Either/Or. Please try again",this.updateEitherOrTranslationErrorMessage=(e==null?void 0:e.updateEitherOrTranslationErrorMessage)||"There was a problem translating Either/Or game. Please try again",this.uploadingImageMessage=(e==null?void 0:e.uploadingImageMessage)||"You have successfully uploaded image",this.generateSignedInUrlErrorMessage=(e==null?void 0:e.generateSignedInUrlErrorMessage)||"There was a problem generating signed in URL to store the image in bucket. Please try again",this.uploadingImageErrorMessage=(e==null?void 0:e.uploadingImageErrorMessage)||"There was a problem with uploading image to bucket. Please try again",this.encryptingImageErrorMessage=(e==null?void 0:e.encryptingImageErrorMessage)||"There was a problem with encrypting image before uploading it to bucket. Please try again",this.searchSportal365ImagesErrorMessage=(e==null?void 0:e.searchSportal365ImagesErrorMessage)||"There was a problem with searching images from Sportal 365 API. Please try again",this.deleteEitherOrTitle=(e==null?void 0:e.deleteEitherOrTitle)||"Delete Either/Or",this.deleteEitherOrDescription=(e==null?void 0:e.deleteEitherOrDescription)||"Are you sure you want to delete",this.mainImage=(e==null?void 0:e.mainImage)||"Main",this.coverImage=(e==null?void 0:e.coverImage)||"Cover",this.mobileImage=(e==null?void 0:e.mobileImage)||"Mobile",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.addPoint=(e==null?void 0:e.addPoint)||"Add point",this.removePoint=(e==null?void 0:e.removePoint)||"Remove",this.addOption=(e==null?void 0:e.addOption)||"Add option",this.removeOption=(e==null?void 0:e.removeOption)||"Remove option",this.addImages=(e==null?void 0:e.addImages)||"Add images",this.additionalFields=(e==null?void 0:e.additionalFields)||"Additional fields",this.languagesModalTitle=(e==null?void 0:e.languagesModalTitle)||"Select Languages",this.languagesModalDescription=(e==null?void 0:e.languagesModalDescription)||"Select the languages this game is going to be translated in.",this.languagesModalSave=(e==null?void 0:e.languagesModalSave)||"Save language preference",this.gameTranslationErrorMessage=(e==null?void 0:e.gameTranslationErrorMessage)||"An error occurred while translating the game.",this.languageParentText=(e==null?void 0:e.languageParentText)||"This game is a translated version of",this.translateTo=(e==null?void 0:e.translateTo)||"Translate to ",this.exportUsersData=(e==null?void 0:e.exportUsersData)||"Export users data",this.exportUsersLeads=(e==null?void 0:e.exportUsersLeads)||"Export users leads",this.exportAllUsersLeads=(e==null?void 0:e.exportAllUsersLeads)||"Export all users leads",this.exportAllUsersLeadsDescription=(e==null?void 0:e.exportAllUsersLeadsDescription)||"Export all users collected leads in the game.",this.usersLeadsExportMessage=(e==null?void 0:e.usersLeadsExportMessage)||"All users leads have been exported successfully",this.usersLeadsExportErrorMessage=(e==null?void 0:e.usersLeadsExportErrorMessage)||"There was a problem with exporting all users leads. Please try again",this.related=(e==null?void 0:e.related)||"Related",this.relationship=(e==null?void 0:e.relationship)||"Relationship",this.relatedEntitiesErrorMessage=(e==null?void 0:e.relatedEntitiesErrorMessage)||"There was a problem with fetching entities for related. Please try again",this.widgetEmbedCodeTitle=(e==null?void 0:e.widgetEmbedCodeTitle)||"Widget embed code",this.configureLeads=(e==null?void 0:e.configureLeads)||"Configure leads",this.configureLeadsDisabledMessage=(e==null?void 0:e.configureLeadsDisabledMessage)||"Configure leads is enabled only when the authentication requirement is set to “Lead”.",this.leadPosition=(e==null?void 0:e.leadPosition)||"Lead position",this.addCampaignInfo=(e==null?void 0:e.addCampaignInfo)||"Add campaign info",this.campaignIdInfoMessage=(e==null?void 0:e.campaignIdInfoMessage)||'Group multiple content items by a campaign ID. This field will be used for filtering later on, so make sure you have excatly the same ID across your multiple quizzes, polls and other games in general. We recommend using lowercase and -. Example: "adidas-december-2025"',this.campaignNameInfoMessage=(e==null?void 0:e.campaignNameInfoMessage)||'A label for your campaign that will appear in the reports. You can use anything here. Example: "Adidas (December 2025)"',this.copyToClipboard=(e==null?void 0:e.copyToClipboard)||"Copy to clipboard",this.divElementTextInfo=(e==null?void 0:e.divElementTextInfo)||"The generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation: ",this.widgetEmbedCodeNotAvailable=(e==null?void 0:e.widgetEmbedCodeNotAvailable)||"To configure embed code you need to first create your Either/Or game."}}const zt=W.createContext(null),OEe=({labels:t,children:e})=>{const r=new EEe(t);return E.jsx(zt.Provider,{value:r,children:e})},aa=W.createContext(null),REe=({features:t,children:e})=>E.jsx(aa.Provider,{value:t,children:e}),MEe=({children:t})=>E.jsx(Oe,{width:"100%",sx:{backgroundColor:"#fff"},children:t});function _t(t){const e=W.useContext(t);if(e===void 0)throw new Error("Context was used outside of its Provider");return e}class DEe{constructor(){l(this,"isValid",!0);l(this,"message","");l(this,"minTimeAndLives",1);l(this,"maxTimeAndLives",20);l(this,"minPoints",1);l(this,"maxPoints",100);l(this,"minCorrectSteps",0);l(this,"maxCorrectSteps",50);l(this,"validate",(e,r)=>{this.validateRequiredFields(e,r),this.isValid&&(this.validateLives(e.lives,r),this.validateTime(e.time,r),this.validatePoints(e.points,r),this.validateOptions(e.options,r),this.validateContext(e.context,r))});l(this,"validateRequiredFields",(e,r)=>{e.title||(this.isValid=!1,this.message=r.titleRequiredFieldValidationMessage)});l(this,"validateLives",(e,r)=>{(e<this.minTimeAndLives||e>this.maxTimeAndLives)&&(this.isValid=!1,this.message=r.livesFieldValidationMessage)});l(this,"validateTime",(e,r)=>{(e<this.minTimeAndLives||e>this.maxTimeAndLives)&&(this.isValid=!1,this.message=r.timeFieldValidationMessage)});l(this,"validatePoints",(e,r)=>{if(e&&e.length>0){const n=e.some(i=>i.score>this.minPoints||i.score<this.maxPoints||i.correct_steps>this.minCorrectSteps||i.correct_steps<this.maxCorrectSteps);n||(this.isValid=n,this.message=r.pointsFieldValidationMessage)}});l(this,"validateOptions",(e,r)=>{if(e&&e.length>0){const n=e.map(o=>o.id);new Set(n).size!==n.length&&(this.isValid=!1,this.message=r.optionsFieldValidationMessage)}});l(this,"validateContext",(e,r)=>{e&&e.tags.forEach(n=>{n.id||(this.isValid=!1,this.message=r.tagsInvalidFieldValidationMessage)})})}}class $Ee{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,"winning_condition","MORE");l(this,"lives",3);l(this,"time",10);l(this,"points",[]);l(this,"rules",null);l(this,"ad_content",null);l(this,"branding",null);l(this,"labels",null);l(this,"custom_fields",null);l(this,"images",null);l(this,"status","INACTIVE");l(this,"flags",[]);l(this,"options",[]);l(this,"related",[]);l(this,"context",null)}}class Th{constructor(){l(this,"createNewRequestBody",e=>{if(!e){const r=new $Ee;return r.points=this.constructEmptyCreatePoints(),r.options=this.constructEmptyCreateOptions(),r}return e.branding=this.reconstructBranding(ce({},e.branding)),e.context=this.createContext(ce({},e.context)),ce({},e)});l(this,"finalizeNewRequestBody",(e,r)=>(e.images&&(e.images=this.reconstructImages(ce({},e.images))),e.branding&&(e.branding=this.reconstructBranding(ce({},e.branding))),e.context&&(e.context=this.reconstructContext(ce({},e.context))),e.auth_requirement=e.auth_requirement||r.authRequirement,e.language=e.language||r.languageConfig.default_language,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(r=>r.id),e.campaign&&this.isObjectValuesEmpty(e.campaign)&&(e.campaign=null),!e.content&&!e.tags.length&&!e.campaign?null:e));l(this,"createImagesModel",()=>({main:null,cover:null,mobile:null}));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,"constructEmptyTag",()=>({id:"",type:"competition",source:"football"}));l(this,"isObjectValuesEmpty",e=>Object.values(e).every(r=>!r));l(this,"createGameImagesModel",()=>({main:"",mobile:""}));l(this,"constructPoints",e=>e&&e.length?Array.from(e):this.constructEmptyCreatePoints());l(this,"constructEmptyCreatePoints",()=>[{correct_steps:0,score:10},{correct_steps:5,score:20},{correct_steps:10,score:30},{correct_steps:15,score:40},{correct_steps:20,score:50}]);l(this,"constructEmptyPoints",()=>({correct_steps:0,score:0}));l(this,"constructOptions",e=>e&&e.length?Array.from(e):this.constructEmptyCreateOptions());l(this,"constructEmptyCreateOptions",()=>{const e=[];for(let n=0;n<9;n++)e.push({id:`${n+1}`,label:"",value:0,images:this.createGameImagesModel()});return e});l(this,"constructEmptyOption",e=>({id:e,label:"",value:0,images:this.createGameImagesModel()}))}}const Tv=t=>(t==null?void 0:t.main)||(t==null?void 0:t.mobile),LEe=({isOpen:t,requestBody:e,handleClose:r})=>{const n=_t(zt);return E.jsx(As,{open:t,onClose:r,children:E.jsxs(Es,{children:[E.jsxs(ks,{children:[E.jsx(_ae,{}),n.previewGame]}),E.jsx(Ni,{}),E.jsxs(Ts,{children:[E.jsx(ze,{fontWeight:"500",mb:1,children:e.title}),E.jsx($f,{variant:"plain",sx:{mb:1},children:Tv(e.images)?E.jsx("img",{src:Tv(e.images),alt:"main-image"}):E.jsx(WR,{})}),E.jsx(ze,{mb:1,children:E.jsx("article",{dangerouslySetInnerHTML:{__html:e.description}})}),E.jsx(Ni,{sx:{mb:1}}),e.options.map((i,o)=>E.jsx(hn,{sx:{mb:1},children:E.jsx($n,{children:E.jsxs(Os,{direction:"row",spacing:2,children:[E.jsx($f,{variant:"plain",sx:{minWidth:200},children:Tv(i.images)?E.jsx("img",{src:Tv(i.images),alt:`option-${o}-image`}):E.jsx(WR,{})}),E.jsxs(Os,{children:[E.jsx(ze,{level:"title-md",alignContent:"center",children:i.label}),E.jsxs(ze,{level:"body-md",alignContent:"center",children:[n.optionsValue,": ",i.value]})]})]})})},o))]}),E.jsx(Bl,{children:E.jsx(lt,{variant:"plain",color:"neutral",onClick:i=>{i.stopPropagation(),r()},children:n.close})})]})})},FEe=1,SB=new Th,NEe=({points:t,isGamePlayed:e,onChange:r})=>{const n=_t(zt),{NumberInput:i}=er.useComponentContext(),o=SB.constructPoints(t),a=(h,p)=>{const f=Array.from(o);f[p].correct_steps=h,d(f)},s=(h,p)=>{const f=Array.from(o);f[p].score=h,d(f)},c=()=>{const h=SB.constructEmptyPoints();d([...o,h])},u=h=>{const p=o.filter((f,g)=>g!==h);d(p)},d=h=>{r(h)};return E.jsxs(Oe,{mb:2,children:[E.jsxs(Oe,{mb:2,children:[E.jsxs(kt,{children:[E.jsx(Pt,{color:"primary",children:n.points}),E.jsx(pi,{children:n.pointsDescription})]}),e?E.jsx(E.Fragment,{}):E.jsx(lt,{variant:"outlined",onClick:c,startDecorator:E.jsx(UR,{}),sx:{mt:2},children:n.addPoint})]}),E.jsx(yr,{container:!0,spacing:2,children:o.map((h,p)=>E.jsx(yr,{xs:12,md:3,children:E.jsxs(hn,{variant:"outlined",children:[E.jsx(jf,{variant:"soft",color:"neutral",children:E.jsx($n,{orientation:"horizontal",sx:{display:"flex",justifyContent:"center"},children:E.jsx(ze,{children:`${n.streakThreshold} ${p+1}`})})}),E.jsxs($n,{children:[E.jsx(i,{size:"md",label:n.pointsCorrectSteps,defaultValue:h.correct_steps,onChange:f=>a(f,p)}),E.jsx(i,{size:"md",label:n.pointsScore,defaultValue:h.score,onChange:f=>s(f,p)})]}),E.jsxs(jf,{variant:"plain",children:[E.jsx(Ni,{inset:"context"}),E.jsx($n,{orientation:"horizontal",sx:{display:"flex",justifyContent:"flex-end"},children:E.jsx(lt,{variant:"outlined",color:"danger",size:"sm",onClick:()=>u(p),disabled:t.length<=FEe,children:E.jsx(gd,{})})})]})]})},`threshold-${p}`))})]})},jEe={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:""}},BEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMA+h6XBeOBCz4ozafvc/W9X+nD29ROsWmINjBVRxC4F3uPnhL6/TMAAAygSURBVHja7N0JkqJAEIXhAsEFEEVs9z3vf8eZmI6J3mxFZamq/L8zaC2ZrxKjTzTaLfu9xWweZ7n8FeRFmRwuq+XbZmDgs2gzPR9iuaGYpOl4yO/AQ+G0lwRSUXJ+40fgkXCaxvKgYDIeGXhgvZrLk8rVxsBp63MsLyn7rAPOCvul1GB+Cg2cE20nUpvDNjJwybpXSK2KPsuAM8J+LPULUk6EbjgF0pDD0MB2w0QaNOMnYLfhRL7iJ6DJaCEtOHAWsNO+F0g7Um4EFlpm0pq8T6/IMptEWhVPDewxWAXSthlNAltEu1I6EKyoD9sgOufSkZIrYfeOM+lQj8NgxzaxdKpcG3RonEvHgpNBV8KDWGByNOjENBMrFJwFu7BPxRbB2KBtw1gsknIbaNk4EKskHATaNLBn+f8vpjLcnn0i9skue4NWHOdipYRfwHUa/v//JBwFWzCYibUm9AebtxCLpQYN64nVVgaNGovllgYN2or13gwaM7Ss/ndNTmuoMevOu/9VZGREGrKxpP17T8bToUaMCnFEQV+gAaFV/d/bYt6O1e5YikPmtAVqNrC2AUBboA2RFfHPRywManQR5/QManMSB5EU1VQApij8k7IC4E855YBaHB0qAHwVExWuQWRxAuieiYHvCZDbzgYvmorTtgYvGTl6APwv4yD4koGlTwCqSwgKqz0AUBHUWgGiHlST0JEI0G0F1YBnOdcCpDFYq6V4grGyTwkdvwF+yEiIKd4A2AR0lgApCL5o70wIvIqCkKiCEBjloBqtxTO8FnqMYynw+2YGWk+AnAMfNnA2Bfa7mLag5zFwYuK1OXpTA/wsoymkKAXAVfAFIwcGwTwjIB7mwSRApgheQw2oGqYHVTERbx0M7tqJxxghd5/DL8F4K8YCwBLAAsAS8IqheI4lQO0VgIuA7hoAyRDVRUDKgZWMxH8BjwTUtQFpCqrOAXyXExFXFQQiGlRZ5GESkHSg7igwAWGqwLwRqGojapANU3sH5Cb4q4GKO+C7jO+JeDwQhqExPAflGEgbgGPgg1aiCp+Z/86riTD3xQaasqA/7Qw+S0WZi4HSIsC7jI6Qd2PBGSJOFpBsIDtAVTl7gOodgD1A9R2APeCLyIsvg3APoArEM0GiIHxW9AlK0sDflQYaO8EfeCT2bixKLQ08+zgQnxJ6QqSwDMhFUNNUGC6Ct/VFrZOBohdhzAy7KvJ0NjgdwT/snVlSAlEMRYO2duEADnQVIO2U/e9RLSkZbB7o5zvnbAGqX3Jzc2MJYHq0KoBZEZqBHAm7EOB6wGHOEo3jAKQbTF8Ydidwn8ugg50EOQ+yBrQKjHhJOPTYULQO6EAQlgykK2iHZtGtxlBD8Ibz8apbEGdC/Su8/Nvmfo4rBTp//h1uYPnBkGB43UGOgB0N2/uZG7VHD10FO8YFJUEYbAN2MoQ5DeU5KTsAO4FhHlPIC+O2AHCbONwCZBmIOgzxV66ietqUw4zqlwIsAeD+ELwDhO4PwTtA6NFx6FVAbeI2Afg2QCcQfE8AnAdyCjdROylFonKalCK1O8QVAuF/AL8A8D+ANQC8BrALoHcByPNA6gAbZikFZlE70xR0ejDyRKDJkRveUgrMo3Y0hBS5i9qBHonUEmY0rNGxCgHqQOwLMcd5iPqxDUB7QiPuUsBNAPhSsDWgtlBHQYrBcCFYLRBfAlgE0EsAM2LAZgCVAPgo0IgA+CTom8ZxwCD3QcGMgEHOg4JvAPoF+MS0aGpKpHHR9JxYbUGHGEFUIJOCsOlAWkMtAc2KAqdD6QsqAjsbF40TIWwP6CcA6wRwT5w+CN7mKeWHLoC4IQJKBRhiaVzQmtE4kOgMAu0DDdE6FGSdjFUQhh+N1hoENwL9plUMyBn2AfhiiT8kPYF2ACrC0CGQl2SZuyAuC5PXgcs04PDYafXXAU6hxQ4FHtANwIYW+g2Y+vuvaZB1wLXff7QkSBYA3RThpIGYGqIL1DfAF+A4XcJAugALtDB/2MQWkH1M6jlkl9tEcRuCjo+0CWRvCtF2gTUG7HEZss8iQSxDyNFhyoDwN0AjGPwN8AVgD4SIaQDGR0IjIdWCVIHMjgOeB/WclIFQ/6BHzISdBMO3hNwGgl+SgIUCKwUoAmgL0QpyKn31gRGTPqTAe1aOdvAyy6wceCIMPkCWGQrrhoiZgB/snVFOwzAQRO2QElJFhUAJClUpwve/I0h8tagobVzH3nnvColsz+7sLEoQDUhDgDbAFOo+mGVFJoR2MYgi0BQas9vlO/qA2tYwrGDT2Bs9AjgAxI8ADgDtV0DPAaAtBJAA2tuEqAGIrxGgCKgdF0EkhPhCMdqAF/IRTDE4uIzW1JCI6nJYFsuKL4edw95QW1h3OSxSEAmIPxQnqPg7UH05qHxXkC7gtdQm6oFbmgBXMxq4BPzoQDk8klBI7UtgzQUwi/fCLwFPKOhMPkPRYAPSXiZECWg+VcEO0f7gQHlgnOWA2o1hFGAc6kIzhJ9RgJGoirQG9ISCR+OhwGqAJxH0B+FRoTcHTjg/kDzAuNSF2YMeeQBG5lBUetgLgbDRaQuqCHaYwH4RlQIbBMBN2IUy8FSAj1HLkEQAniBmDsAE/AcpjyAdoJtyFzKHMdBj1P4ACoCnaP0BfP9zaPhDOP/PIPISvHfwD+abw1jAk/GUYVXYkwKRkNfsFkxuyIFLypiZTXDFCFhiqqzGRtcYQJPTDCEbBlLAJmJTDiL/FmKXxVOwo/2/GG0GD4Et9q8FaRa3i39x/X+zdyc5CMNAEEUhuQnc/46sEFMGWyJy1PX+Fept7R7bfXAXdQWAABAAAkAACAABIAAEgAAQAAJAAAgAASAABIAAEAACQADofPelvQrqqd7+BPRUcX8C2qu5PwGtVd2fgLbq7k9AS5X3J2C/2vsTsFf1/QnYrv7+BGyVsD8B62XsT8BaKfsTsFzO/gQslbQ/Ab9l7U/Ad2n7E/BZ3v4EvJe4PwGvMvcn4Fnq/gQc0zT8W+D2bu5H/LtpPuGdqPWuMwLB8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8CD/buRStRKIDC8NaBRBBFzfttxvP+7zi1Wq2mxgxLC87+v1f4d6VwIPv8TMA+PxOwz88E7PMzAfv8TMA+PxOQukfr/I86xieIyW89gT75n3WKvtz0C/IbT6BfBLxhNAHyn1as5YD875uvFDvyn7ePewJr8n9olClW63lADZOtYkT++vKZYkN+6wmsyH+xfKNYrPYBn3BfKQbk/7xplajlyP816aLVE8jI/2Vp2VNLZaOAKxi3cwLkv57B79ZNgPzXNbjbqUXIf32D5UEtQf7bGP5pxQSyScCNDJt/inxL/tM8HiQg/+11jo09PEj+8yI/QrzNAz4W6xHiGfm/17xRR4jJf4nojhCT/4fsG3F+lPyXiuoIMfkvE9kENuT/eZO6EyB/rEZr/YDNfUBTFF2dR/7Inb9HQH4D70+A/Ca+aQIV+RvrG24TVdOAJnt1gZj8jm72dHlC/pa4rxLye0sXybXzpwFtMi575Pd2tceJkgX52+lhAuT3Ni4T8ntLK/Kby7PP5i/JH4eiS35vw1KX2pI/Knlfl9jxTt/YdErVt+LHP0Kjg2pa8N9cojTOVEfyKyBOtf4M9Hitb8SOyYf9ecY/avse/b1Ndjoj4f1e0cvPLYCv/wbynt5zF2BglOi0WYCFQid1BwEeSp3CFwAbnUz/KwNspDu91ecGgJNfeosrAF4yvbYJsJLrlYTnvtxU+tciwEya6EXCESA/C34BeJvqBZ8AHM30bBtgaK5nnAKz1DnoSZeLgJ5K7gJ4m+gJ73x2ddCjfoCpir8A3gruA3pL9aDHdwBfXa4CedtIWgbYWvIRwNteEofBjaVSN8BYj8eBvK25DORtpmOAsZIvAd6WnAbzVmgYYGyvAGc5A/A2ZQDexgzA25ABmGMA5hiAOQZgjgGYYwDmGIA5BmCOAZjjTKg5jQOcifeDeWMA5hiAOT4DmPvb3h2lNAxEYRT+kzo0JtNqoFpQmyCz/z2KFJFa8d2e863hvCRzZ65fAXAOhcL5IwjOAOAMAM4A4AwAzgDgDADOAOAMAM4A4AwAzgDg4lPRaN4Ohus8DmYrjoSxLVmawHY+Fcu2zdrENSeOBZNtkmyasNa4MYJsdHMs25BPL01MY86mJqT7nJ28Hob0ni9DE88h3x6baOopFgBW+1x48lgYpfT5oXd9GMjzNteGyfEwhvKW363HxQZu3uE1f7gbdtO4b1e6WudSylz3JvJ/dfPDcc2FD2jGIfoz6ZkMAAAAAElFTkSuQmCC",gt={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"}},kh={ar:gt.ar,"ar-dz":gt.ar,"ar-bh":gt.ar,"ar-eg":gt.ar,"ar-iq":gt.ar,"ar-jo":gt.ar,"ar-kw":gt.ar,"ar-lb":gt.ar,"ar-ly":gt.ar,"ar-ma":gt.ar,"ar-om":gt.ar,"ar-qa":gt.ar,"ar-sa":gt.ar,"ar-sy":gt.ar,"ar-tn":gt.ar,"ar-ae":gt.ar,"ar-ye":gt.ar,bg:gt.bg,da:gt.da,de:gt.de,en:gt.en,"en-gb":gt.en,"en-us":gt.en,el:gt.el,es:gt.es,fr:gt.fr,hu:gt.hu,it:gt.it,nl:gt.nl,pt:gt.pt,"pt-br":gt["pt-br"],ro:gt.ro,sk:gt.sk,sr:gt.sr,sv:gt.sv,sw:gt.sw};var kv=(t=>(t.SHOW_IMAGES="show_images",t))(kv||{});const zEe=[10,15,20,25,50],_B="content",UEe=t=>{const e=_t(zt),{Images:r}=er.useComponentContext(),n=i=>{t.option.images=i,t.onChange(t.option)};if(t.field===kv.SHOW_IMAGES)return E.jsx(r,{labels:e,defaultValue:t.option.images,onChange:n})},HEe=(t,e)=>t?!e.label:!0,VEe=t=>{const[e,r]=W.useState(HEe(t.isEditMode,t.option)),n=_t(zt),{InformationInput:i,NumberInput:o}=er.useComponentContext(),a=(u,d)=>{r(d)},s=u=>{u.persist(),t.option.label=u.target.value,t.onChange(t.option)},c=u=>{u=u||null,t.option.value=u,t.onChange(t.option)};return E.jsxs(Nx,{sx:{p:0,overflow:"hidden"},expanded:e,onChange:a,children:[E.jsx(Hx,{variant:"soft",sx:{px:3},children:t.option.label?t.option.label:`${n.optionNumber} ${t.optionNumber}`}),E.jsx(jx,{sx:{"& > div":{pb:0}},children:E.jsxs(hn,{variant:"plain",sx:{borderRadius:0},children:[E.jsxs($n,{children:[E.jsxs(yr,{container:!0,spacing:2,children:[E.jsx(yr,{xs:9,children:E.jsx(i,{label:n.label,defaultValue:t.option.label||"",value:t.option.label||"",required:!0,onChange:s})}),E.jsx(yr,{xs:3,children:E.jsx(o,{size:"md",label:n.optionsValue,defaultValue:t.option.value,onChange:c})})]}),t.additionalFields.map(u=>E.jsx(UEe,{option:t.option,field:u,onChange:t.onChange},`option-id-${t.option.id?t.option.id:Math.random()}-field-${u}`))]}),E.jsxs(jf,{variant:"plain",children:[E.jsx(Ni,{inset:"context"}),E.jsx($n,{orientation:"horizontal",sx:{display:"flex",justifyContent:"flex-end"},children:E.jsx(lt,{startDecorator:E.jsx(gd,{}),variant:"outlined",color:"danger",size:"sm",onClick:t.onDelete,disabled:t.disableDelete,children:n.removeOption})})]})]})})]})},WEe=({label:t,values:e,allValues:r,valuesMap:n,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:s})=>{const c=(u,d)=>{u.persist();let h=[...e];if(u.target.checked){h.push(d),a(h);return}h=e.filter(p=>p!==d),a(h)};return E.jsxs(Oe,{sx:{my:2},children:[E.jsx(ze,{level:"body-xs",mb:1,fontWeight:"bold",children:t}),E.jsxs(Mf,{orientation:"horizontal",wrap:!0,sx:{"--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[r.map(u=>E.jsxs(ka,{children:[e.includes(u)&&E.jsx(Iae,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),E.jsx(ed,{checked:e.includes(u),variant:e.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:n[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?E.jsx(ka,{children:E.jsx(Ps,{onClick:s,children:o})}):E.jsx(E.Fragment,{})]})]})},TB=new Th,qEe=5,GEe=100,kB=t=>{const e=[];return t.some(r=>r.images&&(r.images.main||r.images.mobile))&&e.push(kv.SHOW_IMAGES),e},YEe=({isEditMode:t,isGamePlayed:e,options:r,onChange:n})=>{const[i,o]=W.useState(kB(r)),a=_t(zt),s=TB.constructOptions(r);W.useEffect(()=>{o(kB(r))},[r]);const c=()=>{const p=TB.constructEmptyOption(`${s.length+1}`);h([...s,p])},u=(p,f)=>{const g=Array.from(s);g[f]=p,h(g)},d=p=>{const f=s.filter(g=>g.id!==p);h(f)},h=p=>{n(p)};return E.jsxs(Oe,{mb:2,children:[E.jsxs(Oe,{mb:2,children:[E.jsxs(kt,{children:[E.jsx(Pt,{color:"primary",children:a.options}),E.jsx(pi,{children:a.optionsDescription})]}),E.jsx(WEe,{label:a.additionalFields,values:i,allValues:[kv.SHOW_IMAGES],valuesMap:{show_images:a.addImages},onChange:p=>o(p)}),e?E.jsx(E.Fragment,{}):E.jsx(lt,{variant:"outlined",disabled:r.length===GEe,onClick:c,startDecorator:E.jsx(UR,{}),sx:{mr:2},children:a.addOption})]}),E.jsx(Bx,{variant:"outlined",sx:{borderRadius:"5px"},children:s.map((p,f)=>E.jsx(VEe,{option:p,optionNumber:f+1,isEditMode:t,additionalFields:i,disableDelete:s.length<=qEe||e,onDelete:()=>d(p.id),onChange:g=>u(g,f)},p.id))})]})},KEe=({requestBody:t,isEditMode:e,onRequestBodyUpdate:r,parentTitle:n,onParentSelect:i})=>{const o=_t(zt),{InformationInput:a,RichText:s}=er.useComponentContext(),c=f=>{f.persist();const g=f.target.value?f.target.value:null;r(Be(ce({},t),{title:g}))},u=f=>{f.persist();const g=f.target.value?f.target.value:null;r(Be(ce({},t),{alternative_title:g}))},d=f=>{r(Be(ce({},t),{description:f}))},h=f=>{r(Be(ce({},t),{points:f}))},p=f=>{r(Be(ce({},t),{options:f}))};return E.jsxs(Oe,{sx:{width:{xs:"100%",sm:"70%"}},mr:{sm:2},children:[n&&E.jsx(Wx,{variant:"outlined",color:"primary",startDecorator:E.jsx(Sae,{}),sx:{mb:2,cursor:"pointer"},onClick:i,children:`${o.languageParentText} "${n}"`}),E.jsx(a,{label:o.title,placeholder:"",defaultValue:t.title||"",value:t.title||"",required:!0,onChange:c}),E.jsx(a,{label:o.alternativeTitle,placeholder:"",defaultValue:t.alternative_title||"",value:t.alternative_title||"",required:!1,onChange:u}),E.jsx(s,{label:o.description,placeholder:"",property:"description",value:t.description,defaultValue:t.description,onChange:d}),E.jsx(NEe,{points:t.points,isGamePlayed:!1,onChange:h}),E.jsx(YEe,{options:t.options,isGamePlayed:!1,isEditMode:e,onChange:p})]})},JEe=({defaultValue:t,onChange:e})=>{const{types:r}=_t(aa),n=_t(zt),i=W.useRef(null);return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{children:n.type}),E.jsx(br,Be(ce({value:t,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(o,a)=>e(a),sx:{minHeight:"37px"}},t&&{endDecorator:E.jsx(ur,{variant:"plain",color:"neutral",onMouseDown:o=>{o.stopPropagation()},onClick:()=>{var o;e(null),(o=i.current)==null||o.focusVisible()},sx:{width:"18px",height:"18px"},children:E.jsx(_w,{})}),indicator:null}),{children:r.map(o=>E.jsx(qt,{value:o.id,children:o.label},o.id))})),E.jsx(pi,{children:n.typeDescription})]})},QEe=t=>{const e=_t(zt),r={ACTIVE:e.active,INACTIVE:e.inactive,EXPIRED:e.expired},n=(i,o)=>{t.onChange(o||"")};return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{color:"primary",children:e.status}),E.jsx(br,{value:t.defaultValue,onChange:n,sx:{minHeight:"37px"},children:Object.keys(r).map((i,o)=>E.jsx(qt,{value:i,children:r[i]},`status-select-${i}-${o}`))})]})},XEe=t=>{const e=_t(zt),r={MORE:e.more,LESS:e.less},n=(i,o)=>{t.onChange(o||"")};return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{color:"primary",children:e.winningCondition}),E.jsx(br,{value:t.defaultValue,onChange:n,sx:{minHeight:"37px"},children:Object.keys(r).map((i,o)=>E.jsx(qt,{value:i,children:r[i]},`condition-select-${i}-${o}`))}),E.jsx(pi,{children:e.winningConditionDescription})]})},ZEe=t=>{const e=_t(zt),r=_t(aa),n=r.languageConfig.default_language?[r.languageConfig.default_language,...r.languageConfig.available_languages]:[];return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{children:e.language}),E.jsx(br,{size:"sm",disabled:t.isReadOnly,value:t.defaultValue,onChange:(i,o)=>t.onChange(o),children:n.map(i=>E.jsx(qt,{value:i,children:gt[i].name},`language-select-${i}`))}),E.jsx(pi,{children:e.languageDescription})]})},eOe=t=>{var p;const e=_t(zt),r=_t(aa),{AuthRequirement:n,NumberInput:i}=er.useComponentContext(),o=(p=t.requestBody.related)==null?void 0:p.some(f=>f.entity_relationship==="translatedFrom"),a=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{status:f}))},s=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{type:f}))},c=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{winning_condition:f}))},u=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{language:f}))},d=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{auth_requirement:f}))},h=(f,g)=>{g=g||null,t.onRequestBodyUpdate(Be(ce({},t.requestBody),{[f]:g}))};return E.jsxs(E.Fragment,{children:[t.requestBody.id?E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{color:"primary",children:e.id}),E.jsx(Do,{size:"md",readOnly:!0,variant:"outlined",color:"neutral",name:"id",value:t.requestBody.id,sx:{opacity:.5,borderRadius:"md"}})]}):E.jsx(E.Fragment,{}),E.jsx(QEe,{defaultValue:t.requestBody.status||"INACTIVE",onChange:a}),E.jsx(JEe,{defaultValue:t.requestBody.type,onChange:s}),E.jsx(ZEe,{isReadOnly:t.isMultilingual||o,defaultValue:t.requestBody.language||r.languageConfig.default_language,onChange:u}),E.jsx(XEe,{defaultValue:t.requestBody.winning_condition,onChange:c}),E.jsx(n,{defaultValue:t.requestBody.auth_requirement||r.authRequirement,onChange:d,labels:e}),E.jsxs(yr,{container:!0,spacing:2,mb:2,children:[E.jsx(yr,{lg:6,width:"100%",children:E.jsx(i,{label:e.time,description:e.timeDescription,defaultValue:t.requestBody.time,onChange:f=>h("time",f)})}),E.jsx(yr,{lg:6,width:"100%",children:E.jsx(i,{label:e.lives,description:e.livesDescription,defaultValue:t.requestBody.lives,onChange:f=>h("lives",f)})})]})]})},tOe=new Th,rOe=t=>{const e=_t(zt),{RichText:r,Accordion:n,DynamicFields:i,Branding:o,Images:a,Flags:s,EntityContext:c,Schedule:u,RelatedRelationship:d,WidgetEmbedCode:h}=er.useComponentContext(),p=w=>{w.persist(),t.onRequestBodyUpdate(Be(ce({},t.requestBody),{ad_content:w.target.value||null}))},f=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{branding:w}))},g=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{context:w}))},m=w=>{w=Object.keys(w).length?w:null,t.onRequestBodyUpdate(Be(ce({},t.requestBody),{custom_fields:w}))},v=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{flags:w.length?w:null}))},b=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{images:w}))},x=w=>{w=Object.keys(w).length?w:null,t.onRequestBodyUpdate(Be(ce({},t.requestBody),{labels:w}))},y=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{rules:w||null}))},C=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{related:w}))};return E.jsxs(Oe,{sx:{width:{xs:"100%",sm:"30%"}},children:[E.jsx(n,{label:e.adContent,children:E.jsx(zf,{value:t.requestBody.ad_content,minRows:"7",onChange:p,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)"}}},t.requestBody.id||`new-${t.requestBody.language}`)}),E.jsx(n,{label:e.branding,children:E.jsx(o,{labels:e,defaultValue:t.requestBody.branding||ce({},jEe),onChange:f})}),E.jsx(n,{label:e.configuration,children:E.jsx(eOe,{requestBody:t.requestBody,isMultilingual:t.isMultilingual,onRequestBodyUpdate:t.onRequestBodyUpdate})}),E.jsx(n,{label:e.context,children:E.jsx(c,{labels:e,context:tOe.createContext(t.requestBody.context),onChange:g})}),E.jsx(n,{label:e.customFields,children:E.jsx(i,{labels:e,type:e.customFields,defaultValue:t.requestBody.custom_fields,onChange:m})}),E.jsx(n,{label:e.flags,children:E.jsx(s,{labels:e,flags:t.requestBody.flags||[],onChange:v})}),E.jsx(n,{label:e.images,children:E.jsx(a,{labels:e,defaultValue:t.requestBody.images,onChange:b})}),E.jsx(n,{label:e.labels,children:E.jsx(i,{labels:e,type:e.labels,defaultValue:t.requestBody.labels,onChange:x})}),E.jsx(n,{label:e.related,children:E.jsx(d,{labels:e,defaultValue:t.requestBody.related?Array.from(t.requestBody.related.filter(w=>w.entity_relationship!=="translatedTo"&&w.entity_relationship!=="translatedFrom")):[],onChange:C})}),E.jsx(n,{label:e.rules,children:E.jsx(r,{property:"rules",defaultValue:t.requestBody.rules,onChange:y})}),E.jsx(n,{label:e.schedule,children:t.requestBody.id?E.jsx(u,{labels:e,entityId:t.requestBody.id,entityType:"EITHER_OR"}):E.jsx(ze,{children:e.scheduledTaskNotAvailable})}),E.jsx(n,{label:e.widgetEmbedCodeTitle,children:t.requestBody.id?E.jsx(h,{labels:e,entityType:"either-or",entityId:t.requestBody.id,authRequirement:t.requestBody.auth_requirement}):E.jsx(ze,{children:e.widgetEmbedCodeNotAvailable})})]})},nOe=t=>{const e=_t(zt);return E.jsxs(Oe,{p:2,children:[E.jsx(ze,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:E.jsx(Cae,{fontSize:"inherit"}),onClick:t.onClickBack,children:e.back}),E.jsx(ze,{level:"h3",children:e.manageEitherOrTitle}),E.jsx(pi,{children:e.manageEitherOrDescription})]})},iOe=t=>E.jsx(nw,{"aria-label":"Languages",defaultValue:0,onChange:(e,r)=>t.onTabChange(Number(r)),children:E.jsxs(rw,{sx:{display:"flex",justifyContent:"space-between"},children:[E.jsx(Oe,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:t.languages.map(e=>e&&E.jsx(Ul,{disableIndicator:!0,children:gt[e].name},e))}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:t.onLanguageButtonClick,children:E.jsx(KR,{})})]})}),oOe=t=>{const[e,r]=W.useState(t.languages),n=_t(zt),i=_t(aa);W.useEffect(()=>{r(t.languages)},[t.languages]);const o=()=>{t.onSubmit(e)},a=()=>{t.onClose()},s=d=>{let h=[...e];e.includes(d)?h=h.filter(p=>p!==d):h.push(d),h.includes(t.mainLanguage)||h.unshift(t.mainLanguage),r(h)},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 E.jsx(E.Fragment,{children:E.jsx(As,{onClick:d=>{d.stopPropagation()},open:t.isOpen,onClose:a,children:E.jsxs(Es,{sx:{width:500,minWidth:250,overflowY:"scroll"},children:[E.jsx(ks,{children:n.languagesModalTitle}),E.jsx(pi,{children:n.languagesModalDescription}),E.jsxs(Ts,{sx:{maxHeight:140,overflowY:"scroll",overflowX:"hidden"},children:[E.jsx(ed,{sx:{my:.5,"& .MuiCheckbox-checkbox":{backgroundColor:"white","&:hover":{backgroundColor:"#f0f4f8"}},"& .MuiCheckbox-checkbox.Mui-checked":{backgroundColor:"#0066CC"}},disabled:!0,checked:!0,label:gt[t.mainLanguage].name},"default-language"),u.map(d=>E.jsx(ed,{sx:{my:.5},checked:e.includes(d),label:gt[d].name,onChange:()=>s(d)},d))]}),E.jsxs(Bl,{children:[E.jsx(lt,{disabled:!c,loading:t.isLoadingTranslations,variant:"solid",color:"primary",onClick:o,children:n.languagesModalSave}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:a,children:n.close})]})]})})})},Ah="###",AB=(t,e,r)=>L(this,null,function*(){const n="AIzaSyB6JILBJiJ0Z2pxw0-nudOpRAzqFk6D6Lw",i=t.replace(/###/g," ### ");let o=`https://translation.googleapis.com/language/translate/v2?key=${n}`;return o+="&q="+encodeURIComponent(i),o+=`&target=${kh[e].key||"en"}`,r&&(o+=`&source=${r}`),o+="&format=text",yield fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(s=>s.json())}),aOe=(t,e,r=null)=>L(this,null,function*(){let n=[],i=[];return t.forEach((o,a)=>{let s=o.label;const c=AB(s,e,r).then(u=>{const p=u.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(Ah);n[a]=Be(ce({},o),{label:p[0]})});i.push(c)}),yield Promise.all(i),n}),j1=(t,e,r=null)=>L(this,null,function*(){let n=[],i=[];return t.forEach(o=>{let a=o.title?o.title:"";a+=Ah+(o.alternative_title?o.alternative_title:" "),a+=Ah+(o.description?o.description:" "),a+=Ah+(o.rules?o.rules:" ");const s=AB(a,e,r),c=aOe(o.options,e,r);i.push(Promise.all([s,c]).then(([u,d])=>{const p=u.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(Ah);n.push(Be(ce({},o),{title:p[0],alternative_title:o.alternative_title?p[1]:null,description:o.description?p[2]:null,rules:o.rules?p[3]:null,options:d}))}))}),yield Promise.all(i),n}),sa=new Th,ts=new DEe,sOe=({eitherOrById:t,relatedGames:e,relatedParentTitle:r,loadParent:n,onClickBack:i})=>{const[o,a]=W.useState(sa.createNewRequestBody(t)),[s,c]=W.useState(!1),[u,d]=W.useState(!1),[h,p]=W.useState(!1),[f,g]=W.useState(!1),[m,v]=W.useState([]),[b,x]=W.useState(!1),[y,C]=W.useState(null),[w,I]=W.useState({}),[_,T]=W.useState([]),[O,P]=W.useState(!1),[k,S]=W.useState(!1),[M,$]=W.useState(""),[D,N]=W.useState("danger"),z=_t(zt),U=_t(aa),{Toast:V}=er.useComponentContext(),{https:q}=er.useAPIContext(),F=!!o.id,B=m.length>1,H=B&&w[y]?w[y]:o,G=(be,ge)=>{S(!0),$(ge),N(be)};W.useEffect(()=>{t&&a(t)},[t]),W.useEffect(()=>{if((e==null?void 0:e.length)>0){v([t.language,...e.map(ge=>ge.language)]);let be={};e.forEach(ge=>{be[ge.language]=sa.createNewRequestBody(ge)}),be[t.language]=t,I(be),C(t.language)}},[e]);const Z=be=>{C(m[be])},Y=be=>L(this,null,function*(){P(!0);const ge={},ve={},fe=[];be.forEach(le=>{if(m.includes(le))ge[le]=w[le];else{const he=U.languageConfig.translation_rules[le]?U.languageConfig.translation_rules[le].game_status:"INACTIVE",ye=Be(ce({},H),{language:le,status:he,related:[]});(!F||F&&le!==o.language)&&delete ye.id,ve[le]=ye}}),m.filter(le=>!be.includes(le)).forEach(le=>{w[le].id&&fe.push(Be(ce({},w[le]),{status:"INACTIVE"}))}),T(fe),v(be),C((o==null?void 0:o.language)||U.languageConfig.default_language);const ne=[];Object.keys(ve).forEach(le=>{ne.push(j1([ve[le]],le).then(he=>{ve[le]=Be(ce({},ve[le]),{title:he[0].title,alternative_title:he[0].alternative_title,description:he[0].description,options:he[0].options,rules:he[0].rules})}).catch(()=>{G("danger",z.gameTranslationErrorMessage),P(!1)}))}),Promise.all(ne).then(()=>{I(ce(ce({},ge),ve)),C((o==null?void 0:o.language)||U.languageConfig.default_language),P(!1),x(!1)}).catch(()=>{G("danger",z.gameTranslationErrorMessage),P(!1)})}),Q=()=>L(this,null,function*(){B?ee():K()}),K=()=>L(this,null,function*(){if(c(!0),ts.validate(o,z),!ts.isValid){G("danger",ts.message),c(!1);return}const be=[];_.forEach(fe=>{o.related=o.related.filter(ne=>ne.entity_id!==fe.id),be.push(q.updateEitherOr(fe.id,sa.finalizeNewRequestBody(ce({},fe),U)).then(()=>q.deleteEitherOr(fe.id)))}),Promise.all(be).then(()=>T([]));const ge=sa.finalizeNewRequestBody(ce({},o),U);let ve=null;if(F?ve=yield q.updateEitherOr(ge.id,ce({},ge)):ve=yield q.createEitherOr(ce({},ge)),ve.ok){c(!1),G("success",F?z.updateEitherOrMessage:z.createEitherOrMessage);const fe=yield ve.json();a(fe.data)}else{const fe=F?z.updateEitherOrErrorMessage:z.createEitherOrErrorMessage;G("danger",fe),console.error(fe,yield ve.json()),c(!1)}}),X=be=>L(this,null,function*(){const ge=Object.values(w).filter(ne=>ne.language!==(F?t.language:U.languageConfig.default_language)&&!_.some(le=>le.id===ne.id)),ve=[],fe={};for(const ne of ge){const le=sa.finalizeNewRequestBody(ce({},ne),U);le.auth_requirement=ne.auth_requirement||U.authRequirement,le.related=le.related||[],le.related=le.related.filter(ye=>!(ye.entity_type==="either_or"&&ye.entity_relationship==="translatedFrom"&&ye.entity_id===be.id)),le.related.push({entity_type:"either_or",entity_relationship:"translatedFrom",entity_id:be.id});const he=ne.id?q.updateEitherOr(ne.id,ce({},le)):q.createEitherOr(ce({},le));ve.push(he.then(ye=>{if(ye.ok)return ye.json();throw new Error}).then(ye=>{fe[ne.language]=ye.data}))}return{translatedGamesPromises:ve,updatedGames:fe}}),ee=()=>L(this,null,function*(){c(!0);for(const ne of Object.values(w))if(ts.validate(ne,z),!ts.isValid){c(!1),G("danger",ts.message),ts.isValid=!0,ts.message="";return}const be=[];let ge=o;if(!F){const ne=sa.finalizeNewRequestBody(ce({},Object.values(w).filter(he=>he.language===U.languageConfig.default_language)[0]),U),le=yield q.createEitherOr(ce({},ne));if(le.ok)ge=(yield le.json()).data;else{c(!1),console.error(z.createEitherOrErrorMessage,yield le.json()),G("danger",z.createEitherOrErrorMessage);return}}_.forEach(ne=>{be.push(q.updateEitherOr(ne.id,sa.finalizeNewRequestBody(ce({},ne),U)).then(()=>q.deleteEitherOr(ne.id)))});const{translatedGamesPromises:ve,updatedGames:fe}=yield X(ge);Promise.all([...be,...ve]).then(()=>{T([]);const ne=F?ce({},Object.values(w).filter(ye=>ye.id===o.id)[0]):ge,le=sa.finalizeNewRequestBody(ce({},ne),U),he=Object.keys(fe).length?Array.from(Object.values(fe)).map(ye=>({entity_type:"either_or",entity_relationship:"translatedTo",entity_id:ye.id})):[];he.length>0&&(le.related=he),q.updateEitherOr((o==null?void 0:o.id)||ge.id,ce({},le)).then(ye=>{if(ye.ok)return ye.json();throw new Error}).then(ye=>{a(ye.data),fe[ye.data.language||U.languageConfig.default_language]=ye.data,Object.keys(fe).forEach(pe=>fe[pe]=sa.createNewRequestBody(fe[pe])),I(ce({},fe)),c(!1),G("success",z.updateEitherOrMessage)})}).catch(ne=>{console.error(ne),c(!1),console.error(z.updateEitherOrTranslationErrorMessage),G("danger",z.updateEitherOrTranslationErrorMessage)})}),ae=be=>{B?I(ge=>Be(ce({},ge),{[y]:be})):a(be)},oe=be=>{var ne,le;const ge=H.language||U.languageConfig.default_language;B&&be===y||!B&&be===ge?p(!0):d(!0);const ve=be||kh[be].key,fe=(ne=U.languageConfig)!=null&&ne.default_language&&ve!==U.languageConfig.default_language?(le=U.languageConfig)==null?void 0:le.default_language:null;j1([H],ve,fe).then(he=>{const ye=Be(ce({},H),{title:he[0].title,alternative_title:he[0].alternative_title,description:he[0].description,options:he[0].options,rules:he[0].rules});B?I(pe=>Be(ce({},pe),{[y]:ye})):a(ye),p(!1),d(!1)}).catch(()=>{G("danger",z.gameTranslationErrorMessage),p(!1),d(!1)})},Ce=()=>{var be;if(F&&U.languageConfig.default_language){const ge=H.language||U.languageConfig.default_language,ve=B?y:ge,fe=[...U.languageConfig.available_languages,U.languageConfig.default_language].filter(ne=>ne!==ve);return ve==="en"&&U.languageConfig.available_languages.length===0?void 0:E.jsxs(mee,{sx:{mr:1},children:[E.jsx(lt,{onClick:()=>oe(ve),loading:h,children:`${z.translateTo} ${kh[ve].name}`}),((be=U.languageConfig.available_languages)==null?void 0:be.length)>0&&E.jsxs(DE,{children:[E.jsx(qO,{slots:{root:ur},loading:u,children:E.jsx(KR,{})}),E.jsx(WO,{placement:"top",sx:{maxHeight:200},children:fe.map(ne=>E.jsx(Xx,{onClick:()=>oe(ne),children:kh[ne].name},ne))})]})]})}};return E.jsxs(E.Fragment,{children:[E.jsx(nOe,{onClickBack:i}),E.jsxs(hn,{variant:"plain",children:[U.languageConfig.available_languages.length>0&&E.jsx(iOe,{languages:B?m:[H.language||U.languageConfig.default_language],onTabChange:Z,onLanguageButtonClick:()=>x(!0)}),E.jsxs(Os,{direction:{xs:"column",sm:"row"},children:[E.jsx(KEe,{isEditMode:F,requestBody:H,onRequestBodyUpdate:ae,parentTitle:r,onParentSelect:n}),E.jsx(rOe,{requestBody:H,onRequestBodyUpdate:ae,isMultilingual:B})]}),E.jsxs(Oe,{display:"flex",flexDirection:"row",justifyContent:"center",my:3,children:[Ce(),E.jsx(lt,{variant:"outlined",color:"neutral",onClick:()=>g(!0),sx:{mr:1},children:z.preview}),E.jsx(lt,{variant:"solid",color:"primary",onClick:Q,loading:s,children:z.save})]})]}),E.jsx(LEe,{isOpen:f,requestBody:o,handleClose:()=>g(!1)}),E.jsx(V,{showToast:k,color:D,message:M,hideToast:()=>S(!k)}),U.languageConfig.available_languages.length>0&&E.jsx(oOe,{isOpen:b,mainLanguage:(o==null?void 0:o.language)||U.languageConfig.default_language,languages:m,isLoadingTranslations:O,onSubmit:Y,onClose:()=>x(!1)})]})};class PB{constructor(){l(this,"sort","created_at_desc");l(this,"status","");l(this,"language","");l(this,"flags",[]);l(this,"entityIds",[]);l(this,"groupByStatus",!0);l(this,"limit",20)}}const EB=({filters:t,options:e,showStatusFilter:r=!0,setOptions:n,setFilters:i,handleResetData:o})=>{const a=_t(zt),s=_t(aa),{Flags:c,ContextSelectFilter:u,ItemsPerPageFilter:d}=er.useComponentContext(),h=W.useRef(null),p=(O,P)=>{i(k=>Be(ce({},k),{status:P}))},f=O=>{i(P=>Be(ce({},P),{flags:O}))},g=(O,P)=>{i(k=>Be(ce({},k),{language:P}))},m=(O,P)=>{const k=P;i(S=>Be(ce({},S),{sort:k}))},v=(O,P)=>{i(k=>Be(ce({},k),{limit:P}))},b=()=>{i(O=>Be(ce({},O),{groupByStatus:!O.groupByStatus}))},x=()=>E.jsx(yr,{xs:12,md:3,children:E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.status}),E.jsxs(br,Be(ce({value:t.status,size:"sm",placeholder:"Filter by status",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:p,sx:{minHeight:"37px"}},t.status&&{endDecorator:E.jsx(ur,{variant:"plain",color:"neutral",onMouseDown:O=>{O.stopPropagation()},onClick:()=>{var O;i(P=>Be(ce({},P),{status:""})),(O=h.current)==null||O.focusVisible()},sx:{width:"18px",height:"18px"},children:E.jsx(_w,{})}),indicator:null}),{children:[E.jsx(qt,{value:"ACTIVE",children:a.active}),E.jsx(qt,{value:"INACTIVE",children:a.inactive}),E.jsx(qt,{value:"EXPIRED",children:a.expired})]}))]})}),y=()=>{const O=s.languageConfig.default_language?[s.languageConfig.default_language,...s.languageConfig.available_languages]:[];return E.jsx(yr,{xs:12,md:3,children:E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.language}),E.jsx(br,Be(ce({value:t.language,size:"sm",placeholder:"Filter by language",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:g,sx:{minHeight:"37px"}},t.language&&{endDecorator:E.jsx(ur,{variant:"plain",color:"neutral",onMouseDown:P=>{P.stopPropagation()},onClick:()=>{var P;i(k=>Be(ce({},k),{language:""})),(P=h.current)==null||P.focusVisible()},sx:{width:"18px",height:"18px"},children:E.jsx(_w,{})}),indicator:null}),{children:O.map(P=>E.jsx(qt,{value:P,children:gt[P].name},P))}))]})})},C=()=>E.jsx(yr,{xs:12,md:r?2:4,children:E.jsx(d,{labels:a,value:t.limit,onChange:v,options:zEe})}),w=()=>E.jsx(yr,{xs:12,md:r?4:8,children:E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.sortBy}),E.jsxs(br,{value:t.sort,size:"sm",onChange:m,sx:{minHeight:"37px"},children:[E.jsx(qt,{value:"created_at_asc",children:a.sortByCreatedAtAsc}),E.jsx(qt,{value:"created_at_desc",children:a.sortByCreatedAtDesc}),E.jsx(qt,{value:"updated_at_asc",children:a.sortByUpdatedAtAsc}),E.jsx(qt,{value:"updated_at_desc",children:a.sortByUpdatedAtDesc})]})]})}),I=()=>E.jsxs(yr,{xs:12,md:r?3:5,children:[E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.flags}),E.jsx(c,{labels:a,flags:t.flags,onChange:f})]}),E.jsx(kt,{size:"sm"})]}),_=()=>E.jsx(yr,{xs:12,md:r?4:7,children:E.jsx(Oe,{sx:{fontFamily:"sans-serif"},children:E.jsx(u,{labels:a,options:e,setOptions:n,setFilters:i,handleResetData:o})})}),T=()=>E.jsx(yr,{xs:12,md:4,sx:{my:"auto"},children:E.jsx(ed,{label:a.groupByStatus,checked:t.groupByStatus,onChange:b})});return E.jsx(Oe,{mb:2,children:E.jsxs(yr,{container:!0,spacing:2,children:[r&&x(),r&&y(),C(),w(),I(),_(),r&&T()]})})},lOe=({children:t})=>E.jsx("section",{style:{marginRight:"auto",marginLeft:"auto",padding:"8px"},children:E.jsx(Oe,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:E.jsx(Oe,{width:"100%",children:t})})}),cOe=t=>{const e=_t(zt);return E.jsx("tfoot",{children:E.jsx("tr",{children:E.jsx("td",{colSpan:8,children:E.jsxs(Oe,{sx:{display:"flex",alignItems:"center",gap:2,justifyContent:"flex-end"},children:[E.jsxs(ze,{textAlign:"center",children:[e.pageNo," ",t.pageCount]}),E.jsxs(Oe,{sx:{display:"flex",gap:1},children:[E.jsx(ur,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disablePreviousPage,onClick:t.goToPreviousPage,sx:{bgcolor:"background.surface"},children:E.jsx(Tae,{})}),E.jsx(ur,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disableNextPage,onClick:t.goToNextPage,sx:{bgcolor:"background.surface"},children:E.jsx(kae,{})})]})]})})})})};var Av={exports:{}},uOe=Av.exports,OB;function dOe(){return OB||(OB=1,function(t,e){(function(r,n){t.exports=n()})(uOe,function(){var r=1e3,n=6e4,i=36e5,o="millisecond",a="second",s="minute",c="hour",u="day",d="week",h="month",p="quarter",f="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($){var D=["th","st","nd","rd"],N=$%100;return"["+$+(D[(N-20)%10]||D[N]||D[0])+"]"}},y=function($,D,N){var z=String($);return!z||z.length>=D?$:""+Array(D+1-z.length).join(N)+$},C={s:y,z:function($){var D=-$.utcOffset(),N=Math.abs(D),z=Math.floor(N/60),U=N%60;return(D<=0?"+":"-")+y(z,2,"0")+":"+y(U,2,"0")},m:function $(D,N){if(D.date()<N.date())return-$(N,D);var z=12*(N.year()-D.year())+(N.month()-D.month()),U=D.clone().add(z,h),V=N-U<0,q=D.clone().add(z+(V?-1:1),h);return+(-(z+(N-U)/(V?U-q:q-U))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:h,y:f,w:d,d:u,D:g,h:c,m:s,s:a,ms:o,Q:p}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},w="en",I={};I[w]=x;var _="$isDayjsObject",T=function($){return $ instanceof S||!(!$||!$[_])},O=function $(D,N,z){var U;if(!D)return w;if(typeof D=="string"){var V=D.toLowerCase();I[V]&&(U=V),N&&(I[V]=N,U=V);var q=D.split("-");if(!U&&q.length>1)return $(q[0])}else{var F=D.name;I[F]=D,U=F}return!z&&U&&(w=U),U||!z&&w},P=function($,D){if(T($))return $.clone();var N=typeof D=="object"?D:{};return N.date=$,N.args=arguments,new S(N)},k=C;k.l=O,k.i=T,k.w=function($,D){return P($,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var S=function(){function $(N){this.$L=O(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[_]=!0}var D=$.prototype;return D.parse=function(N){this.$d=function(z){var U=z.date,V=z.utc;if(U===null)return new Date(NaN);if(k.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var q=U.match(v);if(q){var F=q[2]-1||0,B=(q[7]||"0").substring(0,3);return V?new Date(Date.UTC(q[1],F,q[3]||1,q[4]||0,q[5]||0,q[6]||0,B)):new Date(q[1],F,q[3]||1,q[4]||0,q[5]||0,q[6]||0,B)}}return new Date(U)}(N),this.init()},D.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},D.$utils=function(){return k},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(N,z){var U=P(N);return this.startOf(z)<=U&&U<=this.endOf(z)},D.isAfter=function(N,z){return P(N)<this.startOf(z)},D.isBefore=function(N,z){return this.endOf(z)<P(N)},D.$g=function(N,z,U){return k.u(N)?this[z]:this.set(U,N)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(N,z){var U=this,V=!!k.u(z)||z,q=k.p(N),F=function(X,ee){var ae=k.w(U.$u?Date.UTC(U.$y,ee,X):new Date(U.$y,ee,X),U);return V?ae:ae.endOf(u)},B=function(X,ee){return k.w(U.toDate()[X].apply(U.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(ee)),U)},H=this.$W,G=this.$M,Z=this.$D,Y="set"+(this.$u?"UTC":"");switch(q){case f:return V?F(1,0):F(31,11);case h:return V?F(1,G):F(0,G+1);case d:var Q=this.$locale().weekStart||0,K=(H<Q?H+7:H)-Q;return F(V?Z-K:Z+(6-K),G);case u:case g:return B(Y+"Hours",0);case c:return B(Y+"Minutes",1);case s:return B(Y+"Seconds",2);case a:return B(Y+"Milliseconds",3);default:return this.clone()}},D.endOf=function(N){return this.startOf(N,!1)},D.$set=function(N,z){var U,V=k.p(N),q="set"+(this.$u?"UTC":""),F=(U={},U[u]=q+"Date",U[g]=q+"Date",U[h]=q+"Month",U[f]=q+"FullYear",U[c]=q+"Hours",U[s]=q+"Minutes",U[a]=q+"Seconds",U[o]=q+"Milliseconds",U)[V],B=V===u?this.$D+(z-this.$W):z;if(V===h||V===f){var H=this.clone().set(g,1);H.$d[F](B),H.init(),this.$d=H.set(g,Math.min(this.$D,H.daysInMonth())).$d}else F&&this.$d[F](B);return this.init(),this},D.set=function(N,z){return this.clone().$set(N,z)},D.get=function(N){return this[k.p(N)]()},D.add=function(N,z){var U,V=this;N=Number(N);var q=k.p(z),F=function(G){var Z=P(V);return k.w(Z.date(Z.date()+Math.round(G*N)),V)};if(q===h)return this.set(h,this.$M+N);if(q===f)return this.set(f,this.$y+N);if(q===u)return F(1);if(q===d)return F(7);var B=(U={},U[s]=n,U[c]=i,U[a]=r,U)[q]||1,H=this.$d.getTime()+N*B;return k.w(H,this)},D.subtract=function(N,z){return this.add(-1*N,z)},D.format=function(N){var z=this,U=this.$locale();if(!this.isValid())return U.invalidDate||m;var V=N||"YYYY-MM-DDTHH:mm:ssZ",q=k.z(this),F=this.$H,B=this.$m,H=this.$M,G=U.weekdays,Z=U.months,Y=U.meridiem,Q=function(ee,ae,oe,Ce){return ee&&(ee[ae]||ee(z,V))||oe[ae].slice(0,Ce)},K=function(ee){return k.s(F%12||12,ee,"0")},X=Y||function(ee,ae,oe){var Ce=ee<12?"AM":"PM";return oe?Ce.toLowerCase():Ce};return V.replace(b,function(ee,ae){return ae||function(oe){switch(oe){case"YY":return String(z.$y).slice(-2);case"YYYY":return k.s(z.$y,4,"0");case"M":return H+1;case"MM":return k.s(H+1,2,"0");case"MMM":return Q(U.monthsShort,H,Z,3);case"MMMM":return Q(Z,H);case"D":return z.$D;case"DD":return k.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Q(U.weekdaysMin,z.$W,G,2);case"ddd":return Q(U.weekdaysShort,z.$W,G,3);case"dddd":return G[z.$W];case"H":return String(F);case"HH":return k.s(F,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return X(F,B,!0);case"A":return X(F,B,!1);case"m":return String(B);case"mm":return k.s(B,2,"0");case"s":return String(z.$s);case"ss":return k.s(z.$s,2,"0");case"SSS":return k.s(z.$ms,3,"0");case"Z":return q}return null}(ee)||q.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(N,z,U){var V,q=this,F=k.p(z),B=P(N),H=(B.utcOffset()-this.utcOffset())*n,G=this-B,Z=function(){return k.m(q,B)};switch(F){case f:V=Z()/12;break;case h:V=Z();break;case p:V=Z()/3;break;case d:V=(G-H)/6048e5;break;case u:V=(G-H)/864e5;break;case c:V=G/i;break;case s:V=G/n;break;case a:V=G/r;break;default:V=G}return U?V:k.a(V)},D.daysInMonth=function(){return this.endOf(h).$D},D.$locale=function(){return I[this.$L]},D.locale=function(N,z){if(!N)return this.$L;var U=this.clone(),V=O(N,z,!0);return V&&(U.$L=V),U},D.clone=function(){return k.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},$}(),M=S.prototype;return P.prototype=M,[["$ms",o],["$s",a],["$m",s],["$H",c],["$W",u],["$M",h],["$y",f],["$D",g]].forEach(function($){M[$[1]]=function(D){return this.$g(D,$[0],$[1])}}),P.extend=function($,D){return $.$i||($(D,S,P),$.$i=!0),P},P.locale=O,P.isDayjs=T,P.unix=function($){return P(1e3*$)},P.en=I[w],P.Ls=I,P.p={},P})}(Av)),Av.exports}var hOe=dOe();const el=hl(hOe),pOe=t=>{const[e,r]=W.useState(!1),[n,i]=W.useState(!1),[o,a]=W.useState(""),[s,c]=W.useState("success"),{https:u}=er.useAPIContext(),{Toast:d}=er.useComponentContext(),h=_t(zt),p=(m,v)=>{c(m),a(v),i(!0)},f=()=>{a(""),i(!1)},g=m=>L(this,null,function*(){if(m.stopPropagation(),r(!0),(yield u.deleteEitherOr(t.eitherOr.id)).ok){p("success",h.deleteEitherOrMessage),r(!1),t.onClose(m),t.onDelete();return}p("danger",h.deleteEitherOrErrorMessage),r(!1)});return E.jsxs(E.Fragment,{children:[E.jsx(As,{open:t.isOpen,onClose:t.onClose,children:E.jsxs(Es,{children:[E.jsxs(ks,{children:[E.jsx(Pae,{}),h.deleteEitherOrTitle]}),E.jsx(Ni,{}),E.jsx(Ts,{children:E.jsxs(ze,{children:[h.deleteEitherOrDescription," ",E.jsx(ze,{fontWeight:"bold",children:t.eitherOr.title}),"?"]})}),E.jsxs(Bl,{children:[E.jsx(lt,{loading:e,variant:"solid",color:"danger",onClick:g,children:h.deleteLabel}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:m=>{m.stopPropagation(),t.onClose(m)},children:h.close})]})]})}),E.jsx(d,{showToast:n,color:s,message:o,hideToast:f})]})},fOe=({eitherOr:t,onClickEdit:e,onDelete:r})=>{const[n,i]=W.useState(!1),o=_t(zt),a=s=>{s.stopPropagation(),i(!n)};return E.jsxs(E.Fragment,{children:[E.jsxs(DE,{children:[E.jsx(qO,{slots:{root:ur},slotProps:{root:{variant:"plain",color:"neutral",size:"sm"}},onClick:s=>s.stopPropagation(),children:E.jsx(Aae,{})}),E.jsxs(WO,{size:"sm",sx:{minWidth:140},onClick:s=>s.stopPropagation(),children:[E.jsx(Xx,{onClick:e,children:o.edit}),E.jsx(Ni,{}),E.jsx(Xx,{color:"danger",onClick:a,disabled:t.status!=="INACTIVE",children:o.deleteLabel})]})]}),E.jsx(pOe,{isOpen:n,eitherOr:t,onDelete:r,onClose:s=>{s.stopPropagation(),i(!1)}})]})},mOe=({game:t})=>{const[e,r]=W.useState(null),[n,i]=W.useState(!1),{sdk:o}=er.useAPIContext(),{Spinner:a,Toast:s}=er.useComponentContext(),c=_t(zt),u=()=>L(this,null,function*(){try{const d=yield o.miniGames.getEitherOrResults(t.id);r(d.standings)}catch(d){console.error(d),r([]),i(!0)}});return W.useEffect(()=>(u(),()=>{r(null)}),[]),e?E.jsxs(E.Fragment,{children:[E.jsx(zl,{variant:"soft",sx:{p:2,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)",cursor:"default","&hover":{backgroundColor:"transparent"}},children:e.length?E.jsxs(Ma,{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:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{style:{width:"3%"},children:"#"}),E.jsx("th",{children:c.name}),E.jsx("th",{children:c.points})]})}),E.jsx("tbody",{children:e.map((d,h)=>{var p,f,g,m,v;return E.jsxs("tr",{children:[E.jsx("td",{children:h+1}),E.jsx("td",{children:E.jsxs(Oe,{display:"flex",alignItems:"center",children:[E.jsx(Sn,{variant:"soft",size:"sm",src:(p=d.userModel)!=null&&p.avatar?d.userModel.avatar:BEe,alt:"profile-avatar"}),E.jsxs(Oe,{ml:1,children:[E.jsxs(ze,{fontWeight:"md",children:[((f=d.userModel)==null?void 0:f.nickname)||"-------------"," ",(g=d.userModel)!=null&&g.name?E.jsxs(ze,{children:["(",d.userModel.name,")"]}):E.jsx(E.Fragment,{})]}),E.jsx(ze,{fontSize:"sm",sx:{opacity:"0.5"},children:(m=d.userModel)!=null&&m.country?(v=d.userModel)==null?void 0:v.country.name:""})]})]})}),E.jsx("td",{children:d.personalBest})]},`report-user-${d.userId}`)})})]}):E.jsx(ze,{level:"body-lg",textAlign:"center",fontWeight:"bold",my:6,children:c.noStandingsAvailable})}),E.jsx(s,{showToast:n,color:"danger",message:c.standingsErrorMessage,hideToast:()=>i(!1)})]}):E.jsx(a,{my:20})};class gOe{constructor(){l(this,"registered",{from_date:"",to_date:""});l(this,"interests",{ids:[],type:""});l(this,"either_or",{ids:[],type:"ALL",min_points:0});l(this,"classic_quiz",{ids:[],type:"",min_success_rate:0});l(this,"poll",{ids:[],type:"",option_ids:[]});l(this,"single_predictions",{ids:[],type:""});l(this,"top_x",{ids:[],type:""});l(this,"match_quiz",{ids:[],type:""})}}const vOe=({game:t})=>{const[e,r]=W.useState(null),[n,i]=W.useState(0),[o,a]=W.useState(!1),[s,c]=W.useState("success"),[u,d]=W.useState(""),h=_t(zt),{https:p}=er.useAPIContext(),{Toast:f,NumberInput:g,ExportUsersLeads:m}=er.useComponentContext(),v=(y,C)=>{c(y),d(C),a(!0)},b=y=>L(this,null,function*(){r(y);const C=new gOe;C.either_or.ids=[t.id],y>0&&(C.either_or.min_points=y);const w=yield p.exportUsers(C);if(w.ok){const I=yield w.blob(),_=URL.createObjectURL(I),T=document.createElement("a");T.href=_;const O=t.id+(y>0?`_points_${y}`:"");T.download=`either_or_${O}_exported_users.csv`,document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(_),r(null),v("success",h.usersExportMessage)}else console.error(yield w.json()),r(null),v("danger",h.usersExportErrorMessage)}),x=()=>E.jsxs(E.Fragment,{children:[E.jsxs("tr",{children:[E.jsxs("td",{children:[E.jsx(ze,{level:"body-sm",fontWeight:"600",children:h.exportUsersWithMinPoints.replace("_minPoints_",`${n||0}`)}),E.jsx(ze,{level:"body-xs",color:"neutral",children:h.exportUsersWithMinPointsDescription.replace("_minPoints_",`${n||0}`)})]}),E.jsx("td",{children:E.jsxs(Oe,{display:"flex",alignItems:"center",justifyContent:"flex-end",children:[E.jsx(g,{sx:{mb:.5,mr:2,width:70},defaultValue:n,onChange:y=>i(y)}),E.jsx(lt,{disabled:!(n>0),loading:e>0,onClick:()=>b(n),children:h.exportUsersWithMinPoints.replace("_minPoints_",`${n||0}`)})]})})]},"some-users"),E.jsxs("tr",{children:[E.jsxs("td",{children:[E.jsx(ze,{level:"body-sm",fontWeight:"600",children:h.exportAllUsers}),E.jsx(ze,{level:"body-xs",color:"neutral",children:h.exportAllUsersDescription})]}),E.jsx("td",{children:E.jsx(lt,{loading:e===0,onClick:()=>b(0),children:h.exportAllUsers})})]},"all-users")]});return E.jsxs(hn,{variant:"soft",sx:{borderRadius:0,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)"},children:[E.jsxs($n,{children:[E.jsxs(Oe,{mb:2,children:[E.jsx(Oe,{display:"flex",alignItems:"center",mb:1,children:E.jsx(ze,{level:"body-lg",sx:{mx:"auto"},children:h.exportUsersData})}),E.jsx(zl,{sx:{overflowX:"auto",minWidth:"700px"},children:E.jsxs(Ma,{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:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{children:h.category}),E.jsx("th",{children:h.action})]})}),E.jsx("tbody",{children:x()})]})})]}),E.jsx(m,{entityId:t.id,entityType:"either_or",entityName:t.title,labels:h})]}),E.jsx(f,{showToast:o,color:s,message:u,hideToast:()=>a(!1)})]})},B1="DEFAULT_X_AXIS_KEY",z1="DEFAULT_Y_AXIS_KEY",yOe={top:50,bottom:50,left:50,right:50},RB=R.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),bOe=(t,e)=>r=>t?t.fade==="series"?r.seriesId===(e==null?void 0:e.seriesId)&&r.dataIndex!==(e==null?void 0:e.dataIndex):t.fade==="global"?r.seriesId!==(e==null?void 0:e.seriesId)||r.dataIndex!==(e==null?void 0:e.dataIndex):!1:!1,xOe=(t,e)=>r=>t?t.highlight==="series"?r.seriesId===(e==null?void 0:e.seriesId):t.highlight==="item"?r.dataIndex===(e==null?void 0:e.dataIndex)&&r.seriesId===(e==null?void 0:e.seriesId):!1:!1,wOe=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function COe(t,e,r=wOe){return t.type==="pie"?j({},t,{data:t.data.map((n,i)=>j({color:r[i%r.length]},n))}):j({color:r[e%r.length]},t)}const IOe=({series:t,colors:e,seriesFormatters:r,dataset:n})=>{const i={};t.forEach((a,s)=>{var d;const{id:c=`auto-generated-id-${s}`,type:u}=a;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]=j({id:c},COe(a,s,e)),i[u].seriesOrder.push(c)});const o={};return Object.keys(r).forEach(a=>{var c,u;const s=i[a];s!==void 0&&(o[a]=(u=(c=r[a])==null?void 0:c.call(r,s,n))!=null?u:i[a])}),o};function rs({props:t,name:e}){return woe({props:t,name:e,defaultTheme:xw,themeId:ww})}const SOe=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],_Oe=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],TOe=t=>t==="dark"?_Oe:SOe,MB=R.createContext({isInitialized:!1,data:{}}),Ph=R.createContext({isInitialized:!1,data:{colorProcessors:{},seriesFormatters:{},xExtremumGetters:{},yExtremumGetters:{},rotationExtremumGetters:{},radiusExtremumGetters:{}}}),DB=(t,e)=>e==="x"?{x:t,y:null}:{x:null,y:t},$B=t=>{var c;const{axis:e,getFilters:r,isDefaultAxis:n}=t,i=r==null?void 0:r({currentAxisId:e.id,isDefaultAxis:n}),o=i?(c=e.data)==null?void 0:c.filter((u,d)=>i({x:null,y:null},d)):e.data,a=Math.min(...o!=null?o:[]),s=Math.max(...o!=null?o:[]);return[a,s]},LB=t=>e=>{const{series:r,axis:n,getFilters:i,isDefaultAxis:o}=e;return Object.keys(r).filter(a=>{var c;const s=(c=r[a].yAxisId)!=null?c:r[a].yAxisKey;return s===n.id||o&&s===void 0}).reduce((a,s)=>{var p,f,g;const{stackedData:c}=r[s],u=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:o,seriesXAxisId:(p=r[s].xAxisId)!=null?p:r[s].xAxisKey,seriesYAxisId:(f=r[s].yAxisId)!=null?f:r[s].yAxisKey}),[d,h]=(g=c==null?void 0:c.reduce((m,v,b)=>u&&(!u(DB(v[0],t),b)||!u(DB(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,a[0]),Math.max(h,a[1])]},[1/0,-1/0])},kOe=t=>Object.keys(t.series).some(r=>t.series[r].layout==="horizontal")?LB("x")(t):$B(t),AOe=t=>Object.keys(t.series).some(r=>t.series[r].layout==="horizontal")?$B(t):LB("y")(t);function Gi(t){return function(){return t}}const U1=2*Math.PI;function FB(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function POe(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function EOe(t){return t}function OOe(){var t=EOe,e=POe,r=null,n=Gi(0),i=Gi(U1),o=Gi(0);function a(s){var c,u=(s=FB(s)).length,d,h,p=0,f=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(U1,Math.max(-U1,i.apply(this,arguments)-m)),b,x=Math.min(Math.abs(v)/u,o.apply(this,arguments)),y=x*(v<0?-1:1),C;for(c=0;c<u;++c)(C=g[f[c]=c]=+t(s[c],c,s))>0&&(p+=C);for(e!=null?f.sort(function(w,I){return e(g[w],g[I])}):r!=null&&f.sort(function(w,I){return r(s[w],s[I])}),c=0,h=p?(v-u*y)/p:0;c<u;++c,m=b)d=f[c],C=g[d],b=m+(C>0?C*h:0)+y,g[d]={data:s[d],index:c,value:C,startAngle:m,endAngle:b,padAngle:x};return g}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:Gi(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,r=null,a):e},a.sort=function(s){return arguments.length?(r=s,e=null,a):r},a.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:Gi(+s),a):n},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Gi(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:Gi(+s),a):o},a}function Uc(t,e){if((a=t.length)>1)for(var r=1,n,i,o=t[e[0]],a,s=o.length;r<a;++r)for(i=o,o=t[e[r]],n=0;n<s;++n)o[n][1]+=o[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Hc(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function ROe(t,e){return t[e]}function MOe(t){const e=[];return e.key=t,e}function NB(){var t=Gi([]),e=Hc,r=Uc,n=ROe;function i(o){var a=Array.from(t.apply(this,arguments),MOe),s,c=a.length,u=-1,d;for(const h of o)for(s=0,++u;s<c;++s)(a[s][u]=[0,+n(h,a[s].key,u,o)]).data=h;for(s=0,d=FB(e(a));s<c;++s)a[d[s]].index=s;return r(a,d),a}return i.keys=function(o){return arguments.length?(t=typeof o=="function"?o:Gi(Array.from(o)),i):t},i.value=function(o){return arguments.length?(n=typeof o=="function"?o:Gi(+o),i):n},i.order=function(o){return arguments.length?(e=o==null?Hc:typeof o=="function"?o:Gi(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(r=o==null?Uc:o,i):r},i}function DOe(t,e){if((n=t.length)>0){for(var r,n,i=0,o=t[0].length,a;i<o;++i){for(a=r=0;r<n;++r)a+=t[r][i][1]||0;if(a)for(r=0;r<n;++r)t[r][i][1]/=a}Uc(t,e)}}function $Oe(t,e){if((c=t.length)>0)for(var r,n=0,i,o,a,s,c,u=t[e[0]].length;n<u;++n)for(a=s=0,r=0;r<c;++r)(o=(i=t[e[r]][n])[1]-i[0])>0?(i[0]=a,i[1]=a+=o):o<0?(i[1]=s,i[0]=s+=o):(i[0]=0,i[1]=o)}function LOe(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,o=n.length;r<o;++r){for(var a=0,s=0;a<i;++a)s+=t[a][r][1]||0;n[r][1]+=n[r][0]=-s/2}Uc(t,e)}}function FOe(t,e){if(!(!((a=t.length)>0)||!((o=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,o,a;n<o;++n){for(var s=0,c=0,u=0;s<a;++s){for(var d=t[e[s]],h=d[n][1]||0,p=d[n-1][1]||0,f=(h-p)/2,g=0;g<s;++g){var m=t[e[g]],v=m[n][1]||0,b=m[n-1][1]||0;f+=v-b}c+=h,u+=f*h}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,Uc(t,e)}}function jB(t){var e=t.map(NOe);return Hc(t).sort(function(r,n){return e[r]-e[n]})}function NOe(t){for(var e=-1,r=0,n=t.length,i,o=-1/0;++e<n;)(i=+t[e][1])>o&&(o=i,r=e);return r}function BB(t){var e=t.map(zB);return Hc(t).sort(function(r,n){return e[r]-e[n]})}function zB(t){for(var e=0,r=-1,n=t.length,i;++r<n;)(i=+t[r][1])&&(e+=i);return e}function jOe(t){return BB(t).reverse()}function BOe(t){var e=t.length,r,n,i=t.map(zB),o=jB(t),a=0,s=0,c=[],u=[];for(r=0;r<e;++r)n=o[r],a<s?(a+=i[n],c.push(n)):(s+=i[n],u.push(n));return u.reverse().concat(c)}function zOe(t){return Hc(t).reverse()}const H1={appearance:jB,ascending:BB,descending:jOe,insideOut:BOe,none:Hc,reverse:zOe},V1={expand:DOe,diverging:$Oe,none:Uc,silhouette:LOe,wiggle:FOe},UB=t=>{const{series:e,seriesOrder:r,defaultStrategy:n}=t,i=[],o={};return r.forEach(a=>{var d,h;const{stack:s,stackOrder:c,stackOffset:u}=e[a];s===void 0?i.push({ids:[a],stackingOrder:H1.none,stackingOffset:V1.none}):o[s]===void 0?(o[s]=i.length,i.push({ids:[a],stackingOrder:H1[(d=c!=null?c:n==null?void 0:n.stackOrder)!=null?d:"none"],stackingOffset:V1[(h=u!=null?u:n==null?void 0:n.stackOffset)!=null?h:"diverging"]})):(i[o[s]].ids.push(a),c!==void 0&&(i[o[s]].stackingOrder=H1[c]),u!==void 0&&(i[o[s]].stackingOffset=V1[u]))}),i};function HB(t,e){const r={};return Object.keys(t).forEach(n=>{var i;r[n]=j({},t[n],{valueFormatter:(i=t[n].valueFormatter)!=null?i:e})}),r}const UOe=(t,e)=>{const{seriesOrder:r,series:n}=t,i=UB(t),o=e!=null?e:[];r.forEach(s=>{const c=n[s].data;if(c!==void 0)c.forEach((u,d)=>{o.length<=d?o.push({[s]:u}):o[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(`
|
|
3639
|
+
></div>`,m=({title:b})=>A.jsx(Et,{title:b,sx:{maxWidth:300},children:A.jsx(Ac,{color:"primary"})}),v=()=>A.jsxs(hn,{sx:{pb:1,mb:3},children:[A.jsx(wo,{label:e.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:A.jsx(m,{title:e.quizzesInfoMessage}),onChange:b=>o(b.target.value)}),A.jsx(wo,{label:e.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:A.jsx(m,{title:e.eitherOrsInfoMessage}),onChange:b=>s(b.target.value)}),A.jsx(wo,{label:e.pollURL,placeholder:"",defaultValue:c,required:!1,size:"md",endDecorator:A.jsx(m,{title:e.pollsInfoMessage}),onChange:b=>u(b.target.value)})]});return A.jsxs(Oe,{mt:1,children:[A.jsx(ov,{defaultValue:r,label:e.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:b=>{b===!1&&(o(""),s(""),u("")),n(b)}}),r&&v(),A.jsxs(Oe,{position:"relative",mb:1,children:[A.jsx(zf,{value:g,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:b=>b.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),A.jsx(Et,{title:e.copyToClipboard,children:A.jsx(lt,{onClick:()=>{navigator.clipboard.writeText(g)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:A.jsx(rm,{})})})]}),A.jsx(Wx,{variant:"outlined",color:"primary",startDecorator:A.jsx(Ac,{}),sx:{mb:1,width:"fit-content"},children:A.jsxs(ze,{color:"primary",fontSize:14,fontWeight:500,children:[e.divElementTextInfo,A.jsx(Ps,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},bB=t=>(t==null?void 0:t.map(e=>({id:e.id,value:e.nickname?e.nickname:e.name||`No name ${e.id.slice(0,5)}`,label:e.nickname?e.nickname:e.name||`No name ${e.id.slice(0,5)}`,avatar:e.avatar})))||[],_Ee=({labels:t,ids:e,onChange:r})=>{const[n,i]=W.useState([]),[o,a]=W.useState([]),[s,c]=W.useState(""),[u,d]=W.useState("name"),[h,p]=W.useState(!1),[f,g]=W.useState(!1),{sdk:m}=qr(),v=!0,b=()=>g(!f),x=(I,_)=>{i(_);const T=_.map(O=>O.id);r(T&&T.length?T:null)},y=3;W.useEffect(()=>{!s&&e&&e.length&&m.profile.getByIds(e,void 0,v).then(I=>{i(bB(I))}).catch(I=>{b(),console.error(I),i([])})},[]);const C=W.useMemo(()=>Xs((I,_)=>{p(!0),m.profile.getByIds(_==="id"?[I]:[],_==="name"?I:void 0,v).then(T=>{a([...bB(T)]),p(!1)}).catch(T=>{console.error(T),b(),a([]),p(!1)})},300),[]);W.useEffect(()=>{if(!s||s.length<y){a([]);return}return C(s,u),()=>C.cancel()},[s,C,u]);const w=(I,_)=>I.map((T,O)=>{var P;return A.jsx(dn,{variant:"solid",endDecorator:A.jsx(Pa,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>_({index:O}).onClick(k),children:A.jsx(Ms,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:A.jsxs(Oe,{display:"flex",alignItems:"center",mr:1,children:[A.jsx(Sn,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(P=T.avatar)!=null?P:jr.avatar}),A.jsx(ze,{children:T.label})]})},T.id)});return A.jsxs(A.Fragment,{children:[A.jsx(Oe,{sx:{marginBottom:"16px"},children:A.jsx(Ss,{forcePopupIcon:!1,multiple:!0,loading:h,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(I,_)=>I.id===_.id,endDecorator:A.jsxs(A.Fragment,{children:[h&&A.jsx(Kn,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),A.jsx(Ni,{orientation:"vertical"}),A.jsxs(br,{variant:"plain",value:u,onChange:(I,_)=>d(_),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[A.jsx(qt,{value:"name",children:t.searchByName}),A.jsx(qt,{value:"id",children:t.searchById})]})]}),placeholder:n.length>0?"":t.excludedProfilesPlaceholder,options:o,filterOptions:I=>I.filter(_=>!n.some(T=>T.value===_.value)),onInputChange:(I,_)=>{c(_)},onChange:x,getOptionKey:I=>I.id,value:n,renderTags:w,renderOption:(I,_)=>{var T;return A.jsx(Is,me(se({},I),{children:A.jsxs(Oe,{display:"flex",alignItems:"center",mr:1,children:[A.jsx(Sn,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(T=_.avatar)!=null?T:jr.avatar}),A.jsx(ze,{children:_.label})]})}))}})}),A.jsx(Nr,{showToast:f,message:t.searchProfilesErrorMessage,color:"danger",hideToast:b})]})},TEe={Login:oSe,InformationInput:wo,RichText:bI,HeaderButtons:Mwe,MarketSelection:xSe,Accordion:yye,DynamicFields:Qwe,BasicSelect:xye,BooleanSwitch:ov,Branding:Rwe,ProfileSearchSelect:z_e,RangeCalendar:Kwe,CompetitionSearchSelect:j_e,Related:SSe,Images:$1e,Duration:Ywe,DatePickerComponent:ah,Flags:O1e,Spinner:iv,Tags:zN,Toast:Nr,AdContent:bye,Match:wSe,Winners:Pke,CompetitionsSearchSelect:B_e,TeamsSearchSelect:U_e,CustomSelect:BSe,Schedule:MSe,NoPermissionCard:Jwe,CustomFlatpickrCalendar:r1,ContextSelectFilter:Oke,NumberInput:nAe,EntityContext:uAe,MiniGamesImages:hAe,AuthRequirement:pAe,SortableList:iEe,ItemsPerPageFilter:oEe,ImageCard:hh,RelatedRelationship:bEe,ExportUsersLeads:xEe,SignOutButton:mF,BasicSortableList:CEe,WidgetEmbedCode:IEe,WidgetListEmbedCode:SEe,AdvancedProfileSearchSelect:_Ee},xB=W.createContext(null),kEe=({children:t})=>A.jsx(xB.Provider,{value:TEe,children:t}),AEe=()=>{const t=W.useContext(xB);if(!t)throw new Error("useComponentContext must be used within a ComponentProvider");return t},wB=425,CB=1024,PEe=()=>{const[t,e]=W.useState(window.innerWidth<=CB),[r,n]=W.useState(window.innerWidth<=wB);return W.useLayoutEffect(()=>{const i=()=>{e(window.innerWidth<=CB),n(window.innerWidth<=wB)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:t,isPhone:r}},er={APIProvider:Rfe,AuthProvider:Mfe,AuthContext:K$,ComponentProvider:kEe,useComponentContext:AEe,useAPIContext:qr,useIsMobile:PEe};class IB{constructor(){l(this,"types",[]);l(this,"languageConfig",null);l(this,"authRequirement",null)}}class EEe{constructor(e){l(this,"userNotFound");l(this,"signOut");l(this,"timeFormat");l(this,"getEitherOrsErrorMessage");l(this,"title");l(this,"noGamesFound");l(this,"status");l(this,"totalParticipations");l(this,"finishedParticipations");l(this,"users");l(this,"averageStartedParticipations");l(this,"averageFinishedParticipations");l(this,"creationDate");l(this,"actions");l(this,"create");l(this,"edit");l(this,"save");l(this,"preview");l(this,"previewGame");l(this,"close");l(this,"filterBy");l(this,"sortBy");l(this,"clearStatus");l(this,"contextEntityTag");l(this,"typeContextTagNamePlaceholder");l(this,"showMoreImages");l(this,"hideMoreImages");l(this,"uploadImage");l(this,"groupByStatus");l(this,"copyUrl");l(this,"copied");l(this,"add");l(this,"configuration");l(this,"description");l(this,"descriptionPlaceholder");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,"rules");l(this,"rulesPlaceholder");l(this,"adContent");l(this,"adContentPlaceholder");l(this,"optionImages");l(this,"imagePlaceholder");l(this,"main");l(this,"cover");l(this,"mobile");l(this,"active");l(this,"inactive");l(this,"statusDescription");l(this,"winningCondition");l(this,"winningConditionDescription");l(this,"more");l(this,"less");l(this,"time");l(this,"timeDescription");l(this,"lives");l(this,"livesDescription");l(this,"points");l(this,"pointsDescription");l(this,"streakThreshold");l(this,"pointsCorrectSteps");l(this,"pointsCorrectStepsPlaceholder");l(this,"pointsScore");l(this,"pointsScorePlaceholder");l(this,"optionsValue");l(this,"optionsValuePlaceholder");l(this,"repeatedValueMessage");l(this,"flags");l(this,"flagsPlaceholder");l(this,"labels");l(this,"customFields");l(this,"dynamicFieldsDescription");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,"entity");l(this,"campaign");l(this,"id");l(this,"label");l(this,"type");l(this,"typeDescription");l(this,"deleteLabel");l(this,"hideFilters");l(this,"showFilters");l(this,"previous");l(this,"next");l(this,"exportAllUsers");l(this,"getFootballEntitiesErrorMessage");l(this,"titleRequiredFieldValidationMessage");l(this,"livesFieldValidationMessage");l(this,"timeFieldValidationMessage");l(this,"pointsFieldValidationMessage");l(this,"optionsFieldValidationMessage");l(this,"tagsInvalidFieldValidationMessage");l(this,"getEitherOrErrorMessage");l(this,"deleteEitherOrMessage");l(this,"deleteEitherOrErrorMessage");l(this,"createEitherOrMessage");l(this,"createEitherOrErrorMessage");l(this,"updateEitherOrMessage");l(this,"updateEitherOrErrorMessage");l(this,"updateEitherOrTranslationErrorMessage");l(this,"uploadingImageMessage");l(this,"generateSignedInUrlErrorMessage");l(this,"uploadingImageErrorMessage");l(this,"encryptingImageErrorMessage");l(this,"searchSportal365ImagesErrorMessage");l(this,"usersExportMessage");l(this,"usersExportErrorMessage");l(this,"createFromTemplate");l(this,"browseEitherOrGames");l(this,"noTemplateGamesFound");l(this,"expand");l(this,"import");l(this,"translateAndImport");l(this,"clientFeaturesNotFoundMessage");l(this,"featureDisabled");l(this,"noPermissionMessage");l(this,"tryAgainButton");l(this,"expired");l(this,"sortByCreatedAtAsc");l(this,"sortByCreatedAtDesc");l(this,"sortByUpdatedAtAsc");l(this,"sortByUpdatedAtDesc");l(this,"itemsPerPage");l(this,"pageNo");l(this,"additionalInformation");l(this,"deleteEitherOrTitle");l(this,"deleteEitherOrDescription");l(this,"manageEitherOrTitle");l(this,"manageEitherOrDescription");l(this,"back");l(this,"alternativeTitle");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,"urlCopiedToClipboardMessage");l(this,"imageDeletedMessage");l(this,"imageResetMessage");l(this,"authRequirement");l(this,"authRequirementDescription");l(this,"free");l(this,"lead");l(this,"registered");l(this,"language");l(this,"languageDescription");l(this,"addOption");l(this,"removeOption");l(this,"addImages");l(this,"additionalFields");l(this,"addPoint");l(this,"removePoint");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,"reports");l(this,"exports");l(this,"exportUsersData");l(this,"category");l(this,"action");l(this,"exportAllUsersDescription");l(this,"participations");l(this,"standings");l(this,"noStandingsAvailable");l(this,"standingsErrorMessage");l(this,"participationOverview");l(this,"performanceByDay");l(this,"chartErrorMessage");l(this,"exportUsersForOption");l(this,"exportAllUsersForOption");l(this,"exportForOption");l(this,"languagesModalTitle");l(this,"languagesModalDescription");l(this,"languagesModalSave");l(this,"languageParentText");l(this,"gameTranslationErrorMessage");l(this,"translateTo");l(this,"exportUsersWithMinPoints");l(this,"exportUsersWithMinPointsDescription");l(this,"exportUsersLeads");l(this,"exportAllUsersLeads");l(this,"exportAllUsersLeadsDescription");l(this,"usersLeadsExportMessage");l(this,"usersLeadsExportErrorMessage");l(this,"related");l(this,"relationship");l(this,"relatedEntitiesErrorMessage");l(this,"widgetEmbedCodeTitle");l(this,"configureLeads");l(this,"configureLeadsDisabledMessage");l(this,"leadPosition");l(this,"addCampaignInfo");l(this,"campaignIdInfoMessage");l(this,"campaignNameInfoMessage");l(this,"copyToClipboard");l(this,"divElementTextInfo");l(this,"widgetEmbedCodeNotAvailable");this.userNotFound=(e==null?void 0: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==null?void 0:e.featureDisabled)||"Feature disabled!",this.noPermissionMessage=(e==null?void 0:e.noPermissionMessage)||"You have no permission for this feature!",this.tryAgainButton=(e==null?void 0:e.tryAgainButton)||"Try again",this.signOut=(e==null?void 0:e.signOut)||"Sign out",this.noGamesFound=(e==null?void 0:e.noGamesFound)||"No Either/Or games were found. You can create one by clicking the button 'Create'",this.timeFormat=(e==null?void 0:e.timeFormat)||"DD.MM.YYYY, HH:mm",this.getEitherOrsErrorMessage=(e==null?void 0:e.getEitherOrsErrorMessage)||"There was a problem with fetching list of Either/Or games",this.title=e&&e.title?e.title:"Title",this.status=e&&e.status?e.status:"Status",this.totalParticipations=(e==null?void 0:e.totalParticipations)||"Total participations",this.finishedParticipations=(e==null?void 0:e.finishedParticipations)||"Finished participations",this.users=(e==null?void 0:e.users)||"Users",this.averageStartedParticipations=(e==null?void 0:e.averageStartedParticipations)||"Average started participations",this.averageFinishedParticipations=(e==null?void 0:e.averageFinishedParticipations)||"Average finished participations",this.creationDate=e&&e.creationDate?e.creationDate:"Created at",this.actions=e&&e.actions?e.actions:"Actions",this.language=(e==null?void 0:e.language)||"Language",this.languageDescription=(e==null?void 0:e.languageDescription)||"Select the language for your game. You can manage language selection by configuring available languages in language configuration. It cannot be changed if multilingual feature is in use.",this.sortByCreatedAtAsc=(e==null?void 0:e.sortByCreatedAtAsc)||"Sort by created at field in ascending order",this.sortByCreatedAtDesc=(e==null?void 0:e.sortByCreatedAtDesc)||"Sort by created at field in descending order",this.sortByUpdatedAtAsc=(e==null?void 0:e.sortByUpdatedAtAsc)||"Sort by updated at field in ascending order",this.sortByUpdatedAtDesc=(e==null?void 0:e.sortByUpdatedAtDesc)||"Sort by updated at field in descending order",this.itemsPerPage=(e==null?void 0:e.itemsPerPage)||"Items per page",this.pageNo=(e==null?void 0:e.pageNo)||"Page No",this.additionalInformation=(e==null?void 0:e.additionalInformation)||"Additional information",this.exports=(e==null?void 0:e.exports)||"Exports",this.reports=(e==null?void 0:e.reports)||"Reports",this.standings=(e==null?void 0:e.standings)||"Standings",this.noStandingsAvailable=(e==null?void 0:e.noStandingsAvailable)||"No standings available.",this.standingsErrorMessage=(e==null?void 0:e.standingsErrorMessage)||"There was a problem with fetching information about either/or game standings. Please try again",this.participations=(e==null?void 0:e.participations)||"Participations",this.participationOverview=(e==null?void 0:e.participationOverview)||"Participation Overview",this.performanceByDay=(e==null?void 0:e.performanceByDay)||"Performance by day",this.chartErrorMessage=(e==null?void 0:e.chartErrorMessage)||"There was a problem with fetching information about either/or game participation. Please try again",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 participated in the game.",this.exportUsersWithMinPoints=(e==null?void 0:e.exportUsersWithMinPoints)||"Export all users with at least _minPoints_ points",this.exportUsersWithMinPointsDescription=(e==null?void 0:e.exportUsersWithMinPointsDescription)||"Exports the users who got at least _minPoints_ points in the game.",this.usersExportMessage=(e==null?void 0:e.usersExportMessage)||"All users have been exported successfully",this.usersExportErrorMessage=(e==null?void 0:e.usersExportErrorMessage)||"There was a problem with exporting users. Please try again",this.createFromTemplate=(e==null?void 0:e.createFromTemplate)||"Create from template",this.browseEitherOrGames=(e==null?void 0:e.browseEitherOrGames)||"Browse Either/Or Games",this.noTemplateGamesFound=(e==null?void 0:e.noTemplateGamesFound)||"No Either/Or games were found.",this.expand=(e==null?void 0:e.expand)||"Expand",this.import=(e==null?void 0:e.import)||"Import",this.translateAndImport=(e==null?void 0:e.translateAndImport)||"Translate to _language_ and Import",this.manageEitherOrTitle=(e==null?void 0:e.manageEitherOrTitle)||"Manage Either/Or",this.manageEitherOrDescription=(e==null?void 0:e.manageEitherOrDescription)||"Manage your Either/Or game here",this.back=(e==null?void 0:e.back)||"Back",this.alternativeTitle=(e==null?void 0:e.alternativeTitle)||"Alternative title",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.previewGame=e&&e.previewGame?e.previewGame:"Preview Either/Or",this.close=e&&e.close?e.close:"Close",this.sortBy=(e==null?void 0:e.sortBy)||"Sort by:",this.contextEntityTag=(e==null?void 0:e.contextEntityTag)||"Context entity tag",this.typeContextTagNamePlaceholder=(e==null?void 0:e.typeContextTagNamePlaceholder)||"Type context tag name...",this.getFootballEntitiesErrorMessage=(e==null?void 0:e.getFootballEntitiesErrorMessage)||"There was a problem with fetching football's data",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.groupByStatus=(e==null?void 0:e.groupByStatus)||"Group by status",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.description=e&&e.description?e.description:"Description",this.descriptionPlaceholder=e&&e.descriptionPlaceholder?e.descriptionPlaceholder:"Describe your Either/Or",this.images=e&&e.images?e.images:"Images",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 in Either/Or",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.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.winningCondition=(e==null?void 0:e.winningCondition)||"Winning condition",this.winningConditionDescription=(e==null?void 0:e.winningConditionDescription)||"Winning condition determines the correct choice out of a pair of options presented to the user. When is set to 'More,' the user must select the option that has a greater value to win. Conversely, if is set to 'Less,' the winning choice is the one with the lesser value",this.more=(e==null?void 0:e.more)||"More",this.less=(e==null?void 0:e.less)||"Less",this.time=e&&e.time?e.time:"Time",this.timeDescription=e&&e.timeDescription?e.timeDescription:"Enter the time limit for answering questions by users. Time is in seconds",this.lives=(e==null?void 0:e.lives)||"Lives",this.livesDescription=(e==null?void 0:e.livesDescription)||"Enter how many lives the user will have during a game",this.points=(e==null?void 0:e.points)||"Points",this.pointsDescription=(e==null?void 0:e.pointsDescription)||"Set the threshold of consecutive correct answers after which points are awarded and define the amount of points received from this step onwards. Valid value for correct steps is between 0-50 and for score 1-100",this.streakThreshold=(e==null?void 0:e.streakThreshold)||"Streak threshold",this.pointsCorrectSteps=(e==null?void 0:e.pointsCorrectSteps)||"Correct steps",this.pointsScore=(e==null?void 0:e.pointsScore)||"Score",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 game",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.optionsDescription=(e==null?void 0:e.optionsDescription)||"Describe the options that users will select from during the game. Ensure to provide a minimum of 5 and a maximum of 100 options",this.optionsValue=(e==null?void 0:e.optionsValue)||"Value",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.entity=e&&e.entity?e.entity:"Entity",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 Either/Or type. You can manage different types by configuring them in the settings",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.createEitherOrMessage=e&&(e==null?void 0:e.createEitherOrMessage)||"You have successfully created Either/Or",this.createEitherOrErrorMessage=(e==null?void 0:e.createEitherOrErrorMessage)||"There was a problem creating Either/Or. Please try again",this.titleRequiredFieldValidationMessage=(e==null?void 0:e.titleRequiredFieldValidationMessage)||"Title field is required!",this.livesFieldValidationMessage=(e==null?void 0:e.livesFieldValidationMessage)||"The value for 'lives' field is invalid. The valid one is withing the range of 1-20",this.timeFieldValidationMessage=(e==null?void 0:e.timeFieldValidationMessage)||"The value for 'time' field is invalid. The valid one is withing the range of 1-20",this.pointsFieldValidationMessage=(e==null?void 0:e.pointsFieldValidationMessage)||"Points contain value where score or correct steps is an invalid one",this.optionsFieldValidationMessage=(e==null?void 0:e.optionsFieldValidationMessage)||"Options must not contain any repeated IDs",this.tagsInvalidFieldValidationMessage=(e==null?void 0:e.tagsInvalidFieldValidationMessage)||"Tag entity is required!",this.getEitherOrErrorMessage=(e==null?void 0:e.getEitherOrErrorMessage)||"There was a problem with fetching Either/Or data. Please try again",this.deleteEitherOrMessage=(e==null?void 0:e.deleteEitherOrMessage)||"You have successfully deleted Either/Or",this.deleteEitherOrErrorMessage=(e==null?void 0:e.deleteEitherOrErrorMessage)||"There was a problem with deleting Either/Or. Please try again",this.updateEitherOrMessage=(e==null?void 0:e.updateEitherOrMessage)||"You have successfully updated Either/Or",this.updateEitherOrErrorMessage=(e==null?void 0:e.updateEitherOrErrorMessage)||"There was a problem updating Either/Or. Please try again",this.updateEitherOrTranslationErrorMessage=(e==null?void 0:e.updateEitherOrTranslationErrorMessage)||"There was a problem translating Either/Or game. Please try again",this.uploadingImageMessage=(e==null?void 0:e.uploadingImageMessage)||"You have successfully uploaded image",this.generateSignedInUrlErrorMessage=(e==null?void 0:e.generateSignedInUrlErrorMessage)||"There was a problem generating signed in URL to store the image in bucket. Please try again",this.uploadingImageErrorMessage=(e==null?void 0:e.uploadingImageErrorMessage)||"There was a problem with uploading image to bucket. Please try again",this.encryptingImageErrorMessage=(e==null?void 0:e.encryptingImageErrorMessage)||"There was a problem with encrypting image before uploading it to bucket. Please try again",this.searchSportal365ImagesErrorMessage=(e==null?void 0:e.searchSportal365ImagesErrorMessage)||"There was a problem with searching images from Sportal 365 API. Please try again",this.deleteEitherOrTitle=(e==null?void 0:e.deleteEitherOrTitle)||"Delete Either/Or",this.deleteEitherOrDescription=(e==null?void 0:e.deleteEitherOrDescription)||"Are you sure you want to delete",this.mainImage=(e==null?void 0:e.mainImage)||"Main",this.coverImage=(e==null?void 0:e.coverImage)||"Cover",this.mobileImage=(e==null?void 0:e.mobileImage)||"Mobile",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.addPoint=(e==null?void 0:e.addPoint)||"Add point",this.removePoint=(e==null?void 0:e.removePoint)||"Remove",this.addOption=(e==null?void 0:e.addOption)||"Add option",this.removeOption=(e==null?void 0:e.removeOption)||"Remove option",this.addImages=(e==null?void 0:e.addImages)||"Add images",this.additionalFields=(e==null?void 0:e.additionalFields)||"Additional fields",this.languagesModalTitle=(e==null?void 0:e.languagesModalTitle)||"Select Languages",this.languagesModalDescription=(e==null?void 0:e.languagesModalDescription)||"Select the languages this game is going to be translated in.",this.languagesModalSave=(e==null?void 0:e.languagesModalSave)||"Save language preference",this.gameTranslationErrorMessage=(e==null?void 0:e.gameTranslationErrorMessage)||"An error occurred while translating the game.",this.languageParentText=(e==null?void 0:e.languageParentText)||"This game is a translated version of",this.translateTo=(e==null?void 0:e.translateTo)||"Translate to ",this.exportUsersData=(e==null?void 0:e.exportUsersData)||"Export users data",this.exportUsersLeads=(e==null?void 0:e.exportUsersLeads)||"Export users leads",this.exportAllUsersLeads=(e==null?void 0:e.exportAllUsersLeads)||"Export all users leads",this.exportAllUsersLeadsDescription=(e==null?void 0:e.exportAllUsersLeadsDescription)||"Export all users collected leads in the game.",this.usersLeadsExportMessage=(e==null?void 0:e.usersLeadsExportMessage)||"All users leads have been exported successfully",this.usersLeadsExportErrorMessage=(e==null?void 0:e.usersLeadsExportErrorMessage)||"There was a problem with exporting all users leads. Please try again",this.related=(e==null?void 0:e.related)||"Related",this.relationship=(e==null?void 0:e.relationship)||"Relationship",this.relatedEntitiesErrorMessage=(e==null?void 0:e.relatedEntitiesErrorMessage)||"There was a problem with fetching entities for related. Please try again",this.widgetEmbedCodeTitle=(e==null?void 0:e.widgetEmbedCodeTitle)||"Widget embed code",this.configureLeads=(e==null?void 0:e.configureLeads)||"Configure leads",this.configureLeadsDisabledMessage=(e==null?void 0:e.configureLeadsDisabledMessage)||"Configure leads is enabled only when the authentication requirement is set to “Lead”.",this.leadPosition=(e==null?void 0:e.leadPosition)||"Lead position",this.addCampaignInfo=(e==null?void 0:e.addCampaignInfo)||"Add campaign info",this.campaignIdInfoMessage=(e==null?void 0:e.campaignIdInfoMessage)||'Group multiple content items by a campaign ID. This field will be used for filtering later on, so make sure you have excatly the same ID across your multiple quizzes, polls and other games in general. We recommend using lowercase and -. Example: "adidas-december-2025"',this.campaignNameInfoMessage=(e==null?void 0:e.campaignNameInfoMessage)||'A label for your campaign that will appear in the reports. You can use anything here. Example: "Adidas (December 2025)"',this.copyToClipboard=(e==null?void 0:e.copyToClipboard)||"Copy to clipboard",this.divElementTextInfo=(e==null?void 0:e.divElementTextInfo)||"The generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation: ",this.widgetEmbedCodeNotAvailable=(e==null?void 0:e.widgetEmbedCodeNotAvailable)||"To configure embed code you need to first create your Either/Or game."}}const zt=W.createContext(null),OEe=({labels:t,children:e})=>{const r=new EEe(t);return E.jsx(zt.Provider,{value:r,children:e})},aa=W.createContext(null),REe=({features:t,children:e})=>E.jsx(aa.Provider,{value:t,children:e}),MEe=({children:t})=>E.jsx(Oe,{width:"100%",sx:{backgroundColor:"#fff"},children:t});function _t(t){const e=W.useContext(t);if(e===void 0)throw new Error("Context was used outside of its Provider");return e}class DEe{constructor(){l(this,"isValid",!0);l(this,"message","");l(this,"minTimeAndLives",1);l(this,"maxTimeAndLives",20);l(this,"minPoints",1);l(this,"maxPoints",100);l(this,"minCorrectSteps",0);l(this,"maxCorrectSteps",50);l(this,"validate",(e,r)=>{this.validateRequiredFields(e,r),this.isValid&&(this.validateLives(e.lives,r),this.validateTime(e.time,r),this.validatePoints(e.points,r),this.validateOptions(e.options,r),this.validateContext(e.context,r))});l(this,"validateRequiredFields",(e,r)=>{e.title||(this.isValid=!1,this.message=r.titleRequiredFieldValidationMessage)});l(this,"validateLives",(e,r)=>{(e<this.minTimeAndLives||e>this.maxTimeAndLives)&&(this.isValid=!1,this.message=r.livesFieldValidationMessage)});l(this,"validateTime",(e,r)=>{(e<this.minTimeAndLives||e>this.maxTimeAndLives)&&(this.isValid=!1,this.message=r.timeFieldValidationMessage)});l(this,"validatePoints",(e,r)=>{if(e&&e.length>0){const n=e.some(i=>i.score>this.minPoints||i.score<this.maxPoints||i.correct_steps>this.minCorrectSteps||i.correct_steps<this.maxCorrectSteps);n||(this.isValid=n,this.message=r.pointsFieldValidationMessage)}});l(this,"validateOptions",(e,r)=>{if(e&&e.length>0){const n=e.map(o=>o.id);new Set(n).size!==n.length&&(this.isValid=!1,this.message=r.optionsFieldValidationMessage)}});l(this,"validateContext",(e,r)=>{e&&e.tags.forEach(n=>{n.id||(this.isValid=!1,this.message=r.tagsInvalidFieldValidationMessage)})})}}class $Ee{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,"winning_condition","MORE");l(this,"lives",3);l(this,"time",10);l(this,"points",[]);l(this,"rules",null);l(this,"ad_content",null);l(this,"branding",null);l(this,"labels",null);l(this,"custom_fields",null);l(this,"images",null);l(this,"status","INACTIVE");l(this,"flags",[]);l(this,"options",[]);l(this,"related",[]);l(this,"context",null)}}class Th{constructor(){l(this,"createNewRequestBody",e=>{if(!e){const r=new $Ee;return r.points=this.constructEmptyCreatePoints(),r.options=this.constructEmptyCreateOptions(),r}return e.branding=this.reconstructBranding(ce({},e.branding)),e.context=this.createContext(ce({},e.context)),ce({},e)});l(this,"finalizeNewRequestBody",(e,r)=>(e.images&&(e.images=this.reconstructImages(ce({},e.images))),e.branding&&(e.branding=this.reconstructBranding(ce({},e.branding))),e.context&&(e.context=this.reconstructContext(ce({},e.context))),e.auth_requirement=e.auth_requirement||r.authRequirement,e.language=e.language||r.languageConfig.default_language,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(r=>r.id),e.campaign&&this.isObjectValuesEmpty(e.campaign)&&(e.campaign=null),!e.content&&!e.tags.length&&!e.campaign?null:e));l(this,"createImagesModel",()=>({main:null,cover:null,mobile:null}));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,"constructEmptyTag",()=>({id:"",type:"competition",source:"football"}));l(this,"isObjectValuesEmpty",e=>Object.values(e).every(r=>!r));l(this,"createGameImagesModel",()=>({main:"",mobile:""}));l(this,"constructPoints",e=>e&&e.length?Array.from(e):this.constructEmptyCreatePoints());l(this,"constructEmptyCreatePoints",()=>[{correct_steps:0,score:10},{correct_steps:5,score:20},{correct_steps:10,score:30},{correct_steps:15,score:40},{correct_steps:20,score:50}]);l(this,"constructEmptyPoints",()=>({correct_steps:0,score:0}));l(this,"constructOptions",e=>e&&e.length?Array.from(e):this.constructEmptyCreateOptions());l(this,"constructEmptyCreateOptions",()=>{const e=[];for(let n=0;n<9;n++)e.push({id:`${n+1}`,label:"",value:0,images:this.createGameImagesModel()});return e});l(this,"constructEmptyOption",e=>({id:e,label:"",value:0,images:this.createGameImagesModel()}))}}const Tv=t=>(t==null?void 0:t.main)||(t==null?void 0:t.mobile),LEe=({isOpen:t,requestBody:e,handleClose:r})=>{const n=_t(zt);return E.jsx(As,{open:t,onClose:r,children:E.jsxs(Es,{children:[E.jsxs(ks,{children:[E.jsx(_ae,{}),n.previewGame]}),E.jsx(Ni,{}),E.jsxs(Ts,{children:[E.jsx(ze,{fontWeight:"500",mb:1,children:e.title}),E.jsx($f,{variant:"plain",sx:{mb:1},children:Tv(e.images)?E.jsx("img",{src:Tv(e.images),alt:"main-image"}):E.jsx(WR,{})}),E.jsx(ze,{mb:1,children:E.jsx("article",{dangerouslySetInnerHTML:{__html:e.description}})}),E.jsx(Ni,{sx:{mb:1}}),e.options.map((i,o)=>E.jsx(hn,{sx:{mb:1},children:E.jsx($n,{children:E.jsxs(Os,{direction:"row",spacing:2,children:[E.jsx($f,{variant:"plain",sx:{minWidth:200},children:Tv(i.images)?E.jsx("img",{src:Tv(i.images),alt:`option-${o}-image`}):E.jsx(WR,{})}),E.jsxs(Os,{children:[E.jsx(ze,{level:"title-md",alignContent:"center",children:i.label}),E.jsxs(ze,{level:"body-md",alignContent:"center",children:[n.optionsValue,": ",i.value]})]})]})})},o))]}),E.jsx(Bl,{children:E.jsx(lt,{variant:"plain",color:"neutral",onClick:i=>{i.stopPropagation(),r()},children:n.close})})]})})},FEe=1,SB=new Th,NEe=({points:t,isGamePlayed:e,onChange:r})=>{const n=_t(zt),{NumberInput:i}=er.useComponentContext(),o=SB.constructPoints(t),a=(h,p)=>{const f=Array.from(o);f[p].correct_steps=h,d(f)},s=(h,p)=>{const f=Array.from(o);f[p].score=h,d(f)},c=()=>{const h=SB.constructEmptyPoints();d([...o,h])},u=h=>{const p=o.filter((f,g)=>g!==h);d(p)},d=h=>{r(h)};return E.jsxs(Oe,{mb:2,children:[E.jsxs(Oe,{mb:2,children:[E.jsxs(kt,{children:[E.jsx(Pt,{color:"primary",children:n.points}),E.jsx(pi,{children:n.pointsDescription})]}),e?E.jsx(E.Fragment,{}):E.jsx(lt,{variant:"outlined",onClick:c,startDecorator:E.jsx(UR,{}),sx:{mt:2},children:n.addPoint})]}),E.jsx(yr,{container:!0,spacing:2,children:o.map((h,p)=>E.jsx(yr,{xs:12,md:3,children:E.jsxs(hn,{variant:"outlined",children:[E.jsx(jf,{variant:"soft",color:"neutral",children:E.jsx($n,{orientation:"horizontal",sx:{display:"flex",justifyContent:"center"},children:E.jsx(ze,{children:`${n.streakThreshold} ${p+1}`})})}),E.jsxs($n,{children:[E.jsx(i,{size:"md",label:n.pointsCorrectSteps,defaultValue:h.correct_steps,onChange:f=>a(f,p)}),E.jsx(i,{size:"md",label:n.pointsScore,defaultValue:h.score,onChange:f=>s(f,p)})]}),E.jsxs(jf,{variant:"plain",children:[E.jsx(Ni,{inset:"context"}),E.jsx($n,{orientation:"horizontal",sx:{display:"flex",justifyContent:"flex-end"},children:E.jsx(lt,{variant:"outlined",color:"danger",size:"sm",onClick:()=>u(p),disabled:t.length<=FEe,children:E.jsx(gd,{})})})]})]})},`threshold-${p}`))})]})},jEe={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:""}},BEe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMA+h6XBeOBCz4ozafvc/W9X+nD29ROsWmINjBVRxC4F3uPnhL6/TMAAAygSURBVHja7N0JkqJAEIXhAsEFEEVs9z3vf8eZmI6J3mxFZamq/L8zaC2ZrxKjTzTaLfu9xWweZ7n8FeRFmRwuq+XbZmDgs2gzPR9iuaGYpOl4yO/AQ+G0lwRSUXJ+40fgkXCaxvKgYDIeGXhgvZrLk8rVxsBp63MsLyn7rAPOCvul1GB+Cg2cE20nUpvDNjJwybpXSK2KPsuAM8J+LPULUk6EbjgF0pDD0MB2w0QaNOMnYLfhRL7iJ6DJaCEtOHAWsNO+F0g7Um4EFlpm0pq8T6/IMptEWhVPDewxWAXSthlNAltEu1I6EKyoD9sgOufSkZIrYfeOM+lQj8NgxzaxdKpcG3RonEvHgpNBV8KDWGByNOjENBMrFJwFu7BPxRbB2KBtw1gsknIbaNk4EKskHATaNLBn+f8vpjLcnn0i9skue4NWHOdipYRfwHUa/v//JBwFWzCYibUm9AebtxCLpQYN64nVVgaNGovllgYN2or13gwaM7Ss/ndNTmuoMevOu/9VZGREGrKxpP17T8bToUaMCnFEQV+gAaFV/d/bYt6O1e5YikPmtAVqNrC2AUBboA2RFfHPRywManQR5/QManMSB5EU1VQApij8k7IC4E855YBaHB0qAHwVExWuQWRxAuieiYHvCZDbzgYvmorTtgYvGTl6APwv4yD4koGlTwCqSwgKqz0AUBHUWgGiHlST0JEI0G0F1YBnOdcCpDFYq6V4grGyTwkdvwF+yEiIKd4A2AR0lgApCL5o70wIvIqCkKiCEBjloBqtxTO8FnqMYynw+2YGWk+AnAMfNnA2Bfa7mLag5zFwYuK1OXpTA/wsoymkKAXAVfAFIwcGwTwjIB7mwSRApgheQw2oGqYHVTERbx0M7tqJxxghd5/DL8F4K8YCwBLAAsAS8IqheI4lQO0VgIuA7hoAyRDVRUDKgZWMxH8BjwTUtQFpCqrOAXyXExFXFQQiGlRZ5GESkHSg7igwAWGqwLwRqGojapANU3sH5Cb4q4GKO+C7jO+JeDwQhqExPAflGEgbgGPgg1aiCp+Z/86riTD3xQaasqA/7Qw+S0WZi4HSIsC7jI6Qd2PBGSJOFpBsIDtAVTl7gOodgD1A9R2APeCLyIsvg3APoArEM0GiIHxW9AlK0sDflQYaO8EfeCT2bixKLQ08+zgQnxJ6QqSwDMhFUNNUGC6Ct/VFrZOBohdhzAy7KvJ0NjgdwT/snVlSAlEMRYO2duEADnQVIO2U/e9RLSkZbB7o5zvnbAGqX3Jzc2MJYHq0KoBZEZqBHAm7EOB6wGHOEo3jAKQbTF8Ydidwn8ugg50EOQ+yBrQKjHhJOPTYULQO6EAQlgykK2iHZtGtxlBD8Ibz8apbEGdC/Su8/Nvmfo4rBTp//h1uYPnBkGB43UGOgB0N2/uZG7VHD10FO8YFJUEYbAN2MoQ5DeU5KTsAO4FhHlPIC+O2AHCbONwCZBmIOgzxV66ietqUw4zqlwIsAeD+ELwDhO4PwTtA6NFx6FVAbeI2Afg2QCcQfE8AnAdyCjdROylFonKalCK1O8QVAuF/AL8A8D+ANQC8BrALoHcByPNA6gAbZikFZlE70xR0ejDyRKDJkRveUgrMo3Y0hBS5i9qBHonUEmY0rNGxCgHqQOwLMcd5iPqxDUB7QiPuUsBNAPhSsDWgtlBHQYrBcCFYLRBfAlgE0EsAM2LAZgCVAPgo0IgA+CTom8ZxwCD3QcGMgEHOg4JvAPoF+MS0aGpKpHHR9JxYbUGHGEFUIJOCsOlAWkMtAc2KAqdD6QsqAjsbF40TIWwP6CcA6wRwT5w+CN7mKeWHLoC4IQJKBRhiaVzQmtE4kOgMAu0DDdE6FGSdjFUQhh+N1hoENwL9plUMyBn2AfhiiT8kPYF2ACrC0CGQl2SZuyAuC5PXgcs04PDYafXXAU6hxQ4FHtANwIYW+g2Y+vuvaZB1wLXff7QkSBYA3RThpIGYGqIL1DfAF+A4XcJAugALtDB/2MQWkH1M6jlkl9tEcRuCjo+0CWRvCtF2gTUG7HEZss8iQSxDyNFhyoDwN0AjGPwN8AVgD4SIaQDGR0IjIdWCVIHMjgOeB/WclIFQ/6BHzISdBMO3hNwGgl+SgIUCKwUoAmgL0QpyKn31gRGTPqTAe1aOdvAyy6wceCIMPkCWGQrrhoiZgB/snVFOwzAQRO2QElJFhUAJClUpwve/I0h8tagobVzH3nnvColsz+7sLEoQDUhDgDbAFOo+mGVFJoR2MYgi0BQas9vlO/qA2tYwrGDT2Bs9AjgAxI8ADgDtV0DPAaAtBJAA2tuEqAGIrxGgCKgdF0EkhPhCMdqAF/IRTDE4uIzW1JCI6nJYFsuKL4edw95QW1h3OSxSEAmIPxQnqPg7UH05qHxXkC7gtdQm6oFbmgBXMxq4BPzoQDk8klBI7UtgzQUwi/fCLwFPKOhMPkPRYAPSXiZECWg+VcEO0f7gQHlgnOWA2o1hFGAc6kIzhJ9RgJGoirQG9ISCR+OhwGqAJxH0B+FRoTcHTjg/kDzAuNSF2YMeeQBG5lBUetgLgbDRaQuqCHaYwH4RlQIbBMBN2IUy8FSAj1HLkEQAniBmDsAE/AcpjyAdoJtyFzKHMdBj1P4ACoCnaP0BfP9zaPhDOP/PIPISvHfwD+abw1jAk/GUYVXYkwKRkNfsFkxuyIFLypiZTXDFCFhiqqzGRtcYQJPTDCEbBlLAJmJTDiL/FmKXxVOwo/2/GG0GD4Et9q8FaRa3i39x/X+zdyc5CMNAEEUhuQnc/46sEFMGWyJy1PX+Fept7R7bfXAXdQWAABAAAkAACAABIAAEgAAQAAJAAAgAASAABIAAEAACQADofPelvQrqqd7+BPRUcX8C2qu5PwGtVd2fgLbq7k9AS5X3J2C/2vsTsFf1/QnYrv7+BGyVsD8B62XsT8BaKfsTsFzO/gQslbQ/Ab9l7U/Ad2n7E/BZ3v4EvJe4PwGvMvcn4Fnq/gQc0zT8W+D2bu5H/LtpPuGdqPWuMwLB8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8CD/buRStRKIDC8NaBRBBFzfttxvP+7zi1Wq2mxgxLC87+v1f4d6VwIPv8TMA+PxOwz88E7PMzAfv8TMA+PxOQukfr/I86xieIyW89gT75n3WKvtz0C/IbT6BfBLxhNAHyn1as5YD875uvFDvyn7ePewJr8n9olClW63lADZOtYkT++vKZYkN+6wmsyH+xfKNYrPYBn3BfKQbk/7xplajlyP816aLVE8jI/2Vp2VNLZaOAKxi3cwLkv57B79ZNgPzXNbjbqUXIf32D5UEtQf7bGP5pxQSyScCNDJt/inxL/tM8HiQg/+11jo09PEj+8yI/QrzNAz4W6xHiGfm/17xRR4jJf4nojhCT/4fsG3F+lPyXiuoIMfkvE9kENuT/eZO6EyB/rEZr/YDNfUBTFF2dR/7Inb9HQH4D70+A/Ca+aQIV+RvrG24TVdOAJnt1gZj8jm72dHlC/pa4rxLye0sXybXzpwFtMi575Pd2tceJkgX52+lhAuT3Ni4T8ntLK/Kby7PP5i/JH4eiS35vw1KX2pI/Knlfl9jxTt/YdErVt+LHP0Kjg2pa8N9cojTOVEfyKyBOtf4M9Hitb8SOyYf9ecY/avse/b1Ndjoj4f1e0cvPLYCv/wbynt5zF2BglOi0WYCFQid1BwEeSp3CFwAbnUz/KwNspDu91ecGgJNfeosrAF4yvbYJsJLrlYTnvtxU+tciwEya6EXCESA/C34BeJvqBZ8AHM30bBtgaK5nnAKz1DnoSZeLgJ5K7gJ4m+gJ73x2ddCjfoCpir8A3gruA3pL9aDHdwBfXa4CedtIWgbYWvIRwNteEofBjaVSN8BYj8eBvK25DORtpmOAsZIvAd6WnAbzVmgYYGyvAGc5A/A2ZQDexgzA25ABmGMA5hiAOQZgjgGYYwDmGIA5BmCOAZjjTKg5jQOcifeDeWMA5hiAOT4DmPvb3h2lNAxEYRT+kzo0JtNqoFpQmyCz/z2KFJFa8d2e863hvCRzZ65fAXAOhcL5IwjOAOAMAM4A4AwAzgDgDADOAOAMAM4A4AwAzgDg4lPRaN4Ohus8DmYrjoSxLVmawHY+Fcu2zdrENSeOBZNtkmyasNa4MYJsdHMs25BPL01MY86mJqT7nJ28Hob0ni9DE88h3x6baOopFgBW+1x48lgYpfT5oXd9GMjzNteGyfEwhvKW363HxQZu3uE1f7gbdtO4b1e6WudSylz3JvJ/dfPDcc2FD2jGIfoz6ZkMAAAAAElFTkSuQmCC",mt={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"},hi:{key:"hi",name:"Hindi"},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"}},kh={ar:mt.ar,"ar-dz":mt.ar,"ar-bh":mt.ar,"ar-eg":mt.ar,"ar-iq":mt.ar,"ar-jo":mt.ar,"ar-kw":mt.ar,"ar-lb":mt.ar,"ar-ly":mt.ar,"ar-ma":mt.ar,"ar-om":mt.ar,"ar-qa":mt.ar,"ar-sa":mt.ar,"ar-sy":mt.ar,"ar-tn":mt.ar,"ar-ae":mt.ar,"ar-ye":mt.ar,bg:mt.bg,da:mt.da,de:mt.de,en:mt.en,"en-gb":mt.en,"en-us":mt.en,el:mt.el,es:mt.es,fr:mt.fr,hi:mt.hi,hu:mt.hu,it:mt.it,nl:mt.nl,pt:mt.pt,"pt-br":mt["pt-br"],ro:mt.ro,sk:mt.sk,sr:mt.sr,sv:mt.sv,sw:mt.sw};var kv=(t=>(t.SHOW_IMAGES="show_images",t))(kv||{});const zEe=[10,15,20,25,50],_B="content",UEe=t=>{const e=_t(zt),{Images:r}=er.useComponentContext(),n=i=>{t.option.images=i,t.onChange(t.option)};if(t.field===kv.SHOW_IMAGES)return E.jsx(r,{labels:e,defaultValue:t.option.images,onChange:n})},HEe=(t,e)=>t?!e.label:!0,VEe=t=>{const[e,r]=W.useState(HEe(t.isEditMode,t.option)),n=_t(zt),{InformationInput:i,NumberInput:o}=er.useComponentContext(),a=(u,d)=>{r(d)},s=u=>{u.persist(),t.option.label=u.target.value,t.onChange(t.option)},c=u=>{u=u||null,t.option.value=u,t.onChange(t.option)};return E.jsxs(Nx,{sx:{p:0,overflow:"hidden"},expanded:e,onChange:a,children:[E.jsx(Hx,{variant:"soft",sx:{px:3},children:t.option.label?t.option.label:`${n.optionNumber} ${t.optionNumber}`}),E.jsx(jx,{sx:{"& > div":{pb:0}},children:E.jsxs(hn,{variant:"plain",sx:{borderRadius:0},children:[E.jsxs($n,{children:[E.jsxs(yr,{container:!0,spacing:2,children:[E.jsx(yr,{xs:9,children:E.jsx(i,{label:n.label,defaultValue:t.option.label||"",value:t.option.label||"",required:!0,onChange:s})}),E.jsx(yr,{xs:3,children:E.jsx(o,{size:"md",label:n.optionsValue,defaultValue:t.option.value,onChange:c})})]}),t.additionalFields.map(u=>E.jsx(UEe,{option:t.option,field:u,onChange:t.onChange},`option-id-${t.option.id?t.option.id:Math.random()}-field-${u}`))]}),E.jsxs(jf,{variant:"plain",children:[E.jsx(Ni,{inset:"context"}),E.jsx($n,{orientation:"horizontal",sx:{display:"flex",justifyContent:"flex-end"},children:E.jsx(lt,{startDecorator:E.jsx(gd,{}),variant:"outlined",color:"danger",size:"sm",onClick:t.onDelete,disabled:t.disableDelete,children:n.removeOption})})]})]})})]})},WEe=({label:t,values:e,allValues:r,valuesMap:n,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:s})=>{const c=(u,d)=>{u.persist();let h=[...e];if(u.target.checked){h.push(d),a(h);return}h=e.filter(p=>p!==d),a(h)};return E.jsxs(Oe,{sx:{my:2},children:[E.jsx(ze,{level:"body-xs",mb:1,fontWeight:"bold",children:t}),E.jsxs(Mf,{orientation:"horizontal",wrap:!0,sx:{"--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[r.map(u=>E.jsxs(ka,{children:[e.includes(u)&&E.jsx(Iae,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),E.jsx(ed,{checked:e.includes(u),variant:e.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:n[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?E.jsx(ka,{children:E.jsx(Ps,{onClick:s,children:o})}):E.jsx(E.Fragment,{})]})]})},TB=new Th,qEe=5,GEe=100,kB=t=>{const e=[];return t.some(r=>r.images&&(r.images.main||r.images.mobile))&&e.push(kv.SHOW_IMAGES),e},YEe=({isEditMode:t,isGamePlayed:e,options:r,onChange:n})=>{const[i,o]=W.useState(kB(r)),a=_t(zt),s=TB.constructOptions(r);W.useEffect(()=>{o(kB(r))},[r]);const c=()=>{const p=TB.constructEmptyOption(`${s.length+1}`);h([...s,p])},u=(p,f)=>{const g=Array.from(s);g[f]=p,h(g)},d=p=>{const f=s.filter(g=>g.id!==p);h(f)},h=p=>{n(p)};return E.jsxs(Oe,{mb:2,children:[E.jsxs(Oe,{mb:2,children:[E.jsxs(kt,{children:[E.jsx(Pt,{color:"primary",children:a.options}),E.jsx(pi,{children:a.optionsDescription})]}),E.jsx(WEe,{label:a.additionalFields,values:i,allValues:[kv.SHOW_IMAGES],valuesMap:{show_images:a.addImages},onChange:p=>o(p)}),e?E.jsx(E.Fragment,{}):E.jsx(lt,{variant:"outlined",disabled:r.length===GEe,onClick:c,startDecorator:E.jsx(UR,{}),sx:{mr:2},children:a.addOption})]}),E.jsx(Bx,{variant:"outlined",sx:{borderRadius:"5px"},children:s.map((p,f)=>E.jsx(VEe,{option:p,optionNumber:f+1,isEditMode:t,additionalFields:i,disableDelete:s.length<=qEe||e,onDelete:()=>d(p.id),onChange:g=>u(g,f)},p.id))})]})},KEe=({requestBody:t,isEditMode:e,onRequestBodyUpdate:r,parentTitle:n,onParentSelect:i})=>{const o=_t(zt),{InformationInput:a,RichText:s}=er.useComponentContext(),c=f=>{f.persist();const g=f.target.value?f.target.value:null;r(Be(ce({},t),{title:g}))},u=f=>{f.persist();const g=f.target.value?f.target.value:null;r(Be(ce({},t),{alternative_title:g}))},d=f=>{r(Be(ce({},t),{description:f}))},h=f=>{r(Be(ce({},t),{points:f}))},p=f=>{r(Be(ce({},t),{options:f}))};return E.jsxs(Oe,{sx:{width:{xs:"100%",sm:"70%"}},mr:{sm:2},children:[n&&E.jsx(Wx,{variant:"outlined",color:"primary",startDecorator:E.jsx(Sae,{}),sx:{mb:2,cursor:"pointer"},onClick:i,children:`${o.languageParentText} "${n}"`}),E.jsx(a,{label:o.title,placeholder:"",defaultValue:t.title||"",value:t.title||"",required:!0,onChange:c}),E.jsx(a,{label:o.alternativeTitle,placeholder:"",defaultValue:t.alternative_title||"",value:t.alternative_title||"",required:!1,onChange:u}),E.jsx(s,{label:o.description,placeholder:"",property:"description",value:t.description,defaultValue:t.description,onChange:d}),E.jsx(NEe,{points:t.points,isGamePlayed:!1,onChange:h}),E.jsx(YEe,{options:t.options,isGamePlayed:!1,isEditMode:e,onChange:p})]})},JEe=({defaultValue:t,onChange:e})=>{const{types:r}=_t(aa),n=_t(zt),i=W.useRef(null);return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{children:n.type}),E.jsx(br,Be(ce({value:t,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(o,a)=>e(a),sx:{minHeight:"37px"}},t&&{endDecorator:E.jsx(ur,{variant:"plain",color:"neutral",onMouseDown:o=>{o.stopPropagation()},onClick:()=>{var o;e(null),(o=i.current)==null||o.focusVisible()},sx:{width:"18px",height:"18px"},children:E.jsx(_w,{})}),indicator:null}),{children:r.map(o=>E.jsx(qt,{value:o.id,children:o.label},o.id))})),E.jsx(pi,{children:n.typeDescription})]})},QEe=t=>{const e=_t(zt),r={ACTIVE:e.active,INACTIVE:e.inactive,EXPIRED:e.expired},n=(i,o)=>{t.onChange(o||"")};return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{color:"primary",children:e.status}),E.jsx(br,{value:t.defaultValue,onChange:n,sx:{minHeight:"37px"},children:Object.keys(r).map((i,o)=>E.jsx(qt,{value:i,children:r[i]},`status-select-${i}-${o}`))})]})},XEe=t=>{const e=_t(zt),r={MORE:e.more,LESS:e.less},n=(i,o)=>{t.onChange(o||"")};return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{color:"primary",children:e.winningCondition}),E.jsx(br,{value:t.defaultValue,onChange:n,sx:{minHeight:"37px"},children:Object.keys(r).map((i,o)=>E.jsx(qt,{value:i,children:r[i]},`condition-select-${i}-${o}`))}),E.jsx(pi,{children:e.winningConditionDescription})]})},ZEe=t=>{const e=_t(zt),r=_t(aa),n=r.languageConfig.default_language?[r.languageConfig.default_language,...r.languageConfig.available_languages]:[];return E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{children:e.language}),E.jsx(br,{size:"sm",disabled:t.isReadOnly,value:t.defaultValue,onChange:(i,o)=>t.onChange(o),children:n.map(i=>E.jsx(qt,{value:i,children:mt[i].name},`language-select-${i}`))}),E.jsx(pi,{children:e.languageDescription})]})},eOe=t=>{var p;const e=_t(zt),r=_t(aa),{AuthRequirement:n,NumberInput:i}=er.useComponentContext(),o=(p=t.requestBody.related)==null?void 0:p.some(f=>f.entity_relationship==="translatedFrom"),a=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{status:f}))},s=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{type:f}))},c=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{winning_condition:f}))},u=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{language:f}))},d=f=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{auth_requirement:f}))},h=(f,g)=>{g=g||null,t.onRequestBodyUpdate(Be(ce({},t.requestBody),{[f]:g}))};return E.jsxs(E.Fragment,{children:[t.requestBody.id?E.jsxs(kt,{size:"sm",sx:{mb:2},children:[E.jsx(Pt,{color:"primary",children:e.id}),E.jsx(Do,{size:"md",readOnly:!0,variant:"outlined",color:"neutral",name:"id",value:t.requestBody.id,sx:{opacity:.5,borderRadius:"md"}})]}):E.jsx(E.Fragment,{}),E.jsx(QEe,{defaultValue:t.requestBody.status||"INACTIVE",onChange:a}),E.jsx(JEe,{defaultValue:t.requestBody.type,onChange:s}),E.jsx(ZEe,{isReadOnly:t.isMultilingual||o,defaultValue:t.requestBody.language||r.languageConfig.default_language,onChange:u}),E.jsx(XEe,{defaultValue:t.requestBody.winning_condition,onChange:c}),E.jsx(n,{defaultValue:t.requestBody.auth_requirement||r.authRequirement,onChange:d,labels:e}),E.jsxs(yr,{container:!0,spacing:2,mb:2,children:[E.jsx(yr,{lg:6,width:"100%",children:E.jsx(i,{label:e.time,description:e.timeDescription,defaultValue:t.requestBody.time,onChange:f=>h("time",f)})}),E.jsx(yr,{lg:6,width:"100%",children:E.jsx(i,{label:e.lives,description:e.livesDescription,defaultValue:t.requestBody.lives,onChange:f=>h("lives",f)})})]})]})},tOe=new Th,rOe=t=>{const e=_t(zt),{RichText:r,Accordion:n,DynamicFields:i,Branding:o,Images:a,Flags:s,EntityContext:c,Schedule:u,RelatedRelationship:d,WidgetEmbedCode:h}=er.useComponentContext(),p=w=>{w.persist(),t.onRequestBodyUpdate(Be(ce({},t.requestBody),{ad_content:w.target.value||null}))},f=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{branding:w}))},g=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{context:w}))},m=w=>{w=Object.keys(w).length?w:null,t.onRequestBodyUpdate(Be(ce({},t.requestBody),{custom_fields:w}))},v=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{flags:w.length?w:null}))},b=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{images:w}))},x=w=>{w=Object.keys(w).length?w:null,t.onRequestBodyUpdate(Be(ce({},t.requestBody),{labels:w}))},y=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{rules:w||null}))},C=w=>{t.onRequestBodyUpdate(Be(ce({},t.requestBody),{related:w}))};return E.jsxs(Oe,{sx:{width:{xs:"100%",sm:"30%"}},children:[E.jsx(n,{label:e.adContent,children:E.jsx(zf,{value:t.requestBody.ad_content,minRows:"7",onChange:p,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)"}}},t.requestBody.id||`new-${t.requestBody.language}`)}),E.jsx(n,{label:e.branding,children:E.jsx(o,{labels:e,defaultValue:t.requestBody.branding||ce({},jEe),onChange:f})}),E.jsx(n,{label:e.configuration,children:E.jsx(eOe,{requestBody:t.requestBody,isMultilingual:t.isMultilingual,onRequestBodyUpdate:t.onRequestBodyUpdate})}),E.jsx(n,{label:e.context,children:E.jsx(c,{labels:e,context:tOe.createContext(t.requestBody.context),onChange:g})}),E.jsx(n,{label:e.customFields,children:E.jsx(i,{labels:e,type:e.customFields,defaultValue:t.requestBody.custom_fields,onChange:m})}),E.jsx(n,{label:e.flags,children:E.jsx(s,{labels:e,flags:t.requestBody.flags||[],onChange:v})}),E.jsx(n,{label:e.images,children:E.jsx(a,{labels:e,defaultValue:t.requestBody.images,onChange:b})}),E.jsx(n,{label:e.labels,children:E.jsx(i,{labels:e,type:e.labels,defaultValue:t.requestBody.labels,onChange:x})}),E.jsx(n,{label:e.related,children:E.jsx(d,{labels:e,defaultValue:t.requestBody.related?Array.from(t.requestBody.related.filter(w=>w.entity_relationship!=="translatedTo"&&w.entity_relationship!=="translatedFrom")):[],onChange:C})}),E.jsx(n,{label:e.rules,children:E.jsx(r,{property:"rules",defaultValue:t.requestBody.rules,onChange:y})}),E.jsx(n,{label:e.schedule,children:t.requestBody.id?E.jsx(u,{labels:e,entityId:t.requestBody.id,entityType:"EITHER_OR"}):E.jsx(ze,{children:e.scheduledTaskNotAvailable})}),E.jsx(n,{label:e.widgetEmbedCodeTitle,children:t.requestBody.id?E.jsx(h,{labels:e,entityType:"either-or",entityId:t.requestBody.id,authRequirement:t.requestBody.auth_requirement}):E.jsx(ze,{children:e.widgetEmbedCodeNotAvailable})})]})},nOe=t=>{const e=_t(zt);return E.jsxs(Oe,{p:2,children:[E.jsx(ze,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:E.jsx(Cae,{fontSize:"inherit"}),onClick:t.onClickBack,children:e.back}),E.jsx(ze,{level:"h3",children:e.manageEitherOrTitle}),E.jsx(pi,{children:e.manageEitherOrDescription})]})},iOe=t=>E.jsx(nw,{"aria-label":"Languages",defaultValue:0,onChange:(e,r)=>t.onTabChange(Number(r)),children:E.jsxs(rw,{sx:{display:"flex",justifyContent:"space-between"},children:[E.jsx(Oe,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:t.languages.map(e=>e&&E.jsx(Ul,{disableIndicator:!0,children:mt[e].name},e))}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:t.onLanguageButtonClick,children:E.jsx(KR,{})})]})}),oOe=t=>{const[e,r]=W.useState(t.languages),n=_t(zt),i=_t(aa);W.useEffect(()=>{r(t.languages)},[t.languages]);const o=()=>{t.onSubmit(e)},a=()=>{t.onClose()},s=d=>{let h=[...e];e.includes(d)?h=h.filter(p=>p!==d):h.push(d),h.includes(t.mainLanguage)||h.unshift(t.mainLanguage),r(h)},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 E.jsx(E.Fragment,{children:E.jsx(As,{onClick:d=>{d.stopPropagation()},open:t.isOpen,onClose:a,children:E.jsxs(Es,{sx:{width:500,minWidth:250,overflowY:"scroll"},children:[E.jsx(ks,{children:n.languagesModalTitle}),E.jsx(pi,{children:n.languagesModalDescription}),E.jsxs(Ts,{sx:{maxHeight:140,overflowY:"scroll",overflowX:"hidden"},children:[E.jsx(ed,{sx:{my:.5,"& .MuiCheckbox-checkbox":{backgroundColor:"white","&:hover":{backgroundColor:"#f0f4f8"}},"& .MuiCheckbox-checkbox.Mui-checked":{backgroundColor:"#0066CC"}},disabled:!0,checked:!0,label:mt[t.mainLanguage].name},"default-language"),u.map(d=>E.jsx(ed,{sx:{my:.5},checked:e.includes(d),label:mt[d].name,onChange:()=>s(d)},d))]}),E.jsxs(Bl,{children:[E.jsx(lt,{disabled:!c,loading:t.isLoadingTranslations,variant:"solid",color:"primary",onClick:o,children:n.languagesModalSave}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:a,children:n.close})]})]})})})},Ah="###",AB=(t,e,r)=>L(this,null,function*(){const n="AIzaSyB6JILBJiJ0Z2pxw0-nudOpRAzqFk6D6Lw",i=t.replace(/###/g," ### ");let o=`https://translation.googleapis.com/language/translate/v2?key=${n}`;return o+="&q="+encodeURIComponent(i),o+=`&target=${kh[e].key||"en"}`,r&&(o+=`&source=${r}`),o+="&format=text",yield fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(s=>s.json())}),aOe=(t,e,r=null)=>L(this,null,function*(){let n=[],i=[];return t.forEach((o,a)=>{let s=o.label;const c=AB(s,e,r).then(u=>{const p=u.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(Ah);n[a]=Be(ce({},o),{label:p[0]})});i.push(c)}),yield Promise.all(i),n}),j1=(t,e,r=null)=>L(this,null,function*(){let n=[],i=[];return t.forEach(o=>{let a=o.title?o.title:"";a+=Ah+(o.alternative_title?o.alternative_title:" "),a+=Ah+(o.description?o.description:" "),a+=Ah+(o.rules?o.rules:" ");const s=AB(a,e,r),c=aOe(o.options,e,r);i.push(Promise.all([s,c]).then(([u,d])=>{const p=u.data.translations[0].translatedText.replaceAll(" #","#").replaceAll("# ","#").split(Ah);n.push(Be(ce({},o),{title:p[0],alternative_title:o.alternative_title?p[1]:null,description:o.description?p[2]:null,rules:o.rules?p[3]:null,options:d}))}))}),yield Promise.all(i),n}),sa=new Th,ts=new DEe,sOe=({eitherOrById:t,relatedGames:e,relatedParentTitle:r,loadParent:n,onClickBack:i})=>{const[o,a]=W.useState(sa.createNewRequestBody(t)),[s,c]=W.useState(!1),[u,d]=W.useState(!1),[h,p]=W.useState(!1),[f,g]=W.useState(!1),[m,v]=W.useState([]),[b,x]=W.useState(!1),[y,C]=W.useState(null),[w,I]=W.useState({}),[_,T]=W.useState([]),[O,P]=W.useState(!1),[k,S]=W.useState(!1),[M,$]=W.useState(""),[D,N]=W.useState("danger"),z=_t(zt),U=_t(aa),{Toast:V}=er.useComponentContext(),{https:q}=er.useAPIContext(),F=!!o.id,B=m.length>1,H=B&&w[y]?w[y]:o,G=(be,ge)=>{S(!0),$(ge),N(be)};W.useEffect(()=>{t&&a(t)},[t]),W.useEffect(()=>{if((e==null?void 0:e.length)>0){v([t.language,...e.map(ge=>ge.language)]);let be={};e.forEach(ge=>{be[ge.language]=sa.createNewRequestBody(ge)}),be[t.language]=t,I(be),C(t.language)}},[e]);const Z=be=>{C(m[be])},Y=be=>L(this,null,function*(){P(!0);const ge={},ve={},fe=[];be.forEach(le=>{if(m.includes(le))ge[le]=w[le];else{const he=U.languageConfig.translation_rules[le]?U.languageConfig.translation_rules[le].game_status:"INACTIVE",ye=Be(ce({},H),{language:le,status:he,related:[]});(!F||F&&le!==o.language)&&delete ye.id,ve[le]=ye}}),m.filter(le=>!be.includes(le)).forEach(le=>{w[le].id&&fe.push(Be(ce({},w[le]),{status:"INACTIVE"}))}),T(fe),v(be),C((o==null?void 0:o.language)||U.languageConfig.default_language);const ne=[];Object.keys(ve).forEach(le=>{ne.push(j1([ve[le]],le).then(he=>{ve[le]=Be(ce({},ve[le]),{title:he[0].title,alternative_title:he[0].alternative_title,description:he[0].description,options:he[0].options,rules:he[0].rules})}).catch(()=>{G("danger",z.gameTranslationErrorMessage),P(!1)}))}),Promise.all(ne).then(()=>{I(ce(ce({},ge),ve)),C((o==null?void 0:o.language)||U.languageConfig.default_language),P(!1),x(!1)}).catch(()=>{G("danger",z.gameTranslationErrorMessage),P(!1)})}),Q=()=>L(this,null,function*(){B?ee():K()}),K=()=>L(this,null,function*(){if(c(!0),ts.validate(o,z),!ts.isValid){G("danger",ts.message),c(!1);return}const be=[];_.forEach(fe=>{o.related=o.related.filter(ne=>ne.entity_id!==fe.id),be.push(q.updateEitherOr(fe.id,sa.finalizeNewRequestBody(ce({},fe),U)).then(()=>q.deleteEitherOr(fe.id)))}),Promise.all(be).then(()=>T([]));const ge=sa.finalizeNewRequestBody(ce({},o),U);let ve=null;if(F?ve=yield q.updateEitherOr(ge.id,ce({},ge)):ve=yield q.createEitherOr(ce({},ge)),ve.ok){c(!1),G("success",F?z.updateEitherOrMessage:z.createEitherOrMessage);const fe=yield ve.json();a(fe.data)}else{const fe=F?z.updateEitherOrErrorMessage:z.createEitherOrErrorMessage;G("danger",fe),console.error(fe,yield ve.json()),c(!1)}}),X=be=>L(this,null,function*(){const ge=Object.values(w).filter(ne=>ne.language!==(F?t.language:U.languageConfig.default_language)&&!_.some(le=>le.id===ne.id)),ve=[],fe={};for(const ne of ge){const le=sa.finalizeNewRequestBody(ce({},ne),U);le.auth_requirement=ne.auth_requirement||U.authRequirement,le.related=le.related||[],le.related=le.related.filter(ye=>!(ye.entity_type==="either_or"&&ye.entity_relationship==="translatedFrom"&&ye.entity_id===be.id)),le.related.push({entity_type:"either_or",entity_relationship:"translatedFrom",entity_id:be.id});const he=ne.id?q.updateEitherOr(ne.id,ce({},le)):q.createEitherOr(ce({},le));ve.push(he.then(ye=>{if(ye.ok)return ye.json();throw new Error}).then(ye=>{fe[ne.language]=ye.data}))}return{translatedGamesPromises:ve,updatedGames:fe}}),ee=()=>L(this,null,function*(){c(!0);for(const ne of Object.values(w))if(ts.validate(ne,z),!ts.isValid){c(!1),G("danger",ts.message),ts.isValid=!0,ts.message="";return}const be=[];let ge=o;if(!F){const ne=sa.finalizeNewRequestBody(ce({},Object.values(w).filter(he=>he.language===U.languageConfig.default_language)[0]),U),le=yield q.createEitherOr(ce({},ne));if(le.ok)ge=(yield le.json()).data;else{c(!1),console.error(z.createEitherOrErrorMessage,yield le.json()),G("danger",z.createEitherOrErrorMessage);return}}_.forEach(ne=>{be.push(q.updateEitherOr(ne.id,sa.finalizeNewRequestBody(ce({},ne),U)).then(()=>q.deleteEitherOr(ne.id)))});const{translatedGamesPromises:ve,updatedGames:fe}=yield X(ge);Promise.all([...be,...ve]).then(()=>{T([]);const ne=F?ce({},Object.values(w).filter(ye=>ye.id===o.id)[0]):ge,le=sa.finalizeNewRequestBody(ce({},ne),U),he=Object.keys(fe).length?Array.from(Object.values(fe)).map(ye=>({entity_type:"either_or",entity_relationship:"translatedTo",entity_id:ye.id})):[];he.length>0&&(le.related=he),q.updateEitherOr((o==null?void 0:o.id)||ge.id,ce({},le)).then(ye=>{if(ye.ok)return ye.json();throw new Error}).then(ye=>{a(ye.data),fe[ye.data.language||U.languageConfig.default_language]=ye.data,Object.keys(fe).forEach(pe=>fe[pe]=sa.createNewRequestBody(fe[pe])),I(ce({},fe)),c(!1),G("success",z.updateEitherOrMessage)})}).catch(ne=>{console.error(ne),c(!1),console.error(z.updateEitherOrTranslationErrorMessage),G("danger",z.updateEitherOrTranslationErrorMessage)})}),ae=be=>{B?I(ge=>Be(ce({},ge),{[y]:be})):a(be)},oe=be=>{var ne,le;const ge=H.language||U.languageConfig.default_language;B&&be===y||!B&&be===ge?p(!0):d(!0);const ve=be||kh[be].key,fe=(ne=U.languageConfig)!=null&&ne.default_language&&ve!==U.languageConfig.default_language?(le=U.languageConfig)==null?void 0:le.default_language:null;j1([H],ve,fe).then(he=>{const ye=Be(ce({},H),{title:he[0].title,alternative_title:he[0].alternative_title,description:he[0].description,options:he[0].options,rules:he[0].rules});B?I(pe=>Be(ce({},pe),{[y]:ye})):a(ye),p(!1),d(!1)}).catch(()=>{G("danger",z.gameTranslationErrorMessage),p(!1),d(!1)})},Ce=()=>{var be;if(F&&U.languageConfig.default_language){const ge=H.language||U.languageConfig.default_language,ve=B?y:ge,fe=[...U.languageConfig.available_languages,U.languageConfig.default_language].filter(ne=>ne!==ve);return ve==="en"&&U.languageConfig.available_languages.length===0?void 0:E.jsxs(mee,{sx:{mr:1},children:[E.jsx(lt,{onClick:()=>oe(ve),loading:h,children:`${z.translateTo} ${kh[ve].name}`}),((be=U.languageConfig.available_languages)==null?void 0:be.length)>0&&E.jsxs(DE,{children:[E.jsx(qO,{slots:{root:ur},loading:u,children:E.jsx(KR,{})}),E.jsx(WO,{placement:"top",sx:{maxHeight:200},children:fe.map(ne=>E.jsx(Xx,{onClick:()=>oe(ne),children:kh[ne].name},ne))})]})]})}};return E.jsxs(E.Fragment,{children:[E.jsx(nOe,{onClickBack:i}),E.jsxs(hn,{variant:"plain",children:[U.languageConfig.available_languages.length>0&&E.jsx(iOe,{languages:B?m:[H.language||U.languageConfig.default_language],onTabChange:Z,onLanguageButtonClick:()=>x(!0)}),E.jsxs(Os,{direction:{xs:"column",sm:"row"},children:[E.jsx(KEe,{isEditMode:F,requestBody:H,onRequestBodyUpdate:ae,parentTitle:r,onParentSelect:n}),E.jsx(rOe,{requestBody:H,onRequestBodyUpdate:ae,isMultilingual:B})]}),E.jsxs(Oe,{display:"flex",flexDirection:"row",justifyContent:"center",my:3,children:[Ce(),E.jsx(lt,{variant:"outlined",color:"neutral",onClick:()=>g(!0),sx:{mr:1},children:z.preview}),E.jsx(lt,{variant:"solid",color:"primary",onClick:Q,loading:s,children:z.save})]})]}),E.jsx(LEe,{isOpen:f,requestBody:o,handleClose:()=>g(!1)}),E.jsx(V,{showToast:k,color:D,message:M,hideToast:()=>S(!k)}),U.languageConfig.available_languages.length>0&&E.jsx(oOe,{isOpen:b,mainLanguage:(o==null?void 0:o.language)||U.languageConfig.default_language,languages:m,isLoadingTranslations:O,onSubmit:Y,onClose:()=>x(!1)})]})};class PB{constructor(){l(this,"sort","created_at_desc");l(this,"status","");l(this,"language","");l(this,"flags",[]);l(this,"entityIds",[]);l(this,"groupByStatus",!0);l(this,"limit",20)}}const EB=({filters:t,options:e,showStatusFilter:r=!0,setOptions:n,setFilters:i,handleResetData:o})=>{const a=_t(zt),s=_t(aa),{Flags:c,ContextSelectFilter:u,ItemsPerPageFilter:d}=er.useComponentContext(),h=W.useRef(null),p=(O,P)=>{i(k=>Be(ce({},k),{status:P}))},f=O=>{i(P=>Be(ce({},P),{flags:O}))},g=(O,P)=>{i(k=>Be(ce({},k),{language:P}))},m=(O,P)=>{const k=P;i(S=>Be(ce({},S),{sort:k}))},v=(O,P)=>{i(k=>Be(ce({},k),{limit:P}))},b=()=>{i(O=>Be(ce({},O),{groupByStatus:!O.groupByStatus}))},x=()=>E.jsx(yr,{xs:12,md:3,children:E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.status}),E.jsxs(br,Be(ce({value:t.status,size:"sm",placeholder:"Filter by status",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:p,sx:{minHeight:"37px"}},t.status&&{endDecorator:E.jsx(ur,{variant:"plain",color:"neutral",onMouseDown:O=>{O.stopPropagation()},onClick:()=>{var O;i(P=>Be(ce({},P),{status:""})),(O=h.current)==null||O.focusVisible()},sx:{width:"18px",height:"18px"},children:E.jsx(_w,{})}),indicator:null}),{children:[E.jsx(qt,{value:"ACTIVE",children:a.active}),E.jsx(qt,{value:"INACTIVE",children:a.inactive}),E.jsx(qt,{value:"EXPIRED",children:a.expired})]}))]})}),y=()=>{const O=s.languageConfig.default_language?[s.languageConfig.default_language,...s.languageConfig.available_languages]:[];return E.jsx(yr,{xs:12,md:3,children:E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.language}),E.jsx(br,Be(ce({value:t.language,size:"sm",placeholder:"Filter by language",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:g,sx:{minHeight:"37px"}},t.language&&{endDecorator:E.jsx(ur,{variant:"plain",color:"neutral",onMouseDown:P=>{P.stopPropagation()},onClick:()=>{var P;i(k=>Be(ce({},k),{language:""})),(P=h.current)==null||P.focusVisible()},sx:{width:"18px",height:"18px"},children:E.jsx(_w,{})}),indicator:null}),{children:O.map(P=>E.jsx(qt,{value:P,children:mt[P].name},P))}))]})})},C=()=>E.jsx(yr,{xs:12,md:r?2:4,children:E.jsx(d,{labels:a,value:t.limit,onChange:v,options:zEe})}),w=()=>E.jsx(yr,{xs:12,md:r?4:8,children:E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.sortBy}),E.jsxs(br,{value:t.sort,size:"sm",onChange:m,sx:{minHeight:"37px"},children:[E.jsx(qt,{value:"created_at_asc",children:a.sortByCreatedAtAsc}),E.jsx(qt,{value:"created_at_desc",children:a.sortByCreatedAtDesc}),E.jsx(qt,{value:"updated_at_asc",children:a.sortByUpdatedAtAsc}),E.jsx(qt,{value:"updated_at_desc",children:a.sortByUpdatedAtDesc})]})]})}),I=()=>E.jsxs(yr,{xs:12,md:r?3:5,children:[E.jsxs(kt,{size:"sm",children:[E.jsx(Pt,{children:a.flags}),E.jsx(c,{labels:a,flags:t.flags,onChange:f})]}),E.jsx(kt,{size:"sm"})]}),_=()=>E.jsx(yr,{xs:12,md:r?4:7,children:E.jsx(Oe,{sx:{fontFamily:"sans-serif"},children:E.jsx(u,{labels:a,options:e,setOptions:n,setFilters:i,handleResetData:o})})}),T=()=>E.jsx(yr,{xs:12,md:4,sx:{my:"auto"},children:E.jsx(ed,{label:a.groupByStatus,checked:t.groupByStatus,onChange:b})});return E.jsx(Oe,{mb:2,children:E.jsxs(yr,{container:!0,spacing:2,children:[r&&x(),r&&y(),C(),w(),I(),_(),r&&T()]})})},lOe=({children:t})=>E.jsx("section",{style:{marginRight:"auto",marginLeft:"auto",padding:"8px"},children:E.jsx(Oe,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:E.jsx(Oe,{width:"100%",children:t})})}),cOe=t=>{const e=_t(zt);return E.jsx("tfoot",{children:E.jsx("tr",{children:E.jsx("td",{colSpan:8,children:E.jsxs(Oe,{sx:{display:"flex",alignItems:"center",gap:2,justifyContent:"flex-end"},children:[E.jsxs(ze,{textAlign:"center",children:[e.pageNo," ",t.pageCount]}),E.jsxs(Oe,{sx:{display:"flex",gap:1},children:[E.jsx(ur,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disablePreviousPage,onClick:t.goToPreviousPage,sx:{bgcolor:"background.surface"},children:E.jsx(Tae,{})}),E.jsx(ur,{size:"sm",color:"neutral",variant:"outlined",disabled:t.disableNextPage,onClick:t.goToNextPage,sx:{bgcolor:"background.surface"},children:E.jsx(kae,{})})]})]})})})})};var Av={exports:{}},uOe=Av.exports,OB;function dOe(){return OB||(OB=1,function(t,e){(function(r,n){t.exports=n()})(uOe,function(){var r=1e3,n=6e4,i=36e5,o="millisecond",a="second",s="minute",c="hour",u="day",d="week",h="month",p="quarter",f="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($){var D=["th","st","nd","rd"],N=$%100;return"["+$+(D[(N-20)%10]||D[N]||D[0])+"]"}},y=function($,D,N){var z=String($);return!z||z.length>=D?$:""+Array(D+1-z.length).join(N)+$},C={s:y,z:function($){var D=-$.utcOffset(),N=Math.abs(D),z=Math.floor(N/60),U=N%60;return(D<=0?"+":"-")+y(z,2,"0")+":"+y(U,2,"0")},m:function $(D,N){if(D.date()<N.date())return-$(N,D);var z=12*(N.year()-D.year())+(N.month()-D.month()),U=D.clone().add(z,h),V=N-U<0,q=D.clone().add(z+(V?-1:1),h);return+(-(z+(N-U)/(V?U-q:q-U))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:h,y:f,w:d,d:u,D:g,h:c,m:s,s:a,ms:o,Q:p}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},w="en",I={};I[w]=x;var _="$isDayjsObject",T=function($){return $ instanceof S||!(!$||!$[_])},O=function $(D,N,z){var U;if(!D)return w;if(typeof D=="string"){var V=D.toLowerCase();I[V]&&(U=V),N&&(I[V]=N,U=V);var q=D.split("-");if(!U&&q.length>1)return $(q[0])}else{var F=D.name;I[F]=D,U=F}return!z&&U&&(w=U),U||!z&&w},P=function($,D){if(T($))return $.clone();var N=typeof D=="object"?D:{};return N.date=$,N.args=arguments,new S(N)},k=C;k.l=O,k.i=T,k.w=function($,D){return P($,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var S=function(){function $(N){this.$L=O(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[_]=!0}var D=$.prototype;return D.parse=function(N){this.$d=function(z){var U=z.date,V=z.utc;if(U===null)return new Date(NaN);if(k.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var q=U.match(v);if(q){var F=q[2]-1||0,B=(q[7]||"0").substring(0,3);return V?new Date(Date.UTC(q[1],F,q[3]||1,q[4]||0,q[5]||0,q[6]||0,B)):new Date(q[1],F,q[3]||1,q[4]||0,q[5]||0,q[6]||0,B)}}return new Date(U)}(N),this.init()},D.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},D.$utils=function(){return k},D.isValid=function(){return this.$d.toString()!==m},D.isSame=function(N,z){var U=P(N);return this.startOf(z)<=U&&U<=this.endOf(z)},D.isAfter=function(N,z){return P(N)<this.startOf(z)},D.isBefore=function(N,z){return this.endOf(z)<P(N)},D.$g=function(N,z,U){return k.u(N)?this[z]:this.set(U,N)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(N,z){var U=this,V=!!k.u(z)||z,q=k.p(N),F=function(X,ee){var ae=k.w(U.$u?Date.UTC(U.$y,ee,X):new Date(U.$y,ee,X),U);return V?ae:ae.endOf(u)},B=function(X,ee){return k.w(U.toDate()[X].apply(U.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(ee)),U)},H=this.$W,G=this.$M,Z=this.$D,Y="set"+(this.$u?"UTC":"");switch(q){case f:return V?F(1,0):F(31,11);case h:return V?F(1,G):F(0,G+1);case d:var Q=this.$locale().weekStart||0,K=(H<Q?H+7:H)-Q;return F(V?Z-K:Z+(6-K),G);case u:case g:return B(Y+"Hours",0);case c:return B(Y+"Minutes",1);case s:return B(Y+"Seconds",2);case a:return B(Y+"Milliseconds",3);default:return this.clone()}},D.endOf=function(N){return this.startOf(N,!1)},D.$set=function(N,z){var U,V=k.p(N),q="set"+(this.$u?"UTC":""),F=(U={},U[u]=q+"Date",U[g]=q+"Date",U[h]=q+"Month",U[f]=q+"FullYear",U[c]=q+"Hours",U[s]=q+"Minutes",U[a]=q+"Seconds",U[o]=q+"Milliseconds",U)[V],B=V===u?this.$D+(z-this.$W):z;if(V===h||V===f){var H=this.clone().set(g,1);H.$d[F](B),H.init(),this.$d=H.set(g,Math.min(this.$D,H.daysInMonth())).$d}else F&&this.$d[F](B);return this.init(),this},D.set=function(N,z){return this.clone().$set(N,z)},D.get=function(N){return this[k.p(N)]()},D.add=function(N,z){var U,V=this;N=Number(N);var q=k.p(z),F=function(G){var Z=P(V);return k.w(Z.date(Z.date()+Math.round(G*N)),V)};if(q===h)return this.set(h,this.$M+N);if(q===f)return this.set(f,this.$y+N);if(q===u)return F(1);if(q===d)return F(7);var B=(U={},U[s]=n,U[c]=i,U[a]=r,U)[q]||1,H=this.$d.getTime()+N*B;return k.w(H,this)},D.subtract=function(N,z){return this.add(-1*N,z)},D.format=function(N){var z=this,U=this.$locale();if(!this.isValid())return U.invalidDate||m;var V=N||"YYYY-MM-DDTHH:mm:ssZ",q=k.z(this),F=this.$H,B=this.$m,H=this.$M,G=U.weekdays,Z=U.months,Y=U.meridiem,Q=function(ee,ae,oe,Ce){return ee&&(ee[ae]||ee(z,V))||oe[ae].slice(0,Ce)},K=function(ee){return k.s(F%12||12,ee,"0")},X=Y||function(ee,ae,oe){var Ce=ee<12?"AM":"PM";return oe?Ce.toLowerCase():Ce};return V.replace(b,function(ee,ae){return ae||function(oe){switch(oe){case"YY":return String(z.$y).slice(-2);case"YYYY":return k.s(z.$y,4,"0");case"M":return H+1;case"MM":return k.s(H+1,2,"0");case"MMM":return Q(U.monthsShort,H,Z,3);case"MMMM":return Q(Z,H);case"D":return z.$D;case"DD":return k.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Q(U.weekdaysMin,z.$W,G,2);case"ddd":return Q(U.weekdaysShort,z.$W,G,3);case"dddd":return G[z.$W];case"H":return String(F);case"HH":return k.s(F,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return X(F,B,!0);case"A":return X(F,B,!1);case"m":return String(B);case"mm":return k.s(B,2,"0");case"s":return String(z.$s);case"ss":return k.s(z.$s,2,"0");case"SSS":return k.s(z.$ms,3,"0");case"Z":return q}return null}(ee)||q.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(N,z,U){var V,q=this,F=k.p(z),B=P(N),H=(B.utcOffset()-this.utcOffset())*n,G=this-B,Z=function(){return k.m(q,B)};switch(F){case f:V=Z()/12;break;case h:V=Z();break;case p:V=Z()/3;break;case d:V=(G-H)/6048e5;break;case u:V=(G-H)/864e5;break;case c:V=G/i;break;case s:V=G/n;break;case a:V=G/r;break;default:V=G}return U?V:k.a(V)},D.daysInMonth=function(){return this.endOf(h).$D},D.$locale=function(){return I[this.$L]},D.locale=function(N,z){if(!N)return this.$L;var U=this.clone(),V=O(N,z,!0);return V&&(U.$L=V),U},D.clone=function(){return k.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},$}(),M=S.prototype;return P.prototype=M,[["$ms",o],["$s",a],["$m",s],["$H",c],["$W",u],["$M",h],["$y",f],["$D",g]].forEach(function($){M[$[1]]=function(D){return this.$g(D,$[0],$[1])}}),P.extend=function($,D){return $.$i||($(D,S,P),$.$i=!0),P},P.locale=O,P.isDayjs=T,P.unix=function($){return P(1e3*$)},P.en=I[w],P.Ls=I,P.p={},P})}(Av)),Av.exports}var hOe=dOe();const el=hl(hOe),pOe=t=>{const[e,r]=W.useState(!1),[n,i]=W.useState(!1),[o,a]=W.useState(""),[s,c]=W.useState("success"),{https:u}=er.useAPIContext(),{Toast:d}=er.useComponentContext(),h=_t(zt),p=(m,v)=>{c(m),a(v),i(!0)},f=()=>{a(""),i(!1)},g=m=>L(this,null,function*(){if(m.stopPropagation(),r(!0),(yield u.deleteEitherOr(t.eitherOr.id)).ok){p("success",h.deleteEitherOrMessage),r(!1),t.onClose(m),t.onDelete();return}p("danger",h.deleteEitherOrErrorMessage),r(!1)});return E.jsxs(E.Fragment,{children:[E.jsx(As,{open:t.isOpen,onClose:t.onClose,children:E.jsxs(Es,{children:[E.jsxs(ks,{children:[E.jsx(Pae,{}),h.deleteEitherOrTitle]}),E.jsx(Ni,{}),E.jsx(Ts,{children:E.jsxs(ze,{children:[h.deleteEitherOrDescription," ",E.jsx(ze,{fontWeight:"bold",children:t.eitherOr.title}),"?"]})}),E.jsxs(Bl,{children:[E.jsx(lt,{loading:e,variant:"solid",color:"danger",onClick:g,children:h.deleteLabel}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:m=>{m.stopPropagation(),t.onClose(m)},children:h.close})]})]})}),E.jsx(d,{showToast:n,color:s,message:o,hideToast:f})]})},fOe=({eitherOr:t,onClickEdit:e,onDelete:r})=>{const[n,i]=W.useState(!1),o=_t(zt),a=s=>{s.stopPropagation(),i(!n)};return E.jsxs(E.Fragment,{children:[E.jsxs(DE,{children:[E.jsx(qO,{slots:{root:ur},slotProps:{root:{variant:"plain",color:"neutral",size:"sm"}},onClick:s=>s.stopPropagation(),children:E.jsx(Aae,{})}),E.jsxs(WO,{size:"sm",sx:{minWidth:140},onClick:s=>s.stopPropagation(),children:[E.jsx(Xx,{onClick:e,children:o.edit}),E.jsx(Ni,{}),E.jsx(Xx,{color:"danger",onClick:a,disabled:t.status!=="INACTIVE",children:o.deleteLabel})]})]}),E.jsx(pOe,{isOpen:n,eitherOr:t,onDelete:r,onClose:s=>{s.stopPropagation(),i(!1)}})]})},mOe=({game:t})=>{const[e,r]=W.useState(null),[n,i]=W.useState(!1),{sdk:o}=er.useAPIContext(),{Spinner:a,Toast:s}=er.useComponentContext(),c=_t(zt),u=()=>L(this,null,function*(){try{const d=yield o.miniGames.getEitherOrResults(t.id);r(d.standings)}catch(d){console.error(d),r([]),i(!0)}});return W.useEffect(()=>(u(),()=>{r(null)}),[]),e?E.jsxs(E.Fragment,{children:[E.jsx(zl,{variant:"soft",sx:{p:2,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)",cursor:"default","&hover":{backgroundColor:"transparent"}},children:e.length?E.jsxs(Ma,{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:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{style:{width:"3%"},children:"#"}),E.jsx("th",{children:c.name}),E.jsx("th",{children:c.points})]})}),E.jsx("tbody",{children:e.map((d,h)=>{var p,f,g,m,v;return E.jsxs("tr",{children:[E.jsx("td",{children:h+1}),E.jsx("td",{children:E.jsxs(Oe,{display:"flex",alignItems:"center",children:[E.jsx(Sn,{variant:"soft",size:"sm",src:(p=d.userModel)!=null&&p.avatar?d.userModel.avatar:BEe,alt:"profile-avatar"}),E.jsxs(Oe,{ml:1,children:[E.jsxs(ze,{fontWeight:"md",children:[((f=d.userModel)==null?void 0:f.nickname)||"-------------"," ",(g=d.userModel)!=null&&g.name?E.jsxs(ze,{children:["(",d.userModel.name,")"]}):E.jsx(E.Fragment,{})]}),E.jsx(ze,{fontSize:"sm",sx:{opacity:"0.5"},children:(m=d.userModel)!=null&&m.country?(v=d.userModel)==null?void 0:v.country.name:""})]})]})}),E.jsx("td",{children:d.personalBest})]},`report-user-${d.userId}`)})})]}):E.jsx(ze,{level:"body-lg",textAlign:"center",fontWeight:"bold",my:6,children:c.noStandingsAvailable})}),E.jsx(s,{showToast:n,color:"danger",message:c.standingsErrorMessage,hideToast:()=>i(!1)})]}):E.jsx(a,{my:20})};class gOe{constructor(){l(this,"registered",{from_date:"",to_date:""});l(this,"interests",{ids:[],type:""});l(this,"either_or",{ids:[],type:"ALL",min_points:0});l(this,"classic_quiz",{ids:[],type:"",min_success_rate:0});l(this,"poll",{ids:[],type:"",option_ids:[]});l(this,"single_predictions",{ids:[],type:""});l(this,"top_x",{ids:[],type:""});l(this,"match_quiz",{ids:[],type:""})}}const vOe=({game:t})=>{const[e,r]=W.useState(null),[n,i]=W.useState(0),[o,a]=W.useState(!1),[s,c]=W.useState("success"),[u,d]=W.useState(""),h=_t(zt),{https:p}=er.useAPIContext(),{Toast:f,NumberInput:g,ExportUsersLeads:m}=er.useComponentContext(),v=(y,C)=>{c(y),d(C),a(!0)},b=y=>L(this,null,function*(){r(y);const C=new gOe;C.either_or.ids=[t.id],y>0&&(C.either_or.min_points=y);const w=yield p.exportUsers(C);if(w.ok){const I=yield w.blob(),_=URL.createObjectURL(I),T=document.createElement("a");T.href=_;const O=t.id+(y>0?`_points_${y}`:"");T.download=`either_or_${O}_exported_users.csv`,document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(_),r(null),v("success",h.usersExportMessage)}else console.error(yield w.json()),r(null),v("danger",h.usersExportErrorMessage)}),x=()=>E.jsxs(E.Fragment,{children:[E.jsxs("tr",{children:[E.jsxs("td",{children:[E.jsx(ze,{level:"body-sm",fontWeight:"600",children:h.exportUsersWithMinPoints.replace("_minPoints_",`${n||0}`)}),E.jsx(ze,{level:"body-xs",color:"neutral",children:h.exportUsersWithMinPointsDescription.replace("_minPoints_",`${n||0}`)})]}),E.jsx("td",{children:E.jsxs(Oe,{display:"flex",alignItems:"center",justifyContent:"flex-end",children:[E.jsx(g,{sx:{mb:.5,mr:2,width:70},defaultValue:n,onChange:y=>i(y)}),E.jsx(lt,{disabled:!(n>0),loading:e>0,onClick:()=>b(n),children:h.exportUsersWithMinPoints.replace("_minPoints_",`${n||0}`)})]})})]},"some-users"),E.jsxs("tr",{children:[E.jsxs("td",{children:[E.jsx(ze,{level:"body-sm",fontWeight:"600",children:h.exportAllUsers}),E.jsx(ze,{level:"body-xs",color:"neutral",children:h.exportAllUsersDescription})]}),E.jsx("td",{children:E.jsx(lt,{loading:e===0,onClick:()=>b(0),children:h.exportAllUsers})})]},"all-users")]});return E.jsxs(hn,{variant:"soft",sx:{borderRadius:0,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)"},children:[E.jsxs($n,{children:[E.jsxs(Oe,{mb:2,children:[E.jsx(Oe,{display:"flex",alignItems:"center",mb:1,children:E.jsx(ze,{level:"body-lg",sx:{mx:"auto"},children:h.exportUsersData})}),E.jsx(zl,{sx:{overflowX:"auto",minWidth:"700px"},children:E.jsxs(Ma,{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:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{children:h.category}),E.jsx("th",{children:h.action})]})}),E.jsx("tbody",{children:x()})]})})]}),E.jsx(m,{entityId:t.id,entityType:"either_or",entityName:t.title,labels:h})]}),E.jsx(f,{showToast:o,color:s,message:u,hideToast:()=>a(!1)})]})},B1="DEFAULT_X_AXIS_KEY",z1="DEFAULT_Y_AXIS_KEY",yOe={top:50,bottom:50,left:50,right:50},RB=R.createContext({isInitialized:!1,data:{highlightedItem:null,setHighlighted:()=>{},clearHighlighted:()=>{},isHighlighted:()=>!1,isFaded:()=>!1}}),bOe=(t,e)=>r=>t?t.fade==="series"?r.seriesId===(e==null?void 0:e.seriesId)&&r.dataIndex!==(e==null?void 0:e.dataIndex):t.fade==="global"?r.seriesId!==(e==null?void 0:e.seriesId)||r.dataIndex!==(e==null?void 0:e.dataIndex):!1:!1,xOe=(t,e)=>r=>t?t.highlight==="series"?r.seriesId===(e==null?void 0:e.seriesId):t.highlight==="item"?r.dataIndex===(e==null?void 0:e.dataIndex)&&r.seriesId===(e==null?void 0:e.seriesId):!1:!1,wOe=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];function COe(t,e,r=wOe){return t.type==="pie"?j({},t,{data:t.data.map((n,i)=>j({color:r[i%r.length]},n))}):j({color:r[e%r.length]},t)}const IOe=({series:t,colors:e,seriesFormatters:r,dataset:n})=>{const i={};t.forEach((a,s)=>{var d;const{id:c=`auto-generated-id-${s}`,type:u}=a;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]=j({id:c},COe(a,s,e)),i[u].seriesOrder.push(c)});const o={};return Object.keys(r).forEach(a=>{var c,u;const s=i[a];s!==void 0&&(o[a]=(u=(c=r[a])==null?void 0:c.call(r,s,n))!=null?u:i[a])}),o};function rs({props:t,name:e}){return woe({props:t,name:e,defaultTheme:xw,themeId:ww})}const SOe=["#02B2AF","#2E96FF","#B800D8","#60009B","#2731C8","#03008D"],_Oe=["#02B2AF","#72CCFF","#DA00FF","#9001CB","#2E96FF","#3B48E0"],TOe=t=>t==="dark"?_Oe:SOe,MB=R.createContext({isInitialized:!1,data:{}}),Ph=R.createContext({isInitialized:!1,data:{colorProcessors:{},seriesFormatters:{},xExtremumGetters:{},yExtremumGetters:{},rotationExtremumGetters:{},radiusExtremumGetters:{}}}),DB=(t,e)=>e==="x"?{x:t,y:null}:{x:null,y:t},$B=t=>{var c;const{axis:e,getFilters:r,isDefaultAxis:n}=t,i=r==null?void 0:r({currentAxisId:e.id,isDefaultAxis:n}),o=i?(c=e.data)==null?void 0:c.filter((u,d)=>i({x:null,y:null},d)):e.data,a=Math.min(...o!=null?o:[]),s=Math.max(...o!=null?o:[]);return[a,s]},LB=t=>e=>{const{series:r,axis:n,getFilters:i,isDefaultAxis:o}=e;return Object.keys(r).filter(a=>{var c;const s=(c=r[a].yAxisId)!=null?c:r[a].yAxisKey;return s===n.id||o&&s===void 0}).reduce((a,s)=>{var p,f,g;const{stackedData:c}=r[s],u=i==null?void 0:i({currentAxisId:n.id,isDefaultAxis:o,seriesXAxisId:(p=r[s].xAxisId)!=null?p:r[s].xAxisKey,seriesYAxisId:(f=r[s].yAxisId)!=null?f:r[s].yAxisKey}),[d,h]=(g=c==null?void 0:c.reduce((m,v,b)=>u&&(!u(DB(v[0],t),b)||!u(DB(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,a[0]),Math.max(h,a[1])]},[1/0,-1/0])},kOe=t=>Object.keys(t.series).some(r=>t.series[r].layout==="horizontal")?LB("x")(t):$B(t),AOe=t=>Object.keys(t.series).some(r=>t.series[r].layout==="horizontal")?$B(t):LB("y")(t);function Gi(t){return function(){return t}}const U1=2*Math.PI;function FB(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function POe(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function EOe(t){return t}function OOe(){var t=EOe,e=POe,r=null,n=Gi(0),i=Gi(U1),o=Gi(0);function a(s){var c,u=(s=FB(s)).length,d,h,p=0,f=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(U1,Math.max(-U1,i.apply(this,arguments)-m)),b,x=Math.min(Math.abs(v)/u,o.apply(this,arguments)),y=x*(v<0?-1:1),C;for(c=0;c<u;++c)(C=g[f[c]=c]=+t(s[c],c,s))>0&&(p+=C);for(e!=null?f.sort(function(w,I){return e(g[w],g[I])}):r!=null&&f.sort(function(w,I){return r(s[w],s[I])}),c=0,h=p?(v-u*y)/p:0;c<u;++c,m=b)d=f[c],C=g[d],b=m+(C>0?C*h:0)+y,g[d]={data:s[d],index:c,value:C,startAngle:m,endAngle:b,padAngle:x};return g}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:Gi(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,r=null,a):e},a.sort=function(s){return arguments.length?(r=s,e=null,a):r},a.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:Gi(+s),a):n},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:Gi(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:Gi(+s),a):o},a}function Uc(t,e){if((a=t.length)>1)for(var r=1,n,i,o=t[e[0]],a,s=o.length;r<a;++r)for(i=o,o=t[e[r]],n=0;n<s;++n)o[n][1]+=o[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Hc(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function ROe(t,e){return t[e]}function MOe(t){const e=[];return e.key=t,e}function NB(){var t=Gi([]),e=Hc,r=Uc,n=ROe;function i(o){var a=Array.from(t.apply(this,arguments),MOe),s,c=a.length,u=-1,d;for(const h of o)for(s=0,++u;s<c;++s)(a[s][u]=[0,+n(h,a[s].key,u,o)]).data=h;for(s=0,d=FB(e(a));s<c;++s)a[d[s]].index=s;return r(a,d),a}return i.keys=function(o){return arguments.length?(t=typeof o=="function"?o:Gi(Array.from(o)),i):t},i.value=function(o){return arguments.length?(n=typeof o=="function"?o:Gi(+o),i):n},i.order=function(o){return arguments.length?(e=o==null?Hc:typeof o=="function"?o:Gi(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(r=o==null?Uc:o,i):r},i}function DOe(t,e){if((n=t.length)>0){for(var r,n,i=0,o=t[0].length,a;i<o;++i){for(a=r=0;r<n;++r)a+=t[r][i][1]||0;if(a)for(r=0;r<n;++r)t[r][i][1]/=a}Uc(t,e)}}function $Oe(t,e){if((c=t.length)>0)for(var r,n=0,i,o,a,s,c,u=t[e[0]].length;n<u;++n)for(a=s=0,r=0;r<c;++r)(o=(i=t[e[r]][n])[1]-i[0])>0?(i[0]=a,i[1]=a+=o):o<0?(i[1]=s,i[0]=s+=o):(i[0]=0,i[1]=o)}function LOe(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,o=n.length;r<o;++r){for(var a=0,s=0;a<i;++a)s+=t[a][r][1]||0;n[r][1]+=n[r][0]=-s/2}Uc(t,e)}}function FOe(t,e){if(!(!((a=t.length)>0)||!((o=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,o,a;n<o;++n){for(var s=0,c=0,u=0;s<a;++s){for(var d=t[e[s]],h=d[n][1]||0,p=d[n-1][1]||0,f=(h-p)/2,g=0;g<s;++g){var m=t[e[g]],v=m[n][1]||0,b=m[n-1][1]||0;f+=v-b}c+=h,u+=f*h}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,Uc(t,e)}}function jB(t){var e=t.map(NOe);return Hc(t).sort(function(r,n){return e[r]-e[n]})}function NOe(t){for(var e=-1,r=0,n=t.length,i,o=-1/0;++e<n;)(i=+t[e][1])>o&&(o=i,r=e);return r}function BB(t){var e=t.map(zB);return Hc(t).sort(function(r,n){return e[r]-e[n]})}function zB(t){for(var e=0,r=-1,n=t.length,i;++r<n;)(i=+t[r][1])&&(e+=i);return e}function jOe(t){return BB(t).reverse()}function BOe(t){var e=t.length,r,n,i=t.map(zB),o=jB(t),a=0,s=0,c=[],u=[];for(r=0;r<e;++r)n=o[r],a<s?(a+=i[n],c.push(n)):(s+=i[n],u.push(n));return u.reverse().concat(c)}function zOe(t){return Hc(t).reverse()}const H1={appearance:jB,ascending:BB,descending:jOe,insideOut:BOe,none:Hc,reverse:zOe},V1={expand:DOe,diverging:$Oe,none:Uc,silhouette:LOe,wiggle:FOe},UB=t=>{const{series:e,seriesOrder:r,defaultStrategy:n}=t,i=[],o={};return r.forEach(a=>{var d,h;const{stack:s,stackOrder:c,stackOffset:u}=e[a];s===void 0?i.push({ids:[a],stackingOrder:H1.none,stackingOffset:V1.none}):o[s]===void 0?(o[s]=i.length,i.push({ids:[a],stackingOrder:H1[(d=c!=null?c:n==null?void 0:n.stackOrder)!=null?d:"none"],stackingOffset:V1[(h=u!=null?u:n==null?void 0:n.stackOffset)!=null?h:"diverging"]})):(i[o[s]].ids.push(a),c!==void 0&&(i[o[s]].stackingOrder=H1[c]),u!==void 0&&(i[o[s]].stackingOffset=V1[u]))}),i};function HB(t,e){const r={};return Object.keys(t).forEach(n=>{var i;r[n]=j({},t[n],{valueFormatter:(i=t[n].valueFormatter)!=null?i:e})}),r}const UOe=(t,e)=>{const{seriesOrder:r,series:n}=t,i=UB(t),o=e!=null?e:[];r.forEach(s=>{const c=n[s].data;if(c!==void 0)c.forEach((u,d)=>{o.length<=d?o.push({[s]:u}):o[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(`
|
|
3640
3640
|
`))});const a={};return i.forEach(s=>{const{ids:c,stackingOffset:u,stackingOrder:d}=s,h=NB().keys(c.map(p=>{const f=n[p].dataKey;return n[p].data===void 0&&f!==void 0?f:p})).value((p,f)=>{var g;return(g=p[f])!=null?g:0}).order(d).offset(u)(o);c.forEach((p,f)=>{const g=n[p].dataKey;a[p]=j({layout:"vertical"},n[p],{data:g?e.map(m=>{const v=m[g];return typeof v!="number"?0:v}):n[p].data,stackedData:h[f].map(([m,v])=>[m,v])})})}),{seriesOrder:r,stackingGroups:i,series:HB(a,s=>s==null?"":s.toLocaleString())}},VB=(t,e,r)=>{const n=t.layout==="vertical",i=n?e==null?void 0:e.colorScale:r==null?void 0:r.colorScale,o=n?r==null?void 0:r.colorScale:e==null?void 0:e.colorScale,a=n?e==null?void 0:e.data:r==null?void 0:r.data;return o?s=>{const c=t.data[s],u=c===null?t.color:o(c);return u===null?t.color:u}:i&&a?s=>{const c=a[s],u=c===null?t.color:i(c);return u===null?t.color:u}:()=>t.color},HOe={seriesType:"bar",seriesFormatter:UOe,colorProcessor:VB,xExtremumGetter:kOe,yExtremumGetter:AOe},Pv=(t,e)=>[e[0]===null?t[0]:Math.min(t[0],e[0]),e[1]===null?t[1]:Math.max(t[1],e[1])],VOe={seriesType:"scatter",seriesFormatter:({series:t,seriesOrder:e},r)=>({series:Object.fromEntries(Object.entries(t).map(([i,o])=>{var u,d,h;const a=o==null?void 0:o.datasetKeys,s=["x","y","id"].filter(p=>typeof(a==null?void 0:a[p])!="string");if(o!=null&&o.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(`
|
|
3641
3641
|
`));const c=a?(d=r==null?void 0:r.map(p=>{var f,g;return{x:(f=p[a.x])!=null?f:null,y:(g=p[a.y])!=null?g:null,z:a.z&&p[a.z],id:p[a.id]}}))!=null?d:[]:(u=o.data)!=null?u:[];return[i,j({},o,{data:c,valueFormatter:(h=o.valueFormatter)!=null?h:p=>`(${p.x}, ${p.y})`})]})),seriesOrder:e}),colorProcessor:(t,e,r,n)=>{const i=n==null?void 0:n.colorScale,o=r==null?void 0:r.colorScale,a=e==null?void 0:e.colorScale;return i?s=>{var d,h;if(((d=n==null?void 0:n.data)==null?void 0:d[s])!==void 0){const p=i((h=n==null?void 0:n.data)==null?void 0:h[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}:o?s=>{const c=t.data[s],u=c===null?t.color:o(c.y);return u===null?t.color:u}:a?s=>{const c=t.data[s],u=c===null?t.color:a(c.x);return u===null?t.color:u}:()=>t.color},xExtremumGetter:t=>{const{series:e,axis:r,isDefaultAxis:n,getFilters:i}=t;return Object.keys(e).filter(o=>{var s;const a=(s=e[o].xAxisId)!=null?s:e[o].xAxisKey;return a===r.id||a===void 0&&n}).reduce((o,a)=>{var u,d,h;const s=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:n,seriesXAxisId:(u=e[a].xAxisId)!=null?u:e[a].xAxisKey,seriesYAxisId:(d=e[a].yAxisId)!=null?d:e[a].yAxisKey}),c=(h=e[a].data)==null?void 0:h.reduce((p,f,g)=>s&&!s(f,g)?p:Pv(p,[f.x,f.x]),[1/0,-1/0]);return Pv(o,c!=null?c:[1/0,-1/0])},[1/0,-1/0])},yExtremumGetter:t=>{const{series:e,axis:r,isDefaultAxis:n,getFilters:i}=t;return Object.keys(e).filter(o=>{var s;const a=(s=e[o].yAxisId)!=null?s:e[o].yAxisKey;return a===r.id||a===void 0&&n}).reduce((o,a)=>{var u,d,h;const s=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:n,seriesXAxisId:(u=e[a].xAxisId)!=null?u:e[a].xAxisKey,seriesYAxisId:(d=e[a].yAxisId)!=null?d:e[a].yAxisKey}),c=(h=e[a].data)==null?void 0:h.reduce((p,f,g)=>s&&!s(f,g)?p:Pv(p,[f.y,f.y]),[1/0,-1/0]);return Pv(o,c!=null?c:[1/0,-1/0])},[1/0,-1/0])}},WOe=t=>{var i,o;const{axis:e}=t,r=Math.min(...(i=e.data)!=null?i:[]),n=Math.max(...(o=e.data)!=null?o:[]);return[r,n]};function qOe(t,e,r){return e.reduce((n,i,o)=>{const[a,s]=t(i);return r&&(!r({y:a,x:null},o)||!r({y:s,x:null},o))?n:[Math.min(a,s,n[0]),Math.max(a,s,n[1])]},[1/0,-1/0])}const GOe={seriesType:"line",colorProcessor:(t,e,r)=>{const n=r==null?void 0:r.colorScale,i=e==null?void 0:e.colorScale;return n?o=>{const a=t.data[o],s=a===null?t.color:n(a);return s===null?t.color:s}:i?o=>{var c;const a=(c=e.data)==null?void 0:c[o],s=a===null?t.color:i(a);return s===null?t.color:s}:()=>t.color},seriesFormatter:(t,e)=>{const{seriesOrder:r,series:n}=t,i=UB(j({},t,{defaultStrategy:{stackOffset:"none"}})),o=e!=null?e:[];r.forEach(s=>{const c=n[s].data;c!==void 0&&c.forEach((u,d)=>{o.length<=d?o.push({[s]:u}):o[d][s]=u})});const a={};return i.forEach(s=>{const{ids:c,stackingOrder:u,stackingOffset:d}=s,h=NB().keys(c.map(p=>{const f=n[p].dataKey;return n[p].data===void 0&&f!==void 0?f:p})).value((p,f)=>{var g;return(g=p[f])!=null?g:0}).order(u).offset(d)(o);c.forEach((p,f)=>{const g=n[p].dataKey;a[p]=j({},n[p],{data:g?e.map(m=>{const v=m[g];return typeof v!="number"?null:v}):n[p].data,stackedData:h[f].map(([m,v])=>[m,v])})})}),{seriesOrder:r,stackingGroups:i,series:HB(a,s=>s==null?"":s.toLocaleString())}},xExtremumGetter:WOe,yExtremumGetter:t=>{const{series:e,axis:r,isDefaultAxis:n,getFilters:i}=t;return Object.keys(e).filter(o=>{var s;const a=(s=e[o].yAxisId)!=null?s:e[o].yAxisKey;return a===r.id||n&&a===void 0}).reduce((o,a)=>{var m,v;const{area:s,stackedData:c}=e[a],u=s!==void 0,d=i==null?void 0:i({currentAxisId:r.id,isDefaultAxis:n,seriesXAxisId:(m=e[a].xAxisId)!=null?m:e[a].xAxisKey,seriesYAxisId:(v=e[a].yAxisId)!=null?v:e[a].yAxisKey}),h=u&&r.scaleType!=="log"&&typeof e[a].baseline!="string"?b=>b:b=>[b[1],b[1]],p=qOe(h,c,d),[f,g]=p;return[Math.min(f,o[0]),Math.max(g,o[1])]},[1/0,-1/0])}};function la(t,e){return typeof t=="function"?t(e):t}const YOe=(t="none")=>{if(typeof t=="function")return t;switch(t){case"none":return null;case"desc":return(e,r)=>r-e;case"asc":return(e,r)=>e-r;default:return null}},KOe=[HOe,VOe,GOe,{seriesType:"pie",colorProcessor:t=>e=>t.data[e].color,seriesFormatter:t=>{const{seriesOrder:e,series:r}=t,n={};return e.forEach(i=>{var a,s,c,u;const o=OOe().startAngle(2*Math.PI*((a=r[i].startAngle)!=null?a:0)/360).endAngle(2*Math.PI*((s=r[i].endAngle)!=null?s:360)/360).padAngle(2*Math.PI*((c=r[i].paddingAngle)!=null?c:0)/360).sortValues(YOe((u=r[i].sortingValues)!=null?u:"none"))(r[i].data.map(d=>d.value));n[i]=j({valueFormatter:d=>d.value.toLocaleString()},r[i],{data:r[i].data.map((d,h)=>{var p;return j({},d,{id:(p=d.id)!=null?p:`auto-generated-pie-id-${i}-${h}`},o[h])}).map((d,h)=>{var p,f,g;return j({},d,{formattedValue:(g=(f=(p=r[i]).valueFormatter)==null?void 0:f.call(p,j({},d,{label:la(d.label,"arc")}),{dataIndex:h}))!=null?g:d.value.toLocaleString()})})})}),{seriesOrder:e,series:n}}}];function JOe(t){const e=t!=null?t:KOe,r={},n={},i={},o={},a={},s={};for(let c=0;c<e.length;c+=1){const u=e[c],d=u.seriesType;r[d]=u.seriesFormatter,n[d]=u.colorProcessor,u.xExtremumGetter&&(i[d]=u.xExtremumGetter),u.yExtremumGetter&&(o[d]=u.yExtremumGetter),u.rotationExtremumGetter&&(a[d]=u.rotationExtremumGetter),u.radiusExtremumGetter&&(s[d]=u.radiusExtremumGetter)}return{seriesFormatters:r,colorProcessors:n,xExtremumGetters:i,yExtremumGetters:o,rotationExtremumGetters:a,radiusExtremumGetters:s}}function QOe(t){const{children:e,plugins:r}=t,n=R.useMemo(()=>({isInitialized:!0,data:JOe(r)}),[r]);return E.jsx(Ph.Provider,{value:n,children:e})}function WB(t){const{isInitialized:e,data:r}=R.useContext(Ph);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(`
|
|
3642
3642
|
`));return r.colorProcessors}function XOe(t){const{isInitialized:e,data:r}=R.useContext(Ph);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(`
|
|
@@ -3652,4 +3652,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3652
3652
|
`));if(g!==null&&!u[g])throw new Error([`MUI X: id used for right axis "${g}" is not defined.`,`Available ids are: ${d.join(", ")}.`].join(`
|
|
3653
3653
|
`));if(p!==null&&!s[p])throw new Error([`MUI X: id used for bottom axis "${p}" is not defined.`,`Available ids are: ${c.join(", ")}.`].join(`
|
|
3654
3654
|
`));const m=Zv(e,o,a),v=Zv(i,o,a),b=Zv(r,o,a),x=Zv(n,o,a);return E.jsxs(R.Fragment,{children:[f&&E.jsx(uz,j({},m,{position:"top",axisId:f})),p&&E.jsx(uz,j({},v,{position:"bottom",axisId:p})),h&&E.jsx(dz,j({},b,{position:"left",axisId:h})),g&&E.jsx(dz,j({},x,{position:"right",axisId:g}))]})}function d$e(t){return Bi("MuiChartsGrid",t)}const PS=ho("MuiChartsGrid",["root","line","horizontalLine","verticalLine"]),h$e=Cr("g",{name:"MuiChartsGrid",slot:"Root",overridesResolver:(t,e)=>[{[`&.${PS.verticalLine}`]:e.verticalLine},{[`&.${PS.horizontalLine}`]:e.horizontalLine},e.root]})({}),hz=Cr("line",{name:"MuiChartsGrid",slot:"Line",overridesResolver:(t,e)=>e.line})(({theme:t})=>({stroke:(t.vars||t).palette.divider,shapeRendering:"crispEdges",strokeWidth:1}));function p$e(t){const{axis:e,drawingArea:r,classes:n}=t,{scale:i,tickNumber:o,tickInterval:a}=e,s=Jv({scale:i,tickNumber:o,tickInterval:a});return E.jsx(R.Fragment,{children:s.map(({value:c,offset:u})=>E.jsx(hz,{y1:r.top,y2:r.top+r.height,x1:u,x2:u,className:n.verticalLine},`vertical-${c}`))})}function f$e(t){const{axis:e,drawingArea:r,classes:n}=t,{scale:i,tickNumber:o,tickInterval:a}=e,s=Jv({scale:i,tickNumber:o,tickInterval:a});return E.jsx(R.Fragment,{children:s.map(({value:c,offset:u})=>E.jsx(hz,{y1:u,y2:u,x1:r.left,x2:r.left+r.width,className:n.horizontalLine},`horizontal-${c}`))})}const m$e=["vertical","horizontal"],g$e=({classes:t})=>ji({root:["root"],verticalLine:["line","verticalLine"],horizontalLine:["line","horizontalLine"]},d$e,t);function v$e(t){const e=rs({props:t,name:"MuiChartsGrid"}),r=Ki(),{vertical:n,horizontal:i}=e,o=Fe(e,m$e),{xAxis:a,xAxisIds:s,yAxis:c,yAxisIds:u}=Ji(),d=g$e(e),h=c[u[0]],p=a[s[0]];return E.jsxs(h$e,j({},o,{className:d.root,children:[n&&E.jsx(p$e,{axis:p,drawingArea:r,classes:d}),i&&E.jsx(f$e,{axis:h,drawingArea:r,classes:d})]}))}function y$e(t){return typeof t=="function"?t():t}const b$e=R.forwardRef(function(e,r){const{children:n,container:i,disablePortal:o=!1}=e,[a,s]=R.useState(null),c=ad(R.isValidElement(n)?lie(n):null,r);if(Da(()=>{o||s(y$e(i)||document.body)},[i,o]),Da(()=>{if(a&&!o)return ow(r,a),()=>{ow(r,null)}},[r,a,o]),o){if(R.isValidElement(n)){const u={ref:c};return R.cloneElement(n,u)}return n}return a&&sp.createPortal(n,a)});function x$e(t){return Bi("MuiPopper",t)}ho("MuiPopper",["root"]);function w$e(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function ES(t){return typeof t=="function"?t():t}function C$e(t){return t.nodeType!==void 0}const I$e=t=>{const{classes:e}=t;return ji({root:["root"]},x$e,e)},S$e={},_$e=R.forwardRef(function(e,r){var N;const D=e,{anchorEl:n,children:i,direction:o,disablePortal:a,modifiers:s,open:c,placement:u,popperOptions:d,popperRef:h,slotProps:p={},slots:f={},TransitionProps:g,ownerState:m}=D,v=Yt(D,["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"]),b=R.useRef(null),x=ad(b,r),y=R.useRef(null),C=ad(y,h),w=R.useRef(C);Da(()=>{w.current=C},[C]),R.useImperativeHandle(h,()=>y.current,[]);const I=w$e(u,o),[_,T]=R.useState(I),[O,P]=R.useState(ES(n));R.useEffect(()=>{y.current&&y.current.forceUpdate()}),R.useEffect(()=>{n&&P(ES(n))},[n]),Da(()=>{if(!O||!c)return;const z=q=>{T(q.placement)};let U=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:q})=>{z(q)}}];s!=null&&(U=U.concat(s)),d&&d.modifiers!=null&&(U=U.concat(d.modifiers));const V=nO(O,b.current,Be(ce({placement:I},d),{modifiers:U}));return w.current(V),()=>{V.destroy(),w.current(null)}},[O,a,s,c,d,I]);const k={placement:_};g!==null&&(k.TransitionProps=g);const S=I$e(e),M=(N=f.root)!=null?N:"div",$=fi({elementType:M,externalSlotProps:p.root,externalForwardedProps:v,additionalProps:{role:"tooltip",ref:x},ownerState:e,className:S.root});return E.jsx(M,Be(ce({},$),{children:typeof i=="function"?i(k):i}))}),T$e=Cr(R.forwardRef(function(e,r){const P=e,{anchorEl:n,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:c=!1,modifiers:u,open:d,placement:h="bottom",popperOptions:p=S$e,popperRef:f,style:g,transition:m=!1,slotProps:v={},slots:b={}}=P,x=Yt(P,["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"]),[y,C]=R.useState(!0),w=()=>{C(!1)},I=()=>{C(!0)};if(!c&&!d&&(!m||y))return null;let _;if(o)_=o;else if(n){const k=ES(n);_=k&&C$e(k)?iw(k).body:iw(null).body}const T=!d&&c&&(!m||y)?"none":void 0,O=m?{in:d,onEnter:w,onExited:I}:void 0;return E.jsx(b$e,{disablePortal:s,container:_,children:E.jsx(_$e,Be(ce({anchorEl:n,direction:a,disablePortal:s,modifiers:u,ref:r,open:m?!y:d,placement:h,popperOptions:p,popperRef:f,slotProps:v,slots:b},x),{style:ce({position:"fixed",top:0,left:0,display:T},g),TransitionProps:O,children:i}))})}),{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),k$e=R.forwardRef(function(e,r){var T;const n=Aoe(),_=Cw({props:e,name:"MuiPopper"}),{anchorEl:o,component:a,components:s,componentsProps:c,container:u,disablePortal:d,keepMounted:h,modifiers:p,open:f,placement:g,popperOptions:m,popperRef:v,transition:b,slots:x,slotProps:y}=_,C=Yt(_,["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"]),w=(T=x==null?void 0:x.root)!=null?T:s==null?void 0:s.Root,I=ce({anchorEl:o,container:u,disablePortal:d,keepMounted:h,modifiers:p,open:f,placement:g,popperOptions:m,popperRef:v,transition:b},C);return E.jsx(T$e,Be(ce({as:a,direction:n?"rtl":"ltr",slots:{root:w},slotProps:y!=null?y:c},I),{ref:r}))});function pz(t){const{children:e,defer:r=!1,fallback:n=null}=t,[i,o]=R.useState(!1);return Da(()=>{r||o(!0)},[r]),R.useEffect(()=>{r&&o(!0)},[r]),i?e:n}const Jc=R.createContext({item:null,axis:{x:null,y:null},useVoronoiInteraction:!1,dispatch:()=>null}),A$e=(t,e)=>{switch(e.type){case"enterItem":return j({},t,{item:e.data});case"exitChart":return t.item===null&&t.axis.x===null&&t.axis.y===null?t:j({},t,{axis:{x:null,y:null},item:null});case"updateVoronoiUsage":return j({},t,{useVoronoiInteraction:e.useVoronoiInteraction});case"leaveItem":return t.item===null||Object.keys(e.data).some(r=>e.data[r]!==t.item[r])?t:j({},t,{item:null});case"updateAxis":return e.data.x===t.axis.x&&e.data.y===t.axis.y?t:j({},t,{axis:e.data});default:return t}};function P$e(t){const{children:e}=t,[r,n]=R.useReducer(A$e,{item:null,axis:{x:null,y:null},useVoronoiInteraction:!1}),i=R.useMemo(()=>j({},r,{dispatch:n}),[r]);return E.jsx(Jc.Provider,{value:i,children:e})}function E$e(t){if(t===null)return{getBoundingClientRect:()=>({width:0,height:0,x:0,y:0,top:0,right:0,bottom:0,left:0,toJSON:()=>""})};const{x:e,y:r}=t,n={width:0,height:0,x:e,y:r,top:r,right:e,bottom:r,left:e};return{getBoundingClientRect:()=>j({},n,{toJSON:()=>JSON.stringify(n)})}}function O$e(){const t=TS(),[e,r]=R.useState(null);return R.useEffect(()=>{const n=t.current;if(n===null)return()=>{};const i=a=>{a.pointerType!=="mouse"&&r(null)},o=a=>{r({x:a.clientX,y:a.clientY,height:a.height,pointerType:a.pointerType})};return n.addEventListener("pointerdown",o),n.addEventListener("pointermove",o),n.addEventListener("pointerup",i),()=>{n.removeEventListener("pointerdown",o),n.removeEventListener("pointermove",o),n.removeEventListener("pointerup",i)}},[t]),e}function R$e(t,e){if(t==="item")return e!==null;const r=e.x!==null,n=e.y!==null;return r||n}function M$e(t){return t instanceof Date?t.toUTCString():t.toLocaleString()}function D$e(t){return Bi("MuiChartsTooltip",t)}const fz=ho("MuiChartsTooltip",["root","paper","table","row","cell","mark","markCell","labelCell","valueCell"]),mz=Cr("div",{name:"MuiChartsTooltip",slot:"Container",overridesResolver:(t,e)=>e.paper})(({theme:t})=>({boxShadow:t.shadows[1],backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),borderRadius:t.shape.borderRadius})),gz=Cr("table",{name:"MuiChartsTooltip",slot:"Table",overridesResolver:(t,e)=>e.table})(({theme:t})=>({borderSpacing:0,"& thead td":{borderBottom:`solid ${(t.vars||t).palette.divider} 1px`}})),OS=Cr("tr",{name:"MuiChartsTooltip",slot:"Row",overridesResolver:(t,e)=>e.row})(({theme:t})=>({"tr:first-of-type& td":{paddingTop:t.spacing(1)},"tr:last-of-type& td":{paddingBottom:t.spacing(1)}})),ll=Cr("td",{name:"MuiChartsTooltip",slot:"Cell",overridesResolver:(t,e)=>e.cell})(({theme:t})=>({verticalAlign:"middle",color:(t.vars||t).palette.text.secondary,[`&.${fz.labelCell}`]:{paddingLeft:t.spacing(1)},[`&.${fz.valueCell}`]:{paddingLeft:t.spacing(4),color:(t.vars||t).palette.text.primary},"td:first-of-type&":{paddingLeft:t.spacing(2)},"td:last-of-type&":{paddingRight:t.spacing(2)}})),vz=Cr("div",{name:"MuiChartsTooltip",slot:"Mark",overridesResolver:(t,e)=>e.mark,shouldForwardProp:t=>tf(t)&&t!=="color"})(({theme:t,color:e})=>({width:t.spacing(1),height:t.spacing(1),borderRadius:"50%",boxShadow:t.shadows[1],background:e,borderColor:(t.vars||t).palette.background.paper,border:`solid ${(t.vars||t).palette.background.paper} ${t.spacing(.25)}`,boxSizing:"content-box"}));function $$e(t){var d;const{series:e,itemData:r,sx:n,classes:i,getColor:o}=t;if(r.dataIndex===void 0||!e.data[r.dataIndex])return null;const{displayedLabel:a,color:s}=e.type==="pie"?{color:o(r.dataIndex),displayedLabel:la(e.data[r.dataIndex].label,"tooltip")}:{color:o(r.dataIndex),displayedLabel:la(e.label,"tooltip")},c=e.type==="pie"?j({},e.data[r.dataIndex],{label:la(e.data[r.dataIndex].label,"tooltip")}):e.data[r.dataIndex],u=(d=e.valueFormatter)==null?void 0:d.call(e,c,{dataIndex:r.dataIndex});return E.jsx(mz,{sx:n,className:i.paper,children:E.jsx(gz,{className:i.table,children:E.jsx("tbody",{children:E.jsxs(OS,{className:i.row,children:[E.jsx(ll,{className:ft(i.markCell,i.cell),children:E.jsx(vz,{color:s,className:i.mark})}),E.jsx(ll,{className:ft(i.labelCell,i.cell),children:a}),E.jsx(ll,{className:ft(i.valueCell,i.cell),children:u})]})})})})}function L$e(t){var C,w,I,_,T,O,P,k;const{content:e,itemData:r,sx:n,classes:i,contentProps:o}=t,a=ns()[r.type].series[r.seriesId],{xAxis:s,yAxis:c,xAxisIds:u,yAxisIds:d}=Ji(),{zAxis:h,zAxisIds:p}=R.useContext(wS),f=WB(),g=(w=(C=a.xAxisId)!=null?C:a.xAxisKey)!=null?w:u[0],m=(_=(I=a.yAxisId)!=null?I:a.yAxisKey)!=null?_:d[0],v=(O=(T=a.zAxisId)!=null?T:a.zAxisKey)!=null?O:p[0],b=(k=(P=f[a.type])==null?void 0:P.call(f,a,g&&s[g],m&&c[m],v&&h[v]))!=null?k:()=>"",x=e!=null?e:$$e,y=fi({elementType:x,externalSlotProps:o,additionalProps:{itemData:r,series:a,sx:n,classes:i,getColor:b},ownerState:{}});return E.jsx(x,j({},y))}function F$e(t){return typeof t.main=="string"}function N$e(t,e=[]){if(!F$e(t))return!1;for(const r of e)if(!t.hasOwnProperty(r)||typeof t[r]!="string")return!1;return!0}function j$e(t=[]){return([,e])=>e&&N$e(e,t)}function B$e(t){return Bi("MuiTypography",t)}ho("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const z$e={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},U$e=yae(),H$e=t=>{const{align:e,gutterBottom:r,noWrap:n,paragraph:i,variant:o,classes:a}=t,s={root:["root",o,t.align!=="inherit"&&`align${$o(e)}`,r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]};return ji(s,B$e,a)},V$e=Cr("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.variant&&e[r.variant],r.align!=="inherit"&&e[`align${$o(r.align)}`],r.noWrap&&e.noWrap,r.gutterBottom&&e.gutterBottom,r.paragraph&&e.paragraph]}})(zR(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([r,n])=>r!=="inherit"&&n&&typeof n=="object").map(([r,n])=>({props:{variant:r},style:n})),...Object.entries(t.palette).filter(j$e()).map(([r])=>({props:{color:r},style:{color:(t.vars||t).palette[r].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,r])=>typeof r=="string").map(([r])=>({props:{color:`text${$o(r)}`},style:{color:(t.vars||t).palette.text[r]}})),{props:({ownerState:r})=>r.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:r})=>r.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:r})=>r.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:r})=>r.paragraph,style:{marginBottom:16}}]}})),yz={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},RS=R.forwardRef(function(e,r){const y=Cw({props:e,name:"MuiTypography"}),{color:n}=y,i=Yt(y,["color"]),o=!z$e[n],a=U$e(ce(ce({},i),o&&{color:n})),C=a,{align:s="inherit",className:c,component:u,gutterBottom:d=!1,noWrap:h=!1,paragraph:p=!1,variant:f="body1",variantMapping:g=yz}=C,m=Yt(C,["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"]),v=Be(ce({},a),{align:s,color:n,className:c,component:u,gutterBottom:d,noWrap:h,paragraph:p,variant:f,variantMapping:g}),b=u||(p?"p":g[f]||yz[f])||"span",x=H$e(v);return E.jsx(V$e,Be(ce({as:b,ref:r,className:ft(x.root,c)},m),{ownerState:v,style:ce(ce({},s!=="inherit"&&{"--Typography-textAlign":s}),m.style)}))});let bz;class W$e{constructor(){if(this.types=new Set,bz)throw new Error("You can only create one instance!");bz=this.types}addType(e){this.types.add(e)}getTypes(){return this.types}}const ey=new W$e;ey.addType("bar"),ey.addType("line"),ey.addType("scatter");function xz(t){return ey.getTypes().has(t)}function q$e(t){return xz(t.type)}function G$e(t){var c;const{series:e,axis:r,dataIndex:n,axisValue:i,sx:o,classes:a}=t;if(n==null)return null;const s=(c=r.valueFormatter)!=null?c:u=>r.scaleType==="utc"?M$e(u):u.toLocaleString();return E.jsx(mz,{sx:o,className:a.paper,children:E.jsxs(gz,{className:a.table,children:[i!=null&&!r.hideTooltip&&E.jsx("thead",{children:E.jsx(OS,{children:E.jsx(ll,{colSpan:3,children:E.jsx(RS,{children:s(i,{location:"tooltip"})})})})}),E.jsx("tbody",{children:e.filter(q$e).map(({id:u,label:d,valueFormatter:h,data:p,getColor:f})=>{var b;const g=h((b=p[n])!=null?b:null,{dataIndex:n});if(g==null)return null;const m=la(d,"tooltip"),v=f(n);return E.jsxs(OS,{className:a.row,children:[E.jsx(ll,{className:ft(a.markCell,a.cell),children:v&&E.jsx(vz,{color:v,className:a.mark})}),E.jsx(ll,{className:ft(a.labelCell,a.cell),children:m?E.jsx(RS,{children:m}):null}),E.jsx(ll,{className:ft(a.valueCell,a.cell),children:E.jsx(RS,{children:g})})]},u)})})]})})}function Y$e(t){const{content:e,contentProps:r,axisData:n,sx:i,classes:o}=t,a=n.x&&n.x.index!==-1,s=a?n.x&&n.x.index:n.y&&n.y.index,c=a?n.x&&n.x.value:n.y&&n.y.value,{xAxisIds:u,xAxis:d,yAxisIds:h,yAxis:p}=Ji(),{zAxisIds:f,zAxis:g}=R.useContext(wS),m=ns(),v=WB(),b=a?u[0]:h[0],x=R.useMemo(()=>{const I=[];return Object.keys(m).filter(xz).forEach(_=>{m[_].seriesOrder.forEach(T=>{var M,$,D,N,z,U;const O=m[_].series[T],P=(M=O.xAxisId)!=null?M:O.xAxisKey,k=($=O.yAxisId)!=null?$:O.yAxisKey,S=a?P:k;if(S===void 0||S===b){const V=m[_].series[T],q=P!=null?P:u[0],F=k!=null?k:h[0],B=(N=(D=V.zAxisId)!=null?D:V.zAxisKey)!=null?N:f[0],H=(U=(z=v[_])==null?void 0:z.call(v,V,d[q],p[F],B&&g[B]))!=null?U:()=>"";I.push(j({},V,{getColor:H}))}})}),I},[b,v,a,m,d,u,p,h,g,f]),y=R.useMemo(()=>a?d[b]:p[b],[b,a,d,p]),C=e!=null?e:G$e,w=fi({elementType:C,externalSlotProps:r,additionalProps:{axisData:n,series:x,axis:y,dataIndex:s,axisValue:c,sx:i,classes:o},ownerState:{}});return E.jsx(C,j({},w))}const K$e=t=>{const{classes:e}=t;return ji({root:["root"],paper:["paper"],table:["table"],row:["row"],cell:["cell"],mark:["mark"],markCell:["markCell"],labelCell:["labelCell"],valueCell:["valueCell"]},D$e,e)},J$e=Cr(k$e,{name:"MuiChartsTooltip",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({pointerEvents:"none",zIndex:t.zIndex.modal}));function Q$e(t){var v,b,x;const e=rs({props:t,name:"MuiChartsTooltip"}),{trigger:r="axis",itemContent:n,axisContent:i,slots:o,slotProps:a}=e,s=O$e(),{item:c,axis:u}=R.useContext(Jc),d=r==="item"?c:u,h=R$e(r,d),p=s!==null&&h,f=K$e({classes:e.classes}),g=(v=o==null?void 0:o.popper)!=null?v:J$e,m=fi({elementType:g,externalSlotProps:a==null?void 0:a.popper,additionalProps:{open:p,placement:(s==null?void 0:s.pointerType)==="mouse"?"right-start":"top",anchorEl:E$e(s),modifiers:[{name:"offset",options:{offset:[0,(s==null?void 0:s.pointerType)==="touch"?40-s.height:0]}}]},ownerState:{}});return r==="none"?null:E.jsx(pz,{children:p&&E.jsx(g,j({},m,{className:f.root,children:r==="item"?E.jsx(L$e,{itemData:d,content:(b=o==null?void 0:o.itemContent)!=null?b:n,contentProps:a==null?void 0:a.itemContent,sx:{mx:2},classes:f}):E.jsx(Y$e,{axisData:d,content:(x=o==null?void 0:o.axisContent)!=null?x:i,contentProps:a==null?void 0:a.axisContent,sx:{mx:2},classes:f})}))})}const X$e={bar:t=>{const{seriesOrder:e,series:r}=t;return e.reduce((n,i)=>{const o=la(r[i].label,"legend");return o===void 0||n.push({id:i,seriesId:i,color:r[i].color,label:o}),n},[])},scatter:t=>{const{seriesOrder:e,series:r}=t;return e.reduce((n,i)=>{const o=la(r[i].label,"legend");return o===void 0||n.push({id:i,seriesId:i,color:r[i].color,label:o}),n},[])},line:t=>{const{seriesOrder:e,series:r}=t;return e.reduce((n,i)=>{const o=la(r[i].label,"legend");return o===void 0||n.push({id:i,seriesId:i,color:r[i].color,label:o}),n},[])},pie:t=>{const{seriesOrder:e,series:r}=t;return e.reduce((n,i)=>(r[i].data.forEach(o=>{const a=la(o.label,"legend");a!==void 0&&n.push({id:o.id,seriesId:i,color:o.color,label:a,itemId:o.id})}),n),[])}};function Z$e(t){return Object.keys(t).flatMap(e=>{const r=X$e[e];return r===void 0?[]:r(t[e])})}function eLe(t){return Bi("MuiChartsLegend",t)}ho("MuiChartsLegend",["root","series","itemBackground","mark","label","column","row"]);const tLe=["label"];function rLe(t,e,r,n,i,o,a){let s=0,c=0,u=0,d=0,h=0;const p=[0];return[t.map(g=>{let{label:m}=g,v=Fe(g,tLe);const b=e(m,r),x=j({},v,{label:m,positionX:s,positionY:c,innerHeight:b.innerHeight,innerWidth:b.innerWidth,outerHeight:b.outerHeight,outerWidth:b.outerWidth,rowIndex:h});return n==="row"&&(s+b.innerWidth>i&&(s=0,c+=p[h],h+=1,p.length<=h&&p.push(0),x.positionX=s,x.positionY=c,x.rowIndex=h),u=Math.max(u,s+b.outerWidth),d=Math.max(d,c+b.outerHeight),p[h]=Math.max(p[h],b.outerHeight),s+=b.outerWidth),n==="column"&&(c+b.innerHeight>o&&(s=u+a,c=0,h=0,x.positionX=s,x.positionY=c,x.rowIndex=h),p.length<=h&&p.push(0),u=Math.max(u,s+b.outerWidth),d=Math.max(d,c+b.outerHeight),h+=1,c+=b.outerHeight),x}).map(g=>j({},g,{positionY:g.positionY+(n==="row"?p[g.rowIndex]/2:g.outerHeight/2)})),u,d]}function nLe(t){const e=rE(),{id:r,positionY:n,label:i,positionX:o,innerHeight:a,innerWidth:s,legendWidth:c,color:u,gapX:d,gapY:h,itemMarkHeight:p,itemMarkWidth:f,markGap:g,labelStyle:m,classes:v,onClick:b}=t;return E.jsxs("g",{className:ft(v==null?void 0:v.series,`${v==null?void 0:v.series}-${r}`),transform:`translate(${d+(e?c-o:o)} ${h+n})`,children:[E.jsx("rect",{x:e?-(s+2):-2,y:-p/2-2,width:s+4,height:a+4,fill:"transparent",className:v==null?void 0:v.itemBackground,onClick:b,style:{pointerEvents:b?"all":"none",cursor:b?"pointer":"unset"}}),E.jsx("rect",{className:v==null?void 0:v.mark,x:e?-f:0,y:-p/2,width:f,height:p,fill:u,style:{pointerEvents:"none"}}),E.jsx(jh,{style:j({pointerEvents:"none"},m),text:i,x:(e?-1:1)*(f+g),y:0})]})}const iLe=["rotate","dominantBaseline"],oLe=Cr("g",{name:"MuiChartsLegend",slot:"Root",overridesResolver:(t,e)=>e.root})({}),aLe=t=>typeof t=="number"?{left:t,right:t,top:t,bottom:t}:j({left:0,right:0,top:0,bottom:0},t);function sLe(t){const{position:e,direction:r,itemsToDisplay:n,classes:i,itemMarkWidth:o=20,itemMarkHeight:a=20,markGap:s=5,itemGap:c=10,padding:u=10,labelStyle:d,onItemClick:h}=t,p=md(),f=Ki(),g=R.useMemo(()=>j({},p.typography.subtitle1,{color:"inherit",dominantBaseline:"central",textAnchor:"start",fill:(p.vars||p).palette.text.primary,lineHeight:1},d),[d,p]),m=R.useMemo(()=>aLe(u),[u]),v=R.useCallback((P,k={})=>{const S=Fe(k,iLe),M=AS({style:S,needsComputation:!0,text:P}),$={innerWidth:o+s+Math.max(...M.map(D=>D.width)),innerHeight:Math.max(a,M.length*M[0].height)};return j({},$,{outerWidth:$.innerWidth+c,outerHeight:$.innerHeight+c})},[c,a,o,s]),b=f.left+f.width+f.right,x=f.top+f.height+f.bottom,y=b-m.left-m.right,C=x-m.top-m.bottom,[w,I,_]=R.useMemo(()=>rLe(n,v,g,r,y,C,c),[n,v,g,r,y,C,c]),T=R.useMemo(()=>{switch(e.horizontal){case"left":return m.left;case"right":return b-m.right-I;default:return(b-I)/2}},[e.horizontal,m.left,m.right,b,I]),O=R.useMemo(()=>{switch(e.vertical){case"top":return m.top;case"bottom":return x-m.bottom-_;default:return(x-_)/2}},[e.vertical,m.top,m.bottom,x,_]);return E.jsx(pz,{children:E.jsx(oLe,{className:i==null?void 0:i.root,children:w.map((P,k)=>W.createElement(nLe,j({},P,{key:P.id,gapX:T,gapY:O,legendWidth:I,itemMarkHeight:a,itemMarkWidth:o,markGap:s,labelStyle:g,classes:i,onClick:h?S=>h(S,k):void 0})))})})}const lLe=["drawingArea","seriesToDisplay","hidden","onItemClick"],cLe=t=>({type:"series",color:t.color,label:t.label,seriesId:t.seriesId,itemId:t.itemId});function uLe(t){const{seriesToDisplay:e,hidden:r,onItemClick:n}=t,i=Fe(t,lLe);return r?null:E.jsx(sLe,j({},i,{itemsToDisplay:e,onItemClick:n?(o,a)=>n(o,cLe(e[a]),a):void 0}))}const dLe=["slots","slotProps"],hLe=t=>{const{classes:e,direction:r}=t;return ji({root:["root",r],mark:["mark"],label:["label"],series:["series"],itemBackground:["itemBackground"]},eLe,e)};function pLe(t){var f;const e=rs({props:t,name:"MuiChartsLegend"}),r=j({direction:"row"},e,{position:j({horizontal:"middle",vertical:"top"},e.position)}),{slots:n,slotProps:i}=r,o=Fe(r,dLe),a=md(),s=hLe(j({},r,{theme:a})),c=Ki(),u=ns(),d=Z$e(u),h=(f=n==null?void 0:n.legend)!=null?f:uLe,p=fi({elementType:h,externalSlotProps:i==null?void 0:i.legend,additionalProps:j({},o,{classes:s,drawingArea:c,series:u,seriesToDisplay:d}),ownerState:{}});return E.jsx(h,j({},p))}const fLe=10;function wz(t){var g,m;const{gradientUnits:e,isReversed:r,gradientId:n,size:i,direction:o,scale:a,colorScale:s,colorMap:c}=t,u=[(g=c.min)!=null?g:0,(m=c.max)!=null?m:100],d=u.map(a).filter(v=>v!==void 0);if(d.length!==2)return null;const h=typeof u[0]=="number"?Mh(u[0],u[1]):d5(u[0],u[1]),p=Math.round((Math.max(...d)-Math.min(...d))/fLe),f=`${u[0]}-${u[1]}-`;return E.jsx("linearGradient",{id:n,x1:"0",x2:"0",y1:"0",y2:"0",[`${o}${r?1:2}`]:e==="objectBoundingBox"?1:`${i}px`,gradientUnits:e!=null?e:"userSpaceOnUse",children:Array.from({length:p+1},(v,b)=>{const x=h(b/p);if(x===void 0)return null;const y=a(x);if(y===void 0)return null;const C=r?1-y/i:y/i,w=s(x);return w===null?null:E.jsx("stop",{offset:C,stopColor:w,stopOpacity:1},f+b)})})}function mLe(t){return Bi("MuiChartsAxisHighlight",t)}ho("MuiChartsAxisHighlight",["root"]);const gLe=()=>ji({root:["root"]},mLe),ty=Cr("path",{name:"MuiChartsAxisHighlight",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({pointerEvents:"none",variants:[{props:{axisHighlight:"band"},style:j({fill:"white",fillOpacity:.1},t.applyStyles("light",{fill:"gray"}))},{props:{axisHighlight:"line"},style:j({strokeDasharray:"5 2",stroke:"#ffffff"},t.applyStyles("light",{stroke:"#000000"}))}]}));function vLe(t){const{x:e,y:r}=t,{xAxisIds:n,xAxis:i,yAxisIds:o,yAxis:a}=Ji(),s=gLe(),c=n[0],u=o[0],d=i[c].scale,h=a[u].scale,{axis:p}=R.useContext(Jc),f=nz(d),g=nz(h),m=p.x,v=p.y,b=e==="band"&&m!==null&&al(d),x=r==="band"&&v!==null&&al(h);return E.jsxs(R.Fragment,{children:[b&&d(m.value)!==void 0&&E.jsx(ty,{d:`M ${d(m.value)-(d.step()-d.bandwidth())/2} ${h.range()[0]} l ${d.step()} 0 l 0 ${h.range()[1]-h.range()[0]} l ${-d.step()} 0 Z`,className:s.root,ownerState:{axisHighlight:"band"}}),x&&h(v.value)!==void 0&&E.jsx(ty,{d:`M ${d.range()[0]} ${h(v.value)-(h.step()-h.bandwidth())/2} l 0 ${h.step()} l ${d.range()[1]-d.range()[0]} 0 l 0 ${-h.step()} Z`,className:s.root,ownerState:{axisHighlight:"band"}}),e==="line"&&p.x!==null&&E.jsx(ty,{d:`M ${f(p.x.value)} ${h.range()[0]} L ${f(p.x.value)} ${h.range()[1]}`,className:s.root,ownerState:{axisHighlight:"line"}}),r==="line"&&p.y!==null&&E.jsx(ty,{d:`M ${d.range()[0]} ${g(p.y.value)} L ${d.range()[1]} ${g(p.y.value)}`,className:s.root,ownerState:{axisHighlight:"line"}})]})}function yLe(t,e){const r=t.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r.matrixTransform(t.getScreenCTM().inverse())}function bLe(t){const{onAxisClick:e}=t,r=TS(),n=ns(),{axis:i}=R.useContext(Jc),{xAxisIds:o,xAxis:a,yAxisIds:s,yAxis:c}=Ji();return R.useEffect(()=>{const u=r.current;if(u===null||!e)return()=>{};const d=h=>{var b;h.preventDefault();const p=i.x&&i.x.index!==-1,f=p?o[0]:s[0],g=p?i.x&&i.x.index:i.y&&i.y.index;if(g==null)return;const m={};Object.keys(n).filter(x=>["bar","line"].includes(x)).forEach(x=>{var y;(y=n[x])==null||y.seriesOrder.forEach(C=>{var O,P;const w=n[x].series[C],I=(O=w.xAxisId)!=null?O:w.xAxisKey,_=(P=w.yAxisId)!=null?P:w.yAxisKey,T=p?I:_;(T===void 0||T===f)&&(m[C]=w.data[g])})});const v=(b=(p?a:c)[f].data)==null?void 0:b[g];e(h,{dataIndex:g,axisValue:v,seriesValues:m})};return u.addEventListener("click",d),()=>{u.removeEventListener("click",d)}},[i.x,i.y,e,n,r,a,o,c,s]),E.jsx(R.Fragment,{})}var MS=zh(),vt=t=>Bh(t,MS),DS=zh();vt.write=t=>Bh(t,DS);var ry=zh();vt.onStart=t=>Bh(t,ry);var $S=zh();vt.onFrame=t=>Bh(t,$S);var LS=zh();vt.onFinish=t=>Bh(t,LS);var Qc=[];vt.setTimeout=(t,e)=>{const r=vt.now()+e,n=()=>{const o=Qc.findIndex(a=>a.cancel==n);~o&&Qc.splice(o,1),as-=~o?1:0},i={time:r,handler:t,cancel:n};return Qc.splice(Cz(r),0,i),as+=1,Iz(),i};var Cz=t=>~(~Qc.findIndex(e=>e.time>t)||~Qc.length);vt.cancel=t=>{ry.delete(t),$S.delete(t),LS.delete(t),MS.delete(t),DS.delete(t)},vt.sync=t=>{NS=!0,vt.batchedUpdates(t),NS=!1},vt.throttle=t=>{let e;function r(){try{t(...e)}finally{e=null}}function n(...i){e=i,vt.onStart(r)}return n.handler=t,n.cancel=()=>{ry.delete(r),e=null},n};var FS=typeof window!="undefined"?window.requestAnimationFrame:()=>{};vt.use=t=>FS=t,vt.now=typeof performance!="undefined"?()=>performance.now():Date.now,vt.batchedUpdates=t=>t(),vt.catch=console.error,vt.frameLoop="always",vt.advance=()=>{vt.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):_z()};var os=-1,as=0,NS=!1;function Bh(t,e){NS?(e.delete(t),t(0)):(e.add(t),Iz())}function Iz(){os<0&&(os=0,vt.frameLoop!=="demand"&&FS(Sz))}function xLe(){os=-1}function Sz(){~os&&(FS(Sz),vt.batchedUpdates(_z))}function _z(){const t=os;os=vt.now();const e=Cz(os);if(e&&(Tz(Qc.splice(0,e),r=>r.handler()),as-=e),!as){xLe();return}ry.flush(),MS.flush(t?Math.min(64,os-t):16.667),$S.flush(),DS.flush(),LS.flush()}function zh(){let t=new Set,e=t;return{add(r){as+=e==t&&!t.has(r)?1:0,t.add(r)},delete(r){return as-=e==t&&t.has(r)?1:0,t.delete(r)},flush(r){e.size&&(t=new Set,as-=e.size,Tz(e,n=>n(r)&&t.add(n)),as+=t.size,e=t)}}}function Tz(t,e){t.forEach(r=>{try{e(r)}catch(n){vt.catch(n)}})}var wLe=Object.defineProperty,CLe=(t,e)=>{for(var r in e)wLe(t,r,{get:e[r],enumerable:!0})},Pi={};CLe(Pi,{assign:()=>SLe,colors:()=>ss,createStringInterpolator:()=>zS,skipAnimation:()=>Az,to:()=>kz,willAdvance:()=>US});function jS(){}var ILe=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),je={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function fa(t,e){if(je.arr(t)){if(!je.arr(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return t===e}var xt=(t,e)=>t.forEach(e);function _o(t,e,r){if(je.arr(t)){for(let n=0;n<t.length;n++)e.call(r,t[n],`${n}`);return}for(const n in t)t.hasOwnProperty(n)&&e.call(r,t[n],n)}var An=t=>je.und(t)?[]:je.arr(t)?t:[t];function Uh(t,e){if(t.size){const r=Array.from(t);t.clear(),xt(r,e)}}var Hh=(t,...e)=>Uh(t,r=>r(...e)),BS=()=>typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),zS,kz,ss=null,Az=!1,US=jS,SLe=t=>{t.to&&(kz=t.to),t.now&&(vt.now=t.now),t.colors!==void 0&&(ss=t.colors),t.skipAnimation!=null&&(Az=t.skipAnimation),t.createStringInterpolator&&(zS=t.createStringInterpolator),t.requestAnimationFrame&&vt.use(t.requestAnimationFrame),t.batchedUpdates&&(vt.batchedUpdates=t.batchedUpdates),t.willAdvance&&(US=t.willAdvance),t.frameLoop&&(vt.frameLoop=t.frameLoop)},Vh=new Set,Ei=[],HS=[],ny=0,iy={get idle(){return!Vh.size&&!Ei.length},start(t){ny>t.priority?(Vh.add(t),vt.onStart(_Le)):(Pz(t),vt(VS))},advance:VS,sort(t){if(ny)vt.onFrame(()=>iy.sort(t));else{const e=Ei.indexOf(t);~e&&(Ei.splice(e,1),Ez(t))}},clear(){Ei=[],Vh.clear()}};function _Le(){Vh.forEach(Pz),Vh.clear(),vt(VS)}function Pz(t){Ei.includes(t)||Ez(t)}function Ez(t){Ei.splice(TLe(Ei,e=>e.priority>t.priority),0,t)}function VS(t){const e=HS;for(let r=0;r<Ei.length;r++){const n=Ei[r];ny=n.priority,n.idle||(US(n),n.advance(t),n.idle||e.push(n))}return ny=0,HS=Ei,HS.length=0,Ei=e,Ei.length>0}function TLe(t,e){const r=t.findIndex(e);return r<0?t.length:r}var kLe={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Qi="[-+]?\\d*\\.?\\d+",oy=Qi+"%";function ay(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ALe=new RegExp("rgb"+ay(Qi,Qi,Qi)),PLe=new RegExp("rgba"+ay(Qi,Qi,Qi,Qi)),ELe=new RegExp("hsl"+ay(Qi,oy,oy)),OLe=new RegExp("hsla"+ay(Qi,oy,oy,Qi)),RLe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,MLe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,DLe=/^#([0-9a-fA-F]{6})$/,$Le=/^#([0-9a-fA-F]{8})$/;function LLe(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=DLe.exec(t))?parseInt(e[1]+"ff",16)>>>0:ss&&ss[t]!==void 0?ss[t]:(e=ALe.exec(t))?(Xc(e[1])<<24|Xc(e[2])<<16|Xc(e[3])<<8|255)>>>0:(e=PLe.exec(t))?(Xc(e[1])<<24|Xc(e[2])<<16|Xc(e[3])<<8|Mz(e[4]))>>>0:(e=RLe.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=$Le.exec(t))?parseInt(e[1],16)>>>0:(e=MLe.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=ELe.exec(t))?(Oz(Rz(e[1]),sy(e[2]),sy(e[3]))|255)>>>0:(e=OLe.exec(t))?(Oz(Rz(e[1]),sy(e[2]),sy(e[3]))|Mz(e[4]))>>>0:null}function WS(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Oz(t,e,r){const n=r<.5?r*(1+e):r+e-r*e,i=2*r-n,o=WS(i,n,t+1/3),a=WS(i,n,t),s=WS(i,n,t-1/3);return Math.round(o*255)<<24|Math.round(a*255)<<16|Math.round(s*255)<<8}function Xc(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Rz(t){return(parseFloat(t)%360+360)%360/360}function Mz(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function sy(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Dz(t){let e=LLe(t);if(e===null)return t;e=e||0;const r=(e&4278190080)>>>24,n=(e&16711680)>>>16,i=(e&65280)>>>8,o=(e&255)/255;return`rgba(${r}, ${n}, ${i}, ${o})`}var Wh=(t,e,r)=>{if(je.fun(t))return t;if(je.arr(t))return Wh({range:t,output:e,extrapolate:r});if(je.str(t.output[0]))return zS(t);const n=t,i=n.output,o=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",c=n.easing||(u=>u);return u=>{const d=NLe(u,o);return FLe(u,o[d],o[d+1],i[d],i[d+1],c,a,s,n.map)}};function FLe(t,e,r,n,i,o,a,s,c){let u=c?c(t):t;if(u<e){if(a==="identity")return u;a==="clamp"&&(u=e)}if(u>r){if(s==="identity")return u;s==="clamp"&&(u=r)}return n===i?n:e===r?t<=e?n:i:(e===-1/0?u=-u:r===1/0?u=u-e:u=(u-e)/(r-e),u=o(u),n===-1/0?u=-u:i===1/0?u=u+n:u=u*(i-n)+n,u)}function NLe(t,e){for(var r=1;r<e.length-1&&!(e[r]>=t);++r);return r-1}var jLe={linear:t=>t},qh=Symbol.for("FluidValue.get"),Zc=Symbol.for("FluidValue.observers"),Oi=t=>!!(t&&t[qh]),zn=t=>t&&t[qh]?t[qh]():t,$z=t=>t[Zc]||null;function BLe(t,e){t.eventObserved?t.eventObserved(e):t(e)}function Gh(t,e){const r=t[Zc];r&&r.forEach(n=>{BLe(n,e)})}var Lz=class{constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");zLe(this,t)}},zLe=(t,e)=>Fz(t,qh,e);function eu(t,e){if(t[qh]){let r=t[Zc];r||Fz(t,Zc,r=new Set),r.has(e)||(r.add(e),t.observerAdded&&t.observerAdded(r.size,e))}return e}function Yh(t,e){const r=t[Zc];if(r&&r.has(e)){const n=r.size-1;n?r.delete(e):t[Zc]=null,t.observerRemoved&&t.observerRemoved(n,e)}}var Fz=(t,e,r)=>Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0}),ly=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ULe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Nz=new RegExp(`(${ly.source})(%|[a-z]+)`,"i"),HLe=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,cy=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,jz=t=>{const[e,r]=VLe(t);if(!e||BS())return t;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(r&&r.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(r);return i||t}else{if(r&&cy.test(r))return jz(r);if(r)return r}return t},VLe=t=>{const e=cy.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]},qS,WLe=(t,e,r,n,i)=>`rgba(${Math.round(e)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,Bz=t=>{qS||(qS=ss?new RegExp(`(${Object.keys(ss).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(o=>zn(o).replace(cy,jz).replace(ULe,Dz).replace(qS,Dz)),r=e.map(o=>o.match(ly).map(Number)),i=r[0].map((o,a)=>r.map(s=>{if(!(a in s))throw Error('The arity of each "output" value must be equal');return s[a]})).map(o=>Wh(Be(ce({},t),{output:o})));return o=>{var c;const a=!Nz.test(e[0])&&((c=e.find(u=>Nz.test(u)))==null?void 0:c.replace(ly,""));let s=0;return e[0].replace(ly,()=>`${i[s++](o)}${a||""}`).replace(HLe,WLe)}},GS="react-spring: ",zz=t=>{const e=t;let r=!1;if(typeof e!="function")throw new TypeError(`${GS}once requires a function parameter`);return(...n)=>{r||(e(...n),r=!0)}},qLe=zz(console.warn);function GLe(){qLe(`${GS}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var YLe=zz(console.warn);function KLe(){YLe(`${GS}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function uy(t){return je.str(t)&&(t[0]=="#"||/\d/.test(t)||!BS()&&cy.test(t)||t in(ss||{}))}var cl=BS()?W.useEffect:W.useLayoutEffect,JLe=()=>{const t=W.useRef(!1);return cl(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function Uz(){const t=W.useState()[1],e=JLe();return()=>{e.current&&t(Math.random())}}function QLe(t,e){const[r]=W.useState(()=>({inputs:e,result:t()})),n=W.useRef(),i=n.current;let o=i;return o?e&&o.inputs&&XLe(e,o.inputs)||(o={inputs:e,result:t()}):o=r,W.useEffect(()=>{n.current=o,i==r&&(r.inputs=r.result=void 0)},[o]),o.result}function XLe(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}var Hz=t=>W.useEffect(t,ZLe),ZLe=[];function e2e(t){const e=W.useRef();return W.useEffect(()=>{e.current=t}),e.current}var Kh=Symbol.for("Animated:node"),t2e=t=>!!t&&t[Kh]===t,To=t=>t&&t[Kh],YS=(t,e)=>ILe(t,Kh,e),dy=t=>t&&t[Kh]&&t[Kh].getPayload(),Vz=class{constructor(){YS(this,this)}getPayload(){return this.payload||[]}},Jh=class extends Vz{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,je.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new Jh(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return je.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,je.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Qh=class extends Jh{constructor(t){super(0),this._string=null,this._toString=Wh({output:[t,t]})}static create(t){return new Qh(t)}getValue(){const t=this._string;return t==null?this._string=this._toString(this._value):t}setValue(t){if(je.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Wh({output:[this.getValue(),t]})),this._value=0,super.reset()}},hy={dependencies:null},py=class extends Vz{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return _o(this.source,(r,n)=>{t2e(r)?e[n]=r.getValue(t):Oi(r)?e[n]=zn(r):t||(e[n]=r)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&xt(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return _o(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){hy.dependencies&&Oi(t)&&hy.dependencies.add(t);const e=dy(t);e&&xt(e,r=>this.add(r))}},Wz=class extends py{constructor(t){super(t)}static create(t){return new Wz(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((r,n)=>r.setValue(t[n])).some(Boolean):(super.setValue(t.map(r2e)),!0)}};function r2e(t){return(uy(t)?Qh:Jh).create(t)}function KS(t){const e=To(t);return e?e.constructor:je.arr(t)?Wz:uy(t)?Qh:Jh}var qz=(t,e)=>{const r=!je.fun(t)||t.prototype&&t.prototype.isReactComponent;return W.forwardRef((n,i)=>{const o=W.useRef(null),a=r&&W.useCallback(g=>{o.current=o2e(i,g)},[i]),[s,c]=i2e(n,e),u=Uz(),d=()=>{const g=o.current;if(r&&!g)return;(g?e.applyAnimatedValues(g,s.getValue(!0)):!1)===!1&&u()},h=new n2e(d,c),p=W.useRef();cl(()=>(p.current=h,xt(c,g=>eu(g,h)),()=>{p.current&&(xt(p.current.deps,g=>Yh(g,p.current)),vt.cancel(p.current.update))})),W.useEffect(d,[]),Hz(()=>()=>{const g=p.current;xt(g.deps,m=>Yh(m,g))});const f=e.getComponentProps(s.getValue());return R.createElement(t,Be(ce({},f),{ref:a}))})},n2e=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&vt.write(this.update)}};function i2e(t,e){const r=new Set;return hy.dependencies=r,t.style&&(t=Be(ce({},t),{style:e.createAnimatedStyle(t.style)})),t=new py(t),hy.dependencies=null,[t,r]}function o2e(t,e){return t&&(je.fun(t)?t(e):t.current=e),e}var Gz=Symbol.for("AnimatedComponent"),a2e=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:r=i=>new py(i),getComponentProps:n=i=>i}={})=>{const i={applyAnimatedValues:e,createAnimatedStyle:r,getComponentProps:n},o=a=>{const s=Yz(a)||"Anonymous";return je.str(a)?a=o[a]||(o[a]=qz(a,i)):a=a[Gz]||(a[Gz]=qz(a,i)),a.displayName=`Animated(${s})`,a};return _o(t,(a,s)=>{je.arr(t)&&(s=Yz(a)),o[s]=o(a)}),{animated:o}},Yz=t=>je.str(t)?t:t&&je.str(t.displayName)?t.displayName:je.fun(t)&&t.name||null;function Un(t,...e){return je.fun(t)?t(...e):t}var Xh=(t,e)=>t===!0||!!(e&&t&&(je.fun(t)?t(e):An(t).includes(e))),Kz=(t,e)=>je.obj(t)?e&&t[e]:t,Jz=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,s2e=t=>t,JS=(t,e=s2e)=>{let r=l2e;t.default&&t.default!==!0&&(t=t.default,r=Object.keys(t));const n={};for(const i of r){const o=e(t[i],i);je.und(o)||(n[i]=o)}return n},l2e=["config","onProps","onStart","onChange","onPause","onResume","onRest"],c2e={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function u2e(t){const e={};let r=0;if(_o(t,(n,i)=>{c2e[i]||(e[i]=n,r++)}),r)return e}function QS(t){const e=u2e(t);if(e){const r={to:e};return _o(t,(n,i)=>i in e||(r[i]=n)),r}return ce({},t)}function Zh(t){return t=zn(t),je.arr(t)?t.map(Zh):uy(t)?Pi.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function d2e(t){for(const e in t)return!0;return!1}function XS(t){return je.fun(t)||je.arr(t)&&je.obj(t[0])}function Qz(t,e){var r;(r=t.ref)==null||r.delete(t),e==null||e.delete(t)}function h2e(t,e){var r;e&&t.ref!==e&&((r=t.ref)==null||r.delete(t),e.add(t),t.ref=e)}var p2e={default:{tension:170,friction:26}},ZS=Be(ce({},p2e.default),{mass:1,damping:1,easing:jLe.linear,clamp:!1}),f2e=class{constructor(){this.velocity=0,Object.assign(this,ZS)}};function m2e(t,e,r){r&&(r=ce({},r),Xz(r,e),e=ce(ce({},r),e)),Xz(t,e),Object.assign(t,e);for(const a in ZS)t[a]==null&&(t[a]=ZS[a]);let{frequency:n,damping:i}=t;const{mass:o}=t;return je.und(n)||(n<.01&&(n=.01),i<0&&(i=0),t.tension=Math.pow(2*Math.PI/n,2)*o,t.friction=4*Math.PI*i*o/n),t}function Xz(t,e){if(!je.und(e.decay))t.duration=void 0;else{const r=!je.und(e.tension)||!je.und(e.friction);(r||!je.und(e.frequency)||!je.und(e.damping)||!je.und(e.mass))&&(t.duration=void 0,t.decay=void 0),r&&(t.frequency=void 0)}}var Zz=[],g2e=class{constructor(){this.changed=!1,this.values=Zz,this.toValues=null,this.fromValues=Zz,this.config=new f2e,this.immediate=!1}};function eU(t,{key:e,props:r,defaultProps:n,state:i,actions:o}){return new Promise((a,s)=>{var g;let c,u,d=Xh((g=r.cancel)!=null?g:n==null?void 0:n.cancel,e);if(d)f();else{je.und(r.pause)||(i.paused=Xh(r.pause,e));let m=n==null?void 0:n.pause;m!==!0&&(m=i.paused||Xh(m,e)),c=Un(r.delay||0,e),m?(i.resumeQueue.add(p),o.pause()):(o.resume(),p())}function h(){i.resumeQueue.add(p),i.timeouts.delete(u),u.cancel(),c=u.time-vt.now()}function p(){c>0&&!Pi.skipAnimation?(i.delayed=!0,u=vt.setTimeout(f,c),i.pauseQueue.add(h),i.timeouts.add(u)):f()}function f(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(h),i.timeouts.delete(u),t<=(i.cancelId||0)&&(d=!0);try{o.start(Be(ce({},r),{callId:t,cancel:d}),a)}catch(m){s(m)}}})}var e_=(t,e)=>e.length==1?e[0]:e.some(r=>r.cancelled)?tu(t.get()):e.every(r=>r.noop)?tU(t.get()):Xi(t.get(),e.every(r=>r.finished)),tU=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Xi=(t,e,r=!1)=>({value:t,finished:e,cancelled:r}),tu=t=>({value:t,cancelled:!0,finished:!1});function rU(t,e,r,n){const{callId:i,parentId:o,onRest:a}=e,{asyncTo:s,promise:c}=r;return!o&&t===s&&!e.reset?c:r.promise=L(this,null,function*(){r.asyncId=i,r.asyncTo=t;const u=JS(e,(v,b)=>b==="onRest"?void 0:v);let d,h;const p=new Promise((v,b)=>(d=v,h=b)),f=v=>{const b=i<=(r.cancelId||0)&&tu(n)||i!==r.asyncId&&Xi(n,!1);if(b)throw v.result=b,h(v),v},g=(v,b)=>{const x=new nU,y=new iU;return L(this,null,function*(){if(Pi.skipAnimation)throw ep(r),y.result=Xi(n,!1),h(y),y;f(x);const C=je.obj(v)?ce({},v):Be(ce({},b),{to:v});C.parentId=i,_o(u,(I,_)=>{je.und(C[_])&&(C[_]=I)});const w=yield n.start(C);return f(x),r.paused&&(yield new Promise(I=>{r.resumeQueue.add(I)})),w})};let m;if(Pi.skipAnimation)return ep(r),Xi(n,!1);try{let v;je.arr(t)?v=(b=>L(this,null,function*(){for(const x of b)yield g(x)}))(t):v=Promise.resolve(t(g,n.stop.bind(n))),yield Promise.all([v.then(d),p]),m=Xi(n.get(),!0,!1)}catch(v){if(v instanceof nU)m=v.result;else if(v instanceof iU)m=v.result;else throw v}finally{i==r.asyncId&&(r.asyncId=o,r.asyncTo=o?s:void 0,r.promise=o?c:void 0)}return je.fun(a)&&vt.batchedUpdates(()=>{a(m,n,n.item)}),m})}function ep(t,e){Uh(t.timeouts,r=>r.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var nU=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},iU=class extends Error{constructor(){super("SkipAnimationSignal")}},t_=t=>t instanceof r_,v2e=1,r_=class extends Lz{constructor(){super(...arguments),this.id=v2e++,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=To(this);return t&&t.getValue()}to(...t){return Pi.to(this,t)}interpolate(...t){return GLe(),Pi.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){Gh(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||iy.sort(this),Gh(this,{type:"priority",parent:this,priority:t})}},ul=Symbol.for("SpringPhase"),oU=1,aU=2,sU=4,n_=t=>(t[ul]&oU)>0,ls=t=>(t[ul]&aU)>0,tp=t=>(t[ul]&sU)>0,lU=(t,e)=>e?t[ul]|=aU|oU:t[ul]&=-3,cU=(t,e)=>e?t[ul]|=sU:t[ul]&=-5,y2e=class extends r_{constructor(t,e){if(super(),this.animation=new g2e,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!je.und(t)||!je.und(e)){const r=je.obj(t)?ce({},t):Be(ce({},e),{from:t});je.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(ls(this)||this._state.asyncTo)||tp(this)}get goal(){return zn(this.animation.to)}get velocity(){const t=To(this);return t instanceof Jh?t.lastVelocity||0:t.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return n_(this)}get isAnimating(){return ls(this)}get isPaused(){return tp(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,r=!1;const n=this.animation;let{toValues:i}=n;const{config:o}=n,a=dy(n.to);!a&&Oi(n.to)&&(i=An(zn(n.to))),n.values.forEach((u,d)=>{if(u.done)return;const h=u.constructor==Qh?1:a?a[d].lastPosition:i[d];let p=n.immediate,f=h;if(!p){if(f=u.lastPosition,o.tension<=0){u.done=!0;return}let g=u.elapsedTime+=t;const m=n.fromValues[d],v=u.v0!=null?u.v0:u.v0=je.arr(o.velocity)?o.velocity[d]:o.velocity;let b;const x=o.precision||(m==h?.005:Math.min(1,Math.abs(h-m)*.001));if(je.und(o.duration))if(o.decay){const y=o.decay===!0?.998:o.decay,C=Math.exp(-(1-y)*g);f=m+v/(1-y)*(1-C),p=Math.abs(u.lastPosition-f)<=x,b=v*C}else{b=u.lastVelocity==null?v:u.lastVelocity;const y=o.restVelocity||x/10,C=o.clamp?0:o.bounce,w=!je.und(C),I=m==h?u.v0>0:m<h;let _,T=!1;const O=1,P=Math.ceil(t/O);for(let k=0;k<P&&(_=Math.abs(b)>y,!(!_&&(p=Math.abs(h-f)<=x,p)));++k){w&&(T=f==h||f>h==I,T&&(b=-b*C,f=h));const S=-o.tension*1e-6*(f-h),M=-o.friction*.001*b,$=(S+M)/o.mass;b=b+$*O,f=f+b*O}}else{let y=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,u.durationProgress>0&&(u.elapsedTime=o.duration*u.durationProgress,g=u.elapsedTime+=t)),y=(o.progress||0)+g/this._memoizedDuration,y=y>1?1:y<0?0:y,u.durationProgress=y),f=m+o.easing(y)*(h-m),b=(f-u.lastPosition)/t,p=y==1}u.lastVelocity=b,Number.isNaN(f)&&(console.warn("Got NaN while animating:",this),p=!0)}a&&!a[d].done&&(p=!1),p?u.done=!0:e=!1,u.setValue(f,o.round)&&(r=!0)});const s=To(this),c=s.getValue();if(e){const u=zn(n.to);(c!==u||r)&&!o.decay?(s.setValue(u),this._onChange(u)):r&&o.decay&&this._onChange(c),this._stop()}else r&&this._onChange(c)}set(t){return vt.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ls(this)){const{to:t,config:e}=this.animation;vt.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let r;return je.und(t)?(r=this.queue||[],this.queue=[]):r=[je.obj(t)?t:Be(ce({},e),{to:t})],Promise.all(r.map(n=>this._update(n))).then(n=>e_(this,n))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),ep(this._state,t&&this._lastCallId),vt.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:r,from:n}=t;r=je.obj(r)?r[e]:r,(r==null||XS(r))&&(r=void 0),n=je.obj(n)?n[e]:n,n==null&&(n=void 0);const i={to:r,from:n};return n_(this)||(t.reverse&&([r,n]=[n,r]),n=zn(n),je.und(n)?To(this)||this._set(r):this._set(n)),i}_update(r,e){var t=Yt(r,[]);const{key:n,defaultProps:i}=this;t.default&&Object.assign(i,JS(t,(s,c)=>/^on/.test(c)?Kz(s,n):s)),hU(this,t,"onProps"),np(this,"onProps",t,this);const o=this._prepareNode(t);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const a=this._state;return eU(++this._lastCallId,{key:n,props:t,defaultProps:i,state:a,actions:{pause:()=>{tp(this)||(cU(this,!0),Hh(a.pauseQueue),np(this,"onPause",Xi(this,rp(this,this.animation.to)),this))},resume:()=>{tp(this)&&(cU(this,!1),ls(this)&&this._resume(),Hh(a.resumeQueue),np(this,"onResume",Xi(this,rp(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(s=>{if(t.loop&&s.finished&&!(e&&s.noop)){const c=uU(t);if(c)return this._update(c,!0)}return s})}_merge(t,e,r){if(e.cancel)return this.stop(!0),r(tu(this));const n=!je.und(t.to),i=!je.und(t.from);if(n||i)if(e.callId>this._lastToId)this._lastToId=e.callId;else return r(tu(this));const{key:o,defaultProps:a,animation:s}=this,{to:c,from:u}=s;let{to:d=c,from:h=u}=t;i&&!n&&(!e.default||je.und(d))&&(d=h),e.reverse&&([d,h]=[h,d]);const p=!fa(h,u);p&&(s.from=h),h=zn(h);const f=!fa(d,c);f&&this._focus(d);const g=XS(e.to),{config:m}=s,{decay:v,velocity:b}=m;(n||i)&&(m.velocity=0),e.config&&!g&&m2e(m,Un(e.config,o),e.config!==a.config?Un(a.config,o):void 0);let x=To(this);if(!x||je.und(d))return r(Xi(this,!0));const y=je.und(e.reset)?i&&!e.default:!je.und(h)&&Xh(e.reset,o),C=y?h:this.get(),w=Zh(d),I=je.num(w)||je.arr(w)||uy(w),_=!g&&(!I||Xh(a.immediate||e.immediate,o));if(f){const k=KS(d);if(k!==x.constructor)if(_)x=this._set(w);else throw Error(`Cannot animate between ${x.constructor.name} and ${k.name}, as the "to" prop suggests`)}const T=x.constructor;let O=Oi(d),P=!1;if(!O){const k=y||!n_(this)&&p;(f||k)&&(P=fa(Zh(C),w),O=!P),(!fa(s.immediate,_)&&!_||!fa(m.decay,v)||!fa(m.velocity,b))&&(O=!0)}if(P&&ls(this)&&(s.changed&&!y?O=!0:O||this._stop(c)),!g&&((O||Oi(c))&&(s.values=x.getPayload(),s.toValues=Oi(d)?null:T==Qh?[1]:An(w)),s.immediate!=_&&(s.immediate=_,!_&&!y&&this._set(c)),O)){const{onRest:k}=s;xt(b2e,M=>hU(this,e,M));const S=Xi(this,rp(this,c));Hh(this._pendingCalls,S),this._pendingCalls.add(r),s.changed&&vt.batchedUpdates(()=>{var M;s.changed=!y,k==null||k(S,this),y?Un(a.onRest,S):(M=s.onStart)==null||M.call(s,S,this)})}y&&this._set(C),g?r(rU(e.to,e,this._state,this)):O?this._start():ls(this)&&!f?this._pendingCalls.add(r):r(tU(C))}_focus(t){const e=this.animation;t!==e.to&&($z(this)&&this._detach(),e.to=t,$z(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;Oi(e)&&(eu(e,this),t_(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;Oi(t)&&Yh(t,this)}_set(t,e=!0){const r=zn(t);if(!je.und(r)){const n=To(this);if(!n||!fa(r,n.getValue())){const i=KS(r);!n||n.constructor!=i?YS(this,i.create(r)):n.setValue(r),n&&vt.batchedUpdates(()=>{this._onChange(r,e)})}}return To(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,np(this,"onStart",Xi(this,rp(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),Un(this.animation.onChange,t,this)),Un(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;To(this).reset(zn(t.to)),t.immediate||(t.fromValues=t.values.map(e=>e.lastPosition)),ls(this)||(lU(this,!0),tp(this)||this._resume())}_resume(){Pi.skipAnimation?this.finish():iy.start(this)}_stop(t,e){if(ls(this)){lU(this,!1);const r=this.animation;xt(r.values,i=>{i.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),Gh(this,{type:"idle",parent:this});const n=e?tu(this.get()):Xi(this.get(),rp(this,t!=null?t:r.to));Hh(this._pendingCalls,n),r.changed&&(r.changed=!1,np(this,"onRest",n,this))}}};function rp(t,e){const r=Zh(e),n=Zh(t.get());return fa(n,r)}function uU(t,e=t.loop,r=t.to){const n=Un(e);if(n){const i=n!==!0&&QS(n),o=(i||t).reverse,a=!i||i.reset;return fy(ce(Be(ce({},t),{loop:e,default:!1,pause:void 0,to:!o||XS(r)?r:void 0,from:a?t.from:void 0,reset:a}),i))}}function fy(t){const{to:e,from:r}=t=QS(t),n=new Set;return je.obj(e)&&dU(e,n),je.obj(r)&&dU(r,n),t.keys=n.size?Array.from(n):null,t}function dU(t,e){_o(t,(r,n)=>r!=null&&e.add(n))}var b2e=["onStart","onRest","onChange","onPause","onResume"];function hU(t,e,r){t.animation[r]=e[r]!==Jz(e,r)?Kz(e[r],t.key):void 0}function np(t,e,...r){var n,i,o,a;(i=(n=t.animation)[e])==null||i.call(n,...r),(a=(o=t.defaultProps)[e])==null||a.call(o,...r)}var x2e=["onStart","onChange","onRest"],w2e=1,C2e=class{constructor(t,e){this.id=w2e++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(ce({default:!0},t))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,r)=>t[r]=e.get()),t}set(t){for(const e in t){const r=t[e];je.und(r)||this.springs[e].set(r)}}update(t){return t&&this.queue.push(fy(t)),this}start(t){let{queue:e}=this;return t?e=An(t).map(fy):this.queue=[],this._flush?this._flush(this,e):(gU(this,e),I2e(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const r=this.springs;xt(An(e),n=>r[n].stop(!!t))}else ep(this._state,this._lastAsyncId),this.each(r=>r.stop(!!t));return this}pause(t){if(je.und(t))this.start({pause:!0});else{const e=this.springs;xt(An(t),r=>e[r].pause())}return this}resume(t){if(je.und(t))this.start({pause:!1});else{const e=this.springs;xt(An(t),r=>e[r].resume())}return this}each(t){_o(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,Uh(t,([s,c])=>{c.value=this.get(),s(c,this,this._item)}));const o=!n&&this._started,a=i||o&&r.size?this.get():null;i&&e.size&&Uh(e,([s,c])=>{c.value=a,s(c,this,this._item)}),o&&(this._started=!1,Uh(r,([s,c])=>{c.value=a,s(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;vt.onFrame(this._onFrame)}};function I2e(t,e){return Promise.all(e.map(r=>pU(t,r))).then(r=>e_(t,r))}function pU(t,e,r){return L(this,null,function*(){const{keys:n,to:i,from:o,loop:a,onRest:s,onResolve:c}=e,u=je.obj(e.default)&&e.default;a&&(e.loop=!1),i===!1&&(e.to=null),o===!1&&(e.from=null);const d=je.arr(i)||je.fun(i)?i:void 0;d?(e.to=void 0,e.onRest=void 0,u&&(u.onRest=void 0)):xt(x2e,m=>{const v=e[m];if(je.fun(v)){const b=t._events[m];e[m]=({finished:x,cancelled:y})=>{const C=b.get(v);C?(x||(C.finished=!1),y&&(C.cancelled=!0)):b.set(v,{value:null,finished:x||!1,cancelled:y||!1})},u&&(u[m]=e[m])}});const h=t._state;e.pause===!h.paused?(h.paused=e.pause,Hh(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const p=(n||Object.keys(t.springs)).map(m=>t.springs[m].start(e)),f=e.cancel===!0||Jz(e,"cancel")===!0;(d||f&&h.asyncId)&&p.push(eU(++t._lastAsyncId,{props:e,state:h,actions:{pause:jS,resume:jS,start(m,v){f?(ep(h,t._lastAsyncId),v(tu(t))):(m.onRest=s,v(rU(d,m,h,t)))}}})),h.paused&&(yield new Promise(m=>{h.resumeQueue.add(m)}));const g=e_(t,yield Promise.all(p));if(a&&g.finished&&!(r&&g.noop)){const m=uU(e,a,i);if(m)return gU(t,[m]),pU(t,m,!0)}return c&&vt.batchedUpdates(()=>c(g,t,t.item)),g})}function S2e(t,e){const r=ce({},t.springs);return e&&xt(An(e),n=>{je.und(n.keys)&&(n=fy(n)),je.obj(n.to)||(n=Be(ce({},n),{to:void 0})),mU(r,n,i=>fU(i))}),_2e(t,r),r}function _2e(t,e){_o(e,(r,n)=>{t.springs[n]||(t.springs[n]=r,eu(r,t))})}function fU(t,e){const r=new y2e;return r.key=t,e&&eu(r,e),r}function mU(t,e,r){e.keys&&xt(e.keys,n=>{(t[n]||(t[n]=r(n)))._prepareNode(e)})}function gU(t,e){xt(e,r=>{mU(t.springs,r,n=>fU(n,t))})}var my=r=>{var n=r,{children:t}=n,e=Yt(n,["children"]);const i=W.useContext(gy),o=e.pause||!!i.pause,a=e.immediate||!!i.immediate;e=QLe(()=>({pause:o,immediate:a}),[o,a]);const{Provider:s}=gy;return R.createElement(s,{value:e},t)},gy=T2e(my,{});my.Provider=gy.Provider,my.Consumer=gy.Consumer;function T2e(t,e){return Object.assign(t,R.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var k2e=()=>{const t=[],e=function(n){KLe();const i=[];return xt(t,(o,a)=>{if(je.und(n))i.push(o.start());else{const s=r(n,o,a);s&&i.push(o.start(s))}}),i};e.current=t,e.add=function(n){t.includes(n)||t.push(n)},e.delete=function(n){const i=t.indexOf(n);~i&&t.splice(i,1)},e.pause=function(){return xt(t,n=>n.pause(...arguments)),this},e.resume=function(){return xt(t,n=>n.resume(...arguments)),this},e.set=function(n){xt(t,(i,o)=>{const a=je.fun(n)?n(o,i):n;a&&i.set(a)})},e.start=function(n){const i=[];return xt(t,(o,a)=>{if(je.und(n))i.push(o.start());else{const s=this._getProps(n,o,a);s&&i.push(o.start(s))}}),i},e.stop=function(){return xt(t,n=>n.stop(...arguments)),this},e.update=function(n){return xt(t,(i,o)=>i.update(this._getProps(n,i,o))),this};const r=function(n,i,o){return je.fun(n)?n(o,i):n};return e._getProps=r,e};function i_(t,e,r){const n=je.fun(e)&&e,{reset:i,sort:o,trail:a=0,expires:s=!0,exitBeforeEnter:c=!1,onDestroyed:u,ref:d,config:h}=n?n():e,p=W.useMemo(()=>n||arguments.length==3?k2e():void 0,[]),f=An(t),g=[],m=W.useRef(null),v=i?null:m.current;cl(()=>{m.current=g}),Hz(()=>(xt(g,$=>{p==null||p.add($.ctrl),$.ctrl.ref=p}),()=>{xt(m.current,$=>{$.expired&&clearTimeout($.expirationId),Qz($.ctrl,p),$.ctrl.stop(!0)})}));const b=P2e(f,n?n():e,v),x=i&&m.current||[];cl(()=>xt(x,({ctrl:$,item:D,key:N})=>{Qz($,p),Un(u,D,N)}));const y=[];if(v&&xt(v,($,D)=>{$.expired?(clearTimeout($.expirationId),x.push($)):(D=y[D]=b.indexOf($.key),~D&&(g[D]=$))}),xt(f,($,D)=>{g[D]||(g[D]={key:b[D],item:$,phase:"mount",ctrl:new C2e},g[D].ctrl.item=$)}),y.length){let $=-1;const{leave:D}=n?n():e;xt(y,(N,z)=>{const U=v[z];~N?($=g.indexOf(U),g[$]=Be(ce({},U),{item:f[N]})):D&&g.splice(++$,0,U)})}je.fun(o)&&g.sort(($,D)=>o($.item,D.item));let C=-a;const w=Uz(),I=JS(e),_=new Map,T=W.useRef(new Map),O=W.useRef(!1);xt(g,($,D)=>{const N=$.key,z=$.phase,U=n?n():e;let V,q;const F=Un(U.delay||0,N);if(z=="mount")V=U.enter,q="enter";else{const Z=b.indexOf(N)<0;if(z!="leave")if(Z)V=U.leave,q="leave";else if(V=U.update)q="update";else return;else if(!Z)V=U.enter,q="enter";else return}if(V=Un(V,$.item,D),V=je.obj(V)?QS(V):{to:V},!V.config){const Z=h||I.config;V.config=Un(Z,$.item,D,q)}C+=a;const B=ce(Be(ce({},I),{delay:F+C,ref:d,immediate:U.immediate,reset:!1}),V);if(q=="enter"&&je.und(B.from)){const Z=n?n():e,Y=je.und(Z.initial)||v?Z.from:Z.initial;B.from=Un(Y,$.item,D)}const{onResolve:H}=B;B.onResolve=Z=>{Un(H,Z);const Y=m.current,Q=Y.find(K=>K.key===N);if(Q&&!(Z.cancelled&&Q.phase!="update")&&Q.ctrl.idle){const K=Y.every(X=>X.ctrl.idle);if(Q.phase=="leave"){const X=Un(s,Q.item);if(X!==!1){const ee=X===!0?0:X;if(Q.expired=!0,!K&&ee>0){ee<=2147483647&&(Q.expirationId=setTimeout(w,ee));return}}}K&&Y.some(X=>X.expired)&&(T.current.delete(Q),c&&(O.current=!0),w())}};const G=S2e($.ctrl,B);q==="leave"&&c?T.current.set($,{phase:q,springs:G,payload:B}):_.set($,{phase:q,springs:G,payload:B})});const P=W.useContext(my),k=e2e(P),S=P!==k&&d2e(P);cl(()=>{S&&xt(g,$=>{$.ctrl.start({default:P})})},[P]),xt(_,($,D)=>{if(T.current.size){const N=g.findIndex(z=>z.key===D.key);g.splice(N,1)}}),cl(()=>{xt(T.current.size?T.current:_,({phase:$,payload:D},N)=>{const{ctrl:z}=N;N.phase=$,p==null||p.add(z),S&&$=="enter"&&z.start({default:P}),D&&(h2e(z,D.ref),(z.ref||p)&&!O.current?z.update(D):(z.start(D),O.current&&(O.current=!1)))})},i?void 0:r);const M=$=>R.createElement(R.Fragment,null,g.map((D,N)=>{const{springs:z}=_.get(D)||D.ctrl,U=$(ce({},z),D.item,D,N);return U&&U.type?R.createElement(U.type,Be(ce({},U.props),{key:je.str(D.key)||je.num(D.key)?D.key:D.ctrl.id,ref:U.ref})):U}));return p?[M,p]:M}var A2e=1;function P2e(t,{key:e,keys:r=e},n){if(r===null){const i=new Set;return t.map(o=>{const a=n&&n.find(s=>s.item===o&&s.phase!=="leave"&&!i.has(s));return a?(i.add(a),a.key):A2e++})}return je.und(r)?t:je.fun(r)?t.map(r):An(r)}var E2e=class extends r_{constructor(t,e){super(),this.source=t,this.idle=!0,this._active=new Set,this.calc=Wh(...e);const r=this._get(),n=KS(r);YS(this,n.create(r))}advance(t){const e=this._get(),r=this.get();fa(e,r)||(To(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&vU(this._active)&&o_(this)}_get(){const t=je.arr(this.source)?this.source.map(zn):An(zn(this.source));return this.calc(...t)}_start(){this.idle&&!vU(this._active)&&(this.idle=!1,xt(dy(this),t=>{t.done=!1}),Pi.skipAnimation?(vt.batchedUpdates(()=>this.advance()),o_(this)):iy.start(this))}_attach(){let t=1;xt(An(this.source),e=>{Oi(e)&&eu(e,this),t_(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){xt(An(this.source),t=>{Oi(t)&&Yh(t,this)}),this._active.clear(),o_(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=An(this.source).reduce((e,r)=>Math.max(e,(t_(r)?r.priority:0)+1),0))}};function O2e(t){return t.idle!==!1}function vU(t){return!t.size||Array.from(t).every(O2e)}function o_(t){t.idle||(t.idle=!0,xt(dy(t),e=>{e.done=!0}),Gh(t,{type:"idle",parent:t}))}Pi.assign({createStringInterpolator:Bz,to:(t,e)=>new E2e(t,e)});var yU=/^--/;function R2e(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!yU.test(t)&&!(ip.hasOwnProperty(t)&&ip[t])?e+"px":(""+e).trim()}var bU={};function M2e(t,e){if(!t.nodeType||!t.setAttribute)return!1;const r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",p=e,{className:n,style:i,children:o,scrollTop:a,scrollLeft:s,viewBox:c}=p,u=Yt(p,["className","style","children","scrollTop","scrollLeft","viewBox"]),d=Object.values(u),h=Object.keys(u).map(f=>r||t.hasAttribute(f)?f:bU[f]||(bU[f]=f.replace(/([A-Z])/g,g=>"-"+g.toLowerCase())));o!==void 0&&(t.textContent=o);for(const f in i)if(i.hasOwnProperty(f)){const g=R2e(f,i[f]);yU.test(f)?t.style.setProperty(f,g):t.style[f]=g}h.forEach((f,g)=>{t.setAttribute(f,d[g])}),n!==void 0&&(t.className=n),a!==void 0&&(t.scrollTop=a),s!==void 0&&(t.scrollLeft=s),c!==void 0&&t.setAttribute("viewBox",c)}var ip={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},D2e=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),$2e=["Webkit","Ms","Moz","O"];ip=Object.keys(ip).reduce((t,e)=>($2e.forEach(r=>t[D2e(r,e)]=t[e]),t),ip);var L2e=/^(matrix|translate|scale|rotate|skew)/,F2e=/^(translate)/,N2e=/^(rotate|skew)/,a_=(t,e)=>je.num(t)&&t!==0?t+e:t,vy=(t,e)=>je.arr(t)?t.every(r=>vy(r,e)):je.num(t)?t===e:parseFloat(t)===e,j2e=class extends py{constructor(i){var o=i,{x:t,y:e,z:r}=o,n=Yt(o,["x","y","z"]);const a=[],s=[];(t||e||r)&&(a.push([t||0,e||0,r||0]),s.push(c=>[`translate3d(${c.map(u=>a_(u,"px")).join(",")})`,vy(c,0)])),_o(n,(c,u)=>{if(u==="transform")a.push([c||""]),s.push(d=>[d,d===""]);else if(L2e.test(u)){if(delete n[u],je.und(c))return;const d=F2e.test(u)?"px":N2e.test(u)?"deg":"";a.push(An(c)),s.push(u==="rotate3d"?([h,p,f,g])=>[`rotate3d(${h},${p},${f},${a_(g,d)})`,vy(g,0)]:h=>[`${u}(${h.map(p=>a_(p,d)).join(",")})`,vy(h,u.startsWith("scale")?1:0)])}}),a.length&&(n.transform=new B2e(a,s)),super(n)}},B2e=class extends Lz{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return xt(this.inputs,(r,n)=>{const i=zn(r[0]),[o,a]=this.transforms[n](je.arr(i)?i:r.map(zn));t+=" "+o,e=e&&a}),e?"none":t}observerAdded(t){t==1&&xt(this.inputs,e=>xt(e,r=>Oi(r)&&eu(r,this)))}observerRemoved(t){t==0&&xt(this.inputs,e=>xt(e,r=>Oi(r)&&Yh(r,this)))}eventObserved(t){t.type=="change"&&(this._value=null),Gh(this,t)}},z2e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Pi.assign({batchedUpdates:jt.unstable_batchedUpdates,createStringInterpolator:Bz,colors:kLe});var U2e=a2e(z2e,{applyAnimatedValues:M2e,createAnimatedStyle:t=>new j2e(t),getComponentProps:n=>{var i=n,{scrollTop:t,scrollLeft:e}=i,r=Yt(i,["scrollTop","scrollLeft"]);return r}}),s_=U2e.animated;const H2e=t=>{const{dispatch:e}=R.useContext(Jc),{setHighlighted:r,clearHighlighted:n}=qB();return o=>({onPointerEnter:()=>{e({type:"enterItem",data:o}),r({seriesId:o.seriesId,dataIndex:o.dataIndex})},onPointerLeave:u=>{u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.releasePointerCapture(u.pointerId),e({type:"leaveItem",data:o}),n()},onPointerDown:u=>{u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.releasePointerCapture(u.pointerId)}})},V2e=["id","dataIndex","classes","color","slots","slotProps","style","onClick"];function W2e(t){return Bi("MuiBarElement",t)}ho("MuiBarElement",["root"]);const q2e=t=>{const{classes:e,id:r}=t,n={root:["root",`series-${r}`]};return ji(n,W2e,e)},G2e=Cr(s_.rect,{name:"MuiBarElement",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>({stroke:"none",fill:t.isHighlighted?Wc(t.color).brighter(.5).formatHex():t.color,transition:"opacity 0.2s ease-in, fill 0.2s ease-in",opacity:t.isFaded&&.3||1}));function Y2e(t){var b;const{id:e,dataIndex:r,classes:n,color:i,slots:o,slotProps:a,style:s,onClick:c}=t,u=Fe(t,V2e),d=H2e(),{isFaded:h,isHighlighted:p}=GB({seriesId:e,dataIndex:r}),f={id:e,dataIndex:r,classes:n,color:i,isFaded:h,isHighlighted:p},g=q2e(f),m=(b=o==null?void 0:o.bar)!=null?b:G2e,v=fi({elementType:m,externalSlotProps:a==null?void 0:a.bar,externalForwardedProps:u,additionalProps:j({},d({type:"bar",seriesId:e,dataIndex:r}),{style:s,onClick:c,cursor:c?"pointer":"unset"}),className:g.root,ownerState:f});return E.jsx(m,j({},v))}const yy=(t,{hasNegative:e,hasPositive:r,borderRadius:n,layout:i})=>{if(!n)return 0;const o=i==="vertical";return t==="top-left"&&(o&&r||!o&&e)||t==="top-right"&&(o&&r||!o&&r)||t==="bottom-right"&&(o&&e||!o&&r)||t==="bottom-left"&&(o&&e||!o&&e)?n:0},K2e=["style","maskId"],J2e=t=>`inset(0px round ${t.topLeft}px ${t.topRight}px ${t.bottomRight}px ${t.bottomLeft}px)`;function Q2e(t){var r,n;const e=t.ownerState;return E.jsx(s_.rect,{style:j({},t.style,{clipPath:(t.ownerState.layout==="vertical"?(r=t.style)==null?void 0:r.height:(n=t.style)==null?void 0:n.width).to(i=>J2e({topLeft:Math.min(i,yy("top-left",e)),topRight:Math.min(i,yy("top-right",e)),bottomRight:Math.min(i,yy("bottom-right",e)),bottomLeft:Math.min(i,yy("bottom-left",e))}))})})}function X2e(t){const{style:e,maskId:r}=t,n=Fe(t,K2e);return!t.borderRadius||t.borderRadius<=0?null:E.jsx("clipPath",{id:r,children:E.jsx(Q2e,{ownerState:n,style:e})})}function Z2e(t){return Bi("MuiBarLabel",t)}const l_=ho("MuiBarLabel",["root","highlighted","faded"]),eFe=t=>{const{classes:e,seriesId:r,isFaded:n,isHighlighted:i}=t,o={root:["root",`series-${r}`,i&&"highlighted",n&&"faded"]};return ji(o,Z2e,e)},tFe=t=>{const{barLabel:e,value:r,dataIndex:n,seriesId:i,height:o,width:a}=t;return e==="value"?r?r==null?void 0:r.toString():null:e({seriesId:i,dataIndex:n,value:r},{bar:{height:o,width:a}})},rFe=["seriesId","dataIndex","color","isFaded","isHighlighted","classes"],nFe=Cr(s_.text,{name:"MuiBarLabel",slot:"Root",overridesResolver:(t,e)=>[{[`&.${l_.faded}`]:e.faded},{[`&.${l_.highlighted}`]:e.highlighted},e.root]})(({theme:t})=>{var e,r,n,i;return j({},(e=t==null?void 0:t.typography)==null?void 0:e.body2,{stroke:"none",fill:(i=(n=(r=t.vars||t)==null?void 0:r.palette)==null?void 0:n.text)==null?void 0:i.primary,transition:"opacity 0.2s ease-in, fill 0.2s ease-in",textAnchor:"middle",dominantBaseline:"central",pointerEvents:"none",opacity:1,[`&.${l_.faded}`]:{opacity:.3}})});function iFe(t){const e=rs({props:t,name:"MuiBarLabel"}),r=Fe(e,rFe);return E.jsx(nFe,j({},r))}const oFe=["seriesId","classes","color","style","dataIndex","barLabel","slots","slotProps","height","width","value"],aFe=["ownerState"];function sFe(t){var I;const{seriesId:e,classes:r,color:n,style:i,dataIndex:o,barLabel:a,slots:s,slotProps:c,height:u,width:d,value:h}=t,p=Fe(t,oFe),{isFaded:f,isHighlighted:g}=GB({seriesId:e,dataIndex:o}),m={seriesId:e,classes:r,color:n,isFaded:f,isHighlighted:g,dataIndex:o},v=eFe(m),b=(I=s==null?void 0:s.barLabel)!=null?I:iFe,x=fi({elementType:b,externalSlotProps:c==null?void 0:c.barLabel,additionalProps:j({},p,{style:i,className:v.root}),ownerState:m}),{ownerState:y}=x,C=Fe(x,aFe);if(!a)return null;const w=tFe({barLabel:a,value:h,dataIndex:o,seriesId:e,height:u,width:d});return w?E.jsx(b,j({},C,y,{children:w})):null}const lFe=["bars","skipAnimation"],cFe=({layout:t,yOrigin:e,x:r,width:n,y:i,xOrigin:o,height:a})=>j({},t==="vertical"?{y:e,x:r+n/2,height:0,width:n}:{y:i+a/2,x:o,height:a,width:0}),xU=({x:t,width:e,y:r,height:n})=>({x:t+e/2,y:r+n/2,height:n,width:e});function uFe(t){const{bars:e,skipAnimation:r}=t,n=Fe(t,lFe),i=i_(e,{keys:o=>`${o.seriesId}-${o.dataIndex}`,from:cFe,leave:null,enter:xU,update:xU,immediate:r});return E.jsx(R.Fragment,{children:i((o,{seriesId:a,dataIndex:s,color:c,value:u,width:d,height:h})=>E.jsx(sFe,j({seriesId:a,dataIndex:s,value:u,color:c,width:d,height:h},n,{style:o})))})}const c_=(t,e)=>{const r=`${t}-axis`,n=`${t}Axis`;return e===(t==="x"?B1:z1)?`The first \`${n}\``:`The ${r} with id "${e}"`};function dFe(t,e,r,n,i,o){const a=n[r],s=o[i],c=t?a:s,u=t?s:a,d=t?r:i,h=t?i:r,p=t?"x":"y",f=t?"y":"x";if(!CS(c))throw new Error(`MUI X: ${c_(p,d)} should be of type "band" to display the bar series of id "${e}".`);if(c.data===void 0)throw new Error(`MUI X: ${c_(p,d)} should have data property.`);if(CS(u)||X5(u))throw new Error(`MUI X: ${c_(f,h)} should be a continuous type to display the bar series of id "${e}".`)}const wU=R.createContext({isInitialized:!1,data:{skipAnimation:void 0}});function hFe(t){const{children:e,skipAnimation:r}=t,n=typeof window=="undefined"||!(window!=null&&window.matchMedia),[i,o]=R.useState(n||void 0);cl(()=>{var u;if(n)return;const s=d=>{const h=d.matches||void 0;o(h),Pi.assign({skipAnimation:h})},c=window.matchMedia("(prefers-reduced-motion)");return s(c),(u=c==null?void 0:c.addEventListener)==null||u.call(c,"change",s),()=>{var d;(d=c==null?void 0:c.removeEventListener)==null||d.call(c,"change",s)}},[]);const a=R.useMemo(()=>({isInitialized:!0,data:{skipAnimation:r||i}}),[i,r]);return E.jsx(wU.Provider,{value:a,children:e})}function pFe(t){const{isInitialized:e,data:r}=R.useContext(wU);if(!e)throw new Error(["MUI X: Could not find the animation ref context.","It looks like you rendered your component outside of a ChartsContainer parent component."].join(`
|
|
3655
|
-
`));return t||r.skipAnimation}const fFe=["skipAnimation","onItemClick","borderRadius","barLabel"];function mFe({bandWidth:t,numberOfGroups:e,gapRatio:r}){if(r===0)return{barWidth:t/e,offset:0};const n=t/(e+(e-1)*r),i=r*n;return{barWidth:n,offset:i}}const gFe=()=>{var f;const t=(f=rRe())!=null?f:{series:{},stackingGroups:[]},e=Ji(),r=$De(),{series:n,stackingGroups:i}=t,{xAxis:o,yAxis:a,xAxisIds:s,yAxisIds:c}=e,u=s[0],d=c[0],h={};return{completedData:i.flatMap(({ids:g},m)=>g.flatMap(v=>{var D,N,z,U;const b=(N=(D=n[v].xAxisId)!=null?D:n[v].xAxisKey)!=null?N:u,x=(U=(z=n[v].yAxisId)!=null?z:n[v].yAxisKey)!=null?U:d,y=o[b],C=a[x],w=n[v].layout==="vertical";dFe(w,v,b,o,x,a);const I=w?y:C,_=y.scale,T=C.scale,O=VB(n[v],o[b],a[x]),P=I.scale.bandwidth(),{barWidth:k,offset:S}=mFe({bandWidth:P,numberOfGroups:i.length,gapRatio:I.barGapRatio}),M=m*(k+S),{stackedData:$}=n[v];return $.map((V,q)=>{var Q,K,X,ee;const F=V.map(ae=>w?T(ae):_(ae)),B=Math.round(Math.min(...F)),H=Math.round(Math.max(...F)),G=n[v].stack,Z={seriesId:v,dataIndex:q,layout:n[v].layout,x:w?_((Q=o[b].data)==null?void 0:Q[q])+M:B,y:w?B:T((K=a[x].data)==null?void 0:K[q])+M,xOrigin:_(0),yOrigin:T(0),height:w?H-B:k,width:w?k:H-B,color:O(q),value:n[v].data[q],maskId:`${r}_${G||v}_${m}_${q}`};h[Z.maskId]||(h[Z.maskId]={id:Z.maskId,width:0,height:0,hasNegative:!1,hasPositive:!1,layout:Z.layout,xOrigin:_(0),yOrigin:T(0),x:0,y:0});const Y=h[Z.maskId];return Y.width=Z.layout==="vertical"?Z.width:Y.width+Z.width,Y.height=Z.layout==="vertical"?Y.height+Z.height:Z.height,Y.x=Math.min(Y.x===0?1/0:Y.x,Z.x),Y.y=Math.min(Y.y===0?1/0:Y.y,Z.y),Y.hasNegative=Y.hasNegative||((X=Z.value)!=null?X:0)<0,Y.hasPositive=Y.hasPositive||((ee=Z.value)!=null?ee:0)>0,Z})})),masksData:Object.values(h)}},by=({layout:t,yOrigin:e,x:r,width:n,y:i,xOrigin:o,height:a})=>j({},t==="vertical"?{y:e,x:r,height:0,width:n}:{y:i,x:o,height:a,width:0}),xy=({x:t,width:e,y:r,height:n})=>({y:r,x:t,height:n,width:e});function vFe(t){const{completedData:e,masksData:r}=gFe(),{skipAnimation:n,onItemClick:i,borderRadius:o,barLabel:a}=t,s=Fe(t,fFe),c=pFe(n),u=!o||o<=0,d=i_(e,{keys:p=>`${p.seriesId}-${p.dataIndex}`,from:by,leave:by,enter:xy,update:xy,immediate:c}),h=i_(u?[]:r,{keys:p=>p.id,from:by,leave:by,enter:xy,update:xy,immediate:c});return E.jsxs(R.Fragment,{children:[!u&&h((p,{id:f,hasPositive:g,hasNegative:m,layout:v})=>E.jsx(X2e,{maskId:f,borderRadius:o,hasNegative:m,hasPositive:g,layout:v,style:p})),d((p,{seriesId:f,dataIndex:g,color:m,maskId:v})=>{const b=E.jsx(Y2e,j({id:f,dataIndex:g,color:m},s,{onClick:i&&(x=>{i(x,{type:"bar",seriesId:f,dataIndex:g})}),style:p}));return u?b:E.jsx("g",{clipPath:`url(#${v})`,children:b})}),a&&E.jsx(uFe,j({bars:e,skipAnimation:c,barLabel:a},s))]})}function ru(t){return t instanceof Date?t.getTime():t}const yFe=t=>{const e=TS(),r=Ki(),{xAxis:n,yAxis:i,xAxisIds:o,yAxisIds:a}=Ji(),{dispatch:s}=R.useContext(Jc),c=o[0],u=a[0],d=R.useRef({isInChart:!1,x:-1,y:-1});R.useEffect(()=>{const h=e.current;if(h===null||t)return()=>{};function p(v,b){const{scale:x,data:y,reverse:C}=v;if(!al(x)){const I=x.invert(b);if(y===void 0)return{value:I,index:-1};const _=ru(I),T=y==null?void 0:y.findIndex((O,P)=>{const k=ru(O);return k>_&&(P===0||Math.abs(_-k)<=Math.abs(_-ru(y[P-1])))||k<=_&&(P===y.length-1||Math.abs(ru(I)-k)<Math.abs(ru(I)-ru(y[P+1])))});return{value:T!==void 0&&T>=0?y[T]:I,index:T}}const w=x.bandwidth()===0?Math.floor((b-Math.min(...x.range())+x.step()/2)/x.step()):Math.floor((b-Math.min(...x.range()))/x.step());if(w<0||w>=y.length)return null;if(C){const I=y.length-1-w;return{index:I,value:y[I]}}return{index:w,value:y[w]}}const f=()=>{d.current={isInChart:!1,x:-1,y:-1},s({type:"exitChart"})},g=v=>{const b="targetTouches"in v?v.targetTouches[0]:v,x=yLe(h,b);if(d.current.x=x.x,d.current.y=x.y,!r.isPointInside(x,{targetElement:v.target})){d.current.isInChart&&(s({type:"exitChart"}),d.current.isInChart=!1);return}d.current.isInChart=!0;const y=p(n[c],x.x),C=p(i[u],x.y);s({type:"updateAxis",data:{x:y,y:C}})},m=v=>{const b=v.currentTarget;b&&b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId)};return h.addEventListener("pointerdown",m),h.addEventListener("pointermove",g),h.addEventListener("pointerout",f),h.addEventListener("pointercancel",f),h.addEventListener("pointerleave",f),()=>{h.removeEventListener("pointerdown",m),h.removeEventListener("pointermove",g),h.removeEventListener("pointerout",f),h.removeEventListener("pointercancel",f),h.removeEventListener("pointerleave",f)}},[e,s,u,i,c,n,t,r])},bFe=["children","width","height","viewBox","disableAxisListener","className","title","desc"],xFe=Cr("svg",{name:"MuiChartsSurface",slot:"Root"})(()=>({touchAction:"none"})),wFe=R.forwardRef(function(e,r){const n=rs({props:e,name:"MuiChartsSurface"}),{children:i,width:o,height:a,viewBox:s,disableAxisListener:c=!1,className:u,title:d,desc:h}=n,p=Fe(n,bFe),f=j({width:o,height:a,x:0,y:0},s);return yFe(c),E.jsxs(xFe,j({width:o,height:a,viewBox:`${f.x} ${f.y} ${f.width} ${f.height}`,ref:r,className:u},p,{children:[E.jsx("title",{children:d}),E.jsx("desc",{children:h}),i]}))});function CU(t){const{isReversed:e,gradientId:r,size:n,direction:i,scale:o,colorMap:a}=t;return n<=0?null:E.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${e?1:2}`]:`${n}px`,gradientUnits:"userSpaceOnUse",children:a.thresholds.map((s,c)=>{const u=o(s);if(u===void 0)return null;const d=e?1-u/n:u/n;return E.jsxs(R.Fragment,{children:[E.jsx("stop",{offset:d,stopColor:a.colors[c],stopOpacity:1}),E.jsx("stop",{offset:d,stopColor:a.colors[c+1],stopOpacity:1})]},s.toString()+c)})})}function CFe(){const{chartId:t}=R.useContext(Kv);return R.useCallback((e,r)=>`${t}-gradient-${r}-${e}`,[t])}function IFe(){const{top:t,height:e,bottom:r,left:n,width:i,right:o}=Ki(),a=t+e+r,s=n+i+o,c=CFe(),{xAxisIds:u,xAxis:d,yAxisIds:h,yAxis:p}=Ji();return E.jsxs("defs",{children:[h.filter(f=>p[f].colorMap!==void 0).map(f=>{const g=c(f,"y"),{colorMap:m,scale:v,colorScale:b,reverse:x}=p[f];return(m==null?void 0:m.type)==="piecewise"?E.jsx(CU,{isReversed:!x,scale:v,colorMap:m,size:a,gradientId:g,direction:"y"},g):(m==null?void 0:m.type)==="continuous"?E.jsx(wz,{isReversed:!x,scale:v,colorScale:b,colorMap:m,size:a,gradientId:g,direction:"y"},g):null}),u.filter(f=>d[f].colorMap!==void 0).map(f=>{const g=c(f,"x"),{colorMap:m,scale:v,reverse:b,colorScale:x}=d[f];return(m==null?void 0:m.type)==="piecewise"?E.jsx(CU,{isReversed:b,scale:v,colorMap:m,size:s,gradientId:g,direction:"x"},g):(m==null?void 0:m.type)==="continuous"?E.jsx(wz,{isReversed:b,scale:v,colorScale:x,colorMap:m,size:s,gradientId:g,direction:"x"},g):null})]})}const IU=(t,e,r)=>{var i;const n=r==="x"?B1:z1;return[...(i=t==null?void 0:t.map((o,a)=>j({id:`defaultized-${r}-axis-${a}`},o)))!=null?i:[],...t===void 0||t.findIndex(({id:o})=>o===n)===-1?[{id:n,scaleType:"linear"}]:[]].map(o=>{const a=o.dataKey;if(a===void 0||o.data!==void 0)return o;if(e===void 0)throw new Error(`MUI X: ${r}-axis uses \`dataKey\` but no \`dataset\` is provided.`);return j({},o,{data:e.map(s=>s[a])})})},SFe=(t,e,r)=>{const n=R.useMemo(()=>IU(t,r,"x"),[t,r]),i=R.useMemo(()=>IU(e,r,"y"),[e,r]);return[n,i]},_Fe=["width","height","series","margin","xAxis","yAxis","zAxis","colors","dataset","sx","title","desc","disableAxisListener","highlightedItem","onHighlightChange","plugins","children","skipAnimation"],TFe=(t,e)=>{const{width:r,height:n,series:i,margin:o,xAxis:a,yAxis:s,zAxis:c,colors:u,dataset:d,sx:h,title:p,desc:f,disableAxisListener:g,highlightedItem:m,onHighlightChange:v,plugins:b,children:x,skipAnimation:y}=t,C=Fe(t,_Fe),w=R.useRef(null),I=ad(e,w),[_,T]=SFe(a,s,d),O={width:r,height:n,margin:o,svgRef:w},P={skipAnimation:y},k={plugins:b},S={series:i,colors:u,dataset:d},M={xAxis:_,yAxis:T,dataset:d},$={zAxis:c,dataset:d},D={highlightedItem:m,onHighlightChange:v},N=j({},C,{width:r,height:n,ref:I,sx:h,title:p,desc:f,disableAxisListener:g});return{children:x,drawingProviderProps:O,seriesProviderProps:S,cartesianProviderProps:M,zAxisContextProps:$,highlightedProviderProps:D,chartsSurfaceProps:N,pluginProviderProps:k,animationProviderProps:P,xAxis:_,yAxis:T}},kFe=R.forwardRef(function(e,r){const{children:n,drawingProviderProps:i,seriesProviderProps:o,cartesianProviderProps:a,zAxisContextProps:s,highlightedProviderProps:c,chartsSurfaceProps:u,pluginProviderProps:d,animationProviderProps:h}=TFe(e,r);return E.jsx(DDe,j({},i,{children:E.jsx(QOe,j({},d,{children:E.jsx(tRe,j({},o,{children:E.jsx(HDe,j({},a,{children:E.jsx(RDe,j({},s,{children:E.jsx(P$e,{children:E.jsx(oRe,j({},c,{children:E.jsxs(wFe,j({},u,{children:[E.jsx(IFe,{}),E.jsx(hFe,j({},h,{children:n}))]}))}))})}))}))}))}))}))}),AFe=Cr("div",{name:"MuiResponsiveChart",slot:"Container"})(({ownerState:t})=>{var e,r;return{width:(e=t.width)!=null?e:"100%",height:(r=t.height)!=null?r:"100%",display:"flex",position:"relative",flexGrow:1,flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden","&>svg":{width:"100%",height:"100%"}}}),PFe=(t,e,r)=>{const n=R.useRef({displayError:!1,initialCompute:!0,computeRun:0}),i=R.useRef(null),[o,a]=R.useState(0),[s,c]=R.useState(0),u=R.useCallback(()=>{const d=i==null?void 0:i.current;if(!d)return{};const p=Qne(d).getComputedStyle(d),f=Math.floor(parseFloat(p.height))||0,g=Math.floor(parseFloat(p.width))||0;return a(g),c(f),{width:g,height:f}},[]);return R.useEffect(()=>{n.current.displayError=!0},[]),Da(()=>{if(!r||!n.current.initialCompute||n.current.computeRun>20)return;const d=u();d.width!==o||d.height!==s?n.current.computeRun+=1:n.current.initialCompute&&(n.current.initialCompute=!1)},[o,s,u,r]),Da(()=>{if(t!==void 0&&e!==void 0)return()=>{};u();const d=i.current;if(typeof ResizeObserver=="undefined")return()=>{};let h;const p=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{u()})});return d&&p.observe(d),()=>{h&&cancelAnimationFrame(h),d&&p.unobserve(d)}},[u,e,t]),{containerRef:i,width:t!=null?t:o,height:e!=null?e:s}},EFe=["width","height","resolveSizeBeforeRender","margin","children","series","colors","dataset","desc","disableAxisListener","highlightedItem","onHighlightChange","plugins","sx","title","viewBox","xAxis","yAxis","zAxis","skipAnimation"],OFe=(t,e)=>{const{width:r,height:n,resolveSizeBeforeRender:i,margin:o,children:a,series:s,colors:c,dataset:u,desc:d,disableAxisListener:h,highlightedItem:p,onHighlightChange:f,plugins:g,sx:m,title:v,viewBox:b,xAxis:x,yAxis:y,zAxis:C,skipAnimation:w}=t,I=Fe(t,EFe),{containerRef:_,width:T,height:O}=PFe(r,n,i),P=j({},I,{ownerState:{width:r,height:n},ref:_});return{hasIntrinsicSize:T&&O,chartContainerProps:{margin:o,children:a,series:s,colors:c,dataset:u,desc:d,disableAxisListener:h,highlightedItem:p,onHighlightChange:f,plugins:g,sx:m,title:v,viewBox:b,xAxis:x,yAxis:y,zAxis:C,skipAnimation:w,width:T,height:O,ref:e},resizableChartContainerProps:P}},RFe=R.forwardRef(function(e,r){const{hasIntrinsicSize:n,chartContainerProps:i,resizableChartContainerProps:o}=OFe(e,r);return E.jsx(AFe,j({},o,{children:n?E.jsx(kFe,j({},i)):null}))}),MFe=["message"],DFe=Cr("text")(({theme:t})=>j({},t.typography.body2,{stroke:"none",fill:t.palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function $Fe(t){const{message:e}=t,r=Fe(t,MFe),{top:n,left:i,height:o,width:a}=Ki();return E.jsx(DFe,j({x:i+a/2,y:n+o/2},r,{children:e!=null?e:"Loading data…"}))}const LFe=["message"],FFe=Cr("text")(({theme:t})=>j({},t.typography.body2,{stroke:"none",fill:t.palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function NFe(t){const{message:e}=t,r=Fe(t,LFe),{top:n,left:i,height:o,width:a}=Ki();return E.jsx(FFe,j({x:i+a/2,y:n+o/2},r,{children:e!=null?e:"No data to display"}))}function jFe(){const t=ns();return Object.values(t).every(e=>{if(!e)return!0;const{series:r,seriesOrder:n}=e;return n.every(i=>r[i].data.length===0)})}function BFe(t){var r,n,i,o,a,s;const e=jFe();if(t.loading){const c=(n=(r=t.slots)==null?void 0:r.loadingOverlay)!=null?n:$Fe;return E.jsx(c,j({},(i=t.slotProps)==null?void 0:i.loadingOverlay))}if(e){const c=(a=(o=t.slots)==null?void 0:o.noDataOverlay)!=null?a:NFe;return E.jsx(c,j({},(s=t.slotProps)==null?void 0:s.noDataOverlay))}return null}const zFe=["xAxis","yAxis","series","width","height","margin","colors","dataset","sx","tooltip","onAxisClick","axisHighlight","legend","grid","topAxis","leftAxis","rightAxis","bottomAxis","children","slots","slotProps","skipAnimation","loading","layout","onItemClick","highlightedItem","onHighlightChange","borderRadius","barLabel","className"],UFe=t=>{const{xAxis:e,yAxis:r,series:n,width:i,height:o,margin:a,colors:s,dataset:c,sx:u,tooltip:d,onAxisClick:h,axisHighlight:p,legend:f,grid:g,topAxis:m,leftAxis:v,rightAxis:b,bottomAxis:x,children:y,slots:C,slotProps:w,skipAnimation:I,loading:_,layout:T,onItemClick:O,highlightedItem:P,onHighlightChange:k,borderRadius:S,barLabel:M,className:$}=t,D=Fe(t,zFe),z=`${mR()}-clip-path`,U=T==="horizontal"||T===void 0&&n.some(ae=>ae.layout==="horizontal"),V={scaleType:"band",data:Array.from({length:Math.max(...n.map(ae=>{var oe,Ce;return((Ce=(oe=ae.data)!=null?oe:c)!=null?Ce:[]).length}))},(ae,oe)=>oe)},q=j({},D,{series:n.map(ae=>j({type:"bar"},ae,{layout:U?"horizontal":"vertical"})),width:i,height:o,margin:a,colors:s,dataset:c,xAxis:e!=null?e:U?void 0:[j({id:B1},V)],yAxis:r!=null?r:U?[j({id:z1},V)]:void 0,sx:u,highlightedItem:P,onHighlightChange:k,disableAxisListener:(d==null?void 0:d.trigger)!=="axis"&&(p==null?void 0:p.x)==="none"&&(p==null?void 0:p.y)==="none"&&!h,className:$,skipAnimation:I}),F={onItemClick:O,slots:C,slotProps:w,borderRadius:S,barLabel:M},B={onAxisClick:h},H={vertical:g==null?void 0:g.vertical,horizontal:g==null?void 0:g.horizontal},G={clipPath:`url(#${z})`},Z={id:z},Y={slots:C,slotProps:w,loading:_},Q={topAxis:m,leftAxis:v,rightAxis:b,bottomAxis:x,slots:C,slotProps:w},K=j({},U?{y:"band"}:{x:"band"},p),X=j({},f,{slots:C,slotProps:w}),ee=j({},d,{slots:C,slotProps:w});return{chartContainerProps:q,barPlotProps:F,axisClickHandlerProps:B,gridProps:H,clipPathProps:Z,clipPathGroupProps:G,overlayProps:Y,chartsAxisProps:Q,axisHighlightProps:K,legendProps:X,tooltipProps:ee,children:y}},HFe=R.forwardRef(function(e,r){const n=rs({props:e,name:"MuiBarChart"}),{chartContainerProps:i,barPlotProps:o,axisClickHandlerProps:a,gridProps:s,clipPathProps:c,clipPathGroupProps:u,overlayProps:d,chartsAxisProps:h,axisHighlightProps:p,legendProps:f,tooltipProps:g,children:m}=UFe(n);return E.jsxs(RFe,j({ref:r},i,{children:[n.onAxisClick&&E.jsx(bLe,j({},a)),E.jsx(v$e,j({},s)),E.jsxs("g",j({},u,{children:[E.jsx(vFe,j({},o)),E.jsx(BFe,j({},d)),E.jsx(vLe,j({},p))]})),E.jsx(u$e,j({},h)),E.jsx(pLe,j({},f)),!n.loading&&E.jsx(Q$e,j({},g)),E.jsx(VDe,j({},c)),m]}))}),VFe=t=>{const{Spinner:e}=er.useComponentContext(),r=_t(zt);if(!t.chartData)return E.jsx(e,{my:10});const n=()=>E.jsx(HFe,{borderRadius:5,sx:{[`& .${PS.line}`]:{strokeDasharray:"5 3",strokeWidth:1},"& .MuiChartsLegend-series tspan":{fontSize:"18px"}},margin:{bottom:80,top:60},height:375,grid:{vertical:!1,horizontal:!0},bottomAxis:{tickLabelStyle:{angle:-45,textAnchor:"end"},disableTicks:!0},xAxis:[{scaleType:"band",data:t.chartData.map(i=>i.date)}],yAxis:[{disableTicks:!0}],series:[{data:t.chartData.map(i=>i.participations||0),color:"#2a63c5",label:r.participations,valueFormatter:i=>`${i}`}],slotProps:{popper:{sx:{"& .MuiChartsTooltip-paper":{backgroundColor:"white",opacity:.9},"& .MuiChartsTooltip-row":{backgroundColor:"#FFF",height:50},"& .MuiChartsTooltip-table":{backgroundColor:"#F0F4F8",textAlign:"center"}}}}});return E.jsx(Oe,{textAlign:"center",bgcolor:"white",children:n()})},WFe=({game:t})=>{const e=_t(zt),r=[{title:e.finishedParticipations,value:t.finishedParticipationsCount},{title:e.totalParticipations,value:t.totalParticipationsCount},{title:e.averageStartedParticipations,value:parseFloat(t.averageStartedParticipationsCount.toFixed(2))},{title:e.averageFinishedParticipations,value:parseFloat(t.averageFinishedParticipationsCount.toFixed(2))}];return E.jsx(E.Fragment,{children:E.jsx(zl,{variant:"soft",sx:{p:2,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)",cursor:"default","&hover":{backgroundColor:"transparent"}},children:E.jsxs(Ma,{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:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{style:{width:"80%"},children:e.participationOverview}),E.jsx("th",{children:e.optionsValue})]})}),E.jsx("tbody",{children:r.map(n=>E.jsxs("tr",{children:[E.jsx("td",{children:E.jsx(ze,{fontWeight:"md",children:n.title})}),E.jsx("td",{children:n.value})]},`report-${n.title}`))})]})})})},qFe=t=>{const[e,r]=W.useState("statistics"),[n,i]=W.useState(null),[o,a]=W.useState(!1),s=_t(zt),{https:c}=er.useAPIContext(),{Toast:u}=er.useComponentContext();W.useEffect(()=>{if(!((n==null?void 0:n.length)>0))return d(),()=>{i(null)}},[]);const d=()=>L(this,null,function*(){var g;const h=el(t.game.createdAt).format("YYYY-MM-DD"),p=el(new Date).format("YYYY-MM-DD"),f=yield c.getEntityParticipations(t.game.id,h,p);if(f.ok){const v=(g=(yield f.json()).data)==null?void 0:g.breakdown.map(b=>({date:el(b.date).format("DD MMM YYYY"),participations:b.count})).sort((b,x)=>el(b.date).valueOf()-el(x.date).valueOf());i(v);return}console.error(yield f.json()),i([]),a(!0)});return E.jsxs(hn,{variant:"soft",sx:{borderRadius:0,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)"},children:[E.jsx($n,{children:E.jsxs(Oe,{mb:1,children:[E.jsx(Oe,{display:"flex",alignItems:"center",mb:1,children:E.jsxs(br,{value:e,size:"sm",sx:{mx:"auto",marginBottom:"5px"},onChange:(h,p)=>r(p),children:[E.jsx(qt,{value:"statistics",children:"Statistics"}),E.jsx(qt,{value:"chart",children:"Performance by day"})]})}),e==="chart"&&E.jsx(VFe,{chartData:n}),e==="statistics"&&E.jsx(WFe,{game:t.game})]})}),E.jsx(u,{showToast:o,color:"danger",message:s.chartErrorMessage,hideToast:()=>a(!1)})]})},GFe=t=>{const e=_t(zt);return E.jsxs(nw,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[E.jsxs(rw,{sx:{borderRadius:0,cursor:"default",fontSize:"0.875rem",[`& .${sR.root}`]:{'&[aria-selected="true"]':{bgcolor:"#fff",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[E.jsx(Ul,{children:e.standings}),E.jsx(Ul,{children:e.reports}),E.jsx(Ul,{children:e.exports})]}),E.jsx(id,{value:0,sx:{p:0},children:E.jsx(mOe,{game:t.eitherOr})}),E.jsx(id,{value:1,sx:{p:0,cursor:"default"},children:E.jsx(qFe,{game:t.eitherOr})}),E.jsx(id,{value:2,sx:{p:0,cursor:"default"},children:E.jsx(vOe,{game:t.eitherOr})})]})},YFe=({row:t,onClickEdit:e,onDelete:r})=>{var h,p;const[n,i]=W.useState(!1),{isMobile:o}=er.useIsMobile(),a=_t(zt),s=_t(aa),c=f=>{switch(f){case"ACTIVE":return"success";case"INACTIVE":return"danger";default:return"neutral"}},u=f=>{f.stopPropagation(),i(!n)},d=()=>{var f;return E.jsx(E.Fragment,{children:!o&&E.jsxs(E.Fragment,{children:[E.jsx("td",{children:((f=s.types.find(g=>g.id===t.type))==null?void 0:f.label)||"No type"}),E.jsx("td",{children:t.totalUsersCount}),E.jsx("td",{children:el(t.createdAt).format(a.timeFormat)})]})})};return E.jsxs(E.Fragment,{children:[E.jsxs("tr",{onClick:e,children:[E.jsx("td",{children:E.jsx(Et,{title:a.additionalInformation,children:E.jsx(ur,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",onClick:u,children:n?E.jsx(GR,{}):E.jsx(qR,{})})})}),E.jsx("td",{scope:"row",children:t.title}),E.jsx("td",{children:E.jsx(dn,{color:c(t.status),variant:"solid",size:"sm",children:t.status})}),E.jsx("td",{children:o?((h=gt[t.language])==null?void 0:h.key)||"N/A":((p=gt[t.language])==null?void 0:p.name)||"N/A"}),d(),E.jsx("td",{children:E.jsx(fOe,{eitherOr:t,onClickEdit:e,onDelete:r})})]}),E.jsx("tr",{children:E.jsx("td",{style:{height:0,padding:0},colSpan:8,children:n?E.jsx(GFe,{eitherOr:t}):E.jsx(E.Fragment,{})})})]})},KFe=({row:t,isSelected:e,onRowSelect:r})=>{const[n,i]=W.useState(null),[o,a]=W.useState(!1),[s,c]=W.useState(!1),[u,d]=W.useState(!1),{Spinner:h,Toast:p}=er.useComponentContext(),{https:f}=er.useAPIContext(),g=_t(zt);W.useEffect(()=>{o&&!n&&L(this,null,function*(){c(!0);const y=yield f.getEitherOrById(t.id,_B);if(y.ok){const C=yield y.json();i(C.data),c(!1)}else console.error(yield y.json()),i(null),c(!1),d(!0)})},[o]);const m=x=>{x.stopPropagation(),a(!o)},v=()=>{r(t.id)},b=()=>s||!s&&!n?E.jsx(h,{my:10}):E.jsxs(Ma,{variant:"outlined",size:"sm",sx:{"& > 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:[E.jsx("thead",{children:E.jsx("tr",{children:E.jsx("th",{children:E.jsxs(Oe,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[E.jsx(ze,{level:"body-sm",children:g.options}),E.jsxs(ze,{level:"body-sm",children:[g.winningCondition,":",E.jsx(dn,{sx:{ml:.5},color:n.winning_condition==="LESS"?"danger":"success",size:"sm",children:n.winning_condition})]}),E.jsx(ze,{level:"body-sm",children:g.optionsValue})]})})})}),E.jsx("tbody",{children:n==null?void 0:n.options.sort((x,y)=>n.winning_condition==="LESS"?x.value-y.value:y.value-x.value).map(x=>E.jsx("tr",{children:E.jsx("td",{children:E.jsxs(Oe,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[E.jsx(ze,{level:"body-sm",children:x.label}),E.jsx(ze,{level:"body-sm",children:x.value})]})})},`option-${x.label}`))})]});return E.jsxs(E.Fragment,{children:[E.jsxs("tr",{onClick:v,children:[E.jsx("td",{children:E.jsx(ed,{checked:e,onChange:v})}),E.jsx("td",{scope:"row",children:t.title}),E.jsx("td",{children:el(t.createdAt).format(g.timeFormat)}),E.jsx("td",{children:E.jsx(Et,{title:o?"":g.expand,children:E.jsx(ur,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",onClick:m,children:o?E.jsx(GR,{}):E.jsx(qR,{})})})})]}),E.jsx("tr",{children:E.jsx("td",{style:{height:0,padding:o?10:0},colSpan:9,children:o?b():E.jsx(E.Fragment,{})})}),E.jsx(p,{showToast:u,color:"danger",message:g.getEitherOrErrorMessage,hideToast:()=>d(!u)})]})},SU=t=>{const{isMobile:e}=er.useIsMobile(),r=_t(zt),n=t.pageGames.get(t.pageCount),i=t.pageCount===1,o=t.pageGames.get(t.pageCount).length<t.gamesPerPage,a=[r.type,r.users,r.creationDate],s=()=>E.jsxs("tr",{children:[E.jsx("th",{style:{width:40},"aria-label":"empty"}),E.jsx("th",{style:{width:e?"60%":"40%"},children:r.title}),E.jsx("th",{style:{width:e?"20%":100},children:r.status}),E.jsx("th",{style:{width:e?"20%":100},children:r.language}),!e&&a.map(u=>E.jsx("th",{children:u},u)),E.jsx("th",{style:{width:e?"20%":100},children:r.actions})]}),c=()=>E.jsxs("tr",{children:[E.jsx("th",{style:{width:40},"aria-label":"empty"}),E.jsx("th",{style:{width:"70%"},children:r.title}),E.jsx("th",{style:{width:"30%"},children:r.creationDate}),E.jsx("th",{style:{width:40},"aria-label":"empty"})]});return E.jsx(Oe,{sx:Be(ce({},t.sx),{overflowX:"auto",width:"100%"}),children:E.jsxs(Ma,{hoverRow:!0,"aria-label":"collapsible table",sx:{"& > tbody > tr:nth-of-type(even)":{"&:hover":{backgroundColor:"transparent"}},'& > tbody > tr:nth-of-type(odd) > td, & > tbody > tr:nth-of-type(odd) > th[scope="row"]':{borderBottom:0},"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:t.isGameTemplate?"left":"right"},"& > tbody > tr":{cursor:"pointer"},"& > tfoot > tr > *":{backgroundColor:"white"}},children:[E.jsx("thead",{children:t.isGameTemplate?c():s()}),E.jsx("tbody",{children:n.map(u=>t.isGameTemplate?E.jsx(KFe,{row:u,isSelected:t.selectedGames.includes(u.id),onRowSelect:t.onRowSelect},u.id):E.jsx(YFe,{row:u,onClickEdit:()=>t.onClickEdit(u.id),onDelete:t.onDelete},u.id))}),E.jsx(cOe,{pageCount:t.pageCount,disablePreviousPage:i,disableNextPage:o,goToPreviousPage:t.getPreviousPage,goToNextPage:t.getNextPage})]})})},JFe={apiKey:"AIzaSyB6JILBJiJ0Z2pxw0-nudOpRAzqFk6D6Lw",clientId:"content",environment:"prod",lang:"en",errorHandlingMode:"standard",authProvider:{getIdToken:()=>"",logout:()=>{}}},QFe=new Th,XFe=({fansUnitedEnvironment:t,isOpen:e,onImport:r,onClose:n})=>{const[i,o]=W.useState(1),[a,s]=W.useState(null),[c,u]=W.useState(new Map),[d,h]=W.useState(new PB),[p,f]=W.useState([]),[g,m]=W.useState(!1),[v,b]=W.useState(""),[x,y]=W.useState([]),[C,w]=W.useState(!1),[I,_]=W.useState(!1),{Spinner:T,Toast:O}=er.useComponentContext(),{https:P}=er.useAPIContext(),k=_t(zt),S=_t(aa),M=gk(JFe);W.useEffect(()=>(e&&D(!0),()=>{s(""),u(null),o(1),y([])}),[d,e]),W.useEffect(()=>{i!==1&&c&&Array.from(c.keys()).length>0&&!Array.from(c.keys()).includes(i)&&D(!1)},[i]);const $=B=>{m(!0),b(B)},D=B=>L(this,null,function*(){const H=B?ce({},d):Be(ce({},d),{startAfter:a});try{const G=yield M.miniGames.getEitherOrs(H,!1,!0);s(G.meta.pagination.nextPageStartsAfter);const Z=B?new Map:new Map(c);Z.set(B?1:i,G.data),u(Z),B&&o(1)}catch(G){$(k.getEitherOrsErrorMessage)}}),N=()=>o(B=>B-1),z=()=>o(B=>B+1),U=B=>{if(!x.includes(B))y([...x,B]);else{const H=x.filter(G=>G!==B);y(H)}},V=()=>{o(1),u(new Map),y([])},q=()=>L(this,null,function*(){const B=[];return x.forEach(H=>{B.push(P.getEitherOrById(H,_B).then(G=>G.json()).then(G=>G.data))}),Promise.all(B)}),F=(B=!1)=>L(this,null,function*(){B?_(!0):w(!0);let H=[];try{H=yield q()}catch(Z){console.error(Z),$(k.getEitherOrsErrorMessage),B?_(!1):w(!1);return}if(B)try{H=yield j1(H,S.languageConfig.default_language,"en")}catch(Z){$(k.gameTranslationErrorMessage),_(!1);return}const G=[];H.forEach(Z=>{var X;const Y=QFe.finalizeNewRequestBody(Z,S),Q=B?S.languageConfig.default_language:"en";Y.language=Q;const K=S.languageConfig.translation_rules&&((X=S.languageConfig.translation_rules[Q])==null?void 0:X.game_status)||"INACTIVE";Y.status=K,G.push(P.createEitherOr(ce({},Y)))}),Promise.all(G).then(()=>{n(),r()}).catch(Z=>{$(Z)}),B?_(!1):w(!1)});return E.jsx(As,{open:e,onClose:n,children:E.jsxs(E.Fragment,{children:[E.jsxs(Es,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[E.jsx(ks,{children:k.browseEitherOrGames}),E.jsx(Ni,{}),E.jsx(Ts,{sx:{overflowX:"hidden"},children:E.jsxs(E.Fragment,{children:[E.jsx(EB,{filters:d,options:p,setOptions:f,setFilters:h,handleResetData:V,showStatusFilter:!1}),(!c||!c.get(i))&&d.flags.length===0&&d.entityIds.length===0?E.jsx(T,{my:"10%"}):E.jsx(E.Fragment,{}),c&&c.size>0&&c.get(i)&&c.get(i).length>0?E.jsx(SU,{pageGames:c,pageCount:i,gamesPerPage:d.limit,getPreviousPage:N,getNextPage:z,isGameTemplate:!0,selectedGames:x,onRowSelect:U,sx:{backgroundColor:"white"}}):E.jsx(E.Fragment,{}),c&&c.size>0&&c.get(i)&&c.get(i).length===0?E.jsx(ze,{level:"h2",textAlign:"center",fontWeight:"bold",fontSize:"xl",my:20,children:k.noTemplateGamesFound}):E.jsx(E.Fragment,{})]})}),E.jsxs(Bl,{children:[S.languageConfig.default_language&&!S.languageConfig.default_language.startsWith("en")&&E.jsx(lt,{variant:"outlined",color:"primary",loading:I,disabled:x.length===0,onClick:()=>F(!0),children:k.translateAndImport.replace("_language_",kh[S.languageConfig.default_language].name)}),E.jsx(lt,{variant:"solid",color:"primary",loading:C,disabled:x.length===0,onClick:()=>F(),children:k.import}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:B=>{B.stopPropagation(),n()},children:k.close})]})]}),E.jsx(O,{showToast:g,color:"danger",message:v,hideToast:()=>m(!g)})]})})},ZFe=({fansUnitedEnvironment:t,hideSignOutButton:e})=>{const[r,n]=W.useState(new PB),[i,o]=W.useState(1),[a,s]=W.useState(null),[c,u]=W.useState(new Map),[d,h]=W.useState(null),[p,f]=W.useState(null),[g,m]=W.useState(null),[v,b]=W.useState(!1),[x,y]=W.useState(!1),[C,w]=W.useState(!1),[I,_]=W.useState(!1),[T,O]=W.useState(!1),[P,k]=W.useState(""),[S,M]=W.useState("danger"),[$,D]=W.useState([]),{sdk:N,https:z}=er.useAPIContext(),{HeaderButtons:U,Spinner:V,Toast:q}=er.useComponentContext(),F=_t(zt),B=(ae,oe)=>{O(!0),k(oe),M(ae)};W.useEffect(()=>(H(),()=>{s(null),u(null)}),[r]),W.useEffect(()=>{G()},[i]);const H=()=>L(this,null,function*(){y(!0);try{const ae=yield N.miniGames.getEitherOrs(r,!1,!0);s(ae.meta.pagination.nextPageStartsAfter);const oe=new Map;oe.set(1,ae.data),u(oe),o(1)}catch(ae){console.error(ae),B("danger",F.getEitherOrsErrorMessage)}y(!1)}),G=()=>L(this,null,function*(){if(i!==1&&c&&Array.from(c.keys()).length>0&&!Array.from(c.keys()).includes(i)){y(!0);try{const ae=yield N.miniGames.getEitherOrs(Be(ce({},r),{startAfter:a}),!1,!0);if(ae.data.length>0){const oe=new Map(c);oe.set(i,ae.data),u(oe),s(ae.meta.pagination.nextPageStartsAfter)}}catch(ae){console.error(ae),B("danger",F.getEitherOrsErrorMessage)}y(!1)}}),Z=()=>o(ae=>ae-1),Y=()=>o(ae=>ae+1),Q=ae=>L(this,null,function*(){var Ce;w(!0);const oe=yield z.getEitherOrById(ae);if(oe.ok){const be=yield oe.json(),ge=(Ce=be.data.related)==null?void 0:Ce.filter(ve=>ve.entity_relationship==="translatedFrom"||ve.entity_relationship==="translatedTo");if((ge==null?void 0:ge.length)>0){const ve=new Set,ne=be.data.related.filter(le=>(le.entity_relationship==="translatedFrom"||le.entity_relationship==="translatedTo")&&!ve.has(le.entity_id)?(ve.add(le.entity_id),!0):!1).map(le=>z.getEitherOrById(le.entity_id).then(he=>he.json()).then(he=>he.data));Promise.all(ne).then(le=>{var ye;const he=(ye=be.data.related.find(pe=>pe.entity_relationship==="translatedFrom"))==null?void 0:ye.entity_id;he&&he!==be.data.id&&m(le.find(pe=>(pe==null?void 0:pe.id)===he)),f(le.filter(pe=>pe!==void 0&&pe.id!==he))})}h(be.data),w(!1),b(!0)}else console.error(F.getEitherOrErrorMessage,yield oe.json()),B("danger",F.getEitherOrErrorMessage),w(!1)}),K=()=>{o(1),s(null),u(null)},X=()=>{h(null),f(null),m(null),b(!v),H()},ee=()=>{K(),H()};return C?E.jsx(V,{my:60}):v?E.jsx(sOe,{eitherOrById:d,relatedGames:p,relatedParentTitle:g==null?void 0:g.title,onClickBack:X,loadParent:()=>{X(),Q(g.id)}}):E.jsxs(E.Fragment,{children:[E.jsx(U,{createLabel:F.create,createFromTemplateLabel:F.createFromTemplate,signOutLabel:e?"":F.signOut,environment:t,onClickCreate:()=>b(!0),onClickCreateFromTemplate:()=>_(!0)}),E.jsxs(lOe,{children:[E.jsx(EB,{filters:r,options:$,setOptions:D,setFilters:n,handleResetData:K}),x?E.jsx(V,{my:40}):E.jsx(E.Fragment,{}),!x&&c&&c.size>0&&c.get(i)&&c.get(i).length>0?E.jsx(SU,{pageGames:c,pageCount:i,gamesPerPage:r.limit,getPreviousPage:Z,getNextPage:Y,onClickEdit:Q,onDelete:ee}):E.jsx(E.Fragment,{}),c&&c.size>0&&c.get(i)&&c.get(i).length===0?E.jsx(ze,{level:"h2",textAlign:"center",fontWeight:"bold",fontSize:"xl",my:40,children:F.noGamesFound}):E.jsx(E.Fragment,{})]}),E.jsx(q,{showToast:T,color:S,message:P,hideToast:()=>O(!T)}),E.jsx(XFe,{fansUnitedEnvironment:t,isOpen:I,onImport:ee,onClose:()=>_(!1)})]})},eNe=({hideSignOutButton:t,fansUnitedEnvironment:e})=>{const[r,n]=W.useState(null),[i,o]=W.useState(!1),[a,s]=W.useState(!1),[c,u]=W.useState(new IB),{AuthContext:d,useComponentContext:h,useAPIContext:p}=er,f=W.useContext(d),g=W.useContext(zt),{Login:m,Spinner:v,NoPermissionCard:b,Toast:x}=h(),{https:y}=p(),C=()=>L(this,null,function*(){if(f){o(!0);const w=yield y.getEitherOrFeature(),I=yield w.json();if(w.ok){const _=I.data.types,T=I.data.auth_requirement,O=yield y.getLanguageConfig(),P=yield O.json();let k=null;O.ok?k=P.data:console.warn("There was a problem with fetching client language configuration. API error: ",P),n(!I.data.enabled),u({types:_,authRequirement:T,languageConfig:k}),o(!1);return}console.error(I),n(!0),o(!1),s(!0)}});return W.useEffect(()=>(C(),()=>{n(null),u(new IB)}),[f]),i?E.jsx(v,{my:60}):f?f&&r===!0?E.jsx(b,{labels:g,environment:e,setNoPermission:n}):E.jsxs(E.Fragment,{children:[f&&r===!1?E.jsx(REe,{features:c,children:E.jsx(MEe,{children:E.jsx(ZFe,{hideSignOutButton:t,fansUnitedEnvironment:e})})}):E.jsx(E.Fragment,{}),E.jsx(x,{showToast:a,color:"danger",message:g.clientFeaturesNotFoundMessage,hideToast:()=>s(!1)})]}):E.jsx(m,{environment:e,userNotFound:g.userNotFound})},tNe=t=>{const e={apiKey:t.fansUnitedApiKey,clientId:t.fansUnitedClientId,environment:t.fansUnitedEnvironment,language:t.fansUnitedLanguage,sportal365Project:t.sportal365Project,sportal365Infrastructure:t.sportal365Infrastructure},{AuthProvider:r,APIProvider:n,ComponentProvider:i}=er;return E.jsx(r,{environment:t.fansUnitedEnvironment,children:E.jsx(OEe,{labels:t.labels,children:E.jsx(n,{config:e,children:E.jsx(i,{children:E.jsx(eNe,{fansUnitedEnvironment:t.fansUnitedEnvironment,hideSignOutButton:t.hideSignOutButton})})})})})};$t.EitherOrManager=tNe,Object.defineProperty($t,Symbol.toStringTag,{value:"Module"})});
|
|
3655
|
+
`));return t||r.skipAnimation}const fFe=["skipAnimation","onItemClick","borderRadius","barLabel"];function mFe({bandWidth:t,numberOfGroups:e,gapRatio:r}){if(r===0)return{barWidth:t/e,offset:0};const n=t/(e+(e-1)*r),i=r*n;return{barWidth:n,offset:i}}const gFe=()=>{var f;const t=(f=rRe())!=null?f:{series:{},stackingGroups:[]},e=Ji(),r=$De(),{series:n,stackingGroups:i}=t,{xAxis:o,yAxis:a,xAxisIds:s,yAxisIds:c}=e,u=s[0],d=c[0],h={};return{completedData:i.flatMap(({ids:g},m)=>g.flatMap(v=>{var D,N,z,U;const b=(N=(D=n[v].xAxisId)!=null?D:n[v].xAxisKey)!=null?N:u,x=(U=(z=n[v].yAxisId)!=null?z:n[v].yAxisKey)!=null?U:d,y=o[b],C=a[x],w=n[v].layout==="vertical";dFe(w,v,b,o,x,a);const I=w?y:C,_=y.scale,T=C.scale,O=VB(n[v],o[b],a[x]),P=I.scale.bandwidth(),{barWidth:k,offset:S}=mFe({bandWidth:P,numberOfGroups:i.length,gapRatio:I.barGapRatio}),M=m*(k+S),{stackedData:$}=n[v];return $.map((V,q)=>{var Q,K,X,ee;const F=V.map(ae=>w?T(ae):_(ae)),B=Math.round(Math.min(...F)),H=Math.round(Math.max(...F)),G=n[v].stack,Z={seriesId:v,dataIndex:q,layout:n[v].layout,x:w?_((Q=o[b].data)==null?void 0:Q[q])+M:B,y:w?B:T((K=a[x].data)==null?void 0:K[q])+M,xOrigin:_(0),yOrigin:T(0),height:w?H-B:k,width:w?k:H-B,color:O(q),value:n[v].data[q],maskId:`${r}_${G||v}_${m}_${q}`};h[Z.maskId]||(h[Z.maskId]={id:Z.maskId,width:0,height:0,hasNegative:!1,hasPositive:!1,layout:Z.layout,xOrigin:_(0),yOrigin:T(0),x:0,y:0});const Y=h[Z.maskId];return Y.width=Z.layout==="vertical"?Z.width:Y.width+Z.width,Y.height=Z.layout==="vertical"?Y.height+Z.height:Z.height,Y.x=Math.min(Y.x===0?1/0:Y.x,Z.x),Y.y=Math.min(Y.y===0?1/0:Y.y,Z.y),Y.hasNegative=Y.hasNegative||((X=Z.value)!=null?X:0)<0,Y.hasPositive=Y.hasPositive||((ee=Z.value)!=null?ee:0)>0,Z})})),masksData:Object.values(h)}},by=({layout:t,yOrigin:e,x:r,width:n,y:i,xOrigin:o,height:a})=>j({},t==="vertical"?{y:e,x:r,height:0,width:n}:{y:i,x:o,height:a,width:0}),xy=({x:t,width:e,y:r,height:n})=>({y:r,x:t,height:n,width:e});function vFe(t){const{completedData:e,masksData:r}=gFe(),{skipAnimation:n,onItemClick:i,borderRadius:o,barLabel:a}=t,s=Fe(t,fFe),c=pFe(n),u=!o||o<=0,d=i_(e,{keys:p=>`${p.seriesId}-${p.dataIndex}`,from:by,leave:by,enter:xy,update:xy,immediate:c}),h=i_(u?[]:r,{keys:p=>p.id,from:by,leave:by,enter:xy,update:xy,immediate:c});return E.jsxs(R.Fragment,{children:[!u&&h((p,{id:f,hasPositive:g,hasNegative:m,layout:v})=>E.jsx(X2e,{maskId:f,borderRadius:o,hasNegative:m,hasPositive:g,layout:v,style:p})),d((p,{seriesId:f,dataIndex:g,color:m,maskId:v})=>{const b=E.jsx(Y2e,j({id:f,dataIndex:g,color:m},s,{onClick:i&&(x=>{i(x,{type:"bar",seriesId:f,dataIndex:g})}),style:p}));return u?b:E.jsx("g",{clipPath:`url(#${v})`,children:b})}),a&&E.jsx(uFe,j({bars:e,skipAnimation:c,barLabel:a},s))]})}function ru(t){return t instanceof Date?t.getTime():t}const yFe=t=>{const e=TS(),r=Ki(),{xAxis:n,yAxis:i,xAxisIds:o,yAxisIds:a}=Ji(),{dispatch:s}=R.useContext(Jc),c=o[0],u=a[0],d=R.useRef({isInChart:!1,x:-1,y:-1});R.useEffect(()=>{const h=e.current;if(h===null||t)return()=>{};function p(v,b){const{scale:x,data:y,reverse:C}=v;if(!al(x)){const I=x.invert(b);if(y===void 0)return{value:I,index:-1};const _=ru(I),T=y==null?void 0:y.findIndex((O,P)=>{const k=ru(O);return k>_&&(P===0||Math.abs(_-k)<=Math.abs(_-ru(y[P-1])))||k<=_&&(P===y.length-1||Math.abs(ru(I)-k)<Math.abs(ru(I)-ru(y[P+1])))});return{value:T!==void 0&&T>=0?y[T]:I,index:T}}const w=x.bandwidth()===0?Math.floor((b-Math.min(...x.range())+x.step()/2)/x.step()):Math.floor((b-Math.min(...x.range()))/x.step());if(w<0||w>=y.length)return null;if(C){const I=y.length-1-w;return{index:I,value:y[I]}}return{index:w,value:y[w]}}const f=()=>{d.current={isInChart:!1,x:-1,y:-1},s({type:"exitChart"})},g=v=>{const b="targetTouches"in v?v.targetTouches[0]:v,x=yLe(h,b);if(d.current.x=x.x,d.current.y=x.y,!r.isPointInside(x,{targetElement:v.target})){d.current.isInChart&&(s({type:"exitChart"}),d.current.isInChart=!1);return}d.current.isInChart=!0;const y=p(n[c],x.x),C=p(i[u],x.y);s({type:"updateAxis",data:{x:y,y:C}})},m=v=>{const b=v.currentTarget;b&&b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId)};return h.addEventListener("pointerdown",m),h.addEventListener("pointermove",g),h.addEventListener("pointerout",f),h.addEventListener("pointercancel",f),h.addEventListener("pointerleave",f),()=>{h.removeEventListener("pointerdown",m),h.removeEventListener("pointermove",g),h.removeEventListener("pointerout",f),h.removeEventListener("pointercancel",f),h.removeEventListener("pointerleave",f)}},[e,s,u,i,c,n,t,r])},bFe=["children","width","height","viewBox","disableAxisListener","className","title","desc"],xFe=Cr("svg",{name:"MuiChartsSurface",slot:"Root"})(()=>({touchAction:"none"})),wFe=R.forwardRef(function(e,r){const n=rs({props:e,name:"MuiChartsSurface"}),{children:i,width:o,height:a,viewBox:s,disableAxisListener:c=!1,className:u,title:d,desc:h}=n,p=Fe(n,bFe),f=j({width:o,height:a,x:0,y:0},s);return yFe(c),E.jsxs(xFe,j({width:o,height:a,viewBox:`${f.x} ${f.y} ${f.width} ${f.height}`,ref:r,className:u},p,{children:[E.jsx("title",{children:d}),E.jsx("desc",{children:h}),i]}))});function CU(t){const{isReversed:e,gradientId:r,size:n,direction:i,scale:o,colorMap:a}=t;return n<=0?null:E.jsx("linearGradient",{id:r,x1:"0",x2:"0",y1:"0",y2:"0",[`${i}${e?1:2}`]:`${n}px`,gradientUnits:"userSpaceOnUse",children:a.thresholds.map((s,c)=>{const u=o(s);if(u===void 0)return null;const d=e?1-u/n:u/n;return E.jsxs(R.Fragment,{children:[E.jsx("stop",{offset:d,stopColor:a.colors[c],stopOpacity:1}),E.jsx("stop",{offset:d,stopColor:a.colors[c+1],stopOpacity:1})]},s.toString()+c)})})}function CFe(){const{chartId:t}=R.useContext(Kv);return R.useCallback((e,r)=>`${t}-gradient-${r}-${e}`,[t])}function IFe(){const{top:t,height:e,bottom:r,left:n,width:i,right:o}=Ki(),a=t+e+r,s=n+i+o,c=CFe(),{xAxisIds:u,xAxis:d,yAxisIds:h,yAxis:p}=Ji();return E.jsxs("defs",{children:[h.filter(f=>p[f].colorMap!==void 0).map(f=>{const g=c(f,"y"),{colorMap:m,scale:v,colorScale:b,reverse:x}=p[f];return(m==null?void 0:m.type)==="piecewise"?E.jsx(CU,{isReversed:!x,scale:v,colorMap:m,size:a,gradientId:g,direction:"y"},g):(m==null?void 0:m.type)==="continuous"?E.jsx(wz,{isReversed:!x,scale:v,colorScale:b,colorMap:m,size:a,gradientId:g,direction:"y"},g):null}),u.filter(f=>d[f].colorMap!==void 0).map(f=>{const g=c(f,"x"),{colorMap:m,scale:v,reverse:b,colorScale:x}=d[f];return(m==null?void 0:m.type)==="piecewise"?E.jsx(CU,{isReversed:b,scale:v,colorMap:m,size:s,gradientId:g,direction:"x"},g):(m==null?void 0:m.type)==="continuous"?E.jsx(wz,{isReversed:b,scale:v,colorScale:x,colorMap:m,size:s,gradientId:g,direction:"x"},g):null})]})}const IU=(t,e,r)=>{var i;const n=r==="x"?B1:z1;return[...(i=t==null?void 0:t.map((o,a)=>j({id:`defaultized-${r}-axis-${a}`},o)))!=null?i:[],...t===void 0||t.findIndex(({id:o})=>o===n)===-1?[{id:n,scaleType:"linear"}]:[]].map(o=>{const a=o.dataKey;if(a===void 0||o.data!==void 0)return o;if(e===void 0)throw new Error(`MUI X: ${r}-axis uses \`dataKey\` but no \`dataset\` is provided.`);return j({},o,{data:e.map(s=>s[a])})})},SFe=(t,e,r)=>{const n=R.useMemo(()=>IU(t,r,"x"),[t,r]),i=R.useMemo(()=>IU(e,r,"y"),[e,r]);return[n,i]},_Fe=["width","height","series","margin","xAxis","yAxis","zAxis","colors","dataset","sx","title","desc","disableAxisListener","highlightedItem","onHighlightChange","plugins","children","skipAnimation"],TFe=(t,e)=>{const{width:r,height:n,series:i,margin:o,xAxis:a,yAxis:s,zAxis:c,colors:u,dataset:d,sx:h,title:p,desc:f,disableAxisListener:g,highlightedItem:m,onHighlightChange:v,plugins:b,children:x,skipAnimation:y}=t,C=Fe(t,_Fe),w=R.useRef(null),I=ad(e,w),[_,T]=SFe(a,s,d),O={width:r,height:n,margin:o,svgRef:w},P={skipAnimation:y},k={plugins:b},S={series:i,colors:u,dataset:d},M={xAxis:_,yAxis:T,dataset:d},$={zAxis:c,dataset:d},D={highlightedItem:m,onHighlightChange:v},N=j({},C,{width:r,height:n,ref:I,sx:h,title:p,desc:f,disableAxisListener:g});return{children:x,drawingProviderProps:O,seriesProviderProps:S,cartesianProviderProps:M,zAxisContextProps:$,highlightedProviderProps:D,chartsSurfaceProps:N,pluginProviderProps:k,animationProviderProps:P,xAxis:_,yAxis:T}},kFe=R.forwardRef(function(e,r){const{children:n,drawingProviderProps:i,seriesProviderProps:o,cartesianProviderProps:a,zAxisContextProps:s,highlightedProviderProps:c,chartsSurfaceProps:u,pluginProviderProps:d,animationProviderProps:h}=TFe(e,r);return E.jsx(DDe,j({},i,{children:E.jsx(QOe,j({},d,{children:E.jsx(tRe,j({},o,{children:E.jsx(HDe,j({},a,{children:E.jsx(RDe,j({},s,{children:E.jsx(P$e,{children:E.jsx(oRe,j({},c,{children:E.jsxs(wFe,j({},u,{children:[E.jsx(IFe,{}),E.jsx(hFe,j({},h,{children:n}))]}))}))})}))}))}))}))}))}),AFe=Cr("div",{name:"MuiResponsiveChart",slot:"Container"})(({ownerState:t})=>{var e,r;return{width:(e=t.width)!=null?e:"100%",height:(r=t.height)!=null?r:"100%",display:"flex",position:"relative",flexGrow:1,flexDirection:"column",alignItems:"center",justifyContent:"center",overflow:"hidden","&>svg":{width:"100%",height:"100%"}}}),PFe=(t,e,r)=>{const n=R.useRef({displayError:!1,initialCompute:!0,computeRun:0}),i=R.useRef(null),[o,a]=R.useState(0),[s,c]=R.useState(0),u=R.useCallback(()=>{const d=i==null?void 0:i.current;if(!d)return{};const p=Qne(d).getComputedStyle(d),f=Math.floor(parseFloat(p.height))||0,g=Math.floor(parseFloat(p.width))||0;return a(g),c(f),{width:g,height:f}},[]);return R.useEffect(()=>{n.current.displayError=!0},[]),Da(()=>{if(!r||!n.current.initialCompute||n.current.computeRun>20)return;const d=u();d.width!==o||d.height!==s?n.current.computeRun+=1:n.current.initialCompute&&(n.current.initialCompute=!1)},[o,s,u,r]),Da(()=>{if(t!==void 0&&e!==void 0)return()=>{};u();const d=i.current;if(typeof ResizeObserver=="undefined")return()=>{};let h;const p=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{u()})});return d&&p.observe(d),()=>{h&&cancelAnimationFrame(h),d&&p.unobserve(d)}},[u,e,t]),{containerRef:i,width:t!=null?t:o,height:e!=null?e:s}},EFe=["width","height","resolveSizeBeforeRender","margin","children","series","colors","dataset","desc","disableAxisListener","highlightedItem","onHighlightChange","plugins","sx","title","viewBox","xAxis","yAxis","zAxis","skipAnimation"],OFe=(t,e)=>{const{width:r,height:n,resolveSizeBeforeRender:i,margin:o,children:a,series:s,colors:c,dataset:u,desc:d,disableAxisListener:h,highlightedItem:p,onHighlightChange:f,plugins:g,sx:m,title:v,viewBox:b,xAxis:x,yAxis:y,zAxis:C,skipAnimation:w}=t,I=Fe(t,EFe),{containerRef:_,width:T,height:O}=PFe(r,n,i),P=j({},I,{ownerState:{width:r,height:n},ref:_});return{hasIntrinsicSize:T&&O,chartContainerProps:{margin:o,children:a,series:s,colors:c,dataset:u,desc:d,disableAxisListener:h,highlightedItem:p,onHighlightChange:f,plugins:g,sx:m,title:v,viewBox:b,xAxis:x,yAxis:y,zAxis:C,skipAnimation:w,width:T,height:O,ref:e},resizableChartContainerProps:P}},RFe=R.forwardRef(function(e,r){const{hasIntrinsicSize:n,chartContainerProps:i,resizableChartContainerProps:o}=OFe(e,r);return E.jsx(AFe,j({},o,{children:n?E.jsx(kFe,j({},i)):null}))}),MFe=["message"],DFe=Cr("text")(({theme:t})=>j({},t.typography.body2,{stroke:"none",fill:t.palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function $Fe(t){const{message:e}=t,r=Fe(t,MFe),{top:n,left:i,height:o,width:a}=Ki();return E.jsx(DFe,j({x:i+a/2,y:n+o/2},r,{children:e!=null?e:"Loading data…"}))}const LFe=["message"],FFe=Cr("text")(({theme:t})=>j({},t.typography.body2,{stroke:"none",fill:t.palette.text.primary,shapeRendering:"crispEdges",textAnchor:"middle",dominantBaseline:"middle"}));function NFe(t){const{message:e}=t,r=Fe(t,LFe),{top:n,left:i,height:o,width:a}=Ki();return E.jsx(FFe,j({x:i+a/2,y:n+o/2},r,{children:e!=null?e:"No data to display"}))}function jFe(){const t=ns();return Object.values(t).every(e=>{if(!e)return!0;const{series:r,seriesOrder:n}=e;return n.every(i=>r[i].data.length===0)})}function BFe(t){var r,n,i,o,a,s;const e=jFe();if(t.loading){const c=(n=(r=t.slots)==null?void 0:r.loadingOverlay)!=null?n:$Fe;return E.jsx(c,j({},(i=t.slotProps)==null?void 0:i.loadingOverlay))}if(e){const c=(a=(o=t.slots)==null?void 0:o.noDataOverlay)!=null?a:NFe;return E.jsx(c,j({},(s=t.slotProps)==null?void 0:s.noDataOverlay))}return null}const zFe=["xAxis","yAxis","series","width","height","margin","colors","dataset","sx","tooltip","onAxisClick","axisHighlight","legend","grid","topAxis","leftAxis","rightAxis","bottomAxis","children","slots","slotProps","skipAnimation","loading","layout","onItemClick","highlightedItem","onHighlightChange","borderRadius","barLabel","className"],UFe=t=>{const{xAxis:e,yAxis:r,series:n,width:i,height:o,margin:a,colors:s,dataset:c,sx:u,tooltip:d,onAxisClick:h,axisHighlight:p,legend:f,grid:g,topAxis:m,leftAxis:v,rightAxis:b,bottomAxis:x,children:y,slots:C,slotProps:w,skipAnimation:I,loading:_,layout:T,onItemClick:O,highlightedItem:P,onHighlightChange:k,borderRadius:S,barLabel:M,className:$}=t,D=Fe(t,zFe),z=`${mR()}-clip-path`,U=T==="horizontal"||T===void 0&&n.some(ae=>ae.layout==="horizontal"),V={scaleType:"band",data:Array.from({length:Math.max(...n.map(ae=>{var oe,Ce;return((Ce=(oe=ae.data)!=null?oe:c)!=null?Ce:[]).length}))},(ae,oe)=>oe)},q=j({},D,{series:n.map(ae=>j({type:"bar"},ae,{layout:U?"horizontal":"vertical"})),width:i,height:o,margin:a,colors:s,dataset:c,xAxis:e!=null?e:U?void 0:[j({id:B1},V)],yAxis:r!=null?r:U?[j({id:z1},V)]:void 0,sx:u,highlightedItem:P,onHighlightChange:k,disableAxisListener:(d==null?void 0:d.trigger)!=="axis"&&(p==null?void 0:p.x)==="none"&&(p==null?void 0:p.y)==="none"&&!h,className:$,skipAnimation:I}),F={onItemClick:O,slots:C,slotProps:w,borderRadius:S,barLabel:M},B={onAxisClick:h},H={vertical:g==null?void 0:g.vertical,horizontal:g==null?void 0:g.horizontal},G={clipPath:`url(#${z})`},Z={id:z},Y={slots:C,slotProps:w,loading:_},Q={topAxis:m,leftAxis:v,rightAxis:b,bottomAxis:x,slots:C,slotProps:w},K=j({},U?{y:"band"}:{x:"band"},p),X=j({},f,{slots:C,slotProps:w}),ee=j({},d,{slots:C,slotProps:w});return{chartContainerProps:q,barPlotProps:F,axisClickHandlerProps:B,gridProps:H,clipPathProps:Z,clipPathGroupProps:G,overlayProps:Y,chartsAxisProps:Q,axisHighlightProps:K,legendProps:X,tooltipProps:ee,children:y}},HFe=R.forwardRef(function(e,r){const n=rs({props:e,name:"MuiBarChart"}),{chartContainerProps:i,barPlotProps:o,axisClickHandlerProps:a,gridProps:s,clipPathProps:c,clipPathGroupProps:u,overlayProps:d,chartsAxisProps:h,axisHighlightProps:p,legendProps:f,tooltipProps:g,children:m}=UFe(n);return E.jsxs(RFe,j({ref:r},i,{children:[n.onAxisClick&&E.jsx(bLe,j({},a)),E.jsx(v$e,j({},s)),E.jsxs("g",j({},u,{children:[E.jsx(vFe,j({},o)),E.jsx(BFe,j({},d)),E.jsx(vLe,j({},p))]})),E.jsx(u$e,j({},h)),E.jsx(pLe,j({},f)),!n.loading&&E.jsx(Q$e,j({},g)),E.jsx(VDe,j({},c)),m]}))}),VFe=t=>{const{Spinner:e}=er.useComponentContext(),r=_t(zt);if(!t.chartData)return E.jsx(e,{my:10});const n=()=>E.jsx(HFe,{borderRadius:5,sx:{[`& .${PS.line}`]:{strokeDasharray:"5 3",strokeWidth:1},"& .MuiChartsLegend-series tspan":{fontSize:"18px"}},margin:{bottom:80,top:60},height:375,grid:{vertical:!1,horizontal:!0},bottomAxis:{tickLabelStyle:{angle:-45,textAnchor:"end"},disableTicks:!0},xAxis:[{scaleType:"band",data:t.chartData.map(i=>i.date)}],yAxis:[{disableTicks:!0}],series:[{data:t.chartData.map(i=>i.participations||0),color:"#2a63c5",label:r.participations,valueFormatter:i=>`${i}`}],slotProps:{popper:{sx:{"& .MuiChartsTooltip-paper":{backgroundColor:"white",opacity:.9},"& .MuiChartsTooltip-row":{backgroundColor:"#FFF",height:50},"& .MuiChartsTooltip-table":{backgroundColor:"#F0F4F8",textAlign:"center"}}}}});return E.jsx(Oe,{textAlign:"center",bgcolor:"white",children:n()})},WFe=({game:t})=>{const e=_t(zt),r=[{title:e.finishedParticipations,value:t.finishedParticipationsCount},{title:e.totalParticipations,value:t.totalParticipationsCount},{title:e.averageStartedParticipations,value:parseFloat(t.averageStartedParticipationsCount.toFixed(2))},{title:e.averageFinishedParticipations,value:parseFloat(t.averageFinishedParticipationsCount.toFixed(2))}];return E.jsx(E.Fragment,{children:E.jsx(zl,{variant:"soft",sx:{p:2,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)",cursor:"default","&hover":{backgroundColor:"transparent"}},children:E.jsxs(Ma,{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:[E.jsx("thead",{children:E.jsxs("tr",{children:[E.jsx("th",{style:{width:"80%"},children:e.participationOverview}),E.jsx("th",{children:e.optionsValue})]})}),E.jsx("tbody",{children:r.map(n=>E.jsxs("tr",{children:[E.jsx("td",{children:E.jsx(ze,{fontWeight:"md",children:n.title})}),E.jsx("td",{children:n.value})]},`report-${n.title}`))})]})})})},qFe=t=>{const[e,r]=W.useState("statistics"),[n,i]=W.useState(null),[o,a]=W.useState(!1),s=_t(zt),{https:c}=er.useAPIContext(),{Toast:u}=er.useComponentContext();W.useEffect(()=>{if(!((n==null?void 0:n.length)>0))return d(),()=>{i(null)}},[]);const d=()=>L(this,null,function*(){var g;const h=el(t.game.createdAt).format("YYYY-MM-DD"),p=el(new Date).format("YYYY-MM-DD"),f=yield c.getEntityParticipations(t.game.id,h,p);if(f.ok){const v=(g=(yield f.json()).data)==null?void 0:g.breakdown.map(b=>({date:el(b.date).format("DD MMM YYYY"),participations:b.count})).sort((b,x)=>el(b.date).valueOf()-el(x.date).valueOf());i(v);return}console.error(yield f.json()),i([]),a(!0)});return E.jsxs(hn,{variant:"soft",sx:{borderRadius:0,boxShadow:"inset 0 3px 6px 0 rgba(0 0 0 / 0.08)"},children:[E.jsx($n,{children:E.jsxs(Oe,{mb:1,children:[E.jsx(Oe,{display:"flex",alignItems:"center",mb:1,children:E.jsxs(br,{value:e,size:"sm",sx:{mx:"auto",marginBottom:"5px"},onChange:(h,p)=>r(p),children:[E.jsx(qt,{value:"statistics",children:"Statistics"}),E.jsx(qt,{value:"chart",children:"Performance by day"})]})}),e==="chart"&&E.jsx(VFe,{chartData:n}),e==="statistics"&&E.jsx(WFe,{game:t.game})]})}),E.jsx(u,{showToast:o,color:"danger",message:s.chartErrorMessage,hideToast:()=>a(!1)})]})},GFe=t=>{const e=_t(zt);return E.jsxs(nw,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[E.jsxs(rw,{sx:{borderRadius:0,cursor:"default",fontSize:"0.875rem",[`& .${sR.root}`]:{'&[aria-selected="true"]':{bgcolor:"#fff",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[E.jsx(Ul,{children:e.standings}),E.jsx(Ul,{children:e.reports}),E.jsx(Ul,{children:e.exports})]}),E.jsx(id,{value:0,sx:{p:0},children:E.jsx(mOe,{game:t.eitherOr})}),E.jsx(id,{value:1,sx:{p:0,cursor:"default"},children:E.jsx(qFe,{game:t.eitherOr})}),E.jsx(id,{value:2,sx:{p:0,cursor:"default"},children:E.jsx(vOe,{game:t.eitherOr})})]})},YFe=({row:t,onClickEdit:e,onDelete:r})=>{var h,p;const[n,i]=W.useState(!1),{isMobile:o}=er.useIsMobile(),a=_t(zt),s=_t(aa),c=f=>{switch(f){case"ACTIVE":return"success";case"INACTIVE":return"danger";default:return"neutral"}},u=f=>{f.stopPropagation(),i(!n)},d=()=>{var f;return E.jsx(E.Fragment,{children:!o&&E.jsxs(E.Fragment,{children:[E.jsx("td",{children:((f=s.types.find(g=>g.id===t.type))==null?void 0:f.label)||"No type"}),E.jsx("td",{children:t.totalUsersCount}),E.jsx("td",{children:el(t.createdAt).format(a.timeFormat)})]})})};return E.jsxs(E.Fragment,{children:[E.jsxs("tr",{onClick:e,children:[E.jsx("td",{children:E.jsx(Et,{title:a.additionalInformation,children:E.jsx(ur,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",onClick:u,children:n?E.jsx(GR,{}):E.jsx(qR,{})})})}),E.jsx("td",{scope:"row",children:t.title}),E.jsx("td",{children:E.jsx(dn,{color:c(t.status),variant:"solid",size:"sm",children:t.status})}),E.jsx("td",{children:o?((h=mt[t.language])==null?void 0:h.key)||"N/A":((p=mt[t.language])==null?void 0:p.name)||"N/A"}),d(),E.jsx("td",{children:E.jsx(fOe,{eitherOr:t,onClickEdit:e,onDelete:r})})]}),E.jsx("tr",{children:E.jsx("td",{style:{height:0,padding:0},colSpan:8,children:n?E.jsx(GFe,{eitherOr:t}):E.jsx(E.Fragment,{})})})]})},KFe=({row:t,isSelected:e,onRowSelect:r})=>{const[n,i]=W.useState(null),[o,a]=W.useState(!1),[s,c]=W.useState(!1),[u,d]=W.useState(!1),{Spinner:h,Toast:p}=er.useComponentContext(),{https:f}=er.useAPIContext(),g=_t(zt);W.useEffect(()=>{o&&!n&&L(this,null,function*(){c(!0);const y=yield f.getEitherOrById(t.id,_B);if(y.ok){const C=yield y.json();i(C.data),c(!1)}else console.error(yield y.json()),i(null),c(!1),d(!0)})},[o]);const m=x=>{x.stopPropagation(),a(!o)},v=()=>{r(t.id)},b=()=>s||!s&&!n?E.jsx(h,{my:10}):E.jsxs(Ma,{variant:"outlined",size:"sm",sx:{"& > 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:[E.jsx("thead",{children:E.jsx("tr",{children:E.jsx("th",{children:E.jsxs(Oe,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[E.jsx(ze,{level:"body-sm",children:g.options}),E.jsxs(ze,{level:"body-sm",children:[g.winningCondition,":",E.jsx(dn,{sx:{ml:.5},color:n.winning_condition==="LESS"?"danger":"success",size:"sm",children:n.winning_condition})]}),E.jsx(ze,{level:"body-sm",children:g.optionsValue})]})})})}),E.jsx("tbody",{children:n==null?void 0:n.options.sort((x,y)=>n.winning_condition==="LESS"?x.value-y.value:y.value-x.value).map(x=>E.jsx("tr",{children:E.jsx("td",{children:E.jsxs(Oe,{display:"flex",flexDirection:"row",justifyContent:"space-between",children:[E.jsx(ze,{level:"body-sm",children:x.label}),E.jsx(ze,{level:"body-sm",children:x.value})]})})},`option-${x.label}`))})]});return E.jsxs(E.Fragment,{children:[E.jsxs("tr",{onClick:v,children:[E.jsx("td",{children:E.jsx(ed,{checked:e,onChange:v})}),E.jsx("td",{scope:"row",children:t.title}),E.jsx("td",{children:el(t.createdAt).format(g.timeFormat)}),E.jsx("td",{children:E.jsx(Et,{title:o?"":g.expand,children:E.jsx(ur,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",onClick:m,children:o?E.jsx(GR,{}):E.jsx(qR,{})})})})]}),E.jsx("tr",{children:E.jsx("td",{style:{height:0,padding:o?10:0},colSpan:9,children:o?b():E.jsx(E.Fragment,{})})}),E.jsx(p,{showToast:u,color:"danger",message:g.getEitherOrErrorMessage,hideToast:()=>d(!u)})]})},SU=t=>{const{isMobile:e}=er.useIsMobile(),r=_t(zt),n=t.pageGames.get(t.pageCount),i=t.pageCount===1,o=t.pageGames.get(t.pageCount).length<t.gamesPerPage,a=[r.type,r.users,r.creationDate],s=()=>E.jsxs("tr",{children:[E.jsx("th",{style:{width:40},"aria-label":"empty"}),E.jsx("th",{style:{width:e?"60%":"40%"},children:r.title}),E.jsx("th",{style:{width:e?"20%":100},children:r.status}),E.jsx("th",{style:{width:e?"20%":100},children:r.language}),!e&&a.map(u=>E.jsx("th",{children:u},u)),E.jsx("th",{style:{width:e?"20%":100},children:r.actions})]}),c=()=>E.jsxs("tr",{children:[E.jsx("th",{style:{width:40},"aria-label":"empty"}),E.jsx("th",{style:{width:"70%"},children:r.title}),E.jsx("th",{style:{width:"30%"},children:r.creationDate}),E.jsx("th",{style:{width:40},"aria-label":"empty"})]});return E.jsx(Oe,{sx:Be(ce({},t.sx),{overflowX:"auto",width:"100%"}),children:E.jsxs(Ma,{hoverRow:!0,"aria-label":"collapsible table",sx:{"& > tbody > tr:nth-of-type(even)":{"&:hover":{backgroundColor:"transparent"}},'& > tbody > tr:nth-of-type(odd) > td, & > tbody > tr:nth-of-type(odd) > th[scope="row"]':{borderBottom:0},"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:t.isGameTemplate?"left":"right"},"& > tbody > tr":{cursor:"pointer"},"& > tfoot > tr > *":{backgroundColor:"white"}},children:[E.jsx("thead",{children:t.isGameTemplate?c():s()}),E.jsx("tbody",{children:n.map(u=>t.isGameTemplate?E.jsx(KFe,{row:u,isSelected:t.selectedGames.includes(u.id),onRowSelect:t.onRowSelect},u.id):E.jsx(YFe,{row:u,onClickEdit:()=>t.onClickEdit(u.id),onDelete:t.onDelete},u.id))}),E.jsx(cOe,{pageCount:t.pageCount,disablePreviousPage:i,disableNextPage:o,goToPreviousPage:t.getPreviousPage,goToNextPage:t.getNextPage})]})})},JFe={apiKey:"AIzaSyB6JILBJiJ0Z2pxw0-nudOpRAzqFk6D6Lw",clientId:"content",environment:"prod",lang:"en",errorHandlingMode:"standard",authProvider:{getIdToken:()=>"",logout:()=>{}}},QFe=new Th,XFe=({fansUnitedEnvironment:t,isOpen:e,onImport:r,onClose:n})=>{const[i,o]=W.useState(1),[a,s]=W.useState(null),[c,u]=W.useState(new Map),[d,h]=W.useState(new PB),[p,f]=W.useState([]),[g,m]=W.useState(!1),[v,b]=W.useState(""),[x,y]=W.useState([]),[C,w]=W.useState(!1),[I,_]=W.useState(!1),{Spinner:T,Toast:O}=er.useComponentContext(),{https:P}=er.useAPIContext(),k=_t(zt),S=_t(aa),M=gk(JFe);W.useEffect(()=>(e&&D(!0),()=>{s(""),u(null),o(1),y([])}),[d,e]),W.useEffect(()=>{i!==1&&c&&Array.from(c.keys()).length>0&&!Array.from(c.keys()).includes(i)&&D(!1)},[i]);const $=B=>{m(!0),b(B)},D=B=>L(this,null,function*(){const H=B?ce({},d):Be(ce({},d),{startAfter:a});try{const G=yield M.miniGames.getEitherOrs(H,!1,!0);s(G.meta.pagination.nextPageStartsAfter);const Z=B?new Map:new Map(c);Z.set(B?1:i,G.data),u(Z),B&&o(1)}catch(G){$(k.getEitherOrsErrorMessage)}}),N=()=>o(B=>B-1),z=()=>o(B=>B+1),U=B=>{if(!x.includes(B))y([...x,B]);else{const H=x.filter(G=>G!==B);y(H)}},V=()=>{o(1),u(new Map),y([])},q=()=>L(this,null,function*(){const B=[];return x.forEach(H=>{B.push(P.getEitherOrById(H,_B).then(G=>G.json()).then(G=>G.data))}),Promise.all(B)}),F=(B=!1)=>L(this,null,function*(){B?_(!0):w(!0);let H=[];try{H=yield q()}catch(Z){console.error(Z),$(k.getEitherOrsErrorMessage),B?_(!1):w(!1);return}if(B)try{H=yield j1(H,S.languageConfig.default_language,"en")}catch(Z){$(k.gameTranslationErrorMessage),_(!1);return}const G=[];H.forEach(Z=>{var X;const Y=QFe.finalizeNewRequestBody(Z,S),Q=B?S.languageConfig.default_language:"en";Y.language=Q;const K=S.languageConfig.translation_rules&&((X=S.languageConfig.translation_rules[Q])==null?void 0:X.game_status)||"INACTIVE";Y.status=K,G.push(P.createEitherOr(ce({},Y)))}),Promise.all(G).then(()=>{n(),r()}).catch(Z=>{$(Z)}),B?_(!1):w(!1)});return E.jsx(As,{open:e,onClose:n,children:E.jsxs(E.Fragment,{children:[E.jsxs(Es,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[E.jsx(ks,{children:k.browseEitherOrGames}),E.jsx(Ni,{}),E.jsx(Ts,{sx:{overflowX:"hidden"},children:E.jsxs(E.Fragment,{children:[E.jsx(EB,{filters:d,options:p,setOptions:f,setFilters:h,handleResetData:V,showStatusFilter:!1}),(!c||!c.get(i))&&d.flags.length===0&&d.entityIds.length===0?E.jsx(T,{my:"10%"}):E.jsx(E.Fragment,{}),c&&c.size>0&&c.get(i)&&c.get(i).length>0?E.jsx(SU,{pageGames:c,pageCount:i,gamesPerPage:d.limit,getPreviousPage:N,getNextPage:z,isGameTemplate:!0,selectedGames:x,onRowSelect:U,sx:{backgroundColor:"white"}}):E.jsx(E.Fragment,{}),c&&c.size>0&&c.get(i)&&c.get(i).length===0?E.jsx(ze,{level:"h2",textAlign:"center",fontWeight:"bold",fontSize:"xl",my:20,children:k.noTemplateGamesFound}):E.jsx(E.Fragment,{})]})}),E.jsxs(Bl,{children:[S.languageConfig.default_language&&!S.languageConfig.default_language.startsWith("en")&&E.jsx(lt,{variant:"outlined",color:"primary",loading:I,disabled:x.length===0,onClick:()=>F(!0),children:k.translateAndImport.replace("_language_",kh[S.languageConfig.default_language].name)}),E.jsx(lt,{variant:"solid",color:"primary",loading:C,disabled:x.length===0,onClick:()=>F(),children:k.import}),E.jsx(lt,{variant:"plain",color:"neutral",onClick:B=>{B.stopPropagation(),n()},children:k.close})]})]}),E.jsx(O,{showToast:g,color:"danger",message:v,hideToast:()=>m(!g)})]})})},ZFe=({fansUnitedEnvironment:t,hideSignOutButton:e})=>{const[r,n]=W.useState(new PB),[i,o]=W.useState(1),[a,s]=W.useState(null),[c,u]=W.useState(new Map),[d,h]=W.useState(null),[p,f]=W.useState(null),[g,m]=W.useState(null),[v,b]=W.useState(!1),[x,y]=W.useState(!1),[C,w]=W.useState(!1),[I,_]=W.useState(!1),[T,O]=W.useState(!1),[P,k]=W.useState(""),[S,M]=W.useState("danger"),[$,D]=W.useState([]),{sdk:N,https:z}=er.useAPIContext(),{HeaderButtons:U,Spinner:V,Toast:q}=er.useComponentContext(),F=_t(zt),B=(ae,oe)=>{O(!0),k(oe),M(ae)};W.useEffect(()=>(H(),()=>{s(null),u(null)}),[r]),W.useEffect(()=>{G()},[i]);const H=()=>L(this,null,function*(){y(!0);try{const ae=yield N.miniGames.getEitherOrs(r,!1,!0);s(ae.meta.pagination.nextPageStartsAfter);const oe=new Map;oe.set(1,ae.data),u(oe),o(1)}catch(ae){console.error(ae),B("danger",F.getEitherOrsErrorMessage)}y(!1)}),G=()=>L(this,null,function*(){if(i!==1&&c&&Array.from(c.keys()).length>0&&!Array.from(c.keys()).includes(i)){y(!0);try{const ae=yield N.miniGames.getEitherOrs(Be(ce({},r),{startAfter:a}),!1,!0);if(ae.data.length>0){const oe=new Map(c);oe.set(i,ae.data),u(oe),s(ae.meta.pagination.nextPageStartsAfter)}}catch(ae){console.error(ae),B("danger",F.getEitherOrsErrorMessage)}y(!1)}}),Z=()=>o(ae=>ae-1),Y=()=>o(ae=>ae+1),Q=ae=>L(this,null,function*(){var Ce;w(!0);const oe=yield z.getEitherOrById(ae);if(oe.ok){const be=yield oe.json(),ge=(Ce=be.data.related)==null?void 0:Ce.filter(ve=>ve.entity_relationship==="translatedFrom"||ve.entity_relationship==="translatedTo");if((ge==null?void 0:ge.length)>0){const ve=new Set,ne=be.data.related.filter(le=>(le.entity_relationship==="translatedFrom"||le.entity_relationship==="translatedTo")&&!ve.has(le.entity_id)?(ve.add(le.entity_id),!0):!1).map(le=>z.getEitherOrById(le.entity_id).then(he=>he.json()).then(he=>he.data));Promise.all(ne).then(le=>{var ye;const he=(ye=be.data.related.find(pe=>pe.entity_relationship==="translatedFrom"))==null?void 0:ye.entity_id;he&&he!==be.data.id&&m(le.find(pe=>(pe==null?void 0:pe.id)===he)),f(le.filter(pe=>pe!==void 0&&pe.id!==he))})}h(be.data),w(!1),b(!0)}else console.error(F.getEitherOrErrorMessage,yield oe.json()),B("danger",F.getEitherOrErrorMessage),w(!1)}),K=()=>{o(1),s(null),u(null)},X=()=>{h(null),f(null),m(null),b(!v),H()},ee=()=>{K(),H()};return C?E.jsx(V,{my:60}):v?E.jsx(sOe,{eitherOrById:d,relatedGames:p,relatedParentTitle:g==null?void 0:g.title,onClickBack:X,loadParent:()=>{X(),Q(g.id)}}):E.jsxs(E.Fragment,{children:[E.jsx(U,{createLabel:F.create,createFromTemplateLabel:F.createFromTemplate,signOutLabel:e?"":F.signOut,environment:t,onClickCreate:()=>b(!0),onClickCreateFromTemplate:()=>_(!0)}),E.jsxs(lOe,{children:[E.jsx(EB,{filters:r,options:$,setOptions:D,setFilters:n,handleResetData:K}),x?E.jsx(V,{my:40}):E.jsx(E.Fragment,{}),!x&&c&&c.size>0&&c.get(i)&&c.get(i).length>0?E.jsx(SU,{pageGames:c,pageCount:i,gamesPerPage:r.limit,getPreviousPage:Z,getNextPage:Y,onClickEdit:Q,onDelete:ee}):E.jsx(E.Fragment,{}),c&&c.size>0&&c.get(i)&&c.get(i).length===0?E.jsx(ze,{level:"h2",textAlign:"center",fontWeight:"bold",fontSize:"xl",my:40,children:F.noGamesFound}):E.jsx(E.Fragment,{})]}),E.jsx(q,{showToast:T,color:S,message:P,hideToast:()=>O(!T)}),E.jsx(XFe,{fansUnitedEnvironment:t,isOpen:I,onImport:ee,onClose:()=>_(!1)})]})},eNe=({hideSignOutButton:t,fansUnitedEnvironment:e})=>{const[r,n]=W.useState(null),[i,o]=W.useState(!1),[a,s]=W.useState(!1),[c,u]=W.useState(new IB),{AuthContext:d,useComponentContext:h,useAPIContext:p}=er,f=W.useContext(d),g=W.useContext(zt),{Login:m,Spinner:v,NoPermissionCard:b,Toast:x}=h(),{https:y}=p(),C=()=>L(this,null,function*(){if(f){o(!0);const w=yield y.getEitherOrFeature(),I=yield w.json();if(w.ok){const _=I.data.types,T=I.data.auth_requirement,O=yield y.getLanguageConfig(),P=yield O.json();let k=null;O.ok?k=P.data:console.warn("There was a problem with fetching client language configuration. API error: ",P),n(!I.data.enabled),u({types:_,authRequirement:T,languageConfig:k}),o(!1);return}console.error(I),n(!0),o(!1),s(!0)}});return W.useEffect(()=>(C(),()=>{n(null),u(new IB)}),[f]),i?E.jsx(v,{my:60}):f?f&&r===!0?E.jsx(b,{labels:g,environment:e,setNoPermission:n}):E.jsxs(E.Fragment,{children:[f&&r===!1?E.jsx(REe,{features:c,children:E.jsx(MEe,{children:E.jsx(ZFe,{hideSignOutButton:t,fansUnitedEnvironment:e})})}):E.jsx(E.Fragment,{}),E.jsx(x,{showToast:a,color:"danger",message:g.clientFeaturesNotFoundMessage,hideToast:()=>s(!1)})]}):E.jsx(m,{environment:e,userNotFound:g.userNotFound})},tNe=t=>{const e={apiKey:t.fansUnitedApiKey,clientId:t.fansUnitedClientId,environment:t.fansUnitedEnvironment,language:t.fansUnitedLanguage,sportal365Project:t.sportal365Project,sportal365Infrastructure:t.sportal365Infrastructure},{AuthProvider:r,APIProvider:n,ComponentProvider:i}=er;return E.jsx(r,{environment:t.fansUnitedEnvironment,children:E.jsx(OEe,{labels:t.labels,children:E.jsx(n,{config:e,children:E.jsx(i,{children:E.jsx(eNe,{fansUnitedEnvironment:t.fansUnitedEnvironment,hideSignOutButton:t.hideSignOutButton})})})})})};$t.EitherOrManager=tNe,Object.defineProperty($t,Symbol.toStringTag,{value:"Module"})});
|