FitTrackee/fittrackee/dist/static/js/workouts.64a95f47.js
2023-07-22 11:36:58 +02:00

2 lines
82 KiB
JavaScript

"use strict";(self["webpackChunkfittrackee_client"]=self["webpackChunkfittrackee_client"]||[]).push([[401],{2537: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 v={id:"workout-form"},y=["onSubmit"],k={class:"form-items"},f={key:0,class:"form-item-radio"},_=["checked","disabled"],g={for:"withGpx"},S=["checked","disabled"],h={for:"withoutGpx"},b={class:"form-item"},U=["disabled"],T=["value"],O={key:1,class:"form-item"},E={for:"gpxFile"},D=["disabled"],I={class:"files-help info-box"},A={key:2,class:"form-item"},C={for:"title"},R=["required","disabled"],$={key:3},L={class:"workout-date-duration"},N={class:"form-item"},j={class:"workout-date-time"},x=["disabled"],z=["disabled"],W={class:"form-item"},F=["disabled"],B=["disabled"],H=["disabled"],P={class:"workout-data"},Z={class:"form-item"},M=["disabled"],q={class:"form-item"},K=["disabled"],G={class:"form-item"},Y=["disabled"],X={class:"form-item"},V={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 vt=null;const yt=(0,l.iH)(!1),kt=(0,l.iH)([]);function ft(t){mt.notes=t}function _t(){wt.value=!wt.value,yt.value=!1}function gt(t){t.target.files&&(vt=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 ht(){return kt.value.includes("workouts.INVALID_DISTANCE")}function bt(){return kt.value.includes("workouts.INVALID_DURATION")}function Ut(){return kt.value.includes("workouts.INVALID_ASCENT_OR_DESCENT")}function Tt(t){kt.value=[],t.title=mt.title,t.duration=3600*+mt.workoutDurationHour+60*+mt.workoutDurationMinutes+ +mt.workoutDurationSeconds,t.duration<=0&&kt.value.push("workouts.INVALID_DURATION"),t.distance=at.value.imperial_units?(0,w.sC)(+mt.workoutDistance,"mi","km",3):+mt.workoutDistance,t.distance<=0&&kt.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)&&kt.value.push("workouts.INVALID_ASCENT_OR_DESCENT")}function Ot(){const t={sport_id:+mt.sport_id,notes:mt.notes};if(e.workout.id)e.workout.with_gpx?t.title=mt.title:Tt(t),kt.value.length>0?et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,kt.value):et.dispatch(u.aX.ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t});else if(wt.value){if(!vt){const t="workouts.NO_FILE_PROVIDED";return void et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,t)}t.file=vt,et.dispatch(u.aX.ACTIONS.ADD_WORKOUT,t)}else Tt(t),kt.value.length>0?et.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,kt.value):et.dispatch(u.aX.ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function Et(){e.workout.id?ot.push({name:"Workout",params:{workoutId:e.workout.id}}):ot.go(-1)}function Dt(){yt.value=!0}return(0,a.bv)((()=>{let t;e.workout.id?(St(e.workout),t=document.getElementById("sport")):t=document.getElementById("withGpx"),t&&t.focus()})),(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",v,[(0,a._)("form",{class:(0,n.C_)({errors:yt.value}),onSubmit:(0,r.iM)(Ot,["prevent"])},[(0,a._)("div",k,[(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:_t},null,8,_),(0,a._)("label",g,(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:_t},null,8,S),(0,a._)("label",h,(0,n.zw)(t.$t("workouts.WITHOUT_GPX")),1)])])):(0,a.kq)("",!0),(0,a._)("div",b,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.SPORT",1))+"*: ",1),(0,a.wy)((0,a._)("select",{id:"sport",required:"",onInvalid:Dt,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,U),[[r.bM,mt.sport_id]])]),(0,l.SU)(lt)&&wt.value?((0,a.wg)(),(0,a.iD)("div",O,[(0,a._)("label",E,(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:Dt,onInput:gt},null,40,D),(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:Dt,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",L,[(0,a._)("div",N,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.WORKOUT_DATE"))+"*:",1),(0,a._)("div",j,[(0,a.wy)((0,a._)("input",{id:"workout-date",name:"workout-date",type:"date",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[2]||(e[2]=t=>mt.workoutDate=t)},null,40,x),[[r.nr,mt.workoutDate]]),(0,a.wy)((0,a._)("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[3]||(e[3]=t=>mt.workoutTime=t)},null,40,z),[[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:bt()}]),type:"text",placeholder:"HH",minlength:"1",maxlength:"2",pattern:"^([0-1]?[0-9]|2[0-3])$",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[4]||(e[4]=t=>mt.workoutDurationHour=t)},null,42,F),[[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:bt()}]),type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"MM",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[5]||(e[5]=t=>mt.workoutDurationMinutes=t)},null,42,B),[[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:bt()}]),type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"SS",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[6]||(e[6]=t=>mt.workoutDurationSeconds=t)},null,42,H),[[r.nr,mt.workoutDurationSeconds]])])])]),(0,a._)("div",P,[(0,a._)("div",Z,[(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:ht()}),name:"workout-distance",type:"number",min:"0",step:"0.001",required:"",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[7]||(e[7]=t=>mt.workoutDistance=t)},null,42,M),[[r.nr,mt.workoutDistance]])]),(0,a._)("div",q,[(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:Ut()}),name:"workout-ascent",type:"number",min:"0",step:"0.01",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[8]||(e[8]=t=>mt.workoutAscent=t)},null,42,K),[[r.nr,mt.workoutAscent]])]),(0,a._)("div",G,[(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:Ut()}),name:"workout-descent",type:"number",min:"0",step:"0.01",onInvalid:Dt,disabled:(0,l.SU)(rt),"onUpdate:modelValue":e[9]||(e[9]=t=>mt.workoutDescent=t)},null,42,Y),[[r.nr,mt.workoutDescent]])])])])),(0,a._)("div",X,[(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",V,[(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)(Et,["prevent"])},(0,n.zw)(t.$t("buttons.CANCEL")),9,tt)]))],42,y)])])),_:1})],2)}}}),ot=o(3744);const at=(0,ot.Z)(et,[["__scopeId","data-v-5f89aca6"]]);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(2537),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(2537),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},7729:function(t,e,o){o.r(e),o.d(e,{default:function(){return en}});var a=o(6252),n=o(2262),l=o(2201),r=o(8273),s=o(9963),i=(o(7658),o(3577)),u=o(5167);const d=t=>((0,a.dD)("data-v-5568f498"),t=t(),(0,a.Cn)(),t),c={id:"workout-card-title"},p=["disabled","title"],m=d((()=>(0,a._)("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1))),w=[m],v={class:"workout-card-title"},y={class:"workout-title-date"},k={key:0,class:"workout-title"},f=["aria-label"],_=d((()=>(0,a._)("i",{class:"fa fa-edit","aria-hidden":"true"},null,-1))),g=[_],S=["aria-label"],h=d((()=>(0,a._)("i",{class:"fa fa-download","aria-hidden":"true"},null,-1))),b=[h],U=["aria-label"],T=d((()=>(0,a._)("i",{class:"fa fa-trash","aria-hidden":"true"},null,-1))),O=[T],E={key:1,class:"workout-title"},D={class:"workout-segment"},I=d((()=>(0,a._)("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1))),A={class:"workout-date"},C={class:"workout-link"},R=["disabled","title"],$=d((()=>(0,a._)("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1))),L=[$];var N=(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()}))}function m(t){t.target.blur(),e("displayModal",!0)}return(t,e)=>{const o=(0,a.up)("SportImage"),u=(0,a.up)("router-link");return(0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("button",{class:(0,i.C_)(["workout-previous workout-arrow transparent",{inactive:!(0,n.SU)(r).previousUrl}]),disabled:!(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:e[0]||(e[0]=e=>(0,n.SU)(r).previousUrl?t.$router.push((0,n.SU)(r).previousUrl):null)},w,10,p),(0,a._)("div",v,[(0,a.Wm)(o,{"sport-label":(0,n.SU)(l).label,color:(0,n.SU)(l).color},null,8,["sport-label","color"]),(0,a._)("div",y,["WORKOUT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.iD)("div",k,[(0,a._)("span",null,(0,i.zw)((0,n.SU)(r).title),1),(0,a._)("button",{class:"transparent icon-button",onClick:e[1]||(e[1]=e=>t.$router.push({name:"EditWorkout",params:{workoutId:(0,n.SU)(r).workoutId}})),"aria-label":t.$t("workouts.EDIT_WORKOUT")},g,8,f),(0,n.SU)(r).with_gpx?((0,a.wg)(),(0,a.iD)("button",{key:0,class:"transparent icon-button",onClick:e[2]||(e[2]=(0,s.iM)((t=>d((0,n.SU)(r).workoutId)),["prevent"])),"aria-label":t.$t("workouts.DOWNLOAD_WORKOUT")},b,8,S)):(0,a.kq)("",!0),(0,a._)("button",{id:"delete-workout-button",class:"transparent icon-button",onClick:m,"aria-label":t.$t("workouts.DELETE_WORKOUT")},O,8,U)])):((0,a.wg)(),(0,a.iD)("div",E,[(0,a.Uk)((0,i.zw)((0,n.SU)(r).title)+" ",1),(0,a._)("span",D,[(0,a.Uk)(" — "),I,(0,a.Uk)(" "+(0,i.zw)(t.$t("workouts.SEGMENT"))+" "+(0,i.zw)((0,n.SU)(r).segmentId+1),1)])])),(0,a._)("div",A,[(0,a._)("time",null,(0,i.zw)((0,n.SU)(r).workoutDate)+" - "+(0,i.zw)((0,n.SU)(r).workoutTime),1),(0,a._)("span",C,["SEGMENT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.j4)(u,{key:0,to:{name:"Workout",params:{workoutId:(0,n.SU)(r).workoutId}}},{default:(0,a.w5)((()=>[(0,a.Uk)(" > "+(0,i.zw)(t.$t("workouts.BACK_TO_WORKOUT")),1)])),_:1},8,["to"])):(0,a.kq)("",!0)])])])]),(0,a._)("button",{class:(0,i.C_)(["workout-next workout-arrow transparent",{inactive:!(0,n.SU)(r).nextUrl}]),disabled:!(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:e[3]||(e[3]=e=>(0,n.SU)(r).nextUrl?t.$router.push((0,n.SU)(r).nextUrl):null)},L,10,R)])}}}),j=o(3744);const x=(0,j.Z)(N,[["__scopeId","data-v-5568f498"]]);var z=x;const W=t=>((0,a.dD)("data-v-1a5282f6"),t=t(),(0,a.Cn)(),t),F={key:0,class:"workout-record"},B=W((()=>(0,a._)("sup",null,[(0,a._)("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1))),H=[B];var P=(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",F,H)):(0,a.kq)("",!0)}});const Z=(0,j.Z)(P,[["__scopeId","data-v-1a5282f6"]]);var M=Z,q=o(9150),K=o(3649);const G=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],Y=t=>{const e=Math.floor(t/22.5+.5);return G[e%16]},X={class:"wind"},V={class:"wind-bearing"},J=["title"];var Q=(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,q.QT)();function s(t){return r(`workouts.WEATHER.WIND_DIRECTIONS.${Y(t)}`)}return(t,e)=>((0,a.wg)(),(0,a.iD)("div",X,[(0,a.Uk)((0,i.zw)((0,n.SU)(K.Y2)((0,n.SU)(l).wind,(0,n.SU)(o)))+" ",1),(0,a._)("div",V,[(0,n.SU)(l).windBearing?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-long-arrow-down",style:(0,i.j5)({transform:`rotate(${(0,n.SU)(l).windBearing}deg)`}),"aria-hidden":"true",title:s((0,n.SU)(l).windBearing)},null,12,J)):(0,a.kq)("",!0)])]))}});const tt=(0,j.Z)(Q,[["__scopeId","data-v-40697ed1"]]);var et=tt;const ot=t=>((0,a.dD)("data-v-807b431a"),t=t(),(0,a.Cn)(),t),at={key:0,id:"workout-weather"},nt={class:"weather-table"},lt=ot((()=>(0,a._)("th",null,null,-1))),rt={class:"weather-th"},st=["src","alt","title"],it={class:"weather-th"},ut=["src","alt","title"],dt=["alt","title"],ct=["alt","title"],pt=["alt","title"];var mt=(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",at,[(0,a._)("table",nt,[(0,a._)("thead",null,[(0,a._)("tr",null,[lt,(0,a._)("th",null,[(0,a._)("div",rt,[(0,a.Uk)((0,i.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,st)])]),(0,a._)("th",null,[(0,a._)("div",it,[(0,a.Uk)((0,i.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,ut)])])])]),(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,dt)]),(0,a._)("td",null,(0,i.zw)((0,n.SU)(K.x$)((0,n.SU)(l).weatherStart.temperature,(0,n.SU)(o))),1),(0,a._)("td",null,(0,i.zw)((0,n.SU)(K.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,ct)]),(0,a._)("td",null,(0,i.zw)(Number(100*(0,n.SU)(l).weatherStart.humidity).toFixed(1))+"% ",1),(0,a._)("td",null,(0,i.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,pt)]),(0,a._)("td",null,[(0,a.Wm)(et,{weather:(0,n.SU)(l).weatherStart,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])]),(0,a._)("td",null,[(0,a.Wm)(et,{weather:(0,n.SU)(l).weatherEnd,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])])])])])])):(0,a.kq)("",!0)}});const wt=(0,j.Z)(mt,[["__scopeId","data-v-807b431a"]]);var vt=wt;const yt=t=>((0,a.dD)("data-v-74c5993b"),t=t(),(0,a.Cn)(),t),kt={id:"workout-info"},ft={class:"workout-data"},_t=yt((()=>(0,a._)("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1))),gt={class:"label"},St={class:"value"},ht={key:0},bt={class:"value"},Ut={class:"value"},Tt={class:"workout-data"},Ot=yt((()=>(0,a._)("i",{class:"fa fa-road","aria-hidden":"true"},null,-1))),Et={class:"label"},Dt={class:"workout-data"},It=yt((()=>(0,a._)("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1))),At={class:"label"},Ct=yt((()=>(0,a._)("br",null,null,-1))),Rt={class:"label"},$t={key:0,class:"workout-data"},Lt=["alt"],Nt={class:"label"},jt=yt((()=>(0,a._)("br",null,null,-1))),xt={class:"label"},zt={key:1,class:"workout-data"},Wt=yt((()=>(0,a._)("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1))),Ft={class:"label"},Bt=yt((()=>(0,a._)("br",null,null,-1))),Ht={class:"label"};var Pt=(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),s=(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",kt,[(0,a._)("div",ft,[_t,(0,a._)("span",gt,(0,i.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(": "),(0,a._)("span",St,(0,i.zw)((0,n.SU)(l).moving),1),(0,a.Wm)(M,{workoutObject:(0,n.SU)(l),recordType:"LD"},null,8,["workoutObject"]),(0,n.SU)(s)?((0,a.wg)(),(0,a.iD)("div",ht,[(0,a.Uk)(" ("+(0,i.zw)(t.$t("workouts.PAUSES"))+": ",1),(0,a._)("span",bt,(0,i.zw)((0,n.SU)(l).pauses),1),(0,a.Uk)(" - "+(0,i.zw)(t.$t("workouts.TOTAL_DURATION"))+": ",1),(0,a._)("span",Ut,(0,i.zw)((0,n.SU)(l).duration)+")",1)])):(0,a.kq)("",!0)]),(0,a._)("div",Tt,[Ot,(0,a._)("span",Et,(0,i.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)(M,{workoutObject:(0,n.SU)(l),recordType:"FD"},null,8,["workoutObject"])]),(0,a._)("div",Dt,[It,(0,a._)("span",At,(0,i.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)(M,{workoutObject:(0,n.SU)(l),recordType:"AS"},null,8,["workoutObject"]),Ct,(0,a._)("span",Rt,(0,i.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)(M,{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",$t,[(0,a._)("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:t.$t("workouts.ELEVATION")},null,8,Lt),(0,a._)("span",Nt,(0,i.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"]),jt,(0,a._)("span",xt,(0,i.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",zt,[Wt,(0,a._)("span",Ft,(0,i.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)(M,{key:0,workoutObject:(0,n.SU)(l),recordType:"HA"},null,8,["workoutObject"])):(0,a.kq)("",!0),Bt,(0,a._)("span",Ht,(0,i.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)(vt,{workoutObject:(0,n.SU)(l),useImperialUnits:(0,n.SU)(r)},null,8,["workoutObject","useImperialUnits"])])}}});const Zt=(0,j.Z)(Pt,[["__scopeId","data-v-74c5993b"]]);var Mt=Zt;function qt(t,e){return Array.from(t.getElementsByTagName(e))}function Kt(t){return t?.normalize(),t&&t.textContent||""}function Gt(t,e,o){const a=t.getElementsByTagName(e),n=a.length?a[0]:null;return n&&o&&o(n),n}function Yt(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 Xt(t,e,o){const a=Kt(Gt(t,e));return a&&o&&o(a)||{}}function Vt(t,e,o){const a=parseFloat(Kt(Gt(t,e)));if(!isNaN(a))return a&&o&&o(a)||{}}function Jt(t,e,o){const a=parseFloat(Kt(Gt(t,e)));if(!isNaN(a))return o&&o(a),a}function Qt(t,e){const o={};for(const a of e)Xt(t,a,(t=>{o[a]=t}));return o}function te(t){return 1===t?.nodeType}function ee(t){return Yt(t,"line",(t=>{const e=Object.assign({},Xt(t,"color",(t=>({stroke:`#${t}`}))),Vt(t,"opacity",(t=>({"stroke-opacity":t}))),Vt(t,"width",(t=>({"stroke-width":96*t/25.4}))));return e}))}function oe(t){let e=[];if(null===t)return e;for(const o of Array.from(t.childNodes)){if(!te(o))continue;const t=ae(o.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(oe(o));else{const a=Kt(o);e.push([t,ne(a)])}}return e}function ae(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function ne(t){const e=parseFloat(t);return isNaN(e)?t:e}function le(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;Jt(t,"ele",(t=>{e.push(t)}));const o=Gt(t,"time");return{coordinates:e,time:o?Kt(o):null,extendedValues:oe(Gt(t,"extensions"))}}function re(t){const e=Qt(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(":","_")]=Kt(n));const a=qt(t,"link");return a.length&&(e.links=a.map((t=>Object.assign({href:t.getAttribute("href")},Qt(t,["text","type"]))))),e}function se(t,e){const o=qt(t,e),a=[],n=[],l={};for(let r=0;r<o.length;r++){const t=le(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 ie(t){const e=se(t,"rtept");if(e)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},re(t),ee(Gt(t,"extensions"))),geometry:{type:"LineString",coordinates:e.line}}}function ue(t){const e=qt(t,"trkseg"),o=[],a=[],n=[];for(const s of e){const t=se(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"},re(t),ee(Gt(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 de(t){const e=Object.assign(re(t),Qt(t,["sym"])),o=le(t);return o?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:o.coordinates}}:null}function*ce(t){for(const e of qt(t,"trk")){const t=ue(e);t&&(yield t)}for(const e of qt(t,"rte")){const t=ie(e);t&&(yield t)}for(const e of qt(t,"wpt")){const t=de(e);t&&(yield t)}}function pe(t){return{type:"FeatureCollection",features:Array.from(ce(t))}}Math.PI;const me=(t,e)=>{for(const o of Object.keys(e))t.on(o,e[o])},we=t=>{for(const e of Object.keys(t)){const o=t[e];o&&ye(o.cancel)&&o.cancel()}},ve=t=>t&&"function"==typeof t.charAt?t.charAt(0).toUpperCase()+t.slice(1):t,ye=t=>"function"==typeof t,ke=(t,e,o)=>{for(const n in o){const l="set"+ve(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)}))}},fe=(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},_e=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},ge=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})},Se=t=>{const e=(0,n.iH)(((...e)=>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},he=(t,e)=>t.wrapped.value=e,be="object"==typeof self&&self.self===self&&self||"object"==typeof o.g&&o.g.global===o.g&&o.g||globalThis,Ue=t=>{const e=(0,a.f3)(t);if(!e)throw new Error(`Attempt to inject ${t} before it was provided.`);return e},Te=Symbol(),Oe=Symbol(),Ee=Symbol(),De=Symbol(),Ie=Symbol(),Ae=Symbol(),Ce=Symbol(),Re=Symbol(),$e=Symbol(),Le=Symbol(),Ne=Symbol(),je=Symbol(),xe={options:{type:Object,default:()=>({}),custom:!0}},ze=t=>({options:t.options,methods:{}}),We={...xe,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},Fe=(t,e,o)=>{const n=Ue(Oe),l=Ue(Ee),{options:r,methods:s}=ze(t),i=fe(t,We,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(t){e.value&&ye(e.value.bindPopup)?e.value.bindPopup(t):console.warn("Attempt to bind popup before bindPopup method available on layer.")},bindTooltip(t){e.value&&ye(e.value.bindTooltip)?e.value.bindTooltip(t):console.warn("Attempt to bind tooltip before bindTooltip method available on layer.")},unbindTooltip(){e.value&&(ye(e.value.closeTooltip)&&e.value.closeTooltip(),ye(e.value.unbindTooltip)&&e.value.unbindTooltip())},unbindPopup(){e.value&&(ye(e.value.closePopup)&&e.value.closePopup(),ye(e.value.unbindPopup)&&e.value.unbindPopup())},updateVisibleProp(t){o.emit("update:visible",t)}};return(0,a.JJ)($e,c.bindPopup),(0,a.JJ)(Le,c.bindTooltip),(0,a.JJ)(Ne,c.unbindPopup),(0,a.JJ)(je,c.unbindTooltip),(0,a.Ah)((()=>{c.unbindPopup(),c.unbindTooltip(),d()})),{options:i,methods:c}},Be=(t,e)=>{if(t&&e.default)return(0,a.h)("div",{style:{display:"none"}},e.default())},He={...We,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},Pe=(t,e,o)=>{const{options:a,methods:n}=Fe(t,e,o);return{options:fe(t,He,a),methods:n}},Ze={...He,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}},Me=(t,e,o)=>{const{options:n,methods:l}=Pe(t,e,o),r=fe(t,Ze,n),s=Ue(Ee),i={...l,setStroke(t){e.value.setStyle({stroke:t})},setColor(t){e.value.setStyle({color:t})},setWeight(t){e.value.setStyle({weight:t})},setOpacity(t){e.value.setStyle({opacity:t})},setLineCap(t){e.value.setStyle({lineCap:t})},setLineJoin(t){e.value.setStyle({lineJoin:t})},setDashArray(t){e.value.setStyle({dashArray:t})},setDashOffset(t){e.value.setStyle({dashOffset:t})},setFill(t){e.value.setStyle({fill:t})},setFillColor(t){e.value.setStyle({fillColor:t})},setFillOpacity(t){e.value.setStyle({fillOpacity:t})},setFillRule(t){e.value.setStyle({fillRule:t})},setClassName(t){e.value.setStyle({className:t})}};return(0,a.Jd)((()=>{s({leafletObject:e.value})})),{options:r,methods:i}},qe={...Ze,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}},Ke=(t,e,o)=>{const{options:a,methods:n}=Me(t,e,o),l=fe(t,qe,a),r={...n,setRadius(t){e.value.setRadius(t)},setLatLng(t){e.value.setLatLng(t)}};return{options:l,methods:r}},Ge={...qe,radius:{type:Number}},Ye=(t,e,o)=>{const{options:a,methods:n}=Ke(t,e,o),l=fe(t,Ge,a),r={...n};return{options:l,methods:r}},Xe=((0,a.aZ)({name:"LCircle",props:Ge,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{options:u,methods:d}=Ye(t,l,e);return(0,a.bv)((async()=>{const{circle:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLng,u));const p=_e(e.attrs);l.value.on(p),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),(0,a.aZ)({name:"LCircleMarker",props:qe,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{options:u,methods:d}=Ke(t,l,e);return(0,a.bv)((async()=>{const{circleMarker:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLng,u));const p=_e(e.attrs);l.value.on(p),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),{...xe,position:{type:String}}),Ve=(t,e)=>{const{options:o,methods:n}=ze(t),l=fe(t,Xe,o),r={...n,setPosition(t){e.value&&e.value.setPosition(t)}};return(0,a.Ah)((()=>{e.value&&e.value.remove()})),{options:l,methods:r}},Je=t=>t.default?(0,a.h)("div",{ref:"root"},t.default()):null,Qe=(0,a.aZ)({name:"LControl",props:{...Xe,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)(),s=(0,a.f3)(Te),i=Ue(De),{options:u,methods:d}=Ve(t,l);return(0,a.bv)((async()=>{const{Control:c,DomEvent:p}=s?be.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)),ke(d,l.value,t),i({leafletObject:l.value}),t.disableClickPropagation&&r.value&&p.disableClickPropagation(r.value),t.disableScrollPropagation&&r.value&&p.disableScrollPropagation(r.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,leafletObject:l}},render(){return Je(this.$slots)}}),to={...Xe,prefix:{type:String}},eo=(t,e)=>{const{options:o,methods:a}=Ve(t,e),n=fe(t,to,o),l={...a,setPrefix(t){e.value.setPrefix(t)}};return{options:n,methods:l}},oo=((0,a.aZ)({name:"LControlAttribution",props:to,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(De),{options:i,methods:u}=eo(t,l);return(0,a.bv)((async()=>{const{control:d}=r?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.attribution(i)),ke(u,l.value,t),s({leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),{...Xe,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}}),ao=(t,e)=>{const{options:o}=Ve(t,e);return{options:fe(t,oo,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)}}}},no=(0,a.aZ)({name:"LControlLayers",props:oo,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(Ie),{options:i,methods:u}=ao(t,l);return(0,a.bv)((async()=>{const{control:d}=r?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.layers(void 0,void 0,i)),ke(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),lo={...Xe,maxWidth:{type:Number},metric:{type:Boolean,default:void 0},imperial:{type:Boolean,default:void 0},updateWhenIdle:{type:Boolean,default:void 0}},ro=(t,e)=>{const{options:o,methods:a}=Ve(t,e);return{options:fe(t,lo,o),methods:a}},so=((0,a.aZ)({name:"LControlScale",props:lo,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(De),{options:i,methods:u}=ro(t,l);return(0,a.bv)((async()=>{const{control:d}=r?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.scale(i)),ke(u,l.value,t),s({leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),{...Xe,zoomInText:{type:String},zoomInTitle:{type:String},zoomOutText:{type:String},zoomOutTitle:{type:String}}),io=(t,e)=>{const{options:o,methods:a}=Ve(t,e);return{options:fe(t,so,o),methods:a}},uo=((0,a.aZ)({name:"LControlZoom",props:so,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(De),{options:i,methods:u}=io(t,l);return(0,a.bv)((async()=>{const{control:d}=r?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.zoom(i)),ke(u,l.value,t),s({leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),{...We}),co=(t,e,o)=>{const{options:n,methods:l}=Fe(t,e,o),r=fe(t,uo,n),s={...l,addLayer(t){e.value.addLayer(t.leafletObject)},removeLayer(t){e.value.removeLayer(t.leafletObject)}};return(0,a.JJ)(Oe,s.addLayer),(0,a.JJ)(Ee,s.removeLayer),{options:r,methods:s}},po={...uo},mo=(t,e,o)=>{const{options:a,methods:n}=co(t,e,o),l=fe(t,po,a),r={...n};return{options:l,methods:r}},wo=((0,a.aZ)({props:po,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{methods:u,options:d}=mo(t,l,e);return(0,a.bv)((async()=>{const{featureGroup:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(void 0,d));const p=_e(e.attrs);l.value.on(p),ke(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 Be(this.ready,this.$slots)}}),{...uo,geojson:{type:[Object,Array],custom:!0},optionsStyle:{type:Function,custom:!0}}),vo=(t,e,o)=>{const{options:a,methods:n}=co(t,e,o),l=fe(t,wo,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}},yo=(0,a.aZ)({props:wo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{methods:u,options:d}=vo(t,l,e);return(0,a.bv)((async()=>{const{geoJSON:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.geojson,d));const p=_e(e.attrs);l.value.on(p),ke(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 Be(this.ready,this.$slots)}}),ko={...We,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:[Number,Array,Object]},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number}},fo=(t,e,o)=>{const{options:n,methods:l}=Fe(t,e,o),r=fe(t,ko,n),s={...l,setTileComponent(){var t;null==(t=e.value)||t.redraw()}};return(0,a.Ah)((()=>{e.value.off()})),{options:r,methods:s}},_o=(t,e,o,n)=>t.extend({initialize(t){this.tileComponents={},this.on("tileunload",this._unloadTile),o.setOptions(this,t)},createTile(t){const o=this._tileCoordsToKey(t);this.tileComponents[o]=e.create("div");const l=(0,a.h)({setup:n,props:["coords"]},{coords:t});return(0,s.sY)(l,this.tileComponents[o]),this.tileComponents[o]},_unloadTile(t){const e=this._tileCoordsToKey(t.coords);this.tileComponents[e]&&(this.tileComponents[e].innerHTML="",this.tileComponents[e]=void 0)}}),go=((0,a.aZ)({props:{...ko,childRender:{type:Function,required:!0}},setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(null),s=(0,n.iH)(!1),i=(0,a.f3)(Te),u=Ue(Oe),{options:d,methods:c}=fo(t,l,e);return(0,a.bv)((async()=>{const{GridLayer:r,DomUtil:p,Util:m}=i?be.L:await o.e(633).then(o.bind(o,6633)),w=_o(r,p,m,t.childRender);l.value=(0,n.Xl)(new w(d));const v=_e(e.attrs);l.value.on(v),ke(c,l.value,t),u({...t,...c,leafletObject:l.value}),s.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,ready:s,leafletObject:l}},render(){return this.ready?(0,a.h)("div",{style:{display:"none"},ref:"root"}):null}}),{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}}),So=(0,a.aZ)({name:"LIcon",props:{...go,...xe},setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(Ae),i=Ue(Ce),u=Ue(Re);let d,c,p,m,w;const v=(o,a,n)=>{const l=o&&o.innerHTML;if(!a)return void(n&&w&&s()&&i(l));const r=_e(e.attrs);w&&c(w,r);const{options:v}=ze(t),y=fe(t,go,v);l&&(y.html=l),w=y.html?p(y):m(y),d(w,r),u(w)},y=()=>{(0,a.Y3)((()=>v(l.value,!0,!1)))},k=()=>{(0,a.Y3)((()=>v(l.value,!1,!0)))},f={setIconUrl:y,setIconRetinaUrl:y,setIconSize:y,setIconAnchor:y,setPopupAnchor:y,setTooltipAnchor:y,setShadowUrl:y,setShadowRetinaUrl:y,setShadowAnchor:y,setBgPos:y,setClassName:y,setHtml:y};return(0,a.bv)((async()=>{const{DomEvent:e,divIcon:a,icon:n}=r?be.L:await o.e(633).then(o.bind(o,6633));d=e.on,c=e.off,p=a,m=n,ke(f,{},t),new MutationObserver(k).observe(l.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),y()})),{root:l}},render(){const t=this.$slots.default?this.$slots.default():void 0;return(0,a.h)("div",{ref:"root"},t)}}),ho={...We,opacity:{type:Number},alt:{type:String},interactive:{type:Boolean,default:void 0},crossOrigin:{type:Boolean,default:void 0},errorOverlayUrl:{type:String},zIndex:{type:Number},className:{type:String},url:{type:String,required:!0,custom:!0},bounds:{type:[Array,Object],required:!0,custom:!0}},bo=(t,e,o)=>{const{options:a,methods:n}=Fe(t,e,o),l=fe(t,ho,a),r={...n,setOpacity(t){return e.value.setOpacity(t)},setUrl(t){return e.value.setUrl(t)},setBounds(t){return e.value.setBounds(t)},getBounds(){return e.value.getBounds()},getElement(){return e.value.getElement()},bringToFront(){return e.value.bringToFront()},bringToBack(){return e.value.bringToBack()},setZIndex(t){return e.value.setZIndex(t)}};return{options:l,methods:r}},Uo=((0,a.aZ)({name:"LImageOverlay",props:ho,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{options:u,methods:d}=bo(t,l,e);return(0,a.bv)((async()=>{const{imageOverlay:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.url,t.bounds,u));const p=_e(e.attrs);l.value.on(p),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),(0,a.aZ)({props:uo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{methods:u}=co(t,l,e);return(0,a.bv)((async()=>{const{layerGroup:d}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d(void 0,t.options));const c=_e(e.attrs);l.value.on(c),ke(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 Be(this.ready,this.$slots)}}));function To(t,e,o){var a,n,l;void 0===e&&(e=50),void 0===o&&(o={});var r=null!=(a=o.isImmediate)&&a,s=null!=(n=o.callback)&&n,i=o.maxWait,u=Date.now(),d=[];function c(){if(void 0!==i){var t=Date.now()-u;if(t+e>=i)return i-t}return e}var p=function(){var e=[].slice.call(arguments),o=this;return new Promise((function(a,n){var i=r&&void 0===l;if(void 0!==l&&clearTimeout(l),l=setTimeout((function(){if(l=void 0,u=Date.now(),!r){var a=t.apply(o,e);s&&s(a),d.forEach((function(t){return(0,t.resolve)(a)})),d=[]}}),c()),i){var p=t.apply(o,e);return s&&s(p),a(p)}d.push({resolve:a,reject:n})}))};return p.cancel=function(t){void 0!==l&&clearTimeout(l),d.forEach((function(e){return(0,e.reject)(t)})),d=[]},p}const Oo={...xe,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:[Object,Array]},paddingTopLeft:{type:Object},padding:{type:Object},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}},Eo=(0,a.aZ)({emits:["ready","update:zoom","update:center","update:bounds"],props:Oo,setup(t,e){const l=(0,n.iH)(),r=(0,n.qj)({ready:!1,layersToAdd:[],layersInControl:[]}),{options:s}=ze(t),i=fe(t,Oo,s),u=Se(Oe),d=Se(Ee),c=Se(De),p=Se(Ie);(0,a.JJ)(Te,t.useGlobalLeaflet);const m=(0,a.Fl)((()=>{const e={};return t.noBlockingAnimations&&(e.animate=!1),e})),w=(0,a.Fl)((()=>{const e=m.value;return t.padding&&(e.padding=t.padding),t.paddingTopLeft&&(e.paddingTopLeft=t.paddingTopLeft),t.paddingBottomRight&&(e.paddingBottomRight=t.paddingBottomRight),e})),v={moveend:To((t=>{r.leafletRef&&(e.emit("update:zoom",r.leafletRef.getZoom()),e.emit("update:center",r.leafletRef.getCenter()),e.emit("update:bounds",r.leafletRef.getBounds()))})),overlayadd(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!0)},overlayremove(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!1)}};(0,a.bv)((async()=>{t.useGlobalLeaflet&&(be.L=be.L||await o.e(243).then(o.t.bind(o,5243,23)));const{map:s,CRS:y,Icon:k,latLngBounds:f,latLng:_,DomEvent:g,stamp:S}=t.useGlobalLeaflet?be.L:await o.e(633).then(o.bind(o,6633));try{i.beforeMapMount&&await i.beforeMapMount()}catch(T){console.error(`The following error occurred running the provided beforeMapMount hook ${T.message}`)}await ge(k);const h="string"==typeof i.crs?y[i.crs]:i.crs;i.crs=h||y.EPSG3857;const b={addLayer(t){void 0!==t.layerType&&(void 0===r.layerControl?r.layersToAdd.push(t):r.layersInControl.find((e=>S(e.leafletObject)===S(t.leafletObject)))||(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=>S(e.leafletObject)!==S(t.leafletObject))))),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(t){const e=r.leafletRef.getZoom();t!==e&&r.leafletRef.setZoom(t,m.value)},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,w.value)},setBounds(t){if(!t)return;const e=f(t);e.isValid()&&!(r.lastSetBounds||r.leafletRef.getBounds()).equals(e,0)&&(r.lastSetBounds=e,r.leafletRef.fitBounds(e))},setCenter(t){if(null==t)return;const e=_(t),o=r.lastSetCenter||r.leafletRef.getCenter();(o.lat!==e.lat||o.lng!==e.lng)&&(r.lastSetCenter=e,r.leafletRef.panTo(e,m.value))}};he(u,b.addLayer),he(d,b.removeLayer),he(c,b.registerControl),he(p,b.registerLayerControl),r.leafletRef=(0,n.Xl)(s(l.value,i)),ke(b,r.leafletRef,t);const U=_e(e.attrs);me(r.leafletRef,v),g.on(r.leafletRef.getContainer(),U),r.ready=!0,(0,a.Y3)((()=>e.emit("ready",r.leafletRef)))})),(0,a.Jd)((()=>{we(v),r.leafletRef&&(r.leafletRef.off(),r.leafletRef.remove())}));const y=(0,a.Fl)((()=>r.leafletRef)),k=(0,a.Fl)((()=>r.ready));return{root:l,ready:k,leafletObject:y}},render(){return(0,a.h)("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}}),Do=["Symbol(Comment)","Symbol(Text)"],Io=["LTooltip","LPopup"],Ao={...We,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},Co=(t,e,o)=>{const{options:a,methods:n}=Fe(t,e,o),l=fe(t,Ao,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}},Ro=(t,e)=>{const o=e.slots.default&&e.slots.default();return o&&o.length&&o.some($o)};function $o(t){return!(Do.includes(t.type.toString())||Io.includes(t.type.name))}const Lo=(0,a.aZ)({name:"LMarker",props:Ao,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe);(0,a.JJ)(Ae,(()=>{var t;return!(null==(t=l.value)||!t.getElement())})),(0,a.JJ)(Ce,(t=>{var e,o;const a=ye(null==(e=l.value)?void 0:e.getElement)&&(null==(o=l.value)?void 0:o.getElement());a&&(a.innerHTML=t)})),(0,a.JJ)(Re,(t=>{var e;return(null==(e=l.value)?void 0:e.setIcon)&&l.value.setIcon(t)}));const{options:u,methods:d}=Co(t,l,e),c={moveHandler:To(d.latLngSync)};return(0,a.bv)((async()=>{const{marker:p,divIcon:m}=s?be.L:await o.e(633).then(o.bind(o,6633));Ro(u,e)&&(u.icon=m({className:""})),l.value=(0,n.Xl)(p(t.latLng,u));const w=_e(e.attrs);l.value.on(w),l.value.on("move",c.moveHandler),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),(0,a.Jd)((()=>we(c))),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),No={...Ze,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},jo=(t,e,o)=>{const{options:a,methods:n}=Me(t,e,o),l=fe(t,No,a),r={...n,setSmoothFactor(t){e.value.setStyle({smoothFactor:t})},setNoClip(t){e.value.setStyle({noClip:t})},addLatLng(t){e.value.addLatLng(t)}};return{options:l,methods:r}},xo={...No},zo=(t,e,o)=>{const{options:a,methods:n}=jo(t,e,o),l=fe(t,xo,a),r={...n,toGeoJSON(t){return e.value.toGeoJSON(t)}};return{options:l,methods:r}},Wo=((0,a.aZ)({name:"LPolygon",props:xo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{options:u,methods:d}=zo(t,l,e);return(0,a.bv)((async()=>{const{polygon:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLngs,u));const p=_e(e.attrs);l.value.on(p),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),(0,a.aZ)({name:"LPolyline",props:No,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{options:u,methods:d}=jo(t,l,e);return(0,a.bv)((async()=>{const{polyline:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(t.latLngs,u));const p=_e(e.attrs);l.value.on(p),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),{...xe,content:{type:String,default:null}}),Fo=(t,e)=>{const{options:o,methods:a}=ze(t),n={...a,setContent(t){e.value&&null!==t&&void 0!==t&&e.value.setContent(t)}};return{options:o,methods:n}},Bo=t=>t.default?(0,a.h)("div",{ref:"root"},t.default()):null,Ho={...Wo,latLng:{type:[Object,Array],default:()=>[]}},Po=(t,e)=>{const{options:o,methods:a}=Fo(t,e);return{options:o,methods:a}},Zo=((0,a.aZ)({name:"LPopup",props:Ho,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(null),s=(0,a.f3)(Te),i=Ue($e),u=Ue(Ne),{options:d,methods:c}=Po(t,l);return(0,a.bv)((async()=>{const{popup:u}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(u(d)),void 0!==t.latLng&&l.value.setLatLng(t.latLng),ke(c,l.value,t);const p=_e(e.attrs);l.value.on(p),l.value.setContent(t.content||r.value||""),i(l.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),(0,a.Jd)((()=>{u()})),{root:r,leafletObject:l}},render(){return Bo(this.$slots)}}),{...xo,latLngs:{...xo.latLngs,required:!1},bounds:{type:Object,custom:!0}}),Mo=(t,e,o)=>{const{options:a,methods:n}=zo(t,e,o),l=fe(t,Zo,a),r={...n,setBounds(t){e.value.setBounds(t)},setLatLngs(t){e.value.setBounds(t)}};return{options:l,methods:r}},qo=((0,a.aZ)({name:"LRectangle",props:Zo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(!1),s=(0,a.f3)(Te),i=Ue(Oe),{options:u,methods:d}=Mo(t,l,e);return(0,a.bv)((async()=>{const{rectangle:c,latLngBounds:p}=s?be.L:await o.e(633).then(o.bind(o,6633)),m=t.bounds?p(t.bounds):p(t.latLngs||[]);l.value=(0,n.Xl)(c(m,u));const w=_e(e.attrs);l.value.on(w),ke(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return Be(this.ready,this.$slots)}}),{...ko,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}}),Ko=(t,e,o)=>{const{options:a,methods:n}=fo(t,e,o),l=fe(t,qo,a),r={...n};return{options:l,methods:r}},Go=(0,a.aZ)({props:qo,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(Oe),{options:i,methods:u}=Ko(t,l,e);return(0,a.bv)((async()=>{const{tileLayer:d}=r?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d(t.url,i));const c=_e(e.attrs);l.value.on(c),ke(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}}),Yo={...Wo},Xo=(t,e)=>{const{options:o,methods:n}=Fo(t,e),l=Ue(je);return(0,a.Jd)((()=>{l()})),{options:o,methods:n}},Vo=((0,a.aZ)({name:"LTooltip",props:Yo,setup(t,e){const l=(0,n.iH)(),r=(0,n.iH)(null),s=(0,a.f3)(Te),i=Ue(Le),{options:u,methods:d}=Xo(t,l);return(0,a.bv)((async()=>{const{tooltip:c}=s?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(c(u)),ke(d,l.value,t);const p=_e(e.attrs);l.value.on(p),l.value.setContent(t.content||r.value||""),i(l.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,leafletObject:l}},render(){return Bo(this.$slots)}}),{...qo,layers:{type:String,required:!0},styles:{type:String},format:{type:String},transparent:{type:Boolean,default:void 0},version:{type:String},crs:{type:Object},uppercase:{type:Boolean,default:void 0}}),Jo=(t,e,o)=>{const{options:a,methods:n}=Ko(t,e,o);return{options:fe(t,Vo,a),methods:{...n}}};(0,a.aZ)({props:Vo,setup(t,e){const l=(0,n.iH)(),r=(0,a.f3)(Te),s=Ue(Oe),{options:i,methods:u}=Jo(t,l,e);return(0,a.bv)((async()=>{const{tileLayer:d}=r?be.L:await o.e(633).then(o.bind(o,6633));l.value=(0,n.Xl)(d.wms(t.url,i));const c=_e(e.attrs);l.value.on(c),ke(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null}});var Qo=(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)(Lo),{key:0,"lat-lng":[(0,n.SU)(l).latitude,(0,n.SU)(l).longitude]},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(So),{"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 ta=Qo;var ea=ta,oa=o(5801),aa=o(9917),na=o(2024);const la=t=>((0,a.dD)("data-v-4582e1d0"),t=t(),(0,a.Cn)(),t),ra={id:"workout-map"},sa={key:0,class:"leaflet-container"},ia={key:1},ua=la((()=>(0,a._)("i",{class:"fa fa-refresh","aria-hidden":"true"},null,-1))),da={key:1,class:"no-map"};var ca=(0,a.aZ)({__name:"index",props:{workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,aa.o)(),{workoutData:l,markerCoordinates:r}=(0,n.BK)(e),s=(0,n.iH)(null),u=(0,a.Fl)((()=>_())),d=(0,a.Fl)((()=>o.getters[oa.SY.GETTERS.APP_CONFIG])),c=(0,a.Fl)((()=>k(u))),p=(0,a.Fl)((()=>e.workoutData&&e.workoutData.gpx?y(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}:{})),v=(0,n.iH)(!1);function y(t){if(!t||""!==t)try{const e=pe((new DOMParser).parseFromString(t,"text/xml"));return{jsonData:e}}catch(e){return console.error("Invalid gpx content"),{}}return{}}function k(t){return[(t.value[0][0]+t.value[1][0])/2,(t.value[0][1]+t.value[1][1])/2]}function f(t){s.value?.leafletObject&&s.value?.leafletObject.fitBounds(t)}function _(){return e.workoutData?[[e.workoutData.workout.bounds[0],e.workoutData.workout.bounds[1]],[e.workoutData.workout.bounds[2],e.workoutData.workout.bounds[3]]]:[]}function g(){s.value?.leafletObject.fitBounds(_())}function S(){v.value=!v.value,v.value||setTimeout((()=>{g()}),100)}return(t,e)=>{const o=(0,a.up)("VFullscreen");return(0,a.wg)(),(0,a.iD)("div",ra,[(0,n.SU)(l).loading?((0,a.wg)(),(0,a.iD)("div",sa)):((0,a.wg)(),(0,a.iD)("div",ia,[(0,n.SU)(l).workout.with_gpx?((0,a.wg)(),(0,a.j4)(o,{key:0,modelValue:v.value,"onUpdate:modelValue":e[1]||(e[1]=t=>v.value=t)},{default:(0,a.w5)((()=>[(0,a._)("div",{class:(0,i.C_)(["leaflet-container",{"fullscreen-map":v.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)(Eo),{key:0,zoom:13,maxZoom:19,center:(0,n.SU)(c),bounds:(0,n.SU)(u),zoomAnimation:!1,ref_key:"workoutMap",ref:s,onReady:e[0]||(e[0]=t=>f((0,n.SU)(u)))},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(no)),(0,a.Wm)((0,n.SU)(Qe),{position:"topleft",class:"map-control",tabindex:"0",role:"button","aria-label":t.$t("workouts.RESET_ZOOM"),onClick:g},{default:(0,a.w5)((()=>[ua])),_:1},8,["aria-label"]),(0,a.Wm)((0,n.SU)(Qe),{position:"topleft",class:"map-control",tabindex:"0",role:"button","aria-label":t.$t(`workouts.${v.value?"EXIT":"VIEW"}_FULLSCREEN`),onClick:S},{default:(0,a.w5)((()=>[(0,a._)("i",{class:(0,i.C_)("fa fa-"+(v.value?"compress":"arrows-alt")),"aria-hidden":"true"},null,2)])),_:1},8,["aria-label"]),(0,a.Wm)((0,n.SU)(Go),{url:`${(0,n.SU)(na.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)(yo),{geojson:(0,n.SU)(p).jsonData},null,8,["geojson"]),(0,n.SU)(r).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(Lo),{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)(Uo),{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)(ea,{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)(ea,{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",da,(0,i.zw)(t.$t("workouts.NO_MAP")),1))]))])}}});const pa=(0,j.Z)(ca,[["__scopeId","data-v-4582e1d0"]]);var ma=pa,wa=o(6558);const va={class:"workout-detail"};var ya=(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,aa.o)(),{authUser:i,markerCoordinates:u,workoutData:d}=(0,n.BK)(e),c=(0,a.Fl)((()=>e.workoutData.workout)),p=(0,n.iH)(o.params.workoutId?+o.params.segmentId:null),m=(0,a.Fl)((()=>c.value.segments.length>0&&p.value?c.value.segments[+p.value-1]:null)),w=(0,n.iH)(!1),v=(0,a.Fl)((()=>e.sports?e.sports.find((t=>t.id===e.workoutData.workout.sport_id)):{})),y=(0,a.Fl)((()=>f(c.value,m.value)));function k(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 f(t,o){const a=k(t,e.displaySegment,p.value?+p.value:null),n=(0,wa.Jo)((0,wa.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 _(t){w.value=t,w.value&&(0,a.Y3)((()=>{const t=document.getElementById("workout-cancel-button");t&&t.focus()}))}function g(){_(!1);const t=document.getElementById("delete-workout-button");t&&t.focus()}function S(t){_(!1),r.dispatch(oa.aX.ACTIONS.DELETE_WORKOUT,{workoutId:t})}function h(){window.scrollTo({top:0,behavior:"smooth"})}return(0,a.YP)((()=>o.params.segmentId),(async t=>{t&&(p.value=+t,h())})),(0,a.YP)((()=>o.params.workoutId),(async t=>{t&&(w.value=!1,h())})),(t,e)=>{const o=(0,a.up)("Modal"),l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",va,[w.value?((0,a.wg)(),(0,a.j4)(o,{key:0,name:"workout",title:t.$t("common.CONFIRMATION"),message:t.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:e[0]||(e[0]=t=>S((0,n.SU)(y).workoutId)),onCancelAction:g,onKeydown:(0,s.D2)(g,["esc"])},null,8,["title","message","onKeydown"])):(0,a.kq)("",!0),(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Wm)(z,{sport:(0,n.SU)(v),workoutObject:(0,n.SU)(y),onDisplayModal:e[1]||(e[1]=t=>_(!0))},null,8,["sport","workoutObject"])])),content:(0,a.w5)((()=>[(0,a.Wm)(ma,{workoutData:(0,n.SU)(d),markerCoordinates:(0,n.SU)(u)},null,8,["workoutData","markerCoordinates"]),(0,a.Wm)(Mt,{workoutObject:(0,n.SU)(y),useImperialUnits:(0,n.SU)(i).imperial_units,displayHARecord:(0,n.SU)(i).display_ascent},null,8,["workoutObject","useImperialUnits","displayHARecord"])])),_:1})])}}});const ka=(0,j.Z)(ya,[["__scopeId","data-v-869dd634"]]);var fa=ka,_a=o(6518);const ga=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")},Sa={id:"htmlLegend",afterUpdate(t,e,o){const a=ga(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=>{if(!t.config.options?.scales?.yElevation?.display&&1===e.datasetIndex)return;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 ha=o(3768);const ba=t=>((0,a.dD)("data-v-4ad610c4"),t=t(),(0,a.Cn)(),t),Ua={id:"workout-chart"},Ta={class:"chart-radio"},Oa=["checked"],Ea=["checked"],Da=ba((()=>(0,a._)("div",{id:"chart-legend"},null,-1))),Ia={class:"chart-info"},Aa={class:"no-data-cleaning"},Ca={key:0,class:"elevation-start"},Ra=["checked"];var $a=(0,a.aZ)({__name:"index",props:{authUser:null,workoutData:null},emits:["getCoordinates"],setup(t,{emit:e}){const o=t,{t:l}=(0,q.QT)(),r=(0,n.iH)(!0),s=(0,n.iH)(o.authUser.start_elevation_at_zero),u=(0,a.Fl)((()=>(0,ha.EX)(o.workoutData.chartData,l,o.authUser.imperial_units))),d=(0,a.Fl)((()=>u.value&&u.value.datasets.elevation.data.length>0)),c=S("km"),p=S("m"),m=(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]))}))),w=(0,a.Fl)((()=>u.value.coordinates)),v=(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):f(t)}},type:"linear",bounds:"data",title:{display:!0,text:r.value?l("workouts.DISTANCE")+` (${c})`:l("workouts.DURATION")}},ySpeed:{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:l("workouts.SPEED")+` (${c}/h)`}},yElevation:{beginAtZero:s.value,display:d.value,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:l("workouts.ELEVATION")+` (${p})`}}},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+` ${p}`:e+` ${c}/h`},title:function(t){return t.length>0&&_(w.value[t[0].dataIndex]),0===t.length?"":r.value?`${l("workouts.DISTANCE")}: ${t[0].label} ${c}`:`${l("workouts.DURATION")}: ${f(t[0].label.replace(",",""))}`}}},legend:{display:!1},htmlLegend:{containerID:"chart-legend",displayElevation:d.value}}}))),{lineChartProps:y}=(0,_a.tn)({chartData:m,options:v,plugins:[Sa]});function k(){r.value=!r.value}function f(t){return new Date(1e3*+t).toISOString().substr(11,8)}function _(t){e("getCoordinates",t)}function g(){_({latitude:null,longitude:null})}function S(t){return o.authUser.imperial_units?K.Dl[t].defaultTarget:t}return(t,e)=>{const o=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",Ua,[(0,a.Wm)(o,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,i.zw)(t.$t("workouts.ANALYSIS")),1)])),content:(0,a.w5)((()=>[(0,a._)("div",Ta,[(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"distance",checked:r.value,onClick:k},null,8,Oa),(0,a.Uk)(" "+(0,i.zw)(t.$t("workouts.DISTANCE")),1)]),(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"duration",checked:!r.value,onClick:k},null,8,Ea),(0,a.Uk)(" "+(0,i.zw)(t.$t("workouts.DURATION")),1)])]),Da,(0,a.Wm)((0,n.SU)(_a.wW),(0,a.dG)((0,n.SU)(y),{class:"line-chart",onMouseleave:g}),null,16),(0,a._)("div",Ia,[(0,a._)("div",Aa,(0,i.zw)(t.$t("workouts.NO_DATA_CLEANING")),1),(0,n.SU)(d)?((0,a.wg)(),(0,a.iD)("div",Ca,[(0,a._)("label",null,[(0,a._)("input",{type:"checkbox",checked:s.value,onClick:e[0]||(e[0]=t=>s.value=!s.value)},null,8,Ra),(0,a.Uk)(" "+(0,i.zw)(t.$t("workouts.START_ELEVATION_AT_ZERO")),1)])])):(0,a.kq)("",!0)])])),_:1})])}}});const La=(0,j.Z)($a,[["__scopeId","data-v-4ad610c4"]]);var Na=La,ja=o(2335);const xa={id:"workout-note"},za=["innerHTML"];var Wa=(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",xa,[(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,i.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)(ja.O)((0,n.SU)(o)):t.$t("workouts.NO_NOTES")},null,8,za)])),_:1})])}}});const Fa=(0,j.Z)(Wa,[["__scopeId","data-v-f6b59442"]]);var Ba=Fa;const Ha={id:"workout-segments"};var Pa=(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"),s=(0,a.up)("Distance"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",Ha,[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,i.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,i.zw)(t.$t("workouts.SEGMENT",1))+" "+(0,i.zw)(o+1),1)])),_:2},1032,["to"]),(0,a.Uk)(" ("+(0,i.zw)(t.$t("workouts.DISTANCE"))+": ",1),(0,a.Wm)(s,{distance:e.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(l)},null,8,["distance","useImperialUnits"]),(0,a.Uk)(", "+(0,i.zw)(t.$t("workouts.DURATION"))+": "+(0,i.zw)(e.duration)+") ",1)])))),128))])])),_:1})])}}});const Za=(0,j.Z)(Pa,[["__scopeId","data-v-6b8a27cd"]]);var Ma=Za;const qa=t=>((0,a.dD)("data-v-53c4e53a"),t=t(),(0,a.Cn)(),t),Ka={id:"workout",class:"view"},Ga={class:"container"},Ya={key:0,class:"workout-container"},Xa={key:0},Va=qa((()=>(0,a._)("div",{id:"bottom"},null,-1))),Ja={key:1};var Qa=(0,a.aZ)({__name:"Workout",props:{displaySegment:{type:Boolean}},setup(t){const e=t,o=(0,l.yj)(),s=(0,aa.o)(),{displaySegment:i}=(0,n.BK)(e),u=(0,a.Fl)((()=>s.getters[oa.aX.GETTERS.WORKOUT_DATA])),d=(0,a.Fl)((()=>s.getters[oa.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>s.getters[oa.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(oa.aX.ACTIONS.GET_WORKOUT_DATA,t)})),(0,a.Ah)((()=>{s.commit(oa.aX.MUTATIONS.EMPTY_WORKOUT)})),(0,a.YP)((()=>o.params.workoutId),(async t=>{t&&s.dispatch(oa.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(oa.aX.ACTIONS.GET_WORKOUT_DATA,e)}})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",Ka,[(0,a._)("div",Ga,[(0,n.SU)(c).length>0?((0,a.wg)(),(0,a.iD)("div",Ya,[(0,n.SU)(u).workout.id?((0,a.wg)(),(0,a.iD)("div",Xa,[(0,a.Wm)(fa,{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)(Na,{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)(Ma,{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)(Ba,{key:2,notes:(0,n.SU)(u).workout.notes},null,8,["notes"])),Va])):((0,a.wg)(),(0,a.iD)("div",Ja,[(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 tn=(0,j.Z)(Qa,[["__scopeId","data-v-53c4e53a"]]);var en=tn},119:function(t,e,o){o.r(e),o.d(e,{default:function(){return qt}});var a=o(6252),n=o(2262),l=o(3577),r=o(9150),s=(o(7658),o(9963)),i=o(2201),u=o(631),d=o(3649);const c=t=>((0,a.dD)("data-v-28429a13"),t=t(),(0,a.Cn)(),t),p={class:"workouts-filters"},m={class:"box"},w=["onSubmit"],v={class:"form-all-items"},y={class:"form-items-group"},k={class:"form-item"},f=["value"],_={class:"form-item"},g=["value"],S={class:"form-items-group"},h={class:"form-item"},b=["value","onKeyup"],U=c((()=>(0,a._)("option",{value:""},null,-1))),T=["value"],O={class:"form-item form-item-title"},E={class:"form-inputs-group"},D=["value","onKeyup"],I={class:"form-items-group"},A={class:"form-item"},C={class:"form-inputs-group"},R=["value","onKeyup"],$=["value","onKeyup"],L={class:"form-items-group"},N={class:"form-item"},j={class:"form-inputs-group"},x=["value","onKeyup"],z=["value","onKeyup"],W={class:"form-items-group"},F={class:"form-item"},B={class:"form-inputs-group"},H=["value","onKeyup"],P=["value","onKeyup"],Z={class:"form-items-group"},M={class:"form-item"},q={class:"form-inputs-group"},K=["value","onKeyup"],G=["value","onKeyup"],Y={class:"form-button"};var X=(0,a.aZ)({__name:"WorkoutsFilters",props:{authUser:null,sports:null},emits:["filter"],setup(t,{emit:e}){const o=t,{t:c}=(0,r.QT)(),X=(0,i.yj)(),V=(0,i.tv)(),{authUser:J}=(0,n.BK)(o),Q=J.value.imperial_units?d.Dl.km.defaultTarget:"km",tt=(0,a.Fl)((()=>(0,u.xH)(o.sports,c)));let et=Object.assign({},X.query);function ot(t){""===t.target.value?delete et[t.target.name]:et[t.target.name]=t.target.value}function at(){e("filter"),"page"in et&&(et["page"]="1"),V.push({path:"/workouts",query:et})}function nt(){e("filter"),V.push({path:"/workouts",query:{}})}return(0,a.bv)((()=>{const t=document.getElementById("from");t&&t.focus()})),(0,a.YP)((()=>X.query),(t=>{et=Object.assign({},t)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",p,[(0,a._)("div",m,[(0,a._)("form",{onSubmit:(0,s.iM)(at,["prevent"]),class:"form"},[(0,a._)("div",v,[(0,a._)("div",y,[(0,a._)("div",k,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.FROM"))+": ",1),(0,a._)("input",{id:"from",name:"from",type:"date",value:t.$route.query.from,onChange:ot},null,40,f)]),(0,a._)("div",_,[(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:ot},null,40,g)])]),(0,a._)("div",S,[(0,a._)("div",h,[(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:ot,onKeyup:(0,s.D2)(at,["enter"])},[U,((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(tt).filter((t=>(0,n.SU)(J).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,T)))),128))],40,b)]),(0,a._)("div",O,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.TITLE",1))+":",1),(0,a._)("div",E,[(0,a._)("input",{class:"title",name:"title",value:t.$route.query.title,onChange:ot,placeholder:"",type:"text",onKeyup:(0,s.D2)(at,["enter"])},null,40,D)])])]),(0,a._)("div",I,[(0,a._)("div",A,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,l.zw)((0,n.SU)(Q))+"): ",1),(0,a._)("div",C,[(0,a._)("input",{name:"distance_from",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_from,onChange:ot,onKeyup:(0,s.D2)(at,["enter"])},null,40,R),(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:ot,onKeyup:(0,s.D2)(at,["enter"])},null,40,$)])])]),(0,a._)("div",L,[(0,a._)("div",N,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DURATION"))+": ",1),(0,a._)("div",j,[(0,a._)("input",{name:"duration_from",value:t.$route.query.duration_from,onChange:ot,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text",onKeyup:(0,s.D2)(at,["enter"])},null,40,x),(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:ot,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text",onKeyup:(0,s.D2)(at,["enter"])},null,40,z)])])]),(0,a._)("div",W,[(0,a._)("div",F,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.AVE_SPEED"))+" ("+(0,l.zw)((0,n.SU)(Q))+"/h): ",1),(0,a._)("div",B,[(0,a._)("input",{min:"0",name:"ave_speed_from",value:t.$route.query.ave_speed_from,onChange:ot,step:"0.1",type:"number",onKeyup:(0,s.D2)(at,["enter"])},null,40,H),(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:ot,step:"0.1",type:"number",onKeyup:(0,s.D2)(at,["enter"])},null,40,P)])])]),(0,a._)("div",Z,[(0,a._)("div",M,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.MAX_SPEED"))+" ("+(0,l.zw)((0,n.SU)(Q))+"/h): ",1),(0,a._)("div",q,[(0,a._)("input",{min:"0",name:"max_speed_from",value:t.$route.query.max_speed_from,onChange:ot,step:"0.1",type:"number",onKeyup:(0,s.D2)(at,["enter"])},null,40,K),(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:ot,step:"0.1",type:"number",onKeyup:(0,s.D2)(at,["enter"])},null,40,G)])])])]),(0,a._)("div",Y,[(0,a._)("button",{type:"submit",class:"confirm",onClick:at},(0,l.zw)(t.$t("buttons.FILTER")),1),(0,a._)("button",{class:"confirm",onClick:nt},(0,l.zw)(t.$t("buttons.CLEAR_FILTER")),1)])],40,w)])]))}}),V=o(3744);const J=(0,V.Z)(X,[["__scopeId","data-v-28429a13"]]);var Q=J,tt=o(8626),et=o(115),ot=o(2056),at=o(5630),nt=o(5801),lt=o(9917),rt=o(2766),st=o(6558),it=o(3768);const ut=t=>((0,a.dD)("data-v-347b95f9"),t=t(),(0,a.Cn)(),t),dt={class:"workouts-list"},ct={class:"total"},pt={class:"total-label"},mt={key:0},wt={key:0,class:"workouts-table responsive-table"},vt=ut((()=>(0,a._)("th",{class:"sport-col"},null,-1))),yt={class:"sport-col"},kt={class:"cell-heading"},ft=["onMouseover"],_t={class:"cell-heading"},gt={key:0,class:"fa fa-map-o","aria-hidden":"true"},St={class:"title"},ht={class:"workout-date"},bt={class:"cell-heading"},Ut={class:"text-right"},Tt={class:"cell-heading"},Ot={class:"text-right"},Et={class:"cell-heading"},Dt={class:"text-right"},It={class:"cell-heading"},At={class:"text-right"},Ct={class:"cell-heading"},Rt={class:"text-right"},$t={class:"cell-heading"},Lt={class:"text-right"},Nt={class:"cell-heading"},jt=ut((()=>(0,a._)("div",{id:"bottom"},null,-1)));var xt=(0,a.aZ)({__name:"WorkoutsList",props:{user:null,sports:null},setup(t){const e=t,o=(0,lt.o)(),r=(0,i.yj)(),s=(0,i.tv)(),{user:c,sports:p}=(0,n.BK)(e),m=["ave_speed","distance","duration","workout_date"],w=(0,a.Fl)((()=>o.getters[nt.aX.GETTERS.USER_WORKOUTS])),v=(0,a.Fl)((()=>o.getters[nt.aX.GETTERS.WORKOUTS_PAGINATION])),y=(0,a.Fl)((()=>o.getters[nt.SY.GETTERS.LANGUAGE]));let k=S(r.query);const f=(0,n.iH)(null);function _(t){o.dispatch(nt.aX.ACTIONS.GET_USER_WORKOUTS,c.value.imperial_units?h(t):t)}function g(t,e){const o=Object.assign({},r.query);o[t]=e,"per_page"===t&&(o["page"]="1"),k=S(o),s.push({path:"/workouts",query:k})}function S(t){const e=(0,rt.pm)(t,m,it.eR.order_by,{defaultSort:it.eR.order});return Object.keys(t).filter((t=>rt.Ne.includes(t))).map((o=>{"string"===typeof t[o]&&(e[o]=t[o])})),e}function h(t){const e={...t};return Object.entries(e).map((t=>{t[0].match("speed|distance")&&t[1]&&(e[t[0]]=(0,d.sC)(+t[1],"mi","km"))})),e}function b(t){f.value=t}return(0,a.wF)((()=>{_(k)})),(0,a.YP)((()=>r.query),(async t=>{k=S(t),_(k)})),(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",dt,[(0,a._)("div",{class:(0,l.C_)(["box",{"empty-table":0===(0,n.SU)(w).length}])},[(0,a._)("div",ct,[(0,a._)("span",pt,(0,l.zw)(t.$t("common.TOTAL").toLowerCase())+": ",1),null!==(0,n.SU)(v).total?((0,a.wg)(),(0,a.iD)("span",mt,(0,l.zw)((0,n.SU)(v).total)+" "+(0,l.zw)(t.$t("workouts.WORKOUT",(0,n.SU)(v).total)),1)):(0,a.kq)("",!0)]),(0,a.Wm)(tt.Z,{sort:(0,n.SU)(rt.fS),order_by:m,query:(0,n.SU)(k),message:"workouts",onUpdateSelect:g},null,8,["sort","query"]),(0,n.SU)(w).length>0?((0,a.wg)(),(0,a.iD)("div",wt,[(0,a.Wm)(et.Z,{class:"top-pagination",pagination:(0,n.SU)(v),path:"/workouts",query:(0,n.SU)(k)},null,8,["pagination","query"]),(0,a._)("table",null,[(0,a._)("thead",{class:(0,l.C_)({smaller:"de"===(0,n.SU)(y)})},[(0,a._)("tr",null,[vt,(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),(i=>((0,a.wg)(),(0,a.iD)("tr",{key:i.id},[(0,a._)("td",yt,[(0,a._)("span",kt,(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===i.sport_id)).translatedLabel,"sport-label":(0,n.SU)(u.PA)(i,(0,n.SU)(p)),color:(0,n.SU)(u.CM)(i,(0,n.SU)(p))},null,8,["title","sport-label","color"])):(0,a.kq)("",!0)]),(0,a._)("td",{class:"workout-title",onMouseover:t=>b(i.id),onMouseleave:e[0]||(e[0]=t=>b(null))},[(0,a._)("span",_t,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a.Wm)(r,{class:"nav-item",to:{name:"Workout",params:{workoutId:i.id}}},{default:(0,a.w5)((()=>[i.with_gpx?((0,a.wg)(),(0,a.iD)("i",gt)):(0,a.kq)("",!0),(0,a._)("span",St,(0,l.zw)(i.title),1)])),_:2},1032,["to"]),i.with_gpx&&f.value===i.id?((0,a.wg)(),(0,a.j4)(ot.Z,{key:0,workout:i,"display-hover":!0},null,8,["workout"])):(0,a.kq)("",!0)],40,ft),(0,a._)("td",ht,[(0,a._)("span",bt,(0,l.zw)(t.$t("workouts.DATE")),1),(0,a._)("time",null,(0,l.zw)((0,n.SU)(st.p6)(i.workout_date,(0,n.SU)(c).timezone,(0,n.SU)(c).date_format)),1)]),(0,a._)("td",Ut,[(0,a._)("span",Tt,(0,l.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Wm)(s,{distance:i.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Ot,[(0,a._)("span",Et,(0,l.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(" "+(0,l.zw)(i.moving),1)]),(0,a._)("td",Dt,[(0,a._)("span",It,(0,l.zw)(t.$t("workouts.AVE_SPEED")),1),(0,a.Wm)(s,{distance:i.ave_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",At,[(0,a._)("span",Ct,(0,l.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Wm)(s,{distance:i.max_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Rt,[(0,a._)("span",$t,(0,l.zw)(t.$t("workouts.ASCENT")),1),null!==i.ascent?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:i.ascent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)]),(0,a._)("td",Lt,[(0,a._)("span",Nt,(0,l.zw)(t.$t("workouts.DESCENT")),1),null!==i.descent?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:i.descent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)])])))),128))])]),(0,a.Wm)(et.Z,{pagination:(0,n.SU)(v),path:"/workouts",query:(0,n.SU)(k)},null,8,["pagination","query"])])):(0,a.kq)("",!0)],2),0===(0,n.SU)(w).length?((0,a.wg)(),(0,a.j4)(at.Z,{key:0})):(0,a.kq)("",!0),jt])}}});const zt=(0,V.Z)(xt,[["__scopeId","data-v-347b95f9"]]);var Wt=zt;const Ft={key:0,id:"workouts",class:"view"},Bt={class:"container workouts-container"},Ht={class:"display-filters"},Pt={class:"list-container"};var Zt=(0,a.aZ)({__name:"WorkoutsView",setup(t){const{t:e}=(0,r.QT)(),o=(0,lt.o)(),s=(0,a.Fl)((()=>o.getters[nt.YN.GETTERS.AUTH_USER_PROFILE])),i=(0,a.Fl)((()=>o.getters[nt.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>(0,u.xH)(i.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",Ft,[(0,a._)("div",Bt,[(0,a._)("div",{class:(0,l.C_)(["filters-container",{hidden:c.value}])},[(0,a.Wm)(Q,{sports:(0,n.SU)(d),authUser:(0,n.SU)(s),onFilter:p},null,8,["sports","authUser"])],2),(0,a._)("div",Ht,[(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",Pt,[(0,a.Wm)(Wt,{user:(0,n.SU)(s),sports:(0,n.SU)(d)},null,8,["user","sports"])])])])):(0,a.kq)("",!0)}});const Mt=(0,V.Z)(Zt,[["__scopeId","data-v-57ec0168"]]);var qt=Mt}}]);
//# sourceMappingURL=workouts.64a95f47.js.map