FitTrackee/fittrackee/dist/static/js/workouts.52ba33b8.js

2 lines
86 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["workouts"],{"0385":function(e,t,o){"use strict";o.r(t);var n=o("7a23"),r={key:0,id:"workouts",class:"view"},a={class:"container workouts-container"},c={class:"display-filters"},l={class:"list-container"};function i(e,t,o,i,u,s){var d=Object(n["resolveComponent"])("WorkoutsFilters"),p=Object(n["resolveComponent"])("WorkoutsList");return e.authUser.username?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",r,[Object(n["createElementVNode"])("div",a,[Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["filters-container",{hidden:e.hiddenFilters}])},[Object(n["createVNode"])(d,{sports:e.translatedSports,authUser:e.authUser,onFilter:e.toggleFilters},null,8,["sports","authUser","onFilter"])],2),Object(n["createElementVNode"])("div",c,[Object(n["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(){return e.toggleFilters&&e.toggleFilters.apply(e,arguments)})},[Object(n["createElementVNode"])("i",{class:Object(n["normalizeClass"])("fa fa-caret-".concat(e.hiddenFilters?"down":"up")),"aria-hidden":"true"},null,2),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.$t("workouts.".concat(e.hiddenFilters?"DISPLAY":"HIDE","_FILTERS"))),1)])]),Object(n["createElementVNode"])("div",l,[Object(n["createVNode"])(p,{user:e.authUser,sports:e.translatedSports},null,8,["user","sports"])])])])):Object(n["createCommentVNode"])("",!0)}var u=o("47e2"),s=(o("4de4"),o("d3b7"),o("caad"),o("2532"),function(e){return Object(n["pushScopeId"])("data-v-cbc43e30"),e=e(),Object(n["popScopeId"])(),e}),d={class:"workouts-filters"},p={class:"box"},b={class:"form"},m={class:"form-items-group"},O={class:"form-item"},j=["value"],f={class:"form-item"},k=["value"],g={class:"form-items-group"},y={class:"form-item"},w=["value"],h=s((function(){return Object(n["createElementVNode"])("option",{value:""},null,-1)})),v=["value"],E={class:"form-items-group"},N={class:"form-item"},S={class:"form-inputs-group"},V=["value"],T=["value"],D={class:"form-items-group"},C={class:"form-item"},_={class:"form-inputs-group"},x=["value"],B=["value"],A={class:"form-items-group"},R={class:"form-item"},I={class:"form-inputs-group"},L=["value"],U=["value"],M={class:"form-items-group"},W={class:"form-item"},$={class:"form-inputs-group"},F=["value"],P=["value"],G={class:"form-button"};function q(e,t,o,r,a,c){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",d,[Object(n["createElementVNode"])("div",p,[Object(n["createElementVNode"])("div",b,[Object(n["createElementVNode"])("div",m,[Object(n["createElementVNode"])("div",O,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.FROM"))+": ",1),Object(n["createElementVNode"])("input",{name:"from",type:"date",value:e.$route.query.from,onChange:t[0]||(t[0]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,j)]),Object(n["createElementVNode"])("div",f,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.TO"))+": ",1),Object(n["createElementVNode"])("input",{name:"to",type:"date",value:e.$route.query.to,onChange:t[1]||(t[1]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,k)])]),Object(n["createElementVNode"])("div",g,[Object(n["createElementVNode"])("div",y,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.SPORT",1))+":",1),Object(n["createElementVNode"])("select",{name:"sport_id",value:e.$route.query.sport_id,onChange:t[2]||(t[2]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},[h,(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(e.translatedSports.filter((function(t){return e.authUser.sports_list.includes(t.id)})),(function(e){return Object(n["openBlock"])(),Object(n["createElementBlock"])("option",{value:e.id,key:e.id},Object(n["toDisplayString"])(e.label),9,v)})),128))],40,w)])]),Object(n["createElementVNode"])("div",E,[Object(n["createElementVNode"])("div",N,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.DISTANCE"))+" (km): ",1),Object(n["createElementVNode"])("div",S,[Object(n["createElementVNode"])("input",{name:"distance_from",type:"number",min:"0",step:"1",value:e.$route.query.distance_from,onChange:t[3]||(t[3]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,V),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.$t("workouts.TO")),1),Object(n["createElementVNode"])("input",{name:"distance_to",type:"number",min:"0",step:"1",value:e.$route.query.distance_to,onChange:t[4]||(t[4]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,T)])])]),Object(n["createElementVNode"])("div",D,[Object(n["createElementVNode"])("div",C,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.DURATION"))+" (km): ",1),Object(n["createElementVNode"])("div",_,[Object(n["createElementVNode"])("input",{name:"duration_from",value:e.$route.query.duration_from,onChange:t[5]||(t[5]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,x),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.$t("workouts.TO")),1),Object(n["createElementVNode"])("input",{name:"duration_to",value:e.$route.query.duration_to,onChange:t[6]||(t[6]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,B)])])]),Object(n["createElementVNode"])("div",A,[Object(n["createElementVNode"])("div",R,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.AVE_SPEED"))+" (km): ",1),Object(n["createElementVNode"])("div",I,[Object(n["createElementVNode"])("input",{min:"0",name:"ave_speed_from",value:e.$route.query.ave_speed_from,onChange:t[7]||(t[7]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,L),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.$t("workouts.TO")),1),Object(n["createElementVNode"])("input",{min:"0",name:"ave_speed_to",value:e.$route.query.ave_speed_to,onChange:t[8]||(t[8]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,U)])])]),Object(n["createElementVNode"])("div",M,[Object(n["createElementVNode"])("div",W,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+" (km): ",1),Object(n["createElementVNode"])("div",$,[Object(n["createElementVNode"])("input",{min:"0",name:"max_speed_from",value:e.$route.query.max_speed_from,onChange:t[9]||(t[9]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,F),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.$t("workouts.TO")),1),Object(n["createElementVNode"])("input",{min:"0",name:"max_speed_to",value:e.$route.query.max_speed_to,onChange:t[10]||(t[10]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,P)])])])]),Object(n["createElementVNode"])("div",G,[Object(n["createElementVNode"])("button",{class:"confirm",onClick:t[11]||(t[11]=function(){return e.onFilter&&e.onFilter.apply(e,arguments)})},Object(n["toDisplayString"])(e.$t("buttons.FILTER")),1),Object(n["createElementVNode"])("button",{class:"confirm",onClick:t[12]||(t[12]=function(){return e.onClearFilter&&e.onClearFilter.apply(e,arguments)})},Object(n["toDisplayString"])(e.$t("buttons.CLEAR_FILTER")),1)])])])}o("b0c0");var z=o("6c02"),H=o("1119"),K=Object(n["defineComponent"])({name:"WorkoutsFilters",props:{authUser:{type:Object,required:!0},sports:{type:Object,required:!0}},emits:["filter"],setup:function(e,t){var o=t.emit,r=Object(u["b"])(),a=r.t,c=Object(z["c"])(),l=Object(z["d"])(),i=Object(n["computed"])((function(){return Object(H["d"])(e.sports,a)})),s=Object.assign({},c.query);function d(e){""===e.target.value?delete s[e.target.name]:s[e.target.name]=e.target.value}function p(){o("filter"),"page"in s&&(s["page"]="1"),l.push({path:"/workouts",query:s})}function b(){o("filter"),l.push({path:"/workouts",query:{}})}return Object(n["watch"])((function(){return c.query}),(function(e){s=Object.assign({},e)})),{translatedSports:i,onClearFilter:b,onFilter:p,handleFilterChange:d}}}),Z=(o("3ab5"),o("6b0d")),J=o.n(Z);const X=J()(K,[["render",q],["__scopeId","data-v-cbc43e30"]]);var Y=X,Q=(o("b680"),o("a9e3"),function(e){return Object(n["pushScopeId"])("data-v-0144da86"),e=e(),Object(n["popScopeId"])(),e}),ee={class:"workouts-list"},te={class:"total"},oe={class:"total-label"},ne={key:0},re={key:0,class:"workouts-table responsive-table"},ae=Q((function(){return Object(n["createElementVNode"])("th",{class:"sport-col"},null,-1)})),ce={class:"sport-col"},le={class:"cell-heading"},ie=["onMouseover"],ue={class:"cell-heading"},se={key:0,class:"fa fa-map-o","aria-hidden":"true"},de={class:"cell-heading"},pe={class:"text-right"},be={class:"cell-heading"},me={class:"text-right"},Oe={class:"cell-heading"},je={class:"text-right"},fe={class:"cell-heading"},ke={class:"text-right"},ge={class:"cell-heading"},ye={class:"text-right"},we={class:"cell-heading"},he={key:0},ve={class:"text-right"},Ee={class:"cell-heading"},Ne={key:0},Se=Q((function(){return Object(n["createElementVNode"])("div",{id:"bottom"},null,-1)}));function Ve(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("FilterSelects"),i=Object(n["resolveComponent"])("Pagination"),u=Object(n["resolveComponent"])("SportImage"),s=Object(n["resolveComponent"])("router-link"),d=Object(n["resolveComponent"])("StaticMap"),p=Object(n["resolveComponent"])("NoWorkouts");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ee,[Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["box",{"empty-table":0===e.workouts.length}])},[Object(n["createElementVNode"])("div",te,[Object(n["createElementVNode"])("span",oe,Object(n["toDisplayString"])(e.$t("common.TOTAL").toLowerCase())+": ",1),null!==e.pagination.total?(Object(n["openBlock"])(),Object(n["createElementBlock"])("span",ne,Object(n["toDisplayString"])(e.pagination.total)+" "+Object(n["toDisplayString"])(e.$t("workouts.WORKOUT",e.pagination.total)),1)):Object(n["createCommentVNode"])("",!0)]),Object(n["createVNode"])(l,{sort:e.sortList,order_by:e.orderByList,query:e.query,message:"workouts",onUpdateSelect:e.reloadWorkouts},null,8,["sort","order_by","query","onUpdateSelect"]),e.workouts.length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",re,[Object(n["createVNode"])(i,{class:"top-pagination",pagination:e.pagination,path:"/workouts",query:e.query},null,8,["pagination","query"]),Object(n["createElementVNode"])("table",null,[Object(n["createElementVNode"])("thead",null,[Object(n["createElementVNode"])("tr",null,[ae,Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.WORKOUT",1))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.DATE"))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.DISTANCE"))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.DURATION"))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.AVE_SPEED"))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.MAX_SPEED"))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.ASCENT"))),1),Object(n["createElementVNode"])("th",null,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.DESCENT"))),1)])]),Object(n["createElementVNode"])("tbody",null,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(e.workouts,(function(o){return Object(n["openBlock"])(),Object(n["createElementBlock"])("tr",{key:o.id},[Object(n["createElementVNode"])("td",ce,[Object(n["createElementVNode"])("span",le,Object(n["toDisplayString"])(e.$t("workouts.SPORT",1)),1),Object(n["createVNode"])(u,{title:e.sports.filter((function(e){return e.id===o.sport_id}))[0].translatedLabel,"sport-label":e.sports.filter((function(e){return e.id===o.sport_id}))[0].label},null,8,["title","sport-label"])]),Object(n["createElementVNode"])("td",{class:"workout-title",onMouseover:function(t){return e.onHover(o.id)},onMouseleave:t[0]||(t[0]=function(t){return e.onHover(null)})},[Object(n["createElementVNode"])("span",ue,Object(n["toDisplayString"])(e.capitalize(e.$t("workouts.WORKOUT",1))),1),Object(n["createVNode"])(s,{class:"nav-item",to:{name:"Workout",params:{workoutId:o.id}}},{default:Object(n["withCtx"])((function(){return[o.with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("i",se)):Object(n["createCommentVNode"])("",!0),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(o.title),1)]})),_:2},1032,["to"]),o.with_gpx&&e.hoverWorkoutId===o.id?(Object(n["openBlock"])(),Object(n["createBlock"])(d,{key:0,workout:o,"display-hover":!0},null,8,["workout"])):Object(n["createCommentVNode"])("",!0)],40,ie),Object(n["createElementVNode"])("td",null,[Object(n["createElementVNode"])("span",de,Object(n["toDisplayString"])(e.$t("workouts.DATE")),1),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.format(e.getDateWithTZ(o.workout_date,e.user.timezone),"dd/MM/yyyy HH:mm")),1)]),Object(n["createElementVNode"])("td",pe,[Object(n["createElementVNode"])("span",be,Object(n["toDisplayString"])(e.$t("workouts.DISTANCE")),1),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(Number(o.distance).toFixed(2))+" km ",1)]),Object(n["createElementVNode"])("td",me,[Object(n["createElementVNode"])("span",Oe,Object(n["toDisplayString"])(e.$t("workouts.DURATION")),1),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(o.moving),1)]),Object(n["createElementVNode"])("td",je,[Object(n["createElementVNode"])("span",fe,Object(n["toDisplayString"])(e.$t("workouts.AVE_SPEED")),1),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(o.ave_speed)+" km/h ",1)]),Object(n["createElementVNode"])("td",ke,[Object(n["createElementVNode"])("span",ge,Object(n["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(o.max_speed)+" km/h ",1)]),Object(n["createElementVNode"])("td",ye,[Object(n["createElementVNode"])("span",we,Object(n["toDisplayString"])(e.$t("workouts.ASCENT")),1),o.with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("span",he,Object(n["toDisplayString"])(o.ascent)+" m",1)):Object(n["createCommentVNode"])("",!0)]),Object(n["createElementVNode"])("td",ve,[Object(n["createElementVNode"])("span",Ee,Object(n["toDisplayString"])(e.$t("workouts.DESCENT")),1),o.with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("span",Ne,Object(n["toDisplayString"])(o.descent)+" m",1)):Object(n["createCommentVNode"])("",!0)])])})),128))])]),Object(n["createVNode"])(i,{pagination:e.pagination,path:"/workouts",query:e.query},null,8,["pagination","query"])])):Object(n["createCommentVNode"])("",!0)],2),0===e.workouts.length?(Object(n["openBlock"])(),Object(n["createBlock"])(p,{key:0})):Object(n["createCommentVNode"])("",!0),Se])}var Te=o("1da1"),De=(o("96cf"),o("d81d"),o("b64b"),o("b166")),Ce=o("9176"),_e=o("6d7d"),xe=o("68c6"),Be=o("1724"),Ae=o("dad5"),Re=o("2906"),Ie=o("97e5"),Le=o("5e65"),Ue=o("9230"),Me=Object(n["defineComponent"])({name:"WorkoutsList",components:{FilterSelects:Ce["a"],NoWorkouts:Be["a"],Pagination:_e["a"],StaticMap:xe["a"]},props:{user:{type:Object,required:!0},sports:{type:Object}},setup:function(){var e=Object(Re["a"])(),t=Object(z["c"])(),o=Object(z["d"])(),r=["ave_speed","distance","duration","workout_date"],a=Object(n["computed"])((function(){return e.getters[Ae["f"].GETTERS.USER_WORKOUTS]})),c=Object(n["computed"])((function(){return e.getters[Ae["f"].GETTERS.WORKOUTS_PAGINATION]})),l=d(t.query),i=Object(n["ref"])(null);function u(t){e.dispatch(Ae["f"].ACTIONS.GET_USER_WORKOUTS,t)}function s(e,n){var r=Object.assign({},t.query);r[e]=n,"per_page"===e&&(r["page"]="1"),l=d(r),o.push({path:"/workouts",query:l})}function d(e){return l=Object(Ie["a"])(e,r,Ue["a"].order_by,{defaultSort:Ue["a"].order}),Object.keys(e).filter((function(e){return Ie["d"].includes(e)})).map((function(t){"string"===typeof e[t]&&(l[t]=e[t])})),l}function p(e){i.value=e}return Object(n["onBeforeMount"])((function(){u(l)})),Object(n["watch"])((function(){return t.query}),function(){var e=Object(Te["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:l=d(t),u(l);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),{query:l,hoverWorkoutId:i,orderByList:r,pagination:c,sortList:Ie["c"],workouts:a,capitalize:n["capitalize"],format:De["a"],getDateWithTZ:Le["c"],onHover:p,reloadWorkouts:s}}});o("3424");const We=J()(Me,[["render",Ve],["__scopeId","data-v-0144da86"]]);var $e=We,Fe=Object(n["defineComponent"])({name:"WorkoutsView",components:{WorkoutsFilters:Y,WorkoutsList:$e},setup:function(){var e=Object(u["b"])(),t=e.t,o=Object(Re["a"])(),r=Object(n["computed"])((function(){return o.getters[Ae["a"].GETTERS.AUTH_USER_PROFILE]})),a=Object(n["computed"])((function(){return o.getters[Ae["c"].GETTERS.SPORTS]})),c=Object(n["computed"])((function(){return Object(H["d"])(a.value,t)})),l=Object(n["ref"])(!0);function i(){l.value=!l.value}return{authUser:r,hiddenFilters:l,translatedSports:c,toggleFilters:i}}});o("3ad7");const Pe=J()(Fe,[["render",i],["__scopeId","data-v-22a8a7cd"]]);t["default"]=Pe},"172f":function(e,t,o){},2794:function(e,t,o){"use strict";o("3854")},"2de4":function(e,t,o){},"304a":function(e,t,o){"use strict";o.r(t);var n=o("7a23"),r=function(e){return Object(n["pushScopeId"])("data-v-05bdbd04"),e=e(),Object(n["popScopeId"])(),e},a={id:"workout",class:"view"},c={class:"container"},l={key:0,class:"workout-container"},i={key:0},u=r((function(){return Object(n["createElementVNode"])("div",{id:"bottom"},null,-1)})),s={key:1};function d(e,t,o,r,d,p){var b=Object(n["resolveComponent"])("WorkoutDetail"),m=Object(n["resolveComponent"])("WorkoutChart"),O=Object(n["resolveComponent"])("WorkoutSegments"),j=Object(n["resolveComponent"])("WorkoutNotes"),f=Object(n["resolveComponent"])("NotFound");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",a,[Object(n["createElementVNode"])("div",c,[e.sports.length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",l,[e.workoutData.workout.id?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",i,[Object(n["createVNode"])(b,{workoutData:e.workoutData,sports:e.sports,authUser:e.authUser,markerCoordinates:e.markerCoordinates,displaySegment:e.displaySegment},null,8,["workoutData","sports","authUser","markerCoordinates","displaySegment"]),e.workoutData.workout.with_gpx&&e.workoutData.chartData.length>0?(Object(n["openBlock"])(),Object(n["createBlock"])(m,{key:0,workoutData:e.workoutData,authUser:e.authUser,displaySegment:e.displaySegment,onGetCoordinates:e.updateCoordinates},null,8,["workoutData","authUser","displaySegment","onGetCoordinates"])):Object(n["createCommentVNode"])("",!0),!e.displaySegment&&e.workoutData.workout.segments.length>1?(Object(n["openBlock"])(),Object(n["createBlock"])(O,{key:1,segments:e.workoutData.workout.segments},null,8,["segments"])):Object(n["createCommentVNode"])("",!0),e.displaySegment?Object(n["createCommentVNode"])("",!0):(Object(n["openBlock"])(),Object(n["createBlock"])(j,{key:2,notes:e.workoutData.workout.notes},null,8,["notes"])),u])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",s,[e.workoutData.loading?Object(n["createCommentVNode"])("",!0):(Object(n["openBlock"])(),Object(n["createBlock"])(f,{key:0,target:"WORKOUT"}))]))])):Object(n["createCommentVNode"])("",!0)])])}var p=o("1da1"),b=(o("96cf"),o("6c02")),m=o("f7f9"),O={id:"workout-chart"},j={class:"chart-radio"},f=["checked"],k=["checked"],g={class:"no-data-cleaning"};function y(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("LineChart"),i=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",O,[Object(n["createVNode"])(i,null,{title:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.ANALYSIS")),1)]})),content:Object(n["withCtx"])((function(){return[Object(n["createElementVNode"])("div",j,[Object(n["createElementVNode"])("label",null,[Object(n["createElementVNode"])("input",{type:"radio",name:"distance",checked:e.displayDistance,onClick:t[0]||(t[0]=function(){return e.updateDisplayDistance&&e.updateDisplayDistance.apply(e,arguments)})},null,8,f),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DISTANCE")),1)]),Object(n["createElementVNode"])("label",null,[Object(n["createElementVNode"])("input",{type:"radio",name:"duration",checked:!e.displayDistance,onClick:t[1]||(t[1]=function(){return e.updateDisplayDistance&&e.updateDisplayDistance.apply(e,arguments)})},null,8,k),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DURATION")),1)])]),Object(n["createVNode"])(l,Object(n["mergeProps"])(e.lineChartProps,{class:"line-chart",onMouseleave:e.emitEmptyCoordinates}),null,16,["onMouseleave"]),Object(n["createElementVNode"])("div",g,Object(n["toDisplayString"])(e.$t("workouts.NO_DATA_CLEANING")),1)]})),_:1})])}var w=o("ade3"),h=(o("e9c4"),o("b680"),o("a9e3"),o("99af"),o("ac1f"),o("5319"),o("b48c")),v=o("47e2"),E=o("9230"),N=Object(n["defineComponent"])({name:"WorkoutChart",components:{LineChart:h["LineChart"]},props:{authUser:{type:Object,required:!0},workoutData:{type:Object,required:!0}},emits:["getCoordinates"],setup:function(e,t){var o=t.emit,r=Object(v["b"])(),a=r.t,c=Object(n["ref"])(!0),l=Object(n["computed"])((function(){return Object(E["b"])(e.workoutData.chartData,a)})),i=Object(n["computed"])((function(){return{labels:c.value?l.value.distance_labels:l.value.duration_labels,datasets:JSON.parse(JSON.stringify([l.value.datasets.speed,l.value.datasets.elevation]))}})),u=Object(n["computed"])((function(){return l.value.coordinates})),s=Object(n["computed"])((function(){var e;return{responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:(e={},Object(w["a"])(e,c.value?"xDistance":"xDuration",{grid:{drawOnChartArea:!1},ticks:{count:10,callback:function(e){return c.value?Number(e).toFixed(2):p(e)}},type:"linear",bounds:"data",title:{display:!0,text:c.value?a("workouts.DISTANCE")+" (km)":a("workouts.DURATION")}}),Object(w["a"])(e,"ySpeed",{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:a("workouts.SPEED")+" (km/h)"}}),Object(w["a"])(e,"yElevation",{beginAtZero:!0,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:a("workouts.ELEVATION")+" (m)"}}),e),elements:{point:{pointStyle:"circle",pointRadius:0}},plugins:{datalabels:{display:!1},tooltip:{interaction:{intersect:!1,mode:"index"},callbacks:{label:function(e){var t=" ".concat(e.dataset.label,": ").concat(e.formattedValue);return"yElevation"===e.dataset.yAxisID?t+" m":t+" km/h"},title:function(e){return e.length>0&&b(u.value[e[0].dataIndex]),0===e.length?"":c.value?"".concat(a("workouts.DISTANCE"),": ").concat(e[0].label," km"):"".concat(a("workouts.DURATION"),": ").concat(p(e[0].label.replace(",","")))}}}}}}));function d(){c.value=!c.value}function p(e){return new Date(1e3*+e).toISOString().substr(11,8)}function b(e){o("getCoordinates",e)}function m(){b({latitude:null,longitude:null})}var O=Object(h["useLineChart"])({chartData:i,options:s}),j=O.lineChartProps;return{displayDistance:c,lineChartProps:j,emitEmptyCoordinates:m,updateDisplayDistance:d}}}),S=(o("5687"),o("6b0d")),V=o.n(S);const T=V()(N,[["render",y],["__scopeId","data-v-2230775e"]]);var D=T,C={class:"workout-detail"};function _(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("Modal"),i=Object(n["resolveComponent"])("WorkoutCardTitle"),u=Object(n["resolveComponent"])("WorkoutMap"),s=Object(n["resolveComponent"])("WorkoutData"),d=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",C,[e.displayModal?(Object(n["openBlock"])(),Object(n["createBlock"])(l,{key:0,title:e.$t("common.CONFIRMATION"),message:e.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:t[0]||(t[0]=function(t){return e.deleteWorkout(e.workoutObject.workoutId)}),onCancelAction:t[1]||(t[1]=function(t){return e.updateDisplayModal(!1)})},null,8,["title","message"])):Object(n["createCommentVNode"])("",!0),Object(n["createVNode"])(d,null,{title:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(i,{sport:e.sport,workoutObject:e.workoutObject,onDisplayModal:t[2]||(t[2]=function(t){return e.updateDisplayModal(!0)})},null,8,["sport","workoutObject"])]})),content:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(u,{workoutData:e.workoutData,markerCoordinates:e.markerCoordinates},null,8,["workoutData","markerCoordinates"]),Object(n["createVNode"])(s,{workoutObject:e.workoutObject},null,8,["workoutObject"])]})),_:1})])}o("7db0"),o("d3b7");var x=function(e){return Object(n["pushScopeId"])("data-v-9cab340c"),e=e(),Object(n["popScopeId"])(),e},B={id:"workout-card-title"},A=["title"],R=x((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1)})),I=[R],L={class:"workout-card-title"},U={class:"workout-title-date"},M={key:0,class:"workout-title"},W={key:1,class:"workout-title"},$={class:"workout-segment"},F=Object(n["createTextVNode"])(" — "),P=x((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1)})),G={class:"workout-date"},q={class:"workout-link"},z=["title"],H=x((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1)})),K=[H];function Z(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("SportImage"),i=Object(n["resolveComponent"])("router-link");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",B,[Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["workout-previous workout-arrow",{inactive:!e.workoutObject.previousUrl}]),title:e.workoutObject.previousUrl?e.$t("workouts.PREVIOUS_".concat(e.workoutObject.type)):e.$t("workouts.NO_PREVIOUS_".concat(e.workoutObject.type)),onClick:t[0]||(t[0]=function(t){return e.workoutObject.previousUrl?e.$router.push(e.workoutObject.previousUrl):null})},I,10,A),Object(n["createElementVNode"])("div",L,[Object(n["createVNode"])(l,{"sport-label":e.sport.label},null,8,["sport-label"]),Object(n["createElementVNode"])("div",U,["WORKOUT"===e.workoutObject.type?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",M,[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.workoutObject.title)+" ",1),Object(n["createElementVNode"])("i",{class:"fa fa-edit","aria-hidden":"true",onClick:t[1]||(t[1]=function(t){return e.$router.push({name:"EditWorkout",params:{workoutId:e.workoutObject.workoutId}})})}),Object(n["createElementVNode"])("i",{class:"fa fa-trash","aria-hidden":"true",onClick:t[2]||(t[2]=function(t){return e.emit("displayModal",!0)})})])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",W,[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.workoutObject.title)+" ",1),Object(n["createElementVNode"])("span",$,[F,P,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.SEGMENT"))+" "+Object(n["toDisplayString"])(e.workoutObject.segmentId+1),1)])])),Object(n["createElementVNode"])("div",G,[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.workoutObject.workoutDate)+" - "+Object(n["toDisplayString"])(e.workoutObject.workoutTime)+" ",1),Object(n["createElementVNode"])("span",q,["SEGMENT"===e.workoutObject.type?(Object(n["openBlock"])(),Object(n["createBlock"])(i,{key:0,to:{name:"Workout",params:{workoutId:e.workoutObject.workoutId}}},{default:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(" > "+Object(n["toDisplayString"])(e.$t("workouts.BACK_TO_WORKOUT")),1)]})),_:1},8,["to"])):Object(n["createCommentVNode"])("",!0)])])])]),Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["workout-next workout-arrow",{inactive:!e.workoutObject.nextUrl}]),title:e.workoutObject.nextUrl?e.$t("workouts.NEXT_".concat(e.workoutObject.type)):e.$t("workouts.NO_NEXT_".concat(e.workoutObject.type)),onClick:t[3]||(t[3]=function(t){return e.workoutObject.nextUrl?e.$router.push(e.workoutObject.nextUrl):null})},K,10,z)])}var J=Object(n["defineComponent"])({name:"WorkoutCardTitle",props:{sport:{type:Object,required:!0},workoutObject:{type:Object,required:!0}},emits:["displayModal"],setup:function(e,t){var o=t.emit;return{emit:o}}});o("5910");const X=V()(J,[["render",Z],["__scopeId","data-v-9cab340c"]]);var Y=X,Q=function(e){return Object(n["pushScopeId"])("data-v-aa863bde"),e=e(),Object(n["popScopeId"])(),e},ee={id:"workout-info"},te={class:"workout-data"},oe=Q((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1)})),ne={key:0},re={class:"workout-data"},ae=Q((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1)})),ce={class:"workout-data"},le=Q((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1)})),ie=Q((function(){return Object(n["createElementVNode"])("br",null,null,-1)})),ue={key:0,class:"workout-data"},se=["alt"],de=Q((function(){return Object(n["createElementVNode"])("br",null,null,-1)})),pe={key:1,class:"workout-data"},be=Q((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1)})),me=Q((function(){return Object(n["createElementVNode"])("br",null,null,-1)}));function Oe(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("WorkoutRecord"),i=Object(n["resolveComponent"])("WorkoutWeather");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ee,[Object(n["createElementVNode"])("div",te,[oe,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DURATION"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.moving),1),Object(n["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"LD"},null,8,["workoutObject"]),e.withPause?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ne,[Object(n["createTextVNode"])(" ("+Object(n["toDisplayString"])(e.$t("workouts.PAUSES"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.pauses),1),Object(n["createTextVNode"])(" - "+Object(n["toDisplayString"])(e.$t("workouts.TOTAL_DURATION"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.duration)+")",1)])):Object(n["createCommentVNode"])("",!0)]),Object(n["createElementVNode"])("div",re,[ae,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DISTANCE"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.distance)+" km",1),Object(n["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"FD"},null,8,["workoutObject"])]),Object(n["createElementVNode"])("div",ce,[le,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.AVERAGE_SPEED"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.aveSpeed)+" km/h",1),Object(n["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"AS"},null,8,["workoutObject"]),ie,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.maxSpeed)+" km/h",1),Object(n["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"MS"},null,8,["workoutObject"])]),null!==e.workoutObject.maxAlt&&null!==e.workoutObject.minAlt?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ue,[Object(n["createElementVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,se),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.MIN_ALTITUDE"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.minAlt)+" m",1),de,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.MAX_ALTITUDE"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.maxAlt)+" m",1)])):Object(n["createCommentVNode"])("",!0),null!==e.workoutObject.ascent&&null!==e.workoutObject.descent?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",pe,[be,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.ASCENT"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.ascent)+" m",1),me,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DESCENT"))+": ",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.workoutObject.descent)+" m",1)])):Object(n["createCommentVNode"])("",!0),Object(n["createVNode"])(i,{workoutObject:e.workoutObject},null,8,["workoutObject"])])}var je=function(e){return Object(n["pushScopeId"])("data-v-da96984c"),e=e(),Object(n["popScopeId"])(),e},fe={key:0,class:"workout-record"},ke=je((function(){return Object(n["createElementVNode"])("sup",null,[Object(n["createElementVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1)})),ge=[ke];function ye(e,t,o,r,a,c){return e.workoutObject.records&&e.workoutObject.records.find((function(t){return t.record_type===e.record_type}))?(Object(n["openBlock"])(),Object(n["createElementBlock"])("span",fe,ge)):Object(n["createCommentVNode"])("",!0)}var we=Object(n["defineComponent"])({name:"WorkoutRecord",props:{record_type:{type:String,required:!0},workoutObject:{type:Object,required:!0}}});o("bfb4");const he=V()(we,[["render",ye],["__scopeId","data-v-da96984c"]]);var ve=he,Ee=function(e){return Object(n["pushScopeId"])("data-v-7eb41918"),e=e(),Object(n["popScopeId"])(),e},Ne={key:0,id:"workout-weather"},Se={class:"weather-table"},Ve=Ee((function(){return Object(n["createElementVNode"])("th",null,null,-1)})),Te={class:"weather-th"},De=["src","alt","title"],Ce={class:"weather-th"},_e=["src","alt","title"],xe=["alt","title"],Be=["alt","title"],Ae=["alt","title"];function Re(e,t,o,r,a,c){return e.workoutObject.weatherStart&&e.workoutObject.weatherEnd?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ne,[Object(n["createElementVNode"])("table",Se,[Object(n["createElementVNode"])("thead",null,[Object(n["createElementVNode"])("tr",null,[Ve,Object(n["createElementVNode"])("th",null,[Object(n["createElementVNode"])("div",Te,[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.START"))+" ",1),Object(n["createElementVNode"])("img",{class:"weather-img",src:"/img/weather/".concat(e.workoutObject.weatherStart.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherStart.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherStart.icon))},null,8,De)])]),Object(n["createElementVNode"])("th",null,[Object(n["createElementVNode"])("div",Ce,[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.END"))+" ",1),Object(n["createElementVNode"])("img",{class:"weather-img",src:"/img/weather/".concat(e.workoutObject.weatherEnd.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherEnd.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherEnd.icon))},null,8,_e)])])])]),Object(n["createElementVNode"])("tbody",null,[Object(n["createElementVNode"])("tr",null,[Object(n["createElementVNode"])("td",null,[Object(n["createElementVNode"])("img",{class:"weather-img weather-img-small",src:"/img/weather/temperature.svg",alt:e.$t("workouts.WEATHER.TEMPERATURE"),title:e.$t("workouts.WEATHER.TEMPERATURE")},null,8,xe)]),Object(n["createElementVNode"])("td",null,Object(n["toDisplayString"])(Number(e.workoutObject.weatherStart.temperature).toFixed(1))+"°C ",1),Object(n["createElementVNode"])("td",null,Object(n["toDisplayString"])(Number(e.workoutObject.weatherEnd.temperature).toFixed(1))+"°C ",1)]),Object(n["createElementVNode"])("tr",null,[Object(n["createElementVNode"])("td",null,[Object(n["createElementVNode"])("img",{class:"weather-img weather-img-small",src:"/img/weather/pour-rain.svg",alt:e.$t("workouts.WEATHER.HUMIDITY"),title:e.$t("workouts.WEATHER.HUMIDITY")},null,8,Be)]),Object(n["createElementVNode"])("td",null,Object(n["toDisplayString"])(Number(100*e.workoutObject.weatherStart.humidity).toFixed(1))+"% ",1),Object(n["createElementVNode"])("td",null,Object(n["toDisplayString"])(Number(100*e.workoutObject.weatherEnd.humidity).toFixed(1))+"% ",1)]),Object(n["createElementVNode"])("tr",null,[Object(n["createElementVNode"])("td",null,[Object(n["createElementVNode"])("img",{class:"weather-img weather-img-small",src:"/img/weather/breeze.svg",alt:e.$t("workouts.WEATHER.WIND"),title:e.$t("workouts.WEATHER.WIND")},null,8,Ae)]),Object(n["createElementVNode"])("td",null,Object(n["toDisplayString"])(Number(e.workoutObject.weatherStart.wind).toFixed(1))+"m/s",1),Object(n["createElementVNode"])("td",null,Object(n["toDisplayString"])(Number(e.workoutObject.weatherEnd.wind).toFixed(1))+"m/s",1)])])])])):Object(n["createCommentVNode"])("",!0)}var Ie=Object(n["defineComponent"])({name:"WorkoutWeather",props:{workoutObject:{type:Object,required:!0}}});o("6595");const Le=V()(Ie,[["render",Re],["__scopeId","data-v-7eb41918"]]);var Ue=Le,Me=Object(n["defineComponent"])({name:"WorkoutData",components:{WorkoutRecord:ve,WorkoutWeather:Ue},props:{workoutObject:{type:Object,required:!0}},setup:function(e){return{withPause:Object(n["computed"])((function(){return"0:00:00"!==e.workoutObject.pauses&&null!==e.workoutObject.pauses}))}}});o("f962");const We=V()(Me,[["render",Oe],["__scopeId","data-v-aa863bde"]]);var $e=We,Fe={id:"workout-map"},Pe={key:0,class:"leaflet-container"},Ge={key:1},qe={key:0,class:"leaflet-container"},ze={key:1,class:"no-map"};function He(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("LTileLayer"),i=Object(n["resolveComponent"])("LGeoJson"),u=Object(n["resolveComponent"])("LMarker"),s=Object(n["resolveComponent"])("LMap");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Fe,[e.workoutData.loading?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Pe)):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ge,[e.workoutData.workout.with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",qe,[e.geoJson.jsonData&&e.center&&2===e.bounds.length?(Object(n["openBlock"])(),Object(n["createBlock"])(s,{key:0,zoom:13,center:e.center,bounds:e.bounds,ref:"workoutMap",onReady:t[0]||(t[0]=function(t){return e.fitBounds(e.bounds)})},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(l,{url:"".concat(e.getApiUrl(),"workouts/map_tile/{s}/{z}/{x}/{y}.png"),attribution:e.appConfig.map_attribution,bounds:e.bounds},null,8,["url","attribution","bounds"]),Object(n["createVNode"])(i,{geojson:e.geoJson.jsonData},null,8,["geojson"]),e.markerCoordinates.latitude?(Object(n["openBlock"])(),Object(n["createBlock"])(u,{key:0,"lat-lng":[e.markerCoordinates.latitude,e.markerCoordinates.longitude]},null,8,["lat-lng"])):Object(n["createCommentVNode"])("",!0)]})),_:1},8,["center","bounds"])):Object(n["createCommentVNode"])("",!0)])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ze,Object(n["toDisplayString"])(e.$t("workouts.NO_MAP")),1))]))])}var Ke=o("e94f"),Ze=o("5afd"),Je=o("dad5"),Xe=o("2906"),Ye=o("d257"),Qe=Object(n["defineComponent"])({name:"WorkoutMap",components:{LGeoJson:Ze["a"],LMap:Ze["b"],LMarker:Ze["c"],LTileLayer:Ze["d"]},props:{workoutData:{type:Object},markerCoordinates:{type:Object,required:!1}},setup:function(e){var t=Object(Xe["a"])();function o(e){if(!e||""!==e)try{var t=Object(Ke["gpx"])((new DOMParser).parseFromString(e,"text/xml"));return{jsonData:t}}catch(o){return console.error("Invalid gpx content"),{}}return{}}function r(e){return[(e.value[0][0]+e.value[1][0])/2,(e.value[0][1]+e.value[1][1])/2]}function a(e){var t,o;null!==(t=c.value)&&void 0!==t&&t.leafletObject&&(null===(o=c.value)||void 0===o||o.leafletObject.fitBounds(e))}var c=Object(n["ref"])(null),l=Object(n["computed"])((function(){return e.workoutData?[[e.workoutData.workout.bounds[0],e.workoutData.workout.bounds[1]],[e.workoutData.workout.bounds[2],e.workoutData.workout.bounds[3]]]:[]})),i=Object(n["computed"])((function(){return t.getters[Je["b"].GETTERS.APP_CONFIG]})),u=Object(n["computed"])((function(){return r(l)})),s=Object(n["computed"])((function(){return e.workoutData&&e.workoutData.gpx?o(e.workoutData.gpx):{}}));return{appConfig:i,bounds:l,center:u,geoJson:s,workoutMap:c,fitBounds:a,getApiUrl:Ye["a"]}}});o("2794");const et=V()(Qe,[["render",He],["__scopeId","data-v-76f3a2e8"]]);var tt=et,ot=o("5e65"),nt=Object(n["defineComponent"])({name:"WorkoutDetail",components:{WorkoutCardTitle:Y,WorkoutData:$e,WorkoutMap:tt},props:{authUser:{type:Object,required:!0},displaySegment:{type:Boolean,required:!0},markerCoordinates:{type:Object,required:!1},sports:{type:Object},workoutData:{type:Object,required:!0}},setup:function(e){var t=Object(b["c"])(),o=Object(Xe["a"])();function r(e,t,o){var n=t&&o&&1!==o?"/workouts/".concat(e.id,"/segment/").concat(o-1):!t&&e.previous_workout?"/workouts/".concat(e.previous_workout):null,r=t&&o&&o<e.segments.length?"/workouts/".concat(e.id,"/segment/").concat(o+1):!t&&e.next_workout?"/workouts/".concat(e.next_workout):null;return{previousUrl:n,nextUrl:r}}function a(t,o){var n=r(t,e.displaySegment,u.value?+u.value:null),a=Object(ot["a"])(Object(ot["c"])(e.workoutData.workout.workout_date,e.authUser.timezone));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:n.nextUrl,pauses:o?o.pauses:t.pauses,previousUrl:n.previousUrl,records:o?[]:t.records,segmentId:o?o.segment_id:null,title:t.title,type:e.displaySegment?"SEGMENT":"WORKOUT",workoutDate:a.workout_date,weatherEnd:o?null:t.weather_end,workoutId:t.id,weatherStart:o?null:t.weather_start,workoutTime:a.workout_time}}function c(e){d.value=e}function l(e){o.dispatch(Je["f"].ACTIONS.DELETE_WORKOUT,{workoutId:e})}var i=Object(n["computed"])((function(){return e.workoutData.workout})),u=Object(n["ref"])(t.params.workoutId?+t.params.segmentId:null),s=Object(n["computed"])((function(){return i.value.segments.length>0&&u.value?i.value.segments[+u.value-1]:null})),d=Object(n["ref"])(!1);return Object(n["watch"])((function(){return t.params.segmentId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t&&(u.value=+t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),{sport:Object(n["computed"])((function(){return e.sports?e.sports.find((function(t){return t.id===e.workoutData.workout.sport_id})):{}})),workoutObject:Object(n["computed"])((function(){return a(i.value,s.value)})),displayModal:d,deleteWorkout:l,updateDisplayModal:c}}});o("c2ce");const rt=V()(nt,[["render",_],["__scopeId","data-v-a17554ea"]]);var at=rt,ct={id:"workout-note"};function lt(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ct,[Object(n["createVNode"])(l,null,{title:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.NOTES")),1)]})),content:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.notes&&""!==e.notes?e.notes:e.$t("workouts.NO_NOTES")),1)]})),_:1})])}var it=Object(n["defineComponent"])({name:"WorkoutNotes",props:{notes:{type:String,required:!1}}});o("42ec");const ut=V()(it,[["render",lt],["__scopeId","data-v-5c47d30a"]]);var st=ut,dt={id:"workout-segments"};function pt(e,t,o,r,a,c){var l=Object(n["resolveComponent"])("router-link"),i=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",dt,[Object(n["createVNode"])(i,null,{title:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.SEGMENT",2)),1)]})),content:Object(n["withCtx"])((function(){return[Object(n["createElementVNode"])("ul",null,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(e.segments,(function(t,o){return Object(n["openBlock"])(),Object(n["createElementBlock"])("li",{key:t.segment_id},[Object(n["createVNode"])(l,{to:{name:"WorkoutSegment",params:{workoutId:t.workout_id,segmentId:o+1}}},{default:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.SEGMENT",1))+" "+Object(n["toDisplayString"])(o+1),1)]})),_:2},1032,["to"]),Object(n["createTextVNode"])(" ("+Object(n["toDisplayString"])(e.$t("workouts.DISTANCE"))+": "+Object(n["toDisplayString"])(t.distance)+" km, "+Object(n["toDisplayString"])(e.$t("workouts.DURATION"))+": "+Object(n["toDisplayString"])(t.duration)+") ",1)])})),128))])]})),_:1})])}var bt=Object(n["defineComponent"])({name:"WorkoutSegments",props:{segments:{type:Object,required:!0}}});o("628e");const mt=V()(bt,[["render",pt],["__scopeId","data-v-5c40d110"]]);var Ot=mt,jt=Object(n["defineComponent"])({name:"Workout",components:{NotFound:m["a"],WorkoutChart:D,WorkoutDetail:at,WorkoutNotes:st,WorkoutSegments:Ot},props:{displaySegment:{type:Boolean,required:!0}},setup:function(e){var t=Object(b["c"])(),o=Object(Xe["a"])();Object(n["onBeforeMount"])((function(){var n={workoutId:t.params.workoutId};e.displaySegment&&(n.segmentId=t.params.segmentId),o.dispatch(Je["f"].ACTIONS.GET_WORKOUT_DATA,n)}));var r=Object(n["computed"])((function(){return o.getters[Je["f"].GETTERS.WORKOUT_DATA]})),a=Object(n["computed"])((function(){return o.getters[Je["a"].GETTERS.AUTH_USER_PROFILE]})),c=Object(n["computed"])((function(){return o.getters[Je["c"].GETTERS.SPORTS]})),l=Object(n["ref"])({latitude:null,longitude:null});function i(e){l.value={latitude:e.latitude,longitude:e.longitude}}return Object(n["watch"])((function(){return t.params.workoutId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t&&o.dispatch(Je["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(n["watch"])((function(){return t.params.segmentId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(n){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.params.workoutId&&(r={workoutId:t.params.workoutId},n&&(r.segmentId=n),o.dispatch(Je["f"].ACTIONS.GET_WORKOUT_DATA,r));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(n["onUnmounted"])((function(){o.commit(Je["f"].MUTATIONS.EMPTY_WORKOUT)})),{authUser:a,markerCoordinates:l,sports:c,workoutData:r,updateCoordinates:i}}});o("76ef");const ft=V()(jt,[["render",d],["__scopeId","data-v-05bdbd04"]]);t["default"]=ft},3424:function(e,t,o){"use strict";o("4bb0")},3854:function(e,t,o){},3950:function(e,t,o){},"3ab5":function(e,t,o){"use strict";o("799a")},"3ad7":function(e,t,o){"use strict";o("3950")},"42ec":function(e,t,o){"use strict";o("8300")},"442c":function(e,t,o){},"4bb0":function(e,t,o){},5687:function(e,t,o){"use strict";o("bef2")},5910:function(e,t,o){"use strict";o("b76e")},"5afd":function(e,t,o){"use strict";(function(e){o.d(t,"a",(function(){return T})),o.d(t,"b",(function(){return x})),o.d(t,"c",(function(){return R})),o.d(t,"d",(function(){return $}));var n=o("7a23");const r=(e,t)=>{let o;return function(...n){const r=this;o&&clearTimeout(o),o=setTimeout(()=>{e.apply(r,n),o=null},t)}},a=e=>e&&"function"===typeof e.charAt?e.charAt(0).toUpperCase()+e.slice(1):e,c=(e,t,o)=>{for(const r in o){const c="set"+a(r);e[c]?Object(n["watch"])(()=>o[r],(t,o)=>{e[c](t,o)}):t[c]&&Object(n["watch"])(()=>o[r],e=>{t[c](e)})}},l=e=>{const t={};for(const o in e)if(o.startsWith("on")&&!o.startsWith("onUpdate")&&"onReady"!==o){const n=o.slice(2).toLocaleLowerCase();t[n]=e[o]}return t},i=async e=>{const t=await Promise.all([o.e("chunk-2d0c9189").then(o.t.bind(null,"584d",7)),o.e("chunk-2d0cf391").then(o.t.bind(null,"6397",7)),o.e("chunk-2d22523a").then(o.t.bind(null,"e2b9",7))]);delete e.Default.prototype._getIconUrl,e.Default.mergeOptions({iconRetinaUrl:t[0].default,iconUrl:t[1].default,shadowUrl:t[2].default})},u=e=>{const t=Object(n["ref"])(()=>console.warn(`Method ${e} has been invoked without being replaced`)),o=(...e)=>t.value(...e);return o.wrapped=t,Object(n["provide"])(e,o),o},s=(e,t)=>e.wrapped.value=t,d="object"===typeof self&&self.self===self&&self||"object"===typeof e&&e.global===e&&e||void 0,p="useGlobalLeaflet",b={options:{type:Object,default:()=>({})}},m=e=>({options:e.options,methods:{}}),O={...b,pane:{type:String,default:"overlayPane"},attribution:{type:String,default:null},name:{type:String,custom:!0,default:void 0},layerType:{type:String,custom:!0,default:void 0},visible:{type:Boolean,custom:!0,default:!0}},j=(e,t,o)=>{const r=Object(n["inject"])("addLayer"),a=Object(n["inject"])("removeLayer"),{options:c,methods:l}=m(e),i={...c,attribution:e.attribution,pane:e.pane},u=()=>r({leafletObject:t.value}),s=()=>a({leafletObject:t.value}),d={...l,setAttribution(e,t){const o=this.$parent.leafletObject.attributionControl;o.removeAttribution(t).addAttribution(e)},setName(){s(),e.visible&&u()},setLayerType(){s(),e.visible&&u()},setVisible(e){t.value&&(e?u():s())},bindPopup({leafletObject:e}){t.value.bindPopup(e)},bindTooltip({leafletObject:e}){t.value.bindTooltip(e)},unbindTooltip(){const e=t.value?t.value.getTooltip():null;e&&e.unbindTooltip()},unbindPopup(){const e=t.value?t.value.getPopup():null;e&&e.unbindPopup()},updateVisibleProp(e){o.emit("update:visible",e)}};return Object(n["provide"])("bindPopup",d.bindPopup),Object(n["provide"])("bindTooltip",d.bindTooltip),Object(n["provide"])("unbindTooltip",d.unbindTooltip),Object(n["provide"])("unbindPopup",d.unbindPopup),Object(n["onUnmounted"])(()=>{d.unbindPopup(),d.unbindTooltip(),s()}),{options:i,methods:d}},f=(e,t)=>{if(e&&t.default)return Object(n["h"])("div",{style:{display:"none"}},t.default())},k={...b,interactive:{type:Boolean,default:!0},bubblingMouseEvents:{type:Boolean,default:!0}},g={...O,...k,stroke:{type:Boolean,custom:!0,default:!0},color:{type:String,custom:!0,default:"#3388ff"},weight:{type:Number,custom:!0,default:3},opacity:{type:Number,custom:!0,default:1},lineCap:{type:String,custom:!0,default:"round"},lineJoin:{type:String,custom:!0,default:"round"},dashArray:{type:String,custom:!0,default:null},dashOffset:{type:String,custom:!0,default:null},fill:{type:Boolean,custom:!0,default:!1},fillColor:{type:String,custom:!0,default:"#3388ff"},fillOpacity:{type:Number,custom:!0,default:.2},fillRule:{type:String,custom:!0,default:"evenodd"},className:{type:String,custom:!0,default:null}},y={...g,latLng:{type:[Object,Array],custom:!0,default:null},radius:{type:Number,default:null}};const w={...b,position:{type:String,default:"topright"}},h=(e,t)=>{const{options:o,methods:r}=m(e),a={...o,position:e.position},c={...r,setPosition(e){t.value&&t.value.setPosition(e)}};return Object(n["onUnmounted"])(()=>{t.value&&t.value.remove()}),{options:a,methods:c}},v=e=>e.default?Object(n["h"])("div",{ref:"root"},e.default()):null;Boolean,Boolean;Boolean,Boolean,Boolean,Boolean;Boolean,Boolean,Boolean;const E={...O},N=(e,t,o)=>{const{options:r,methods:a}=j(e,t,o),c={...r},l={...a,addLayer(e){t.value.addLayer(e.leafletObject)},removeLayer(e){t.value.removeLayer(e.leafletObject)}};return Object(n["provide"])("addLayer",l.addLayer),Object(n["provide"])("removeLayer",l.removeLayer),{options:c,methods:l}};const S={...E,geojson:{type:[Object,Array],default:()=>({})}},V=(e,t)=>{const{options:o,methods:n}=N(e,t),r={...o,...e},a={...n,setGeojson(e){t.value.clearLayers(),t.value.addData(e)},getGeoJSONData(){return t.value.toGeoJSON()},getBounds(){return t.value.getBounds()}};return{options:r,methods:a}};var T={props:S,setup(e,t){const r=Object(n["ref"])({}),a=Object(n["ref"])(!1),i=Object(n["inject"])(p),u=Object(n["inject"])("addLayer"),{methods:s,options:b}=V(e,r);return Object(n["onMounted"])(async()=>{const{geoJSON:p,DomEvent:m}=i?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));r.value=p(e.geojson,b);const O=l(t.attrs);m.on(r.value,O),c(s,r.value,e),u({...e,...s,leafletObject:r.value}),a.value=!0,Object(n["nextTick"])(()=>t.emit("ready",r.value))}),{ready:a,leafletObject:r}},render(){return f(this.ready,this.$slots)},__file:"src/components/LGeoJson.vue"};const D={...O,pane:{type:String,default:"tilePane"},opacity:{type:Number,custom:!1,default:1},zIndex:{type:Number,default:1},tileSize:{type:Number,default:256},noWrap:{type:Boolean,default:!1},minZoom:{type:Number,default:0},maxZoom:{type:Number,default:void 0}},C=(e,t,o)=>{const{options:n,methods:r}=j(e,t,o),a={...n,pane:e.pane,opacity:e.opacity,zIndex:e.zIndex,tileSize:e.tileSize,noWrap:e.noWrap,minZoom:e.minZoom,maxZoom:e.maxZoom};return{options:a,methods:{...r}}};const _={iconUrl:{type:String,custom:!0,default:null},iconRetinaUrl:{type:String,custom:!0,default:null},iconSize:{type:[Object,Array],custom:!0,default:null},iconAnchor:{type:[Object,Array],custom:!0,default:null},popupAnchor:{type:[Object,Array],custom:!0,default:()=>[0,0]},tooltipAnchor:{type:[Object,Array],custom:!0,default:()=>[0,0]},shadowUrl:{type:String,custom:!0,default:null},shadowRetinaUrl:{type:String,custom:!0,default:null},shadowSize:{type:[Object,Array],custom:!0,default:null},shadowAnchor:{type:[Object,Array],custom:!0,default:null},bgPos:{type:[Object,Array],custom:!0,default:()=>[0,0]},className:{type:String,custom:!0,default:""},options:{type:Object,custom:!0,default:()=>({})}};Boolean,Boolean;var x={emits:["ready","update:zoom","update:center","update:bounds"],props:{...b,center:{type:[Object,Array],default:()=>[0,0]},bounds:{type:[Array,Object],default:void 0},maxBounds:{type:[Array,Object],default:void 0},zoom:{type:Number,default:0},minZoom:{type:Number,default:void 0},maxZoom:{type:Number,default:void 0},paddingBottomRight:{type:Array,default:void 0},paddingTopLeft:{type:Array,default:void 0},padding:{type:Array,default:void 0},worldCopyJump:{type:Boolean,default:!1},crs:{type:[String,Object],default:"EPSG3857"},maxBoundsViscosity:{type:Number,default:void 0},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number,default:void 0},inertiaMaxSpeed:{type:Number,default:void 0},easeLinearity:{type:Number,default:void 0},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number,default:void 0},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:!1},useGlobalLeaflet:{type:Boolean,default:!1}},setup(e,t){const a=Object(n["ref"])(null),b=Object(n["reactive"])({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:O}=m(e),j={...O,minZoom:e.minZoom,maxZoom:e.maxZoom,maxBounds:e.maxBounds,maxBoundsViscosity:e.maxBoundsViscosity,worldCopyJump:e.worldCopyJump,crs:e.crs,center:e.center,zoom:e.zoom,inertia:e.inertia,inertiaDeceleration:e.inertiaDeceleration,inertiaMaxSpeed:e.inertiaMaxSpeed,easeLinearity:e.easeLinearity,zoomAnimation:e.zoomAnimation,zoomAnimationThreshold:e.zoomAnimationThreshold,fadeAnimation:e.fadeAnimation,markerZoomAnimation:e.markerZoomAnimation},f=u("addLayer"),k=u("removeLayer"),g=u("registerControl"),y=u("registerLayerControl");Object(n["provide"])(p,e.useGlobalLeaflet);const w={moveEndHandler(){t.emit("update:zoom",b.leafletRef.getZoom()),t.emit("update:center",b.leafletRef.getCenter()),t.emit("update:bounds",b.leafletRef.getBounds())},overlayAddHandler(e){const t=b.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!0)},overlayRemoveHandler(e){const t=b.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!1)}};Object(n["onMounted"])(async()=>{e.useGlobalLeaflet&&(d.L=d.L||await o.e("chunk-2d2248b6").then(o.t.bind(null,"e11e",7)));const{map:u,CRS:p,Icon:m,latLngBounds:O,latLng:h,DomEvent:v}=e.useGlobalLeaflet?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));try{j.beforeMapMount&&await j.beforeMapMount()}catch(V){console.error("The following error occurred running the provided beforeMapMount hook "+V.message)}await i(m);const E="string"==typeof j.crs?p[j.crs]:j.crs;j.crs=E||p.EPSG3857;const N={addLayer(e){if(void 0!==e.layerType)if(void 0===b.layerControl)b.layersToAdd.push(e);else{const t=b.layersInControl.find(t=>t.leafletObject._leaflet_id===e.leafletObject._leaflet_id);t||(b.layerControl.addLayer(e),b.layersInControl.push(e))}!1!==e.visible&&b.leafletRef.addLayer(e.leafletObject)},removeLayer(e){void 0!==e.layerType&&(void 0===b.layerControl?b.layersToAdd=b.layersToAdd.filter(t=>t.name!==e.name):(b.layerControl.removeLayer(e.leafletObject),b.layersInControl=b.layersInControl.filter(t=>t.leafletObject._leaflet_id!==e.leafletObject._leaflet_id))),b.leafletRef.removeLayer(e.leafletObject)},registerLayerControl(e){b.layerControl=e,b.layersToAdd.forEach(e=>{b.layerControl.addLayer(e)}),b.layersToAdd=[],g(e)},registerControl(e){b.leafletRef.addControl(e.leafletObject)},setZoom(t){const o=b.leafletRef.getZoom();t!==o&&b.leafletRef.setZoom(t,{animate:!e.noBlockingAnimations&&null})},setPaddingBottomRight(e){b.paddingBottomRight=e},setPaddingTopLeft(e){b.paddingTopLeft=e},setPadding(e){b.padding=e},setCrs(e){const t=b.leafletRef.getBounds();b.leafletRef.options.crs=e,b.leafletRef.fitBounds(t,{animate:!1,padding:[0,0]})},fitBounds(e){b.leafletRef.fitBounds(e,{animate:!this.noBlockingAnimations&&null})},setBounds(e){if(!e)return;const t=O(e);if(!t.isValid())return;const o=b.lastSetBounds||b.leafletRef.getBounds(),n=!o.equals(t,0);n&&(b.lastSetBounds=t,b.leafletRef.fitBounds(t,this.fitBoundsOptions))},setCenter(e){if(null==e)return;const t=h(e),o=b.lastSetCenter||b.leafletRef.getCenter();o.lat===t.lat&&o.lng===t.lng||(b.lastSetCenter=t,b.leafletRef.panTo(t,{animate:!this.noBlockingAnimations&&null}))}};s(f,N.addLayer),s(k,N.removeLayer),s(g,N.registerControl),s(y,N.registerLayerControl),b.leafletRef=u(a.value,j),c(N,b.leafletRef,e);const S=l(t.attrs);b.leafletRef.on("moveend",r(w.moveEndHandler,100)),b.leafletRef.on("overlayadd",w.overlayAddHandler),b.leafletRef.on("overlayremove",w.overlayRemoveHandler),v.on(b.leafletRef,S),b.ready=!0,Object(n["nextTick"])(()=>t.emit("ready",b.leafletRef))}),Object(n["onBeforeUnmount"])(()=>{b.leafletRef&&b.leafletRef.remove()});const h=Object(n["computed"])(()=>b.leafletRef),v=Object(n["computed"])(()=>b.ready);return{root:a,ready:v,leafletObject:h}},render(){return Object(n["h"])("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready?this.$slots.default():{})},__file:"src/components/LMap.vue"};const B={...O,pane:{type:String,default:"markerPane"},draggable:{type:Boolean,custom:!0,default:!1},latLng:{type:[Object,Array],custom:!0,default:null},icon:{type:[Object],default:()=>{},custom:!1},zIndexOffset:{type:Number,custom:!1,default:null}},A=(e,t,o)=>{const{options:n,methods:r}=j(e,t,o),a={...n,...e},c={...r,setDraggable(e){t.value.dragging&&(e?t.value.dragging.enable():t.value.dragging.disable())},latLngSync(e){o.emit("update:latLng",e.latlng),o.emit("update:lat-lng",e.latlng)},setLatLng(e){if(null!=e&&t.value){const o=t.value.getLatLng();o&&o.equals(e)||t.value.setLatLng(e)}}};return{options:a,methods:c}};var R={name:"LMarker",props:B,setup(e,t){const a=Object(n["ref"])({}),i=Object(n["ref"])(!1),u=Object(n["inject"])(p),s=Object(n["inject"])("addLayer");Object(n["provide"])("canSetParentHtml",()=>!!a.value.getElement()),Object(n["provide"])("setParentHtml",e=>a.value.getElement().innerHTML=e),Object(n["provide"])("setIcon",e=>a.value.setIcon&&a.value.setIcon(e));const{options:b,methods:m}=A(e,a,t);return void 0===b.icon&&delete b.icon,Object(n["onMounted"])(async()=>{const{marker:p,DomEvent:O}=u?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));a.value=p(e.latLng,b);const j=l(t.attrs);O.on(a.value,j),a.value.on("move",r(m.latLngSync,100)),c(m,a.value,e),s({...e,...m,leafletObject:a.value}),i.value=!0,Object(n["nextTick"])(()=>t.emit("ready",a.value))}),{ready:i,leafletObject:a}},render(){return f(this.ready,this.$slots)},__file:"src/components/LMarker.vue"};const I={...g,latLngs:{type:Array,default:()=>[]},smoothFactor:{type:Number,custom:!0,default:1},noClip:{type:Boolean,custom:!0,default:!1}},L={...I};const U={...b,content:{type:String,default:null}};const M={...D,tms:{type:Boolean,default:!1},subdomains:{type:String,default:"abc"},detectRetina:{type:Boolean,default:!1},url:{type:String,default:null}},W=(e,t)=>{const{options:o,methods:n}=C(e,t),r={...o,tms:e.tms,subdomains:e.subdomains,detectRetina:e.detectRetina};return{options:r,methods:{...n}}};var $={props:M,setup(e,t){const r=Object(n["ref"])({}),a=Object(n["inject"])(p),i=Object(n["inject"])("addLayer"),{options:u,methods:s}=W(e,r);return Object(n["onMounted"])(async()=>{const{tileLayer:p,DomEvent:b}=a?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));r.value=p(e.url,u);const m=l(t.attrs);b.on(r.value,m),c(s,r.value,e),i({...e,...s,leafletObject:r.value}),Object(n["nextTick"])(()=>t.emit("ready",r.value))}),{leafletObject:r}},render(){return null},__file:"src/components/LTileLayer.vue"};Boolean,Boolean}).call(this,o("c8ba"))},"5c76":function(e,t,o){"use strict";o("4de4"),o("d3b7");var n=o("7a23"),r={id:"workout-form"},a={class:"form-items"},c={key:0,class:"form-item-radio"},l=["checked","disabled"],i={for:"withGpx"},u=["checked","disabled"],s={for:"withoutGpx"},d={class:"form-item"},p=["disabled"],b=["value"],m={key:1,class:"form-item"},O={for:"gpxFile"},j=["disabled"],f={class:"files-help info-box"},k={key:2,class:"form-item"},g={for:"title"},y=["required","disabled"],w={key:3},h={class:"workout-date-duration"},v={class:"form-item"},E={class:"workout-date-time"},N=["disabled"],S=["disabled"],V={class:"form-item"},T=["disabled"],D=Object(n["createTextVNode"])(" : "),C=["disabled"],_=Object(n["createTextVNode"])(" : "),x=["disabled"],B={class:"form-item"},A=["disabled"],R={class:"form-item"},I={key:1},L={key:2,class:"form-buttons"},U=["disabled"];function M(e,t,o,M,W,$){var F=Object(n["resolveComponent"])("CustomTextArea"),P=Object(n["resolveComponent"])("ErrorMessage"),G=Object(n["resolveComponent"])("Loader"),q=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{id:"workout-edition",class:Object(n["normalizeClass"])(["center-card center-card with-margin",{"center-form":e.workout&&e.workout.with_gpx}])},[Object(n["createVNode"])(q,null,{title:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("workouts.".concat(e.isCreation?"ADD":"EDIT","_WORKOUT"))),1)]})),content:Object(n["withCtx"])((function(){return[Object(n["createElementVNode"])("div",r,[Object(n["createElementVNode"])("form",{onSubmit:t[12]||(t[12]=Object(n["withModifiers"])((function(){return e.updateWorkout&&e.updateWorkout.apply(e,arguments)}),["prevent"]))},[Object(n["createElementVNode"])("div",a,[e.isCreation?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",c,[Object(n["createElementVNode"])("div",null,[Object(n["createElementVNode"])("input",{id:"withGpx",type:"radio",checked:e.withGpx,disabled:e.loading,onClick:t[0]||(t[0]=function(){return e.updateWithGpx&&e.updateWithGpx.apply(e,arguments)})},null,8,l),Object(n["createElementVNode"])("label",i,Object(n["toDisplayString"])(e.$t("workouts.WITH_GPX")),1)]),Object(n["createElementVNode"])("div",null,[Object(n["createElementVNode"])("input",{id:"withoutGpx",type:"radio",checked:!e.withGpx,disabled:e.loading,onClick:t[1]||(t[1]=function(){return e.updateWithGpx&&e.updateWithGpx.apply(e,arguments)})},null,8,u),Object(n["createElementVNode"])("label",s,Object(n["toDisplayString"])(e.$t("workouts.WITHOUT_GPX")),1)])])):Object(n["createCommentVNode"])("",!0),Object(n["createElementVNode"])("div",d,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.SPORT",1))+": ",1),Object(n["withDirectives"])(Object(n["createElementVNode"])("select",{id:"sport",required:"",disabled:e.loading,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.workoutDataObject.sport_id=t})},[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(e.translatedSports.filter((function(e){return e.is_active})),(function(e){return Object(n["openBlock"])(),Object(n["createElementBlock"])("option",{value:e.id,key:e.id},Object(n["toDisplayString"])(e.label),9,b)})),128))],8,p),[[n["vModelSelect"],e.workoutDataObject.sport_id]])]),e.isCreation&&e.withGpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",m,[Object(n["createElementVNode"])("label",O,Object(n["toDisplayString"])(e.$t("workouts.GPX_FILE"))+" "+Object(n["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+": ",1),Object(n["createElementVNode"])("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:e.loading,onInput:t[3]||(t[3]=function(){return e.updateFile&&e.updateFile.apply(e,arguments)})},null,40,j),Object(n["createElementVNode"])("div",f,[Object(n["createElementVNode"])("div",null,[Object(n["createElementVNode"])("strong",null,Object(n["toDisplayString"])(e.$t("workouts.GPX_FILE"))+":",1),Object(n["createElementVNode"])("ul",null,[Object(n["createElementVNode"])("li",null,Object(n["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(n["toDisplayString"])(e.fileSizeLimit),1)])]),Object(n["createElementVNode"])("div",null,[Object(n["createElementVNode"])("strong",null,Object(n["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE"))+":",1),Object(n["createElementVNode"])("ul",null,[Object(n["createElementVNode"])("li",null,Object(n["toDisplayString"])(e.$t("workouts.NO_FOLDER")),1),Object(n["createElementVNode"])("li",null,Object(n["toDisplayString"])(e.$t("workouts.MAX_FILES"))+": "+Object(n["toDisplayString"])(e.gpx_limit_import),1),Object(n["createElementVNode"])("li",null,Object(n["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(n["toDisplayString"])(e.zipSizeLimit),1)])])])])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",k,[Object(n["createElementVNode"])("label",g,Object(n["toDisplayString"])(e.$t("workouts.TITLE"))+": ",1),Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{id:"title",name:"title",type:"text",required:!e.isCreation,disabled:e.loading,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.workoutDataObject.title=t})},null,8,y),[[n["vModelText"],e.workoutDataObject.title]])])),e.withGpx?Object(n["createCommentVNode"])("",!0):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",w,[Object(n["createElementVNode"])("div",h,[Object(n["createElementVNode"])("div",v,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.WORKOUT_DATE"))+":",1),Object(n["createElementVNode"])("div",E,[Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{id:"workout-date",name:"workout-date",type:"date",required:"",disabled:e.loading,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.workoutDataObject.workoutDate=t})},null,8,N),[[n["vModelText"],e.workoutDataObject.workoutDate]]),Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",disabled:e.loading,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.workoutDataObject.workoutTime=t})},null,8,S),[[n["vModelText"],e.workoutDataObject.workoutTime]])])]),Object(n["createElementVNode"])("div",V,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.DURATION"))+":",1),Object(n["createElementVNode"])("div",null,[Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{id:"workout-duration-hour",name:"workout-duration-hour",class:"workout-duration",type:"text",placeholder:"HH",pattern:"^([0-9]*[0-9])$",required:"",disabled:e.loading,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.workoutDataObject.workoutDurationHour=t})},null,8,T),[[n["vModelText"],e.workoutDataObject.workoutDurationHour]]),D,Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{id:"workout-duration-minutes",name:"workout-duration-minutes",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",placeholder:"MM",required:"",disabled:e.loading,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.workoutDataObject.workoutDurationMinutes=t})},null,8,C),[[n["vModelText"],e.workoutDataObject.workoutDurationMinutes]]),_,Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{id:"workout-duration-seconds",name:"workout-duration-seconds",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",placeholder:"SS",required:"",disabled:e.loading,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.workoutDataObject.workoutDurationSeconds=t})},null,8,x),[[n["vModelText"],e.workoutDataObject.workoutDurationSeconds]])])])]),Object(n["createElementVNode"])("div",B,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.DISTANCE"))+" (km):",1),Object(n["withDirectives"])(Object(n["createElementVNode"])("input",{name:"workout-distance",type:"number",min:"0",step:"0.1",required:"",disabled:e.loading,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.workoutDataObject.workoutDistance=t})},null,8,A),[[n["vModelText"],e.workoutDataObject.workoutDistance]])])])),Object(n["createElementVNode"])("div",R,[Object(n["createElementVNode"])("label",null,Object(n["toDisplayString"])(e.$t("workouts.NOTES"))+": ",1),Object(n["createVNode"])(F,{name:"notes",input:e.workoutDataObject.notes,disabled:e.loading,onUpdateValue:e.updateNotes},null,8,["input","disabled","onUpdateValue"])])]),e.errorMessages?(Object(n["openBlock"])(),Object(n["createBlock"])(P,{key:0,message:e.errorMessages},null,8,["message"])):Object(n["createCommentVNode"])("",!0),e.loading?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",I,[Object(n["createVNode"])(G)])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",L,[Object(n["createElementVNode"])("button",{class:"confirm",type:"submit",disabled:e.loading},Object(n["toDisplayString"])(e.$t("buttons.SUBMIT")),9,U),Object(n["createElementVNode"])("button",{class:"cancel",onClick:t[11]||(t[11]=Object(n["withModifiers"])((function(){return e.onCancel&&e.onCancel.apply(e,arguments)}),["prevent"]))},Object(n["toDisplayString"])(e.$t("buttons.CANCEL")),1)]))],32)])]})),_:1})],2)}var W=o("1da1"),$=(o("96cf"),o("ac1f"),o("1276"),o("99af"),o("47e2")),F=o("6c02"),P=o("dad5"),G=o("2906"),q=o("5e65"),z=o("c364"),H=o("1119"),K=Object(n["defineComponent"])({name:"WorkoutEdition",props:{authUser:{type:Object,required:!0},isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},sports:{type:Object,required:!0},workout:{type:Object,required:!1}},setup:function(e){var t=Object($["b"])(),o=t.t,r=Object(G["a"])(),a=Object(F["d"])();Object(n["onMounted"])((function(){e.workout&&e.workout.id&&k(e.workout)}));var c=Object(n["computed"])((function(){return Object(H["d"])(e.sports,o)})),l=Object(n["computed"])((function(){return r.getters[P["b"].GETTERS.APP_CONFIG]})),i=l.value.max_single_file_size?Object(z["b"])(l.value.max_single_file_size):"",u=l.value.gpx_limit_import,s=l.value.max_zip_file_size?Object(z["b"])(l.value.max_zip_file_size):"",d=Object(n["computed"])((function(){return r.getters[P["b"].GETTERS.ERROR_MESSAGES]})),p=Object(n["reactive"])({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:""}),b=Object(n["ref"])(e.workout?e.workout.with_gpx:e.isCreation),m=null;function O(e){p.notes=e}function j(){b.value=!b.value}function f(e){e.target.files&&(m=e.target.files[0])}function k(t){if(p.sport_id="".concat(t.sport_id),p.title=t.title,p.notes=t.notes,!t.with_gpx){var o=Object(q["a"])(Object(q["c"])(t.workout_date,e.authUser.timezone),"yyyy-MM-dd"),n=t.duration.split(":");p.workoutDistance="".concat(t.distance),p.workoutDate=o.workout_date,p.workoutTime=o.workout_time,p.workoutDurationHour=n[0],p.workoutDurationMinutes=n[1],p.workoutDurationSeconds=n[2]}}function g(e){e.title=p.title,e.distance=+p.workoutDistance,e.duration=3600*+p.workoutDurationHour+60*+p.workoutDurationMinutes+ +p.workoutDurationSeconds,e.workout_date="".concat(p.workoutDate," ").concat(p.workoutTime)}function y(){var t={sport_id:+p.sport_id,notes:p.notes};if(e.workout)e.workout.with_gpx?t.title=p.title:g(t),r.dispatch(P["f"].ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t});else if(b.value){if(!m){var o="workouts.NO_FILE_PROVIDED";return void r.commit(P["b"].MUTATIONS.SET_ERROR_MESSAGES,o)}t.file=m,r.dispatch(P["f"].ACTIONS.ADD_WORKOUT,t)}else g(t),r.dispatch(P["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function w(){e.workout?a.push({name:"Workout",params:{workoutId:e.workout.id}}):a.go(-1)}return Object(n["watch"])((function(){return e.workout}),function(){var e=Object(W["a"])(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t!==o&&t&&t.id&&k(t);case 1:case"end":return e.stop()}}),e)})));return function(t,o){return e.apply(this,arguments)}}()),Object(n["onUnmounted"])((function(){return r.commit(P["b"].MUTATIONS.EMPTY_ERROR_MESSAGES)})),{appConfig:l,errorMessages:d,fileSizeLimit:i,gpx_limit_import:u,translatedSports:c,withGpx:b,zipSizeLimit:s,workoutDataObject:p,onCancel:w,updateFile:f,updateNotes:O,updateWithGpx:j,updateWorkout:y}}}),Z=(o("ba30"),o("6b0d")),J=o.n(Z);const X=J()(K,[["render",M],["__scopeId","data-v-8eb73dd0"]]);t["a"]=X},"628e":function(e,t,o){"use strict";o("be77")},6595:function(e,t,o){"use strict";o("cc92")},"692d":function(e,t,o){"use strict";o.r(t);var n=o("7a23"),r={id:"add-workout",class:"view"},a={class:"container"};function c(e,t,o,c,l,i){var u=Object(n["resolveComponent"])("WorkoutEdition");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",r,[Object(n["createElementVNode"])("div",a,[Object(n["createVNode"])(u,{authUser:e.authUser,sports:e.sports,isCreation:!0,loading:e.workoutData.loading},null,8,["authUser","sports","loading"])])])}var l=o("5c76"),i=o("dad5"),u=o("2906"),s=Object(n["defineComponent"])({name:"AddWorkout",components:{WorkoutEdition:l["a"]},setup:function(){var e=Object(u["a"])(),t=Object(n["computed"])((function(){return e.getters[i["c"].GETTERS.SPORTS]})),o=Object(n["computed"])((function(){return e.getters[i["a"].GETTERS.AUTH_USER_PROFILE]})),r=Object(n["computed"])((function(){return e.getters[i["f"].GETTERS.WORKOUT_DATA]}));return{authUser:o,sports:t,workoutData:r}}}),d=o("6b0d"),p=o.n(d);const b=p()(s,[["render",c]]);t["default"]=b},"76ef":function(e,t,o){"use strict";o("442c")},"799a":function(e,t,o){},8300:function(e,t,o){},"87bb":function(e,t,o){},"8ee9":function(e,t,o){"use strict";o.r(t);var n=o("7a23"),r={id:"edit-workout",class:"view"},a={class:"container"};function c(e,t,o,c,l,i){var u=Object(n["resolveComponent"])("WorkoutEdition");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",r,[Object(n["createElementVNode"])("div",a,[Object(n["createVNode"])(u,{authUser:e.authUser,sports:e.sports,workout:e.workoutData.workout,loading:e.workoutData.loading},null,8,["authUser","sports","workout","loading"])])])}var l=o("1da1"),i=(o("96cf"),o("6c02")),u=o("5c76"),s=o("dad5"),d=o("2906"),p=Object(n["defineComponent"])({name:"EditWorkout",components:{WorkoutEdition:u["a"]},setup:function(){var e=Object(i["c"])(),t=Object(d["a"])();Object(n["onBeforeMount"])((function(){t.dispatch(s["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:e.params.workoutId})}));var o=Object(n["computed"])((function(){return t.getters[s["a"].GETTERS.AUTH_USER_PROFILE]})),r=Object(n["computed"])((function(){return t.getters[s["c"].GETTERS.SPORTS]})),a=Object(n["computed"])((function(){return t.getters[s["f"].GETTERS.WORKOUT_DATA]}));return Object(n["watch"])((function(){return e.params.workoutId}),function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(o){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:o||t.commit(s["f"].MUTATIONS.EMPTY_WORKOUT);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),{authUser:o,sports:r,workoutData:a}}}),b=o("6b0d"),m=o.n(b);const O=m()(p,[["render",c]]);t["default"]=O},a33d:function(e,t,o){},b76e:function(e,t,o){},ba30:function(e,t,o){"use strict";o("87bb")},be77:function(e,t,o){},bef2:function(e,t,o){},bfb4:function(e,t,o){"use strict";o("a33d")},c2ce:function(e,t,o){"use strict";o("2de4")},cc92:function(e,t,o){},e94f:function(e,t,o){!function(e,o){o(t)}(0,(function(e){"use strict";function t(e){return e&&e.normalize&&e.normalize(),e&&e.textContent||""}function o(e,t){const o=e.getElementsByTagName(t);return o.length?o[0]:null}function n(e){const n={};if(e){const r=o(e,"line");if(r){const e=t(o(r,"color")),a=parseFloat(t(o(r,"opacity"))),c=parseFloat(t(o(r,"width")));e&&(n.stroke=e),isNaN(a)||(n["stroke-opacity"]=a),isNaN(c)||(n["stroke-width"]=96*c/25.4)}}return n}function r(e,n){const r={};let a,c;for(c=0;c<n.length;c++)a=o(e,n[c]),a&&(r[n[c]]=t(a));return r}function a(e){const o=r(e,["name","cmt","desc","type","time","keywords"]),n=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*");for(let r=0;r<n.length;r++){const a=n[r];a.parentNode.parentNode===e&&(o[a.tagName.replace(":","_")]=t(a))}const a=e.getElementsByTagName("link");a.length&&(o.links=[]);for(let t=0;t<a.length;t++)o.links.push(Object.assign({href:a[t].getAttribute("href")},r(a[t],["text","type"])));return o}function c(e){const n=[parseFloat(e.getAttribute("lon")),parseFloat(e.getAttribute("lat"))],r=o(e,"ele"),a=o(e,"gpxtpx:hr")||o(e,"hr"),c=o(e,"time");let l;r&&(l=parseFloat(t(r)),isNaN(l)||n.push(l));const i={coordinates:n,time:c?t(c):null,extendedValues:[]};a&&i.extendedValues.push(["heart",parseFloat(t(a))]);const u=o(e,"extensions");if(null!==u)for(const s of["speed","course","hAcc","vAcc"]){const e=parseFloat(t(o(u,s)));isNaN(e)||i.extendedValues.push([s,e])}return i}function l(e){const t=i(e,"rtept");if(t)return{type:"Feature",properties:Object.assign(a(e),n(o(e,"extensions")),{_gpxType:"rte"}),geometry:{type:"LineString",coordinates:t.line}}}function i(e,t){const o=e.getElementsByTagName(t);if(o.length<2)return;const n=[],r=[],a={};for(let l=0;l<o.length;l++){const e=c(o[l]);n.push(e.coordinates),e.time&&r.push(e.time);for(let t=0;t<e.extendedValues.length;t++){const[n,r]=e.extendedValues[t],c="heart"===n?n:n+"s";a[c]||(a[c]=Array(o.length).fill(null)),a[c][l]=r}}return{line:n,times:r,extendedValues:a}}function u(e){const t=e.getElementsByTagName("trkseg"),r=[],c=[],l=[];for(let o=0;o<t.length;o++){const e=i(t[o],"trkpt");e&&(l.push(e),e.times&&e.times.length&&c.push(e.times))}if(0===l.length)return;const u=l.length>1,s=Object.assign(a(e),n(o(e,"extensions")),{_gpxType:"trk"},c.length?{coordinateProperties:{times:u?c:c[0]}}:{});for(let o=0;o<l.length;o++){const e=l[o];r.push(e.line);for(const[t,n]of Object.entries(e.extendedValues)){let e=s;"heart"===t&&(s.coordinateProperties||(s.coordinateProperties={}),e=s.coordinateProperties),u?(e[t]||(e[t]=l.map(e=>new Array(e.line.length).fill(null))),e[t][o]=n):e[t]=n}}return{type:"Feature",properties:s,geometry:u?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function*s(e){const t=e.getElementsByTagName("trk"),o=e.getElementsByTagName("rte"),n=e.getElementsByTagName("wpt");for(let r=0;r<t.length;r++){const e=u(t[r]);e&&(yield e)}for(let r=0;r<o.length;r++){const e=l(o[r]);e&&(yield e)}for(let l=0;l<n.length;l++)yield(i=n[l],{type:"Feature",properties:Object.assign(a(i),r(i,["sym"])),geometry:{type:"Point",coordinates:c(i).coordinates}});var i}const d=[["heartRate","heartRates"],["Cadence","cadences"],["Speed","speeds"],["Watts","watts"]],p=[["TotalTimeSeconds","totalTimeSeconds"],["DistanceMeters","distanceMeters"],["MaximumSpeed","maxSpeed"],["AverageHeartRateBpm","avgHeartRate"],["MaximumHeartRateBpm","maxHeartRate"],["AvgSpeed","avgSpeed"],["AvgWatts","avgWatts"],["MaxWatts","maxWatts"]];function b(e,n){const r=[];for(const[a,c]of n){let n=o(e,a);if(!n){const t=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/ActivityExtension/v2",a);t.length&&(n=t[0])}const l=parseFloat(t(n));isNaN(l)||r.push([c,l])}return r}function m(e){const n=t(o(e,"LongitudeDegrees")),r=t(o(e,"LatitudeDegrees"));if(!n.length||!r.length)return null;const a=[parseFloat(n),parseFloat(r)],c=o(e,"AltitudeMeters"),l=o(e,"HeartRateBpm"),i=o(e,"Time");let u;return c&&(u=parseFloat(t(c)),isNaN(u)||a.push(u)),{coordinates:a,time:i?t(i):null,heartRate:l?parseFloat(t(l)):null,extensions:b(e,d)}}function O(e,t){const o=e.getElementsByTagName(t),n=[],r=[],a=[];if(o.length<2)return null;const c={extendedProperties:{}};for(let l=0;l<o.length;l++){const e=m(o[l]);if(null!==e){n.push(e.coordinates),e.time&&r.push(e.time),e.heartRate&&a.push(e.heartRate);for(const[t,n]of e.extensions)c.extendedProperties[t]||(c.extendedProperties[t]=Array(o.length).fill(null)),c.extendedProperties[t][l]=n}}return Object.assign(c,{line:n,times:r,heartRates:a})}function j(e){const n=e.getElementsByTagName("Track"),r=[],a=[],c=[],l=[];let i;const u=function(e){const t={};for(const[o,n]of e)t[o]=n;return t}(b(e,p)),s=o(e,"Name");s&&(u.name=t(s));for(let t=0;t<n.length;t++)i=O(n[t],"Trackpoint"),i&&(r.push(i.line),i.times.length&&a.push(i.times),i.heartRates.length&&c.push(i.heartRates),l.push(i.extendedProperties));for(let t=0;t<l.length;t++){const e=l[t];for(const o in e)1===n.length?u[o]=i.extendedProperties[o]:(u[o]||(u[o]=r.map(e=>Array(e.length).fill(null))),u[o][t]=e[o])}if(0!==r.length)return(a.length||c.length)&&(u.coordinateProperties=Object.assign(a.length?{times:1===r.length?a[0]:a}:{},c.length?{heart:1===r.length?c[0]:c}:{})),{type:"Feature",properties:u,geometry:{type:1===r.length?"LineString":"MultiLineString",coordinates:1===r.length?r[0]:r}}}function*f(e){const t=e.getElementsByTagName("Lap");for(let n=0;n<t.length;n++){const e=j(t[n]);e&&(yield e)}const o=e.getElementsByTagName("Courses");for(let n=0;n<o.length;n++){const e=j(o[n]);e&&(yield e)}}const k=/\s*/g,g=/^\s*|\s*$/g,y=/\s+/;function w(e){if(!e||!e.length)return 0;let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o)|0;return t}function h(e){return e.replace(k,"").split(",").map(parseFloat)}function v(e){return e.replace(g,"").split(y).map(h)}function E(e){if(void 0!==e.xml)return e.xml;if(e.tagName){let t=e.tagName;for(let o=0;o<e.attributes.length;o++)t+=e.attributes[o].name+e.attributes[o].value;for(let o=0;o<e.childNodes.length;o++)t+=E(e.childNodes[o]);return t}return"#text"===e.nodeName?(e.nodeValue||e.value||"").trim():"#cdata-section"===e.nodeName?e.nodeValue:""}const N=["Polygon","LineString","Point","Track","gx:Track"];function S(e,n,r){let a=t(o(n,"color"))||"";const c="stroke"==r||"fill"===r?r:r+"-color";"#"===a.substr(0,1)&&(a=a.substr(1)),6===a.length||3===a.length?e[c]=a:8===a.length&&(e[r+"-opacity"]=parseInt(a.substr(0,2),16)/255,e[c]="#"+a.substr(6,2)+a.substr(4,2)+a.substr(2,2))}function V(e,n,r,a){const c=parseFloat(t(o(n,r)));isNaN(c)||(e[a]=c)}function T(e){let o=e.getElementsByTagName("coord");const n=[],r=[];0===o.length&&(o=e.getElementsByTagName("gx:coord"));for(let c=0;c<o.length;c++)n.push(t(o[c]).split(" ").map(parseFloat));const a=e.getElementsByTagName("when");for(let c=0;c<a.length;c++)r.push(t(a[c]));return{coords:n,times:r}}function D(e){let n,r,a,c,l;const i=[],u=[];if(o(e,"MultiGeometry"))return D(o(e,"MultiGeometry"));if(o(e,"MultiTrack"))return D(o(e,"MultiTrack"));if(o(e,"gx:MultiTrack"))return D(o(e,"gx:MultiTrack"));for(a=0;a<N.length;a++)if(r=e.getElementsByTagName(N[a]),r)for(c=0;c<r.length;c++)if(n=r[c],"Point"===N[a])i.push({type:"Point",coordinates:h(t(o(n,"coordinates")))});else if("LineString"===N[a])i.push({type:"LineString",coordinates:v(t(o(n,"coordinates")))});else if("Polygon"===N[a]){const e=n.getElementsByTagName("LinearRing"),r=[];for(l=0;l<e.length;l++)r.push(v(t(o(e[l],"coordinates"))));i.push({type:"Polygon",coordinates:r})}else if("Track"===N[a]||"gx:Track"===N[a]){const e=T(n);i.push({type:"LineString",coordinates:e.coords}),e.times.length&&u.push(e.times)}return{geoms:i,coordTimes:u}}function C(e,n,r,a){const c=D(e);let l;const i={},u=t(o(e,"name")),s=t(o(e,"address"));let d=t(o(e,"styleUrl"));const p=t(o(e,"description")),b=o(e,"TimeSpan"),m=o(e,"TimeStamp"),O=o(e,"ExtendedData");let j=o(e,"IconStyle"),f=o(e,"LabelStyle"),k=o(e,"LineStyle"),g=o(e,"PolyStyle");const y=o(e,"visibility");if(u&&(i.name=u),s&&(i.address=s),d){"#"!==d[0]&&(d="#"+d),i.styleUrl=d,n[d]&&(i.styleHash=n[d]),r[d]&&(i.styleMapHash=r[d],i.styleHash=n[r[d].normal]);const e=a[i.styleHash];e&&(j||(j=o(e,"IconStyle")),f||(f=o(e,"LabelStyle")),k||(k=o(e,"LineStyle")),g||(g=o(e,"PolyStyle")))}if(p&&(i.description=p),b){const e=t(o(b,"begin")),n=t(o(b,"end"));i.timespan={begin:e,end:n}}if(m&&(i.timestamp=t(o(m,"when"))),j){S(i,j,"icon"),V(i,j,"scale","icon-scale"),V(i,j,"heading","icon-heading");const e=o(j,"hotSpot");if(e){const t=parseFloat(e.getAttribute("x")),o=parseFloat(e.getAttribute("y"));isNaN(t)||isNaN(o)||(i["icon-offset"]=[t,o])}const n=o(j,"Icon");if(n){const e=t(o(n,"href"));e&&(i.icon=e)}}if(f&&(S(i,f,"label"),V(i,f,"scale","label-scale")),k&&(S(i,k,"stroke"),V(i,k,"width","stroke-width")),g){S(i,g,"fill");const e=t(o(g,"fill")),n=t(o(g,"outline"));e&&(i["fill-opacity"]="1"===e?i["fill-opacity"]||1:0),n&&(i["stroke-opacity"]="1"===n?i["stroke-opacity"]||1:0)}if(O){const e=O.getElementsByTagName("Data"),n=O.getElementsByTagName("SimpleData");for(l=0;l<e.length;l++)i[e[l].getAttribute("name")]=t(o(e[l],"value"));for(l=0;l<n.length;l++)i[n[l].getAttribute("name")]=t(n[l])}y&&(i.visibility=t(y)),c.coordTimes.length&&(i.coordinateProperties={times:1===c.coordTimes.length?c.coordTimes[0]:c.coordTimes});const w={type:"Feature",geometry:0===c.geoms.length?null:1===c.geoms.length?c.geoms[0]:{type:"GeometryCollection",geometries:c.geoms},properties:i};return e.getAttribute("id")&&(w.id=e.getAttribute("id")),w}function*_(e){const n={},r={},a={},c=e.getElementsByTagName("Placemark"),l=e.getElementsByTagName("Style"),i=e.getElementsByTagName("StyleMap");for(let t=0;t<l.length;t++){const e=w(E(l[t])).toString(16);n["#"+l[t].getAttribute("id")]=e,r[e]=l[t]}for(let u=0;u<i.length;u++){n["#"+i[u].getAttribute("id")]=w(E(i[u])).toString(16);const e=i[u].getElementsByTagName("Pair"),r={};for(let n=0;n<e.length;n++)r[t(o(e[n],"key"))]=t(o(e[n],"styleUrl"));a["#"+i[u].getAttribute("id")]=r}for(let t=0;t<c.length;t++){const e=C(c[t],n,a,r);e&&(yield e)}}e.gpx=function(e){return{type:"FeatureCollection",features:Array.from(s(e))}},e.gpxGen=s,e.kml=function(e){return{type:"FeatureCollection",features:Array.from(_(e))}},e.kmlGen=_,e.tcx=function(e){return{type:"FeatureCollection",features:Array.from(f(e))}},e.tcxGen=f,Object.defineProperty(e,"__esModule",{value:!0})}))},f962:function(e,t,o){"use strict";o("172f")}}]);
//# sourceMappingURL=workouts.52ba33b8.js.map