1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8702,8677],{18677:function(t,i,e){"use strict";e.r(i),e.d(i,{default:function(){return p}});var a=e(25237),n=e(2784),o=e(33831),r=e(20110),c=e(52755),s=e(54741),l=e(9716),u=e(26772),d=e(52259),v=e(16724),y=function(){return{marginTop:u.cv.a20,".title":{fontSize:(0,d.hO)(v.JB.a14),fontWeight:600,textAlign:"left",margin:"".concat(u.cv.a12,"px 0")},".subtitle":{fontSize:(0,d.hO)(v.JB.a12),textAlign:"right"}}},f=e(28165),m=function(t){var i=t.totalAscent,e=(0,s.y)(y),a=(0,o.$)(),r=(0,l.u)().getElevation,c=(0,n.useMemo)((function(){return a("elevation.elevationChart")}),[]),u=(0,n.useMemo)((function(){return"".concat(a("elevation.elevationAscent"),": ").concat(r(i))}),[i,r]),d=(0,n.useMemo)((function(){return a("elevation.ariaLabel.elevationAscent",{total:r(i)})}),[u]);return(0,f.jsx)("div",{css:e,"aria-label":d},(0,f.jsx)("h2",{className:"title"},c),(0,f.jsx)("p",{className:"subtitle"},u))},b=(0,a.default)((function(){return Promise.all([e.e(164),e.e(6300)]).then(e.bind(e,96300))}),{ssr:!1,loadableGenerated:{webpack:function(){return[96300]},modules:["../components/route-elevation/route-elevation.tsx -> ./components/route-elevation-chart/route-elevation-chart"]}}),p=function(t){var i=t.routeElevation,e=t.isLoading,a=t.hasError,s=t.areKeyWaypointsVisible,l=t.hasDrawnWaypointsError,u=t.keyWaypoints,d=(0,o.$)(),v=i.elevationData,y=i.highest,p=i.lowest,h=i.totalAscent,g=(0,n.useMemo)((function(){return e?r.I.loading:a||l?r.I.failure:v.length?r.I.success:r.I.failure}),[e,a,l,v]),x=(0,n.useMemo)((function(){return d("elevation.ariaLabel.failure")}),[d]),E=(0,n.useMemo)((function(){return d("elevation.ariaLabel.noResults")}),[d]);return(0,f.jsx)(n.Fragment,null,(0,f.jsx)(m,{totalAscent:h}),(0,f.jsx)(c.u,{status:g,failureMessage:x,ariaLabelError:x,ariaLabelNoResults:E,isSmall:!0},(0,f.jsx)(b,{elevations:v,highest:y,lowest:p,keyWaypoints:u,areKeyWaypointsVisible:s})))}},95350:function(t,i,e){"use strict";e.r(i),e.d(i,{ConvertActivityPage:function(){return ot},__N_SSP:function(){return nt},default:function(){return rt}});var a,n=e(2784),o=e(49796),r=e(68685),c=e(34166),s=e(87412),l=e(37711),u=e(18677),d=e(3586),v=e(33864),y=e(76712),f=e(90095),m=e(33831),b=e(58839),p=e(89017),h=e(23932),g=e(65496),x=e(59827),E=e(18744),A=e(95541),S=e(55551),j=e(64165),C=e(31865),T=e(54741),_=e(10433),I=e(98419);!function(t){t.activity="activity",t.name="name",t.description="description",t.visibility="visibility",t.difficulty="difficulty"}(a||(a={}));var M,L=e(79108),w=e(55837),D=e(69783),V=e(34236),k=e(59635),R=e(26772),B=function(){return{display:"flex",margin:"".concat(R.cv.a15,"px 0"),justifyContent:"space-between",gap:R.cv.a20}},N=e(28165),W=(0,V.S)(),X=function(t){var i=t.isSaving,e=t.isSaveButtonDisabled,a=t.submitForm,o=(0,m.$)(),r=(0,T.y)(B),c=(0,w.v9)(W),s=(0,n.useState)(void 0),l=s[0],u=s[1],d=(0,D.O)().goToPreviousCard,y=(0,n.useMemo)((function(){return!!c.length}),[c]),f=(0,n.useMemo)((function(){return o("createRouteCard.ariaLabel.footer.cancel")}),[o]),b=(0,n.useMemo)((function(){return o(y?i?"createRouteCard.ariaLabel.footer.saveDisabledLoading":"createRouteCard.ariaLabel.footer.save":"createRouteCard.ariaLabel.footer.saveDisabledNoWaypoints")}),[o,y,i]),p=(0,n.useCallback)((function(){d()}),[y]);return(0,n.useEffect)((function(){u(document.getElementById(v.L0))}),[]),(0,N.jsx)(L.Z,{node:document&&l},(0,N.jsx)("div",{css:r},(0,N.jsx)(k.z,{text:o("button.cancel"),onClick:p,secondary:!0,"aria-label":f}),(0,N.jsx)(k.z,{text:o("button.save"),onClick:a,type:"submit",disabled:e,isLoading:i,"aria-label":b})))},K=e(33253),G=function(t){return{marginTop:R.cv.a12,".characteristics":{marginBottom:R.cv.a30,marginTop:R.cv.a20},".convert-activity":{"&__visibility":{marginTop:R.cv.a10,marginBottom:R.cv.a30},"&__technical-difficulty":{marginTop:R.cv.a30,paddingBottom:R.cv.a10}},hr:(0,K.mq)({marginTop:R.cv.a30,marginLeft:[-R.cv.a20,-R.cv.a20,-R.cv.a20,-R.cv.a30],marginRight:[-R.cv.a20,-R.cv.a20,-R.cv.a20,-R.cv.a30],marginBottom:0,color:t.grey.a200,border:"none",borderBottomWidth:1,borderBottomStyle:"solid"})}},P=function(t){var i,e=t.isValid,o=t.submitForm,r=t.isSaving,c=t.activity,l=t.totalAscent,u=(0,m.$)(),d=(0,T.y)(G),v=(0,g.D)(),y=(0,n.useMemo)((function(){return[{value:
1I.EE.private,label:u("routeVisibility.private.label"),labelDesc:u("routeVisibility.private.description")},{value:I.EE.unlisted,label:u("routeVisibility.unlisted.label"),labelDesc:u("routeVisibility.unlisted.description")},{value:I.EE.public,label:u("routeVisibility.public.label"),labelDesc:u("routeVisibility.public.description")}]}),[u]);return(0,N.jsx)("div",{css:d},(0,N.jsx)(x.default,{name:a.activity,hideEmptyError:!0,isDisabled:r}),c&&(0,N.jsx)(C.k,{className:"characteristics",characteristics:null===c||void 0===c?void 0:c.characteristics,movingTime:null===c||void 0===c||null===(i=c.characteristics)||void 0===i?void 0:i.movingTime,totalAscent:l,hasDurationWithSeconds:!0,hideActivityType:!0}),(0,N.jsx)(E._,{name:a.name,label:u("convertActivityCard.form.name"),placeholder:"".concat(_.KX," ").concat(u("common.characters")),"aria-label":"".concat(u("convertActivityCard.form.name")," - ").concat(_.KX," ").concat(u("ariaLabel.characterLimit")),labeltype:s.J.light,characterslimit:_.KX,disabled:r,required:!0}),(0,N.jsx)(j.E,{name:a.description,label:u("convertActivityCard.form.notes"),placeholder:"".concat(_.SM," ").concat(u("common.characters")),"aria-label":"".concat(u("convertActivityCard.form.notes")," - ").concat(_.SM," ").concat(u("ariaLabel.characterLimit")," - ").concat(u("ariaLabel.editText")),labeltype:s.J.light,disabled:r,characterslimit:_.SM}),(0,N.jsx)(A.h,{data:y,name:a.visibility,hideEmptyError:!0,labelTag:s.V.h2,className:"convert-activity__visibility",disabled:r}),(0,N.jsx)("hr",null),(0,N.jsx)(S.B,{name:a.difficulty,difficultiesProps:v,hideEmptyError:!0,labelTag:s.V.h2,className:"convert-activity__technical-difficulty",isDisabled:r}),(0,N.jsx)(X,{isSaving:r,isSaveButtonDisabled:!e,submitForm:o}))},z=e(77460),O=e(9699),$={activity:I.cS.OTHER,name:"",description:"",visibility:I.EE.private,difficulty:I.ER.unknown},F=(0,O.Ry)().shape((M={},(0,z.Z)(M,a.name,_.sA),(0,z.Z)(M,a.description,_.p2),M)),J=e(27812),Z=e(20),q=e(90705),H=e(20114),U=e(47009),Q=e(6054),Y=e(78229),tt=e(91942),it=e(7282),et=e(14718),at=function(t){var i,e,a,o,g,x,E=t.activityId,A=(0,m.$)(),S=(0,f.n)().goToActivitiesPage,j=(0,b.I)({activityId:E}),C=j.pageStatus,T=j.activity,_=j.activityGeometry,I=(0,n.useMemo)((function(){var t,i;return null===(t=T.data)||void 0===t||null===(i=t.characteristics)||void 0===i?void 0:i.routeId}),[T]),M=(0,p.e)({activityId:E,routeId:I,isManuallyAdded:!(null!==(i=T.data)&&void 0!==i&&i.hasGeometry)}),L=function(t){var i=t.activityGeometry,e=t.creationType,a=t.totalAscent,o=(0,m.$)(),r=(0,n.useState)(!1),c=r[0],s=r[1],l=(0,et.B)().subject,u=(0,f.n)().goToRouteDetails,d=(0,n.useCallback)((function(t){var n=t.activity,o=t.name,r=t.description,c=t.difficulty,s=t.visibility,l=(0,Y.xu)(i,e),u=(null===l||void 0===l?void 0:l.map((function(t,i){return{geometry:{coordinates:t,type:Q.e_},properties:{kind:Q.I9,positionInSegment:i},type:Q.D9}})))||[],d={geometry:{type:Q.Sd,coordinates:l},type:Q.D9,properties:{kind:Q.Ai}};return{activity:n,name:o,description:r,visibility:s,difficulty:c[0],elevationAscent:a,features:[d].concat((0,J.Z)(u))}}),[i,e,a]);return{onSubmit:(0,n.useCallback)((function(t){s(!0);var i=d(t);(0,tt.p)(i).pipe((0,H.R)(l),(0,U.K)((function(){return null===it.X||void 0===it.X||it.X.showError(o("convertActivityCard.error.convert")),Z.E})),(0,q.x)((function(){s(!1)}))).subscribe((function(t){null===it.X||void 0===it.X||it.X.showSuccess(o("convertActivityCard.success")),t.id&&u(t.id)}))}),[d]),isSaving:c}}({activityGeometry:null===_||void 0===_?void 0:_.data,creationType:null===(e=T.data)||void 0===e||null===(a=e.metadata)||void 0===a?void 0:a.creationType,totalAscent:null===M||void 0===M||null===(o=M.routeElevation)||void 0===o?void 0:o.totalAscent}),w=L.onSubmit,D=L.isSaving,V=function(t){return{initialValues:(0,n.useMemo)((function(){return t?{activity:t.characteristics.activity||$.activity,name:t.metadata.name||$.name,description:t.metadata.description||$.name,visibility:$.visibility,difficulty:[$.difficulty]}:void 0}),[t])}}(T.data).initialValues;return(0,n.useEffect)((function(){var t;!T.data||null!==(t=T.data)&&void 0!==t&&t.hasGeometry||S()}),[T]),(0,h.y)({activityGeometry:null===_||void 0===_?void 0:_.data,creationType:null===(g=T.data)||void 0===g||null===(x=g.metadata)||void 0===x?void 0:x.creationType}),(0,N.jsx)(d.Card,{title:A("convertActivityCard.title"),cardName:y.AW.CONVERT_ACTIVITY,tag:s.V.h1,footerId:v.L0,isArrowHidden:!0,isTitleCentered:!0},(0,N.jsx)(l.Q,{status:C,errorMessage:A("convertActivityCard.error.get")},(0,N.jsx)(c.J9,{initialValues:V,validationSchema:F,onSubmit:w,enableReinitialize:!0},(function(t){return(0,N.jsx)(P,(0,r.Z)({},t,{isSaving:D,activity:T.data,activityGeometry:_.data,totalAscent:M.routeElevation.totalAscent}))})),(0,N.jsx)(u.default,M)))},nt=!0,ot=function(t){var i=t.activityId;return(0,N.jsx)(at,{activityId:i})};ot.getLayout=o.n;var rt=ot},91942:function(t,i,e){"use strict";e.d(i,{p:function(){return l},f:function(){return u}});var a=e(83746),n=e(77984),o=e(47009),r=e(20784),c=e(46762),s=e(98419),l=function(t){var i=t.activity,e=t.description,a=t.difficulty,o=t.elevationAscent,l=t.features,u=t.name,d=t.visibility,v=t.sourceRouteId,y="".concat(c.BM),f={type:"FeatureCollection",metadata:{name:u,description:e,visibility:d,sourceRouteId:v},characteristics:{activity:i,difficulty:a,elevationAscent:o},features:l};
1return(0,r.M)().authorized.post(y,f).pipe((0,n.U)((function(t){return{data:new s.KW(t.data),headers:t.headers}})))},u=function(t){var i=t.patchDelta,e=t.routeId,l="".concat(c.BM,"/").concat(e);return(0,r.M)().authorized.patch(l,i).pipe((0,n.U)((function(t){return{data:new s.KW(t.data),headers:t.headers}})),(0,o.K)((function(t){return(0,a._)(t)})))}},8912:function(t,i,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/convert-activity/[activityId]",function(){return e(95350)}])}},function(t){t.O(0,[2516,9796,1865,2346,8974,749,9774,2888,179],(function(){return i=8912,t(t.s=i);var i}));var i=t.O();_N_E=i}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.