1import{_ as e,G as t,N as a,u as l,Z as s,e as i,t as r,f as o,v as n,q as c,F as d,x as u,r as p,g as y,n as h,a0 as m,y as g,B as v,k as f,W as k,U as S,V as b,z as P,a2 as w,Y as _}from"./index-M5qy_4Wm.js";import{C}from"./customBottomSheet-C2KbP7iQ.js";import{s as G}from"./setVenueTvLanes-D7ccZfAY.js";const L={style:{width:"100%"},id:"matchup"},T={key:0,class:"text-center py-4"},x={class:"item py-3 px-3"},E=["src"],A={key:0,class:"mr-3"},W={key:1,style:{color:"var(--theme-background)"},class:"d-inline-block"},M={key:2,class:"text-red d-inline-block"},N={key:3,class:"text-orange d-inline-block"},V={key:4,class:"text-grey d-inline-block"};const U={name:"matchupsQuickTournaments",components:{CustomBottomSheet:C,playerWeek:e({name:"playerWeekQuickTournament",props:["selectedWeek","selectedSeason","playerList","gameList","selected","autoSchedule","autoGames","weekPath","isPublic"],emits:["playerClicked"],data(){return{currentPlayerlist:this.playerList,sortedByColumn:"",standingHeaders:[{label:"Rk",value:"rk"},{label:"Name",value:"first"}],headersPage1:[{label:" ",value:"",class:"border-left xs1 sm1"},{label:"Starting Count",value:"sgp",class:"border-left xs4 sm2"},{label:"Today GP",value:"gp",class:"border-left xs4 sm2"},{label:"Queued",value:"sched",class:"border-left xs4 sm2"},{label:"Total",value:"total",class:"border-left hidden-xs-only sm2"},{label:"STATUS",value:"status",class:"border-left border-right xs3 hidden-xs-only"}],headersQualifying:[{label:"Score",value:"score",class:"border-left xs6"},{label:"STATUS",value:"status",class:"border-left border-right xs6 hidden-xs-only"}]}},setup:()=>({venueStore:l(),eventStore:s()}),computed:{dbPathEventCurrentWeek(){return"/venues/"+this.venueStore.venue[".key"]+"/event-list/"+this.eventStore.selectedEventType.toLowerCase()+"/"+this.eventStore.selectedEvent[".key"]+"/currentWeek"},headers(){return"Qualifying Round"===this.selectedWeek.type?this.headersQualifying:this.headersPage1}},methods:{leagueType(){if(void 0===this.eventStore.selectedEvent.leagueType)return"standard-league";switch(this.eventStore.selectedEvent.leagueType){case"standard-league":default:return"standard-league";case"duals-league":return"doubles-league";case"big-axe-league":return"big-axe-league"}},sortGP(){this.currentPlayerlist.sort((e,t)=>e.gp>t.gp?1:e.gp<t.gp?-1:0)},scheduled(e){let t=0;return this.gameList.forEach(a=>{void 0!==a.player2?(a.player1.playerid==e[".key"]&&"Completed"!==a.status||a.player2.playerid==e[".key"]&&"Completed"!==a.status)&&t++:a.player1.playerid==e[".key"]&&"Completed"!==a.status&&t++}),t},autoScheduled(e){let t=0;return this.autoSchedule.forEach(a=>{a.player1.playerid!==e[".key"]&&a.player2.playerid!==e[".key"]||t++}),t},done(e){if(this.scheduled(e)+e.gp+e.gs>=4*this.selectedWeek.name.slice(-1))return!0},checkWeekCompleted(){if(!this.selectedWeek.completed)if("Qualifying Round"===this.selectedWeek.type)void 0===this.currentPlayerlist.find(e=>0===e.gp)&&this.completeWeek();else{this.currentPlayerlist.reduce((e,t)=>({gp:e.gp+t.gp})).gp>0&&this.completeWeek()}},completeWeek(){t(a(this.weekPath),{completed:!0}).then(e=>{}).catch(e=>{this._console(e)}),this.updateCurrentWeek()},updateCurrentWeek(){t(a(this.dbPathEventCurrentWeek),{completed:!0,name:this.selectedWeek.name,type:this.selectedWeek.type}),t(a("/venues/".concat(this.venueStore.venue[".key"],"/league-list/").concat(this.eventStore.selectedEvent.slug,"/").concat(this.selectedSeason,"/").concat(this.selectedWeek.name)),{completed:!0}),this.eventStore.selectedEvent.isOfficial&&t(a("".concat(this.dbPathEventCurrentWeek,"/").concat(this.selectedSeason,"/").concat(this.selectedWeek.name)),{completed:!0}),"Qualifying Round"===this.selectedWeek.type&&this.rankPlayers()},rankPlayers(){this.currentPlayerlist.sort((e,t)=>e.score<t.score?100:e.score>t.score?-100:0);let e=1;this.currentPlayerlist.forEach(l=>{l.rank=e,t(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/standings/").concat(l[".key"])),{rank:e}),e++})},playing(e){let t=0;return this.gameList.forEach(a=>{void 0!==a.player3?(a.player1.playerid==e[".key"]&&"Now Playing"==a.status||a.player2.playerid==e[".key"]&&"Now Playing"==a.status||a.player3.playerid==e[".key"]&&"Now Playing"==a.status||a.player4.playerid==e[".key"]&&"Now Playing"==a.status)&&t++:void 0!==a.player2?
1(a.player1.playerid==e[".key"]&&"Now Playing"==a.status||a.player2.playerid==e[".key"]&&"Now Playing"==a.status)&&t++:a.player1.playerid==e[".key"]&&"Now Playing"==a.status&&t++}),t}},mounted(){this.sortGP(),this.checkWeekCompleted()}},[["render",function(e,t,a,l,s,f){const k=p("v-checkbox"),S=p("v-col"),b=p("v-row");return y(),i("div",L,["Qualifying Throws"===l.eventStore.selectedEventType?(y(),i("div",T,[...t[0]||(t[0]=[n("strong",null,"Click on any 2 players or any 1 player to start qualifying throws.",-1)])])):r("",!0),o(b,{class:"justify-space-between grid-list-md main-list mb-4"},{default:c(()=>[(y(!0),i(d,null,u(s.currentPlayerlist,s=>(y(),h(S,{cols:"12",sm:"6",md:"4",class:"px-2 py-2 pa-2",key:s.id,onClick:t=>(a.isPublic||!f.scheduled(s))&&"Qualifying Throws"!==l.eventStore.selectedEventType||!f.scheduled(s)&&"Qualifying Throws"===l.eventStore.selectedEventType&&0===s.gp?(e.$emit("playerClicked",s),console.log("Emitting playerClicked for:",s.first)):(console.log("Click blocked for:",s.first,"reason: scheduled or other condition"),!1)},{default:c(()=>[n("div",x,[o(b,{class:"align-center"},{default:c(()=>[o(S,{cols:"2"},{default:c(()=>[o(k,{light:"",color:"var(--clr-blue)",disabled:1==f.scheduled(s)&&s.gp>0,"model-value":a.selected.includes(s.id),onClick:m(()=>{console.log("Checkbox clicked for:",s.alias,"Selected array:",a.selected,"Is selected:",a.selected.includes(s.id))},["prevent"])},null,8,["disabled","model-value","onClick"])]),_:2},1024),o(S,{cols:"2"},{default:c(()=>[void 0!==s.pic?(y(),i("img",{key:0,class:"avatar",src:s.pic},null,8,E)):r("",!0)]),_:2},1024),o(S,{cols:"8",class:"pl-1"},{default:c(()=>[g(v(s.first)+" ",1),"Qualifying Throws"!==l.eventStore.selectedEventType?(y(),i("span",A,[t[1]||(t[1]=n("i",{class:"icon-play_round"},null,-1)),g(" "+v(s.gs)+" ",1),t[2]||(t[2]=n("i",{class:"icon-calendar"},null,-1)),g(" "+v(s.gp)+" ",1),t[3]||(t[3]=n("i",{class:"icon-windows"},null,-1)),g(" "+v(s.autoGP),1)])):r("",!0),f.playing(s)?(y(),i("span",W,"NOW PLAYING")):r("",!0),f.scheduled(s)&&!f.playing(s)?(y(),i("span",M,"ADDED GAME")):f.scheduled(s)||0!==s.gp?"Qualifying Throws"===l.eventStore.selectedEventType&&s.gp>0?(y(),i("span",V,"COMPLETED")):r("",!0):(y(),i("span",N,"SELECT PLAYER"))]),_:2},1024)]),_:2},1024)])]),_:2},1032,["onClick"]))),128))]),_:1})])}],["__scopeId","data-v-4d0d5a43"]])},data(){return{isPublic:!1,totalLanes:4,dialogLane:!1,laneAutomation:"automatic",openLanes:["Cage 1","Cage 2","Cage 3","Cage 4","Cage 5","Cage 6","Cage 7","Cage 8","Cage 9","Cage 10"],matchup:{dialog:!1,player1:"",player2:"",court:"",confirmed:!1},virtual:this.eventStore.selectedEvent.virtual,user:"guest-user",myGames:[],loadMoreCompleted:50,loadMoreAutoSchedule:50,activeTabSecondary:"Qualifying Throws"===this.eventStore.selectedEventType?2:0,singleSelectBottom:!1,pleaseWait:!1}},props:{gameList:{type:Array,default:()=>[]},roundrobin:{type:Array,default:()=>[]},dblocation:String,dbScheduleLocation:String,matchSelect:String,schedule:{type:Object,default:()=>{}},public:Boolean,allowManageControls:{type:Boolean,default:!1},generateAutoGames:{type:Function},playersCount:Number,selectedWeek:{type:Object,default:()=>{}},selectedSeason:String,playerList:{type:Array,default:()=>[]},selected:{type:Array,default:()=>[]},autoSchedule:{type:Array,default:()=>[]},autoGames:{type:Array,default:()=>[]},weekPath:String,view:String,listView:String,useImmediateSingleSelect:{type:Boolean,default:!1}},emits:["singlePlayerGame","playerClicked","closeNextUp"],methods:{singlePlayerGame(){this.$emit("singlePlayerGame"),this.singleSelectBottom=!1},playerSelected(e){if(this.$emit("playerClicked",e),this.useImmediateSingleSelect){const t=e.id;let a;return a=this.selected.includes(t)?this.selected.length-1:this.selected.length<2?this.selected.length+1:this.selected.length,void(this.singleSelectBottom=1===a)}this.selected.includes(e.id)&&this.singleSelectBottom?this.singleSelectBottom=!1:1===this.selected.length?this.singleSelectBottom=!0:this.singleSelectBottom=!1},laneSelect(e){this.dialogLane=!1},showGamesheet:()=>"watl-quick-games",selectGame(e){if(this.isPublic){const t="/"+this.venueStore.venue.locationSlug+"/league/"+this.eventStore.selectedEvent[".key"]+"/public-quick-games/"+e.id;this.$router.push(t),this.$emit("closeNextUp",e.id)}else this.$router.push("/hosts/"+this.venueStore.venue.locationSlug+"/"+this.dblocation+"/"+e.id+"/"+this.showGamesheet())},deleteMatch(e){this.confirmDelete()&&(["game-list","game-data"].forEach(t=>{b(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/").concat(t,"/").concat(e.id)))}),this.addGameToSchedule(e,-1))},removeAutoMatch(e){this.confirmDelete()&&t(S("/venues/".concat(this.venueStore.venue.locationSlug,"/").concat(this.dblocation,"/autosched-cancel")),{[e.autoschedid]:!0})},confirmDelete:()=>confirm("Are you sure you want to delete?"),sendAutoToNowPlaying(e){this.createAutoGame(e),this.addGameToSchedule(e,1)},addGameToSchedule(e,l){if(!e.player2||!e.player2.playerid)return;let s=0;void 0!==this.schedule[e.player1.playerid]&&void 0!==this.schedule[e.player1.playerid][e.player2.playerid]?s=this.schedule[e.player1.playerid][e.player2.playerid]+l:s+=l,t(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/schedule/").concat(e.player1.playerid)),{[e.player2.playerid]:s});let i=0;void 0!==this.schedule[e.player2.playerid]&&void 0!==this.schedule[e.player2.playerid][e.player1.playerid]?i=this.schedule[e.player2.playerid][e.player1.playerid]+l:i+=l,t(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/schedule/").concat(e.player2.playerid)),{[e.player1.playerid]:i})},createAutoGame(e){null==e.player1.facebook&&(e.player1.facebook=""),null==e.player2.facebook&&(e.player2.facebook=""),null==e.player1.instagram&&(e.player1.instagram=""),null==e.player2.instagram&&(e.player2.instagram="");const l=this.availableLanes[0];k(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/game-list")),{player1:{playerid:e.player1.id,first:e.player1.first,alias:e.player1.alias,team:void 0!==e.player1.team?e.player1.team:"No Team",facebook:e.player1.facebook,instagram:e.player1.instagram},player2:{playerid:e.player2.id,first:e.player2.first,alias:e.player2.alias,team:void 0!==e.player2.team?e.player2.team:"No Team",facebook:e.player2.facebook,instagram:e.player2.instagram},arena:l,auto:!0,status:"Now Playing",gameStart:Date.now()}).then(s=>{G(l),t(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/game-data/").concat(s.key)),{player1:{playerid:e.player1.id,first:e.player1.first,alias:e.player1.alias,team:void 0!==e.player1.team?e.player1.team:"No Team",facebook:e.player1.facebook,instagram:e.player1.instagram},player2:{playerid:e.player2.id,first:e.player2.first,alias:e.player2.alias,team:void 0!==e.player2.team?e.player2.team:"No Team",facebook:e.player2.facebook,instagram:e.player2.instagram},round:1,winner:"none",round1:{player1:{sum:0},player2:{sum:0}},round2:{player1:{sum:0},player2:{sum:0}},round3:{player1:{sum:0},player2:{sum:0}},round4:{player1:{sum:0},player2:{sum:0}},round5:{player1:{sum:0},player2:{sum:0}},round6:{player1:{sum:0},player2:{sum:0}},throws:{player1:{sum:0},player2:{sum:0}}}).then(e=>{this.matchSelect&&(this.$router.push("/hosts/"+this.venueStore.venue.locationSlug+"/"+this.dblocation+"/"+s.key+"/"+this.showGamesheet()),this.$emit("closeNextUp"))})})},sendToNowPlaying(e){this.availableLanes.length>0&&t(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/game-list/").concat(e.id)),{status:"Now Playing",arena:this.availableLanes[0]}),void 0!==this.matchSelect&&(this.$router.push("/hosts/"+this.venueStore.venue.locationSlug+"/"+this.dblocation+"/"+e.id+"/"+this.showGamesheet()),this.$emit("closeNextUp"))},sendToQueue(e){t(a("/venues/".concat(this.venueStore.venue.locationSlug,"/event-list/group-events/").concat(this.eventStore.selectedEvent[".key"],"/game-list/").concat(e.id)),{status:"On Standby"}).then(()=>{G(e.arena,!0)})},isPlaying(e){let t;return this.gameList.forEach(a=>
1{void 0!==a.player2&&void 0!==e.player2?(a.player1.playerid==e.player1.playerid&&"Now Playing"==a.status||a.player1.playerid==e.player2.playerid&&"Now Playing"==a.status||a.player2.playerid==e.player1.playerid&&"Now Playing"==a.status||a.player2.playerid==e.player2.playerid&&"Now Playing"==a.status)&&(t=!0):a.player1.playerid==e.player1.playerid&&"Now Playing"==a.status&&(t=!0)}),t},sleep:e=>new Promise(t=>setTimeout(t,e)),async addAutoGames(){let e=this.generateAutoGames();this.pleaseWait=!0;for(let t in e)this.sendAutoToNowPlaying(e[t]),await this.sleep(2e3);this.pleaseWait=!1},reserMyGames(){this.myGames=[]}},setup:()=>({venueStore:l(),userStore:f(),eventStore:s()}),computed:{nowplaying(){return this.reserMyGames(),this.gameList.filter(e=>"Now Playing"===e.status&&(this.virtual&&this.public&&this.userStore.user&&this.userStore.user[".key"]&&(e.player1.playerid==this.userStore.user[".key"]||e.player2&&e.player2.playerid==this.userStore.user[".key"])&&this.myGames.push(e),!0)).sort(function(e,t){return!e.auto&&t.auto?-1:0})},nextup(){return this.gameList.filter(e=>"On Standby"==e.status)},requests(){return this.gameList.filter(e=>"Request"==e.status)},completed(){return this.gameList.filter(e=>"Completed"==e.status)},availableLanes(){return this.virtual?this.openLanes[0]:this.matchSelect?[this.matchSelect]:this.openLanes.filter(e=>!this.nowplaying.some(t=>e==t.arena))}},mounted(){this.isPublic=this.public,this.$firebaseAuth&&this.$firebaseAuth.currentUser?this.user=this.$firebaseAuth.currentUser.uid:window.$firebaseAuth&&window.$firebaseAuth.currentUser&&(this.user=window.$firebaseAuth.currentUser.uid),window.setTimeout(function(){},3e3)},watch:{public(){this.isPublic=this.public}}},B={style:{width:"100%"}},D={key:0,class:"alert"},Q={key:0,class:"pa-3"},R={key:0},$={key:1,class:"pa-3"},z={key:0},O={key:0,class:"mb-2 text-center text-grey",style:{width:"100%"}},I={key:1,class:"mb-2 text-center text-grey",style:{width:"100%"}},q={key:0,class:"live"},j={key:1,class:"ready"},Y={key:0},H={key:0,class:"vs"},F={class:"text-center"},Z={class:"text-center"},J={key:5},K={class:"label-stick filled"},X={class:"py-2 text-center",style:{color:"var(--theme-text)"}},ee={key:0,class:"text-center"},te={key:6};const ae=e(U,[["render",function(e,t,a,l,s,f){const k=p("v-alert"),S=p("v-icon"),b=p("v-btn"),_=p("v-col"),C=p("v-row"),G=p("v-tab"),L=p("v-tabs"),T=p("v-divider"),x=p("v-list-item-title"),E=p("v-list-item-subtitle"),A=p("v-list-item"),W=p("v-list"),M=p("playerWeek"),N=p("v-card-text"),V=p("v-card"),U=p("CustomBottomSheet"),ae=p("v-card-title"),le=p("v-spacer"),se=p("v-card-actions"),ie=p("v-dialog");return y(),i("div",B,[0===a.gameList.length&&"Qualifying Throws"===l.eventStore.selectedEventType?(y(),i("div",D," Click on any 2 players or any 1 player to start qualifying throws. ")):r("",!0),s.myGames.length>0?(y(),h(k,{key:1,color:"primary",class:"mx-6"},{default:c(()=>[...t[13]||(t[13]=[g("You have an active match! Click on score match button to play",-1)])]),_:1})):r("",!0),s.virtual&&!s.isPublic?(y(),h(C,{key:2,class:"bar"},{default:c(()=>[o(_,{sm:"3"},{default:c(()=>[o(b,{onClick:t[0]||(t[0]=e=>f.addAutoGames())},{default:c(()=>[o(S,{class:"mr-1"},{default:c(()=>[...t[14]||(t[14]=[g("mdi-plus",-1)])]),_:1}),t[15]||(t[15]=g(" Add auto-SCHEDULED",-1))]),_:1})]),_:1}),o(_,{sm:"3"},{default:c(()=>[n("span",null,[o(S,{class:"mr-2"},{default:c(()=>[...t[16]||(t[16]=[g("mdi-human-greeting",-1)])]),_:1}),n("strong",null,v(a.playersCount),1),t[17]||(t[17]=g(" players checked-in",-1))])]),_:1}),o(_,{sm:"3"},{default:c(()=>[n("span",null,[o(S,{class:"mr-2"},{default:c(()=>[...t[18]||(t[18]=[g("mdi-compare-horizontal",-1)])]),_:1}),n("strong",null,v(f.nowplaying.length),1),t[19]||(t[19]=g(" active matches",-1))])]),_:1}),o(_,{sm:"3"},{default:c(()=>[n("span",null,[o(S,{class:"mr-2"},{default:c(()=>[...t[20]||(t[20]=[g("mdi-calendar-check",-1)])]),_:1}),n("strong",null,v(f.completed.length),1),t[21]||(t[21]=g(" matches completed",-1))])]),_:1})]),_:1})):r("",!0),o(C,{class:P({listview:"List view"===a.listView})},{default:c(()=>[(y(!0),i(d,null,u([f.nowplaying,f.nextup],(e,p)=>(y(),i(d,null,[!s.isPublic||s.isPublic&&(0===p||1===p)?(y(),h(_,{cols:"12",ke
1y:"first"+p},{default:c(()=>[n("div",{class:P({"label-stick":!1,"label-matchselect":a.matchSelect})},[0!==p||s.virtual?r("",!0):(y(),i("div",Q,[t[22]||(t[22]=g(" NOW PLAYING ",-1)),void 0!==e?(y(),i("span",R,"("+v(e.length)+")",1)):r("",!0)])),1===p?(y(),i("div",$,[t[23]||(t[23]=g(" ADDED GAMES ",-1)),void 0!==e?(y(),i("span",z,"("+v(e.length)+")",1)):r("",!0)])):r("",!0)],2),o(C,{class:"list"},{default:c(()=>[0===p&&0===e.length?(y(),i("div",O," No games are currently being played ")):r("",!0),1===p&&0===f.nextup.length?(y(),i("div",I," No games were manually scheduled ")):r("",!0),(y(!0),i(d,null,u(e,(e,u)=>(y(),i(d,null,[2!==p||2===p&&u<s.loadMoreAutoSchedule?(y(),h(_,{key:"second"+u,cols:"12",sm:"List view"!==a.listView?"6":"12",md:"List view"!==a.listView?"4":"12",class:P({auto:e.auto,"px-2 py-4":"List view"!==a.listView})},{default:c(()=>[o(C,{class:"match"},{default:c(()=>[o(_,{cols:"12",class:"pa-0"},{default:c(()=>[o(C,{class:P(["header align-center",{"pa-2":"List view"!==a.listView}]),"no-gutters":""},{default:c(()=>[o(_,{cols:"3",class:"pa-0"},{default:c(()=>[e.scored&&0==p?(y(),i("span",q,"Live")):(y(),i("span",j,"Ready"))]),_:2},1024),o(_,{cols:"6",class:"text-center center"},{default:c(()=>[0!=p||s.virtual?r("",!0):(y(),i("span",Y,v("watl"===l.venueStore.venue.rules?"Lane":"Cage")+" "+v(e.arena.slice(-2)),1
1))]),_:2},1024),o(_,{cols:"3",class:"text-right"},{default:c(()=>[a.allowManageControls&&(1===p||3===p&&!a.matchSelect)?(y(),h(b,{key:0,icon:"",class:"gray-circle",onClick:t=>f.deleteMatch(e)},{default:c(()=>[...t[24]||(t[24]=[n("i",{class:"icon-close"},null,-1)])]),_:1},8,["onClick"])):r("",!0),0===p&&a.allowManageControls?(y(),h(b,{key:1,icon:"",class:"lightblue-circle",onClick:m(t=>f.sendToQueue(e),["stop"])},{default:c(()=>[...t[25]||(t[25]=[n("i",{class:"icon-arrow-down"},null,-1)])]),_:1},8,["onClick"])):r("",!0)]),_:2},1024)]),_:2},1032,["class"]),o(C,{class:"body text-center pa-3 align-center"},{default:c(()=>[o(_,{cols:void 0===e.player2&&"List view"!==a.listView?"12":"4",style:w(void 0===e.player2&&"List view"!==a.listView?"padding-top: 44px":"")},{default:c(()=>[g(v(e.player1.first),1)]),_:2},1032,["cols","style"]),o(_,{cols:"4"},{default:c(()=>[void 0!==e.player2?(y(),i("span",H,[...t[26]||(t[26]=[n("i",{class:"icon-axes"},null,-1),n("span",null,"VS",-1)])])):r("",!0),2===p?(y(),h(b,{key:1,color:"primary",class:"btnBottom",disabled:0===f.availableLanes.length||f.isPlaying(e)&&!s.virtual,onClick:t=>f.sendAutoToNowPlaying(e),title:"select game"},{default:c(()=>[...t[27]||(t[27]=[g("Schedule Match ",-1),n("i",{class:"icon-arrow-full-up"},null,-1)])]),_:1},8,["disabled","onClick"])):r("",!0),(1===p||3===p)&&!s.isPublic||s.isPublic&&(1===p||3===p)&&(a.allowManageControls||e.player1&&e.player1.playerid==l.userStore.user[".key"]||e.player2&&e.player2.playerid==l.userStore.user[".key"])?(y(),h(b,{key:2,color:"primary",class:"btnBottom",disabled:0===f.availableLanes.length||f.isPlaying(e)&&!s.virtual,onClick:t=>f.sendToNowPlaying(e),title:"play game"},{default:c(()=>[...t[28]||(t[28]=[g("Play Match ",-1),n("i",{class:"icon-exit"},null,-1)])]),_:1},8,["disabled","onClick"])):r("",!0),0===p?(y(),h(b,{key:3,color:"primary",class:"btnBottom",onClick:m(t=>f.selectGame(e),["stop"]),disabled:"Disabled"===l.venueStore.venue.status,title:"play game"},{default:c(()=>[...t[29]||(t[29]=[g("Score Match ",-1),n("i",{class:"icon-exit"},null,-1)])]),_:1},8,["onClick","disabled"])):r("",!0)]),_:2}
1,1024),void 0!==e.player2?(y(),h(_,{key:0,cols:"4"},{default:c(()=>[g(v(e.player2.first),1)]),_:2},1024)):r("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["sm","md","class"])):r("",!0)],64))),256))]),_:2},1024),n("div",F,[2===p&&s.loadMoreAutoSchedule<e.length?(y(),h(b,{key:0,size:"large",class:"mt-4",color:"primary",onClick:t[1]||(t[1]=e=>s.loadMoreAutoSchedule+=50)},{default:c(()=>[...t[30]||(t[30]=[g("Load more",-1)])]),_:1})):r("",!0),2===p&&s.loadMoreAutoSchedule<e.length?(y(),h(b,{key:1,size:"large",class:"mt-4",color:"primary",onClick:t[2]||(t[2]=e=>s.loadMoreAutoSchedule+=9999)},{default:c(()=>[...t[31]||(t[31]=[g("Load All",-1)])]),_:1})):r("",!0)])]),_:2},1024)):r("",!0)],64))),256))]),_:1},8,["class"]),a.view?r("",!0):(y(),h(L,{key:3,id:"bottomTabs","bg-color":"transparent","slider-color":"primary",modelValue:s.activeTabSecondary,"onUpdate:modelValue":t[3]||(t[3]=e=>s.activeTabSecondary=e),height:"64"},{default:c(()=>[o(G,null,{default:c(()=>[...t[32]||(t[32]=[g("AUTOSCHEDULE",-1)])]),_:1}),o(G,null,{default:c(()=>[...t[33]||(t[33]=[g("COMPLETED",-1)])]),_:1}),o(G,null,{default:c(()=>[...t[34]||(t[34]=[g("MATCHUP",-1)])]),_:1})]),_:1},8,["modelValue"])),0===s.activeTabSecondary?(y(),h(C,{key:4,"no-gutters":""},{default:c(()=>[(y(!0),i(d,null,u([a.roundrobin],(e,l)=>(y(),h(_,{key:"first"+l,cols:"12"},{default:c(()=>[o(C,{class:P({listview:"List view"===a.listView})},{default:c(()=>[(y(!0),i(d,null,u(e,(e,l)=>(y(),i(d,null,[l<s.loadMoreAutoSchedule?(y(),h(_,{key:"second"+l,cols:"12",sm:"List view"!==a.listView?"6":"12",md:"List view"!==a.listView?"4":"12",class:P({auto:e.auto,"px-2 py-4":"List view"!==a.listView})},{default:c(()=>[o(C,{class:"match"},{default:c(()=>[o(_,{cols:"12"},{default:c(()=>[o(C,{class:"text-center pa-3 align-center body"},{default:c(()=>[o(_,{cols:"4"},{default:c(()=>[t[35]||(t[35]=n("div",null,null,-1)),n("div",null,v(e.player1.first),1)]),_:2},1024),o(_,{cols:"4"},{default:c(()=>[t[37]||(t[37]=n("span",{class:"vs"},[n("i",{class:"icon-axes"}),n("span",null,"VS")],-1)),o(b,{color:"primary",class:"btnBottom",disabled:0===f.availableLanes.length||f.isPlaying(e)&&!s.virtual,onClick:t=>f.sendAutoToNowPlaying(e),title:"select game"},{default:c(()=>[...t[36]||(t[36]=[g("Schedule Match ",-1),n("i",{class:"icon-arrow-full-up"},null,-1)])]),_:1},8,["disabled","onClick"])]),_:2}
1,1024),void 0!==e.player2?(y(),h(_,{key:0,cols:"4"},{default:c(()=>[t[38]||(t[38]=n("div",null,null,-1)),n("div",null,v(e.player2.first),1)]),_:2},1024)):r("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["sm","md","class"])):r("",!0)],64))),256))]),_:2},1032,["class"]),n("div",Z,[0===l&&s.loadMoreAutoSchedule<e.length?(y(),h(b,{key:0,size:"large",class:"mt-4",color:"primary",onClick:t[4]||(t[4]=e=>s.loadMoreAutoSchedule+=50)},{default:c(()=>[...t[39]||(t[39]=[g("Load more",-1)])]),_:1})):r("",!0),0===l&&s.loadMoreAutoSchedule<e.length?(y(),h(b,{key:1,size:"large",class:"mt-4",color:"primary",onClick:t[5]||(t[5]=e=>s.loadMoreAutoSchedule+=9999)},{default:c(()=>[...t[40]||(t[40]=[g("Load All",-1)])]),_:1})):r("",!0)])]),_:2},1024))),128))]),_:1})):r("",!0),f.completed.length>0&&!a.matchSelect&&1===s.activeTabSecondary?(y(),i("div",J,[n("div",K,[n("div",X,[g(" COMPLETED ("+v(f.completed.length)+") ",1),t[41]||(t[41]=n("div",{style:{"font-size":"12px"}},"Showing points obtained",-1))]),o(T,{style:{"background-color":"var(--theme-text)"}})]),(y(!0),i(d,null,u(f.completed,(e,t)=>(y(),i(d,null,[t<s.loadMoreCompleted?(y(),h(C,{key:e[".key"],onClick:a=>f.selectGame(e,t),class:"py-2 banded-list align-center"},{default:c(()=>[o(_,{cols:"4",sm:"5"},{default:c(()=>[o(W,{density:"compact","bg-color":"transparent"},{default:c(()=>[o(A,null,{default:c(()=>[o(A,null,{default:c(()=>["watl"!=l.eventStore.selectedEvent.rules?(y(),h(x,{key:0,class:"text-right alias"},{default:c(()=>[g(v(e.player1.alias),1)]),_:2},1024)):r("",!0),o(E,{class:"text-right"},{default:c(()=>[g(v(e.player1.first),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024),o(_,{cols:"2",sm:"1",class:"text-center score"},{default:c(()=>[n("span",{class:P({winner:e.p1score>e.p2score})},v(e.p1score),3)]),_:2},1024),o(_,{cols:"2",sm:"1",class:"text-center score"},{default:c(()=>[n("span",{class:P({winner:e.p1score<e.p2score})},v(e.p2score),3)]),_:2},1024),o(_,{cols:"4",sm:"5"},{default:c(()=>[o(W,{density:"compact","bg-color":"transparent"},{default:c(()=>
1[void 0!==e.player2?(y(),h(A,{key:0},{default:c(()=>[o(A,null,{default:c(()=>["watl"!=l.eventStore.selectedEvent.rules?(y(),h(x,{key:0,class:"alias"},{default:c(()=>[g(v(e.player2.alias),1)]),_:2},1024)):r("",!0),o(E,null,{default:c(()=>[g(v(e.player2.first),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)):r("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"])):r("",!0)],64))),256)),s.isPublic?r("",!0):(y(),i("div",ee,[s.loadMoreCompleted<f.completed.length?(y(),h(b,{key:0,size:"large",color:"primary",onClick:t[6]||(t[6]=e=>s.loadMoreCompleted+=50)},{default:c(()=>[...t[42]||(t[42]=[g("Load more",-1)])]),_:1})):r("",!0),s.loadMoreCompleted<f.completed.length?(y(),h(b,{key:1,size:"large",color:"primary",onClick:t[7]||(t[7]=e=>s.loadMoreCompleted+=9999)},{default:c(()=>[...t[43]||(t[43]=[g("Load all",-1)])]),_:1})):r("",!0)]))])):r("",!0),a.playerList&&!a.view?(y(),i("div",te,[a.playerList.length>0&&"Playoffs"!==a.selectedWeek.type&&2===s.activeTabSecondary?(y(),h(M,{key:0,selectedWeek:a.selectedWeek,selectedSeason:a.selectedSeason,playerList:a.playerList,gameList:a.gameList,selected:a.selected,isPublic:s.isPublic,onSinglePlayerGame:f.singlePlayerGame,onPlayerClicked:f.playerSelected,autoSchedule:a.autoSchedule,autoGames:a.autoSchedule,weekPath:a.weekPath},null,8,["selectedWeek","selectedSeason","playerList","gameList","selected","isPublic","onSinglePlayerGame","onPlayerClicked","autoSchedule","autoGames","weekPath"])):r("",!0)])):r("",!0),o(U,{"hide-overlay":"",persistent:"",modelValue:s.singleSelectBottom,"onUpdate:modelValue":t[9]||(t[9]=e=>s.singleSelectBottom=e)},{default:c(()=>[o(V,null,{default:c(()=>[o(N,{class:"text-center"},{default:c(()=>[o(b,{size:"large",color:"primary",onClick:t[8]||(t[8]=e=>f.singlePlayerGame())},{default:c(()=>[o(S,{class:"mr-2"},{default:c(()=>[...t[44]||(t[44]=[g("mdi-account-circle",-1)])]),_:1}),t[45]||(t[45]=g(" score single player match",-1))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),o(ie,{modelValue:s.dialogLane,"onUpdate:modelValue":t[11]||(t[11]=e=>s.dialogLane=e),persistent:"","max-width":"300px",style:{background:"var(--theme-dialog)"}},{default:c(()=>[o(V,null,{default:c(()=>[o(ae,{class:"headline"},{default:c(()=>[...t[46]||(t[46]=[g("Select Lane",-1)])]),_:1}),o(N,{class:"text-center"},{default:c(()=>[(y(!0),i(d,null,u(parseInt(s.totalLanes),e=>(y(),h(b,{size:"large",color:"primary",key:e,class:"my-2",onClick:t=>f.laneSelect(e)},{default:c(()=>[g("Lane "+v(e),1)]),_:2},1032,["onClick"]))),128))]),_:1}),o(se,null,{default:c(()=>[o(le),o(b,{color:"error",variant:"flat",onClick:t[10]||(t[10]=e=>s.dialogLane=!1)},{default:c(()=>[...t[47]||(t[47]=[g("Cancel",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),o(ie,{modelValue:s.pleaseWait,"onUpdate:modelValue":t[12]||(t[12]=e=>s.pleaseWait=e),width:"500"},{default:c(()=>[o(V,null,{default:c(()=>[o(ae,{class:"headline grey lighten-2","primary-title":""},{default:c(()=>[...t[48]||(t[48]=[g(" Please wait. ",-1)])]),_:1}),o(N,null,{default:c(()=>[...t[49]||(t[49]=[g(" Please wait, app is adding auto-scheduled games. ",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}],["__scopeId","data-v-cbfc318a"]]),le={mounted(){},setup:()=>({seasonStore:_(),eventStore:s()}),methods:{opponentList(e){let t=[];this.weekPlayers.forEach(a=>{void 0!==this.schedule[e.id]&&void 0!==this.schedule[e.id][a.id]&&e.id!==a.id?t[a.id]={gp:this.schedule[e.id][a.id],totalGP:a.gs+a.gp+a.autoGP}:e.id!==a.id&&(t[a.id]={gp:0,totalGP:a.gs+a.gp+a.autoGP})});let a=[];for(let l in t)a.push({opponent:l,gp:t[l].gp,totalGP:t[l].totalGP});return a.sort(function(e,t){return e.gp-t.gp||e.totalGP-t.totalGP})},opponentListTeam(e){let t=[];this.weekPlayers.forEach(a=>{void 0===this.schedule[e.id]||void 0===this.schedule[e.id][a.id]||e.id===a.id||this.checkSameTeam(e,a)?e.id===a.id||this.checkSameTeam(e,a)||(t[a.id]={gp:0,totalGP:a.gs+a.gp+a.autoGP}):t[a.id]={gp:this.schedule[e.id][a.id],totalGP:a.gs+a.gp+a.autoGP}});let a=[];for(let l in t)a.push({opponent:l,gp:t[l].gp,totalGP:t[l].totalGP});return a.sort(function(e,t){return e.gp-t.gp||e.totalGP-t.totalGP})},findPlayer(e){if(void 0!==e){return this.weekPlayers.find(t=>e.opponent===t.id)}},gamesQueued(e,t){let a=0;return t.forEach(t=>
1{t.player2?(t.player1.playerid==e.id&&"Completed"!=t.status||t.player2.playerid==e.id&&"Completed"!=t.status)&&a++:t.player1.playerid==e.id&&"Completed"!=t.status&&a++}),a},isUnderMaxGames(e,t){return this.eventStore.selectedEvent.virtual&&(e.autoGP+=this.gamesQueued(e,this.weekGames)),e.gp+e.gs+e.autoGP<t&&e.autoGP<=7},isUnderMaxGamesTeam(e,t,a){let l=e.gp+e.gs+e.autoGP,s=e.autoGP+t.autoGP;return l<=a&&s<=7},playersSameTeam(e,t){let a=null;for(let l in e)if(e[l].team.name===t.team.name&&e[l].id!==t.id)return a=e[l],a;return a},checkDuplicates(e,t,a,l){let s=[e.id,t.id,a.id,l.id];return new Set(s).size!==s.length},checkSameTeam(e,t){let a=[e.team.name,t.team.name];return new Set(a).size!==a.length},standardRR(){let e=[],t=0;t=void 0!==this.rrWeek?4*this.rrWeek.slice(-1):4;let a=this.weekPlayers.slice().sort((e,t)=>e.gs+e.gp-(t.gs+t.gp));return a.forEach(e=>{e.autoGP=0}),a.forEach((a,l)=>{let s=this.opponentList(a);for(let i=0;this.isUnderMaxGames(a,t)&&i<=s.length-1;i++){let l=this.findPlayer(s[i]);if(void 0!==l&&this.isUnderMaxGames(l,t)){let t={sort:a.autoGP-l.autoGP,player1:{id:a.id,alias:a.alias,first:a.first,pic:a.pic,playerid:a.id,team:a.team,facebook:a.facebook,instagram:a.instagram},player2:{id:l.id,alias:l.alias,first:l.first,pic:l.pic,playerid:l.id,team:l.team,facebook:l.facebook,instagram:l.instagram}};e.push(t),a.autoGP++,l.autoGP++}else void 0===l||(l.gp,l.gs,l.autoGP)}}),e.sort(function(e,t){return e.sort-t.sort})},doublesRR(){let e=[],t=0,a=null;if(void 0===this.rrWeek)return;if(t=4*this.rrWeek.slice(-1),!this.showNextUp&&"classic"===this.$route.name)return;if("Playoffs"===this.seasonStore.hostWeek.type)return[];let l=this.weekPlayers.slice().sort((e,t)=>e.gs+e.gp-(t.gs+t.gp));return l.forEach(e=>{e.autoGP=0}),a=l.sort(function(e,t){if(void 0!==e.team&&void 0!==t.team){if(e.team.name<t.team.name)return-1;if(e.team.name>t.team.name)return 1}return 0}),a.forEach((l,s)=>{let i=this.opponentListTeam(l);for(let r=0;this.isUnderMaxGames(l,t)&&r<=i.length-2;r++){let s=this.playersSameTeam(a,l),o=this.findPlayer(i[r]),n=this.playersSameTeam(a,o);if(null!=o&&null!=n&&null!=s&&this.isUnderMaxGamesTeam(o,n,t)&&this.isUnderMaxGamesTeam(l,s,t)&&!this.checkDuplicates(o,n,l,s)&&this.checkSameTeam(o,n)&&this.checkSameTeam(l,s)){let t={sort:l.autoGP+s.autoGP-(o.autoGP+n.autoGP),player1:{id:l.id,alias:l.alias,first:l.first,last:l.last,pic:l.pic,playerid:l.id,team:l.team},player2:{id:s.id,alias:s.alias,first:s.first,last:s.last,pic:s.pic,playerid:s.id,team:s.team},player3:{id:o.id,alias:o.alias,first:o.first,last:o.last,pic:o.pic,playerid:o.id,team:o.team},player4:{id:n.id,alias:n.alias,first:n.first,last:n.last,pic:n.pic,playerid:n.id,team:n.team}};e.push(t),l.autoGP++,s.autoGP++,o.autoGP++,n.autoGP++}else void 0===o||(o.gp,o.gs,o.autoGP)}}),e.sort(function(e,t){return e.sort-t.sort})},generateAutoGames(){return void 0===this.eventStore.selectedEvent.leagueType||"quick-group-games"===this.eventStore.selectedEvent.leagueType?this.standardRR():void 0}},computed:{rrWeek(){return void 0!==this.weekID?this.weekID:this.selectedWeek.name},newRR(){return void 0===this.eventStore.selectedEvent.leagueType||"quick-group-games"===this.eventStore.selectedEvent.leagueType?this.standardRR():void 0}}};export{ae as m,le as r};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.