FitTrackee/fittrackee/dist/static/js/workouts.6d428fcc.js
2021-11-03 18:28:29 +01:00

2 lines
82 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["workouts"],{"0385":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a=Object(r["withScopeId"])("data-v-499760ae");Object(r["pushScopeId"])("data-v-499760ae");var n={key:0,id:"workouts"},c={class:"container workouts-container"},l={class:"display-filters"},i={class:"list-container"};Object(r["popScopeId"])();var u=a((function(e,t,o,a,u,s){var d=Object(r["resolveComponent"])("WorkoutsFilters"),p=Object(r["resolveComponent"])("WorkoutsList");return e.authUser.username?(Object(r["openBlock"])(),Object(r["createBlock"])("div",n,[Object(r["createVNode"])("div",c,[Object(r["createVNode"])("div",{class:["filters-container",{hidden:e.hiddenFilters}]},[Object(r["createVNode"])(d,{sports:e.translatedSports,authUser:e.authUser,onFilter:e.updateParams},null,8,["sports","authUser","onFilter"])],2),Object(r["createVNode"])("div",l,[Object(r["createVNode"])("div",{onClick:t[1]||(t[1]=function(){return e.toggleFilters&&e.toggleFilters.apply(e,arguments)})},[Object(r["createVNode"])("i",{class:"fa fa-caret-".concat(e.hiddenFilters?"down":"up"),"aria-hidden":"true"},null,2),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.".concat(e.hiddenFilters?"DISPLAY":"HIDE","_FILTERS"))),1)])]),Object(r["createVNode"])("div",i,[Object(r["createVNode"])(p,{user:e.authUser,params:e.params,sports:e.translatedSports},null,8,["user","params","sports"])])])])):Object(r["createCommentVNode"])("",!0)})),s=o("47e2"),d=(o("4de4"),o("caad"),o("2532"),Object(r["withScopeId"])("data-v-6d15726f"));Object(r["pushScopeId"])("data-v-6d15726f");var p={class:"workouts-filters"},b={class:"box"},O={class:"form"},j={class:"form-items-group"},m={class:"form-item"},f={class:"form-item"},k={class:"form-items-group"},g={class:"form-item"},y=Object(r["createVNode"])("option",{value:""},null,-1),w={class:"form-items-group"},h={class:"form-item"},v={class:"form-inputs-group"},N={class:"form-items-group"},S={class:"form-item"},T={class:"form-inputs-group"},D={class:"form-items-group"},V={class:"form-item"},C={class:"form-inputs-group"},_={class:"form-items-group"},E={class:"form-item"},x={class:"form-inputs-group"},A={class:"form-button"};Object(r["popScopeId"])();var B=d((function(e,t,o,a,n,c){return Object(r["openBlock"])(),Object(r["createBlock"])("div",p,[Object(r["createVNode"])("div",b,[Object(r["createVNode"])("div",O,[Object(r["createVNode"])("div",j,[Object(r["createVNode"])("div",m,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.FROM"))+": ",1),Object(r["createVNode"])("input",{name:"from",type:"date",onChange:t[1]||(t[1]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,32)]),Object(r["createVNode"])("div",f,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.TO"))+": ",1),Object(r["createVNode"])("input",{name:"to",type:"date",onChange:t[2]||(t[2]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,32)])]),Object(r["createVNode"])("div",k,[Object(r["createVNode"])("div",g,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1))+":",1),Object(r["createVNode"])("select",{name:"sport_id",onChange:t[3]||(t[3]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},[y,(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.translatedSports.filter((function(t){return e.authUser.sports_list.includes(t.id)})),(function(e){return Object(r["openBlock"])(),Object(r["createBlock"])("option",{value:e.id,key:e.id},Object(r["toDisplayString"])(e.label),9,["value"])})),128))],32)])]),Object(r["createVNode"])("div",w,[Object(r["createVNode"])("div",h,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+" (km): ",1),Object(r["createVNode"])("div",v,[Object(r["createVNode"])("input",{name:"distance_from",type:"number",min:"0",step:"1",onChange:t[4]||(t[4]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,32),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{name:"distance_to",type:"number",min:"0",step:"1",onChange:t[5]||(t[5]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,32)])])]),Object(r["createVNode"])("div",N,[Object(r["createVNode"])("div",S,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+" (km): ",1),Object(r["createVNode"])("div",T,[Object(r["createVNode"])("input",{name:"duration_from",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,32),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{name:"duration_to",onChange:t[7]||(t[7]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,32)])])]),Object(r["createVNode"])("div",D,[Object(r["createVNode"])("div",V,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.AVE_SPEED"))+" (km): ",1),Object(r["createVNode"])("div",C,[Object(r["createVNode"])("input",{min:"0",name:"ave_speed_from",onChange:t[8]||(t[8]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,32),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{min:"0",name:"ave_speed_to",onChange:t[9]||(t[9]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,32)])])]),Object(r["createVNode"])("div",_,[Object(r["createVNode"])("div",E,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+" (km): ",1),Object(r["createVNode"])("div",x,[Object(r["createVNode"])("input",{min:"0",name:"max_speed_from",onChange:t[10]||(t[10]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,32),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{min:"0",name:"max_speed_to",onChange:t[11]||(t[11]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,32)])])])]),Object(r["createVNode"])("div",A,[Object(r["createVNode"])("button",{class:"confirm",onClick:t[12]||(t[12]=function(){return e.onFilter&&e.onFilter.apply(e,arguments)})},Object(r["toDisplayString"])(e.$t("buttons.FILTER")),1)])])])})),I=o("5530"),R=(o("b0c0"),o("1119")),L=Object(r["defineComponent"])({name:"WorkoutsFilters",props:{authUser:{type:Object,required:!0},sports:{type:Object,required:!0}},emits:["filter","filtersUpdate"],setup:function(e,t){var o=t.emit,a=Object(s["b"])(),n=a.t,c=Object(r["computed"])((function(){return Object(R["d"])(e.sports,n)})),l={};function i(e){""===e.target.value?delete l[e.target.name]:l[e.target.name]=e.target.value}function u(){o("filter",Object(I["a"])({},l))}return{translatedSports:c,onFilter:u,handleFilterChange:i}}});o("ffd66");L.render=B,L.__scopeId="data-v-6d15726f";var U=L,M=(o("b680"),o("a9e3"),Object(r["withScopeId"])("data-v-d190dd62"));Object(r["pushScopeId"])("data-v-d190dd62");var W={class:"workouts-list"},P={class:"workouts-table responsive-table"},$=Object(r["createVNode"])("th",{class:"sport-col"},null,-1),F={class:"sport-col"},G={class:"cell-heading"},z={class:"workout-title"},H={class:"cell-heading"},K={key:0,class:"fa fa-map-o","aria-hidden":"true"},q={class:"cell-heading"},Z={class:"text-right"},J={class:"cell-heading"},X={class:"text-right"},Y={class:"cell-heading"},Q={class:"text-right"},ee={class:"cell-heading"},te={class:"text-right"},oe={class:"cell-heading"},re={key:1,class:"more-workouts"},ae=Object(r["createVNode"])("div",{id:"bottom"},null,-1);Object(r["popScopeId"])();var ne=M((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("SportImage"),i=Object(r["resolveComponent"])("router-link"),u=Object(r["resolveComponent"])("StaticMap"),s=Object(r["resolveComponent"])("NoWorkouts");return Object(r["openBlock"])(),Object(r["createBlock"])("div",W,[Object(r["createVNode"])("div",{class:["box",{"empty-table":0===e.workouts.length}]},[Object(r["createVNode"])("div",P,[Object(r["createVNode"])("table",null,[Object(r["createVNode"])("thead",null,[Object(r["createVNode"])("tr",null,[$,Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.WORKOUT",1))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.DATE"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.DISTANCE"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.DURATION"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.AVE_SPEED"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.MAX_SPEED"))),1)])]),Object(r["createVNode"])("tbody",null,[(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.workouts,(function(t){return Object(r["openBlock"])(),Object(r["createBlock"])("tr",{key:t.id},[Object(r["createVNode"])("td",F,[Object(r["createVNode"])("span",G,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1)),1),Object(r["createVNode"])(l,{title:e.sports.filter((function(e){return e.id===t.sport_id}))[0].translatedLabel,"sport-label":e.sports.filter((function(e){return e.id===t.sport_id}))[0].label},null,8,["title","sport-label"])]),Object(r["createVNode"])("td",z,[Object(r["createVNode"])("span",H,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.WORKOUT",1))),1),Object(r["createVNode"])(i,{class:"nav-item",to:{name:"Workout",params:{workoutId:t.id}}},{default:M((function(){return[t.with_gpx?(Object(r["openBlock"])(),Object(r["createBlock"])("i",K)):Object(r["createCommentVNode"])("",!0),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(t.title),1)]})),_:2},1032,["to"]),t.with_gpx?(Object(r["openBlock"])(),Object(r["createBlock"])(u,{key:0,workout:t,"display-hover":!0},null,8,["workout"])):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])("td",null,[Object(r["createVNode"])("span",q,Object(r["toDisplayString"])(e.$t("workouts.DATE")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.format(e.getDateWithTZ(t.workout_date,e.user.timezone),"dd/MM/yyyy HH:mm")),1)]),Object(r["createVNode"])("td",Z,[Object(r["createVNode"])("span",J,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(Number(t.distance).toFixed(2))+" km ",1)]),Object(r["createVNode"])("td",X,[Object(r["createVNode"])("span",Y,Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(t.moving),1)]),Object(r["createVNode"])("td",Q,[Object(r["createVNode"])("span",ee,Object(r["toDisplayString"])(e.$t("workouts.AVE_SPEED")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(t.ave_speed)+" km/h ",1)]),Object(r["createVNode"])("td",te,[Object(r["createVNode"])("span",oe,Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(t.max_speed)+" km/h ",1)])])})),128))])])])],2),0===e.workouts.length?(Object(r["openBlock"])(),Object(r["createBlock"])(s,{key:0})):Object(r["createCommentVNode"])("",!0),e.moreWorkoutsExist?(Object(r["openBlock"])(),Object(r["createBlock"])("div",re,[Object(r["createVNode"])("button",{onClick:t[1]||(t[1]=function(){return e.loadMoreWorkouts&&e.loadMoreWorkouts.apply(e,arguments)})},Object(r["toDisplayString"])(e.$t("workouts.LOAD_MORE_WORKOUT")),1)])):Object(r["createCommentVNode"])("",!0),ae])})),ce=o("1da1"),le=(o("96cf"),o("b166")),ie=o("68c6"),ue=o("1724"),se=o("dad5"),de=o("2906"),pe=o("5e65"),be=Object(r["defineComponent"])({name:"WorkoutsList",components:{NoWorkouts:ue["a"],StaticMap:ie["a"]},props:{params:{type:Object,required:!0},user:{type:Object,required:!0},sports:{type:Object}},setup:function(e){var t=Object(de["a"])(),o=Object(r["computed"])((function(){return t.getters[se["f"].GETTERS.USER_WORKOUTS]})),a=10,n=Object(r["ref"])(1),c=Object(r["computed"])((function(){return o.value.length>0&&null!==o.value[o.value.length-1].previous_workout}));function l(){n.value=1,t.dispatch(se["f"].ACTIONS.GET_USER_WORKOUTS,Object(I["a"])({page:n.value,per_page:a},e.params))}function i(){n.value+=1,t.dispatch(se["f"].ACTIONS.GET_MORE_USER_WORKOUTS,Object(I["a"])({page:n.value,per_page:a},e.params))}return Object(r["onBeforeMount"])((function(){l()})),Object(r["watch"])((function(){return e.params}),Object(ce["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:l();case 1:case"end":return e.stop()}}),e)})))),{moreWorkoutsExist:c,workouts:o,capitalize:r["capitalize"],format:le["a"],getDateWithTZ:pe["c"],loadMoreWorkouts:i}}});o("5ab5");be.render=ne,be.__scopeId="data-v-d190dd62";var Oe=be,je=Object(r["defineComponent"])({name:"WorkoutsView",components:{WorkoutsFilters:U,WorkoutsList:Oe},setup:function(){var e=Object(s["b"])(),t=e.t,o=Object(de["a"])(),a=Object(r["computed"])((function(){return o.getters[se["e"].GETTERS.AUTH_USER_PROFILE]})),n=Object(r["computed"])((function(){return o.getters[se["b"].GETTERS.SPORTS]})),c=Object(r["computed"])((function(){return Object(R["d"])(n.value,t)})),l=Object(r["ref"])({}),i=Object(r["ref"])(!0);function u(e){l.value=e,i.value=!0}function d(){i.value=!i.value}return{authUser:a,hiddenFilters:i,params:l,translatedSports:c,toggleFilters:d,updateParams:u}}});o("d3d3");je.render=u,je.__scopeId="data-v-499760ae";t["default"]=je},"18ac":function(e,t,o){},2794:function(e,t,o){"use strict";o("3854")},"29dd":function(e,t,o){},"2de4":function(e,t,o){},"304a":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a=Object(r["withScopeId"])("data-v-a4156454");Object(r["pushScopeId"])("data-v-a4156454");var n={id:"workout"},c={class:"container"},l={key:0,class:"workout-container"},i={key:0},u=Object(r["createVNode"])("div",{id:"bottom"},null,-1),s={key:1};Object(r["popScopeId"])();var d=a((function(e,t,o,a,d,p){var b=Object(r["resolveComponent"])("WorkoutDetail"),O=Object(r["resolveComponent"])("WorkoutChart"),j=Object(r["resolveComponent"])("WorkoutSegments"),m=Object(r["resolveComponent"])("WorkoutNotes"),f=Object(r["resolveComponent"])("NotFound");return Object(r["openBlock"])(),Object(r["createBlock"])("div",n,[Object(r["createVNode"])("div",c,[e.sports.length>0?(Object(r["openBlock"])(),Object(r["createBlock"])("div",l,[e.workoutData.workout.id?(Object(r["openBlock"])(),Object(r["createBlock"])("div",i,[Object(r["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(r["openBlock"])(),Object(r["createBlock"])(O,{key:0,workoutData:e.workoutData,authUser:e.authUser,displaySegment:e.displaySegment,onGetCoordinates:e.updateCoordinates},null,8,["workoutData","authUser","displaySegment","onGetCoordinates"])):Object(r["createCommentVNode"])("",!0),!e.displaySegment&&e.workoutData.workout.segments.length>1?(Object(r["openBlock"])(),Object(r["createBlock"])(j,{key:1,segments:e.workoutData.workout.segments},null,8,["segments"])):Object(r["createCommentVNode"])("",!0),e.displaySegment?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(m,{key:2,notes:e.workoutData.workout.notes},null,8,["notes"])),u])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",s,[e.workoutData.loading?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(f,{key:0,target:"WORKOUT"}))]))])):Object(r["createCommentVNode"])("",!0)])])})),p=o("1da1"),b=(o("96cf"),o("6c02")),O=o("f7f9"),j=Object(r["withScopeId"])("data-v-2230775e");Object(r["pushScopeId"])("data-v-2230775e");var m={id:"workout-chart"},f={class:"chart-radio"},k={class:"no-data-cleaning"};Object(r["popScopeId"])();var g=j((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("LineChart"),i=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",m,[Object(r["createVNode"])(i,null,{title:j((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.ANALYSIS")),1)]})),content:j((function(){return[Object(r["createVNode"])("div",f,[Object(r["createVNode"])("label",null,[Object(r["createVNode"])("input",{type:"radio",name:"distance",checked:e.displayDistance,onClick:t[1]||(t[1]=function(){return e.updateDisplayDistance&&e.updateDisplayDistance.apply(e,arguments)})},null,8,["checked"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1)]),Object(r["createVNode"])("label",null,[Object(r["createVNode"])("input",{type:"radio",name:"duration",checked:!e.displayDistance,onClick:t[2]||(t[2]=function(){return e.updateDisplayDistance&&e.updateDisplayDistance.apply(e,arguments)})},null,8,["checked"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1)])]),Object(r["createVNode"])(l,Object(r["mergeProps"])(e.lineChartProps,{class:"line-chart",onMouseleave:e.emitEmptyCoordinates}),null,16,["onMouseleave"]),Object(r["createVNode"])("div",k,Object(r["toDisplayString"])(e.$t("workouts.NO_DATA_CLEANING")),1)]})),_:1})])})),y=o("ade3"),w=(o("b680"),o("a9e3"),o("99af"),o("ac1f"),o("5319"),o("b48c")),h=o("47e2"),v=o("9230"),N=Object(r["defineComponent"])({name:"WorkoutChart",components:{LineChart:w["LineChart"]},props:{authUser:{type:Object,required:!0},workoutData:{type:Object,required:!0}},emits:["getCoordinates"],setup:function(e,t){var o=t.emit,a=Object(h["b"])(),n=a.t,c=Object(r["ref"])(!0),l=Object(r["computed"])((function(){return Object(v["a"])(e.workoutData.chartData,n)})),i=Object(r["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(r["computed"])((function(){return l.value.coordinates})),s=Object(r["computed"])((function(){var e;return{responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:(e={},Object(y["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?n("workouts.DISTANCE")+" (km)":n("workouts.DURATION")}}),Object(y["a"])(e,"ySpeed",{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:n("workouts.SPEED")+" (km/h)"}}),Object(y["a"])(e,"yElevation",{beginAtZero:!0,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:n("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(n("workouts.DISTANCE"),": ").concat(e[0].label," km"):"".concat(n("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 O(){b({latitude:null,longitude:null})}var j=Object(w["useLineChart"])({chartData:i,options:s}),m=j.lineChartProps;return{displayDistance:c,lineChartProps:m,emitEmptyCoordinates:O,updateDisplayDistance:d}}});o("5687");N.render=g,N.__scopeId="data-v-2230775e";var S=N,T=Object(r["withScopeId"])("data-v-a17554ea");Object(r["pushScopeId"])("data-v-a17554ea");var D={class:"workout-detail"};Object(r["popScopeId"])();var V=T((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("Modal"),i=Object(r["resolveComponent"])("WorkoutCardTitle"),u=Object(r["resolveComponent"])("WorkoutMap"),s=Object(r["resolveComponent"])("WorkoutData"),d=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",D,[e.displayModal?(Object(r["openBlock"])(),Object(r["createBlock"])(l,{key:0,title:e.$t("common.CONFIRMATION"),message:e.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:t[1]||(t[1]=function(t){return e.deleteWorkout(e.workoutObject.workoutId)}),onCancelAction:t[2]||(t[2]=function(t){return e.updateDisplayModal(!1)})},null,8,["title","message"])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(d,null,{title:T((function(){return[Object(r["createVNode"])(i,{sport:e.sport,workoutObject:e.workoutObject,onDisplayModal:t[3]||(t[3]=function(t){return e.updateDisplayModal(!0)})},null,8,["sport","workoutObject"])]})),content:T((function(){return[Object(r["createVNode"])(u,{workoutData:e.workoutData,markerCoordinates:e.markerCoordinates},null,8,["workoutData","markerCoordinates"]),Object(r["createVNode"])(s,{workoutObject:e.workoutObject},null,8,["workoutObject"])]})),_:1})])})),C=(o("7db0"),Object(r["withScopeId"])("data-v-9cab340c"));Object(r["pushScopeId"])("data-v-9cab340c");var _={id:"workout-card-title"},E=Object(r["createVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),x={class:"workout-card-title"},A={class:"workout-title-date"},B={key:0,class:"workout-title"},I={key:1,class:"workout-title"},R={class:"workout-segment"},L=Object(r["createTextVNode"])(" — "),U=Object(r["createVNode"])("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1),M={class:"workout-date"},W={class:"workout-link"},P=Object(r["createVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1);Object(r["popScopeId"])();var $=C((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("SportImage"),i=Object(r["resolveComponent"])("router-link");return Object(r["openBlock"])(),Object(r["createBlock"])("div",_,[Object(r["createVNode"])("div",{class:["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[1]||(t[1]=function(t){return e.workoutObject.previousUrl?e.$router.push(e.workoutObject.previousUrl):null})},[E],10,["title"]),Object(r["createVNode"])("div",x,[Object(r["createVNode"])(l,{"sport-label":e.sport.label},null,8,["sport-label"]),Object(r["createVNode"])("div",A,["WORKOUT"===e.workoutObject.type?(Object(r["openBlock"])(),Object(r["createBlock"])("div",B,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.workoutObject.title)+" ",1),Object(r["createVNode"])("i",{class:"fa fa-edit","aria-hidden":"true",onClick:t[2]||(t[2]=function(t){return e.$router.push({name:"EditWorkout",params:{workoutId:e.workoutObject.workoutId}})})}),Object(r["createVNode"])("i",{class:"fa fa-trash","aria-hidden":"true",onClick:t[3]||(t[3]=function(t){return e.emit("displayModal",!0)})})])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",I,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.workoutObject.title)+" ",1),Object(r["createVNode"])("span",R,[L,U,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.SEGMENT"))+" "+Object(r["toDisplayString"])(e.workoutObject.segmentId+1),1)])])),Object(r["createVNode"])("div",M,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.workoutObject.workoutDate)+" - "+Object(r["toDisplayString"])(e.workoutObject.workoutTime)+" ",1),Object(r["createVNode"])("span",W,["SEGMENT"===e.workoutObject.type?(Object(r["openBlock"])(),Object(r["createBlock"])(i,{key:0,to:{name:"Workout",params:{workoutId:e.workoutObject.workoutId}}},{default:C((function(){return[Object(r["createTextVNode"])(" > "+Object(r["toDisplayString"])(e.$t("workouts.BACK_TO_WORKOUT")),1)]})),_:1},8,["to"])):Object(r["createCommentVNode"])("",!0)])])])]),Object(r["createVNode"])("div",{class:["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[4]||(t[4]=function(t){return e.workoutObject.nextUrl?e.$router.push(e.workoutObject.nextUrl):null})},[P],10,["title"])])})),F=Object(r["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");F.render=$,F.__scopeId="data-v-9cab340c";var G=F,z=Object(r["withScopeId"])("data-v-45a7f031");Object(r["pushScopeId"])("data-v-45a7f031");var H={id:"workout-info"},K={class:"workout-data"},q=Object(r["createVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1),Z={key:0},J={class:"workout-data"},X=Object(r["createVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1),Y={class:"workout-data"},Q=Object(r["createVNode"])("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1),ee=Object(r["createVNode"])("br",null,null,-1),te={key:0,class:"workout-data"},oe=Object(r["createVNode"])("br",null,null,-1),re={key:1,class:"workout-data"},ae=Object(r["createVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1),ne=Object(r["createVNode"])("br",null,null,-1);Object(r["popScopeId"])();var ce=z((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("WorkoutRecord"),i=Object(r["resolveComponent"])("WorkoutWeather");return Object(r["openBlock"])(),Object(r["createBlock"])("div",H,[Object(r["createVNode"])("div",K,[q,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.moving),1),Object(r["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"LD"},null,8,["workoutObject"]),e.withPause?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Z,[Object(r["createTextVNode"])(" ("+Object(r["toDisplayString"])(e.$t("workouts.PAUSES"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.pauses),1),Object(r["createTextVNode"])(" - "+Object(r["toDisplayString"])(e.$t("workouts.TOTAL_DURATION"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.duration)+")",1)])):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])("div",J,[X,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.distance)+" km",1),Object(r["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"FD"},null,8,["workoutObject"])]),Object(r["createVNode"])("div",Y,[Q,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.AVERAGE_SPEED"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.aveSpeed)+" km/h",1),Object(r["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"AS"},null,8,["workoutObject"]),ee,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.maxSpeed)+" km/h",1),Object(r["createVNode"])(l,{workoutObject:e.workoutObject,record_type:"MS"},null,8,["workoutObject"])]),null!==e.workoutObject.maxAlt&&null!==e.workoutObject.minAlt?(Object(r["openBlock"])(),Object(r["createBlock"])("div",te,[Object(r["createVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,["alt"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.MIN_ALTITUDE"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.minAlt)+" m",1),oe,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.MAX_ALTITUDE"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.maxAlt)+" m",1)])):Object(r["createCommentVNode"])("",!0),null!==e.workoutObject.ascent&&null!==e.workoutObject.descent?(Object(r["openBlock"])(),Object(r["createBlock"])("div",re,[ae,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.ASCENT"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.ascent)+" m",1),ne,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DESCENT"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.descent)+" m",1)])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(i,{workoutObject:e.workoutObject},null,8,["workoutObject"])])})),le=Object(r["withScopeId"])("data-v-da96984c");Object(r["pushScopeId"])("data-v-da96984c");var ie={key:0,class:"workout-record"},ue=Object(r["createVNode"])("sup",null,[Object(r["createVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1);Object(r["popScopeId"])();var se=le((function(e,t,o,a,n,c){return e.workoutObject.records&&e.workoutObject.records.find((function(t){return t.record_type===e.record_type}))?(Object(r["openBlock"])(),Object(r["createBlock"])("span",ie,[ue])):Object(r["createCommentVNode"])("",!0)})),de=Object(r["defineComponent"])({name:"WorkoutRecord",props:{record_type:{type:String,required:!0},workoutObject:{type:Object,required:!0}}});o("bfb4");de.render=se,de.__scopeId="data-v-da96984c";var pe=de,be=Object(r["withScopeId"])("data-v-7eb41918");Object(r["pushScopeId"])("data-v-7eb41918");var Oe={key:0,id:"workout-weather"},je={class:"weather-table"},me=Object(r["createVNode"])("th",null,null,-1),fe={class:"weather-th"},ke={class:"weather-th"};Object(r["popScopeId"])();var ge=be((function(e,t,o,a,n,c){return e.workoutObject.weatherStart&&e.workoutObject.weatherEnd?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Oe,[Object(r["createVNode"])("table",je,[Object(r["createVNode"])("thead",null,[Object(r["createVNode"])("tr",null,[me,Object(r["createVNode"])("th",null,[Object(r["createVNode"])("div",fe,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.START"))+" ",1),Object(r["createVNode"])("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,["src","alt","title"])])]),Object(r["createVNode"])("th",null,[Object(r["createVNode"])("div",ke,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.END"))+" ",1),Object(r["createVNode"])("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,["src","alt","title"])])])])]),Object(r["createVNode"])("tbody",null,[Object(r["createVNode"])("tr",null,[Object(r["createVNode"])("td",null,[Object(r["createVNode"])("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,["alt","title"])]),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherStart.temperature).toFixed(1))+"°C ",1),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherEnd.temperature).toFixed(1))+"°C ",1)]),Object(r["createVNode"])("tr",null,[Object(r["createVNode"])("td",null,[Object(r["createVNode"])("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,["alt","title"])]),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(100*e.workoutObject.weatherStart.humidity).toFixed(1))+"% ",1),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(100*e.workoutObject.weatherEnd.humidity).toFixed(1))+"% ",1)]),Object(r["createVNode"])("tr",null,[Object(r["createVNode"])("td",null,[Object(r["createVNode"])("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,["alt","title"])]),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherStart.wind).toFixed(1))+"m/s",1),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherEnd.wind).toFixed(1))+"m/s",1)])])])])):Object(r["createCommentVNode"])("",!0)})),ye=Object(r["defineComponent"])({name:"WorkoutWeather",props:{workoutObject:{type:Object,required:!0}}});o("6595");ye.render=ge,ye.__scopeId="data-v-7eb41918";var we=ye,he=Object(r["defineComponent"])({name:"WorkoutData",components:{WorkoutRecord:pe,WorkoutWeather:we},props:{workoutObject:{type:Object,required:!0}},setup:function(e){return{withPause:Object(r["computed"])((function(){return"0:00:00"!==e.workoutObject.pauses&&null!==e.workoutObject.pauses}))}}});o("c04f");he.render=ce,he.__scopeId="data-v-45a7f031";var ve=he,Ne=Object(r["withScopeId"])("data-v-76f3a2e8");Object(r["pushScopeId"])("data-v-76f3a2e8");var Se={id:"workout-map"},Te={key:0,class:"leaflet-container"},De={key:1},Ve={key:0,class:"leaflet-container"},Ce={key:1,class:"no-map"};Object(r["popScopeId"])();var _e=Ne((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("LTileLayer"),i=Object(r["resolveComponent"])("LGeoJson"),u=Object(r["resolveComponent"])("LMarker"),s=Object(r["resolveComponent"])("LMap");return Object(r["openBlock"])(),Object(r["createBlock"])("div",Se,[e.workoutData.loading?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Te)):(Object(r["openBlock"])(),Object(r["createBlock"])("div",De,[e.workoutData.workout.with_gpx?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Ve,[e.geoJson.jsonData&&e.center&&2===e.bounds.length?(Object(r["openBlock"])(),Object(r["createBlock"])(s,{key:0,zoom:13,center:e.center,bounds:e.bounds,ref:"workoutMap",onReady:t[1]||(t[1]=function(t){return e.fitBounds(e.bounds)})},{default:Ne((function(){return[Object(r["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(r["createVNode"])(i,{geojson:e.geoJson.jsonData},null,8,["geojson"]),e.markerCoordinates.latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(u,{key:0,"lat-lng":[e.markerCoordinates.latitude,e.markerCoordinates.longitude]},null,8,["lat-lng"])):Object(r["createCommentVNode"])("",!0)]})),_:1},8,["center","bounds"])):Object(r["createCommentVNode"])("",!0)])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",Ce,Object(r["toDisplayString"])(e.$t("workouts.NO_MAP")),1))]))])})),Ee=o("e94f"),xe=o("5afd"),Ae=o("dad5"),Be=o("2906"),Ie=o("d257"),Re=Object(r["defineComponent"])({name:"WorkoutMap",components:{LGeoJson:xe["a"],LMap:xe["b"],LMarker:xe["c"],LTileLayer:xe["d"]},props:{workoutData:{type:Object},markerCoordinates:{type:Object,required:!1}},setup:function(e){var t=Object(Be["a"])();function o(e){if(!e||""!==e)try{var t=Object(Ee["gpx"])((new DOMParser).parseFromString(e,"text/xml"));return{jsonData:t}}catch(o){return console.error("Invalid gpx content"),{}}return{}}function a(e){return[(e.value[0][0]+e.value[1][0])/2,(e.value[0][1]+e.value[1][1])/2]}function n(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(r["ref"])(null),l=Object(r["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(r["computed"])((function(){return t.getters[Ae["a"].GETTERS.APP_CONFIG]})),u=Object(r["computed"])((function(){return a(l)})),s=Object(r["computed"])((function(){return e.workoutData&&e.workoutData.gpx?o(e.workoutData.gpx):{}}));return{appConfig:i,bounds:l,center:u,geoJson:s,workoutMap:c,fitBounds:n,getApiUrl:Ie["a"]}}});o("2794");Re.render=_e,Re.__scopeId="data-v-76f3a2e8";var Le=Re,Ue=o("5e65"),Me=Object(r["defineComponent"])({name:"WorkoutDetail",components:{WorkoutCardTitle:G,WorkoutData:ve,WorkoutMap:Le},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(Be["a"])();function a(e,t,o){var r=t&&o&&1!==o?"/workouts/".concat(e.id,"/segment/").concat(o-1):!t&&e.previous_workout?"/workouts/".concat(e.previous_workout):null,a=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:r,nextUrl:a}}function n(t,o){var r=a(t,e.displaySegment,u.value?+u.value:null),n=Object(Ue["a"])(Object(Ue["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:r.nextUrl,pauses:o?o.pauses:t.pauses,previousUrl:r.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,workoutId:t.id,weatherStart:o?null:t.weather_start,workoutTime:n.workout_time}}function c(e){d.value=e}function l(e){o.dispatch(Ae["f"].ACTIONS.DELETE_WORKOUT,{workoutId:e})}var i=Object(r["computed"])((function(){return e.workoutData.workout})),u=Object(r["ref"])(t.params.workoutId?+t.params.segmentId:null),s=Object(r["computed"])((function(){return i.value.segments.length>0&&u.value?i.value.segments[+u.value-1]:null})),d=Object(r["ref"])(!1);return Object(r["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(r["computed"])((function(){return e.sports?e.sports.find((function(t){return t.id===e.workoutData.workout.sport_id})):{}})),workoutObject:Object(r["computed"])((function(){return n(i.value,s.value)})),displayModal:d,deleteWorkout:l,updateDisplayModal:c}}});o("c2ce");Me.render=V,Me.__scopeId="data-v-a17554ea";var We=Me,Pe=Object(r["withScopeId"])("data-v-5c47d30a");Object(r["pushScopeId"])("data-v-5c47d30a");var $e={id:"workout-note"};Object(r["popScopeId"])();var Fe=Pe((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",$e,[Object(r["createVNode"])(l,null,{title:Pe((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.NOTES")),1)]})),content:Pe((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.notes&&""!==e.notes?e.notes:e.$t("workouts.NO_NOTES")),1)]})),_:1})])})),Ge=Object(r["defineComponent"])({name:"WorkoutNotes",props:{notes:{type:String,required:!1}}});o("42ec");Ge.render=Fe,Ge.__scopeId="data-v-5c47d30a";var ze=Ge,He=Object(r["withScopeId"])("data-v-5c40d110");Object(r["pushScopeId"])("data-v-5c40d110");var Ke={id:"workout-segments"};Object(r["popScopeId"])();var qe=He((function(e,t,o,a,n,c){var l=Object(r["resolveComponent"])("router-link"),i=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",Ke,[Object(r["createVNode"])(i,null,{title:He((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.SEGMENT",2)),1)]})),content:He((function(){return[Object(r["createVNode"])("ul",null,[(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.segments,(function(t,o){return Object(r["openBlock"])(),Object(r["createBlock"])("li",{key:t.segment_id},[Object(r["createVNode"])(l,{to:{name:"WorkoutSegment",params:{workoutId:t.workout_id,segmentId:o+1}}},{default:He((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.SEGMENT",1))+" "+Object(r["toDisplayString"])(o+1),1)]})),_:2},1032,["to"]),Object(r["createTextVNode"])(" ("+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+": "+Object(r["toDisplayString"])(t.distance)+" km, "+Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+": "+Object(r["toDisplayString"])(t.duration)+") ",1)])})),128))])]})),_:1})])})),Ze=Object(r["defineComponent"])({name:"WorkoutSegments",props:{segments:{type:Object,required:!0}}});o("628e");Ze.render=qe,Ze.__scopeId="data-v-5c40d110";var Je=Ze,Xe=Object(r["defineComponent"])({name:"Workout",components:{NotFound:O["a"],WorkoutChart:S,WorkoutDetail:We,WorkoutNotes:ze,WorkoutSegments:Je},props:{displaySegment:{type:Boolean,required:!0}},setup:function(e){var t=Object(b["c"])(),o=Object(Be["a"])();Object(r["onBeforeMount"])((function(){var r={workoutId:t.params.workoutId};e.displaySegment&&(r.segmentId=t.params.segmentId),o.dispatch(Ae["f"].ACTIONS.GET_WORKOUT_DATA,r)}));var a=Object(r["computed"])((function(){return o.getters[Ae["f"].GETTERS.WORKOUT_DATA]})),n=Object(r["computed"])((function(){return o.getters[Ae["e"].GETTERS.AUTH_USER_PROFILE]})),c=Object(r["computed"])((function(){return o.getters[Ae["b"].GETTERS.SPORTS]})),l=Object(r["ref"])({latitude:null,longitude:null});function i(e){l.value={latitude:e.latitude,longitude:e.longitude}}return Object(r["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(Ae["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(r["watch"])((function(){return t.params.segmentId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(r){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.params.workoutId&&(a={workoutId:t.params.workoutId},r&&(a.segmentId=r),o.dispatch(Ae["f"].ACTIONS.GET_WORKOUT_DATA,a));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(r["onUnmounted"])((function(){o.commit(Ae["f"].MUTATIONS.EMPTY_WORKOUT)})),{authUser:n,markerCoordinates:l,sports:c,workoutData:a,updateCoordinates:i}}});o("5be4");Xe.render=d,Xe.__scopeId="data-v-a4156454";t["default"]=Xe},3854:function(e,t,o){},"42ec":function(e,t,o){"use strict";o("8300")},5687:function(e,t,o){"use strict";o("bef2")},5910:function(e,t,o){"use strict";o("b76e")},"5ab5":function(e,t,o){"use strict";o("86b9")},"5afd":function(e,t,o){"use strict";(function(e){o.d(t,"a",(function(){return V})),o.d(t,"b",(function(){return x})),o.d(t,"c",(function(){return I})),o.d(t,"d",(function(){return P}));var r=o("7a23");const a=(e,t)=>{let o;return function(...r){const a=this;o&&clearTimeout(o),o=setTimeout(()=>{e.apply(a,r),o=null},t)}},n=e=>e&&"function"===typeof e.charAt?e.charAt(0).toUpperCase()+e.slice(1):e,c=(e,t,o)=>{for(const a in o){const c="set"+n(a);e[c]?Object(r["watch"])(()=>o[a],(t,o)=>{e[c](t,o)}):t[c]&&Object(r["watch"])(()=>o[a],e=>{t[c](e)})}},l=e=>{const t={};for(const o in e)if(o.startsWith("on")&&!o.startsWith("onUpdate")&&"onReady"!==o){const r=o.slice(2).toLocaleLowerCase();t[r]=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(r["ref"])(()=>console.warn(`Method ${e} has been invoked without being replaced`)),o=(...e)=>t.value(...e);return o.wrapped=t,Object(r["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:()=>({})}},O=e=>({options:e.options,methods:{}}),j={...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}},m=(e,t,o)=>{const a=Object(r["inject"])("addLayer"),n=Object(r["inject"])("removeLayer"),{options:c,methods:l}=O(e),i={...c,attribution:e.attribution,pane:e.pane},u=()=>a({leafletObject:t.value}),s=()=>n({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(r["provide"])("bindPopup",d.bindPopup),Object(r["provide"])("bindTooltip",d.bindTooltip),Object(r["provide"])("unbindTooltip",d.unbindTooltip),Object(r["provide"])("unbindPopup",d.unbindPopup),Object(r["onUnmounted"])(()=>{d.unbindPopup(),d.unbindTooltip(),s()}),{options:i,methods:d}},f=(e,t)=>{if(e&&t.default)return Object(r["h"])("div",{style:{display:"none"}},t.default())},k={...b,interactive:{type:Boolean,default:!0},bubblingMouseEvents:{type:Boolean,default:!0}},g={...j,...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:a}=O(e),n={...o,position:e.position},c={...a,setPosition(e){t.value&&t.value.setPosition(e)}};return Object(r["onUnmounted"])(()=>{t.value&&t.value.remove()}),{options:n,methods:c}},v=e=>e.default?Object(r["h"])("div",{ref:"root"},e.default()):null;Boolean,Boolean;Boolean,Boolean,Boolean,Boolean;Boolean,Boolean,Boolean;const N={...j},S=(e,t,o)=>{const{options:a,methods:n}=m(e,t,o),c={...a},l={...n,addLayer(e){t.value.addLayer(e.leafletObject)},removeLayer(e){t.value.removeLayer(e.leafletObject)}};return Object(r["provide"])("addLayer",l.addLayer),Object(r["provide"])("removeLayer",l.removeLayer),{options:c,methods:l}};const T={...N,geojson:{type:[Object,Array],default:()=>({})}},D=(e,t)=>{const{options:o,methods:r}=S(e,t),a={...o,...e},n={...r,setGeojson(e){t.value.clearLayers(),t.value.addData(e)},getGeoJSONData(){return t.value.toGeoJSON()},getBounds(){return t.value.getBounds()}};return{options:a,methods:n}};var V={props:T,setup(e,t){const a=Object(r["ref"])({}),n=Object(r["ref"])(!1),i=Object(r["inject"])(p),u=Object(r["inject"])("addLayer"),{methods:s,options:b}=D(e,a);return Object(r["onMounted"])(async()=>{const{geoJSON:p,DomEvent:O}=i?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));a.value=p(e.geojson,b);const j=l(t.attrs);O.on(a.value,j),c(s,a.value,e),u({...e,...s,leafletObject:a.value}),n.value=!0,Object(r["nextTick"])(()=>t.emit("ready",a.value))}),{ready:n,leafletObject:a}},render(){return f(this.ready,this.$slots)},__file:"src/components/LGeoJson.vue"};const C={...j,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}},_=(e,t,o)=>{const{options:r,methods:a}=m(e,t,o),n={...r,pane:e.pane,opacity:e.opacity,zIndex:e.zIndex,tileSize:e.tileSize,noWrap:e.noWrap,minZoom:e.minZoom,maxZoom:e.maxZoom};return{options:n,methods:{...a}}};const E={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 n=Object(r["ref"])(null),b=Object(r["reactive"])({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:j}=O(e),m={...j,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(r["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(r["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:O,latLngBounds:j,latLng:h,DomEvent:v}=e.useGlobalLeaflet?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));try{m.beforeMapMount&&await m.beforeMapMount()}catch(D){console.error("The following error occurred running the provided beforeMapMount hook "+D.message)}await i(O);const N="string"==typeof m.crs?p[m.crs]:m.crs;m.crs=N||p.EPSG3857;const S={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=j(e);if(!t.isValid())return;const o=b.lastSetBounds||b.leafletRef.getBounds(),r=!o.equals(t,0);r&&(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,S.addLayer),s(k,S.removeLayer),s(g,S.registerControl),s(y,S.registerLayerControl),b.leafletRef=u(n.value,m),c(S,b.leafletRef,e);const T=l(t.attrs);b.leafletRef.on("moveend",a(w.moveEndHandler,100)),b.leafletRef.on("overlayadd",w.overlayAddHandler),b.leafletRef.on("overlayremove",w.overlayRemoveHandler),v.on(b.leafletRef,T),b.ready=!0,Object(r["nextTick"])(()=>t.emit("ready",b.leafletRef))}),Object(r["onBeforeUnmount"])(()=>{b.leafletRef&&b.leafletRef.remove()});const h=Object(r["computed"])(()=>b.leafletRef),v=Object(r["computed"])(()=>b.ready);return{root:n,ready:v,leafletObject:h}},render(){return Object(r["h"])("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready?this.$slots.default():{})},__file:"src/components/LMap.vue"};const A={...j,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}},B=(e,t,o)=>{const{options:r,methods:a}=m(e,t,o),n={...r,...e},c={...a,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:n,methods:c}};var I={name:"LMarker",props:A,setup(e,t){const n=Object(r["ref"])({}),i=Object(r["ref"])(!1),u=Object(r["inject"])(p),s=Object(r["inject"])("addLayer");Object(r["provide"])("canSetParentHtml",()=>!!n.value.getElement()),Object(r["provide"])("setParentHtml",e=>n.value.getElement().innerHTML=e),Object(r["provide"])("setIcon",e=>n.value.setIcon&&n.value.setIcon(e));const{options:b,methods:O}=B(e,n,t);return void 0===b.icon&&delete b.icon,Object(r["onMounted"])(async()=>{const{marker:p,DomEvent:j}=u?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));n.value=p(e.latLng,b);const m=l(t.attrs);j.on(n.value,m),n.value.on("move",a(O.latLngSync,100)),c(O,n.value,e),s({...e,...O,leafletObject:n.value}),i.value=!0,Object(r["nextTick"])(()=>t.emit("ready",n.value))}),{ready:i,leafletObject:n}},render(){return f(this.ready,this.$slots)},__file:"src/components/LMarker.vue"};const R={...g,latLngs:{type:Array,default:()=>[]},smoothFactor:{type:Number,custom:!0,default:1},noClip:{type:Boolean,custom:!0,default:!1}},L={...R};const U={...b,content:{type:String,default:null}};const M={...C,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:r}=_(e,t),a={...o,tms:e.tms,subdomains:e.subdomains,detectRetina:e.detectRetina};return{options:a,methods:{...r}}};var P={props:M,setup(e,t){const a=Object(r["ref"])({}),n=Object(r["inject"])(p),i=Object(r["inject"])("addLayer"),{options:u,methods:s}=W(e,a);return Object(r["onMounted"])(async()=>{const{tileLayer:p,DomEvent:b}=n?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));a.value=p(e.url,u);const O=l(t.attrs);b.on(a.value,O),c(s,a.value,e),i({...e,...s,leafletObject:a.value}),Object(r["nextTick"])(()=>t.emit("ready",a.value))}),{leafletObject:a}},render(){return null},__file:"src/components/LTileLayer.vue"};Boolean,Boolean}).call(this,o("c8ba"))},"5be4":function(e,t,o){"use strict";o("8ee6")},"5c76":function(e,t,o){"use strict";o("4de4");var r=o("7a23"),a=Object(r["withScopeId"])("data-v-072084e4");Object(r["pushScopeId"])("data-v-072084e4");var n={id:"workout-form"},c={class:"form-items"},l={key:0,class:"form-item-radio"},i={for:"withGpx"},u={for:"withoutGpx"},s={class:"form-item"},d={key:1,class:"form-item"},p={for:"gpxFile"},b={class:"files-help info-box"},O={key:2,class:"form-item"},j={for:"title"},m={key:3},f={class:"workout-date-duration"},k={class:"form-item"},g={class:"workout-date-time"},y={class:"form-item"},w=Object(r["createTextVNode"])(" : "),h=Object(r["createTextVNode"])(" : "),v={class:"form-item"},N={class:"form-item"},S={key:1},T={key:2,class:"form-buttons"};Object(r["popScopeId"])();var D=a((function(e,t,o,D,V,C){var _=Object(r["resolveComponent"])("CustomTextArea"),E=Object(r["resolveComponent"])("ErrorMessage"),x=Object(r["resolveComponent"])("Loader"),A=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",{id:"workout-edition",class:["center-card center-card with-margin",{"center-form":e.workout&&e.workout.with_gpx}]},[Object(r["createVNode"])(A,null,{title:a((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.".concat(e.isCreation?"ADD":"EDIT","_WORKOUT"))),1)]})),content:a((function(){return[Object(r["createVNode"])("div",n,[Object(r["createVNode"])("form",{onSubmit:t[13]||(t[13]=Object(r["withModifiers"])((function(){return e.updateWorkout&&e.updateWorkout.apply(e,arguments)}),["prevent"]))},[Object(r["createVNode"])("div",c,[e.isCreation?(Object(r["openBlock"])(),Object(r["createBlock"])("div",l,[Object(r["createVNode"])("div",null,[Object(r["createVNode"])("input",{id:"withGpx",type:"radio",checked:e.withGpx,disabled:e.loading,onClick:t[1]||(t[1]=function(){return e.updateWithGpx&&e.updateWithGpx.apply(e,arguments)})},null,8,["checked","disabled"]),Object(r["createVNode"])("label",i,Object(r["toDisplayString"])(e.$t("workouts.WITH_GPX")),1)]),Object(r["createVNode"])("div",null,[Object(r["createVNode"])("input",{id:"withoutGpx",type:"radio",checked:!e.withGpx,disabled:e.loading,onClick:t[2]||(t[2]=function(){return e.updateWithGpx&&e.updateWithGpx.apply(e,arguments)})},null,8,["checked","disabled"]),Object(r["createVNode"])("label",u,Object(r["toDisplayString"])(e.$t("workouts.WITHOUT_GPX")),1)])])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])("div",s,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1))+": ",1),Object(r["withDirectives"])(Object(r["createVNode"])("select",{id:"sport",required:"",disabled:e.loading,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.workoutDataObject.sport_id=t})},[(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.translatedSports.filter((function(e){return e.is_active})),(function(e){return Object(r["openBlock"])(),Object(r["createBlock"])("option",{value:e.id,key:e.id},Object(r["toDisplayString"])(e.label),9,["value"])})),128))],8,["disabled"]),[[r["vModelSelect"],e.workoutDataObject.sport_id]])]),e.isCreation&&e.withGpx?(Object(r["openBlock"])(),Object(r["createBlock"])("div",d,[Object(r["createVNode"])("label",p,Object(r["toDisplayString"])(e.$t("workouts.GPX_FILE"))+" "+Object(r["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+": ",1),Object(r["createVNode"])("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:e.loading,onInput:t[4]||(t[4]=function(){return e.updateFile&&e.updateFile.apply(e,arguments)})},null,40,["disabled"]),Object(r["createVNode"])("div",b,[Object(r["createVNode"])("div",null,[Object(r["createVNode"])("strong",null,Object(r["toDisplayString"])(e.$t("workouts.GPX_FILE"))+":",1),Object(r["createVNode"])("ul",null,[Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(e.fileSizeLimit),1)])]),Object(r["createVNode"])("div",null,[Object(r["createVNode"])("strong",null,Object(r["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE"))+":",1),Object(r["createVNode"])("ul",null,[Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.NO_FOLDER")),1),Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_FILES"))+": "+Object(r["toDisplayString"])(e.gpx_limit_import),1),Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(e.zipSizeLimit),1)])])])])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",O,[Object(r["createVNode"])("label",j,Object(r["toDisplayString"])(e.$t("workouts.TITLE"))+": ",1),Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"title",name:"title",type:"text",required:!e.isCreation,disabled:e.loading,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.workoutDataObject.title=t})},null,8,["required","disabled"]),[[r["vModelText"],e.workoutDataObject.title]])])),e.withGpx?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])("div",m,[Object(r["createVNode"])("div",f,[Object(r["createVNode"])("div",k,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.WORKOUT_DATE"))+":",1),Object(r["createVNode"])("div",g,[Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-date",name:"workout-date",type:"date",required:"",disabled:e.loading,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.workoutDataObject.workoutDate=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDate]]),Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",disabled:e.loading,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.workoutDataObject.workoutTime=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutTime]])])]),Object(r["createVNode"])("div",y,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+":",1),Object(r["createVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createVNode"])("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[8]||(t[8]=function(t){return e.workoutDataObject.workoutDurationHour=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDurationHour]]),w,Object(r["withDirectives"])(Object(r["createVNode"])("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[9]||(t[9]=function(t){return e.workoutDataObject.workoutDurationMinutes=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDurationMinutes]]),h,Object(r["withDirectives"])(Object(r["createVNode"])("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[10]||(t[10]=function(t){return e.workoutDataObject.workoutDurationSeconds=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDurationSeconds]])])])]),Object(r["createVNode"])("div",v,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+" (km):",1),Object(r["withDirectives"])(Object(r["createVNode"])("input",{type:"number",min:"0",step:"0.1",required:"",disabled:e.loading,"onUpdate:modelValue":t[11]||(t[11]=function(t){return e.workoutDataObject.workoutDistance=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDistance]])])])),Object(r["createVNode"])("div",N,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.NOTES"))+": ",1),Object(r["createVNode"])(_,{name:"notes",input:e.workoutDataObject.notes,disabled:e.loading,onUpdateValue:e.updateNotes},null,8,["input","disabled","onUpdateValue"])])]),e.errorMessages?(Object(r["openBlock"])(),Object(r["createBlock"])(E,{key:0,message:e.errorMessages},null,8,["message"])):Object(r["createCommentVNode"])("",!0),e.loading?(Object(r["openBlock"])(),Object(r["createBlock"])("div",S,[Object(r["createVNode"])(x)])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",T,[Object(r["createVNode"])("button",{class:"confirm",type:"submit",disabled:e.loading},Object(r["toDisplayString"])(e.$t("buttons.SUBMIT")),9,["disabled"]),Object(r["createVNode"])("button",{class:"cancel",onClick:t[12]||(t[12]=Object(r["withModifiers"])((function(){return e.onCancel&&e.onCancel.apply(e,arguments)}),["prevent"]))},Object(r["toDisplayString"])(e.$t("buttons.CANCEL")),1)]))],32)])]})),_:1})],2)})),V=o("1da1"),C=(o("96cf"),o("ac1f"),o("1276"),o("99af"),o("47e2")),_=o("6c02"),E=o("dad5"),x=o("2906"),A=o("5e65"),B=o("c364"),I=o("1119"),R=Object(r["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(C["b"])(),o=t.t,a=Object(x["a"])(),n=Object(_["d"])();Object(r["onMounted"])((function(){e.workout&&e.workout.id&&k(e.workout)}));var c=Object(r["computed"])((function(){return Object(I["d"])(e.sports,o)})),l=Object(r["computed"])((function(){return a.getters[E["a"].GETTERS.APP_CONFIG]})),i=l.value.max_single_file_size?Object(B["b"])(l.value.max_single_file_size):"",u=l.value.gpx_limit_import,s=l.value.max_zip_file_size?Object(B["b"])(l.value.max_zip_file_size):"",d=Object(r["computed"])((function(){return a.getters[E["a"].GETTERS.ERROR_MESSAGES]})),p=Object(r["reactive"])({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:""}),b=Object(r["ref"])(e.workout?e.workout.with_gpx:e.isCreation),O=null;function j(e){p.notes=e}function m(){b.value=!b.value}function f(e){e.target.files&&(O=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(A["a"])(Object(A["c"])(t.workout_date,e.authUser.timezone),"yyyy-MM-dd"),r=t.duration.split(":");p.workoutDistance="".concat(t.distance),p.workoutDate=o.workout_date,p.workoutTime=o.workout_time,p.workoutDurationHour=r[0],p.workoutDurationMinutes=r[1],p.workoutDurationSeconds=r[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?a.dispatch(E["f"].ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t}):(g(t),a.dispatch(E["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t));else if(b.value){if(!O)throw new Error("No file provided !!");t.file=O,a.dispatch(E["f"].ACTIONS.ADD_WORKOUT,t)}else g(t),a.dispatch(E["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function w(){e.workout?n.push({name:"Workout",params:{workoutId:e.workout.id}}):n.go(-1)}return Object(r["watch"])((function(){return e.workout}),function(){var e=Object(V["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(r["onUnmounted"])((function(){return a.commit(E["a"].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:j,updateWithGpx:m,updateWorkout:y}}});o("6738");R.render=D,R.__scopeId="data-v-072084e4";t["a"]=R},"628e":function(e,t,o){"use strict";o("be77")},6595:function(e,t,o){"use strict";o("cc92")},6738:function(e,t,o){"use strict";o("29dd")},"692d":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a=Object(r["withScopeId"])("data-v-2e2371d9");Object(r["pushScopeId"])("data-v-2e2371d9");var n={id:"add-workout"},c={class:"container"};Object(r["popScopeId"])();var l=a((function(e,t,o,a,l,i){var u=Object(r["resolveComponent"])("WorkoutEdition");return Object(r["openBlock"])(),Object(r["createBlock"])("div",n,[Object(r["createVNode"])("div",c,[Object(r["createVNode"])(u,{authUser:e.authUser,sports:e.sports,isCreation:!0,loading:e.workoutData.loading},null,8,["authUser","sports","loading"])])])})),i=o("5c76"),u=o("dad5"),s=o("2906"),d=Object(r["defineComponent"])({name:"AddWorkout",components:{WorkoutEdition:i["a"]},setup:function(){var e=Object(s["a"])(),t=Object(r["computed"])((function(){return e.getters[u["b"].GETTERS.SPORTS]})),o=Object(r["computed"])((function(){return e.getters[u["e"].GETTERS.AUTH_USER_PROFILE]})),a=Object(r["computed"])((function(){return e.getters[u["f"].GETTERS.WORKOUT_DATA]}));return{authUser:o,sports:t,workoutData:a}}});o("ebf5");d.render=l,d.__scopeId="data-v-2e2371d9";t["default"]=d},"829d":function(e,t,o){},8300:function(e,t,o){},"86b9":function(e,t,o){},"8ee6":function(e,t,o){},"8ee9":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a={id:"edit-workout"},n={class:"container"};function c(e,t,o,c,l,i){var u=Object(r["resolveComponent"])("WorkoutEdition");return Object(r["openBlock"])(),Object(r["createBlock"])("div",a,[Object(r["createVNode"])("div",n,[Object(r["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(r["defineComponent"])({name:"EditWorkout",components:{WorkoutEdition:u["a"]},setup:function(){var e=Object(i["c"])(),t=Object(d["a"])();Object(r["onBeforeMount"])((function(){t.dispatch(s["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:e.params.workoutId})}));var o=Object(r["computed"])((function(){return t.getters[s["e"].GETTERS.AUTH_USER_PROFILE]})),a=Object(r["computed"])((function(){return t.getters[s["b"].GETTERS.SPORTS]})),n=Object(r["computed"])((function(){return t.getters[s["f"].GETTERS.WORKOUT_DATA]}));return Object(r["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:a,workoutData:n}}});p.render=c;t["default"]=p},a33d:function(e,t,o){},b76e:function(e,t,o){},be77:function(e,t,o){},bef2:function(e,t,o){},bfb4:function(e,t,o){"use strict";o("a33d")},c04f:function(e,t,o){"use strict";o("d8e9")},c2ce:function(e,t,o){"use strict";o("2de4")},cc92:function(e,t,o){},d3d3:function(e,t,o){"use strict";o("f0d7")},d8e9: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 r(e){const r={};if(e){const a=o(e,"line");if(a){const e=t(o(a,"color")),n=parseFloat(t(o(a,"opacity"))),c=parseFloat(t(o(a,"width")));e&&(r.stroke=e),isNaN(n)||(r["stroke-opacity"]=n),isNaN(c)||(r["stroke-width"]=96*c/25.4)}}return r}function a(e,r){const a={};let n,c;for(c=0;c<r.length;c++)n=o(e,r[c]),n&&(a[r[c]]=t(n));return a}function n(e){const o=a(e,["name","cmt","desc","type","time","keywords"]),r=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*");for(let a=0;a<r.length;a++){const n=r[a];n.parentNode.parentNode===e&&(o[n.tagName.replace(":","_")]=t(n))}const n=e.getElementsByTagName("link");n.length&&(o.links=[]);for(let t=0;t<n.length;t++)o.links.push(Object.assign({href:n[t].getAttribute("href")},a(n[t],["text","type"])));return o}function c(e){const r=[parseFloat(e.getAttribute("lon")),parseFloat(e.getAttribute("lat"))],a=o(e,"ele"),n=o(e,"gpxtpx:hr")||o(e,"hr"),c=o(e,"time");let l;a&&(l=parseFloat(t(a)),isNaN(l)||r.push(l));const i={coordinates:r,time:c?t(c):null,extendedValues:[]};n&&i.extendedValues.push(["heart",parseFloat(t(n))]);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(n(e),r(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 r=[],a=[],n={};for(let l=0;l<o.length;l++){const e=c(o[l]);r.push(e.coordinates),e.time&&a.push(e.time);for(let t=0;t<e.extendedValues.length;t++){const[r,a]=e.extendedValues[t],c="heart"===r?r:r+"s";n[c]||(n[c]=Array(o.length).fill(null)),n[c][l]=a}}return{line:r,times:a,extendedValues:n}}function u(e){const t=e.getElementsByTagName("trkseg"),a=[],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(n(e),r(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];a.push(e.line);for(const[t,r]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]=r):e[t]=r}}return{type:"Feature",properties:s,geometry:u?{type:"MultiLineString",coordinates:a}:{type:"LineString",coordinates:a[0]}}}function*s(e){const t=e.getElementsByTagName("trk"),o=e.getElementsByTagName("rte"),r=e.getElementsByTagName("wpt");for(let a=0;a<t.length;a++){const e=u(t[a]);e&&(yield e)}for(let a=0;a<o.length;a++){const e=l(o[a]);e&&(yield e)}for(let l=0;l<r.length;l++)yield(i=r[l],{type:"Feature",properties:Object.assign(n(i),a(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,r){const a=[];for(const[n,c]of r){let r=o(e,n);if(!r){const t=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/ActivityExtension/v2",n);t.length&&(r=t[0])}const l=parseFloat(t(r));isNaN(l)||a.push([c,l])}return a}function O(e){const r=t(o(e,"LongitudeDegrees")),a=t(o(e,"LatitudeDegrees"));if(!r.length||!a.length)return null;const n=[parseFloat(r),parseFloat(a)],c=o(e,"AltitudeMeters"),l=o(e,"HeartRateBpm"),i=o(e,"Time");let u;return c&&(u=parseFloat(t(c)),isNaN(u)||n.push(u)),{coordinates:n,time:i?t(i):null,heartRate:l?parseFloat(t(l)):null,extensions:b(e,d)}}function j(e,t){const o=e.getElementsByTagName(t),r=[],a=[],n=[];if(o.length<2)return null;const c={extendedProperties:{}};for(let l=0;l<o.length;l++){const e=O(o[l]);if(null!==e){r.push(e.coordinates),e.time&&a.push(e.time),e.heartRate&&n.push(e.heartRate);for(const[t,r]of e.extensions)c.extendedProperties[t]||(c.extendedProperties[t]=Array(o.length).fill(null)),c.extendedProperties[t][l]=r}}return Object.assign(c,{line:r,times:a,heartRates:n})}function m(e){const r=e.getElementsByTagName("Track"),a=[],n=[],c=[],l=[];let i;const u=function(e){const t={};for(const[o,r]of e)t[o]=r;return t}(b(e,p)),s=o(e,"Name");s&&(u.name=t(s));for(let t=0;t<r.length;t++)i=j(r[t],"Trackpoint"),i&&(a.push(i.line),i.times.length&&n.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===r.length?u[o]=i.extendedProperties[o]:(u[o]||(u[o]=a.map(e=>Array(e.length).fill(null))),u[o][t]=e[o])}if(0!==a.length)return(n.length||c.length)&&(u.coordinateProperties=Object.assign(n.length?{times:1===a.length?n[0]:n}:{},c.length?{heart:1===a.length?c[0]:c}:{})),{type:"Feature",properties:u,geometry:{type:1===a.length?"LineString":"MultiLineString",coordinates:1===a.length?a[0]:a}}}function*f(e){const t=e.getElementsByTagName("Lap");for(let r=0;r<t.length;r++){const e=m(t[r]);e&&(yield e)}const o=e.getElementsByTagName("Courses");for(let r=0;r<o.length;r++){const e=m(o[r]);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 N(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+=N(e.childNodes[o]);return t}return"#text"===e.nodeName?(e.nodeValue||e.value||"").trim():"#cdata-section"===e.nodeName?e.nodeValue:""}const S=["Polygon","LineString","Point","Track","gx:Track"];function T(e,r,a){let n=t(o(r,"color"))||"";const c="stroke"==a||"fill"===a?a:a+"-color";"#"===n.substr(0,1)&&(n=n.substr(1)),6===n.length||3===n.length?e[c]=n:8===n.length&&(e[a+"-opacity"]=parseInt(n.substr(0,2),16)/255,e[c]="#"+n.substr(6,2)+n.substr(4,2)+n.substr(2,2))}function D(e,r,a,n){const c=parseFloat(t(o(r,a)));isNaN(c)||(e[n]=c)}function V(e){let o=e.getElementsByTagName("coord");const r=[],a=[];0===o.length&&(o=e.getElementsByTagName("gx:coord"));for(let c=0;c<o.length;c++)r.push(t(o[c]).split(" ").map(parseFloat));const n=e.getElementsByTagName("when");for(let c=0;c<n.length;c++)a.push(t(n[c]));return{coords:r,times:a}}function C(e){let r,a,n,c,l;const i=[],u=[];if(o(e,"MultiGeometry"))return C(o(e,"MultiGeometry"));if(o(e,"MultiTrack"))return C(o(e,"MultiTrack"));if(o(e,"gx:MultiTrack"))return C(o(e,"gx:MultiTrack"));for(n=0;n<S.length;n++)if(a=e.getElementsByTagName(S[n]),a)for(c=0;c<a.length;c++)if(r=a[c],"Point"===S[n])i.push({type:"Point",coordinates:h(t(o(r,"coordinates")))});else if("LineString"===S[n])i.push({type:"LineString",coordinates:v(t(o(r,"coordinates")))});else if("Polygon"===S[n]){const e=r.getElementsByTagName("LinearRing"),a=[];for(l=0;l<e.length;l++)a.push(v(t(o(e[l],"coordinates"))));i.push({type:"Polygon",coordinates:a})}else if("Track"===S[n]||"gx:Track"===S[n]){const e=V(r);i.push({type:"LineString",coordinates:e.coords}),e.times.length&&u.push(e.times)}return{geoms:i,coordTimes:u}}function _(e,r,a,n){const c=C(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"),O=o(e,"TimeStamp"),j=o(e,"ExtendedData");let m=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,r[d]&&(i.styleHash=r[d]),a[d]&&(i.styleMapHash=a[d],i.styleHash=r[a[d].normal]);const e=n[i.styleHash];e&&(m||(m=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")),r=t(o(b,"end"));i.timespan={begin:e,end:r}}if(O&&(i.timestamp=t(o(O,"when"))),m){T(i,m,"icon"),D(i,m,"scale","icon-scale"),D(i,m,"heading","icon-heading");const e=o(m,"hotSpot");if(e){const t=parseFloat(e.getAttribute("x")),o=parseFloat(e.getAttribute("y"));isNaN(t)||isNaN(o)||(i["icon-offset"]=[t,o])}const r=o(m,"Icon");if(r){const e=t(o(r,"href"));e&&(i.icon=e)}}if(f&&(T(i,f,"label"),D(i,f,"scale","label-scale")),k&&(T(i,k,"stroke"),D(i,k,"width","stroke-width")),g){T(i,g,"fill");const e=t(o(g,"fill")),r=t(o(g,"outline"));e&&(i["fill-opacity"]="1"===e?i["fill-opacity"]||1:0),r&&(i["stroke-opacity"]="1"===r?i["stroke-opacity"]||1:0)}if(j){const e=j.getElementsByTagName("Data"),r=j.getElementsByTagName("SimpleData");for(l=0;l<e.length;l++)i[e[l].getAttribute("name")]=t(o(e[l],"value"));for(l=0;l<r.length;l++)i[r[l].getAttribute("name")]=t(r[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(e){const r={},a={},n={},c=e.getElementsByTagName("Placemark"),l=e.getElementsByTagName("Style"),i=e.getElementsByTagName("StyleMap");for(let t=0;t<l.length;t++){const e=w(N(l[t])).toString(16);r["#"+l[t].getAttribute("id")]=e,a[e]=l[t]}for(let u=0;u<i.length;u++){r["#"+i[u].getAttribute("id")]=w(N(i[u])).toString(16);const e=i[u].getElementsByTagName("Pair"),a={};for(let r=0;r<e.length;r++)a[t(o(e[r],"key"))]=t(o(e[r],"styleUrl"));n["#"+i[u].getAttribute("id")]=a}for(let t=0;t<c.length;t++){const e=_(c[t],r,n,a);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))}},e.kmlGen=E,e.tcx=function(e){return{type:"FeatureCollection",features:Array.from(f(e))}},e.tcxGen=f,Object.defineProperty(e,"__esModule",{value:!0})}))},ebf5:function(e,t,o){"use strict";o("18ac")},f0d7:function(e,t,o){},ffd66:function(e,t,o){"use strict";o("829d")}}]);
//# sourceMappingURL=workouts.6d428fcc.js.map