2 lines
69 KiB
JavaScript
2 lines
69 KiB
JavaScript
"use strict";(self["webpackChunkfittrackee_client"]=self["webpackChunkfittrackee_client"]||[]).push([[401],{2238:function(t,e,o){o.d(e,{Z:function(){return nt}});o(7658);var a=o(6252),n=o(3577),l=o(2262),r=o(9963),s=o(9150),i=o(2201),u=o(5801),d=o(9917),c=o(6558),p=o(8966),m=o(631),w=o(3649);const k={id:"workout-form"},_=["onSubmit"],v={class:"form-items"},f={key:0,class:"form-item-radio"},g=["checked","disabled"],y={for:"withGpx"},S=["checked","disabled"],U={for:"withoutGpx"},h={class:"form-item"},b=["disabled"],T=["value"],E={key:1,class:"form-item"},D={for:"gpxFile"},O=["disabled"],I={class:"files-help info-box"},A={key:2,class:"form-item"},C={for:"title"},R=["required","disabled"],$={key:3},N={class:"workout-date-duration"},x={class:"form-item"},z={class:"workout-date-time"},L=["disabled"],j=["disabled"],W={class:"form-item"},P=["disabled"],F=["disabled"],B=["disabled"],H={class:"workout-data"},M={class:"form-item"},q=["disabled"],Z={class:"form-item"},G=["disabled"],K={class:"form-item"},V=["disabled"],Y={class:"form-item"},X={key:1},J={key:2,class:"form-buttons"},Q=["disabled"],tt=["onClick"];var et=(0,a.aZ)({__name:"WorkoutEdition",props:{authUser:null,sports:null,isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},workout:{default:()=>({})}},setup(t){const e=t,{t:o}=(0,s.QT)(),et=(0,d.o)(),ot=(0,i.tv)(),{authUser:at,workout:nt,isCreation:lt,loading:rt}=(0,l.BK)(e),st=(0,a.Fl)((()=>(0,m.xH)(e.sports,o,"is_active_for_user",nt.value.id?[nt.value.sport_id]:[]))),it=(0,a.Fl)((()=>et.getters[u.SY.GETTERS.APP_CONFIG])),ut=it.value.max_single_file_size?(0,p.Z)(it.value.max_single_file_size):"",dt=it.value.gpx_limit_import,ct=it.value.max_zip_file_size?(0,p.Z)(it.value.max_zip_file_size):"",pt=(0,a.Fl)((()=>et.getters[u.SY.GETTERS.ERROR_MESSAGES])),mt=(0,l.qj)({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:"",workoutAscent:"",workoutDescent:""}),wt=(0,l.iH)(e.workout.id?e.workout.with_gpx:e.isCreation);let kt=null;const _t=(0,l.iH)(!1),vt=(0,l.iH)([]);function ft(t){mt.notes=t}function gt(){wt.value=!wt.value,_t.value=!1}function yt(t){t.target.files&&(kt=t.target.files[0])}function St(t){if(mt.sport_id=`${t.sport_id}`,mt.title=t.title,mt.notes=t.notes,!t.with_gpx){const o=(0,c.Jo)((0,c.eB)(t.workout_date,e.authUser.timezone),"yyyy-MM-dd"),a=t.duration.split(":");mt.workoutDistance=`${at.value.imperial_units?(0,w.sC)(t.distance,"km","mi",3):parseFloat(t.distance.toFixed(3))}`,mt.workoutDate=o.workout_date,mt.workoutTime=o.workout_time,mt.workoutDurationHour=a[0],mt.workoutDurationMinutes=a[1],mt.workoutDurationSeconds=a[2],mt.workoutAscent=null===t.ascent?"":`${at.value.imperial_units?(0,w.sC)(t.ascent,"m","ft",2):parseFloat(t.ascent.toFixed(2))}`,mt.workoutDescent=null===t.descent?"":`${at.value.imperial_units?(0,w.sC)(t.descent,"m","ft",2):parseFloat(t.descent.toFixed(2))}`}}function Ut(){return vt.value.includes("workouts.INVALID_DISTANCE")}function ht(){return vt.value.includes("workouts.INVALID_DURATION")}function bt(){return vt.value.includes("workouts.INVALID_ASCENT_OR_DESCENT")}function Tt(t){vt.value=[],t.title=mt.title,t.duration=3600*+mt.workoutDurationHour+60*+mt.workoutDurationMinutes+ +mt.workoutDurationSeconds,t.duration<=0&&vt.value.push("workouts.INVALID_DURATION"),t.distance=at.value.imperial_units?(0,w.sC)(+mt.workoutDistance,"mi","km",3):+mt.workoutDistance,t.distance<=0&&vt.value.push("workouts.INVALID_DISTANCE"),t.workout_date=`${mt.workoutDate} ${mt.workoutTime}`,t.ascent=""===mt.workoutAscent?null:at.value.imperial_units?(0,w.sC)(+mt.workoutAscent,"ft","m",3):+mt.workoutAscent,t.descent=""===mt.workoutDescent?null:at.value.imperial_units?(0,w.sC)(+mt.workoutDescent,"ft","m",3):+mt.workoutDescent,(null!==t.ascent&&null===t.descent||null===t.ascent&&null!==t.descent)&&vt.value.push("workouts.INVALID_ASCENT_OR_DESCENT")}function Et(){const t={sport_id:+mt.sport_id,notes:mt.notes};if(e.workout.id)e.workout.with_gpx?t.title=mt.title:Tt(t),vt.value.length>0?et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,vt.value):et.dispatch(u.aX.ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t});else if(wt.value){if(!kt){const t="workouts.NO_FILE_PROVIDED";return void et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,t)}t.file=kt,et.dispatch(u.aX.ACTIONS.ADD_WORKOUT,t)}else Tt(t),vt.value.length>0?et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,vt.value):et.dispatch(u.aX.ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function Dt(){e.workout.id?ot.push({name:"Workout",params:{workoutId:e.workout.id}}):ot.go(-1)}function Ot(){_t.value=!0}return(0,a.bv)((()=>{e.workout.id&&St(e.workout)})),(0,a.Ah)((()=>et.commit(u.SY.MUTATIONS.EMPTY_ERROR_MESSAGES))),(0,a.YP)((()=>e.workout),(async(t,e)=>{t!==e&&t&&t.id&&St(t)})),(t,e)=>{const o=(0,a.up)("CustomTextArea"),s=(0,a.up)("ErrorMessage"),i=(0,a.up)("Loader"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",{id:"workout-edition",class:(0,n.C_)(["center-card with-margin",{"center-form":(0,l.SU)(nt)&&(0,l.SU)(nt).with_gpx}])},[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,n.zw)(t.$t(`workouts.${(0,l.SU)(lt)?"ADD":"EDIT"}_WORKOUT`)),1)])),content:(0,a.w5)((()=>[(0,a._)("div",k,[(0,a._)("form",{class:(0,n.C_)({errors:_t.value}),onSubmit:(0,r.iM)(Et,["prevent"])},[(0,a._)("div",v,[(0,l.SU)(lt)?((0,a.wg)(),(0,a.iD)("div",f,[(0,a._)("div",null,[(0,a._)("input",{id:"withGpx",type:"radio",checked:wt.value,disabled:(0,l.SU)(rt),onClick:gt},null,8,g),(0,a._)("label",y,(0,n.zw)(t.$t("workouts.WITH_GPX")),1)]),(0,a._)("div",null,[(0,a._)("input",{id:"withoutGpx",type:"radio",checked:!wt.value,disabled:(0,l.SU)(rt),onClick:gt},null,8,S),(0,a._)("label",U,(0,n.zw)(t.$t("workouts.WITHOUT_GPX")),1)])])):(0,a.kq)("",!0),(0,a._)("div",h,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.SPORT",1))+"*: ",1),(0,a.wy)((0,a._)("select",{id:"sport",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[0]||(e[0]=t=>mt.sport_id=t)},[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,l.SU)(st),(t=>((0,a.wg)(),(0,a.iD)("option",{value:t.id,key:t.id},(0,n.zw)(t.translatedLabel),9,T)))),128))],40,b),[[r.bM,mt.sport_id]])]),(0,l.SU)(lt)&&wt.value?((0,a.wg)(),(0,a.iD)("div",E,[(0,a._)("label",D,(0,n.zw)(t.$t("workouts.GPX_FILE"))+" "+(0,n.zw)(t.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+"*: ",1),(0,a._)("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:(0,l.SU)(rt),required:"",onInvalid:Ot,onInput:yt},null,40,O),(0,a._)("div",I,[(0,a._)("div",null,[(0,a._)("strong",null,(0,n.zw)(t.$t("workouts.GPX_FILE"))+":",1),(0,a._)("ul",null,[(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_SIZE"))+": "+(0,n.zw)((0,l.SU)(ut)),1)])]),(0,a._)("div",null,[(0,a._)("strong",null,(0,n.zw)(t.$t("workouts.ZIP_ARCHIVE"))+":",1),(0,a._)("ul",null,[(0,a._)("li",null,(0,n.zw)(t.$t("workouts.NO_FOLDER")),1),(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_FILES"))+": "+(0,n.zw)((0,l.SU)(dt)),1),(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_SIZE"))+": "+(0,n.zw)((0,l.SU)(ct)),1)])])])])):((0,a.wg)(),(0,a.iD)("div",A,[(0,a._)("label",C,(0,n.zw)(t.$t("workouts.TITLE"))+": ",1),(0,a.wy)((0,a._)("input",{id:"title",name:"title",type:"text",required:!(0,l.SU)(lt),onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[1]||(e[1]=t=>mt.title=t)},null,40,R),[[r.nr,mt.title]])])),wt.value?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",$,[(0,a._)("div",N,[(0,a._)("div",x,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.WORKOUT_DATE"))+"*:",1),(0,a._)("div",z,[(0,a.wy)((0,a._)("input",{id:"workout-date",name:"workout-date",type:"date",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[2]||(e[2]=t=>mt.workoutDate=t)},null,40,L),[[r.nr,mt.workoutDate]]),(0,a.wy)((0,a._)("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[3]||(e[3]=t=>mt.workoutTime=t)},null,40,j),[[r.nr,mt.workoutTime]])])]),(0,a._)("div",W,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DURATION"))+"*:",1),(0,a._)("div",null,[(0,a.wy)((0,a._)("input",{id:"workout-duration-hour",name:"workout-duration-hour",class:(0,n.C_)(["workout-duration",{errored:ht()}]),type:"text",placeholder:"HH",minlength:"1",maxlength:"2",pattern:"^([0-1]?[0-9]|2[0-3])$",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[4]||(e[4]=t=>mt.workoutDurationHour=t)},null,42,P),[[r.nr,mt.workoutDurationHour]]),(0,a.Uk)(" : "),(0,a.wy)((0,a._)("input",{id:"workout-duration-minutes",name:"workout-duration-minutes",class:(0,n.C_)(["workout-duration",{errored:ht()}]),type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"MM",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[5]||(e[5]=t=>mt.workoutDurationMinutes=t)},null,42,F),[[r.nr,mt.workoutDurationMinutes]]),(0,a.Uk)(" : "),(0,a.wy)((0,a._)("input",{id:"workout-duration-seconds",name:"workout-duration-seconds",class:(0,n.C_)(["workout-duration",{errored:ht()}]),type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"SS",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[6]||(e[6]=t=>mt.workoutDurationSeconds=t)},null,42,B),[[r.nr,mt.workoutDurationSeconds]])])])]),(0,a._)("div",H,[(0,a._)("div",M,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,n.zw)((0,l.SU)(at).imperial_units?"mi":"km")+")*: ",1),(0,a.wy)((0,a._)("input",{class:(0,n.C_)({errored:Ut()}),name:"workout-distance",type:"number",min:"0",step:"0.001",required:"",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[7]||(e[7]=t=>mt.workoutDistance=t)},null,42,q),[[r.nr,mt.workoutDistance]])]),(0,a._)("div",Z,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.ASCENT"))+" ("+(0,n.zw)((0,l.SU)(at).imperial_units?"ft":"m")+"): ",1),(0,a.wy)((0,a._)("input",{class:(0,n.C_)({errored:bt()}),name:"workout-ascent",type:"number",min:"0",step:"0.01",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[8]||(e[8]=t=>mt.workoutAscent=t)},null,42,G),[[r.nr,mt.workoutAscent]])]),(0,a._)("div",K,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DESCENT"))+" ("+(0,n.zw)((0,l.SU)(at).imperial_units?"ft":"m")+"): ",1),(0,a.wy)((0,a._)("input",{class:(0,n.C_)({errored:bt()}),name:"workout-descent",type:"number",min:"0",step:"0.01",onInvalid:Ot,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[9]||(e[9]=t=>mt.workoutDescent=t)},null,42,V),[[r.nr,mt.workoutDescent]])])])])),(0,a._)("div",Y,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.NOTES"))+": ",1),(0,a.Wm)(o,{name:"notes",input:mt.notes,disabled:(0,l.SU)(rt),onUpdateValue:ft},null,8,["input","disabled"])])]),(0,l.SU)(pt)?((0,a.wg)(),(0,a.j4)(s,{key:0,message:(0,l.SU)(pt)},null,8,["message"])):(0,a.kq)("",!0),(0,l.SU)(rt)?((0,a.wg)(),(0,a.iD)("div",X,[(0,a.Wm)(i)])):((0,a.wg)(),(0,a.iD)("div",J,[(0,a._)("button",{class:"confirm",type:"submit",disabled:(0,l.SU)(rt)},(0,n.zw)(t.$t("buttons.SUBMIT")),9,Q),(0,a._)("button",{class:"cancel",onClick:(0,r.iM)(Dt,["prevent"])},(0,n.zw)(t.$t("buttons.CANCEL")),9,tt)]))],42,_)])])),_:1})],2)}}}),ot=o(3744);const at=(0,ot.Z)(et,[["__scopeId","data-v-45d3bf87"]]);var nt=at},4189:function(t,e,o){o.r(e),o.d(e,{default:function(){return p}});var a=o(6252),n=o(2262),l=o(2238),r=o(5801),s=o(9917);const i={id:"add-workout",class:"view"},u={class:"container"};var d=(0,a.aZ)({__name:"AddWorkout",setup(t){const e=(0,s.o)(),o=(0,a.Fl)((()=>e.getters[r.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>e.getters[r.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>e.getters[r.aX.GETTERS.WORKOUT_DATA]));return(t,e)=>((0,a.wg)(),(0,a.iD)("div",i,[(0,a._)("div",u,[(0,a.Wm)(l.Z,{authUser:(0,n.SU)(d),sports:(0,n.SU)(o),isCreation:!0,loading:(0,n.SU)(c).loading},null,8,["authUser","sports","loading"])])]))}});const c=d;var p=c},8237:function(t,e,o){o.r(e),o.d(e,{default:function(){return m}});var a=o(6252),n=o(2262),l=o(2201),r=o(2238),s=o(5801),i=o(9917);const u={id:"edit-workout",class:"view"},d={class:"container"};var c=(0,a.aZ)({__name:"EditWorkout",setup(t){const e=(0,l.yj)(),o=(0,i.o)(),c=(0,a.Fl)((()=>o.getters[s.YN.GETTERS.AUTH_USER_PROFILE])),p=(0,a.Fl)((()=>o.getters[s.O8.GETTERS.SPORTS])),m=(0,a.Fl)((()=>o.getters[s.aX.GETTERS.WORKOUT_DATA]));return(0,a.wF)((()=>{o.dispatch(s.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:e.params.workoutId})})),(0,a.YP)((()=>e.params.workoutId),(async t=>{t||o.commit(s.aX.MUTATIONS.EMPTY_WORKOUT)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",u,[(0,a._)("div",d,[(0,n.SU)(m).workout.id?((0,a.wg)(),(0,a.j4)(r.Z,{key:0,authUser:(0,n.SU)(c),sports:(0,n.SU)(p),workout:(0,n.SU)(m).workout,loading:(0,n.SU)(m).loading},null,8,["authUser","sports","workout","loading"])):(0,a.kq)("",!0)])]))}});const p=c;var m=p},5018:function(t,e,o){o.r(e),o.d(e,{default:function(){return ma}});var a=o(6252),n=o(2262),l=o(2201),r=o(8273),s=(o(7658),o(3577)),i=o(9963),u=o(5167);const d=t=>((0,a.dD)("data-v-4d9f9a8a"),t=t(),(0,a.Cn)(),t),c={id:"workout-card-title"},p=["title"],m=d((()=>(0,a._)("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1))),w=[m],k={class:"workout-card-title"},_={class:"workout-title-date"},v={key:0,class:"workout-title"},f={key:1,class:"workout-title"},g={class:"workout-segment"},y=d((()=>(0,a._)("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1))),S={class:"workout-date"},U={class:"workout-link"},h=["title"],b=d((()=>(0,a._)("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1))),T=[b];var E=(0,a.aZ)({__name:"WorkoutCardTitle",props:{sport:null,workoutObject:null},emits:["displayModal"],setup(t,{emit:e}){const o=t,{sport:l,workoutObject:r}=(0,n.BK)(o);async function d(t){await u.Z.get(`workouts/${t}/gpx/download`,{responseType:"blob"}).then((e=>{const o=window.URL.createObjectURL(new Blob([e.data],{type:"application/gpx+xml"})),a=document.createElement("a");a.href=o,a.setAttribute("download",`${t}.gpx`),document.body.appendChild(a),a.click()}))}return(t,o)=>{const u=(0,a.up)("SportImage"),m=(0,a.up)("router-link");return(0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",{class:(0,s.C_)(["workout-previous workout-arrow",{inactive:!(0,n.SU)(r).previousUrl}]),title:(0,n.SU)(r).previousUrl?t.$t(`workouts.PREVIOUS_${(0,n.SU)(r).type}`):t.$t(`workouts.NO_PREVIOUS_${(0,n.SU)(r).type}`),onClick:o[0]||(o[0]=e=>(0,n.SU)(r).previousUrl?t.$router.push((0,n.SU)(r).previousUrl):null)},w,10,p),(0,a._)("div",k,[(0,a.Wm)(u,{"sport-label":(0,n.SU)(l).label,color:(0,n.SU)(l).color},null,8,["sport-label","color"]),(0,a._)("div",_,["WORKOUT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.iD)("div",v,[(0,a._)("span",null,(0,s.zw)((0,n.SU)(r).title),1),(0,a._)("i",{class:"fa fa-edit","aria-hidden":"true",onClick:o[1]||(o[1]=e=>t.$router.push({name:"EditWorkout",params:{workoutId:(0,n.SU)(r).workoutId}}))}),(0,n.SU)(r).with_gpx?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-download","aria-hidden":"true",onClick:o[2]||(o[2]=(0,i.iM)((t=>d((0,n.SU)(r).workoutId)),["prevent"]))})):(0,a.kq)("",!0),(0,a._)("i",{class:"fa fa-trash","aria-hidden":"true",onClick:o[3]||(o[3]=t=>e("displayModal",!0))})])):((0,a.wg)(),(0,a.iD)("div",f,[(0,a.Uk)((0,s.zw)((0,n.SU)(r).title)+" ",1),(0,a._)("span",g,[(0,a.Uk)(" — "),y,(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.SEGMENT"))+" "+(0,s.zw)((0,n.SU)(r).segmentId+1),1)])])),(0,a._)("div",S,[(0,a.Uk)((0,s.zw)((0,n.SU)(r).workoutDate)+" - "+(0,s.zw)((0,n.SU)(r).workoutTime)+" ",1),(0,a._)("span",U,["SEGMENT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.j4)(m,{key:0,to:{name:"Workout",params:{workoutId:(0,n.SU)(r).workoutId}}},{default:(0,a.w5)((()=>[(0,a.Uk)(" > "+(0,s.zw)(t.$t("workouts.BACK_TO_WORKOUT")),1)])),_:1},8,["to"])):(0,a.kq)("",!0)])])])]),(0,a._)("div",{class:(0,s.C_)(["workout-next workout-arrow",{inactive:!(0,n.SU)(r).nextUrl}]),title:(0,n.SU)(r).nextUrl?t.$t(`workouts.NEXT_${(0,n.SU)(r).type}`):t.$t(`workouts.NO_NEXT_${(0,n.SU)(r).type}`),onClick:o[4]||(o[4]=e=>(0,n.SU)(r).nextUrl?t.$router.push((0,n.SU)(r).nextUrl):null)},T,10,h)])}}}),D=o(3744);const O=(0,D.Z)(E,[["__scopeId","data-v-4d9f9a8a"]]);var I=O;const A=t=>((0,a.dD)("data-v-1a5282f6"),t=t(),(0,a.Cn)(),t),C={key:0,class:"workout-record"},R=A((()=>(0,a._)("sup",null,[(0,a._)("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1))),$=[R];var N=(0,a.aZ)({__name:"WorkoutRecord",props:{recordType:null,workoutObject:null},setup(t){const e=t,{recordType:o,workoutObject:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).records&&(0,n.SU)(l).records.find((t=>t.record_type===(0,n.SU)(o)))?((0,a.wg)(),(0,a.iD)("span",C,$)):(0,a.kq)("",!0)}});const x=(0,D.Z)(N,[["__scopeId","data-v-1a5282f6"]]);var z=x,L=o(9150),j=o(3649);const W=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],P=t=>{const e=Math.floor(t/22.5+.5);return W[e%16]},F={class:"wind"},B={class:"wind-bearing"},H=["title"];var M=(0,a.aZ)({__name:"WeatherWind",props:{weather:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{useImperialUnits:o,weather:l}=(0,n.BK)(e),{t:r}=(0,L.QT)();function i(t){return r(`workouts.WEATHER.WIND_DIRECTIONS.${P(t)}`)}return(t,e)=>((0,a.wg)(),(0,a.iD)("div",F,[(0,a.Uk)((0,s.zw)((0,n.SU)(j.Y2)((0,n.SU)(l).wind,(0,n.SU)(o)))+" ",1),(0,a._)("div",B,[(0,n.SU)(l).windBearing?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-long-arrow-down",style:(0,s.j5)({transform:`rotate(${(0,n.SU)(l).windBearing}deg)`}),"aria-hidden":"true",title:i((0,n.SU)(l).windBearing)},null,12,H)):(0,a.kq)("",!0)])]))}});const q=(0,D.Z)(M,[["__scopeId","data-v-40697ed1"]]);var Z=q;const G=t=>((0,a.dD)("data-v-807b431a"),t=t(),(0,a.Cn)(),t),K={key:0,id:"workout-weather"},V={class:"weather-table"},Y=G((()=>(0,a._)("th",null,null,-1))),X={class:"weather-th"},J=["src","alt","title"],Q={class:"weather-th"},tt=["src","alt","title"],et=["alt","title"],ot=["alt","title"],at=["alt","title"];var nt=(0,a.aZ)({__name:"WorkoutWeather",props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{useImperialUnits:o,workoutObject:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).weatherStart&&(0,n.SU)(l).weatherEnd?((0,a.wg)(),(0,a.iD)("div",K,[(0,a._)("table",V,[(0,a._)("thead",null,[(0,a._)("tr",null,[Y,(0,a._)("th",null,[(0,a._)("div",X,[(0,a.Uk)((0,s.zw)(t.$t("workouts.START"))+" ",1),(0,a._)("img",{class:"weather-img",src:`/img/weather/${(0,n.SU)(l).weatherStart.icon}.svg`,alt:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherStart.icon}`),title:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherStart.icon}`)},null,8,J)])]),(0,a._)("th",null,[(0,a._)("div",Q,[(0,a.Uk)((0,s.zw)(t.$t("workouts.END"))+" ",1),(0,a._)("img",{class:"weather-img",src:`/img/weather/${(0,n.SU)(l).weatherEnd.icon}.svg`,alt:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherEnd.icon}`),title:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherEnd.icon}`)},null,8,tt)])])])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/temperature.svg",alt:t.$t("workouts.WEATHER.TEMPERATURE"),title:t.$t("workouts.WEATHER.TEMPERATURE")},null,8,et)]),(0,a._)("td",null,(0,s.zw)((0,n.SU)(j.x$)((0,n.SU)(l).weatherStart.temperature,(0,n.SU)(o))),1),(0,a._)("td",null,(0,s.zw)((0,n.SU)(j.x$)((0,n.SU)(l).weatherEnd.temperature,(0,n.SU)(o))),1)]),(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/pour-rain.svg",alt:t.$t("workouts.WEATHER.HUMIDITY"),title:t.$t("workouts.WEATHER.HUMIDITY")},null,8,ot)]),(0,a._)("td",null,(0,s.zw)(Number(100*(0,n.SU)(l).weatherStart.humidity).toFixed(1))+"% ",1),(0,a._)("td",null,(0,s.zw)(Number(100*(0,n.SU)(l).weatherEnd.humidity).toFixed(1))+"% ",1)]),(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/breeze.svg",alt:t.$t("workouts.WEATHER.WIND"),title:t.$t("workouts.WEATHER.WIND")},null,8,at)]),(0,a._)("td",null,[(0,a.Wm)(Z,{weather:(0,n.SU)(l).weatherStart,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])]),(0,a._)("td",null,[(0,a.Wm)(Z,{weather:(0,n.SU)(l).weatherEnd,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])])])])])])):(0,a.kq)("",!0)}});const lt=(0,D.Z)(nt,[["__scopeId","data-v-807b431a"]]);var rt=lt;const st=t=>((0,a.dD)("data-v-74c5993b"),t=t(),(0,a.Cn)(),t),it={id:"workout-info"},ut={class:"workout-data"},dt=st((()=>(0,a._)("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1))),ct={class:"label"},pt={class:"value"},mt={key:0},wt={class:"value"},kt={class:"value"},_t={class:"workout-data"},vt=st((()=>(0,a._)("i",{class:"fa fa-road","aria-hidden":"true"},null,-1))),ft={class:"label"},gt={class:"workout-data"},yt=st((()=>(0,a._)("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1))),St={class:"label"},Ut=st((()=>(0,a._)("br",null,null,-1))),ht={class:"label"},bt={key:0,class:"workout-data"},Tt=["alt"],Et={class:"label"},Dt=st((()=>(0,a._)("br",null,null,-1))),Ot={class:"label"},It={key:1,class:"workout-data"},At=st((()=>(0,a._)("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1))),Ct={class:"label"},Rt=st((()=>(0,a._)("br",null,null,-1))),$t={class:"label"};var Nt=(0,a.aZ)({__name:"WorkoutData",props:{workoutObject:null,useImperialUnits:{type:Boolean},displayHARecord:{type:Boolean}},setup(t){const e=t,{displayHARecord:o,workoutObject:l,useImperialUnits:r}=(0,n.BK)(e),i=(0,a.Fl)((()=>"0:00:00"!==e.workoutObject.pauses&&null!==e.workoutObject.pauses));return(t,e)=>{const u=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",it,[(0,a._)("div",ut,[dt,(0,a._)("span",ct,(0,s.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(": "),(0,a._)("span",pt,(0,s.zw)((0,n.SU)(l).moving),1),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"LD"},null,8,["workoutObject"]),(0,n.SU)(i)?((0,a.wg)(),(0,a.iD)("div",mt,[(0,a.Uk)(" ("+(0,s.zw)(t.$t("workouts.PAUSES"))+": ",1),(0,a._)("span",wt,(0,s.zw)((0,n.SU)(l).pauses),1),(0,a.Uk)(" - "+(0,s.zw)(t.$t("workouts.TOTAL_DURATION"))+": ",1),(0,a._)("span",kt,(0,s.zw)((0,n.SU)(l).duration)+")",1)])):(0,a.kq)("",!0)]),(0,a._)("div",_t,[vt,(0,a._)("span",ft,(0,s.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).distance,digits:3,unitFrom:"km",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"FD"},null,8,["workoutObject"])]),(0,a._)("div",gt,[yt,(0,a._)("span",St,(0,s.zw)(t.$t("workouts.AVERAGE_SPEED")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).aveSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"AS"},null,8,["workoutObject"]),Ut,(0,a._)("span",ht,(0,s.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).maxSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"MS"},null,8,["workoutObject"])]),null!==(0,n.SU)(l).maxAlt&&null!==(0,n.SU)(l).minAlt?((0,a.wg)(),(0,a.iD)("div",bt,[(0,a._)("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:t.$t("workouts.ELEVATION")},null,8,Tt),(0,a._)("span",Et,(0,s.zw)(t.$t("workouts.MIN_ALTITUDE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).minAlt,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),Dt,(0,a._)("span",Ot,(0,s.zw)(t.$t("workouts.MAX_ALTITUDE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).maxAlt,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"])])):(0,a.kq)("",!0),null!==(0,n.SU)(l).ascent&&null!==(0,n.SU)(l).descent?((0,a.wg)(),(0,a.iD)("div",It,[At,(0,a._)("span",Ct,(0,s.zw)(t.$t("workouts.ASCENT")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).ascent,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,n.SU)(o)?((0,a.wg)(),(0,a.j4)(z,{key:0,workoutObject:(0,n.SU)(l),recordType:"HA"},null,8,["workoutObject"])):(0,a.kq)("",!0),Rt,(0,a._)("span",$t,(0,s.zw)(t.$t("workouts.DESCENT")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).descent,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"])])):(0,a.kq)("",!0),(0,a.Wm)(rt,{workoutObject:(0,n.SU)(l),useImperialUnits:(0,n.SU)(r)},null,8,["workoutObject","useImperialUnits"])])}}});const xt=(0,D.Z)(Nt,[["__scopeId","data-v-74c5993b"]]);var zt=xt;function Lt(t,e){return Array.from(t.getElementsByTagName(e))}function jt(t){return t?.normalize(),t&&t.textContent||""}function Wt(t,e,o){const a=t.getElementsByTagName(e),n=a.length?a[0]:null;return n&&o&&o(n),n}function Pt(t,e,o){const a={};if(!t)return a;const n=t.getElementsByTagName(e),l=n.length?n[0]:null;return l&&o?o(l,a):a}function Ft(t,e,o){const a=jt(Wt(t,e));return a&&o&&o(a)||{}}function Bt(t,e,o){const a=parseFloat(jt(Wt(t,e)));if(!isNaN(a))return a&&o&&o(a)||{}}function Ht(t,e,o){const a=parseFloat(jt(Wt(t,e)));if(!isNaN(a))return a&&o&&o(a),a}function Mt(t,e){const o={};for(const a of e)Ft(t,a,(t=>{o[a]=t}));return o}function qt(t){return 1===t?.nodeType}function Zt(t){return Pt(t,"line",(t=>{const e=Object.assign({},Ft(t,"color",(t=>({stroke:`#${t}`}))),Bt(t,"opacity",(t=>({"stroke-opacity":t}))),Bt(t,"width",(t=>({"stroke-width":96*t/25.4}))));return e}))}function Gt(t){let e=[];if(null===t)return e;for(const o of Array.from(t.childNodes)){if(!qt(o))continue;const t=Kt(o.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(Gt(o));else{const a=jt(o);e.push([t,Vt(a)])}}return e}function Kt(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function Vt(t){const e=parseFloat(t);return isNaN(e)?t:e}function Yt(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;Ht(t,"ele",(t=>{e.push(t)}));const o=Wt(t,"time");return{coordinates:e,time:o?jt(o):null,extendedValues:Gt(Wt(t,"extensions"))}}function Xt(t){const e=Mt(t,["name","cmt","desc","type","time","keywords"]),o=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const n of o)n.parentNode?.parentNode===t&&(e[n.tagName.replace(":","_")]=jt(n));const a=Lt(t,"link");return a.length&&(e.links=a.map((t=>Object.assign({href:t.getAttribute("href")},Mt(t,["text","type"]))))),e}function Jt(t,e){const o=Lt(t,e),a=[],n=[],l={};for(let r=0;r<o.length;r++){const t=Yt(o[r]);if(t){a.push(t.coordinates),t.time&&n.push(t.time);for(const[e,a]of t.extendedValues){const t="heart"===e?e:e.replace("gpxtpx:","")+"s";l[t]||(l[t]=Array(o.length).fill(null)),l[t][r]=a}}}if(!(a.length<2))return{line:a,times:n,extendedValues:l}}function Qt(t){const e=Jt(t,"rtept");if(e)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},Xt(t),Zt(Wt(t,"extensions"))),geometry:{type:"LineString",coordinates:e.line}}}function te(t){const e=Lt(t,"trkseg"),o=[],a=[],n=[];for(const s of e){const t=Jt(s,"trkpt");t&&(n.push(t),t.times&&t.times.length&&a.push(t.times))}if(0===n.length)return null;const l=n.length>1,r=Object.assign({_gpxType:"trk"},Xt(t),Zt(Wt(t,"extensions")),a.length?{coordinateProperties:{times:l?a:a[0]}}:{});for(const s of n){o.push(s.line),r.coordinateProperties||(r.coordinateProperties={});const t=r.coordinateProperties,e=Object.entries(s.extendedValues);for(let o=0;o<e.length;o++){const[a,r]=e[o];l?(t[a]||(t[a]=n.map((t=>new Array(t.line.length).fill(null)))),t[a][o]=r):t[a]=r}}return{type:"Feature",properties:r,geometry:l?{type:"MultiLineString",coordinates:o}:{type:"LineString",coordinates:o[0]}}}function ee(t){const e=Object.assign(Xt(t),Mt(t,["sym"])),o=Yt(t);return o?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:o.coordinates}}:null}function*oe(t){for(const e of Lt(t,"trk")){const t=te(e);t&&(yield t)}for(const e of Lt(t,"rte")){const t=Qt(e);t&&(yield t)}for(const e of Lt(t,"wpt")){const t=ee(e);t&&(yield t)}}function ae(t){return{type:"FeatureCollection",features:Array.from(oe(t))}}Math.PI;const ne=(t,e=100)=>{let o;const a=function(...a){const n=this;o&&clearTimeout(o),o=setTimeout((()=>{t.apply(n,a),o=null}),e)};return a.cancel=function(){o&&clearTimeout(o)},a},le=function(t){for(const e of Object.values(t))e&&se(e.cancel)&&e.cancel()},re=t=>t&&"function"==typeof t.charAt?t.charAt(0).toUpperCase()+t.slice(1):t,se=t=>"function"==typeof t,ie=(t,e,o)=>{for(const n in o){const l="set"+re(n);t[l]?(0,a.YP)((()=>o[n]),((e,o)=>{t[l](e,o)})):e[l]&&(0,a.YP)((()=>o[n]),(t=>{e[l](t)}))}},ue=(t,e,o={})=>{const a={...o};for(const n in t){const o=e[n],l=t[n];o&&(o&&!0===o.custom||void 0!==l&&(a[n]=l))}return a},de=t=>{const e={};for(const o in t)if(o.startsWith("on")&&!o.startsWith("onUpdate")&&"onReady"!==o){const a=o.slice(2).toLocaleLowerCase();e[a]=t[o]}return e},ce=async t=>{const e=await Promise.all([o.e(431).then(o.t.bind(o,6431,17)),o.e(93).then(o.t.bind(o,7093,17)),o.e(858).then(o.t.bind(o,8858,17))]);delete t.Default.prototype._getIconUrl,t.Default.mergeOptions({iconRetinaUrl:e[0].default,iconUrl:e[1].default,shadowUrl:e[2].default})},pe=t=>{const e=(0,n.iH)((()=>console.warn(`Method ${t} has been invoked without being replaced`))),o=(...t)=>e.value(...t);return o.wrapped=e,(0,a.JJ)(t,o),o},me=(t,e)=>t.wrapped.value=e,we="object"==typeof self&&self.self===self&&self||"object"==typeof o.g&&o.g.global===o.g&&o.g||void 0,ke="useGlobalLeaflet",_e={options:{type:Object,default:()=>({}),custom:!0}},ve=t=>({options:t.options,methods:{}}),fe={..._e,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},ge=(t,e,o)=>{const n=(0,a.f3)("addLayer"),l=(0,a.f3)("removeLayer"),{options:r,methods:s}=ve(t),i=ue(t,fe,r),u=()=>n({leafletObject:e.value}),d=()=>l({leafletObject:e.value}),c={...s,setAttribution(o){d(),e.value.options.attribution=o,t.visible&&u()},setName(){d(),t.visible&&u()},setLayerType(){d(),t.visible&&u()},setVisible(t){e.value&&(t?u():d())},bindPopup({leafletObject:t}){e.value&&se(e.value.bindPopup)?e.value.bindPopup(t):console.warn("Attempt to bind popup before bindPopup method available on layer.")},bindTooltip({leafletObject:t}){e.value&&se(e.value.bindTooltip)?e.value.bindTooltip(t):console.warn("Attempt to bind tooltip before bindTooltip method available on layer.")},unbindTooltip(){e.value&&(se(e.value.closeTooltip)&&e.value.closeTooltip(),se(e.value.unbindTooltip)&&e.value.unbindTooltip())},unbindPopup(){e.value&&(se(e.value.closePopup)&&e.value.closePopup(),se(e.value.unbindPopup)&&e.value.unbindPopup())},updateVisibleProp(t){o.emit("update:visible",t)}};return(0,a.JJ)("bindPopup",c.bindPopup),(0,a.JJ)("bindTooltip",c.bindTooltip),(0,a.JJ)("unbindTooltip",c.unbindTooltip),(0,a.JJ)("unbindPopup",c.unbindPopup),(0,a.Ah)((()=>{c.unbindPopup(),c.unbindTooltip(),d()})),{options:i,methods:c}},ye=(t,e)=>{if(t&&e.default)return(0,a.h)("div",{style:{display:"none"}},e.default())},Se={...fe,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},Ue={...Se,stroke:{type:Boolean,default:void 0},color:{type:String},weight:{type:Number},opacity:{type:Number},lineCap:{type:String},lineJoin:{type:String},dashArray:{type:String},dashOffset:{type:String},fill:{type:Boolean,default:void 0},fillColor:{type:String},fillOpacity:{type:Number},fillRule:{type:String},className:{type:String}},he={...Ue,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}},be={..._e,position:{type:String}},Te=(t,e)=>{const{options:o,methods:n}=ve(t),l=ue(t,be,o),r={...n,setPosition(t){e.value&&e.value.setPosition(t)}};return(0,a.Ah)((()=>{e.value&&e.value.remove()})),{options:l,methods:r}},Ee=t=>t.default?(0,a.h)("div",{ref:"root"},t.default()):null,De={name:"LControl",props:{...be,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(null),s=(0,a.f3)(ke),i=(0,a.f3)("registerControl"),{options:u,methods:d}=Te(t,l);return(0,a.bv)((async()=>{const{Control:c,DomEvent:p}=s?we.L:await o.e(633).then(o.bind(o,6633)),m=c.extend({onAdd(){return r.value}});l.value=(0,n.Xl)(new m(u)),ie(d,l.value,t),i({leafletObject:l.value}),t.disableClickPropagation&&p.disableClickPropagation(r.value),t.disableScrollPropagation&&p.disableScrollPropagation(r.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,leafletObject:l}},render(){return Ee(this.$slots)}},Oe=De,Ie={...be,collapsed:{type:Boolean,default:void 0},autoZIndex:{type:Boolean,default:void 0},hideSingleBase:{type:Boolean,default:void 0},sortLayers:{type:Boolean,default:void 0},sortFunction:{type:Function}},Ae=(t,e)=>{const{options:o}=Te(t,e);return{options:ue(t,Ie,o),methods:{addLayer(t){"base"===t.layerType?e.value.addBaseLayer(t.leafletObject,t.name):"overlay"===t.layerType&&e.value.addOverlay(t.leafletObject,t.name)},removeLayer(t){e.value.removeLayer(t.leafletObject)}}}},Ce={name:"LControlLayers",props:Ie,setup(t,e){const l=(0,n.iH)({}),r=(0,a.f3)(ke),s=(0,a.f3)("registerLayerControl"),{options:i,methods:u}=Ae(t,l);return(0,a.bv)((async()=>{const{control:d}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.layers(null,null,i)),ie(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}},Re=Ce,$e=(Boolean,Boolean,Boolean,{...fe}),Ne=(t,e,o)=>{const{options:n,methods:l}=ge(t,e,o),r=ue(t,$e,n),s={...l,addLayer(t){e.value.addLayer(t.leafletObject)},removeLayer(t){e.value.removeLayer(t.leafletObject)}};return(0,a.JJ)("addLayer",s.addLayer),(0,a.JJ)("removeLayer",s.removeLayer),{options:r,methods:s}},xe={...$e,geojson:{type:[Object,Array],custom:!0},optionsStyle:{type:[Object,Function],custom:!0}},ze=(t,e,o)=>{const{options:a,methods:n}=Ne(t,e,o),l=ue(t,xe,a);Object.prototype.hasOwnProperty.call(t,"optionsStyle")&&(l.style=t.optionsStyle);const r={...n,setGeojson(t){e.value.clearLayers(),e.value.addData(t)},setOptionsStyle(t){e.value.setStyle(t)},getGeoJSONData(){return e.value.toGeoJSON()},getBounds(){return e.value.getBounds()}};return{options:l,methods:r}},Le={props:xe,setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=(0,a.f3)("addLayer"),{methods:u,options:d}=ze(t,l,e);return(0,a.bv)((async()=>{const{geoJSON:c,DomEvent:p}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.geojson,d));const m=de(e.attrs);p.on(l.value,m),ie(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return ye(this.ready,this.$slots)}},je=Le,We={...fe,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:Number},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number}},Pe=(t,e,o)=>{const{options:a,methods:n}=ge(t,e,o);return{options:ue(t,We,a),methods:{...n}}},Fe={iconUrl:{type:String},iconRetinaUrl:{type:String},iconSize:{type:[Object,Array]},iconAnchor:{type:[Object,Array]},popupAnchor:{type:[Object,Array]},tooltipAnchor:{type:[Object,Array]},shadowUrl:{type:String},shadowRetinaUrl:{type:String},shadowSize:{type:[Object,Array]},shadowAnchor:{type:[Object,Array]},bgPos:{type:[Object,Array]},className:{type:String}},Be={name:"LIcon",props:{...Fe,..._e},setup(t,e){const l=(0,n.iH)(null),r=(0,a.f3)(ke),s=(0,a.f3)("canSetParentHtml"),i=(0,a.f3)("setParentHtml"),u=(0,a.f3)("setIcon");let d,c,p,m,w;const k=(o,a,n)=>{const l=o&&o.innerHTML;if(!a)return void(n&&w&&s()&&i(l));const r=de(e.attrs);w&&c(w,r);const{options:k}=ve(t),_=ue(t,Fe,k);l&&(_.html=l),w=_.html?p(_):m(_),d(w,r),u(w)},_=()=>{(0,a.Y3)((()=>k(l.value,!0,!1)))},v=()=>{(0,a.Y3)((()=>k(l.value,!1,!0)))},f={setIconUrl:_,setIconRetinaUrl:_,setIconSize:_,setIconAnchor:_,setPopupAnchor:_,setTooltipAnchor:_,setShadowUrl:_,setShadowRetinaUrl:_,setShadowAnchor:_,setBgPos:_,setClassName:_,setHtml:_};return(0,a.bv)((async()=>{const{DomEvent:e,divIcon:a,icon:n}=r?we.L:await o.e(633).then(o.bind(o,6633));d=e.on,c=e.off,p=a,m=n,ie(f,{},t),new MutationObserver(v).observe(l.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),_()})),{root:l}},render(){const t=this.$slots.default?this.$slots.default():void 0;return(0,a.h)("div",{ref:"root"},t)}},He=Be,Me=(Boolean,Boolean,{props:$e,setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=(0,a.f3)("addLayer"),{methods:u}=Ne(t,l,e);return(0,a.bv)((async()=>{const{layerGroup:d,DomEvent:c}=s?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d(t.options));const p=de(e.attrs);c.on(l.value,p),ie(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return ye(this.ready,this.$slots)}}),qe=Me,Ze={..._e,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:Array},paddingTopLeft:{type:Array},padding:{type:Array},worldCopyJump:{type:Boolean,default:void 0},crs:{type:[String,Object]},maxBoundsViscosity:{type:Number},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number},inertiaMaxSpeed:{type:Number},easeLinearity:{type:Number},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:void 0},useGlobalLeaflet:{type:Boolean,default:!0,custom:!0}},Ge={emits:["ready","update:zoom","update:center","update:bounds"],props:Ze,setup(t,e){const l=(0,n.iH)(null),r=(0,n.qj)({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:s}=ve(t),i=ue(t,Ze,s),u=pe("addLayer"),d=pe("removeLayer"),c=pe("registerControl"),p=pe("registerLayerControl");(0,a.JJ)(ke,t.useGlobalLeaflet);const m={moveEndHandler:ne((()=>{e.emit("update:zoom",r.leafletRef.getZoom()),e.emit("update:center",r.leafletRef.getCenter()),e.emit("update:bounds",r.leafletRef.getBounds())})),overlayAddHandler(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!0)},overlayRemoveHandler(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!1)}};(0,a.bv)((async()=>{t.useGlobalLeaflet&&(we.L=we.L||await o.e(243).then(o.t.bind(o,5243,23)));const{map:s,CRS:w,Icon:k,latLngBounds:_,latLng:v,DomEvent:f}=t.useGlobalLeaflet?we.L:await o.e(633).then(o.bind(o,6633));try{i.beforeMapMount&&await i.beforeMapMount()}catch(U){console.error(`The following error occurred running the provided beforeMapMount hook ${U.message}`)}await ce(k);const g="string"==typeof i.crs?w[i.crs]:i.crs;i.crs=g||w.EPSG3857;const y={addLayer(t){void 0!==t.layerType&&(void 0===r.layerControl?r.layersToAdd.push(t):r.layersInControl.find((e=>e.leafletObject._leaflet_id===t.leafletObject._leaflet_id))||(r.layerControl.addLayer(t),r.layersInControl.push(t))),!1!==t.visible&&r.leafletRef.addLayer(t.leafletObject)},removeLayer(t){void 0!==t.layerType&&(void 0===r.layerControl?r.layersToAdd=r.layersToAdd.filter((e=>e.name!==t.name)):(r.layerControl.removeLayer(t.leafletObject),r.layersInControl=r.layersInControl.filter((e=>e.leafletObject._leaflet_id!==t.leafletObject._leaflet_id)))),r.leafletRef.removeLayer(t.leafletObject)},registerLayerControl(t){r.layerControl=t,r.layersToAdd.forEach((t=>{r.layerControl.addLayer(t)})),r.layersToAdd=[],c(t)},registerControl(t){r.leafletRef.addControl(t.leafletObject)},setZoom(e){const o=r.leafletRef.getZoom();e!==o&&r.leafletRef.setZoom(e,{animate:!t.noBlockingAnimations&&null})},setPaddingBottomRight(t){r.paddingBottomRight=t},setPaddingTopLeft(t){r.paddingTopLeft=t},setPadding(t){r.padding=t},setCrs(t){const e=r.leafletRef.getBounds();r.leafletRef.options.crs=t,r.leafletRef.fitBounds(e,{animate:!1,padding:[0,0]})},fitBounds(t){r.leafletRef.fitBounds(t,{animate:!this.noBlockingAnimations&&null})},setBounds(t){if(!t)return;const e=_(t);e.isValid()&&!(r.lastSetBounds||r.leafletRef.getBounds()).equals(e,0)&&(r.lastSetBounds=e,r.leafletRef.fitBounds(e,this.fitBoundsOptions))},setCenter(t){if(null==t)return;const e=v(t),o=r.lastSetCenter||r.leafletRef.getCenter();(o.lat!==e.lat||o.lng!==e.lng)&&(r.lastSetCenter=e,r.leafletRef.panTo(e,{animate:!this.noBlockingAnimations&&null}))}};me(u,y.addLayer),me(d,y.removeLayer),me(c,y.registerControl),me(p,y.registerLayerControl),r.leafletRef=(0,n.Xl)(s(l.value,i)),ie(y,r.leafletRef,t);const S=de(e.attrs);r.leafletRef.on("moveend",m.moveEndHandler),r.leafletRef.on("overlayadd",m.overlayAddHandler),r.leafletRef.on("overlayremove",m.overlayRemoveHandler),f.on(r.leafletRef,S),r.ready=!0,(0,a.Y3)((()=>e.emit("ready",r.leafletRef)))})),(0,a.Jd)((()=>{le(m),r.leafletRef&&(r.leafletRef.off(),r.leafletRef.remove())}));const w=(0,a.Fl)((()=>r.leafletRef)),k=(0,a.Fl)((()=>r.ready));return{root:l,ready:k,leafletObject:w}},render(){return(0,a.h)("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}},Ke=Ge,Ve=["Symbol(Comment)","Symbol(Text)"],Ye=["LTooltip","LPopup"],Xe={...fe,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},Je=(t,e,o)=>{const{options:a,methods:n}=ge(t,e,o),l=ue(t,Xe,a),r={...n,setDraggable(t){e.value.dragging&&(t?e.value.dragging.enable():e.value.dragging.disable())},latLngSync(t){o.emit("update:latLng",t.latlng),o.emit("update:lat-lng",t.latlng)},setLatLng(t){if(null!=t&&e.value){const o=e.value.getLatLng();(!o||!o.equals(t))&&e.value.setLatLng(t)}}};return{options:l,methods:r}},Qe=(t,e)=>{const o=e.slots.default&&e.slots.default();return o&&o.length&&o.some(to)};function to(t){return!(Ve.includes(t.type.toString())||Ye.includes(t.type.name))}const eo={name:"LMarker",props:Xe,setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(!1),s=(0,a.f3)(ke),i=(0,a.f3)("addLayer");(0,a.JJ)("canSetParentHtml",(()=>!!l.value.getElement())),(0,a.JJ)("setParentHtml",(t=>l.value.getElement().innerHTML=t)),(0,a.JJ)("setIcon",(t=>l.value.setIcon&&l.value.setIcon(t)));const{options:u,methods:d}=Je(t,l,e),c={moveHandler:ne(d.latLngSync)};return(0,a.bv)((async()=>{const{marker:p,DomEvent:m,divIcon:w}=s?we.L:await o.e(633).then(o.bind(o,6633));Qe(u,e)&&(u.icon=w({className:""})),l.value=(0,n.Xl)(p(t.latLng,u));const k=de(e.attrs);m.on(l.value,k),l.value.on("move",c.moveHandler),ie(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),(0,a.Jd)((()=>le(c))),{ready:r,leafletObject:l}},render(){return ye(this.ready,this.$slots)}},oo=eo,ao={...Ue,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},no={...ao},lo={..._e,content:{type:String,default:null}};no.latLngs.required=!1;const ro={...We,tms:{type:Boolean,default:void 0},subdomains:{type:[String,Array],validator:t=>"string"==typeof t||!!Array.isArray(t)&&t.every((t=>"string"==typeof t))},detectRetina:{type:Boolean,default:void 0},url:{type:String,required:!0,custom:!0}},so=(t,e,o)=>{const{options:a,methods:n}=Pe(t,e,o),l=ue(t,ro,a),r={...n};return{options:l,methods:r}},io={props:ro,setup(t,e){const l=(0,n.iH)({}),r=(0,a.f3)(ke),s=(0,a.f3)("addLayer"),{options:i,methods:u}=so(t,l,e);return(0,a.bv)((async()=>{const{tileLayer:d,DomEvent:c}=r?we.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d(t.url,i));const p=de(e.attrs);c.on(l.value,p),ie(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}},uo=io;Boolean,Boolean;var co=(0,a.aZ)({__name:"CustomMarker",props:{markerCoordinates:null,isStart:{type:Boolean}},setup(t){const e=t,{isStart:o,markerCoordinates:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(oo),{key:0,"lat-lng":[(0,n.SU)(l).latitude,(0,n.SU)(l).longitude]},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(He),{"icon-url":`/img/workouts/${(0,n.SU)(o)?"start":"finish"}.svg`,iconSize:[15,15]},null,8,["icon-url"])])),_:1},8,["lat-lng"])):(0,a.kq)("",!0)}});const po=co;var mo=po,wo=o(5801),ko=o(9917),_o=o(2024);const vo=t=>((0,a.dD)("data-v-2aec89b0"),t=t(),(0,a.Cn)(),t),fo={id:"workout-map"},go={key:0,class:"leaflet-container"},yo={key:1},So=vo((()=>(0,a._)("i",{class:"fa fa-refresh","aria-hidden":"true"},null,-1))),Uo={key:1,class:"no-map"};var ho=(0,a.aZ)({__name:"index",props:{workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,ko.o)(),{workoutData:l,markerCoordinates:r}=(0,n.BK)(e),i=(0,n.iH)(null),u=(0,a.Fl)((()=>g())),d=(0,a.Fl)((()=>o.getters[wo.SY.GETTERS.APP_CONFIG])),c=(0,a.Fl)((()=>v(u))),p=(0,a.Fl)((()=>e.workoutData&&e.workoutData.gpx?_(e.workoutData.gpx):{})),m=(0,a.Fl)((()=>e.workoutData&&e.workoutData.chartData.length>0?{latitude:e.workoutData.chartData[0].latitude,longitude:e.workoutData.chartData[0].longitude}:{})),w=(0,a.Fl)((()=>e.workoutData&&e.workoutData.chartData.length>0?{latitude:e.workoutData.chartData[e.workoutData.chartData.length-1].latitude,longitude:e.workoutData.chartData[e.workoutData.chartData.length-1].longitude}:{})),k=(0,n.iH)(!1);function _(t){if(!t||""!==t)try{const e=ae((new DOMParser).parseFromString(t,"text/xml"));return{jsonData:e}}catch(e){return console.error("Invalid gpx content"),{}}return{}}function v(t){return[(t.value[0][0]+t.value[1][0])/2,(t.value[0][1]+t.value[1][1])/2]}function f(t){i.value?.leafletObject&&i.value?.leafletObject.fitBounds(t)}function g(){return e.workoutData?[[e.workoutData.workout.bounds[0],e.workoutData.workout.bounds[1]],[e.workoutData.workout.bounds[2],e.workoutData.workout.bounds[3]]]:[]}function y(){i.value?.leafletObject.fitBounds(g())}function S(){k.value=!k.value,k.value||setTimeout((()=>{y()}),100)}return(t,e)=>{const o=(0,a.up)("VFullscreen");return(0,a.wg)(),(0,a.iD)("div",fo,[(0,n.SU)(l).loading?((0,a.wg)(),(0,a.iD)("div",go)):((0,a.wg)(),(0,a.iD)("div",yo,[(0,n.SU)(l).workout.with_gpx?((0,a.wg)(),(0,a.j4)(o,{key:0,modelValue:k.value,"onUpdate:modelValue":e[1]||(e[1]=t=>k.value=t)},{default:(0,a.w5)((()=>[(0,a._)("div",{class:(0,s.C_)(["leaflet-container",{"fullscreen-map":k.value}])},[(0,n.SU)(p).jsonData&&(0,n.SU)(c)&&2===(0,n.SU)(u).length?((0,a.wg)(),(0,a.j4)((0,n.SU)(Ke),{key:0,zoom:13,maxZoom:19,center:(0,n.SU)(c),bounds:(0,n.SU)(u),zoomAnimation:!1,ref_key:"workoutMap",ref:i,onReady:e[0]||(e[0]=t=>f((0,n.SU)(u)))},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(Re)),(0,a.Wm)((0,n.SU)(Oe),{position:"topleft",class:"map-control",onClick:y},{default:(0,a.w5)((()=>[So])),_:1}),(0,a.Wm)((0,n.SU)(Oe),{position:"topleft",class:"map-control",onClick:S},{default:(0,a.w5)((()=>[(0,a._)("i",{class:(0,s.C_)("fa fa-"+(k.value?"compress":"arrows-alt")),"aria-hidden":"true"},null,2)])),_:1}),(0,a.Wm)((0,n.SU)(uo),{url:`${(0,n.SU)(_o.k)()}workouts/map_tile/{s}/{z}/{x}/{y}.png`,attribution:(0,n.SU)(d).map_attribution,bounds:(0,n.SU)(u)},null,8,["url","attribution","bounds"]),(0,a.Wm)((0,n.SU)(je),{geojson:(0,n.SU)(p).jsonData},null,8,["geojson"]),(0,n.SU)(r).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(oo),{key:0,"lat-lng":[(0,n.SU)(r).latitude,(0,n.SU)(r).longitude]},null,8,["lat-lng"])):(0,a.kq)("",!0),(0,a.Wm)((0,n.SU)(qe),{name:t.$t("workouts.START_AND_FINISH"),"layer-type":"overlay"},{default:(0,a.w5)((()=>[(0,n.SU)(m).latitude?((0,a.wg)(),(0,a.j4)(mo,{key:0,markerCoordinates:(0,n.SU)(m),isStart:!0},null,8,["markerCoordinates"])):(0,a.kq)("",!0),(0,n.SU)(w).latitude?((0,a.wg)(),(0,a.j4)(mo,{key:1,markerCoordinates:(0,n.SU)(w),isStart:!1},null,8,["markerCoordinates"])):(0,a.kq)("",!0)])),_:1},8,["name"])])),_:1},8,["center","bounds"])):(0,a.kq)("",!0)],2)])),_:1},8,["modelValue"])):((0,a.wg)(),(0,a.iD)("div",Uo,(0,s.zw)(t.$t("workouts.NO_MAP")),1))]))])}}});const bo=(0,D.Z)(ho,[["__scopeId","data-v-2aec89b0"]]);var To=bo,Eo=o(6558);const Do={class:"workout-detail"};var Oo=(0,a.aZ)({__name:"index",props:{authUser:null,displaySegment:{type:Boolean},sports:null,workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,l.yj)(),r=(0,ko.o)(),{authUser:s,markerCoordinates:i,workoutData:u}=(0,n.BK)(e),d=(0,a.Fl)((()=>e.workoutData.workout)),c=(0,n.iH)(o.params.workoutId?+o.params.segmentId:null),p=(0,a.Fl)((()=>d.value.segments.length>0&&c.value?d.value.segments[+c.value-1]:null)),m=(0,n.iH)(!1),w=(0,a.Fl)((()=>e.sports?e.sports.find((t=>t.id===e.workoutData.workout.sport_id)):{})),k=(0,a.Fl)((()=>v(d.value,p.value)));function _(t,e,o){const a=e&&o&&1!==o?`/workouts/${t.id}/segment/${o-1}`:!e&&t.previous_workout?`/workouts/${t.previous_workout}`:null,n=e&&o&&o<t.segments.length?`/workouts/${t.id}/segment/${o+1}`:!e&&t.next_workout?`/workouts/${t.next_workout}`:null;return{previousUrl:a,nextUrl:n}}function v(t,o){const a=_(t,e.displaySegment,c.value?+c.value:null),n=(0,Eo.Jo)((0,Eo.eB)(e.workoutData.workout.workout_date,e.authUser.timezone),e.authUser.date_format);return{ascent:o?o.ascent:t.ascent,aveSpeed:o?o.ave_speed:t.ave_speed,distance:o?o.distance:t.distance,descent:o?o.descent:t.descent,duration:o?o.duration:t.duration,maxAlt:o?o.max_alt:t.max_alt,maxSpeed:o?o.max_speed:t.max_speed,minAlt:o?o.min_alt:t.min_alt,moving:o?o.moving:t.moving,nextUrl:a.nextUrl,pauses:o?o.pauses:t.pauses,previousUrl:a.previousUrl,records:o?[]:t.records,segmentId:o?o.segment_id:null,title:t.title,type:e.displaySegment?"SEGMENT":"WORKOUT",workoutDate:n.workout_date,weatherEnd:o?null:t.weather_end,weatherStart:o?null:t.weather_start,with_gpx:t.with_gpx,workoutId:t.id,workoutTime:n.workout_time}}function f(t){m.value=t}function g(t){r.dispatch(wo.aX.ACTIONS.DELETE_WORKOUT,{workoutId:t})}return(0,a.YP)((()=>o.params.segmentId),(async t=>{t&&(c.value=+t)})),(t,e)=>{const o=(0,a.up)("Modal"),l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",Do,[m.value?((0,a.wg)(),(0,a.j4)(o,{key:0,title:t.$t("common.CONFIRMATION"),message:t.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:e[0]||(e[0]=t=>g((0,n.SU)(k).workoutId)),onCancelAction:e[1]||(e[1]=t=>f(!1))},null,8,["title","message"])):(0,a.kq)("",!0),(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Wm)(I,{sport:(0,n.SU)(w),workoutObject:(0,n.SU)(k),onDisplayModal:e[2]||(e[2]=t=>f(!0))},null,8,["sport","workoutObject"])])),content:(0,a.w5)((()=>[(0,a.Wm)(To,{workoutData:(0,n.SU)(u),markerCoordinates:(0,n.SU)(i)},null,8,["workoutData","markerCoordinates"]),(0,a.Wm)(zt,{workoutObject:(0,n.SU)(k),useImperialUnits:(0,n.SU)(s).imperial_units,displayHARecord:(0,n.SU)(s).display_ascent},null,8,["workoutObject","useImperialUnits","displayHARecord"])])),_:1})])}}});const Io=(0,D.Z)(Oo,[["__scopeId","data-v-9fc0bab8"]]);var Ao=Io,Co=o(6518);const Ro=t=>{const e=document.getElementById(t);if(e){let t=e.querySelector("ul");return t||(t=document.createElement("ul"),e.appendChild(t)),t}throw new Error("No legend container")},$o={id:"htmlLegend",afterUpdate(t,e,o){const a=Ro(o.containerID);while(a.firstChild)a.firstChild.remove();const n=t.options.plugins?.legend?.labels?.generateLabels?t.options.plugins?.legend?.labels?.generateLabels(t):[];n.forEach((e=>{const o=document.createElement("li");o.onclick=()=>{void 0!==e.datasetIndex&&(t.setDatasetVisibility(e.datasetIndex,!t.isDatasetVisible(e.datasetIndex)),t.update())};const n=document.createElement("input");n&&(n.type="checkbox",n.id=e.text,n.checked=!e.hidden);const l=document.createTextNode(e.text),r=document.createElement("span");r&&(r.style.background=String(e.fillStyle),r.style.borderColor=String(e.strokeStyle)),o.appendChild(n),o.appendChild(l),o.appendChild(r),a.appendChild(o)}))}};var No=o(3768);const xo=t=>((0,a.dD)("data-v-0b68c436"),t=t(),(0,a.Cn)(),t),zo={id:"workout-chart"},Lo={class:"chart-radio"},jo=["checked"],Wo=["checked"],Po=xo((()=>(0,a._)("div",{id:"chart-legend"},null,-1))),Fo={class:"chart-info"},Bo={class:"no-data-cleaning"},Ho={class:"elevation-start"},Mo=["checked"];var qo=(0,a.aZ)({__name:"index",props:{authUser:null,workoutData:null},emits:["getCoordinates"],setup(t,{emit:e}){const o=t,{t:l}=(0,L.QT)(),r=(0,n.iH)(!0),i=(0,n.iH)(!0),u=(0,a.Fl)((()=>(0,No.EX)(o.workoutData.chartData,l,o.authUser.imperial_units))),d=y("km"),c=y("m"),p=(0,a.Fl)((()=>({labels:r.value?u.value.distance_labels:u.value.duration_labels,datasets:JSON.parse(JSON.stringify([u.value.datasets.speed,u.value.datasets.elevation]))}))),m=(0,a.Fl)((()=>u.value.coordinates)),w=(0,a.Fl)((()=>({responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:{x:{grid:{drawOnChartArea:!1},ticks:{count:10,callback:function(t){return r.value?Number(t).toFixed(2):v(t)}},type:"linear",bounds:"data",title:{display:!0,text:r.value?l("workouts.DISTANCE")+` (${d})`:l("workouts.DURATION")}},ySpeed:{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:l("workouts.SPEED")+` (${d}/h)`}},yElevation:{beginAtZero:i.value,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:l("workouts.ELEVATION")+` (${c})`}}},elements:{point:{pointStyle:"circle",pointRadius:0}},plugins:{datalabels:{display:!1},tooltip:{interaction:{intersect:!1,mode:"index"},callbacks:{label:function(t){const e=` ${t.dataset.label}: ${t.formattedValue}`;return"yElevation"===t.dataset.yAxisID?e+` ${c}`:e+` ${d}/h`},title:function(t){return t.length>0&&f(m.value[t[0].dataIndex]),0===t.length?"":r.value?`${l("workouts.DISTANCE")}: ${t[0].label} ${d}`:`${l("workouts.DURATION")}: ${v(t[0].label.replace(",",""))}`}}},legend:{display:!1},htmlLegend:{containerID:"chart-legend"}}}))),{lineChartProps:k}=(0,Co.tn)({chartData:p,options:w,plugins:[$o]});function _(){r.value=!r.value}function v(t){return new Date(1e3*+t).toISOString().substr(11,8)}function f(t){e("getCoordinates",t)}function g(){f({latitude:null,longitude:null})}function y(t){return o.authUser.imperial_units?j.Dl[t].defaultTarget:t}return(t,e)=>{const o=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",zo,[(0,a.Wm)(o,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.ANALYSIS")),1)])),content:(0,a.w5)((()=>[(0,a._)("div",Lo,[(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"distance",checked:r.value,onClick:_},null,8,jo),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.DISTANCE")),1)]),(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"duration",checked:!r.value,onClick:_},null,8,Wo),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.DURATION")),1)])]),Po,(0,a.Wm)((0,n.SU)(Co.wW),(0,a.dG)((0,n.SU)(k),{class:"line-chart",onMouseleave:g}),null,16),(0,a._)("div",Fo,[(0,a._)("div",Bo,(0,s.zw)(t.$t("workouts.NO_DATA_CLEANING")),1),(0,a._)("div",Ho,[(0,a._)("label",null,[(0,a._)("input",{type:"checkbox",checked:i.value,onClick:e[0]||(e[0]=t=>i.value=!i.value)},null,8,Mo),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.START_ELEVATION_AT_ZERO")),1)])])])])),_:1})])}}});const Zo=(0,D.Z)(qo,[["__scopeId","data-v-0b68c436"]]);var Go=Zo,Ko=o(2335);const Vo={id:"workout-note"},Yo=["innerHTML"];var Xo=(0,a.aZ)({__name:"WorkoutNotes",props:{notes:{default:()=>null}},setup(t){const e=t,{notes:o}=(0,n.BK)(e);return(t,e)=>{const l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",Vo,[(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.NOTES")),1)])),content:(0,a.w5)((()=>[(0,a._)("span",{innerHTML:(0,n.SU)(o)&&""!==(0,n.SU)(o)?(0,n.SU)(Ko.O)((0,n.SU)(o)):t.$t("workouts.NO_NOTES")},null,8,Yo)])),_:1})])}}});const Jo=(0,D.Z)(Xo,[["__scopeId","data-v-f6b59442"]]);var Qo=Jo;const ta={id:"workout-segments"};var ea=(0,a.aZ)({__name:"WorkoutSegments",props:{segments:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{segments:o,useImperialUnits:l}=(0,n.BK)(e);return(t,e)=>{const r=(0,a.up)("router-link"),i=(0,a.up)("Distance"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",ta,[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.SEGMENT",2)),1)])),content:(0,a.w5)((()=>[(0,a._)("ul",null,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(o),((e,o)=>((0,a.wg)(),(0,a.iD)("li",{key:e.segment_id},[(0,a.Wm)(r,{to:{name:"WorkoutSegment",params:{workoutId:e.workout_id,segmentId:o+1}}},{default:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.SEGMENT",1))+" "+(0,s.zw)(o+1),1)])),_:2},1032,["to"]),(0,a.Uk)(" ("+(0,s.zw)(t.$t("workouts.DISTANCE"))+": ",1),(0,a.Wm)(i,{distance:e.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(l)},null,8,["distance","useImperialUnits"]),(0,a.Uk)(", "+(0,s.zw)(t.$t("workouts.DURATION"))+": "+(0,s.zw)(e.duration)+") ",1)])))),128))])])),_:1})])}}});const oa=(0,D.Z)(ea,[["__scopeId","data-v-6b8a27cd"]]);var aa=oa;const na=t=>((0,a.dD)("data-v-53c4e53a"),t=t(),(0,a.Cn)(),t),la={id:"workout",class:"view"},ra={class:"container"},sa={key:0,class:"workout-container"},ia={key:0},ua=na((()=>(0,a._)("div",{id:"bottom"},null,-1))),da={key:1};var ca=(0,a.aZ)({__name:"Workout",props:{displaySegment:{type:Boolean}},setup(t){const e=t,o=(0,l.yj)(),s=(0,ko.o)(),{displaySegment:i}=(0,n.BK)(e),u=(0,a.Fl)((()=>s.getters[wo.aX.GETTERS.WORKOUT_DATA])),d=(0,a.Fl)((()=>s.getters[wo.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>s.getters[wo.O8.GETTERS.SPORTS])),p=(0,n.iH)({latitude:null,longitude:null});function m(t){p.value={latitude:t.latitude,longitude:t.longitude}}return(0,a.wF)((()=>{const t={workoutId:o.params.workoutId};e.displaySegment&&(t.segmentId=o.params.segmentId),s.dispatch(wo.aX.ACTIONS.GET_WORKOUT_DATA,t)})),(0,a.Ah)((()=>{s.commit(wo.aX.MUTATIONS.EMPTY_WORKOUT)})),(0,a.YP)((()=>o.params.workoutId),(async t=>{t&&s.dispatch(wo.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:t})})),(0,a.YP)((()=>o.params.segmentId),(async t=>{if(o.params.workoutId){const e={workoutId:o.params.workoutId};t&&(e.segmentId=t),s.dispatch(wo.aX.ACTIONS.GET_WORKOUT_DATA,e)}})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",la,[(0,a._)("div",ra,[(0,n.SU)(c).length>0?((0,a.wg)(),(0,a.iD)("div",sa,[(0,n.SU)(u).workout.id?((0,a.wg)(),(0,a.iD)("div",ia,[(0,a.Wm)(Ao,{workoutData:(0,n.SU)(u),sports:(0,n.SU)(c),authUser:(0,n.SU)(d),markerCoordinates:p.value,displaySegment:(0,n.SU)(i)},null,8,["workoutData","sports","authUser","markerCoordinates","displaySegment"]),(0,n.SU)(u).workout.with_gpx&&(0,n.SU)(u).chartData.length>0?((0,a.wg)(),(0,a.j4)(Go,{key:0,workoutData:(0,n.SU)(u),authUser:(0,n.SU)(d),displaySegment:(0,n.SU)(i),onGetCoordinates:m},null,8,["workoutData","authUser","displaySegment"])):(0,a.kq)("",!0),!(0,n.SU)(i)&&(0,n.SU)(u).workout.segments.length>1?((0,a.wg)(),(0,a.j4)(aa,{key:1,segments:(0,n.SU)(u).workout.segments,useImperialUnits:(0,n.SU)(d).imperial_units},null,8,["segments","useImperialUnits"])):(0,a.kq)("",!0),(0,n.SU)(i)?(0,a.kq)("",!0):((0,a.wg)(),(0,a.j4)(Qo,{key:2,notes:(0,n.SU)(u).workout.notes},null,8,["notes"])),ua])):((0,a.wg)(),(0,a.iD)("div",da,[(0,n.SU)(u).loading?(0,a.kq)("",!0):((0,a.wg)(),(0,a.j4)(r.Z,{key:0,target:"WORKOUT"}))]))])):(0,a.kq)("",!0)])]))}});const pa=(0,D.Z)(ca,[["__scopeId","data-v-53c4e53a"]]);var ma=pa},9628:function(t,e,o){o.r(e),o.d(e,{default:function(){return Ft}});var a=o(6252),n=o(2262),l=o(3577),r=o(9150),s=(o(7658),o(2201)),i=o(631),u=o(3649);const d=t=>((0,a.dD)("data-v-6c38593a"),t=t(),(0,a.Cn)(),t),c={class:"workouts-filters"},p={class:"box"},m={class:"form"},w={class:"form-items-group"},k={class:"form-item"},_=["value"],v={class:"form-item"},f=["value"],g={class:"form-items-group"},y={class:"form-item"},S=["value"],U=d((()=>(0,a._)("option",{value:""},null,-1))),h=["value"],b={class:"form-items-group"},T={class:"form-item"},E={class:"form-inputs-group"},D=["value"],O=["value"],I={class:"form-items-group"},A={class:"form-item"},C={class:"form-inputs-group"},R=["value"],$=["value"],N={class:"form-items-group"},x={class:"form-item"},z={class:"form-inputs-group"},L=["value"],j=["value"],W={class:"form-items-group"},P={class:"form-item"},F={class:"form-inputs-group"},B=["value"],H=["value"],M={class:"form-button"};var q=(0,a.aZ)({__name:"WorkoutsFilters",props:{authUser:null,sports:null},emits:["filter"],setup(t,{emit:e}){const o=t,{t:d}=(0,r.QT)(),q=(0,s.yj)(),Z=(0,s.tv)(),{authUser:G}=(0,n.BK)(o),K=G.value.imperial_units?u.Dl.km.defaultTarget:"km",V=(0,a.Fl)((()=>(0,i.xH)(o.sports,d)));let Y=Object.assign({},q.query);function X(t){""===t.target.value?delete Y[t.target.name]:Y[t.target.name]=t.target.value}function J(){e("filter"),"page"in Y&&(Y["page"]="1"),Z.push({path:"/workouts",query:Y})}function Q(){e("filter"),Z.push({path:"/workouts",query:{}})}return(0,a.YP)((()=>q.query),(t=>{Y=Object.assign({},t)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",p,[(0,a._)("div",m,[(0,a._)("div",w,[(0,a._)("div",k,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.FROM"))+": ",1),(0,a._)("input",{name:"from",type:"date",value:t.$route.query.from,onChange:X},null,40,_)]),(0,a._)("div",v,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.TO"))+": ",1),(0,a._)("input",{name:"to",type:"date",value:t.$route.query.to,onChange:X},null,40,f)])]),(0,a._)("div",g,[(0,a._)("div",y,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.SPORT",1))+":",1),(0,a._)("select",{name:"sport_id",value:t.$route.query.sport_id,onChange:X},[U,((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(V).filter((t=>(0,n.SU)(G).sports_list.includes(t.id))),(t=>((0,a.wg)(),(0,a.iD)("option",{value:t.id,key:t.id},(0,l.zw)(t.translatedLabel),9,h)))),128))],40,S)])]),(0,a._)("div",b,[(0,a._)("div",T,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,l.zw)((0,n.SU)(K))+"): ",1),(0,a._)("div",E,[(0,a._)("input",{name:"distance_from",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_from,onChange:X},null,40,D),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{name:"distance_to",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_to,onChange:X},null,40,O)])])]),(0,a._)("div",I,[(0,a._)("div",A,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DURATION"))+": ",1),(0,a._)("div",C,[(0,a._)("input",{name:"duration_from",value:t.$route.query.duration_from,onChange:X,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,R),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{name:"duration_to",value:t.$route.query.duration_to,onChange:X,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,$)])])]),(0,a._)("div",N,[(0,a._)("div",x,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.AVE_SPEED"))+" ("+(0,l.zw)((0,n.SU)(K))+"/h): ",1),(0,a._)("div",z,[(0,a._)("input",{min:"0",name:"ave_speed_from",value:t.$route.query.ave_speed_from,onChange:X,step:"0.1",type:"number"},null,40,L),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{min:"0",name:"ave_speed_to",value:t.$route.query.ave_speed_to,onChange:X,step:"0.1",type:"number"},null,40,j)])])]),(0,a._)("div",W,[(0,a._)("div",P,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.MAX_SPEED"))+" ("+(0,l.zw)((0,n.SU)(K))+"/h): ",1),(0,a._)("div",F,[(0,a._)("input",{min:"0",name:"max_speed_from",value:t.$route.query.max_speed_from,onChange:X,step:"0.1",type:"number"},null,40,B),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{min:"0",name:"max_speed_to",value:t.$route.query.max_speed_to,onChange:X,step:"0.1",type:"number"},null,40,H)])])])]),(0,a._)("div",M,[(0,a._)("button",{class:"confirm",onClick:J},(0,l.zw)(t.$t("buttons.FILTER")),1),(0,a._)("button",{class:"confirm",onClick:Q},(0,l.zw)(t.$t("buttons.CLEAR_FILTER")),1)])])]))}}),Z=o(3744);const G=(0,Z.Z)(q,[["__scopeId","data-v-6c38593a"]]);var K=G,V=o(8626),Y=o(5020),X=o(2056),J=o(5630),Q=o(5801),tt=o(9917),et=o(2766),ot=o(6558),at=o(3768);const nt=t=>((0,a.dD)("data-v-19504874"),t=t(),(0,a.Cn)(),t),lt={class:"workouts-list"},rt={class:"total"},st={class:"total-label"},it={key:0},ut={key:0,class:"workouts-table responsive-table"},dt=nt((()=>(0,a._)("th",{class:"sport-col"},null,-1))),ct={class:"sport-col"},pt={class:"cell-heading"},mt=["onMouseover"],wt={class:"cell-heading"},kt={key:0,class:"fa fa-map-o","aria-hidden":"true"},_t={class:"title"},vt={class:"workout-date"},ft={class:"cell-heading"},gt={class:"text-right"},yt={class:"cell-heading"},St={class:"text-right"},Ut={class:"cell-heading"},ht={class:"text-right"},bt={class:"cell-heading"},Tt={class:"text-right"},Et={class:"cell-heading"},Dt={class:"text-right"},Ot={class:"cell-heading"},It={class:"text-right"},At={class:"cell-heading"},Ct=nt((()=>(0,a._)("div",{id:"bottom"},null,-1)));var Rt=(0,a.aZ)({__name:"WorkoutsList",props:{user:null,sports:null},setup(t){const e=t,o=(0,tt.o)(),r=(0,s.yj)(),d=(0,s.tv)(),{user:c,sports:p}=(0,n.BK)(e),m=["ave_speed","distance","duration","workout_date"],w=(0,a.Fl)((()=>o.getters[Q.aX.GETTERS.USER_WORKOUTS])),k=(0,a.Fl)((()=>o.getters[Q.aX.GETTERS.WORKOUTS_PAGINATION])),_=(0,a.Fl)((()=>o.getters[Q.SY.GETTERS.LANGUAGE]));let v=S(r.query);const f=(0,n.iH)(null);function g(t){o.dispatch(Q.aX.ACTIONS.GET_USER_WORKOUTS,c.value.imperial_units?U(t):t)}function y(t,e){const o=Object.assign({},r.query);o[t]=e,"per_page"===t&&(o["page"]="1"),v=S(o),d.push({path:"/workouts",query:v})}function S(t){const e=(0,et.pm)(t,m,at.eR.order_by,{defaultSort:at.eR.order});return Object.keys(t).filter((t=>et.Ne.includes(t))).map((o=>{"string"===typeof t[o]&&(e[o]=t[o])})),e}function U(t){const e={...t};return Object.entries(e).map((t=>{t[0].match("speed|distance")&&t[1]&&(e[t[0]]=(0,u.sC)(+t[1],"mi","km"))})),e}function h(t){f.value=t}return(0,a.wF)((()=>{g(v)})),(0,a.YP)((()=>r.query),(async t=>{v=S(t),g(v)})),(t,e)=>{const o=(0,a.up)("SportImage"),r=(0,a.up)("router-link"),s=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",lt,[(0,a._)("div",{class:(0,l.C_)(["box",{"empty-table":0===(0,n.SU)(w).length}])},[(0,a._)("div",rt,[(0,a._)("span",st,(0,l.zw)(t.$t("common.TOTAL").toLowerCase())+": ",1),null!==(0,n.SU)(k).total?((0,a.wg)(),(0,a.iD)("span",it,(0,l.zw)((0,n.SU)(k).total)+" "+(0,l.zw)(t.$t("workouts.WORKOUT",(0,n.SU)(k).total)),1)):(0,a.kq)("",!0)]),(0,a.Wm)(V.Z,{sort:(0,n.SU)(et.fS),order_by:m,query:(0,n.SU)(v),message:"workouts",onUpdateSelect:y},null,8,["sort","query"]),(0,n.SU)(w).length>0?((0,a.wg)(),(0,a.iD)("div",ut,[(0,a.Wm)(Y.Z,{class:"top-pagination",pagination:(0,n.SU)(k),path:"/workouts",query:(0,n.SU)(v)},null,8,["pagination","query"]),(0,a._)("table",null,[(0,a._)("thead",{class:(0,l.C_)({smaller:"de"===(0,n.SU)(_)})},[(0,a._)("tr",null,[dt,(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DATE"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DISTANCE"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DURATION"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.AVE_SPEED"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.MAX_SPEED"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.ASCENT"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DESCENT"))),1)])],2),(0,a._)("tbody",null,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(w),(u=>((0,a.wg)(),(0,a.iD)("tr",{key:u.id},[(0,a._)("td",ct,[(0,a._)("span",pt,(0,l.zw)(t.$t("workouts.SPORT",1)),1),(0,n.SU)(p).length>0?((0,a.wg)(),(0,a.j4)(o,{key:0,title:(0,n.SU)(p).find((t=>t.id===u.sport_id)).translatedLabel,"sport-label":(0,n.SU)(i.PA)(u,(0,n.SU)(p)),color:(0,n.SU)(i.CM)(u,(0,n.SU)(p))},null,8,["title","sport-label","color"])):(0,a.kq)("",!0)]),(0,a._)("td",{class:"workout-title",onMouseover:t=>h(u.id),onMouseleave:e[0]||(e[0]=t=>h(null))},[(0,a._)("span",wt,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a.Wm)(r,{class:"nav-item",to:{name:"Workout",params:{workoutId:u.id}}},{default:(0,a.w5)((()=>[u.with_gpx?((0,a.wg)(),(0,a.iD)("i",kt)):(0,a.kq)("",!0),(0,a._)("span",_t,(0,l.zw)(u.title),1)])),_:2},1032,["to"]),u.with_gpx&&f.value===u.id?((0,a.wg)(),(0,a.j4)(X.Z,{key:0,workout:u,"display-hover":!0},null,8,["workout"])):(0,a.kq)("",!0)],40,mt),(0,a._)("td",vt,[(0,a._)("span",ft,(0,l.zw)(t.$t("workouts.DATE")),1),(0,a.Uk)(" "+(0,l.zw)((0,n.SU)(ot.p6)(u.workout_date,(0,n.SU)(c).timezone,(0,n.SU)(c).date_format)),1)]),(0,a._)("td",gt,[(0,a._)("span",yt,(0,l.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Wm)(s,{distance:u.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",St,[(0,a._)("span",Ut,(0,l.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(" "+(0,l.zw)(u.moving),1)]),(0,a._)("td",ht,[(0,a._)("span",bt,(0,l.zw)(t.$t("workouts.AVE_SPEED")),1),(0,a.Wm)(s,{distance:u.ave_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Tt,[(0,a._)("span",Et,(0,l.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Wm)(s,{distance:u.max_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Dt,[(0,a._)("span",Ot,(0,l.zw)(t.$t("workouts.ASCENT")),1),null!==u.ascent?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:u.ascent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)]),(0,a._)("td",It,[(0,a._)("span",At,(0,l.zw)(t.$t("workouts.DESCENT")),1),null!==u.descent?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:u.descent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)])])))),128))])]),(0,a.Wm)(Y.Z,{pagination:(0,n.SU)(k),path:"/workouts",query:(0,n.SU)(v)},null,8,["pagination","query"])])):(0,a.kq)("",!0)],2),0===(0,n.SU)(w).length?((0,a.wg)(),(0,a.j4)(J.Z,{key:0})):(0,a.kq)("",!0),Ct])}}});const $t=(0,Z.Z)(Rt,[["__scopeId","data-v-19504874"]]);var Nt=$t;const xt={key:0,id:"workouts",class:"view"},zt={class:"container workouts-container"},Lt={class:"display-filters"},jt={class:"list-container"};var Wt=(0,a.aZ)({__name:"WorkoutsView",setup(t){const{t:e}=(0,r.QT)(),o=(0,tt.o)(),s=(0,a.Fl)((()=>o.getters[Q.YN.GETTERS.AUTH_USER_PROFILE])),u=(0,a.Fl)((()=>o.getters[Q.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>(0,i.xH)(u.value,e))),c=(0,n.iH)(!0);function p(){c.value=!c.value}return(t,e)=>(0,n.SU)(s).username?((0,a.wg)(),(0,a.iD)("div",xt,[(0,a._)("div",zt,[(0,a._)("div",{class:(0,l.C_)(["filters-container",{hidden:c.value}])},[(0,a.Wm)(K,{sports:(0,n.SU)(d),authUser:(0,n.SU)(s),onFilter:p},null,8,["sports","authUser"])],2),(0,a._)("div",Lt,[(0,a._)("div",{onClick:p},[(0,a._)("i",{class:(0,l.C_)("fa fa-caret-"+(c.value?"down":"up")),"aria-hidden":"true"},null,2),(0,a._)("span",null,(0,l.zw)(t.$t(`workouts.${c.value?"DISPLAY":"HIDE"}_FILTERS`)),1)])]),(0,a._)("div",jt,[(0,a.Wm)(Nt,{user:(0,n.SU)(s),sports:(0,n.SU)(d)},null,8,["user","sports"])])])])):(0,a.kq)("",!0)}});const Pt=(0,Z.Z)(Wt,[["__scopeId","data-v-57ec0168"]]);var Ft=Pt}}]);
|
|
//# sourceMappingURL=workouts.664239b3.js.map
|