PageSourceSearch

https://axethrowing.org/assets/watl-Dr90i3Zc.js

js axethrowing.org collected 2026-10-01 15:00:56 UTC 100,402 bytes, 1 lines download raw bytes

1import{m as e}from"./matchups-BkvTHpmK.js";import{a as t}from"./accolades-BIKMTpKJ.js";import{r as a}from"./newroundrobin-BxKMGNd8.js";import{p as s}from"./playoffScheduling-DTKuKqYe.js";import{c as o}from"./chat-BKlFAIoT.js";import{o as n}from"./online-CG08BUj0.js";import{X as i,H as l,_ as r,u as c,ap as u,r as h,e as d,g as p,v as g,f as m,q as y,n as v,t as w,y as f,F as S,a5 as k,Z as T,k as b,m as D,a4 as I,c as P,V as O,U as B,G as C,N as E,R as _,c2 as R,ck as x,z as L,B as N,a_ as W,x as G,as as A,w as j,bV as K,a0 as X,Y as M,o as U,bA as H,ai as Q,ac as V,ad as F,O as $,an as q,cl as z,ak as Y}from"./index-M5qy_4Wm.js";import{c as Z,s as J,T as ee,i as te}from"./targetPoint-tZzPPSMN.js";import{s as ae}from"./setVenueTvLanes-D7ccZfAY.js";import{g as se}from"./dateTimeFormater-C88j8ARD.js";import{_ as oe}from"./arrow-BN2WFFaR.js";import{B as ne}from"./boardBottom-aHDEkg-L.js";import{c as ie}from"./chatModal-DvERl9al.js";import"./customBottomSheet-C2KbP7iQ.js";import"./weekGames-BmMPzrMO.js";async function le(e,t){const a=+(await ce(e[".key"],e.rating,e.daysSinceLastGame)),s=+(await ce(t[".key"],t.rating,t.daysSinceLastGame)),o=+ue(a,s),n=+ue(s,a),i=+he(e),l=+he(t),r=de(e),c=de(t),u=+pe(a,e.winner,o,e.ratingDeviation),h=+pe(s,t.winner,n,t.ratingDeviation),d=+ge(u,e.averageThrow,i,r,e.ratingDeviation,e.winner),p=+ge(h,t.averageThrow,l,c,t.ratingDeviation,t.winner),g=+me(e.ratingDeviation,t.ratingDeviation,o),m=+me(t.ratingDeviation,e.ratingDeviation,n),y=+ye(e.eventDivision,t.eventDivision,a,d-a),v=+ye(t.eventDivision,e.eventDivision,s,p-s),w=+ve(e.playerDivision,y),f=+ve(t.playerDivision,v);return{player1:{".key":e[".key"],finalRating:+w.toFixed(2),finalRatingDeviation:+g.toFixed(2),preGameRating:a,bk:i,failures:r,winOdds:o,postGameRating:d,preFinalRating:y},player2:{".key":t[".key"],finalRating:+f.toFixed(2),finalRatingDeviation:+m.toFixed(2),preGameRating:s,bk:l,failures:c,winOdds:n,postGameRating:p,preFinalRating:v}}}const re=async e=>{var t,a,s;const o=await i(l("/watl/players-career/".concat(e))).then(e=>e.exists()?e.val():{});let n=[];if(o.league)for(let[i,l]of Object.entries(o.league)){const e="sanctioned"===l.sanctioning||(null==(t=l.name)?void 0:t.includes("official"));"standard-league"===l.type&&(null==(a=l.name)?void 0:a.includes("hatchet"))&&e&&n.push(i)}let r=[];if(o.tournament)for(let[i,l]of Object.entries(o.tournament))"standard-league"===l.type&&(null==(s=l.name)?void 0:s.includes("hatchet"))&&"sanctioned"===l.sanctioning&&r.push(i);let c=0;return n.forEach(e=>{Object.keys(o["league-games"][e]||{}).forEach(e=>{const t=se(e);t>c&&(c=t)})}),r.forEach(e=>{Object.keys(o["tournament-games"][e]||{}).forEach(e=>{const t=se(e);t>c&&(c=t)})}),c};async function ce(e,t=250,a){let s;try{s=void 0!==a?0:await re(e)}catch(o){s=0}if(!(s>0||void 0!==a))return t;{const e=(new Date).getTime(),o=864e5,n=Math.abs(e-s),i=Math.floor(n/o),l=void 0!==a?a:i;if(l<90)return t;if(l>=90){const e=-.003994*(l-90);return(t*Math.pow(Math.E,e)).toFixed(4)}}}function ue(e,t){return(.05+.9/(1+Math.pow(10,(t-e)/600))).toFixed(4)}function he(e){return Object.values(e.hitBullsEyes).reduce((e,t)=>e+t.total,0)+2*Object.values(e.hitKillShots).reduce((e,t)=>e+t.total,0)}function de(e){return-2*(e.faults+e.drops+.75*e.score0)}function pe(e,t,a,s=150){return(e+3*((t?1:0)-a)*(1+s/100)).toFixed(4)}function ge(e,t,a,s,o=150,n){const i=n?1:-1;return(e+i*(t*a+s/2*i)*(o/1e3)*1.9).toFixed(4)}function me(e=150,t=150,a){const s=1/Math.pow(e,2),o=Math.pow(.0057565,2),n=Math.sqrt(1+3*o*(Math.pow(t,2)/Math.pow(Math.PI,2))),i=Math.pow(1/n,2);return(1/+Math.sqrt(s+o*i*a*(1-a))).toFixed(4)}function ye(e,t,a,s){let o=1;return("professional"===e&&"recreational"===t||"recreational"===e&&"professional"===t)&&(o=.3),("professional"===e&&"amateur"===t||"amateur"===e&&"professional"===t||("recreational"===e&&"amateur"===t||"amateur"===e&&"recreational"===t))&&(o=.5),(a+s*o).toFixed(4)}function ve(e,t){let a=t;return"professional"===e?(t<550&&(a=550),t>1200&&(a=1200)):["amateur","recreational"].includes(e)&&(t<100&&(a=100),t>1200&&(a=1200)),a}const we={class:"text-center mb-12",style:{height:"40px"}},fe={class:"sideButtons"},Se=r({__name:"topPanelActions",props:{showTargetTypeSwitcher:{type:Boolean,default:!1},showEventTypeSwitcher:{type:Boolean,default:!1},eventType:{type:String,default:"league"},practiceEventType:String,targetType:String,showDoneButton:Boolean,showSubmitButton:Boolean,showNextStepActions:Boolean,showKillShotThrows:Boolean,disableCLoseIcon:Boolean,showSideEditIcon:Bo
1olean,showNextThrows:Boolean,isButtonLoading:Boolean,defaultBoard:Boolean,showDoneAsCommissionerButton:Boolean},emits:["changeTargetType","changeEventType","endGame","scoresEntered","enableOvertime","goToRound","showNextUp","exitAction","doneAsCommissioner"],setup(e,{emit:t}){const a=t,s=c(),o=u("postHog");function n(){o.capture("button_next-game"),a("showNextUp",!0)}return(t,o)=>{const i=h("v-switch"),l=h("v-col"),r=h("v-btn"),c=h("v-row");return p(),d(S,null,[g("div",we,[m(c,null,{default:y(()=>[m(l,{cols:"2"},{default:y(()=>[e.showTargetTypeSwitcher?(p(),v(i,{key:0,"hide-details":"",label:"Default",modelValue:e.defaultBoard,"onUpdate:modelValue":o[0]||(o[0]=e=>a("changeTargetType",e)),class:"ml-3 hidden-sm-and-down",color:"#2f27d4"},null,8,["modelValue"])):w("",!0),e.showEventTypeSwitcher?(p(),v(i,{key:1,"hide-details":"","true-value":"league","false-value":"tournament",label:"".concat(e.practiceEventType," game"),modelValue:e.practiceEventType,"onUpdate:modelValue":o[1]||(o[1]=e=>a("changeEventType",e)),class:"ml-3 hidden-sm-and-down",color:"#2f27d4"},null,8,["label","modelValue"])):w("",!0)]),_:1}),m(l,{cols:"8"},{default:y(()=>[e.showDoneButton?(p(),v(r,{key:0,loading:e.isButtonLoading,disabled:e.isButtonLoading,class:"primary actionButton",onClick:o[2]||(o[2]=e=>a("endGame",1))},{default:y(()=>[...o[10]||(o[10]=[f(" Done ",-1)])]),_:1},8,["loading","disabled"])):w("",!0),e.showSubmitButton?(p(),v(r,{key:1,class:"primary actionButton",onClick:o[3]||(o[3]=e=>a("scoresEntered"))},{default:y(()=>[...o[11]||(o[11]=[f("Submit",-1)])]),_:1})):w("",!0),e.showDoneAsCommissionerButton?(p(),v(r,{key:2,class:"primary actionButton",onClick:o[4]||(o[4]=e=>a("doneAsCommissioner"))},{default:y(()=>[...o[12]||(o[12]=[f("Done as commissioner",-1)])]),_:1})):w("",!0),e.showNextThrows?(p(),v(r,{key:3,color:"primary",onClick:o[5]||(o[5]=e=>a("goToRound",1))},{default:y(()=>[...o[13]||(o[13]=[f("NEXT SET OF THROWS",-1)])]),_:1})):w("",!0),e.showKillShotThrows?(p(),v(r,{key:4,color:"primary",onClick:o[6]||(o[6]=e=>a("enableOvertime"))},{default:y(()=>[...o[14]||(o[14]=[f("NEXT ROUND: KILLSHOT THROWS ",-1)])]),_:1})):w("",!0),e.showNextStepActions&&!e.showSubmitButton?(p(),d(S,{key:5},[m(r,{disabled:e.isButtonLoading||"Disabled"===k(s).venue.status,class:"primary",onClick:n},{default:y(()=>[...o[15]||(o[15]=[f(" Next Game ",-1)])]),_:1},8,["disabled"]),m(r,{disabled:e.isButtonLoading,class:"primary",onClick:o[7]||(o[7]=e=>a("exitAction"))},{default:y(()=>[...o[16]||(o[16]=[f(" Close ",-1)])]),_:1},8,["disabled"])],64)):w("",!0)]),_:1}),m(l,{cols:"2"})]),_:1})]),g("div",fe,[e.showSideEditIcon&&!e.showSubmitButton?(p(),v(r,{key:0,loading:e.isButtonLoading,disabled:e.isButtonLoading||"Disabled"===k(s).venue.status,color:"icony",variant:"flat",onClick:o[8]||(o[8]=e=>a("endGame",-1)),border:""},{default:y(()=>[...o[17]||(o[17]=[g("i",{class:"icon-edit"},null,-1)])]),_:1},8,["loading","disabled"])):w("",!0),m(r,{border:"",color:"icony",variant:"flat",onClick:o[9]||(o[9]=e=>a("exitAction")),disabled:e.isButtonLoading||e.disableCLoseIcon},{default:y(()=>[...o[18]||(o[18]=[g("i",{class:"icon-close"},null,-1)])]),_:1},8,["disabled"])])],64)}}},[["__scopeId","data-v-ab3db4a6"]]),ke={__name:"hatchetTopPanel",props:{rules:String,type:String,isPublic:Boolean,throwsDone:Boolean,overtimeDone:Boolean,isSinglePlayer:Boolean,defaultBoard:Boolean,practiceEventType:String,isLeague:Boolean,isPracticeOrLiveGameType:Boolean,inactive:Boolean,killshotOvertime:Boolean,settings:{type:Object,default:()=>{}},gamesheet:{type:Object,default:()=>{}},gameinfo:{type:Object,default:()=>{}},playerGameStats:{type:Object,default:()=>{}},sumScores:{type:Object,default:()=>{}},isBestOfX:Number,round:Number,game:String,leagueID:String,seasonID:String,weekID:String,players:{type:Array,default:()=>[]}},emits:["enableOvertime","goToRound","showNextUp","exitAction","declareWinner","checkAccolades","deathThrowCalled","setDefaultBoard","setEventType","removePlayer2"],setup(e,{emit:t}){const a=c(),s=T(),o=b(),n=t,r=e,u=D(),h=I(!1),d=P(()=>r.isBestOfX>1&&"Completed"!==r.gameinfo.status&&"Qualifying Round"===r.settings.type&&r.isBestOfX>r.round&&!r.throwsDone),g=P(()=>"Completed"===r.gameinfo.status&&"practice"!==r.type&&"live"!==r.type),m=P(()=>{const e=s.selectedEvent.isOfficial&&"individual"!==s.selectedEvent.divisionRuleset||"sanctioned"===s.selectedEvent.sanctioning,t=(new Date).getFullYear()>=2025,a="watl"===s.selectedEvent.rules&&"standard-league"===s.selectedEvent.leagueType;return e&&t&&a}),y=P(()=>{const e=Object.entries({player1:r.gamesheet.player1||{},player2:r.gamesheet.player2||{}}).find(([e,t])=>t.playerid===o.user[".key"]);return null==e?void 0:e[0]}),w=P(()=>{const e=y.value;return r.isPublic&&y.value&&e&&r.gamesheet.throws[e].completed}),f=P(()=>{const e=r.gameinfo.player1Complete&&!r.gameinfo.player2Complete||!r.gameinfo.player1Complete&&r.gameinfo.player2Complete;return["commissioner","master"].includes(o.siteAccess)&&s.selectedEvent.virtual&&e&&"Completed"!==r.gameinfo.status}),S=P(()=>{var e,t,a;const s=null!=(t=null==(e=r.gamesheet)?void 0:e.throws)?t:{};return void 0!==(null==(a=r.gamesheet)?void 0:a.player2)?[s.player1,s.player2]:[s.player1]}),L=P(()=>{var e,t;return Z({status:r.gameinfo.status,sides:S.value,winner:r.gamesheet.winner,settingsType:null==(e=r.settings)?void 0:e.type,isSinglePlayer:void 0===(null==(t=r.gamesheet)?void 0:t.player2)})}),N=P(()=>"Completed"!==r.gameinfo.status&&"live"!==r.type&&L.value&&r.overtimeDone),W=P(()=>"Completed"===r.gameinfo.status&&("Qualifying Throws"!==s.selectedEvent.type||["master","commissioner"].includes(o.siteAccess)));
1async function G(){"player2"===(r.gameinfo.player1Complete?"player2":"player1")?(await O(B("/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-data/").concat(r.game,"/player2"))).then(()=>{n("removePlayer2")}),await O(B("/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-list/").concat(r.game,"/player2")))):(await C(B("/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-data/").concat(r.game)),{player1:r.gameinfo.player2,player2:null,throws:{player1:r.gamesheet.throws.player2,player2:null},round1:{player1:r.gamesheet.round1.player2,player2:null}}).then(()=>{n("removePlayer2")}),await C(B("/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-list/").concat(r.game)),{player1:r.gameinfo.player2,player2:null})),n("removePlayer2"),K(1)}function A(e,t){const a={top_left:{total:0},top_right:{total:0},low_left:{total:0},low_right:{total:0},_center:{total:0}};return(t?[t]:["1","2","3","4","5"]).forEach(t=>{const s=r.gamesheet["round".concat(t)][e],o=r.gamesheet.throws[e];for(let[e,n]of Object.entries(s))if(e.includes("bullseye")&&e.includes("position")){const s=e.replace(/[^0-9]/g,"");6===+o["1"===t?"throw-".concat(s):"".concat(t,"throw-").concat(s)]&&a[n].total++}}),a}function j(e,t){const a={top_left:{total:0},top_right:{total:0},low_left:{total:0},low_right:{total:0}};return(t?[t]:["1","2","3","4","5"]).forEach(t=>{const s=r.gamesheet["round".concat(t)][e];for(let[e,o]of Object.entries(s))e.includes("killshot")&&e.includes("position")&&a[o].total++}),a}function K(e){if(!h.value){if(h.value=!0,"playoff"===r.gameinfo.type&&1===e){let e,t,s;r.isSinglePlayer||1===r.playerGameStats.player1.win?(e=r.gamesheet.player1,t=r.gamesheet.player2,s="pw1"):(e=r.gamesheet.player2,t=r.gamesheet.player1,s="pw2"),n("declareWinner",e,t,s),function(){let e;e="right"===r.gameinfo.bracketSide?"2":"";let t="/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/").concat(r.gameinfo.bracket+e,"/").concat(r.gameinfo.bracketRound,"/").concat(r.gameinfo.bracketGame);r.players.forEach(e=>{let s={sum:{round1:r.sumScores[e].total1,round2:r.sumScores[e].total2,round3:r.sumScores[e].total3,round4:r.sumScores[e].total4,round5:r.sumScores[e].total5,round6:r.sumScores[e].total6}};C(B("".concat(t,"/").concat(e)),{pts:r.playerGameStats[e].pts}).catch(e=>{u.logError({function:"updateBracketinfo",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})}),C(B("".concat(t,"/").concat(e)),s)})}()}r.isPracticeOrLiveGameType?Promise.all([$(e)]).then(()=>{h.value=!1,r.isPublic&&n("exitAction")}).catch(e=>{u.logError({function:"endGameSync - endGameStatus",error:e,type:"request",venue:a.venue.locationSlug,game:r.game}),h.value=!1,console.error("Error",e)}):Promise.all([X(e),$(e),V(e),M(e)]).then(()=>{ae(r.gameinfo.arena,!0),h.value=!1,function(){let e="/venues/"+a.venue.locationSlug+"/league/"+r.leagueID+"/"+r.seasonID+"/"+r.weekID+"/game-data/"+r.game,t=Date.now(),s=a.venue.locationSlug+"-"+r.leagueID;C(E("/active/".concat(s)),{venue:a.venue.locationSlug,game:e,timestamp:t,league:r.leagueID})}()}).catch(e=>{u.logError({function:"endGameSync - Promises",error:e,type:"request",venue:a.venue.locationSlug,game:r.game}),h.value=!1})}}async function X(e){let t=0,o=function(){let e,t,a={player1:{ugame:0,ngame:0,sgame:0,umatch:0,nmatch:0,smatch:0,eightyone:0,sixtyfour:0},player2:{ugame:0,ngame:0,sgame:0,umatch:0,nmatch:0,smatch:0,eightyone:0,sixtyfour:0}};for(e=1;e<=2;e++)for(r.sumScores["player"+e].round1+r.sumScores["player"+e].round2+r.sumScores["player"+e].round3==75&&(r.sumScores["player"+e].round17s+r.sumScores["player"+e].round27s+r.sumScores["player"+e].round37s>=1?a["player"+e].umatch=1:a["player"+e].nmatch=1),r.sumScores["player"+e].round1+r.sumScores["player"+e].round2+r.sumScores["player"+e].round3>75&&(a["player"+e].smatch=1),t=1;t<=6;
1t++)25===r.sumScores["player"+e]["round"+t]&&(1===r.sumScores["player"+e]["round"+t+"7s"]?a["player"+e].ugame++:a["player"+e].ngame++),27===r.sumScores["player"+e]["round"+t]&&a["player"+e].sgame++;return a}();const c="playoff"!==r.gameinfo.type;let u=["player1"];"player2"in r.gamesheet&&u.push("player2");const h=B("/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-list/").concat(r.game));if(1===e){const e=await i(h);if(e.exists()&&!0===e.val().countedInStandings)return"Game Stats (skipped: already counted in standings)"}let d;if(-1===e){const{playersGameHS:e}=await async function(e){const t={[r.gameinfo.player1.playerid]:[],...e.includes("player2")&&{[r.gameinfo.player2.playerid]:[]}},s=Object.keys(t),o=B("/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/"));return await i(_(o)).then(e=>{if(e.exists()){const a=e.val();return Object.keys(a).filter(e=>e.includes("Week")).forEach(e=>{const o=a[e]["game-data"],n=a[e]["game-list"];for(let[a,i]of Object.entries(o)){if(s.includes(i.player1.playerid)&&a!==r.game&&"Now Playing"!==n[a].status)for(let a=1;a<=i.round;a++){const s=i["round".concat(a)].player1;t[i.player1.playerid].push({week:e,sum:s.sum})}if(i.player2&&s.includes(i.player2.playerid)&&a!==r.game&&"Now Playing"!==n[a].status)for(let a=1;a<=i.round;a++){const s=i["round".concat(a)].player2;t[i.player2.playerid].push({week:e,sum:s.sum})}}}),{playersGameHS:t}}})}(u);d=e}let p=[{path:"/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/players"),dbRef:B,type:"season_week"},...c&&[{path:"/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/standings"),dbRef:B,type:"season_standings"},{path:"/".concat(a.venue.rules,"/players"),dbRef:l,type:"global_player_stats"}]||[]];return new Promise((l,g)=>{C(h,{countedInStandings:1===e}),p.forEach((h,g)=>{u.forEach(m=>{const y=r.gamesheet[m].playerid,v=h.dbRef("".concat(h.path,"/").concat(y));i(_(v)).then(i=>{var w;let f=Q(i.val()||{}),S=[R.get(r.sumScores,"".concat(m,".total1")),R.get(r.sumScores,"".concat(m,".total2")),R.get(r.sumScores,"".concat(m,".total3")),R.get(r.sumScores,"".concat(m,".total4")),R.get(r.sumScores,"".concat(m,".total5")),R.get(r.sumScores,"".concat(m,".total6"))],k=Math.max(f.high,...S);if(-1===e)if("season_week"===h.type){const e=d[y].filter(e=>e.week===r.weekID).map(e=>e.sum);k=e.length>0?Math.max(...e):0}else if("season_standings"===h.type){const e=d[y].map(e=>e.sum);k=e.length>0?Math.max(...e):0}let T=S.filter(e=>64===e).length,b=A(m);const D="Qualifying Throws"===s.selectedEvent.type;h.type;let I={...j(m),...D&&{overtime:{innerShot:r.playerGameStats[m].overtime,outerShot:r.playerGameStats[m].overtimeOuter}}||{}},P=0;D&&(P=function(e){let t=0;const a=r.gamesheet.throws[e],s=r.settings.rounds||5,o=Object.keys(a),n=new Set;return o.forEach(e=>{if(e.includes("throw-")){const t=e.split("throw-")[0];""===t?n.add(""):parseInt(t)<=s&&n.add(t)}}),n.forEach(e=>{for(let s=1;s<=10;s++){const o="".concat(e,"throw-").concat(s),n=a[o];7!==n&&8!==n||t++}}),t}(m)),(null==(w=f.killShotHit)?void 0:w.overtime)&&((f.killShotHit.overtime.innerShot||0)<0&&(f.killShotHit.overtime.innerShot=0),(f.killShotHit.overtime.outerShot||0)<0&&(f.killShotHit.overtime.outerShot=0));let O=x("killShot",f.killShotHit,I,e,D),E=x("bullsEye",f.bullsEyeHit,b,e),_=e*r.playerGameStats[m].gp+f.gp;const L=parseFloat(((e*r.playerGameStats[m].score+f.score)/(e*r.playerGameStats[m].win+f.win+(e*r.playerGameStats[m].loss+f.loss)+e*r.playerGameStats[m].nc+f.nc)).toFixed(4))||0,N=function(e,t,a,s){const o={drops:s*t.drops+e.drops,faults:s*t.faults+e.faults,score0:s*t.score0s+e.score0,score1:s*t.score1s+e.score1,score2:s*t.score2s+e.score2,score3:s*t.score3s+e.score3,score4:s*t.score4s+e.score4,score5:s*t.score5s+e.score5,score6:s*t.score6s+e.score6,score7:s*t.score7s+e.score7,score8:s*t.score8s+e.score8-s*a};return Object.values(o).reduce((e,t)=>e+t,0)}(f,r.sumScores[m],r.playerGameStats[m].overtime,e),W=((r.playerGameStats[m].score+f.score)/N).toFixed(1);let G={gp:_,win:e*r.playerGameStats[m].win+f.win,loss:e*r.playerGameStats[m].loss+f.loss,nc:e*r.playerGameStats[m].nc+f.nc,score:e*r.playerGameStats[m].score+f.score,scoreavg:isFinite(L)?L:0,drops:e*r.sumScores[m].drops+f.drops,faults:e*r.sumScores[m].faults+f.faults,high:k,axeavg:isFinite(W)?W:0,baxe:e*r.playerGameStats[m].baxe+f.baxe,baxewin:e*r.playerGameStats[m].baxewin+f.baxewin,killcall:e*r.playerGameStats[m].killcall+f.killcall,perfect:T+f.perfect,score0:e*r.sumScores[m].score0s+f.score0,score1:e*r.sumScores[m].score1s+f.score1,score2:e*r.sumScores[m].score2s+f.score2,score3:e*r.sumScores[m].score3s+f.score3,score4:e*r.sumScores[m].score4s+f.score4,score5:e*r.sumScores[m].score5s+f.score5,score6:e*r.sumScores[m].score6s+f.score6-(D?0:e*r.playerGameStats[m].overtimeOuter),score7:e*r.sumScores[m].score7s+f.score7,score8:e*r.sumScores[m].score8s+f.score8-(D?0:e*r.playerGameStats[m].overtime),overtime:e*r.playerGameStats[m].overtime+f.overtime,bullsEyeHit:E,killShotHit:O,...D&&{regularKillshotHits:e*P+(f.regularKillshotHits||0)}||{}};if(C(v,G).then(e=>{t++,t>=p.length*u.length&&l("Game Stats")}),"custom"!==a.venue.type)if("season_week"===h.type&&c&&s.selectedEvent.isOfficial){const e="/venues/watl/league/".concat(s.selectedEvent.officialLeague,"/").concat(r.seasonID,"/").concat(r.weekID,"/players/").concat(r.gamesheet[m].playerid);C(B(e),{...G,venue:a.venue.locationSlug,venueName:a.venue.company+" "+a.venue.city})}else 2===g&&n("checkAccolades",r.gamesheet[m].playerid,r.gamesheet[m].alias,r.playerGameStats[m],o[m],G,r.rules)})})})})}function M(e){const t="playoff"!==r.gameinfo.type;let a=["player1"];"player2"in r.gamesheet&&a.push("player2");let o=10*r.round;const n={player1:{},player2:{}};return new Promise(async(c,u)=>{if(1===a.length||!m.value||-1===e)return c();for(let e of a){const a=l("/watl/players/".concat(r.gamesheet[e].playerid));await i(_(a)).then(a=>{let i=Q(a.val()||{});const l=t||"individual"===s.selectedEvent.divisionRuleset?i.division:s.selectedEvent.divisionRuleset;n[e]={".key":r.gamesheet[e].playerid,rating:i.rating,ratingDeviation:i.ratingDeviation,eventDivision:l||"amateur",playerDivision:i.division}
1,"player2"===e&&(t?H(n,o):U(n,o),c())})}})}async function U(e,t){const s={round1:{player1:{},player2:{},winner:""},round2:{player1:{},player2:{},winner:""},round3:{player1:{},player2:{},winner:""}};for(let a=1;a<=3;a++)["player1","player2"].forEach(e=>{const o=r.sumScores[e]["total".concat(a)],n=r.gamesheet.throws[e]["tieWon".concat(a)]||!1;let i={score0:0,faults:0,drops:0};const l=r.gamesheet.throws[e];let c=1===a?"":a;for(let[t,a]of Object.entries(l))if(t.startsWith(c+"throw"))switch(a){case 0:i.score0++;break;case"F":i.faults++;break;case"D":i.drops++}let u=A(e,String(a)),h=j(e,a);s["round".concat(a)][e]={tieWon:n,sum:o,...i,hitBullsEyes:u,hitKillShots:h,averageThrow:+(o/t).toFixed(1)},"player2"===e&&((s["round".concat(a)].player1.sum>s["round".concat(a)].player2.sum||s["round".concat(a)].player1.tieWon)&&(s["round".concat(a)].winner="player1"),(s["round".concat(a)].player2.sum>s["round".concat(a)].player1.sum||s["round".concat(a)].player2.tieWon)&&(s["round".concat(a)].winner="player2"))});for(let[a,o]of Object.entries(s))o.winner||delete s[a];for(let[o,n]of Object.entries(s)){const t={player:"player1",...e.player1,...n.player1,winner:"player1"===n.winner,..."round1"!==o&&{rating:n.player1.roundRating,ratingDeviation:n.player1.roundRatingDeviation,daysSinceLastGame:0}},i={player:"player2",...e.player2,...n.player2,winner:"player2"===n.winner,..."round1"!==o&&{rating:n.player2.roundRating,ratingDeviation:n.player2.roundRatingDeviation,daysSinceLastGame:0}},c=await le(t,i),u="round".concat(+o.slice(-1)+1);for(let[e,a]of Object.entries(c))u in s&&(s[u][e]={...s[u][e],roundRating:a.finalRating,roundRatingDeviation:a.finalRatingDeviation});[t,i].forEach(e=>{const t="/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-data/").concat(r.game,"/").concat(o,"/").concat(e.player),s={before:{rating:e.rating,deviation:e.ratingDeviation},after:{rating:c[e.player].finalRating,deviation:c[e.player].finalRatingDeviation}};C(B(t),{ratings:s})}),u in s||["player1","player2"].forEach(t=>{C(l("/watl/players/".concat(e[t][".key"])),{playedIn2025:!0,rating:c[t].finalRating,ratingDeviation:c[t].finalRatingDeviation})})}}function H(e,t){const s={player1:{},player2:{}};for(let[a,o]of Object.entries(e)){let e=A(a),n=j(a);s[a]={...o,hitBullsEyes:e,hitKillShots:n,score0:r.sumScores[a].score0s,faults:r.sumScores[a].faults,drops:r.sumScores[a].drops,averageThrow:r.playerGameStats[a].score/t,winner:Boolean(r.playerGameStats[a].win)}}!async function(e){const t=await le(e.player1,e.player2);for(let[s,o]of Object.entries(t)){const t="/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-data/").concat(r.game,"/round").concat(r.round,"/").concat(s),n={before:{rating:e[s].rating,deviation:e[s].ratingDeviation},after:{rating:o.finalRating,deviation:o.finalRatingDeviation}};C(B(t),{ratings:n}).then(()=>{}),C(l("/watl/players/".concat(o[".key"])),{playedIn2025:!0,rating:o.finalRating,ratingDeviation:o.finalRatingDeviation}).then(()=>{})}}(s)}function Q(e={}){return{high:e.high||0,score0:Math.max(0,e.score0||0),score1:Math.max(0,e.score1||0),score2:Math.max(0,e.score2||0),score3:Math.max(0,e.score3||0),score4:Math.max(0,e.score4||0),score5:Math.max(0,e.score5||0),score6:Math.max(0,e.score6||0),score7:Math.max(0,e.score7||0),score8:Math.max(0,e.score8||0),drops:Math.max(0,e.drops||0),faults:Math.max(0,e.faults||0),perfect:e.perfect||0,killcall:Math.max(0,e.killcall||0),overtime:Math.max(0,e.overtime||0),bullsEyeHit:e.bullsEyeHit||{top_left:{total:0},top_right:{total:0},low_left:{total:0},low_right:{total:0},_center:{total:0}},killShotHit:e.killShotHit||{top_left:{total:0},top_right:{total:0},low_left:{total:0},low_right:{total:0}},gp:e.gp||0,score:e.score||0,win:e.win||0,loss:e.loss||0,nc:e.nc||0,baxe:e.baxe||0,baxewin:e.baxewin||0,rating:e.rating||250,ratingDeviation:e.ratingDeviation||150,division:e.division||"amateur"}}function V(e){let t=r.isLeague?"league":"tournament",o=void 0!==r.gamesheet.player2?["player1","player2"]:["player1"];return new Promise((n,i)=>{o.forEach(o=>{let i;i="player1"===o?"player2":"player1";let c="custom"===a.venue.type?s.selectedEvent.rules:r.rules,h="/".concat(c,"/players-career/").concat(r.gamesheet[o].playerid,"/").concat(t,"-games/").concat(r.leagueID,"-").concat(r.seasonID);if(1===e)if(void 0!==r.gamesheet.player2){let e={leagueID:r.leagueID,seasonID:r.seasonID,weekID:r.weekID,opponentAlias:r.gamesheet[i].alias,opponentFirst:r.gamesheet[i].first,opponentPic:r.gamesheet[i].pic,opponentID:r.gamesheet[i].playerid,win:r.playerGameStats[o].win};C(l("".concat(h,"/").concat(r.game)),e).then(()=>
1{"player2"===o&&n("Career")}).catch(e=>{u.logError({function:"endGameCareer",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})})}else C(l("".concat(h,"/").concat(r.game)),{leagueID:r.leagueID,seasonID:r.seasonID,weekID:r.weekID}).then(()=>{n("Career")}).catch(e=>{u.logError({function:"updateWinner - single",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})});else O(l("".concat(h,"/").concat(r.game))).then(()=>{n("Career")})})})}function F(){let e,t=!1;if(r.gamesheet.player1.playerid===o.user[".key"]&&(t="player1"),r.gamesheet.player2&&r.gamesheet.player2.playerid===o.user[".key"]&&(t="player2"),!t)return!1;e=r.isPracticeOrLiveGameType?"/venues/".concat(a.venue.locationSlug,"/practice"):"/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID);const s=e.includes("/league/")?B("".concat(e,"/game-list/").concat(r.game)):E("".concat(e,"/game-list/").concat(r.game));C(s,{[t+"Complete"]:!0}).then(()=>{r.gameinfo.player1Complete&&r.gameinfo.player2Complete&&"Completed"!==r.gameinfo.status&&K(1),n("exitAction")}).catch(function(e){u.logError({function:"scoresEntered",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})})}function $(e){let t;return-1===e?(t="Now Playing",n("deathThrowCalled",!1)):t="Completed",new Promise((e,s)=>{let o;o=r.isPracticeOrLiveGameType?"/venues/".concat(a.venue.locationSlug,"/practice"):"/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID);const n=o.includes("/league/")?B("".concat(o,"/game-list/").concat(r.game)):E("".concat(o,"/game-list/").concat(r.game));r.gameinfo.gameEnd?C(n,{gameEdit:Date.now()}):C(n,{gameEnd:Date.now()}),C(n,{status:t,p1score:r.playerGameStats.player1.pts,p2score:r.playerGameStats.player2.pts}).then(()=>{e("Game Status")}).catch(function(e){u.logError({function:"endGameStatus",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})})})}return(t,a)=>(p(),v(Se,{showTargetTypeSwitcher:"wktl"!==e.rules&&"practice"!==e.type&&"before_2024"===k(s).selectedEvent.gamePlayRules,showEventTypeSwitcher:"practice"===e.type,eventType:e.isLeague?"league":"tournament",practiceEventType:e.practiceEventType,targetType:"new",showDoneButton:N.value,showDoneAsCommissionerButton:f.value,showSubmitButton:w.value,showNextStepActions:g.value,showKillShotThrows:!e.killshotOvertime&&"Qualifying Round"===e.settings.type&&e.throwsDone,defaultBoard:e.defaultBoard,disableCLoseIcon:!e.gamesheet.winner&&"live"===e.type&&!e.inactive,showSideEditIcon:W.value,showNextThrows:d.value,isButtonLoading:h.value,onChangeTargetType:a[0]||(a[0]=e=>n("setDefaultBoard",e)),onChangeEventType:a[1]||(a[1]=e=>n("setEventType",e)),onEndGame:K,onScoresEntered:F,onEnableOvertime:a[2]||(a[2]=e=>n("enableOvertime")),onGoToRound:a[3]||(a[3]=e=>n("goToRound",e)),onShowNextUp:a[4]||(a[4]=()=>n("showNextUp",!0)),onExitAction:a[5]||(a[5]=e=>n("exitAction")),onDoneAsCommissioner:G},null,8,["showTargetTypeSwitcher","showEventTypeSwitcher","eventType","practiceEventType","showDoneButton","showDoneAsCommissionerButton","showSubmitButton","showNextStepActions","showKillShotThrows","defaultBoard","disableCLoseIcon","showSideEditIcon","showNextThrows","isButtonLoading"]))}},Te={key:0,class:"vs players"},be={key:1,class:"vs"},De={key:2,class:"vs players"},Ie=r({__name:"scoreBoard",props:{isSinglePlayer:Boolean,participants:{type:Array,default:()=>[]},leftParticipantTie:Boolean,leftParticipantTotalSum:Number,leftParticipantRoundSum:Number,rightParticipantTie:Boolean,rightParticipantTotalSum:Number,rightParticipantRoundSum:Number,isQualifying:Boolean},setup:e=>(t,a)=>(p(),d(S,null,[e.isSinglePlayer||e.isQualifying?w("",!0):(p(),d("div",Te,[void 0!==e.participants[0]?(p(),d("span",{key:0,class:L({tie:e.leftParticipantTie,lead:e.leftParticipantRoundSum>e.rightParticipantRoundSum})},N(e.leftParticipantRoundSum),3)):w("",!0),a[0]||(a[0]=g("span",{class:"dot"},":",-1)),void 0!==e.participants[1]?(p(),d("span",{key:1,class:L({tie:e.rightParticipantTie,lead:e.leftParticipantRoundSum<e.rightParticipantRoundSum})},N(e.rightParticipantRoundSum),3)):w("",!0),a[1]||(a[1]=g("span",null,"VS",-1))])),e.isSinglePlayer?(p(),d("div",be,[g("span",null,N(e.leftParticipantRoundSum),1)])):w("",!0),!e.isSinglePlayer&&e.isQualifying?(p(),d("div",De,[void 0!==e.participants[0]?(p(),d("span",{key:0,class:L({lead:e.leftParticipantTotalSum>e.rightParticipantTotalSum})},N(e.leftParticipantTotalSum),3)):w("",!0),a[2]||(a[2]=g("span",{class:"dot"},":",-1)),void 0!==e.participants[1]?(p(),d("span",{key:1,class:L({lead:e.leftParticipantTotalSum<e.rightParticipantTotalSum})},N(e.rightParticipantTotalSum),3)):w("",!0),a[3]||(a[3]=g("span",null,"VS",-1))])):w("",!0)],64))},[["__scopeId","data-v-f0ba91ce"]]),Pe={class:"round"},Oe={key:0},Be={key:1},Ce={key:2},Ee={class:"round-number text-center"},_e={key:0},Re=r({__name:"roundNavigation",props:{isMatch:Boolean,isBestOfX:Boolean,bestOfX:Number,killshotOvertime:Boolean,disableNextIcon:Bo
1olean,disablePrevIcon:Boolean,showNavigationIcons:Boolean,round:Number,currentThrowNr:Number},emits:["goTo"],setup(e,{emit:t}){const a=t;return(t,s)=>{const o=h("v-icon"),n=h("v-btn");return p(),d("div",null,[g("div",Pe,[e.isMatch?(p(),d("span",Oe,"MATCH")):w("",!0),e.isBestOfX?(p(),d("span",Be,"Best of "+N(e.bestOfX),1)):w("",!0),e.killshotOvertime?(p(),d("div",Ce,[...s[2]||(s[2]=[g("strong",null,"OVERTIME",-1)])])):w("",!0),W(t.$slots,"default",{},void 0,!0)]),g("div",Ee,[e.showNavigationIcons?(p(),v(n,{key:0,icon:"",size:"small",color:"primary",onClick:s[0]||(s[0]=e=>a("goTo",-1)),disabled:e.disablePrevIcon},{default:y(()=>[m(o,{size:"large"},{default:y(()=>[...s[3]||(s[3]=[f("mdi-chevron-left",-1)])]),_:1})]),_:1},8,["disabled"])):w("",!0),g("div",null,[e.isBestOfX||e.bestOfX>1?(p(),d("p",_e,"Round "+N(e.round),1)):w("",!0),g("p",null,"Throw "+N(e.currentThrowNr),1)]),e.showNavigationIcons?(p(),v(n,{key:1,icon:"",size:"small",color:"primary",onClick:s[1]||(s[1]=e=>a("goTo",1)),disabled:e.disableNextIcon},{default:y(()=>[m(o,{size:"large"},{default:y(()=>[...s[4]||(s[4]=[f("mdi-chevron-right",-1)])]),_:1})]),_:1},8,["disabled"])):w("",!0)])])}}},[["__scopeId","data-v-a4465784"]]),xe={class:"col-score"},Le={class:"throwWinner"},Ne={key:0},We={key:0},Ge={class:"scoreboard scoreboard-sum"},Ae={key:0,class:"names"},je=["onClick"],Ke={key:0},Xe=["onClick"],Me={key:0},Ue=["onClick"],He={key:0},Qe=["onClick"],Ve={key:0},Fe=r({__name:"hatchetBoardScores",props:{type:String,players:{type:Array,default:()=>[]},isSinglePlayer:Boolean,settings:{type:Object,default:()=>{}},gamesheet:{type:Object,default:()=>{}},sumScores:{type:Object,default:()=>{}},isBestOfX:Number,round:Number,killshotOvertime:Boolean,isPracticeOrLiveGameType:Boolean,sidesSwitched:Boolean,isPublic:Boolean,pointBoxes:Number,watlRound:String,game:String,leagueID:String,seasonID:String,weekID:String,currentThrowNr:Number,disableNextRound:Boolean},emits:["switchSides","goToRound","decreaseThrowsCount","updatePlayerThrowStatus","resetDeathThrow","deathThrowSwitch","updateWinner"],setup(e,{emit:t}){const a=c(),s=T(),o=b(),n=t,i=e,l=P(()=>{let e="",t="Qualifying Round"===i.settings.type?"":i.round,a=void 0!==i.players[0]?i.sumScores[i.players[0]]["total"+t]:0,s=void 0!==i.players[1]?i.sumScores[i.players[1]]["total"+t]:0;a>s&&(e=i.gamesheet[i.players[0]].first),a<s&&(e=i.gamesheet[i.players[1]].first);let o=Math.abs(a-s);return a===s?"Tie":e+" up by "+o});function r(e,t,l){const r=i.gamesheet.throws[e]["throw-".concat(l)];if("test"!==(c=i.gamesheet[e].playerid)&&(i.isPublic&&c!==o.user[".key"]||i.isPublic&&!o.siteAccess&&c!==o.user[".key"])||void 0===r)return!1;var c;if(n("resetDeathThrow"),n("deathThrowSwitch",!1),confirm("Remove Point?")){let o;o=i.isPracticeOrLiveGameType?"/venues/".concat(a.venue.locationSlug,"/practice"):"/venues/".concat(a.venue.locationSlug,"/league/").concat(i.leagueID,"/").concat(i.seasonID,"/").concat(i.weekID);const c=o.includes("/league/")?B("".concat(o,"/game-data/").concat(i.game,"/throws/").concat(e,"/").concat(i.watlRound,"throw-").concat(l)):E("".concat(o,"/game-data/").concat(i.game,"/throws/").concat(e,"/").concat(i.watlRound,"throw-").concat(l)),u=o.includes("/league/")?B("".concat(o,"/game-data/").concat(i.game,"/throws/").concat(e,"/tieWon").concat(t)):E("".concat(o,"/game-data/").concat(i.game,"/throws/").concat(e,"/tieWon").concat(t));O(c).then(()=>{i.isPracticeOrLiveGameType||J(e,l,r)}),O(u),n("decreaseThrowsCount"),function(e,t){if("practice"===i.type||"before_2024"!==s.selectedEvent.gamePlayRules)!function(e,t){Object.keys(i.gamesheet["round"+i.round][e]).forEach(s=>{let o,n;s.includes("killshot".concat(t,"th_position"))?o={["killshot".concat(t,"th_position")]:null,["killcall".concat(t,"th")]:!1}:s.includes("bullseye".concat(t,"th_position"))&&(o={["bullseye".concat(t,"th_position")]:null}),n=i.isPracticeOrLiveGameType?E("/venues/".concat(a.venue.locationSlug,"/practice/game-data/").concat(i.game,"/round").concat(i.round,"/").concat(e)):B("/venues/".concat(a.venue.locationSlug,"/league/").concat(i.leagueID,"/").concat(i.seasonID,"/").concat(i.weekID,"/game-data/").concat(i.game,"/round").concat(i.round,"/").concat(e)),o&&C(n,o)})}(e,t);else{let s="killcall"+t+"th";const o=["killshot".concat(t,"empty"),"killshot".concat(t,"th_side")],n=Object.keys(i.gamesheet["round"+i.round][e]).filter(e=>e.includes("killshot")).find(e=>o.includes(e)),l=i.gamesheet["round"+i.round][e][n],r={[s]:!1};if(l&&(r["activeKillshot_".concat(l)]={throwNr:t,side:l,isThrow:!1}),i.gamesheet["round"+i.round][e][s]){const t="/venues/".concat(a.venue.locationSlug,"/league/").concat(i.leagueID,"/").concat(i.seasonID,"/").concat(i.weekID,"/game-data/").concat(i.game,"/round").concat(i.round,"/").concat(e);C(B(t),r),n&&O(B("".concat(t,"/").concat(n)))}}}(e,l),n("updatePlayerThrowStatus",e,!1),n("updateWinner","none")}}return(t,a)=>{var s,o,i,c,u,f,k;const T=h("v-btn");return p(),d(S,null,[g("div",xe,[m(Ie,{participants:e.players,isSinglePlayer:e.isSinglePlayer,isQualifying:"Qualifying Round"===e.settings.type,leftParticipantTie:e.gamesheet.throws[e.players[0]]["tieWon"+e.round],leftParticipantRoundSum:e.sumScores[e.players[0]]["total"+e.round],leftParticipantTotalSum:e.sumScores[e.players[0]].total,rightParticipantTie:null==(s=e.gamesheet.throws[e.players[1]])?void 0:s["tieWon"+e.round],rightParticipantRoundSum:null==(o=e.sumScores[e.players[1]])?void 0:o["total"+e.round],rightParticipantTotalSum:null==(i=e.sumScores[e.players[1]])?void 0:i.total},null,8,["participants","isSinglePlayer","isQualifying","leftParticipantTie","leftParticipantRoundSum","leftParticipantTotalSum","rightParticipantTie","rightParticipantRoundSum","rightParticipantTotalSum"]),g("div",Le,N(l.value),1),void 0!==e.gamesheet["round"+e.round]?(p(),d("div",Ne,[m(Re,{isMatch:1===e.isBestOfX&&"Qualifying Round"!==e.settings.type,isBestOfX:e.isBestOfX>1&&!e.killshotOvertime&&"Qualifying Round"!==e.settings.type,bestOfX:e.isBestOfX,killshotOvertime:e.killshotOvertime,showNavigationIcons:e.isBestOfX>1||"Qualifying Round"===e.settings.type,disableNextIcon:e.disableNextRound||e.killshotOvertime,disablePrevIcon:1===e.round,round:e.gamesheet.round,currentThrowNr:e.currentThrowNr,onGoTo:a[0]||(a[0]=e=>n("goToRound",e))},{default:y(()=>["Qualifying Round"!==e.settings.type||e.killshotOvertime?w("",!0):(p(),d("span",We,[g("strong",null,N(e.settings.throws)+" THROWS",1)]))]),_:1},8,["isMatch","isBestOfX","bestOfX","killshotOvertime","showNavigationIcons","disableNextIcon","disablePrevIcon","round","currentThrowNr"]),g("div",{class:L(["score-table",{switchSide:e.sidesSwitched}])},[a[2]||(a[2]=g("div",null,[g("img",{src:oe,class:"arrow"}),g("img",{src:oe,class:"arrow"})],-1)),g("table",Ge,[e.players.length>1?(p(),d("tr",Ae,[g("td",null,N((null==(c=e.gamesheet[e.players[0]])?void 0:c.first)||"")+" "+N((null==(u=e.gamesheet[e.players[0]])?void 0:u.last)||""),1),g("td",null,N((null==(f=e.gamesheet[e.players[1]])?void 0:f.first)||"")+" "+N((null==(k=e.gamesheet[e.players[1]])?void 0:k.last)||""),1)])):w("",!0),e.killshotOvertime?w("",!0):(p(!0),d(S,{key:1},G(e.pointBoxes,t=>(p(),d("tr",{key:t},[e.gamesheet["round"+e.round][e.players[0]]?(p(),d("td",{key:0,onClick:a=>r(e.players[0],e.round,t),class:L({killshot:e.gamesheet["round"+e.round][e.players[0]]["killcall"+t+"th"],half:5===t})},[void 0!==e.gamesheet.throws[e.players[0]]?(p(),d("span",Ke,N(e.gamesheet.throws[e.players[0]][e.watlRound+"throw-"+t]),1)):w("",!0)],10,je)):w("",!0),e.gamesheet["round"+e.round][e.players[1]]?(p(),d("td",{key:1,onClick:a=>r(e.players[1],e.round,t),class:L({killshot:e.gamesheet["round"+e.round][e.players[1]]["killcall"+t+"th"],half:5===t})},[void 0!==e.gamesheet.throws[e.players[1]]?(p(),d("span",Me,N(e.gamesheet.throws[e.players[1]][e.watlRound+"throw-"+t]),1)):w("",!0)],10,Xe)):w("",!0)]))),128)),e.killshotOvertime?(p(!0),d(S,{key:2},G(e.settings.killshots,t=>(p(),d("tr",{key:t},[g("td",{onClick:a=>r(e.players[0],e.round,t)},[void 0!==e.gamesheet.throws[e.players[0]]?(p(),d("span",He,N(e.gamesheet.throws[e.players[0]][e.watlRound+"throw-"+t]),1)):w("",!0)],8,Ue),g("td",{onClick:a=>r(e.players[1],e.round,t)},[void 0!==e.gamesheet.throws[e.players[1]]?(p(),d("span",Ve,N(e.gamesheet.throws[e.players[1]][e.watlRound+"throw-"+t]),1)):w("",!0)],8,Qe)]))),128)):w("",!0)])],2)])):w("",!0)]),void 0!==e.gamesheet.player2&&"live"!==e.type?(p(),v(T,{key:0,color:"lightblue",variant:"flat",onClick:a[1]||(a[1]=e=>n("switchSides")),class:L({switchSide:e.sidesSwitched})},{default:y(()=>[...a[3]||(a[3]=[g("img",{src:"https://firebasestorage.googleapis.com/v0/b/forged-7adb7.appspot.com/o/switch.png?alt=media&token=6eec5133-0d6f-4514-991f-c8bb128c3a1f"},null,-1)])]),_:1},8,["class"])):w("",!0)],64)}}},[["__scopeId","data-v-1884ae78"]]),$e={style:{position:"relative"}}
1,qe={class:"simpleTargetsWrapper"},ze={class:L(["targetCell"])},Ye={class:"doubleTargetsWrapper"},Ze={key:0,class:"chooseScreen targetCell"},Je=r({__name:"newBoardTarget",props:{killShotCalled:{type:Boolean,default:!1},hitKillShots:{type:Array,default:[]},hitBullsEyes:{type:Array,default:[]},isLeague:Boolean,killshotOvertime:Boolean,divisionRuleset:{type:String,default:"professional"}},emits:["hitTarget"],setup(e,{emit:t}){const a=t,s=e,o=T(),n=P(()=>"since_2025"===o.selectedEvent.gamePlayRules);let i=A([{level:"top",side:"left",values:n.value?[7,8]:[6,8],type:"killShot",disabled:!0,hit:!1,class:"killShot_top_left"},{level:"top",side:"right",values:n.value?[7,8]:[6,8],type:"killShot",disabled:!0,hit:!1,class:"killShot_top_right"},{level:"low",side:"left",values:n.value?[7,8]:[6,8],type:"killShot",disabled:!0,hit:!1,class:"killShot_low_left"},{level:"low",side:"right",values:n.value?[7,8]:[6,8],type:"killShot",disabled:!0,hit:!1,class:"killShot_low_right"}]);j(()=>n.value,e=>{i=i.map(t=>({...t,values:e?[7,8]:[6,8]}))});const l=A([{level:"top",side:"left",values:[5,6],hitValues:[],type:"bullsEye",disabled:!1,hit:!1,class:"bullsEye_top_left"},{level:"top",side:"right",values:[5,6],hitValues:[],type:"bullsEye",disabled:!1,hit:!1,class:"bullsEye_top_right"},{level:"low",side:"left",values:[5,6],hitValues:[],type:"bullsEye",disabled:!1,hit:!1,class:"bullsEye_low_left"},{level:"low",side:"right",values:[5,6],hitValues:[],type:"bullsEye",disabled:!1,hit:!1,class:"bullsEye_low_right"},{level:"",side:"center",values:[5,6],hitValues:[],type:"bullsEye",disabled:!1,hit:!1,class:"bullsEye_center"}]);function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}const c={level:"",side:"",values:[],type:""};let u=A({...c});const b=P(()=>u.type.length),D=P(()=>{if("bullsEye"===u.type){return l.find(e=>"".concat(e.level,"_").concat(e.side)==="".concat(u.level,"_").concat(u.side)).hit}return!1});function I([...e],[...t]){return e.filter(e=>e!==t[0])[0]}function O(e){for(let t in c)u[t]=e[t]}function B(){for(let e in u)u[e]=c[e]}return j(()=>s.killShotCalled,e=>{B(),i.forEach((t,a)=>{let o=s.hitKillShots.some(e=>e.split("_")[0]===t.level),l=s.hitKillShots.length?s.hitKillShots[s.hitKillShots.length-1].split("_")[0]:"";e?n.value?i[a].disabled=l===t.level:(2===s.hitKillShots.length||s.hitKillShots.length<2&&!o)&&(i[a].disabled=!1):e||(i[a].disabled=!e,B())})},{immediate:!0}),j(()=>s.hitKillShots,e=>{e.forEach(e=>{const t=i.findIndex(t=>e==="".concat(t.level,"_").concat(t.side));i[t].hit=!0})},{immediate:!0}),j([()=>s.hitBullsEyes,()=>s.isLeague],([e])=>{let t=[...e].sort((e,t)=>e.points-t.points);l.map(e=>(e.hit=!1,e.disabled=!1,e.hitValues=[],e)),n.value?"professional"===s.divisionRuleset?t.forEach(e=>{l.map(t=>e.position==="".concat(t.level,"_").concat(t.side)?(t.hit=6===e.points,t.disabled=!0,t):t)}):"amateur"===s.divisionRuleset?t.forEach(e=>{l.map(t=>e.position==="".concat(t.level,"_").concat(t.side)?(t.hitValues.push(e.points),t.disabled=2===t.hitValues.length,t):t)}):s.divisionRuleset:t.forEach(e=>{l.map(t=>e.position==="".concat(t.level,"_").concat(t.side)?(t.hit=6===e.points,t.disabled=!s.isLeague,t):t)})},{immediate:!0}),(t,o)=>{const c=h("v-icon"),T=h("v-btn");return p(),d("div",$e,[g("div",qe,[(p(),d(S,null,G(4,t=>g("div",ze,[m(ee,{disabled:e.killShotCalled||e.killshotOvertime,onClick:e=>{a("hitTarget",t)},"data-cypress-target":"target-".concat(t)},{default:y(()=>[f(N(t),1)]),_:2},1032,["disabled","onClick","data-cypress-target"])])),64))]),g("div",Ye,[(p(!0),d(S,null,G(k(i),t=>(p(),d("div",{class:L(["targetCell",t.class])},[m(ee,{disabled:t.disabled&&!e.killshotOvertime,class:"targetKills",onClick:e=>O(t)},{default:y(()=>[g("span",null,N(r(t.level)),1),f(" "+N(t.side.charAt(0).toUpperCase()),1)]),_:2},1032,["disabled","onClick"])],2))),256)),(p(!0),d(S,null,G(l,t=>(p(),d("div",{class:L(["targetCell",t.class])},[m(ee,{disabled:t.disabled||e.killShotCalled||e.killshotOvertime,class:"targetBulls",onClick:e=>function(e){if(e.hit&&s.isLeague||n.value&&e.hitValues.length){const t={type:e.type,position:"".concat(e.level,"_").concat(e.side)};let s=n.value?I(e.values,e.hitValues):e.values[0];a("hitTarget",s,t)}else O(e)}(t)},{default:y(()=>[n.value?(p(),d(S,{key:0},[!t.hitValues.length||t.disabled?(p(),d(S,{key:0}
1,[g("span",null,N(r(t.level)),1),f(" "+N(t.side.charAt(0).toUpperCase()),1)],64)):(p(),d(S,{key:1},[f(N(I(t.values,t.hitValues)),1)],64))],64)):(p(),d(S,{key:1},[t.hit&&e.isLeague?(p(),d(S,{key:0},[f(N(t.values[0]),1)],64)):(p(),d(S,{key:1},[g("span",null,N(r(t.level)),1),f(" "+N(t.side.charAt(0).toUpperCase()),1)],64))],64))]),_:2},1032,["disabled","onClick"])],2))),256)),m(K,{name:"fade"},{default:y(()=>[b.value?(p(),d("div",Ze,[(p(!0),d(S,null,G(k(u).values,e=>(p(),v(ee,{class:L({targetKills:"killShot"===k(u).type,targetBulls:"bullsEye"===k(u).type}),disabled:6===e&&D.value,onClick:t=>function(e){const t={type:u.type,position:"".concat(u.level,"_").concat(u.side)};a("hitTarget",e,t),B()}(e)},{default:y(()=>[f(N(e),1)]),_:2},1032,["class","disabled","onClick"]))),256)),m(T,{icon:"",onClick:B,class:"closeButton"},{default:y(()=>[m(c,null,{default:y(()=>[...o[0]||(o[0]=[f("mdi-close",-1)])]),_:1})]),_:1})])):w("",!0)]),_:1})])])}}},[["__scopeId","data-v-2118f79e"]]),et={class:"board-zoom"},tt={class:"clutch"},at={key:0,class:"label-winner"},st={key:1,class:"label-winner"},ot={key:0,class:"clutch-amount"},nt={key:0,class:"clutch-amount"},it={class:"target-amount"},lt={key:0},rt={class:"target-amount"},ct={key:0},ut={class:"target-amount"},ht={key:0},dt={class:"target-amount"},pt={key:0},gt={class:"target-amount"},mt={key:0},yt={class:"target-amount"},vt={key:0},wt=r({__name:"oldBoardTarget",props:{player:String,sumScores:{type:Object,default:()=>{}},gamesheet:{type:Object,default:()=>{}},settings:{type:Object,default:()=>{}},round:Number,defaultBoard:Boolean,isActiveLeftKillshot:Boolean,isActiveRightKillshot:Boolean,rules:String},emits:["addScore"],setup(e,{emit:t}){const a=t;return(t,s)=>(p(),d("div",et,[g("div",{class:L(["board",[e.defaultBoard&&"wktl"!==e.rules?"default":"mini"]])},[g("div",{class:"target target-clutch",onClick:s[0]||(s[0]=X(t=>a("addScore",e.player,8),["stop"]))},[...s[10]||(s[10]=[g("div",{class:"target-amount"},[g("span",null,[g("span",{class:"x"},"8")])],-1)])]),g("div",{class:"target target-one",onClick:s[3]||(s[3]=X(t=>a("addScore",e.player,1),["stop"])),"data-cypress-target":"target-1"},[g("div",tt,[e.gamesheet.winner===e.player&&void 0!==e.gamesheet.player2&&"Qualifying Round"!==e.settings.type?(p(),d("div",at,[...s[11]||(s[11]=[g("i",{class:"icon-axes"},null,-1),f(" WINNER! ",-1)])])):w("",!0),e.gamesheet.winner===e.player&&void 0===e.gamesheet.player2?(p(),d("div",st,[...s[12]||(s[12]=[g("i",{class:"icon-axes"},null,-1),f(" COMPLETED! ",-1)])])):w("",!0),g("div",{class:L(["target-clutch-l",{"killshot-left-active":e.isActiveLeftKillshot}]),onClick:s[1]||(s[1]=X(t=>a("addScore",e.player,8,"left"),["stop"]))},[0!==e.sumScores[e.player]["round"+e.round+"7s"]?(p(),d("span",ot,[...s[13]||(s[13]=[g("span",{class:"x pl-1"},"8",-1)])])):w("",!0)],2),g("div",{class:L(["target-clutch-r",{"killshot-right-active":e.isActiveRightKillshot}]),onClick:s[2]||(s[2]=X(t=>a("addScore",e.player,8,"right"),["stop"]))},[0!==e.sumScores[e.player]["round"+e.round+"7s"]?(p(),d("span",nt,[...s[14]||(s[14]=[g("span",{class:"x pl-1"},"8",-1)])])):w("",!0)],2)]),g("div",it,[0!==e.sumScores[e.player]["round"+e.round+"1s"]?(p(),d("span",lt,[...s[15]||(s[15]=[g("span",{class:"x"},"1",-1)])])):w("",!0)])]),g("div",{class:"target target-two",onClick:s[4]||(s[4]=X(t=>a("addScore",e.player,2),["stop"])),"data-cypress-target":"target-2"},[g("div",rt,[0!==e.sumScores[e.player]["round"+e.round+"5s"]?(p(),d("span",ct,[...s[16]||(s[16]=[g("span",{class:"x"},"2",-1)])])):w("",!0)])]),g("div",{class:"target target-three","data-cypress-target":"target-3",onClick:s[5]||(s[5]=X(t=>a("addScore",e.player,3),["stop"]))},[g("div",ut,[0!==e.sumScores[e.player]["round"+e.round+"3s"]?(p(),d("span",ht,[...s[17]||(s[17]=[g("span",{class:"x"},"3",-1)])])):w("",!0)])]),g("div",{class:"target target-clutch",onClick:s[6]||(s[6]=X(t=>a("addScore",e.player,8),["stop"]))},[...s[18]||(s[18]=[g("div",{class:"target-amount"},[g("span",null,[g("span",{class:"x"},"8")])],-1)])]),g("div",{class:"target target-four",onClick:s[7]||(s[7]=X(t=>a("addScore",e.player,4),["stop"])),"data-cypress-target":"target-4"},[g("div",dt,[0!==e.sumScores[e.player]["round"+e.round+"3s"]?(p(),d("span",pt,[...s[19]||(s[19]=[g("span",{class:"x"},"4",-1)])])):w("",!0)])]),g("div",{class:"target target-five",onClick:s[8]||(s[8]=X(t=>a("addScore",e.player,5),["stop"]))},[g("div",gt,[0!==e.sumScores[e.player]["round"+e.round+"5s"]?(p(),d("span",mt,[...s[20]||(s[20]=[g("span",{class:"x"},"5",-1)])])):w("",!0)])]),g("div",{class:"target target-six",onClick:s[9]||(s[9]=X(t=>a("addScore",e.player,6),["stop"]))},[g("div",yt,[0!==e.sumScores[e.player]["round"+e.round+"5s"]?(p(),d("span",vt,[...s[21]||(s[21]=[g("span",{class:"x"},"6",-1)])])):w("",!0)])])],2)]))}},[["__scopeId","data-v-a8d61eae"]]),ft={key:0,class:"banner winner"},St={key:1,class:"banner completed"},kt=r({__name:"hatchetBoardTarget",props:{rules:String,type:String,player:String,activePlayer:String,practiceEventType:String,killShotCalled:{type:Boolean,default:!1},nextPoint:Number,round:Number,roundThrows:{type:Object,default:()=>{}},gamesheet:{type:Object,default:()=>{}},settings:{type:Object,default:()=>{}}
1,noAccess:Boolean,isLeague:Boolean,defaultBoard:Boolean,isPracticeOrLiveGameType:Boolean,sumScores:{type:Object,default:()=>{}},totalThrows:Number,overtimeDone:Boolean,killshotAvailability:Boolean,killshotOvertime:Boolean,venueLocationSlug:String,game:String,leagueID:String,seasonID:String,weekID:String,watlRound:String,throwsCount:Number,timeToSwitchSides:{type:Boolean,default:!1}},emits:["increaseThrowsCount","callKillShot","confirmCompletedStatus","updatePlayerThrowStatus","switchSides","addKillshotSide"],setup(e,{emit:t}){const a=c(),s=T(),o=D(),n=M(),i=t,l=e,r=I(null);let u=null;function h(){var e,t,a;l.player===l.activePlayer&&(null==(e=r.value)||e.removeEventListener("keyup",N),null==(t=r.value)||t.addEventListener("keyup",N),null==(a=r.value)||a.focus(),u&&clearTimeout(u),u=setTimeout(h,5e3))}U(()=>{var e,t;l.player===l.activePlayer&&(null==(e=r.value)||e.focus(),null==(t=r.value)||t.addEventListener("keyup",N))}),j(()=>l.activePlayer,e=>{var t;u&&clearTimeout(u),l.player===e?h():null==(t=r.value)||t.removeEventListener("keyup",N)});const y=P(()=>{var e,t,a;return"League"===s.selectedEvent.type&&"Playoffs"!==(null==(e=n.hostWeek)?void 0:e.type)?null==(t=l.gamesheet[l.player])?void 0:t.division:"League"===s.selectedEvent.type&&"Playoffs"===(null==(a=n.hostWeek)?void 0:a.type)||"Tournament"===s.selectedEvent.type?"individual"===s.selectedEvent.divisionRuleset?l.gamesheet[l.player].division:s.selectedEvent.divisionRuleset:"Qualifying Throws"===s.selectedEvent.type?"professional":"recreational"}),b=P(()=>!!l.gamesheet["round"+l.round][l.player].activeKillshot_left&&l.gamesheet["round"+l.round][l.player].activeKillshot_left.isThrow),O=P(()=>!!l.gamesheet["round"+l.round][l.player].activeKillshot_right&&l.gamesheet["round"+l.round][l.player].activeKillshot_right.isThrow);function _(e,t){let n;if(n=isNaN(t)?l.sumScores[e]["throw"+l.round]:l.sumScores[e]["throw"+l.round]+t,l.nextPoint<=l.totalThrows||l.killshotOvertime&&!l.overtimeDone){let r;r=l.isPracticeOrLiveGameType?E("/venues/".concat(l.venueLocationSlug,"/practice/game-data/").concat(l.game,"/throws/").concat(e)):B("/venues/".concat(l.venueLocationSlug,"/league/").concat(l.leagueID,"/").concat(l.seasonID,"/").concat(l.weekID,"/game-data/").concat(l.game,"/throws/").concat(e));const c=l.nextPoint;if(void 0!==c){let u={[l.watlRound+"throw-"+c]:t,last:t,sum:n,completed:!1};C(r,u).then(()=>{!function(e,t,a){const s="".concat(a,"throw-").concat(e),o=JSON.parse(localStorage.getItem(s)||"{}");if(!l.isPracticeOrLiveGameType&&Object.keys(o).length){const n={oldValue:o.value,newValue:t,throwNumber:e,initiator:o.initiator};let i=Q().unix();C(B("/venues/".concat(l.venueLocationSlug,"/league/").concat(l.leagueID,"/").concat(l.seasonID,"/").concat(l.weekID,"/game-data/").concat(l.game,"/throws/editedScores/").concat(a)),{[i]:n}).then(()=>{localStorage.removeItem(s)})}}(c,t,e),l.timeToSwitchSides&&i("switchSides",!0),(c+1!==5||"wktl"===s.selectedEvent.rules)&&c+1!==10||l.killshotOvertime||"Qualifying Throws"!==s.selectedEvent.type||i("callKillShot",l.player)}).catch(e=>{o.logError({function:"addScore",error:e,type:"request",venue:a.venue.locationSlug,game:l.game})}),i("increaseThrowsCount")}if(1===l.throwsCount){const e="/venues/".concat(l.venueLocationSlug,"/league/").concat(l.leagueID,"/").concat(l.seasonID,"/").concat(l.weekID,"/game-list/").concat(l.game);C(B(e),{scored:!0})}}else i("updatePlayerThrowStatus",e,!0)}function R(e,t){if(l.noAccess)return!1;l.killshotOvertime?t=7===t||8===t?8:0:(8!==t&&"D"!==t&&l.gamesheet["round"+l.round][e]["killcall"+l.nextPoint+"th"]&&(t=0,x(e,l.nextPoint,"zero")),8!==t||l.gamesheet["round"+l.round][e]["killcall"+l.nextPoint+"th"]||(t=0)),8!==t||l.killshotAvailability||l.killshotOvertime?void 0!==arguments[2]&&0!==t&&x(e,l.nextPoint,arguments[2]):t=1,_(e,t)}function x(e,t,s){let n;i("addKillshotSide",e,t,s),n=l.isPracticeOrLiveGameType?"/venues/".concat(a.venue.locationSlug,"/practice"):"/venues/".concat(a.venue.locationSlug,"/league/").concat(l.leagueID,"/").concat(l.seasonID,"/").concat(l.weekID);const r=n.includes("/league/")?B("".concat(n,"/game-data/").concat(l.game,"/round").concat(l.round,"/").concat(e)):E("".concat(n,"/game-data/").concat(l.game,"/round").concat(l.round,"/").concat(e));C(r,{["killshot"+t+("zero"===s?"empty":"th_side")]:s,["activeKillshot_".concat(s)]:{throwNr:t,side:s,isThrow:!0}}).catch(e=>{o.logError({function:"saveKillshotSide",error:e,type:"request",venue:a.venue.locationSlug,game:l.game})})}function L(e,t={type:"",position:""}){if(l.noAccess)return!1;!function(e){let t=l.nextPoint;if(!e.type)return;const a=e.type.toLowerCase();let s;s=l.isPracticeOrLiveGameType?E("/venues/".concat(l.venueLocationSlug,"/practice/game-data/").concat(l.game,"/round").concat(l.round,"/").concat(l.player)):B("/venues/".concat(l.venueLocationSlug,"/league/").concat(l.leagueID,"/").concat(l.seasonID,"/").concat(l.weekID,"/game-data/").concat(l.game,"/round").concat(l.round,"/").concat(l.player)),C(s,{[a+t+"th_position"]:e.position}).catch(function(e){o.logError({function:"saveKillsAndBullsPosition",error:e,type:"request",venue:l.venueLocationSlug,game:l.game})})}(t,l.nextPoint),_(l.player,e)}
1function N(e){var t,a,s;if(l.player!==l.activePlayer)return;if(null==(t=l.gamesheet.throws[l.player])?void 0:t.completed)return;let o;switch(e.code){case"Numpad7":o="D";break;case"Numpad0":o=0;break;case"Numpad1":o=1;break;case"Numpad2":o=2;break;case"Numpad3":o=3;break;case"Numpad4":o=4;break;case"Numpad5":o=5;break;case"Numpad6":o=6;break;case"Numpad8":if(l.killShotCalled||(null==(s=null==(a=l.gamesheet["round"+l.round])?void 0:a[l.player])?void 0:s["killcall"+l.nextPoint+"th"]))return o=8,R(l.player,o),void e.stopPropagation();o=null;break;default:o=null}null!==o&&(e.stopPropagation(),L(o))}j(()=>l.nextPoint,e=>{void 0===e&&(i("confirmCompletedStatus",l.player),i("updatePlayerThrowStatus",l.player,!0))}),H(()=>{var e;u&&clearTimeout(u),null==(e=r.value)||e.removeEventListener("keyup",N)}),j(()=>l.gamesheet,e=>{e.player2&&"test"===e.player2.playerid&&function(){let e=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},t=[0,1,2,3,4,6];for(let a=1;a<=10;a++){let s=e(0,5);window.setTimeout(function(){R("player2",t[s])},5e3*a)}}()},{immediate:!0}),P(()=>{let e=0,t=l.gamesheet["round"+l.round][l.player];for(let[a,s]of Object.entries(t))a.includes("killcall")&&s&&e++;return e});const W=P(()=>{const e=[],t=l.gamesheet["round".concat(l.round)][l.player]||{};for(let[a,s]of Object.entries(t))a.includes("position")&&a.includes("killshot")&&e.push(s);return e}),G=P(()=>{const e=[],t=l.gamesheet["round".concat(l.round)][l.player]||{};for(let[a,s]of Object.entries(t))if(a.includes("position")&&a.includes("bullseye")){const t=a.replace(/[^0-9]/g,"");if(l.nextPoint<=5&&+t<=5||(l.nextPoint>5||!l.nextPoint)&&+t>=6){let a=1===l.round?"":l.round;const o=l.gamesheet.throws[l.player]["".concat(a,"throw-").concat(t)];e.push({position:s,points:o})}}return e});return P(()=>(1===l.round?Object.keys(l.roundThrows["round".concat(l.round)][l.player]):(l.round,Object.keys(l.roundThrows["round".concat(l.round)][l.player]).filter(e=>e.startsWith(l.round)))).some(e=>e.startsWith(l.round)&&2===l.round||e.startsWith(l.round)&&3===l.round||e.startsWith("th")&&1===l.round?"D"===l.roundThrows["round".concat(l.round)][l.player][e]:void 0)),(t,a)=>(p(),d("div",{class:"wrapper",tabindex:"0",ref_key:"wrapperRef",ref:r},["practice"===e.type||"before_2024"!==k(s).selectedEvent.gamePlayRules?(p(),v(Je,{key:0,class:"mt-5 mb-7",isLeague:"practice"===e.type&&"league"===e.practiceEventType||"League"===k(s).selectedEvent.type,killshotOvertime:e.killshotOvertime,divisionRuleset:y.value,killShotCalled:e.killShotCalled,hitKillShots:W.value,hitBullsEyes:G.value,onHitTarget:L},null,8,["isLeague","killshotOvertime","divisionRuleset","killShotCalled","hitKillShots","hitBullsEyes"])):(p(),v(wt,{key:1,player:e.player,sumScores:e.sumScores,gamesheet:e.gamesheet,settings:e.settings,round:e.round,defaultBoard:e.defaultBoard,isActiveLeftKillshot:b.value,isActiveRightKillshot:O.value,rules:e.rules,onAddScore:R},null,8,["player","sumScores","gamesheet","settings","round","defaultBoard","isActiveLeftKillshot","isActiveRightKillshot","rules"])),"practice"===e.type||"before_2024"!==k(s).selectedEvent.gamePlayRules?(p(),d(S,{key:2},[e.gamesheet.winner===e.player&&void 0!==e.gamesheet.player2&&"Qualifying Round"!==e.settings.type?(p(),d("div",ft,[...a[1]||(a[1]=[g("i",{class:"icon-axes"},null,-1),f(" WINNER! ",-1)])])):w("",!0),e.gamesheet.throws.player1.completed&&void 0===e.gamesheet.player2&&"Qualifying Round"!==e.settings.type?(p(),d("div",St,[...a[2]||(a[2]=[g("i",{class:"icon-axes"},null,-1),f(" COMPLETED! ",-1)])])):w("",!0)],64)):w("",!0),m(ne,{onAddScore:a[0]||(a[0]=e=>L(e))})],512))}},[["__scopeId","data-v-14f3bd58"]]),Tt=["src"],bt=["src"],Dt=r({__name:"boardPlayer",props:{imgSrc:String,firstName:String,lastName:String,advanced:Boolean,division:String,wktlDivision:String,reverseDisplay:Boolean},emits:["playerClick"],setup(e,{emit:t}){const a=T(),s=t,o=P(()=>"since_2024"===a.selectedEvent.gamePlayRules),n=P(()=>"since_2025"===a.selectedEvent.gamePlayRules),i=P(()=>"wktl"===a.selectedEvent.rules);return(t,a)=>{const l=h("v-avatar"),r=h("v-list-item-title"),c=h("v-list-item"),u=h("v-list");return p(),v(u,{class:"av"},{default:y(()=>[m(c,{class:"pa-0",onClick:a[0]||(a[0]=e=>s("playerClick"))},{prepend:y(()=>[e.reverseDisplay?w("",!0):(p(),v(l,{key:0,size:"75",class:"mx-0 pa-2"},{default:y(()=>[g("img",{src:e.imgSrc,class:"icon-shadow avatar"},null,8,Tt)]),_:1}))]),append:y(()=>[e.reverseDisplay?(p(),v(l,{key:0,size:"75",class:"mx-0 pa-2"},{default:y(()=>[g("img",{src:e.imgSrc,class:"icon-shadow avatar"},null,8,bt)]),_:1})):w("",!0)]),default:y(()=>[m(c,null,{default:y(()=>[m(r,{class:L({"text-right":e.reverseDisplay})},{default:y(()=>[g("h5",{class:L(["px-3",{advancedPlayer:"amateur"===e.division&&n.value,proPlayer:e.advanced&&o.value||"professional"===e.division&&n.value,proPlayerWktl:"professional"===e.wktlDivision&&i.value}])},N(e.firstName)+" "+N(e.lastName),3)]),_:1},8,["class"])]),_:1})]),_:1})]),_:1})}}},[["__scopeId","data-v-dcef1259"]]),It={key:0,class:"suddenOverlay"},Pt={key:1,class:"suddenOverlay"},Ot={class:"hidden-xs-only"},Bt={__name:"hatchetMainPanel",props:{gameinfo:{type:Object,default:()=>{}},type:String,rules:String,players:{type:Array,default:()=>[]},isSinglePlayer:Boolean,settings:{type:Object,default:()=>{}},gamesheet:{type:Object,default:()=>{}},sumScores:{type:Object,default:()=>{}},isBestOfX:Number,round:Number,throwsCount:Number,roundThrows:{type:Object,default:()=>{}},killshotOvertime:Boolean,isPracticeOrLiveGameType:Boolean,isLeague:Boolean,sidesSwitched:Boolean,overt
1imeDone:Boolean,deathThrowCalled:Boolean,deathThrow:Boolean,selectSuddenDeathWinner:Boolean,isPublic:Boolean,defaultBoard:Boolean,totalThrows:Number,watlRound:String,game:String,leagueID:String,seasonID:String,weekID:String,practiceEventType:String,currentThrowNr:Number},emits:["goToRound","increaseThrowsCount","decreaseThrowsCount","confirmCompletedStatus","updatePlayerThrowStatus","resetDeathThrow","deathThrowSwitch","updateWinner","setDeathThrowCalled","reversePlayers","setSideSwitched","selectWinner","addKillshotSide","playerClick"],setup(e,{emit:t}){const a=c(),s=T(),o=b(),n=t,r=e,u=D(),O=I(!1);let _=I(!1);const R=P(()=>{const e=e=>{const t=K(e);return t>5||void 0===t};return!r.sidesSwitched&&e(r.players[0])&&e(r.players[1])});let x=P(()=>r.round===r.isBestOfX||"none"!==r.gamesheet.winner&&2===r.round&&40===r.throwsCount&&"Qualifying Round"!==r.settings.type);function W(e=!1){if(r.killshotOvertime||_.value&&e)return;e&&(_.value=!0),n("reversePlayers"),O.value=!0;let t="/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID,"/game-data/").concat(r.game);C(B(t),{switchSide:!r.gamesheet.switchSide}).catch(function(e){u.logError({function:"switchSides",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})}),setTimeout(()=>{O.value=!1},1e3)}function A(e){var t;return null==(t=r.gamesheet["round"+r.round][e])?void 0:t["killcall"+K(e)+"th"]}function K(e){if(void 0===r.gamesheet.throws||void 0===r.gamesheet.throws[e])return 1;{let t,a=r.killshotOvertime?r.settings.killshots:10;for(t=1;t<=a;t++)if(void 0===r.gamesheet.throws[e][r.watlRound+"throw-"+t])return t}}function X(e){return"test"!==e&&(!(!r.isPublic||e===o.user[".key"])||r.isPublic&&!o.siteAccess&&e!==o.user[".key"])}function M(e){var t;if(X(null==(t=r.gamesheet[e])?void 0:t.playerid))return!1;let s,o="killcall"+K(e)+"th";s=r.isPracticeOrLiveGameType?"/venues/".concat(a.venue.locationSlug,"/practice"):"/venues/".concat(a.venue.locationSlug,"/league/").concat(r.leagueID,"/").concat(r.seasonID,"/").concat(r.weekID);const n=s.includes("/league/")?B("".concat(s,"/game-data/").concat(r.game,"/round").concat(r.round,"/").concat(e)):E("".concat(s,"/game-data/").concat(r.game,"/round").concat(r.round,"/").concat(e));C(n,{[o]:!r.gamesheet["round"+r.round][e][o]}).catch(function(e){u.logError({function:"callKillshot",error:e,type:"request",venue:a.venue.locationSlug,game:r.game})})}function U(e,t){const a=K(e);if("Qualifying Throws"===s.selectedEvent.type||"practice"===r.type&&"Qualifying"===r.practiceEventType)return"wktl"===s.selectedEvent.rules?10===a:5===a||10===a;if(a){if(t||(t=2),"since_2025"===s.selectedEvent.gamePlayRules){let a=H(e);const s=Q(e);return a<=t||a<=t+1&&a<2||s+2>a}{let a=H(e);const s=Q(e)>0;return a<=t||a<=t+1&&a<2||s&&a<3}}return!1}function H(e){var t;let a=0;for(let s=1;s<=10;s++)(null==(t=r.gamesheet["round"+r.round][e])?void 0:t["killcall"+s+"th"])&&a++;return a}function Q(e){let t=0;return(1===r.round?Object.keys(r.roundThrows["round".concat(r.round)][e]):(r.round,Object.keys(r.roundThrows["round".concat(r.round)][e]).filter(e=>e.startsWith(r.round)))).some(a=>{a.startsWith(r.round)&&2===r.round||a.startsWith(r.round)&&3===r.round?"D"===r.roundThrows["round".concat(r.round)][e][a]&&t++:a.startsWith("th")&&1===r.round&&"D"===r.roundThrows["round".concat(r.round)][e][a]&&t++}),t}const V=P(()=>{if(!r.gamesheet)return"player1";const e=r.gamesheet.throws||{};return Object.keys(e.player1||{}).filter(e=>e.startsWith("".concat(r.watlRound,"throw-"))).length<=Object.keys(e.player2||{}).filter(e=>e.startsWith("".concat(r.watlRound,"throw-"))).length?"player1":"player2"}),F=I({});return j(()=>r.gamesheet,async e=>{var t,a;if(!e||"wktl"!==s.selectedEvent.rules)return;const o=[];(null==(t=e.player1)?void 0:t.playerid)&&o.push(e.player1.playerid),(null==(a=e.player2)?void 0:a.playerid)&&o.push(e.player2.playerid),0!==o.length&&await Promise.all(o.map(async e=>{try{const t=await i(l("/watl/players/".concat(e)));t.exists()&&(F.value[e]=t.val().wktlDivision||"recreational")}catch(t){console.error("Failed to fetch wktl division for player:",e,t)}}))},{immediate:!0,deep:!0}),(t,s)=>{const i=h("v-btn"),l=h("v-icon"),r=h("v-col"),c=h("v-row");return p(),v(c,{class:L(["gameboard ma-n3",{disabled:"Completed"===e.gameinfo.status,switchAnimDoubles:O.value,mini:e.killshotOvertime&&e.settings.killshots>10}]),align:"start"},{default:y(()=>[(p(!0),d(S,null,G(e.players,(t,c)=>{var u,h;return p(),v(r,{cols:"12",md:"5",class:L([{leftPlayer:0===c,rightPlayer:1===c,"order-3":1===c,opponent:(null==(u=e.gamesheet[t])?void 0:u.playerid)!==k(o).user[".key"]&&e.isPublic,player:(null==(h=e.gamesheet[t])?void 0:h.playerid)===k(o).user[".key"],killshot:A(t)||e.killshotOvertime,winner:e.gamesheet.winner===t&&void 0!==e.gamesheet.player2&&"Qualifying Round"!==e.settings.type}
1,"px-3 mb-3 boardSpace"]),key:t.id},{default:y(()=>{var o,r;return[g("div",{class:L(["sheet","player-"+(c+1)]),style:{position:"relative"}},[e.gamesheet.deathThrow&&e.selectSuddenDeathWinner&&"Qualifying Round"!==e.settings.type?(p(),d("div",It,[g("div",null,[s[12]||(s[12]=g("p",{class:"deathText"}," You're now in sudden death. Please select the winner after throws have been made. Good luck! ",-1)),m(i,{block:"",size:"large",class:"redish hidden-md-and-up",disabled:!e.selectSuddenDeathWinner,onClick:s[0]||(s[0]=e=>n("selectWinner","player1"))},{default:y(()=>[f("Winner: "+N(e.gamesheet.player1.first)+" "+N(e.gamesheet.player1.last),1)]),_:1},8,["disabled"]),m(i,{block:"",size:"large",class:"redish hidden-md-and-up",disabled:!e.selectSuddenDeathWinner,onClick:s[1]||(s[1]=e=>n("selectWinner","player2"))},{default:y(()=>[f("Winner: "+N(e.gamesheet.player2.first)+" "+N(e.gamesheet.player2.last),1)]),_:1},8,["disabled"])])])):w("",!0),e.gamesheet.deathThrow&&!e.selectSuddenDeathWinner&&"Qualifying Round"!==e.settings.type?(p(),d("div",Pt,[...s[13]||(s[13]=[g("div",null,[g("p",{class:"deathText"}," You're now in sudden death. Tap to select the winner. ")],-1)])])):w("",!0),void 0!==e.gamesheet[t]?(p(),v(Dt,{key:2,"reverse-display":1===c,"first-name":e.gamesheet[t].first,"last-name":e.gamesheet[t].last,advanced:e.gamesheet[t].advanced,division:e.gamesheet[t].division||"","wktl-division":F.value[e.gamesheet[t].playerid]||"","img-src":e.gamesheet[t].pic,onPlayerClick:a=>n("playerClick",e.gamesheet[t])},null,8,["reverse-display","first-name","last-name","advanced","division","wktl-division","img-src","onPlayerClick"])):w("",!0),m(kt,{type:e.type,rules:e.rules,player:t,killShotCalled:A(t),nextPoint:K(t),round:e.round,settings:e.settings,isLeague:e.isLeague,defaultBoard:e.defaultBoard,roundThrows:e.roundThrows,gamesheet:e.gamesheet,activePlayer:V.value,noAccess:X(null==(o=e.gamesheet[t])?void 0:o.playerid),isPracticeOrLiveGameType:e.isPracticeOrLiveGameType,venueLocationSlug:k(a).venue.locationSlug,sumScores:e.sumScores,totalThrows:e.totalThrows,overtimeDone:e.overtimeDone,killshotOvertime:e.killshotOvertime,killshotAvailability:U(t,3),game:e.game,leagueID:e.leagueID,seasonID:e.seasonID,weekID:e.weekID,watlRound:e.watlRound,throwsCount:e.throwsCount,practiceEventType:e.practiceEventType,timeToSwitchSides:R.value,onIncreaseThrowsCount:s[2]||(s[2]=e=>n("increaseThrowsCount")),onCallKillShot:M,onConfirmCompletedStatus:s[3]||(s[3]=e=>n("confirmCompletedStatus",e)),onUpdatePlayerThrowStatus:(e,t)=>n("updatePlayerThrowStatus",e,t),onSwitchSides:W,onAddKillshotSide:(e,t,a)=>n("addKillshotSide",e,t,a)},null,8,["type","rules","player","killShotCalled","nextPoint","round","settings","isLeague","defaultBoard","roundThrows","gamesheet","activePlayer","noAccess","isPracticeOrLiveGameType","venueLocationSlug","sumScores","totalThrows","overtimeDone","killshotOvertime","killshotAvailability","game","leagueID","seasonID","weekID","watlRound","throwsCount","practiceEventType","timeToSwitchSides","onUpdatePlayerThrowStatus","onAddKillshotSide"])],2),A(t)?(p(),v(i,{key:1,block:"",class:"third ma-0",onClick:e=>M(t)},{default:y(()=>[g("span",Ot,[s[16]||(s[16]=f("Killshot Called ",-1)),m(l,null,{default:y(()=>[...s[15]||(s[15]=[f("mdi-check",-1)])]),_:1})])]),_:1},8,["onClick"])):(p(),v(i,{key:0,block:"",class:L(["third ma-0",{success:null==(r=e.gamesheet["round"+e.round][t])?void 0:r["killcall"+K(t)+"th"]}]),disabled:e.killshotOvertime||!U(t,1),onClick:e=>M(t)},{default:y(()=>[...s[14]||(s[14]=[g("span",{class:"hidden-xs-only"},"Call Killshot ",-1)])]),_:1},8,["class","disabled","onClick"])),e.selectSuddenDeathWinner?(p(),v(i,{key:2,block:"",size:"large",class:"redish mx-0",onClick:e=>n("selectWinner",t)},{default:y(()=>[...s[17]||(s[17]=[g("span",null,"Select Winner",-1)])]),_:1},8,["onClick"])):w("",!0),0===c&&void 0!==e.gamesheet.player2&&e.deathThrow&&"Qualifying Round"!==e.settings.type&&!e.deathThrowCalled?(p(),v(i,{key:3,color:"primary",block:"",class:"mx-0 mt-6",id:"deathThrow",onClick:s[4]||(s[4]=e=>n("deathThrowSwitch",!0))},{default:y(()=>[...s[18]||(s[18]=[f("Sudden Death Throw",-1)])]),_:1})):w("",!0),0===c&&e.isBestOfX>1&&"Completed"!==e.gameinfo.status&&"Qualifying Round"!==e.settings.type?(p(),v(i,{key:4,block:"",class:"mx-0 mt-6",color:"primary",onClick:s[5
1]||(s[5]=e=>n("goToRound",1)),disabled:k(x)},{default:y(()=>[...s[19]||(s[19]=[f("Next Round",-1)])]),_:1},8,["disabled"])):w("",!0)]}),_:2},1032,["class"])}),128)),m(r,{cols:"12",md:"2",class:"px-3 text-center scores"},{default:y(()=>[m(Fe,{type:e.type,players:e.players,isSinglePlayer:e.isSinglePlayer,settings:e.settings,gamesheet:e.gamesheet,sumScores:e.sumScores,isBestOfX:e.isBestOfX,killshotOvertime:e.killshotOvertime,isPracticeOrLiveGameType:e.isPracticeOrLiveGameType,sidesSwitched:e.sidesSwitched,isPublic:e.isPublic,pointBoxes:e.totalThrows,round:e.round,watlRound:e.watlRound,game:e.game,leagueID:e.leagueID,seasonID:e.seasonID,weekID:e.weekID,currentThrowNr:e.currentThrowNr,disableNextRound:k(x),onSwitchSides:W,onGoToRound:s[6]||(s[6]=e=>(n("goToRound",e),void(_.value=!1))),onDecreaseThrowsCount:s[7]||(s[7]=e=>n("decreaseThrowsCount")),onUpdatePlayerThrowStatus:s[8]||(s[8]=(e,t)=>n("updatePlayerThrowStatus",e,t)),onResetDeathThrow:s[9]||(s[9]=e=>n("resetDeathThrow")),onDeathThrowSwitch:s[10]||(s[10]=e=>n("deathThrowSwitch",e)),onUpdateWinner:s[11]||(s[11]=(e,t)=>n("updateWinner",e,t))},null,8,["type","players","isSinglePlayer","settings","gamesheet","sumScores","isBestOfX","killshotOvertime","isPracticeOrLiveGameType","sidesSwitched","isPublic","pointBoxes","round","watlRound","game","leagueID","seasonID","weekID","currentThrowNr","disableNextRound"])]),_:1})]),_:1},8,["class"])}}};const Ct={key:0,id:"board-page",class:"newContainer"},Et={key:0,class:"d-flex align-center justify-center py-5 text-overline"},_t={key:2,class:"preloader-center"},Rt={key:4,class:"timestamp"};const xt=r({name:"watlGamesheet",props:{leagueID:{type:String},seasonID:{type:String},weekID:{type:String},game:{type:String},rules:{type:String,default:"watl"},type:{type:String}},mixins:[a,t,s],components:{HatchetMainPanel:r(Bt,[["__scopeId","data-v-f2bce820"]]),HatchetTopPanel:ke,matchups:e,chat:o,chatModal:ie,online:n},data:function(){return{gameSheetLoaded:!1,dblocation:"",currentThrowNr:0,throwsCount:0,allThrows:0,isSinglePlayer:!1,boardZoom:!0,defaultBoard:!1,practiceEventType:"league",showNextUp:!1,matchNumber:0,weekGames:[],gameinfo:{},schedule:[],settings:{},weekPlayers:[],deathThrow:!1,selectSuddenDeathWinner:!1,sidesSwitched:!1,inactive:!1,inactiveTimeout:!1,players:["player2","player1"],gamesheet:{round:1,throw1:{player1:"",player2:""},throw2:{player1:"",player2:""},throw3:{player1:"",player2:""},throw4:{player1:"",player2:""},throw5:{player1:"",player2:""},throw6:{player1:"",player2:""},throw7:{player1:"",player2:""},throw8:{player1:"",player2:""},throw9:{player1:"",player2:""},throw10:{player1:"",player2:""}},roundThrows:{round1:{},round2:{},round3:{}},me:null,totalThrows:10,killshotOvertime:!1,deathThrowCalled:!1,showTransition:!1,autoschedule:[],standings:[],divisions:{professional:"Pro",amateur:"Amateur",recreational:"Unsanctioned Rec",individual:"Unsanctioned Player-Depend"}}},setup:()=>({venueStore:c(),userStore:b(),eventStore:T(),generalStore:D(),seasonStore:M(),chatStore:Y()}),computed:{gameWithBot(){var e,t,a,s;const o="player1"in this.gameinfo&&"player2"in this.gameinfo,n="axe_bot"===(null==(t=null==(e=this.gameinfo)?void 0:e.player1)?void 0:t.playerid)||"axe_bot"===(null==(s=null==(a=this.gameinfo)?void 0:a.player2)?void 0:s.playerid);return o&&n},playersThrows(){var e;return null==(e=this.gamesheet)?void 0:e.throws},gameChatMembers(){var e,t;return[(null==(e=this.gameinfo)?void 0:e.player1)||{},(null==(t=this.gameinfo)?void 0:t.player2)||{}].map(e=>({...e,".key":(null==e?void 0:e.playerid)||(null==e?void 0:e[".key"])||""}))},chatIsAvailable(){var e,t;return(null==(t=null==(e=this.gameinfo)?void 0:e.gameChatId)?void 0:t.length)>0&&this.chatStore.userIsChatMember},showTournamentDivision(){return this.eventStore.selectedEvent.divisionRuleset&&("Tournament"===this.eventStore.selectedEvent.type||"League"===this.eventStore.selectedEvent.type&&"Week8"===this.seasonStore.hostWeek.name)},venueLocationSlug(){return this.venueStore.venue.locationSlug},generalLeagueType(){return void 0!==this.eventStore.selectedEvent.leagueType?"standard-league"===this.eventStore.selectedEvent.leagueType?"standard-league":"duals-league"===this.eventStore.selectedEvent.leagueType?"doubles-league":"big-axe-league":"standard-league"},isPracticeOrLiveGameType(){return"practice"===this.type||"live"===this.type},isPublic(){return["watlPublic","watlPublicGame","watlPublicNoVenue"].includes(this.$route.name)},throwsDone(){return this.allThrows-this.throwsCount<1},overtimeDone(){return"Qualifying Throws"!==this.eventStore.selectedEvent.type||this.allThrows+this.settings.killshots*this.players.length-this.throwsCount<=0},sides(){var e,t,a;const s=null!=(t=null==(e=this.gamesheet)?void 0:e.throws)?t:{};return void 0!==(null==(a=this.gamesheet)?void 0:a.player2)?[s.player1,s.player2]:[s.player1]},completeCheck(){return te(this.sides)}
1,currentThrow(){this.setCurrentThrowNr();let e=this;for(let t in this.players){let a=this.nextPoint(this.players[t]);a<this.currentThrowNr&&(e.currentThrowNr=a)}return this.currentThrowNr},isBestOfX(){var e,t;return"finals"===this.gameinfo.bracket?3:(null==(e=this.settings)?void 0:e.bestOf)?this.settings.bestOf:"Qualifying Round"===(null==(t=this.settings)?void 0:t.type)||"Qualifying Throws"===this.eventStore.selectedEventType?this.settings.rounds+1:1},isLeague(){return void 0!==this.weekID?this.weekID.startsWith("Week"):null},eventType(){return void 0!==this.weekID?this.weekID.startsWith("Week")?"league":"tournament":null},round(){return this.gamesheet.round||1},watlRound(){return 1===this.round?"":String(this.round)},playerGameStats(){let e={player1:{gp:1,win:0,loss:0,nc:0,pts:0,score:this.getPlayerScores("player1"),high:0,drops:0,faults:0,baxe:0,baxewin:0,perfect:0,killcall:0,tieWon1:!1,tieWon2:!1,tieWon3:!1,tieWon4:!1,tieWon5:!1,tieWon6:!1,overtime:this.sumScores.player1.overtime,overtimeOuter:this.sumScores.player1.overtimeOuter},player2:{gp:1,win:0,loss:0,nc:0,pts:0,score:this.getPlayerScores("player2"),high:0,drops:0,faults:0,baxe:0,baxewin:0,perfect:0,killcall:0,tieWon1:!1,tieWon2:!1,tieWon3:!1,tieWon4:!1,tieWon5:!1,tieWon6:!1,overtime:this.sumScores.player2.overtime,overtimeOuter:this.sumScores.player2.overtimeOuter}};switch(this.gamesheet.winner){case"player1":e.player1.win=1,e.player1.loss=0,e.player2.loss=1,e.player2.win=0;break;case"player2":e.player2.win=1,e.player2.loss=0,e.player1.loss=1,e.player1.win=0}if(void 0!==this.gamesheet.throws&&(e.player1.pts=this.sumScores.player1.total,e.player2.pts=this.sumScores.player2.total,this.completeCheck))if(this.isSinglePlayer)e.player1.nc=1;else{let t="none";this.isBestOfX>1?(t=this.getBestXWinner(),"player1"===t&&(e.player1.win=1,e.player2.loss=1),"player2"===t&&(e.player2.win=1,e.player1.loss=1)):this.sumScores.player1.total>this.sumScores.player2.total&&this.settings.bestOf&&this.settings.bestOf<3?(e.player1.win=1,e.player2.loss=1,t="player1",this.updateWinner(t,!0)):this.sumScores.player1.total<this.sumScores.player2.total&&this.settings.bestOf&&this.settings.bestOf<3?(e.player2.win=1,e.player1.loss=1,t="player2",this.updateWinner(t,!0)):this.deathThrowToTrue()}for(let t=1;t<=this.isBestOfX;t++)for(let a=1;a<=10;a++)this.gamesheet["round"+t].player1["killcall"+a+"th"]&&e.player1.killcall++,void 0!==this.gamesheet.player2&&this.gamesheet["round"+t].player2["killcall"+a+"th"]&&e.player2.killcall++;return e},getThrowsPerRounds(){var e;const t={player1:{round1:0,round2:0,round3:0,round4:0,round5:0,round6:0,round7:0,round8:0},player2:{round1:0,round2:0,round3:0,round4:0,round5:0,round6:0,round7:0,round8:0}};let a=1,s=void 0!==this.gamesheet.player2?2:1;if(void 0!==this.gamesheet.player1&&(null==(e=this.gamesheet.throws)?void 0:e["player"+a])){let e=1;this.isBestOfX>1&&(e=this.isBestOfX),"Qualifying Round"===this.settings.type&&(e=this.settings.rounds+1);let o=this.killshotOvertime&&this.settings.killshots>10?this.settings.killshots:10;for(let n=1;n<=e;n++){let e="";for(this.isBestOfX&&(e=n,1===n&&(e="")),a=1;a<=s;a++)for(let s=1;s<=o;s++){const o=this.gamesheet.throws["player"+a][e+"throw-"+s];void 0===o||isNaN(o)&&!["D","F"].includes(o)||t["player"+a]["round"+n]++}}}return t},sumScores(){var e;this.refreshInactive();let t={player1:{throw1:0,throw2:0,throw3:0,throw4:0,throw5:0,throw6:0,throw7:0,throw8:0,throw9:0,throw10:0,score0s:0,score1s:0,score2s:0,score3s:0,score4s:0,score5s:0,score6s:0,score7s:0,score8s:0,score10s:0,drops:0,faults:0,total:0,total1:0,total2:0,total3:0,total4:0,total5:0,total6:0,killcall:0,killcall5th:0,killcall10th:0,killcall5th_side:"",killcall10th_side:"",overtime:0,overtimeOuter:0},player2:{throw1:0,throw2:0,throw3:0,throw4:0,throw5:0,throw6:0,throw7:0,throw8:0,throw9:0,throw10:0,score0s:0,score1s:0,score2s:0,score3s:0,score4s:0,score5s:0,score6s:0,score7s:0,score8s:0,score10s:0,drops:0,faults:0,total:0,total1:0,total2:0,total3:0,total4:0,total5:0,total6:0,killcall:0,killcall5th:0,killcall10th:0,killcall5th_side:"",killcall10th_side:"",overtime:0,overt
1imeOuter:0}},a=1,s=1,o=void 0!==this.gamesheet.player2?2:1;if(void 0!==this.gamesheet.player1){if(null==(e=this.gamesheet.throws)?void 0:e["player"+s]){let e=1;this.settings.rounds||this.setSettingsRoundOne(),this.isBestOfX>1&&(e=this.isBestOfX),"Qualifying Round"===this.settings.type&&(e=this.settings.rounds+1);let n=this.killshotOvertime&&this.settings.killshots>10?this.settings.killshots:10;for(let i=1;i<=e;i++){let e="";for(this.isBestOfX&&(e=i,1===i&&(e="")),s=1;s<=o;s++)for(a=1;a<=n;a++){const o=this.gamesheet.throws["player"+s][e+"throw-"+a];if(void 0===o||isNaN(o))"D"===o?t["player"+s].drops++:"F"===o&&t["player"+s].faults++;else{i<=this.settings.rounds&&(t["player"+s]["throw"+a]=t["player"+s]["throw"+a]+o);const e=[0,1,2,3,4,5,6,7,8],n=e.length;for(let a=0;a<n;a++)o===e[a]&&(i<=this.settings.rounds?t["player"+s].total+=o:(6===o&&t["player"+s].overtimeOuter++,7!==o&&8!==o||t["player"+s].overtime++),t["player"+s]["total"+i]+=o,t["player"+s]["score"+o+"s"]++)}}}}}else t["player"+s].total=0;return t},notPlayedAutoschedule(){return this.autoschedule.filter(e=>!e.played)}},methods:{setBotThrow(e,t,a){if(t in this.gamesheet.throws[a])return;const s=B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/throws/").concat(a)),o=this.generalLeagueType;let n=z(o,e,this.eventStore.selectedEvent.rules);if(this.gamesheet.throws[a][t]=n,e){let e=t.slice(-1);C(B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/round1/").concat(a)),{["killcall".concat(e,"th")]:!0,killshot1th_position:"low_left"})}C(s,{[t]:n})},updatePlayersRoundScoreSum(){this.players.forEach(e=>{C(B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/round").concat(this.round,"/").concat(e)),{sum:this.sumScores[e]["total".concat(this.round)]})})},playerClickHandler(e){if(["watlPublicGame","watlDoublesPublic","watlBigAxePublic","watlPublicNoVenue"].includes(this.$route.name)&&this.eventStore.selectedEvent.virtual){const t=this.standings.find(t=>t.id===e.playerid).code;this.$router.push("/".concat(this.venueLocationSlug,"/player/").concat(t))}},gameRef(e){return this.isPracticeOrLiveGameType?E("/venues/".concat(this.venueLocationSlug,"/practice/game-data/").concat(this.game)):B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(e||this.game))},getAutoschedule(){let e="/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID);this.$databaseBind("autoschedule",B("".concat(e,"/").concat(this.weekID,"/autoschedule"))).then(t=>{t.length||C(B("".concat(e,"/").concat(this.weekID)),{autoschedule:this.newRR})})},setAutoschedule(){let e="/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID);const t=this.newRR;t.length&&C(B("".concat(e,"/").concat(this.weekID)),{autoschedule:t})},addKillshotSideHandler(e,t,a){"zero"!==a?this.gamesheet["round"+this.round][e]["killshot"+t+"th_side"]=a:this.gamesheet["round"+this.round][e]["killshot"+t+"empty"]=a},errorLog(e,t){this.generalStore.logError({function:t,error:e,type:"request",venue:this.venueLocationSlug,game:this.game})},getPlayerScores(e){let t=0;for(let a=1;a<=10;a++)t+=this.sumScores[e]["throw".concat(a)];return t},checkAccoladesHandler(){this.checkAccolades(...arguments)},declareWinnerHandler(e,t,a){this.declareWinner(this.gameinfo.bracket,this.stringToNum(String(this.gameinfo.bracketRound)),this.stringToNum(String(this.gameinfo.bracketGame)),e,t,a,this.settings.size,this.settings.eliminationType)},confirmCompletedHandler(e){this.gamesheet.throws[e].completed=!0},setCurrentThrowNr(){this.nextPoint(this.players[0])?this.currentThrowNr=this.nextPoint(this.players[0]):this.currentThrowNr=this.totalThrows},deathThrowToTrue(){this.deathThrow=!0},refreshInactive(){this.inactive=!1},setInactivity(){this.inactive=!0},setSettingsRoundOne(){this.settings.rounds=1},updateGameData(e,t){C(t,{sum:e.total}).catch(e=>{this.errorLog(e,"updateGameData")})},calculateNrThrows(){let e=0;this.isSinglePlayer&&this.gamesheet.throws.hasOwnProperty("player1")?e=Object.keys(this.gamesheet.throws.player1).length-3:this.gamesheet.throws.hasOwnProperty("player1")&&this.gamesheet.throws.hasOwnProperty("player2")&&(e=Object.keys(this.gamesheet.throws.player1).length-3,e+=Object.keys(this.gamesheet.throws.player2).length-3),e>0&&(this.throwsCount=e)},enableOvertime(){this.killshotOvertime=!0;let e=this.settings.rounds+1,t="/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game);C(B(t),{round:e}).catch(function(e){this.errorLog(e,"enableOvertime")})},exitAction(){if(console.log(this.$route.name),"practice"===this.type)"no-venue"===this.venueLocationSlug||void 0===this.venueLocationSlug?this.$router.push("/watl/profile"):this.$router.push("/"+this.venueLocationSlug+"/profile");else if("live"===this.type)this.$router.push("/live");else if(this.eventStore.selectedEvent.virtual&&this.isPublic)this.$router.push("/".concat(this.venueLocationSlug,"/virtual/view/").concat(this.eventStore.selectedEvent.slug));else if(this.isPublic&&!this.eventStore.selectedEvent.virtual)this.$router.push("/"+this.venueLocationSlug+"/league/"+this.leagueID);else{let e="Qualifying Throws"!==this.eventStore.selectedEvent.type?this.eventStore.selectedEvent.type.toLowerCase():"qualifying",t="/hosts/".concat(this.venueLocationSlug,"/").concat(e,"/").concat(this.leagueID),a=this.$route.query.activeGamesTab?"?activeGamesTab=".concat(this.$route.query.activeGamesTab,"#games"):"/#games";this.$router.push(t+a)}},goToRound(e){let t=this.round+e;"Qualifying Round"===this.settings.type&&t>this.settings.rounds?this.enableOvertime():this.killshotOvertime=!1;let a="/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game);C(B(a),{round:t}).catch(function(e){this.errorLog(e,"goToRound")}),this.setSideSwitch()},setSideSwitch(){const e=e=>{const t=this.nextPoint(e);return t>5||void 0===t};this.sidesSwitched=e(this.players[0])&&e(this.players[1])},nextPoint(e){if(void 0===this.gamesheet.throws||void 0===this.gamesheet.throws[e])return 1;{let t,a=this.killshotOvertime?this.settings.killshots:10;for(t=1;t<=a;t++)if(void 0===this.gamesheet.throws[e][this.watlRound+"throw-"+t])return t}},async createGameChat(e){const t={createdAt:(new Date).getTime(),type:"direct",participants:{[this.gameinfo.player1.playerid]:{joinedAt:(new Date).getTime(),role:"member",isActive:!1},[this.gameinfo.player2.playerid]:{joinedAt:(new Date).getTime(),role:"member",isActive:!1}}};return await this.chatStore.createChat(e,t)},handeleGameChat(e){$(q("chats/".concat(e)),async t=>{t.exists()||await this.createGameChat(e),this.chatStore.loadChat(e)},{onlyOnce:!0})},getData(e){Object.assign(this.$data,{gameSheetLoaded:!1,dblocation:"",currentThrowNr:0,throwsCount:0,allThrows:0,isSinglePlayer:!1,boardZoom:!0,defaultBoard:!1,practiceEventType:"league",showNextUp:!1,matchNumber:0,weekGames:[],gameinfo:{},schedule:[],settings:{},weekPlayers:[],deathThrow:!1,selectSuddenDeathWinner:!1,sidesSwitched:!1,inactive:!1,inactiveTimeout:!1,players:["player2","player1"],gamesheet:{round:1,throw1:{player1:"",player2:""},throw2:{player1:"",player2:""},throw3:{player1:"",player2:""},throw4:{player1:"",player2:""},throw5:{player1:"",player2:""},throw6:{player1:"",player2:""},throw7:{player1:"",player2:""},throw8:{player1:"",player2:""},throw9:{player1:"",player2:""},throw10:{player1:"",player2:""}},roundThrows:{round1:{},round2:{},round3:{}},me:null,totalThrows:10,killshotOvertime:!1,deathThrowCalled:!1,showTransition:!1,autoschedule:[],standings:[],divisions:{professional:"Pro",amateur:"Amateur",recreational:"Unsanctioned Rec",individual:"Unsanctioned Player-Depend"}});let t=V.get("defaultBoard");this.defaultBoard="true"===t,this.dblocation="/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID),this.matchNumber=this.eventStore.matchNumber,this.gamesheet.round=1,this.totalThrows=10,this.eventStore.matchNumber=1;let a=this.gameRef(e);this.$databaseBind("gamesheet",a).then(()=>{let t;this.gameSheetLoaded=!0,this.sidesSwitched=!!this.gamesheet.switchSide,this.sidesSwitched&&this.players.reverse(),this.gamesheet.player2?this.me=this.gamesheet.player1.playerid===this.userStore.user[".key"]?this.gamesheet.player1.playerid:this.gamesheet.player2.playerid:this.me=this.gamesheet.player1.playerid,this.isBestOfX>1&&this.getBestXWinner(),void 0===this.gamesheet.player2&&(this.players=["player1"],this.isSinglePlayer=!0),["player1","player2"].forEach(e
1=>{if(this.gamesheet.throws[e])for(let t in this.gamesheet.throws[e])-1!==t.indexOf("throw")&&this.throwsCount++}),"practice"!==this.type&&"live"!==this.type&&this.eventStore.setSelectedEventGamesheet({venue:this.venueLocationSlug,leagueID:this.leagueID,type:this.isLeague?"league":"tournament"}),t=this.isPracticeOrLiveGameType?E("/venues/".concat(this.venueLocationSlug,"/practice/game-list/").concat(this.game)):B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-list/").concat(e||this.game)),this.$databaseBind("gameinfo",t).then(()=>{this.$databaseBind("settings",B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/settings"))).then(()=>{var e;(null==(e=this.gameinfo)?void 0:e.gameChatId)&&this.handeleGameChat(this.gameinfo.gameChatId),this.allThrows=this.players.length*this.settings.rounds*this.totalThrows,this.calculateNrThrows(),this.gamesheet.round>this.settings.rounds&&this.enableOvertime()}),this.isBestOfX>1&&this.getBestXWinner()}),this.$databaseBind("weekGames",B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-list"))),this.$databaseBind("schedule",B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/schedule"))).then(e=>{e||(this.schedule={})}),this.$databaseBind("weekPlayers",_(B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/players")),F()))}),this.getAutoschedule(),this.$databaseBind("standings",_(B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/standings"))))},deathThrowSwitch(e){this.selectSuddenDeathWinner=!0===e;let t=this.gameRef();C(t,{deathThrow:this.selectSuddenDeathWinner}).catch(function(e){this.errorLog(e,"deathThrowSwitch")})},selectWinner(e){if(this.isBestOfX>1){this.deathThrow=!1,this.deathThrowSwitch(!1),this.playerGameStats[e]["tieWon"+this.round]=!0;const t="/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/throws/").concat(e);C(B(t),{["tieWon"+this.round]:!0}).catch(function(e){this.errorLog(e,"selectWinner")}),this.evenRoundsSuddenThrow&&(this.updateWinner(e,!0),this.evenRoundsSuddenThrow=!1),this.getBestXWinner()}else"player1"===e?(this.playerGameStats.player1.win=1,this.playerGameStats.player2.win=0):(this.playerGameStats.player2.win=1,this.playerGameStats.player1.win=0),this.deathThrow=!1,this.deathThrowSwitch(!1),this.deathThrowCalled=!0,this.updateWinner(e,!0)},updateWinner(e){if(this.isSinglePlayer)return;let t=this.gameRef();C(t,{winner:e}).catch(function(e){console.error("Error updating the winner player: ",e),this.errorLog(e,"updateWinner")})},updatePlayerThrowStatus(e,t){let a;this.gamesheet.throws[e].completed=t,void 0!==this.gamesheet.throws.player2?!0===this.gamesheet.throws.player1.completed&&!0===this.gamesheet.throws.player2.completed&&this.getWinner():!0===this.gamesheet.throws.player1.completed&&this.getWinner(),a=this.isPracticeOrLiveGameType?E("/venues/".concat(this.venueLocationSlug,"/practice/game-data/").concat(this.game,"/throws/").concat(e)):B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/throws/").concat(e)),C(a,{completed:t}).catch(function(e){this.errorLog(e,"updatePlayerThrowStatus")})},getBestXWinner(){let e={round1:!1,round2:!1,round3:!1,round4:!1,round5:!1,round6:!1};for(let s=0;s<=6;s++)e["round"+s]=10===this.getThrowsPerRounds.player1["round"+s]&&10===this.getThrowsPerRounds.player2["round"+s];let t=0,a=0;for(let s=1;s<=6;s++)e["round"+s]&&((this.sumScores.player1["total"+s]>this.sumScores.player2["total"+s]||this.gamesheet.throws.player1["tieWon"+s])&&t++,(this.sumScores.player1["total"+s]<this.sumScores.player2["total"+s]||this.gamesheet.throws.player2["tieWon"+s])&&a++);
1if(this.isSinglePlayer&&Object.keys(this.gamesheet.throws.player1).length-2===this.settings.rounds*this.totalThrows)return this.updateWinner("player1",!0),"player1";if(void 0!==this.settings.rounds)if(2===this.settings.rounds&&1===t&&1===a&&(this.deathThrow=!0,this.evenRoundsSuddenThrow=!0),4===this.settings.rounds&&2===t&&2===a&&(this.deathThrow=!0,this.evenRoundsSuddenThrow=!0),4===this.settings.rounds){if(t>=3&&4===this.settings.rounds)return this.updateWinner("player1",!0),"player1";if(a>=3&&4===this.settings.rounds)return this.updateWinner("player2",!0),"player2"}else{if(t>=2)return this.updateWinner("player1",!0),"player1";if(a>=2)return this.updateWinner("player2",!0),"player2"}else{if(t>=2)return this.updateWinner("player1",!0),"player1";if(a>=2)return this.updateWinner("player2",!0),"player2"}},getWinner(){if(1===this.isBestOfX){if(void 0!==this.sumScores){let e="none";this.sumScores.player1.total>this.sumScores.player2.total?(e="player1",this.updateWinner(e,!0)):this.sumScores.player1.total<this.sumScores.player2.total?(e="player2",this.updateWinner(e,!0)):(this.deathThrow=!0,this.gamesheet.deathThrow=!0,void 0===this.gamesheet.player2&&this.updateWinner("player1",!0))}}else this.sumScores.player1["total"+this.round]===this.sumScores.player2["total"+this.round]?this.gamesheet.throws.player1["tieWon"+this.round]||this.gamesheet.throws.player2["tieWon"+this.round]||(this.deathThrow=!0):this.getBestXWinner()},availableMatches(){return this.weekGames.filter(e=>"completed"!==e.status.toLowerCase()).length}},watch:{playersThrows:function(e,t){var a,s;if(this.gameWithBot){const t="axe_bot"===(null==(s=null==(a=this.gameinfo)?void 0:a.player1)?void 0:s.playerid)?"player1":"player2",o="player1"===t?"player2":"player1";Object.keys(e[o]||{}).forEach(a=>{a.includes("throw")&&!e[t][a]&&setTimeout(()=>{let e=a.slice(-1);const s=this.gamesheet.round1[o]["killcall".concat(e,"th")];this.setBotThrow(s,a,t)},400)})}},sumScores(e){for(let[t,a]of Object.entries(e)){let e;e=this.isPracticeOrLiveGameType?E("/venues/".concat(this.venueLocationSlug,"/practice/game-data/").concat(this.game,"/throws/").concat(t)):B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/throws/").concat(t)),this.updateGameData(a,e)}},throwsCount(e,t){const a=B("/venues/".concat(this.venueLocationSlug,"/league/").concat(this.leagueID,"/").concat(this.seasonID,"/").concat(this.weekID,"/game-data/").concat(this.game,"/round").concat(this.round));e>t&&[1,21,41,61,81].includes(e)&&!this.gamesheet["round".concat(this.round)].start&&C(a,{start:(new Date).toISOString()}).catch(function(e){this.errorLog(e,"updateWinner")});const s=this.players.length;e>t&&e===this.round*this.totalThrows*s&&(this.updatePlayersRoundScoreSum(),this.gamesheet["round".concat(this.round)].end||C(a,{end:(new Date).toISOString()}).catch(function(e){this.errorLog(e,"updateWinner")}))},settings(e){null===e?this.settings={}:Object.keys(e).length&&e.type&&"Qualifying Round"===e.type&&(this.eventStore.selectedEvent.type||this.eventStore.setSelectedEventGamesheet({venue:"watl",leagueID:this.leagueID,type:"qualifying"}))},"$route.params":function(e){this.getData(e.game)},gamesheet:{deep:!0,handler:function(e){e&&(this.roundThrows["round".concat(e.round)]=e.throws)}},showNextUp(){let e=this;if(e.settings&&"Qualifying Round"===e.settings.type){let t=e.availableMatches();!0===e.showNextUp&&t>0?(e.deathThrowSwitch(!1),e.deathThrow=!1,e.sidesSwitched=!1,e.deathThrowCalled=!1,e.throwsDone=!1,e.overtimeDone=!1,e.killshotOvertime=!1):e.exitAction()}else!0===e.showNextUp&&(e.deathThrowSwitch(!1),e.deathThrow=!1,e.sidesSwitched=!1,e.deathThrowCalled=!1,e.throwsDone=!1,e.overtimeDone=!1,e.killshotOvertime=!1)},defaultBoard(){V.set("defaultBoard",this.defaultBoard)},notPlayedAutoschedule(e){e.length||this.setAutoschedule()}},mounted(){void 0!==this.venueStore.venue.locationSlug&&this.getData()}},[["render",function(e,t,a,s,o,n){var i;const l=h("hatchet-top-panel"),r=h("v-icon"),c=h("v-btn"),u=h("v-progress-circular"),g=h("hatchet-main-panel"),S=h("v-toolbar-title"),k=h("v-spacer"),T=h("v-toolbar"),b=h("matchups"),D=h("v-container"),I=h("v-card-text"),P=h("v-card"),O=h("v-dialog"),B=h("chat-modal");return e.gameSheetLoaded?(p(),d("div",Ct,[m(l,{rules:a.rules,type:a.type,isPublic:n.isPublic,throwsDone:n.throwsDone,overtimeDone:n.overt
1imeDone,isSinglePlayer:e.isSinglePlayer,isLeague:n.isLeague,defaultBoard:e.defaultBoard,isPracticeOrLiveGameType:n.isPracticeOrLiveGameType,inactive:e.inactive,killshotOvertime:e.killshotOvertime,settings:e.settings,gamesheet:e.gamesheet,gameinfo:e.gameinfo,playerGameStats:n.playerGameStats,sumScores:n.sumScores,isBestOfX:n.isBestOfX,round:n.round,game:a.game,leagueID:a.leagueID,seasonID:a.seasonID,weekID:a.weekID,players:e.players,practiceEventType:e.practiceEventType,onEnableOvertime:n.enableOvertime,onGoToRound:n.goToRound,onShowNextUp:t[0]||(t[0]=e=>this.showNextUp=e),onExitAction:n.exitAction,onDeclareWinner:n.declareWinnerHandler,onCheckAccolades:n.checkAccoladesHandler,onDeathThrowCalled:t[1]||(t[1]=e=>this.deathThrowCalled=e),onSetDefaultBoard:t[2]||(t[2]=e=>this.defaultBoard=e),onSetEventType:t[3]||(t[3]=e=>this.practiceEventType=e),onRemovePlayer2:t[4]||(t[4]=t=>(e.players=["player1"],e.isSinglePlayer=!0))},null,8,["rules","type","isPublic","throwsDone","overtimeDone","isSinglePlayer","isLeague","defaultBoard","isPracticeOrLiveGameType","inactive","killshotOvertime","settings","gamesheet","gameinfo","playerGameStats","sumScores","isBestOfX","round","game","leagueID","seasonID","weekID","players","practiceEventType","onEnableOvertime","onGoToRound","onExitAction","onDeclareWinner","onCheckAccolades"]),n.showTournamentDivision?(p(),d("div",Et," This game is playing with "+N(e.divisions[s.eventStore.selectedEvent.divisionRuleset])+" division ruleset ",1)):w("",!0),w("",!0),e.gamesheet["round"+n.round]?(p(),v(g,{key:3,rules:a.rules,gameinfo:e.gameinfo,type:a.type,players:e.players,isSinglePlayer:e.isSinglePlayer,settings:e.settings,isLeague:n.isLeague,gamesheet:e.gamesheet,defaultBoard:e.defaultBoard,sumScores:n.sumScores,isBestOfX:n.isBestOfX,round:n.round,throwsCount:e.throwsCount,roundThrows:e.roundThrows,killshotOvertime:e.killshotOvertime,isPracticeOrLiveGameType:n.isPracticeOrLiveGameType,sidesSwitched:e.sidesSwitched,overtimeDone:n.overtimeDone,deathThrowCalled:e.deathThrowCalled,deathThrow:e.deathThrow,selectSuddenDeathWinner:e.selectSuddenDeathWinner,isPublic:n.isPublic,totalThrows:e.totalThrows,watlRound:n.watlRound,game:a.game,leagueID:a.leagueID,seasonID:a.seasonID,weekID:a.weekID,practiceEventType:e.practiceEventType,currentThrowNr:n.currentThrow,onGoToRound:n.goToRound,onIncreaseThrowsCount:t[6]||(t[6]=t=>e.throwsCount++),onDecreaseThrowsCount:t[7]||(t[7]=t=>e.throwsCount--),onConfirmCompletedStatus:n.confirmCompletedHandler,onUpdatePlayerThrowStatus:n.updatePlayerThrowStatus,onResetDeathThrow:t[8]||(t[8]=t=>e.deathThrow=!1),onDeathThrowSwitch:n.deathThrowSwitch,onUpdateWinner:n.updateWinner,onSetDeathThrowCalled:t[9]||(t[9]=e=>this.deathThrowCalled=e),onReversePlayers:t[10]||(t[10]=()=>e.players.reverse()),onSelectWinner:n.selectWinner,onAddKillshotSide:n.addKillshotSideHandler,onPlayerClick:n.playerClickHandler},null,8,["rules","gameinfo","type","players","isSinglePlayer","settings","isLeague","gamesheet","defaultBoard","sumScores","isBestOfX","round","throwsCount","roundThrows","killshotOvertime","isPracticeOrLiveGameType","sidesSwitched","overtimeDone","deathThrowCalled","deathThrow","selectSuddenDeathWinner","isPublic","totalThrows","watlRound","game","leagueID","seasonID","weekID","practiceEventType","currentThrowNr","onGoToRound","onConfirmCompletedStatus","onUpdatePlayerThrowStatus","onDeathThrowSwitch","onUpdateWinner","onSelectWinner","onAddKillshotSide","onPlayerClick"])):(p(),d("div",_t,[m(u,{size:50,color:"primary",indeterminate:""})])),m(O,{fullscreen:"",transition:"dialog-bottom-transition",scrollable:"",modelValue:e.showNextUp,"onUpdate:modelValue":t[14]||(t[14]=t=>e.showNextUp=t)},{default:y(()=>[m(P,{tile:""},{default:y(()=>[m(T,null,{default:y(()=>[m(c,{icon:"",dark:"",onClick:t[11]||(t[11]=t=>e.showNextUp=!1)},{default:y(()=>[m(r,null,{default:y(()=>[...t[16]||(t[16]=[f("mdi-close",-1)])]),_:1})]),_:1}),m(S,null,{default:y(()=>[...t[17]||(t[17]=[f("Select Next Match",-1)])]),_:1}),m(k),m(c,{dark:"",color:"primary",onClick:t[12]||(t[12]=t=>e.showNextUp=!1)},{default:y(()=>[...t[18]||(t[18]=[f("Close",-1)])]),_:1})]),_:1}),m(I,{id:"nextUp",style:{height:"100%","-webkit-overflow-scrolling":"touch"}},{default:y(()=>[m(D,null,{default:y(()=>[m(b,{standings:e.standings,gameList:e.weekGames,roundrobin:"Round Robin"!==e.settings.type||s.eventStore.selectedEvent.virtual?"":n.notPlayedAutoschedule,dblocation:"league/"+a.leagueID+"/"+a.seasonID+"/"+a.weekID,dbScheduleLocation:"league/"+a.leagueID+"/"+a.seasonID,schedule:e.schedule,matchSelect:e.gameinfo.arena,view:"dialog",leagueType:n.generalLeagueType,onCloseNextUp:t[13]||(t[13]=t=>e.showNextUp=!1)},null,8,["standings","gameList","roundrobin","dblocation","dbScheduleLocation","schedule","matchSelect","leagueType"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),a.game?(p(),d("div",Rt,N(new Date(e.keyTimestamp(a.game)).toLocaleDateString("en-US",{timeZone:"America/Ne
1w_York"}))+" - "+N(new Date(e.keyTimestamp(a.game)).toLocaleTimeString("en-US",{timeZone:"America/New_York"})),1)):w("",!0),m(B,{showChatButton:n.chatIsAvailable,chatId:null==(i=e.gameinfo)?void 0:i.gameChatId,currentUserId:s.userStore.user[".key"],members:n.gameChatMembers},null,8,["showChatButton","chatId","currentUserId","members"])])):w("",!0)}],["__scopeId","data-v-62ba805e"]]);export{xt as default};

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.