(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["workouts"],{"0385":function(e,t,n){"use strict";n.r(t);var o=n("7a23"),r=n("47e2"),c=(n("b0c0"),n("4de4"),n("d3b7"),n("caad"),n("2532"),n("6c02")),a=n("1119"),l=n("6284"),i=function(e){return Object(o["pushScopeId"])("data-v-fe8ba900"),e=e(),Object(o["popScopeId"])(),e},u={class:"workouts-filters"},s={class:"box"},d={class:"form"},b={class:"form-items-group"},O={class:"form-item"},p=["value"],m={class:"form-item"},j=["value"],f={class:"form-items-group"},g={class:"form-item"},k=["value"],y=i((function(){return Object(o["createElementVNode"])("option",{value:""},null,-1)})),v=["value"],h={class:"form-items-group"},E={class:"form-item"},N={class:"form-inputs-group"},w=["value"],S=["value"],V={class:"form-items-group"},T={class:"form-item"},D={class:"form-inputs-group"},_=["value"],I=["value"],x={class:"form-items-group"},C={class:"form-item"},A={class:"form-inputs-group"},B=["value"],R=["value"],U={class:"form-items-group"},L={class:"form-item"},$={class:"form-inputs-group"},M=["value"],P=["value"],F={class:"form-button"},G=Object(o["defineComponent"])({props:{authUser:null,sports:null},emits:["filter"],setup:function(e,t){var n=t.emit,i=e,G=Object(r["b"])(),W=G.t,z=Object(c["c"])(),H=Object(c["d"])(),q=Object(o["toRefs"])(i),K=q.authUser,Z=K.value.imperial_units?l["c"]["km"].defaultTarget:"km",X=Object(o["computed"])((function(){return Object(a["e"])(i.sports,W)})),Y=Object.assign({},z.query);function J(e){""===e.target.value?delete Y[e.target.name]:Y[e.target.name]=e.target.value}function Q(){n("filter"),"page"in Y&&(Y["page"]="1"),H.push({path:"/workouts",query:Y})}function ee(){n("filter"),H.push({path:"/workouts",query:{}})}return Object(o["watch"])((function(){return z.query}),(function(e){Y=Object.assign({},e)})),function(e,t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",u,[Object(o["createElementVNode"])("div",s,[Object(o["createElementVNode"])("div",d,[Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("div",O,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.FROM"))+": ",1),Object(o["createElementVNode"])("input",{name:"from",type:"date",value:e.$route.query.from,onChange:J},null,40,p)]),Object(o["createElementVNode"])("div",m,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.TO"))+": ",1),Object(o["createElementVNode"])("input",{name:"to",type:"date",value:e.$route.query.to,onChange:J},null,40,j)])]),Object(o["createElementVNode"])("div",f,[Object(o["createElementVNode"])("div",g,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.SPORT",1))+":",1),Object(o["createElementVNode"])("select",{name:"sport_id",value:e.$route.query.sport_id,onChange:J},[y,(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(X).filter((function(e){return Object(o["unref"])(K).sports_list.includes(e.id)})),(function(e){return Object(o["openBlock"])(),Object(o["createElementBlock"])("option",{value:e.id,key:e.id},Object(o["toDisplayString"])(e.translatedLabel),9,v)})),128))],40,k)])]),Object(o["createElementVNode"])("div",h,[Object(o["createElementVNode"])("div",E,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.DISTANCE"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",N,[Object(o["createElementVNode"])("input",{name:"distance_from",type:"number",min:"0",step:"0.1",value:e.$route.query.distance_from,onChange:J},null,40,w),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.$t("workouts.TO")),1),Object(o["createElementVNode"])("input",{name:"distance_to",type:"number",min:"0",step:"0.1",value:e.$route.query.distance_to,onChange:J},null,40,S)])])]),Object(o["createElementVNode"])("div",V,[Object(o["createElementVNode"])("div",T,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.DURATION"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",D,[Object(o["createElementVNode"])("input",{name:"duration_from",value:e.$route.query.duration_from,onChange:J,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,_),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.$t("workouts.TO")),1),Object(o["createElementVNode"])("input",{name:"duration_to",value:e.$route.query.duration_to,onChange:J,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,I)])])]),Object(o["createElementVNode"])("div",x,[Object(o["createElementVNode"])("div",C,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.AVE_SPEED"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",A,[Object(o["createElementVNode"])("input",{min:"0",name:"ave_speed_from",value:e.$route.query.ave_speed_from,onChange:J,step:"0.1",type:"number"},null,40,B),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.$t("workouts.TO")),1),Object(o["createElementVNode"])("input",{min:"0",name:"ave_speed_to",value:e.$route.query.ave_speed_to,onChange:J,step:"0.1",type:"number"},null,40,R)])])]),Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("div",L,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("input",{min:"0",name:"max_speed_from",value:e.$route.query.max_speed_from,onChange:J,step:"0.1",type:"number"},null,40,M),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.$t("workouts.TO")),1),Object(o["createElementVNode"])("input",{min:"0",name:"max_speed_to",value:e.$route.query.max_speed_to,onChange:J,step:"0.1",type:"number"},null,40,P)])])])]),Object(o["createElementVNode"])("div",F,[Object(o["createElementVNode"])("button",{class:"confirm",onClick:Q},Object(o["toDisplayString"])(e.$t("buttons.FILTER")),1),Object(o["createElementVNode"])("button",{class:"confirm",onClick:ee},Object(o["toDisplayString"])(e.$t("buttons.CLEAR_FILTER")),1)])])])}}}),W=(n("5022"),n("6b0d")),z=n.n(W);const H=z()(G,[["__scopeId","data-v-fe8ba900"]]);var q=H,K=n("1da1"),Z=n("5530"),X=(n("96cf"),n("d81d"),n("b64b"),n("4fad"),n("ac1f"),n("466d"),n("7db0"),n("b166")),Y=n("9176"),J=n("6d7d"),Q=n("68c6"),ee=n("1724"),te=n("dad5"),ne=n("2906"),oe=n("97e5"),re=n("5e65"),ce=n("9230"),ae=function(e){return Object(o["pushScopeId"])("data-v-c2063212"),e=e(),Object(o["popScopeId"])(),e},le={class:"workouts-list"},ie={class:"total"},ue={class:"total-label"},se={key:0},de={key:0,class:"workouts-table responsive-table"},be=ae((function(){return Object(o["createElementVNode"])("th",{class:"sport-col"},null,-1)})),Oe={class:"sport-col"},pe={class:"cell-heading"},me=["onMouseover"],je={class:"cell-heading"},fe={key:0,class:"fa fa-map-o","aria-hidden":"true"},ge={class:"cell-heading"},ke={class:"text-right"},ye={class:"cell-heading"},ve={class:"text-right"},he={class:"cell-heading"},Ee={class:"text-right"},Ne={class:"cell-heading"},we={class:"text-right"},Se={class:"cell-heading"},Ve={class:"text-right"},Te={class:"cell-heading"},De={class:"text-right"},_e={class:"cell-heading"},Ie=ae((function(){return Object(o["createElementVNode"])("div",{id:"bottom"},null,-1)})),xe=Object(o["defineComponent"])({props:{user:null,sports:null},setup:function(e){var t=e,n=Object(ne["a"])(),r=Object(c["c"])(),i=Object(c["d"])(),u=Object(o["toRefs"])(t),s=u.user,d=u.sports,b=["ave_speed","distance","duration","workout_date"],O=Object(o["computed"])((function(){return n.getters[te["f"].GETTERS.USER_WORKOUTS]})),p=Object(o["computed"])((function(){return n.getters[te["f"].GETTERS.WORKOUTS_PAGINATION]})),m=k(r.query),j=Object(o["ref"])(null);function f(e){n.dispatch(te["f"].ACTIONS.GET_USER_WORKOUTS,s.value.imperial_units?y(e):e)}function g(e,t){var n=Object.assign({},r.query);n[e]=t,"per_page"===e&&(n["page"]="1"),m=k(n),i.push({path:"/workouts",query:m})}function k(e){return m=Object(oe["a"])(e,b,ce["a"].order_by,{defaultSort:ce["a"].order}),Object.keys(e).filter((function(e){return oe["d"].includes(e)})).map((function(t){"string"===typeof e[t]&&(m[t]=e[t])})),m}function y(e){var t=Object(Z["a"])({},e);return Object.entries(t).map((function(e){e[0].match("speed|distance")&&(t[e[0]]=Object(l["a"])(+e[1],"mi","km"))})),t}function v(e){j.value=e}return Object(o["onBeforeMount"])((function(){f(m)})),Object(o["watch"])((function(){return r.query}),function(){var e=Object(K["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:m=k(t),f(m);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),function(e,t){var n=Object(o["resolveComponent"])("SportImage"),r=Object(o["resolveComponent"])("router-link"),c=Object(o["resolveComponent"])("Distance");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",le,[Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])(["box",{"empty-table":0===Object(o["unref"])(O).length}])},[Object(o["createElementVNode"])("div",ie,[Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.$t("common.TOTAL").toLowerCase())+": ",1),null!==Object(o["unref"])(p).total?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",se,Object(o["toDisplayString"])(Object(o["unref"])(p).total)+" "+Object(o["toDisplayString"])(e.$t("workouts.WORKOUT",Object(o["unref"])(p).total)),1)):Object(o["createCommentVNode"])("",!0)]),Object(o["createVNode"])(Y["a"],{sort:Object(o["unref"])(oe["c"]),order_by:b,query:Object(o["unref"])(m),message:"workouts",onUpdateSelect:g},null,8,["sort","query"]),Object(o["unref"])(O).length>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",de,[Object(o["createVNode"])(J["a"],{class:"top-pagination",pagination:Object(o["unref"])(p),path:"/workouts",query:Object(o["unref"])(m)},null,8,["pagination","query"]),Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[be,Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.WORKOUT",1))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.DATE"))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.DISTANCE"))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.DURATION"))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.AVE_SPEED"))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.MAX_SPEED"))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.ASCENT"))),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.DESCENT"))),1)])]),Object(o["createElementVNode"])("tbody",null,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(O),(function(l){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:l.id},[Object(o["createElementVNode"])("td",Oe,[Object(o["createElementVNode"])("span",pe,Object(o["toDisplayString"])(e.$t("workouts.SPORT",1)),1),Object(o["unref"])(d).length>0?(Object(o["openBlock"])(),Object(o["createBlock"])(n,{key:0,title:Object(o["unref"])(d).find((function(e){return e.id===l.sport_id})).translatedLabel,"sport-label":Object(o["unref"])(a["b"])(l,Object(o["unref"])(d)),color:Object(o["unref"])(a["a"])(l,Object(o["unref"])(d))},null,8,["title","sport-label","color"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("td",{class:"workout-title",onMouseover:function(e){return v(l.id)},onMouseleave:t[0]||(t[0]=function(e){return v(null)})},[Object(o["createElementVNode"])("span",je,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.WORKOUT",1))),1),Object(o["createVNode"])(r,{class:"nav-item",to:{name:"Workout",params:{workoutId:l.id}}},{default:Object(o["withCtx"])((function(){return[l.with_gpx?(Object(o["openBlock"])(),Object(o["createElementBlock"])("i",fe)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(l.title),1)]})),_:2},1032,["to"]),l.with_gpx&&j.value===l.id?(Object(o["openBlock"])(),Object(o["createBlock"])(Q["a"],{key:0,workout:l,"display-hover":!0},null,8,["workout"])):Object(o["createCommentVNode"])("",!0)],40,me),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",ge,Object(o["toDisplayString"])(e.$t("workouts.DATE")),1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(Object(o["unref"])(X["a"])(Object(o["unref"])(re["c"])(l.workout_date,Object(o["unref"])(s).timezone),"dd/MM/yyyy HH:mm")),1)]),Object(o["createElementVNode"])("td",ke,[Object(o["createElementVNode"])("span",ye,Object(o["toDisplayString"])(e.$t("workouts.DISTANCE")),1),Object(o["createVNode"])(c,{distance:l.distance,unitFrom:"km",useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])]),Object(o["createElementVNode"])("td",ve,[Object(o["createElementVNode"])("span",he,Object(o["toDisplayString"])(e.$t("workouts.DURATION")),1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(l.moving),1)]),Object(o["createElementVNode"])("td",Ee,[Object(o["createElementVNode"])("span",Ne,Object(o["toDisplayString"])(e.$t("workouts.AVE_SPEED")),1),Object(o["createVNode"])(c,{distance:l.ave_speed,unitFrom:"km",speed:!0,useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])]),Object(o["createElementVNode"])("td",we,[Object(o["createElementVNode"])("span",Se,Object(o["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),Object(o["createVNode"])(c,{distance:l.max_speed,unitFrom:"km",speed:!0,useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])]),Object(o["createElementVNode"])("td",Ve,[Object(o["createElementVNode"])("span",Te,Object(o["toDisplayString"])(e.$t("workouts.ASCENT")),1),l.with_gpx?(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:0,distance:l.ascent,unitFrom:"m",useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("td",De,[Object(o["createElementVNode"])("span",_e,Object(o["toDisplayString"])(e.$t("workouts.DESCENT")),1),l.with_gpx?(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:0,distance:l.descent,unitFrom:"m",useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])):Object(o["createCommentVNode"])("",!0)])])})),128))])]),Object(o["createVNode"])(J["a"],{pagination:Object(o["unref"])(p),path:"/workouts",query:Object(o["unref"])(m)},null,8,["pagination","query"])])):Object(o["createCommentVNode"])("",!0)],2),0===Object(o["unref"])(O).length?(Object(o["openBlock"])(),Object(o["createBlock"])(ee["a"],{key:0})):Object(o["createCommentVNode"])("",!0),Ie])}}});n("8aa2");const Ce=z()(xe,[["__scopeId","data-v-c2063212"]]);var Ae=Ce,Be={key:0,id:"workouts",class:"view"},Re={class:"container workouts-container"},Ue={class:"display-filters"},Le={class:"list-container"},$e=Object(o["defineComponent"])({setup:function(e){var t=Object(r["b"])(),n=t.t,c=Object(ne["a"])(),l=Object(o["computed"])((function(){return c.getters[te["a"].GETTERS.AUTH_USER_PROFILE]})),i=Object(o["computed"])((function(){return c.getters[te["c"].GETTERS.SPORTS]})),u=Object(o["computed"])((function(){return Object(a["e"])(i.value,n)})),s=Object(o["ref"])(!0);function d(){s.value=!s.value}return function(e,t){return Object(o["unref"])(l).username?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Be,[Object(o["createElementVNode"])("div",Re,[Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])(["filters-container",{hidden:s.value}])},[Object(o["createVNode"])(q,{sports:Object(o["unref"])(u),authUser:Object(o["unref"])(l),onFilter:d},null,8,["sports","authUser"])],2),Object(o["createElementVNode"])("div",Ue,[Object(o["createElementVNode"])("div",{onClick:d},[Object(o["createElementVNode"])("i",{class:Object(o["normalizeClass"])("fa fa-caret-".concat(s.value?"down":"up")),"aria-hidden":"true"},null,2),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.$t("workouts.".concat(s.value?"DISPLAY":"HIDE","_FILTERS"))),1)])]),Object(o["createElementVNode"])("div",Le,[Object(o["createVNode"])(Ae,{user:Object(o["unref"])(l),sports:Object(o["unref"])(u)},null,8,["user","sports"])])])])):Object(o["createCommentVNode"])("",!0)}}});n("b1c7");const Me=z()($e,[["__scopeId","data-v-03de0ddc"]]);t["default"]=Me},"0716":function(e,t,n){},"17b6":function(e,t,n){},"1c8d":function(e,t,n){},2146:function(e,t,n){"use strict";n("4c68")},"304a":function(e,t,n){"use strict";n.r(t);var o=n("1da1"),r=(n("96cf"),n("7a23")),c=n("6c02"),a=n("f7f9"),l=(n("7db0"),n("d3b7"),n("99af"),function(e){return Object(r["pushScopeId"])("data-v-07bbfa5e"),e=e(),Object(r["popScopeId"])(),e}),i={id:"workout-card-title"},u=["title"],s=l((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1)})),d=[s],b={class:"workout-card-title"},O={class:"workout-title-date"},p={key:0,class:"workout-title"},m={key:1,class:"workout-title"},j={class:"workout-segment"},f=Object(r["createTextVNode"])(" — "),g=l((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1)})),k={class:"workout-date"},y={class:"workout-link"},v=["title"],h=l((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1)})),E=[h],N=Object(r["defineComponent"])({props:{sport:null,workoutObject:null},emits:["displayModal"],setup:function(e,t){var n=t.emit,o=e,c=Object(r["toRefs"])(o),a=c.sport,l=c.workoutObject;return function(e,t){var o=Object(r["resolveComponent"])("SportImage"),c=Object(r["resolveComponent"])("router-link");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",i,[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])(["workout-previous workout-arrow",{inactive:!Object(r["unref"])(l).previousUrl}]),title:Object(r["unref"])(l).previousUrl?e.$t("workouts.PREVIOUS_".concat(Object(r["unref"])(l).type)):e.$t("workouts.NO_PREVIOUS_".concat(Object(r["unref"])(l).type)),onClick:t[0]||(t[0]=function(t){return Object(r["unref"])(l).previousUrl?e.$router.push(Object(r["unref"])(l).previousUrl):null})},d,10,u),Object(r["createElementVNode"])("div",b,[Object(r["createVNode"])(o,{"sport-label":Object(r["unref"])(a).label,color:Object(r["unref"])(a).color},null,8,["sport-label","color"]),Object(r["createElementVNode"])("div",O,["WORKOUT"===Object(r["unref"])(l).type?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",p,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(Object(r["unref"])(l).title)+" ",1),Object(r["createElementVNode"])("i",{class:"fa fa-edit","aria-hidden":"true",onClick:t[1]||(t[1]=function(t){return e.$router.push({name:"EditWorkout",params:{workoutId:Object(r["unref"])(l).workoutId}})})}),Object(r["createElementVNode"])("i",{class:"fa fa-trash","aria-hidden":"true",onClick:t[2]||(t[2]=function(e){return n("displayModal",!0)})})])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",m,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(Object(r["unref"])(l).title)+" ",1),Object(r["createElementVNode"])("span",j,[f,g,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.SEGMENT"))+" "+Object(r["toDisplayString"])(Object(r["unref"])(l).segmentId+1),1)])])),Object(r["createElementVNode"])("div",k,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(Object(r["unref"])(l).workoutDate)+" - "+Object(r["toDisplayString"])(Object(r["unref"])(l).workoutTime)+" ",1),Object(r["createElementVNode"])("span",y,["SEGMENT"===Object(r["unref"])(l).type?(Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:0,to:{name:"Workout",params:{workoutId:Object(r["unref"])(l).workoutId}}},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(" > "+Object(r["toDisplayString"])(e.$t("workouts.BACK_TO_WORKOUT")),1)]})),_:1},8,["to"])):Object(r["createCommentVNode"])("",!0)])])])]),Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])(["workout-next workout-arrow",{inactive:!Object(r["unref"])(l).nextUrl}]),title:Object(r["unref"])(l).nextUrl?e.$t("workouts.NEXT_".concat(Object(r["unref"])(l).type)):e.$t("workouts.NO_NEXT_".concat(Object(r["unref"])(l).type)),onClick:t[3]||(t[3]=function(t){return Object(r["unref"])(l).nextUrl?e.$router.push(Object(r["unref"])(l).nextUrl):null})},E,10,v)])}}}),w=(n("686a"),n("6b0d")),S=n.n(w);const V=S()(N,[["__scopeId","data-v-07bbfa5e"]]);var T=V,D=function(e){return Object(r["pushScopeId"])("data-v-1a5282f6"),e=e(),Object(r["popScopeId"])(),e},_={key:0,class:"workout-record"},I=D((function(){return Object(r["createElementVNode"])("sup",null,[Object(r["createElementVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1)})),x=[I],C=Object(r["defineComponent"])({props:{recordType:null,workoutObject:null},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.recordType,c=n.workoutObject;return function(e,t){return Object(r["unref"])(c).records&&Object(r["unref"])(c).records.find((function(e){return e.record_type===Object(r["unref"])(o)}))?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",_,x)):Object(r["createCommentVNode"])("",!0)}}});n("b86c");const A=S()(C,[["__scopeId","data-v-1a5282f6"]]);var B=A,R=(n("b680"),n("a9e3"),function(e){return Object(r["pushScopeId"])("data-v-59cb2880"),e=e(),Object(r["popScopeId"])(),e}),U={key:0,id:"workout-weather"},L={class:"weather-table"},$=R((function(){return Object(r["createElementVNode"])("th",null,null,-1)})),M={class:"weather-th"},P=["src","alt","title"],F={class:"weather-th"},G=["src","alt","title"],W=["alt","title"],z=["alt","title"],H=["alt","title"],q=Object(r["defineComponent"])({props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.useImperialUnits,c=n.workoutObject;return function(e,t){var n=Object(r["resolveComponent"])("Distance");return Object(r["unref"])(c).weatherStart&&Object(r["unref"])(c).weatherEnd?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",U,[Object(r["createElementVNode"])("table",L,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[$,Object(r["createElementVNode"])("th",null,[Object(r["createElementVNode"])("div",M,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.START"))+" ",1),Object(r["createElementVNode"])("img",{class:"weather-img",src:"/img/weather/".concat(Object(r["unref"])(c).weatherStart.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(c).weatherStart.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(c).weatherStart.icon))},null,8,P)])]),Object(r["createElementVNode"])("th",null,[Object(r["createElementVNode"])("div",F,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.END"))+" ",1),Object(r["createElementVNode"])("img",{class:"weather-img",src:"/img/weather/".concat(Object(r["unref"])(c).weatherEnd.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(c).weatherEnd.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(c).weatherEnd.icon))},null,8,G)])])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",null,[Object(r["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,W)]),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(Object(r["unref"])(c).weatherStart.temperature).toFixed(1))+"°C ",1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(Object(r["unref"])(c).weatherEnd.temperature).toFixed(1))+"°C ",1)]),Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",null,[Object(r["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,z)]),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(100*Object(r["unref"])(c).weatherStart.humidity).toFixed(1))+"% ",1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(100*Object(r["unref"])(c).weatherEnd.humidity).toFixed(1))+"% ",1)]),Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",null,[Object(r["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,H)]),Object(r["createElementVNode"])("td",null,[Object(r["createVNode"])(n,{distance:Object(r["unref"])(c).weatherStart.wind,unitFrom:"m",digits:1,displayUnit:!1,useImperialUnits:Object(r["unref"])(o)},null,8,["distance","useImperialUnits"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(Object(r["unref"])(o)?"ft":"m")+"/s ",1)]),Object(r["createElementVNode"])("td",null,[Object(r["createVNode"])(n,{distance:Object(r["unref"])(c).weatherEnd.wind,unitFrom:"m",digits:1,displayUnit:!1,useImperialUnits:Object(r["unref"])(o)},null,8,["distance","useImperialUnits"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(Object(r["unref"])(o)?"ft":"m")+"/s ",1)])])])])])):Object(r["createCommentVNode"])("",!0)}}});n("a497");const K=S()(q,[["__scopeId","data-v-59cb2880"]]);var Z=K,X=function(e){return Object(r["pushScopeId"])("data-v-dc2fbc66"),e=e(),Object(r["popScopeId"])(),e},Y={id:"workout-info"},J={class:"workout-data"},Q=X((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1)})),ee={class:"label"},te=Object(r["createTextVNode"])(": "),ne={class:"value"},oe={key:0},re={class:"value"},ce={class:"value"},ae={class:"workout-data"},le=X((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1)})),ie={class:"label"},ue=Object(r["createTextVNode"])(": "),se={class:"workout-data"},de=X((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1)})),be={class:"label"},Oe=Object(r["createTextVNode"])(": "),pe=X((function(){return Object(r["createElementVNode"])("br",null,null,-1)})),me={class:"label"},je=Object(r["createTextVNode"])(": "),fe={key:0,class:"workout-data"},ge=["alt"],ke={class:"label"},ye=Object(r["createTextVNode"])(": "),ve=X((function(){return Object(r["createElementVNode"])("br",null,null,-1)})),he={class:"label"},Ee=Object(r["createTextVNode"])(": "),Ne={key:1,class:"workout-data"},we=X((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1)})),Se={class:"label"},Ve=Object(r["createTextVNode"])(": "),Te=X((function(){return Object(r["createElementVNode"])("br",null,null,-1)})),De={class:"label"},_e=Object(r["createTextVNode"])(": "),Ie=Object(r["defineComponent"])({props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.workoutObject,c=n.useImperialUnits,a=Object(r["computed"])((function(){return"0:00:00"!==t.workoutObject.pauses&&null!==t.workoutObject.pauses}));return function(e,t){var n=Object(r["resolveComponent"])("Distance");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Y,[Object(r["createElementVNode"])("div",J,[Q,Object(r["createElementVNode"])("span",ee,Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1),te,Object(r["createElementVNode"])("span",ne,Object(r["toDisplayString"])(Object(r["unref"])(o).moving),1),Object(r["createVNode"])(B,{workoutObject:Object(r["unref"])(o),recordType:"LD"},null,8,["workoutObject"]),Object(r["unref"])(a)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",oe,[Object(r["createTextVNode"])(" ("+Object(r["toDisplayString"])(e.$t("workouts.PAUSES"))+": ",1),Object(r["createElementVNode"])("span",re,Object(r["toDisplayString"])(Object(r["unref"])(o).pauses),1),Object(r["createTextVNode"])(" - "+Object(r["toDisplayString"])(e.$t("workouts.TOTAL_DURATION"))+": ",1),Object(r["createElementVNode"])("span",ce,Object(r["toDisplayString"])(Object(r["unref"])(o).duration)+")",1)])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",ae,[le,Object(r["createElementVNode"])("span",ie,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1),ue,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).distance,digits:3,unitFrom:"km",strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"]),Object(r["createVNode"])(B,{workoutObject:Object(r["unref"])(o),recordType:"FD"},null,8,["workoutObject"])]),Object(r["createElementVNode"])("div",se,[de,Object(r["createElementVNode"])("span",be,Object(r["toDisplayString"])(e.$t("workouts.AVERAGE_SPEED")),1),Oe,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).aveSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"]),Object(r["createVNode"])(B,{workoutObject:Object(r["unref"])(o),recordType:"AS"},null,8,["workoutObject"]),pe,Object(r["createElementVNode"])("span",me,Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),je,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).maxSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"]),Object(r["createVNode"])(B,{workoutObject:Object(r["unref"])(o),recordType:"MS"},null,8,["workoutObject"])]),null!==Object(r["unref"])(o).maxAlt&&null!==Object(r["unref"])(o).minAlt?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",fe,[Object(r["createElementVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,ge),Object(r["createElementVNode"])("span",ke,Object(r["toDisplayString"])(e.$t("workouts.MIN_ALTITUDE")),1),ye,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).minAlt,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"]),ve,Object(r["createElementVNode"])("span",he,Object(r["toDisplayString"])(e.$t("workouts.MAX_ALTITUDE")),1),Ee,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).maxAlt,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"])])):Object(r["createCommentVNode"])("",!0),null!==Object(r["unref"])(o).ascent&&null!==Object(r["unref"])(o).descent?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ne,[we,Object(r["createElementVNode"])("span",Se,Object(r["toDisplayString"])(e.$t("workouts.ASCENT")),1),Ve,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).ascent,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"]),Te,Object(r["createElementVNode"])("span",De,Object(r["toDisplayString"])(e.$t("workouts.DESCENT")),1),_e,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).descent,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"])])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(Z,{workoutObject:Object(r["unref"])(o),useImperialUnits:Object(r["unref"])(c)},null,8,["workoutObject","useImperialUnits"])])}}});n("5f44");const xe=S()(Ie,[["__scopeId","data-v-dc2fbc66"]]);var Ce=xe,Ae=n("e94f"),Be=n("5afd"),Re=n("dad5"),Ue=n("2906"),Le=n("d257"),$e={id:"workout-map"},Me={key:0,class:"leaflet-container"},Pe={key:1},Fe={key:0,class:"leaflet-container"},Ge={key:1,class:"no-map"},We=Object(r["defineComponent"])({props:{workoutData:null,markerCoordinates:{default:function(){return{}}}},setup:function(e){var t=e,n=Object(Ue["a"])(),o=Object(r["toRefs"])(t),c=o.workoutData,a=o.markerCoordinates,l=Object(r["ref"])(null),i=Object(r["computed"])((function(){return t.workoutData?[[t.workoutData.workout.bounds[0],t.workoutData.workout.bounds[1]],[t.workoutData.workout.bounds[2],t.workoutData.workout.bounds[3]]]:[]})),u=Object(r["computed"])((function(){return n.getters[Re["b"].GETTERS.APP_CONFIG]})),s=Object(r["computed"])((function(){return O(i)})),d=Object(r["computed"])((function(){return t.workoutData&&t.workoutData.gpx?b(t.workoutData.gpx):{}}));function b(e){if(!e||""!==e)try{var t=Object(Ae["gpx"])((new DOMParser).parseFromString(e,"text/xml"));return{jsonData:t}}catch(n){return console.error("Invalid gpx content"),{}}return{}}function O(e){return[(e.value[0][0]+e.value[1][0])/2,(e.value[0][1]+e.value[1][1])/2]}function p(e){var t,n;null!==(t=l.value)&&void 0!==t&&t.leafletObject&&(null===(n=l.value)||void 0===n||n.leafletObject.fitBounds(e))}return function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",$e,[Object(r["unref"])(c).loading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Me)):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Pe,[Object(r["unref"])(c).workout.with_gpx?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Fe,[Object(r["unref"])(d).jsonData&&Object(r["unref"])(s)&&2===Object(r["unref"])(i).length?(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["unref"])(Be["b"]),{key:0,zoom:13,center:Object(r["unref"])(s),bounds:Object(r["unref"])(i),ref:function(e,t){t["workoutMap"]=e,l.value=e},onReady:t[0]||(t[0]=function(e){return p(Object(r["unref"])(i))})},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(Object(r["unref"])(Be["d"]),{url:"".concat(Object(r["unref"])(Le["a"])(),"workouts/map_tile/{s}/{z}/{x}/{y}.png"),attribution:Object(r["unref"])(u).map_attribution,bounds:Object(r["unref"])(i)},null,8,["url","attribution","bounds"]),Object(r["createVNode"])(Object(r["unref"])(Be["a"]),{geojson:Object(r["unref"])(d).jsonData},null,8,["geojson"]),Object(r["unref"])(a).latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["unref"])(Be["c"]),{key:0,"lat-lng":[Object(r["unref"])(a).latitude,Object(r["unref"])(a).longitude]},null,8,["lat-lng"])):Object(r["createCommentVNode"])("",!0)]})),_:1},8,["center","bounds"])):Object(r["createCommentVNode"])("",!0)])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ge,Object(r["toDisplayString"])(e.$t("workouts.NO_MAP")),1))]))])}}});n("58a2");const ze=S()(We,[["__scopeId","data-v-3ee4aadc"]]);var He=ze,qe=n("5e65"),Ke={class:"workout-detail"},Ze=Object(r["defineComponent"])({props:{authUser:null,displaySegment:{type:Boolean},sports:null,workoutData:null,markerCoordinates:{default:function(){return{}}}},setup:function(e){var t=e,n=Object(c["c"])(),a=Object(Ue["a"])(),l=Object(r["toRefs"])(t),i=l.authUser,u=l.markerCoordinates,s=l.workoutData,d=Object(r["computed"])((function(){return t.workoutData.workout})),b=Object(r["ref"])(n.params.workoutId?+n.params.segmentId:null),O=Object(r["computed"])((function(){return d.value.segments.length>0&&b.value?d.value.segments[+b.value-1]:null})),p=Object(r["ref"])(!1),m=Object(r["computed"])((function(){return t.sports?t.sports.find((function(e){return e.id===t.workoutData.workout.sport_id})):{}})),j=Object(r["computed"])((function(){return g(d.value,O.value)}));function f(e,t,n){var o=t&&n&&1!==n?"/workouts/".concat(e.id,"/segment/").concat(n-1):!t&&e.previous_workout?"/workouts/".concat(e.previous_workout):null,r=t&&n&&n0&&k(O.value[e[0].dataIndex]),0===e.length?"":l.value?"".concat(a("workouts.DISTANCE"),": ").concat(e[0].label," ").concat(s):"".concat(a("workouts.DURATION"),": ").concat(g(e[0].label.replace(",","")))}}},legend:{display:!1},htmlLegend:{containerID:"chart-legend"}}}})),m=Object(Qe["useLineChart"])({chartData:b,options:p,plugins:[nt]}),j=m.lineChartProps;function f(){l.value=!l.value}function g(e){return new Date(1e3*+e).toISOString().substr(11,8)}function k(e){n("getCoordinates",e)}function y(){k({latitude:null,longitude:null})}function v(e){return o.authUser.imperial_units?ot["c"][e].defaultTarget:e}return function(e,t){var n=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",at,[Object(r["createVNode"])(n,null,{title:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.ANALYSIS")),1)]})),content:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",lt,[Object(r["createElementVNode"])("label",null,[Object(r["createElementVNode"])("input",{type:"radio",name:"distance",checked:Object(r["unref"])(l),onClick:f},null,8,it),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1)]),Object(r["createElementVNode"])("label",null,[Object(r["createElementVNode"])("input",{type:"radio",name:"duration",checked:!Object(r["unref"])(l),onClick:f},null,8,ut),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1)])]),st,Object(r["createVNode"])(Object(r["unref"])(Qe["LineChart"]),Object(r["mergeProps"])(Object(r["unref"])(j),{class:"line-chart",onMouseleave:y}),null,16),Object(r["createElementVNode"])("div",dt,[Object(r["createElementVNode"])("div",bt,Object(r["toDisplayString"])(e.$t("workouts.NO_DATA_CLEANING")),1),Object(r["createElementVNode"])("div",Ot,[Object(r["createElementVNode"])("label",null,[Object(r["createElementVNode"])("input",{type:"checkbox",checked:Object(r["unref"])(i),onClick:t[0]||(t[0]=function(e){return Object(r["isRef"])(i)?i.value=!Object(r["unref"])(i):i=!Object(r["unref"])(i)})},null,8,pt),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.START_ELEVATION_AT_ZERO")),1)])])])]})),_:1})])}}});n("73b0");const jt=S()(mt,[["__scopeId","data-v-7b25bb74"]]);var ft=jt,gt={id:"workout-note"},kt=Object(r["defineComponent"])({props:{notes:{default:function(){return null}}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.notes;return function(e,t){var n=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",gt,[Object(r["createVNode"])(n,null,{title:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.NOTES")),1)]})),content:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(Object(r["unref"])(o)&&""!==Object(r["unref"])(o)?Object(r["unref"])(o):e.$t("workouts.NO_NOTES")),1)]})),_:1})])}}});n("c4b5");const yt=S()(kt,[["__scopeId","data-v-028ad527"]]);var vt=yt,ht={id:"workout-segments"},Et=Object(r["defineComponent"])({props:{segments:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.segments,c=n.useImperialUnits;return function(e,t){var n=Object(r["resolveComponent"])("router-link"),a=Object(r["resolveComponent"])("Distance"),l=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ht,[Object(r["createVNode"])(l,null,{title:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.SEGMENT",2)),1)]})),content:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("ul",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(Object(r["unref"])(o),(function(t,o){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:t.segment_id},[Object(r["createVNode"])(n,{to:{name:"WorkoutSegment",params:{workoutId:t.workout_id,segmentId:o+1}}},{default:Object(r["withCtx"])((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"))+": ",1),Object(r["createVNode"])(a,{distance:t.distance,unitFrom:"km",useImperialUnits:Object(r["unref"])(c)},null,8,["distance","useImperialUnits"]),Object(r["createTextVNode"])(", "+Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+": "+Object(r["toDisplayString"])(t.duration)+") ",1)])})),128))])]})),_:1})])}}});n("dbf6");const Nt=S()(Et,[["__scopeId","data-v-6b8a27cd"]]);var wt=Nt,St=function(e){return Object(r["pushScopeId"])("data-v-d146d84a"),e=e(),Object(r["popScopeId"])(),e},Vt={id:"workout",class:"view"},Tt={class:"container"},Dt={key:0,class:"workout-container"},_t={key:0},It=St((function(){return Object(r["createElementVNode"])("div",{id:"bottom"},null,-1)})),xt={key:1},Ct=Object(r["defineComponent"])({props:{displaySegment:{type:Boolean}},setup:function(e){var t=e,n=Object(c["c"])(),l=Object(Ue["a"])(),i=Object(r["toRefs"])(t),u=i.displaySegment,s=Object(r["computed"])((function(){return l.getters[Re["f"].GETTERS.WORKOUT_DATA]})),d=Object(r["computed"])((function(){return l.getters[Re["a"].GETTERS.AUTH_USER_PROFILE]})),b=Object(r["computed"])((function(){return l.getters[Re["c"].GETTERS.SPORTS]})),O=Object(r["ref"])({latitude:null,longitude:null});function p(e){O.value={latitude:e.latitude,longitude:e.longitude}}return Object(r["onBeforeMount"])((function(){var e={workoutId:n.params.workoutId};t.displaySegment&&(e.segmentId=n.params.segmentId),l.dispatch(Re["f"].ACTIONS.GET_WORKOUT_DATA,e)})),Object(r["onUnmounted"])((function(){l.commit(Re["f"].MUTATIONS.EMPTY_WORKOUT)})),Object(r["watch"])((function(){return n.params.workoutId}),function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t&&l.dispatch(Re["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 n.params.segmentId}),function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:n.params.workoutId&&(o={workoutId:n.params.workoutId},t&&(o.segmentId=t),l.dispatch(Re["f"].ACTIONS.GET_WORKOUT_DATA,o));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Vt,[Object(r["createElementVNode"])("div",Tt,[Object(r["unref"])(b).length>0?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Dt,[Object(r["unref"])(s).workout.id?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",_t,[Object(r["createVNode"])(Ye,{workoutData:Object(r["unref"])(s),sports:Object(r["unref"])(b),authUser:Object(r["unref"])(d),markerCoordinates:Object(r["unref"])(O),displaySegment:Object(r["unref"])(u)},null,8,["workoutData","sports","authUser","markerCoordinates","displaySegment"]),Object(r["unref"])(s).workout.with_gpx&&Object(r["unref"])(s).chartData.length>0?(Object(r["openBlock"])(),Object(r["createBlock"])(ft,{key:0,workoutData:Object(r["unref"])(s),authUser:Object(r["unref"])(d),displaySegment:Object(r["unref"])(u),onGetCoordinates:p},null,8,["workoutData","authUser","displaySegment"])):Object(r["createCommentVNode"])("",!0),!Object(r["unref"])(u)&&Object(r["unref"])(s).workout.segments.length>1?(Object(r["openBlock"])(),Object(r["createBlock"])(wt,{key:1,segments:Object(r["unref"])(s).workout.segments,useImperialUnits:Object(r["unref"])(d).imperial_units},null,8,["segments","useImperialUnits"])):Object(r["createCommentVNode"])("",!0),Object(r["unref"])(u)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(vt,{key:2,notes:Object(r["unref"])(s).workout.notes},null,8,["notes"])),It])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",xt,[Object(r["unref"])(s).loading?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(a["a"],{key:0,target:"WORKOUT"}))]))])):Object(r["createCommentVNode"])("",!0)])])}}});n("2146");const At=S()(Ct,[["__scopeId","data-v-d146d84a"]]);t["default"]=At},"30e0":function(e,t,n){},3450:function(e,t,n){},"4c68":function(e,t,n){},5022:function(e,t,n){"use strict";n("83e8")},"57cc":function(e,t,n){},"58a2":function(e,t,n){"use strict";n("1c8d")},"5afd":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return T})),n.d(t,"b",(function(){return x})),n.d(t,"c",(function(){return B})),n.d(t,"d",(function(){return P}));var o=n("7a23");const r=(e,t)=>{let n;return function(...o){const r=this;n&&clearTimeout(n),n=setTimeout(()=>{e.apply(r,o),n=null},t)}},c=e=>e&&"function"===typeof e.charAt?e.charAt(0).toUpperCase()+e.slice(1):e,a=(e,t,n)=>{for(const r in n){const a="set"+c(r);e[a]?Object(o["watch"])(()=>n[r],(t,n)=>{e[a](t,n)}):t[a]&&Object(o["watch"])(()=>n[r],e=>{t[a](e)})}},l=e=>{const t={};for(const n in e)if(n.startsWith("on")&&!n.startsWith("onUpdate")&&"onReady"!==n){const o=n.slice(2).toLocaleLowerCase();t[o]=e[n]}return t},i=async e=>{const t=await Promise.all([n.e("chunk-2d0c9189").then(n.t.bind(null,"584d",7)),n.e("chunk-2d0cf391").then(n.t.bind(null,"6397",7)),n.e("chunk-2d22523a").then(n.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(o["ref"])(()=>console.warn(`Method ${e} has been invoked without being replaced`)),n=(...e)=>t.value(...e);return n.wrapped=t,Object(o["provide"])(e,n),n},s=(e,t)=>e.wrapped.value=t,d="object"===typeof self&&self.self===self&&self||"object"===typeof e&&e.global===e&&e||void 0,b="useGlobalLeaflet",O={options:{type:Object,default:()=>({})}},p=e=>({options:e.options,methods:{}}),m={...O,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,n)=>{const r=Object(o["inject"])("addLayer"),c=Object(o["inject"])("removeLayer"),{options:a,methods:l}=p(e),i={...a,attribution:e.attribution,pane:e.pane},u=()=>r({leafletObject:t.value}),s=()=>c({leafletObject:t.value}),d={...l,setAttribution(e,t){const n=this.$parent.leafletObject.attributionControl;n.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){n.emit("update:visible",e)}};return Object(o["provide"])("bindPopup",d.bindPopup),Object(o["provide"])("bindTooltip",d.bindTooltip),Object(o["provide"])("unbindTooltip",d.unbindTooltip),Object(o["provide"])("unbindPopup",d.unbindPopup),Object(o["onUnmounted"])(()=>{d.unbindPopup(),d.unbindTooltip(),s()}),{options:i,methods:d}},f=(e,t)=>{if(e&&t.default)return Object(o["h"])("div",{style:{display:"none"}},t.default())},g={...O,interactive:{type:Boolean,default:!0},bubblingMouseEvents:{type:Boolean,default:!0}},k={...m,...g,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={...k,latLng:{type:[Object,Array],custom:!0,default:null},radius:{type:Number,default:null}};const v={...O,position:{type:String,default:"topright"}},h=(e,t)=>{const{options:n,methods:r}=p(e),c={...n,position:e.position},a={...r,setPosition(e){t.value&&t.value.setPosition(e)}};return Object(o["onUnmounted"])(()=>{t.value&&t.value.remove()}),{options:c,methods:a}},E=e=>e.default?Object(o["h"])("div",{ref:"root"},e.default()):null;Boolean,Boolean;Boolean,Boolean,Boolean,Boolean;Boolean,Boolean,Boolean;const N={...m},w=(e,t,n)=>{const{options:r,methods:c}=j(e,t,n),a={...r},l={...c,addLayer(e){t.value.addLayer(e.leafletObject)},removeLayer(e){t.value.removeLayer(e.leafletObject)}};return Object(o["provide"])("addLayer",l.addLayer),Object(o["provide"])("removeLayer",l.removeLayer),{options:a,methods:l}};const S={...N,geojson:{type:[Object,Array],default:()=>({})}},V=(e,t)=>{const{options:n,methods:o}=w(e,t),r={...n,...e},c={...o,setGeojson(e){t.value.clearLayers(),t.value.addData(e)},getGeoJSONData(){return t.value.toGeoJSON()},getBounds(){return t.value.getBounds()}};return{options:r,methods:c}};var T={props:S,setup(e,t){const r=Object(o["ref"])({}),c=Object(o["ref"])(!1),i=Object(o["inject"])(b),u=Object(o["inject"])("addLayer"),{methods:s,options:O}=V(e,r);return Object(o["onMounted"])(async()=>{const{geoJSON:b,DomEvent:p}=i?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));r.value=b(e.geojson,O);const m=l(t.attrs);p.on(r.value,m),a(s,r.value,e),u({...e,...s,leafletObject:r.value}),c.value=!0,Object(o["nextTick"])(()=>t.emit("ready",r.value))}),{ready:c,leafletObject:r}},render(){return f(this.ready,this.$slots)},__file:"src/components/LGeoJson.vue"};const D={...m,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,n)=>{const{options:o,methods:r}=j(e,t,n),c={...o,pane:e.pane,opacity:e.opacity,zIndex:e.zIndex,tileSize:e.tileSize,noWrap:e.noWrap,minZoom:e.minZoom,maxZoom:e.maxZoom};return{options:c,methods:{...r}}};const I={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:{...O,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 c=Object(o["ref"])(null),O=Object(o["reactive"])({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:m}=p(e),j={...m,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"),g=u("removeLayer"),k=u("registerControl"),y=u("registerLayerControl");Object(o["provide"])(b,e.useGlobalLeaflet);const v={moveEndHandler(){t.emit("update:zoom",O.leafletRef.getZoom()),t.emit("update:center",O.leafletRef.getCenter()),t.emit("update:bounds",O.leafletRef.getBounds())},overlayAddHandler(e){const t=O.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!0)},overlayRemoveHandler(e){const t=O.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!1)}};Object(o["onMounted"])(async()=>{e.useGlobalLeaflet&&(d.L=d.L||await n.e("chunk-2d2248b6").then(n.t.bind(null,"e11e",7)));const{map:u,CRS:b,Icon:p,latLngBounds:m,latLng:h,DomEvent:E}=e.useGlobalLeaflet?d.L:await n.e("chunk-2d0da8f3").then(n.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(p);const N="string"==typeof j.crs?b[j.crs]:j.crs;j.crs=N||b.EPSG3857;const w={addLayer(e){if(void 0!==e.layerType)if(void 0===O.layerControl)O.layersToAdd.push(e);else{const t=O.layersInControl.find(t=>t.leafletObject._leaflet_id===e.leafletObject._leaflet_id);t||(O.layerControl.addLayer(e),O.layersInControl.push(e))}!1!==e.visible&&O.leafletRef.addLayer(e.leafletObject)},removeLayer(e){void 0!==e.layerType&&(void 0===O.layerControl?O.layersToAdd=O.layersToAdd.filter(t=>t.name!==e.name):(O.layerControl.removeLayer(e.leafletObject),O.layersInControl=O.layersInControl.filter(t=>t.leafletObject._leaflet_id!==e.leafletObject._leaflet_id))),O.leafletRef.removeLayer(e.leafletObject)},registerLayerControl(e){O.layerControl=e,O.layersToAdd.forEach(e=>{O.layerControl.addLayer(e)}),O.layersToAdd=[],k(e)},registerControl(e){O.leafletRef.addControl(e.leafletObject)},setZoom(t){const n=O.leafletRef.getZoom();t!==n&&O.leafletRef.setZoom(t,{animate:!e.noBlockingAnimations&&null})},setPaddingBottomRight(e){O.paddingBottomRight=e},setPaddingTopLeft(e){O.paddingTopLeft=e},setPadding(e){O.padding=e},setCrs(e){const t=O.leafletRef.getBounds();O.leafletRef.options.crs=e,O.leafletRef.fitBounds(t,{animate:!1,padding:[0,0]})},fitBounds(e){O.leafletRef.fitBounds(e,{animate:!this.noBlockingAnimations&&null})},setBounds(e){if(!e)return;const t=m(e);if(!t.isValid())return;const n=O.lastSetBounds||O.leafletRef.getBounds(),o=!n.equals(t,0);o&&(O.lastSetBounds=t,O.leafletRef.fitBounds(t,this.fitBoundsOptions))},setCenter(e){if(null==e)return;const t=h(e),n=O.lastSetCenter||O.leafletRef.getCenter();n.lat===t.lat&&n.lng===t.lng||(O.lastSetCenter=t,O.leafletRef.panTo(t,{animate:!this.noBlockingAnimations&&null}))}};s(f,w.addLayer),s(g,w.removeLayer),s(k,w.registerControl),s(y,w.registerLayerControl),O.leafletRef=u(c.value,j),a(w,O.leafletRef,e);const S=l(t.attrs);O.leafletRef.on("moveend",r(v.moveEndHandler,100)),O.leafletRef.on("overlayadd",v.overlayAddHandler),O.leafletRef.on("overlayremove",v.overlayRemoveHandler),E.on(O.leafletRef,S),O.ready=!0,Object(o["nextTick"])(()=>t.emit("ready",O.leafletRef))}),Object(o["onBeforeUnmount"])(()=>{O.leafletRef&&O.leafletRef.remove()});const h=Object(o["computed"])(()=>O.leafletRef),E=Object(o["computed"])(()=>O.ready);return{root:c,ready:E,leafletObject:h}},render(){return Object(o["h"])("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready?this.$slots.default():{})},__file:"src/components/LMap.vue"};const C={...m,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,n)=>{const{options:o,methods:r}=j(e,t,n),c={...o,...e},a={...r,setDraggable(e){t.value.dragging&&(e?t.value.dragging.enable():t.value.dragging.disable())},latLngSync(e){n.emit("update:latLng",e.latlng),n.emit("update:lat-lng",e.latlng)},setLatLng(e){if(null!=e&&t.value){const n=t.value.getLatLng();n&&n.equals(e)||t.value.setLatLng(e)}}};return{options:c,methods:a}};var B={name:"LMarker",props:C,setup(e,t){const c=Object(o["ref"])({}),i=Object(o["ref"])(!1),u=Object(o["inject"])(b),s=Object(o["inject"])("addLayer");Object(o["provide"])("canSetParentHtml",()=>!!c.value.getElement()),Object(o["provide"])("setParentHtml",e=>c.value.getElement().innerHTML=e),Object(o["provide"])("setIcon",e=>c.value.setIcon&&c.value.setIcon(e));const{options:O,methods:p}=A(e,c,t);return void 0===O.icon&&delete O.icon,Object(o["onMounted"])(async()=>{const{marker:b,DomEvent:m}=u?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));c.value=b(e.latLng,O);const j=l(t.attrs);m.on(c.value,j),c.value.on("move",r(p.latLngSync,100)),a(p,c.value,e),s({...e,...p,leafletObject:c.value}),i.value=!0,Object(o["nextTick"])(()=>t.emit("ready",c.value))}),{ready:i,leafletObject:c}},render(){return f(this.ready,this.$slots)},__file:"src/components/LMarker.vue"};const R={...k,latLngs:{type:Array,default:()=>[]},smoothFactor:{type:Number,custom:!0,default:1},noClip:{type:Boolean,custom:!0,default:!1}},U={...R};const L={...O,content:{type:String,default:null}};const $={...D,tms:{type:Boolean,default:!1},subdomains:{type:String,default:"abc"},detectRetina:{type:Boolean,default:!1},url:{type:String,default:null}},M=(e,t)=>{const{options:n,methods:o}=_(e,t),r={...n,tms:e.tms,subdomains:e.subdomains,detectRetina:e.detectRetina};return{options:r,methods:{...o}}};var P={props:$,setup(e,t){const r=Object(o["ref"])({}),c=Object(o["inject"])(b),i=Object(o["inject"])("addLayer"),{options:u,methods:s}=M(e,r);return Object(o["onMounted"])(async()=>{const{tileLayer:b,DomEvent:O}=c?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));r.value=b(e.url,u);const p=l(t.attrs);O.on(r.value,p),a(s,r.value,e),i({...e,...s,leafletObject:r.value}),Object(o["nextTick"])(()=>t.emit("ready",r.value))}),{leafletObject:r}},render(){return null},__file:"src/components/LTileLayer.vue"};Boolean,Boolean}).call(this,n("c8ba"))},"5c76":function(e,t,n){"use strict";var o=n("1da1"),r=(n("96cf"),n("ac1f"),n("1276"),n("b680"),n("99af"),n("7a23")),c=n("47e2"),a=n("6c02"),l=n("dad5"),i=n("2906"),u=n("5e65"),s=n("c364"),d=n("1119"),b=n("6284"),O={id:"workout-form"},p=["onSubmit"],m={class:"form-items"},j={key:0,class:"form-item-radio"},f=["checked","disabled"],g={for:"withGpx"},k=["checked","disabled"],y={for:"withoutGpx"},v={class:"form-item"},h=["disabled"],E=["value"],N={key:1,class:"form-item"},w={for:"gpxFile"},S=["disabled"],V={class:"files-help info-box"},T={key:2,class:"form-item"},D={for:"title"},_=["required","disabled"],I={key:3},x={class:"workout-date-duration"},C={class:"form-item"},A={class:"workout-date-time"},B=["disabled"],R=["disabled"],U={class:"form-item"},L=["disabled"],$=Object(r["createTextVNode"])(" : "),M=["disabled"],P=Object(r["createTextVNode"])(" : "),F=["disabled"],G={class:"form-item"},W=["disabled"],z={class:"form-item"},H={key:1},q={key:2,class:"form-buttons"},K=["disabled"],Z=["onClick"],X=Object(r["defineComponent"])({props:{authUser:null,sports:null,isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},workout:{default:function(){return{}}}},setup:function(e){var t=e,n=Object(c["b"])(),X=n.t,Y=Object(i["a"])(),J=Object(a["d"])(),Q=Object(r["toRefs"])(t),ee=Q.authUser,te=Q.workout,ne=Q.isCreation,oe=Q.loading,re=Object(r["computed"])((function(){return Object(d["e"])(t.sports,X,!0,te.value.id?[te.value.sport_id]:null)})),ce=Object(r["computed"])((function(){return Y.getters[l["b"].GETTERS.APP_CONFIG]})),ae=ce.value.max_single_file_size?Object(s["b"])(ce.value.max_single_file_size):"",le=ce.value.gpx_limit_import,ie=ce.value.max_zip_file_size?Object(s["b"])(ce.value.max_zip_file_size):"",ue=Object(r["computed"])((function(){return Y.getters[l["b"].GETTERS.ERROR_MESSAGES]})),se=Object(r["reactive"])({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:""}),de=Object(r["ref"])(t.workout.id?t.workout.with_gpx:t.isCreation),be=null,Oe=Object(r["ref"])(!1);function pe(e){se.notes=e}function me(){de.value=!de.value,Oe.value=!1}function je(e){e.target.files&&(be=e.target.files[0])}function fe(e){if(se.sport_id="".concat(e.sport_id),se.title=e.title,se.notes=e.notes,!e.with_gpx){var n=Object(u["a"])(Object(u["c"])(e.workout_date,t.authUser.timezone),"yyyy-MM-dd"),o=e.duration.split(":");se.workoutDistance="".concat(ee.value.imperial_units?Object(b["a"])(e.distance,"km","mi",2):parseFloat(e.distance.toFixed(2))),se.workoutDate=n.workout_date,se.workoutTime=n.workout_time,se.workoutDurationHour=o[0],se.workoutDurationMinutes=o[1],se.workoutDurationSeconds=o[2]}}function ge(e){e.title=se.title,e.distance=ee.value.imperial_units?Object(b["a"])(+se.workoutDistance,"mi","km",3):+se.workoutDistance,e.duration=3600*+se.workoutDurationHour+60*+se.workoutDurationMinutes+ +se.workoutDurationSeconds,e.workout_date="".concat(se.workoutDate," ").concat(se.workoutTime)}function ke(){var e={sport_id:+se.sport_id,notes:se.notes};if(t.workout.id)t.workout.with_gpx?e.title=se.title:ge(e),Y.dispatch(l["f"].ACTIONS.EDIT_WORKOUT,{workoutId:t.workout.id,data:e});else if(de.value){if(!be){var n="workouts.NO_FILE_PROVIDED";return void Y.commit(l["b"].MUTATIONS.SET_ERROR_MESSAGES,n)}e.file=be,Y.dispatch(l["f"].ACTIONS.ADD_WORKOUT,e)}else ge(e),Y.dispatch(l["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,e)}function ye(){t.workout.id?J.push({name:"Workout",params:{workoutId:t.workout.id}}):J.go(-1)}function ve(){Oe.value=!0}return Object(r["onMounted"])((function(){t.workout.id&&fe(t.workout)})),Object(r["onUnmounted"])((function(){return Y.commit(l["b"].MUTATIONS.EMPTY_ERROR_MESSAGES)})),Object(r["watch"])((function(){return t.workout}),function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t!==n&&t&&t.id&&fe(t);case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),function(e,t){var n=Object(r["resolveComponent"])("CustomTextArea"),o=Object(r["resolveComponent"])("ErrorMessage"),c=Object(r["resolveComponent"])("Loader"),a=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{id:"workout-edition",class:Object(r["normalizeClass"])(["center-card center-card with-margin",{"center-form":Object(r["unref"])(te)&&Object(r["unref"])(te).with_gpx}])},[Object(r["createVNode"])(a,null,{title:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.".concat(Object(r["unref"])(ne)?"ADD":"EDIT","_WORKOUT"))),1)]})),content:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",O,[Object(r["createElementVNode"])("form",{class:Object(r["normalizeClass"])({errors:Oe.value}),onSubmit:Object(r["withModifiers"])(ke,["prevent"])},[Object(r["createElementVNode"])("div",m,[Object(r["unref"])(ne)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",j,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("input",{id:"withGpx",type:"radio",checked:Object(r["unref"])(de),disabled:Object(r["unref"])(oe),onClick:me},null,8,f),Object(r["createElementVNode"])("label",g,Object(r["toDisplayString"])(e.$t("workouts.WITH_GPX")),1)]),Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("input",{id:"withoutGpx",type:"radio",checked:!Object(r["unref"])(de),disabled:Object(r["unref"])(oe),onClick:me},null,8,k),Object(r["createElementVNode"])("label",y,Object(r["toDisplayString"])(e.$t("workouts.WITHOUT_GPX")),1)])])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",v,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1))+": ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("select",{id:"sport",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[0]||(t[0]=function(e){return Object(r["unref"])(se).sport_id=e})},[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(Object(r["unref"])(re),(function(e){return Object(r["openBlock"])(),Object(r["createElementBlock"])("option",{value:e.id,key:e.id},Object(r["toDisplayString"])(e.translatedLabel),9,E)})),128))],40,h),[[r["vModelSelect"],Object(r["unref"])(se).sport_id]])]),Object(r["unref"])(ne)&&Object(r["unref"])(de)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",N,[Object(r["createElementVNode"])("label",w,Object(r["toDisplayString"])(e.$t("workouts.GPX_FILE"))+" "+Object(r["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+": ",1),Object(r["createElementVNode"])("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:Object(r["unref"])(oe),required:"",onInvalid:ve,onInput:je},null,40,S),Object(r["createElementVNode"])("div",V,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.$t("workouts.GPX_FILE"))+":",1),Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(Object(r["unref"])(ae)),1)])]),Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE"))+":",1),Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.NO_FOLDER")),1),Object(r["createElementVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_FILES"))+": "+Object(r["toDisplayString"])(Object(r["unref"])(le)),1),Object(r["createElementVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(Object(r["unref"])(ie)),1)])])])])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",T,[Object(r["createElementVNode"])("label",D,Object(r["toDisplayString"])(e.$t("workouts.TITLE"))+": ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"title",name:"title",type:"text",required:!Object(r["unref"])(ne),onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[1]||(t[1]=function(e){return Object(r["unref"])(se).title=e})},null,40,_),[[r["vModelText"],Object(r["unref"])(se).title]])])),Object(r["unref"])(de)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",I,[Object(r["createElementVNode"])("div",x,[Object(r["createElementVNode"])("div",C,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.WORKOUT_DATE"))+":",1),Object(r["createElementVNode"])("div",A,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-date",name:"workout-date",type:"date",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[2]||(t[2]=function(e){return Object(r["unref"])(se).workoutDate=e})},null,40,B),[[r["vModelText"],Object(r["unref"])(se).workoutDate]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[3]||(t[3]=function(e){return Object(r["unref"])(se).workoutTime=e})},null,40,R),[[r["vModelText"],Object(r["unref"])(se).workoutTime]])])]),Object(r["createElementVNode"])("div",U,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+":",1),Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-duration-hour",name:"workout-duration-hour",class:"workout-duration",type:"text",placeholder:"HH",pattern:"^([0-1]?[0-9]|2[0-3])$",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[4]||(t[4]=function(e){return Object(r["unref"])(se).workoutDurationHour=e})},null,40,L),[[r["vModelText"],Object(r["unref"])(se).workoutDurationHour]]),$,Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-duration-minutes",name:"workout-duration-minutes",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",placeholder:"MM",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[5]||(t[5]=function(e){return Object(r["unref"])(se).workoutDurationMinutes=e})},null,40,M),[[r["vModelText"],Object(r["unref"])(se).workoutDurationMinutes]]),P,Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-duration-seconds",name:"workout-duration-seconds",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",placeholder:"SS",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[6]||(t[6]=function(e){return Object(r["unref"])(se).workoutDurationSeconds=e})},null,40,F),[[r["vModelText"],Object(r["unref"])(se).workoutDurationSeconds]])])])]),Object(r["createElementVNode"])("div",G,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+" ("+Object(r["toDisplayString"])(Object(r["unref"])(ee).imperial_units?"mi":"km")+"): ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{name:"workout-distance",type:"number",min:"0",step:"0.001",required:"",onInvalid:ve,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[7]||(t[7]=function(e){return Object(r["unref"])(se).workoutDistance=e})},null,40,W),[[r["vModelText"],Object(r["unref"])(se).workoutDistance]])])])),Object(r["createElementVNode"])("div",z,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.NOTES"))+": ",1),Object(r["createVNode"])(n,{name:"notes",input:Object(r["unref"])(se).notes,disabled:Object(r["unref"])(oe),onUpdateValue:pe},null,8,["input","disabled"])])]),Object(r["unref"])(ue)?(Object(r["openBlock"])(),Object(r["createBlock"])(o,{key:0,message:Object(r["unref"])(ue)},null,8,["message"])):Object(r["createCommentVNode"])("",!0),Object(r["unref"])(oe)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",H,[Object(r["createVNode"])(c)])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",q,[Object(r["createElementVNode"])("button",{class:"confirm",type:"submit",disabled:Object(r["unref"])(oe)},Object(r["toDisplayString"])(e.$t("buttons.SUBMIT")),9,K),Object(r["createElementVNode"])("button",{class:"cancel",onClick:Object(r["withModifiers"])(ye,["prevent"])},Object(r["toDisplayString"])(e.$t("buttons.CANCEL")),9,Z)]))],42,p)])]})),_:1})],2)}}}),Y=(n("fedc"),n("6b0d")),J=n.n(Y);const Q=J()(X,[["__scopeId","data-v-6d22c97d"]]);t["a"]=Q},"5f44":function(e,t,n){"use strict";n("0716")},"686a":function(e,t,n){"use strict";n("cab2")},"692d":function(e,t,n){"use strict";n.r(t);var o=n("7a23"),r=n("5c76"),c=n("dad5"),a=n("2906"),l={id:"add-workout",class:"view"},i={class:"container"},u=Object(o["defineComponent"])({setup:function(e){var t=Object(a["a"])(),n=Object(o["computed"])((function(){return t.getters[c["c"].GETTERS.SPORTS]})),u=Object(o["computed"])((function(){return t.getters[c["a"].GETTERS.AUTH_USER_PROFILE]})),s=Object(o["computed"])((function(){return t.getters[c["f"].GETTERS.WORKOUT_DATA]}));return function(e,t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",l,[Object(o["createElementVNode"])("div",i,[Object(o["createVNode"])(r["a"],{authUser:Object(o["unref"])(u),sports:Object(o["unref"])(n),isCreation:!0,loading:Object(o["unref"])(s).loading},null,8,["authUser","sports","loading"])])])}}});const s=u;t["default"]=s},"6dff":function(e,t,n){"use strict";n("87cc")},7156:function(e,t,n){var o=n("1626"),r=n("861d"),c=n("d2bb");e.exports=function(e,t,n){var a,l;return c&&o(a=t.constructor)&&a!==n&&r(l=a.prototype)&&l!==n.prototype&&c(e,l),e}},7240:function(e,t,n){},"73b0":function(e,t,n){"use strict";n("a0a8")},"83e8":function(e,t,n){},"87cc":function(e,t,n){},"8aa2":function(e,t,n){"use strict";n("17b6")},"8ee9":function(e,t,n){"use strict";n.r(t);var o=n("1da1"),r=(n("96cf"),n("7a23")),c=n("6c02"),a=n("5c76"),l=n("dad5"),i=n("2906"),u={id:"edit-workout",class:"view"},s={class:"container"},d=Object(r["defineComponent"])({setup:function(e){var t=Object(c["c"])(),n=Object(i["a"])(),d=Object(r["computed"])((function(){return n.getters[l["a"].GETTERS.AUTH_USER_PROFILE]})),b=Object(r["computed"])((function(){return n.getters[l["c"].GETTERS.SPORTS]})),O=Object(r["computed"])((function(){return n.getters[l["f"].GETTERS.WORKOUT_DATA]}));return Object(r["onBeforeMount"])((function(){n.dispatch(l["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:t.params.workoutId})})),Object(r["watch"])((function(){return t.params.workoutId}),function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t||n.commit(l["f"].MUTATIONS.EMPTY_WORKOUT);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",u,[Object(r["createElementVNode"])("div",s,[Object(r["createVNode"])(a["a"],{authUser:Object(r["unref"])(d),sports:Object(r["unref"])(b),workout:Object(r["unref"])(O).workout,loading:Object(r["unref"])(O).loading},null,8,["authUser","sports","workout","loading"])])])}}});const b=d;t["default"]=b},a0a8:function(e,t,n){},a497:function(e,t,n){"use strict";n("30e0")},a4ee:function(e,t,n){},a9e3:function(e,t,n){"use strict";var o=n("83ab"),r=n("da84"),c=n("e330"),a=n("94ca"),l=n("6eeb"),i=n("1a2d"),u=n("7156"),s=n("3a9b"),d=n("d9b5"),b=n("c04e"),O=n("d039"),p=n("241c").f,m=n("06cf").f,j=n("9bf2").f,f=n("408a"),g=n("58a8").trim,k="Number",y=r[k],v=y.prototype,h=r.TypeError,E=c("".slice),N=c("".charCodeAt),w=function(e){var t=b(e,"number");return"bigint"==typeof t?t:S(t)},S=function(e){var t,n,o,r,c,a,l,i,u=b(e,"number");if(d(u))throw h("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=g(u),t=N(u,0),43===t||45===t){if(n=N(u,2),88===n||120===n)return NaN}else if(48===t){switch(N(u,1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+u}for(c=E(u,2),a=c.length,l=0;lr)return NaN;return parseInt(c,o)}return+u};if(a(k,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var V,T=function(e){var t=arguments.length<1?0:y(w(e)),n=this;return s(v,n)&&O((function(){f(n)}))?u(Object(t),n,T):t},D=o?p(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),_=0;D.length>_;_++)i(y,V=D[_])&&!i(T,V)&&j(T,V,m(y,V));T.prototype=v,v.constructor=T,l(r,k,T)}},b1c7:function(e,t,n){"use strict";n("57cc")},b3d2:function(e,t,n){},b86c:function(e,t,n){"use strict";n("7240")},c4b5:function(e,t,n){"use strict";n("3450")},cab2:function(e,t,n){},dbf6:function(e,t,n){"use strict";n("a4ee")},e94f:function(e,t,n){!function(e,n){n(t)}(0,(function(e){"use strict";function t(e){return e&&e.normalize&&e.normalize(),e&&e.textContent||""}function n(e,t){const n=e.getElementsByTagName(t);return n.length?n[0]:null}function o(e){const o={};if(e){const r=n(e,"line");if(r){const e=t(n(r,"color")),c=parseFloat(t(n(r,"opacity"))),a=parseFloat(t(n(r,"width")));e&&(o.stroke=e),isNaN(c)||(o["stroke-opacity"]=c),isNaN(a)||(o["stroke-width"]=96*a/25.4)}}return o}function r(e,o){const r={};let c,a;for(a=0;a1,s=Object.assign(c(e),o(n(e,"extensions")),{_gpxType:"trk"},a.length?{coordinateProperties:{times:u?a:a[0]}}:{});for(let n=0;nnew Array(e.line.length).fill(null))),e[t][n]=o):e[t]=o}}return{type:"Feature",properties:s,geometry:u?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function*s(e){const t=e.getElementsByTagName("trk"),n=e.getElementsByTagName("rte"),o=e.getElementsByTagName("wpt");for(let r=0;rArray(e.length).fill(null))),u[n][t]=e[n])}if(0!==r.length)return(c.length||a.length)&&(u.coordinateProperties=Object.assign(c.length?{times:1===r.length?c[0]:c}:{},a.length?{heart:1===r.length?a[0]:a}:{})),{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 o=0;o