PageSourceSearch

https://app.playmetrics.com/assets/v2/ManageRuleSets-Bz4WSYk4.js

js playmetrics.com collected 2026-09-24 09:43:45 UTC 4,812 bytes, 2 lines download raw bytes

1import{m as o,a as c,v as x,c as _,p as a,x as n,E as B,y as g,e as i,z as d,f as E,F as b,_ as p}from"./vendor-BlynvCoC.js";import{a as y,e as M}from"./main-Bs_lHNW0.js";import{P as I}from"./PlannerHeader-Dvw8Gdjq.js";import{C as T}from"./CreateEditRuleSetModal-XfE09mRM.js";import{_ as w}from"./config-DrDySPH_.js";import"./MultipleSelect-DQxZIp5F.js";import"./NonZeroNumberInput-BDzWAl8p.js";import"./FullScreenModal-BIJiFCA9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"c27e83a969462e61a866326f8ee6cc37a4feab4d"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1f5bd087-4011-4db4-9d07-95b169a72e1d",e._sentryDebugIdIdentifier="sentry-dbid-1f5bd087-4011-4db4-9d07-95b169a72e1d")}catch(u){}})();const L={components:{PlannerHeader:I,CreateEditRuleSetModal:T},setup(){return{toast:M()}},data(){return{league:null,ruleSets:null}},computed:{loading(){return this.league===null||this.ruleSets===null},ruleSetsByID(){return p.keyBy(this.ruleSets,"id")},divisionCountsByRuleSetID(){const e={};return this.ruleSets.forEach(t=>{e[t.id]=this.league.league_divisions.filter(u=>u.league_rule_set_id===t.id).length}),e},scoringModelsByRuleSetID(){const e={};return this.ruleSets.forEach(t=>{t.type==="points"?e[t.id]={label:"Point System",model:"Win: ".concat(t.win_value,", Tie: ").concat(t.tie_value,", Loss: ").concat(t.loss_value)}:e[t.id]={label:"Winning Percentage"}}),e}},created(){this.fetchLeague()},methods:{fetchLeague(){y().get("/club_admin/club_leagues/".concat(this.$route.params.league,"?populate=league_divisions,league_divisions:rule_set")).then(e=>{if(e.data){this.league=e.data;const t=this.league.league_divisions.reduce((u,m)=>m.rule_set?[...u,m.rule_set]:u,[]);t.length===0?this.exit():this.ruleSets=p.uniqBy(t,"id")}})},createRuleSet(){this.$refs.ruleSetModal.show()},editRuleSet(e){this.$refs.ruleSetModal.show(this.ruleSetsByID[e])},handleDeleteRuleSet(e){this.$confirm.confirm({title:"Delete Scoring Rule",message:"Deleting this rule will remove its divisions from the league standings.<br><br>Are you sure you want to delete this rule?",confirmText:"Delete Rule",type:"is-danger",icon:"exclamation-circle",onConfirm:()=>this.doDeleteRuleSet(e)})},doDeleteRuleSet(e){return y().delete("/club_admin/club_leagues/rule_sets/".concat(e)).then(t=>{t.status===200&&(this.fetchLeague(),this.toast.success("Rule Deleted"))}).catch(()=>this.toast.error("Unable to delete rule"))},modalDismissed(e={refreshData:!1}){e.refreshData&&this.fetchLeague()},exit(){this.$router.push({name:"ClubAdminLeague",params:{league:this.league.id,defaultTab:"Standings"}})}}},N={key:1},P={class:"rules-table"},A={class:"ranking-model"},V={key:0},H={class:"action-column"},$=["onClick"],F=["onClick"];function U(e,t,u,m,f,s){const S=o("spinner"),h=o("fa-icon"),D=o("b-button"),R=o("PlannerHeader"),r=o("b-table-column"),v=o("BaseTable"),k=o("CreateEditRuleSetModal");return s.loading?(c(),x(S,{key:0})):(c(),_("div",N,[a(R,{name:"Manage Scoring Rules",sticky:!0,"tool-name":f.league.name,onExit:s.exit},{ctas:n(()=>[a(D,{class:"is-primary",onClick:B(s.createRuleSet,["stop"])},{default:n(()=>[a(h,{icon:["far","plus"],style:{"margin-right":"0.5rem"}}),t[0]||(t[0]=g(" Create Rule ",-1))]),_:1},8,["onClick"])]),_:1},8,["tool-name","onExit"]),i("div",P,[a(v,{name:"ruleSets",data:f.ruleSets,"show-all":""},{default:n(()=>[a(r,{label:"Name"},{default:n(({row:l})=>[i("span",null,d(l.name),1)]),_:1}),a(r,{label:"# of Divisions"},{default:n(({row:l})=>[i("span",null,d(s.divisionCountsByRuleSetID[l.id]),1)]),_:1}),a(r,{label:"Ranking Model"},{default:n(({row:l})=>[i("div",A,[i("span",null,d(s.scoringModelsByRuleSetID[l.id].label),1),s.scoringModelsByRuleSetID[l.id].model?(c(),_("span",V,d(s.scoringModelsByRuleSetID[l.id].model),1)):E("",!0)])]),_:1}),a(r,{label:"Tiebreaker Rules"},{default:n(({row:l})=>[i("span",null,d(l.tie_breaker_order===""?"No":"Yes"),1)]),_:1}),a(r,{label:"Last Updated By"},{default:n(({row:l})=>[i("span",null,[l.last_updated_by?(c(),_(b,{key:0},[g(d(l.last_updated_by.name),1)],64)):(c(),_(b,{key:1},[g(" — ")],64))])]),_:1}),a(r,{label:"Actions"},{default:n(({row:l})=>[i("div",H,[i("a",{class:"button is-text is-small has-text-primary","aria-label":"Edit Rule Set",onClick:C=>s.editRuleSet(l.id)},[a(h,{icon:["fas","pencil"]})],8,$),i("a",{class:"button is-text is-small has-text-primary","aria-label":"Delete Rule Set",onClick:C=>s.handleDeleteRuleSet(l.id)},[a(h,{icon:["fas","trash-alt"]})],8,F)])]),_:1})]),_:1},8,["data"])]),a(k,{ref:"ruleSetModal",league:f.league,onDismissed:s.modalDismissed},null,8,["league","onDismissed"])]))}const O=w(L,[["render",U]]);export{O as default};
2//# sourceMappingURL=ManageRuleSets-Bz4WSYk4.js.map

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.