fansunited-management-components 1.58.0-RC3 → 1.58.0-RC4

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/index.es.js CHANGED
@@ -38381,9 +38381,8 @@ class v5 {
38381
38381
  q(this, "description", "");
38382
38382
  q(this, "type", "EVENT");
38383
38383
  q(this, "rules", "");
38384
- q(this, "status", "");
38384
+ q(this, "status", "PENDING");
38385
38385
  q(this, "images", null);
38386
- q(this, "points", 0);
38387
38386
  q(this, "related", []);
38388
38387
  q(this, "custom_fields", null);
38389
38388
  q(this, "predictions_cutoff", "");
package/index.umd.js CHANGED
@@ -2495,4 +2495,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2495
2495
  data-widget-mode="${v}"`,$=`<div
2496
2496
  data-component="fu-widget"
2497
2497
  data-content-type="list"${b}${x}${S}${C}${A}${E}${k}
2498
- ></div>`,G=({title:N})=>l.jsx(p.Tooltip,{title:N,sx:{maxWidth:300},children:l.jsx(or,{color:"primary"})}),O=()=>l.jsxs(p.Card,{sx:{pb:1,mb:3},children:[l.jsx(on,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:l.jsx(G,{title:t.quizzesInfoMessage}),onChange:N=>o(N.target.value)}),l.jsx(on,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:l.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:N=>s(N.target.value)}),l.jsx(on,{label:t.pollURL,placeholder:"",defaultValue:c,required:!1,size:"md",endDecorator:l.jsx(G,{title:t.pollsInfoMessage}),onChange:N=>u(N.target.value)})]}),T=()=>l.jsxs(p.Card,{sx:{pb:1,mb:3},children:[l.jsx(Eu,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:f,onChange:N=>d(N||null),size:"md"}),l.jsx(Eu,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:h,onChange:N=>g(N||null),size:"md"}),l.jsxs(p.FormControl,{sx:()=>({marginBottom:"16px"}),children:[l.jsx(p.FormLabel,{color:"primary",children:t.mode}),l.jsx(p.Select,{defaultValue:v,onChange:(N,H)=>m(H),children:MN.map((N,H)=>l.jsx(p.Option,{value:N,children:LN[N]},`basic-select-${N}-${H}`))}),l.jsx(p.FormHelperText,{children:t.modeDescription})]})]});return l.jsxs(p.Box,{mt:1,children:[T(),l.jsx(hi,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:N=>{N===!1&&(o(""),s(""),u("")),r(N)}}),n&&O(),l.jsxs(p.Box,{position:"relative",mb:1,children:[l.jsx(p.Textarea,{value:$,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:N=>N.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),l.jsx(p.Tooltip,{title:t.copyToClipboard,children:l.jsx(p.Button,{onClick:()=>{navigator.clipboard.writeText($)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:l.jsx(Ee.ContentCopy,{})})})]}),l.jsx(p.Alert,{variant:"outlined",color:"primary",startDecorator:l.jsx(or,{}),sx:{mb:1,width:"fit-content"},children:l.jsxs(p.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,l.jsx(p.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},yb=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],$N=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[s,c]=y.useState(""),[u,f]=y.useState("name"),[d,h]=y.useState(!1),[g,v]=y.useState(!1),{sdk:m}=Ye(),b=!0,x=()=>v(!g),S=(A,E)=>{i(E);const k=E.map($=>$.id);n(k&&k.length?k:null)},C=3;y.useEffect(()=>{!s&&t&&t.length&&m.profile.getByIds(t,void 0,b).then(A=>{i(yb(A))}).catch(A=>{x(),console.error(A),i([])})},[]);const I=y.useMemo(()=>ar((A,E)=>{h(!0),m.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,b).then(k=>{a([...yb(k)]),h(!1)}).catch(k=>{console.error(k),x(),a([]),h(!1)})},300),[]);y.useEffect(()=>{if(!s||s.length<C){a([]);return}return I(s,u),()=>I.cancel()},[s,I,u]);const w=(A,E)=>A.map((k,$)=>{var G;return l.jsx(p.Chip,{variant:"solid",endDecorator:l.jsx(p.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:O=>E({index:$}).onClick(O),children:l.jsx(Ee.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:l.jsxs(p.Box,{display:"flex",alignItems:"center",mr:1,children:[l.jsx(p.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=k.avatar)!=null?G:Me.avatar}),l.jsx(p.Typography,{children:k.label})]})},k.id)});return l.jsxs(l.Fragment,{children:[l.jsx(p.Box,{sx:{marginBottom:"16px"},children:l.jsx(p.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:d,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:l.jsxs(l.Fragment,{children:[d&&l.jsx(p.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),l.jsx(p.Divider,{orientation:"vertical"}),l.jsxs(p.Select,{variant:"plain",value:u,onChange:(A,E)=>f(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[l.jsx(p.Option,{value:"name",children:e.searchByName}),l.jsx(p.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(k=>k.value===E.value)),onInputChange:(A,E)=>{c(E)},onChange:S,getOptionKey:A=>A.id,value:r,renderTags:w,renderOption:(A,E)=>{var k;return l.jsx(p.AutocompleteOption,Q(B({},A),{children:l.jsxs(p.Box,{display:"flex",alignItems:"center",mr:1,children:[l.jsx(p.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(k=E.avatar)!=null?k:Me.avatar}),l.jsx(p.Typography,{children:E.label})]})}))}})}),l.jsx(Ke,{showToast:g,message:e.searchProfilesErrorMessage,color:"danger",hideToast:x})]})},FN=({value:e,sx:t,tooltipPlacement:n})=>{const r=c=>{const u=Math.abs(c);return u>=1e9?(c/1e9).toFixed(1)+"b":u>=1e6?(c/1e6).toFixed(1)+"m":u>=1e3?(c/1e3).toFixed(1)+"k":c.toString()},i=c=>new Intl.NumberFormat("en-US").format(c),o=Math.abs(e)>=1e3,a=r(e),s=i(e);return o?l.jsx(p.Tooltip,{title:s,placement:n,arrow:!0,children:l.jsx(p.Typography,{sx:t,children:a})}):l.jsx(p.Typography,{sx:t,children:a})},NN=(e,t,n,r)=>{if(e&&e.length===0){n([]);return}t.football.getPlayers({playerIds:e}).then(i=>{const o=i.data.map(a=>xb(a));n(o)}).catch(i=>{console.error("Error fetching players by ID:",i),r()})},xb=e=>{var t,n,r,i,o;return{id:e.id,name:e.name,avatar:((t=e.assets)==null?void 0:t.headshot)||Me.avatar,countryName:((n=e.country)==null?void 0:n.name)||"Unknown",countryFlag:((i=(r=e.country)==null?void 0:r.assets)==null?void 0:i.flag)||Me.flag,teams:((o=e.teams)==null?void 0:o.map(a=>{var s;return{id:a.id,name:a.name,logo:((s=a.assets)==null?void 0:s.logo)||Me.team}}))||[]}},zN=({player:e,onRemove:t})=>l.jsx(p.Tooltip,{title:l.jsxs(p.Box,{sx:{p:1},children:[l.jsx(p.Typography,{level:"body-sm",fontWeight:"bold",children:e.name}),l.jsxs(p.Typography,{level:"body-xs",sx:{display:"flex",alignItems:"center",gap:.5,mt:.5},children:[l.jsx("img",{src:e.countryFlag,alt:e.countryName,width:16,height:12,loading:"lazy"}),e.countryName]}),e.teams&&e.teams.length>0&&l.jsxs(p.Box,{sx:{mt:.5},children:[l.jsx(p.Typography,{level:"body-xs",sx:{mb:.5},children:"Teams:"}),l.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:.25},children:e.teams.map((n,r)=>l.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[l.jsx("img",{src:n.logo,alt:n.name,width:16,height:16,style:{borderRadius:"2px"},loading:"lazy"}),l.jsx(p.Typography,{level:"body-xs",children:n.name})]},r))})]})]}),placement:"left",variant:"solid",sx:{"--Tooltip-radius":"8px",maxWidth:300,bgcolor:"background.level1"},children:l.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:.5,backgroundColor:"#e0f3ff",borderRadius:"50px",padding:"2px 8px 2px 2px",margin:"2px",position:"relative","&:hover":{backgroundColor:"#d0e8ff",cursor:"default"}},children:[l.jsx(p.Avatar,{src:e.avatar,alt:e.name,size:"sm",sx:{width:24,height:24,border:"1px solid #fff"}}),l.jsx(p.Typography,{level:"body-sm",sx:{fontSize:"12px",maxWidth:80,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),l.jsx(p.IconButton,{size:"sm",variant:"plain",color:"danger",onClick:t,sx:{minHeight:16,minWidth:16,padding:0,ml:.5,"&:hover":{backgroundColor:"rgba(255, 0, 0, 0.1)"}},children:l.jsx(Ee.Close,{sx:{fontSize:12}})})]})}),jN=({labels:e,teamIds:t,selectedPlayers:n,onChangePlayers:r})=>{const[i,o]=y.useState([]),[a,s]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[h,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=Ye(),x=()=>m(!v),S=t&&t.length>0,C=(k,$)=>{o($),r($)},I=()=>_(this,null,function*(){if(S){d(!0);try{const k=t.map(O=>b.football.getTeamById(O)),$=yield Promise.all(k),G=[];$.forEach(O=>{if(O.squad&&O.squad.length>0){const T=O.squad.map(N=>{var H,j,F,M,V;return{id:N.id,name:N.name,avatar:((H=N.assets)==null?void 0:H.headshot)||Me.avatar,countryName:((j=N.country)==null?void 0:j.name)||"Unknown",countryFlag:((M=(F=N.country)==null?void 0:F.assets)==null?void 0:M.flag)||Me.flag,teams:[{id:O.id,name:O.name,logo:((V=O.assets)==null?void 0:V.logo)||Me.team}]}}).sort((N,H)=>N.name.localeCompare(H.name));G.push(...T)}}),u(G),s(G)}catch(k){console.error("Error fetching team players:",k),x()}finally{d(!1)}}}),w=k=>{if(!k){s(c);return}const $=c.filter(G=>G.name.toLowerCase().includes(k.toLowerCase()));s($)};y.useEffect(()=>{NN(n,b,o,x)},[n]),y.useEffect(()=>{S&&I()},[t]);const A=y.useMemo(()=>ar(k=>{if(!S){if(!k||k.length<2){s([]),d(!1);return}d(!0),b.football.getPlayers({name:k,sortField:"name",sortOrder:"asc"}).then($=>{const G=$.data.map(O=>xb(O));s(G),d(!1)}).catch($=>{console.error("Error searching players:",$),s([]),d(!1),x()})}},300),[b,S]);y.useEffect(()=>(S?w(h):A(h),()=>{S||A.cancel()}),[h,S]);const E=(k,$)=>k.map((G,O)=>l.jsx(zN,{player:G,onRemove:()=>{const T=$({index:O});T.onClick&&T.onClick({})}},G.id));return l.jsxs(l.Fragment,{children:[l.jsx(p.Autocomplete,{forcePopupIcon:S,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,flexWrap:"wrap"}},noOptions:{sx:{}}},isOptionEqualToValue:(k,$)=>k.id===$.id,endDecorator:f?l.jsx(p.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e==null?void 0:e.searchPlayersPlaceholder,options:a,filterSelectedOptions:!0,onInputChange:(k,$)=>{g($)},onChange:C,getOptionKey:k=>typeof k=="string"?k:k.id,getOptionLabel:k=>typeof k=="string"?k:k.name,value:i,renderTags:E,limitTags:1,renderOption:(k,$)=>{const G={props:k};return l.jsxs(p.AutocompleteOption,Q(B({},k),{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(p.Avatar,{src:$.avatar,alt:$.name,size:"sm",sx:{width:32,height:32}}),l.jsxs(p.Box,{sx:{flexGrow:1},children:[l.jsx(p.Typography,{level:"body-sm",fontWeight:"bold",children:$.name}),l.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[l.jsx("img",{src:$.countryFlag,alt:$.countryName,width:16,height:12,loading:"lazy"}),l.jsx(p.Typography,{level:"body-xs",color:"neutral",children:$.countryName})]})]})]}),`player-option-${$.id}-${G}`)}}),l.jsx(Ke,{showToast:v,message:e.getPlayersErrorMessage,color:"danger",hideToast:x})]})},UN=(e,t={})=>{const{enabled:n=!0}=t,{sdk:r}=Ye(),[i,o]=y.useState(null),[a,s]=y.useState(!1),[c,u]=y.useState(null),[f,d]=y.useState(null),h=y.useMemo(()=>B({},e),[JSON.stringify(e)]),g=y.useCallback(()=>_(this,null,function*(){var v,m;s(!0),u(null);try{const b=yield r.football.getMatches(h);o(b.data),d((m=(v=b.meta)==null?void 0:v.pagination)!=null?m:null)}catch(b){u(b),o([]),d(null)}finally{s(!1)}}),[r,h]);return y.useEffect(()=>{n&&g()},[g,n]),{matches:i,loading:a,error:c,meta:f,refetch:g}},Cb=Be(l.jsx("path",{d:"M4.25 5.61C6.57 8.59 10 13 10 13v5c0 1.1.9 2 2 2s2-.9 2-2v-5s3.43-4.41 5.75-7.39c.51-.66.04-1.61-.8-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAltRounded"),wb=Be(l.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.89-2-2-2m0 16H5V7h14zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"PreviewRounded"),cr=We("MuiStep",["root","indicator","horizontal","vertical","active","completed","disabled"]),xi=We("MuiStepIndicator",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]),VN=Be(l.jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z"}),"KeyboardArrowLeft"),HN=Be(l.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),Sb=Be(l.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");class WN{constructor(){J(this,"id","");J(this,"title","");J(this,"alternative_title",null);J(this,"description",null);J(this,"type",null);J(this,"auth_requirement",null);J(this,"rules",null);J(this,"ad_content",null);J(this,"labels",null);J(this,"branding",null);J(this,"embed_code",null);J(this,"custom_fields",null);J(this,"images",null);J(this,"status","");J(this,"flags",[]);J(this,"context",null);J(this,"options",[]);J(this,"related",[]);J(this,"multiple_choice",!1);J(this,"max_multiple_choice_options",null);J(this,"participation_count",0);J(this,"preferences_enabled",!1);J(this,"max_attempts",1);J(this,"external_activity",null)}}const GN=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(""),o=e.generatedEntity,a=d=>{const h=new WN;return h.title=d.question||"",h.status="INACTIVE",h.options=(d.options||[]).map(g=>({title:g,description:"",images:{main:"",mobile:"",cover:""},embed_code:null,preference_mappings:[]})),h},s=d=>{i(d.id);const h=a(d);e.setPollRequestBody(h)},c=()=>{if(!o)return l.jsx(p.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const d=()=>l.jsxs(p.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[l.jsx("thead",{children:l.jsx("tr",{children:l.jsx("th",{children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.questions})})})}),l.jsx("tbody",{children:o.questions.map((g,v)=>{var m;return l.jsx("tr",{children:l.jsx("td",{children:l.jsxs(p.Typography,{level:"body-sm",children:[g.question," ",l.jsx(p.Typography,{children:(m=g.options)==null?void 0:m.map((b,x)=>l.jsx(p.Chip,{color:b.correct?"success":"neutral",variant:b.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:b.option},`question-option-${x}`))})]})})},`question-${v}`)})})]}),h=()=>{const g=o.questions||[],v=m=>!m&&m!==0?"neutral":m>=5?"success":m>=4?"primary":m>=3?"warning":"neutral";return l.jsx(p.Box,{component:"ul",sx:{listStyle:"none",m:0,p:0,ml:0,pl:0,marginBlockStart:0,marginBlockEnd:0,marginInlineStart:0,marginInlineEnd:0,paddingInlineStart:0,display:"flex",flexDirection:"column",gap:1},children:g.map((m,b)=>{const x=r===m.id;return l.jsx(p.Box,{component:"li",children:l.jsx(p.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",cursor:"pointer",bgcolor:x?"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))":"background.body",borderColor:x?"primary.solidBg":void 0,"&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},"&:hover .pollOptionChipNeutral":{backgroundColor:"background.level1",borderColor:"neutral.outlinedBorder"}},onClick:()=>s(m),role:"button",tabIndex:0,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),s(m))},children:l.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[l.jsx(p.Radio,{name:"selectedPollSuggestion",value:m.id,checked:x,onChange:()=>s(m),size:"sm"}),l.jsxs(p.Box,{sx:{flex:1,minWidth:0},children:[l.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.5},children:[l.jsx(p.Typography,{level:"body-sm",fontWeight:600,p:0,children:m.question}),l.jsx(p.Box,{sx:{flex:1}}),m.engagement_score?l.jsx(p.Tooltip,{title:e.labels.engagementScore,children:l.jsx(p.Chip,{size:"sm",variant:"solid",color:v(m.engagement_score),children:m.engagement_score})}):l.jsx(l.Fragment,{})]}),l.jsx(p.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(m.options||[]).map((S,C)=>l.jsx(p.Chip,{className:x?void 0:"pollOptionChipNeutral",variant:x?"soft":"outlined",color:x?"primary":"neutral",size:"sm",sx:{mr:.5,mb:.5},children:S},`poll-suggestion-opt-${C}`))})]})]})})},`poll-suggestion-${m.id||b}`)})})};return e.entityType==="poll"?l.jsx(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",p:1,maxHeight:"400px",my:.5},children:h()}):l.jsxs(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[l.jsxs(p.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(v=>!v))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[l.jsx(p.Typography,{level:"body-sm",sx:{flexGrow:1},children:o.title}),l.jsx(p.Tooltip,{title:t?"":e.labels.expand,children:l.jsx(p.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?l.jsx(Sb,{}):l.jsx(ys,{})})})]}),l.jsx(p.Box,{sx:{display:t?"block":"none",p:1},children:t?d():null})]})},u=()=>!e.matches||e.matches.length===0?l.jsx(p.Box,{sx:{height:250,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noMatchesFound})}):l.jsx(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"250px",my:.5},children:e.matches.map(d=>{var h,g,v,m,b,x,S,C,I,w,A,E,k,$,G,O,T,N,H,j,F,M,V,Y;return l.jsxs(y.Fragment,{children:[l.jsxs(p.Box,{onClick:()=>e.setSelectedMatchId(d.id),onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),e.setSelectedMatchId(d.id))},role:"button",tabIndex:0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},backgroundColor:e.selectedMatchId===d.id?"rgba(0,0,0,0.04)":"transparent"},children:[l.jsx(p.Radio,{size:"sm",name:"selectedMatch",value:d.id,checked:e.selectedMatchId===d.id,onChange:Z=>e.setSelectedMatchId(Z.target.value),sx:{mr:1}}),l.jsx(p.Tooltip,{title:(((g=(h=d.context)==null?void 0:h.competition)==null?void 0:g.name)||"Competition with no name")+((b=(m=(v=d.context)==null?void 0:v.competition)==null?void 0:m.country)!=null&&b.name?` (${d.context.competition.country.name})`:""),children:l.jsx(p.Avatar,{src:((C=(S=(x=d.context)==null?void 0:x.competition)==null?void 0:S.assets)==null?void 0:C.logo)||Me.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),l.jsxs(p.Typography,{level:"body-sm",children:["[",ut(d.kickoffAt).format("HH:mm DD.MM.YYYY"),"]"]}),(I=d.homeTeam)!=null&&I.code?l.jsx(p.Tooltip,{title:d.homeTeam.name,children:l.jsxs(p.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),l.jsx(p.Avatar,{src:((w=d.homeTeam.assets)==null?void 0:w.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]})}):l.jsxs(l.Fragment,{children:[l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),l.jsx(p.Avatar,{src:((A=d.homeTeam.assets)==null?void 0:A.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]}),((k=(E=d==null?void 0:d.scores)==null?void 0:E.ftScore)==null?void 0:k.homeGoals)!==null&&((G=($=d==null?void 0:d.scores)==null?void 0:$.ftScore)==null?void 0:G.awayGoals)!==null?l.jsx(p.Chip,{variant:"outlined",children:((N=(T=(O=d.scores)==null?void 0:O.ftScore)==null?void 0:T.homeGoals)!=null?N:"")+":"+((F=(j=(H=d.scores)==null?void 0:H.ftScore)==null?void 0:j.awayGoals)!=null?F:"")}):" : ",(M=d.awayTeam)!=null&&M.code?l.jsx(p.Tooltip,{title:d.awayTeam.name,children:l.jsxs(p.Box,{display:"flex",gap:.5,alignItems:"center",children:[l.jsx(p.Avatar,{src:((V=d.awayTeam.assets)==null?void 0:V.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})," ",l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})}):l.jsxs(l.Fragment,{children:[l.jsx(p.Avatar,{src:((Y=d.awayTeam.assets)==null?void 0:Y.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}}),l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})]}),l.jsx(p.Divider,{sx:{my:.5}})]},`search-matches-custom-${d.id}`)})}),f=()=>l.jsxs(l.Fragment,{children:[l.jsx(p.Typography,{level:"body-xs",children:e.pagination?`${e.labels.page} ${e.pagination.currentPage} ${e.labels.of} ${e.pagination.numberOfPages} • ${e.pagination.totalItems} ${e.labels.total}`:""}),l.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[l.jsx(p.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage<=1,onClick:()=>e.setPage(d=>Math.max(1,d-1)),sx:{bgcolor:"background.surface"},children:l.jsx(VN,{})}),l.jsx(p.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage>=e.pagination.numberOfPages,onClick:()=>e.setPage(d=>e.pagination?Math.min(e.pagination.numberOfPages,d+1):d+1),sx:{bgcolor:"background.surface"},children:l.jsx(HN,{})})]})]});return e.loading?l.jsx(p.Box,{sx:{height:240},children:l.jsx(fi,{my:0})}):l.jsxs(l.Fragment,{children:[e.step==="search"?u():c(),l.jsxs(p.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[l.jsx(p.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedMatchId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate}),e.step==="search"?f():l.jsx(l.Fragment,{})]})]})},YN=e=>{const t=ut(Date.now()).format("YYYY-MM-DD");if(e.step==="preview")return l.jsx(l.Fragment,{});const n=()=>e.entityType==="poll"?l.jsx(p.Checkbox,{disabled:!e.matchFilters.teamIds||e.matchFilters.teamIds.length===0,checked:e.useFramingGuidelines,size:"sm",onChange:r=>{e.setUseFramingGuidelines(r.target.checked)},label:e.labels.useFramingGuidelinesLabel}):l.jsx(l.Fragment,{});return l.jsxs(l.Fragment,{children:[l.jsx(zm,{labels:{teamsSelectionPlaceholder:e.labels.teamsSelectionPlaceholder||"",searchTeamsErrorMessage:e.labels.searchTeamsErrorMessage},ids:e.matchFilters.teamIds||[],onChange:e.onChangeTeams,scope:e.competitionsScope,readOnly:e.isGenerating,AdditionalCheckbox:n()}),l.jsxs(p.Grid,{container:!0,spacing:2,minWidth:"100%",columns:{xs:0,sm:0,md:12},mb:2,children:[l.jsx(p.Grid,{xs:6,children:l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.fromDate}),l.jsx(p.Input,{name:"fromDate",type:"date",defaultValue:e.matchFilters.fromDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})}),l.jsx(p.Grid,{xs:6,children:l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.toDate}),l.jsx(p.Input,{name:"toDate",type:"date",defaultValue:e.matchFilters.toDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})})]})]})},KN=ut(Date.now()).format("YYYY-MM-DD"),Ib=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Ei[t]?Ei[t].key:"en"},Ab=e=>({fromDate:"",toDate:KN,competitionIds:e&&e.length?e:void 0,teamIds:void 0,sortOrder:"desc",status:"finished"}),qN=e=>{var ee;const[t,n]=y.useState(Ib(e.defaultLanguage)),[r,i]=y.useState(Ab(e.competitionsScope)),[o,a]=y.useState(1),[s,c]=y.useState(""),[u,f]=y.useState(!1),[d,h]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[x,S]=y.useState(null),[C,I]=y.useState(!1),[w,A]=y.useState(!1),[E,k]=y.useState(""),[$,G]=y.useState(!1),[O,T]=y.useState(""),[N,H]=y.useState("danger"),j=10,F=y.useMemo(()=>{const Ne=r,{fromDate:ne,toDate:X}=Ne,ce=qe(Ne,["fromDate","toDate"]),ve=B({},ce);if(ne&&(ve.fromDate=`${ne}T00:00:00Z`),X){const xt=ut().add(1,"minute").format("THH:mm:ss")+"Z";ve.toDate=X+xt}return Q(B({},ve),{page:o,limit:j})},[r,o]),M=y.useMemo(()=>!(!m||e.entityType==="poll"&&!x),[m,e.entityType,x]);y.useEffect(()=>()=>{n(Ib),i(Ab(e.competitionsScope)),a(1),c(""),f(!1),h("search"),b(null)},[]);const{https:V}=Ye(),{matches:Y,loading:Z,meta:D}=UN(F,{enabled:u}),L=()=>{T(""),G(!1)},U=ne=>{let X="",ce="danger";switch(ne){case"on_generate_failed":X=e.labels.onEntityGenerateErrorMessage;break;case"on_create":X=e.labels.onEntityCreateMessage,ce="success";break;case"on_create_failed":X=e.labels.onEntityCreateErrorMessage;break}H(ce),T(X),G(!0)},W=ne=>{var ce;const X=ne.map(ve=>ve.id);i(ve=>Q(B({},ve),{teamIds:X||void 0})),a(1),f(!0),e.entityType==="poll"&&(ne.length===0?(k(""),A(!1)):k(((ce=ne[ne.length-1])==null?void 0:ce.label)||""))},ie=ne=>{const{name:X,value:ce}=ne.target;i(ve=>Q(B({},ve),{[X]:ce})),f(!0)},le=()=>_(this,null,function*(){v(!0),e.entityType==="poll"&&S(null);let ne=null;switch(e.entityType){case"classic_quiz":ne=yield V.generatePostMatchQuiz({sportType:"football",lang:t,eventId:s});break;case"poll":const ce=w?E:"";ne=yield V.generatePostMatchPoll({targetParticipant:ce,lang:t,eventId:s});break}if(!(ne!=null&&ne.ok)){const ce=yield ne==null?void 0:ne.json();console.error("Failed to generate AI content",ce),v(!1),U("on_generate_failed");return}const X=yield ne==null?void 0:ne.json();if(e.entityType==="poll"){const ce=X;ce.questions.sort((ve,Ne)=>Ne.engagement_score-ve.engagement_score),b(ce)}else b(X);v(!1),h("preview")}),ae=ne=>_(this,null,function*(){I(!0);let X=null;switch(e.entityType){case"classic_quiz":const ve=m;X=yield V.createClassicQuiz(ve);break;case"poll":X=yield V.createPoll(x);break}const ce=yield X==null?void 0:X.json();if(!(X!=null&&X.ok)){console.error("Failed to create content",ce),I(!1),U("on_create_failed");return}if(I(!1),ne==="goto"){U("on_create"),e.toggleModal(),e.fetchEntityById(ce.data.id);return}U("on_create")});return l.jsx(p.Modal,{open:e.isOpen,onClose:()=>{g||C||e.toggleModal()},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[l.jsx(p.DialogTitle,{children:e.labels.generateFootballPostMatchModalTitle}),l.jsx(p.Divider,{}),l.jsx(p.DialogContent,{sx:{overflowX:"hidden"},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.FormControl,{size:"sm",sx:{mb:2},children:[l.jsx(p.FormLabel,{children:e.labels.language}),l.jsx(p.Select,{value:t,onChange:(ne,X)=>X&&n(X),indicator:null,disabled:g,startDecorator:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[t]||"gb").toLowerCase()}.png`,alt:((ee=Object.values(Ae).find(ne=>ne.key===t))==null?void 0:ee.name)||"Language"}),sx:{minWidth:220,minHeight:38},children:Object.values(Ae).map(ne=>l.jsxs(p.Option,{value:ne.key,label:ne.name,children:[l.jsx(p.ListItemDecorator,{children:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[ne.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[ne.key]||"gb").toLowerCase()}.png`,alt:ne.name})}),ne.name]},ne.key))}),l.jsx(p.FormHelperText,{children:e.labels.targetLanguageDescription})]}),l.jsxs(p.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${xi.root}`]:{borderWidth:3},[`& .${cr.root}::after`]:{height:3},[`& .${cr.completed}`]:{[`& .${xi.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${cr.active}`]:{[`& .${xi.root}`]:{borderColor:"currentColor"}},[`& .${cr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[l.jsx(p.Step,{active:d==="search",orientation:"vertical",indicator:l.jsx(p.Tooltip,{title:d==="preview"?e.labels.searchMatchTooltip:"",placement:"right",children:l.jsx(p.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&d==="preview"&&(ne.preventDefault(),b(null),h("search"))},sx:B({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:l.jsx(Cb,{})})}),children:l.jsx(p.Typography,{sx:B({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&d==="preview"&&(ne.preventDefault(),b(null),h("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchMatch})}),l.jsx(p.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:l.jsx(p.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:l.jsx(wb,{})}),children:l.jsx(p.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),l.jsx(YN,{entityType:e.entityType,step:d,labels:e.labels,useFramingGuidelines:w,matchFilters:r,competitionsScope:e.competitionsScope,generatedEntity:m,isGenerating:g,setUseFramingGuidelines:A,onChangeTeams:W,onChangeDates:ie}),u?l.jsx(p.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",bgcolor:"background.surface"},children:l.jsx(GN,{step:d,loading:Z||g,matches:Y,selectedMatchId:s,generatedEntity:m,labels:e.labels,pagination:D,teamIdsFilter:r.teamIds,setPollRequestBody:S,setPage:a,setSelectedMatchId:c,onGenerate:le,entityType:e.entityType,setGeneratedEntity:b})}):l.jsx(l.Fragment,{})]})}),l.jsxs(p.DialogActions,{children:[l.jsx(p.Button,{variant:"outlined",color:"primary",loading:C,disabled:!M||g,onClick:()=>ae("goto"),children:e.labels.createAndGoTo}),l.jsx(p.Button,{variant:"solid",color:"primary",loading:C,disabled:!M||g,onClick:()=>ae("continue"),children:e.labels.createAndContinue}),l.jsx(p.Button,{disabled:g||C,variant:"plain",color:"neutral",onClick:ne=>{ne.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),l.jsx(Ke,{showToast:$,color:N,message:O,hideToast:L})]})})},QN=e=>{const[t,n]=y.useState(!1),r=e.generatedEntity,i=()=>{if(!r)return l.jsx(p.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const a=()=>l.jsxs(p.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[l.jsx("thead",{children:l.jsx("tr",{children:l.jsx("th",{children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.questions})})})}),l.jsx("tbody",{children:r.questions.map((s,c)=>{var u;return l.jsx("tr",{children:l.jsx("td",{children:l.jsxs(p.Typography,{level:"body-sm",children:[s.question," ",l.jsx(p.Typography,{children:(u=s.options)==null?void 0:u.map((f,d)=>l.jsx(p.Chip,{color:f.correct?"success":"neutral",variant:f.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:f.option},`question-option-${d}`))})]})})},`question-${c}`)})})]});return l.jsxs(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[l.jsxs(p.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n(c=>!c))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[l.jsx(p.Typography,{level:"body-sm",sx:{flexGrow:1},children:r.title}),l.jsx(p.Tooltip,{title:t?"":e.labels.expand,children:l.jsx(p.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?l.jsx(Sb,{}):l.jsx(ys,{})})})]}),l.jsx(p.Box,{sx:{display:t?"block":"none",p:1},children:t?a():null})]})},o=()=>!e.races||e.races.length===0?l.jsx(p.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noRacesFound})}):l.jsx(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:e.races.map(a=>{var u;const s=a.status==="Completed",c=a.status==="Scheduled";return l.jsxs(y.Fragment,{children:[l.jsxs(p.Box,{onClick:s?()=>e.setSelectedRaceId(a.id.toString()):void 0,onKeyDown:s?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e.setSelectedRaceId(a.id.toString()))}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:s?"pointer":"not-allowed",opacity:c?.6:1,"&:hover":s?{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}:{},backgroundColor:e.selectedRaceId===a.id.toString()?"rgba(0,0,0,0.04)":"transparent"},children:[l.jsx(p.Radio,{size:"sm",name:"selectedRace",value:a.id.toString(),checked:e.selectedRaceId===a.id.toString(),disabled:!s,onChange:s?f=>e.setSelectedRaceId(f.target.value):void 0,sx:{mr:1}}),l.jsx(p.Tooltip,{title:a.competition.name+((u=a.competition.location)!=null&&u.country?` (${a.competition.location.country})`:""),children:l.jsx(p.Avatar,{src:a.circuit.image||Me.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),l.jsxs(p.Typography,{level:"body-sm",children:["[",ut(a.date).format("HH:mm DD.MM.YYYY"),"]"]}),l.jsx(p.Typography,{level:"body-sm",fontWeight:600,children:a.competition.name}),l.jsx(p.Typography,{level:"body-sm",children:a.circuit.name}),l.jsx(p.Chip,{variant:s?"solid":"outlined",color:s?"success":"neutral",size:"sm",children:a.status==="Completed"?"Finished":"Upcoming"})]}),l.jsx(p.Divider,{sx:{my:.5}})]},`race-${a.id}`)})});return e.loading?l.jsx(p.Box,{sx:{height:240},children:l.jsx(fi,{my:0})}):l.jsxs(l.Fragment,{children:[e.step==="search"?o():i(),l.jsx(p.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:l.jsx(p.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedRaceId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate})})]})},Tb=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Ei[t]?Ei[t].key:"en"},zs=()=>new Date().getFullYear(),JN=()=>{const e=zs();return[e,e-1,e-2]},XN={Login:vM,InformationInput:on,RichText:yc,HeaderButtons:GP,MarketSelection:OM,Accordion:DT,DynamicFields:cD,BasicSelect:RT,BooleanSwitch:hi,Branding:UP,ProfileSearchSelect:ZL,RangeCalendar:sD,CompetitionSearchSelect:JL,Related:BM,Images:YR,Duration:aD,DatePickerComponent:uo,Flags:VR,Spinner:fi,Tags:jm,Toast:Ke,AdContent:OT,Match:RM,Winners:jB,CompetitionsSearchSelect:XL,TeamsSearchSelect:zm,CustomSelect:XM,Schedule:WM,NoPermissionCard:lD,CustomFlatpickrCalendar:nu,ContextSelectFilter:VB,NumberInput:Eu,EntityContext:C$,MiniGamesImages:S$,AuthRequirement:I$,SortableList:pN,ItemsPerPageFilter:gN,ImageCard:vo,RelatedRelationship:_N,ExportUsersLeads:PN,SignOutButton:gg,BasicSortableList:ON,WidgetEmbedCode:RN,WidgetListEmbedCode:BN,AdvancedProfileSearchSelect:$N,FormatNumber:FN,PlayersSearchSelect:jN,GenerateFootballPostMatchModal:qN,GenerateFormula1PostEventModal:e=>{var M,V;const[t,n]=y.useState(Tb(e.defaultLanguage)),[r,i]=y.useState(zs()),[o,a]=y.useState([]),[s,c]=y.useState(!1),[u,f]=y.useState(""),[d,h]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[x,S]=y.useState(!1),[C,I]=y.useState(!1),[w,A]=y.useState(""),[E,k]=y.useState("danger"),$=y.useMemo(()=>!!m,[m]);y.useEffect(()=>{e.isOpen?N(zs()):(n(Tb(e.defaultLanguage)),i(zs()),a([]),f(""),h("search"),b(null))},[e.isOpen]);const{https:G}=Ye(),O=()=>{A(""),I(!1)},T=Y=>{let Z="",D="danger";switch(Y){case"on_generate_failed":Z=e.labels.onEntityGenerateErrorMessage;break;case"on_create":Z=e.labels.onEntityCreateMessage,D="success";break;case"on_create_failed":Z=e.labels.onEntityCreateErrorMessage;break;case"fetch_races_failed":Z=e.labels.fetchRacesErrorMessage;break}k(D),A(Z),I(!0)},N=Y=>_(this,null,function*(){c(!0);const Z=yield G.apiSports.getRaces(Y),D=yield Z.json();if(!Z.ok){console.error("Error fetching races:",D),c(!1),a([]),T("fetch_races_failed");return}const W=(D.response||[]).sort((ne,X)=>new Date(X.date).getTime()-new Date(ne.date).getTime()),ie=W.filter(ne=>ne.status==="Completed"),le=W.filter(ne=>ne.status==="Scheduled"),ee=[...le.length>0?[le.sort((ne,X)=>new Date(ne.date).getTime()-new Date(X.date).getTime())[0]]:[],...ie];a(ee),c(!1)}),H=Y=>{i(Y),f(""),N(Y)},j=()=>_(this,null,function*(){v(!0);const Y=yield G.generatePostMatchQuiz({sportType:"formula1",lang:t,eventId:u});if(!(Y!=null&&Y.ok)){const D=yield Y==null?void 0:Y.json();console.error("Failed to generate AI content",D),v(!1),T("on_generate_failed");return}const Z=yield Y==null?void 0:Y.json();b(Z),v(!1),h("preview")}),F=Y=>_(this,null,function*(){S(!0);const Z=m,D=yield G.createClassicQuiz(Z),L=yield D.json();if(!(D!=null&&D.ok)){console.error("Failed to create content",L),S(!1),T("on_create_failed");return}if(S(!1),Y==="goto"){T("on_create"),e.toggleModal(),e.fetchEntityById(L.data.id);return}T("on_create")});return l.jsx(p.Modal,{open:e.isOpen,onClose:()=>{g||x||e.toggleModal()},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[l.jsx(p.DialogTitle,{children:e.labels.generateFormulaOnePostEventModalTitle}),l.jsx(p.Divider,{}),l.jsx(p.DialogContent,{sx:{overflowX:"hidden"},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:2,mb:2},children:[l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.language}),l.jsx(p.Select,{value:t,onChange:(Y,Z)=>Z&&n(Z),indicator:null,disabled:g,startDecorator:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[t]||"gb").toLowerCase()}.png`,alt:((M=Object.values(Ae).find(Y=>Y.key===t))==null?void 0:M.name)||"Language"}),sx:{minHeight:38},children:Object.values(Ae).map(Y=>l.jsxs(p.Option,{value:Y.key,label:Y.name,children:[l.jsx(p.ListItemDecorator,{children:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[Y.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[Y.key]||"gb").toLowerCase()}.png`,alt:Y.name})}),Y.name]},Y.key))}),l.jsx(p.FormHelperText,{children:e.labels.targetLanguageDescription})]}),l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.season}),l.jsx(p.Select,{value:r,onChange:(Y,Z)=>Z&&H(Z),disabled:g||!!m,sx:{minHeight:38},children:JN().map(Y=>l.jsx(p.Option,{value:Y,children:Y},Y))}),l.jsx(p.FormHelperText,{children:e.labels.seasonDescription})]})]}),l.jsxs(p.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${xi.root}`]:{borderWidth:3},[`& .${cr.root}::after`]:{height:3},[`& .${cr.completed}`]:{[`& .${xi.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${cr.active}`]:{[`& .${xi.root}`]:{borderColor:"currentColor"}},[`& .${cr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[l.jsx(p.Step,{active:d==="search",orientation:"vertical",indicator:l.jsx(p.Tooltip,{title:d==="preview"?(V=e.labels)==null?void 0:V.searchRaceTooltip:"",placement:"right",children:l.jsx(p.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),h("search"))},sx:B({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:l.jsx(Cb,{})})}),children:l.jsx(p.Typography,{sx:B({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),h("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchRace})}),l.jsx(p.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:l.jsx(p.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:l.jsx(wb,{})}),children:l.jsx(p.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),l.jsx(p.Sheet,{variant:"outlined",sx:{mt:2,p:1,borderRadius:"sm",bgcolor:"background.surface"},children:l.jsx(QN,{step:d,loading:s||g,races:o,selectedRaceId:u,generatedEntity:m,labels:e.labels,setSelectedRaceId:f,onGenerate:j,setGeneratedEntity:b})})]})}),l.jsxs(p.DialogActions,{children:[l.jsx(p.Button,{variant:"outlined",color:"primary",loading:x,disabled:!$||g,onClick:()=>F("goto"),children:e.labels.createAndGoTo}),l.jsx(p.Button,{variant:"solid",color:"primary",loading:x,disabled:!$||g,onClick:()=>F("continue"),children:e.labels.createAndContinue}),l.jsx(p.Button,{disabled:g||x,variant:"plain",color:"neutral",onClick:Y=>{Y.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),l.jsx(Ke,{showToast:C,color:E,message:w,hideToast:O})]})})}},Eb=y.createContext(null),ZN=({children:e})=>l.jsx(Eb.Provider,{value:XN,children:e}),ez=()=>{const e=y.useContext(Eb);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},kb=425,_b=1024,tz=()=>{const[e,t]=y.useState(window.innerWidth<=_b),[n,r]=y.useState(window.innerWidth<=kb);return y.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=_b),r(window.innerWidth<=kb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}};var Pb=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.ENUM="ENUM",e.FREE_INPUT="FREE_INPUT",e))(Pb||{}),Db=(e=>(e.ACTIVE="ACTIVE",e.SETTLED="SETTLED",e.VOID="VOID",e))(Db||{});class nz{constructor(){J(this,"id","");J(this,"question","");J(this,"status","ACTIVE");J(this,"void_reason",null);J(this,"points",0);J(this,"outcome_type",null);J(this,"valid_outcomes",null);J(this,"outcome",null)}}class rz{constructor(){J(this,"id","");J(this,"title","");J(this,"description","");J(this,"type","EVENT");J(this,"rules","");J(this,"status","");J(this,"images",null);J(this,"points",0);J(this,"related",[]);J(this,"custom_fields",null);J(this,"predictions_cutoff","");J(this,"fixtures",[]);J(this,"tiebreaker",{stat_tiebreaker_enabled:!1,stat_total:0})}}const iz={APIProvider:HS,AuthProvider:WS,AuthContext:Kf,ComponentProvider:ZN,useComponentContext:ez,useAPIContext:Ye,useIsMobile:tz,constants:{supportedLanguages:Ae,languagesMap:Ei}};Ie.EventGameFixtureStatusEnum=Db,Ie.EventGameFixturesModel=nz,Ie.EventGameOutcomeTypeEnum=Pb,Ie.EventGameRequestBody=rz,Ie.default=iz,Object.defineProperties(Ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
2498
+ ></div>`,G=({title:N})=>l.jsx(p.Tooltip,{title:N,sx:{maxWidth:300},children:l.jsx(or,{color:"primary"})}),O=()=>l.jsxs(p.Card,{sx:{pb:1,mb:3},children:[l.jsx(on,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:l.jsx(G,{title:t.quizzesInfoMessage}),onChange:N=>o(N.target.value)}),l.jsx(on,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:l.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:N=>s(N.target.value)}),l.jsx(on,{label:t.pollURL,placeholder:"",defaultValue:c,required:!1,size:"md",endDecorator:l.jsx(G,{title:t.pollsInfoMessage}),onChange:N=>u(N.target.value)})]}),T=()=>l.jsxs(p.Card,{sx:{pb:1,mb:3},children:[l.jsx(Eu,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:f,onChange:N=>d(N||null),size:"md"}),l.jsx(Eu,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:h,onChange:N=>g(N||null),size:"md"}),l.jsxs(p.FormControl,{sx:()=>({marginBottom:"16px"}),children:[l.jsx(p.FormLabel,{color:"primary",children:t.mode}),l.jsx(p.Select,{defaultValue:v,onChange:(N,H)=>m(H),children:MN.map((N,H)=>l.jsx(p.Option,{value:N,children:LN[N]},`basic-select-${N}-${H}`))}),l.jsx(p.FormHelperText,{children:t.modeDescription})]})]});return l.jsxs(p.Box,{mt:1,children:[T(),l.jsx(hi,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:N=>{N===!1&&(o(""),s(""),u("")),r(N)}}),n&&O(),l.jsxs(p.Box,{position:"relative",mb:1,children:[l.jsx(p.Textarea,{value:$,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:N=>N.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),l.jsx(p.Tooltip,{title:t.copyToClipboard,children:l.jsx(p.Button,{onClick:()=>{navigator.clipboard.writeText($)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:l.jsx(Ee.ContentCopy,{})})})]}),l.jsx(p.Alert,{variant:"outlined",color:"primary",startDecorator:l.jsx(or,{}),sx:{mb:1,width:"fit-content"},children:l.jsxs(p.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,l.jsx(p.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},yb=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],$N=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[s,c]=y.useState(""),[u,f]=y.useState("name"),[d,h]=y.useState(!1),[g,v]=y.useState(!1),{sdk:m}=Ye(),b=!0,x=()=>v(!g),S=(A,E)=>{i(E);const k=E.map($=>$.id);n(k&&k.length?k:null)},C=3;y.useEffect(()=>{!s&&t&&t.length&&m.profile.getByIds(t,void 0,b).then(A=>{i(yb(A))}).catch(A=>{x(),console.error(A),i([])})},[]);const I=y.useMemo(()=>ar((A,E)=>{h(!0),m.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,b).then(k=>{a([...yb(k)]),h(!1)}).catch(k=>{console.error(k),x(),a([]),h(!1)})},300),[]);y.useEffect(()=>{if(!s||s.length<C){a([]);return}return I(s,u),()=>I.cancel()},[s,I,u]);const w=(A,E)=>A.map((k,$)=>{var G;return l.jsx(p.Chip,{variant:"solid",endDecorator:l.jsx(p.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:O=>E({index:$}).onClick(O),children:l.jsx(Ee.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:l.jsxs(p.Box,{display:"flex",alignItems:"center",mr:1,children:[l.jsx(p.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=k.avatar)!=null?G:Me.avatar}),l.jsx(p.Typography,{children:k.label})]})},k.id)});return l.jsxs(l.Fragment,{children:[l.jsx(p.Box,{sx:{marginBottom:"16px"},children:l.jsx(p.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:d,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:l.jsxs(l.Fragment,{children:[d&&l.jsx(p.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),l.jsx(p.Divider,{orientation:"vertical"}),l.jsxs(p.Select,{variant:"plain",value:u,onChange:(A,E)=>f(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[l.jsx(p.Option,{value:"name",children:e.searchByName}),l.jsx(p.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(k=>k.value===E.value)),onInputChange:(A,E)=>{c(E)},onChange:S,getOptionKey:A=>A.id,value:r,renderTags:w,renderOption:(A,E)=>{var k;return l.jsx(p.AutocompleteOption,Q(B({},A),{children:l.jsxs(p.Box,{display:"flex",alignItems:"center",mr:1,children:[l.jsx(p.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(k=E.avatar)!=null?k:Me.avatar}),l.jsx(p.Typography,{children:E.label})]})}))}})}),l.jsx(Ke,{showToast:g,message:e.searchProfilesErrorMessage,color:"danger",hideToast:x})]})},FN=({value:e,sx:t,tooltipPlacement:n})=>{const r=c=>{const u=Math.abs(c);return u>=1e9?(c/1e9).toFixed(1)+"b":u>=1e6?(c/1e6).toFixed(1)+"m":u>=1e3?(c/1e3).toFixed(1)+"k":c.toString()},i=c=>new Intl.NumberFormat("en-US").format(c),o=Math.abs(e)>=1e3,a=r(e),s=i(e);return o?l.jsx(p.Tooltip,{title:s,placement:n,arrow:!0,children:l.jsx(p.Typography,{sx:t,children:a})}):l.jsx(p.Typography,{sx:t,children:a})},NN=(e,t,n,r)=>{if(e&&e.length===0){n([]);return}t.football.getPlayers({playerIds:e}).then(i=>{const o=i.data.map(a=>xb(a));n(o)}).catch(i=>{console.error("Error fetching players by ID:",i),r()})},xb=e=>{var t,n,r,i,o;return{id:e.id,name:e.name,avatar:((t=e.assets)==null?void 0:t.headshot)||Me.avatar,countryName:((n=e.country)==null?void 0:n.name)||"Unknown",countryFlag:((i=(r=e.country)==null?void 0:r.assets)==null?void 0:i.flag)||Me.flag,teams:((o=e.teams)==null?void 0:o.map(a=>{var s;return{id:a.id,name:a.name,logo:((s=a.assets)==null?void 0:s.logo)||Me.team}}))||[]}},zN=({player:e,onRemove:t})=>l.jsx(p.Tooltip,{title:l.jsxs(p.Box,{sx:{p:1},children:[l.jsx(p.Typography,{level:"body-sm",fontWeight:"bold",children:e.name}),l.jsxs(p.Typography,{level:"body-xs",sx:{display:"flex",alignItems:"center",gap:.5,mt:.5},children:[l.jsx("img",{src:e.countryFlag,alt:e.countryName,width:16,height:12,loading:"lazy"}),e.countryName]}),e.teams&&e.teams.length>0&&l.jsxs(p.Box,{sx:{mt:.5},children:[l.jsx(p.Typography,{level:"body-xs",sx:{mb:.5},children:"Teams:"}),l.jsx(p.Box,{sx:{display:"flex",flexDirection:"column",gap:.25},children:e.teams.map((n,r)=>l.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[l.jsx("img",{src:n.logo,alt:n.name,width:16,height:16,style:{borderRadius:"2px"},loading:"lazy"}),l.jsx(p.Typography,{level:"body-xs",children:n.name})]},r))})]})]}),placement:"left",variant:"solid",sx:{"--Tooltip-radius":"8px",maxWidth:300,bgcolor:"background.level1"},children:l.jsxs(p.Box,{sx:{display:"inline-flex",alignItems:"center",gap:.5,backgroundColor:"#e0f3ff",borderRadius:"50px",padding:"2px 8px 2px 2px",margin:"2px",position:"relative","&:hover":{backgroundColor:"#d0e8ff",cursor:"default"}},children:[l.jsx(p.Avatar,{src:e.avatar,alt:e.name,size:"sm",sx:{width:24,height:24,border:"1px solid #fff"}}),l.jsx(p.Typography,{level:"body-sm",sx:{fontSize:"12px",maxWidth:80,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),l.jsx(p.IconButton,{size:"sm",variant:"plain",color:"danger",onClick:t,sx:{minHeight:16,minWidth:16,padding:0,ml:.5,"&:hover":{backgroundColor:"rgba(255, 0, 0, 0.1)"}},children:l.jsx(Ee.Close,{sx:{fontSize:12}})})]})}),jN=({labels:e,teamIds:t,selectedPlayers:n,onChangePlayers:r})=>{const[i,o]=y.useState([]),[a,s]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[h,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=Ye(),x=()=>m(!v),S=t&&t.length>0,C=(k,$)=>{o($),r($)},I=()=>_(this,null,function*(){if(S){d(!0);try{const k=t.map(O=>b.football.getTeamById(O)),$=yield Promise.all(k),G=[];$.forEach(O=>{if(O.squad&&O.squad.length>0){const T=O.squad.map(N=>{var H,j,F,M,V;return{id:N.id,name:N.name,avatar:((H=N.assets)==null?void 0:H.headshot)||Me.avatar,countryName:((j=N.country)==null?void 0:j.name)||"Unknown",countryFlag:((M=(F=N.country)==null?void 0:F.assets)==null?void 0:M.flag)||Me.flag,teams:[{id:O.id,name:O.name,logo:((V=O.assets)==null?void 0:V.logo)||Me.team}]}}).sort((N,H)=>N.name.localeCompare(H.name));G.push(...T)}}),u(G),s(G)}catch(k){console.error("Error fetching team players:",k),x()}finally{d(!1)}}}),w=k=>{if(!k){s(c);return}const $=c.filter(G=>G.name.toLowerCase().includes(k.toLowerCase()));s($)};y.useEffect(()=>{NN(n,b,o,x)},[n]),y.useEffect(()=>{S&&I()},[t]);const A=y.useMemo(()=>ar(k=>{if(!S){if(!k||k.length<2){s([]),d(!1);return}d(!0),b.football.getPlayers({name:k,sortField:"name",sortOrder:"asc"}).then($=>{const G=$.data.map(O=>xb(O));s(G),d(!1)}).catch($=>{console.error("Error searching players:",$),s([]),d(!1),x()})}},300),[b,S]);y.useEffect(()=>(S?w(h):A(h),()=>{S||A.cancel()}),[h,S]);const E=(k,$)=>k.map((G,O)=>l.jsx(zN,{player:G,onRemove:()=>{const T=$({index:O});T.onClick&&T.onClick({})}},G.id));return l.jsxs(l.Fragment,{children:[l.jsx(p.Autocomplete,{forcePopupIcon:S,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,flexWrap:"wrap"}},noOptions:{sx:{}}},isOptionEqualToValue:(k,$)=>k.id===$.id,endDecorator:f?l.jsx(p.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e==null?void 0:e.searchPlayersPlaceholder,options:a,filterSelectedOptions:!0,onInputChange:(k,$)=>{g($)},onChange:C,getOptionKey:k=>typeof k=="string"?k:k.id,getOptionLabel:k=>typeof k=="string"?k:k.name,value:i,renderTags:E,limitTags:1,renderOption:(k,$)=>{const G={props:k};return l.jsxs(p.AutocompleteOption,Q(B({},k),{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(p.Avatar,{src:$.avatar,alt:$.name,size:"sm",sx:{width:32,height:32}}),l.jsxs(p.Box,{sx:{flexGrow:1},children:[l.jsx(p.Typography,{level:"body-sm",fontWeight:"bold",children:$.name}),l.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[l.jsx("img",{src:$.countryFlag,alt:$.countryName,width:16,height:12,loading:"lazy"}),l.jsx(p.Typography,{level:"body-xs",color:"neutral",children:$.countryName})]})]})]}),`player-option-${$.id}-${G}`)}}),l.jsx(Ke,{showToast:v,message:e.getPlayersErrorMessage,color:"danger",hideToast:x})]})},UN=(e,t={})=>{const{enabled:n=!0}=t,{sdk:r}=Ye(),[i,o]=y.useState(null),[a,s]=y.useState(!1),[c,u]=y.useState(null),[f,d]=y.useState(null),h=y.useMemo(()=>B({},e),[JSON.stringify(e)]),g=y.useCallback(()=>_(this,null,function*(){var v,m;s(!0),u(null);try{const b=yield r.football.getMatches(h);o(b.data),d((m=(v=b.meta)==null?void 0:v.pagination)!=null?m:null)}catch(b){u(b),o([]),d(null)}finally{s(!1)}}),[r,h]);return y.useEffect(()=>{n&&g()},[g,n]),{matches:i,loading:a,error:c,meta:f,refetch:g}},Cb=Be(l.jsx("path",{d:"M4.25 5.61C6.57 8.59 10 13 10 13v5c0 1.1.9 2 2 2s2-.9 2-2v-5s3.43-4.41 5.75-7.39c.51-.66.04-1.61-.8-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAltRounded"),wb=Be(l.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.89-2-2-2m0 16H5V7h14zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"PreviewRounded"),cr=We("MuiStep",["root","indicator","horizontal","vertical","active","completed","disabled"]),xi=We("MuiStepIndicator",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]),VN=Be(l.jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z"}),"KeyboardArrowLeft"),HN=Be(l.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),Sb=Be(l.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");class WN{constructor(){J(this,"id","");J(this,"title","");J(this,"alternative_title",null);J(this,"description",null);J(this,"type",null);J(this,"auth_requirement",null);J(this,"rules",null);J(this,"ad_content",null);J(this,"labels",null);J(this,"branding",null);J(this,"embed_code",null);J(this,"custom_fields",null);J(this,"images",null);J(this,"status","");J(this,"flags",[]);J(this,"context",null);J(this,"options",[]);J(this,"related",[]);J(this,"multiple_choice",!1);J(this,"max_multiple_choice_options",null);J(this,"participation_count",0);J(this,"preferences_enabled",!1);J(this,"max_attempts",1);J(this,"external_activity",null)}}const GN=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(""),o=e.generatedEntity,a=d=>{const h=new WN;return h.title=d.question||"",h.status="INACTIVE",h.options=(d.options||[]).map(g=>({title:g,description:"",images:{main:"",mobile:"",cover:""},embed_code:null,preference_mappings:[]})),h},s=d=>{i(d.id);const h=a(d);e.setPollRequestBody(h)},c=()=>{if(!o)return l.jsx(p.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const d=()=>l.jsxs(p.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[l.jsx("thead",{children:l.jsx("tr",{children:l.jsx("th",{children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.questions})})})}),l.jsx("tbody",{children:o.questions.map((g,v)=>{var m;return l.jsx("tr",{children:l.jsx("td",{children:l.jsxs(p.Typography,{level:"body-sm",children:[g.question," ",l.jsx(p.Typography,{children:(m=g.options)==null?void 0:m.map((b,x)=>l.jsx(p.Chip,{color:b.correct?"success":"neutral",variant:b.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:b.option},`question-option-${x}`))})]})})},`question-${v}`)})})]}),h=()=>{const g=o.questions||[],v=m=>!m&&m!==0?"neutral":m>=5?"success":m>=4?"primary":m>=3?"warning":"neutral";return l.jsx(p.Box,{component:"ul",sx:{listStyle:"none",m:0,p:0,ml:0,pl:0,marginBlockStart:0,marginBlockEnd:0,marginInlineStart:0,marginInlineEnd:0,paddingInlineStart:0,display:"flex",flexDirection:"column",gap:1},children:g.map((m,b)=>{const x=r===m.id;return l.jsx(p.Box,{component:"li",children:l.jsx(p.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",cursor:"pointer",bgcolor:x?"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))":"background.body",borderColor:x?"primary.solidBg":void 0,"&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},"&:hover .pollOptionChipNeutral":{backgroundColor:"background.level1",borderColor:"neutral.outlinedBorder"}},onClick:()=>s(m),role:"button",tabIndex:0,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),s(m))},children:l.jsxs(p.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[l.jsx(p.Radio,{name:"selectedPollSuggestion",value:m.id,checked:x,onChange:()=>s(m),size:"sm"}),l.jsxs(p.Box,{sx:{flex:1,minWidth:0},children:[l.jsxs(p.Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.5},children:[l.jsx(p.Typography,{level:"body-sm",fontWeight:600,p:0,children:m.question}),l.jsx(p.Box,{sx:{flex:1}}),m.engagement_score?l.jsx(p.Tooltip,{title:e.labels.engagementScore,children:l.jsx(p.Chip,{size:"sm",variant:"solid",color:v(m.engagement_score),children:m.engagement_score})}):l.jsx(l.Fragment,{})]}),l.jsx(p.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(m.options||[]).map((S,C)=>l.jsx(p.Chip,{className:x?void 0:"pollOptionChipNeutral",variant:x?"soft":"outlined",color:x?"primary":"neutral",size:"sm",sx:{mr:.5,mb:.5},children:S},`poll-suggestion-opt-${C}`))})]})]})})},`poll-suggestion-${m.id||b}`)})})};return e.entityType==="poll"?l.jsx(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",p:1,maxHeight:"400px",my:.5},children:h()}):l.jsxs(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[l.jsxs(p.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(v=>!v))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[l.jsx(p.Typography,{level:"body-sm",sx:{flexGrow:1},children:o.title}),l.jsx(p.Tooltip,{title:t?"":e.labels.expand,children:l.jsx(p.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?l.jsx(Sb,{}):l.jsx(ys,{})})})]}),l.jsx(p.Box,{sx:{display:t?"block":"none",p:1},children:t?d():null})]})},u=()=>!e.matches||e.matches.length===0?l.jsx(p.Box,{sx:{height:250,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noMatchesFound})}):l.jsx(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"250px",my:.5},children:e.matches.map(d=>{var h,g,v,m,b,x,S,C,I,w,A,E,k,$,G,O,T,N,H,j,F,M,V,Y;return l.jsxs(y.Fragment,{children:[l.jsxs(p.Box,{onClick:()=>e.setSelectedMatchId(d.id),onKeyDown:Z=>{(Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),e.setSelectedMatchId(d.id))},role:"button",tabIndex:0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},backgroundColor:e.selectedMatchId===d.id?"rgba(0,0,0,0.04)":"transparent"},children:[l.jsx(p.Radio,{size:"sm",name:"selectedMatch",value:d.id,checked:e.selectedMatchId===d.id,onChange:Z=>e.setSelectedMatchId(Z.target.value),sx:{mr:1}}),l.jsx(p.Tooltip,{title:(((g=(h=d.context)==null?void 0:h.competition)==null?void 0:g.name)||"Competition with no name")+((b=(m=(v=d.context)==null?void 0:v.competition)==null?void 0:m.country)!=null&&b.name?` (${d.context.competition.country.name})`:""),children:l.jsx(p.Avatar,{src:((C=(S=(x=d.context)==null?void 0:x.competition)==null?void 0:S.assets)==null?void 0:C.logo)||Me.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),l.jsxs(p.Typography,{level:"body-sm",children:["[",ut(d.kickoffAt).format("HH:mm DD.MM.YYYY"),"]"]}),(I=d.homeTeam)!=null&&I.code?l.jsx(p.Tooltip,{title:d.homeTeam.name,children:l.jsxs(p.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),l.jsx(p.Avatar,{src:((w=d.homeTeam.assets)==null?void 0:w.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]})}):l.jsxs(l.Fragment,{children:[l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),l.jsx(p.Avatar,{src:((A=d.homeTeam.assets)==null?void 0:A.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]}),((k=(E=d==null?void 0:d.scores)==null?void 0:E.ftScore)==null?void 0:k.homeGoals)!==null&&((G=($=d==null?void 0:d.scores)==null?void 0:$.ftScore)==null?void 0:G.awayGoals)!==null?l.jsx(p.Chip,{variant:"outlined",children:((N=(T=(O=d.scores)==null?void 0:O.ftScore)==null?void 0:T.homeGoals)!=null?N:"")+":"+((F=(j=(H=d.scores)==null?void 0:H.ftScore)==null?void 0:j.awayGoals)!=null?F:"")}):" : ",(M=d.awayTeam)!=null&&M.code?l.jsx(p.Tooltip,{title:d.awayTeam.name,children:l.jsxs(p.Box,{display:"flex",gap:.5,alignItems:"center",children:[l.jsx(p.Avatar,{src:((V=d.awayTeam.assets)==null?void 0:V.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})," ",l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})}):l.jsxs(l.Fragment,{children:[l.jsx(p.Avatar,{src:((Y=d.awayTeam.assets)==null?void 0:Y.logo)||Me.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}}),l.jsx(p.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})]}),l.jsx(p.Divider,{sx:{my:.5}})]},`search-matches-custom-${d.id}`)})}),f=()=>l.jsxs(l.Fragment,{children:[l.jsx(p.Typography,{level:"body-xs",children:e.pagination?`${e.labels.page} ${e.pagination.currentPage} ${e.labels.of} ${e.pagination.numberOfPages} • ${e.pagination.totalItems} ${e.labels.total}`:""}),l.jsxs(p.Box,{sx:{display:"flex",gap:1},children:[l.jsx(p.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage<=1,onClick:()=>e.setPage(d=>Math.max(1,d-1)),sx:{bgcolor:"background.surface"},children:l.jsx(VN,{})}),l.jsx(p.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage>=e.pagination.numberOfPages,onClick:()=>e.setPage(d=>e.pagination?Math.min(e.pagination.numberOfPages,d+1):d+1),sx:{bgcolor:"background.surface"},children:l.jsx(HN,{})})]})]});return e.loading?l.jsx(p.Box,{sx:{height:240},children:l.jsx(fi,{my:0})}):l.jsxs(l.Fragment,{children:[e.step==="search"?u():c(),l.jsxs(p.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[l.jsx(p.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedMatchId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate}),e.step==="search"?f():l.jsx(l.Fragment,{})]})]})},YN=e=>{const t=ut(Date.now()).format("YYYY-MM-DD");if(e.step==="preview")return l.jsx(l.Fragment,{});const n=()=>e.entityType==="poll"?l.jsx(p.Checkbox,{disabled:!e.matchFilters.teamIds||e.matchFilters.teamIds.length===0,checked:e.useFramingGuidelines,size:"sm",onChange:r=>{e.setUseFramingGuidelines(r.target.checked)},label:e.labels.useFramingGuidelinesLabel}):l.jsx(l.Fragment,{});return l.jsxs(l.Fragment,{children:[l.jsx(zm,{labels:{teamsSelectionPlaceholder:e.labels.teamsSelectionPlaceholder||"",searchTeamsErrorMessage:e.labels.searchTeamsErrorMessage},ids:e.matchFilters.teamIds||[],onChange:e.onChangeTeams,scope:e.competitionsScope,readOnly:e.isGenerating,AdditionalCheckbox:n()}),l.jsxs(p.Grid,{container:!0,spacing:2,minWidth:"100%",columns:{xs:0,sm:0,md:12},mb:2,children:[l.jsx(p.Grid,{xs:6,children:l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.fromDate}),l.jsx(p.Input,{name:"fromDate",type:"date",defaultValue:e.matchFilters.fromDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})}),l.jsx(p.Grid,{xs:6,children:l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.toDate}),l.jsx(p.Input,{name:"toDate",type:"date",defaultValue:e.matchFilters.toDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})})]})]})},KN=ut(Date.now()).format("YYYY-MM-DD"),Ib=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Ei[t]?Ei[t].key:"en"},Ab=e=>({fromDate:"",toDate:KN,competitionIds:e&&e.length?e:void 0,teamIds:void 0,sortOrder:"desc",status:"finished"}),qN=e=>{var ee;const[t,n]=y.useState(Ib(e.defaultLanguage)),[r,i]=y.useState(Ab(e.competitionsScope)),[o,a]=y.useState(1),[s,c]=y.useState(""),[u,f]=y.useState(!1),[d,h]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[x,S]=y.useState(null),[C,I]=y.useState(!1),[w,A]=y.useState(!1),[E,k]=y.useState(""),[$,G]=y.useState(!1),[O,T]=y.useState(""),[N,H]=y.useState("danger"),j=10,F=y.useMemo(()=>{const Ne=r,{fromDate:ne,toDate:X}=Ne,ce=qe(Ne,["fromDate","toDate"]),ve=B({},ce);if(ne&&(ve.fromDate=`${ne}T00:00:00Z`),X){const xt=ut().add(1,"minute").format("THH:mm:ss")+"Z";ve.toDate=X+xt}return Q(B({},ve),{page:o,limit:j})},[r,o]),M=y.useMemo(()=>!(!m||e.entityType==="poll"&&!x),[m,e.entityType,x]);y.useEffect(()=>()=>{n(Ib),i(Ab(e.competitionsScope)),a(1),c(""),f(!1),h("search"),b(null)},[]);const{https:V}=Ye(),{matches:Y,loading:Z,meta:D}=UN(F,{enabled:u}),L=()=>{T(""),G(!1)},U=ne=>{let X="",ce="danger";switch(ne){case"on_generate_failed":X=e.labels.onEntityGenerateErrorMessage;break;case"on_create":X=e.labels.onEntityCreateMessage,ce="success";break;case"on_create_failed":X=e.labels.onEntityCreateErrorMessage;break}H(ce),T(X),G(!0)},W=ne=>{var ce;const X=ne.map(ve=>ve.id);i(ve=>Q(B({},ve),{teamIds:X||void 0})),a(1),f(!0),e.entityType==="poll"&&(ne.length===0?(k(""),A(!1)):k(((ce=ne[ne.length-1])==null?void 0:ce.label)||""))},ie=ne=>{const{name:X,value:ce}=ne.target;i(ve=>Q(B({},ve),{[X]:ce})),f(!0)},le=()=>_(this,null,function*(){v(!0),e.entityType==="poll"&&S(null);let ne=null;switch(e.entityType){case"classic_quiz":ne=yield V.generatePostMatchQuiz({sportType:"football",lang:t,eventId:s});break;case"poll":const ce=w?E:"";ne=yield V.generatePostMatchPoll({targetParticipant:ce,lang:t,eventId:s});break}if(!(ne!=null&&ne.ok)){const ce=yield ne==null?void 0:ne.json();console.error("Failed to generate AI content",ce),v(!1),U("on_generate_failed");return}const X=yield ne==null?void 0:ne.json();if(e.entityType==="poll"){const ce=X;ce.questions.sort((ve,Ne)=>Ne.engagement_score-ve.engagement_score),b(ce)}else b(X);v(!1),h("preview")}),ae=ne=>_(this,null,function*(){I(!0);let X=null;switch(e.entityType){case"classic_quiz":const ve=m;X=yield V.createClassicQuiz(ve);break;case"poll":X=yield V.createPoll(x);break}const ce=yield X==null?void 0:X.json();if(!(X!=null&&X.ok)){console.error("Failed to create content",ce),I(!1),U("on_create_failed");return}if(I(!1),ne==="goto"){U("on_create"),e.toggleModal(),e.fetchEntityById(ce.data.id);return}U("on_create")});return l.jsx(p.Modal,{open:e.isOpen,onClose:()=>{g||C||e.toggleModal()},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[l.jsx(p.DialogTitle,{children:e.labels.generateFootballPostMatchModalTitle}),l.jsx(p.Divider,{}),l.jsx(p.DialogContent,{sx:{overflowX:"hidden"},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.FormControl,{size:"sm",sx:{mb:2},children:[l.jsx(p.FormLabel,{children:e.labels.language}),l.jsx(p.Select,{value:t,onChange:(ne,X)=>X&&n(X),indicator:null,disabled:g,startDecorator:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[t]||"gb").toLowerCase()}.png`,alt:((ee=Object.values(Ae).find(ne=>ne.key===t))==null?void 0:ee.name)||"Language"}),sx:{minWidth:220,minHeight:38},children:Object.values(Ae).map(ne=>l.jsxs(p.Option,{value:ne.key,label:ne.name,children:[l.jsx(p.ListItemDecorator,{children:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[ne.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[ne.key]||"gb").toLowerCase()}.png`,alt:ne.name})}),ne.name]},ne.key))}),l.jsx(p.FormHelperText,{children:e.labels.targetLanguageDescription})]}),l.jsxs(p.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${xi.root}`]:{borderWidth:3},[`& .${cr.root}::after`]:{height:3},[`& .${cr.completed}`]:{[`& .${xi.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${cr.active}`]:{[`& .${xi.root}`]:{borderColor:"currentColor"}},[`& .${cr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[l.jsx(p.Step,{active:d==="search",orientation:"vertical",indicator:l.jsx(p.Tooltip,{title:d==="preview"?e.labels.searchMatchTooltip:"",placement:"right",children:l.jsx(p.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&d==="preview"&&(ne.preventDefault(),b(null),h("search"))},sx:B({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:l.jsx(Cb,{})})}),children:l.jsx(p.Typography,{sx:B({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:ne=>{(ne.key==="Enter"||ne.key===" ")&&d==="preview"&&(ne.preventDefault(),b(null),h("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchMatch})}),l.jsx(p.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:l.jsx(p.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:l.jsx(wb,{})}),children:l.jsx(p.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),l.jsx(YN,{entityType:e.entityType,step:d,labels:e.labels,useFramingGuidelines:w,matchFilters:r,competitionsScope:e.competitionsScope,generatedEntity:m,isGenerating:g,setUseFramingGuidelines:A,onChangeTeams:W,onChangeDates:ie}),u?l.jsx(p.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",bgcolor:"background.surface"},children:l.jsx(GN,{step:d,loading:Z||g,matches:Y,selectedMatchId:s,generatedEntity:m,labels:e.labels,pagination:D,teamIdsFilter:r.teamIds,setPollRequestBody:S,setPage:a,setSelectedMatchId:c,onGenerate:le,entityType:e.entityType,setGeneratedEntity:b})}):l.jsx(l.Fragment,{})]})}),l.jsxs(p.DialogActions,{children:[l.jsx(p.Button,{variant:"outlined",color:"primary",loading:C,disabled:!M||g,onClick:()=>ae("goto"),children:e.labels.createAndGoTo}),l.jsx(p.Button,{variant:"solid",color:"primary",loading:C,disabled:!M||g,onClick:()=>ae("continue"),children:e.labels.createAndContinue}),l.jsx(p.Button,{disabled:g||C,variant:"plain",color:"neutral",onClick:ne=>{ne.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),l.jsx(Ke,{showToast:$,color:N,message:O,hideToast:L})]})})},QN=e=>{const[t,n]=y.useState(!1),r=e.generatedEntity,i=()=>{if(!r)return l.jsx(p.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const a=()=>l.jsxs(p.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[l.jsx("thead",{children:l.jsx("tr",{children:l.jsx("th",{children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.questions})})})}),l.jsx("tbody",{children:r.questions.map((s,c)=>{var u;return l.jsx("tr",{children:l.jsx("td",{children:l.jsxs(p.Typography,{level:"body-sm",children:[s.question," ",l.jsx(p.Typography,{children:(u=s.options)==null?void 0:u.map((f,d)=>l.jsx(p.Chip,{color:f.correct?"success":"neutral",variant:f.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:f.option},`question-option-${d}`))})]})})},`question-${c}`)})})]});return l.jsxs(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[l.jsxs(p.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n(c=>!c))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[l.jsx(p.Typography,{level:"body-sm",sx:{flexGrow:1},children:r.title}),l.jsx(p.Tooltip,{title:t?"":e.labels.expand,children:l.jsx(p.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?l.jsx(Sb,{}):l.jsx(ys,{})})})]}),l.jsx(p.Box,{sx:{display:t?"block":"none",p:1},children:t?a():null})]})},o=()=>!e.races||e.races.length===0?l.jsx(p.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(p.Typography,{level:"body-sm",children:e.labels.noRacesFound})}):l.jsx(p.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:e.races.map(a=>{var u;const s=a.status==="Completed",c=a.status==="Scheduled";return l.jsxs(y.Fragment,{children:[l.jsxs(p.Box,{onClick:s?()=>e.setSelectedRaceId(a.id.toString()):void 0,onKeyDown:s?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e.setSelectedRaceId(a.id.toString()))}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:s?"pointer":"not-allowed",opacity:c?.6:1,"&:hover":s?{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}:{},backgroundColor:e.selectedRaceId===a.id.toString()?"rgba(0,0,0,0.04)":"transparent"},children:[l.jsx(p.Radio,{size:"sm",name:"selectedRace",value:a.id.toString(),checked:e.selectedRaceId===a.id.toString(),disabled:!s,onChange:s?f=>e.setSelectedRaceId(f.target.value):void 0,sx:{mr:1}}),l.jsx(p.Tooltip,{title:a.competition.name+((u=a.competition.location)!=null&&u.country?` (${a.competition.location.country})`:""),children:l.jsx(p.Avatar,{src:a.circuit.image||Me.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),l.jsxs(p.Typography,{level:"body-sm",children:["[",ut(a.date).format("HH:mm DD.MM.YYYY"),"]"]}),l.jsx(p.Typography,{level:"body-sm",fontWeight:600,children:a.competition.name}),l.jsx(p.Typography,{level:"body-sm",children:a.circuit.name}),l.jsx(p.Chip,{variant:s?"solid":"outlined",color:s?"success":"neutral",size:"sm",children:a.status==="Completed"?"Finished":"Upcoming"})]}),l.jsx(p.Divider,{sx:{my:.5}})]},`race-${a.id}`)})});return e.loading?l.jsx(p.Box,{sx:{height:240},children:l.jsx(fi,{my:0})}):l.jsxs(l.Fragment,{children:[e.step==="search"?o():i(),l.jsx(p.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:l.jsx(p.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedRaceId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate})})]})},Tb=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Ei[t]?Ei[t].key:"en"},zs=()=>new Date().getFullYear(),JN=()=>{const e=zs();return[e,e-1,e-2]},XN={Login:vM,InformationInput:on,RichText:yc,HeaderButtons:GP,MarketSelection:OM,Accordion:DT,DynamicFields:cD,BasicSelect:RT,BooleanSwitch:hi,Branding:UP,ProfileSearchSelect:ZL,RangeCalendar:sD,CompetitionSearchSelect:JL,Related:BM,Images:YR,Duration:aD,DatePickerComponent:uo,Flags:VR,Spinner:fi,Tags:jm,Toast:Ke,AdContent:OT,Match:RM,Winners:jB,CompetitionsSearchSelect:XL,TeamsSearchSelect:zm,CustomSelect:XM,Schedule:WM,NoPermissionCard:lD,CustomFlatpickrCalendar:nu,ContextSelectFilter:VB,NumberInput:Eu,EntityContext:C$,MiniGamesImages:S$,AuthRequirement:I$,SortableList:pN,ItemsPerPageFilter:gN,ImageCard:vo,RelatedRelationship:_N,ExportUsersLeads:PN,SignOutButton:gg,BasicSortableList:ON,WidgetEmbedCode:RN,WidgetListEmbedCode:BN,AdvancedProfileSearchSelect:$N,FormatNumber:FN,PlayersSearchSelect:jN,GenerateFootballPostMatchModal:qN,GenerateFormula1PostEventModal:e=>{var M,V;const[t,n]=y.useState(Tb(e.defaultLanguage)),[r,i]=y.useState(zs()),[o,a]=y.useState([]),[s,c]=y.useState(!1),[u,f]=y.useState(""),[d,h]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[x,S]=y.useState(!1),[C,I]=y.useState(!1),[w,A]=y.useState(""),[E,k]=y.useState("danger"),$=y.useMemo(()=>!!m,[m]);y.useEffect(()=>{e.isOpen?N(zs()):(n(Tb(e.defaultLanguage)),i(zs()),a([]),f(""),h("search"),b(null))},[e.isOpen]);const{https:G}=Ye(),O=()=>{A(""),I(!1)},T=Y=>{let Z="",D="danger";switch(Y){case"on_generate_failed":Z=e.labels.onEntityGenerateErrorMessage;break;case"on_create":Z=e.labels.onEntityCreateMessage,D="success";break;case"on_create_failed":Z=e.labels.onEntityCreateErrorMessage;break;case"fetch_races_failed":Z=e.labels.fetchRacesErrorMessage;break}k(D),A(Z),I(!0)},N=Y=>_(this,null,function*(){c(!0);const Z=yield G.apiSports.getRaces(Y),D=yield Z.json();if(!Z.ok){console.error("Error fetching races:",D),c(!1),a([]),T("fetch_races_failed");return}const W=(D.response||[]).sort((ne,X)=>new Date(X.date).getTime()-new Date(ne.date).getTime()),ie=W.filter(ne=>ne.status==="Completed"),le=W.filter(ne=>ne.status==="Scheduled"),ee=[...le.length>0?[le.sort((ne,X)=>new Date(ne.date).getTime()-new Date(X.date).getTime())[0]]:[],...ie];a(ee),c(!1)}),H=Y=>{i(Y),f(""),N(Y)},j=()=>_(this,null,function*(){v(!0);const Y=yield G.generatePostMatchQuiz({sportType:"formula1",lang:t,eventId:u});if(!(Y!=null&&Y.ok)){const D=yield Y==null?void 0:Y.json();console.error("Failed to generate AI content",D),v(!1),T("on_generate_failed");return}const Z=yield Y==null?void 0:Y.json();b(Z),v(!1),h("preview")}),F=Y=>_(this,null,function*(){S(!0);const Z=m,D=yield G.createClassicQuiz(Z),L=yield D.json();if(!(D!=null&&D.ok)){console.error("Failed to create content",L),S(!1),T("on_create_failed");return}if(S(!1),Y==="goto"){T("on_create"),e.toggleModal(),e.fetchEntityById(L.data.id);return}T("on_create")});return l.jsx(p.Modal,{open:e.isOpen,onClose:()=>{g||x||e.toggleModal()},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[l.jsx(p.DialogTitle,{children:e.labels.generateFormulaOnePostEventModalTitle}),l.jsx(p.Divider,{}),l.jsx(p.DialogContent,{sx:{overflowX:"hidden"},children:l.jsxs(l.Fragment,{children:[l.jsxs(p.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:2,mb:2},children:[l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.language}),l.jsx(p.Select,{value:t,onChange:(Y,Z)=>Z&&n(Z),indicator:null,disabled:g,startDecorator:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[t]||"gb").toLowerCase()}.png`,alt:((M=Object.values(Ae).find(Y=>Y.key===t))==null?void 0:M.name)||"Language"}),sx:{minHeight:38},children:Object.values(Ae).map(Y=>l.jsxs(p.Option,{value:Y.key,label:Y.name,children:[l.jsx(p.ListItemDecorator,{children:l.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(Wn[Y.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(Wn[Y.key]||"gb").toLowerCase()}.png`,alt:Y.name})}),Y.name]},Y.key))}),l.jsx(p.FormHelperText,{children:e.labels.targetLanguageDescription})]}),l.jsxs(p.FormControl,{size:"sm",children:[l.jsx(p.FormLabel,{children:e.labels.season}),l.jsx(p.Select,{value:r,onChange:(Y,Z)=>Z&&H(Z),disabled:g||!!m,sx:{minHeight:38},children:JN().map(Y=>l.jsx(p.Option,{value:Y,children:Y},Y))}),l.jsx(p.FormHelperText,{children:e.labels.seasonDescription})]})]}),l.jsxs(p.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${xi.root}`]:{borderWidth:3},[`& .${cr.root}::after`]:{height:3},[`& .${cr.completed}`]:{[`& .${xi.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${cr.active}`]:{[`& .${xi.root}`]:{borderColor:"currentColor"}},[`& .${cr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[l.jsx(p.Step,{active:d==="search",orientation:"vertical",indicator:l.jsx(p.Tooltip,{title:d==="preview"?(V=e.labels)==null?void 0:V.searchRaceTooltip:"",placement:"right",children:l.jsx(p.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),h("search"))},sx:B({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:l.jsx(Cb,{})})}),children:l.jsx(p.Typography,{sx:B({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),h("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),h("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchRace})}),l.jsx(p.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:l.jsx(p.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:l.jsx(wb,{})}),children:l.jsx(p.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),l.jsx(p.Sheet,{variant:"outlined",sx:{mt:2,p:1,borderRadius:"sm",bgcolor:"background.surface"},children:l.jsx(QN,{step:d,loading:s||g,races:o,selectedRaceId:u,generatedEntity:m,labels:e.labels,setSelectedRaceId:f,onGenerate:j,setGeneratedEntity:b})})]})}),l.jsxs(p.DialogActions,{children:[l.jsx(p.Button,{variant:"outlined",color:"primary",loading:x,disabled:!$||g,onClick:()=>F("goto"),children:e.labels.createAndGoTo}),l.jsx(p.Button,{variant:"solid",color:"primary",loading:x,disabled:!$||g,onClick:()=>F("continue"),children:e.labels.createAndContinue}),l.jsx(p.Button,{disabled:g||x,variant:"plain",color:"neutral",onClick:Y=>{Y.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),l.jsx(Ke,{showToast:C,color:E,message:w,hideToast:O})]})})}},Eb=y.createContext(null),ZN=({children:e})=>l.jsx(Eb.Provider,{value:XN,children:e}),ez=()=>{const e=y.useContext(Eb);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},kb=425,_b=1024,tz=()=>{const[e,t]=y.useState(window.innerWidth<=_b),[n,r]=y.useState(window.innerWidth<=kb);return y.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=_b),r(window.innerWidth<=kb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}};var Pb=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.ENUM="ENUM",e.FREE_INPUT="FREE_INPUT",e))(Pb||{}),Db=(e=>(e.ACTIVE="ACTIVE",e.SETTLED="SETTLED",e.VOID="VOID",e))(Db||{});class nz{constructor(){J(this,"id","");J(this,"question","");J(this,"status","ACTIVE");J(this,"void_reason",null);J(this,"points",0);J(this,"outcome_type",null);J(this,"valid_outcomes",null);J(this,"outcome",null)}}class rz{constructor(){J(this,"id","");J(this,"title","");J(this,"description","");J(this,"type","EVENT");J(this,"rules","");J(this,"status","PENDING");J(this,"images",null);J(this,"related",[]);J(this,"custom_fields",null);J(this,"predictions_cutoff","");J(this,"fixtures",[]);J(this,"tiebreaker",{stat_tiebreaker_enabled:!1,stat_total:0})}}const iz={APIProvider:HS,AuthProvider:WS,AuthContext:Kf,ComponentProvider:ZN,useComponentContext:ez,useAPIContext:Ye,useIsMobile:tz,constants:{supportedLanguages:Ae,languagesMap:Ei}};Ie.EventGameFixtureStatusEnum=Db,Ie.EventGameFixturesModel=nz,Ie.EventGameOutcomeTypeEnum=Pb,Ie.EventGameRequestBody=rz,Ie.default=iz,Object.defineProperties(Ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fansunited-management-components",
3
- "version": "1.58.0-RC3",
3
+ "version": "1.58.0-RC4",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.es.d.ts",
@@ -20,8 +20,8 @@ export interface EventGameFixtureEnumModel {
20
20
  * Number model for fixture valid outcomes
21
21
  */
22
22
  export interface EventGameFixtureNumberModel {
23
- min: number;
24
- max: number;
23
+ min: number | null;
24
+ max: number | null;
25
25
  }
26
26
  /**
27
27
  * Outcome type enum for event game fixtures
@@ -69,7 +69,6 @@ export default class EventGameRequestBody {
69
69
  rules: string;
70
70
  status: string;
71
71
  images: ImagesModel | null;
72
- points: number;
73
72
  related: IRelated[];
74
73
  custom_fields: Record<string, string> | null;
75
74
  predictions_cutoff: string;
@@ -1 +1 @@
1
- {"version":3,"file":"EventGameRequestBody.d.ts","sourceRoot":"","sources":["../../../../../src/models/games/event/EventGameRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,UAAU,CAAC;IACxB,mBAAmB,EAAE,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,WAAW;IAC3B,uBAAuB,EAAE,OAAO,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,oBAAY,wBAAwB;IACnC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,UAAU,eAAe;CACzB;AAED;;GAEG;AACH,oBAAY,0BAA0B;IACrC,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACb;AAED;;GAEG;AACH,KAAK,iBAAiB,CAAC,CAAC,SAAS,wBAAwB,IAAI,CAAC,SAAS,wBAAwB,CAAC,OAAO,GACpG,IAAI,GACJ,CAAC,SAAS,wBAAwB,CAAC,MAAM,GACzC,2BAA2B,GAC3B,CAAC,SAAS,wBAAwB,CAAC,IAAI,GACvC,yBAAyB,GACzB,CAAC,SAAS,wBAAwB,CAAC,UAAU,GAC7C,IAAI,GACJ,KAAK,CAAC;AAET;;GAEG;AACH,KAAK,WAAW,CAAC,CAAC,SAAS,wBAAwB,IAAI,CAAC,SAAS,wBAAwB,CAAC,OAAO,GAC9F,OAAO,GAAG,IAAI,GACd,CAAC,SAAS,wBAAwB,CAAC,MAAM,GACzC,MAAM,GAAG,IAAI,GACb,CAAC,SAAS,wBAAwB,CAAC,IAAI,GACvC,MAAM,GAAG,IAAI,GACb,CAAC,SAAS,wBAAwB,CAAC,UAAU,GAC7C,MAAM,GAAG,IAAI,GACb,KAAK,CAAC;AAET;;GAEG;AACH,qBAAa,sBAAsB,CAAC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB;IACzF,EAAE,EAAE,MAAM,CAAM;IAChB,QAAQ,EAAE,MAAM,CAAM;IACtB,MAAM,EAAE,0BAA0B,CAAqC;IACvE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,MAAM,EAAE,MAAM,CAAK;IACnB,YAAY,EAAE,CAAC,CAAwB;IACvC,cAAc,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAA2C;IAC/E,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAqC;CACnE;AAED,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAM;IAChB,KAAK,EAAE,MAAM,CAAM;IACnB,WAAW,EAAE,MAAM,CAAM;IACzB,IAAI,EAAE,MAAM,CAAW;IACvB,KAAK,EAAE,MAAM,CAAM;IACnB,MAAM,EAAE,MAAM,CAAM;IACpB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAQ;IAClC,MAAM,EAAE,MAAM,CAAK;IACnB,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;IACpD,kBAAkB,EAAE,MAAM,CAAM;IAChC,QAAQ,EAAE,sBAAsB,EAAE,CAAM;IACxC,UAAU,EAAE,WAAW,CAAqD;CACnF"}
1
+ {"version":3,"file":"EventGameRequestBody.d.ts","sourceRoot":"","sources":["../../../../../src/models/games/event/EventGameRequestBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,UAAU,CAAC;IACxB,mBAAmB,EAAE,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,WAAW;IAC3B,uBAAuB,EAAE,OAAO,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,oBAAY,wBAAwB;IACnC,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,UAAU,eAAe;CACzB;AAED;;GAEG;AACH,oBAAY,0BAA0B;IACrC,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACb;AAED;;GAEG;AACH,KAAK,iBAAiB,CAAC,CAAC,SAAS,wBAAwB,IAAI,CAAC,SAAS,wBAAwB,CAAC,OAAO,GACpG,IAAI,GACJ,CAAC,SAAS,wBAAwB,CAAC,MAAM,GACzC,2BAA2B,GAC3B,CAAC,SAAS,wBAAwB,CAAC,IAAI,GACvC,yBAAyB,GACzB,CAAC,SAAS,wBAAwB,CAAC,UAAU,GAC7C,IAAI,GACJ,KAAK,CAAC;AAET;;GAEG;AACH,KAAK,WAAW,CAAC,CAAC,SAAS,wBAAwB,IAAI,CAAC,SAAS,wBAAwB,CAAC,OAAO,GAC9F,OAAO,GAAG,IAAI,GACd,CAAC,SAAS,wBAAwB,CAAC,MAAM,GACzC,MAAM,GAAG,IAAI,GACb,CAAC,SAAS,wBAAwB,CAAC,IAAI,GACvC,MAAM,GAAG,IAAI,GACb,CAAC,SAAS,wBAAwB,CAAC,UAAU,GAC7C,MAAM,GAAG,IAAI,GACb,KAAK,CAAC;AAET;;GAEG;AACH,qBAAa,sBAAsB,CAAC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB;IACzF,EAAE,EAAE,MAAM,CAAM;IAChB,QAAQ,EAAE,MAAM,CAAM;IACtB,MAAM,EAAE,0BAA0B,CAAqC;IACvE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,MAAM,EAAE,MAAM,CAAK;IACnB,YAAY,EAAE,CAAC,CAAwB;IACvC,cAAc,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAA2C;IAC/E,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAqC;CACnE;AAED,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAM;IAChB,KAAK,EAAE,MAAM,CAAM;IACnB,WAAW,EAAE,MAAM,CAAM;IACzB,IAAI,EAAE,MAAM,CAAW;IACvB,KAAK,EAAE,MAAM,CAAM;IACnB,MAAM,EAAE,MAAM,CAAa;IAC3B,MAAM,EAAE,WAAW,GAAG,IAAI,CAAQ;IAClC,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAQ;IACpD,kBAAkB,EAAE,MAAM,CAAM;IAChC,QAAQ,EAAE,sBAAsB,EAAE,CAAM;IACxC,UAAU,EAAE,WAAW,CAAqD;CACnF"}