import{T as P}from"./TouchPan-B3Sz8bhd.js";import{_ as y,a as x}from"./dartBoard-Dnsy9UQ7.js";import{r as m,L as T,D as S,M as v,p as R,O as w,P as o,N}from"./index-CoQ-x5A8.js";import"./selection-BGkpRqCo.js";const k={class:"dartBoardDiv"},q={__name:"testDartPickerPage",setup(E){const l=m({top:null,left:null}),f=m({top:null,left:null}),g=m(null),s=m(null),h=m(null),t=m(null),u=m({id:null,name:null,points:null}),d={0:{name:"Bulls Eye",points:50},1:{name:"Bull",points:25},100:{name:"20",points:20},101:{name:"1",points:1},102:{name:"18",points:18},103:{name:"4",points:4},104:{name:"13",points:13},105:{name:"6",points:6},106:{name:"10",points:10},107:{name:"15",points:15},108:{name:"2",points:2},109:{name:"17",points:17},110:{name:"3",points:3},111:{name:"19",points:19},112:{name:"7",points:7},113:{name:"16",points:16},114:{name:"8",points:8},115:{name:"11",points:11},116:{name:"14",points:14},117:{name:"9",points:9},118:{name:"12",points:12},119:{name:"5",points:5},200:{name:"Trebel 20",points:20},201:{name:"Trebel 1",points:1},202:{name:"Trebel 18",points:18},203:{name:"Trebel 4",points:4},204:{name:"Trebel 13",points:13},205:{name:"Trebel 6",points:6},206:{name:"Trebel 10",points:10},207:{name:"Trebel 15",points:15},208:{name:"Trebel 2",points:2},209:{name:"Trebel 17",points:17},210:{name:"Trebel 3",points:3},211:{name:"Trebel 19",points:19},212:{name:"Trebel 7",points:7},213:{name:"Trebel 16",points:16},214:{name:"Trebel 8",points:8},215:{name:"Trebel 11",points:11},216:{name:"Trebel 14",points:14},217:{name:"Trebel 9",points:9},218:{name:"Trebel 12",points:12},219:{name:"Trebel 5",points:5},300:{name:"20",points:20},301:{name:"1",points:1},302:{name:"18",points:18},303:{name:"4",points:4},304:{name:"13",points:13},305:{name:"6",points:6},306:{name:"10",points:10},307:{name:"15",points:15},308:{name:"2",points:2},309:{name:"17",points:17},310:{name:"3",points:3},311:{name:"19",points:19},312:{name:"7",points:7},313:{name:"16",points:16},314:{name:"8",points:8},315:{name:"11",points:11},316:{name:"14",points:14},317:{name:"9",points:9},318:{name:"12",points:12},319:{name:"5",points:5},400:{name:"Double 20",points:20},401:{name:"Double 1",points:1},402:{name:"Double 18",points:18},403:{name:"Double 4",points:4},404:{name:"Double 13",points:13},405:{name:"Double 6",points:6},406:{name:"Double 10",points:10},407:{name:"Double 15",points:15},408:{name:"Double 2",points:2},409:{name:"Double 17",points:17},410:{name:"Double 3",points:3},411:{name:"Double 19",points:19},412:{name:"Double 7",points:7},413:{name:"Double 16",points:16},414:{name:"Double 8",points:8},415:{name:"Double 11",points:11},416:{name:"Double 14",points:14},417:{name:"Double 9",points:9},418:{name:"Double 12",points:12},419:{name:"Double 5",points:5}};function B(a,i,c,b){const n=c-a,r=b-i;return Math.sqrt(n*n+r*r)}function _(a,i,c,b){let n=Math.atan2(b-i,c-a)*(180/Math.PI);return n=n-90+18/2,n<0&&(n+=360),n}function M({position:a,isFinal:i}){l.value.top=a.top+-50,l.value.left=a.left;const n=document.getElementById("dartBoard").getBoundingClientRect(),r=n.top+n.height/2,D=n.left+n.width/2;f.value.top=Math.round(a.top-r+-50),f.value.left=Math.round(a.left-D);const p=B(l.value.left,l.value.top,D,r);if(h.value=_(l.value.left,l.value.top,D,r),t.value=Math.floor(h.value/18),p<n.height/2){g.value=p;var e;p<n.height/45?(s.value=0,e=String(0)):p<n.height/20?(s.value=1,e=String(1)):p<n.height/3.5?(s.value=2,e=String(1),t.value<10&&(e=e+String(0)),e=e+String(t.value)):p<n.height/3.2?(s.value=3,e=String(2),t.value<10&&(e=e+String(0)),e=e+String(t.value)):p<n.height/2.16?(s.value=4,e=String(3),t.value<10&&(e=e+String(0)),e=e+String(t.value)):p<n.height&&(s.value=5,e=String(4),t.value<10&&(e=e+String(0)),e=e+String(t.value)),u.value.id=e,u.value.name=d[Number(e)].name,u.value.points=d[Number(e)].points}else g.value=null,s.value=null;i&&console.log("end")}return(a,i)=>(S(),T(N,null,[v("img",{src:y,class:"dart",style:w({top:l.value.top+"px",left:l.value.left+"px"})},null,4),R((S(),T("div",k,[v("p",null,"X: "+o(f.value.top)+" | Y: "+o(f.value.left),1),v("p",null,"distance: "+o(g.value)+" | dartRing: "+o(s.value),1),v("p",null,"degrees: "+o(h.value)+"° | field: "+o(t.value),1),v("p",null,"id: "+o(u.value.id)+" | name: "+o(u.value.name)+" | points: "+o(u.value.points),1),i[0]||(i[0]=v("img",{id:"dartBoard",class:"dartBoard",src:x},null,-1))])),[[P,M,void 0,{prevent:!0,mouse:!0}]])],64))}};export{q as default};
