(function(){"use strict";var t={3804:function(t,e,a){var r=a(6369),n=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"app"}},[e("Navigation"),e("router-view")],1)},s=[],o=function(){var t=this;t._self._c;return t._m(0)},i=[function(){var t=this,e=t._self._c;return e("ul",{staticClass:"navigation"},[e("li",[e("a",{staticClass:"active",attrs:{href:"#home"}},[t._v("Forside")])]),e("li",[e("a",{attrs:{href:"https://isdragen.dk/tournament/"}},[t._v("Tournament")])]),e("li",[e("a",{attrs:{href:"https://isdragen.dk/poll/index.php"}},[t._v("Afstemning")])])])}],l={name:"Navigation-component",components:{},props:{},methods:{}},u=l,d=a(3736),p=(0,d.Z)(u,o,i,!1,null,null,null),c=p.exports,h={name:"App",components:{Navigation:c},data(){return{}},methods:{}},g=h,f=(0,d.Z)(g,n,s,!1,null,null,null),m=f.exports,v=a(2631),b=function(){var t=this,e=t._self._c;return e("div",[e("img",{attrs:{src:a(7146)}}),t._v(" "),e("br"),e("b-container",{staticClass:"center"},[e("b-row",[e("b-col",{attrs:{cols:"12",sm:"6",lg:"6"}},[e("GroupDropdown",{attrs:{groupid:t.groupid},on:{"group-change":t.selectGroup}})],1),e("b-col",{attrs:{cols:"12",sm:"6",lg:"6"}},[e("DateSelect",{attrs:{date:t.date,groupid:t.groupid},on:{"date-change":t.selectDate}})],1)],1)],1),e("Highscore",{attrs:{date:t.date,groupid:t.groupid}}),e("GameView",{attrs:{date:t.date,groupid:t.groupid}}),e("br"),e("Bubble",{staticStyle:{display:"none"}})],1)},y=[],w=function(){var t=this,e=t._self._c;return e("div",{staticClass:"highscore"},[e("GoodTable",{attrs:{rows:t.rows}})],1)},_=[],C=function(){var t=this,e=t._self._c;return e("div",[e("vue-good-table",{attrs:{columns:t.columns,rows:t.rows}})],1)},k=[],O={name:"good-table",data(){return{columns:[{label:"Player",field:"player"},{label:"Score",field:"score",type:"number"},{label:"Plays",field:"plays"},{label:"Wins",field:"wins"},{label:"Wins percent",field:"wins_percent",type:"percentage"}]}},props:{rows:{type:Array}}},Z=O,D=(0,d.Z)(Z,C,k,!1,null,null,null),x=D.exports,S=a(6943),j={name:"Highscore-component",components:{GoodTable:x},data(){return{rows:[]}},props:{date:{type:String,default:""},groupid:{type:String}},watch:{date:function(t,e){t!=e&&this.getData()},groupid:function(t,e){t!=e&&this.getData()}},created:function(){this.getData()},methods:{getData(){""!=this.date&&0!=this.date&&""!=this.groupid&&0!=this.groupid?S.Z.get("https://isdragen.dk/php/gettopplayers.php?date="+this.date+"&group="+this.groupid).then((t=>{this.rows=Object.values(t.data)})):""!=this.date&&0!=this.date?S.Z.get("https://isdragen.dk/php/gettopplayers.php?date="+this.date).then((t=>{this.rows=Object.values(t.data)})):""!=this.groupid&&0!=this.groupid?S.Z.get("https://isdragen.dk/php/gettopplayers.php?group="+this.groupid).then((t=>{this.rows=Object.values(t.data)})):S.Z.get("https://isdragen.dk/php/gettopplayers.php").then((t=>{this.rows=Object.values(t.data)}))}}},A=j,N=(0,d.Z)(A,w,_,!1,null,"51502b63",null),P=N.exports,B=function(){var t=this,e=t._self._c;return e("div",[e("b-container",{staticClass:"game-view"},[e("b-row",t._l(t.games,(function(t){return e("b-col",{key:t.boardgame,staticClass:"game-col",attrs:{cols:"12",sm:"6",lg:"6"}},[e("img",{staticClass:"boardgame_image",attrs:{src:t.img,alt:t.name}}),e("Game",{attrs:{name:t.boardgame,data:t.playerscores}})],1)})),1)],1)],1)},T=[],E=function(){var t=this,e=t._self._c;return e("div",[e("Bar",{attrs:{label:t.label,data:t.scores,labels:t.playernames}})],1)},G=[],I=function(){var t=this,e=t._self._c;return e("Bar",{attrs:{"chart-options":t.chartOptions,"chart-data":t.chartData,"chart-id":t.chartId,"dataset-id-key":t.datasetIdKey,plugins:t.plugins,"css-classes":t.cssClasses,styles:t.styles,width:t.width,height:t.height}})},L=[],F=a(4483),$=a(741);$.kL.register($.Dx,$.u,$.De,$.ZL,$.uw,$.f$);var K={name:"BarChart",components:{Bar:F.$Q},props:{chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},width:{type:Number,default:400},height:{type:Number,default:400},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]},data:{type:Array},label:{type:String},labels:{type:Array},color:{type:String,default:"#f87979"}},data(){return{chartData:{labels:this.labels,datasets:[{data:this.data,label:this.label,backgroundColor:this.color}]},chartOptions:{responsive:!0,maintainAspectRatio:!1}}}},H=K,V=(0,d.Z)(H,I,L,!1,null,null,null),q=V.exports,M={name:"game-view",components:{Bar:q},data(){return{scores:[],playernames:[],chartData:null,labels:[],label:null,backgroundColor:"#f87979",highscoreData:null,rows:[],games:[]}},props:{data:{type:Array,require:!0},name:{type:String}},methods:{},created:function(){this.playernames=[],this.scores=[];var t=0;this.data.forEach((e=>{this.playernames[t]=e.name+"("+e.plays+") ["+e.wins+"]",this.scores[t]=e.score,t++})),this.label=this.name}},R=M,W=(0,d.Z)(R,E,G,!1,null,null,null),Q=W.exports,U={name:"game-view",components:{Game:Q},data(){return{games:[]}},props:{date:{type:String,default:""},groupid:{type:String}},watch:{date:function(t,e){t!=e&&this.getData()},groupid:function(t,e){t!=e&&this.getData()}},created:function(){this.getData()},methods:{getData(){this.games=[],""!=this.date&&0!=this.date&&""!=this.groupid&&0!=this.groupid?S.Z.get("https://isdragen.dk/php/getboardsbestplayers.php?date="+this.date+"&group="+this.groupid).then((t=>{this.games=Object.values(t.data)})):""!=this.date&&0!=this.date?S.Z.get("https://isdragen.dk/php/getboardsbestplayers.php?date="+this.date).then((t=>{this.games=Object.values(t.data)})):""!=this.groupid&&0!=this.groupid?S.Z.get("https://isdragen.dk/php/getboardsbestplayers.php?group="+this.groupid).then((t=>{this.games=Object.values(t.data)})):S.Z.get("https://isdragen.dk/php/getboardsbestplayers.php").then((t=>{this.games=Object.values(t.data)}))}}},z=U,J=(0,d.Z)(z,B,T,!1,null,"e1634ca4",null),X=J.exports,Y=function(){var t=this,e=t._self._c;return e("Bubble",{attrs:{"chart-options":t.chartOptions,"chart-data":t.chartData,"chart-id":t.chartId,"dataset-id-key":t.datasetIdKey,plugins:t.plugins,"css-classes":t.cssClasses,styles:t.styles,width:t.width,height:t.height}})},tt=[];$.kL.register($.Dx,$.u,$.De,$.od,$.f$);var et={name:"BubbleChart",components:{Bubble:F.xj},props:{chartId:{type:String,default:"bubble-chart"},datasetIdKey:{type:String,default:"label"},width:{type:Number,default:400},height:{type:Number,default:400},cssClasses:{default:"",type:String},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},data(){return{chartData:{datasets:[{label:"Data One",backgroundColor:"#f87979",data:[{x:20,y:25,r:5},{x:40,y:10,r:10},{x:30,y:22,r:30}]},{label:"Data Two",backgroundColor:"#7C8CF8",data:[{x:10,y:30,r:15},{x:20,y:20,r:10},{x:15,y:8,r:30}]}]},chartOptions:{responsive:!0,maintainAspectRatio:!1}}}},at=et,rt=(0,d.Z)(at,Y,tt,!1,null,null,null),nt=rt.exports,st=function(){var t=this,e=t._self._c;return e("div",{staticClass:"select"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.selected,expression:"selected"}],staticClass:"standard-select",on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.selected=e.target.multiple?a:a[0]},function(e){return t.onChange(e)}]}},[e("option",{attrs:{disabled:"",value:""}},[t._v("Vælg gruppe")]),t._l(t.groups,(function(a){return e("option",{key:a.id,domProps:{value:a.id}},[t._v(t._s(a.name))])})),e("option",{attrs:{value:"0"}},[t._v("Alle grupper")])],2)])},ot=[],it={name:"group-dropdown",components:{},data(){return{groups:[],selected:""}},props:{groupid:{type:String,default:"0"}},methods:{onChange(t){this.$emit("group-change",t.target.value),console.log("Emit: "+t.target.value)}},created:function(){this.selected=this.groupid,S.Z.get("https://isdragen.dk/php/getinfo_groups.php").then((t=>{var e=Object.values(t.data);this.groups=e}))}},lt=it,ut=(0,d.Z)(lt,st,ot,!1,null,"fddffbe0",null),dt=ut.exports,pt=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"select"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.selected,expression:"selected"}],staticClass:"standard-select",on:{change:[function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.selected=e.target.multiple?a:a[0]},function(e){return t.onChange(e)}]}},[e("option",{attrs:{disabled:"",value:""}},[t._v("Vælg dato")]),t._l(t.dates,(function(a){return e("option",{key:a.date,domProps:{value:a.date}},[t._v(t._s(a.date))])})),e("option",{attrs:{value:"0"}},[t._v("Alle datoer")])],2)])])},ct=[],ht={name:"date-dropdown",components:{},data(){return{dates:[],selected:""}},props:{date:{type:String,default:""},groupid:{type:String,default:"0"}},watch:{groupid:function(t,e){t!=e&&this.getData()}},methods:{onChange(t){this.$emit("date-change",t.target.value)},getData(){console.log("test"),this.selected=this.date,S.Z.get("https://isdragen.dk/php/getinfo_dates.php?group="+this.groupid).then((t=>{null!=t.data?this.dates=Object.values(t.data):(console.log("No dates"),this.dates=[])}))}},created:function(){this.getData()}},gt=ht,ft=(0,d.Z)(gt,pt,ct,!1,null,"5da82d48",null),mt=ft.exports,vt={name:"App",components:{Highscore:P,Bubble:nt,GameView:X,GroupDropdown:dt,DateSelect:mt},data(){return{groupid:"1",date:""}},methods:{selectGroup(t){this.groupid=t},selectDate(t){this.date=t,S.Z.get("https://isdragen.dk/php/getboardsbestplayers.php?date="+t).then((t=>{var e=Object.values(t.data);this.dates=e}))}}},bt=vt,yt=(0,d.Z)(bt,b,y,!1,null,null,null),wt=yt.exports;r.ZP.use(v.ZP);let _t=[{path:"/admin",name:"admin",component:()=>a.e(443).then(a.bind(a,701))},{path:"/",component:wt}];const Ct=new v.ZP({base:"/",routes:_t});var kt=Ct,Ot=a(503),Zt=(a(3586),a(7024),a(8625)),Dt=a(3494),xt=a(7749),St=a(8539);r.ZP.use(Zt.A6),Dt.vI.add(St.BC0),r.ZP.component("font-awesome-icon",xt.GN),r.ZP.config.productionTip=!1,r.ZP.use(Ot.Z),new r.ZP({render:t=>t(m),router:kt}).$mount("#app")},7146:function(t,e,a){t.exports=a.p+"img/banner.2582a7ec.jpg"}},e={};function a(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,a),s.exports}a.m=t,function(){var t=[];a.O=function(e,r,n,s){if(!r){var o=1/0;for(d=0;d<t.length;d++){r=t[d][0],n=t[d][1],s=t[d][2];for(var i=!0,l=0;l<r.length;l++)(!1&s||o>=s)&&Object.keys(a.O).every((function(t){return a.O[t](r[l])}))?r.splice(l--,1):(i=!1,s<o&&(o=s));if(i){t.splice(d--,1);var u=n();void 0!==u&&(e=u)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[r,n,s]}}(),function(){a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,{a:e}),e}}(),function(){a.d=function(t,e){for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})}}(),function(){a.f={},a.e=function(t){return Promise.all(Object.keys(a.f).reduce((function(e,r){return a.f[r](t,e),e}),[]))}}(),function(){a.u=function(t){return"js/about.5b7c4110.js"}}(),function(){a.miniCssF=function(t){return"css/about.193aaa6d.css"}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="boardgame:";a.l=function(r,n,s,o){if(t[r])t[r].push(n);else{var i,l;if(void 0!==s)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var p=u[d];if(p.getAttribute("src")==r||p.getAttribute("data-webpack")==e+s){i=p;break}}i||(l=!0,i=document.createElement("script"),i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack",e+s),i.src=r),t[r]=[n];var c=function(e,a){i.onerror=i.onload=null,clearTimeout(h);var n=t[r];if(delete t[r],i.parentNode&&i.parentNode.removeChild(i),n&&n.forEach((function(t){return t(a)})),e)return e(a)},h=setTimeout(c.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=c.bind(null,i.onerror),i.onload=c.bind(null,i.onload),l&&document.head.appendChild(i)}}}(),function(){a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){a.p="/"}(),function(){if("undefined"!==typeof document){var t=function(t,e,a,r,n){var s=document.createElement("link");s.rel="stylesheet",s.type="text/css";var o=function(a){if(s.onerror=s.onload=null,"load"===a.type)r();else{var o=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.href||e,l=new Error("Loading CSS chunk "+t+" failed.\n("+i+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=i,s.parentNode.removeChild(s),n(l)}};return s.onerror=s.onload=o,s.href=e,a?a.parentNode.insertBefore(s,a.nextSibling):document.head.appendChild(s),s},e=function(t,e){for(var a=document.getElementsByTagName("link"),r=0;r<a.length;r++){var n=a[r],s=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(s===t||s===e))return n}var o=document.getElementsByTagName("style");for(r=0;r<o.length;r++){n=o[r],s=n.getAttribute("data-href");if(s===t||s===e)return n}},r=function(r){return new Promise((function(n,s){var o=a.miniCssF(r),i=a.p+o;if(e(o,i))return n();t(r,i,null,n,s)}))},n={143:0};a.f.miniCss=function(t,e){var a={443:1};n[t]?e.push(n[t]):0!==n[t]&&a[t]&&e.push(n[t]=r(t).then((function(){n[t]=0}),(function(e){throw delete n[t],e})))}}}(),function(){var t={143:0};a.f.j=function(e,r){var n=a.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var s=new Promise((function(a,r){n=t[e]=[a,r]}));r.push(n[2]=s);var o=a.p+a.u(e),i=new Error,l=function(r){if(a.o(t,e)&&(n=t[e],0!==n&&(t[e]=void 0),n)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;i.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",i.name="ChunkLoadError",i.type=s,i.request=o,n[1](i)}};a.l(o,l,"chunk-"+e,e)}},a.O.j=function(e){return 0===t[e]};var e=function(e,r){var n,s,o=r[0],i=r[1],l=r[2],u=0;if(o.some((function(e){return 0!==t[e]}))){for(n in i)a.o(i,n)&&(a.m[n]=i[n]);if(l)var d=l(a)}for(e&&e(r);u<o.length;u++)s=o[u],a.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return a.O(d)},r=self["webpackChunkboardgame"]=self["webpackChunkboardgame"]||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var r=a.O(void 0,[998],(function(){return a(3804)}));r=a.O(r)})();
//# sourceMappingURL=app.2215e147.js.map