From fbc40385a0be0adcd53a3d8a121aeb00a764bdcb Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 20 Feb 2021 16:59:31 +0100 Subject: [PATCH] API & Client - max sizes and max number of files must be greater than 0 - #71 --- docs/api/configuration.html | 8 +- docs/searchindex.js | 2 +- fittrackee/application/app_config.py | 14 ++- fittrackee/application/utils.py | 29 ++++- fittrackee/dist/asset-manifest.json | 6 +- fittrackee/dist/index.html | 2 +- ...5c861a.chunk.js => main.4387b246.chunk.js} | 4 +- .../dist/static/js/main.4387b246.chunk.js.map | 1 + .../dist/static/js/main.7c5c861a.chunk.js.map | 1 - fittrackee/responses.py | 9 +- .../tests/application/test_app_config_api.py | 102 ++++++++++++++++++ fittrackee/tests/fixtures/fixtures_app.py | 16 ++- fittrackee_client/src/actions/application.js | 13 ++- fittrackee_client/src/actions/index.js | 7 +- .../src/components/Admin/AdminApplication.jsx | 6 +- .../src/locales/en/messages.json | 3 + .../src/locales/fr/messages.json | 3 + fittrackee_client/src/reducers/index.js | 3 + 18 files changed, 203 insertions(+), 26 deletions(-) rename fittrackee/dist/static/js/{main.7c5c861a.chunk.js => main.4387b246.chunk.js} (55%) create mode 100644 fittrackee/dist/static/js/main.4387b246.chunk.js.map delete mode 100644 fittrackee/dist/static/js/main.7c5c861a.chunk.js.map diff --git a/docs/api/configuration.html b/docs/api/configuration.html index 15c12d56..fbf88b14 100644 --- a/docs/api/configuration.html +++ b/docs/api/configuration.html @@ -196,11 +196,11 @@
Request JSON Object
Request Headers
diff --git a/docs/searchindex.js b/docs/searchindex.js index eda3f1ff..b81eb92e 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["api/auth","api/configuration","api/index","api/records","api/sports","api/stats","api/users","api/workouts","changelog","features","index","installation","troubleshooting/administrator","troubleshooting/index","troubleshooting/user"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["api/auth.rst","api/configuration.rst","api/index.rst","api/records.rst","api/sports.rst","api/stats.rst","api/users.rst","api/workouts.rst","changelog.md","features.rst","index.rst","installation.rst","troubleshooting/administrator.rst","troubleshooting/index.rst","troubleshooting/user.rst"],objects:{"":{"/api/auth/login":[0,0,1,"post--api-auth-login"],"/api/auth/logout":[0,1,1,"get--api-auth-logout"],"/api/auth/password/reset-request":[0,0,1,"post--api-auth-password-reset-request"],"/api/auth/password/update":[0,0,1,"post--api-auth-password-update"],"/api/auth/picture":[0,0,1,"post--api-auth-picture"],"/api/auth/profile":[0,1,1,"get--api-auth-profile"],"/api/auth/profile/edit":[0,0,1,"post--api-auth-profile-edit"],"/api/auth/register":[0,0,1,"post--api-auth-register"],"/api/config":[1,3,1,"patch--api-config"],"/api/ping":[1,1,1,"get--api-ping"],"/api/records":[3,1,1,"get--api-records"],"/api/sports":[4,1,1,"get--api-sports"],"/api/sports/(int:sport_id)":[4,3,1,"patch--api-sports-(int-sport_id)"],"/api/stats/(user_name)/by_sport":[5,1,1,"get--api-stats-(user_name)-by_sport"],"/api/stats/(user_name)/by_time":[5,1,1,"get--api-stats-(user_name)-by_time"],"/api/stats/all":[5,1,1,"get--api-stats-all"],"/api/users":[6,1,1,"get--api-users"],"/api/users/(user_name)":[6,3,1,"patch--api-users-(user_name)"],"/api/users/(user_name)/picture":[6,1,1,"get--api-users-(user_name)-picture"],"/api/workouts":[7,0,1,"post--api-workouts"],"/api/workouts/(string:workout_short_id)":[7,3,1,"patch--api-workouts-(string-workout_short_id)"],"/api/workouts/(string:workout_short_id)/chart_data":[7,1,1,"get--api-workouts-(string-workout_short_id)-chart_data"],"/api/workouts/(string:workout_short_id)/chart_data/segment/(int:segment_id)":[7,1,1,"get--api-workouts-(string-workout_short_id)-chart_data-segment-(int-segment_id)"],"/api/workouts/(string:workout_short_id)/gpx":[7,1,1,"get--api-workouts-(string-workout_short_id)-gpx"],"/api/workouts/(string:workout_short_id)/gpx/segment/(int:segment_id)":[7,1,1,"get--api-workouts-(string-workout_short_id)-gpx-segment-(int-segment_id)"],"/api/workouts/map/(map_id)":[7,1,1,"get--api-workouts-map-(map_id)"],"/api/workouts/no_gpx":[7,0,1,"post--api-workouts-no_gpx"],"APP_LOG \ud83c\udd95":[11,4,1,"envvar-APP_LOG"],"DATABASE_DISABLE_POOLING \ud83c\udd95":[11,4,1,"envvar-DATABASE_DISABLE_POOLING"],"MAP_ATTRIBUTION \ud83c\udd95":[11,4,1,"envvar-MAP_ATTRIBUTION"],"TILE_SERVER_URL \ud83c\udd95":[11,4,1,"envvar-TILE_SERVER_URL"],"UPLOAD_FOLDER \ud83c\udd95":[11,4,1,"envvar-UPLOAD_FOLDER"],APP_SECRET_KEY:[11,4,1,"-"],APP_SETTINGS:[11,4,1,"-"],APP_WORKERS:[11,4,1,"-"],DATABASE_URL:[11,4,1,"-"],EMAIL_URL:[11,4,1,"-"],FLASK_APP:[11,4,1,"-"],HOST:[11,4,1,"-"],PORT:[11,4,1,"-"],REACT_APP_ALLOW_REGISTRATION:[11,4,1,"-"],REACT_APP_API_URL:[11,4,1,"-"],REACT_APP_GPX_LIMIT_IMPORT:[11,4,1,"-"],REACT_APP_MAX_SINGLE_FILE_SIZE:[11,4,1,"-"],REACT_APP_MAX_ZIP_FILE_SIZE:[11,4,1,"-"],REACT_APP_THUNDERFOREST_API_KEY:[11,4,1,"-"],REDIS_URL:[11,4,1,"-"],SENDER_EMAIL:[11,4,1,"-"],UI_URL:[11,4,1,"-"],WEATHER_API_KEY:[11,4,1,"-"],WORKERS_PROCESSES:[11,4,1,"-"]},"/api/workouts/map_tile/(s)/(z)/(x)/(y)":{png:[7,1,1,"get--api-workouts-map_tile-(s)-(z)-(x)-(y).png"]}},objnames:{"0":["http","post","HTTP post"],"1":["http","get","HTTP get"],"2":["http","delete","HTTP delete"],"3":["http","patch","HTTP patch"],"4":["std","envvar","environment variable"]},objtypes:{"0":"http:post","1":"http:get","2":"http:delete","3":"http:patch","4":"std:envvar"},terms:{"0mb":[0,7],"100":[7,9],"1000":5,"1048576":1,"10485760":1,"10mb":11,"1232004":7,"12341":5,"1234538":7,"1267":5,"127":11,"1563529507772":7,"1mb":11,"200":[0,1,3,4,5,6,7],"201":[0,7],"2017":[5,7],"2018":[5,7,10],"2019":[0,3,5,6,7,10],"2020":10,"2021":10,"204":[0,6,7],"279":7,"280":7,"282":5,"2930":7,"2e1ee2c":8,"3000":[11,12],"301":11,"34614d5":8,"400":[0,1,4,7],"401":[0,1,3,4,5,6,7],"403":[0,1,4,5,6,7],"404":[0,4,5,6,7],"4109":7,"413":[0,7],"443":11,"465":11,"4c3fc34":8,"500":[0,1,4,6,7],"5000":11,"5078118":7,"5079733":7,"5432":11,"587":11,"613":5,"7380":7,"8025":11,"895":[0,6],"9960":5,"boolean":[1,6],"default":[5,6,7,8,11],"export":10,"float":7,"import":[8,11],"int":[4,7],"new":[9,11],"null":[0,6,7],"return":[3,7,11],"short":7,"static":11,"true":[0,1,4,6,11],"try":[0,6,7],For:11,NOT:[0,4,7],Not:[4,5,6,7],One:11,That:0,The:[8,9,11],There:11,Use:8,WITH:11,With:11,__main__:11,_blank:11,access:11,accord:10,account:[6,8],acit:7,activ:[4,8,9,10,11],adapt:11,add:[6,8,9,10],address:11,admin:[0,1,3,4,5,6,7,8,11],administr:[0,6,7,10,13],after:11,again:[0,1,3,4,5,6,7],all:[3,4,5,6,11],allow:[0,1,7,10,11],along:7,alpinequest:10,alreadi:0,also:[8,10],alwai:11,android:10,anoth:[6,11],anymor:8,apach:10,api:[0,1,3,4,5,6,7,8,9,10,11,12],apikei:11,app:10,app_log:11,app_secret_kei:11,app_set:11,app_work:11,applic:[0,1,3,4,5,6,7,8,9,10,11],arch:11,archiv:[1,8,9,11],archlinux:11,asc:6,ascent:7,attribut:11,auth:[0,1,3,4,5,6,7],auth_token:0,auth_user_id:[1,3,4,5,6,7],authent:[1,2,3,4,5,6,7,10],author:[0,1,3,4,5,6,7],avail:[3,9,10,11],ave_spe:7,ave_speed_from:7,ave_speed_to:7,averag:[3,7,8,9],axi:7,b862a77:8,background:8,backup:11,bad:[0,1,4,7],bearer:[0,1,3,4,5,6,7],becom:8,been:8,befor:[8,11],bike:[4,7,8,9],bin:11,bio:[0,6],biographi:0,birth:0,birth_dat:[0,6],bound:7,build:11,by_sport:5,by_tim:5,calcul:8,calendar:[8,9],can:[6,8,9,10,11],cannot:8,chang:[9,10,11],charact:[0,13],chart:[7,8,9,11],chart_data:7,check:[1,11,12],choos:8,client:[8,11,12],clone:11,code:[0,1,3,4,5,6,7],color:8,column:13,com:[0,6,11],complet:8,config:[1,11,12],configur:[2,10,11],confirm:0,contact:[0,6,7],contain:[8,11],content:[0,1,3,4,5,6,7],contributor:[1,11],coordin:11,copi:[1,11],copyright:[1,11],correctli:[8,12],creat:[0,7,8,9,11],create_app:11,created_at:[0,6],creation:[8,9],creation_d:7,credenti:[0,11],criteria:6,current:8,custom:[11,12],cycl:[4,8,9],dai:8,dark:11,darkski:[8,9],dashboard:[8,10],data:[0,1,3,4,5,6,7,8,10,11,13],databas:[8,11],database_disable_pool:11,database_url:11,date:[0,5,7,8,9],debian:11,defin:9,definit:8,delet:[0,6,7,8,9],depend:[8,11],deploy:10,desc:7,descent:7,describ:11,descript:11,detail:[6,8,10],develop:[10,11],differ:8,directli:11,directori:[8,11],disabl:[0,8,9,11],displai:[7,8,9,10,11],distanc:[3,7,8,9],distance_from:7,distance_to:7,distribut:11,docker:[8,10],document:[8,10,11],doe:[0,5,6,7,8],don:0,down:8,download:11,dramatiq:11,drop:8,durat:[3,7,8,9],duration_from:7,duration_to:7,dure:[0,7],easi:8,edit:[0,8,9],elev:[7,8,9,11],els:11,email:[0,6,8],email_url:11,empti:8,enabl:[1,9],encount:11,end:[5,7],endpoint:[1,2,8,13],english:9,enter:[8,9],entiti:[0,7],entri:11,env:11,environ:[8,10],environn:12,error:[0,1,4,6,7,8,11],europ:[0,6],evalu:[8,11],even:[8,9],exampl:[0,1,3,4,5,6,7,10,11,12],exce:[0,7],except:6,execstart:11,exist:[0,5,6,7,9,10,12],exodu:10,expir:[0,1,3,4,5,6,7],extens:[0,7],fa33f4d996844a5c73ecd1ae24456ab8:7,fals:[0,1,4,6,7,11],farest:[3,8,9],featur:[10,11],fetch:11,file:[0,1,7,8,9,10,11,12],filter:[8,9],first:[0,10],first_nam:[0,6],fitotrack:10,fittracke:[9,11],fittrackee_init_data:11,fittrackee_upgrade_db:11,fittrackee_work:11,fix:10,flask:11,flask_app:11,flaticon:11,follow:[3,9,11],forbidden:[0,1,4,5,6,7],forecast:11,form:[0,7],format:[0,5,7],former:11,forrunn:10,forward:11,found:[0,4,5,6,7],frame:5,freepik:11,french:[9,10],fri:7,from:[1,3,4,5,6,7,8,10],fullchain:11,gener:11,get:[0,1,3,4,5,6,7],gif:0,git:11,github:11,given:11,gmt:[0,3,6,7],gpl:10,gpx:[7,8,9,10,11],gpx_limit_import:1,gpxpy:11,grant:11,gunicorn:11,handl:0,has:6,has_workout:4,have:[1,4,5,6,7,8],header:[0,1,3,4,5,6,7],health:1,heavi:[10,11],hike:[4,8,9],his:[6,8,9],home:11,host:11,href:[1,11],http:[0,1,3,4,5,6,7,11,12],hvybqybra7wwxpastwr4v2:3,i18n:8,icon:11,imag:[0,6,7,8,11],img:4,improv:10,incorrect:8,index:7,info:0,inform:[8,10,11],init:11,initi:[11,12],initialis:11,insid:11,instal:[8,10],instanc:[1,11],integ:[1,3,4,5,6,7],integr:1,interceptor:8,interfac:11,intern:[0,1,4,6,7],introduc:8,invalid:[0,1,3,4,5,6,7,8],is_act:4,is_registration_en:1,issu:[10,11],jan:7,javascript:11,john_do:6,jpeg:6,jpg:0,json:[0,1,3,4,5,6,7,13],jul:[0,3,6,7],keep:[10,11],kei:[8,9,11],kjxavsturjvoah2wvcegef:7,label:4,languag:[0,6],larg:[0,7],last:[0,11],last_nam:[0,6],latitud:7,layer:[8,11],leaflet:[7,11],least:[7,11],librari:11,licens:10,limit:[8,9],line:13,link:11,linux:11,list:[8,10,11],listen:11,load:8,local:[8,10,11],localhost:[11,12],locat:[0,6,11],log:[0,1,3,4,5,6,7,10,11],logfil:11,login:0,logout:[0,8],longest:[3,8,9],longitud:7,made:[11,12],mai:[10,11],mailhog:11,major:8,make:11,makefil:[11,12],manag:8,mandatori:[7,8,11],map:[7,8,9,10],map_attribut:[1,11],map_id:7,map_til:7,match:0,max:[1,6,7],max_alt:7,max_single_file_s:1,max_spe:7,max_speed_from:7,max_speed_to:7,max_us:1,max_zip_file_s:1,maxim:7,maximum:[3,8,9,11],mean:12,messag:[0,1,7,8],method:11,min_alt:7,minim:7,minor:10,mobil:10,model:8,modifi:6,modification_d:7,modul:11,mon:7,mondai:[0,5,9],montain:[8,9],month:[5,8,9],more:[8,10,11],morn:7,mountain:4,mous:8,move:[7,8],mpwoadmin:11,multi:11,multipart:[0,7],must:[0,1,4,8,9,11],name:[0,5,6,11],nano:11,nb_sport:[0,6],nb_workout:[0,5,6],necessari:11,need:11,network:[11,12],next_workout:7,nginx:11,no_gpx:7,non:4,noopen:11,noreferr:11,note:[7,8,9,11],now:[8,9,11],number:[1,6,7,9,11],oauth:[0,1,3,4,5,6,7],object:[0,1,4,6,7],one:[6,7],onli:[6,7,8,9,11],open:[10,11],openstreetmap:[1,8,11],opentrack:10,option:11,order:[6,7,8],order_bi:6,org:[1,11],other:[6,11],out:0,outdoor:[8,10,11],over:8,own:[6,10],owner:[8,9],packag:[8,11],page:[6,7],pagin:[6,7],par_pag:6,paramet:[0,1,3,4,5,6,7,8,9,11],pari:[0,6],pars:[11,13],part:[0,7],pass:11,password:[0,8,9,11],password_conf:0,patch:[1,4,6,7],path:11,paus:[7,8],payload:[0,1,4,7],pem:11,per:[6,7,8],per_pag:[6,7],permiss:[1,4,5,6,7],pg_dump:11,pictur:[0,6,7,11],ping:1,pip:11,pipenv:8,pleas:[0,1,3,4,5,6,7,8],png:[0,4,7,11],poetri:[8,11],point:[8,11],pong:1,pool:11,port:11,possibl:[8,10],post:[0,7],postgr:11,postgresql:11,prefer:0,prerequisit:10,previous_workout:7,prior:11,privai:10,privileg:11,privkei:11,process:[0,11],productionconfig:11,profil:0,project:11,proprietari:10,provid:[0,1,3,4,5,6,7,8,9,11],proxi:11,proxy_add_x_forwarded_for:11,proxy_pass:11,proxy_redirect:11,proxy_set_head:11,pull:11,purpos:[8,11],pwd:11,pypi:10,python:[8,11],queri:[5,6,7],queue:11,react:11,react_app_allow_registr:11,react_app_api_url:[11,12],react_app_gpx_limit_import:11,react_app_max_single_file_s:11,react_app_max_zip_file_s:11,react_app_thunderforest_api_kei:11,read:8,real:11,rebuild:12,rechart:[7,11],recommend:11,record:[2,7,8,9,10],record_typ:[3,7],redi:[8,11],redis_url:11,redux:11,refactor:8,regist:[0,1,11],registr:[0,1,8,9],rel:11,relat:11,releas:[10,11],remote_addr:11,remov:9,renam:8,replac:[8,11],repo:11,report:10,repositori:11,request:[0,1,3,4,5,6,7,12],request_uri:11,requir:0,reset:[0,8,9],respons:[0,1,3,4,5,6,7],restart:11,restartsec:11,right:[6,9],rout:8,run:[4,8,9,11],runner:10,sam:[0,6],same:8,samr1:11,sat:6,save:9,schema:11,search:8,second:7,secret:11,see:[8,9,10,11,12],segment:[7,8,9],segment_id:7,select:[0,7],send:[8,11],sender:11,sender_email:11,serv:11,server:[0,1,4,6,7,8,10],server_nam:11,servic:11,set:9,sever:[10,11],shell:11,should:11,show:8,shown:8,side:8,signatur:[0,1,3,4,5,6,7],simpl:11,simplifi:8,sinc:11,singl:[1,6],size:[0,1,7,8,9,11],sky:11,smtp:11,some:[6,7,8,10,11],sorri:0,sort:[6,7],sourc:10,spawn:11,speed:[3,7,8,9,11],spinner:8,sport:[2,5,7,8,9,10,11],sport_id:[3,4,5,7],sports_list:[0,6],sql:11,sqlalchemi:11,ssl:11,ssl_certif:11,ssl_certificate_kei:11,standard:[8,11],standarderror:11,standardoutput:11,start:[0,5,7,9,11],startlimitintervalsec:11,starttl:11,stat:[5,8],staticmap:11,statist:[2,10],statu:[0,1,3,4,5,6,7],step:11,still:10,stop:11,store:[10,11],street:10,string:[0,4,5,6,7],subdomain:7,success:[0,1,3,4,5,6,7],successfulli:0,sun:[0,3,6,7],sundai:[5,7,9],support:[8,9],syslog:11,syslogidentifi:11,system:11,systemd:11,tab:12,tar:11,target:11,task:11,term:[8,11],test:11,than:8,thei:11,them:10,thi:[7,8,9,10,11],thunderforest:[8,11],tile:[7,8],tile_server_url:11,time:[0,5,7,8,9],timezon:[0,6,8],titl:7,tls:11,todo:14,token:[0,1,3,4,5,6,7],too:[0,7],tool:11,tooltip:8,total:8,total_dist:[0,5,6],total_dur:[0,5,6],track:10,tracker:10,transport:[4,8,9],troubleshoot:10,type:[0,1,3,4,5,6,7,11],ui_url:11,unauthor:[0,1,3,4,5,6,7],undefin:12,under:[10,11],unencrypt:11,unexpect:13,unit:11,unstabl:[10,11],updat:[0,1,4,6,7,8,9,11],upload:[8,9,11],upload_fold:11,uploads_dir_s:5,url:[8,11],use:11,used:[8,11],user:[0,1,2,3,4,5,7,8,9,10,11,13],user_nam:[5,6],usernam:[0,6,11],usernanm:0,using:[6,7,10,11],uuid:[7,8],valid:[0,1,3,4,5,6,7,11],valu:[3,7],variabl:[8,10,12],venv:11,version:[10,11],view:8,virtualenv:11,wai:11,walk:[4,8,9],wantedbi:11,warn:8,weather:[8,9,11],weather_api:11,weather_api_kei:11,weather_end:7,weather_start:7,web:[0,1,3,4,5,6,7,10,11],week:[0,5,8,9],weekend:8,weekm:[0,5],were:8,wget:11,when:[8,11],where:11,which:9,with_gpx:7,without:[5,6,7,8,9,10],worker:11,workers_process:11,workingdirectori:11,workout:[2,5,8,10],workout_d:[3,7],workout_id:[3,7],workout_short_id:7,workouts_count:6,written:11,www:[1,11],xxxx:11,xzf:11,yai:11,yarn:11,year:5,yet:10,you:[1,4,5,6,7,10],your:[6,10,11],zip:[1,7,8,9,11],zone:0,zoom:7},titles:["Authentication","Configuration","API documentation","Records","Sports","Statistics","Users","Workouts","Change log","Features","FitTrackee","Installation","Administrator","Troubleshooting","User"],titleterms:{"2018":8,"2019":8,"2020":8,"2021":8,"new":8,account:9,administr:[8,9,12],api:2,authent:0,avail:8,bug:8,chang:8,charact:12,close:8,column:12,configur:1,content:10,dashboard:9,data:12,deploy:11,deprec:11,detail:9,dev:11,docker:11,document:2,email:11,environ:11,featur:[8,9],first:8,fittracke:[8,10],fix:8,french:8,from:11,improv:8,instal:11,issu:8,json:12,line:12,list:9,log:8,map:11,minor:8,misc:8,pars:12,prerequisit:11,prod:11,product:11,pypi:[8,11],record:3,releas:8,server:11,sourc:11,sport:4,statist:[5,8,9],tabl:10,tile:11,translat:9,troubleshoot:13,unexpect:12,upgrad:11,user:[6,14],variabl:11,version:8,workout:[7,9]}}) \ No newline at end of file +Search.setIndex({docnames:["api/auth","api/configuration","api/index","api/records","api/sports","api/stats","api/users","api/workouts","changelog","features","index","installation","troubleshooting/administrator","troubleshooting/index","troubleshooting/user"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["api/auth.rst","api/configuration.rst","api/index.rst","api/records.rst","api/sports.rst","api/stats.rst","api/users.rst","api/workouts.rst","changelog.md","features.rst","index.rst","installation.rst","troubleshooting/administrator.rst","troubleshooting/index.rst","troubleshooting/user.rst"],objects:{"":{"/api/auth/login":[0,0,1,"post--api-auth-login"],"/api/auth/logout":[0,1,1,"get--api-auth-logout"],"/api/auth/password/reset-request":[0,0,1,"post--api-auth-password-reset-request"],"/api/auth/password/update":[0,0,1,"post--api-auth-password-update"],"/api/auth/picture":[0,0,1,"post--api-auth-picture"],"/api/auth/profile":[0,1,1,"get--api-auth-profile"],"/api/auth/profile/edit":[0,0,1,"post--api-auth-profile-edit"],"/api/auth/register":[0,0,1,"post--api-auth-register"],"/api/config":[1,3,1,"patch--api-config"],"/api/ping":[1,1,1,"get--api-ping"],"/api/records":[3,1,1,"get--api-records"],"/api/sports":[4,1,1,"get--api-sports"],"/api/sports/(int:sport_id)":[4,3,1,"patch--api-sports-(int-sport_id)"],"/api/stats/(user_name)/by_sport":[5,1,1,"get--api-stats-(user_name)-by_sport"],"/api/stats/(user_name)/by_time":[5,1,1,"get--api-stats-(user_name)-by_time"],"/api/stats/all":[5,1,1,"get--api-stats-all"],"/api/users":[6,1,1,"get--api-users"],"/api/users/(user_name)":[6,3,1,"patch--api-users-(user_name)"],"/api/users/(user_name)/picture":[6,1,1,"get--api-users-(user_name)-picture"],"/api/workouts":[7,0,1,"post--api-workouts"],"/api/workouts/(string:workout_short_id)":[7,3,1,"patch--api-workouts-(string-workout_short_id)"],"/api/workouts/(string:workout_short_id)/chart_data":[7,1,1,"get--api-workouts-(string-workout_short_id)-chart_data"],"/api/workouts/(string:workout_short_id)/chart_data/segment/(int:segment_id)":[7,1,1,"get--api-workouts-(string-workout_short_id)-chart_data-segment-(int-segment_id)"],"/api/workouts/(string:workout_short_id)/gpx":[7,1,1,"get--api-workouts-(string-workout_short_id)-gpx"],"/api/workouts/(string:workout_short_id)/gpx/segment/(int:segment_id)":[7,1,1,"get--api-workouts-(string-workout_short_id)-gpx-segment-(int-segment_id)"],"/api/workouts/map/(map_id)":[7,1,1,"get--api-workouts-map-(map_id)"],"/api/workouts/no_gpx":[7,0,1,"post--api-workouts-no_gpx"],"APP_LOG \ud83c\udd95":[11,4,1,"envvar-APP_LOG"],"DATABASE_DISABLE_POOLING \ud83c\udd95":[11,4,1,"envvar-DATABASE_DISABLE_POOLING"],"MAP_ATTRIBUTION \ud83c\udd95":[11,4,1,"envvar-MAP_ATTRIBUTION"],"TILE_SERVER_URL \ud83c\udd95":[11,4,1,"envvar-TILE_SERVER_URL"],"UPLOAD_FOLDER \ud83c\udd95":[11,4,1,"envvar-UPLOAD_FOLDER"],APP_SECRET_KEY:[11,4,1,"-"],APP_SETTINGS:[11,4,1,"-"],APP_WORKERS:[11,4,1,"-"],DATABASE_URL:[11,4,1,"-"],EMAIL_URL:[11,4,1,"-"],FLASK_APP:[11,4,1,"-"],HOST:[11,4,1,"-"],PORT:[11,4,1,"-"],REACT_APP_ALLOW_REGISTRATION:[11,4,1,"-"],REACT_APP_API_URL:[11,4,1,"-"],REACT_APP_GPX_LIMIT_IMPORT:[11,4,1,"-"],REACT_APP_MAX_SINGLE_FILE_SIZE:[11,4,1,"-"],REACT_APP_MAX_ZIP_FILE_SIZE:[11,4,1,"-"],REACT_APP_THUNDERFOREST_API_KEY:[11,4,1,"-"],REDIS_URL:[11,4,1,"-"],SENDER_EMAIL:[11,4,1,"-"],UI_URL:[11,4,1,"-"],WEATHER_API_KEY:[11,4,1,"-"],WORKERS_PROCESSES:[11,4,1,"-"]},"/api/workouts/map_tile/(s)/(z)/(x)/(y)":{png:[7,1,1,"get--api-workouts-map_tile-(s)-(z)-(x)-(y).png"]}},objnames:{"0":["http","post","HTTP post"],"1":["http","get","HTTP get"],"2":["http","delete","HTTP delete"],"3":["http","patch","HTTP patch"],"4":["std","envvar","environment variable"]},objtypes:{"0":"http:post","1":"http:get","2":"http:delete","3":"http:patch","4":"std:envvar"},terms:{"0mb":[0,7],"100":[7,9],"1000":5,"1048576":1,"10485760":1,"10mb":11,"1232004":7,"12341":5,"1234538":7,"1267":5,"127":11,"1563529507772":7,"1mb":11,"200":[0,1,3,4,5,6,7],"201":[0,7],"2017":[5,7],"2018":[5,7,10],"2019":[0,3,5,6,7,10],"2020":10,"2021":10,"204":[0,6,7],"279":7,"280":7,"282":5,"2930":7,"2e1ee2c":8,"3000":[11,12],"301":11,"34614d5":8,"400":[0,1,4,7],"401":[0,1,3,4,5,6,7],"403":[0,1,4,5,6,7],"404":[0,4,5,6,7],"4109":7,"413":[0,7],"443":11,"465":11,"4c3fc34":8,"500":[0,1,4,6,7],"5000":11,"5078118":7,"5079733":7,"5432":11,"587":11,"613":5,"7380":7,"8025":11,"895":[0,6],"9960":5,"boolean":[1,6],"default":[5,6,7,8,11],"export":10,"float":7,"import":[8,11],"int":[4,7],"new":[9,11],"null":[0,6,7],"return":[3,7,11],"short":7,"static":11,"true":[0,1,4,6,11],"try":[0,6,7],For:11,NOT:[0,4,7],Not:[4,5,6,7],One:11,That:0,The:[8,9,11],There:11,Use:8,WITH:11,With:11,__main__:11,_blank:11,access:11,accord:10,account:[6,8],acit:7,activ:[4,8,9,10,11],adapt:11,add:[6,8,9,10],address:11,admin:[0,1,3,4,5,6,7,8,11],administr:[0,6,7,10,13],after:11,again:[0,1,3,4,5,6,7],all:[3,4,5,6,11],allow:[0,1,7,10,11],along:7,alpinequest:10,alreadi:0,also:[8,10],alwai:11,android:10,anoth:[6,11],anymor:8,apach:10,api:[0,1,3,4,5,6,7,8,9,10,11,12],apikei:11,app:10,app_log:11,app_secret_kei:11,app_set:11,app_work:11,applic:[0,1,3,4,5,6,7,8,9,10,11],arch:11,archiv:[1,8,9,11],archlinux:11,asc:6,ascent:7,attribut:11,auth:[0,1,3,4,5,6,7],auth_token:0,auth_user_id:[1,3,4,5,6,7],authent:[1,2,3,4,5,6,7,10],author:[0,1,3,4,5,6,7],avail:[3,9,10,11],ave_spe:7,ave_speed_from:7,ave_speed_to:7,averag:[3,7,8,9],axi:7,b862a77:8,background:8,backup:11,bad:[0,1,4,7],bearer:[0,1,3,4,5,6,7],becom:8,been:8,befor:[8,11],bike:[4,7,8,9],bin:11,bio:[0,6],biographi:0,birth:0,birth_dat:[0,6],bound:7,build:11,by_sport:5,by_tim:5,calcul:8,calendar:[8,9],can:[6,8,9,10,11],cannot:8,chang:[9,10,11],charact:[0,13],chart:[7,8,9,11],chart_data:7,check:[1,11,12],choos:8,client:[8,11,12],clone:11,code:[0,1,3,4,5,6,7],color:8,column:13,com:[0,6,11],complet:8,config:[1,11,12],configur:[2,10,11],confirm:0,contact:[0,6,7],contain:[8,11],content:[0,1,3,4,5,6,7],contributor:[1,11],coordin:11,copi:[1,11],copyright:[1,11],correctli:[8,12],creat:[0,7,8,9,11],create_app:11,created_at:[0,6],creation:[8,9],creation_d:7,credenti:[0,11],criteria:6,current:8,custom:[11,12],cycl:[4,8,9],dai:8,dark:11,darkski:[8,9],dashboard:[8,10],data:[0,1,3,4,5,6,7,8,10,11,13],databas:[8,11],database_disable_pool:11,database_url:11,date:[0,5,7,8,9],debian:11,defin:9,definit:8,delet:[0,6,7,8,9],depend:[8,11],deploy:10,desc:7,descent:7,describ:11,descript:11,detail:[6,8,10],develop:[10,11],differ:8,directli:11,directori:[8,11],disabl:[0,8,9,11],displai:[7,8,9,10,11],distanc:[3,7,8,9],distance_from:7,distance_to:7,distribut:11,docker:[8,10],document:[8,10,11],doe:[0,5,6,7,8],don:0,down:8,download:11,dramatiq:11,drop:8,durat:[3,7,8,9],duration_from:7,duration_to:7,dure:[0,7],easi:8,edit:[0,8,9],elev:[7,8,9,11],els:11,email:[0,6,8],email_url:11,empti:8,enabl:[1,9],encount:11,end:[5,7],endpoint:[1,2,8,13],english:9,enter:[8,9],entiti:[0,7],entri:11,env:11,environ:[8,10],environn:12,error:[0,1,4,6,7,8,11],europ:[0,6],evalu:[8,11],even:[8,9],exampl:[0,1,3,4,5,6,7,10,11,12],exce:[0,7],except:6,execstart:11,exist:[0,5,6,7,9,10,12],exodu:10,expir:[0,1,3,4,5,6,7],extens:[0,7],fa33f4d996844a5c73ecd1ae24456ab8:7,fals:[0,1,4,6,7,11],farest:[3,8,9],featur:[10,11],fetch:11,file:[0,1,7,8,9,10,11,12],filter:[8,9],first:[0,10],first_nam:[0,6],fitotrack:10,fittracke:[9,11],fittrackee_init_data:11,fittrackee_upgrade_db:11,fittrackee_work:11,fix:10,flask:11,flask_app:11,flaticon:11,follow:[3,9,11],forbidden:[0,1,4,5,6,7],forecast:11,form:[0,7],format:[0,5,7],former:11,forrunn:10,forward:11,found:[0,4,5,6,7],frame:5,freepik:11,french:[9,10],fri:7,from:[1,3,4,5,6,7,8,10],fullchain:11,gener:11,get:[0,1,3,4,5,6,7],gif:0,git:11,github:11,given:11,gmt:[0,3,6,7],gpl:10,gpx:[7,8,9,10,11],gpx_limit_import:1,gpxpy:11,grant:11,gunicorn:11,handl:0,has:6,has_workout:4,have:[1,4,5,6,7,8],header:[0,1,3,4,5,6,7],health:1,heavi:[10,11],hike:[4,8,9],his:[6,8,9],home:11,host:11,href:[1,11],http:[0,1,3,4,5,6,7,11,12],hvybqybra7wwxpastwr4v2:3,i18n:8,icon:11,imag:[0,6,7,8,11],img:4,improv:10,incorrect:8,index:7,info:0,inform:[8,10,11],init:11,initi:[11,12],initialis:11,insid:11,instal:[8,10],instanc:[1,11],integ:[1,3,4,5,6,7],interceptor:8,interfac:11,intern:[0,1,4,6,7],introduc:8,invalid:[0,1,3,4,5,6,7,8],is_act:4,is_registration_en:1,issu:[10,11],jan:7,javascript:11,john_do:6,jpeg:6,jpg:0,json:[0,1,3,4,5,6,7,13],jul:[0,3,6,7],keep:[10,11],kei:[8,9,11],kjxavsturjvoah2wvcegef:7,label:4,languag:[0,6],larg:[0,7],last:[0,11],last_nam:[0,6],latitud:7,layer:[8,11],leaflet:[7,11],least:[7,11],librari:11,licens:10,limit:[8,9],line:13,link:11,linux:11,list:[8,10,11],listen:11,load:8,local:[8,10,11],localhost:[11,12],locat:[0,6,11],log:[0,1,3,4,5,6,7,10,11],logfil:11,login:0,logout:[0,8],longest:[3,8,9],longitud:7,made:[11,12],mai:[10,11],mailhog:11,major:8,make:11,makefil:[11,12],manag:8,mandatori:[7,8,11],map:[7,8,9,10],map_attribut:[1,11],map_id:7,map_til:7,match:0,max:[1,6,7],max_alt:7,max_single_file_s:1,max_spe:7,max_speed_from:7,max_speed_to:7,max_us:1,max_zip_file_s:1,maxim:7,maximum:[3,8,9,11],mean:12,messag:[0,1,7,8],method:11,min_alt:7,minim:7,minor:10,mobil:10,model:8,modifi:6,modification_d:7,modul:11,mon:7,mondai:[0,5,9],montain:[8,9],month:[5,8,9],more:[8,10,11],morn:7,mountain:4,mous:8,move:[7,8],mpwoadmin:11,multi:11,multipart:[0,7],must:[0,1,4,8,9,11],name:[0,5,6,11],nano:11,nb_sport:[0,6],nb_workout:[0,5,6],necessari:11,need:11,network:[11,12],next_workout:7,nginx:11,no_gpx:7,non:4,noopen:11,noreferr:11,note:[7,8,9,11],now:[8,9,11],number:[1,6,7,9,11],oauth:[0,1,3,4,5,6,7],object:[0,1,4,6,7],one:[6,7],onli:[6,7,8,9,11],open:[10,11],openstreetmap:[1,8,11],opentrack:10,option:11,order:[6,7,8],order_bi:6,org:[1,11],other:[6,11],out:0,outdoor:[8,10,11],over:8,own:[6,10],owner:[8,9],packag:[8,11],page:[6,7],pagin:[6,7],par_pag:6,paramet:[0,1,3,4,5,6,7,8,9,11],pari:[0,6],pars:[11,13],part:[0,7],pass:11,password:[0,8,9,11],password_conf:0,patch:[1,4,6,7],path:11,paus:[7,8],payload:[0,1,4,7],pem:11,per:[6,7,8],per_pag:[6,7],permiss:[1,4,5,6,7],pg_dump:11,pictur:[0,6,7,11],ping:1,pip:11,pipenv:8,pleas:[0,1,3,4,5,6,7,8],png:[0,4,7,11],poetri:[8,11],point:[8,11],pong:1,pool:11,port:11,possibl:[8,10],post:[0,7],postgr:11,postgresql:11,prefer:0,prerequisit:10,previous_workout:7,prior:11,privai:10,privileg:11,privkei:11,process:[0,11],productionconfig:11,profil:0,project:11,proprietari:10,provid:[0,1,3,4,5,6,7,8,9,11],proxi:11,proxy_add_x_forwarded_for:11,proxy_pass:11,proxy_redirect:11,proxy_set_head:11,pull:11,purpos:[8,11],pwd:11,pypi:10,python:[8,11],queri:[5,6,7],queue:11,react:11,react_app_allow_registr:11,react_app_api_url:[11,12],react_app_gpx_limit_import:11,react_app_max_single_file_s:11,react_app_max_zip_file_s:11,react_app_thunderforest_api_kei:11,read:8,real:11,rebuild:12,rechart:[7,11],recommend:11,record:[2,7,8,9,10],record_typ:[3,7],redi:[8,11],redis_url:11,redux:11,refactor:8,regist:[0,1,11],registr:[0,1,8,9],rel:11,relat:11,releas:[10,11],remote_addr:11,remov:9,renam:8,replac:[8,11],repo:11,report:10,repositori:11,request:[0,1,3,4,5,6,7,12],request_uri:11,requir:0,reset:[0,8,9],respons:[0,1,3,4,5,6,7],restart:11,restartsec:11,right:[6,9],rout:8,run:[4,8,9,11],runner:10,sam:[0,6],same:8,samr1:11,sat:6,save:9,schema:11,search:8,second:7,secret:11,see:[8,9,10,11,12],segment:[7,8,9],segment_id:7,select:[0,7],send:[8,11],sender:11,sender_email:11,serv:11,server:[0,1,4,6,7,8,10],server_nam:11,servic:11,set:9,sever:[10,11],shell:11,should:11,show:8,shown:8,side:8,signatur:[0,1,3,4,5,6,7],simpl:11,simplifi:8,sinc:11,singl:[1,6],size:[0,1,7,8,9,11],sky:11,smtp:11,some:[6,7,8,10,11],sorri:0,sort:[6,7],sourc:10,spawn:11,speed:[3,7,8,9,11],spinner:8,sport:[2,5,7,8,9,10,11],sport_id:[3,4,5,7],sports_list:[0,6],sql:11,sqlalchemi:11,ssl:11,ssl_certif:11,ssl_certificate_kei:11,standard:[8,11],standarderror:11,standardoutput:11,start:[0,5,7,9,11],startlimitintervalsec:11,starttl:11,stat:[5,8],staticmap:11,statist:[2,10],statu:[0,1,3,4,5,6,7],step:11,still:10,stop:11,store:[10,11],street:10,string:[0,4,5,6,7],subdomain:7,success:[0,1,3,4,5,6,7],successfulli:0,sun:[0,3,6,7],sundai:[5,7,9],support:[8,9],syslog:11,syslogidentifi:11,system:11,systemd:11,tab:12,tar:11,target:11,task:11,term:[8,11],test:11,than:8,thei:11,them:10,thi:[7,8,9,10,11],thunderforest:[8,11],tile:[7,8],tile_server_url:11,time:[0,5,7,8,9],timezon:[0,6,8],titl:7,tls:11,todo:14,token:[0,1,3,4,5,6,7],too:[0,7],tool:11,tooltip:8,total:8,total_dist:[0,5,6],total_dur:[0,5,6],track:10,tracker:10,transport:[4,8,9],troubleshoot:10,type:[0,1,3,4,5,6,7,11],ui_url:11,unauthor:[0,1,3,4,5,6,7],undefin:12,under:[10,11],unencrypt:11,unexpect:13,unit:11,unstabl:[10,11],updat:[0,1,4,6,7,8,9,11],upload:[8,9,11],upload_fold:11,uploads_dir_s:5,url:[8,11],use:11,used:[8,11],user:[0,1,2,3,4,5,7,8,9,10,11,13],user_nam:[5,6],usernam:[0,6,11],usernanm:0,using:[6,7,10,11],uuid:[7,8],valid:[0,1,3,4,5,6,7,11],valu:[3,7],variabl:[8,10,12],venv:11,version:[10,11],view:8,virtualenv:11,wai:11,walk:[4,8,9],wantedbi:11,warn:8,weather:[8,9,11],weather_api:11,weather_api_kei:11,weather_end:7,weather_start:7,web:[0,1,3,4,5,6,7,10,11],week:[0,5,8,9],weekend:8,weekm:[0,5],were:8,wget:11,when:[8,11],where:11,which:9,with_gpx:7,without:[5,6,7,8,9,10],worker:11,workers_process:11,workingdirectori:11,workout:[2,5,8,10],workout_d:[3,7],workout_id:[3,7],workout_short_id:7,workouts_count:6,written:11,www:[1,11],xxxx:11,xzf:11,yai:11,yarn:11,year:5,yet:10,you:[1,4,5,6,7,10],your:[6,10,11],zip:[1,7,8,9,11],zone:0,zoom:7},titles:["Authentication","Configuration","API documentation","Records","Sports","Statistics","Users","Workouts","Change log","Features","FitTrackee","Installation","Administrator","Troubleshooting","User"],titleterms:{"2018":8,"2019":8,"2020":8,"2021":8,"new":8,account:9,administr:[8,9,12],api:2,authent:0,avail:8,bug:8,chang:8,charact:12,close:8,column:12,configur:1,content:10,dashboard:9,data:12,deploy:11,deprec:11,detail:9,dev:11,docker:11,document:2,email:11,environ:11,featur:[8,9],first:8,fittracke:[8,10],fix:8,french:8,from:11,improv:8,instal:11,issu:8,json:12,line:12,list:9,log:8,map:11,minor:8,misc:8,pars:12,prerequisit:11,prod:11,product:11,pypi:[8,11],record:3,releas:8,server:11,sourc:11,sport:4,statist:[5,8,9],tabl:10,tile:11,translat:9,troubleshoot:13,unexpect:12,upgrad:11,user:[6,14],variabl:11,version:8,workout:[7,9]}}) \ No newline at end of file diff --git a/fittrackee/application/app_config.py b/fittrackee/application/app_config.py index 3a6a9015..1b2d4f0c 100644 --- a/fittrackee/application/app_config.py +++ b/fittrackee/application/app_config.py @@ -12,7 +12,7 @@ from fittrackee.responses import ( from fittrackee.users.decorators import authenticate_as_admin from .models import AppConfig -from .utils import update_app_config_from_database +from .utils import update_app_config_from_database, verify_app_config config_blueprint = Blueprint('config', __name__) @@ -96,11 +96,11 @@ def update_application_config(auth_user_id: int) -> Union[Dict, HttpResponse]: :param integer auth_user_id: authenticate user id (from JSON Web Token) - : Union[Dict, HttpResponse]: if not config_data: return InvalidPayloadErrorResponse() + ret = verify_app_config(config_data) + if ret: + return InvalidPayloadErrorResponse(message=ret) + try: config = AppConfig.query.one() if 'gpx_limit_import' in config_data: diff --git a/fittrackee/application/utils.py b/fittrackee/application/utils.py index 04027e71..d0d20b4b 100644 --- a/fittrackee/application/utils.py +++ b/fittrackee/application/utils.py @@ -1,5 +1,5 @@ import os -from typing import Tuple +from typing import Dict, List, Tuple from flask import Flask @@ -49,3 +49,30 @@ def update_app_config_from_database( current_app.config[ 'is_registration_enabled' ] = db_config.is_registration_enabled + + +def verify_app_config(config_data: Dict) -> List: + """ + Verify if application config is valid. + + If not, it returns not empty string + """ + ret = [] + if ( + 'gpx_limit_import' in config_data + and config_data['gpx_limit_import'] <= 0 + ): + ret.append('Max. files in a zip archive must be greater than 0') + + if ( + 'max_single_file_size' in config_data + and config_data['max_single_file_size'] <= 0 + ): + ret.append('Max. size of uploaded files must be greater than 0') + + if ( + 'max_zip_file_size' in config_data + and config_data['max_zip_file_size'] <= 0 + ): + ret.append('Max. size of zip archive must be greater than 0') + return ret diff --git a/fittrackee/dist/asset-manifest.json b/fittrackee/dist/asset-manifest.json index 7c97d7ae..30a6b57f 100644 --- a/fittrackee/dist/asset-manifest.json +++ b/fittrackee/dist/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "/static/css/main.376b8924.chunk.css", - "main.js": "/static/js/main.7c5c861a.chunk.js", - "main.js.map": "/static/js/main.7c5c861a.chunk.js.map", + "main.js": "/static/js/main.4387b246.chunk.js", + "main.js.map": "/static/js/main.4387b246.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.1240af94.js", "runtime-main.js.map": "/static/js/runtime-main.1240af94.js.map", "static/js/2.301144a0.chunk.js": "/static/js/2.301144a0.chunk.js", @@ -19,6 +19,6 @@ "static/js/runtime-main.1240af94.js", "static/js/2.301144a0.chunk.js", "static/css/main.376b8924.chunk.css", - "static/js/main.7c5c861a.chunk.js" + "static/js/main.4387b246.chunk.js" ] } \ No newline at end of file diff --git a/fittrackee/dist/index.html b/fittrackee/dist/index.html index 8762cdd0..c512fa88 100644 --- a/fittrackee/dist/index.html +++ b/fittrackee/dist/index.html @@ -1 +1 @@ -FitTrackee
\ No newline at end of file +FitTrackee
\ No newline at end of file diff --git a/fittrackee/dist/static/js/main.7c5c861a.chunk.js b/fittrackee/dist/static/js/main.4387b246.chunk.js similarity index 55% rename from fittrackee/dist/static/js/main.7c5c861a.chunk.js rename to fittrackee/dist/static/js/main.4387b246.chunk.js index 4e7ee15f..9905cd02 100644 --- a/fittrackee/dist/static/js/main.7c5c861a.chunk.js +++ b/fittrackee/dist/static/js/main.4387b246.chunk.js @@ -1,2 +1,2 @@ -(this.webpackJsonpfittrackee_client=this.webpackJsonpfittrackee_client||[]).push([[0],{203:function(e){e.exports=JSON.parse('{"Workouts":"Workouts","Workout":"Workout","Workout Date":"Workout Date","Add a workout":"Add a workout","Are you sure you want to delete this workout?":"Are you sure you want to delete this workout?","Ave. speed":"Ave. speed","Ascent":"Ascent","Average speed":"Average speed","Chart":"Chart","data from gpx, without any cleaning":"data from gpx, without any cleaning","Date":"Date","Delete workout":"Delete workout","Descent":"Descent","Distance":"Distance","distance":"distance","Duration":"Duration","duration":"duration","Edit a workout":"Edit a workout","Edit workout":"Edit workout","elevation":"elevation","End":"End","Farest distance":"Farest distance","Filter":"Filter","From":"From","gpxFile":"gpx file","Longest duration":"Longest duration","Max. altitude":"Max. altitude","Max. speed":"Max. speed","Min. altitude":"Min. altitude","no folder inside":"no folder inside","files max":"files max","max size":"max size","No data to display":"No data to display","No Map":"No Map","No next workout":"No next workout","No next segment":"No next segment","No notes":"No notes","No previous workout":"No previous workout","No previous segment":"No previous segment","Notes":"Notes","pauses":"pauses","Personal records":"Personal records","See next workout":"See next workout","See next segment":"See next segment","See previous workout":"See previous workout","See previous segment":"See previous segment","segment":"segment","Segments":"Segments","speed":"speed","Start":"Start","Title":"Title","To":"To","total duration":"total duration","with gpx file":"with gpx file","without gpx file":"without gpx file","zipFile":"or zip file containing gpx files"}')},204:function(e){e.exports=JSON.parse('{"Actions":"Actions","Active":"Active","workouts exist":"workouts exist","Add admin rights":"Add admin rights","Add/remove admin rights, delete user account.":"Add/remove admin rights, delete user account.","Administration":"Administration","Application":"Application","Application configuration":"Application configuration","Back":"Back","Disable":"Disable","Enable":"Enable","Enable/disable sports.":"Enable/disable sports.","FitTrackee administration":"FitTrackee administration","id":"id","if 0, no limitation":"if 0, no limitation","Image":"Image","Label":"Label","Max. number of active users":"Max. number of active users","Max. files of zip archive":"Max. files of zip archive","Max. size of uploaded files":"Max. size of uploaded files","Max. size of uploaded files (in Mb)":"Max. size of uploaded files (in Mb)","Max. size of zip archive":"Max. size of zip archive","Max. size of zip archive (in Mb)":"Max. size of zip archive (in Mb)","Registration is currently disabled.":"Registration is currently disabled.","Registration is currently enabled.":"Registration is currently enabled.","Remove admin rights":"Remove admin rights","Sports":"Sports","Update application configuration (maximum number of registered users, maximum files size).":"Update application configuration (maximum number of registered users, maximum files size).","uploads":"uploads","user":"user","Users":"Users","users":"users"}')},205:function(e){e.exports=JSON.parse('{"workouts count":"workouts count","Add workout":"Add workout","admin rights":"admin rights","ascending":"ascending","Back":"Back","Back to home":"Back to home","Cancel":"Cancel","Confirmation":"Confirmation","Dashboard":"Dashboard","descending":"descending","Edit":"Edit","day":"day","days":"days","Next":"Next","No":"No","no":"no","No records.":"No records.","No workouts.":"No workouts.","Page not found":"Page not found","Previous":"Prev","registration date":"registration date","Sort":"Sort","Sort by":"Sort by","Sport":"Sport","sport":"sport","Sports":"Sports","sports":"sports","Statistics":"Statistics","Submit":"Submit","to":"to","user name":"user name","Workout":"Workout","Workouts":"Workouts","workout":"workout","workouts":"workouts","Yes":"Yes","yes":"yes"}')},206:function(e){e.exports=JSON.parse('{"Personal records":"Personal records","This month":"This month","Upload one !":"Upload one !"}')},207:function(e){e.exports=JSON.parse('{"3 to 12 characters required for username.":"3 to 12 characters required for username.","8 characters required for password.":"8 characters required for password.","An error occurred. Please contact the administrator.":"An error occurred. Please contact the administrator.","application":"application","Error during picture deletion.":"Error during picture deletion.","Error during picture update.":"Error during picture update.","Error during picture update, file size exceeds max size.":"Error during picture update, file size exceeds max size.","Error. Registration is disabled.":"Error. Registration is disabled.","Error. Please try again or contact the administrator.":"Error. Please try again or contact the administrator.","File extension not allowed.":"File extension not allowed.","File size is greater than the allowed size":"File size is greater than the allowed size","Incorrect id":"Incorrect id","Invalid credentials.":"Invalid credentials.","Invalid payload.":"Invalid payload.","Invalid token. Please log in again.":"Invalid token. Please log in again.","Max. size of zip archive must be equal or greater than max. size of uploaded files":"Max. size of zip archive must be equal or greater than max. size of uploaded files","No file part.":"No file part.","No picture.":"No picture.","No selected file.":"No selected file.","no correct file.":"no correct file.","no gpx file for this workout":"no gpx file for this workout","Password and password confirmation don\'t match.":"Password and password confirmation don\'t match.","Provide a valid auth token":"Provide a valid auth token","records":"records","Signature expired. Please log in again.":"Signature expired. Please log in again.","Sorry. That user already exists.":"Sorry. That user already exists.","Sport can not be disabled, workouts exist.":"Sport can not be disabled, workouts exist.","Sport does not exist.":"Sport does not exist.","sports":"sports","statistics":"statistiques","User does not exist.":"User does not exist.","Valid email must be provided.\\n":"Valid email must be provided.","workouts":"workouts","You can not delete your account, no other user has admin rights.":"You can not delete your account, no other user has admin rights.","You do not have permissions.":"You do not have permissions."}')},208:function(e){e.exports=JSON.parse('{"Cycling (Sport)":"Cycling (Sport)","Cycling (Transport)":"Cycling (Transport)","Hiking":"Hiking","Mountain Biking":"Mountain Biking","Running":"Running","Walking":"Walking"}')},209:function(e){e.exports=JSON.parse('{"workouts":"workouts","distance":"distance","duration":"duration","month":"month","Statistics":"Statistics","year":"year","week":"week"}')},210:function(e){e.exports=JSON.parse('{"Admin":"Admin","Are you sure you want to delete this account? All data will be deleted, this cannot be undone.":"Are you sure you want to delete this account? All data will be deleted, this cannot be undone.","Are you sure you want to delete your account? All data will be deleted, this cannot be undone.":"Are you sure you want to delete your account? All data will be deleted, this cannot be undone.","Bio":"Bio","Birth Date":"Birth Date","Check your email. If your address is in our database, you\'ll received an email with a link to reset your password.":"Check your email. If your address is in our database, you\'ll received an email with a link to reset your password.","Delete my account":"Delete my account","Delete picture":"Delete picture","Delete user account":"Delete user account","Edit Profile":"Edit Profile","Email":"Email","Enter a username":"Enter a username","Enter an email address":"Enter an email address","Enter a password":"Enter a password","Enter the password confirmation":"Enter the password confirmation","First day of week":"First day of week","First Name":"First Name","Forgot password?":"Forgot password?","Invalid token. Please request a new token.":"Invalid token. Please request a new token.","Language":"Language","Last Name":"Last Name","Location":"Location","loggedOut":"You are now logged out. Click <1>here to log back in.","Login":"Login","login":"login","Logout":"Logout","Monday":"Monday","Password":"Password","Password Confirmation":"Password Confirmation","Password reset":"Password reset","password reset":"password reset","Profile":"Profile","Profile Edition":"Profile Edition","Register":"Register","register":"register","Registration Date":"Registration Date","Reset your password":"Reset your password","reset your password":"reset your password","Send":"Send","Sunday":"Sunday","Timezone":"Timezone","updatedPasswordText":"Your password have been updated. Click <1>here to log in.","Username":"Username"}')},211:function(e){e.exports=JSON.parse('{"Workouts":"S\xe9ances","Workout":"S\xe9ance","Workout Date":"Date de l\'s\xe9ance","Add a workout":"Ajouter une s\xe9ance","Are you sure you want to delete this workout?":"Etes-vous s\xfbr de vouloir supprimer cette s\xe9ance ?","Ave. speed":"Vitesse moyenne","Ascent":"D\xe9nivel\xe9 positif","Average speed":"Vitesse moyenne","Chart":"Analyse","data from gpx, without any cleaning":"donn\xe9es issues du fichier gpx, sans correction","Date":"Date","Delete workout":"Supprimer l\'s\xe9ance","Descent":"D\xe9nivel\xe9 n\xe9gatif","Distance":"Distance","distance":"distance","Duration":"Dur\xe9e","duration":"dur\xe9e","Edit a workout":"Editer une s\xe9ance","Edit workout":"Editer une workout","elevation":"altitude","End":"Arriv\xe9e","Farest distance":"Distance la + longue","Filter":"Filtrer","From":"A partir de","gpxFile":"fichier gpx","Longest duration":"Dur\xe9e la + longue","Max. altitude":"Altitude max","Max. speed":"Vitesse max","Min. altitude":"Altitude min","no folder inside":"pas de r\xe9pertoire","files max":" fichiers max","max size":"taille max","No data to display":"Pas de donn\xe9es \xe0 afficher","No Map":"Pas de carte","No next workout":"Pas d\'s\xe9ance suivante","No next segment":"Pas de segment suivant","No notes":"Pas de notes","No previous workout":"Pas d\'s\xe9ance pr\xe9c\xe9dente","No previous segment":"Pas de segment pr\xe9c\xe9dent","Notes":"Notes","pauses":"pauses","Personal records":"Records personnels","See next workout":"Voir l\'s\xe9ance suivante","See next segment":"Voir le segment suivant","See previous workout":"Voir l\'s\xe9ance pr\xe9c\xe9dente","See previous segment":"Voir le segment pr\xe9c\xe9dent","segment":"segment","Segments":"Segments","Start":"D\xe9part","speed":"vitesse","Title":"Titre","To":"Jusqu\'au","total duration":"dur\xe9e totale","with gpx file":"avec un fichier gpx","without gpx file":"sans fichier gpx","zipFile":"ou un fichier zip contenant des fichiers gpx"}')},212:function(e){e.exports=JSON.parse('{"Actions":"Actions","Active":"Active","Add admin rights":"Ajouter des droits d\'admin","Add/remove admin rights, delete user account.":"Ajouter/retirer des droits d\'adminsitration, supprimer des comptes utilisateurs.","Administration":"Administration","workouts exist":"des s\xe9ances existent","Application":"Application","Application configuration":"Configuration de l\'application","Back":"Retour","Disable":"d\xe9sactiver","Enable":"activer","Enable/disable sports.":"Activer/d\xe9sactiver des sports.","FitTrackee administration":"Administration de FitTrackee","id":"id","if 0, no limitation":"si \xe9gal \xe0 0, pas limite d\'inscription","Image":"Image","Label":"Label","Max. number of active users":"Nombre maximum d\'utilisateurs actifs","Max. files of zip archive":"Nombre max. de fichiers dans une archive zip","Max. size of uploaded files":"Taille max. des fichiers","Max. size of uploaded files (in Mb)":"Taille max. des fichiers (en Mo)","Max. size of zip archive":"Taille max. des archives zip","Max. size of zip archive (in Mb)":"Taille max. des archives zip (en Mo)","Registration is currently disabled.":"Les inscriptions sont actuellement d\xe9sactiv\xe9es.","Registration is currently enabled.":"Les inscriptions sont actuellement activ\xe9es.","Remove admin rights":"Retirer des droits d\'admin","Sports":"Sports","Update application configuration (maximum number of registered users, maximum files size).":"Configurer l\'application (nombre maximum d\'utilisateurs inscrits, taille maximale des fichers).","uploads":"fichiers","user":"user","Users":"Utilisateurs","users":"utilisateurs"}')},213:function(e){e.exports=JSON.parse('{"workouts count":"nombre d\'s\xe9ances","Add workout":"Ajouter une s\xe9ance","admin rights":"droits d\'admin","ascending":"ascendant","Back":"Revenir \xe0 la page pr\xe9c\xe9dente","Back to home":"Retour \xe0 l\'accueil","Cancel":"Annuler","Confirmation":"Confirmation","Dashboard":"Tableau de Bord","descending":"descendant","Edit":"Modifier","day":"jour","days":"jours","Next":"Page suivante","No":"Non","no":"non","No records.":"Pas de records.","No workouts.":"Pas d\'s\xe9ances.","Page not found":"Page introuvable","Previous":"Page pr\xe9c\xe9dente","registration date":"date d\'inscription","Sort":"Tri","Sort by":"Trier par","Sport":"Sport","sport":"sport","Sports":"Sports","sports":"sports","Statistics":"Statistiques","Submit":"Valider","to":"\xe0","user name":"utilisateur","Workout":"S\xe9ance","Workouts":"S\xe9ances","workout":"s\xe9ance","workouts":"s\xe9ances","Yes":"Oui","yes":"oui"}')},214:function(e){e.exports=JSON.parse('{"Personal records":"Mes records","This month":"Ce mois","Upload one !":"Ajoutez votre premi\xe8re s\xe9ance !"}')},215:function(e){e.exports=JSON.parse('{"3 to 12 characters required for username.":"3 \xe0 12 caract\xe8res requis pour le nom.","8 characters required for password.":"8 caract\xe8res minimum pour le mot de passe.","An error occurred. Please contact the administrator.":"Une erreur s\'est produite. Merci de contacter l\'administrateur.","application":"application","Error during picture deletion.":"Erreur lors de la suppression de l\'image.","Error during picture update.":"Erreur lors de la mise \xe0 jour de l\'image.","Error during picture update, file size exceeds max size.":"Erreur lors de la mise \xe0 jour de l\'image, la taille du ficher d\xe9passe la taille maximum autoris\xe9e","Error. Registration is disabled.":"Erreur. L\'inscription est d\xe9sactiv\xe9e.","Error. Please try again or contact the administrator.":"Erreur. Veuillez r\xe9essayer ou contacter l\'administrateur","File extension not allowed.":"Extension de fichier non autoris\xe9e.","File size is greater than the allowed size":"La taille du fichier est sup\xe9rieure \xe0 la limite autoris\xe9e","Incorrect id":"Id incorrect","Invalid credentials.":"Identifiants invalides.","Invalid payload.":"Donn\xe9es incorrectes.","Invalid token. Please log in again.":"Jeton invalide. Merci de vous reconnecter.","Max. size of zip archive must be equal or greater than max. size of uploaded files":"La taille max. d\'une archive doit \xeatre sup\xe9rieure ou \xe9gale \xe0 la taille max. d\'un fichier","No file part.":"Pas de fichier fourni.","No picture.":"Pas d\'image.","No selected file.":"Pas de fichier s\xe9lectionn\xe9.","no correct file.":"fichier incorrect","no gpx file for this workout":"pas de fichier gpx pour cette s\xe9ance","Password and password confirmation don\'t match.":"Les mots de passe saisis sont diff\xe9rents.","Provide a valid auth token":"Merci de fournir un jeton valide","records":"records","Signature expired. Please log in again.":"Signature expir\xe9e. Merci de vous reconnecter.","Sorry. That user already exists.":"D\xe9sol\xe9. Cet utilisateur existe d\xe9j\xe0.","Sport can not be disabled, workouts exist.":"Le sport ne peut \xeatre d\xe9sactiv\xe9, des s\xe9ancees existent","Sport does not exist.":"Le sport n\'existe pas.","sports":"sports","statistics":"statistics","User does not exist.":"L\'utilisateur n\'existe pas.","Valid email must be provided.\\n":"L\'email fourni n\'est pas valide.","workouts":"s\xe9ances","You can not delete your account, no other user has admin rights.":"Vous ne pouvez pas supprimer votre compte, aucun autre utilisateur n\'a des droits d\'administration.","You do not have permissions.":"Vous n\'avez pas les permissions n\xe9cessaires."}')},216:function(e){e.exports=JSON.parse('{"Cycling (Sport)":"V\xe9lo (Sport)","Cycling (Transport)":"V\xe9lo (Transport)","Hiking":"Randonn\xe9e","Mountain Biking":"VTT","Running":"Course","Walking":"Marche"}')},217:function(e){e.exports=JSON.parse('{"workouts":"s\xe9ances","distance":"distance","duration":"dur\xe9e","month":"mois","Statistics":"Statistiques","year":"ann\xe9e","week":"semaine"}')},218:function(e){e.exports=JSON.parse('{"Admin":"Admin","Are you sure you want to delete this account? All data will be deleted, this cannot be undone.":"Etes-vous s\xfbr de vouloir supprimer ce compte ? Toutes les donn\xe9es seront d\xe9finitivement effac\xe9s.","Are you sure you want to delete your account? All data will be deleted, this cannot be undone.":"Etes-vous s\xfbr de vouloir supprimer votre compte ? Toutes les donn\xe9es seront d\xe9finitivement effac\xe9s.","Bio":"Bio","Birth Date":"Date de naissance","Check your email. If your address is in our database, you\'ll received an email with a link to reset your password.":"V\xe9rifiez vore boite mail. Si vote adresse est dans notre base de donn\xe9es, vous recevrez un email avec un lien pour r\xe9initialiser votre mot de passe","Delete my account":"Supprimer mon compte","Delete picture":"Supprimer l\'image","Delete user account":"Supprimer le compte","Edit Profile":"Editer le profil","Email":"Email","Enter a username":"Saisir un nom","Enter an email address":"Saisir une adresse e-mail","Enter a password":"Saisir un mot de passe","Enter the password confirmation":"Confirmer le mot de passe","First day of week":"Premier jour de la semaine","First Name":"Pr\xe9nom","Forgot password?":"Mot de passe oubli\xe9 ?","Invalid token. Please request a new token.":"Token invalid. Veuillez demander un nouveau token.","Language":"Langue","Last Name":"Nom","Location":"Lieu","loggedOut":"Vous \xeates d\xe9connect\xe9. Cliquez <1>ici pour vous reconnecter.","Login":"Se connecter","login":"se connecter","Logout":"Se d\xe9connecter","Monday":"Lundi","Password":"Mot de passe","Password Confirmation":"Confirmation du mot de passe","Password reset":"R\xe9initialiser votre mot de passe","password reset":"r\xe9initialiser votre mot de passe","Profile":"Profil","Profile Edition":"Edition du profil","Register":"S\'inscrire","register":"s\'inscrire","Registration Date":"Date d\'inscription","Reset your password":"R\xe9initialiser votre mot de passe","reset your password":"r\xe9initialiser votre mot de passe","Send":"Envoyer","Sunday":"Dimanche","Timezone":"Fuseau horaire","updatedPasswordText":"Votre mot de passe a \xe9t\xe9 mis \xe0 jour. Cliquez <1>ici pour vous connecter.","Username":"Nom d\'utilisateur"}')},277:function(e,t,s){},285:function(e,t){},889:function(e,t,s){"use strict";s.r(t),s.d(t,"history",(function(){return Ma})),s.d(t,"rootNode",(function(){return Pa})),s.d(t,"store",(function(){return Fa}));var a=s(1),r=s(29),o=s(2),c=s.n(o),n=s(908),i=s(51),l=s.n(i),d=s(199),u=s(55),m=s(200),j=s(83),p=s(201),h=s(202);const b={en:{workouts:s(203),administration:s(204),common:s(205),dashboard:s(206),messages:s(207),sports:s(208),statistics:s(209),user:s(210)},fr:{workouts:s(211),administration:s(212),common:s(213),dashboard:s(214),messages:s(215),sports:s(216),statistics:s(217),user:s(218)}};j.a.use(h.a).use(p.a).init({debug:!1,lng:"en",fallbackLng:"en",keySeparator:!1,interpolation:{escapeValue:!1},resources:b,ns:["common"],defaultNS:"common"});var x=j.a,O=s(10),g=s(19),f=(s(277),s(20)),w=s(891);class v extends c.a.PureComponent{render(){const e=this.props,t=e.message,s=e.messages,r=e.t,o=""!==t&&t?t.split("|").length>1?"".concat(r("messages:".concat(t.split("|")[0])),": ").concat(r("messages:".concat(t.split("|")[1]))):r("messages:".concat(t)):"";return Object(a.jsxs)("div",{className:"error-message",children:[""!==o&&Object(a.jsx)("code",{children:o}),s&&s.length>0&&Object(a.jsx)("code",{children:Object(a.jsx)("ul",{children:s.map((e=>Object(a.jsx)("li",{children:r("messages:".concat(e.value))},e.id)))})})]})}}var k=s(12),y=s(910),N=s(909),_=s(222);const S=["bytes","KB","MB","GB","TB"],D=(e,t=!0)=>{const s=Math.floor(Math.log(e)/Math.log(1024));if(!e)return t?"0 bytes":{size:0,suffix:"bytes"};const a=(e/Math.pow(1024,s)).toFixed(1),r=S[s];return t?"".concat(a).concat(r):{size:a,suffix:r}},C="/api/",E=[{key:"workouts_count",label:"workouts count"},{key:"admin",label:"admin rights"},{key:"created_at",label:"registration date"},{key:"username",label:"user name"}],A=[{key:"asc",label:"ascending"},{key:"desc",label:"descending"}],M=()=>!!window.localStorage.authToken,T=e=>{const t={};e.noAuthorization||(t.Authorization="Bearer ".concat(window.localStorage.getItem("authToken"))),e.type&&(t["Content-Type"]=e.type);const s={method:e.method,headers:t};"application/json"===e.type&&e.body?s.body=JSON.stringify(e.body):e.body&&(s.body=e.body);const a=new Request("".concat(C).concat(e.url),s);return fetch(a).then((t=>"DELETE"===e.method||413===t.status?t:t.json())).catch((e=>(console.error(e),new Error("An error occurred. Please contact the administrator."))))},P=(e,t)=>{if(!e)return"";const s=_.DateTime.fromISO(Object(y.a)(new Date(e),"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")).setZone(t);return Object(N.a)(s.toFormat("yyyy-MM-dd HH:mm:ss"),"yyyy-MM-dd HH:mm:ss",new Date)},F=(e,t)=>{const s=e.label.toLowerCase(),a=t.label.toLowerCase();return s>a?1:st.map((t=>Object(k.a)(Object(k.a)({},t),{},{label:e("".concat(s,":").concat(t.label))}))).sort(F),R=(e,t)=>{let s=e;return t.id||"users"===e&&t.username?s="".concat(s,"/").concat(t.username?t.username:t.id):Object.keys(t).length>0&&(s+="?",Object.keys(t).filter((e=>t[e])).map(((e,a)=>s+="".concat(0===a?"":"&").concat(e,"=").concat(t[e])))),s};class L{static getData(e,t={}){const s=R(e,t);return T({url:s,method:"GET",type:"application/json"})}static addData(e,t){return T({url:e,method:"POST",body:t,type:"application/json"})}static addDataWithFile(e,t){return T({url:e,method:"POST",body:t})}static postData(e,t){const s={url:"".concat(e).concat(t.id?"/".concat(t.id):""),method:"POST",body:t,type:"application/json"};return T(s)}static updateData(e,t){const s={url:"".concat(e).concat(t.id?"/".concat(t.id):t.username?"/".concat(t.username):""),method:"PATCH",body:t,type:"application/json"};return T(s)}static deleteData(e,t){const s={url:"".concat(e,"/").concat(t),method:"DELETE",type:"application/json"};return T(s)}}const U=(e,t)=>({type:"SET_DATA",data:t,target:e}),I=e=>({type:"SET_ERROR",message:e}),W=e=>({type:"SET_LOADING",loading:e}),H=(e,t,s,a=!0)=>r=>(r(W(!0)),s&&s.id&&"workouts"!==t&&isNaN(s.id)?(r(W(!1)),r(I("".concat(t,"|Incorrect id")))):(r(I("")),L[e](t,s).then((s=>{if("success"===s.status)if(a){if("users"===t&&"getData"===e)return r(((e,t,s)=>({type:"SET_PAGINATED_DATA",data:t,pagination:s,target:e}))(t,s.data,s.pagination));r(U(t,s.data))}else"updateData"===e&&"sports"===t?r((e=>({type:"UPDATE_SPORT_DATA",data:e}))(s.data.sports[0])):"updateData"===e&&"users"===t&&r((e=>({type:"UPDATE_USER_DATA",data:e}))(s.data.users[0]));else r(I("".concat(t,"|").concat(s.message||s.status)));r(W(!1))})).catch((e=>{r(W(!1)),r(I("".concat(t,"|").concat(e)))})))),q=e=>t=>{j.a.changeLanguage(e).then(t((e=>({type:"SET_LANGUAGE",language:e}))(e)))},B=e=>({type:"SET_APP_CONFIG",data:e}),V=e=>t=>L.getData(e).then((s=>{"success"===s.status?"config"===e?t(B(s.data)):"stats/all"===e&&t({type:"SET_APP_STATS",data:s.data}):t(I("application|".concat(s.message)))})).catch((e=>t(I("application|".concat(e)))));class G extends c.a.Component{constructor(e,t){super(e,t),this.state={formData:{}}}componentDidMount(){this.initForm()}componentDidUpdate(e){this.props.appConfig!==e.appConfig&&this.initForm()}initForm(){const e=this.props.appConfig,t={};Object.keys(e).map((s=>null===e[s]?t[s]="":["max_single_file_size","max_zip_file_size"].includes(s)?t[s]=+(e[s]/1048576).toFixed(2):t[s]=e[s])),this.setState({formData:t})}handleFormChange(e){const t=this.state.formData;t[e.target.name]=+e.target.value,this.setState(t)}render(){const e=this.props,t=e.isInEdition,s=e.loadAppConfig,r=e.message,o=e.onHandleConfigFormSubmit,c=e.t,n=this.state.formData;return Object(a.jsxs)("div",{children:[r&&Object(a.jsx)(v,{message:r,t:c}),Object.keys(n).length>0&&Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col-md-12",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:c("administration:Application configuration")})}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("form",{className:"app-config-form ".concat(t?"":"form-disabled"),onSubmit:e=>{e.preventDefault(),o(n)},children:[Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsxs)("label",{className:"col-sm-6 col-form-label",htmlFor:"max_users",children:[c("administration:Max. number of active users"),Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-question-circle","aria-hidden":"true",title:c("administration:if 0, no limitation")})}),":"]}),Object(a.jsx)("input",{className:"col-sm-5",id:"max_users",name:"max_users",type:"number",min:"0",value:n.max_users,onChange:e=>this.handleFormChange(e)})]}),Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsxs)("label",{className:"col-sm-6 col-form-label",htmlFor:"max_single_file_size",children:[c("administration:Max. size of uploaded files (in Mb)"),":"]}),Object(a.jsx)("input",{className:"col-sm-5",id:"max_single_file_size",name:"max_single_file_size",type:"number",step:"0.1",min:"0",value:n.max_single_file_size,onChange:e=>this.handleFormChange(e)})]}),Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsxs)("label",{className:"col-sm-6 col-form-label",htmlFor:"max_zip_file_size",children:[c("administration:Max. size of zip archive (in Mb)"),":"]}),Object(a.jsx)("input",{className:"col-sm-5",id:"max_zip_file_size",name:"max_zip_file_size",type:"number",step:"0.1",min:"0",value:n.max_zip_file_size,onChange:e=>this.handleFormChange(e)})]}),Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsx)("label",{className:"col-sm-6 col-form-label",htmlFor:"gpx_limit_import",children:c("administration:Max. files of zip archive")}),Object(a.jsx)("input",{className:"col-sm-5",id:"gpx_limit_import",name:"gpx_limit_import",type:"number",min:"0",value:n.gpx_limit_import,onChange:e=>this.handleFormChange(e)})]}),t?Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",value:c("common:Submit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:e=>{e.preventDefault(),s(),Ma.push("/admin/application")},value:c("common:Cancel")})]}):Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",onClick:e=>{e.preventDefault(),Ma.push("/admin/application/edit")},value:c("common:Edit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ma.push("/admin"),value:c("common:Back")})]})]})})]})})})]})}}var J=Object(O.c)((e=>({message:e.message})),(e=>({loadAppConfig:()=>{e(V("config"))},onHandleConfigFormSubmit:t=>{const s=Object.assign({},t);s.max_single_file_size*=1048576,s.max_zip_file_size*=1048576,e((e=>t=>L.updateData("config",e).then((e=>{"success"===e.status?(t(B(e.data)),Ma.push("/admin/application")):t(I("application|".concat(e.message)))})).catch((e=>t(I("application|".concat(e))))))(s))}})))(G),K=s(15);class Y extends c.a.Component{componentDidMount(){this.props.loadAppStats()}render(){const e=this.props,t=e.appStats,s=e.t,r=D(t.uploads_dir_size,!1);return Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-users fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:t.users?t.users:0}),Object(a.jsx)("div",{children:"".concat(1===t.users?s("administration:user"):s("administration:users"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-tags fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:t.sports?t.sports:0}),Object(a.jsx)("div",{children:"".concat(1===t.sports?s("common:sport"):s("common:sports"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-calendar fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:t.workouts?t.workouts:0}),Object(a.jsx)("div",{children:"".concat(1===t.workouts?s("common:workout"):s("common:workouts"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-folder-open fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:r.size}),Object(a.jsxs)("div",{children:[r.suffix," (",s("administration:uploads"),")"]})]})]})})})]})}}var X=Object(w.a)()(Object(O.c)((e=>({appStats:e.application.statistics})),(e=>({loadAppStats:()=>{e(V("stats/all"))}})))(Y));function $(e){const t=e.appConfig,s=e.t;return Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:s("administration:Administration")})}),Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsx)(X,{}),Object(a.jsx)("br",{}),Object(a.jsxs)("dl",{className:"admin-items",children:[Object(a.jsx)("dt",{children:Object(a.jsx)(K.a,{to:{pathname:"/admin/application"},children:s("administration:Application")})}),Object(a.jsxs)("dd",{children:[s("administration:Update application configuration (maximum number of registered users, maximum files size)."),Object(a.jsx)("br",{}),Object(a.jsx)("strong",{children:s("administration:Registration is currently ".concat(t.is_registration_enabled?"enabled":"disabled","."))})]}),Object(a.jsx)("br",{}),Object(a.jsx)("dt",{children:Object(a.jsx)(K.a,{to:{pathname:"/admin/sports"},children:s("administration:Sports")})}),Object(a.jsx)("dd",{children:s("administration:Enable/disable sports.")}),Object(a.jsx)("br",{}),Object(a.jsx)("dt",{children:Object(a.jsx)(K.a,{to:{pathname:"/admin/users"},children:s("administration:Users")})}),Object(a.jsx)("dd",{children:s("administration:Add/remove admin rights, delete user account.")})]})]})]})}class Z extends c.a.Component{componentDidMount(){this.props.loadSports()}render(){const e=this.props,t=e.message,s=e.sports,r=e.t,o=e.updateSport;return Object(a.jsxs)("div",{children:[t&&Object(a.jsx)(v,{message:t,t:r}),Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:r("administration:Sports")})}),Object(a.jsxs)("div",{className:"card-body",children:[s.length>0&&Object(a.jsxs)("table",{className:"table",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{children:r("administration:id")}),Object(a.jsx)("th",{children:r("administration:Image")}),Object(a.jsx)("th",{children:r("administration:Label")}),Object(a.jsx)("th",{children:r("administration:Active")}),Object(a.jsx)("th",{children:r("administration:Actions")})]})}),Object(a.jsx)("tbody",{children:s.map((e=>Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:id")}),e.id]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Image")}),Object(a.jsx)("img",{className:"admin-img",src:e.img?e.img:"/img/photo.png",alt:"sport logo"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Label")}),r("sports:".concat(e.label))]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Active")}),e.is_active?Object(a.jsx)("i",{className:"fa fa-check-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"}):Object(a.jsx)("i",{className:"fa fa-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Actions")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-".concat(e.is_active?"dark":"primary"," btn-sm"),value:e.is_active?r("administration:Disable"):r("administration:Enable"),onClick:()=>o(e.id,!e.is_active)}),e.has_workouts&&Object(a.jsxs)("span",{className:"admin-message",children:[Object(a.jsx)("i",{className:"fa fa-warning custom-fa","aria-hidden":"true"}),r("administration:workouts exist")]})]})]},e.id)))})]}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ma.push("/admin/"),value:r("common:Back")})]})]})})})]})}}var Q=Object(O.c)((e=>({message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadSports:()=>{e(H("getData","sports"))},updateSport:(t,s)=>{e(H("updateData","sports",{id:t,is_active:s},!1))}})))(Z);class ee extends c.a.PureComponent{getUrl(e){const t=this.props,s=t.query,a=t.pathname,r=Object.assign({},s);let o=s.page?+s.page:1;switch(e){case"prev":o-=1;break;case"next":o+=1;break;default:o=+e}return r.page=o,R(a,r)}render(){const e=this.props,t=e.pagination,s=e.t;return Object(a.jsx)(a.Fragment,{children:t&&Object.keys(t).length>0&&Object(a.jsx)("nav",{"aria-label":"Page navigation example",children:Object(a.jsxs)("ul",{className:"pagination justify-content-center",children:[Object(a.jsx)("li",{className:"page-item ".concat(t.has_prev?"":"disabled"),children:Object(a.jsx)(K.a,{className:"page-link",to:this.getUrl("prev"),"aria-disabled":!t.has_prev,children:s("common:Previous")})}),(r=t.pages,Array.from({length:r},((e,t)=>t+1))).map((e=>Object(a.jsx)("li",{className:"page-item ".concat(e===t.page?"active":""),children:Object(a.jsx)(K.a,{className:"page-link",to:this.getUrl(e),children:e})},e))),Object(a.jsx)("li",{className:"page-item ".concat(t.has_next?"":"disabled"),children:Object(a.jsx)(K.a,{className:"page-link",to:this.getUrl("next"),"aria-disabled":!t.has_next,children:s("common:Next")})})]})})});var r}}class te extends c.a.Component{constructor(e,t){super(e,t),this.state={page:null,per_page:null,order_by:"created_at",order:"asc"}}componentDidMount(){this.props.loadUsers(this.initState())}componentDidUpdate(e){e.location.query!==this.props.location.query&&this.props.loadUsers(this.props.location.query)}initState(){const e=this.props.location.query,t={page:e.page,per_page:e.per_page,order_by:e.order_by?e.order_by:"created_at",order:e.order?e.order:"asc"};return this.setState(t),t}updatePage(e,t){const s=Object.assign({},this.state);s[e]=t,this.setState(s);const a=R(this.props.location.pathname,s);Ma.push(a)}render(){const e=this.props,t=e.authUser,s=e.location,r=e.message,o=e.t,c=e.pagination,n=e.updateUser,i=e.users,l=z(o,E),d=z(o,A);return Object(a.jsxs)("div",{children:[r&&Object(a.jsx)(v,{message:r,t:o}),Object(a.jsx)("div",{className:"container",children:Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:o("administration:Users")})}),Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsxs)("div",{className:"row user-filters",children:[Object(a.jsx)("div",{className:"col-lg-4 col-md-6 col-sm-12",children:Object(a.jsxs)("label",{htmlFor:"order_by",children:[o("common:Sort by"),":"," ",Object(a.jsx)("select",{id:"order_by",name:"order_by",value:this.state.order_by,onChange:e=>this.updatePage("order_by",e.target.value),children:l.map((e=>Object(a.jsx)("option",{value:e.key,children:e.label},e.key)))})," "]})}),Object(a.jsx)("div",{className:"col-lg-4 col-md-6 col-sm-12",children:Object(a.jsxs)("label",{htmlFor:"sort",children:[o("common:Sort"),":"," ",Object(a.jsx)("select",{id:"sort",name:"sort",value:this.state.order,onChange:e=>this.updatePage("order",e.target.value),children:d.map((e=>Object(a.jsx)("option",{value:e.key,children:e.label},e.key)))})," "]})})]}),Object(a.jsxs)("table",{className:"table",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{children:"#"}),Object(a.jsx)("th",{children:o("user:Username")}),Object(a.jsx)("th",{children:o("user:Email")}),Object(a.jsx)("th",{children:o("user:Registration Date")}),Object(a.jsx)("th",{children:o("workouts:Workouts")}),Object(a.jsx)("th",{children:o("user:Admin")}),Object(a.jsx)("th",{children:o("administration:Actions")})]})}),Object(a.jsx)("tbody",{children:i.map((e=>Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:"#"}),!0===e.picture?Object(a.jsx)("img",{alt:"Avatar",src:"".concat(C,"users/").concat(e.username,"/picture?").concat(Date.now()),className:"img-fluid App-nav-profile-img"}):Object(a.jsx)("i",{className:"fa fa-user-circle-o fa-2x no-picture","aria-hidden":"true"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Username")}),Object(a.jsx)(K.a,{to:"/users/".concat(e.username),children:e.username})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Email")}),e.email]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Registration Date")}),Object(y.a)(new Date(e.created_at),"dd/MM/yyyy HH:mm")]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("workouts:Workouts")}),e.nb_workouts]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Admin")}),e.admin?Object(a.jsx)("i",{className:"fa fa-check-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"}):Object(a.jsx)("i",{className:"fa fa-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("administration:Actions")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-".concat(e.admin?"dark":"primary"," btn-sm"),disabled:e.username===t.username,value:e.admin?o("administration:Remove admin rights"):o("administration:Add admin rights"),onClick:()=>n(e.username,!e.admin)})]})]},e.username)))})]}),Object(a.jsx)(ee,{pagination:c,pathname:s.pathname,query:this.state,t:o}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ma.push("/admin/"),value:o("common:Back")})]})]})})})})]})}}var se=Object(O.c)((e=>({authUser:e.user,location:e.router.location,message:e.message,pagination:e.users.pagination,users:e.users.data})),(e=>({loadUsers:t=>{e(H("getData","users",t))},updateUser:(t,s)=>{e(H("updateData","users",{username:t,admin:s},!1))}})))(te),ae=s(223);function re(){const e=Object(ae.a)().t;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsx)("title",{children:"fittrackee - 404"})}),Object(a.jsx)("h1",{className:"page-title",children:e("Page not found")})]})}var oe=Object(w.a)()(Object(O.c)((e=>({appConfig:e.application.config,user:e.user})))((function(e){const t=e.appConfig,s=e.t,r=e.user;return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",s("administration:Administration")]})}),Object(a.jsx)("div",{className:"container dashboard",children:r.admin?Object(a.jsxs)(g.d,{children:[Object(a.jsx)(g.b,{exact:!0,path:"/admin",render:()=>Object(a.jsx)($,{appConfig:t,t:s})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/application",render:()=>Object(a.jsx)(J,{appConfig:t,t:s,isInEdition:!1})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/application/edit",render:()=>Object(a.jsx)(J,{appConfig:t,t:s,isInEdition:!0})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/sports",render:()=>Object(a.jsx)(Q,{t:s})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/users",render:()=>Object(a.jsx)(se,{t:s})}),Object(a.jsx)(g.b,{component:re})]}):Object(a.jsx)(re,{})})]})}))),ce=s(892),ne=s(24),ie=s(911),le=s(226),de=s.n(le);const ue=["#55a8a3","#98C3A9","#D0838A","#ECC77E","#926692","#929292","#428bca"],me=[{record_type:"AS",label:"Ave. speed"},{record_type:"FD",label:"Farest distance"},{record_type:"LD",label:"Longest duration"},{record_type:"MS",label:"Max. speed"}],je=(e,t=null,s=null)=>(t||(t="yyyy/MM/dd"),s||(s="HH:mm"),{workout_date:e?Object(y.a)(e,t):null,workout_time:e?Object(y.a)(e,s):null}),pe=e=>{let t=new Date(0);return t=Object(ie.a)(t.setSeconds(e),1),t.getTime()},he=e=>{for(let t=0;t{const s=e.label.toLowerCase(),a=t.label.toLowerCase();return s>a?1:se.filter((e=>!s||e.is_active)).map((e=>Object(k.a)(Object(k.a)({},e),{},{label:t("sports:".concat(e.label))}))).sort(be);class Oe{static loginOrRegisterOrPasswordReset(e,t){const s={url:"auth/".concat(e),method:"POST",noAuthorization:!0,body:t,type:"application/json"};return T(s)}static deletePicture(){return T({url:"auth/picture",method:"DELETE"})}}const ge=e=>({type:"PICTURE_ERROR",message:e}),fe=e=>({type:"PROFILE_UPDATE_ERROR",message:e}),we=()=>e=>window.localStorage.getItem("authToken")?e(ve()):{type:"LOGOUT"},ve=()=>e=>L.getData("auth/profile").then((t=>"success"===t.status?(e(H("getData","sports")),t.data.isAuthenticated=!0,t.data.language&&e(q(t.data.language)),e({type:"PROFILE_SUCCESS",profil:t.data})):e({type:"PROFILE_ERROR",message:t.message}))).catch((e=>{throw e})),ke=(e,t)=>s=>{if("register"===t||"password/update"===t){const a=((e,t=!1)=>{const s=[];return!t&&(e.username.length<3||e.username.length>12)&&s.push("3 to 12 characters required for username."),e.password!==e.password_conf&&s.push("Password and password confirmation don't match."),e.password.length<8&&s.push("8 characters required for password."),s})(e,"password/update"===t);if(a.length>0)return s({type:"AUTH_ERRORS",messages:(e=>{let t=0;return e.map((e=>{const s={id:t,value:e};return t++,s}))})(a)})}return s(((e,t)=>s=>Oe.loginOrRegisterOrPasswordReset(e,t).then((t=>{if("success"===t.status){if("password/reset-request"===e)return Ma.push({pathname:"/password-reset/sent"});if("password/update"===e)return Ma.push({pathname:"/updated-password"});if("login"===e||"register"===e)return window.localStorage.setItem("authToken",t.auth_token),"register"===e&&s(V("config")),s(ve())}return s({type:"AUTH_ERROR",message:t.message})})).catch((e=>{throw e})))(t,e))},ye=(e,t=!1)=>s=>L.deleteData("users",e).then((e=>{204===e.status?(s(V("config")),t?Ma.push("/admin/users"):(s({type:"LOGOUT"}),Ma.push("/"))):e.json().then((e=>s(I("".concat(e.message)))))})).catch((e=>s(I("user|".concat(e))))),Ne=e=>({type:"SET_GPX",gpxContent:e}),_e=e=>({type:"SET_CHART_DATA",chartData:e}),Se=e=>t=>L.updateData("workouts",e).then((e=>{"success"===e.status?(t(we()),Ma.push("/workouts/".concat(e.data.workouts[0].id))):t(I("workouts|".concat(e.message))),t(W(!1))})).catch((e=>{t(W(!1)),t(I("workouts|".concat(e)))})),De=e=>t=>L.getData("workouts",e).then((e=>{"success"===e.status?e.data.workouts.length>0&&t({type:"PUSH_WORKOUTS",workouts:e.data.workouts}):t(I("workouts|".concat(e.message)))})).catch((e=>t(I("workouts|".concat(e)))));var Ce=Object(O.c)((e=>({appConfig:e.application.config,loading:e.loading})),(e=>({onAddWorkout:t=>{e(W(!0));const s=new FormData;s.append("file",t.target.form.gpxFile.files[0]),s.append("data",'{"sport_id": '.concat(t.target.form.sport.value,', "notes": "').concat(t.target.form.notes.value,'"}')),e((e=>t=>L.addDataWithFile("workouts",e).then((e=>{"created"===e.status?0===e.data.workouts.length?t(I("workouts|no correct file.")):1===e.data.workouts.length?(t(we()),Ma.push("/workouts/".concat(e.data.workouts[0].id))):(t(we()),Ma.push("/")):413===e.status?t(I("workouts|File size is greater than the allowed size")):t(I("workouts|".concat(e.message))),t(W(!1))})).catch((e=>{t(W(!1)),t(I("workouts|".concat(e)))})))(s))},onEditWorkout:(t,s)=>{e(Se({id:s.id,notes:t.target.form.notes.value,sport_id:+t.target.form.sport.value,title:t.target.form.title.value}))}})))((function(e){const t=e.appConfig,s=e.loading,r=e.onAddWorkout,o=e.onEditWorkout,c=e.sports,n=e.t,i=e.workout,l=i?i.sport_id:"",d=xe(c,n,!0),u="".concat(n("workouts:no folder inside"),", ").concat(t.gpx_limit_import," ").concat(n("workouts:files max"),", ").concat(n("workouts:max size"),": ").concat(D(t.max_zip_file_size)),m=D(t.max_single_file_size);return Object(a.jsxs)("form",{encType:"multipart/form-data",method:"post",onSubmit:e=>e.preventDefault(),children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[n("common:Sport"),":",Object(a.jsxs)("select",{className:"form-control input-lg",defaultValue:l,disabled:s,name:"sport",required:!0,children:[Object(a.jsx)("option",{value:""}),d.map((e=>Object(a.jsx)("option",{value:e.id,children:e.label},e.id)))]})]})}),i?Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[n("workouts:Title"),":",Object(a.jsx)("input",{name:"title",defaultValue:i?i.title:"",disabled:s,className:"form-control input-lg"})]})}):Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[Object(a.jsxs)(ce.a,{i18nKey:"workouts:gpxFile",children:[Object(a.jsx)("strong",{children:"gpx"})," file"]}),Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-question-circle","aria-hidden":"true","data-toggle":"tooltip",title:"".concat(n("workouts:max size"),": ").concat(m)})})," ",Object(a.jsxs)(ce.a,{i18nKey:"workouts:zipFile",children:["or ",Object(a.jsx)("strong",{children:" zip"})," file containing ",Object(a.jsx)("strong",{children:"gpx "}),"files"]}),Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-question-circle","aria-hidden":"true","data-toggle":"tooltip","data-placement":"top",title:u})})," ",":",Object(a.jsx)("input",{accept:".gpx, .zip",className:"form-control form-control-file gpx-file",disabled:s,name:"gpxFile",required:!0,type:"file"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[n("workouts:Notes"),":",Object(a.jsx)("textarea",{name:"notes",defaultValue:i?i.notes:"",disabled:s,className:"form-control input-lg",maxLength:"500"})]})}),s?Object(a.jsx)("div",{className:"loader"}):Object(a.jsxs)("div",{children:[Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",onClick:e=>i?o(e,i):r(e),value:n("common:Submit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ma.push("/"),value:n("common:Cancel")})]})]})}));var Ee=Object(O.c)((e=>({user:e.user})),(e=>({onAddOrEdit:(t,s)=>{const a=t.target.form.duration.value.split(":"),r=60*+a[0]*60+60*+a[1]+ +a[2],o={workout_date:"".concat(t.target.form.workout_date.value," ").concat(t.target.form.workout_time.value),distance:+t.target.form.distance.value,duration:r,notes:t.target.form.notes.value,sport_id:+t.target.form.sport_id.value,title:t.target.form.title.value};var c;s?(o.id=s.id,e(Se(o))):e((c=o,e=>L.addData("workouts/no_gpx",c).then((t=>{"created"===t.status?(e(we()),Ma.push("/workouts/".concat(t.data.workouts[0].id))):e(I("workouts|".concat(t.message)))})).catch((t=>e(I("workouts|".concat(t)))))))}})))((function(e){const t=e.onAddOrEdit,s=e.sports,r=e.t,o=e.user,c=e.workout,n=xe(s,r,!0);let i,l,d="";if(c){const e=je(P(c.workout_date,o.timezone),"yyyy-MM-dd");i=e.workout_date,l=e.workout_time,d=c.sport_id}return Object(a.jsxs)("form",{onSubmit:e=>e.preventDefault(),children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Title"),":",Object(a.jsx)("input",{name:"title",defaultValue:c?c.title:"",className:"form-control input-lg"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("common:Sport"),":",Object(a.jsxs)("select",{className:"form-control input-lg",defaultValue:d,name:"sport_id",required:!0,children:[Object(a.jsx)("option",{value:""}),n.map((e=>Object(a.jsx)("option",{value:e.id,children:e.label},e.id)))]})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Workout Date"),":",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("input",{name:"workout_date",defaultValue:i,className:"form-control col-md",required:!0,type:"date"}),Object(a.jsx)("input",{name:"workout_time",defaultValue:l,className:"form-control col-md",required:!0,type:"time"})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Duration"),":",Object(a.jsx)("input",{name:"duration",defaultValue:c?c.duration:"",className:"form-control col-xs-4",pattern:"^([0-9]*[0-9]):([0-5][0-9]):([0-5][0-9])$",placeholder:"hh:mm:ss",required:!0,type:"text"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Distance")," (km):",Object(a.jsx)("input",{name:"distance",defaultValue:c?c.distance:"",className:"form-control input-lg",min:0,required:!0,step:"0.001",type:"number"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Notes"),":",Object(a.jsx)("textarea",{name:"notes",defaultValue:c?c.notes:"",className:"form-control input-lg",maxLength:"500"})]})}),Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",onClick:e=>t(e,c),value:r("common:Submit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ma.push("/"),value:r("common:Cancel")})]})}));class Ae extends c.a.Component{constructor(e,t){super(e,t),this.state={withGpx:!0}}handleRadioChange(e){this.setState({withGpx:"withGpx"===e.target.name?e.target.value:!e.target.value})}render(){const e=this.props,t=e.loading,s=e.message,r=e.sports,o=e.t,c=e.workout,n=this.state.withGpx;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee -"," ",o(c?"workouts:Edit a workout":"workouts:Add a workout")]})}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(v,{message:s,t:o}),Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-2"}),Object(a.jsx)("div",{className:"col-md-8",children:Object(a.jsxs)("div",{className:"card add-workout",children:[Object(a.jsx)("h2",{className:"card-header text-center",children:o(c?"workouts:Edit a workout":"workouts:Add a workout")}),Object(a.jsx)("div",{className:"card-body",children:c?c.with_gpx?Object(a.jsx)(Ce,{workout:c,sports:r,t:o}):Object(a.jsx)(Ee,{workout:c,sports:r,t:o}):Object(a.jsxs)("div",{children:[Object(a.jsx)("form",{children:Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("label",{className:"radioLabel",children:[Object(a.jsx)("input",{className:"add-workout-radio",type:"radio",name:"withGpx",disabled:t,checked:n,onChange:e=>this.handleRadioChange(e)}),o("workouts:with gpx file")]})}),Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("label",{className:"radioLabel",children:[Object(a.jsx)("input",{className:"add-workout-radio",type:"radio",name:"withoutGpx",disabled:t,checked:!n,onChange:e=>this.handleRadioChange(e)}),o("workouts:without gpx file")]})})]})}),n?Object(a.jsx)(Ce,{sports:r,t:o}):Object(a.jsx)(Ee,{sports:r,t:o})]})})]})}),Object(a.jsx)("div",{className:"col-md-2"})]})})]})}}var Me=Object(w.a)()(Object(O.c)((e=>({loading:e.loading})))(Ae));var Te=Object(O.c)((e=>({message:e.message,sports:e.sports.data,user:e.user})))((function(e){const t=e.message,s=e.sports;return Object(a.jsx)("div",{children:Object(a.jsx)(Me,{workout:null,message:t,sports:s})})}));function Pe(e){const t=Object(ae.a)().t;return Object(a.jsx)("div",{className:"custom-modal-backdrop",children:Object(a.jsx)("div",{className:"custom-modal",children:Object(a.jsxs)("div",{className:"modal-content",children:[Object(a.jsxs)("div",{className:"modal-header",children:[Object(a.jsx)("h5",{className:"modal-title",children:e.title}),Object(a.jsx)("button",{type:"button",className:"close","aria-label":"Close",onClick:()=>e.close(),children:Object(a.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),Object(a.jsx)("div",{className:"modal-body",children:Object(a.jsx)("p",{children:e.text})}),Object(a.jsxs)("div",{className:"modal-footer",children:[Object(a.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>e.confirm(),children:t("common:Yes")}),Object(a.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:()=>e.close(),children:t("common:No")})]})]})})})}function Fe(e){const t=e.dataType,s=e.displayModal,r=e.segmentId,o=e.sport,c=e.t,n=e.title,i=e.user,l=e.workout,d=l?je(P(l.workout_date,i.timezone)):null,u="segment"===t&&1!==r?"/workouts/".concat(l.id,"/segment/").concat(r-1):"workout"===t&&l.previous_workout?"/workouts/".concat(l.previous_workout):null,m="segment"===t&&rs(!0),title:c("workouts:Delete workout")})]}):Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(K.a,{to:"/workouts/".concat(l.id),children:n})," ","- ",c("workouts:segment")," ",r]}),Object(a.jsx)("br",{}),d&&Object(a.jsx)("span",{className:"workout-date",children:"".concat(d.workout_date," - ").concat(d.workout_time)})]}),Object(a.jsx)("div",{className:"col-auto",children:m?Object(a.jsx)(K.a,{className:"unlink",to:m,children:Object(a.jsx)("i",{className:"fa fa-chevron-right","aria-hidden":"true",title:c("workouts:See next ".concat(t))})}):Object(a.jsx)("i",{className:"fa fa-chevron-right inactive-link","aria-hidden":"true",title:c("workouts:No next ".concat(t))})})]})})}var ze=s(25);class Re extends c.a.Component{constructor(e,t){super(e,t),this.state={displayDistance:!0,dataToHide:[]}}componentDidMount(){"workout"===this.props.dataType?this.props.loadWorkoutData(this.props.workout.id):this.props.loadSegmentData(this.props.workout.id,this.props.segmentId)}componentDidUpdate(e){("workout"===this.props.dataType&&e.workout.id!==this.props.workout.id||"workout"===this.props.dataType&&"segment"===e.dataType)&&this.props.loadWorkoutData(this.props.workout.id),"segment"===this.props.dataType&&e.segmentId!==this.props.segmentId&&this.props.loadSegmentData(this.props.workout.id,this.props.segmentId)}componentWillUnmount(){this.props.loadWorkoutData(null)}handleRadioChange(e){this.setState({displayDistance:"distance"===e.target.name?e.target.value:!e.target.value})}handleLegendChange(e){const t=this.state.dataToHide,s=e.target.name;t.find((e=>e===s))?t.splice(t.indexOf(s),1):t.push(s),this.setState({dataToHide:t})}displayData(e){return!this.state.dataToHide.find((t=>t===e))}render(){const e=this.props,t=e.chartData,s=e.t,r=e.updateCoordinates,o=this.state.displayDistance,c=t?parseInt(t.length/10,10):0;let n,i;return o?(n="distance",i="linear"):(n="duration",i="time"),Object(a.jsx)("div",{className:"container",children:t&&t.length>0?Object(a.jsxs)("div",{children:[Object(a.jsxs)("div",{className:"row chart-radio",children:[Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"radio",name:"distance",checked:o,onChange:e=>this.handleRadioChange(e)}),s("workouts:distance")]}),Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"radio",name:"duration",checked:!o,onChange:e=>this.handleRadioChange(e)}),s("workouts:duration")]})]}),Object(a.jsxs)("div",{className:"row chart-radio",children:[Object(a.jsx)("div",{className:"col-md-5"}),Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"checkbox",name:"speed",checked:this.displayData("speed"),onChange:e=>this.handleLegendChange(e)}),s("workouts:speed")]}),Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"checkbox",name:"elevation",checked:this.displayData("elevation"),onChange:e=>this.handleLegendChange(e)}),s("workouts:elevation")]}),Object(a.jsx)("div",{className:"col-md-5"})]}),Object(a.jsx)("div",{className:"row chart",children:Object(a.jsx)(ze.f,{height:300,children:Object(a.jsxs)(ze.d,{data:t,margin:{top:15,right:30,left:20,bottom:15},onMouseMove:e=>r(e.activePayload),onMouseLeave:()=>r(null),children:[Object(a.jsx)(ze.h,{allowDecimals:!1,dataKey:n,label:{value:s("workouts:".concat(n)),offset:0,position:"bottom"},scale:i,interval:c,tickFormatter:e=>o?e:Object(y.a)(e,"HH:mm:ss"),type:"number"}),Object(a.jsx)(ze.i,{label:{value:"".concat(s("workouts:speed")," (km/h)"),angle:-90,position:"left"},yAxisId:"left"}),Object(a.jsx)(ze.i,{label:{value:"".concat(s("workouts:elevation")," (m)"),angle:-90,position:"right"},yAxisId:"right",orientation:"right"}),this.displayData("elevation")&&Object(a.jsx)(ze.a,{yAxisId:"right",type:"linear",dataKey:"elevation",name:s("workouts:elevation"),fill:"#e5e5e5",stroke:"#cccccc",dot:!1,unit:" m"}),this.displayData("speed")&&Object(a.jsx)(ze.e,{yAxisId:"left",type:"linear",dataKey:"speed",name:s("workouts:speed"),stroke:"#8884d8",strokeWidth:2,dot:!1,unit:" km/h"}),Object(a.jsx)(ze.g,{labelFormatter:e=>o?"".concat(s("workouts:distance"),": ").concat(e," km"):"".concat(s("workouts:duration"),": ").concat(Object(y.a)(e,"HH:mm:ss"))})]})})}),Object(a.jsx)("div",{className:"chart-info",children:s("workouts:data from gpx, without any cleaning")})]}):s("workouts:No data to display")})}}var Le=Object(O.c)((e=>({chartData:e.chartData})),(e=>({loadWorkoutData:t=>{e((e=>t=>{if(e)return L.getData("workouts/".concat(e,"/chart_data")).then((e=>{"success"===e.status?t(_e(he(e.data.chart_data))):t(I("workouts|".concat(e.message)))})).catch((e=>t(I("workouts|".concat(e)))));t(_e(null))})(t))},loadSegmentData:(t,s)=>{e(((e,t)=>s=>{if(e)return L.getData("workouts/".concat(e,"/chart_data/segment/").concat(t)).then((e=>{"success"===e.status?s(_e(he(e.data.chart_data))):s(I("workouts|".concat(e.message)))})).catch((e=>s(I("workouts|".concat(e)))));s(_e(null))})(t,s))}})))(Re);function Ue(e){const t=e.t,s=e.workout;return Object(a.jsx)("div",{className:"container",children:s.weather_start&&s.weather_end&&Object(a.jsxs)("table",{className:"table table-borderless weather-table text-center",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{}),Object(a.jsxs)("th",{children:[t("workouts:Start"),Object(a.jsx)("br",{}),Object(a.jsx)("img",{className:"weather-img",src:"/img/weather/".concat(s.weather_start.icon,".png"),alt:"workout weather (".concat(s.weather_start.icon,")"),title:s.weather_start.summary})]}),Object(a.jsxs)("th",{children:[t("workouts:End"),Object(a.jsx)("br",{}),Object(a.jsx)("img",{className:"weather-img",src:"/img/weather/".concat(s.weather_end.icon,".png"),alt:"workout weather (".concat(s.weather_end.icon,")"),title:s.weather_end.summary})]})]})}),Object(a.jsxs)("tbody",{children:[Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{children:Object(a.jsx)("img",{className:"weather-img-small",src:"/img/weather/temperature.png",alt:"Temperatures"})}),Object(a.jsxs)("td",{children:[Number(s.weather_start.temperature).toFixed(1),"\xb0C"]}),Object(a.jsxs)("td",{children:[Number(s.weather_end.temperature).toFixed(1),"\xb0C"]})]}),Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{children:Object(a.jsx)("img",{className:"weather-img-small",src:"/img/weather/pour-rain.png",alt:"Temperatures"})}),Object(a.jsxs)("td",{children:[Number(100*s.weather_start.humidity).toFixed(1),"%"]}),Object(a.jsxs)("td",{children:[Number(100*s.weather_end.humidity).toFixed(1),"%"]})]}),Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{children:Object(a.jsx)("img",{className:"weather-img-small",src:"/img/weather/breeze.png",alt:"Temperatures"})}),Object(a.jsxs)("td",{children:[Number(s.weather_start.wind).toFixed(1),"m/s"]}),Object(a.jsxs)("td",{children:[Number(s.weather_end.wind).toFixed(1),"m/s"]})]})]})]})})}function Ie(e){const t=e.t,s=e.workout,r="0:00:00"!==s.pauses&&null!==s.pauses;return Object(a.jsxs)("div",{className:"workout-details",children:[Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-clock-o custom-fa","aria-hidden":"true"}),t("workouts:Duration"),": ",s.moving,s.records&&s.records.find((e=>"LD"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})}),r&&Object(a.jsxs)("span",{children:[Object(a.jsx)("br",{}),"(",t("workouts:pauses"),": ",s.pauses,","," ",t("workouts:total duration"),": ",s.duration,")"]})]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-road custom-fa","aria-hidden":"true"}),t("workouts:Distance"),": ",s.distance," km",s.records&&s.records.find((e=>"FD"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})})]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-tachometer custom-fa","aria-hidden":"true"}),t("workouts:Average speed"),": ",s.ave_speed," km/h",s.records&&s.records.find((e=>"AS"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})}),Object(a.jsx)("br",{}),t("workouts:Max. speed"),": ",s.max_speed," km/h",s.records&&s.records.find((e=>"MS"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})})]}),s.min_alt&&s.max_alt&&Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fi-mountains custom-fa"}),t("workouts:Min. altitude"),": ",s.min_alt,"m",Object(a.jsx)("br",{}),t("workouts:Max. altitude"),": ",s.max_alt,"m"]}),s.ascent&&s.descent&&Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-location-arrow custom-fa"}),t("workouts:Ascent"),": ",s.ascent,"m",Object(a.jsx)("br",{}),t("workouts:Descent"),": ",s.descent,"m"]}),Object(a.jsx)(Ue,{workout:s,t:t})]})}var We=s(896),He=s(893),qe=s(912),Be=s(894),Ve=s(895),Ge=s(237),Je=s.n(Ge);function Ke({bounds:e,coordinates:t,jsonData:s,mapAttribution:r}){return Object(He.a)().fitBounds(e),Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(qe.a,{attribution:r,url:"".concat(C,"workouts/map_tile/{s}/{z}/{x}/{y}.png")}),Object(a.jsx)(Be.a,{data:s},Je()(s)),t.latitude&&Object(a.jsx)(Ve.a,{position:[t.latitude,t.longitude]})]})}class Ye extends c.a.Component{constructor(e,t){super(e,t),this.state={zoom:13}}componentDidMount(){"workout"===this.props.dataType?this.props.loadWorkoutGpx(this.props.workout.id):this.props.loadSegmentGpx(this.props.workout.id,this.props.segmentId)}componentDidUpdate(e){("workout"===this.props.dataType&&e.workout.id!==this.props.workout.id||"workout"===this.props.dataType&&"segment"===e.dataType)&&this.props.loadWorkoutGpx(this.props.workout.id),"segment"===this.props.dataType&&e.segmentId!==this.props.segmentId&&this.props.loadSegmentGpx(this.props.workout.id,this.props.segmentId)}componentWillUnmount(){this.props.loadWorkoutGpx(null)}render(){const e=this.props,t=e.coordinates,s=e.gpxContent,r=e.mapAttribution,o=e.workout,c=(e=>{let t;if(e){const s=(new DOMParser).parseFromString(e,"text/xml");t=de.a.gpx(s)}return{jsonData:t}})(s).jsonData,n=[[o.bounds[0],o.bounds[1]],[o.bounds[2],o.bounds[3]]];return Object(a.jsx)("div",{children:c&&Object(a.jsx)(We.a,{zoom:this.state.zoom,bounds:n,boundsOptions:{padding:[10,10]},children:Object(a.jsx)(Ke,{bounds:n,coordinates:t,jsonData:c,mapAttribution:r})})})}}var Xe=Object(O.c)((e=>({gpxContent:e.gpx,mapAttribution:e.application.config.map_attribution})),(e=>({loadWorkoutGpx:t=>{e((e=>t=>{if(e)return L.getData("workouts/".concat(e,"/gpx")).then((e=>{"success"===e.status?t(Ne(e.data.gpx)):t(I("workouts|".concat(e.message)))})).catch((e=>t(I("workouts|".concat(e)))));t(Ne(null))})(t))},loadSegmentGpx:(t,s)=>{e(((e,t)=>s=>{if(e)return L.getData("workouts/".concat(e,"/gpx/segment/").concat(t)).then((e=>{"success"===e.status?s(Ne(e.data.gpx)):s(I("workouts|".concat(e.message)))})).catch((e=>s(I("workouts|".concat(e)))));s(Ne(null))})(t,s))}})))(Ye);function $e(e){const t=e.t;return Object(a.jsx)("div",{className:"workout-no-map text-center",children:t("workouts:No Map")})}function Ze(e){const t=e.notes,s=e.t;return Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body",children:["Notes",Object(a.jsx)("div",{className:"workout-notes",children:t||s("workouts:No notes")})]})})})})}function Qe(e){const t=e.segments,s=e.t;return Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body",children:[s("workouts:Segments"),Object(a.jsx)("div",{className:"workout-segments",children:Object(a.jsx)("ul",{children:t.map(((e,t)=>Object(a.jsxs)("li",{className:"workout-segments-list",children:[Object(a.jsxs)(K.a,{to:"/workouts/".concat(e.workout_id,"/segment/").concat(t+1),children:[s("workouts:segment")," ",t+1]})," ","(",s("workouts:distance"),": ",e.distance," km,"," ",s("workouts:duration"),": ",e.duration,")"]},"segment-".concat(t))))})})]})})})})}class et extends c.a.Component{constructor(e,t){super(e,t),this.state={displayModal:!1,coordinates:{latitude:null,longitude:null}}}componentDidMount(){this.props.loadWorkout(this.props.match.params.workoutId)}componentDidUpdate(e){e.match.params.workoutId!==this.props.match.params.workoutId&&this.props.loadWorkout(this.props.match.params.workoutId)}displayModal(e){this.setState((t=>Object(k.a)(Object(k.a)({},t),{},{displayModal:e})))}updateCoordinates(e){const t=e&&e.length>0?{latitude:e[0].payload.latitude,longitude:e[0].payload.longitude}:{latitude:null,longitude:null};this.setState((e=>Object(k.a)(Object(k.a)({},e),{},{coordinates:t})))}render(){const e=this.props,t=e.message,s=e.onDeleteWorkout,r=e.sports,o=e.t,c=e.user,n=e.workouts,i=this.state,l=i.coordinates,d=i.displayModal,u=Object(ne.a)(n,1)[0],m=u?u.title:o("workouts:Workout"),j=u?r.filter((e=>e.id===u.sport_id)):[],p=Object(ne.a)(j,1)[0],h=parseInt(this.props.match.params.segmentId),b=h>=0?"segment":"workout";return Object(a.jsxs)("div",{className:"workout-page",children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",m]})}),t?Object(a.jsx)(v,{message:t,t:o}):Object(a.jsxs)("div",{className:"container",children:[d&&Object(a.jsx)(Pe,{title:o("common:Confirmation"),text:o("workouts:Are you sure you want to delete this workout?"),confirm:()=>{s(u.id),this.displayModal(!1)},close:()=>this.displayModal(!1)}),u&&p&&1===n.length&&Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)(Fe,{workout:u,dataType:b,segmentId:h,sport:p,t:o,title:m,user:c,displayModal:()=>this.displayModal(!0)})}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-8",children:u.with_gpx?Object(a.jsx)(Xe,{workout:u,coordinates:l,dataType:b,segmentId:h}):Object(a.jsx)($e,{t:o})}),Object(a.jsx)("div",{className:"col",children:Object(a.jsx)(Ie,{workout:"workout"===b?u:u.segments[h-1],t:o})})]})})]})})}),u.with_gpx&&Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("div",{className:"row",children:Object(a.jsxs)("div",{className:"col",children:[Object(a.jsx)("div",{className:"chart-title",children:o("workouts:Chart")}),Object(a.jsx)(Le,{workout:u,dataType:b,segmentId:h,t:o,updateCoordinates:e=>this.updateCoordinates(e)})]})})})})})}),"workout"===b&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Ze,{notes:u.notes,t:o}),u.segments.length>1&&Object(a.jsx)(Qe,{segments:u.segments,t:o})]})]})]})]})}}var tt=Object(w.a)()(Object(O.c)((e=>({workouts:e.workouts.data,message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadWorkout:t=>{e(H("getData","workouts",{id:t}))},onDeleteWorkout:t=>{var s;e((s=t,e=>L.deleteData("workouts",s).then((t=>{var a;204===t.status?Promise.resolve(e((a=s,{type:"REMOVE_WORKOUT",workoutId:a}))).then((()=>e(we()))).then((()=>Ma.push("/"))):e(I("workouts|".concat(t.status)))})).catch((t=>e(I("workouts|".concat(t)))))))}})))(et));class st extends c.a.Component{componentDidMount(){this.props.loadWorkout(this.props.match.params.workoutId)}render(){const e=this.props,t=e.message,s=e.sports,r=e.workouts,o=Object(ne.a)(r,1)[0];return Object(a.jsx)("div",{children:s.length>0&&Object(a.jsx)(Me,{workout:o,message:t,sports:s})})}}var at=Object(O.c)((e=>({workouts:e.workouts.data,message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadWorkout:t=>{e(H("getData","workouts",{id:t}))}})))(st);var rt=Object(O.c)((e=>({user:e.user})))((function(){return Object(a.jsx)("div",{children:M()?Object(a.jsxs)(g.d,{children:[Object(a.jsx)(g.b,{exact:!0,path:"/workouts/add",component:Te}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/:workoutId",component:tt}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/:workoutId/edit",component:at}),Object(a.jsx)(g.b,{path:"/workouts/:workoutId/segment/:segmentId",component:tt}),Object(a.jsx)(g.b,{component:re})]}):Object(a.jsx)(g.a,{to:"/login"})})}));class ot extends c.a.PureComponent{render(){const e=this.props.t;return Object(a.jsx)("div",{className:"card text-center",children:Object(a.jsxs)("div",{className:"card-body",children:[e("common:No workouts.")," ",Object(a.jsx)(K.a,{to:{pathname:"/workouts/add"},children:e("dashboard:Upload one !")})]})})}}class ct extends c.a.PureComponent{render(){const e=this.props,t=e.loadWorkouts,s=e.sports,r=e.t,o=e.updateParams,c=xe(s,r);return Object(a.jsx)("div",{className:"card",children:Object(a.jsx)("div",{className:"card-body workout-filter",children:Object(a.jsxs)("form",{onSubmit:e=>e.preventDefault(),children:[Object(a.jsxs)("div",{className:"form-group",children:[Object(a.jsxs)("label",{children:[r("workouts:From"),":",Object(a.jsx)("input",{className:"form-control col-md",name:"from",onChange:e=>o(e),type:"date"})]}),Object(a.jsxs)("label",{children:[r("workouts:To"),":",Object(a.jsx)("input",{className:"form-control col-md",name:"to",onChange:e=>o(e),type:"date"})]})]}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("common:Sport"),":",Object(a.jsxs)("select",{className:"form-control input-lg",name:"sport_id",onChange:e=>o(e),children:[Object(a.jsx)("option",{value:""}),c.map((e=>Object(a.jsx)("option",{value:e.id,children:e.label},e.id)))]})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Distance")," (km):",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"distance_from",onChange:e=>o(e),step:"1",type:"number"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"distance_to",onChange:e=>o(e),step:"1",type:"number"})})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Duration"),":",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",name:"duration_from",onChange:e=>o(e),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",name:"duration_to",onChange:e=>o(e),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"})})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Average speed")," (km/h):",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"ave_speed_from",onChange:e=>o(e),step:"1",type:"number"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"ave_speed_to",onChange:e=>o(e),step:"1",type:"number"})})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Max. speed")," (km/h):",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"max_speed_from",onChange:e=>o(e),step:"1",type:"number"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"max_speed_to",onChange:e=>o(e),step:"1",type:"number"})})]})})]})}),Object(a.jsx)("input",{className:"btn btn-primary btn-lg btn-block",onClick:()=>t(),type:"submit",value:r("workouts:Filter")})]})})})}}class nt extends c.a.PureComponent{render(){const e=this.props,t=e.display,s=e.workout;return Object(a.jsxs)("div",{className:"workout-map".concat("list"===t?"-list":""),children:[Object(a.jsx)("img",{src:"".concat(C,"workouts/map/").concat(s.map,"?").concat(Date.now()),alt:"workout map"}),Object(a.jsxs)("div",{className:"map-attribution".concat("list"===t?"-list":""),children:[Object(a.jsx)("span",{className:"map-attribution-text",children:"\xa9"}),Object(a.jsx)("a",{className:"map-attribution-text",href:"http://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer",children:"OpenStreetMap"})]})]})}}class it extends c.a.PureComponent{render(){const e=this.props,t=e.loading,s=e.sports,r=e.t,o=e.user,c=e.workouts;return Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsxs)("table",{className:"table",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{scope:"col"}),Object(a.jsx)("th",{scope:"col",children:r("common:Workout")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Date")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Distance")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Duration")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Ave. speed")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Max. speed")})]})}),Object(a.jsx)("tbody",{children:!t&&s&&c.map(((e,t)=>Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("common:Sport")}),Object(a.jsx)("img",{className:"workout-sport",src:s.filter((t=>t.id===e.sport_id)).map((e=>e.img)),alt:"workout sport logo"})]}),Object(a.jsxs)("td",{className:"workout-title",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("common:Workout")}),Object(a.jsx)(K.a,{to:"/workouts/".concat(e.id),children:e.title}),e.map&&Object(a.jsx)(nt,{workout:e,display:"list"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Date")}),Object(y.a)(P(e.workout_date,o.timezone),"dd/MM/yyyy HH:mm")]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Distance")}),Number(e.distance).toFixed(2)," km"]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Duration")}),e.moving]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Ave. speed")}),e.ave_speed," km/h"]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Max. speed")}),e.max_speed," km/h"]})]},t)))})]}),t&&Object(a.jsx)("div",{className:"loader"})]})})}}class lt extends c.a.Component{constructor(e,t){super(e,t),this.state={params:{page:1,per_page:10}}}componentDidMount(){this.props.loadWorkouts(this.state.params)}setParams(e){const t=this.state.params;""===e.target.value?delete t[e.target.name]:t[e.target.name]=e.target.value,t.page=1,this.setState(t)}render(){const e=this.props,t=e.loading,s=e.loadWorkouts,r=e.loadMoreWorkouts,o=e.message,c=e.sports,n=e.t,i=e.user,l=e.workouts,d=this.state.params,u=!(l.length>0)||null===l[l.length-1].previous_workout;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",n("common:Workouts")]})}),o?Object(a.jsx)(v,{message:o,t:n}):Object(a.jsx)("div",{className:"container history",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-3",children:Object(a.jsx)(ct,{sports:c,loadWorkouts:()=>s(d),t:n,updateParams:e=>this.setParams(e)})}),Object(a.jsxs)("div",{className:"col-md-9 workouts-result",children:[Object(a.jsx)(it,{workouts:l,loading:t,sports:c,t:n,user:i}),!u&&Object(a.jsx)("input",{type:"submit",className:"btn btn-default btn-md btn-block",value:"Load more workouts",onClick:()=>{d.page+=1,r(d),this.setState(d)}}),0===l.length&&Object(a.jsx)(ot,{t:n})]})]})})]})}}var dt=Object(w.a)()(Object(O.c)((e=>({workouts:e.workouts.data,loading:e.loading,message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadWorkouts:t=>{e(H("getData","workouts",t))},loadMoreWorkouts:t=>{e(De(t))}})))(lt));var ut=Object(w.a)()(Object(O.c)((e=>({appConfig:e.application.config,pathname:e.router.location.pathname,message:e.message})),(e=>({onDeletePicture:()=>{e((e=>Oe.deletePicture().then((t=>204===t.status?e(ve()):e(ge(t.message)))).catch((e=>{throw e}))))},onUploadPicture:t=>{e((e=>t=>{e.preventDefault();const s=new FormData;return s.append("file",e.target.picture.files[0]),e.target.reset(),L.addDataWithFile("auth/picture",s).then((e=>{if("success"===e.status)return t(ve());const s=413===e.status?"Error during picture update, file size exceeds max size.":e.message;return t(ge(s))})).catch((e=>{throw e}))})(t))}})))((function({appConfig:e,displayModal:t,editable:s,isDeletable:r,message:o,onDeletePicture:c,onUploadPicture:n,pathname:i,t:l,user:d}){const u=d.created_at?Object(y.a)(new Date(d.created_at),"dd/MM/yyyy HH:mm"):"",m=d.birth_date?Object(y.a)(new Date(d.birth_date),"dd/MM/yyyy"):"",j=D(e.max_single_file_size);return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",l("user:Profile")]})}),Object(a.jsx)(v,{message:o,t:l}),Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("h1",{className:"page-title",children:l("user:Profile")}),Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col-md-12",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header userName",children:Object(a.jsx)("strong",{children:d.username})}),Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsxs)("div",{className:"row",children:[Object(a.jsxs)("div",{className:"col-md-8",children:[Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Email")}),": ",d.email]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Registration Date")}),": ",u]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:First Name")}),": ",d.first_name]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Last Name")}),": ",d.last_name]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Birth Date")}),": ",m]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Location")}),": ",d.location]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Bio")}),":"," ",d.bio]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Language")}),": ",d.language]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Timezone")}),": ",d.timezone]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:First day of week")}),": ",d.weekm?l("user:Monday"):l("user:Sunday")]})]}),Object(a.jsxs)("div",{className:"col-md-4",children:[!0===d.picture&&Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"Profile",src:"".concat(C,"users/").concat(d.username,"/picture")+"?".concat(Date.now()),className:"img-fluid App-profile-img-small"}),s&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("br",{}),Object(a.jsx)("button",{type:"submit",onClick:()=>c(),children:l("user:Delete picture")}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{})]})]}),s&&Object(a.jsxs)("form",{encType:"multipart/form-data",onSubmit:e=>n(e),children:[Object(a.jsx)("input",{type:"file",name:"picture",accept:".png,.jpg,.gif"}),Object(a.jsx)("br",{}),Object(a.jsx)("button",{type:"submit",children:l("user:Send")})," (max. size: ".concat(j,")")]})," "]})]}),s&&Object(a.jsx)("button",{className:"btn btn-primary",onClick:()=>Ma.push("/profile/edit"),children:l("common:Edit")}),r&&Object(a.jsx)("button",{className:"btn btn-danger",onClick:()=>t(!0),children:l("user:Delete user account")}),Object(a.jsx)("button",{className:"btn btn-secondary",onClick:()=>"/profile"===i?Ma.push("/"):Ma.go(-1),children:l("/profile"===i?"common:Back to home":"common:Back")})]})]})})})]})]})})));var mt=Object(w.a)()(Object(O.c)((e=>({user:e.user})))((function({t:e,user:t}){return Object(a.jsx)("div",{children:Object(a.jsx)(ut,{editable:!0,t:e,user:t})})}))),jt=s(897),pt=s(898),ht=s(899),bt=s(900),xt=s(238),Ot=s(242),gt=s(901),ft=s(902),wt=s(107),vt=s(903),kt=s(144);function yt(e){const t=e.isDisabled,s=e.isMore,r=e.sportImg,o=e.workout;return Object(a.jsx)(K.a,{className:"calendar-workout".concat(s),to:"/workouts/".concat(o.id),children:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("img",{alt:"workout sport logo",className:"workout-sport ".concat(t),src:r,title:o.title}),o.records.length>0&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa-small","aria-hidden":"true",title:o.records.map((e=>" ".concat(me.filter((t=>t.record_type===e.record_type))[0].label)))})})]})})}class Nt extends c.a.Component{constructor(e,t){super(e,t),this.state={isHidden:!0}}handleDisplayMore(){this.setState({isHidden:!this.state.isHidden})}render(){const e=this.props,t=e.dayWorkouts,s=e.isDisabled,r=e.sports,o=this.state.isHidden;return Object(a.jsxs)("div",{children:[t.map((e=>Object(a.jsx)(yt,{workout:e,isDisabled:s,isMore:"",sportImg:r.filter((t=>t.id===e.sport_id)).map((e=>e.img))},e.id))),t.length>2&&Object(a.jsx)("i",{className:"fa fa-".concat(o?"plus":"times"," calendar-more"),"aria-hidden":"true",onClick:()=>this.handleDisplayMore(),title:"show more workouts"}),!o&&Object(a.jsx)("div",{className:"calendar-display-more",children:t.map((e=>Object(a.jsx)(yt,{workout:e,isDisabled:s,isMore:"-more",sportImg:r.filter((t=>t.id===e.sport_id)).map((e=>e.img))},e.id)))})]})}}const _t=(e,t)=>{const s=Object(jt.a)(e),a=Object(pt.a)(e),r=t?1:0;return{start:Object(ht.a)(s,{weekStartsOn:r}),end:Object(bt.a)(a)}};class St extends c.a.Component{constructor(e,t){super(e,t);const s=new Date;this.state={currentMonth:s,startDate:_t(s,e.weekm).start,endDate:_t(s,e.weekm).end,weekStartOnMonday:e.weekm}}componentDidMount(){this.props.loadMonthWorkouts(this.state.startDate,this.state.endDate)}renderHeader(e){return Object(a.jsxs)("div",{className:"header row flex-middle",children:[Object(a.jsx)("div",{className:"col col-start",onClick:()=>this.handlePrevMonth(),children:Object(a.jsx)("i",{className:"fa fa-chevron-left","aria-hidden":"true"})}),Object(a.jsx)("div",{className:"col col-center",children:Object(a.jsx)("span",{children:Object(y.a)(this.state.currentMonth,"MMM yyyy",e)})}),Object(a.jsx)("div",{className:"col col-end",onClick:()=>this.handleNextMonth(),children:Object(a.jsx)("i",{className:"fa fa-chevron-right","aria-hidden":"true"})})]})}renderDays(e){const t=[],s=this.state.startDate;for(let r=0;r<7;r++)t.push(Object(a.jsx)("div",{className:"col col-center",children:Object(y.a)(Object(xt.a)(s,r),"EEE",e)},r));return Object(a.jsx)("div",{className:"days row",children:t})}filterWorkouts(e){const t=this.props,s=t.workouts,a=t.user;return s?s.filter((t=>Object(Ot.a)(P(t.workout_date,a.timezone),e))):[]}renderCells(){const e=this.state,t=e.currentMonth,s=e.startDate,r=e.endDate,o=e.weekStartOnMonday,c=this.props.sports,n=[];let i=[],l=s,d="";for(;l<=r;){for(let e=0;e<7;e++){d=Object(y.a)(l,"d");const s=this.filterWorkouts(l),r=Object(gt.a)(l,t)?"":"-disabled",n=o?[5,6].includes(e):[0,6].includes(e);i.push(Object(a.jsx)("div",{className:"col cell ".concat(n?" weekend":"").concat(Object(ft.a)(l)?" today":""),children:Object(a.jsxs)("div",{className:"img".concat(r),children:[Object(a.jsx)("span",{className:"number",children:d}),Object(a.jsx)(Nt,{dayWorkouts:s,isDisabled:r,sports:c})]})},l)),l=Object(xt.a)(l,1)}n.push(Object(a.jsx)("div",{className:"row",children:i},l)),i=[]}return Object(a.jsx)("div",{className:"body",children:n})}updateStateDate(e){const t=_t(e,this.state.weekStartOnMonday),s=t.start,a=t.end;this.setState({currentMonth:e,startDate:s,endDate:a}),this.props.loadMonthWorkouts(s,a)}handleNextMonth(){const e=Object(wt.a)(this.state.currentMonth,1);this.updateStateDate(e)}handlePrevMonth(){const e=Object(vt.a)(this.state.currentMonth,1);this.updateStateDate(e)}render(){const e={locale:"fr"===this.props.language?kt.fr:kt.enGB};return Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"calendar",children:[this.renderHeader(e),this.renderDays(e),this.renderCells()]})})}}var Dt=Object(O.c)((e=>({workouts:e.calendarWorkouts.data,language:e.language,sports:e.sports.data,user:e.user})),(e=>({loadMonthWorkouts:(t,s)=>{const a="yyyy-MM-dd";var r,o;e((r=Object(y.a)(t,a),o=Object(y.a)(s,a),e=>L.getData("workouts",{from:r,to:o,order:"desc",per_page:100}).then((t=>{"success"===t.status?e({type:"UPDATE_CALENDAR",workouts:t.data.workouts}):e(I("workouts|".concat(t.message)))})).catch((t=>e(I("workouts|".concat(t)))))))}})))(St);function Ct(e){const t=e.records,s=e.sports,r=e.t,o=e.user,c=xe(s,r),n=t.reduce(((e,t)=>{const s=c.find((e=>e.id===t.sport_id));return void 0===e[s.label]&&(e[s.label]={img:s.img,records:[]}),e[s.label].records.push(((e,t)=>{let s;switch(e.record_type){case"AS":case"MS":s="".concat(e.value," km/h");break;case"FD":s="".concat(e.value," km");break;default:s=e.value}const a=me.filter((t=>t.record_type===e.record_type)),r=Object(ne.a)(a,1)[0];return{workout_date:je(P(e.workout_date,t)).workout_date,workout_id:e.workout_id,id:e.id,record_type:r.label,value:s}})(t,o.timezone)),e}),{});return Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:r("workouts:Personal records")}),Object(a.jsx)("div",{className:"card-body",children:0===Object.keys(n).length?r("common:No records."):Object.keys(n).sort().map((e=>Object(a.jsxs)("div",{children:[Object(a.jsxs)("span",{className:"heading-span",children:[Object(a.jsx)("img",{alt:"".concat(e," logo"),className:"record-logo",src:n[e].img}),e]}),Object(a.jsxs)("table",{className:"table table-borderless table-sm record-table",children:[Object(a.jsx)("thead",{children:Object(a.jsx)("tr",{children:Object(a.jsxs)("th",{colSpan:"3",children:[Object(a.jsx)("img",{alt:"".concat(e," logo"),className:"record-logo",src:n[e].img}),e]})})}),Object(a.jsx)("tbody",{children:n[e].records.map((e=>Object(a.jsxs)("tr",{className:"record-tr",children:[Object(a.jsx)("td",{className:"record-td",children:r("workouts:".concat(e.record_type))}),Object(a.jsx)("td",{className:"record-td text-right",children:e.value}),Object(a.jsx)("td",{className:"record-td text-right",children:Object(a.jsx)(K.a,{to:"/workouts/".concat(e.workout_id),children:e.workout_date})})]},e.id)))})]})]},e)))})]})}var Et=s(239),At=s(904);const Mt=[{duration:"week",dateFormat:"yyyy-MM-dd",xAxis:"dd/MM"},{duration:"month",dateFormat:"yyyy-MM",xAxis:"MM/yyyy"},{duration:"year",dateFormat:"yyyy",xAxis:"yyyy"}],Tt=(e,t=!1)=>{let s="0";t&&(s=String(Math.floor(e/86400)),e%=86400);const a=String(Math.floor(e/3600)).padStart(2,"0");e%=3600;const r=String(Math.floor(e/60)).padStart(2,"0"),o=String(e%60).padStart(2,"0");return t?"".concat("0"===s?"":"".concat(s,"d:")).concat("00"===a?"":"".concat(a,"h:")).concat(r,"m:").concat(o,"s"):"".concat("00"===a?"":"".concat(a,":")).concat(r,":").concat(o)},Pt=(e,t)=>0===t?"":"distance"===e?"".concat(t.toFixed(2)," km"):"duration"===e?Tt(t):t,Ft=(e,t)=>{switch(e){case"week":return Object(xt.a)(t,7);case"year":return Object(Et.a)(t,1);case"month":default:return Object(wt.a)(t,1)}},zt=(e,t,s,a,r)=>{const o=[],c=[],n=[];for(let i=((e,t,s)=>{switch(e){case"week":return Object(ht.a)(t,{weekStartsOn:s?1:0});case"year":return Object(At.a)(t);case"month":default:return Object(jt.a)(t)}})(s.duration,s.start,r);i<=s.end;i=Ft(s.duration,i)){const r=Mt.filter((e=>e.duration===s.duration)),l=Object(ne.a)(r,1)[0],d=Object(y.a)(i,l.dateFormat),u=Object(y.a)(i,l.xAxis),m={date:u},j={date:u},p={date:u};e[d]&&Object.keys(e[d]).filter((e=>!a||a.includes(+e))).map((s=>{const a=t.filter((e=>e.id===+s))[0].label;return m[a]=e[d][s].nb_workouts,j[a]=e[d][s].total_distance,p[a]=e[d][s].total_duration,null})),o.push(m),c.push(j),n.push(p)}return{workouts:o,distance:c,duration:n}},Rt=(e,t)=>"duration"===e?Tt(t,!0):"distance"===e?t.toFixed(2):t;function Lt(e){if(e.active){const t=e.displayedData,s=e.payload,r=e.label;let o=0;return s.map((e=>o+=e.value)),Object(a.jsxs)("div",{className:"custom-tooltip",children:[Object(a.jsx)("p",{className:"custom-tooltip-label",children:r}),s.map((e=>Object(a.jsxs)("p",{style:{color:e.fill},children:[e.name,": ",Rt(t,e.value)," ",e.unit]},e.name))),s.length>0&&Object(a.jsxs)("p",{children:["Total: ",Rt(t,o)]})]})}return null}function Ut(e){const t=e.displayedData,s=e.x,r=e.y,o=e.width,c=e.value;if(!c)return null;const n=Pt(t,c);return Object(a.jsx)("g",{children:Object(a.jsx)("text",{x:s+o/2,y:r-10,fill:"#666",fontSize:"11",textAnchor:"middle",dominantBaseline:"middle",children:n})})}class It extends c.a.PureComponent{constructor(e,t){super(e,t),this.state={displayedData:"distance"}}handleRadioChange(e){this.setState({displayedData:e.target.name})}render(){const e=this.state.displayedData,t=this.props,s=t.sports,r=t.stats,o=t.t;return 0===Object.keys(r).length?o("common:No workouts."):Object(a.jsxs)("div",{className:"chart-stats",children:[Object(a.jsxs)("div",{className:"row chart-radio",children:[Object(a.jsxs)("label",{className:"radioLabel col",children:[Object(a.jsx)("input",{type:"radio",name:"distance",checked:"distance"===e,onChange:e=>this.handleRadioChange(e)}),o("statistics:distance")]}),Object(a.jsxs)("label",{className:"radioLabel col",children:[Object(a.jsx)("input",{type:"radio",name:"duration",checked:"duration"===e,onChange:e=>this.handleRadioChange(e)}),o("statistics:duration")]}),Object(a.jsxs)("label",{className:"radioLabel col",children:[Object(a.jsx)("input",{type:"radio",name:"workouts",checked:"workouts"===e,onChange:e=>this.handleRadioChange(e)}),o("statistics:workouts")]})]}),Object(a.jsx)(ze.f,{height:300,children:Object(a.jsxs)(ze.c,{data:r[e],margin:{top:15,bottom:0},children:[Object(a.jsx)(ze.h,{dataKey:"date",interval:0}),Object(a.jsx)(ze.i,{tickFormatter:t=>Pt(e,t)}),Object(a.jsx)(ze.g,{content:Object(a.jsx)(Lt,{displayedData:e})}),s.map(((t,r)=>Object(a.jsx)(ze.b,{isAnimationActive:!1,dataKey:t.label,stackId:"a",fill:ue[r],label:r===s.length-1?Object(a.jsx)(Ut,{displayedData:e}):"",name:o("sports:".concat(t.label))},t.id)))]})})]})}}class Wt extends c.a.PureComponent{componentDidMount(){this.updateData()}componentDidUpdate(e){(this.props.user.username&&this.props.user.username!==e.user.username||this.props.statsParams!==e.statsParams)&&this.updateData()}updateData(){this.props.user.username&&this.props.loadWorkouts(this.props.user.username,this.props.user.weekm,this.props.statsParams)}render(){const e=this.props,t=e.displayedSports,s=e.sports,r=e.statistics,o=e.statsParams,c=e.displayEmpty,n=e.t,i=e.user;if(!c&&0===Object.keys(r).length)return Object(a.jsx)("span",{children:n("common:No workouts.")});const l=zt(r,s,o,t,i.weekm);return Object(a.jsx)(It,{sports:s,stats:l,t:n})}}var Ht=Object(O.c)((e=>({sports:e.sports.data,statistics:e.statistics.data,user:e.user})),(e=>({loadWorkouts:(t,s,a)=>{const r="yyyy-MM-dd",o="week"===a.duration?"".concat(a.duration).concat(s?"m":""):a.duration,c={from:Object(y.a)(a.start,r),to:Object(y.a)(a.end,r),time:o};e(((e,t,s)=>a=>L.getData("stats/".concat(e,"/").concat(t),s).then((e=>{"success"===e.status?a(U("statistics",e.data)):a(I("statistics|".concat(e.message)))})).catch((e=>a(I("statistics|".concat(e))))))(t,a.type,c))}})))(Wt);class qt extends c.a.Component{constructor(e,t){super(e,t);const s=new Date;this.state={start:Object(jt.a)(s),end:Object(pt.a)(s),duration:"week",type:"by_time"}}render(){const e=this.props.t;return Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:e("dashboard:This month")}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)(Ht,{displayEmpty:!1,statsParams:this.state,t:e})})]})}}function Bt(e){const t=e.t,s=e.user,r=s.total_duration.match(/day/g)?"".concat(s.total_duration.split(" ")[0]," ").concat(s.total_duration.match(/days/g)?t("common:days"):t("common:day")):"0 ".concat(t("common:days"),",");let o=s.total_duration.match(/day/g)?s.total_duration.split(", ")[1]:s.total_duration;return o="".concat(o.split(":")[0],"h ").concat(o.split(":")[1],"min"),Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-calendar fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:s.nb_workouts}),Object(a.jsx)("div",{children:"".concat(1===s.nb_workouts?t("common:workout"):t("common:workouts"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-road fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:Number(s.total_distance).toFixed(2)}),Object(a.jsx)("div",{children:"km"})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-clock-o fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:r}),Object(a.jsx)("div",{children:o})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-tags fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:s.nb_sports}),Object(a.jsx)("div",{children:"".concat(1===s.nb_sports?t("common:sport"):t("common:sports"))})]})]})})})]})}function Vt(e){const t=e.sports,s=e.t,r=e.user,o=e.workout;return Object(a.jsxs)("div",{className:"card workout-card text-center",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsxs)(K.a,{to:"/workouts/".concat(o.id),children:[t.filter((e=>e.id===o.sport_id)).map((e=>s("sports:".concat(e.label))))," ","-"," ",Object(y.a)(P(o.workout_date,r.timezone),"dd/MM/yyyy HH:mm")]})}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("div",{className:"row",children:[o.map&&Object(a.jsx)("div",{className:"col",children:Object(a.jsx)(nt,{workout:o})}),Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-clock-o","aria-hidden":"true"})," ",s("workouts:Duration"),": ",o.moving,o.map?Object(a.jsxs)("span",{children:[Object(a.jsx)("br",{}),Object(a.jsx)("br",{})]}):" - ",Object(a.jsx)("i",{className:"fa fa-road","aria-hidden":"true"})," ",s("workouts:Distance"),": ",o.distance," km"]})})]})})]})}class Gt extends c.a.Component{constructor(e,t){super(e,t),this.state={page:1}}componentDidMount(){this.props.loadWorkouts()}render(){const e=this.props,t=e.loadMoreWorkouts,s=e.message,r=e.records,o=e.sports,c=e.t,n=e.user,i=e.workouts,l=!(i.length>0)||null===i[i.length-1].previous_workout,d=this.state.page;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",c("common:Dashboard")]})}),s?Object(a.jsx)(v,{message:s,t:c}):i&&n.total_duration&&o.length>0&&Object(a.jsxs)("div",{className:"container dashboard",children:[Object(a.jsx)(Bt,{user:n,t:c}),Object(a.jsxs)("div",{className:"row",children:[Object(a.jsxs)("div",{className:"col-md-4",children:[Object(a.jsx)(qt,{t:c}),Object(a.jsx)(Ct,{t:c,records:r,sports:o,user:n})]}),Object(a.jsxs)("div",{className:"col-md-8",children:[Object(a.jsx)(Dt,{weekm:n.weekm}),i.length>0?i.map((e=>Object(a.jsx)(Vt,{workout:e,sports:o,t:c,user:n},e.id))):Object(a.jsx)(ot,{t:c}),!l&&Object(a.jsx)("input",{type:"submit",className:"btn btn-default btn-md btn-block",value:"Load more workouts",onClick:()=>{t(d+1),this.setState({page:d+1})}})]})]})]})]})}}var Jt=Object(w.a)()(Object(O.c)((e=>({workouts:e.workouts.data,message:e.message,records:e.records.data,sports:e.sports.data,user:e.user})),(e=>({loadWorkouts:()=>{e(H("getData","workouts",{page:1})),e(H("getData","records"))},loadMoreWorkouts:t=>{e(De({page:t}))}})))(Gt));function Kt(){return Object(a.jsx)("footer",{className:"footer",children:Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("strong",{children:"FitTrackee"})," v","0.4.5"," -"," ",Object(a.jsx)("a",{href:"https://github.com/SamR1/FitTrackee",target:"_blank",rel:"noopener noreferrer",children:"source code"})," ","under"," ",Object(a.jsx)("a",{href:"https://choosealicense.com/licenses/gpl-3.0/",target:"_blank",rel:"noopener noreferrer",children:"GPLv3"})," ","license -"," ",Object(a.jsx)("a",{href:"https://samr1.github.io/FitTrackee/",target:"_blank",rel:"noopener noreferrer",children:"documentation"})]})})}class Yt extends c.a.Component{componentDidMount(){this.props.UserLogout()}render(){return Object(a.jsx)("div",{className:"container dashboard",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-2"}),Object(a.jsx)("div",{className:"card col-8",children:Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("div",{className:"text-center",children:Object(a.jsxs)(ce.a,{i18nKey:"user:loggedOut",children:["You are now logged out. Click ",Object(a.jsx)(K.a,{to:"/login",children:"here"})," to log back in."]})})})}),Object(a.jsx)("div",{className:"col-2"})]})})}}var Xt=Object(O.c)((e=>({user:e.user})),(e=>({UserLogout:()=>{e({type:"LOGOUT"})}})))(Yt);function $t(){return($t=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var Qt=o.createElement("path",{d:"m466.916 27.803h-421.832c-24.859 0-45.084 20.225-45.084 45.084v366.226c0 24.859 20.225 45.084 45.084 45.084h421.832c24.859 0 45.084-20.225 45.084-45.084v-366.226c0-24.859-20.225-45.084-45.084-45.084z",fill:"#f0f9ff"}),es=o.createElement("path",{d:"m198.58 188.334-181.344-150.862c-7.75 6.107-13.456 14.691-15.905 24.554l164.142 136.551h33.102z",fill:"#f40055"}),ts=o.createElement("path",{d:"m313.425 198.576h33.93l163.447-135.973c-2.325-9.923-7.93-18.592-15.613-24.796l-181.764 151.211z",fill:"#c20044"}),ss=o.createElement("path",{d:"m165.472 313.425-164.141 136.549c2.449 9.863 8.155 18.447 15.905 24.553l181.344-150.861-.005-10.241z",fill:"#f40055"}),as=o.createElement("path",{d:"m313.425 313.425v9.557l181.765 151.211c7.683-6.204 13.288-14.874 15.613-24.796l-163.446-135.971z",fill:"#c20044"}),rs=o.createElement("path",{d:"m53.273 27.803 145.302 120.879v-120.879z",fill:"#406bd4"}),os=o.createElement("path",{d:"m313.425 150.571v-122.768h148.082z",fill:"#3257b0"}),cs=o.createElement("path",{d:"m394.732 198.575 117.268-97.556v97.556z",fill:"#3257b0"}),ns=o.createElement("g",{fill:"#406bd4"},o.createElement("path",{d:"m0 99.317v99.258h119.313z"}),o.createElement("path",{d:"m0 313.425v97.699l117.44-97.699z"}),o.createElement("path",{d:"m50.49 484.197 148.085-122.676v122.676z"})),is=o.createElement("path",{d:"m313.425 484.197v-124.139l149.221 124.139z",fill:"#3257b0"}),ls=o.createElement("path",{d:"m512 409.423-115.395-95.998h115.395z",fill:"#3257b0"}),ds=o.createElement("path",{d:"m512 222.142h-222.142v-194.339h-67.716v194.339h-222.142v67.716h222.142v194.339h67.716v-194.339h222.142z",fill:"#f40055"}),us=o.createElement("path",{d:"m289.858 222.142v-194.339h-33.858v456.394h33.858v-194.339h222.142v-67.716z",fill:"#c20044"});function ms(e,t){let s=e.title,a=e.titleId,r=Zt(e,["title","titleId"]);return o.createElement("svg",$t({id:"Capa_1",enableBackground:"new 0 0 512 512",height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,Qt,es,ts,ss,as,rs,os,cs,ns,is,ls,ds,us)}const js=o.forwardRef(ms);s.p;function ps(){return(ps=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var bs=o.createElement("path",{d:"m173.899 31.804h-8.707l-4.397-4h-115.711c-24.859-.001-45.084 20.224-45.084 45.083v366.226c0 24.859 20.225 45.084 45.084 45.084h115.711l6.348-4h6.755v-448.393z",fill:"#406bd4"}),xs=o.createElement("path",{d:"m466.916 27.803h-115.711l-4.523 4h-5.141v448.393h4.141l5.523 4h115.711c24.859 0 45.084-20.225 45.084-45.084v-366.225c0-24.859-20.225-45.084-45.084-45.084z",fill:"#c20044"}),Os=o.createElement("path",{d:"m160.795 27.803h190.409v456.394h-190.409z",fill:"#f0f9ff"}),gs=o.createElement("path",{d:"m256 27.803h95.205v456.394h-95.205z",fill:"#cee5f5"});function fs(e,t){let s=e.title,a=e.titleId,r=hs(e,["title","titleId"]);return o.createElement("svg",ps({id:"Capa_1",enableBackground:"new 0 0 512 512",height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,bs,xs,Os,gs)}const ws=o.forwardRef(fs);s.p;const vs=[{name:"en",selected:!0,flag:Object(a.jsx)(js,{})},{name:"fr",selected:!1,flag:Object(a.jsx)(ws,{})}];class ks extends o.Component{constructor(e){super(e),this.state={isOpen:!1}}toggleDropdown(){this.setState((e=>({isOpen:!e.isOpen})))}render(){const e=this.state.isOpen,t=this.props,s=t.language,r=t.onUpdateLanguage;return Object(a.jsx)("div",{className:"dropdown-wrapper",onClick:()=>this.toggleDropdown(),children:Object(a.jsx)("ul",{className:"dropdown-list i18n-flag",children:vs.filter((t=>e?t:t.name===s)).map((t=>Object(a.jsxs)("li",{className:"dropdown-item".concat(t.name===s&&e?" dropdown-item-selected":""),onClick:()=>r(t.name,s),children:[t.flag," ",t.name]},t.name)))})})}}var ys=Object(O.c)((e=>({language:e.language})),(e=>({onUpdateLanguage:(t,s)=>{t!==s&&e(q(t))}})))(ks);class Ns extends c.a.PureComponent{render(){const e=this.props,t=e.admin,s=e.isAuthenticated,r=e.picture,o=e.t,c=e.username;return Object(a.jsx)("header",{children:Object(a.jsx)("nav",{className:"navbar navbar-expand-lg navbar-light bg-light",children:Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("span",{className:"navbar-brand",children:"FitTrackee"}),Object(a.jsx)("button",{className:"navbar-toggler",type:"button","data-toggle":"collapse","data-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation",children:Object(a.jsx)("span",{className:"navbar-toggler-icon"})}),Object(a.jsxs)("div",{className:"collapse navbar-collapse",id:"navbarSupportedContent",children:[Object(a.jsxs)("ul",{className:"navbar-nav mr-auto",children:[Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/"},children:o("common:Dashboard")})}),s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/workouts/history"},children:o("Workouts")})}),s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/workouts/statistics"},children:o("common:Statistics")})}),t&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/admin"},children:"Admin"})}),s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/workouts/add"},children:Object(a.jsx)("strong",{children:o("common:Add workout")})})})]}),Object(a.jsxs)("ul",{className:"navbar-nav flex-row ml-md-auto d-none d-md-flex",children:[!s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/register"},children:o("user:Register")})}),!s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/login"},children:o("user:Login")})}),s&&Object(a.jsxs)(a.Fragment,{children:[!0===r?Object(a.jsx)("img",{alt:"Avatar",src:"".concat(C,"users/").concat(c,"/picture?").concat(Date.now()),className:"img-fluid App-nav-profile-img"}):Object(a.jsx)("i",{className:"fa fa-user-circle-o fa-2x no-picture","aria-hidden":"true"}),Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/profile"},children:c})}),Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(K.a,{className:"nav-link",to:{pathname:"/logout"},children:o("user:Logout")})})]}),Object(a.jsx)("li",{children:Object(a.jsx)(ys,{})})]})]})]})})})}}var _s=Object(w.a)()(Object(O.c)((({user:e})=>({admin:e.admin,isAuthenticated:e.isAuthenticated,picture:e.picture,username:e.username})))(Ns));function Ss(){return(Ss=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var Cs=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M468.683,287.265h-69.07c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h69.07 c4.147,0,7.508-3.361,7.508-7.508C476.191,290.626,472.83,287.265,468.683,287.265z"}))),Es=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M105.012,268.377L85.781,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L58.034,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C109.507,275.266,108.499,270.62,105.012,268.377z"}))),As=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M194.441,268.377L175.21,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.47,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.776l-17.471-11.243 c-3.487-2.245-8.133-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L147.463,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.47,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C198.936,275.266,197.928,270.62,194.441,268.377z"}))),Ms=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M283.871,268.377L264.64,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.471-11.243 c-3.486-2.245-8.134-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L236.892,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.886-1.216,6.32-3.446C288.366,275.266,287.358,270.62,283.871,268.377z"}))),Ts=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M373.3,268.377L354.069,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L326.322,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C377.795,275.266,376.787,270.62,373.3,268.377z"}))),Ps=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M271.792,330.359H15.016V181.642h93.1c4.147,0,7.508-3.361,7.508-7.508c0-4.147-3.361-7.508-7.508-7.508H12.513 C5.613,166.626,0,172.24,0,179.14v153.722c0,6.9,5.613,12.513,12.513,12.513h259.278c4.147,0,7.508-3.361,7.508-7.508 C279.299,333.72,275.939,330.359,271.792,330.359z"}))),Fs=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M499.487,166.626H162.174c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h334.811v148.716H323.848 c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h175.64c6.9,0,12.513-5.613,12.513-12.513V179.14 C512.001,172.24,506.387,166.626,499.487,166.626z"})));function zs(e,t){let s=e.title,a=e.titleId,r=Ds(e,["title","titleId"]);return o.createElement("svg",Ss({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512.001 512.001",style:{enableBackground:"new 0 0 512.001 512.001"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,Cs,Es,As,Ms,Ts,Ps,Fs)}const Rs=o.forwardRef(zs);s.p;function Ls(){return(Ls=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var Is=o.createElement("g",null,o.createElement("path",{d:"M339.798,260.429c0.13-0.026,0.257-0.061,0.385-0.094c0.109-0.028,0.219-0.051,0.326-0.084 c0.125-0.038,0.247-0.085,0.369-0.129c0.108-0.039,0.217-0.074,0.324-0.119c0.115-0.048,0.226-0.104,0.338-0.157 c0.109-0.052,0.22-0.1,0.327-0.158c0.107-0.057,0.208-0.122,0.312-0.184c0.107-0.064,0.215-0.124,0.319-0.194 c0.111-0.074,0.214-0.156,0.321-0.236c0.09-0.067,0.182-0.13,0.27-0.202c0.162-0.133,0.316-0.275,0.466-0.421 c0.027-0.026,0.056-0.048,0.083-0.075c0.028-0.028,0.052-0.059,0.079-0.088c0.144-0.148,0.284-0.3,0.416-0.46 c0.077-0.094,0.144-0.192,0.216-0.289c0.074-0.1,0.152-0.197,0.221-0.301c0.074-0.111,0.139-0.226,0.207-0.34 c0.057-0.096,0.118-0.19,0.171-0.289c0.062-0.115,0.114-0.234,0.169-0.351c0.049-0.104,0.101-0.207,0.146-0.314 c0.048-0.115,0.086-0.232,0.128-0.349c0.041-0.114,0.085-0.227,0.12-0.343c0.036-0.118,0.062-0.238,0.092-0.358 c0.029-0.118,0.063-0.234,0.086-0.353c0.028-0.141,0.045-0.283,0.065-0.425c0.014-0.1,0.033-0.199,0.043-0.3 c0.025-0.249,0.038-0.498,0.038-0.748V92.76c0-4.143-3.357-7.5-7.5-7.5h-236.25c-0.066,0-0.13,0.008-0.196,0.01 c-0.143,0.004-0.285,0.01-0.427,0.022c-0.113,0.009-0.225,0.022-0.337,0.037c-0.128,0.016-0.255,0.035-0.382,0.058 c-0.119,0.021-0.237,0.046-0.354,0.073c-0.119,0.028-0.238,0.058-0.356,0.092c-0.117,0.033-0.232,0.069-0.346,0.107 c-0.117,0.04-0.234,0.082-0.349,0.128c-0.109,0.043-0.216,0.087-0.322,0.135c-0.118,0.053-0.235,0.11-0.351,0.169 c-0.099,0.051-0.196,0.103-0.292,0.158c-0.116,0.066-0.23,0.136-0.343,0.208c-0.093,0.06-0.184,0.122-0.274,0.185 c-0.106,0.075-0.211,0.153-0.314,0.235c-0.094,0.075-0.186,0.152-0.277,0.231c-0.09,0.079-0.179,0.158-0.266,0.242 c-0.099,0.095-0.194,0.194-0.288,0.294c-0.047,0.05-0.097,0.094-0.142,0.145c-0.027,0.03-0.048,0.063-0.074,0.093 c-0.094,0.109-0.182,0.223-0.27,0.338c-0.064,0.084-0.13,0.168-0.19,0.254c-0.078,0.112-0.15,0.227-0.222,0.343 c-0.059,0.095-0.12,0.189-0.174,0.286c-0.063,0.112-0.118,0.227-0.175,0.342c-0.052,0.105-0.106,0.21-0.153,0.317 c-0.049,0.113-0.092,0.23-0.135,0.345c-0.043,0.113-0.087,0.225-0.124,0.339c-0.037,0.115-0.067,0.232-0.099,0.349 c-0.032,0.12-0.066,0.239-0.093,0.36c-0.025,0.113-0.042,0.228-0.062,0.342c-0.022,0.13-0.044,0.26-0.06,0.39 c-0.013,0.108-0.019,0.218-0.027,0.328c-0.01,0.14-0.019,0.28-0.021,0.421c-0.001,0.041-0.006,0.081-0.006,0.122v46.252 c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-29.595l66.681,59.037c-0.348,0.245-0.683,0.516-0.995,0.827l-65.687,65.687v-49.288 c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v9.164h-38.75c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h38.75v43.231 c0,4.143,3.357,7.5,7.5,7.5h236.25c0.247,0,0.494-0.013,0.74-0.037c0.115-0.011,0.226-0.033,0.339-0.049 C339.542,260.469,339.67,260.454,339.798,260.429z M330.834,234.967l-65.688-65.687c-0.042-0.042-0.087-0.077-0.13-0.117 l49.383-41.897c3.158-2.68,3.546-7.412,0.866-10.571c-2.678-3.157-7.41-3.547-10.571-0.866l-84.381,71.59l-98.444-87.158h208.965 V234.967z M185.878,179.888c0.535-0.535,0.969-1.131,1.308-1.765l28.051,24.835c1.418,1.255,3.194,1.885,4.972,1.885 c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z"}),o.createElement("path",{d:"M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5 S3.357,170.676,7.5,170.676z"}),o.createElement("path",{d:"M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5 S16.482,129.345,20.625,129.345z"}),o.createElement("path",{d:"M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z"}));function Ws(e,t){let s=e.title,a=e.titleId,r=Us(e,["title","titleId"]);return o.createElement("svg",Ls({id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 345.834 345.834",style:{enableBackground:"new 0 0 345.834 345.834"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,Is)}const Hs=o.forwardRef(Ws);s.p;function qs(e){const t=Object(ae.a)().t,s=e.action;return Object(a.jsx)("div",{className:"container dashboard",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-2"}),Object(a.jsx)("div",{className:"card col-8",children:Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("div",{className:"text-center ",children:["sent"===s&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:"svg-icon",children:Object(a.jsx)(Hs,{})}),t("user:Check your email. If your address is in our database, you'll received an email with a link to reset your password.")]}),"updated"===s&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:"svg-icon",children:Object(a.jsx)(Rs,{})}),Object(a.jsxs)(ce.a,{i18nKey:"user:updatedPasswordText",children:["Your password have been updated. Click",Object(a.jsx)(K.a,{to:"/login",children:"here"})," to log in."]})]})]})})}),Object(a.jsx)("div",{className:"col-2"})]})})}var Bs=s(240),Vs=s.n(Bs);class Gs extends c.a.Component{constructor(e,t){super(e,t),this.state={formData:{},displayModal:!1}}componentDidMount(){this.initForm()}componentDidUpdate(e){e.user!==this.props.user&&this.initForm()}initForm(){const e=this.props.user,t={};Object.keys(e).map((s=>null===e[s]?t[s]="":t[s]="birth_date"===s?Object(y.a)(new Date(e[s]),"yyyy-MM-DD"):e[s])),this.setState({formData:t})}handleFormChange(e){const t=this.state.formData;"weekm"===e.target.name?t.weekm="Monday"===e.target.value:t[e.target.name]=e.target.value,this.setState(t)}displayModal(e){this.setState((t=>Object(k.a)(Object(k.a)({},t),{},{displayModal:e})))}render(){const e=this.props,t=e.message,s=e.onDeleteUser,r=e.onHandleProfileFormSubmit,o=e.t,c=e.user,n=this.state,i=n.displayModal,l=n.formData;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",o("user:Profile Edition")]})}),l.isAuthenticated&&Object(a.jsxs)("div",{className:"container",children:[i&&Object(a.jsx)(Pe,{title:o("common:Confirmation"),text:o("user:Are you sure you want to delete your account? All data will be deleted, this cannot be undone."),confirm:()=>{s(c.username),this.displayModal(!1)},close:()=>this.displayModal(!1)}),Object(a.jsx)("h1",{className:"page-title",children:o("user:Profile Edition")}),Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-2"}),Object(a.jsx)("div",{className:"col-md-8",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:c.username}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("div",{className:"row",children:Object(a.jsxs)("div",{className:"col-md-12",children:[Object(a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),r(l)},children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Email"),":",Object(a.jsx)("input",{name:"email",className:"form-control input-lg",type:"text",value:l.email,readOnly:!0})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Registration Date"),":",Object(a.jsx)("input",{name:"createdAt",className:"form-control input-lg",type:"text",value:l.created_at,disabled:!0})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Password"),":",Object(a.jsx)("input",{name:"password",className:"form-control input-lg",type:"password",onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Password Confirmation"),":",Object(a.jsx)("input",{name:"password_conf",className:"form-control input-lg",type:"password",onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("hr",{}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:First Name"),":",Object(a.jsx)("input",{name:"first_name",className:"form-control input-lg",type:"text",value:l.first_name,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Last Name"),":",Object(a.jsx)("input",{name:"last_name",className:"form-control input-lg",type:"text",value:l.last_name,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Birth Date"),Object(a.jsx)("input",{name:"birth_date",className:"form-control input-lg",type:"date",value:l.birth_date,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Location"),":",Object(a.jsx)("input",{name:"location",className:"form-control input-lg",type:"text",value:l.location,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Bio"),":",Object(a.jsx)("textarea",{name:"bio",className:"form-control input-lg",maxLength:"200",value:l.bio,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Language"),":",Object(a.jsx)("select",{name:"language",className:"form-control input-lg",value:l.language,onChange:e=>this.handleFormChange(e),children:vs.map((e=>Object(a.jsx)("option",{value:e.name,children:e.name},e.name)))})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Timezone"),":",Object(a.jsx)(Vs.a,{className:"form-control timezone-custom",onChange:e=>{const t={target:{name:"timezone",value:e||"Europe/Paris"}};this.handleFormChange(t)},value:l.timezone})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:First day of week"),":",Object(a.jsxs)("select",{name:"weekm",className:"form-control input-lg",value:l.weekm?"Monday":"Sunday",onChange:e=>this.handleFormChange(e),children:[Object(a.jsx)("option",{value:"Sunday",children:o("user:Sunday")}),Object(a.jsx)("option",{value:"Monday",children:o("user:Monday")})]})]})}),Object(a.jsx)("button",{type:"submit",className:"btn btn-primary",children:o("common:Submit")}),Object(a.jsx)("button",{className:"btn btn-danger",onClick:e=>{e.preventDefault(),this.displayModal(!0)},children:o("user:Delete my account")}),Object(a.jsx)("button",{type:"submit",className:"btn btn-secondary",onClick:()=>Ma.push("/profile"),children:o("common:Cancel")})]}),Object(a.jsx)(v,{message:t,t:o})]})})})]})}),Object(a.jsx)("div",{className:"col-md-2"})]})]})]})}}var Js=Object(w.a)()(Object(O.c)((e=>({location:e.router.location,message:e.message,user:e.user})),(e=>({onDeleteUser:t=>{e(ye(t))},onHandleProfileFormSubmit:t=>{e((e=>t=>!e.password===e.password_conf?t(fe("Password and password confirmation don't match.")):(delete e.id,L.postData("auth/profile/edit",e).then((e=>{if("success"===e.status)return t(ve()),Ma.push("/profile");t(fe(e.message))})).catch((e=>{throw e}))))(t))}})))(Gs)),Ks=s(905),Ys=s(906),Xs=s(907),$s=s(241);const Zs=["week","month","year"];class Qs extends c.a.Component{constructor(e,t){super(e,t);const s=new Date;this.state={displayedSports:e.sports.map((e=>e.id)),statsParams:{start:Object(jt.a)(Object(vt.a)(s,11)),end:Object(pt.a)(s),duration:"month",type:"by_time"}}}componentDidUpdate(e){this.props.sports!==e.sports&&this.updateDisplayedSports()}updateDisplayedSports(){const e=this.props.sports;this.setState({displayedSports:e.map((e=>e.id))})}handleOnChangeDuration(e){const t=e.target.name,s=new Date,a="year"===t?Object(At.a)(Object(Ks.a)(s,9)):"week"===t?Object(jt.a)(Object(vt.a)(s,2)):Object(jt.a)(Object(vt.a)(s,11)),r="year"===t?Object(Ys.a)(s):"week"===t?Object(bt.a)(s):Object(pt.a)(s);this.setState({statsParams:{duration:t,end:r,start:a,type:"by_time"}})}handleOnChangeSports(e){const t=this.state.displayedSports;t.includes(e)?this.setState({displayedSports:t.filter((t=>t!==e))}):this.setState({displayedSports:t.concat([e])})}handleOnClickArrows(e){const t=this.state.statsParams,s=t.start,a=t.end,r=t.duration;let o,c;e?(o="year"===r?Object(At.a)(Object(Ks.a)(s,1)):"week"===r?Object(ht.a)(Object(Xs.a)(s,1)):Object(jt.a)(Object(vt.a)(s,1)),c="year"===r?Object(Ys.a)(Object(Ks.a)(a,1)):"week"===r?Object(bt.a)(Object(Xs.a)(a,1)):Object(pt.a)(Object(vt.a)(a,1))):(o="year"===r?Object(At.a)(Object(Et.a)(s,1)):"week"===r?Object(ht.a)(Object($s.a)(s,1)):Object(jt.a)(Object(wt.a)(s,1)),c="year"===r?Object(Ys.a)(Object(Et.a)(a,1)):"week"===r?Object(bt.a)(Object($s.a)(a,1)):Object(pt.a)(Object(wt.a)(a,1))),this.setState({statsParams:{duration:r,end:c,start:o,type:"by_time"}})}render(){const e=this.state,t=e.displayedSports,s=e.statsParams,r=this.props,o=r.sports,c=r.t,n=r.user,i=xe(o.filter((e=>n.sports_list.includes(e.id))),c);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",c("statistics:Statistics")]})}),Object(a.jsxs)("div",{className:"container dashboard",children:[Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:c("statistics:Statistics")}),Object(a.jsxs)("div",{className:"card-body".concat(0===n.nb_workouts?" stats-disabled":""),children:[Object(a.jsxs)("div",{className:"chart-filters row",children:[Object(a.jsx)("div",{className:"col chart-arrows",children:Object(a.jsx)("p",{className:"text-center",children:Object(a.jsx)("i",{className:"fa fa-chevron-left","aria-hidden":"true",onClick:()=>this.handleOnClickArrows(!0)})})}),Object(a.jsx)("div",{className:"col-md-3 time-frames justify-content-around",children:Zs.map((e=>Object(a.jsx)("div",{className:"time-frame",children:Object(a.jsxs)("label",{children:[Object(a.jsx)("input",{type:"radio",id:e,name:e,checked:e===s.duration,onChange:e=>this.handleOnChangeDuration(e)}),Object(a.jsx)("span",{children:c("statistics:".concat(e))})]})},e)))}),Object(a.jsx)("div",{className:"col chart-arrows",children:Object(a.jsx)("p",{className:"text-center",children:Object(a.jsx)("i",{className:"fa fa-chevron-right","aria-hidden":"true",onClick:()=>this.handleOnClickArrows(!1)})})})]}),Object(a.jsx)(Ht,{displayEmpty:!0,displayedSports:t,statsParams:s,t:c}),Object(a.jsx)("div",{className:"row chart-workouts",children:i.map((e=>Object(a.jsxs)("label",{className:"col workout-label",children:[Object(a.jsx)("input",{type:"checkbox",checked:t.includes(e.id),name:e.label,onChange:()=>this.handleOnChangeSports(e.id)}),Object(a.jsx)("span",{style:{color:ue[e.id-1]},children:" ".concat(e.label)})]},e.id)))})]})]}),0===n.nb_workouts&&Object(a.jsx)(ot,{t:c})]})]})}}var ea=Object(w.a)()(Object(O.c)((e=>({sports:e.sports.data,user:e.user})))(Qs));function ta(e){const t=Object(ae.a)().t,s="user:".concat(e.formType.charAt(0).toUpperCase()).concat(e.formType.slice(1));return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",t("user:".concat(e.formType))]})}),Object(a.jsx)("h1",{className:"page-title",children:t(s)}),Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-3"}),Object(a.jsxs)("div",{className:"col-md-6",children:[Object(a.jsx)("br",{}),"register"!==e.formType||e.isRegistrationAllowed?Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)("form",{onSubmit:t=>e.handleUserFormSubmit(t,e.formType),children:["register"===e.formType&&Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"username",placeholder:t("user:Enter a username"),required:!0,type:"text",value:e.userForm.username,onChange:e.onHandleFormChange})}),"password reset"!==e.formType&&Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"email",placeholder:t("user:Enter an email address"),required:!0,type:"email",value:e.userForm.email,onChange:e.onHandleFormChange})}),"reset your password"!==e.formType&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"password",placeholder:t("user:Enter a password"),required:!0,type:"password",value:e.userForm.password,onChange:e.onHandleFormChange})}),"login"!==e.formType&&Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"password_conf",placeholder:t("user:Enter the password confirmation"),required:!0,type:"password",value:e.userForm.password_conf,onChange:e.onHandleFormChange})})]}),Object(a.jsx)("input",{type:"submit",className:"btn btn-primary btn-lg btn-block",value:t("Submit")})]}),Object(a.jsx)("p",{className:"password-forget",children:"login"===e.formType&&Object(a.jsx)(K.a,{to:{pathname:"/password-reset/request"},children:t("user:Forgot password?")})})]}):Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-body",children:"Registration is disabled."}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("button",{type:"submit",className:"btn btn-secondary btn-lg btn-block",onClick:()=>Ma.go(-1),children:"Back"})})]})]}),Object(a.jsx)("div",{className:"col-md-3"})]})})]})}class sa extends c.a.Component{constructor(e,t){super(e,t),this.state={formData:{username:"",email:"",password:"",password_conf:""}}}componentDidUpdate(e){e.location.pathname!==this.props.location.pathname&&this.emptyForm()}emptyForm(){const e=this.state.formData;Object.keys(e).map((t=>e[t]="")),this.setState(e)}onHandleFormChange(e){const t=this.state.formData;t[e.target.name]=e.target.value,this.setState(t)}render(){const e=this.props,t=e.formType,s=e.isRegistrationAllowed,r=e.message,o=e.messages,c=e.onHandleUserFormSubmit,n=e.t,i=this.state.formData,l=this.props.location.query.token;return Object(a.jsx)("div",{children:M()||"password reset"===t&&!l?Object(a.jsx)(g.a,{to:"/"}):Object(a.jsxs)("div",{children:[Object(a.jsx)(v,{message:r,messages:o,t:n}),Object(a.jsx)(ta,{isRegistrationAllowed:s,formType:t,userForm:i,onHandleFormChange:e=>this.onHandleFormChange(e),handleUserFormSubmit:e=>{e.preventDefault(),"password reset"===t&&(i.token=l),c(i,t)}})]})})}}var aa=Object(w.a)()(Object(O.c)((e=>({isRegistrationAllowed:e.application.config.is_registration_enabled,location:e.router.location,message:e.message,messages:e.messages})),(e=>({onHandleUserFormSubmit:(t,s)=>{e(ke(t,s="password reset"===s?"password/update":"reset your password"===s?"password/reset-request":s))}})))(sa));class ra extends c.a.Component{constructor(e,t){super(e,t),this.state={displayModal:!1}}componentDidMount(){this.props.loadUser(this.props.match.params.userName)}componentDidUpdate(e){e.match.params.userName!==this.props.match.params.userName&&this.props.loadUser(this.props.match.params.userName)}displayModal(e){this.setState((t=>Object(k.a)(Object(k.a)({},t),{},{displayModal:e})))}render(){const e=this.props,t=e.t,s=e.currentUser,r=e.onDeleteUser,o=e.users,c=this.state.displayModal,n=Object(ne.a)(o,1)[0],i=!!n&&s.username===n.username;return Object(a.jsxs)("div",{children:[c&&Object(a.jsx)(Pe,{title:t("common:Confirmation"),text:t("user:Are you sure you want to delete this account? All data will be deleted, this cannot be undone."),confirm:()=>{r(n.username),this.displayModal(!1)},close:()=>this.displayModal(!1)}),n&&Object(a.jsx)(ut,{editable:i,isDeletable:s.admin&&!i,onDeleteUser:r,displayModal:e=>this.displayModal(e),t:t,user:n})]})}}var oa=Object(w.a)()(Object(O.c)((e=>({currentUser:e.user,users:e.users.data})),(e=>({onDeleteUser:t=>{e(ye(t,!0))},loadUser:t=>{e(H("getData","users",{username:t}))}})))(ra));class ca extends c.a.Component{constructor(e){super(e),this.props=e}componentDidMount(){this.props.loadAppConfig()}render(){return Object(a.jsxs)("div",{className:"App",children:[Object(a.jsx)(_s,{}),Object(a.jsxs)(g.d,{children:[Object(a.jsx)(g.b,{exact:!0,path:"/",component:Jt}),Object(a.jsx)(g.b,{exact:!0,path:"/register",render:()=>Object(a.jsx)(aa,{formType:"register"})}),Object(a.jsx)(g.b,{exact:!0,path:"/login",render:()=>Object(a.jsx)(aa,{formType:"login"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset",render:()=>Object(a.jsx)(aa,{formType:"password reset"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset/request",render:()=>Object(a.jsx)(aa,{formType:"reset your password"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset/sent",render:()=>Object(a.jsx)(qs,{action:"sent"})}),Object(a.jsx)(g.b,{exact:!0,path:"/updated-password",render:()=>Object(a.jsx)(qs,{action:"updated"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset/sent",component:qs}),Object(a.jsx)(g.b,{exact:!0,path:"/logout",component:Xt}),Object(a.jsx)(g.b,{exact:!0,path:"/profile/edit",component:Js}),Object(a.jsx)(g.b,{exact:!0,path:"/profile",component:mt}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/history",component:dt}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/statistics",component:ea}),Object(a.jsx)(g.b,{exact:!0,path:"/users/:userName",component:oa}),Object(a.jsx)(g.b,{path:"/workouts",component:rt}),Object(a.jsx)(g.b,{path:"/admin",component:oe}),Object(a.jsx)(g.b,{component:re})]}),Object(a.jsx)(Kt,{})]})}}var na=Object(O.c)((()=>({})),(e=>({loadAppConfig:()=>{e(V("config"))}})))(ca),ia=s(80);function la({store:e,history:t,children:s}){return Object(a.jsx)(O.a,{store:e,children:Object(a.jsx)(ia.a,{history:t,children:s})})}const da=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function ua(e){navigator.serviceWorker.register(e).then((e=>{e.onupdatefound=()=>{const t=e.installing;t.onstatechange=()=>{"installed"===t.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}})).catch((e=>{console.error("Error during service worker registration:",e)}))}const ma={data:[]};var ja={language:"en",message:"",messages:[],user:{isAuthenticated:!1},workouts:Object(k.a)({},ma),application:{statistics:{},config:{gpx_limit_import:null,is_registration_enabled:null,max_single_file_size:null,max_users:null,max_zip_file_size:null,registration:null}},calendarWorkouts:Object(k.a)({},ma),chartData:[],gpx:null,loading:!1,records:Object(k.a)({},ma),sports:Object(k.a)({},ma),statistics:{data:{}},users:Object(k.a)({},ma)};const pa=(e,t,s)=>s.target!==t?e:"SET_DATA"===s.type?Object(k.a)(Object(k.a)({},e),{},{data:s.data[s.target]}):"SET_PAGINATED_DATA"===s.type?Object(k.a)(Object(k.a)({},e),{},{data:s.data[s.target],pagination:s.pagination}):e,ha=(e=ja.workouts,t)=>{switch(t.type){case"LOGOUT":return ja.workouts;case"PUSH_WORKOUTS":return Object(k.a)(Object(k.a)({},e),{},{data:e.data.concat(t.workouts)});case"REMOVE_WORKOUT":return Object(k.a)(Object(k.a)({},e),{},{data:e.data.filter((e=>e.id!==t.workoutId))});default:return pa(e,"workouts",t)}},ba=(e=ja.application,t)=>"SET_APP_CONFIG"===t.type?Object(k.a)(Object(k.a)({},e),{},{config:t.data}):"SET_APP_STATS"===t.type?Object(k.a)(Object(k.a)({},e),{},{statistics:t.data}):e,xa=(e=ja.calendarWorkouts,t)=>{switch(t.type){case"LOGOUT":return ja.calendarWorkouts;case"UPDATE_CALENDAR":return Object(k.a)(Object(k.a)({},e),{},{data:t.workouts});default:return pa(e,"calendarWorkouts",t)}},Oa=(e=ja.chartData,t)=>"SET_CHART_DATA"===t.type?t.chartData:e,ga=(e=ja.gpx,t)=>"SET_GPX"===t.type?t.gpxContent:e,fa=(e=ja.language,t)=>"SET_LANGUAGE"===t.type?t.language:e,wa=(e=ja.loading,t)=>"SET_LOADING"===t.type?t.loading:e,va=(e=ja.message,t)=>{switch(t.type){case"AUTH_ERROR":case"PROFILE_ERROR":case"PROFILE_UPDATE_ERROR":case"PICTURE_ERROR":case"SET_ERROR":return t.message;case"LOGOUT":case"PROFILE_SUCCESS":case"SET_APP_CONFIG":case"SET_RESULTS":case"@@router/LOCATION_CHANGE":return"";default:return e}},ka=(e=ja.messages,t)=>{switch(t.type){case"AUTH_ERRORS":return t.messages;case"LOGOUT":case"PROFILE_SUCCESS":case"@@router/LOCATION_CHANGE":return[];default:return e}},ya=(e=ja.records,t)=>"LOGOUT"===t.type?ja.records:pa(e,"records",t),Na=(e=ja.sports,t)=>"UPDATE_SPORT_DATA"===t.type?Object(k.a)(Object(k.a)({},e),{},{data:e.data.map((e=>(e.id===t.data.id&&(e.is_active=t.data.is_active),e)))}):pa(e,"sports",t),_a=(e=ja.users,t)=>"UPDATE_USER_DATA"===t.type?Object(k.a)(Object(k.a)({},e),{},{data:e.data.map((e=>(e.username===t.data.username&&(e.admin=t.data.admin),e)))}):pa(e,"users",t),Sa=(e=ja.user,t)=>{switch(t.type){case"AUTH_ERROR":case"PROFILE_ERROR":case"LOGOUT":return window.localStorage.removeItem("authToken"),ja.user;case"PROFILE_SUCCESS":return t.profil;default:return e}},Da=(e=ja.statistics,t)=>"LOGOUT"===t.type?ja.statistics:pa(e,"statistics",t);const Ca=["/login","/register","/password-reset","/password-reset/request","/password-reset/sent","/updated-password"],Ea=(e,t)=>("string"===typeof e||e instanceof String?e=t:e.pathname=t,e),Aa=e=>(window.localStorage.authToken||Ca.includes(e.pathname)||(e=Ea(e,"/login")),window.localStorage.authToken&&Ca.includes(e.pathname)&&(e=Ea(e,"/")),e),Ma=((Ta=Object(r.a)()).location=Aa(Ta.location),Object(k.a)(Object(k.a)({},Ta),{},{push:(e,...t)=>Ta.push(Aa(e),...t),replace:(e,...t)=>Ta.replace(Aa(e),...t)}));var Ta;Ma.listen((()=>{window.scrollTo(0,0)}));const Pa=document.getElementById("root"),Fa=Object(u.e)((za=Ma,Object(u.c)({workouts:ha,application:ba,calendarWorkouts:xa,chartData:Oa,gpx:ga,language:fa,loading:wa,message:va,messages:ka,records:ya,router:Object(ia.b)(za),sports:Na,statistics:Da,user:Sa,users:_a})),window.__STATE__,(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||u.d)(Object(u.a)(Object(d.a)(Ma),m.a)));var za;null!==window.localStorage.authToken&&Fa.dispatch(we()),l.a.render(Object(a.jsx)(la,{store:Fa,history:Ma,children:Object(a.jsx)(n.a,{i18n:x,children:Object(a.jsx)(na,{})})}),Pa),function(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",(()=>{const e="".concat("","/service-worker.js");da?function(e){fetch(e).then((t=>{404===t.status||-1===t.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then((e=>{e.unregister().then((()=>{window.location.reload()}))})):ua(e)})).catch((()=>{console.log("No internet connection found. App is running in offline mode.")}))}(e):ua(e)}))}}()}},[[889,1,2]]]); -//# sourceMappingURL=main.7c5c861a.chunk.js.map \ No newline at end of file +(this.webpackJsonpfittrackee_client=this.webpackJsonpfittrackee_client||[]).push([[0],{203:function(e){e.exports=JSON.parse('{"Workouts":"Workouts","Workout":"Workout","Workout Date":"Workout Date","Add a workout":"Add a workout","Are you sure you want to delete this workout?":"Are you sure you want to delete this workout?","Ave. speed":"Ave. speed","Ascent":"Ascent","Average speed":"Average speed","Chart":"Chart","data from gpx, without any cleaning":"data from gpx, without any cleaning","Date":"Date","Delete workout":"Delete workout","Descent":"Descent","Distance":"Distance","distance":"distance","Duration":"Duration","duration":"duration","Edit a workout":"Edit a workout","Edit workout":"Edit workout","elevation":"elevation","End":"End","Farest distance":"Farest distance","Filter":"Filter","From":"From","gpxFile":"gpx file","Longest duration":"Longest duration","Max. altitude":"Max. altitude","Max. speed":"Max. speed","Min. altitude":"Min. altitude","no folder inside":"no folder inside","files max":"files max","max size":"max size","No data to display":"No data to display","No Map":"No Map","No next workout":"No next workout","No next segment":"No next segment","No notes":"No notes","No previous workout":"No previous workout","No previous segment":"No previous segment","Notes":"Notes","pauses":"pauses","Personal records":"Personal records","See next workout":"See next workout","See next segment":"See next segment","See previous workout":"See previous workout","See previous segment":"See previous segment","segment":"segment","Segments":"Segments","speed":"speed","Start":"Start","Title":"Title","To":"To","total duration":"total duration","with gpx file":"with gpx file","without gpx file":"without gpx file","zipFile":"or zip file containing gpx files"}')},204:function(e){e.exports=JSON.parse('{"Actions":"Actions","Active":"Active","workouts exist":"workouts exist","Add admin rights":"Add admin rights","Add/remove admin rights, delete user account.":"Add/remove admin rights, delete user account.","Administration":"Administration","Application":"Application","Application configuration":"Application configuration","Back":"Back","Disable":"Disable","Enable":"Enable","Enable/disable sports.":"Enable/disable sports.","FitTrackee administration":"FitTrackee administration","id":"id","if 0, no limitation":"if 0, no limitation","Image":"Image","Label":"Label","Max. number of active users":"Max. number of active users","Max. files of zip archive":"Max. files of zip archive","Max. size of uploaded files":"Max. size of uploaded files","Max. size of uploaded files (in Mb)":"Max. size of uploaded files (in Mb)","Max. size of zip archive":"Max. size of zip archive","Max. size of zip archive (in Mb)":"Max. size of zip archive (in Mb)","Registration is currently disabled.":"Registration is currently disabled.","Registration is currently enabled.":"Registration is currently enabled.","Remove admin rights":"Remove admin rights","Sports":"Sports","Update application configuration (maximum number of registered users, maximum files size).":"Update application configuration (maximum number of registered users, maximum files size).","uploads":"uploads","user":"user","Users":"Users","users":"users"}')},205:function(e){e.exports=JSON.parse('{"workouts count":"workouts count","Add workout":"Add workout","admin rights":"admin rights","ascending":"ascending","Back":"Back","Back to home":"Back to home","Cancel":"Cancel","Confirmation":"Confirmation","Dashboard":"Dashboard","descending":"descending","Edit":"Edit","day":"day","days":"days","Next":"Next","No":"No","no":"no","No records.":"No records.","No workouts.":"No workouts.","Page not found":"Page not found","Previous":"Prev","registration date":"registration date","Sort":"Sort","Sort by":"Sort by","Sport":"Sport","sport":"sport","Sports":"Sports","sports":"sports","Statistics":"Statistics","Submit":"Submit","to":"to","user name":"user name","Workout":"Workout","Workouts":"Workouts","workout":"workout","workouts":"workouts","Yes":"Yes","yes":"yes"}')},206:function(e){e.exports=JSON.parse('{"Personal records":"Personal records","This month":"This month","Upload one !":"Upload one !"}')},207:function(e){e.exports=JSON.parse('{"3 to 12 characters required for username.":"3 to 12 characters required for username.","8 characters required for password.":"8 characters required for password.","An error occurred. Please contact the administrator.":"An error occurred. Please contact the administrator.","application":"application","Error during picture deletion.":"Error during picture deletion.","Error during picture update.":"Error during picture update.","Error during picture update, file size exceeds max size.":"Error during picture update, file size exceeds max size.","Error. Registration is disabled.":"Error. Registration is disabled.","Error. Please try again or contact the administrator.":"Error. Please try again or contact the administrator.","File extension not allowed.":"File extension not allowed.","File size is greater than the allowed size":"File size is greater than the allowed size","Incorrect id":"Incorrect id","Invalid credentials.":"Invalid credentials.","Invalid payload.":"Invalid payload.","Invalid token. Please log in again.":"Invalid token. Please log in again.","Max. files in a zip archive must be greater than 0":"Max. files in a zip archive must be greater than 0","Max. size of uploaded files must be greater than 0":"Max. size of uploaded files must be greater than 0","Max. size of zip archive must be equal or greater than max. size of uploaded files":"Max. size of zip archive must be equal or greater than max. size of uploaded files","Max. size of zip archive must be greater than 0":"Max. size of zip archive must be greater than 0","No file part.":"No file part.","No picture.":"No picture.","No selected file.":"No selected file.","no correct file.":"no correct file.","no gpx file for this workout":"no gpx file for this workout","Password and password confirmation don\'t match.":"Password and password confirmation don\'t match.","Provide a valid auth token":"Provide a valid auth token","records":"records","Signature expired. Please log in again.":"Signature expired. Please log in again.","Sorry. That user already exists.":"Sorry. That user already exists.","Sport can not be disabled, workouts exist.":"Sport can not be disabled, workouts exist.","Sport does not exist.":"Sport does not exist.","sports":"sports","statistics":"statistiques","User does not exist.":"User does not exist.","Valid email must be provided.\\n":"Valid email must be provided.","workouts":"workouts","You can not delete your account, no other user has admin rights.":"You can not delete your account, no other user has admin rights.","You do not have permissions.":"You do not have permissions."}')},208:function(e){e.exports=JSON.parse('{"Cycling (Sport)":"Cycling (Sport)","Cycling (Transport)":"Cycling (Transport)","Hiking":"Hiking","Mountain Biking":"Mountain Biking","Running":"Running","Walking":"Walking"}')},209:function(e){e.exports=JSON.parse('{"workouts":"workouts","distance":"distance","duration":"duration","month":"month","Statistics":"Statistics","year":"year","week":"week"}')},210:function(e){e.exports=JSON.parse('{"Admin":"Admin","Are you sure you want to delete this account? All data will be deleted, this cannot be undone.":"Are you sure you want to delete this account? All data will be deleted, this cannot be undone.","Are you sure you want to delete your account? All data will be deleted, this cannot be undone.":"Are you sure you want to delete your account? All data will be deleted, this cannot be undone.","Bio":"Bio","Birth Date":"Birth Date","Check your email. If your address is in our database, you\'ll received an email with a link to reset your password.":"Check your email. If your address is in our database, you\'ll received an email with a link to reset your password.","Delete my account":"Delete my account","Delete picture":"Delete picture","Delete user account":"Delete user account","Edit Profile":"Edit Profile","Email":"Email","Enter a username":"Enter a username","Enter an email address":"Enter an email address","Enter a password":"Enter a password","Enter the password confirmation":"Enter the password confirmation","First day of week":"First day of week","First Name":"First Name","Forgot password?":"Forgot password?","Invalid token. Please request a new token.":"Invalid token. Please request a new token.","Language":"Language","Last Name":"Last Name","Location":"Location","loggedOut":"You are now logged out. Click <1>here to log back in.","Login":"Login","login":"login","Logout":"Logout","Monday":"Monday","Password":"Password","Password Confirmation":"Password Confirmation","Password reset":"Password reset","password reset":"password reset","Profile":"Profile","Profile Edition":"Profile Edition","Register":"Register","register":"register","Registration Date":"Registration Date","Reset your password":"Reset your password","reset your password":"reset your password","Send":"Send","Sunday":"Sunday","Timezone":"Timezone","updatedPasswordText":"Your password have been updated. Click <1>here to log in.","Username":"Username"}')},211:function(e){e.exports=JSON.parse('{"Workouts":"S\xe9ances","Workout":"S\xe9ance","Workout Date":"Date de l\'s\xe9ance","Add a workout":"Ajouter une s\xe9ance","Are you sure you want to delete this workout?":"Etes-vous s\xfbr de vouloir supprimer cette s\xe9ance ?","Ave. speed":"Vitesse moyenne","Ascent":"D\xe9nivel\xe9 positif","Average speed":"Vitesse moyenne","Chart":"Analyse","data from gpx, without any cleaning":"donn\xe9es issues du fichier gpx, sans correction","Date":"Date","Delete workout":"Supprimer l\'s\xe9ance","Descent":"D\xe9nivel\xe9 n\xe9gatif","Distance":"Distance","distance":"distance","Duration":"Dur\xe9e","duration":"dur\xe9e","Edit a workout":"Editer une s\xe9ance","Edit workout":"Editer une workout","elevation":"altitude","End":"Arriv\xe9e","Farest distance":"Distance la + longue","Filter":"Filtrer","From":"A partir de","gpxFile":"fichier gpx","Longest duration":"Dur\xe9e la + longue","Max. altitude":"Altitude max","Max. speed":"Vitesse max","Min. altitude":"Altitude min","no folder inside":"pas de r\xe9pertoire","files max":" fichiers max","max size":"taille max","No data to display":"Pas de donn\xe9es \xe0 afficher","No Map":"Pas de carte","No next workout":"Pas d\'s\xe9ance suivante","No next segment":"Pas de segment suivant","No notes":"Pas de notes","No previous workout":"Pas d\'s\xe9ance pr\xe9c\xe9dente","No previous segment":"Pas de segment pr\xe9c\xe9dent","Notes":"Notes","pauses":"pauses","Personal records":"Records personnels","See next workout":"Voir l\'s\xe9ance suivante","See next segment":"Voir le segment suivant","See previous workout":"Voir l\'s\xe9ance pr\xe9c\xe9dente","See previous segment":"Voir le segment pr\xe9c\xe9dent","segment":"segment","Segments":"Segments","Start":"D\xe9part","speed":"vitesse","Title":"Titre","To":"Jusqu\'au","total duration":"dur\xe9e totale","with gpx file":"avec un fichier gpx","without gpx file":"sans fichier gpx","zipFile":"ou un fichier zip contenant des fichiers gpx"}')},212:function(e){e.exports=JSON.parse('{"Actions":"Actions","Active":"Active","Add admin rights":"Ajouter des droits d\'admin","Add/remove admin rights, delete user account.":"Ajouter/retirer des droits d\'adminsitration, supprimer des comptes utilisateurs.","Administration":"Administration","workouts exist":"des s\xe9ances existent","Application":"Application","Application configuration":"Configuration de l\'application","Back":"Retour","Disable":"d\xe9sactiver","Enable":"activer","Enable/disable sports.":"Activer/d\xe9sactiver des sports.","FitTrackee administration":"Administration de FitTrackee","id":"id","if 0, no limitation":"si \xe9gal \xe0 0, pas limite d\'inscription","Image":"Image","Label":"Label","Max. number of active users":"Nombre maximum d\'utilisateurs actifs","Max. files of zip archive":"Nombre max. de fichiers dans une archive zip","Max. size of uploaded files":"Taille max. des fichiers","Max. size of uploaded files (in Mb)":"Taille max. des fichiers (en Mo)","Max. size of zip archive":"Taille max. des archives zip","Max. size of zip archive (in Mb)":"Taille max. des archives zip (en Mo)","Registration is currently disabled.":"Les inscriptions sont actuellement d\xe9sactiv\xe9es.","Registration is currently enabled.":"Les inscriptions sont actuellement activ\xe9es.","Remove admin rights":"Retirer des droits d\'admin","Sports":"Sports","Update application configuration (maximum number of registered users, maximum files size).":"Configurer l\'application (nombre maximum d\'utilisateurs inscrits, taille maximale des fichers).","uploads":"fichiers","user":"user","Users":"Utilisateurs","users":"utilisateurs"}')},213:function(e){e.exports=JSON.parse('{"workouts count":"nombre d\'s\xe9ances","Add workout":"Ajouter une s\xe9ance","admin rights":"droits d\'admin","ascending":"ascendant","Back":"Revenir \xe0 la page pr\xe9c\xe9dente","Back to home":"Retour \xe0 l\'accueil","Cancel":"Annuler","Confirmation":"Confirmation","Dashboard":"Tableau de Bord","descending":"descendant","Edit":"Modifier","day":"jour","days":"jours","Next":"Page suivante","No":"Non","no":"non","No records.":"Pas de records.","No workouts.":"Pas d\'s\xe9ances.","Page not found":"Page introuvable","Previous":"Page pr\xe9c\xe9dente","registration date":"date d\'inscription","Sort":"Tri","Sort by":"Trier par","Sport":"Sport","sport":"sport","Sports":"Sports","sports":"sports","Statistics":"Statistiques","Submit":"Valider","to":"\xe0","user name":"utilisateur","Workout":"S\xe9ance","Workouts":"S\xe9ances","workout":"s\xe9ance","workouts":"s\xe9ances","Yes":"Oui","yes":"oui"}')},214:function(e){e.exports=JSON.parse('{"Personal records":"Mes records","This month":"Ce mois","Upload one !":"Ajoutez votre premi\xe8re s\xe9ance !"}')},215:function(e){e.exports=JSON.parse('{"3 to 12 characters required for username.":"3 \xe0 12 caract\xe8res requis pour le nom.","8 characters required for password.":"8 caract\xe8res minimum pour le mot de passe.","An error occurred. Please contact the administrator.":"Une erreur s\'est produite. Merci de contacter l\'administrateur.","application":"application","Error during picture deletion.":"Erreur lors de la suppression de l\'image.","Error during picture update.":"Erreur lors de la mise \xe0 jour de l\'image.","Error during picture update, file size exceeds max size.":"Erreur lors de la mise \xe0 jour de l\'image, la taille du ficher d\xe9passe la taille maximum autoris\xe9e","Error. Registration is disabled.":"Erreur. L\'inscription est d\xe9sactiv\xe9e.","Error. Please try again or contact the administrator.":"Erreur. Veuillez r\xe9essayer ou contacter l\'administrateur","File extension not allowed.":"Extension de fichier non autoris\xe9e.","File size is greater than the allowed size":"La taille du fichier est sup\xe9rieure \xe0 la limite autoris\xe9e","Incorrect id":"Id incorrect","Invalid credentials.":"Identifiants invalides.","Invalid payload.":"Donn\xe9es incorrectes.","Invalid token. Please log in again.":"Jeton invalide. Merci de vous reconnecter.","Max. files in a zip archive must be greater than 0":"Le nombre max. de fichiers dans une archive doit \xeatre sup\xe9rieur \xe0 0","Max. size of uploaded files must be greater than 0":"La taille max. des fichiers doit \xeatre sup\xe9rieure \xe0 0","Max. size of zip archive must be equal or greater than max. size of uploaded files":"La taille max. d\'une archive doit \xeatre sup\xe9rieure ou \xe9gale \xe0 la taille max. d\'un fichier","Max. size of zip archive must be greater than 0":"La taille max. d\'une archive doit \xeatre sup\xe9rieure \xe0 0","No file part.":"Pas de fichier fourni.","No picture.":"Pas d\'image.","No selected file.":"Pas de fichier s\xe9lectionn\xe9.","no correct file.":"fichier incorrect","no gpx file for this workout":"pas de fichier gpx pour cette s\xe9ance","Password and password confirmation don\'t match.":"Les mots de passe saisis sont diff\xe9rents.","Provide a valid auth token":"Merci de fournir un jeton valide","records":"records","Signature expired. Please log in again.":"Signature expir\xe9e. Merci de vous reconnecter.","Sorry. That user already exists.":"D\xe9sol\xe9. Cet utilisateur existe d\xe9j\xe0.","Sport can not be disabled, workouts exist.":"Le sport ne peut \xeatre d\xe9sactiv\xe9, des s\xe9ancees existent","Sport does not exist.":"Le sport n\'existe pas.","sports":"sports","statistics":"statistics","User does not exist.":"L\'utilisateur n\'existe pas.","Valid email must be provided.\\n":"L\'email fourni n\'est pas valide.","workouts":"s\xe9ances","You can not delete your account, no other user has admin rights.":"Vous ne pouvez pas supprimer votre compte, aucun autre utilisateur n\'a des droits d\'administration.","You do not have permissions.":"Vous n\'avez pas les permissions n\xe9cessaires."}')},216:function(e){e.exports=JSON.parse('{"Cycling (Sport)":"V\xe9lo (Sport)","Cycling (Transport)":"V\xe9lo (Transport)","Hiking":"Randonn\xe9e","Mountain Biking":"VTT","Running":"Course","Walking":"Marche"}')},217:function(e){e.exports=JSON.parse('{"workouts":"s\xe9ances","distance":"distance","duration":"dur\xe9e","month":"mois","Statistics":"Statistiques","year":"ann\xe9e","week":"semaine"}')},218:function(e){e.exports=JSON.parse('{"Admin":"Admin","Are you sure you want to delete this account? All data will be deleted, this cannot be undone.":"Etes-vous s\xfbr de vouloir supprimer ce compte ? Toutes les donn\xe9es seront d\xe9finitivement effac\xe9s.","Are you sure you want to delete your account? All data will be deleted, this cannot be undone.":"Etes-vous s\xfbr de vouloir supprimer votre compte ? Toutes les donn\xe9es seront d\xe9finitivement effac\xe9s.","Bio":"Bio","Birth Date":"Date de naissance","Check your email. If your address is in our database, you\'ll received an email with a link to reset your password.":"V\xe9rifiez vore boite mail. Si vote adresse est dans notre base de donn\xe9es, vous recevrez un email avec un lien pour r\xe9initialiser votre mot de passe","Delete my account":"Supprimer mon compte","Delete picture":"Supprimer l\'image","Delete user account":"Supprimer le compte","Edit Profile":"Editer le profil","Email":"Email","Enter a username":"Saisir un nom","Enter an email address":"Saisir une adresse e-mail","Enter a password":"Saisir un mot de passe","Enter the password confirmation":"Confirmer le mot de passe","First day of week":"Premier jour de la semaine","First Name":"Pr\xe9nom","Forgot password?":"Mot de passe oubli\xe9 ?","Invalid token. Please request a new token.":"Token invalid. Veuillez demander un nouveau token.","Language":"Langue","Last Name":"Nom","Location":"Lieu","loggedOut":"Vous \xeates d\xe9connect\xe9. Cliquez <1>ici pour vous reconnecter.","Login":"Se connecter","login":"se connecter","Logout":"Se d\xe9connecter","Monday":"Lundi","Password":"Mot de passe","Password Confirmation":"Confirmation du mot de passe","Password reset":"R\xe9initialiser votre mot de passe","password reset":"r\xe9initialiser votre mot de passe","Profile":"Profil","Profile Edition":"Edition du profil","Register":"S\'inscrire","register":"s\'inscrire","Registration Date":"Date d\'inscription","Reset your password":"R\xe9initialiser votre mot de passe","reset your password":"r\xe9initialiser votre mot de passe","Send":"Envoyer","Sunday":"Dimanche","Timezone":"Fuseau horaire","updatedPasswordText":"Votre mot de passe a \xe9t\xe9 mis \xe0 jour. Cliquez <1>ici pour vous connecter.","Username":"Nom d\'utilisateur"}')},277:function(e,t,s){},285:function(e,t){},889:function(e,t,s){"use strict";s.r(t),s.d(t,"history",(function(){return Ta})),s.d(t,"rootNode",(function(){return za})),s.d(t,"store",(function(){return Fa}));var a=s(1),r=s(29),o=s(2),c=s.n(o),n=s(908),i=s(51),l=s.n(i),d=s(199),u=s(55),m=s(200),j=s(83),p=s(201),h=s(202);const b={en:{workouts:s(203),administration:s(204),common:s(205),dashboard:s(206),messages:s(207),sports:s(208),statistics:s(209),user:s(210)},fr:{workouts:s(211),administration:s(212),common:s(213),dashboard:s(214),messages:s(215),sports:s(216),statistics:s(217),user:s(218)}};j.a.use(h.a).use(p.a).init({debug:!1,lng:"en",fallbackLng:"en",keySeparator:!1,interpolation:{escapeValue:!1},resources:b,ns:["common"],defaultNS:"common"});var x=j.a,O=s(10),g=s(19),f=(s(277),s(20)),w=s(891);class v extends c.a.PureComponent{render(){const e=this.props,t=e.message,s=e.messages,r=e.t,o=""!==t&&t?t.split("|").length>1?"".concat(r("messages:".concat(t.split("|")[0])),": ").concat(r("messages:".concat(t.split("|")[1]))):r("messages:".concat(t)):"";return Object(a.jsxs)("div",{className:"error-message",children:[""!==o&&Object(a.jsx)("code",{children:o}),s&&s.length>0&&Object(a.jsx)("code",{children:Object(a.jsx)("ul",{children:s.map((e=>Object(a.jsx)("li",{children:r("messages:".concat(e.value))},e.id)))})})]})}}var k=s(12),y=s(910),N=s(909),_=s(222);const S=["bytes","KB","MB","GB","TB"],D=(e,t=!0)=>{const s=Math.floor(Math.log(e)/Math.log(1024));if(!e)return t?"0 bytes":{size:0,suffix:"bytes"};const a=(e/Math.pow(1024,s)).toFixed(1),r=S[s];return t?"".concat(a).concat(r):{size:a,suffix:r}},C="/api/",E=[{key:"workouts_count",label:"workouts count"},{key:"admin",label:"admin rights"},{key:"created_at",label:"registration date"},{key:"username",label:"user name"}],A=[{key:"asc",label:"ascending"},{key:"desc",label:"descending"}],M=()=>!!window.localStorage.authToken,T=e=>{let t=0;return e.map((e=>{const s={id:t,value:e};return t++,s}))},P=e=>{const t={};e.noAuthorization||(t.Authorization="Bearer ".concat(window.localStorage.getItem("authToken"))),e.type&&(t["Content-Type"]=e.type);const s={method:e.method,headers:t};"application/json"===e.type&&e.body?s.body=JSON.stringify(e.body):e.body&&(s.body=e.body);const a=new Request("".concat(C).concat(e.url),s);return fetch(a).then((t=>"DELETE"===e.method||413===t.status?t:t.json())).catch((e=>(console.error(e),new Error("An error occurred. Please contact the administrator."))))},z=(e,t)=>{if(!e)return"";const s=_.DateTime.fromISO(Object(y.a)(new Date(e),"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")).setZone(t);return Object(N.a)(s.toFormat("yyyy-MM-dd HH:mm:ss"),"yyyy-MM-dd HH:mm:ss",new Date)},F=(e,t)=>{const s=e.label.toLowerCase(),a=t.label.toLowerCase();return s>a?1:st.map((t=>Object(k.a)(Object(k.a)({},t),{},{label:e("".concat(s,":").concat(t.label))}))).sort(F),L=(e,t)=>{let s=e;return t.id||"users"===e&&t.username?s="".concat(s,"/").concat(t.username?t.username:t.id):Object.keys(t).length>0&&(s+="?",Object.keys(t).filter((e=>t[e])).map(((e,a)=>s+="".concat(0===a?"":"&").concat(e,"=").concat(t[e])))),s};class U{static getData(e,t={}){const s=L(e,t);return P({url:s,method:"GET",type:"application/json"})}static addData(e,t){return P({url:e,method:"POST",body:t,type:"application/json"})}static addDataWithFile(e,t){return P({url:e,method:"POST",body:t})}static postData(e,t){const s={url:"".concat(e).concat(t.id?"/".concat(t.id):""),method:"POST",body:t,type:"application/json"};return P(s)}static updateData(e,t){const s={url:"".concat(e).concat(t.id?"/".concat(t.id):t.username?"/".concat(t.username):""),method:"PATCH",body:t,type:"application/json"};return P(s)}static deleteData(e,t){const s={url:"".concat(e,"/").concat(t),method:"DELETE",type:"application/json"};return P(s)}}const I=(e,t)=>({type:"SET_DATA",data:t,target:e}),W=e=>({type:"SET_ERROR",message:e}),H=e=>({type:"SET_LOADING",loading:e}),q=(e,t,s,a=!0)=>r=>(r(H(!0)),s&&s.id&&"workouts"!==t&&isNaN(s.id)?(r(H(!1)),r(W("".concat(t,"|Incorrect id")))):(r({type:"CLEAN_ALL_MESSAGES"}),U[e](t,s).then((s=>{if("success"===s.status)if(a){if("users"===t&&"getData"===e)return r(((e,t,s)=>({type:"SET_PAGINATED_DATA",data:t,pagination:s,target:e}))(t,s.data,s.pagination));r(I(t,s.data))}else"updateData"===e&&"sports"===t?r((e=>({type:"UPDATE_SPORT_DATA",data:e}))(s.data.sports[0])):"updateData"===e&&"users"===t&&r((e=>({type:"UPDATE_USER_DATA",data:e}))(s.data.users[0]));else r(W("".concat(t,"|").concat(s.message||s.status)));r(H(!1))})).catch((e=>{r(H(!1)),r(W("".concat(t,"|").concat(e)))})))),B=e=>t=>{j.a.changeLanguage(e).then(t((e=>({type:"SET_LANGUAGE",language:e}))(e)))},G=e=>({type:"SET_APP_CONFIG",data:e}),V=e=>t=>U.getData(e).then((s=>{"success"===s.status?"config"===e?t(G(s.data)):"stats/all"===e&&t({type:"SET_APP_STATS",data:s.data}):t(W("application|".concat(s.message)))})).catch((e=>t(W("application|".concat(e)))));class J extends c.a.Component{constructor(e,t){super(e,t),this.state={formData:{}}}componentDidMount(){this.initForm()}componentDidUpdate(e){this.props.appConfig!==e.appConfig&&this.initForm()}initForm(){const e=this.props.appConfig,t={};Object.keys(e).map((s=>null===e[s]?t[s]="":["max_single_file_size","max_zip_file_size"].includes(s)?t[s]=+(e[s]/1048576).toFixed(2):t[s]=e[s])),this.setState({formData:t})}handleFormChange(e){const t=this.state.formData;t[e.target.name]=+e.target.value,this.setState(t)}render(){const e=this.props,t=e.isInEdition,s=e.loadAppConfig,r=e.message,o=e.messages,c=e.onHandleConfigFormSubmit,n=e.t,i=this.state.formData;return Object(a.jsxs)("div",{children:[(r||o)&&Object(a.jsx)(v,{message:r,messages:o,t:n}),Object.keys(i).length>0&&Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col-md-12",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:n("administration:Application configuration")})}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("form",{className:"app-config-form ".concat(t?"":"form-disabled"),onSubmit:e=>{e.preventDefault(),c(i)},children:[Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsxs)("label",{className:"col-sm-6 col-form-label",htmlFor:"max_users",children:[n("administration:Max. number of active users"),Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-question-circle","aria-hidden":"true",title:n("administration:if 0, no limitation")})}),":"]}),Object(a.jsx)("input",{className:"col-sm-5",id:"max_users",name:"max_users",type:"number",min:"0",value:i.max_users,onChange:e=>this.handleFormChange(e)})]}),Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsxs)("label",{className:"col-sm-6 col-form-label",htmlFor:"max_single_file_size",children:[n("administration:Max. size of uploaded files (in Mb)"),":"]}),Object(a.jsx)("input",{className:"col-sm-5",id:"max_single_file_size",name:"max_single_file_size",type:"number",step:"0.1",min:"0",value:i.max_single_file_size,onChange:e=>this.handleFormChange(e)})]}),Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsxs)("label",{className:"col-sm-6 col-form-label",htmlFor:"max_zip_file_size",children:[n("administration:Max. size of zip archive (in Mb)"),":"]}),Object(a.jsx)("input",{className:"col-sm-5",id:"max_zip_file_size",name:"max_zip_file_size",type:"number",step:"0.1",min:"0",value:i.max_zip_file_size,onChange:e=>this.handleFormChange(e)})]}),Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsx)("label",{className:"col-sm-6 col-form-label",htmlFor:"gpx_limit_import",children:n("administration:Max. files of zip archive")}),Object(a.jsx)("input",{className:"col-sm-5",id:"gpx_limit_import",name:"gpx_limit_import",type:"number",min:"0",value:i.gpx_limit_import,onChange:e=>this.handleFormChange(e)})]}),t?Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",value:n("common:Submit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:e=>{e.preventDefault(),s(),Ta.push("/admin/application")},value:n("common:Cancel")})]}):Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",onClick:e=>{e.preventDefault(),Ta.push("/admin/application/edit")},value:n("common:Edit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ta.push("/admin"),value:n("common:Back")})]})]})})]})})})]})}}var K=Object(O.c)((e=>({message:e.message,messages:e.messages})),(e=>({loadAppConfig:()=>{e(V("config"))},onHandleConfigFormSubmit:t=>{const s=Object.assign({},t);s.max_single_file_size*=1048576,s.max_zip_file_size*=1048576,e((e=>t=>{t({type:"CLEAN_ALL_MESSAGES"}),U.updateData("config",e).then((e=>{"success"===e.status?(t(G(e.data)),Ta.push("/admin/application")):Array.isArray(e.message)?t({type:"APP_ERRORS",messages:T(e.message)}):t(W(e.message))})).catch((e=>t(W("application|".concat(e)))))})(s))}})))(J),Y=s(15);class X extends c.a.Component{componentDidMount(){this.props.loadAppStats()}render(){const e=this.props,t=e.appStats,s=e.t,r=D(t.uploads_dir_size,!1);return Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-users fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:t.users?t.users:0}),Object(a.jsx)("div",{children:"".concat(1===t.users?s("administration:user"):s("administration:users"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-tags fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:t.sports?t.sports:0}),Object(a.jsx)("div",{children:"".concat(1===t.sports?s("common:sport"):s("common:sports"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-calendar fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:t.workouts?t.workouts:0}),Object(a.jsx)("div",{children:"".concat(1===t.workouts?s("common:workout"):s("common:workouts"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-folder-open fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:r.size}),Object(a.jsxs)("div",{children:[r.suffix," (",s("administration:uploads"),")"]})]})]})})})]})}}var $=Object(w.a)()(Object(O.c)((e=>({appStats:e.application.statistics})),(e=>({loadAppStats:()=>{e(V("stats/all"))}})))(X));function Z(e){const t=e.appConfig,s=e.t;return Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:s("administration:Administration")})}),Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsx)($,{}),Object(a.jsx)("br",{}),Object(a.jsxs)("dl",{className:"admin-items",children:[Object(a.jsx)("dt",{children:Object(a.jsx)(Y.a,{to:{pathname:"/admin/application"},children:s("administration:Application")})}),Object(a.jsxs)("dd",{children:[s("administration:Update application configuration (maximum number of registered users, maximum files size)."),Object(a.jsx)("br",{}),Object(a.jsx)("strong",{children:s("administration:Registration is currently ".concat(t.is_registration_enabled?"enabled":"disabled","."))})]}),Object(a.jsx)("br",{}),Object(a.jsx)("dt",{children:Object(a.jsx)(Y.a,{to:{pathname:"/admin/sports"},children:s("administration:Sports")})}),Object(a.jsx)("dd",{children:s("administration:Enable/disable sports.")}),Object(a.jsx)("br",{}),Object(a.jsx)("dt",{children:Object(a.jsx)(Y.a,{to:{pathname:"/admin/users"},children:s("administration:Users")})}),Object(a.jsx)("dd",{children:s("administration:Add/remove admin rights, delete user account.")})]})]})]})}class Q extends c.a.Component{componentDidMount(){this.props.loadSports()}render(){const e=this.props,t=e.message,s=e.sports,r=e.t,o=e.updateSport;return Object(a.jsxs)("div",{children:[t&&Object(a.jsx)(v,{message:t,t:r}),Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:r("administration:Sports")})}),Object(a.jsxs)("div",{className:"card-body",children:[s.length>0&&Object(a.jsxs)("table",{className:"table",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{children:r("administration:id")}),Object(a.jsx)("th",{children:r("administration:Image")}),Object(a.jsx)("th",{children:r("administration:Label")}),Object(a.jsx)("th",{children:r("administration:Active")}),Object(a.jsx)("th",{children:r("administration:Actions")})]})}),Object(a.jsx)("tbody",{children:s.map((e=>Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:id")}),e.id]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Image")}),Object(a.jsx)("img",{className:"admin-img",src:e.img?e.img:"/img/photo.png",alt:"sport logo"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Label")}),r("sports:".concat(e.label))]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Active")}),e.is_active?Object(a.jsx)("i",{className:"fa fa-check-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"}):Object(a.jsx)("i",{className:"fa fa-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("administration:Actions")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-".concat(e.is_active?"dark":"primary"," btn-sm"),value:e.is_active?r("administration:Disable"):r("administration:Enable"),onClick:()=>o(e.id,!e.is_active)}),e.has_workouts&&Object(a.jsxs)("span",{className:"admin-message",children:[Object(a.jsx)("i",{className:"fa fa-warning custom-fa","aria-hidden":"true"}),r("administration:workouts exist")]})]})]},e.id)))})]}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ta.push("/admin/"),value:r("common:Back")})]})]})})})]})}}var ee=Object(O.c)((e=>({message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadSports:()=>{e(q("getData","sports"))},updateSport:(t,s)=>{e(q("updateData","sports",{id:t,is_active:s},!1))}})))(Q);class te extends c.a.PureComponent{getUrl(e){const t=this.props,s=t.query,a=t.pathname,r=Object.assign({},s);let o=s.page?+s.page:1;switch(e){case"prev":o-=1;break;case"next":o+=1;break;default:o=+e}return r.page=o,L(a,r)}render(){const e=this.props,t=e.pagination,s=e.t;return Object(a.jsx)(a.Fragment,{children:t&&Object.keys(t).length>0&&Object(a.jsx)("nav",{"aria-label":"Page navigation example",children:Object(a.jsxs)("ul",{className:"pagination justify-content-center",children:[Object(a.jsx)("li",{className:"page-item ".concat(t.has_prev?"":"disabled"),children:Object(a.jsx)(Y.a,{className:"page-link",to:this.getUrl("prev"),"aria-disabled":!t.has_prev,children:s("common:Previous")})}),(r=t.pages,Array.from({length:r},((e,t)=>t+1))).map((e=>Object(a.jsx)("li",{className:"page-item ".concat(e===t.page?"active":""),children:Object(a.jsx)(Y.a,{className:"page-link",to:this.getUrl(e),children:e})},e))),Object(a.jsx)("li",{className:"page-item ".concat(t.has_next?"":"disabled"),children:Object(a.jsx)(Y.a,{className:"page-link",to:this.getUrl("next"),"aria-disabled":!t.has_next,children:s("common:Next")})})]})})});var r}}class se extends c.a.Component{constructor(e,t){super(e,t),this.state={page:null,per_page:null,order_by:"created_at",order:"asc"}}componentDidMount(){this.props.loadUsers(this.initState())}componentDidUpdate(e){e.location.query!==this.props.location.query&&this.props.loadUsers(this.props.location.query)}initState(){const e=this.props.location.query,t={page:e.page,per_page:e.per_page,order_by:e.order_by?e.order_by:"created_at",order:e.order?e.order:"asc"};return this.setState(t),t}updatePage(e,t){const s=Object.assign({},this.state);s[e]=t,this.setState(s);const a=L(this.props.location.pathname,s);Ta.push(a)}render(){const e=this.props,t=e.authUser,s=e.location,r=e.message,o=e.t,c=e.pagination,n=e.updateUser,i=e.users,l=R(o,E),d=R(o,A);return Object(a.jsxs)("div",{children:[r&&Object(a.jsx)(v,{message:r,t:o}),Object(a.jsx)("div",{className:"container",children:Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)("strong",{children:o("administration:Users")})}),Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsxs)("div",{className:"row user-filters",children:[Object(a.jsx)("div",{className:"col-lg-4 col-md-6 col-sm-12",children:Object(a.jsxs)("label",{htmlFor:"order_by",children:[o("common:Sort by"),":"," ",Object(a.jsx)("select",{id:"order_by",name:"order_by",value:this.state.order_by,onChange:e=>this.updatePage("order_by",e.target.value),children:l.map((e=>Object(a.jsx)("option",{value:e.key,children:e.label},e.key)))})," "]})}),Object(a.jsx)("div",{className:"col-lg-4 col-md-6 col-sm-12",children:Object(a.jsxs)("label",{htmlFor:"sort",children:[o("common:Sort"),":"," ",Object(a.jsx)("select",{id:"sort",name:"sort",value:this.state.order,onChange:e=>this.updatePage("order",e.target.value),children:d.map((e=>Object(a.jsx)("option",{value:e.key,children:e.label},e.key)))})," "]})})]}),Object(a.jsxs)("table",{className:"table",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{children:"#"}),Object(a.jsx)("th",{children:o("user:Username")}),Object(a.jsx)("th",{children:o("user:Email")}),Object(a.jsx)("th",{children:o("user:Registration Date")}),Object(a.jsx)("th",{children:o("workouts:Workouts")}),Object(a.jsx)("th",{children:o("user:Admin")}),Object(a.jsx)("th",{children:o("administration:Actions")})]})}),Object(a.jsx)("tbody",{children:i.map((e=>Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:"#"}),!0===e.picture?Object(a.jsx)("img",{alt:"Avatar",src:"".concat(C,"users/").concat(e.username,"/picture?").concat(Date.now()),className:"img-fluid App-nav-profile-img"}):Object(a.jsx)("i",{className:"fa fa-user-circle-o fa-2x no-picture","aria-hidden":"true"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Username")}),Object(a.jsx)(Y.a,{to:"/users/".concat(e.username),children:e.username})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Email")}),e.email]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Registration Date")}),Object(y.a)(new Date(e.created_at),"dd/MM/yyyy HH:mm")]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("workouts:Workouts")}),e.nb_workouts]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("user:Admin")}),e.admin?Object(a.jsx)("i",{className:"fa fa-check-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"}):Object(a.jsx)("i",{className:"fa fa-square-o custom-fa","aria-hidden":"true","data-toggle":"tooltip"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:o("administration:Actions")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-".concat(e.admin?"dark":"primary"," btn-sm"),disabled:e.username===t.username,value:e.admin?o("administration:Remove admin rights"):o("administration:Add admin rights"),onClick:()=>n(e.username,!e.admin)})]})]},e.username)))})]}),Object(a.jsx)(te,{pagination:c,pathname:s.pathname,query:this.state,t:o}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ta.push("/admin/"),value:o("common:Back")})]})]})})})})]})}}var ae=Object(O.c)((e=>({authUser:e.user,location:e.router.location,message:e.message,pagination:e.users.pagination,users:e.users.data})),(e=>({loadUsers:t=>{e(q("getData","users",t))},updateUser:(t,s)=>{e(q("updateData","users",{username:t,admin:s},!1))}})))(se),re=s(223);function oe(){const e=Object(re.a)().t;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsx)("title",{children:"fittrackee - 404"})}),Object(a.jsx)("h1",{className:"page-title",children:e("Page not found")})]})}var ce=Object(w.a)()(Object(O.c)((e=>({appConfig:e.application.config,user:e.user})))((function(e){const t=e.appConfig,s=e.t,r=e.user;return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",s("administration:Administration")]})}),Object(a.jsx)("div",{className:"container dashboard",children:r.admin?Object(a.jsxs)(g.d,{children:[Object(a.jsx)(g.b,{exact:!0,path:"/admin",render:()=>Object(a.jsx)(Z,{appConfig:t,t:s})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/application",render:()=>Object(a.jsx)(K,{appConfig:t,t:s,isInEdition:!1})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/application/edit",render:()=>Object(a.jsx)(K,{appConfig:t,t:s,isInEdition:!0})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/sports",render:()=>Object(a.jsx)(ee,{t:s})}),Object(a.jsx)(g.b,{exact:!0,path:"/admin/users",render:()=>Object(a.jsx)(ae,{t:s})}),Object(a.jsx)(g.b,{component:oe})]}):Object(a.jsx)(oe,{})})]})}))),ne=s(892),ie=s(24),le=s(911),de=s(226),ue=s.n(de);const me=["#55a8a3","#98C3A9","#D0838A","#ECC77E","#926692","#929292","#428bca"],je=[{record_type:"AS",label:"Ave. speed"},{record_type:"FD",label:"Farest distance"},{record_type:"LD",label:"Longest duration"},{record_type:"MS",label:"Max. speed"}],pe=(e,t=null,s=null)=>(t||(t="yyyy/MM/dd"),s||(s="HH:mm"),{workout_date:e?Object(y.a)(e,t):null,workout_time:e?Object(y.a)(e,s):null}),he=e=>{let t=new Date(0);return t=Object(le.a)(t.setSeconds(e),1),t.getTime()},be=e=>{for(let t=0;t{const s=e.label.toLowerCase(),a=t.label.toLowerCase();return s>a?1:se.filter((e=>!s||e.is_active)).map((e=>Object(k.a)(Object(k.a)({},e),{},{label:t("sports:".concat(e.label))}))).sort(xe);class ge{static loginOrRegisterOrPasswordReset(e,t){const s={url:"auth/".concat(e),method:"POST",noAuthorization:!0,body:t,type:"application/json"};return P(s)}static deletePicture(){return P({url:"auth/picture",method:"DELETE"})}}const fe=e=>({type:"PICTURE_ERROR",message:e}),we=e=>({type:"PROFILE_UPDATE_ERROR",message:e}),ve=()=>e=>window.localStorage.getItem("authToken")?e(ke()):{type:"LOGOUT"},ke=()=>e=>U.getData("auth/profile").then((t=>"success"===t.status?(e(q("getData","sports")),t.data.isAuthenticated=!0,t.data.language&&e(B(t.data.language)),e({type:"PROFILE_SUCCESS",profil:t.data})):e({type:"PROFILE_ERROR",message:t.message}))).catch((e=>{throw e})),ye=(e,t)=>s=>{if("register"===t||"password/update"===t){const a=((e,t=!1)=>{const s=[];return!t&&(e.username.length<3||e.username.length>12)&&s.push("3 to 12 characters required for username."),e.password!==e.password_conf&&s.push("Password and password confirmation don't match."),e.password.length<8&&s.push("8 characters required for password."),s})(e,"password/update"===t);if(a.length>0)return s({type:"AUTH_ERRORS",messages:T(a)})}return s(((e,t)=>s=>ge.loginOrRegisterOrPasswordReset(e,t).then((t=>{if("success"===t.status){if("password/reset-request"===e)return Ta.push({pathname:"/password-reset/sent"});if("password/update"===e)return Ta.push({pathname:"/updated-password"});if("login"===e||"register"===e)return window.localStorage.setItem("authToken",t.auth_token),"register"===e&&s(V("config")),s(ke())}return s({type:"AUTH_ERROR",message:t.message})})).catch((e=>{throw e})))(t,e))},Ne=(e,t=!1)=>s=>U.deleteData("users",e).then((e=>{204===e.status?(s(V("config")),t?Ta.push("/admin/users"):(s({type:"LOGOUT"}),Ta.push("/"))):e.json().then((e=>s(W("".concat(e.message)))))})).catch((e=>s(W("user|".concat(e))))),_e=e=>({type:"SET_GPX",gpxContent:e}),Se=e=>({type:"SET_CHART_DATA",chartData:e}),De=e=>t=>U.updateData("workouts",e).then((e=>{"success"===e.status?(t(ve()),Ta.push("/workouts/".concat(e.data.workouts[0].id))):t(W("workouts|".concat(e.message))),t(H(!1))})).catch((e=>{t(H(!1)),t(W("workouts|".concat(e)))})),Ce=e=>t=>U.getData("workouts",e).then((e=>{"success"===e.status?e.data.workouts.length>0&&t({type:"PUSH_WORKOUTS",workouts:e.data.workouts}):t(W("workouts|".concat(e.message)))})).catch((e=>t(W("workouts|".concat(e)))));var Ee=Object(O.c)((e=>({appConfig:e.application.config,loading:e.loading})),(e=>({onAddWorkout:t=>{e(H(!0));const s=new FormData;s.append("file",t.target.form.gpxFile.files[0]),s.append("data",'{"sport_id": '.concat(t.target.form.sport.value,', "notes": "').concat(t.target.form.notes.value,'"}')),e((e=>t=>U.addDataWithFile("workouts",e).then((e=>{"created"===e.status?0===e.data.workouts.length?t(W("workouts|no correct file.")):1===e.data.workouts.length?(t(ve()),Ta.push("/workouts/".concat(e.data.workouts[0].id))):(t(ve()),Ta.push("/")):413===e.status?t(W("workouts|File size is greater than the allowed size")):t(W("workouts|".concat(e.message))),t(H(!1))})).catch((e=>{t(H(!1)),t(W("workouts|".concat(e)))})))(s))},onEditWorkout:(t,s)=>{e(De({id:s.id,notes:t.target.form.notes.value,sport_id:+t.target.form.sport.value,title:t.target.form.title.value}))}})))((function(e){const t=e.appConfig,s=e.loading,r=e.onAddWorkout,o=e.onEditWorkout,c=e.sports,n=e.t,i=e.workout,l=i?i.sport_id:"",d=Oe(c,n,!0),u="".concat(n("workouts:no folder inside"),", ").concat(t.gpx_limit_import," ").concat(n("workouts:files max"),", ").concat(n("workouts:max size"),": ").concat(D(t.max_zip_file_size)),m=D(t.max_single_file_size);return Object(a.jsxs)("form",{encType:"multipart/form-data",method:"post",onSubmit:e=>e.preventDefault(),children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[n("common:Sport"),":",Object(a.jsxs)("select",{className:"form-control input-lg",defaultValue:l,disabled:s,name:"sport",required:!0,children:[Object(a.jsx)("option",{value:""}),d.map((e=>Object(a.jsx)("option",{value:e.id,children:e.label},e.id)))]})]})}),i?Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[n("workouts:Title"),":",Object(a.jsx)("input",{name:"title",defaultValue:i?i.title:"",disabled:s,className:"form-control input-lg"})]})}):Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[Object(a.jsxs)(ne.a,{i18nKey:"workouts:gpxFile",children:[Object(a.jsx)("strong",{children:"gpx"})," file"]}),Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-question-circle","aria-hidden":"true","data-toggle":"tooltip",title:"".concat(n("workouts:max size"),": ").concat(m)})})," ",Object(a.jsxs)(ne.a,{i18nKey:"workouts:zipFile",children:["or ",Object(a.jsx)("strong",{children:" zip"})," file containing ",Object(a.jsx)("strong",{children:"gpx "}),"files"]}),Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-question-circle","aria-hidden":"true","data-toggle":"tooltip","data-placement":"top",title:u})})," ",":",Object(a.jsx)("input",{accept:".gpx, .zip",className:"form-control form-control-file gpx-file",disabled:s,name:"gpxFile",required:!0,type:"file"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[n("workouts:Notes"),":",Object(a.jsx)("textarea",{name:"notes",defaultValue:i?i.notes:"",disabled:s,className:"form-control input-lg",maxLength:"500"})]})}),s?Object(a.jsx)("div",{className:"loader"}):Object(a.jsxs)("div",{children:[Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",onClick:e=>i?o(e,i):r(e),value:n("common:Submit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ta.push("/"),value:n("common:Cancel")})]})]})}));var Ae=Object(O.c)((e=>({user:e.user})),(e=>({onAddOrEdit:(t,s)=>{const a=t.target.form.duration.value.split(":"),r=60*+a[0]*60+60*+a[1]+ +a[2],o={workout_date:"".concat(t.target.form.workout_date.value," ").concat(t.target.form.workout_time.value),distance:+t.target.form.distance.value,duration:r,notes:t.target.form.notes.value,sport_id:+t.target.form.sport_id.value,title:t.target.form.title.value};var c;s?(o.id=s.id,e(De(o))):e((c=o,e=>U.addData("workouts/no_gpx",c).then((t=>{"created"===t.status?(e(ve()),Ta.push("/workouts/".concat(t.data.workouts[0].id))):e(W("workouts|".concat(t.message)))})).catch((t=>e(W("workouts|".concat(t)))))))}})))((function(e){const t=e.onAddOrEdit,s=e.sports,r=e.t,o=e.user,c=e.workout,n=Oe(s,r,!0);let i,l,d="";if(c){const e=pe(z(c.workout_date,o.timezone),"yyyy-MM-dd");i=e.workout_date,l=e.workout_time,d=c.sport_id}return Object(a.jsxs)("form",{onSubmit:e=>e.preventDefault(),children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Title"),":",Object(a.jsx)("input",{name:"title",defaultValue:c?c.title:"",className:"form-control input-lg"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("common:Sport"),":",Object(a.jsxs)("select",{className:"form-control input-lg",defaultValue:d,name:"sport_id",required:!0,children:[Object(a.jsx)("option",{value:""}),n.map((e=>Object(a.jsx)("option",{value:e.id,children:e.label},e.id)))]})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Workout Date"),":",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("input",{name:"workout_date",defaultValue:i,className:"form-control col-md",required:!0,type:"date"}),Object(a.jsx)("input",{name:"workout_time",defaultValue:l,className:"form-control col-md",required:!0,type:"time"})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Duration"),":",Object(a.jsx)("input",{name:"duration",defaultValue:c?c.duration:"",className:"form-control col-xs-4",pattern:"^([0-9]*[0-9]):([0-5][0-9]):([0-5][0-9])$",placeholder:"hh:mm:ss",required:!0,type:"text"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Distance")," (km):",Object(a.jsx)("input",{name:"distance",defaultValue:c?c.distance:"",className:"form-control input-lg",min:0,required:!0,step:"0.001",type:"number"})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Notes"),":",Object(a.jsx)("textarea",{name:"notes",defaultValue:c?c.notes:"",className:"form-control input-lg",maxLength:"500"})]})}),Object(a.jsx)("input",{type:"submit",className:"btn btn-primary",onClick:e=>t(e,c),value:r("common:Submit")}),Object(a.jsx)("input",{type:"submit",className:"btn btn-secondary",onClick:()=>Ta.push("/"),value:r("common:Cancel")})]})}));class Me extends c.a.Component{constructor(e,t){super(e,t),this.state={withGpx:!0}}handleRadioChange(e){this.setState({withGpx:"withGpx"===e.target.name?e.target.value:!e.target.value})}render(){const e=this.props,t=e.loading,s=e.message,r=e.sports,o=e.t,c=e.workout,n=this.state.withGpx;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee -"," ",o(c?"workouts:Edit a workout":"workouts:Add a workout")]})}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(v,{message:s,t:o}),Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-2"}),Object(a.jsx)("div",{className:"col-md-8",children:Object(a.jsxs)("div",{className:"card add-workout",children:[Object(a.jsx)("h2",{className:"card-header text-center",children:o(c?"workouts:Edit a workout":"workouts:Add a workout")}),Object(a.jsx)("div",{className:"card-body",children:c?c.with_gpx?Object(a.jsx)(Ee,{workout:c,sports:r,t:o}):Object(a.jsx)(Ae,{workout:c,sports:r,t:o}):Object(a.jsxs)("div",{children:[Object(a.jsx)("form",{children:Object(a.jsxs)("div",{className:"form-group row",children:[Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("label",{className:"radioLabel",children:[Object(a.jsx)("input",{className:"add-workout-radio",type:"radio",name:"withGpx",disabled:t,checked:n,onChange:e=>this.handleRadioChange(e)}),o("workouts:with gpx file")]})}),Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("label",{className:"radioLabel",children:[Object(a.jsx)("input",{className:"add-workout-radio",type:"radio",name:"withoutGpx",disabled:t,checked:!n,onChange:e=>this.handleRadioChange(e)}),o("workouts:without gpx file")]})})]})}),n?Object(a.jsx)(Ee,{sports:r,t:o}):Object(a.jsx)(Ae,{sports:r,t:o})]})})]})}),Object(a.jsx)("div",{className:"col-md-2"})]})})]})}}var Te=Object(w.a)()(Object(O.c)((e=>({loading:e.loading})))(Me));var Pe=Object(O.c)((e=>({message:e.message,sports:e.sports.data,user:e.user})))((function(e){const t=e.message,s=e.sports;return Object(a.jsx)("div",{children:Object(a.jsx)(Te,{workout:null,message:t,sports:s})})}));function ze(e){const t=Object(re.a)().t;return Object(a.jsx)("div",{className:"custom-modal-backdrop",children:Object(a.jsx)("div",{className:"custom-modal",children:Object(a.jsxs)("div",{className:"modal-content",children:[Object(a.jsxs)("div",{className:"modal-header",children:[Object(a.jsx)("h5",{className:"modal-title",children:e.title}),Object(a.jsx)("button",{type:"button",className:"close","aria-label":"Close",onClick:()=>e.close(),children:Object(a.jsx)("span",{"aria-hidden":"true",children:"\xd7"})})]}),Object(a.jsx)("div",{className:"modal-body",children:Object(a.jsx)("p",{children:e.text})}),Object(a.jsxs)("div",{className:"modal-footer",children:[Object(a.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>e.confirm(),children:t("common:Yes")}),Object(a.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:()=>e.close(),children:t("common:No")})]})]})})})}function Fe(e){const t=e.dataType,s=e.displayModal,r=e.segmentId,o=e.sport,c=e.t,n=e.title,i=e.user,l=e.workout,d=l?pe(z(l.workout_date,i.timezone)):null,u="segment"===t&&1!==r?"/workouts/".concat(l.id,"/segment/").concat(r-1):"workout"===t&&l.previous_workout?"/workouts/".concat(l.previous_workout):null,m="segment"===t&&rs(!0),title:c("workouts:Delete workout")})]}):Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Y.a,{to:"/workouts/".concat(l.id),children:n})," ","- ",c("workouts:segment")," ",r]}),Object(a.jsx)("br",{}),d&&Object(a.jsx)("span",{className:"workout-date",children:"".concat(d.workout_date," - ").concat(d.workout_time)})]}),Object(a.jsx)("div",{className:"col-auto",children:m?Object(a.jsx)(Y.a,{className:"unlink",to:m,children:Object(a.jsx)("i",{className:"fa fa-chevron-right","aria-hidden":"true",title:c("workouts:See next ".concat(t))})}):Object(a.jsx)("i",{className:"fa fa-chevron-right inactive-link","aria-hidden":"true",title:c("workouts:No next ".concat(t))})})]})})}var Re=s(25);class Le extends c.a.Component{constructor(e,t){super(e,t),this.state={displayDistance:!0,dataToHide:[]}}componentDidMount(){"workout"===this.props.dataType?this.props.loadWorkoutData(this.props.workout.id):this.props.loadSegmentData(this.props.workout.id,this.props.segmentId)}componentDidUpdate(e){("workout"===this.props.dataType&&e.workout.id!==this.props.workout.id||"workout"===this.props.dataType&&"segment"===e.dataType)&&this.props.loadWorkoutData(this.props.workout.id),"segment"===this.props.dataType&&e.segmentId!==this.props.segmentId&&this.props.loadSegmentData(this.props.workout.id,this.props.segmentId)}componentWillUnmount(){this.props.loadWorkoutData(null)}handleRadioChange(e){this.setState({displayDistance:"distance"===e.target.name?e.target.value:!e.target.value})}handleLegendChange(e){const t=this.state.dataToHide,s=e.target.name;t.find((e=>e===s))?t.splice(t.indexOf(s),1):t.push(s),this.setState({dataToHide:t})}displayData(e){return!this.state.dataToHide.find((t=>t===e))}render(){const e=this.props,t=e.chartData,s=e.t,r=e.updateCoordinates,o=this.state.displayDistance,c=t?parseInt(t.length/10,10):0;let n,i;return o?(n="distance",i="linear"):(n="duration",i="time"),Object(a.jsx)("div",{className:"container",children:t&&t.length>0?Object(a.jsxs)("div",{children:[Object(a.jsxs)("div",{className:"row chart-radio",children:[Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"radio",name:"distance",checked:o,onChange:e=>this.handleRadioChange(e)}),s("workouts:distance")]}),Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"radio",name:"duration",checked:!o,onChange:e=>this.handleRadioChange(e)}),s("workouts:duration")]})]}),Object(a.jsxs)("div",{className:"row chart-radio",children:[Object(a.jsx)("div",{className:"col-md-5"}),Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"checkbox",name:"speed",checked:this.displayData("speed"),onChange:e=>this.handleLegendChange(e)}),s("workouts:speed")]}),Object(a.jsxs)("label",{className:"radioLabel col-md-1",children:[Object(a.jsx)("input",{type:"checkbox",name:"elevation",checked:this.displayData("elevation"),onChange:e=>this.handleLegendChange(e)}),s("workouts:elevation")]}),Object(a.jsx)("div",{className:"col-md-5"})]}),Object(a.jsx)("div",{className:"row chart",children:Object(a.jsx)(Re.f,{height:300,children:Object(a.jsxs)(Re.d,{data:t,margin:{top:15,right:30,left:20,bottom:15},onMouseMove:e=>r(e.activePayload),onMouseLeave:()=>r(null),children:[Object(a.jsx)(Re.h,{allowDecimals:!1,dataKey:n,label:{value:s("workouts:".concat(n)),offset:0,position:"bottom"},scale:i,interval:c,tickFormatter:e=>o?e:Object(y.a)(e,"HH:mm:ss"),type:"number"}),Object(a.jsx)(Re.i,{label:{value:"".concat(s("workouts:speed")," (km/h)"),angle:-90,position:"left"},yAxisId:"left"}),Object(a.jsx)(Re.i,{label:{value:"".concat(s("workouts:elevation")," (m)"),angle:-90,position:"right"},yAxisId:"right",orientation:"right"}),this.displayData("elevation")&&Object(a.jsx)(Re.a,{yAxisId:"right",type:"linear",dataKey:"elevation",name:s("workouts:elevation"),fill:"#e5e5e5",stroke:"#cccccc",dot:!1,unit:" m"}),this.displayData("speed")&&Object(a.jsx)(Re.e,{yAxisId:"left",type:"linear",dataKey:"speed",name:s("workouts:speed"),stroke:"#8884d8",strokeWidth:2,dot:!1,unit:" km/h"}),Object(a.jsx)(Re.g,{labelFormatter:e=>o?"".concat(s("workouts:distance"),": ").concat(e," km"):"".concat(s("workouts:duration"),": ").concat(Object(y.a)(e,"HH:mm:ss"))})]})})}),Object(a.jsx)("div",{className:"chart-info",children:s("workouts:data from gpx, without any cleaning")})]}):s("workouts:No data to display")})}}var Ue=Object(O.c)((e=>({chartData:e.chartData})),(e=>({loadWorkoutData:t=>{e((e=>t=>{if(e)return U.getData("workouts/".concat(e,"/chart_data")).then((e=>{"success"===e.status?t(Se(be(e.data.chart_data))):t(W("workouts|".concat(e.message)))})).catch((e=>t(W("workouts|".concat(e)))));t(Se(null))})(t))},loadSegmentData:(t,s)=>{e(((e,t)=>s=>{if(e)return U.getData("workouts/".concat(e,"/chart_data/segment/").concat(t)).then((e=>{"success"===e.status?s(Se(be(e.data.chart_data))):s(W("workouts|".concat(e.message)))})).catch((e=>s(W("workouts|".concat(e)))));s(Se(null))})(t,s))}})))(Le);function Ie(e){const t=e.t,s=e.workout;return Object(a.jsx)("div",{className:"container",children:s.weather_start&&s.weather_end&&Object(a.jsxs)("table",{className:"table table-borderless weather-table text-center",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{}),Object(a.jsxs)("th",{children:[t("workouts:Start"),Object(a.jsx)("br",{}),Object(a.jsx)("img",{className:"weather-img",src:"/img/weather/".concat(s.weather_start.icon,".png"),alt:"workout weather (".concat(s.weather_start.icon,")"),title:s.weather_start.summary})]}),Object(a.jsxs)("th",{children:[t("workouts:End"),Object(a.jsx)("br",{}),Object(a.jsx)("img",{className:"weather-img",src:"/img/weather/".concat(s.weather_end.icon,".png"),alt:"workout weather (".concat(s.weather_end.icon,")"),title:s.weather_end.summary})]})]})}),Object(a.jsxs)("tbody",{children:[Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{children:Object(a.jsx)("img",{className:"weather-img-small",src:"/img/weather/temperature.png",alt:"Temperatures"})}),Object(a.jsxs)("td",{children:[Number(s.weather_start.temperature).toFixed(1),"\xb0C"]}),Object(a.jsxs)("td",{children:[Number(s.weather_end.temperature).toFixed(1),"\xb0C"]})]}),Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{children:Object(a.jsx)("img",{className:"weather-img-small",src:"/img/weather/pour-rain.png",alt:"Temperatures"})}),Object(a.jsxs)("td",{children:[Number(100*s.weather_start.humidity).toFixed(1),"%"]}),Object(a.jsxs)("td",{children:[Number(100*s.weather_end.humidity).toFixed(1),"%"]})]}),Object(a.jsxs)("tr",{children:[Object(a.jsx)("td",{children:Object(a.jsx)("img",{className:"weather-img-small",src:"/img/weather/breeze.png",alt:"Temperatures"})}),Object(a.jsxs)("td",{children:[Number(s.weather_start.wind).toFixed(1),"m/s"]}),Object(a.jsxs)("td",{children:[Number(s.weather_end.wind).toFixed(1),"m/s"]})]})]})]})})}function We(e){const t=e.t,s=e.workout,r="0:00:00"!==s.pauses&&null!==s.pauses;return Object(a.jsxs)("div",{className:"workout-details",children:[Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-clock-o custom-fa","aria-hidden":"true"}),t("workouts:Duration"),": ",s.moving,s.records&&s.records.find((e=>"LD"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})}),r&&Object(a.jsxs)("span",{children:[Object(a.jsx)("br",{}),"(",t("workouts:pauses"),": ",s.pauses,","," ",t("workouts:total duration"),": ",s.duration,")"]})]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-road custom-fa","aria-hidden":"true"}),t("workouts:Distance"),": ",s.distance," km",s.records&&s.records.find((e=>"FD"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})})]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-tachometer custom-fa","aria-hidden":"true"}),t("workouts:Average speed"),": ",s.ave_speed," km/h",s.records&&s.records.find((e=>"AS"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})}),Object(a.jsx)("br",{}),t("workouts:Max. speed"),": ",s.max_speed," km/h",s.records&&s.records.find((e=>"MS"===e.record_type))&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa","aria-hidden":"true"})})]}),s.min_alt&&s.max_alt&&Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fi-mountains custom-fa"}),t("workouts:Min. altitude"),": ",s.min_alt,"m",Object(a.jsx)("br",{}),t("workouts:Max. altitude"),": ",s.max_alt,"m"]}),s.ascent&&s.descent&&Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-location-arrow custom-fa"}),t("workouts:Ascent"),": ",s.ascent,"m",Object(a.jsx)("br",{}),t("workouts:Descent"),": ",s.descent,"m"]}),Object(a.jsx)(Ie,{workout:s,t:t})]})}var He=s(896),qe=s(893),Be=s(912),Ge=s(894),Ve=s(895),Je=s(237),Ke=s.n(Je);function Ye({bounds:e,coordinates:t,jsonData:s,mapAttribution:r}){return Object(qe.a)().fitBounds(e),Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Be.a,{attribution:r,url:"".concat(C,"workouts/map_tile/{s}/{z}/{x}/{y}.png")}),Object(a.jsx)(Ge.a,{data:s},Ke()(s)),t.latitude&&Object(a.jsx)(Ve.a,{position:[t.latitude,t.longitude]})]})}class Xe extends c.a.Component{constructor(e,t){super(e,t),this.state={zoom:13}}componentDidMount(){"workout"===this.props.dataType?this.props.loadWorkoutGpx(this.props.workout.id):this.props.loadSegmentGpx(this.props.workout.id,this.props.segmentId)}componentDidUpdate(e){("workout"===this.props.dataType&&e.workout.id!==this.props.workout.id||"workout"===this.props.dataType&&"segment"===e.dataType)&&this.props.loadWorkoutGpx(this.props.workout.id),"segment"===this.props.dataType&&e.segmentId!==this.props.segmentId&&this.props.loadSegmentGpx(this.props.workout.id,this.props.segmentId)}componentWillUnmount(){this.props.loadWorkoutGpx(null)}render(){const e=this.props,t=e.coordinates,s=e.gpxContent,r=e.mapAttribution,o=e.workout,c=(e=>{let t;if(e){const s=(new DOMParser).parseFromString(e,"text/xml");t=ue.a.gpx(s)}return{jsonData:t}})(s).jsonData,n=[[o.bounds[0],o.bounds[1]],[o.bounds[2],o.bounds[3]]];return Object(a.jsx)("div",{children:c&&Object(a.jsx)(He.a,{zoom:this.state.zoom,bounds:n,boundsOptions:{padding:[10,10]},children:Object(a.jsx)(Ye,{bounds:n,coordinates:t,jsonData:c,mapAttribution:r})})})}}var $e=Object(O.c)((e=>({gpxContent:e.gpx,mapAttribution:e.application.config.map_attribution})),(e=>({loadWorkoutGpx:t=>{e((e=>t=>{if(e)return U.getData("workouts/".concat(e,"/gpx")).then((e=>{"success"===e.status?t(_e(e.data.gpx)):t(W("workouts|".concat(e.message)))})).catch((e=>t(W("workouts|".concat(e)))));t(_e(null))})(t))},loadSegmentGpx:(t,s)=>{e(((e,t)=>s=>{if(e)return U.getData("workouts/".concat(e,"/gpx/segment/").concat(t)).then((e=>{"success"===e.status?s(_e(e.data.gpx)):s(W("workouts|".concat(e.message)))})).catch((e=>s(W("workouts|".concat(e)))));s(_e(null))})(t,s))}})))(Xe);function Ze(e){const t=e.t;return Object(a.jsx)("div",{className:"workout-no-map text-center",children:t("workouts:No Map")})}function Qe(e){const t=e.notes,s=e.t;return Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body",children:["Notes",Object(a.jsx)("div",{className:"workout-notes",children:t||s("workouts:No notes")})]})})})})}function et(e){const t=e.segments,s=e.t;return Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body",children:[s("workouts:Segments"),Object(a.jsx)("div",{className:"workout-segments",children:Object(a.jsx)("ul",{children:t.map(((e,t)=>Object(a.jsxs)("li",{className:"workout-segments-list",children:[Object(a.jsxs)(Y.a,{to:"/workouts/".concat(e.workout_id,"/segment/").concat(t+1),children:[s("workouts:segment")," ",t+1]})," ","(",s("workouts:distance"),": ",e.distance," km,"," ",s("workouts:duration"),": ",e.duration,")"]},"segment-".concat(t))))})})]})})})})}class tt extends c.a.Component{constructor(e,t){super(e,t),this.state={displayModal:!1,coordinates:{latitude:null,longitude:null}}}componentDidMount(){this.props.loadWorkout(this.props.match.params.workoutId)}componentDidUpdate(e){e.match.params.workoutId!==this.props.match.params.workoutId&&this.props.loadWorkout(this.props.match.params.workoutId)}displayModal(e){this.setState((t=>Object(k.a)(Object(k.a)({},t),{},{displayModal:e})))}updateCoordinates(e){const t=e&&e.length>0?{latitude:e[0].payload.latitude,longitude:e[0].payload.longitude}:{latitude:null,longitude:null};this.setState((e=>Object(k.a)(Object(k.a)({},e),{},{coordinates:t})))}render(){const e=this.props,t=e.message,s=e.onDeleteWorkout,r=e.sports,o=e.t,c=e.user,n=e.workouts,i=this.state,l=i.coordinates,d=i.displayModal,u=Object(ie.a)(n,1)[0],m=u?u.title:o("workouts:Workout"),j=u?r.filter((e=>e.id===u.sport_id)):[],p=Object(ie.a)(j,1)[0],h=parseInt(this.props.match.params.segmentId),b=h>=0?"segment":"workout";return Object(a.jsxs)("div",{className:"workout-page",children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",m]})}),t?Object(a.jsx)(v,{message:t,t:o}):Object(a.jsxs)("div",{className:"container",children:[d&&Object(a.jsx)(ze,{title:o("common:Confirmation"),text:o("workouts:Are you sure you want to delete this workout?"),confirm:()=>{s(u.id),this.displayModal(!1)},close:()=>this.displayModal(!1)}),u&&p&&1===n.length&&Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsx)(Fe,{workout:u,dataType:b,segmentId:h,sport:p,t:o,title:m,user:c,displayModal:()=>this.displayModal(!0)})}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-8",children:u.with_gpx?Object(a.jsx)($e,{workout:u,coordinates:l,dataType:b,segmentId:h}):Object(a.jsx)(Ze,{t:o})}),Object(a.jsx)("div",{className:"col",children:Object(a.jsx)(We,{workout:"workout"===b?u:u.segments[h-1],t:o})})]})})]})})}),u.with_gpx&&Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("div",{className:"row",children:Object(a.jsxs)("div",{className:"col",children:[Object(a.jsx)("div",{className:"chart-title",children:o("workouts:Chart")}),Object(a.jsx)(Ue,{workout:u,dataType:b,segmentId:h,t:o,updateCoordinates:e=>this.updateCoordinates(e)})]})})})})})}),"workout"===b&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Qe,{notes:u.notes,t:o}),u.segments.length>1&&Object(a.jsx)(et,{segments:u.segments,t:o})]})]})]})]})}}var st=Object(w.a)()(Object(O.c)((e=>({workouts:e.workouts.data,message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadWorkout:t=>{e(q("getData","workouts",{id:t}))},onDeleteWorkout:t=>{var s;e((s=t,e=>U.deleteData("workouts",s).then((t=>{var a;204===t.status?Promise.resolve(e((a=s,{type:"REMOVE_WORKOUT",workoutId:a}))).then((()=>e(ve()))).then((()=>Ta.push("/"))):e(W("workouts|".concat(t.status)))})).catch((t=>e(W("workouts|".concat(t)))))))}})))(tt));class at extends c.a.Component{componentDidMount(){this.props.loadWorkout(this.props.match.params.workoutId)}render(){const e=this.props,t=e.message,s=e.sports,r=e.workouts,o=Object(ie.a)(r,1)[0];return Object(a.jsx)("div",{children:s.length>0&&Object(a.jsx)(Te,{workout:o,message:t,sports:s})})}}var rt=Object(O.c)((e=>({workouts:e.workouts.data,message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadWorkout:t=>{e(q("getData","workouts",{id:t}))}})))(at);var ot=Object(O.c)((e=>({user:e.user})))((function(){return Object(a.jsx)("div",{children:M()?Object(a.jsxs)(g.d,{children:[Object(a.jsx)(g.b,{exact:!0,path:"/workouts/add",component:Pe}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/:workoutId",component:st}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/:workoutId/edit",component:rt}),Object(a.jsx)(g.b,{path:"/workouts/:workoutId/segment/:segmentId",component:st}),Object(a.jsx)(g.b,{component:oe})]}):Object(a.jsx)(g.a,{to:"/login"})})}));class ct extends c.a.PureComponent{render(){const e=this.props.t;return Object(a.jsx)("div",{className:"card text-center",children:Object(a.jsxs)("div",{className:"card-body",children:[e("common:No workouts.")," ",Object(a.jsx)(Y.a,{to:{pathname:"/workouts/add"},children:e("dashboard:Upload one !")})]})})}}class nt extends c.a.PureComponent{render(){const e=this.props,t=e.loadWorkouts,s=e.sports,r=e.t,o=e.updateParams,c=Oe(s,r);return Object(a.jsx)("div",{className:"card",children:Object(a.jsx)("div",{className:"card-body workout-filter",children:Object(a.jsxs)("form",{onSubmit:e=>e.preventDefault(),children:[Object(a.jsxs)("div",{className:"form-group",children:[Object(a.jsxs)("label",{children:[r("workouts:From"),":",Object(a.jsx)("input",{className:"form-control col-md",name:"from",onChange:e=>o(e),type:"date"})]}),Object(a.jsxs)("label",{children:[r("workouts:To"),":",Object(a.jsx)("input",{className:"form-control col-md",name:"to",onChange:e=>o(e),type:"date"})]})]}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("common:Sport"),":",Object(a.jsxs)("select",{className:"form-control input-lg",name:"sport_id",onChange:e=>o(e),children:[Object(a.jsx)("option",{value:""}),c.map((e=>Object(a.jsx)("option",{value:e.id,children:e.label},e.id)))]})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Distance")," (km):",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"distance_from",onChange:e=>o(e),step:"1",type:"number"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"distance_to",onChange:e=>o(e),step:"1",type:"number"})})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Duration"),":",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",name:"duration_from",onChange:e=>o(e),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",name:"duration_to",onChange:e=>o(e),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"})})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Average speed")," (km/h):",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"ave_speed_from",onChange:e=>o(e),step:"1",type:"number"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"ave_speed_to",onChange:e=>o(e),step:"1",type:"number"})})]})})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[r("workouts:Max. speed")," (km/h):",Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"max_speed_from",onChange:e=>o(e),step:"1",type:"number"})}),Object(a.jsx)("div",{className:"col-2 align-middle text-center",children:r("common:to")}),Object(a.jsx)("div",{className:"col-5",children:Object(a.jsx)("input",{className:"form-control",min:0,name:"max_speed_to",onChange:e=>o(e),step:"1",type:"number"})})]})})]})}),Object(a.jsx)("input",{className:"btn btn-primary btn-lg btn-block",onClick:()=>t(),type:"submit",value:r("workouts:Filter")})]})})})}}class it extends c.a.PureComponent{render(){const e=this.props,t=e.display,s=e.workout;return Object(a.jsxs)("div",{className:"workout-map".concat("list"===t?"-list":""),children:[Object(a.jsx)("img",{src:"".concat(C,"workouts/map/").concat(s.map,"?").concat(Date.now()),alt:"workout map"}),Object(a.jsxs)("div",{className:"map-attribution".concat("list"===t?"-list":""),children:[Object(a.jsx)("span",{className:"map-attribution-text",children:"\xa9"}),Object(a.jsx)("a",{className:"map-attribution-text",href:"http://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer",children:"OpenStreetMap"})]})]})}}class lt extends c.a.PureComponent{render(){const e=this.props,t=e.loading,s=e.sports,r=e.t,o=e.user,c=e.workouts;return Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsxs)("table",{className:"table",children:[Object(a.jsx)("thead",{children:Object(a.jsxs)("tr",{children:[Object(a.jsx)("th",{scope:"col"}),Object(a.jsx)("th",{scope:"col",children:r("common:Workout")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Date")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Distance")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Duration")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Ave. speed")}),Object(a.jsx)("th",{scope:"col",children:r("workouts:Max. speed")})]})}),Object(a.jsx)("tbody",{children:!t&&s&&c.map(((e,t)=>Object(a.jsxs)("tr",{children:[Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("common:Sport")}),Object(a.jsx)("img",{className:"workout-sport",src:s.filter((t=>t.id===e.sport_id)).map((e=>e.img)),alt:"workout sport logo"})]}),Object(a.jsxs)("td",{className:"workout-title",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("common:Workout")}),Object(a.jsx)(Y.a,{to:"/workouts/".concat(e.id),children:e.title}),e.map&&Object(a.jsx)(it,{workout:e,display:"list"})]}),Object(a.jsxs)("td",{children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Date")}),Object(y.a)(z(e.workout_date,o.timezone),"dd/MM/yyyy HH:mm")]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Distance")}),Number(e.distance).toFixed(2)," km"]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Duration")}),e.moving]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Ave. speed")}),e.ave_speed," km/h"]}),Object(a.jsxs)("td",{className:"text-right",children:[Object(a.jsx)("span",{className:"heading-span-absolute",children:r("workouts:Max. speed")}),e.max_speed," km/h"]})]},t)))})]}),t&&Object(a.jsx)("div",{className:"loader"})]})})}}class dt extends c.a.Component{constructor(e,t){super(e,t),this.state={params:{page:1,per_page:10}}}componentDidMount(){this.props.loadWorkouts(this.state.params)}setParams(e){const t=this.state.params;""===e.target.value?delete t[e.target.name]:t[e.target.name]=e.target.value,t.page=1,this.setState(t)}render(){const e=this.props,t=e.loading,s=e.loadWorkouts,r=e.loadMoreWorkouts,o=e.message,c=e.sports,n=e.t,i=e.user,l=e.workouts,d=this.state.params,u=!(l.length>0)||null===l[l.length-1].previous_workout;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",n("common:Workouts")]})}),o?Object(a.jsx)(v,{message:o,t:n}):Object(a.jsx)("div",{className:"container history",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-3",children:Object(a.jsx)(nt,{sports:c,loadWorkouts:()=>s(d),t:n,updateParams:e=>this.setParams(e)})}),Object(a.jsxs)("div",{className:"col-md-9 workouts-result",children:[Object(a.jsx)(lt,{workouts:l,loading:t,sports:c,t:n,user:i}),!u&&Object(a.jsx)("input",{type:"submit",className:"btn btn-default btn-md btn-block",value:"Load more workouts",onClick:()=>{d.page+=1,r(d),this.setState(d)}}),0===l.length&&Object(a.jsx)(ct,{t:n})]})]})})]})}}var ut=Object(w.a)()(Object(O.c)((e=>({workouts:e.workouts.data,loading:e.loading,message:e.message,sports:e.sports.data,user:e.user})),(e=>({loadWorkouts:t=>{e(q("getData","workouts",t))},loadMoreWorkouts:t=>{e(Ce(t))}})))(dt));var mt=Object(w.a)()(Object(O.c)((e=>({appConfig:e.application.config,pathname:e.router.location.pathname,message:e.message})),(e=>({onDeletePicture:()=>{e((e=>ge.deletePicture().then((t=>204===t.status?e(ke()):e(fe(t.message)))).catch((e=>{throw e}))))},onUploadPicture:t=>{e((e=>t=>{e.preventDefault();const s=new FormData;return s.append("file",e.target.picture.files[0]),e.target.reset(),U.addDataWithFile("auth/picture",s).then((e=>{if("success"===e.status)return t(ke());const s=413===e.status?"Error during picture update, file size exceeds max size.":e.message;return t(fe(s))})).catch((e=>{throw e}))})(t))}})))((function({appConfig:e,displayModal:t,editable:s,isDeletable:r,message:o,onDeletePicture:c,onUploadPicture:n,pathname:i,t:l,user:d}){const u=d.created_at?Object(y.a)(new Date(d.created_at),"dd/MM/yyyy HH:mm"):"",m=d.birth_date?Object(y.a)(new Date(d.birth_date),"dd/MM/yyyy"):"",j=D(e.max_single_file_size);return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",l("user:Profile")]})}),Object(a.jsx)(v,{message:o,t:l}),Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("h1",{className:"page-title",children:l("user:Profile")}),Object(a.jsx)("div",{className:"row",children:Object(a.jsx)("div",{className:"col-md-12",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header userName",children:Object(a.jsx)("strong",{children:d.username})}),Object(a.jsxs)("div",{className:"card-body",children:[Object(a.jsxs)("div",{className:"row",children:[Object(a.jsxs)("div",{className:"col-md-8",children:[Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Email")}),": ",d.email]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Registration Date")}),": ",u]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:First Name")}),": ",d.first_name]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Last Name")}),": ",d.last_name]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Birth Date")}),": ",m]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Location")}),": ",d.location]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Bio")}),":"," ",d.bio]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Language")}),": ",d.language]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:Timezone")}),": ",d.timezone]}),Object(a.jsxs)("p",{children:[Object(a.jsx)("span",{className:"user-label",children:l("user:First day of week")}),": ",d.weekm?l("user:Monday"):l("user:Sunday")]})]}),Object(a.jsxs)("div",{className:"col-md-4",children:[!0===d.picture&&Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"Profile",src:"".concat(C,"users/").concat(d.username,"/picture")+"?".concat(Date.now()),className:"img-fluid App-profile-img-small"}),s&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("br",{}),Object(a.jsx)("button",{type:"submit",onClick:()=>c(),children:l("user:Delete picture")}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{})]})]}),s&&Object(a.jsxs)("form",{encType:"multipart/form-data",onSubmit:e=>n(e),children:[Object(a.jsx)("input",{type:"file",name:"picture",accept:".png,.jpg,.gif"}),Object(a.jsx)("br",{}),Object(a.jsx)("button",{type:"submit",children:l("user:Send")})," (max. size: ".concat(j,")")]})," "]})]}),s&&Object(a.jsx)("button",{className:"btn btn-primary",onClick:()=>Ta.push("/profile/edit"),children:l("common:Edit")}),r&&Object(a.jsx)("button",{className:"btn btn-danger",onClick:()=>t(!0),children:l("user:Delete user account")}),Object(a.jsx)("button",{className:"btn btn-secondary",onClick:()=>"/profile"===i?Ta.push("/"):Ta.go(-1),children:l("/profile"===i?"common:Back to home":"common:Back")})]})]})})})]})]})})));var jt=Object(w.a)()(Object(O.c)((e=>({user:e.user})))((function({t:e,user:t}){return Object(a.jsx)("div",{children:Object(a.jsx)(mt,{editable:!0,t:e,user:t})})}))),pt=s(897),ht=s(898),bt=s(899),xt=s(900),Ot=s(238),gt=s(242),ft=s(901),wt=s(902),vt=s(107),kt=s(903),yt=s(144);function Nt(e){const t=e.isDisabled,s=e.isMore,r=e.sportImg,o=e.workout;return Object(a.jsx)(Y.a,{className:"calendar-workout".concat(s),to:"/workouts/".concat(o.id),children:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("img",{alt:"workout sport logo",className:"workout-sport ".concat(t),src:r,title:o.title}),o.records.length>0&&Object(a.jsx)("sup",{children:Object(a.jsx)("i",{className:"fa fa-trophy custom-fa-small","aria-hidden":"true",title:o.records.map((e=>" ".concat(je.filter((t=>t.record_type===e.record_type))[0].label)))})})]})})}class _t extends c.a.Component{constructor(e,t){super(e,t),this.state={isHidden:!0}}handleDisplayMore(){this.setState({isHidden:!this.state.isHidden})}render(){const e=this.props,t=e.dayWorkouts,s=e.isDisabled,r=e.sports,o=this.state.isHidden;return Object(a.jsxs)("div",{children:[t.map((e=>Object(a.jsx)(Nt,{workout:e,isDisabled:s,isMore:"",sportImg:r.filter((t=>t.id===e.sport_id)).map((e=>e.img))},e.id))),t.length>2&&Object(a.jsx)("i",{className:"fa fa-".concat(o?"plus":"times"," calendar-more"),"aria-hidden":"true",onClick:()=>this.handleDisplayMore(),title:"show more workouts"}),!o&&Object(a.jsx)("div",{className:"calendar-display-more",children:t.map((e=>Object(a.jsx)(Nt,{workout:e,isDisabled:s,isMore:"-more",sportImg:r.filter((t=>t.id===e.sport_id)).map((e=>e.img))},e.id)))})]})}}const St=(e,t)=>{const s=Object(pt.a)(e),a=Object(ht.a)(e),r=t?1:0;return{start:Object(bt.a)(s,{weekStartsOn:r}),end:Object(xt.a)(a)}};class Dt extends c.a.Component{constructor(e,t){super(e,t);const s=new Date;this.state={currentMonth:s,startDate:St(s,e.weekm).start,endDate:St(s,e.weekm).end,weekStartOnMonday:e.weekm}}componentDidMount(){this.props.loadMonthWorkouts(this.state.startDate,this.state.endDate)}renderHeader(e){return Object(a.jsxs)("div",{className:"header row flex-middle",children:[Object(a.jsx)("div",{className:"col col-start",onClick:()=>this.handlePrevMonth(),children:Object(a.jsx)("i",{className:"fa fa-chevron-left","aria-hidden":"true"})}),Object(a.jsx)("div",{className:"col col-center",children:Object(a.jsx)("span",{children:Object(y.a)(this.state.currentMonth,"MMM yyyy",e)})}),Object(a.jsx)("div",{className:"col col-end",onClick:()=>this.handleNextMonth(),children:Object(a.jsx)("i",{className:"fa fa-chevron-right","aria-hidden":"true"})})]})}renderDays(e){const t=[],s=this.state.startDate;for(let r=0;r<7;r++)t.push(Object(a.jsx)("div",{className:"col col-center",children:Object(y.a)(Object(Ot.a)(s,r),"EEE",e)},r));return Object(a.jsx)("div",{className:"days row",children:t})}filterWorkouts(e){const t=this.props,s=t.workouts,a=t.user;return s?s.filter((t=>Object(gt.a)(z(t.workout_date,a.timezone),e))):[]}renderCells(){const e=this.state,t=e.currentMonth,s=e.startDate,r=e.endDate,o=e.weekStartOnMonday,c=this.props.sports,n=[];let i=[],l=s,d="";for(;l<=r;){for(let e=0;e<7;e++){d=Object(y.a)(l,"d");const s=this.filterWorkouts(l),r=Object(ft.a)(l,t)?"":"-disabled",n=o?[5,6].includes(e):[0,6].includes(e);i.push(Object(a.jsx)("div",{className:"col cell ".concat(n?" weekend":"").concat(Object(wt.a)(l)?" today":""),children:Object(a.jsxs)("div",{className:"img".concat(r),children:[Object(a.jsx)("span",{className:"number",children:d}),Object(a.jsx)(_t,{dayWorkouts:s,isDisabled:r,sports:c})]})},l)),l=Object(Ot.a)(l,1)}n.push(Object(a.jsx)("div",{className:"row",children:i},l)),i=[]}return Object(a.jsx)("div",{className:"body",children:n})}updateStateDate(e){const t=St(e,this.state.weekStartOnMonday),s=t.start,a=t.end;this.setState({currentMonth:e,startDate:s,endDate:a}),this.props.loadMonthWorkouts(s,a)}handleNextMonth(){const e=Object(vt.a)(this.state.currentMonth,1);this.updateStateDate(e)}handlePrevMonth(){const e=Object(kt.a)(this.state.currentMonth,1);this.updateStateDate(e)}render(){const e={locale:"fr"===this.props.language?yt.fr:yt.enGB};return Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"calendar",children:[this.renderHeader(e),this.renderDays(e),this.renderCells()]})})}}var Ct=Object(O.c)((e=>({workouts:e.calendarWorkouts.data,language:e.language,sports:e.sports.data,user:e.user})),(e=>({loadMonthWorkouts:(t,s)=>{const a="yyyy-MM-dd";var r,o;e((r=Object(y.a)(t,a),o=Object(y.a)(s,a),e=>U.getData("workouts",{from:r,to:o,order:"desc",per_page:100}).then((t=>{"success"===t.status?e({type:"UPDATE_CALENDAR",workouts:t.data.workouts}):e(W("workouts|".concat(t.message)))})).catch((t=>e(W("workouts|".concat(t)))))))}})))(Dt);function Et(e){const t=e.records,s=e.sports,r=e.t,o=e.user,c=Oe(s,r),n=t.reduce(((e,t)=>{const s=c.find((e=>e.id===t.sport_id));return void 0===e[s.label]&&(e[s.label]={img:s.img,records:[]}),e[s.label].records.push(((e,t)=>{let s;switch(e.record_type){case"AS":case"MS":s="".concat(e.value," km/h");break;case"FD":s="".concat(e.value," km");break;default:s=e.value}const a=je.filter((t=>t.record_type===e.record_type)),r=Object(ie.a)(a,1)[0];return{workout_date:pe(z(e.workout_date,t)).workout_date,workout_id:e.workout_id,id:e.id,record_type:r.label,value:s}})(t,o.timezone)),e}),{});return Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:r("workouts:Personal records")}),Object(a.jsx)("div",{className:"card-body",children:0===Object.keys(n).length?r("common:No records."):Object.keys(n).sort().map((e=>Object(a.jsxs)("div",{children:[Object(a.jsxs)("span",{className:"heading-span",children:[Object(a.jsx)("img",{alt:"".concat(e," logo"),className:"record-logo",src:n[e].img}),e]}),Object(a.jsxs)("table",{className:"table table-borderless table-sm record-table",children:[Object(a.jsx)("thead",{children:Object(a.jsx)("tr",{children:Object(a.jsxs)("th",{colSpan:"3",children:[Object(a.jsx)("img",{alt:"".concat(e," logo"),className:"record-logo",src:n[e].img}),e]})})}),Object(a.jsx)("tbody",{children:n[e].records.map((e=>Object(a.jsxs)("tr",{className:"record-tr",children:[Object(a.jsx)("td",{className:"record-td",children:r("workouts:".concat(e.record_type))}),Object(a.jsx)("td",{className:"record-td text-right",children:e.value}),Object(a.jsx)("td",{className:"record-td text-right",children:Object(a.jsx)(Y.a,{to:"/workouts/".concat(e.workout_id),children:e.workout_date})})]},e.id)))})]})]},e)))})]})}var At=s(239),Mt=s(904);const Tt=[{duration:"week",dateFormat:"yyyy-MM-dd",xAxis:"dd/MM"},{duration:"month",dateFormat:"yyyy-MM",xAxis:"MM/yyyy"},{duration:"year",dateFormat:"yyyy",xAxis:"yyyy"}],Pt=(e,t=!1)=>{let s="0";t&&(s=String(Math.floor(e/86400)),e%=86400);const a=String(Math.floor(e/3600)).padStart(2,"0");e%=3600;const r=String(Math.floor(e/60)).padStart(2,"0"),o=String(e%60).padStart(2,"0");return t?"".concat("0"===s?"":"".concat(s,"d:")).concat("00"===a?"":"".concat(a,"h:")).concat(r,"m:").concat(o,"s"):"".concat("00"===a?"":"".concat(a,":")).concat(r,":").concat(o)},zt=(e,t)=>0===t?"":"distance"===e?"".concat(t.toFixed(2)," km"):"duration"===e?Pt(t):t,Ft=(e,t)=>{switch(e){case"week":return Object(Ot.a)(t,7);case"year":return Object(At.a)(t,1);case"month":default:return Object(vt.a)(t,1)}},Rt=(e,t,s,a,r)=>{const o=[],c=[],n=[];for(let i=((e,t,s)=>{switch(e){case"week":return Object(bt.a)(t,{weekStartsOn:s?1:0});case"year":return Object(Mt.a)(t);case"month":default:return Object(pt.a)(t)}})(s.duration,s.start,r);i<=s.end;i=Ft(s.duration,i)){const r=Tt.filter((e=>e.duration===s.duration)),l=Object(ie.a)(r,1)[0],d=Object(y.a)(i,l.dateFormat),u=Object(y.a)(i,l.xAxis),m={date:u},j={date:u},p={date:u};e[d]&&Object.keys(e[d]).filter((e=>!a||a.includes(+e))).map((s=>{const a=t.filter((e=>e.id===+s))[0].label;return m[a]=e[d][s].nb_workouts,j[a]=e[d][s].total_distance,p[a]=e[d][s].total_duration,null})),o.push(m),c.push(j),n.push(p)}return{workouts:o,distance:c,duration:n}},Lt=(e,t)=>"duration"===e?Pt(t,!0):"distance"===e?t.toFixed(2):t;function Ut(e){if(e.active){const t=e.displayedData,s=e.payload,r=e.label;let o=0;return s.map((e=>o+=e.value)),Object(a.jsxs)("div",{className:"custom-tooltip",children:[Object(a.jsx)("p",{className:"custom-tooltip-label",children:r}),s.map((e=>Object(a.jsxs)("p",{style:{color:e.fill},children:[e.name,": ",Lt(t,e.value)," ",e.unit]},e.name))),s.length>0&&Object(a.jsxs)("p",{children:["Total: ",Lt(t,o)]})]})}return null}function It(e){const t=e.displayedData,s=e.x,r=e.y,o=e.width,c=e.value;if(!c)return null;const n=zt(t,c);return Object(a.jsx)("g",{children:Object(a.jsx)("text",{x:s+o/2,y:r-10,fill:"#666",fontSize:"11",textAnchor:"middle",dominantBaseline:"middle",children:n})})}class Wt extends c.a.PureComponent{constructor(e,t){super(e,t),this.state={displayedData:"distance"}}handleRadioChange(e){this.setState({displayedData:e.target.name})}render(){const e=this.state.displayedData,t=this.props,s=t.sports,r=t.stats,o=t.t;return 0===Object.keys(r).length?o("common:No workouts."):Object(a.jsxs)("div",{className:"chart-stats",children:[Object(a.jsxs)("div",{className:"row chart-radio",children:[Object(a.jsxs)("label",{className:"radioLabel col",children:[Object(a.jsx)("input",{type:"radio",name:"distance",checked:"distance"===e,onChange:e=>this.handleRadioChange(e)}),o("statistics:distance")]}),Object(a.jsxs)("label",{className:"radioLabel col",children:[Object(a.jsx)("input",{type:"radio",name:"duration",checked:"duration"===e,onChange:e=>this.handleRadioChange(e)}),o("statistics:duration")]}),Object(a.jsxs)("label",{className:"radioLabel col",children:[Object(a.jsx)("input",{type:"radio",name:"workouts",checked:"workouts"===e,onChange:e=>this.handleRadioChange(e)}),o("statistics:workouts")]})]}),Object(a.jsx)(Re.f,{height:300,children:Object(a.jsxs)(Re.c,{data:r[e],margin:{top:15,bottom:0},children:[Object(a.jsx)(Re.h,{dataKey:"date",interval:0}),Object(a.jsx)(Re.i,{tickFormatter:t=>zt(e,t)}),Object(a.jsx)(Re.g,{content:Object(a.jsx)(Ut,{displayedData:e})}),s.map(((t,r)=>Object(a.jsx)(Re.b,{isAnimationActive:!1,dataKey:t.label,stackId:"a",fill:me[r],label:r===s.length-1?Object(a.jsx)(It,{displayedData:e}):"",name:o("sports:".concat(t.label))},t.id)))]})})]})}}class Ht extends c.a.PureComponent{componentDidMount(){this.updateData()}componentDidUpdate(e){(this.props.user.username&&this.props.user.username!==e.user.username||this.props.statsParams!==e.statsParams)&&this.updateData()}updateData(){this.props.user.username&&this.props.loadWorkouts(this.props.user.username,this.props.user.weekm,this.props.statsParams)}render(){const e=this.props,t=e.displayedSports,s=e.sports,r=e.statistics,o=e.statsParams,c=e.displayEmpty,n=e.t,i=e.user;if(!c&&0===Object.keys(r).length)return Object(a.jsx)("span",{children:n("common:No workouts.")});const l=Rt(r,s,o,t,i.weekm);return Object(a.jsx)(Wt,{sports:s,stats:l,t:n})}}var qt=Object(O.c)((e=>({sports:e.sports.data,statistics:e.statistics.data,user:e.user})),(e=>({loadWorkouts:(t,s,a)=>{const r="yyyy-MM-dd",o="week"===a.duration?"".concat(a.duration).concat(s?"m":""):a.duration,c={from:Object(y.a)(a.start,r),to:Object(y.a)(a.end,r),time:o};e(((e,t,s)=>a=>U.getData("stats/".concat(e,"/").concat(t),s).then((e=>{"success"===e.status?a(I("statistics",e.data)):a(W("statistics|".concat(e.message)))})).catch((e=>a(W("statistics|".concat(e))))))(t,a.type,c))}})))(Ht);class Bt extends c.a.Component{constructor(e,t){super(e,t);const s=new Date;this.state={start:Object(pt.a)(s),end:Object(ht.a)(s),duration:"week",type:"by_time"}}render(){const e=this.props.t;return Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:e("dashboard:This month")}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)(qt,{displayEmpty:!1,statsParams:this.state,t:e})})]})}}function Gt(e){const t=e.t,s=e.user,r=s.total_duration.match(/day/g)?"".concat(s.total_duration.split(" ")[0]," ").concat(s.total_duration.match(/days/g)?t("common:days"):t("common:day")):"0 ".concat(t("common:days"),",");let o=s.total_duration.match(/day/g)?s.total_duration.split(", ")[1]:s.total_duration;return o="".concat(o.split(":")[0],"h ").concat(o.split(":")[1],"min"),Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-calendar fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:s.nb_workouts}),Object(a.jsx)("div",{children:"".concat(1===s.nb_workouts?t("common:workout"):t("common:workouts"))})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-road fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:Number(s.total_distance).toFixed(2)}),Object(a.jsx)("div",{children:"km"})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-clock-o fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:r}),Object(a.jsx)("div",{children:o})]})]})})}),Object(a.jsx)("div",{className:"col-lg-3 col-md-6 col-sm-6",children:Object(a.jsx)("div",{className:"card workout-card",children:Object(a.jsxs)("div",{className:"card-body row",children:[Object(a.jsx)("div",{className:"col-3",children:Object(a.jsx)("i",{className:"fa fa-tags fa-3x fa-color"})}),Object(a.jsxs)("div",{className:"col-9 text-right",children:[Object(a.jsx)("div",{className:"huge",children:s.nb_sports}),Object(a.jsx)("div",{children:"".concat(1===s.nb_sports?t("common:sport"):t("common:sports"))})]})]})})})]})}function Vt(e){const t=e.sports,s=e.t,r=e.user,o=e.workout;return Object(a.jsxs)("div",{className:"card workout-card text-center",children:[Object(a.jsx)("div",{className:"card-header",children:Object(a.jsxs)(Y.a,{to:"/workouts/".concat(o.id),children:[t.filter((e=>e.id===o.sport_id)).map((e=>s("sports:".concat(e.label))))," ","-"," ",Object(y.a)(z(o.workout_date,r.timezone),"dd/MM/yyyy HH:mm")]})}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("div",{className:"row",children:[o.map&&Object(a.jsx)("div",{className:"col",children:Object(a.jsx)(it,{workout:o})}),Object(a.jsx)("div",{className:"col",children:Object(a.jsxs)("p",{children:[Object(a.jsx)("i",{className:"fa fa-clock-o","aria-hidden":"true"})," ",s("workouts:Duration"),": ",o.moving,o.map?Object(a.jsxs)("span",{children:[Object(a.jsx)("br",{}),Object(a.jsx)("br",{})]}):" - ",Object(a.jsx)("i",{className:"fa fa-road","aria-hidden":"true"})," ",s("workouts:Distance"),": ",o.distance," km"]})})]})})]})}class Jt extends c.a.Component{constructor(e,t){super(e,t),this.state={page:1}}componentDidMount(){this.props.loadWorkouts()}render(){const e=this.props,t=e.loadMoreWorkouts,s=e.message,r=e.records,o=e.sports,c=e.t,n=e.user,i=e.workouts,l=!(i.length>0)||null===i[i.length-1].previous_workout,d=this.state.page;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",c("common:Dashboard")]})}),s?Object(a.jsx)(v,{message:s,t:c}):i&&n.total_duration&&o.length>0&&Object(a.jsxs)("div",{className:"container dashboard",children:[Object(a.jsx)(Gt,{user:n,t:c}),Object(a.jsxs)("div",{className:"row",children:[Object(a.jsxs)("div",{className:"col-md-4",children:[Object(a.jsx)(Bt,{t:c}),Object(a.jsx)(Et,{t:c,records:r,sports:o,user:n})]}),Object(a.jsxs)("div",{className:"col-md-8",children:[Object(a.jsx)(Ct,{weekm:n.weekm}),i.length>0?i.map((e=>Object(a.jsx)(Vt,{workout:e,sports:o,t:c,user:n},e.id))):Object(a.jsx)(ct,{t:c}),!l&&Object(a.jsx)("input",{type:"submit",className:"btn btn-default btn-md btn-block",value:"Load more workouts",onClick:()=>{t(d+1),this.setState({page:d+1})}})]})]})]})]})}}var Kt=Object(w.a)()(Object(O.c)((e=>({workouts:e.workouts.data,message:e.message,records:e.records.data,sports:e.sports.data,user:e.user})),(e=>({loadWorkouts:()=>{e(q("getData","workouts",{page:1})),e(q("getData","records"))},loadMoreWorkouts:t=>{e(Ce({page:t}))}})))(Jt));function Yt(){return Object(a.jsx)("footer",{className:"footer",children:Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("strong",{children:"FitTrackee"})," v","0.4.5"," -"," ",Object(a.jsx)("a",{href:"https://github.com/SamR1/FitTrackee",target:"_blank",rel:"noopener noreferrer",children:"source code"})," ","under"," ",Object(a.jsx)("a",{href:"https://choosealicense.com/licenses/gpl-3.0/",target:"_blank",rel:"noopener noreferrer",children:"GPLv3"})," ","license -"," ",Object(a.jsx)("a",{href:"https://samr1.github.io/FitTrackee/",target:"_blank",rel:"noopener noreferrer",children:"documentation"})]})})}class Xt extends c.a.Component{componentDidMount(){this.props.UserLogout()}render(){return Object(a.jsx)("div",{className:"container dashboard",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-2"}),Object(a.jsx)("div",{className:"card col-8",children:Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("div",{className:"text-center",children:Object(a.jsxs)(ne.a,{i18nKey:"user:loggedOut",children:["You are now logged out. Click ",Object(a.jsx)(Y.a,{to:"/login",children:"here"})," to log back in."]})})})}),Object(a.jsx)("div",{className:"col-2"})]})})}}var $t=Object(O.c)((e=>({user:e.user})),(e=>({UserLogout:()=>{e({type:"LOGOUT"})}})))(Xt);function Zt(){return(Zt=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var es=o.createElement("path",{d:"m466.916 27.803h-421.832c-24.859 0-45.084 20.225-45.084 45.084v366.226c0 24.859 20.225 45.084 45.084 45.084h421.832c24.859 0 45.084-20.225 45.084-45.084v-366.226c0-24.859-20.225-45.084-45.084-45.084z",fill:"#f0f9ff"}),ts=o.createElement("path",{d:"m198.58 188.334-181.344-150.862c-7.75 6.107-13.456 14.691-15.905 24.554l164.142 136.551h33.102z",fill:"#f40055"}),ss=o.createElement("path",{d:"m313.425 198.576h33.93l163.447-135.973c-2.325-9.923-7.93-18.592-15.613-24.796l-181.764 151.211z",fill:"#c20044"}),as=o.createElement("path",{d:"m165.472 313.425-164.141 136.549c2.449 9.863 8.155 18.447 15.905 24.553l181.344-150.861-.005-10.241z",fill:"#f40055"}),rs=o.createElement("path",{d:"m313.425 313.425v9.557l181.765 151.211c7.683-6.204 13.288-14.874 15.613-24.796l-163.446-135.971z",fill:"#c20044"}),os=o.createElement("path",{d:"m53.273 27.803 145.302 120.879v-120.879z",fill:"#406bd4"}),cs=o.createElement("path",{d:"m313.425 150.571v-122.768h148.082z",fill:"#3257b0"}),ns=o.createElement("path",{d:"m394.732 198.575 117.268-97.556v97.556z",fill:"#3257b0"}),is=o.createElement("g",{fill:"#406bd4"},o.createElement("path",{d:"m0 99.317v99.258h119.313z"}),o.createElement("path",{d:"m0 313.425v97.699l117.44-97.699z"}),o.createElement("path",{d:"m50.49 484.197 148.085-122.676v122.676z"})),ls=o.createElement("path",{d:"m313.425 484.197v-124.139l149.221 124.139z",fill:"#3257b0"}),ds=o.createElement("path",{d:"m512 409.423-115.395-95.998h115.395z",fill:"#3257b0"}),us=o.createElement("path",{d:"m512 222.142h-222.142v-194.339h-67.716v194.339h-222.142v67.716h222.142v194.339h67.716v-194.339h222.142z",fill:"#f40055"}),ms=o.createElement("path",{d:"m289.858 222.142v-194.339h-33.858v456.394h33.858v-194.339h222.142v-67.716z",fill:"#c20044"});function js(e,t){let s=e.title,a=e.titleId,r=Qt(e,["title","titleId"]);return o.createElement("svg",Zt({id:"Capa_1",enableBackground:"new 0 0 512 512",height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,es,ts,ss,as,rs,os,cs,ns,is,ls,ds,us,ms)}const ps=o.forwardRef(js);s.p;function hs(){return(hs=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var xs=o.createElement("path",{d:"m173.899 31.804h-8.707l-4.397-4h-115.711c-24.859-.001-45.084 20.224-45.084 45.083v366.226c0 24.859 20.225 45.084 45.084 45.084h115.711l6.348-4h6.755v-448.393z",fill:"#406bd4"}),Os=o.createElement("path",{d:"m466.916 27.803h-115.711l-4.523 4h-5.141v448.393h4.141l5.523 4h115.711c24.859 0 45.084-20.225 45.084-45.084v-366.225c0-24.859-20.225-45.084-45.084-45.084z",fill:"#c20044"}),gs=o.createElement("path",{d:"m160.795 27.803h190.409v456.394h-190.409z",fill:"#f0f9ff"}),fs=o.createElement("path",{d:"m256 27.803h95.205v456.394h-95.205z",fill:"#cee5f5"});function ws(e,t){let s=e.title,a=e.titleId,r=bs(e,["title","titleId"]);return o.createElement("svg",hs({id:"Capa_1",enableBackground:"new 0 0 512 512",height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,xs,Os,gs,fs)}const vs=o.forwardRef(ws);s.p;const ks=[{name:"en",selected:!0,flag:Object(a.jsx)(ps,{})},{name:"fr",selected:!1,flag:Object(a.jsx)(vs,{})}];class ys extends o.Component{constructor(e){super(e),this.state={isOpen:!1}}toggleDropdown(){this.setState((e=>({isOpen:!e.isOpen})))}render(){const e=this.state.isOpen,t=this.props,s=t.language,r=t.onUpdateLanguage;return Object(a.jsx)("div",{className:"dropdown-wrapper",onClick:()=>this.toggleDropdown(),children:Object(a.jsx)("ul",{className:"dropdown-list i18n-flag",children:ks.filter((t=>e?t:t.name===s)).map((t=>Object(a.jsxs)("li",{className:"dropdown-item".concat(t.name===s&&e?" dropdown-item-selected":""),onClick:()=>r(t.name,s),children:[t.flag," ",t.name]},t.name)))})})}}var Ns=Object(O.c)((e=>({language:e.language})),(e=>({onUpdateLanguage:(t,s)=>{t!==s&&e(B(t))}})))(ys);class _s extends c.a.PureComponent{render(){const e=this.props,t=e.admin,s=e.isAuthenticated,r=e.picture,o=e.t,c=e.username;return Object(a.jsx)("header",{children:Object(a.jsx)("nav",{className:"navbar navbar-expand-lg navbar-light bg-light",children:Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("span",{className:"navbar-brand",children:"FitTrackee"}),Object(a.jsx)("button",{className:"navbar-toggler",type:"button","data-toggle":"collapse","data-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation",children:Object(a.jsx)("span",{className:"navbar-toggler-icon"})}),Object(a.jsxs)("div",{className:"collapse navbar-collapse",id:"navbarSupportedContent",children:[Object(a.jsxs)("ul",{className:"navbar-nav mr-auto",children:[Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/"},children:o("common:Dashboard")})}),s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/workouts/history"},children:o("Workouts")})}),s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/workouts/statistics"},children:o("common:Statistics")})}),t&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/admin"},children:"Admin"})}),s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/workouts/add"},children:Object(a.jsx)("strong",{children:o("common:Add workout")})})})]}),Object(a.jsxs)("ul",{className:"navbar-nav flex-row ml-md-auto d-none d-md-flex",children:[!s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/register"},children:o("user:Register")})}),!s&&Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/login"},children:o("user:Login")})}),s&&Object(a.jsxs)(a.Fragment,{children:[!0===r?Object(a.jsx)("img",{alt:"Avatar",src:"".concat(C,"users/").concat(c,"/picture?").concat(Date.now()),className:"img-fluid App-nav-profile-img"}):Object(a.jsx)("i",{className:"fa fa-user-circle-o fa-2x no-picture","aria-hidden":"true"}),Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/profile"},children:c})}),Object(a.jsx)("li",{className:"nav-item",children:Object(a.jsx)(Y.a,{className:"nav-link",to:{pathname:"/logout"},children:o("user:Logout")})})]}),Object(a.jsx)("li",{children:Object(a.jsx)(Ns,{})})]})]})]})})})}}var Ss=Object(w.a)()(Object(O.c)((({user:e})=>({admin:e.admin,isAuthenticated:e.isAuthenticated,picture:e.picture,username:e.username})))(_s));function Ds(){return(Ds=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var Es=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M468.683,287.265h-69.07c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h69.07 c4.147,0,7.508-3.361,7.508-7.508C476.191,290.626,472.83,287.265,468.683,287.265z"}))),As=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M105.012,268.377L85.781,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L58.034,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C109.507,275.266,108.499,270.62,105.012,268.377z"}))),Ms=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M194.441,268.377L175.21,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.47,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.776l-17.471-11.243 c-3.487-2.245-8.133-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L147.463,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.47,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C198.936,275.266,197.928,270.62,194.441,268.377z"}))),Ts=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M283.871,268.377L264.64,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.471-11.243 c-3.486-2.245-8.134-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L236.892,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.886-1.216,6.32-3.446C288.366,275.266,287.358,270.62,283.871,268.377z"}))),Ps=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M373.3,268.377L354.069,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L326.322,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C377.795,275.266,376.787,270.62,373.3,268.377z"}))),zs=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M271.792,330.359H15.016V181.642h93.1c4.147,0,7.508-3.361,7.508-7.508c0-4.147-3.361-7.508-7.508-7.508H12.513 C5.613,166.626,0,172.24,0,179.14v153.722c0,6.9,5.613,12.513,12.513,12.513h259.278c4.147,0,7.508-3.361,7.508-7.508 C279.299,333.72,275.939,330.359,271.792,330.359z"}))),Fs=o.createElement("g",null,o.createElement("g",null,o.createElement("path",{d:"M499.487,166.626H162.174c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h334.811v148.716H323.848 c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h175.64c6.9,0,12.513-5.613,12.513-12.513V179.14 C512.001,172.24,506.387,166.626,499.487,166.626z"})));function Rs(e,t){let s=e.title,a=e.titleId,r=Cs(e,["title","titleId"]);return o.createElement("svg",Ds({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512.001 512.001",style:{enableBackground:"new 0 0 512.001 512.001"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,Es,As,Ms,Ts,Ps,zs,Fs)}const Ls=o.forwardRef(Rs);s.p;function Us(){return(Us=Object.assign||function(e){for(var t=1;t=0||(r[s]=e[s]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}var Ws=o.createElement("g",null,o.createElement("path",{d:"M339.798,260.429c0.13-0.026,0.257-0.061,0.385-0.094c0.109-0.028,0.219-0.051,0.326-0.084 c0.125-0.038,0.247-0.085,0.369-0.129c0.108-0.039,0.217-0.074,0.324-0.119c0.115-0.048,0.226-0.104,0.338-0.157 c0.109-0.052,0.22-0.1,0.327-0.158c0.107-0.057,0.208-0.122,0.312-0.184c0.107-0.064,0.215-0.124,0.319-0.194 c0.111-0.074,0.214-0.156,0.321-0.236c0.09-0.067,0.182-0.13,0.27-0.202c0.162-0.133,0.316-0.275,0.466-0.421 c0.027-0.026,0.056-0.048,0.083-0.075c0.028-0.028,0.052-0.059,0.079-0.088c0.144-0.148,0.284-0.3,0.416-0.46 c0.077-0.094,0.144-0.192,0.216-0.289c0.074-0.1,0.152-0.197,0.221-0.301c0.074-0.111,0.139-0.226,0.207-0.34 c0.057-0.096,0.118-0.19,0.171-0.289c0.062-0.115,0.114-0.234,0.169-0.351c0.049-0.104,0.101-0.207,0.146-0.314 c0.048-0.115,0.086-0.232,0.128-0.349c0.041-0.114,0.085-0.227,0.12-0.343c0.036-0.118,0.062-0.238,0.092-0.358 c0.029-0.118,0.063-0.234,0.086-0.353c0.028-0.141,0.045-0.283,0.065-0.425c0.014-0.1,0.033-0.199,0.043-0.3 c0.025-0.249,0.038-0.498,0.038-0.748V92.76c0-4.143-3.357-7.5-7.5-7.5h-236.25c-0.066,0-0.13,0.008-0.196,0.01 c-0.143,0.004-0.285,0.01-0.427,0.022c-0.113,0.009-0.225,0.022-0.337,0.037c-0.128,0.016-0.255,0.035-0.382,0.058 c-0.119,0.021-0.237,0.046-0.354,0.073c-0.119,0.028-0.238,0.058-0.356,0.092c-0.117,0.033-0.232,0.069-0.346,0.107 c-0.117,0.04-0.234,0.082-0.349,0.128c-0.109,0.043-0.216,0.087-0.322,0.135c-0.118,0.053-0.235,0.11-0.351,0.169 c-0.099,0.051-0.196,0.103-0.292,0.158c-0.116,0.066-0.23,0.136-0.343,0.208c-0.093,0.06-0.184,0.122-0.274,0.185 c-0.106,0.075-0.211,0.153-0.314,0.235c-0.094,0.075-0.186,0.152-0.277,0.231c-0.09,0.079-0.179,0.158-0.266,0.242 c-0.099,0.095-0.194,0.194-0.288,0.294c-0.047,0.05-0.097,0.094-0.142,0.145c-0.027,0.03-0.048,0.063-0.074,0.093 c-0.094,0.109-0.182,0.223-0.27,0.338c-0.064,0.084-0.13,0.168-0.19,0.254c-0.078,0.112-0.15,0.227-0.222,0.343 c-0.059,0.095-0.12,0.189-0.174,0.286c-0.063,0.112-0.118,0.227-0.175,0.342c-0.052,0.105-0.106,0.21-0.153,0.317 c-0.049,0.113-0.092,0.23-0.135,0.345c-0.043,0.113-0.087,0.225-0.124,0.339c-0.037,0.115-0.067,0.232-0.099,0.349 c-0.032,0.12-0.066,0.239-0.093,0.36c-0.025,0.113-0.042,0.228-0.062,0.342c-0.022,0.13-0.044,0.26-0.06,0.39 c-0.013,0.108-0.019,0.218-0.027,0.328c-0.01,0.14-0.019,0.28-0.021,0.421c-0.001,0.041-0.006,0.081-0.006,0.122v46.252 c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-29.595l66.681,59.037c-0.348,0.245-0.683,0.516-0.995,0.827l-65.687,65.687v-49.288 c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v9.164h-38.75c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h38.75v43.231 c0,4.143,3.357,7.5,7.5,7.5h236.25c0.247,0,0.494-0.013,0.74-0.037c0.115-0.011,0.226-0.033,0.339-0.049 C339.542,260.469,339.67,260.454,339.798,260.429z M330.834,234.967l-65.688-65.687c-0.042-0.042-0.087-0.077-0.13-0.117 l49.383-41.897c3.158-2.68,3.546-7.412,0.866-10.571c-2.678-3.157-7.41-3.547-10.571-0.866l-84.381,71.59l-98.444-87.158h208.965 V234.967z M185.878,179.888c0.535-0.535,0.969-1.131,1.308-1.765l28.051,24.835c1.418,1.255,3.194,1.885,4.972,1.885 c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z"}),o.createElement("path",{d:"M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5 S3.357,170.676,7.5,170.676z"}),o.createElement("path",{d:"M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5 S16.482,129.345,20.625,129.345z"}),o.createElement("path",{d:"M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z"}));function Hs(e,t){let s=e.title,a=e.titleId,r=Is(e,["title","titleId"]);return o.createElement("svg",Us({id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 345.834 345.834",style:{enableBackground:"new 0 0 345.834 345.834"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},r),s?o.createElement("title",{id:a},s):null,Ws)}const qs=o.forwardRef(Hs);s.p;function Bs(e){const t=Object(re.a)().t,s=e.action;return Object(a.jsx)("div",{className:"container dashboard",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-2"}),Object(a.jsx)("div",{className:"card col-8",children:Object(a.jsx)("div",{className:"card-body",children:Object(a.jsxs)("div",{className:"text-center ",children:["sent"===s&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:"svg-icon",children:Object(a.jsx)(qs,{})}),t("user:Check your email. If your address is in our database, you'll received an email with a link to reset your password.")]}),"updated"===s&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:"svg-icon",children:Object(a.jsx)(Ls,{})}),Object(a.jsxs)(ne.a,{i18nKey:"user:updatedPasswordText",children:["Your password have been updated. Click",Object(a.jsx)(Y.a,{to:"/login",children:"here"})," to log in."]})]})]})})}),Object(a.jsx)("div",{className:"col-2"})]})})}var Gs=s(240),Vs=s.n(Gs);class Js extends c.a.Component{constructor(e,t){super(e,t),this.state={formData:{},displayModal:!1}}componentDidMount(){this.initForm()}componentDidUpdate(e){e.user!==this.props.user&&this.initForm()}initForm(){const e=this.props.user,t={};Object.keys(e).map((s=>null===e[s]?t[s]="":t[s]="birth_date"===s?Object(y.a)(new Date(e[s]),"yyyy-MM-DD"):e[s])),this.setState({formData:t})}handleFormChange(e){const t=this.state.formData;"weekm"===e.target.name?t.weekm="Monday"===e.target.value:t[e.target.name]=e.target.value,this.setState(t)}displayModal(e){this.setState((t=>Object(k.a)(Object(k.a)({},t),{},{displayModal:e})))}render(){const e=this.props,t=e.message,s=e.onDeleteUser,r=e.onHandleProfileFormSubmit,o=e.t,c=e.user,n=this.state,i=n.displayModal,l=n.formData;return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",o("user:Profile Edition")]})}),l.isAuthenticated&&Object(a.jsxs)("div",{className:"container",children:[i&&Object(a.jsx)(ze,{title:o("common:Confirmation"),text:o("user:Are you sure you want to delete your account? All data will be deleted, this cannot be undone."),confirm:()=>{s(c.username),this.displayModal(!1)},close:()=>this.displayModal(!1)}),Object(a.jsx)("h1",{className:"page-title",children:o("user:Profile Edition")}),Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-2"}),Object(a.jsx)("div",{className:"col-md-8",children:Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-header",children:c.username}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("div",{className:"row",children:Object(a.jsxs)("div",{className:"col-md-12",children:[Object(a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),r(l)},children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Email"),":",Object(a.jsx)("input",{name:"email",className:"form-control input-lg",type:"text",value:l.email,readOnly:!0})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Registration Date"),":",Object(a.jsx)("input",{name:"createdAt",className:"form-control input-lg",type:"text",value:l.created_at,disabled:!0})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Password"),":",Object(a.jsx)("input",{name:"password",className:"form-control input-lg",type:"password",onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Password Confirmation"),":",Object(a.jsx)("input",{name:"password_conf",className:"form-control input-lg",type:"password",onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("hr",{}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:First Name"),":",Object(a.jsx)("input",{name:"first_name",className:"form-control input-lg",type:"text",value:l.first_name,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Last Name"),":",Object(a.jsx)("input",{name:"last_name",className:"form-control input-lg",type:"text",value:l.last_name,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Birth Date"),Object(a.jsx)("input",{name:"birth_date",className:"form-control input-lg",type:"date",value:l.birth_date,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Location"),":",Object(a.jsx)("input",{name:"location",className:"form-control input-lg",type:"text",value:l.location,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Bio"),":",Object(a.jsx)("textarea",{name:"bio",className:"form-control input-lg",maxLength:"200",value:l.bio,onChange:e=>this.handleFormChange(e)})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Language"),":",Object(a.jsx)("select",{name:"language",className:"form-control input-lg",value:l.language,onChange:e=>this.handleFormChange(e),children:ks.map((e=>Object(a.jsx)("option",{value:e.name,children:e.name},e.name)))})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:Timezone"),":",Object(a.jsx)(Vs.a,{className:"form-control timezone-custom",onChange:e=>{const t={target:{name:"timezone",value:e||"Europe/Paris"}};this.handleFormChange(t)},value:l.timezone})]})}),Object(a.jsx)("div",{className:"form-group",children:Object(a.jsxs)("label",{children:[o("user:First day of week"),":",Object(a.jsxs)("select",{name:"weekm",className:"form-control input-lg",value:l.weekm?"Monday":"Sunday",onChange:e=>this.handleFormChange(e),children:[Object(a.jsx)("option",{value:"Sunday",children:o("user:Sunday")}),Object(a.jsx)("option",{value:"Monday",children:o("user:Monday")})]})]})}),Object(a.jsx)("button",{type:"submit",className:"btn btn-primary",children:o("common:Submit")}),Object(a.jsx)("button",{className:"btn btn-danger",onClick:e=>{e.preventDefault(),this.displayModal(!0)},children:o("user:Delete my account")}),Object(a.jsx)("button",{type:"submit",className:"btn btn-secondary",onClick:()=>Ta.push("/profile"),children:o("common:Cancel")})]}),Object(a.jsx)(v,{message:t,t:o})]})})})]})}),Object(a.jsx)("div",{className:"col-md-2"})]})]})]})}}var Ks=Object(w.a)()(Object(O.c)((e=>({location:e.router.location,message:e.message,user:e.user})),(e=>({onDeleteUser:t=>{e(Ne(t))},onHandleProfileFormSubmit:t=>{e((e=>t=>!e.password===e.password_conf?t(we("Password and password confirmation don't match.")):(delete e.id,U.postData("auth/profile/edit",e).then((e=>{if("success"===e.status)return t(ke()),Ta.push("/profile");t(we(e.message))})).catch((e=>{throw e}))))(t))}})))(Js)),Ys=s(905),Xs=s(906),$s=s(907),Zs=s(241);const Qs=["week","month","year"];class ea extends c.a.Component{constructor(e,t){super(e,t);const s=new Date;this.state={displayedSports:e.sports.map((e=>e.id)),statsParams:{start:Object(pt.a)(Object(kt.a)(s,11)),end:Object(ht.a)(s),duration:"month",type:"by_time"}}}componentDidUpdate(e){this.props.sports!==e.sports&&this.updateDisplayedSports()}updateDisplayedSports(){const e=this.props.sports;this.setState({displayedSports:e.map((e=>e.id))})}handleOnChangeDuration(e){const t=e.target.name,s=new Date,a="year"===t?Object(Mt.a)(Object(Ys.a)(s,9)):"week"===t?Object(pt.a)(Object(kt.a)(s,2)):Object(pt.a)(Object(kt.a)(s,11)),r="year"===t?Object(Xs.a)(s):"week"===t?Object(xt.a)(s):Object(ht.a)(s);this.setState({statsParams:{duration:t,end:r,start:a,type:"by_time"}})}handleOnChangeSports(e){const t=this.state.displayedSports;t.includes(e)?this.setState({displayedSports:t.filter((t=>t!==e))}):this.setState({displayedSports:t.concat([e])})}handleOnClickArrows(e){const t=this.state.statsParams,s=t.start,a=t.end,r=t.duration;let o,c;e?(o="year"===r?Object(Mt.a)(Object(Ys.a)(s,1)):"week"===r?Object(bt.a)(Object($s.a)(s,1)):Object(pt.a)(Object(kt.a)(s,1)),c="year"===r?Object(Xs.a)(Object(Ys.a)(a,1)):"week"===r?Object(xt.a)(Object($s.a)(a,1)):Object(ht.a)(Object(kt.a)(a,1))):(o="year"===r?Object(Mt.a)(Object(At.a)(s,1)):"week"===r?Object(bt.a)(Object(Zs.a)(s,1)):Object(pt.a)(Object(vt.a)(s,1)),c="year"===r?Object(Xs.a)(Object(At.a)(a,1)):"week"===r?Object(xt.a)(Object(Zs.a)(a,1)):Object(ht.a)(Object(vt.a)(a,1))),this.setState({statsParams:{duration:r,end:c,start:o,type:"by_time"}})}render(){const e=this.state,t=e.displayedSports,s=e.statsParams,r=this.props,o=r.sports,c=r.t,n=r.user,i=Oe(o.filter((e=>n.sports_list.includes(e.id))),c);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",c("statistics:Statistics")]})}),Object(a.jsxs)("div",{className:"container dashboard",children:[Object(a.jsxs)("div",{className:"card workout-card",children:[Object(a.jsx)("div",{className:"card-header",children:c("statistics:Statistics")}),Object(a.jsxs)("div",{className:"card-body".concat(0===n.nb_workouts?" stats-disabled":""),children:[Object(a.jsxs)("div",{className:"chart-filters row",children:[Object(a.jsx)("div",{className:"col chart-arrows",children:Object(a.jsx)("p",{className:"text-center",children:Object(a.jsx)("i",{className:"fa fa-chevron-left","aria-hidden":"true",onClick:()=>this.handleOnClickArrows(!0)})})}),Object(a.jsx)("div",{className:"col-md-3 time-frames justify-content-around",children:Qs.map((e=>Object(a.jsx)("div",{className:"time-frame",children:Object(a.jsxs)("label",{children:[Object(a.jsx)("input",{type:"radio",id:e,name:e,checked:e===s.duration,onChange:e=>this.handleOnChangeDuration(e)}),Object(a.jsx)("span",{children:c("statistics:".concat(e))})]})},e)))}),Object(a.jsx)("div",{className:"col chart-arrows",children:Object(a.jsx)("p",{className:"text-center",children:Object(a.jsx)("i",{className:"fa fa-chevron-right","aria-hidden":"true",onClick:()=>this.handleOnClickArrows(!1)})})})]}),Object(a.jsx)(qt,{displayEmpty:!0,displayedSports:t,statsParams:s,t:c}),Object(a.jsx)("div",{className:"row chart-workouts",children:i.map((e=>Object(a.jsxs)("label",{className:"col workout-label",children:[Object(a.jsx)("input",{type:"checkbox",checked:t.includes(e.id),name:e.label,onChange:()=>this.handleOnChangeSports(e.id)}),Object(a.jsx)("span",{style:{color:me[e.id-1]},children:" ".concat(e.label)})]},e.id)))})]})]}),0===n.nb_workouts&&Object(a.jsx)(ct,{t:c})]})]})}}var ta=Object(w.a)()(Object(O.c)((e=>({sports:e.sports.data,user:e.user})))(ea));function sa(e){const t=Object(re.a)().t,s="user:".concat(e.formType.charAt(0).toUpperCase()).concat(e.formType.slice(1));return Object(a.jsxs)("div",{children:[Object(a.jsx)(f.a,{children:Object(a.jsxs)("title",{children:["FitTrackee - ",t("user:".concat(e.formType))]})}),Object(a.jsx)("h1",{className:"page-title",children:t(s)}),Object(a.jsx)("div",{className:"container",children:Object(a.jsxs)("div",{className:"row",children:[Object(a.jsx)("div",{className:"col-md-3"}),Object(a.jsxs)("div",{className:"col-md-6",children:[Object(a.jsx)("br",{}),"register"!==e.formType||e.isRegistrationAllowed?Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)("form",{onSubmit:t=>e.handleUserFormSubmit(t,e.formType),children:["register"===e.formType&&Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"username",placeholder:t("user:Enter a username"),required:!0,type:"text",value:e.userForm.username,onChange:e.onHandleFormChange})}),"password reset"!==e.formType&&Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"email",placeholder:t("user:Enter an email address"),required:!0,type:"email",value:e.userForm.email,onChange:e.onHandleFormChange})}),"reset your password"!==e.formType&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"password",placeholder:t("user:Enter a password"),required:!0,type:"password",value:e.userForm.password,onChange:e.onHandleFormChange})}),"login"!==e.formType&&Object(a.jsx)("div",{className:"form-group",children:Object(a.jsx)("input",{className:"form-control input-lg",name:"password_conf",placeholder:t("user:Enter the password confirmation"),required:!0,type:"password",value:e.userForm.password_conf,onChange:e.onHandleFormChange})})]}),Object(a.jsx)("input",{type:"submit",className:"btn btn-primary btn-lg btn-block",value:t("Submit")})]}),Object(a.jsx)("p",{className:"password-forget",children:"login"===e.formType&&Object(a.jsx)(Y.a,{to:{pathname:"/password-reset/request"},children:t("user:Forgot password?")})})]}):Object(a.jsxs)("div",{className:"card",children:[Object(a.jsx)("div",{className:"card-body",children:"Registration is disabled."}),Object(a.jsx)("div",{className:"card-body",children:Object(a.jsx)("button",{type:"submit",className:"btn btn-secondary btn-lg btn-block",onClick:()=>Ta.go(-1),children:"Back"})})]})]}),Object(a.jsx)("div",{className:"col-md-3"})]})})]})}class aa extends c.a.Component{constructor(e,t){super(e,t),this.state={formData:{username:"",email:"",password:"",password_conf:""}}}componentDidUpdate(e){e.location.pathname!==this.props.location.pathname&&this.emptyForm()}emptyForm(){const e=this.state.formData;Object.keys(e).map((t=>e[t]="")),this.setState(e)}onHandleFormChange(e){const t=this.state.formData;t[e.target.name]=e.target.value,this.setState(t)}render(){const e=this.props,t=e.formType,s=e.isRegistrationAllowed,r=e.message,o=e.messages,c=e.onHandleUserFormSubmit,n=e.t,i=this.state.formData,l=this.props.location.query.token;return Object(a.jsx)("div",{children:M()||"password reset"===t&&!l?Object(a.jsx)(g.a,{to:"/"}):Object(a.jsxs)("div",{children:[Object(a.jsx)(v,{message:r,messages:o,t:n}),Object(a.jsx)(sa,{isRegistrationAllowed:s,formType:t,userForm:i,onHandleFormChange:e=>this.onHandleFormChange(e),handleUserFormSubmit:e=>{e.preventDefault(),"password reset"===t&&(i.token=l),c(i,t)}})]})})}}var ra=Object(w.a)()(Object(O.c)((e=>({isRegistrationAllowed:e.application.config.is_registration_enabled,location:e.router.location,message:e.message,messages:e.messages})),(e=>({onHandleUserFormSubmit:(t,s)=>{e(ye(t,s="password reset"===s?"password/update":"reset your password"===s?"password/reset-request":s))}})))(aa));class oa extends c.a.Component{constructor(e,t){super(e,t),this.state={displayModal:!1}}componentDidMount(){this.props.loadUser(this.props.match.params.userName)}componentDidUpdate(e){e.match.params.userName!==this.props.match.params.userName&&this.props.loadUser(this.props.match.params.userName)}displayModal(e){this.setState((t=>Object(k.a)(Object(k.a)({},t),{},{displayModal:e})))}render(){const e=this.props,t=e.t,s=e.currentUser,r=e.onDeleteUser,o=e.users,c=this.state.displayModal,n=Object(ie.a)(o,1)[0],i=!!n&&s.username===n.username;return Object(a.jsxs)("div",{children:[c&&Object(a.jsx)(ze,{title:t("common:Confirmation"),text:t("user:Are you sure you want to delete this account? All data will be deleted, this cannot be undone."),confirm:()=>{r(n.username),this.displayModal(!1)},close:()=>this.displayModal(!1)}),n&&Object(a.jsx)(mt,{editable:i,isDeletable:s.admin&&!i,onDeleteUser:r,displayModal:e=>this.displayModal(e),t:t,user:n})]})}}var ca=Object(w.a)()(Object(O.c)((e=>({currentUser:e.user,users:e.users.data})),(e=>({onDeleteUser:t=>{e(Ne(t,!0))},loadUser:t=>{e(q("getData","users",{username:t}))}})))(oa));class na extends c.a.Component{constructor(e){super(e),this.props=e}componentDidMount(){this.props.loadAppConfig()}render(){return Object(a.jsxs)("div",{className:"App",children:[Object(a.jsx)(Ss,{}),Object(a.jsxs)(g.d,{children:[Object(a.jsx)(g.b,{exact:!0,path:"/",component:Kt}),Object(a.jsx)(g.b,{exact:!0,path:"/register",render:()=>Object(a.jsx)(ra,{formType:"register"})}),Object(a.jsx)(g.b,{exact:!0,path:"/login",render:()=>Object(a.jsx)(ra,{formType:"login"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset",render:()=>Object(a.jsx)(ra,{formType:"password reset"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset/request",render:()=>Object(a.jsx)(ra,{formType:"reset your password"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset/sent",render:()=>Object(a.jsx)(Bs,{action:"sent"})}),Object(a.jsx)(g.b,{exact:!0,path:"/updated-password",render:()=>Object(a.jsx)(Bs,{action:"updated"})}),Object(a.jsx)(g.b,{exact:!0,path:"/password-reset/sent",component:Bs}),Object(a.jsx)(g.b,{exact:!0,path:"/logout",component:$t}),Object(a.jsx)(g.b,{exact:!0,path:"/profile/edit",component:Ks}),Object(a.jsx)(g.b,{exact:!0,path:"/profile",component:jt}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/history",component:ut}),Object(a.jsx)(g.b,{exact:!0,path:"/workouts/statistics",component:ta}),Object(a.jsx)(g.b,{exact:!0,path:"/users/:userName",component:ca}),Object(a.jsx)(g.b,{path:"/workouts",component:ot}),Object(a.jsx)(g.b,{path:"/admin",component:ce}),Object(a.jsx)(g.b,{component:oe})]}),Object(a.jsx)(Yt,{})]})}}var ia=Object(O.c)((()=>({})),(e=>({loadAppConfig:()=>{e(V("config"))}})))(na),la=s(80);function da({store:e,history:t,children:s}){return Object(a.jsx)(O.a,{store:e,children:Object(a.jsx)(la.a,{history:t,children:s})})}const ua=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function ma(e){navigator.serviceWorker.register(e).then((e=>{e.onupdatefound=()=>{const t=e.installing;t.onstatechange=()=>{"installed"===t.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}})).catch((e=>{console.error("Error during service worker registration:",e)}))}const ja={data:[]};var pa={language:"en",message:"",messages:[],user:{isAuthenticated:!1},workouts:Object(k.a)({},ja),application:{statistics:{},config:{gpx_limit_import:null,is_registration_enabled:null,max_single_file_size:null,max_users:null,max_zip_file_size:null,registration:null}},calendarWorkouts:Object(k.a)({},ja),chartData:[],gpx:null,loading:!1,records:Object(k.a)({},ja),sports:Object(k.a)({},ja),statistics:{data:{}},users:Object(k.a)({},ja)};const ha=(e,t,s)=>s.target!==t?e:"SET_DATA"===s.type?Object(k.a)(Object(k.a)({},e),{},{data:s.data[s.target]}):"SET_PAGINATED_DATA"===s.type?Object(k.a)(Object(k.a)({},e),{},{data:s.data[s.target],pagination:s.pagination}):e,ba=(e=pa.workouts,t)=>{switch(t.type){case"LOGOUT":return pa.workouts;case"PUSH_WORKOUTS":return Object(k.a)(Object(k.a)({},e),{},{data:e.data.concat(t.workouts)});case"REMOVE_WORKOUT":return Object(k.a)(Object(k.a)({},e),{},{data:e.data.filter((e=>e.id!==t.workoutId))});default:return ha(e,"workouts",t)}},xa=(e=pa.application,t)=>"SET_APP_CONFIG"===t.type?Object(k.a)(Object(k.a)({},e),{},{config:t.data}):"SET_APP_STATS"===t.type?Object(k.a)(Object(k.a)({},e),{},{statistics:t.data}):e,Oa=(e=pa.calendarWorkouts,t)=>{switch(t.type){case"LOGOUT":return pa.calendarWorkouts;case"UPDATE_CALENDAR":return Object(k.a)(Object(k.a)({},e),{},{data:t.workouts});default:return ha(e,"calendarWorkouts",t)}},ga=(e=pa.chartData,t)=>"SET_CHART_DATA"===t.type?t.chartData:e,fa=(e=pa.gpx,t)=>"SET_GPX"===t.type?t.gpxContent:e,wa=(e=pa.language,t)=>"SET_LANGUAGE"===t.type?t.language:e,va=(e=pa.loading,t)=>"SET_LOADING"===t.type?t.loading:e,ka=(e=pa.message,t)=>{switch(t.type){case"AUTH_ERROR":case"PROFILE_ERROR":case"PROFILE_UPDATE_ERROR":case"PICTURE_ERROR":case"SET_ERROR":return t.message;case"CLEAN_ALL_MESSAGES":case"LOGOUT":case"PROFILE_SUCCESS":case"SET_APP_CONFIG":case"SET_RESULTS":case"@@router/LOCATION_CHANGE":return"";default:return e}},ya=(e=pa.messages,t)=>{switch(t.type){case"AUTH_ERRORS":case"APP_ERRORS":return t.messages;case"CLEAN_ALL_MESSAGES":case"LOGOUT":case"PROFILE_SUCCESS":case"@@router/LOCATION_CHANGE":return[];default:return e}},Na=(e=pa.records,t)=>"LOGOUT"===t.type?pa.records:ha(e,"records",t),_a=(e=pa.sports,t)=>"UPDATE_SPORT_DATA"===t.type?Object(k.a)(Object(k.a)({},e),{},{data:e.data.map((e=>(e.id===t.data.id&&(e.is_active=t.data.is_active),e)))}):ha(e,"sports",t),Sa=(e=pa.users,t)=>"UPDATE_USER_DATA"===t.type?Object(k.a)(Object(k.a)({},e),{},{data:e.data.map((e=>(e.username===t.data.username&&(e.admin=t.data.admin),e)))}):ha(e,"users",t),Da=(e=pa.user,t)=>{switch(t.type){case"AUTH_ERROR":case"PROFILE_ERROR":case"LOGOUT":return window.localStorage.removeItem("authToken"),pa.user;case"PROFILE_SUCCESS":return t.profil;default:return e}},Ca=(e=pa.statistics,t)=>"LOGOUT"===t.type?pa.statistics:ha(e,"statistics",t);const Ea=["/login","/register","/password-reset","/password-reset/request","/password-reset/sent","/updated-password"],Aa=(e,t)=>("string"===typeof e||e instanceof String?e=t:e.pathname=t,e),Ma=e=>(window.localStorage.authToken||Ea.includes(e.pathname)||(e=Aa(e,"/login")),window.localStorage.authToken&&Ea.includes(e.pathname)&&(e=Aa(e,"/")),e),Ta=((Pa=Object(r.a)()).location=Ma(Pa.location),Object(k.a)(Object(k.a)({},Pa),{},{push:(e,...t)=>Pa.push(Ma(e),...t),replace:(e,...t)=>Pa.replace(Ma(e),...t)}));var Pa;Ta.listen((()=>{window.scrollTo(0,0)}));const za=document.getElementById("root"),Fa=Object(u.e)((Ra=Ta,Object(u.c)({workouts:ba,application:xa,calendarWorkouts:Oa,chartData:ga,gpx:fa,language:wa,loading:va,message:ka,messages:ya,records:Na,router:Object(la.b)(Ra),sports:_a,statistics:Ca,user:Da,users:Sa})),window.__STATE__,(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||u.d)(Object(u.a)(Object(d.a)(Ta),m.a)));var Ra;null!==window.localStorage.authToken&&Fa.dispatch(ve()),l.a.render(Object(a.jsx)(da,{store:Fa,history:Ta,children:Object(a.jsx)(n.a,{i18n:x,children:Object(a.jsx)(ia,{})})}),za),function(){if("serviceWorker"in navigator){if(new URL("",window.location).origin!==window.location.origin)return;window.addEventListener("load",(()=>{const e="".concat("","/service-worker.js");ua?function(e){fetch(e).then((t=>{404===t.status||-1===t.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then((e=>{e.unregister().then((()=>{window.location.reload()}))})):ma(e)})).catch((()=>{console.log("No internet connection found. App is running in offline mode.")}))}(e):ma(e)}))}}()}},[[889,1,2]]]); +//# sourceMappingURL=main.4387b246.chunk.js.map \ No newline at end of file diff --git a/fittrackee/dist/static/js/main.4387b246.chunk.js.map b/fittrackee/dist/static/js/main.4387b246.chunk.js.map new file mode 100644 index 00000000..c9c4d24f --- /dev/null +++ b/fittrackee/dist/static/js/main.4387b246.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["locales/fr/resources.js","locales/index.js","locales/en/resources.js","i18n.js","components/Common/Message.jsx","utils/index.js","fitTrackeeApi/index.js","actions/index.js","actions/application.js","components/Admin/AdminApplication.jsx","components/Admin/AdminStats.jsx","components/Admin/AdminDashboard.jsx","components/Admin/AdminSports.jsx","components/Common/Pagination.jsx","components/Admin/AdminUsers.jsx","components/Others/NotFound.jsx","components/Admin/index.jsx","utils/workouts.js","fitTrackeeApi/auth.js","actions/user.js","actions/workouts.js","components/Workout/WorkoutForms/FormWithGpx.jsx","components/Workout/WorkoutForms/FormWithoutGpx.jsx","components/Workout/WorkoutAddOrEdit.jsx","components/Workout/WorkoutAdd.jsx","components/Common/CustomModal.jsx","components/Workout/WorkoutDisplay/WorkoutCardHeader.jsx","components/Workout/WorkoutDisplay/WorkoutCharts.jsx","components/Workout/WorkoutDisplay/WorkoutWeather.jsx","components/Workout/WorkoutDisplay/WorkoutDetails.jsx","components/Workout/WorkoutDisplay/Map.jsx","components/Workout/WorkoutDisplay/WorkoutMap.jsx","components/Workout/WorkoutDisplay/WorkoutNoMap.jsx","components/Workout/WorkoutDisplay/WorkoutNotes.jsx","components/Workout/WorkoutDisplay/WorkoutSegments.jsx","components/Workout/WorkoutDisplay/index.jsx","components/Workout/WorkoutEdit.jsx","components/Workout/index.jsx","components/Common/NoWorkouts.jsx","components/Workouts/WorkoutsFilter.jsx","components/Common/StaticMap.jsx","components/Workouts/WorkoutsList.jsx","components/Workouts/index.jsx","components/User/ProfileDetail.jsx","components/User/CurrentUserProfile.jsx","components/Dashboard/CalendarWorkout.jsx","components/Dashboard/CalendarWorkouts.jsx","components/Dashboard/Calendar.jsx","components/Dashboard/Records.jsx","utils/stats.js","components/Common/Stats/CustomTooltip.jsx","components/Common/Stats/CustomLabel.jsx","components/Common/Stats/StatsChart.jsx","components/Common/Stats/index.jsx","actions/stats.js","components/Dashboard/Statistics.jsx","components/Dashboard/UserStatistics.jsx","components/Dashboard/WorkoutCard.jsx","components/Dashboard/index.jsx","components/Footer/index.jsx","components/User/Logout.jsx","images/flags/en.svg","images/flags/fr.svg","components/NavBar/LanguageDropdown.jsx","components/NavBar/index.jsx","images/password.svg","images/mail-send.svg","components/User/PasswordReset.jsx","components/User/ProfileEdit.jsx","components/Statistics/index.jsx","components/User/Form.jsx","components/User/UserForm.jsx","components/User/UserProfile.jsx","components/App.jsx","components/Root.jsx","registerServiceWorker.js","reducers/initial.js","reducers/index.js","utils/history.js","index.js"],"names":["resources","en","workouts","administration","common","dashboard","messages","sports","statistics","user","fr","i18n","use","XHR","LanguageDetector","init","debug","process","lng","fallbackLng","keySeparator","interpolation","escapeValue","ns","defaultNS","Message","React","PureComponent","render","this","props","message","t","singleMessage","split","length","className","map","msg","value","id","suffixes","getFileSize","fileSize","asText","i","Math","floor","log","size","suffix","pow","toFixed","apiUrl","userFilters","key","label","sortOrders","isLoggedIn","window","localStorage","authToken","generateIds","arr","val","obj","createApiRequest","params","headers","noAuthorization","Authorization","getItem","type","requestParams","method","body","JSON","stringify","request","Request","url","fetch","then","response","status","json","catch","error","console","Error","getDateWithTZ","date","tz","dt","DateTime","fromISO","format","Date","setZone","parse","toFormat","sortValues","a","b","valueALabel","toLowerCase","valueBLabel","translateValues","values","sort","formatUrl","pathname","query","username","Object","keys","filter","index","FitTrackeeApi","target","data","setData","setError","setLoading","loading","getOrUpdateData","action","canDispatch","dispatch","isNaN","ret","pagination","setPaginatedData","updateSportsData","updateUsersData","users","updateLanguage","language","i18next","changeLanguage","setLanguage","setAppConfig","getAppData","FitTrackeeGenericApi","getData","AdminApplication","Component","constructor","context","super","state","formData","componentDidMount","initForm","componentDidUpdate","prevProps","appConfig","k","includes","setState","handleFormChange","e","name","isInEdition","loadAppConfig","onHandleConfigFormSubmit","onSubmit","preventDefault","htmlFor","aria-hidden","title","min","max_users","onChange","step","max_single_file_size","max_zip_file_size","gpx_limit_import","onClick","history","push","connect","assign","updateData","Array","isArray","updateAppConfig","AdminStats","loadAppStats","appStats","uploadDirSize","uploads_dir_size","withTranslation","application","AdminDashboard","to","is_registration_enabled","AdminSports","loadSports","updateSport","sport","src","img","alt","is_active","data-toggle","has_workouts","sportId","isActive","Pagination","getUrl","newQuery","page","aria-label","has_prev","aria-disabled","pages","from","_","has_next","AdminUsers","per_page","order_by","order","loadUsers","initState","location","updatePage","authUser","updateUser","translatedFilters","translatedSortOrders","picture","now","email","created_at","nb_workouts","admin","disabled","router","userName","isAdmin","NotFound","useTranslation","Helmet","config","exact","path","component","workoutColors","recordsLabels","record_type","formatWorkoutDate","dateTime","dateFormat","timeFormat","workout_date","workout_time","formatWorkoutDuration","seconds","newDate","subHours","setSeconds","getTime","formatChartData","chartData","time","duration","sortSports","sportALabel","sportBLabel","translateSports","onlyActive","PictureError","ProfileUpdateError","loadProfile","getProfile","isAuthenticated","profil","handleUserFormSubmit","formType","onlyPasswords","errMsg","password","password_conf","RegisterFormControl","loginOrRegisterOrPasswordReset","setItem","auth_token","deleteUser","deleteData","r","setGpx","gpxContent","setChartData","editWorkout","form","getMoreWorkouts","onAddWorkout","FormData","append","gpxFile","files","notes","addDataWithFile","addWorkout","onEditWorkout","workout","sport_id","translatedSports","zipTooltip","fileSizeLimit","encType","event","defaultValue","required","Trans","i18nKey","data-placement","accept","maxLength","onAddOrEdit","d","distance","addData","workoutDate","workoutTime","workoutDateTime","timezone","pattern","placeholder","WorkoutAddEdit","withGpx","handleRadioChange","changeEvent","with_gpx","checked","WorkoutAddOrEdit","CustomModal","close","text","confirm","WorkoutCardHeader","dataType","displayModal","segmentId","previousUrl","previous_workout","nextUrl","segments","next_workout","WorkoutCharts","displayDistance","dataToHide","loadWorkoutData","loadSegmentData","componentWillUnmount","handleLegendChange","find","splice","indexOf","displayData","updateCoordinates","xInterval","parseInt","xDataKey","xScale","height","margin","top","right","left","bottom","onMouseMove","activePayload","onMouseLeave","allowDecimals","dataKey","offset","position","scale","interval","tickFormatter","angle","yAxisId","orientation","fill","stroke","dot","unit","strokeWidth","labelFormatter","workoutId","chart_data","getWorkoutChartData","getSegmentChartData","WorkoutWeather","weather_start","weather_end","icon","summary","Number","temperature","humidity","wind","WorkoutDetails","withPauses","pauses","moving","records","record","ave_speed","max_speed","min_alt","max_alt","ascent","descent","Map","bounds","coordinates","jsonData","mapAttribution","useMap","fitBounds","TileLayer","attribution","GeoJSON","hash","latitude","Marker","longitude","WorkoutMap","zoom","loadWorkoutGpx","loadSegmentGpx","gpx","DOMParser","parseFromString","togeojson","getGeoJson","MapContainer","boundsOptions","padding","map_attribution","getWorkoutGpx","getSegmentGpx","WorkoutNoMap","WorkoutNotes","WorkoutSegments","segment","workout_id","WorkoutDisplay","loadWorkout","match","prevState","payload","onDeleteWorkout","s","Promise","resolve","WorkoutEdit","WorkoutAdd","NoWorkouts","WorkoutsFilter","loadWorkouts","updateParams","StaticMap","display","href","rel","WorkoutsList","scope","idx","Workouts","setParams","loadMoreWorkouts","paginationEnd","onDeletePicture","deletePicture","onUploadPicture","reset","uploadPicture","editable","isDeletable","createdAt","birthDate","birth_date","first_name","last_name","bio","weekm","go","CalendarWorkout","isDisabled","isMore","sportImg","rec","CalendarWorkouts","isHidden","handleDisplayMore","dayWorkouts","act","getStartAndEndMonth","weekStartOnMonday","monthStart","startOfMonth","monthEnd","endOfMonth","weekStartsOn","start","startOfWeek","end","endOfWeek","Calendar","calendarDate","currentMonth","startDate","endDate","loadMonthWorkouts","renderHeader","localeOptions","handlePrevMonth","handleNextMonth","renderDays","days","addDays","filterWorkouts","day","isSameDay","renderCells","rows","formattedDate","isSameMonth","isWeekEnd","isToday","updateStateDate","addMonths","subMonths","locale","enGB","calendarWorkouts","RecordsCard","recordsBySport","reduce","sportList","recordType","formatRecord","sportLabel","colSpan","xAxisFormats","xAxis","formatDuration","totalSeconds","formatWithDay","String","hours","padStart","minutes","formatValue","displayedData","dateIncrement","addYears","formatStats","stats","displayedSports","nbWorkoutsStats","distanceStats","durationStats","startOfYear","x","xAxisFormat","dataNbWorkouts","dataDistance","dataDuration","total_distance","total_duration","CustomTooltip","active","total","p","style","color","CustomLabel","y","width","formattedValue","fontSize","textAnchor","dominantBaseline","StatsCharts","content","isAnimationActive","stackId","Statistics","statsParams","displayEmpty","getStats","Stats","UserStatistics","nb_sports","WorkoutCard","DashBoard","Footer","Logout","UserLogout","_extends","arguments","source","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","_ref14","SvgEn","_ref","svgRef","titleId","enableBackground","viewBox","xmlns","ref","ForwardRef","SvgFr","languages","selected","flag","Dropdown","isOpen","toggleDropdown","onUpdateLanguage","lang","NavBar","data-target","aria-controls","aria-expanded","LanguageDropdown","SvgPassword","xmlnsXlink","xmlSpace","SvgMailSend","PasswordReset","ProfileEdit","onDeleteUser","onHandleProfileFormSubmit","readOnly","postData","handleProfileFormSubmit","durations","updateDisplayedSports","handleOnChangeDuration","subYears","endOfYear","handleOnChangeSports","concat","handleOnClickArrows","forward","newStart","newEnd","subWeeks","addWeeks","sports_list","Form","pageTitle","charAt","toUpperCase","slice","isRegistrationAllowed","userForm","onHandleFormChange","UserForm","emptyForm","onHandleUserFormSubmit","token","UserProfile","loadUser","currentUser","App","Dashboard","CurrentUserProfile","Workout","Admin","Root","store","children","isLocalhost","Boolean","hostname","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","emptyData","handleDataAndError","initial","removeItem","routesWithoutAuthentication","updatePath","toPath","newPath","pathInterceptor","originalHistory","createBrowserHistory","args","replace","listen","scrollTo","rootNode","document","getElementById","createStore","combineReducers","connectRouter","__STATE__","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","applyMiddleware","routerMiddleware","thunk","ReactDOM","I18nextProvider","URL","origin","addEventListener","get","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"wqnBASO,MCNMA,EAAY,CACvBC,GCKyB,CACzBC,S,OACAC,e,OACAC,O,OACAC,U,OACAC,S,OACAC,O,OACAC,W,OACAC,K,QDZAC,GDIyB,CACzBR,S,OACAC,e,OACAC,O,OACAC,U,OACAC,S,OACAC,O,OACAC,W,OACAC,K,SGXFE,IAC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AAMjrB,GAAN,sBAEP6qB,GA2CV,SAAiCI,GAE/BjnB,MAAMinB,GACHhnB,MAAKC,IAGkB,MAApBA,EAASC,SACuD,IAAhED,EAASf,QAAQwqB,IAAI,gBAAgBpY,QAAQ,cAG7C2V,UAAUC,cAAcyC,MAAM3pB,MAAKonB,IACjCA,EAAawC,aAAa5pB,MAAK,KAC7BvB,OAAOuK,SAAS6gB,eAKpB9C,GAAgBC,MAGnB5mB,OAAM,KAELE,QAAQxC,IACN,oEA/DAgsB,CAAwB9C,GAGxBD,GAAgBC,OIIxB+C,K","file":"static/js/main.4387b246.chunk.js","sourcesContent":["import FrWorkoutsTranslations from './workouts.json'\nimport FrAdministrationTranslations from './administration.json'\nimport FrCommonTranslations from './common.json'\nimport FrDashboardTranslations from './dashboard.json'\nimport FrMessagesTranslations from './messages.json'\nimport FrSportsTranslations from './sports.json'\nimport FrStatisticsTranslations from './statistics.json'\nimport FrUserTranslations from './user.json'\n\nexport const frResources = {\n workouts: FrWorkoutsTranslations,\n administration: FrAdministrationTranslations,\n common: FrCommonTranslations,\n dashboard: FrDashboardTranslations,\n messages: FrMessagesTranslations,\n sports: FrSportsTranslations,\n statistics: FrStatisticsTranslations,\n user: FrUserTranslations,\n}\n","import { enResources } from './en/resources'\nimport { frResources } from './fr/resources'\n\nexport const resources = {\n en: enResources,\n fr: frResources,\n}\n","import EnWorkoutsTranslations from './workouts.json'\nimport EnAdministrationTranslations from './administration.json'\nimport EnCommonTranslations from './common.json'\nimport EnDashboardTranslations from './dashboard.json'\nimport EnMessagesTranslations from './messages.json'\nimport EnSportsTranslations from './sports.json'\nimport EnStatisticsTranslations from './statistics.json'\nimport EnUserTranslations from './user.json'\n\nexport const enResources = {\n workouts: EnWorkoutsTranslations,\n administration: EnAdministrationTranslations,\n common: EnCommonTranslations,\n dashboard: EnDashboardTranslations,\n messages: EnMessagesTranslations,\n sports: EnSportsTranslations,\n statistics: EnStatisticsTranslations,\n user: EnUserTranslations,\n}\n","import i18n from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport XHR from 'i18next-xhr-backend'\n\nimport { resources } from './locales'\n\ni18n\n .use(XHR)\n .use(LanguageDetector)\n .init({\n debug: process.env.NODE_ENV === 'development',\n lng: 'en',\n fallbackLng: 'en',\n keySeparator: false,\n interpolation: {\n escapeValue: false,\n },\n resources,\n ns: ['common'],\n defaultNS: 'common',\n })\n\nexport default i18n\n","import React from 'react'\n\nexport default class Message extends React.PureComponent {\n render() {\n const { message, messages, t } = this.props\n const singleMessage =\n message === '' || !message\n ? ''\n : message.split('|').length > 1\n ? `${t(`messages:${message.split('|')[0]}`)}: ${t(\n `messages:${message.split('|')[1]}`\n )}`\n : t(`messages:${message}`)\n return (\n
\n {singleMessage !== '' && {singleMessage}}\n {messages && messages.length > 0 && (\n \n
    \n {messages.map(msg => (\n
  • {t(`messages:${msg.value}`)}
  • \n ))}\n
\n
\n )}\n
\n )\n }\n}\n","import { format, parse } from 'date-fns'\nimport { DateTime } from 'luxon'\n\nconst suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB']\nexport const getFileSize = (fileSize, asText = true) => {\n const i = Math.floor(Math.log(fileSize) / Math.log(1024))\n if (!fileSize) {\n return asText ? '0 bytes' : { size: 0, suffix: 'bytes' }\n }\n const size = (fileSize / Math.pow(1024, i)).toFixed(1)\n const suffix = suffixes[i]\n return asText ? `${size}${suffix}` : { size, suffix }\n}\n\nexport const getFileSizeInMB = fileSize => {\n const value = fileSize / 1048576\n return (!fileSize && 0) || +value.toFixed(2)\n}\n\nexport const version = '0.4.5' // version stored in 'utils' for now\nexport const apiUrl =\n process.env.NODE_ENV === 'production'\n ? '/api/'\n : `${process.env.REACT_APP_API_URL}/api/`\n\nexport const userFilters = [\n { key: 'workouts_count', label: 'workouts count' },\n { key: 'admin', label: 'admin rights' },\n { key: 'created_at', label: 'registration date' },\n { key: 'username', label: 'user name' },\n]\n\nexport const sortOrders = [\n { key: 'asc', label: 'ascending' },\n { key: 'desc', label: 'descending' },\n]\n\nexport const isLoggedIn = () => !!window.localStorage.authToken\n\nexport const generateIds = arr => {\n let i = 0\n return arr.map(val => {\n const obj = { id: i, value: val }\n i++\n return obj\n })\n}\n\nexport const createApiRequest = params => {\n const headers = {}\n if (!params.noAuthorization) {\n headers.Authorization = `Bearer ${window.localStorage.getItem('authToken')}`\n }\n if (params.type) {\n headers['Content-Type'] = params.type\n }\n const requestParams = {\n method: params.method,\n headers: headers,\n }\n if (params.type === 'application/json' && params.body) {\n requestParams.body = JSON.stringify(params.body)\n } else if (params.body) {\n requestParams.body = params.body\n }\n const request = new Request(`${apiUrl}${params.url}`, requestParams)\n return fetch(request)\n .then(response =>\n params.method === 'DELETE' || response.status === 413\n ? response\n : response.json()\n )\n .catch(error => {\n console.error(error)\n return new Error('An error occurred. Please contact the administrator.')\n })\n}\n\nexport const getDateWithTZ = (date, tz) => {\n if (!date) {\n return ''\n }\n const dt = DateTime.fromISO(\n format(new Date(date), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n ).setZone(tz)\n return parse(\n dt.toFormat('yyyy-MM-dd HH:mm:ss'),\n 'yyyy-MM-dd HH:mm:ss',\n new Date()\n )\n}\n\nexport const capitalize = target =>\n target.charAt(0).toUpperCase() + target.slice(1)\n\nexport const rangePagination = pages =>\n Array.from({ length: pages }, (_, i) => i + 1)\n\nconst sortValues = (a, b) => {\n const valueALabel = a.label.toLowerCase()\n const valueBLabel = b.label.toLowerCase()\n return valueALabel > valueBLabel ? 1 : valueALabel < valueBLabel ? -1 : 0\n}\n\nexport const translateValues = (t, values, key = 'common') =>\n values\n .map(value => ({\n ...value,\n label: t(`${key}:${value.label}`),\n }))\n .sort(sortValues)\n\nexport const formatUrl = (pathname, query) => {\n let url = pathname\n if (query.id || (pathname === 'users' && query.username)) {\n url = `${url}/${query.username ? query.username : query.id}`\n } else if (Object.keys(query).length > 0) {\n url += '?'\n Object.keys(query)\n .filter(key => query[key])\n .map(\n (key, index) => (url += `${index === 0 ? '' : '&'}${key}=${query[key]}`)\n )\n }\n return url\n}\n","import { createApiRequest, formatUrl } from '../utils'\n\nexport default class FitTrackeeApi {\n static getData(target, data = {}) {\n const url = formatUrl(target, data)\n const params = {\n url: url,\n method: 'GET',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addData(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addDataWithFile(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n }\n return createApiRequest(params)\n }\n\n static postData(target, data) {\n const params = {\n url: `${target}${data.id ? `/${data.id}` : ''}`,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static updateData(target, data) {\n const params = {\n url: `${target}${\n data.id ? `/${data.id}` : data.username ? `/${data.username}` : ''\n }`,\n method: 'PATCH',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deleteData(target, id) {\n const params = {\n url: `${target}/${id}`,\n method: 'DELETE',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n}\n","import i18next from 'i18next'\n\nimport FitTrackeeApi from '../fitTrackeeApi/index'\nimport { history } from '../index'\n\nexport const emptyMessages = () => ({\n type: 'CLEAN_ALL_MESSAGES',\n})\n\nexport const setData = (target, data) => ({\n type: 'SET_DATA',\n data,\n target,\n})\n\nexport const setPaginatedData = (target, data, pagination) => ({\n type: 'SET_PAGINATED_DATA',\n data,\n pagination,\n target,\n})\n\nexport const setError = message => ({\n type: 'SET_ERROR',\n message,\n})\n\nexport const setLanguage = language => ({\n type: 'SET_LANGUAGE',\n language,\n})\n\nexport const setLoading = loading => ({\n type: 'SET_LOADING',\n loading,\n})\n\nexport const updateSportsData = data => ({\n type: 'UPDATE_SPORT_DATA',\n data,\n})\n\nexport const updateUsersData = data => ({\n type: 'UPDATE_USER_DATA',\n data,\n})\n\nexport const getOrUpdateData = (\n action,\n target,\n data,\n canDispatch = true\n) => dispatch => {\n dispatch(setLoading(true))\n if (data && data.id && target !== 'workouts' && isNaN(data.id)) {\n dispatch(setLoading(false))\n return dispatch(setError(`${target}|Incorrect id`))\n }\n dispatch(emptyMessages())\n return FitTrackeeApi[action](target, data)\n .then(ret => {\n if (ret.status === 'success') {\n if (canDispatch) {\n if (target === 'users' && action === 'getData') {\n return dispatch(setPaginatedData(target, ret.data, ret.pagination))\n }\n dispatch(setData(target, ret.data))\n } else if (action === 'updateData' && target === 'sports') {\n dispatch(updateSportsData(ret.data.sports[0]))\n } else if (action === 'updateData' && target === 'users') {\n dispatch(updateUsersData(ret.data.users[0]))\n }\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`${target}|${error}`))\n })\n}\n\nexport const addData = (target, data) => dispatch =>\n FitTrackeeApi.addData(target, data)\n .then(ret => {\n if (ret.status === 'created') {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n\nexport const deleteData = (target, id) => dispatch => {\n if (isNaN(id)) {\n return dispatch(setError(target, `${target}|Incorrect id`))\n }\n return FitTrackeeApi.deleteData(target, id)\n .then(ret => {\n if (ret.status === 204) {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n}\n\nexport const updateLanguage = language => dispatch => {\n i18next.changeLanguage(language).then(dispatch(setLanguage(language)))\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { history } from '../index'\nimport { generateIds } from '../utils'\nimport { emptyMessages, setError } from './index'\n\nexport const setAppConfig = data => ({\n type: 'SET_APP_CONFIG',\n data,\n})\n\nexport const setAppStats = data => ({\n type: 'SET_APP_STATS',\n data,\n})\n\nconst SetAppErrors = messages => ({ type: 'APP_ERRORS', messages })\n\nexport const getAppData = target => dispatch =>\n FitTrackeeGenericApi.getData(target)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'config') {\n dispatch(setAppConfig(ret.data))\n } else if (target === 'stats/all') {\n dispatch(setAppStats(ret.data))\n }\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n\nexport const updateAppConfig = formData => dispatch => {\n dispatch(emptyMessages())\n FitTrackeeGenericApi.updateData('config', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setAppConfig(ret.data))\n history.push('/admin/application')\n } else if (Array.isArray(ret.message)) {\n dispatch(SetAppErrors(generateIds(ret.message)))\n } else {\n dispatch(setError(ret.message))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n}\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { getAppData, updateAppConfig } from '../../actions/application'\nimport { history } from '../../index'\nimport { getFileSizeInMB } from '../../utils'\n\nclass AdminApplication extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.appConfig !== prevProps.appConfig) {\n this.initForm()\n }\n }\n\n initForm() {\n const { appConfig } = this.props\n const formData = {}\n Object.keys(appConfig).map(k =>\n appConfig[k] === null\n ? (formData[k] = '')\n : ['max_single_file_size', 'max_zip_file_size'].includes(k)\n ? (formData[k] = getFileSizeInMB(appConfig[k]))\n : (formData[k] = appConfig[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = +e.target.value\n this.setState(formData)\n }\n\n render() {\n const {\n isInEdition,\n loadAppConfig,\n message,\n messages,\n onHandleConfigFormSubmit,\n t,\n } = this.props\n const { formData } = this.state\n return (\n
\n {(message || messages) && (\n \n )}\n {Object.keys(formData).length > 0 && (\n
\n
\n
\n
\n \n {t('administration:Application configuration')}\n \n
\n
\n {\n e.preventDefault()\n onHandleConfigFormSubmit(formData)\n }}\n >\n
\n \n {t(\n // eslint-disable-next-line max-len\n 'administration:Max. number of active users'\n )}\n \n \n \n :\n \n this.handleFormChange(e)}\n />\n
\n
\n \n {t(\n 'administration:Max. size of uploaded files (in Mb)'\n )}\n :\n \n this.handleFormChange(e)}\n />\n
\n
\n \n {t('administration:Max. size of zip archive (in Mb)')}:\n \n this.handleFormChange(e)}\n />\n
\n
\n \n {t('administration:Max. files of zip archive')}\n \n this.handleFormChange(e)}\n />\n
\n {isInEdition ? (\n <>\n \n {\n e.preventDefault()\n loadAppConfig()\n history.push('/admin/application')\n }}\n value={t('common:Cancel')}\n />\n \n ) : (\n <>\n {\n e.preventDefault()\n history.push('/admin/application/edit')\n }}\n value={t('common:Edit')}\n />\n history.push('/admin')}\n value={t('common:Back')}\n />\n \n )}\n \n
\n
\n
\n
\n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n messages: state.messages,\n }),\n dispatch => ({\n loadAppConfig: () => {\n dispatch(getAppData('config'))\n },\n onHandleConfigFormSubmit: formData => {\n const data = Object.assign({}, formData)\n data.max_single_file_size *= 1048576\n data.max_zip_file_size *= 1048576\n dispatch(updateAppConfig(data))\n },\n })\n)(AdminApplication)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { getAppData } from '../../actions/application'\nimport { getFileSize } from '../../utils'\n\nclass AdminStats extends React.Component {\n componentDidMount() {\n this.props.loadAppStats()\n }\n\n render() {\n const { appStats, t } = this.props\n const uploadDirSize = getFileSize(appStats.uploads_dir_size, false)\n return (\n
\n
\n
\n
\n
\n \n
\n
\n
\n {appStats.users ? appStats.users : 0}\n
\n
{`${\n appStats.users === 1\n ? t('administration:user')\n : t('administration:users')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n {appStats.sports ? appStats.sports : 0}\n
\n
{`${\n appStats.sports === 1 ? t('common:sport') : t('common:sports')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n {appStats.workouts ? appStats.workouts : 0}\n
\n
{`${\n appStats.workouts === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{uploadDirSize.size}
\n
\n {uploadDirSize.suffix} ({t('administration:uploads')})\n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appStats: state.application.statistics,\n }),\n dispatch => ({\n loadAppStats: () => {\n dispatch(getAppData('stats/all'))\n },\n })\n )(AdminStats)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport AdminStats from './AdminStats'\n\nexport default function AdminDashboard(props) {\n const { appConfig, t } = props\n return (\n
\n
\n {t('administration:Administration')}\n
\n
\n \n
\n
\n
\n \n {t('administration:Application')}\n \n
\n
\n {t(\n 'administration:Update application configuration ' +\n '(maximum number of registered users, maximum files size).'\n )}\n
\n \n {t(\n `administration:Registration is currently ${\n appConfig.is_registration_enabled ? 'enabled' : 'disabled'\n }.`\n )}\n \n
\n
\n
\n \n {t('administration:Sports')}\n \n
\n
{t('administration:Enable/disable sports.')}
\n
\n
\n \n {t('administration:Users')}\n \n
\n
\n {t(\n 'administration:Add/remove admin rights, ' +\n 'delete user account.'\n )}\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { getOrUpdateData } from '../../actions'\nimport { history } from '../../index'\n\nclass AdminSports extends React.Component {\n componentDidMount() {\n this.props.loadSports()\n }\n\n render() {\n const { message, sports, t, updateSport } = this.props\n return (\n
\n {message && }\n
\n
\n
\n
\n {t('administration:Sports')}\n
\n
\n {sports.length > 0 && (\n \n \n \n \n \n \n \n \n \n \n \n {sports.map(sport => (\n \n \n \n \n \n \n \n ))}\n \n
{t('administration:id')}{t('administration:Image')}{t('administration:Label')}{t('administration:Active')}{t('administration:Actions')}
\n \n {t('administration:id')}\n \n {sport.id}\n \n \n {t('administration:Image')}\n \n \n \n \n {t('administration:Label')}\n \n {t(`sports:${sport.label}`)}\n \n \n {t('administration:Active')}\n \n {sport.is_active ? (\n \n ) : (\n \n )}\n \n \n {t('administration:Actions')}\n \n \n updateSport(sport.id, !sport.is_active)\n }\n />\n {sport.has_workouts && (\n \n \n {t('administration:workouts exist')}\n \n )}\n
\n )}\n history.push('/admin/')}\n value={t('common:Back')}\n />\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadSports: () => {\n dispatch(getOrUpdateData('getData', 'sports'))\n },\n updateSport: (sportId, isActive) => {\n const data = { id: sportId, is_active: isActive }\n dispatch(getOrUpdateData('updateData', 'sports', data, false))\n },\n })\n)(AdminSports)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatUrl, rangePagination } from '../../utils'\n\nexport default class Pagination extends React.PureComponent {\n getUrl(value) {\n const { query, pathname } = this.props\n const newQuery = Object.assign({}, query)\n let page = query.page ? +query.page : 1\n switch (value) {\n case 'prev':\n page -= 1\n break\n case 'next':\n page += 1\n break\n default:\n page = +value\n }\n newQuery.page = page\n return formatUrl(pathname, newQuery)\n }\n\n render() {\n const { pagination, t } = this.props\n return (\n <>\n {pagination && Object.keys(pagination).length > 0 && (\n \n )}\n \n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport Message from '../Common/Message'\nimport Pagination from '../Common/Pagination'\nimport { history } from '../../index'\nimport { getOrUpdateData } from '../../actions'\nimport {\n apiUrl,\n formatUrl,\n sortOrders,\n translateValues,\n userFilters,\n} from '../../utils'\n\nclass AdminUsers extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: null,\n per_page: null,\n order_by: 'created_at',\n order: 'asc',\n }\n }\n\n componentDidMount() {\n this.props.loadUsers(this.initState())\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.query !== this.props.location.query) {\n this.props.loadUsers(this.props.location.query)\n }\n }\n\n initState() {\n const { query } = this.props.location\n const newQuery = {\n page: query.page,\n per_page: query.per_page,\n order_by: query.order_by ? query.order_by : 'created_at',\n order: query.order ? query.order : 'asc',\n }\n this.setState(newQuery)\n return newQuery\n }\n\n updatePage(key, value) {\n const query = Object.assign({}, this.state)\n query[key] = value\n this.setState(query)\n const url = formatUrl(this.props.location.pathname, query)\n history.push(url)\n }\n\n render() {\n const {\n authUser,\n location,\n message,\n t,\n pagination,\n updateUser,\n users,\n } = this.props\n const translatedFilters = translateValues(t, userFilters)\n const translatedSortOrders = translateValues(t, sortOrders)\n return (\n
\n {message && }\n
\n
\n
\n
\n
\n {t('administration:Users')}\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n {users.map(user => (\n \n \n \n \n \n \n \n \n \n ))}\n \n
#{t('user:Username')}{t('user:Email')}{t('user:Registration Date')}{t('workouts:Workouts')}{t('user:Admin')}{t('administration:Actions')}
\n #\n {user.picture === true ? (\n \n ) : (\n \n )}\n \n \n {t('user:Username')}\n \n \n {user.username}\n \n \n \n {t('user:Email')}\n \n {user.email}\n \n \n {t('user:Registration Date')}\n \n {format(\n new Date(user.created_at),\n 'dd/MM/yyyy HH:mm'\n )}\n \n \n {t('workouts:Workouts')}\n \n {user.nb_workouts}\n \n \n {t('user:Admin')}\n \n {user.admin ? (\n \n ) : (\n \n )}\n \n \n {t('administration:Actions')}\n \n \n updateUser(user.username, !user.admin)\n }\n />\n
\n \n history.push('/admin/')}\n value={t('common:Back')}\n />\n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n authUser: state.user,\n location: state.router.location,\n message: state.message,\n pagination: state.users.pagination,\n users: state.users.data,\n }),\n dispatch => ({\n loadUsers: query => {\n dispatch(getOrUpdateData('getData', 'users', query))\n },\n updateUser: (userName, isAdmin) => {\n const data = { username: userName, admin: isAdmin }\n dispatch(getOrUpdateData('updateData', 'users', data, false))\n },\n })\n)(AdminUsers)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useTranslation } from 'react-i18next'\n\nexport default function NotFound() {\n const { t } = useTranslation()\n return (\n
\n \n fittrackee - 404\n \n

{t('Page not found')}

\n
\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport AdminApplication from './AdminApplication'\nimport AdminDashboard from './AdminDashboard'\nimport AdminSports from './AdminSports'\nimport AdminUsers from './AdminUsers'\nimport NotFound from './../Others/NotFound'\n\nfunction Admin(props) {\n const { appConfig, t, user } = props\n return (\n <>\n \n FitTrackee - {t('administration:Administration')}\n \n
\n {user.admin ? (\n \n }\n />\n (\n \n )}\n />\n (\n \n )}\n />\n }\n />\n }\n />\n \n \n ) : (\n \n )}\n
\n \n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n appConfig: state.application.config,\n user: state.user,\n }))(Admin)\n)\n","import { format, subHours } from 'date-fns'\nimport togeojson from '@mapbox/togeojson'\n\nimport { getDateWithTZ } from './index'\n\nexport const workoutColors = [\n '#55a8a3',\n '#98C3A9',\n '#D0838A',\n '#ECC77E',\n '#926692',\n '#929292',\n '#428bca',\n]\n\nexport const recordsLabels = [\n { record_type: 'AS', label: 'Ave. speed' },\n { record_type: 'FD', label: 'Farest distance' },\n { record_type: 'LD', label: 'Longest duration' },\n { record_type: 'MS', label: 'Max. speed' },\n]\n\nexport const getGeoJson = gpxContent => {\n let jsonData\n if (gpxContent) {\n const gpx = new DOMParser().parseFromString(gpxContent, 'text/xml')\n jsonData = togeojson.gpx(gpx)\n }\n return { jsonData }\n}\n\nexport const formatWorkoutDate = (\n dateTime,\n dateFormat = null,\n timeFormat = null\n) => {\n if (!dateFormat) {\n dateFormat = 'yyyy/MM/dd'\n }\n if (!timeFormat) {\n timeFormat = 'HH:mm'\n }\n return {\n workout_date: dateTime ? format(dateTime, dateFormat) : null,\n workout_time: dateTime ? format(dateTime, timeFormat) : null,\n }\n}\n\nexport const formatWorkoutDuration = seconds => {\n let newDate = new Date(0)\n newDate = subHours(newDate.setSeconds(seconds), 1)\n return newDate.getTime()\n}\n\nexport const formatChartData = chartData => {\n for (let i = 0; i < chartData.length; i++) {\n chartData[i].time = new Date(chartData[i].time).getTime()\n chartData[i].duration = formatWorkoutDuration(chartData[i].duration)\n }\n return chartData\n}\n\nexport const formatRecord = (record, tz) => {\n let value\n switch (record.record_type) {\n case 'AS':\n case 'MS':\n value = `${record.value} km/h`\n break\n case 'FD':\n value = `${record.value} km`\n break\n default:\n // 'LD'\n value = record.value // eslint-disable-line prefer-destructuring\n }\n const [recordType] = recordsLabels.filter(\n r => r.record_type === record.record_type\n )\n return {\n workout_date: formatWorkoutDate(getDateWithTZ(record.workout_date, tz))\n .workout_date,\n workout_id: record.workout_id,\n id: record.id,\n record_type: recordType.label,\n value: value,\n }\n}\n\nconst sortSports = (a, b) => {\n const sportALabel = a.label.toLowerCase()\n const sportBLabel = b.label.toLowerCase()\n return sportALabel > sportBLabel ? 1 : sportALabel < sportBLabel ? -1 : 0\n}\n\nexport const translateSports = (sports, t, onlyActive = false) =>\n sports\n .filter(sport => (onlyActive ? sport.is_active : true))\n .map(sport => ({\n ...sport,\n label: t(`sports:${sport.label}`),\n }))\n .sort(sortSports)\n","import { createApiRequest } from '../utils'\n\nexport default class FitTrackeeApi {\n static loginOrRegisterOrPasswordReset(target, data) {\n const params = {\n url: `auth/${target}`,\n method: 'POST',\n noAuthorization: true,\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deletePicture() {\n const params = {\n url: 'auth/picture',\n method: 'DELETE',\n }\n return createApiRequest(params)\n }\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport FitTrackeeApi from '../fitTrackeeApi/auth'\nimport { history } from '../index'\nimport { generateIds } from '../utils'\nimport { getOrUpdateData, setError, updateLanguage } from './index'\nimport { getAppData } from './application'\n\nconst AuthError = message => ({ type: 'AUTH_ERROR', message })\n\nconst AuthErrors = messages => ({ type: 'AUTH_ERRORS', messages })\n\nconst PictureError = message => ({ type: 'PICTURE_ERROR', message })\n\nconst ProfileSuccess = profil => ({ type: 'PROFILE_SUCCESS', profil })\n\nconst ProfileError = message => ({ type: 'PROFILE_ERROR', message })\n\nconst ProfileUpdateError = message => ({\n type: 'PROFILE_UPDATE_ERROR',\n message,\n})\n\nexport const logout = () => ({ type: 'LOGOUT' })\n\nexport const loadProfile = () => dispatch => {\n if (window.localStorage.getItem('authToken')) {\n return dispatch(getProfile())\n }\n return { type: 'LOGOUT' }\n}\n\nexport const getProfile = () => dispatch =>\n FitTrackeeGenericApi.getData('auth/profile')\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getOrUpdateData('getData', 'sports'))\n ret.data.isAuthenticated = true\n if (ret.data.language) {\n dispatch(updateLanguage(ret.data.language))\n }\n return dispatch(ProfileSuccess(ret.data))\n }\n return dispatch(ProfileError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const loginOrRegisterOrPasswordReset = (target, formData) => dispatch =>\n FitTrackeeApi.loginOrRegisterOrPasswordReset(target, formData)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'password/reset-request') {\n return history.push({\n pathname: '/password-reset/sent',\n })\n }\n if (target === 'password/update') {\n return history.push({\n pathname: '/updated-password',\n })\n }\n if (target === 'login' || target === 'register') {\n window.localStorage.setItem('authToken', ret.auth_token)\n if (target === 'register') {\n dispatch(getAppData('config'))\n }\n return dispatch(getProfile())\n }\n }\n return dispatch(AuthError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nconst RegisterFormControl = (formData, onlyPasswords = false) => {\n const errMsg = []\n if (\n !onlyPasswords &&\n (formData.username.length < 3 || formData.username.length > 12)\n ) {\n errMsg.push('3 to 12 characters required for username.')\n }\n if (formData.password !== formData.password_conf) {\n errMsg.push(\"Password and password confirmation don't match.\")\n }\n if (formData.password.length < 8) {\n errMsg.push('8 characters required for password.')\n }\n return errMsg\n}\n\nexport const handleUserFormSubmit = (formData, formType) => dispatch => {\n if (formType === 'register' || formType === 'password/update') {\n const ret = RegisterFormControl(formData, formType === 'password/update')\n if (ret.length > 0) {\n return dispatch(AuthErrors(generateIds(ret)))\n }\n }\n return dispatch(loginOrRegisterOrPasswordReset(formType, formData))\n}\n\nexport const handleProfileFormSubmit = formData => dispatch => {\n if (!formData.password === formData.password_conf) {\n return dispatch(\n ProfileUpdateError(\"Password and password confirmation don't match.\")\n )\n }\n delete formData.id\n return FitTrackeeGenericApi.postData('auth/profile/edit', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getProfile())\n return history.push('/profile')\n }\n dispatch(ProfileUpdateError(ret.message))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const uploadPicture = event => dispatch => {\n event.preventDefault()\n const form = new FormData()\n form.append('file', event.target.picture.files[0])\n event.target.reset()\n return FitTrackeeGenericApi.addDataWithFile('auth/picture', form)\n .then(ret => {\n if (ret.status === 'success') {\n return dispatch(getProfile())\n }\n const msg =\n ret.status === 413\n ? 'Error during picture update, file size exceeds max size.'\n : ret.message\n return dispatch(PictureError(msg))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const deletePicture = () => dispatch =>\n FitTrackeeApi.deletePicture()\n .then(ret => {\n if (ret.status === 204) {\n return dispatch(getProfile())\n }\n return dispatch(PictureError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const deleteUser = (username, isAdmin = false) => dispatch =>\n FitTrackeeGenericApi.deleteData('users', username)\n .then(ret => {\n if (ret.status === 204) {\n dispatch(getAppData('config'))\n if (isAdmin) {\n history.push('/admin/users')\n } else {\n dispatch(logout())\n history.push('/')\n }\n } else {\n ret.json().then(r => dispatch(setError(`${r.message}`)))\n }\n })\n .catch(error => dispatch(setError(`user|${error}`)))\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { history } from '../index'\nimport { formatChartData } from '../utils/workouts'\nimport { setError, setLoading } from './index'\nimport { loadProfile } from './user'\n\nexport const pushWorkouts = workouts => ({\n type: 'PUSH_WORKOUTS',\n workouts,\n})\n\nexport const removeWorkout = workoutId => ({\n type: 'REMOVE_WORKOUT',\n workoutId,\n})\n\nexport const updateCalendar = workouts => ({\n type: 'UPDATE_CALENDAR',\n workouts,\n})\n\nexport const setGpx = gpxContent => ({\n type: 'SET_GPX',\n gpxContent,\n})\n\nexport const setChartData = chartData => ({\n type: 'SET_CHART_DATA',\n chartData,\n})\n\nexport const addWorkout = form => dispatch =>\n FitTrackeeGenericApi.addDataWithFile('workouts', form)\n .then(ret => {\n if (ret.status === 'created') {\n if (ret.data.workouts.length === 0) {\n dispatch(setError('workouts|no correct file.'))\n } else if (ret.data.workouts.length === 1) {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n // ret.data.workouts.length > 1\n dispatch(loadProfile())\n history.push('/')\n }\n } else if (ret.status === 413) {\n dispatch(\n setError('workouts|File size is greater than the allowed size')\n )\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`workouts|${error}`))\n })\n\nexport const addWorkoutWithoutGpx = form => dispatch =>\n FitTrackeeGenericApi.addData('workouts/no_gpx', form)\n .then(ret => {\n if (ret.status === 'created') {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const getWorkoutGpx = workoutId => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(`workouts/${workoutId}/gpx`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getSegmentGpx = (workoutId, segmentId) => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(\n `workouts/${workoutId}/gpx/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getWorkoutChartData = workoutId => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(`workouts/${workoutId}/chart_data`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const getSegmentChartData = (workoutId, segmentId) => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(\n `workouts/${workoutId}/chart_data/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const deleteWorkout = id => dispatch =>\n FitTrackeeGenericApi.deleteData('workouts', id)\n .then(ret => {\n if (ret.status === 204) {\n Promise.resolve(dispatch(removeWorkout(id)))\n .then(() => dispatch(loadProfile()))\n .then(() => history.push('/'))\n } else {\n dispatch(setError(`workouts|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const editWorkout = form => dispatch =>\n FitTrackeeGenericApi.updateData('workouts', form)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`workouts|${error}`))\n })\n\nexport const getMoreWorkouts = params => dispatch =>\n FitTrackeeGenericApi.getData('workouts', params)\n .then(ret => {\n if (ret.status === 'success') {\n if (ret.data.workouts.length > 0) {\n dispatch(pushWorkouts(ret.data.workouts))\n }\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const getMonthWorkouts = (from, to) => dispatch =>\n FitTrackeeGenericApi.getData('workouts', {\n from,\n to,\n order: 'desc',\n per_page: 100,\n })\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(updateCalendar(ret.data.workouts))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { setLoading } from '../../../actions/index'\nimport { addWorkout, editWorkout } from '../../../actions/workouts'\nimport { history } from '../../../index'\nimport { getFileSize } from '../../../utils'\nimport { translateSports } from '../../../utils/workouts'\n\nfunction FormWithGpx(props) {\n const {\n appConfig,\n loading,\n onAddWorkout,\n onEditWorkout,\n sports,\n t,\n workout,\n } = props\n const sportId = workout ? workout.sport_id : ''\n const translatedSports = translateSports(sports, t, true)\n const zipTooltip = `${t('workouts:no folder inside')}, ${\n appConfig.gpx_limit_import\n } ${t('workouts:files max')}, ${t('workouts:max size')}: ${getFileSize(\n appConfig.max_zip_file_size\n )}`\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n event.preventDefault()}\n >\n
\n \n
\n {workout ? (\n
\n \n
\n ) : (\n
\n \n
\n )}\n
\n \n
\n {loading ? (\n
\n ) : (\n
\n \n workout ? onEditWorkout(event, workout) : onAddWorkout(event)\n }\n value={t('common:Submit')}\n />\n history.push('/')}\n value={t('common:Cancel')}\n />\n
\n )}\n \n )\n}\n\nexport default connect(\n state => ({\n appConfig: state.application.config,\n loading: state.loading,\n }),\n dispatch => ({\n onAddWorkout: e => {\n dispatch(setLoading(true))\n const form = new FormData()\n form.append('file', e.target.form.gpxFile.files[0])\n /* prettier-ignore */\n form.append(\n 'data',\n `{\"sport_id\": ${e.target.form.sport.value\n }, \"notes\": \"${e.target.form.notes.value}\"}`\n )\n dispatch(addWorkout(form))\n },\n onEditWorkout: (e, workout) => {\n dispatch(\n editWorkout({\n id: workout.id,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport.value,\n title: e.target.form.title.value,\n })\n )\n },\n })\n)(FormWithGpx)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport { addWorkoutWithoutGpx, editWorkout } from '../../../actions/workouts'\nimport { history } from '../../../index'\nimport { getDateWithTZ } from '../../../utils'\nimport { formatWorkoutDate, translateSports } from '../../../utils/workouts'\n\nfunction FormWithoutGpx(props) {\n const { onAddOrEdit, sports, t, user, workout } = props\n const translatedSports = translateSports(sports, t, true)\n let workoutDate,\n workoutTime,\n sportId = ''\n if (workout) {\n const workoutDateTime = formatWorkoutDate(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'yyyy-MM-dd'\n )\n workoutDate = workoutDateTime.workout_date\n workoutTime = workoutDateTime.workout_time\n sportId = workout.sport_id\n }\n\n return (\n
event.preventDefault()}>\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n onAddOrEdit(event, workout)}\n value={t('common:Submit')}\n />\n history.push('/')}\n value={t('common:Cancel')}\n />\n \n )\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n onAddOrEdit: (e, workout) => {\n const d = e.target.form.duration.value.split(':')\n const duration = +d[0] * 60 * 60 + +d[1] * 60 + +d[2]\n\n /* prettier-ignore */\n const workoutDate = `${e.target.form.workout_date.value\n } ${ e.target.form.workout_time.value}`\n\n const data = {\n workout_date: workoutDate,\n distance: +e.target.form.distance.value,\n duration,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport_id.value,\n title: e.target.form.title.value,\n }\n if (workout) {\n data.id = workout.id\n dispatch(editWorkout(data))\n } else {\n dispatch(addWorkoutWithoutGpx(data))\n }\n },\n })\n)(FormWithoutGpx)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport FormWithGpx from './WorkoutForms/FormWithGpx'\nimport FormWithoutGpx from './WorkoutForms/FormWithoutGpx'\nimport Message from '../Common/Message'\n\nclass WorkoutAddEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n withGpx: true,\n }\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n withGpx:\n changeEvent.target.name === 'withGpx'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n render() {\n const { loading, message, sports, t, workout } = this.props\n const { withGpx } = this.state\n return (\n
\n \n \n FitTrackee -{' '}\n {workout\n ? t('workouts:Edit a workout')\n : t('workouts:Add a workout')}\n \n \n
\n
\n \n
\n
\n
\n
\n
\n

\n {workout\n ? t('workouts:Edit a workout')\n : t('workouts:Add a workout')}\n

\n
\n {workout ? (\n workout.with_gpx ? (\n \n ) : (\n \n )\n ) : (\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n {withGpx ? (\n \n ) : (\n \n )}\n
\n )}\n
\n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n loading: state.loading,\n }))(WorkoutAddEdit)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport WorkoutAddOrEdit from './WorkoutAddOrEdit'\n\nfunction WorkoutAdd(props) {\n const { message, sports } = props\n return (\n
\n \n
\n )\n}\n\nexport default connect(state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n}))(WorkoutAdd)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport default function CustomModal(props) {\n const { t } = useTranslation()\n return (\n
\n
\n
\n
\n
{props.title}
\n props.close()}\n >\n ×\n \n
\n
\n

{props.text}

\n
\n
\n props.confirm()}\n >\n {t('common:Yes')}\n \n props.close()}\n >\n {t('common:No')}\n \n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { getDateWithTZ } from '../../../utils'\nimport { formatWorkoutDate } from '../../../utils/workouts'\n\nexport default function WorkoutCardHeader(props) {\n const {\n dataType,\n displayModal,\n segmentId,\n sport,\n t,\n title,\n user,\n workout,\n } = props\n const workoutDate = workout\n ? formatWorkoutDate(getDateWithTZ(workout.workout_date, user.timezone))\n : null\n\n const previousUrl =\n dataType === 'segment' && segmentId !== 1\n ? `/workouts/${workout.id}/segment/${segmentId - 1}`\n : dataType === 'workout' && workout.previous_workout\n ? `/workouts/${workout.previous_workout}`\n : null\n const nextUrl =\n dataType === 'segment' && segmentId < workout.segments.length\n ? `/workouts/${workout.id}/segment/${segmentId + 1}`\n : dataType === 'workout' && workout.next_workout\n ? `/workouts/${workout.next_workout}`\n : null\n\n return (\n
\n
\n
\n {previousUrl ? (\n \n \n \n ) : (\n \n )}\n
\n
\n \"sport\n
\n
\n {dataType === 'workout' ? (\n <>\n {title}{' '}\n \n \n \n displayModal(true)}\n title={t('workouts:Delete workout')}\n />\n \n ) : (\n <>\n {/* prettier-ignore */}\n \n {title}\n {' '}\n - {t('workouts:segment')} {segmentId}\n \n )}\n
\n {workoutDate && (\n \n {`${workoutDate.workout_date} - ${workoutDate.workout_time}`}\n \n )}\n
\n
\n {nextUrl ? (\n \n \n \n ) : (\n \n )}\n
\n
\n
\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport {\n Area,\n ComposedChart,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport {\n getSegmentChartData,\n getWorkoutChartData,\n} from '../../../actions/workouts'\n\nclass WorkoutCharts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayDistance: true,\n dataToHide: [],\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'workout') {\n this.props.loadWorkoutData(this.props.workout.id)\n } else {\n this.props.loadSegmentData(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'workout' &&\n prevProps.workout.id !== this.props.workout.id) ||\n (this.props.dataType === 'workout' && prevProps.dataType === 'segment')\n ) {\n this.props.loadWorkoutData(this.props.workout.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentData(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadWorkoutData(null)\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n displayDistance:\n changeEvent.target.name === 'distance'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n handleLegendChange(e) {\n const { dataToHide } = this.state\n const name = e.target.name // eslint-disable-line prefer-destructuring\n if (dataToHide.find(d => d === name)) {\n dataToHide.splice(dataToHide.indexOf(name), 1)\n } else {\n dataToHide.push(name)\n }\n this.setState({ dataToHide })\n }\n\n displayData(name) {\n const { dataToHide } = this.state\n return !dataToHide.find(d => d === name)\n }\n\n render() {\n const { chartData, t, updateCoordinates } = this.props\n const { displayDistance } = this.state\n const xInterval = chartData ? parseInt(chartData.length / 10, 10) : 0\n let xDataKey, xScale\n if (displayDistance) {\n xDataKey = 'distance'\n xScale = 'linear'\n } else {\n xDataKey = 'duration'\n xScale = 'time'\n }\n return (\n
\n {chartData && chartData.length > 0 ? (\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n updateCoordinates(e.activePayload)}\n onMouseLeave={() => updateCoordinates(null)}\n >\n \n displayDistance ? value : format(value, 'HH:mm:ss')\n }\n type=\"number\"\n />\n \n \n {this.displayData('elevation') && (\n \n )}\n {this.displayData('speed') && (\n \n )}\n \n displayDistance\n ? `${t('workouts:distance')}: ${value} km`\n : `${t('workouts:duration')}: ${format(\n value,\n 'HH:mm:ss'\n )}`\n }\n />\n \n \n
\n
\n {t('workouts:data from gpx, without any cleaning')}\n
\n
\n ) : (\n t('workouts:No data to display')\n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n chartData: state.chartData,\n }),\n dispatch => ({\n loadWorkoutData: workoutId => {\n dispatch(getWorkoutChartData(workoutId))\n },\n loadSegmentData: (workoutId, segmentId) => {\n dispatch(getSegmentChartData(workoutId, segmentId))\n },\n })\n)(WorkoutCharts)\n","import React from 'react'\n\nexport default function WorkoutWeather(props) {\n const { t, workout } = props\n return (\n
\n {workout.weather_start && workout.weather_end && (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n {t('workouts:Start')}\n
\n \n
\n {t('workouts:End')}\n
\n \n
\n \n {Number(workout.weather_start.temperature).toFixed(1)}°C{Number(workout.weather_end.temperature).toFixed(1)}°C
\n \n \n {Number(workout.weather_start.humidity * 100).toFixed(1)}%\n {Number(workout.weather_end.humidity * 100).toFixed(1)}%
\n \n {Number(workout.weather_start.wind).toFixed(1)}m/s{Number(workout.weather_end.wind).toFixed(1)}m/s
\n )}\n
\n )\n}\n","import React from 'react'\n\nimport WorkoutWeather from './WorkoutWeather'\n\nexport default function WorkoutDetails(props) {\n const { t, workout } = props\n const withPauses = workout.pauses !== '0:00:00' && workout.pauses !== null\n return (\n
\n

\n \n {t('workouts:Duration')}: {workout.moving}\n {workout.records &&\n workout.records.find(record => record.record_type === 'LD') && (\n \n \n \n )}\n {withPauses && (\n \n
({t('workouts:pauses')}: {workout.pauses},{' '}\n {t('workouts:total duration')}: {workout.duration})\n
\n )}\n

\n

\n \n {t('workouts:Distance')}: {workout.distance} km\n {workout.records &&\n workout.records.find(record => record.record_type === 'FD') && (\n \n \n \n )}\n

\n

\n \n {t('workouts:Average speed')}: {workout.ave_speed} km/h\n {workout.records &&\n workout.records.find(record => record.record_type === 'AS') && (\n \n \n \n )}\n
\n {t('workouts:Max. speed')}: {workout.max_speed} km/h\n {workout.records &&\n workout.records.find(record => record.record_type === 'MS') && (\n \n \n \n )}\n

\n {workout.min_alt && workout.max_alt && (\n

\n \n {t('workouts:Min. altitude')}: {workout.min_alt}m\n
\n {t('workouts:Max. altitude')}: {workout.max_alt}m\n

\n )}\n {workout.ascent && workout.descent && (\n

\n \n {t('workouts:Ascent')}: {workout.ascent}m\n
\n {t('workouts:Descent')}: {workout.descent}m\n

\n )}\n \n
\n )\n}\n","import React from 'react'\nimport { GeoJSON, Marker, TileLayer, useMap } from 'react-leaflet'\nimport hash from 'object-hash'\n\nimport { apiUrl } from '../../../utils'\n\nexport default function Map({ bounds, coordinates, jsonData, mapAttribution }) {\n const map = useMap()\n map.fitBounds(bounds)\n return (\n <>\n \n \n {coordinates.latitude && (\n \n )}\n \n )\n}\n","import React from 'react'\nimport { MapContainer } from 'react-leaflet'\nimport { connect } from 'react-redux'\n\nimport Map from './Map'\nimport { getSegmentGpx, getWorkoutGpx } from '../../../actions/workouts'\nimport { getGeoJson } from '../../../utils/workouts'\n\nclass WorkoutMap extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n zoom: 13,\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'workout') {\n this.props.loadWorkoutGpx(this.props.workout.id)\n } else {\n this.props.loadSegmentGpx(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'workout' &&\n prevProps.workout.id !== this.props.workout.id) ||\n (this.props.dataType === 'workout' && prevProps.dataType === 'segment')\n ) {\n this.props.loadWorkoutGpx(this.props.workout.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentGpx(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadWorkoutGpx(null)\n }\n\n render() {\n const { coordinates, gpxContent, mapAttribution, workout } = this.props\n const { jsonData } = getGeoJson(gpxContent)\n const bounds = [\n [workout.bounds[0], workout.bounds[1]],\n [workout.bounds[2], workout.bounds[3]],\n ]\n\n return (\n
\n {jsonData && (\n \n \n \n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n gpxContent: state.gpx,\n mapAttribution: state.application.config.map_attribution,\n }),\n dispatch => ({\n loadWorkoutGpx: workoutId => {\n dispatch(getWorkoutGpx(workoutId))\n },\n loadSegmentGpx: (workoutId, segmentId) => {\n dispatch(getSegmentGpx(workoutId, segmentId))\n },\n })\n)(WorkoutMap)\n","import React from 'react'\n\nexport default function WorkoutNoMap(props) {\n const { t } = props\n return (\n
{t('workouts:No Map')}
\n )\n}\n","import React from 'react'\n\nexport default function WorkoutNotes(props) {\n const { notes, t } = props\n return (\n
\n
\n
\n
\n Notes\n
\n {notes ? notes : t('workouts:No notes')}\n
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default function WorkoutSegments(props) {\n const { segments, t } = props\n return (\n
\n
\n
\n
\n {t('workouts:Segments')}\n
\n
    \n {segments.map((segment, index) => (\n \n \n {t('workouts:segment')} {index + 1}\n {' '}\n ({t('workouts:distance')}: {segment.distance} km,{' '}\n {t('workouts:duration')}: {segment.duration})\n \n ))}\n
\n
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../../Common/CustomModal'\nimport Message from '../../Common/Message'\nimport WorkoutCardHeader from './WorkoutCardHeader'\nimport WorkoutCharts from './WorkoutCharts'\nimport WorkoutDetails from './WorkoutDetails'\nimport WorkoutMap from './WorkoutMap'\nimport WorkoutNoMap from './WorkoutNoMap'\nimport WorkoutNotes from './WorkoutNotes'\nimport WorkoutSegments from './WorkoutSegments'\nimport { getOrUpdateData } from '../../../actions'\nimport { deleteWorkout } from '../../../actions/workouts'\n\nclass WorkoutDisplay extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n coordinates: {\n latitude: null,\n longitude: null,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n\n componentDidUpdate(prevProps) {\n if (\n prevProps.match.params.workoutId !== this.props.match.params.workoutId\n ) {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n updateCoordinates(activePayload) {\n const coordinates =\n activePayload && activePayload.length > 0\n ? {\n latitude: activePayload[0].payload.latitude,\n longitude: activePayload[0].payload.longitude,\n }\n : {\n latitude: null,\n longitude: null,\n }\n this.setState(prevState => ({\n ...prevState,\n coordinates,\n }))\n }\n\n render() {\n const { message, onDeleteWorkout, sports, t, user, workouts } = this.props\n const { coordinates, displayModal } = this.state\n const [workout] = workouts\n const title = workout ? workout.title : t('workouts:Workout')\n const [sport] = workout ? sports.filter(s => s.id === workout.sport_id) : []\n const segmentId = parseInt(this.props.match.params.segmentId)\n const dataType = segmentId >= 0 ? 'segment' : 'workout'\n return (\n
\n \n FitTrackee - {title}\n \n {message ? (\n \n ) : (\n
\n {displayModal && (\n {\n onDeleteWorkout(workout.id)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {workout && sport && workouts.length === 1 && (\n
\n
\n
\n
\n
\n this.displayModal(true)}\n />\n
\n
\n
\n
\n {workout.with_gpx ? (\n \n ) : (\n \n )}\n
\n
\n \n
\n
\n
\n
\n
\n
\n {workout.with_gpx && (\n
\n
\n
\n
\n
\n
\n
\n {t('workouts:Chart')}\n
\n \n this.updateCoordinates(e)\n }\n />\n
\n
\n
\n
\n
\n
\n )}\n {dataType === 'workout' && (\n <>\n \n {workout.segments.length > 1 && (\n \n )}\n \n )}\n
\n )}\n
\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkout: workoutId => {\n dispatch(getOrUpdateData('getData', 'workouts', { id: workoutId }))\n },\n onDeleteWorkout: workoutId => {\n dispatch(deleteWorkout(workoutId))\n },\n })\n )(WorkoutDisplay)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport WorkoutAddOrEdit from './WorkoutAddOrEdit'\nimport { getOrUpdateData } from '../../actions'\n\nclass WorkoutEdit extends React.Component {\n componentDidMount() {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n\n render() {\n const { message, sports, workouts } = this.props\n const [workout] = workouts\n return (\n
\n {sports.length > 0 && (\n \n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkout: workoutId => {\n dispatch(getOrUpdateData('getData', 'workouts', { id: workoutId }))\n },\n })\n)(WorkoutEdit)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Redirect, Route, Switch } from 'react-router-dom'\n\nimport NotFound from './../Others/NotFound'\nimport WorkoutAdd from './WorkoutAdd'\nimport WorkoutDisplay from './WorkoutDisplay'\nimport WorkoutEdit from './WorkoutEdit'\nimport { isLoggedIn } from '../../utils'\n\nfunction Workout() {\n return (\n
\n {isLoggedIn() ? (\n \n \n \n \n \n \n \n ) : (\n \n )}\n
\n )\n}\n\nexport default connect(state => ({\n user: state.user,\n}))(Workout)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default class NoWorkouts extends React.PureComponent {\n render() {\n const { t } = this.props\n return (\n
\n
\n {t('common:No workouts.')}{' '}\n \n {t('dashboard:Upload one !')}\n \n
\n
\n )\n }\n}\n","import React from 'react'\n\nimport { translateSports } from '../../utils/workouts'\n\nexport default class WorkoutsFilter extends React.PureComponent {\n render() {\n const { loadWorkouts, sports, t, updateParams } = this.props\n const translatedSports = translateSports(sports, t)\n return (\n
\n
\n
event.preventDefault()}>\n
\n \n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n loadWorkouts()}\n type=\"submit\"\n value={t('workouts:Filter')}\n />\n \n
\n
\n )\n }\n}\n","import React from 'react'\n\nimport { apiUrl } from '../../utils'\n\nexport default class StaticMap extends React.PureComponent {\n render() {\n const { display, workout } = this.props\n\n return (\n
\n \n
\n ©\n \n OpenStreetMap\n \n
\n
\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default class WorkoutsList extends React.PureComponent {\n render() {\n const { loading, sports, t, user, workouts } = this.props\n return (\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n {!loading &&\n sports &&\n workouts.map((workout, idx) => (\n // eslint-disable-next-line react/no-array-index-key\n \n \n \n \n \n \n \n \n \n ))}\n \n
\n {t('common:Workout')}{t('workouts:Date')}{t('workouts:Distance')}{t('workouts:Duration')}{t('workouts:Ave. speed')}{t('workouts:Max. speed')}
\n \n {t('common:Sport')}\n \n s.id === workout.sport_id)\n .map(s => s.img)}\n alt=\"workout sport logo\"\n />\n \n \n {t('common:Workout')}\n \n \n {workout.title}\n \n {workout.map && (\n \n )}\n \n \n {t('workouts:Date')}\n \n {format(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n \n \n {t('workouts:Distance')}\n \n {Number(workout.distance).toFixed(2)} km\n \n \n {t('workouts:Duration')}\n \n {workout.moving}\n \n \n {t('workouts:Ave. speed')}\n \n {workout.ave_speed} km/h\n \n \n {t('workouts:Max. speed')}\n \n {workout.max_speed} km/h\n
\n {loading &&
}\n
\n
\n )\n }\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport NoWorkouts from '../Common/NoWorkouts'\nimport WorkoutsFilter from './WorkoutsFilter'\nimport WorkoutsList from './WorkoutsList'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreWorkouts } from '../../actions/workouts'\n\nclass Workouts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n params: {\n page: 1,\n per_page: 10,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadWorkouts(this.state.params)\n }\n\n setParams(e) {\n const { params } = this.state\n if (e.target.value === '') {\n delete params[e.target.name]\n } else {\n params[e.target.name] = e.target.value\n }\n params.page = 1\n this.setState(params)\n }\n render() {\n const {\n loading,\n loadWorkouts,\n loadMoreWorkouts,\n message,\n sports,\n t,\n user,\n workouts,\n } = this.props\n const { params } = this.state\n const paginationEnd =\n workouts.length > 0\n ? workouts[workouts.length - 1].previous_workout === null\n : true\n return (\n
\n \n FitTrackee - {t('common:Workouts')}\n \n {message ? (\n \n ) : (\n
\n
\n
\n loadWorkouts(params)}\n t={t}\n updateParams={e => this.setParams(e)}\n />\n
\n
\n \n {!paginationEnd && (\n {\n params.page += 1\n loadMoreWorkouts(params)\n this.setState(params)\n }}\n />\n )}\n {workouts.length === 0 && }\n
\n
\n
\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n loading: state.loading,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: params => {\n dispatch(getOrUpdateData('getData', 'workouts', params))\n },\n loadMoreWorkouts: params => {\n dispatch(getMoreWorkouts(params))\n },\n })\n )(Workouts)\n)\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { deletePicture, uploadPicture } from '../../actions/user'\nimport { apiUrl, getFileSize } from '../../utils'\nimport { history } from '../../index'\n\nfunction ProfileDetail({\n appConfig,\n displayModal,\n editable,\n isDeletable,\n message,\n onDeletePicture,\n onUploadPicture,\n pathname,\n t,\n user,\n}) {\n const createdAt = user.created_at\n ? format(new Date(user.created_at), 'dd/MM/yyyy HH:mm')\n : ''\n const birthDate = user.birth_date\n ? format(new Date(user.birth_date), 'dd/MM/yyyy')\n : ''\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n
\n \n FitTrackee - {t('user:Profile')}\n \n \n
\n

{t('user:Profile')}

\n
\n
\n
\n
\n {user.username}\n
\n
\n
\n
\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Email')}\n : {user.email}\n

\n

\n \n {t('user:Registration Date')}\n \n : {createdAt}\n

\n

\n {t('user:First Name')}\n : {user.first_name}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Last Name')}\n : {user.last_name}\n

\n

\n {t('user:Birth Date')}\n : {birthDate}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Location')}\n : {user.location}\n

\n

\n {t('user:Bio')}:{' '}\n {user.bio}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Language')}\n : {user.language}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Timezone')}\n : {user.timezone}\n

\n

\n \n {t('user:First day of week')}\n \n : {user.weekm ? t('user:Monday') : t('user:Sunday')}\n

\n
\n
\n {user.picture === true && (\n
\n \n {editable && (\n <>\n
\n onDeletePicture()}\n >\n {t('user:Delete picture')}\n \n
\n
\n \n )}\n
\n )}\n {editable && (\n onUploadPicture(event)}\n >\n \n
\n \n {` (max. size: ${fileSizeLimit})`}\n \n )}{' '}\n
\n
\n {editable && (\n history.push('/profile/edit')}\n >\n {t('common:Edit')}\n \n )}\n {isDeletable && (\n displayModal(true)}\n >\n {t('user:Delete user account')}\n \n )}\n \n pathname === '/profile' ? history.push('/') : history.go(-1)\n }\n >\n {t(\n pathname === '/profile'\n ? 'common:Back to home'\n : 'common:Back'\n )}\n \n
\n
\n
\n
\n
\n
\n )\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appConfig: state.application.config,\n pathname: state.router.location.pathname,\n message: state.message,\n }),\n dispatch => ({\n onDeletePicture: () => {\n dispatch(deletePicture())\n },\n onUploadPicture: event => {\n dispatch(uploadPicture(event))\n },\n })\n )(ProfileDetail)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ProfileDetail from './ProfileDetail'\n\nfunction CurrentUserProfile({ t, user }) {\n return (\n
\n \n
\n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n user: state.user,\n }))(CurrentUserProfile)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { recordsLabels } from '../../utils/workouts'\n\nexport default function CalendarWorkout(props) {\n const { isDisabled, isMore, sportImg, workout } = props\n return (\n \n <>\n \n {workout.records.length > 0 && (\n \n \n ` ${\n recordsLabels.filter(\n r => r.record_type === rec.record_type\n )[0].label\n }`\n )}\n />\n \n )}\n \n \n )\n}\n","import React from 'react'\n\nimport CalendarWorkout from './CalendarWorkout'\n\nexport default class CalendarWorkouts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n isHidden: true,\n }\n }\n\n handleDisplayMore() {\n this.setState({\n isHidden: !this.state.isHidden,\n })\n }\n\n render() {\n const { dayWorkouts, isDisabled, sports } = this.props\n const { isHidden } = this.state\n return (\n
\n {dayWorkouts.map(act => (\n s.id === act.sport_id).map(s => s.img)}\n />\n ))}\n {dayWorkouts.length > 2 && (\n this.handleDisplayMore()}\n title=\"show more workouts\"\n />\n )}\n {!isHidden && (\n
\n {dayWorkouts.map(act => (\n s.id === act.sport_id)\n .map(s => s.img)}\n />\n ))}\n
\n )}\n
\n )\n }\n}\n","// eslint-disable-next-line max-len\n// source: https://blog.flowandform.agency/create-a-custom-calendar-in-react-3df1bfd0b728\nimport {\n addDays,\n addMonths,\n endOfMonth,\n endOfWeek,\n format,\n isSameDay,\n isSameMonth,\n isToday,\n startOfMonth,\n startOfWeek,\n subMonths,\n} from 'date-fns'\nimport { enGB, fr } from 'date-fns/locale'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport CalendarWorkouts from './CalendarWorkouts'\nimport { getMonthWorkouts } from '../../actions/workouts'\nimport { getDateWithTZ } from '../../utils'\n\nconst getStartAndEndMonth = (date, weekStartOnMonday) => {\n const monthStart = startOfMonth(date)\n const monthEnd = endOfMonth(date)\n const weekStartsOn = weekStartOnMonday ? 1 : 0\n return {\n start: startOfWeek(monthStart, { weekStartsOn }),\n end: endOfWeek(monthEnd),\n }\n}\n\nclass Calendar extends React.Component {\n constructor(props, context) {\n super(props, context)\n const calendarDate = new Date()\n this.state = {\n currentMonth: calendarDate,\n startDate: getStartAndEndMonth(calendarDate, props.weekm).start,\n endDate: getStartAndEndMonth(calendarDate, props.weekm).end,\n weekStartOnMonday: props.weekm,\n }\n }\n\n componentDidMount() {\n this.props.loadMonthWorkouts(this.state.startDate, this.state.endDate)\n }\n\n renderHeader(localeOptions) {\n const dateFormat = 'MMM yyyy'\n return (\n
\n
this.handlePrevMonth()}>\n \n
\n
\n \n {format(this.state.currentMonth, dateFormat, localeOptions)}\n \n
\n
this.handleNextMonth()}>\n \n
\n
\n )\n }\n\n renderDays(localeOptions) {\n const dateFormat = 'EEE'\n const days = []\n const { startDate } = this.state\n\n for (let i = 0; i < 7; i++) {\n days.push(\n
\n {format(addDays(startDate, i), dateFormat, localeOptions)}\n
\n )\n }\n return
{days}
\n }\n\n filterWorkouts(day) {\n const { workouts, user } = this.props\n if (workouts) {\n return workouts.filter(act =>\n isSameDay(getDateWithTZ(act.workout_date, user.timezone), day)\n )\n }\n return []\n }\n\n renderCells() {\n const { currentMonth, startDate, endDate, weekStartOnMonday } = this.state\n const { sports } = this.props\n\n const dateFormat = 'd'\n const rows = []\n\n let days = []\n let day = startDate\n let formattedDate = ''\n\n while (day <= endDate) {\n for (let i = 0; i < 7; i++) {\n formattedDate = format(day, dateFormat)\n const dayWorkouts = this.filterWorkouts(day)\n const isDisabled = isSameMonth(day, currentMonth) ? '' : '-disabled'\n const isWeekEnd = weekStartOnMonday\n ? [5, 6].includes(i)\n : [0, 6].includes(i)\n days.push(\n \n
\n {formattedDate}\n \n
\n
\n )\n day = addDays(day, 1)\n }\n rows.push(\n
\n {days}\n
\n )\n days = []\n }\n return
{rows}
\n }\n\n updateStateDate(calendarDate) {\n const { start, end } = getStartAndEndMonth(\n calendarDate,\n this.state.weekStartOnMonday\n )\n this.setState({\n currentMonth: calendarDate,\n startDate: start,\n endDate: end,\n })\n this.props.loadMonthWorkouts(start, end)\n }\n\n handleNextMonth() {\n const calendarDate = addMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n handlePrevMonth() {\n const calendarDate = subMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n render() {\n const localeOptions = {\n locale: this.props.language === 'fr' ? fr : enGB,\n }\n return (\n
\n
\n {this.renderHeader(localeOptions)}\n {this.renderDays(localeOptions)}\n {this.renderCells()}\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n workouts: state.calendarWorkouts.data,\n language: state.language,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadMonthWorkouts: (start, end) => {\n const dateFormat = 'yyyy-MM-dd'\n dispatch(\n getMonthWorkouts(format(start, dateFormat), format(end, dateFormat))\n )\n },\n })\n)(Calendar)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatRecord, translateSports } from '../../utils/workouts'\n\nexport default function RecordsCard(props) {\n const { records, sports, t, user } = props\n const translatedSports = translateSports(sports, t)\n const recordsBySport = records.reduce((sportList, record) => {\n const sport = translatedSports.find(s => s.id === record.sport_id)\n if (sportList[sport.label] === void 0) {\n sportList[sport.label] = {\n img: sport.img,\n records: [],\n }\n }\n sportList[sport.label].records.push(formatRecord(record, user.timezone))\n return sportList\n }, {})\n\n return (\n
\n
{t('workouts:Personal records')}
\n
\n {Object.keys(recordsBySport).length === 0\n ? t('common:No records.')\n : Object.keys(recordsBySport)\n .sort()\n .map(sportLabel => (\n
\n \n \n {sportLabel}\n \n {/* eslint-disable-next-line max-len */}\n \n \n \n \n \n \n \n {recordsBySport[sportLabel].records.map(rec => (\n \n \n \n \n \n ))}\n \n
\n \n {sportLabel}\n
\n {t(`workouts:${rec.record_type}`)}\n {rec.value}\n \n {rec.workout_date}\n \n
\n
\n ))}\n
\n
\n )\n}\n","import {\n addDays,\n addMonths,\n addYears,\n format,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns'\n\nconst xAxisFormats = [\n { duration: 'week', dateFormat: 'yyyy-MM-dd', xAxis: 'dd/MM' },\n { duration: 'month', dateFormat: 'yyyy-MM', xAxis: 'MM/yyyy' },\n { duration: 'year', dateFormat: 'yyyy', xAxis: 'yyyy' },\n]\n\nexport const formatDuration = (totalSeconds, formatWithDay = false) => {\n let days = '0'\n if (formatWithDay) {\n days = String(Math.floor(totalSeconds / 86400))\n totalSeconds %= 86400\n }\n const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0')\n totalSeconds %= 3600\n const minutes = String(Math.floor(totalSeconds / 60)).padStart(2, '0')\n const seconds = String(totalSeconds % 60).padStart(2, '0')\n if (formatWithDay) {\n return `${days === '0' ? '' : `${days}d:`}${\n hours === '00' ? '' : `${hours}h:`\n }${minutes}m:${seconds}s`\n }\n return `${hours === '00' ? '' : `${hours}:`}${minutes}:${seconds}`\n}\n\nexport const formatValue = (displayedData, value) =>\n value === 0\n ? ''\n : displayedData === 'distance'\n ? `${value.toFixed(2)} km`\n : displayedData === 'duration'\n ? formatDuration(value)\n : value\n\nconst dateIncrement = (duration, day) => {\n switch (duration) {\n case 'week':\n return addDays(day, 7)\n case 'year':\n return addYears(day, 1)\n case 'month':\n default:\n return addMonths(day, 1)\n }\n}\n\nconst startDate = (duration, day, weekm) => {\n switch (duration) {\n case 'week':\n return startOfWeek(day, { weekStartsOn: weekm ? 1 : 0 })\n case 'year':\n return startOfYear(day)\n case 'month':\n default:\n return startOfMonth(day)\n }\n}\n\nexport const formatStats = (stats, sports, params, displayedSports, weekm) => {\n const nbWorkoutsStats = []\n const distanceStats = []\n const durationStats = []\n\n for (\n let day = startDate(params.duration, params.start, weekm);\n day <= params.end;\n day = dateIncrement(params.duration, day)\n ) {\n const [xAxisFormat] = xAxisFormats.filter(\n x => x.duration === params.duration\n )\n const date = format(day, xAxisFormat.dateFormat)\n const xAxis = format(day, xAxisFormat.xAxis)\n const dataNbWorkouts = { date: xAxis }\n const dataDistance = { date: xAxis }\n const dataDuration = { date: xAxis }\n\n if (stats[date]) {\n Object.keys(stats[date])\n .filter(sportId =>\n displayedSports ? displayedSports.includes(+sportId) : true\n )\n .map(sportId => {\n const sportLabel = sports.filter(s => s.id === +sportId)[0].label\n dataNbWorkouts[sportLabel] = stats[date][sportId].nb_workouts\n dataDistance[sportLabel] = stats[date][sportId].total_distance\n dataDuration[sportLabel] = stats[date][sportId].total_duration\n return null\n })\n }\n nbWorkoutsStats.push(dataNbWorkouts)\n distanceStats.push(dataDistance)\n durationStats.push(dataDuration)\n }\n\n return {\n workouts: nbWorkoutsStats,\n distance: distanceStats,\n duration: durationStats,\n }\n}\n","import React from 'react'\n\nimport { formatDuration } from '../../../utils/stats'\n\nconst formatValue = (displayedData, value) =>\n displayedData === 'duration'\n ? formatDuration(value, true)\n : displayedData === 'distance'\n ? value.toFixed(2)\n : value\n\n/**\n * @return {null}\n */\nexport default function CustomTooltip(props) {\n const { active } = props\n if (active) {\n const { displayedData, payload, label } = props\n let total = 0\n payload.map(p => (total += p.value))\n return (\n
\n

{label}

\n {payload.map(p => (\n

\n {p.name}: {formatValue(displayedData, p.value)} {p.unit}\n

\n ))}\n {payload.length > 0 && (\n

Total: {formatValue(displayedData, total)}

\n )}\n
\n )\n }\n return null\n}\n","import React from 'react'\n\nimport { formatValue } from '../../../utils/stats'\n\n/**\n * @return {null}\n */\nexport default function CustomLabel(props) {\n const { displayedData, x, y, width, value } = props\n if (!value) {\n return null\n }\n const radius = 10\n const formattedValue = formatValue(displayedData, value)\n\n return (\n \n \n {formattedValue}\n \n \n )\n}\n","import React from 'react'\nimport {\n Bar,\n BarChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport { formatValue } from '../../../utils/stats'\nimport { workoutColors } from '../../../utils/workouts'\nimport CustomTooltip from './CustomTooltip'\nimport CustomLabel from './CustomLabel'\n\nexport default class StatsCharts extends React.PureComponent {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayedData: 'distance',\n }\n }\n handleRadioChange(changeEvent) {\n this.setState({\n displayedData: changeEvent.target.name,\n })\n }\n\n render() {\n const { displayedData } = this.state\n const { sports, stats, t } = this.props\n if (Object.keys(stats).length === 0) {\n return t('common:No workouts.')\n }\n return (\n
\n
\n \n \n \n
\n \n \n \n formatValue(displayedData, value)} />\n }\n />\n {sports.map((s, i) => (\n \n ) : (\n ''\n )\n }\n name={t(`sports:${s.label}`)}\n />\n ))}\n \n \n
\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport { getStats } from '../../../actions/stats'\nimport { formatStats } from '../../../utils/stats'\nimport StatsChart from './StatsChart'\n\nclass Statistics extends React.PureComponent {\n componentDidMount() {\n this.updateData()\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.user.username &&\n this.props.user.username !== prevProps.user.username) ||\n this.props.statsParams !== prevProps.statsParams\n ) {\n this.updateData()\n }\n }\n\n updateData() {\n if (this.props.user.username) {\n this.props.loadWorkouts(\n this.props.user.username,\n this.props.user.weekm,\n this.props.statsParams\n )\n }\n }\n\n render() {\n const {\n displayedSports,\n sports,\n statistics,\n statsParams,\n displayEmpty,\n t,\n user,\n } = this.props\n if (!displayEmpty && Object.keys(statistics).length === 0) {\n return {t('common:No workouts.')}\n }\n const stats = formatStats(\n statistics,\n sports,\n statsParams,\n displayedSports,\n user.weekm\n )\n return \n }\n}\n\nexport default connect(\n state => ({\n sports: state.sports.data,\n statistics: state.statistics.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: (userName, weekm, data) => {\n const dateFormat = 'yyyy-MM-dd'\n // depends on user config (first day of week)\n const time =\n data.duration === 'week'\n ? `${data.duration}${weekm ? 'm' : ''}`\n : data.duration\n const params = {\n from: format(data.start, dateFormat),\n to: format(data.end, dateFormat),\n time: time,\n }\n dispatch(getStats(userName, data.type, params))\n },\n })\n)(Statistics)\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { setData, setError } from './index'\n\nexport const getStats = (userName, type, data) => dispatch =>\n FitTrackeeGenericApi.getData(`stats/${userName}/${type}`, data)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setData('statistics', ret.data))\n } else {\n dispatch(setError(`statistics|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`statistics|${error}`)))\n","import { endOfMonth, startOfMonth } from 'date-fns'\nimport React from 'react'\n\nimport Stats from '../Common/Stats'\n\nexport default class Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n start: startOfMonth(date),\n end: endOfMonth(date),\n duration: 'week',\n type: 'by_time',\n }\n }\n\n render() {\n const { t } = this.props\n return (\n
\n
{t('dashboard:This month')}
\n
\n \n
\n
\n )\n }\n}\n","import React from 'react'\n\nexport default function UserStatistics(props) {\n const { t, user } = props\n const days = user.total_duration.match(/day/g)\n ? `${user.total_duration.split(' ')[0]} ${\n user.total_duration.match(/days/g) ? t('common:days') : t('common:day')\n }`\n : `0 ${t('common:days')},`\n let duration = user.total_duration.match(/day/g)\n ? user.total_duration.split(', ')[1]\n : user.total_duration\n duration = `${duration.split(':')[0]}h ${duration.split(':')[1]}min`\n return (\n
\n
\n
\n
\n
\n \n
\n
\n
{user.nb_workouts}
\n
{`${\n user.nb_workouts === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n {Number(user.total_distance).toFixed(2)}\n
\n
km
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{days}
\n
{duration}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{user.nb_sports}
\n
{`${\n user.nb_sports === 1 ? t('common:sport') : t('common:sports')\n }`}
\n
\n
\n
\n
\n
\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default function WorkoutCard(props) {\n const { sports, t, user, workout } = props\n\n return (\n
\n
\n \n {sports\n .filter(sport => sport.id === workout.sport_id)\n .map(sport => t(`sports:${sport.label}`))}{' '}\n -{' '}\n {format(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n \n
\n
\n
\n {workout.map && (\n
\n \n
\n )}\n
\n

\n {' '}\n {t('workouts:Duration')}: {workout.moving}\n {workout.map ? (\n \n
\n
\n
\n ) : (\n ' - '\n )}\n {' '}\n {t('workouts:Distance')}: {workout.distance} km\n

\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Calendar from './Calendar'\nimport Message from '../Common/Message'\nimport NoWorkouts from '../Common/NoWorkouts'\nimport Records from './Records'\nimport Statistics from './Statistics'\nimport UserStatistics from './UserStatistics'\nimport WorkoutCard from './WorkoutCard'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreWorkouts } from '../../actions/workouts'\n\nclass DashBoard extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: 1,\n }\n }\n\n componentDidMount() {\n this.props.loadWorkouts()\n }\n\n render() {\n const {\n loadMoreWorkouts,\n message,\n records,\n sports,\n t,\n user,\n workouts,\n } = this.props\n const paginationEnd =\n workouts.length > 0\n ? workouts[workouts.length - 1].previous_workout === null\n : true\n const { page } = this.state\n return (\n
\n \n FitTrackee - {t('common:Dashboard')}\n \n {message ? (\n \n ) : (\n workouts &&\n user.total_duration &&\n sports.length > 0 && (\n
\n \n
\n
\n \n \n
\n
\n \n {workouts.length > 0 ? (\n workouts.map(workout => (\n \n ))\n ) : (\n \n )}\n {!paginationEnd && (\n {\n loadMoreWorkouts(page + 1)\n this.setState({ page: page + 1 })\n }}\n />\n )}\n
\n
\n
\n )\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n records: state.records.data,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: () => {\n dispatch(getOrUpdateData('getData', 'workouts', { page: 1 }))\n dispatch(getOrUpdateData('getData', 'records'))\n },\n loadMoreWorkouts: page => {\n dispatch(getMoreWorkouts({ page }))\n },\n })\n )(DashBoard)\n)\n","import React from 'react'\n\nimport { version } from './../../utils'\n\nexport default function Footer() {\n return (\n
\n
\n FitTrackee v{version} -{' '}\n \n source code\n {' '}\n under{' '}\n \n GPLv3\n {' '}\n license -{' '}\n \n documentation\n \n
\n
\n )\n}\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport { logout } from '../../actions/user'\n\nclass Logout extends React.Component {\n componentDidMount() {\n this.props.UserLogout()\n }\n render() {\n return (\n
\n
\n
\n
\n
\n
\n \n You are now logged out. Click here to\n log back in.\n \n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n UserLogout: () => {\n dispatch(logout())\n },\n })\n)(Logout)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-421.832c-24.859 0-45.084 20.225-45.084 45.084v366.226c0 24.859 20.225 45.084 45.084 45.084h421.832c24.859 0 45.084-20.225 45.084-45.084v-366.226c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m198.58 188.334-181.344-150.862c-7.75 6.107-13.456 14.691-15.905 24.554l164.142 136.551h33.102z\",\n fill: \"#f40055\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 198.576h33.93l163.447-135.973c-2.325-9.923-7.93-18.592-15.613-24.796l-181.764 151.211z\",\n fill: \"#c20044\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m165.472 313.425-164.141 136.549c2.449 9.863 8.155 18.447 15.905 24.553l181.344-150.861-.005-10.241z\",\n fill: \"#f40055\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 313.425v9.557l181.765 151.211c7.683-6.204 13.288-14.874 15.613-24.796l-163.446-135.971z\",\n fill: \"#c20044\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m53.273 27.803 145.302 120.879v-120.879z\",\n fill: \"#406bd4\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 150.571v-122.768h148.082z\",\n fill: \"#3257b0\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m394.732 198.575 117.268-97.556v97.556z\",\n fill: \"#3257b0\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"#406bd4\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 99.317v99.258h119.313z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 313.425v97.699l117.44-97.699z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m50.49 484.197 148.085-122.676v122.676z\"\n}));\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 484.197v-124.139l149.221 124.139z\",\n fill: \"#3257b0\"\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 409.423-115.395-95.998h115.395z\",\n fill: \"#3257b0\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 222.142h-222.142v-194.339h-67.716v194.339h-222.142v67.716h222.142v194.339h67.716v-194.339h222.142z\",\n fill: \"#f40055\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m289.858 222.142v-194.339h-33.858v456.394h33.858v-194.339h222.142v-67.716z\",\n fill: \"#c20044\"\n});\n\nfunction SvgEn(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgEn);\nexport default __webpack_public_path__ + \"static/media/en.9e6dbfb0.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m173.899 31.804h-8.707l-4.397-4h-115.711c-24.859-.001-45.084 20.224-45.084 45.083v366.226c0 24.859 20.225 45.084 45.084 45.084h115.711l6.348-4h6.755v-448.393z\",\n fill: \"#406bd4\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-115.711l-4.523 4h-5.141v448.393h4.141l5.523 4h115.711c24.859 0 45.084-20.225 45.084-45.084v-366.225c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#c20044\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m160.795 27.803h190.409v456.394h-190.409z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m256 27.803h95.205v456.394h-95.205z\",\n fill: \"#cee5f5\"\n});\n\nfunction SvgFr(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgFr);\nexport default __webpack_public_path__ + \"static/media/fr.d0f9280c.svg\";\nexport { ForwardRef as ReactComponent };","import React, { Component } from 'react'\nimport { connect } from 'react-redux'\n\nimport { ReactComponent as EnFlag } from '../../images/flags/en.svg'\nimport { ReactComponent as FrFlag } from '../../images/flags/fr.svg'\nimport { updateLanguage } from '../../actions/index'\n\nexport const languages = [\n {\n name: 'en',\n selected: true,\n flag: ,\n },\n {\n name: 'fr',\n selected: false,\n flag: ,\n },\n]\n\nclass Dropdown extends Component {\n constructor(props) {\n super(props)\n this.state = {\n isOpen: false,\n }\n }\n\n toggleDropdown() {\n this.setState(prevState => ({\n isOpen: !prevState.isOpen,\n }))\n }\n\n render() {\n const { isOpen } = this.state\n const { language: selected, onUpdateLanguage } = this.props\n return (\n
this.toggleDropdown()}>\n
    \n {languages\n .filter(language =>\n isOpen ? language : language.name === selected\n )\n .map(language => (\n onUpdateLanguage(language.name, selected)}\n >\n {language.flag} {language.name}\n \n ))}\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n language: state.language,\n }),\n dispatch => ({\n onUpdateLanguage: (lang, selected) => {\n if (lang !== selected) {\n dispatch(updateLanguage(lang))\n }\n },\n })\n)(Dropdown)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { withTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport LanguageDropdown from './LanguageDropdown'\nimport { apiUrl } from '../../utils'\n\nclass NavBar extends React.PureComponent {\n render() {\n const { admin, isAuthenticated, picture, t, username } = this.props\n return (\n
\n
\n \n \n )\n }\n}\n\nexport default withTranslation()(\n connect(({ user }) => ({\n admin: user.admin,\n isAuthenticated: user.isAuthenticated,\n picture: user.picture,\n username: user.username,\n }))(NavBar)\n)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M468.683,287.265h-69.07c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h69.07 c4.147,0,7.508-3.361,7.508-7.508C476.191,290.626,472.83,287.265,468.683,287.265z\"\n})));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.012,268.377L85.781,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L58.034,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C109.507,275.266,108.499,270.62,105.012,268.377z\"\n})));\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M194.441,268.377L175.21,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.47,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.776l-17.471-11.243 c-3.487-2.245-8.133-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L147.463,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.47,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C198.936,275.266,197.928,270.62,194.441,268.377z\"\n})));\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M283.871,268.377L264.64,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.471-11.243 c-3.486-2.245-8.134-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L236.892,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.886-1.216,6.32-3.446C288.366,275.266,287.358,270.62,283.871,268.377z\"\n})));\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M373.3,268.377L354.069,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L326.322,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C377.795,275.266,376.787,270.62,373.3,268.377z\"\n})));\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M271.792,330.359H15.016V181.642h93.1c4.147,0,7.508-3.361,7.508-7.508c0-4.147-3.361-7.508-7.508-7.508H12.513 C5.613,166.626,0,172.24,0,179.14v153.722c0,6.9,5.613,12.513,12.513,12.513h259.278c4.147,0,7.508-3.361,7.508-7.508 C279.299,333.72,275.939,330.359,271.792,330.359z\"\n})));\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M499.487,166.626H162.174c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h334.811v148.716H323.848 c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h175.64c6.9,0,12.513-5.613,12.513-12.513V179.14 C512.001,172.24,506.387,166.626,499.487,166.626z\"\n})));\n\nfunction SvgPassword(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 512.001 512.001\",\n style: {\n enableBackground: \"new 0 0 512.001 512.001\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgPassword);\nexport default __webpack_public_path__ + \"static/media/password.afe6a2a5.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M339.798,260.429c0.13-0.026,0.257-0.061,0.385-0.094c0.109-0.028,0.219-0.051,0.326-0.084 c0.125-0.038,0.247-0.085,0.369-0.129c0.108-0.039,0.217-0.074,0.324-0.119c0.115-0.048,0.226-0.104,0.338-0.157 c0.109-0.052,0.22-0.1,0.327-0.158c0.107-0.057,0.208-0.122,0.312-0.184c0.107-0.064,0.215-0.124,0.319-0.194 c0.111-0.074,0.214-0.156,0.321-0.236c0.09-0.067,0.182-0.13,0.27-0.202c0.162-0.133,0.316-0.275,0.466-0.421 c0.027-0.026,0.056-0.048,0.083-0.075c0.028-0.028,0.052-0.059,0.079-0.088c0.144-0.148,0.284-0.3,0.416-0.46 c0.077-0.094,0.144-0.192,0.216-0.289c0.074-0.1,0.152-0.197,0.221-0.301c0.074-0.111,0.139-0.226,0.207-0.34 c0.057-0.096,0.118-0.19,0.171-0.289c0.062-0.115,0.114-0.234,0.169-0.351c0.049-0.104,0.101-0.207,0.146-0.314 c0.048-0.115,0.086-0.232,0.128-0.349c0.041-0.114,0.085-0.227,0.12-0.343c0.036-0.118,0.062-0.238,0.092-0.358 c0.029-0.118,0.063-0.234,0.086-0.353c0.028-0.141,0.045-0.283,0.065-0.425c0.014-0.1,0.033-0.199,0.043-0.3 c0.025-0.249,0.038-0.498,0.038-0.748V92.76c0-4.143-3.357-7.5-7.5-7.5h-236.25c-0.066,0-0.13,0.008-0.196,0.01 c-0.143,0.004-0.285,0.01-0.427,0.022c-0.113,0.009-0.225,0.022-0.337,0.037c-0.128,0.016-0.255,0.035-0.382,0.058 c-0.119,0.021-0.237,0.046-0.354,0.073c-0.119,0.028-0.238,0.058-0.356,0.092c-0.117,0.033-0.232,0.069-0.346,0.107 c-0.117,0.04-0.234,0.082-0.349,0.128c-0.109,0.043-0.216,0.087-0.322,0.135c-0.118,0.053-0.235,0.11-0.351,0.169 c-0.099,0.051-0.196,0.103-0.292,0.158c-0.116,0.066-0.23,0.136-0.343,0.208c-0.093,0.06-0.184,0.122-0.274,0.185 c-0.106,0.075-0.211,0.153-0.314,0.235c-0.094,0.075-0.186,0.152-0.277,0.231c-0.09,0.079-0.179,0.158-0.266,0.242 c-0.099,0.095-0.194,0.194-0.288,0.294c-0.047,0.05-0.097,0.094-0.142,0.145c-0.027,0.03-0.048,0.063-0.074,0.093 c-0.094,0.109-0.182,0.223-0.27,0.338c-0.064,0.084-0.13,0.168-0.19,0.254c-0.078,0.112-0.15,0.227-0.222,0.343 c-0.059,0.095-0.12,0.189-0.174,0.286c-0.063,0.112-0.118,0.227-0.175,0.342c-0.052,0.105-0.106,0.21-0.153,0.317 c-0.049,0.113-0.092,0.23-0.135,0.345c-0.043,0.113-0.087,0.225-0.124,0.339c-0.037,0.115-0.067,0.232-0.099,0.349 c-0.032,0.12-0.066,0.239-0.093,0.36c-0.025,0.113-0.042,0.228-0.062,0.342c-0.022,0.13-0.044,0.26-0.06,0.39 c-0.013,0.108-0.019,0.218-0.027,0.328c-0.01,0.14-0.019,0.28-0.021,0.421c-0.001,0.041-0.006,0.081-0.006,0.122v46.252 c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-29.595l66.681,59.037c-0.348,0.245-0.683,0.516-0.995,0.827l-65.687,65.687v-49.288 c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v9.164h-38.75c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h38.75v43.231 c0,4.143,3.357,7.5,7.5,7.5h236.25c0.247,0,0.494-0.013,0.74-0.037c0.115-0.011,0.226-0.033,0.339-0.049 C339.542,260.469,339.67,260.454,339.798,260.429z M330.834,234.967l-65.688-65.687c-0.042-0.042-0.087-0.077-0.13-0.117 l49.383-41.897c3.158-2.68,3.546-7.412,0.866-10.571c-2.678-3.157-7.41-3.547-10.571-0.866l-84.381,71.59l-98.444-87.158h208.965 V234.967z M185.878,179.888c0.535-0.535,0.969-1.131,1.308-1.765l28.051,24.835c1.418,1.255,3.194,1.885,4.972,1.885 c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5 S3.357,170.676,7.5,170.676z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5 S16.482,129.345,20.625,129.345z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z\"\n}));\n\nfunction SvgMailSend(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 345.834 345.834\",\n style: {\n enableBackground: \"new 0 0 345.834 345.834\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgMailSend);\nexport default __webpack_public_path__ + \"static/media/mail-send.619079f0.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport { ReactComponent as Password } from '../../images/password.svg'\nimport { ReactComponent as MailSend } from '../../images/mail-send.svg'\n\nexport default function PasswordReset(props) {\n const { t } = useTranslation()\n const { action } = props\n return (\n
\n
\n
\n
\n
\n
\n {action === 'sent' && (\n <>\n
\n \n
\n {t(\n // eslint-disable-next-line max-len\n \"user:Check your email. If your address is in our database, you'll received an email with a link to reset your password.\"\n )}\n \n )}\n {action === 'updated' && (\n <>\n
\n \n
\n \n {/* prettier-ignore */}\n Your password have been updated. Click\n here to log in.\n \n \n )}\n
\n
\n
\n
\n
\n
\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport TimezonePicker from 'react-timezone'\n\nimport Message from '../Common/Message'\nimport { deleteUser, handleProfileFormSubmit } from '../../actions/user'\nimport { history } from '../../index'\nimport { languages } from '../NavBar/LanguageDropdown'\nimport CustomModal from '../Common/CustomModal'\n\nclass ProfileEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.user !== this.props.user) {\n this.initForm()\n }\n }\n\n initForm() {\n const { user } = this.props\n const formData = {}\n Object.keys(user).map(k =>\n user[k] === null\n ? (formData[k] = '')\n : k === 'birth_date'\n ? (formData[k] = format(new Date(user[k]), 'yyyy-MM-DD'))\n : (formData[k] = user[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n if (e.target.name === 'weekm') {\n formData.weekm = e.target.value === 'Monday'\n } else {\n formData[e.target.name] = e.target.value\n }\n this.setState(formData)\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const {\n message,\n onDeleteUser,\n onHandleProfileFormSubmit,\n t,\n user,\n } = this.props\n const { displayModal, formData } = this.state\n return (\n
\n \n FitTrackee - {t('user:Profile Edition')}\n \n {formData.isAuthenticated && (\n
\n {displayModal && (\n {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n

{t('user:Profile Edition')}

\n
\n
\n
\n
\n
{user.username}
\n
\n
\n
\n {\n event.preventDefault()\n onHandleProfileFormSubmit(formData)\n }}\n >\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n \n {\n event.preventDefault()\n this.displayModal(true)\n }}\n >\n {t('user:Delete my account')}\n \n history.push('/profile')}\n >\n {t('common:Cancel')}\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n location: state.router.location,\n message: state.message,\n user: state.user,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username))\n },\n onHandleProfileFormSubmit: formData => {\n dispatch(handleProfileFormSubmit(formData))\n },\n })\n )(ProfileEdit)\n)\n","import {\n endOfMonth,\n endOfWeek,\n endOfYear,\n startOfMonth,\n startOfYear,\n startOfWeek,\n addMonths,\n addWeeks,\n addYears,\n subMonths,\n subWeeks,\n subYears,\n} from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport NoWorkouts from '../Common/NoWorkouts'\nimport Stats from '../Common/Stats'\nimport { workoutColors, translateSports } from '../../utils/workouts'\n\nconst durations = ['week', 'month', 'year']\n\nclass Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n displayedSports: props.sports.map(sport => sport.id),\n statsParams: {\n start: startOfMonth(subMonths(date, 11)),\n end: endOfMonth(date),\n duration: 'month',\n type: 'by_time',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.sports !== prevProps.sports) {\n this.updateDisplayedSports()\n }\n }\n\n updateDisplayedSports() {\n const { sports } = this.props\n this.setState({ displayedSports: sports.map(sport => sport.id) })\n }\n\n handleOnChangeDuration(e) {\n const duration = e.target.name\n\n const date = new Date()\n const start =\n duration === 'year'\n ? startOfYear(subYears(date, 9))\n : duration === 'week'\n ? startOfMonth(subMonths(date, 2))\n : startOfMonth(subMonths(date, 11))\n const end =\n duration === 'year'\n ? endOfYear(date)\n : duration === 'week'\n ? endOfWeek(date)\n : endOfMonth(date)\n this.setState({ statsParams: { duration, end, start, type: 'by_time' } })\n }\n\n handleOnChangeSports(sportId) {\n const { displayedSports } = this.state\n if (displayedSports.includes(sportId)) {\n this.setState({\n displayedSports: displayedSports.filter(s => s !== sportId),\n })\n } else {\n this.setState({ displayedSports: displayedSports.concat([sportId]) })\n }\n }\n\n handleOnClickArrows(forward) {\n const { start, end, duration } = this.state.statsParams\n let newStart, newEnd\n if (forward) {\n newStart =\n duration === 'year'\n ? startOfYear(subYears(start, 1))\n : duration === 'week'\n ? startOfWeek(subWeeks(start, 1))\n : startOfMonth(subMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(subYears(end, 1))\n : duration === 'week'\n ? endOfWeek(subWeeks(end, 1))\n : endOfMonth(subMonths(end, 1))\n } else {\n newStart =\n duration === 'year'\n ? startOfYear(addYears(start, 1))\n : duration === 'week'\n ? startOfWeek(addWeeks(start, 1))\n : startOfMonth(addMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(addYears(end, 1))\n : duration === 'week'\n ? endOfWeek(addWeeks(end, 1))\n : endOfMonth(addMonths(end, 1))\n }\n this.setState({\n statsParams: { duration, end: newEnd, start: newStart, type: 'by_time' },\n })\n }\n\n render() {\n const { displayedSports, statsParams } = this.state\n const { sports, t, user } = this.props\n const translatedSports = translateSports(\n sports.filter(sport => user.sports_list.includes(sport.id)),\n t\n )\n return (\n <>\n \n FitTrackee - {t('statistics:Statistics')}\n \n
\n
\n
{t('statistics:Statistics')}
\n \n
\n
\n

\n this.handleOnClickArrows(true)}\n />\n

\n
\n
\n {durations.map(d => (\n
\n \n
\n ))}\n
\n
\n

\n this.handleOnClickArrows(false)}\n />\n

\n
\n
\n \n
\n {translatedSports.map(sport => (\n \n ))}\n
\n
\n
\n {user.nb_workouts === 0 && }\n
\n \n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n sports: state.sports.data,\n user: state.user,\n }))(Statistics)\n)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Helmet } from 'react-helmet'\nimport { Link } from 'react-router-dom'\n\nimport { history } from '../../index'\n\nexport default function Form(props) {\n const { t } = useTranslation()\n const pageTitle = `user:${props.formType\n .charAt(0)\n .toUpperCase()}${props.formType.slice(1)}`\n return (\n
\n \n FitTrackee - {t(`user:${props.formType}`)}\n \n

{t(pageTitle)}

\n
\n
\n
\n
\n
\n {props.formType === 'register' && !props.isRegistrationAllowed ? (\n
\n
Registration is disabled.
\n
\n history.go(-1)}\n >\n Back\n \n
\n
\n ) : (\n <>\n \n props.handleUserFormSubmit(event, props.formType)\n }\n >\n {props.formType === 'register' && (\n
\n \n
\n )}\n {props.formType !== 'password reset' && (\n
\n \n
\n )}\n {props.formType !== 'reset your password' && (\n <>\n
\n \n
\n {props.formType !== 'login' && (\n
\n \n
\n )}\n \n )}\n \n \n

\n {props.formType === 'login' && (\n \n {t('user:Forgot password?')}\n \n )}\n

\n \n )}\n
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Redirect } from 'react-router-dom'\n\nimport Form from './Form'\nimport Message from '../Common/Message'\nimport { handleUserFormSubmit } from '../../actions/user'\nimport { isLoggedIn } from '../../utils'\n\nclass UserForm extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {\n username: '',\n email: '',\n password: '',\n password_conf: '',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.pathname !== this.props.location.pathname) {\n this.emptyForm()\n }\n }\n\n emptyForm() {\n const { formData } = this.state\n Object.keys(formData).map(k => (formData[k] = ''))\n this.setState(formData)\n }\n\n onHandleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = e.target.value\n this.setState(formData)\n }\n\n render() {\n const {\n formType,\n isRegistrationAllowed,\n message,\n messages,\n onHandleUserFormSubmit,\n t,\n } = this.props\n const { formData } = this.state\n const { token } = this.props.location.query\n return (\n
\n {isLoggedIn() || (formType === 'password reset' && !token) ? (\n \n ) : (\n
\n \n this.onHandleFormChange(event)}\n handleUserFormSubmit={event => {\n event.preventDefault()\n if (formType === 'password reset') {\n formData.token = token\n }\n onHandleUserFormSubmit(formData, formType)\n }}\n />\n
\n )}\n
\n )\n }\n}\nexport default withTranslation()(\n connect(\n state => ({\n isRegistrationAllowed: state.application.config.is_registration_enabled,\n location: state.router.location,\n message: state.message,\n messages: state.messages,\n }),\n dispatch => ({\n onHandleUserFormSubmit: (formData, formType) => {\n formType =\n formType === 'password reset'\n ? 'password/update'\n : formType === 'reset your password'\n ? 'password/reset-request'\n : formType\n dispatch(handleUserFormSubmit(formData, formType))\n },\n })\n )(UserForm)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../Common/CustomModal'\nimport ProfileDetail from './ProfileDetail'\nimport { getOrUpdateData } from '../../actions'\nimport { deleteUser } from '../../actions/user'\n\nclass UserProfile extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.props.loadUser(this.props.match.params.userName)\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.match.params.userName !== this.props.match.params.userName) {\n this.props.loadUser(this.props.match.params.userName)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const { t, currentUser, onDeleteUser, users } = this.props\n const { displayModal } = this.state\n const [user] = users\n const editable = user ? currentUser.username === user.username : false\n return (\n
\n {displayModal && (\n {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {user && (\n this.displayModal(e)}\n t={t}\n user={user}\n />\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n currentUser: state.user,\n users: state.users.data,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username, true))\n },\n loadUser: userName => {\n dispatch(getOrUpdateData('getData', 'users', { username: userName }))\n },\n })\n )(UserProfile)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport './App.css'\nimport Admin from './Admin'\nimport Workout from './Workout'\nimport Workouts from './Workouts'\nimport CurrentUserProfile from './User/CurrentUserProfile'\nimport Dashboard from './Dashboard'\nimport Footer from './Footer'\nimport Logout from './User/Logout'\nimport NavBar from './NavBar'\nimport NotFound from './Others/NotFound'\nimport PasswordReset from './User/PasswordReset'\nimport ProfileEdit from './User/ProfileEdit'\nimport Statistics from './Statistics'\nimport UserForm from './User/UserForm'\nimport UserProfile from './User/UserProfile'\nimport { getAppData } from '../actions/application'\n\nclass App extends React.Component {\n constructor(props) {\n super(props)\n this.props = props\n }\n componentDidMount() {\n this.props.loadAppConfig()\n }\n\n render() {\n return (\n
\n \n \n \n }\n />\n }\n />\n }\n />\n }\n />\n }\n />\n }\n />\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n )\n }\n}\nexport default connect(\n () => ({}),\n dispatch => ({\n loadAppConfig: () => {\n dispatch(getAppData('config'))\n },\n })\n)(App)\n","import React from 'react'\nimport { Provider } from 'react-redux'\nimport { ConnectedRouter } from 'connected-react-router'\n\nexport default function Root({ store, history, children }) {\n return (\n \n {children}\n \n )\n}\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n)\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location)\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets;\n // see https://github.com/facebookincubator/create-react-app/issues/2374\n return\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`\n\n if (isLocalhost) {\n // This is running on localhost.\n // Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl)\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl)\n }\n })\n }\n}\n\nfunction registerValidSW(swUrl) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n // eslint-disable-next-line no-console\n console.log('New content is available; please refresh.')\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n // eslint-disable-next-line no-console\n console.log('Content is cached for offline use.')\n }\n }\n }\n }\n })\n .catch(error => {\n console.error('Error during service worker registration:', error)\n })\n}\n\nfunction checkValidServiceWorker(swUrl) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload()\n })\n })\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl)\n }\n })\n .catch(() => {\n // eslint-disable-next-line no-console\n console.log(\n 'No internet connection found. App is running in offline mode.'\n )\n })\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister()\n })\n }\n}\n","const emptyData = {\n data: [],\n}\n\nexport default {\n language: 'en',\n message: '',\n messages: [],\n user: {\n isAuthenticated: false,\n },\n workouts: {\n ...emptyData,\n },\n application: {\n statistics: {},\n config: {\n gpx_limit_import: null,\n is_registration_enabled: null,\n max_single_file_size: null,\n max_users: null,\n max_zip_file_size: null,\n registration: null,\n },\n },\n calendarWorkouts: {\n ...emptyData,\n },\n chartData: [],\n // check if storing gpx content is OK\n gpx: null,\n loading: false,\n records: {\n ...emptyData,\n },\n sports: {\n ...emptyData,\n },\n statistics: {\n data: {},\n },\n users: {\n ...emptyData,\n },\n}\n","import { connectRouter } from 'connected-react-router'\nimport { combineReducers } from 'redux'\n\nimport initial from './initial'\n\nconst handleDataAndError = (state, type, action) => {\n if (action.target !== type) {\n return state\n }\n if (action.type === 'SET_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n }\n }\n if (action.type === 'SET_PAGINATED_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n pagination: action.pagination,\n }\n }\n return state\n}\n\nconst workouts = (state = initial.workouts, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.workouts\n case 'PUSH_WORKOUTS':\n return {\n ...state,\n data: state.data.concat(action.workouts),\n }\n case 'REMOVE_WORKOUT':\n return {\n ...state,\n data: state.data.filter(workout => workout.id !== action.workoutId),\n }\n default:\n return handleDataAndError(state, 'workouts', action)\n }\n}\n\nconst application = (state = initial.application, action) => {\n if (action.type === 'SET_APP_CONFIG') {\n return {\n ...state,\n config: action.data,\n }\n }\n if (action.type === 'SET_APP_STATS') {\n return {\n ...state,\n statistics: action.data,\n }\n }\n return state\n}\n\nconst calendarWorkouts = (state = initial.calendarWorkouts, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.calendarWorkouts\n case 'UPDATE_CALENDAR':\n return {\n ...state,\n data: action.workouts,\n }\n default:\n return handleDataAndError(state, 'calendarWorkouts', action)\n }\n}\n\nconst chartData = (state = initial.chartData, action) => {\n if (action.type === 'SET_CHART_DATA') {\n return action.chartData\n }\n return state\n}\n\nconst gpx = (state = initial.gpx, action) => {\n if (action.type === 'SET_GPX') {\n return action.gpxContent\n }\n return state\n}\n\nconst language = (state = initial.language, action) => {\n if (action.type === 'SET_LANGUAGE') {\n return action.language\n }\n return state\n}\n\nconst loading = (state = initial.loading, action) => {\n if (action.type === 'SET_LOADING') {\n return action.loading\n }\n return state\n}\n\nconst message = (state = initial.message, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'PROFILE_UPDATE_ERROR':\n case 'PICTURE_ERROR':\n case 'SET_ERROR':\n return action.message\n case 'CLEAN_ALL_MESSAGES':\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case 'SET_APP_CONFIG':\n case 'SET_RESULTS':\n case '@@router/LOCATION_CHANGE':\n return ''\n default:\n return state\n }\n}\n\nconst messages = (state = initial.messages, action) => {\n switch (action.type) {\n case 'AUTH_ERRORS':\n case 'APP_ERRORS':\n return action.messages\n case 'CLEAN_ALL_MESSAGES':\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case '@@router/LOCATION_CHANGE':\n return []\n default:\n return state\n }\n}\n\nconst records = (state = initial.records, action) => {\n if (action.type === 'LOGOUT') {\n return initial.records\n }\n return handleDataAndError(state, 'records', action)\n}\n\nconst sports = (state = initial.sports, action) => {\n if (action.type === 'UPDATE_SPORT_DATA') {\n return {\n ...state,\n data: state.data.map(sport => {\n if (sport.id === action.data.id) {\n sport.is_active = action.data.is_active\n }\n return sport\n }),\n }\n }\n return handleDataAndError(state, 'sports', action)\n}\n\nconst users = (state = initial.users, action) => {\n if (action.type === 'UPDATE_USER_DATA') {\n return {\n ...state,\n data: state.data.map(user => {\n if (user.username === action.data.username) {\n user.admin = action.data.admin\n }\n return user\n }),\n }\n }\n return handleDataAndError(state, 'users', action)\n}\n\nconst user = (state = initial.user, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'LOGOUT':\n window.localStorage.removeItem('authToken')\n return initial.user\n case 'PROFILE_SUCCESS':\n return action.profil\n default:\n return state\n }\n}\n\nconst statistics = (state = initial.statistics, action) => {\n if (action.type === 'LOGOUT') {\n return initial.statistics\n }\n return handleDataAndError(state, 'statistics', action)\n}\n\nexport default history =>\n combineReducers({\n workouts,\n application,\n calendarWorkouts,\n chartData,\n gpx,\n language,\n loading,\n message,\n messages,\n records,\n router: connectRouter(history),\n sports,\n statistics,\n user,\n users,\n })\n","const routesWithoutAuthentication = [\n '/login',\n '/register',\n '/password-reset',\n '/password-reset/request',\n '/password-reset/sent',\n '/updated-password',\n]\n\nconst updatePath = (toPath, newPath) => {\n if (typeof toPath === 'string' || toPath instanceof String) {\n toPath = newPath\n } else {\n toPath.pathname = newPath\n }\n return toPath\n}\n\nconst pathInterceptor = toPath => {\n if (\n !window.localStorage.authToken &&\n !routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/login')\n }\n if (\n window.localStorage.authToken &&\n routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/')\n }\n return toPath\n}\n\nexport const historyEnhancer = originalHistory => {\n originalHistory.location = pathInterceptor(originalHistory.location)\n return {\n ...originalHistory,\n push: (path, ...args) =>\n originalHistory.push(pathInterceptor(path), ...args),\n replace: (path, ...args) =>\n originalHistory.replace(pathInterceptor(path), ...args),\n }\n}\n","/* eslint-disable react/jsx-filename-extension */\nimport { createBrowserHistory } from 'history'\nimport React from 'react'\nimport { I18nextProvider } from 'react-i18next'\nimport ReactDOM from 'react-dom'\nimport { routerMiddleware } from 'connected-react-router'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport thunk from 'redux-thunk'\n\nimport i18n from './i18n'\nimport App from './components/App'\nimport Root from './components/Root'\nimport registerServiceWorker from './registerServiceWorker'\nimport createRootReducer from './reducers'\nimport { loadProfile } from './actions/user'\nimport { historyEnhancer } from './utils/history'\n\nexport const history = historyEnhancer(createBrowserHistory())\n\nhistory.listen(() => {\n window.scrollTo(0, 0)\n})\n\nexport const rootNode = document.getElementById('root')\n\nexport const store = createStore(\n createRootReducer(history),\n window.__STATE__, // Server state\n (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose)(\n applyMiddleware(routerMiddleware(history), thunk)\n )\n)\n\nif (window.localStorage.authToken !== null) {\n store.dispatch(loadProfile())\n}\n\nReactDOM.render(\n \n \n \n \n ,\n rootNode\n)\nregisterServiceWorker()\n"],"sourceRoot":""} \ No newline at end of file diff --git a/fittrackee/dist/static/js/main.7c5c861a.chunk.js.map b/fittrackee/dist/static/js/main.7c5c861a.chunk.js.map deleted file mode 100644 index 635723b0..00000000 --- a/fittrackee/dist/static/js/main.7c5c861a.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["locales/fr/resources.js","locales/index.js","locales/en/resources.js","i18n.js","components/Common/Message.jsx","utils/index.js","fitTrackeeApi/index.js","actions/index.js","actions/application.js","components/Admin/AdminApplication.jsx","components/Admin/AdminStats.jsx","components/Admin/AdminDashboard.jsx","components/Admin/AdminSports.jsx","components/Common/Pagination.jsx","components/Admin/AdminUsers.jsx","components/Others/NotFound.jsx","components/Admin/index.jsx","utils/workouts.js","fitTrackeeApi/auth.js","actions/user.js","actions/workouts.js","components/Workout/WorkoutForms/FormWithGpx.jsx","components/Workout/WorkoutForms/FormWithoutGpx.jsx","components/Workout/WorkoutAddOrEdit.jsx","components/Workout/WorkoutAdd.jsx","components/Common/CustomModal.jsx","components/Workout/WorkoutDisplay/WorkoutCardHeader.jsx","components/Workout/WorkoutDisplay/WorkoutCharts.jsx","components/Workout/WorkoutDisplay/WorkoutWeather.jsx","components/Workout/WorkoutDisplay/WorkoutDetails.jsx","components/Workout/WorkoutDisplay/Map.jsx","components/Workout/WorkoutDisplay/WorkoutMap.jsx","components/Workout/WorkoutDisplay/WorkoutNoMap.jsx","components/Workout/WorkoutDisplay/WorkoutNotes.jsx","components/Workout/WorkoutDisplay/WorkoutSegments.jsx","components/Workout/WorkoutDisplay/index.jsx","components/Workout/WorkoutEdit.jsx","components/Workout/index.jsx","components/Common/NoWorkouts.jsx","components/Workouts/WorkoutsFilter.jsx","components/Common/StaticMap.jsx","components/Workouts/WorkoutsList.jsx","components/Workouts/index.jsx","components/User/ProfileDetail.jsx","components/User/CurrentUserProfile.jsx","components/Dashboard/CalendarWorkout.jsx","components/Dashboard/CalendarWorkouts.jsx","components/Dashboard/Calendar.jsx","components/Dashboard/Records.jsx","utils/stats.js","components/Common/Stats/CustomTooltip.jsx","components/Common/Stats/CustomLabel.jsx","components/Common/Stats/StatsChart.jsx","components/Common/Stats/index.jsx","actions/stats.js","components/Dashboard/Statistics.jsx","components/Dashboard/UserStatistics.jsx","components/Dashboard/WorkoutCard.jsx","components/Dashboard/index.jsx","components/Footer/index.jsx","components/User/Logout.jsx","images/flags/en.svg","images/flags/fr.svg","components/NavBar/LanguageDropdown.jsx","components/NavBar/index.jsx","images/password.svg","images/mail-send.svg","components/User/PasswordReset.jsx","components/User/ProfileEdit.jsx","components/Statistics/index.jsx","components/User/Form.jsx","components/User/UserForm.jsx","components/User/UserProfile.jsx","components/App.jsx","components/Root.jsx","registerServiceWorker.js","reducers/initial.js","reducers/index.js","utils/history.js","index.js"],"names":["resources","en","workouts","administration","common","dashboard","messages","sports","statistics","user","fr","i18n","use","XHR","LanguageDetector","init","debug","process","lng","fallbackLng","keySeparator","interpolation","escapeValue","ns","defaultNS","Message","React","PureComponent","render","this","props","message","t","singleMessage","split","length","className","map","msg","value","id","suffixes","getFileSize","fileSize","asText","i","Math","floor","log","size","suffix","pow","toFixed","apiUrl","userFilters","key","label","sortOrders","isLoggedIn","window","localStorage","authToken","createApiRequest","params","headers","noAuthorization","Authorization","getItem","type","requestParams","method","body","JSON","stringify","request","Request","url","fetch","then","response","status","json","catch","error","console","Error","getDateWithTZ","date","tz","dt","DateTime","fromISO","format","Date","setZone","parse","toFormat","sortValues","a","b","valueALabel","toLowerCase","valueBLabel","translateValues","values","sort","formatUrl","pathname","query","username","Object","keys","filter","index","FitTrackeeApi","target","data","setData","setError","setLoading","loading","getOrUpdateData","action","canDispatch","dispatch","isNaN","ret","pagination","setPaginatedData","updateSportsData","updateUsersData","users","updateLanguage","language","i18next","changeLanguage","setLanguage","setAppConfig","getAppData","FitTrackeeGenericApi","getData","AdminApplication","Component","constructor","context","super","state","formData","componentDidMount","initForm","componentDidUpdate","prevProps","appConfig","k","includes","setState","handleFormChange","e","name","isInEdition","loadAppConfig","onHandleConfigFormSubmit","onSubmit","preventDefault","htmlFor","aria-hidden","title","min","max_users","onChange","step","max_single_file_size","max_zip_file_size","gpx_limit_import","onClick","history","push","connect","assign","updateData","updateAppConfig","AdminStats","loadAppStats","appStats","uploadDirSize","uploads_dir_size","withTranslation","application","AdminDashboard","to","is_registration_enabled","AdminSports","loadSports","updateSport","sport","src","img","alt","is_active","data-toggle","has_workouts","sportId","isActive","Pagination","getUrl","newQuery","page","aria-label","has_prev","aria-disabled","pages","Array","from","_","has_next","AdminUsers","per_page","order_by","order","loadUsers","initState","location","updatePage","authUser","updateUser","translatedFilters","translatedSortOrders","picture","now","email","created_at","nb_workouts","admin","disabled","router","userName","isAdmin","NotFound","useTranslation","Helmet","config","exact","path","component","workoutColors","recordsLabels","record_type","formatWorkoutDate","dateTime","dateFormat","timeFormat","workout_date","workout_time","formatWorkoutDuration","seconds","newDate","subHours","setSeconds","getTime","formatChartData","chartData","time","duration","sortSports","sportALabel","sportBLabel","translateSports","onlyActive","PictureError","ProfileUpdateError","loadProfile","getProfile","isAuthenticated","profil","handleUserFormSubmit","formType","onlyPasswords","errMsg","password","password_conf","RegisterFormControl","arr","val","obj","generateIds","loginOrRegisterOrPasswordReset","setItem","auth_token","deleteUser","deleteData","r","setGpx","gpxContent","setChartData","editWorkout","form","getMoreWorkouts","onAddWorkout","FormData","append","gpxFile","files","notes","addDataWithFile","addWorkout","onEditWorkout","workout","sport_id","translatedSports","zipTooltip","fileSizeLimit","encType","event","defaultValue","required","Trans","i18nKey","data-placement","accept","maxLength","onAddOrEdit","d","distance","addData","workoutDate","workoutTime","workoutDateTime","timezone","pattern","placeholder","WorkoutAddEdit","withGpx","handleRadioChange","changeEvent","with_gpx","checked","WorkoutAddOrEdit","CustomModal","close","text","confirm","WorkoutCardHeader","dataType","displayModal","segmentId","previousUrl","previous_workout","nextUrl","segments","next_workout","WorkoutCharts","displayDistance","dataToHide","loadWorkoutData","loadSegmentData","componentWillUnmount","handleLegendChange","find","splice","indexOf","displayData","updateCoordinates","xInterval","parseInt","xDataKey","xScale","height","margin","top","right","left","bottom","onMouseMove","activePayload","onMouseLeave","allowDecimals","dataKey","offset","position","scale","interval","tickFormatter","angle","yAxisId","orientation","fill","stroke","dot","unit","strokeWidth","labelFormatter","workoutId","chart_data","getWorkoutChartData","getSegmentChartData","WorkoutWeather","weather_start","weather_end","icon","summary","Number","temperature","humidity","wind","WorkoutDetails","withPauses","pauses","moving","records","record","ave_speed","max_speed","min_alt","max_alt","ascent","descent","Map","bounds","coordinates","jsonData","mapAttribution","useMap","fitBounds","TileLayer","attribution","GeoJSON","hash","latitude","Marker","longitude","WorkoutMap","zoom","loadWorkoutGpx","loadSegmentGpx","gpx","DOMParser","parseFromString","togeojson","getGeoJson","MapContainer","boundsOptions","padding","map_attribution","getWorkoutGpx","getSegmentGpx","WorkoutNoMap","WorkoutNotes","WorkoutSegments","segment","workout_id","WorkoutDisplay","loadWorkout","match","prevState","payload","onDeleteWorkout","s","Promise","resolve","WorkoutEdit","WorkoutAdd","NoWorkouts","WorkoutsFilter","loadWorkouts","updateParams","StaticMap","display","href","rel","WorkoutsList","scope","idx","Workouts","setParams","loadMoreWorkouts","paginationEnd","onDeletePicture","deletePicture","onUploadPicture","reset","uploadPicture","editable","isDeletable","createdAt","birthDate","birth_date","first_name","last_name","bio","weekm","go","CalendarWorkout","isDisabled","isMore","sportImg","rec","CalendarWorkouts","isHidden","handleDisplayMore","dayWorkouts","act","getStartAndEndMonth","weekStartOnMonday","monthStart","startOfMonth","monthEnd","endOfMonth","weekStartsOn","start","startOfWeek","end","endOfWeek","Calendar","calendarDate","currentMonth","startDate","endDate","loadMonthWorkouts","renderHeader","localeOptions","handlePrevMonth","handleNextMonth","renderDays","days","addDays","filterWorkouts","day","isSameDay","renderCells","rows","formattedDate","isSameMonth","isWeekEnd","isToday","updateStateDate","addMonths","subMonths","locale","enGB","calendarWorkouts","RecordsCard","recordsBySport","reduce","sportList","recordType","formatRecord","sportLabel","colSpan","xAxisFormats","xAxis","formatDuration","totalSeconds","formatWithDay","String","hours","padStart","minutes","formatValue","displayedData","dateIncrement","addYears","formatStats","stats","displayedSports","nbWorkoutsStats","distanceStats","durationStats","startOfYear","x","xAxisFormat","dataNbWorkouts","dataDistance","dataDuration","total_distance","total_duration","CustomTooltip","active","total","p","style","color","CustomLabel","y","width","formattedValue","fontSize","textAnchor","dominantBaseline","StatsCharts","content","isAnimationActive","stackId","Statistics","statsParams","displayEmpty","getStats","Stats","UserStatistics","nb_sports","WorkoutCard","DashBoard","Footer","Logout","UserLogout","_extends","arguments","source","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","_ref14","SvgEn","_ref","svgRef","titleId","enableBackground","viewBox","xmlns","ref","ForwardRef","SvgFr","languages","selected","flag","Dropdown","isOpen","toggleDropdown","onUpdateLanguage","lang","NavBar","data-target","aria-controls","aria-expanded","LanguageDropdown","SvgPassword","xmlnsXlink","xmlSpace","SvgMailSend","PasswordReset","ProfileEdit","onDeleteUser","onHandleProfileFormSubmit","readOnly","postData","handleProfileFormSubmit","durations","updateDisplayedSports","handleOnChangeDuration","subYears","endOfYear","handleOnChangeSports","concat","handleOnClickArrows","forward","newStart","newEnd","subWeeks","addWeeks","sports_list","Form","pageTitle","charAt","toUpperCase","slice","isRegistrationAllowed","userForm","onHandleFormChange","UserForm","emptyForm","onHandleUserFormSubmit","token","UserProfile","loadUser","currentUser","App","Dashboard","CurrentUserProfile","Workout","Admin","Root","store","children","isLocalhost","Boolean","hostname","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","emptyData","handleDataAndError","initial","removeItem","routesWithoutAuthentication","updatePath","toPath","newPath","pathInterceptor","originalHistory","createBrowserHistory","args","replace","listen","scrollTo","rootNode","document","getElementById","createStore","combineReducers","connectRouter","__STATE__","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","applyMiddleware","routerMiddleware","thunk","ReactDOM","I18nextProvider","URL","origin","addEventListener","get","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"mg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MAApBA,EAASC,SACuD,IAAhED,EAASf,QAAQ2qB,IAAI,gBAAgBpY,QAAQ,cAG7C2V,UAAUC,cAAcyC,MAAM9pB,MAAKunB,IACjCA,EAAawC,aAAa/pB,MAAK,KAC7BnB,OAAOkK,SAASihB,eAKpB9C,GAAgBC,MAGnB/mB,OAAM,KAELE,QAAQpC,IACN,oEA/DA+rB,CAAwB9C,GAGxBD,GAAgBC,OIIxB+C,K","file":"static/js/main.7c5c861a.chunk.js","sourcesContent":["import FrWorkoutsTranslations from './workouts.json'\nimport FrAdministrationTranslations from './administration.json'\nimport FrCommonTranslations from './common.json'\nimport FrDashboardTranslations from './dashboard.json'\nimport FrMessagesTranslations from './messages.json'\nimport FrSportsTranslations from './sports.json'\nimport FrStatisticsTranslations from './statistics.json'\nimport FrUserTranslations from './user.json'\n\nexport const frResources = {\n workouts: FrWorkoutsTranslations,\n administration: FrAdministrationTranslations,\n common: FrCommonTranslations,\n dashboard: FrDashboardTranslations,\n messages: FrMessagesTranslations,\n sports: FrSportsTranslations,\n statistics: FrStatisticsTranslations,\n user: FrUserTranslations,\n}\n","import { enResources } from './en/resources'\nimport { frResources } from './fr/resources'\n\nexport const resources = {\n en: enResources,\n fr: frResources,\n}\n","import EnWorkoutsTranslations from './workouts.json'\nimport EnAdministrationTranslations from './administration.json'\nimport EnCommonTranslations from './common.json'\nimport EnDashboardTranslations from './dashboard.json'\nimport EnMessagesTranslations from './messages.json'\nimport EnSportsTranslations from './sports.json'\nimport EnStatisticsTranslations from './statistics.json'\nimport EnUserTranslations from './user.json'\n\nexport const enResources = {\n workouts: EnWorkoutsTranslations,\n administration: EnAdministrationTranslations,\n common: EnCommonTranslations,\n dashboard: EnDashboardTranslations,\n messages: EnMessagesTranslations,\n sports: EnSportsTranslations,\n statistics: EnStatisticsTranslations,\n user: EnUserTranslations,\n}\n","import i18n from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport XHR from 'i18next-xhr-backend'\n\nimport { resources } from './locales'\n\ni18n\n .use(XHR)\n .use(LanguageDetector)\n .init({\n debug: process.env.NODE_ENV === 'development',\n lng: 'en',\n fallbackLng: 'en',\n keySeparator: false,\n interpolation: {\n escapeValue: false,\n },\n resources,\n ns: ['common'],\n defaultNS: 'common',\n })\n\nexport default i18n\n","import React from 'react'\n\nexport default class Message extends React.PureComponent {\n render() {\n const { message, messages, t } = this.props\n const singleMessage =\n message === '' || !message\n ? ''\n : message.split('|').length > 1\n ? `${t(`messages:${message.split('|')[0]}`)}: ${t(\n `messages:${message.split('|')[1]}`\n )}`\n : t(`messages:${message}`)\n return (\n
\n {singleMessage !== '' && {singleMessage}}\n {messages && messages.length > 0 && (\n \n
    \n {messages.map(msg => (\n
  • {t(`messages:${msg.value}`)}
  • \n ))}\n
\n
\n )}\n
\n )\n }\n}\n","import { format, parse } from 'date-fns'\nimport { DateTime } from 'luxon'\n\nconst suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB']\nexport const getFileSize = (fileSize, asText = true) => {\n const i = Math.floor(Math.log(fileSize) / Math.log(1024))\n if (!fileSize) {\n return asText ? '0 bytes' : { size: 0, suffix: 'bytes' }\n }\n const size = (fileSize / Math.pow(1024, i)).toFixed(1)\n const suffix = suffixes[i]\n return asText ? `${size}${suffix}` : { size, suffix }\n}\n\nexport const getFileSizeInMB = fileSize => {\n const value = fileSize / 1048576\n return (!fileSize && 0) || +value.toFixed(2)\n}\n\nexport const version = '0.4.5' // version stored in 'utils' for now\nexport const apiUrl =\n process.env.NODE_ENV === 'production'\n ? '/api/'\n : `${process.env.REACT_APP_API_URL}/api/`\n\nexport const userFilters = [\n { key: 'workouts_count', label: 'workouts count' },\n { key: 'admin', label: 'admin rights' },\n { key: 'created_at', label: 'registration date' },\n { key: 'username', label: 'user name' },\n]\n\nexport const sortOrders = [\n { key: 'asc', label: 'ascending' },\n { key: 'desc', label: 'descending' },\n]\n\nexport const isLoggedIn = () => !!window.localStorage.authToken\n\nexport const generateIds = arr => {\n let i = 0\n return arr.map(val => {\n const obj = { id: i, value: val }\n i++\n return obj\n })\n}\n\nexport const createApiRequest = params => {\n const headers = {}\n if (!params.noAuthorization) {\n headers.Authorization = `Bearer ${window.localStorage.getItem('authToken')}`\n }\n if (params.type) {\n headers['Content-Type'] = params.type\n }\n const requestParams = {\n method: params.method,\n headers: headers,\n }\n if (params.type === 'application/json' && params.body) {\n requestParams.body = JSON.stringify(params.body)\n } else if (params.body) {\n requestParams.body = params.body\n }\n const request = new Request(`${apiUrl}${params.url}`, requestParams)\n return fetch(request)\n .then(response =>\n params.method === 'DELETE' || response.status === 413\n ? response\n : response.json()\n )\n .catch(error => {\n console.error(error)\n return new Error('An error occurred. Please contact the administrator.')\n })\n}\n\nexport const getDateWithTZ = (date, tz) => {\n if (!date) {\n return ''\n }\n const dt = DateTime.fromISO(\n format(new Date(date), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n ).setZone(tz)\n return parse(\n dt.toFormat('yyyy-MM-dd HH:mm:ss'),\n 'yyyy-MM-dd HH:mm:ss',\n new Date()\n )\n}\n\nexport const capitalize = target =>\n target.charAt(0).toUpperCase() + target.slice(1)\n\nexport const rangePagination = pages =>\n Array.from({ length: pages }, (_, i) => i + 1)\n\nconst sortValues = (a, b) => {\n const valueALabel = a.label.toLowerCase()\n const valueBLabel = b.label.toLowerCase()\n return valueALabel > valueBLabel ? 1 : valueALabel < valueBLabel ? -1 : 0\n}\n\nexport const translateValues = (t, values, key = 'common') =>\n values\n .map(value => ({\n ...value,\n label: t(`${key}:${value.label}`),\n }))\n .sort(sortValues)\n\nexport const formatUrl = (pathname, query) => {\n let url = pathname\n if (query.id || (pathname === 'users' && query.username)) {\n url = `${url}/${query.username ? query.username : query.id}`\n } else if (Object.keys(query).length > 0) {\n url += '?'\n Object.keys(query)\n .filter(key => query[key])\n .map(\n (key, index) => (url += `${index === 0 ? '' : '&'}${key}=${query[key]}`)\n )\n }\n return url\n}\n","import { createApiRequest, formatUrl } from '../utils'\n\nexport default class FitTrackeeApi {\n static getData(target, data = {}) {\n const url = formatUrl(target, data)\n const params = {\n url: url,\n method: 'GET',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addData(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addDataWithFile(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n }\n return createApiRequest(params)\n }\n\n static postData(target, data) {\n const params = {\n url: `${target}${data.id ? `/${data.id}` : ''}`,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static updateData(target, data) {\n const params = {\n url: `${target}${\n data.id ? `/${data.id}` : data.username ? `/${data.username}` : ''\n }`,\n method: 'PATCH',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deleteData(target, id) {\n const params = {\n url: `${target}/${id}`,\n method: 'DELETE',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n}\n","import i18next from 'i18next'\n\nimport FitTrackeeApi from '../fitTrackeeApi/index'\nimport { history } from '../index'\n\nexport const setData = (target, data) => ({\n type: 'SET_DATA',\n data,\n target,\n})\nexport const setPaginatedData = (target, data, pagination) => ({\n type: 'SET_PAGINATED_DATA',\n data,\n pagination,\n target,\n})\n\nexport const setError = message => ({\n type: 'SET_ERROR',\n message,\n})\n\nexport const setLanguage = language => ({\n type: 'SET_LANGUAGE',\n language,\n})\n\nexport const setLoading = loading => ({\n type: 'SET_LOADING',\n loading,\n})\n\nexport const updateSportsData = data => ({\n type: 'UPDATE_SPORT_DATA',\n data,\n})\n\nexport const updateUsersData = data => ({\n type: 'UPDATE_USER_DATA',\n data,\n})\n\nexport const getOrUpdateData = (\n action,\n target,\n data,\n canDispatch = true\n) => dispatch => {\n dispatch(setLoading(true))\n if (data && data.id && target !== 'workouts' && isNaN(data.id)) {\n dispatch(setLoading(false))\n return dispatch(setError(`${target}|Incorrect id`))\n }\n dispatch(setError(''))\n return FitTrackeeApi[action](target, data)\n .then(ret => {\n if (ret.status === 'success') {\n if (canDispatch) {\n if (target === 'users' && action === 'getData') {\n return dispatch(setPaginatedData(target, ret.data, ret.pagination))\n }\n dispatch(setData(target, ret.data))\n } else if (action === 'updateData' && target === 'sports') {\n dispatch(updateSportsData(ret.data.sports[0]))\n } else if (action === 'updateData' && target === 'users') {\n dispatch(updateUsersData(ret.data.users[0]))\n }\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`${target}|${error}`))\n })\n}\n\nexport const addData = (target, data) => dispatch =>\n FitTrackeeApi.addData(target, data)\n .then(ret => {\n if (ret.status === 'created') {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n\nexport const deleteData = (target, id) => dispatch => {\n if (isNaN(id)) {\n return dispatch(setError(target, `${target}|Incorrect id`))\n }\n return FitTrackeeApi.deleteData(target, id)\n .then(ret => {\n if (ret.status === 204) {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n}\n\nexport const updateLanguage = language => dispatch => {\n i18next.changeLanguage(language).then(dispatch(setLanguage(language)))\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { history } from '../index'\nimport { setError } from './index'\n\nexport const setAppConfig = data => ({\n type: 'SET_APP_CONFIG',\n data,\n})\n\nexport const setAppStats = data => ({\n type: 'SET_APP_STATS',\n data,\n})\n\nexport const getAppData = target => dispatch =>\n FitTrackeeGenericApi.getData(target)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'config') {\n dispatch(setAppConfig(ret.data))\n } else if (target === 'stats/all') {\n dispatch(setAppStats(ret.data))\n }\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n\nexport const updateAppConfig = formData => dispatch =>\n FitTrackeeGenericApi.updateData('config', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setAppConfig(ret.data))\n history.push('/admin/application')\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { getAppData, updateAppConfig } from '../../actions/application'\nimport { history } from '../../index'\nimport { getFileSizeInMB } from '../../utils'\n\nclass AdminApplication extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.appConfig !== prevProps.appConfig) {\n this.initForm()\n }\n }\n\n initForm() {\n const { appConfig } = this.props\n const formData = {}\n Object.keys(appConfig).map(k =>\n appConfig[k] === null\n ? (formData[k] = '')\n : ['max_single_file_size', 'max_zip_file_size'].includes(k)\n ? (formData[k] = getFileSizeInMB(appConfig[k]))\n : (formData[k] = appConfig[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = +e.target.value\n this.setState(formData)\n }\n\n render() {\n const {\n isInEdition,\n loadAppConfig,\n message,\n onHandleConfigFormSubmit,\n t,\n } = this.props\n const { formData } = this.state\n return (\n
\n {message && }\n {Object.keys(formData).length > 0 && (\n
\n
\n
\n
\n \n {t('administration:Application configuration')}\n \n
\n
\n {\n e.preventDefault()\n onHandleConfigFormSubmit(formData)\n }}\n >\n
\n \n {t(\n // eslint-disable-next-line max-len\n 'administration:Max. number of active users'\n )}\n \n \n \n :\n \n this.handleFormChange(e)}\n />\n
\n
\n \n {t(\n 'administration:Max. size of uploaded files (in Mb)'\n )}\n :\n \n this.handleFormChange(e)}\n />\n
\n
\n \n {t('administration:Max. size of zip archive (in Mb)')}:\n \n this.handleFormChange(e)}\n />\n
\n
\n \n {t('administration:Max. files of zip archive')}\n \n this.handleFormChange(e)}\n />\n
\n {isInEdition ? (\n <>\n \n {\n e.preventDefault()\n loadAppConfig()\n history.push('/admin/application')\n }}\n value={t('common:Cancel')}\n />\n \n ) : (\n <>\n {\n e.preventDefault()\n history.push('/admin/application/edit')\n }}\n value={t('common:Edit')}\n />\n history.push('/admin')}\n value={t('common:Back')}\n />\n \n )}\n \n
\n
\n
\n
\n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n }),\n dispatch => ({\n loadAppConfig: () => {\n dispatch(getAppData('config'))\n },\n onHandleConfigFormSubmit: formData => {\n const data = Object.assign({}, formData)\n data.max_single_file_size *= 1048576\n data.max_zip_file_size *= 1048576\n dispatch(updateAppConfig(data))\n },\n })\n)(AdminApplication)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { getAppData } from '../../actions/application'\nimport { getFileSize } from '../../utils'\n\nclass AdminStats extends React.Component {\n componentDidMount() {\n this.props.loadAppStats()\n }\n\n render() {\n const { appStats, t } = this.props\n const uploadDirSize = getFileSize(appStats.uploads_dir_size, false)\n return (\n
\n
\n
\n
\n
\n \n
\n
\n
\n {appStats.users ? appStats.users : 0}\n
\n
{`${\n appStats.users === 1\n ? t('administration:user')\n : t('administration:users')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n {appStats.sports ? appStats.sports : 0}\n
\n
{`${\n appStats.sports === 1 ? t('common:sport') : t('common:sports')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n {appStats.workouts ? appStats.workouts : 0}\n
\n
{`${\n appStats.workouts === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{uploadDirSize.size}
\n
\n {uploadDirSize.suffix} ({t('administration:uploads')})\n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appStats: state.application.statistics,\n }),\n dispatch => ({\n loadAppStats: () => {\n dispatch(getAppData('stats/all'))\n },\n })\n )(AdminStats)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport AdminStats from './AdminStats'\n\nexport default function AdminDashboard(props) {\n const { appConfig, t } = props\n return (\n
\n
\n {t('administration:Administration')}\n
\n
\n \n
\n
\n
\n \n {t('administration:Application')}\n \n
\n
\n {t(\n 'administration:Update application configuration ' +\n '(maximum number of registered users, maximum files size).'\n )}\n
\n \n {t(\n `administration:Registration is currently ${\n appConfig.is_registration_enabled ? 'enabled' : 'disabled'\n }.`\n )}\n \n
\n
\n
\n \n {t('administration:Sports')}\n \n
\n
{t('administration:Enable/disable sports.')}
\n
\n
\n \n {t('administration:Users')}\n \n
\n
\n {t(\n 'administration:Add/remove admin rights, ' +\n 'delete user account.'\n )}\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { getOrUpdateData } from '../../actions'\nimport { history } from '../../index'\n\nclass AdminSports extends React.Component {\n componentDidMount() {\n this.props.loadSports()\n }\n\n render() {\n const { message, sports, t, updateSport } = this.props\n return (\n
\n {message && }\n
\n
\n
\n
\n {t('administration:Sports')}\n
\n
\n {sports.length > 0 && (\n \n \n \n \n \n \n \n \n \n \n \n {sports.map(sport => (\n \n \n \n \n \n \n \n ))}\n \n
{t('administration:id')}{t('administration:Image')}{t('administration:Label')}{t('administration:Active')}{t('administration:Actions')}
\n \n {t('administration:id')}\n \n {sport.id}\n \n \n {t('administration:Image')}\n \n \n \n \n {t('administration:Label')}\n \n {t(`sports:${sport.label}`)}\n \n \n {t('administration:Active')}\n \n {sport.is_active ? (\n \n ) : (\n \n )}\n \n \n {t('administration:Actions')}\n \n \n updateSport(sport.id, !sport.is_active)\n }\n />\n {sport.has_workouts && (\n \n \n {t('administration:workouts exist')}\n \n )}\n
\n )}\n history.push('/admin/')}\n value={t('common:Back')}\n />\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadSports: () => {\n dispatch(getOrUpdateData('getData', 'sports'))\n },\n updateSport: (sportId, isActive) => {\n const data = { id: sportId, is_active: isActive }\n dispatch(getOrUpdateData('updateData', 'sports', data, false))\n },\n })\n)(AdminSports)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatUrl, rangePagination } from '../../utils'\n\nexport default class Pagination extends React.PureComponent {\n getUrl(value) {\n const { query, pathname } = this.props\n const newQuery = Object.assign({}, query)\n let page = query.page ? +query.page : 1\n switch (value) {\n case 'prev':\n page -= 1\n break\n case 'next':\n page += 1\n break\n default:\n page = +value\n }\n newQuery.page = page\n return formatUrl(pathname, newQuery)\n }\n\n render() {\n const { pagination, t } = this.props\n return (\n <>\n {pagination && Object.keys(pagination).length > 0 && (\n \n )}\n \n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport Message from '../Common/Message'\nimport Pagination from '../Common/Pagination'\nimport { history } from '../../index'\nimport { getOrUpdateData } from '../../actions'\nimport {\n apiUrl,\n formatUrl,\n sortOrders,\n translateValues,\n userFilters,\n} from '../../utils'\n\nclass AdminUsers extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: null,\n per_page: null,\n order_by: 'created_at',\n order: 'asc',\n }\n }\n\n componentDidMount() {\n this.props.loadUsers(this.initState())\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.query !== this.props.location.query) {\n this.props.loadUsers(this.props.location.query)\n }\n }\n\n initState() {\n const { query } = this.props.location\n const newQuery = {\n page: query.page,\n per_page: query.per_page,\n order_by: query.order_by ? query.order_by : 'created_at',\n order: query.order ? query.order : 'asc',\n }\n this.setState(newQuery)\n return newQuery\n }\n\n updatePage(key, value) {\n const query = Object.assign({}, this.state)\n query[key] = value\n this.setState(query)\n const url = formatUrl(this.props.location.pathname, query)\n history.push(url)\n }\n\n render() {\n const {\n authUser,\n location,\n message,\n t,\n pagination,\n updateUser,\n users,\n } = this.props\n const translatedFilters = translateValues(t, userFilters)\n const translatedSortOrders = translateValues(t, sortOrders)\n return (\n
\n {message && }\n
\n
\n
\n
\n
\n {t('administration:Users')}\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n {users.map(user => (\n \n \n \n \n \n \n \n \n \n ))}\n \n
#{t('user:Username')}{t('user:Email')}{t('user:Registration Date')}{t('workouts:Workouts')}{t('user:Admin')}{t('administration:Actions')}
\n #\n {user.picture === true ? (\n \n ) : (\n \n )}\n \n \n {t('user:Username')}\n \n \n {user.username}\n \n \n \n {t('user:Email')}\n \n {user.email}\n \n \n {t('user:Registration Date')}\n \n {format(\n new Date(user.created_at),\n 'dd/MM/yyyy HH:mm'\n )}\n \n \n {t('workouts:Workouts')}\n \n {user.nb_workouts}\n \n \n {t('user:Admin')}\n \n {user.admin ? (\n \n ) : (\n \n )}\n \n \n {t('administration:Actions')}\n \n \n updateUser(user.username, !user.admin)\n }\n />\n
\n \n history.push('/admin/')}\n value={t('common:Back')}\n />\n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n authUser: state.user,\n location: state.router.location,\n message: state.message,\n pagination: state.users.pagination,\n users: state.users.data,\n }),\n dispatch => ({\n loadUsers: query => {\n dispatch(getOrUpdateData('getData', 'users', query))\n },\n updateUser: (userName, isAdmin) => {\n const data = { username: userName, admin: isAdmin }\n dispatch(getOrUpdateData('updateData', 'users', data, false))\n },\n })\n)(AdminUsers)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useTranslation } from 'react-i18next'\n\nexport default function NotFound() {\n const { t } = useTranslation()\n return (\n
\n \n fittrackee - 404\n \n

{t('Page not found')}

\n
\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport AdminApplication from './AdminApplication'\nimport AdminDashboard from './AdminDashboard'\nimport AdminSports from './AdminSports'\nimport AdminUsers from './AdminUsers'\nimport NotFound from './../Others/NotFound'\n\nfunction Admin(props) {\n const { appConfig, t, user } = props\n return (\n <>\n \n FitTrackee - {t('administration:Administration')}\n \n
\n {user.admin ? (\n \n }\n />\n (\n \n )}\n />\n (\n \n )}\n />\n }\n />\n }\n />\n \n \n ) : (\n \n )}\n
\n \n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n appConfig: state.application.config,\n user: state.user,\n }))(Admin)\n)\n","import { format, subHours } from 'date-fns'\nimport togeojson from '@mapbox/togeojson'\n\nimport { getDateWithTZ } from './index'\n\nexport const workoutColors = [\n '#55a8a3',\n '#98C3A9',\n '#D0838A',\n '#ECC77E',\n '#926692',\n '#929292',\n '#428bca',\n]\n\nexport const recordsLabels = [\n { record_type: 'AS', label: 'Ave. speed' },\n { record_type: 'FD', label: 'Farest distance' },\n { record_type: 'LD', label: 'Longest duration' },\n { record_type: 'MS', label: 'Max. speed' },\n]\n\nexport const getGeoJson = gpxContent => {\n let jsonData\n if (gpxContent) {\n const gpx = new DOMParser().parseFromString(gpxContent, 'text/xml')\n jsonData = togeojson.gpx(gpx)\n }\n return { jsonData }\n}\n\nexport const formatWorkoutDate = (\n dateTime,\n dateFormat = null,\n timeFormat = null\n) => {\n if (!dateFormat) {\n dateFormat = 'yyyy/MM/dd'\n }\n if (!timeFormat) {\n timeFormat = 'HH:mm'\n }\n return {\n workout_date: dateTime ? format(dateTime, dateFormat) : null,\n workout_time: dateTime ? format(dateTime, timeFormat) : null,\n }\n}\n\nexport const formatWorkoutDuration = seconds => {\n let newDate = new Date(0)\n newDate = subHours(newDate.setSeconds(seconds), 1)\n return newDate.getTime()\n}\n\nexport const formatChartData = chartData => {\n for (let i = 0; i < chartData.length; i++) {\n chartData[i].time = new Date(chartData[i].time).getTime()\n chartData[i].duration = formatWorkoutDuration(chartData[i].duration)\n }\n return chartData\n}\n\nexport const formatRecord = (record, tz) => {\n let value\n switch (record.record_type) {\n case 'AS':\n case 'MS':\n value = `${record.value} km/h`\n break\n case 'FD':\n value = `${record.value} km`\n break\n default:\n // 'LD'\n value = record.value // eslint-disable-line prefer-destructuring\n }\n const [recordType] = recordsLabels.filter(\n r => r.record_type === record.record_type\n )\n return {\n workout_date: formatWorkoutDate(getDateWithTZ(record.workout_date, tz))\n .workout_date,\n workout_id: record.workout_id,\n id: record.id,\n record_type: recordType.label,\n value: value,\n }\n}\n\nconst sortSports = (a, b) => {\n const sportALabel = a.label.toLowerCase()\n const sportBLabel = b.label.toLowerCase()\n return sportALabel > sportBLabel ? 1 : sportALabel < sportBLabel ? -1 : 0\n}\n\nexport const translateSports = (sports, t, onlyActive = false) =>\n sports\n .filter(sport => (onlyActive ? sport.is_active : true))\n .map(sport => ({\n ...sport,\n label: t(`sports:${sport.label}`),\n }))\n .sort(sortSports)\n","import { createApiRequest } from '../utils'\n\nexport default class FitTrackeeApi {\n static loginOrRegisterOrPasswordReset(target, data) {\n const params = {\n url: `auth/${target}`,\n method: 'POST',\n noAuthorization: true,\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deletePicture() {\n const params = {\n url: 'auth/picture',\n method: 'DELETE',\n }\n return createApiRequest(params)\n }\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport FitTrackeeApi from '../fitTrackeeApi/auth'\nimport { history } from '../index'\nimport { generateIds } from '../utils'\nimport { getOrUpdateData, setError, updateLanguage } from './index'\nimport { getAppData } from './application'\n\nconst AuthError = message => ({ type: 'AUTH_ERROR', message })\n\nconst AuthErrors = messages => ({ type: 'AUTH_ERRORS', messages })\n\nconst PictureError = message => ({ type: 'PICTURE_ERROR', message })\n\nconst ProfileSuccess = profil => ({ type: 'PROFILE_SUCCESS', profil })\n\nconst ProfileError = message => ({ type: 'PROFILE_ERROR', message })\n\nconst ProfileUpdateError = message => ({\n type: 'PROFILE_UPDATE_ERROR',\n message,\n})\n\nexport const logout = () => ({ type: 'LOGOUT' })\n\nexport const loadProfile = () => dispatch => {\n if (window.localStorage.getItem('authToken')) {\n return dispatch(getProfile())\n }\n return { type: 'LOGOUT' }\n}\n\nexport const getProfile = () => dispatch =>\n FitTrackeeGenericApi.getData('auth/profile')\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getOrUpdateData('getData', 'sports'))\n ret.data.isAuthenticated = true\n if (ret.data.language) {\n dispatch(updateLanguage(ret.data.language))\n }\n return dispatch(ProfileSuccess(ret.data))\n }\n return dispatch(ProfileError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const loginOrRegisterOrPasswordReset = (target, formData) => dispatch =>\n FitTrackeeApi.loginOrRegisterOrPasswordReset(target, formData)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'password/reset-request') {\n return history.push({\n pathname: '/password-reset/sent',\n })\n }\n if (target === 'password/update') {\n return history.push({\n pathname: '/updated-password',\n })\n }\n if (target === 'login' || target === 'register') {\n window.localStorage.setItem('authToken', ret.auth_token)\n if (target === 'register') {\n dispatch(getAppData('config'))\n }\n return dispatch(getProfile())\n }\n }\n return dispatch(AuthError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nconst RegisterFormControl = (formData, onlyPasswords = false) => {\n const errMsg = []\n if (\n !onlyPasswords &&\n (formData.username.length < 3 || formData.username.length > 12)\n ) {\n errMsg.push('3 to 12 characters required for username.')\n }\n if (formData.password !== formData.password_conf) {\n errMsg.push(\"Password and password confirmation don't match.\")\n }\n if (formData.password.length < 8) {\n errMsg.push('8 characters required for password.')\n }\n return errMsg\n}\n\nexport const handleUserFormSubmit = (formData, formType) => dispatch => {\n if (formType === 'register' || formType === 'password/update') {\n const ret = RegisterFormControl(formData, formType === 'password/update')\n if (ret.length > 0) {\n return dispatch(AuthErrors(generateIds(ret)))\n }\n }\n return dispatch(loginOrRegisterOrPasswordReset(formType, formData))\n}\n\nexport const handleProfileFormSubmit = formData => dispatch => {\n if (!formData.password === formData.password_conf) {\n return dispatch(\n ProfileUpdateError(\"Password and password confirmation don't match.\")\n )\n }\n delete formData.id\n return FitTrackeeGenericApi.postData('auth/profile/edit', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getProfile())\n return history.push('/profile')\n }\n dispatch(ProfileUpdateError(ret.message))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const uploadPicture = event => dispatch => {\n event.preventDefault()\n const form = new FormData()\n form.append('file', event.target.picture.files[0])\n event.target.reset()\n return FitTrackeeGenericApi.addDataWithFile('auth/picture', form)\n .then(ret => {\n if (ret.status === 'success') {\n return dispatch(getProfile())\n }\n const msg =\n ret.status === 413\n ? 'Error during picture update, file size exceeds max size.'\n : ret.message\n return dispatch(PictureError(msg))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const deletePicture = () => dispatch =>\n FitTrackeeApi.deletePicture()\n .then(ret => {\n if (ret.status === 204) {\n return dispatch(getProfile())\n }\n return dispatch(PictureError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const deleteUser = (username, isAdmin = false) => dispatch =>\n FitTrackeeGenericApi.deleteData('users', username)\n .then(ret => {\n if (ret.status === 204) {\n dispatch(getAppData('config'))\n if (isAdmin) {\n history.push('/admin/users')\n } else {\n dispatch(logout())\n history.push('/')\n }\n } else {\n ret.json().then(r => dispatch(setError(`${r.message}`)))\n }\n })\n .catch(error => dispatch(setError(`user|${error}`)))\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { history } from '../index'\nimport { formatChartData } from '../utils/workouts'\nimport { setError, setLoading } from './index'\nimport { loadProfile } from './user'\n\nexport const pushWorkouts = workouts => ({\n type: 'PUSH_WORKOUTS',\n workouts,\n})\n\nexport const removeWorkout = workoutId => ({\n type: 'REMOVE_WORKOUT',\n workoutId,\n})\n\nexport const updateCalendar = workouts => ({\n type: 'UPDATE_CALENDAR',\n workouts,\n})\n\nexport const setGpx = gpxContent => ({\n type: 'SET_GPX',\n gpxContent,\n})\n\nexport const setChartData = chartData => ({\n type: 'SET_CHART_DATA',\n chartData,\n})\n\nexport const addWorkout = form => dispatch =>\n FitTrackeeGenericApi.addDataWithFile('workouts', form)\n .then(ret => {\n if (ret.status === 'created') {\n if (ret.data.workouts.length === 0) {\n dispatch(setError('workouts|no correct file.'))\n } else if (ret.data.workouts.length === 1) {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n // ret.data.workouts.length > 1\n dispatch(loadProfile())\n history.push('/')\n }\n } else if (ret.status === 413) {\n dispatch(\n setError('workouts|File size is greater than the allowed size')\n )\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`workouts|${error}`))\n })\n\nexport const addWorkoutWithoutGpx = form => dispatch =>\n FitTrackeeGenericApi.addData('workouts/no_gpx', form)\n .then(ret => {\n if (ret.status === 'created') {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const getWorkoutGpx = workoutId => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(`workouts/${workoutId}/gpx`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getSegmentGpx = (workoutId, segmentId) => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(\n `workouts/${workoutId}/gpx/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getWorkoutChartData = workoutId => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(`workouts/${workoutId}/chart_data`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const getSegmentChartData = (workoutId, segmentId) => dispatch => {\n if (workoutId) {\n return FitTrackeeGenericApi.getData(\n `workouts/${workoutId}/chart_data/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const deleteWorkout = id => dispatch =>\n FitTrackeeGenericApi.deleteData('workouts', id)\n .then(ret => {\n if (ret.status === 204) {\n Promise.resolve(dispatch(removeWorkout(id)))\n .then(() => dispatch(loadProfile()))\n .then(() => history.push('/'))\n } else {\n dispatch(setError(`workouts|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const editWorkout = form => dispatch =>\n FitTrackeeGenericApi.updateData('workouts', form)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(loadProfile())\n history.push(`/workouts/${ret.data.workouts[0].id}`)\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`workouts|${error}`))\n })\n\nexport const getMoreWorkouts = params => dispatch =>\n FitTrackeeGenericApi.getData('workouts', params)\n .then(ret => {\n if (ret.status === 'success') {\n if (ret.data.workouts.length > 0) {\n dispatch(pushWorkouts(ret.data.workouts))\n }\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n\nexport const getMonthWorkouts = (from, to) => dispatch =>\n FitTrackeeGenericApi.getData('workouts', {\n from,\n to,\n order: 'desc',\n per_page: 100,\n })\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(updateCalendar(ret.data.workouts))\n } else {\n dispatch(setError(`workouts|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`workouts|${error}`)))\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { setLoading } from '../../../actions/index'\nimport { addWorkout, editWorkout } from '../../../actions/workouts'\nimport { history } from '../../../index'\nimport { getFileSize } from '../../../utils'\nimport { translateSports } from '../../../utils/workouts'\n\nfunction FormWithGpx(props) {\n const {\n appConfig,\n loading,\n onAddWorkout,\n onEditWorkout,\n sports,\n t,\n workout,\n } = props\n const sportId = workout ? workout.sport_id : ''\n const translatedSports = translateSports(sports, t, true)\n const zipTooltip = `${t('workouts:no folder inside')}, ${\n appConfig.gpx_limit_import\n } ${t('workouts:files max')}, ${t('workouts:max size')}: ${getFileSize(\n appConfig.max_zip_file_size\n )}`\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n event.preventDefault()}\n >\n
\n \n
\n {workout ? (\n
\n \n
\n ) : (\n
\n \n
\n )}\n
\n \n
\n {loading ? (\n
\n ) : (\n
\n \n workout ? onEditWorkout(event, workout) : onAddWorkout(event)\n }\n value={t('common:Submit')}\n />\n history.push('/')}\n value={t('common:Cancel')}\n />\n
\n )}\n \n )\n}\n\nexport default connect(\n state => ({\n appConfig: state.application.config,\n loading: state.loading,\n }),\n dispatch => ({\n onAddWorkout: e => {\n dispatch(setLoading(true))\n const form = new FormData()\n form.append('file', e.target.form.gpxFile.files[0])\n /* prettier-ignore */\n form.append(\n 'data',\n `{\"sport_id\": ${e.target.form.sport.value\n }, \"notes\": \"${e.target.form.notes.value}\"}`\n )\n dispatch(addWorkout(form))\n },\n onEditWorkout: (e, workout) => {\n dispatch(\n editWorkout({\n id: workout.id,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport.value,\n title: e.target.form.title.value,\n })\n )\n },\n })\n)(FormWithGpx)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport { addWorkoutWithoutGpx, editWorkout } from '../../../actions/workouts'\nimport { history } from '../../../index'\nimport { getDateWithTZ } from '../../../utils'\nimport { formatWorkoutDate, translateSports } from '../../../utils/workouts'\n\nfunction FormWithoutGpx(props) {\n const { onAddOrEdit, sports, t, user, workout } = props\n const translatedSports = translateSports(sports, t, true)\n let workoutDate,\n workoutTime,\n sportId = ''\n if (workout) {\n const workoutDateTime = formatWorkoutDate(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'yyyy-MM-dd'\n )\n workoutDate = workoutDateTime.workout_date\n workoutTime = workoutDateTime.workout_time\n sportId = workout.sport_id\n }\n\n return (\n
event.preventDefault()}>\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n onAddOrEdit(event, workout)}\n value={t('common:Submit')}\n />\n history.push('/')}\n value={t('common:Cancel')}\n />\n \n )\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n onAddOrEdit: (e, workout) => {\n const d = e.target.form.duration.value.split(':')\n const duration = +d[0] * 60 * 60 + +d[1] * 60 + +d[2]\n\n /* prettier-ignore */\n const workoutDate = `${e.target.form.workout_date.value\n } ${ e.target.form.workout_time.value}`\n\n const data = {\n workout_date: workoutDate,\n distance: +e.target.form.distance.value,\n duration,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport_id.value,\n title: e.target.form.title.value,\n }\n if (workout) {\n data.id = workout.id\n dispatch(editWorkout(data))\n } else {\n dispatch(addWorkoutWithoutGpx(data))\n }\n },\n })\n)(FormWithoutGpx)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport FormWithGpx from './WorkoutForms/FormWithGpx'\nimport FormWithoutGpx from './WorkoutForms/FormWithoutGpx'\nimport Message from '../Common/Message'\n\nclass WorkoutAddEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n withGpx: true,\n }\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n withGpx:\n changeEvent.target.name === 'withGpx'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n render() {\n const { loading, message, sports, t, workout } = this.props\n const { withGpx } = this.state\n return (\n
\n \n \n FitTrackee -{' '}\n {workout\n ? t('workouts:Edit a workout')\n : t('workouts:Add a workout')}\n \n \n
\n
\n \n
\n
\n
\n
\n
\n

\n {workout\n ? t('workouts:Edit a workout')\n : t('workouts:Add a workout')}\n

\n
\n {workout ? (\n workout.with_gpx ? (\n \n ) : (\n \n )\n ) : (\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n {withGpx ? (\n \n ) : (\n \n )}\n
\n )}\n
\n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n loading: state.loading,\n }))(WorkoutAddEdit)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport WorkoutAddOrEdit from './WorkoutAddOrEdit'\n\nfunction WorkoutAdd(props) {\n const { message, sports } = props\n return (\n
\n \n
\n )\n}\n\nexport default connect(state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n}))(WorkoutAdd)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport default function CustomModal(props) {\n const { t } = useTranslation()\n return (\n
\n
\n
\n
\n
{props.title}
\n props.close()}\n >\n ×\n \n
\n
\n

{props.text}

\n
\n
\n props.confirm()}\n >\n {t('common:Yes')}\n \n props.close()}\n >\n {t('common:No')}\n \n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { getDateWithTZ } from '../../../utils'\nimport { formatWorkoutDate } from '../../../utils/workouts'\n\nexport default function WorkoutCardHeader(props) {\n const {\n dataType,\n displayModal,\n segmentId,\n sport,\n t,\n title,\n user,\n workout,\n } = props\n const workoutDate = workout\n ? formatWorkoutDate(getDateWithTZ(workout.workout_date, user.timezone))\n : null\n\n const previousUrl =\n dataType === 'segment' && segmentId !== 1\n ? `/workouts/${workout.id}/segment/${segmentId - 1}`\n : dataType === 'workout' && workout.previous_workout\n ? `/workouts/${workout.previous_workout}`\n : null\n const nextUrl =\n dataType === 'segment' && segmentId < workout.segments.length\n ? `/workouts/${workout.id}/segment/${segmentId + 1}`\n : dataType === 'workout' && workout.next_workout\n ? `/workouts/${workout.next_workout}`\n : null\n\n return (\n
\n
\n
\n {previousUrl ? (\n \n \n \n ) : (\n \n )}\n
\n
\n \"sport\n
\n
\n {dataType === 'workout' ? (\n <>\n {title}{' '}\n \n \n \n displayModal(true)}\n title={t('workouts:Delete workout')}\n />\n \n ) : (\n <>\n {/* prettier-ignore */}\n \n {title}\n {' '}\n - {t('workouts:segment')} {segmentId}\n \n )}\n
\n {workoutDate && (\n \n {`${workoutDate.workout_date} - ${workoutDate.workout_time}`}\n \n )}\n
\n
\n {nextUrl ? (\n \n \n \n ) : (\n \n )}\n
\n
\n
\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport {\n Area,\n ComposedChart,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport {\n getSegmentChartData,\n getWorkoutChartData,\n} from '../../../actions/workouts'\n\nclass WorkoutCharts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayDistance: true,\n dataToHide: [],\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'workout') {\n this.props.loadWorkoutData(this.props.workout.id)\n } else {\n this.props.loadSegmentData(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'workout' &&\n prevProps.workout.id !== this.props.workout.id) ||\n (this.props.dataType === 'workout' && prevProps.dataType === 'segment')\n ) {\n this.props.loadWorkoutData(this.props.workout.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentData(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadWorkoutData(null)\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n displayDistance:\n changeEvent.target.name === 'distance'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n handleLegendChange(e) {\n const { dataToHide } = this.state\n const name = e.target.name // eslint-disable-line prefer-destructuring\n if (dataToHide.find(d => d === name)) {\n dataToHide.splice(dataToHide.indexOf(name), 1)\n } else {\n dataToHide.push(name)\n }\n this.setState({ dataToHide })\n }\n\n displayData(name) {\n const { dataToHide } = this.state\n return !dataToHide.find(d => d === name)\n }\n\n render() {\n const { chartData, t, updateCoordinates } = this.props\n const { displayDistance } = this.state\n const xInterval = chartData ? parseInt(chartData.length / 10, 10) : 0\n let xDataKey, xScale\n if (displayDistance) {\n xDataKey = 'distance'\n xScale = 'linear'\n } else {\n xDataKey = 'duration'\n xScale = 'time'\n }\n return (\n
\n {chartData && chartData.length > 0 ? (\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n updateCoordinates(e.activePayload)}\n onMouseLeave={() => updateCoordinates(null)}\n >\n \n displayDistance ? value : format(value, 'HH:mm:ss')\n }\n type=\"number\"\n />\n \n \n {this.displayData('elevation') && (\n \n )}\n {this.displayData('speed') && (\n \n )}\n \n displayDistance\n ? `${t('workouts:distance')}: ${value} km`\n : `${t('workouts:duration')}: ${format(\n value,\n 'HH:mm:ss'\n )}`\n }\n />\n \n \n
\n
\n {t('workouts:data from gpx, without any cleaning')}\n
\n
\n ) : (\n t('workouts:No data to display')\n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n chartData: state.chartData,\n }),\n dispatch => ({\n loadWorkoutData: workoutId => {\n dispatch(getWorkoutChartData(workoutId))\n },\n loadSegmentData: (workoutId, segmentId) => {\n dispatch(getSegmentChartData(workoutId, segmentId))\n },\n })\n)(WorkoutCharts)\n","import React from 'react'\n\nexport default function WorkoutWeather(props) {\n const { t, workout } = props\n return (\n
\n {workout.weather_start && workout.weather_end && (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n {t('workouts:Start')}\n
\n \n
\n {t('workouts:End')}\n
\n \n
\n \n {Number(workout.weather_start.temperature).toFixed(1)}°C{Number(workout.weather_end.temperature).toFixed(1)}°C
\n \n \n {Number(workout.weather_start.humidity * 100).toFixed(1)}%\n {Number(workout.weather_end.humidity * 100).toFixed(1)}%
\n \n {Number(workout.weather_start.wind).toFixed(1)}m/s{Number(workout.weather_end.wind).toFixed(1)}m/s
\n )}\n
\n )\n}\n","import React from 'react'\n\nimport WorkoutWeather from './WorkoutWeather'\n\nexport default function WorkoutDetails(props) {\n const { t, workout } = props\n const withPauses = workout.pauses !== '0:00:00' && workout.pauses !== null\n return (\n
\n

\n \n {t('workouts:Duration')}: {workout.moving}\n {workout.records &&\n workout.records.find(record => record.record_type === 'LD') && (\n \n \n \n )}\n {withPauses && (\n \n
({t('workouts:pauses')}: {workout.pauses},{' '}\n {t('workouts:total duration')}: {workout.duration})\n
\n )}\n

\n

\n \n {t('workouts:Distance')}: {workout.distance} km\n {workout.records &&\n workout.records.find(record => record.record_type === 'FD') && (\n \n \n \n )}\n

\n

\n \n {t('workouts:Average speed')}: {workout.ave_speed} km/h\n {workout.records &&\n workout.records.find(record => record.record_type === 'AS') && (\n \n \n \n )}\n
\n {t('workouts:Max. speed')}: {workout.max_speed} km/h\n {workout.records &&\n workout.records.find(record => record.record_type === 'MS') && (\n \n \n \n )}\n

\n {workout.min_alt && workout.max_alt && (\n

\n \n {t('workouts:Min. altitude')}: {workout.min_alt}m\n
\n {t('workouts:Max. altitude')}: {workout.max_alt}m\n

\n )}\n {workout.ascent && workout.descent && (\n

\n \n {t('workouts:Ascent')}: {workout.ascent}m\n
\n {t('workouts:Descent')}: {workout.descent}m\n

\n )}\n \n
\n )\n}\n","import React from 'react'\nimport { GeoJSON, Marker, TileLayer, useMap } from 'react-leaflet'\nimport hash from 'object-hash'\n\nimport { apiUrl } from '../../../utils'\n\nexport default function Map({ bounds, coordinates, jsonData, mapAttribution }) {\n const map = useMap()\n map.fitBounds(bounds)\n return (\n <>\n \n \n {coordinates.latitude && (\n \n )}\n \n )\n}\n","import React from 'react'\nimport { MapContainer } from 'react-leaflet'\nimport { connect } from 'react-redux'\n\nimport Map from './Map'\nimport { getSegmentGpx, getWorkoutGpx } from '../../../actions/workouts'\nimport { getGeoJson } from '../../../utils/workouts'\n\nclass WorkoutMap extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n zoom: 13,\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'workout') {\n this.props.loadWorkoutGpx(this.props.workout.id)\n } else {\n this.props.loadSegmentGpx(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'workout' &&\n prevProps.workout.id !== this.props.workout.id) ||\n (this.props.dataType === 'workout' && prevProps.dataType === 'segment')\n ) {\n this.props.loadWorkoutGpx(this.props.workout.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentGpx(this.props.workout.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadWorkoutGpx(null)\n }\n\n render() {\n const { coordinates, gpxContent, mapAttribution, workout } = this.props\n const { jsonData } = getGeoJson(gpxContent)\n const bounds = [\n [workout.bounds[0], workout.bounds[1]],\n [workout.bounds[2], workout.bounds[3]],\n ]\n\n return (\n
\n {jsonData && (\n \n \n \n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n gpxContent: state.gpx,\n mapAttribution: state.application.config.map_attribution,\n }),\n dispatch => ({\n loadWorkoutGpx: workoutId => {\n dispatch(getWorkoutGpx(workoutId))\n },\n loadSegmentGpx: (workoutId, segmentId) => {\n dispatch(getSegmentGpx(workoutId, segmentId))\n },\n })\n)(WorkoutMap)\n","import React from 'react'\n\nexport default function WorkoutNoMap(props) {\n const { t } = props\n return (\n
{t('workouts:No Map')}
\n )\n}\n","import React from 'react'\n\nexport default function WorkoutNotes(props) {\n const { notes, t } = props\n return (\n
\n
\n
\n
\n Notes\n
\n {notes ? notes : t('workouts:No notes')}\n
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default function WorkoutSegments(props) {\n const { segments, t } = props\n return (\n
\n
\n
\n
\n {t('workouts:Segments')}\n
\n
    \n {segments.map((segment, index) => (\n \n \n {t('workouts:segment')} {index + 1}\n {' '}\n ({t('workouts:distance')}: {segment.distance} km,{' '}\n {t('workouts:duration')}: {segment.duration})\n \n ))}\n
\n
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../../Common/CustomModal'\nimport Message from '../../Common/Message'\nimport WorkoutCardHeader from './WorkoutCardHeader'\nimport WorkoutCharts from './WorkoutCharts'\nimport WorkoutDetails from './WorkoutDetails'\nimport WorkoutMap from './WorkoutMap'\nimport WorkoutNoMap from './WorkoutNoMap'\nimport WorkoutNotes from './WorkoutNotes'\nimport WorkoutSegments from './WorkoutSegments'\nimport { getOrUpdateData } from '../../../actions'\nimport { deleteWorkout } from '../../../actions/workouts'\n\nclass WorkoutDisplay extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n coordinates: {\n latitude: null,\n longitude: null,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n\n componentDidUpdate(prevProps) {\n if (\n prevProps.match.params.workoutId !== this.props.match.params.workoutId\n ) {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n updateCoordinates(activePayload) {\n const coordinates =\n activePayload && activePayload.length > 0\n ? {\n latitude: activePayload[0].payload.latitude,\n longitude: activePayload[0].payload.longitude,\n }\n : {\n latitude: null,\n longitude: null,\n }\n this.setState(prevState => ({\n ...prevState,\n coordinates,\n }))\n }\n\n render() {\n const { message, onDeleteWorkout, sports, t, user, workouts } = this.props\n const { coordinates, displayModal } = this.state\n const [workout] = workouts\n const title = workout ? workout.title : t('workouts:Workout')\n const [sport] = workout ? sports.filter(s => s.id === workout.sport_id) : []\n const segmentId = parseInt(this.props.match.params.segmentId)\n const dataType = segmentId >= 0 ? 'segment' : 'workout'\n return (\n
\n \n FitTrackee - {title}\n \n {message ? (\n \n ) : (\n
\n {displayModal && (\n {\n onDeleteWorkout(workout.id)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {workout && sport && workouts.length === 1 && (\n
\n
\n
\n
\n
\n this.displayModal(true)}\n />\n
\n
\n
\n
\n {workout.with_gpx ? (\n \n ) : (\n \n )}\n
\n
\n \n
\n
\n
\n
\n
\n
\n {workout.with_gpx && (\n
\n
\n
\n
\n
\n
\n
\n {t('workouts:Chart')}\n
\n \n this.updateCoordinates(e)\n }\n />\n
\n
\n
\n
\n
\n
\n )}\n {dataType === 'workout' && (\n <>\n \n {workout.segments.length > 1 && (\n \n )}\n \n )}\n
\n )}\n
\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkout: workoutId => {\n dispatch(getOrUpdateData('getData', 'workouts', { id: workoutId }))\n },\n onDeleteWorkout: workoutId => {\n dispatch(deleteWorkout(workoutId))\n },\n })\n )(WorkoutDisplay)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport WorkoutAddOrEdit from './WorkoutAddOrEdit'\nimport { getOrUpdateData } from '../../actions'\n\nclass WorkoutEdit extends React.Component {\n componentDidMount() {\n this.props.loadWorkout(this.props.match.params.workoutId)\n }\n\n render() {\n const { message, sports, workouts } = this.props\n const [workout] = workouts\n return (\n
\n {sports.length > 0 && (\n \n )}\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkout: workoutId => {\n dispatch(getOrUpdateData('getData', 'workouts', { id: workoutId }))\n },\n })\n)(WorkoutEdit)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Redirect, Route, Switch } from 'react-router-dom'\n\nimport NotFound from './../Others/NotFound'\nimport WorkoutAdd from './WorkoutAdd'\nimport WorkoutDisplay from './WorkoutDisplay'\nimport WorkoutEdit from './WorkoutEdit'\nimport { isLoggedIn } from '../../utils'\n\nfunction Workout() {\n return (\n
\n {isLoggedIn() ? (\n \n \n \n \n \n \n \n ) : (\n \n )}\n
\n )\n}\n\nexport default connect(state => ({\n user: state.user,\n}))(Workout)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default class NoWorkouts extends React.PureComponent {\n render() {\n const { t } = this.props\n return (\n
\n
\n {t('common:No workouts.')}{' '}\n \n {t('dashboard:Upload one !')}\n \n
\n
\n )\n }\n}\n","import React from 'react'\n\nimport { translateSports } from '../../utils/workouts'\n\nexport default class WorkoutsFilter extends React.PureComponent {\n render() {\n const { loadWorkouts, sports, t, updateParams } = this.props\n const translatedSports = translateSports(sports, t)\n return (\n
\n
\n
event.preventDefault()}>\n
\n \n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n loadWorkouts()}\n type=\"submit\"\n value={t('workouts:Filter')}\n />\n \n
\n
\n )\n }\n}\n","import React from 'react'\n\nimport { apiUrl } from '../../utils'\n\nexport default class StaticMap extends React.PureComponent {\n render() {\n const { display, workout } = this.props\n\n return (\n
\n \n
\n ©\n \n OpenStreetMap\n \n
\n
\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default class WorkoutsList extends React.PureComponent {\n render() {\n const { loading, sports, t, user, workouts } = this.props\n return (\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n {!loading &&\n sports &&\n workouts.map((workout, idx) => (\n // eslint-disable-next-line react/no-array-index-key\n \n \n \n \n \n \n \n \n \n ))}\n \n
\n {t('common:Workout')}{t('workouts:Date')}{t('workouts:Distance')}{t('workouts:Duration')}{t('workouts:Ave. speed')}{t('workouts:Max. speed')}
\n \n {t('common:Sport')}\n \n s.id === workout.sport_id)\n .map(s => s.img)}\n alt=\"workout sport logo\"\n />\n \n \n {t('common:Workout')}\n \n \n {workout.title}\n \n {workout.map && (\n \n )}\n \n \n {t('workouts:Date')}\n \n {format(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n \n \n {t('workouts:Distance')}\n \n {Number(workout.distance).toFixed(2)} km\n \n \n {t('workouts:Duration')}\n \n {workout.moving}\n \n \n {t('workouts:Ave. speed')}\n \n {workout.ave_speed} km/h\n \n \n {t('workouts:Max. speed')}\n \n {workout.max_speed} km/h\n
\n {loading &&
}\n
\n
\n )\n }\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport NoWorkouts from '../Common/NoWorkouts'\nimport WorkoutsFilter from './WorkoutsFilter'\nimport WorkoutsList from './WorkoutsList'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreWorkouts } from '../../actions/workouts'\n\nclass Workouts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n params: {\n page: 1,\n per_page: 10,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadWorkouts(this.state.params)\n }\n\n setParams(e) {\n const { params } = this.state\n if (e.target.value === '') {\n delete params[e.target.name]\n } else {\n params[e.target.name] = e.target.value\n }\n params.page = 1\n this.setState(params)\n }\n render() {\n const {\n loading,\n loadWorkouts,\n loadMoreWorkouts,\n message,\n sports,\n t,\n user,\n workouts,\n } = this.props\n const { params } = this.state\n const paginationEnd =\n workouts.length > 0\n ? workouts[workouts.length - 1].previous_workout === null\n : true\n return (\n
\n \n FitTrackee - {t('common:Workouts')}\n \n {message ? (\n \n ) : (\n
\n
\n
\n loadWorkouts(params)}\n t={t}\n updateParams={e => this.setParams(e)}\n />\n
\n
\n \n {!paginationEnd && (\n {\n params.page += 1\n loadMoreWorkouts(params)\n this.setState(params)\n }}\n />\n )}\n {workouts.length === 0 && }\n
\n
\n
\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n loading: state.loading,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: params => {\n dispatch(getOrUpdateData('getData', 'workouts', params))\n },\n loadMoreWorkouts: params => {\n dispatch(getMoreWorkouts(params))\n },\n })\n )(Workouts)\n)\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { deletePicture, uploadPicture } from '../../actions/user'\nimport { apiUrl, getFileSize } from '../../utils'\nimport { history } from '../../index'\n\nfunction ProfileDetail({\n appConfig,\n displayModal,\n editable,\n isDeletable,\n message,\n onDeletePicture,\n onUploadPicture,\n pathname,\n t,\n user,\n}) {\n const createdAt = user.created_at\n ? format(new Date(user.created_at), 'dd/MM/yyyy HH:mm')\n : ''\n const birthDate = user.birth_date\n ? format(new Date(user.birth_date), 'dd/MM/yyyy')\n : ''\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n
\n \n FitTrackee - {t('user:Profile')}\n \n \n
\n

{t('user:Profile')}

\n
\n
\n
\n
\n {user.username}\n
\n
\n
\n
\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Email')}\n : {user.email}\n

\n

\n \n {t('user:Registration Date')}\n \n : {createdAt}\n

\n

\n {t('user:First Name')}\n : {user.first_name}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Last Name')}\n : {user.last_name}\n

\n

\n {t('user:Birth Date')}\n : {birthDate}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Location')}\n : {user.location}\n

\n

\n {t('user:Bio')}:{' '}\n {user.bio}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Language')}\n : {user.language}\n

\n

\n {/* eslint-disable-next-line max-len */}\n \n {t('user:Timezone')}\n : {user.timezone}\n

\n

\n \n {t('user:First day of week')}\n \n : {user.weekm ? t('user:Monday') : t('user:Sunday')}\n

\n
\n
\n {user.picture === true && (\n
\n \n {editable && (\n <>\n
\n onDeletePicture()}\n >\n {t('user:Delete picture')}\n \n
\n
\n \n )}\n
\n )}\n {editable && (\n onUploadPicture(event)}\n >\n \n
\n \n {` (max. size: ${fileSizeLimit})`}\n \n )}{' '}\n
\n
\n {editable && (\n history.push('/profile/edit')}\n >\n {t('common:Edit')}\n \n )}\n {isDeletable && (\n displayModal(true)}\n >\n {t('user:Delete user account')}\n \n )}\n \n pathname === '/profile' ? history.push('/') : history.go(-1)\n }\n >\n {t(\n pathname === '/profile'\n ? 'common:Back to home'\n : 'common:Back'\n )}\n \n
\n
\n
\n
\n
\n
\n )\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appConfig: state.application.config,\n pathname: state.router.location.pathname,\n message: state.message,\n }),\n dispatch => ({\n onDeletePicture: () => {\n dispatch(deletePicture())\n },\n onUploadPicture: event => {\n dispatch(uploadPicture(event))\n },\n })\n )(ProfileDetail)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ProfileDetail from './ProfileDetail'\n\nfunction CurrentUserProfile({ t, user }) {\n return (\n
\n \n
\n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n user: state.user,\n }))(CurrentUserProfile)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { recordsLabels } from '../../utils/workouts'\n\nexport default function CalendarWorkout(props) {\n const { isDisabled, isMore, sportImg, workout } = props\n return (\n \n <>\n \n {workout.records.length > 0 && (\n \n \n ` ${\n recordsLabels.filter(\n r => r.record_type === rec.record_type\n )[0].label\n }`\n )}\n />\n \n )}\n \n \n )\n}\n","import React from 'react'\n\nimport CalendarWorkout from './CalendarWorkout'\n\nexport default class CalendarWorkouts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n isHidden: true,\n }\n }\n\n handleDisplayMore() {\n this.setState({\n isHidden: !this.state.isHidden,\n })\n }\n\n render() {\n const { dayWorkouts, isDisabled, sports } = this.props\n const { isHidden } = this.state\n return (\n
\n {dayWorkouts.map(act => (\n s.id === act.sport_id).map(s => s.img)}\n />\n ))}\n {dayWorkouts.length > 2 && (\n this.handleDisplayMore()}\n title=\"show more workouts\"\n />\n )}\n {!isHidden && (\n
\n {dayWorkouts.map(act => (\n s.id === act.sport_id)\n .map(s => s.img)}\n />\n ))}\n
\n )}\n
\n )\n }\n}\n","// eslint-disable-next-line max-len\n// source: https://blog.flowandform.agency/create-a-custom-calendar-in-react-3df1bfd0b728\nimport {\n addDays,\n addMonths,\n endOfMonth,\n endOfWeek,\n format,\n isSameDay,\n isSameMonth,\n isToday,\n startOfMonth,\n startOfWeek,\n subMonths,\n} from 'date-fns'\nimport { enGB, fr } from 'date-fns/locale'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport CalendarWorkouts from './CalendarWorkouts'\nimport { getMonthWorkouts } from '../../actions/workouts'\nimport { getDateWithTZ } from '../../utils'\n\nconst getStartAndEndMonth = (date, weekStartOnMonday) => {\n const monthStart = startOfMonth(date)\n const monthEnd = endOfMonth(date)\n const weekStartsOn = weekStartOnMonday ? 1 : 0\n return {\n start: startOfWeek(monthStart, { weekStartsOn }),\n end: endOfWeek(monthEnd),\n }\n}\n\nclass Calendar extends React.Component {\n constructor(props, context) {\n super(props, context)\n const calendarDate = new Date()\n this.state = {\n currentMonth: calendarDate,\n startDate: getStartAndEndMonth(calendarDate, props.weekm).start,\n endDate: getStartAndEndMonth(calendarDate, props.weekm).end,\n weekStartOnMonday: props.weekm,\n }\n }\n\n componentDidMount() {\n this.props.loadMonthWorkouts(this.state.startDate, this.state.endDate)\n }\n\n renderHeader(localeOptions) {\n const dateFormat = 'MMM yyyy'\n return (\n
\n
this.handlePrevMonth()}>\n \n
\n
\n \n {format(this.state.currentMonth, dateFormat, localeOptions)}\n \n
\n
this.handleNextMonth()}>\n \n
\n
\n )\n }\n\n renderDays(localeOptions) {\n const dateFormat = 'EEE'\n const days = []\n const { startDate } = this.state\n\n for (let i = 0; i < 7; i++) {\n days.push(\n
\n {format(addDays(startDate, i), dateFormat, localeOptions)}\n
\n )\n }\n return
{days}
\n }\n\n filterWorkouts(day) {\n const { workouts, user } = this.props\n if (workouts) {\n return workouts.filter(act =>\n isSameDay(getDateWithTZ(act.workout_date, user.timezone), day)\n )\n }\n return []\n }\n\n renderCells() {\n const { currentMonth, startDate, endDate, weekStartOnMonday } = this.state\n const { sports } = this.props\n\n const dateFormat = 'd'\n const rows = []\n\n let days = []\n let day = startDate\n let formattedDate = ''\n\n while (day <= endDate) {\n for (let i = 0; i < 7; i++) {\n formattedDate = format(day, dateFormat)\n const dayWorkouts = this.filterWorkouts(day)\n const isDisabled = isSameMonth(day, currentMonth) ? '' : '-disabled'\n const isWeekEnd = weekStartOnMonday\n ? [5, 6].includes(i)\n : [0, 6].includes(i)\n days.push(\n \n
\n {formattedDate}\n \n
\n
\n )\n day = addDays(day, 1)\n }\n rows.push(\n
\n {days}\n
\n )\n days = []\n }\n return
{rows}
\n }\n\n updateStateDate(calendarDate) {\n const { start, end } = getStartAndEndMonth(\n calendarDate,\n this.state.weekStartOnMonday\n )\n this.setState({\n currentMonth: calendarDate,\n startDate: start,\n endDate: end,\n })\n this.props.loadMonthWorkouts(start, end)\n }\n\n handleNextMonth() {\n const calendarDate = addMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n handlePrevMonth() {\n const calendarDate = subMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n render() {\n const localeOptions = {\n locale: this.props.language === 'fr' ? fr : enGB,\n }\n return (\n
\n
\n {this.renderHeader(localeOptions)}\n {this.renderDays(localeOptions)}\n {this.renderCells()}\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n workouts: state.calendarWorkouts.data,\n language: state.language,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadMonthWorkouts: (start, end) => {\n const dateFormat = 'yyyy-MM-dd'\n dispatch(\n getMonthWorkouts(format(start, dateFormat), format(end, dateFormat))\n )\n },\n })\n)(Calendar)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatRecord, translateSports } from '../../utils/workouts'\n\nexport default function RecordsCard(props) {\n const { records, sports, t, user } = props\n const translatedSports = translateSports(sports, t)\n const recordsBySport = records.reduce((sportList, record) => {\n const sport = translatedSports.find(s => s.id === record.sport_id)\n if (sportList[sport.label] === void 0) {\n sportList[sport.label] = {\n img: sport.img,\n records: [],\n }\n }\n sportList[sport.label].records.push(formatRecord(record, user.timezone))\n return sportList\n }, {})\n\n return (\n
\n
{t('workouts:Personal records')}
\n
\n {Object.keys(recordsBySport).length === 0\n ? t('common:No records.')\n : Object.keys(recordsBySport)\n .sort()\n .map(sportLabel => (\n
\n \n \n {sportLabel}\n \n {/* eslint-disable-next-line max-len */}\n \n \n \n \n \n \n \n {recordsBySport[sportLabel].records.map(rec => (\n \n \n \n \n \n ))}\n \n
\n \n {sportLabel}\n
\n {t(`workouts:${rec.record_type}`)}\n {rec.value}\n \n {rec.workout_date}\n \n
\n
\n ))}\n
\n
\n )\n}\n","import {\n addDays,\n addMonths,\n addYears,\n format,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns'\n\nconst xAxisFormats = [\n { duration: 'week', dateFormat: 'yyyy-MM-dd', xAxis: 'dd/MM' },\n { duration: 'month', dateFormat: 'yyyy-MM', xAxis: 'MM/yyyy' },\n { duration: 'year', dateFormat: 'yyyy', xAxis: 'yyyy' },\n]\n\nexport const formatDuration = (totalSeconds, formatWithDay = false) => {\n let days = '0'\n if (formatWithDay) {\n days = String(Math.floor(totalSeconds / 86400))\n totalSeconds %= 86400\n }\n const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0')\n totalSeconds %= 3600\n const minutes = String(Math.floor(totalSeconds / 60)).padStart(2, '0')\n const seconds = String(totalSeconds % 60).padStart(2, '0')\n if (formatWithDay) {\n return `${days === '0' ? '' : `${days}d:`}${\n hours === '00' ? '' : `${hours}h:`\n }${minutes}m:${seconds}s`\n }\n return `${hours === '00' ? '' : `${hours}:`}${minutes}:${seconds}`\n}\n\nexport const formatValue = (displayedData, value) =>\n value === 0\n ? ''\n : displayedData === 'distance'\n ? `${value.toFixed(2)} km`\n : displayedData === 'duration'\n ? formatDuration(value)\n : value\n\nconst dateIncrement = (duration, day) => {\n switch (duration) {\n case 'week':\n return addDays(day, 7)\n case 'year':\n return addYears(day, 1)\n case 'month':\n default:\n return addMonths(day, 1)\n }\n}\n\nconst startDate = (duration, day, weekm) => {\n switch (duration) {\n case 'week':\n return startOfWeek(day, { weekStartsOn: weekm ? 1 : 0 })\n case 'year':\n return startOfYear(day)\n case 'month':\n default:\n return startOfMonth(day)\n }\n}\n\nexport const formatStats = (stats, sports, params, displayedSports, weekm) => {\n const nbWorkoutsStats = []\n const distanceStats = []\n const durationStats = []\n\n for (\n let day = startDate(params.duration, params.start, weekm);\n day <= params.end;\n day = dateIncrement(params.duration, day)\n ) {\n const [xAxisFormat] = xAxisFormats.filter(\n x => x.duration === params.duration\n )\n const date = format(day, xAxisFormat.dateFormat)\n const xAxis = format(day, xAxisFormat.xAxis)\n const dataNbWorkouts = { date: xAxis }\n const dataDistance = { date: xAxis }\n const dataDuration = { date: xAxis }\n\n if (stats[date]) {\n Object.keys(stats[date])\n .filter(sportId =>\n displayedSports ? displayedSports.includes(+sportId) : true\n )\n .map(sportId => {\n const sportLabel = sports.filter(s => s.id === +sportId)[0].label\n dataNbWorkouts[sportLabel] = stats[date][sportId].nb_workouts\n dataDistance[sportLabel] = stats[date][sportId].total_distance\n dataDuration[sportLabel] = stats[date][sportId].total_duration\n return null\n })\n }\n nbWorkoutsStats.push(dataNbWorkouts)\n distanceStats.push(dataDistance)\n durationStats.push(dataDuration)\n }\n\n return {\n workouts: nbWorkoutsStats,\n distance: distanceStats,\n duration: durationStats,\n }\n}\n","import React from 'react'\n\nimport { formatDuration } from '../../../utils/stats'\n\nconst formatValue = (displayedData, value) =>\n displayedData === 'duration'\n ? formatDuration(value, true)\n : displayedData === 'distance'\n ? value.toFixed(2)\n : value\n\n/**\n * @return {null}\n */\nexport default function CustomTooltip(props) {\n const { active } = props\n if (active) {\n const { displayedData, payload, label } = props\n let total = 0\n payload.map(p => (total += p.value))\n return (\n
\n

{label}

\n {payload.map(p => (\n

\n {p.name}: {formatValue(displayedData, p.value)} {p.unit}\n

\n ))}\n {payload.length > 0 && (\n

Total: {formatValue(displayedData, total)}

\n )}\n
\n )\n }\n return null\n}\n","import React from 'react'\n\nimport { formatValue } from '../../../utils/stats'\n\n/**\n * @return {null}\n */\nexport default function CustomLabel(props) {\n const { displayedData, x, y, width, value } = props\n if (!value) {\n return null\n }\n const radius = 10\n const formattedValue = formatValue(displayedData, value)\n\n return (\n \n \n {formattedValue}\n \n \n )\n}\n","import React from 'react'\nimport {\n Bar,\n BarChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport { formatValue } from '../../../utils/stats'\nimport { workoutColors } from '../../../utils/workouts'\nimport CustomTooltip from './CustomTooltip'\nimport CustomLabel from './CustomLabel'\n\nexport default class StatsCharts extends React.PureComponent {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayedData: 'distance',\n }\n }\n handleRadioChange(changeEvent) {\n this.setState({\n displayedData: changeEvent.target.name,\n })\n }\n\n render() {\n const { displayedData } = this.state\n const { sports, stats, t } = this.props\n if (Object.keys(stats).length === 0) {\n return t('common:No workouts.')\n }\n return (\n
\n
\n \n \n \n
\n \n \n \n formatValue(displayedData, value)} />\n }\n />\n {sports.map((s, i) => (\n \n ) : (\n ''\n )\n }\n name={t(`sports:${s.label}`)}\n />\n ))}\n \n \n
\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport { getStats } from '../../../actions/stats'\nimport { formatStats } from '../../../utils/stats'\nimport StatsChart from './StatsChart'\n\nclass Statistics extends React.PureComponent {\n componentDidMount() {\n this.updateData()\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.user.username &&\n this.props.user.username !== prevProps.user.username) ||\n this.props.statsParams !== prevProps.statsParams\n ) {\n this.updateData()\n }\n }\n\n updateData() {\n if (this.props.user.username) {\n this.props.loadWorkouts(\n this.props.user.username,\n this.props.user.weekm,\n this.props.statsParams\n )\n }\n }\n\n render() {\n const {\n displayedSports,\n sports,\n statistics,\n statsParams,\n displayEmpty,\n t,\n user,\n } = this.props\n if (!displayEmpty && Object.keys(statistics).length === 0) {\n return {t('common:No workouts.')}\n }\n const stats = formatStats(\n statistics,\n sports,\n statsParams,\n displayedSports,\n user.weekm\n )\n return \n }\n}\n\nexport default connect(\n state => ({\n sports: state.sports.data,\n statistics: state.statistics.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: (userName, weekm, data) => {\n const dateFormat = 'yyyy-MM-dd'\n // depends on user config (first day of week)\n const time =\n data.duration === 'week'\n ? `${data.duration}${weekm ? 'm' : ''}`\n : data.duration\n const params = {\n from: format(data.start, dateFormat),\n to: format(data.end, dateFormat),\n time: time,\n }\n dispatch(getStats(userName, data.type, params))\n },\n })\n)(Statistics)\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { setData, setError } from './index'\n\nexport const getStats = (userName, type, data) => dispatch =>\n FitTrackeeGenericApi.getData(`stats/${userName}/${type}`, data)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setData('statistics', ret.data))\n } else {\n dispatch(setError(`statistics|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`statistics|${error}`)))\n","import { endOfMonth, startOfMonth } from 'date-fns'\nimport React from 'react'\n\nimport Stats from '../Common/Stats'\n\nexport default class Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n start: startOfMonth(date),\n end: endOfMonth(date),\n duration: 'week',\n type: 'by_time',\n }\n }\n\n render() {\n const { t } = this.props\n return (\n
\n
{t('dashboard:This month')}
\n
\n \n
\n
\n )\n }\n}\n","import React from 'react'\n\nexport default function UserStatistics(props) {\n const { t, user } = props\n const days = user.total_duration.match(/day/g)\n ? `${user.total_duration.split(' ')[0]} ${\n user.total_duration.match(/days/g) ? t('common:days') : t('common:day')\n }`\n : `0 ${t('common:days')},`\n let duration = user.total_duration.match(/day/g)\n ? user.total_duration.split(', ')[1]\n : user.total_duration\n duration = `${duration.split(':')[0]}h ${duration.split(':')[1]}min`\n return (\n
\n
\n
\n
\n
\n \n
\n
\n
{user.nb_workouts}
\n
{`${\n user.nb_workouts === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n {Number(user.total_distance).toFixed(2)}\n
\n
km
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{days}
\n
{duration}
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
{user.nb_sports}
\n
{`${\n user.nb_sports === 1 ? t('common:sport') : t('common:sports')\n }`}
\n
\n
\n
\n
\n
\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default function WorkoutCard(props) {\n const { sports, t, user, workout } = props\n\n return (\n
\n
\n \n {sports\n .filter(sport => sport.id === workout.sport_id)\n .map(sport => t(`sports:${sport.label}`))}{' '}\n -{' '}\n {format(\n getDateWithTZ(workout.workout_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n \n
\n
\n
\n {workout.map && (\n
\n \n
\n )}\n
\n

\n {' '}\n {t('workouts:Duration')}: {workout.moving}\n {workout.map ? (\n \n
\n
\n
\n ) : (\n ' - '\n )}\n {' '}\n {t('workouts:Distance')}: {workout.distance} km\n

\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Calendar from './Calendar'\nimport Message from '../Common/Message'\nimport NoWorkouts from '../Common/NoWorkouts'\nimport Records from './Records'\nimport Statistics from './Statistics'\nimport UserStatistics from './UserStatistics'\nimport WorkoutCard from './WorkoutCard'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreWorkouts } from '../../actions/workouts'\n\nclass DashBoard extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: 1,\n }\n }\n\n componentDidMount() {\n this.props.loadWorkouts()\n }\n\n render() {\n const {\n loadMoreWorkouts,\n message,\n records,\n sports,\n t,\n user,\n workouts,\n } = this.props\n const paginationEnd =\n workouts.length > 0\n ? workouts[workouts.length - 1].previous_workout === null\n : true\n const { page } = this.state\n return (\n
\n \n FitTrackee - {t('common:Dashboard')}\n \n {message ? (\n \n ) : (\n workouts &&\n user.total_duration &&\n sports.length > 0 && (\n
\n \n
\n
\n \n \n
\n
\n \n {workouts.length > 0 ? (\n workouts.map(workout => (\n \n ))\n ) : (\n \n )}\n {!paginationEnd && (\n {\n loadMoreWorkouts(page + 1)\n this.setState({ page: page + 1 })\n }}\n />\n )}\n
\n
\n
\n )\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n workouts: state.workouts.data,\n message: state.message,\n records: state.records.data,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadWorkouts: () => {\n dispatch(getOrUpdateData('getData', 'workouts', { page: 1 }))\n dispatch(getOrUpdateData('getData', 'records'))\n },\n loadMoreWorkouts: page => {\n dispatch(getMoreWorkouts({ page }))\n },\n })\n )(DashBoard)\n)\n","import React from 'react'\n\nimport { version } from './../../utils'\n\nexport default function Footer() {\n return (\n
\n
\n FitTrackee v{version} -{' '}\n \n source code\n {' '}\n under{' '}\n \n GPLv3\n {' '}\n license -{' '}\n \n documentation\n \n
\n
\n )\n}\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport { logout } from '../../actions/user'\n\nclass Logout extends React.Component {\n componentDidMount() {\n this.props.UserLogout()\n }\n render() {\n return (\n
\n
\n
\n
\n
\n
\n \n You are now logged out. Click here to\n log back in.\n \n
\n
\n
\n
\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n UserLogout: () => {\n dispatch(logout())\n },\n })\n)(Logout)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-421.832c-24.859 0-45.084 20.225-45.084 45.084v366.226c0 24.859 20.225 45.084 45.084 45.084h421.832c24.859 0 45.084-20.225 45.084-45.084v-366.226c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m198.58 188.334-181.344-150.862c-7.75 6.107-13.456 14.691-15.905 24.554l164.142 136.551h33.102z\",\n fill: \"#f40055\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 198.576h33.93l163.447-135.973c-2.325-9.923-7.93-18.592-15.613-24.796l-181.764 151.211z\",\n fill: \"#c20044\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m165.472 313.425-164.141 136.549c2.449 9.863 8.155 18.447 15.905 24.553l181.344-150.861-.005-10.241z\",\n fill: \"#f40055\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 313.425v9.557l181.765 151.211c7.683-6.204 13.288-14.874 15.613-24.796l-163.446-135.971z\",\n fill: \"#c20044\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m53.273 27.803 145.302 120.879v-120.879z\",\n fill: \"#406bd4\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 150.571v-122.768h148.082z\",\n fill: \"#3257b0\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m394.732 198.575 117.268-97.556v97.556z\",\n fill: \"#3257b0\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"#406bd4\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 99.317v99.258h119.313z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 313.425v97.699l117.44-97.699z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m50.49 484.197 148.085-122.676v122.676z\"\n}));\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 484.197v-124.139l149.221 124.139z\",\n fill: \"#3257b0\"\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 409.423-115.395-95.998h115.395z\",\n fill: \"#3257b0\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 222.142h-222.142v-194.339h-67.716v194.339h-222.142v67.716h222.142v194.339h67.716v-194.339h222.142z\",\n fill: \"#f40055\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m289.858 222.142v-194.339h-33.858v456.394h33.858v-194.339h222.142v-67.716z\",\n fill: \"#c20044\"\n});\n\nfunction SvgEn(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgEn);\nexport default __webpack_public_path__ + \"static/media/en.9e6dbfb0.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m173.899 31.804h-8.707l-4.397-4h-115.711c-24.859-.001-45.084 20.224-45.084 45.083v366.226c0 24.859 20.225 45.084 45.084 45.084h115.711l6.348-4h6.755v-448.393z\",\n fill: \"#406bd4\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-115.711l-4.523 4h-5.141v448.393h4.141l5.523 4h115.711c24.859 0 45.084-20.225 45.084-45.084v-366.225c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#c20044\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m160.795 27.803h190.409v456.394h-190.409z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m256 27.803h95.205v456.394h-95.205z\",\n fill: \"#cee5f5\"\n});\n\nfunction SvgFr(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n xmlns: \"http://www.w3.org/2000/svg\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgFr);\nexport default __webpack_public_path__ + \"static/media/fr.d0f9280c.svg\";\nexport { ForwardRef as ReactComponent };","import React, { Component } from 'react'\nimport { connect } from 'react-redux'\n\nimport { ReactComponent as EnFlag } from '../../images/flags/en.svg'\nimport { ReactComponent as FrFlag } from '../../images/flags/fr.svg'\nimport { updateLanguage } from '../../actions/index'\n\nexport const languages = [\n {\n name: 'en',\n selected: true,\n flag: ,\n },\n {\n name: 'fr',\n selected: false,\n flag: ,\n },\n]\n\nclass Dropdown extends Component {\n constructor(props) {\n super(props)\n this.state = {\n isOpen: false,\n }\n }\n\n toggleDropdown() {\n this.setState(prevState => ({\n isOpen: !prevState.isOpen,\n }))\n }\n\n render() {\n const { isOpen } = this.state\n const { language: selected, onUpdateLanguage } = this.props\n return (\n
this.toggleDropdown()}>\n
    \n {languages\n .filter(language =>\n isOpen ? language : language.name === selected\n )\n .map(language => (\n onUpdateLanguage(language.name, selected)}\n >\n {language.flag} {language.name}\n \n ))}\n
\n
\n )\n }\n}\n\nexport default connect(\n state => ({\n language: state.language,\n }),\n dispatch => ({\n onUpdateLanguage: (lang, selected) => {\n if (lang !== selected) {\n dispatch(updateLanguage(lang))\n }\n },\n })\n)(Dropdown)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { withTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport LanguageDropdown from './LanguageDropdown'\nimport { apiUrl } from '../../utils'\n\nclass NavBar extends React.PureComponent {\n render() {\n const { admin, isAuthenticated, picture, t, username } = this.props\n return (\n
\n
\n \n \n )\n }\n}\n\nexport default withTranslation()(\n connect(({ user }) => ({\n admin: user.admin,\n isAuthenticated: user.isAuthenticated,\n picture: user.picture,\n username: user.username,\n }))(NavBar)\n)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M468.683,287.265h-69.07c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h69.07 c4.147,0,7.508-3.361,7.508-7.508C476.191,290.626,472.83,287.265,468.683,287.265z\"\n})));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.012,268.377L85.781,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L58.034,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C109.507,275.266,108.499,270.62,105.012,268.377z\"\n})));\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M194.441,268.377L175.21,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.47,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.776l-17.471-11.243 c-3.487-2.245-8.133-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L147.463,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.47,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C198.936,275.266,197.928,270.62,194.441,268.377z\"\n})));\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M283.871,268.377L264.64,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.471-11.243 c-3.486-2.245-8.134-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L236.892,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.886-1.216,6.32-3.446C288.366,275.266,287.358,270.62,283.871,268.377z\"\n})));\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M373.3,268.377L354.069,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L326.322,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C377.795,275.266,376.787,270.62,373.3,268.377z\"\n})));\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M271.792,330.359H15.016V181.642h93.1c4.147,0,7.508-3.361,7.508-7.508c0-4.147-3.361-7.508-7.508-7.508H12.513 C5.613,166.626,0,172.24,0,179.14v153.722c0,6.9,5.613,12.513,12.513,12.513h259.278c4.147,0,7.508-3.361,7.508-7.508 C279.299,333.72,275.939,330.359,271.792,330.359z\"\n})));\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M499.487,166.626H162.174c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h334.811v148.716H323.848 c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h175.64c6.9,0,12.513-5.613,12.513-12.513V179.14 C512.001,172.24,506.387,166.626,499.487,166.626z\"\n})));\n\nfunction SvgPassword(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 512.001 512.001\",\n style: {\n enableBackground: \"new 0 0 512.001 512.001\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgPassword);\nexport default __webpack_public_path__ + \"static/media/password.afe6a2a5.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M339.798,260.429c0.13-0.026,0.257-0.061,0.385-0.094c0.109-0.028,0.219-0.051,0.326-0.084 c0.125-0.038,0.247-0.085,0.369-0.129c0.108-0.039,0.217-0.074,0.324-0.119c0.115-0.048,0.226-0.104,0.338-0.157 c0.109-0.052,0.22-0.1,0.327-0.158c0.107-0.057,0.208-0.122,0.312-0.184c0.107-0.064,0.215-0.124,0.319-0.194 c0.111-0.074,0.214-0.156,0.321-0.236c0.09-0.067,0.182-0.13,0.27-0.202c0.162-0.133,0.316-0.275,0.466-0.421 c0.027-0.026,0.056-0.048,0.083-0.075c0.028-0.028,0.052-0.059,0.079-0.088c0.144-0.148,0.284-0.3,0.416-0.46 c0.077-0.094,0.144-0.192,0.216-0.289c0.074-0.1,0.152-0.197,0.221-0.301c0.074-0.111,0.139-0.226,0.207-0.34 c0.057-0.096,0.118-0.19,0.171-0.289c0.062-0.115,0.114-0.234,0.169-0.351c0.049-0.104,0.101-0.207,0.146-0.314 c0.048-0.115,0.086-0.232,0.128-0.349c0.041-0.114,0.085-0.227,0.12-0.343c0.036-0.118,0.062-0.238,0.092-0.358 c0.029-0.118,0.063-0.234,0.086-0.353c0.028-0.141,0.045-0.283,0.065-0.425c0.014-0.1,0.033-0.199,0.043-0.3 c0.025-0.249,0.038-0.498,0.038-0.748V92.76c0-4.143-3.357-7.5-7.5-7.5h-236.25c-0.066,0-0.13,0.008-0.196,0.01 c-0.143,0.004-0.285,0.01-0.427,0.022c-0.113,0.009-0.225,0.022-0.337,0.037c-0.128,0.016-0.255,0.035-0.382,0.058 c-0.119,0.021-0.237,0.046-0.354,0.073c-0.119,0.028-0.238,0.058-0.356,0.092c-0.117,0.033-0.232,0.069-0.346,0.107 c-0.117,0.04-0.234,0.082-0.349,0.128c-0.109,0.043-0.216,0.087-0.322,0.135c-0.118,0.053-0.235,0.11-0.351,0.169 c-0.099,0.051-0.196,0.103-0.292,0.158c-0.116,0.066-0.23,0.136-0.343,0.208c-0.093,0.06-0.184,0.122-0.274,0.185 c-0.106,0.075-0.211,0.153-0.314,0.235c-0.094,0.075-0.186,0.152-0.277,0.231c-0.09,0.079-0.179,0.158-0.266,0.242 c-0.099,0.095-0.194,0.194-0.288,0.294c-0.047,0.05-0.097,0.094-0.142,0.145c-0.027,0.03-0.048,0.063-0.074,0.093 c-0.094,0.109-0.182,0.223-0.27,0.338c-0.064,0.084-0.13,0.168-0.19,0.254c-0.078,0.112-0.15,0.227-0.222,0.343 c-0.059,0.095-0.12,0.189-0.174,0.286c-0.063,0.112-0.118,0.227-0.175,0.342c-0.052,0.105-0.106,0.21-0.153,0.317 c-0.049,0.113-0.092,0.23-0.135,0.345c-0.043,0.113-0.087,0.225-0.124,0.339c-0.037,0.115-0.067,0.232-0.099,0.349 c-0.032,0.12-0.066,0.239-0.093,0.36c-0.025,0.113-0.042,0.228-0.062,0.342c-0.022,0.13-0.044,0.26-0.06,0.39 c-0.013,0.108-0.019,0.218-0.027,0.328c-0.01,0.14-0.019,0.28-0.021,0.421c-0.001,0.041-0.006,0.081-0.006,0.122v46.252 c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-29.595l66.681,59.037c-0.348,0.245-0.683,0.516-0.995,0.827l-65.687,65.687v-49.288 c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v9.164h-38.75c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h38.75v43.231 c0,4.143,3.357,7.5,7.5,7.5h236.25c0.247,0,0.494-0.013,0.74-0.037c0.115-0.011,0.226-0.033,0.339-0.049 C339.542,260.469,339.67,260.454,339.798,260.429z M330.834,234.967l-65.688-65.687c-0.042-0.042-0.087-0.077-0.13-0.117 l49.383-41.897c3.158-2.68,3.546-7.412,0.866-10.571c-2.678-3.157-7.41-3.547-10.571-0.866l-84.381,71.59l-98.444-87.158h208.965 V234.967z M185.878,179.888c0.535-0.535,0.969-1.131,1.308-1.765l28.051,24.835c1.418,1.255,3.194,1.885,4.972,1.885 c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5 S3.357,170.676,7.5,170.676z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5 S16.482,129.345,20.625,129.345z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z\"\n}));\n\nfunction SvgMailSend(_ref, svgRef) {\n let title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 345.834 345.834\",\n style: {\n enableBackground: \"new 0 0 345.834 345.834\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nconst ForwardRef = /*#__PURE__*/React.forwardRef(SvgMailSend);\nexport default __webpack_public_path__ + \"static/media/mail-send.619079f0.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport { ReactComponent as Password } from '../../images/password.svg'\nimport { ReactComponent as MailSend } from '../../images/mail-send.svg'\n\nexport default function PasswordReset(props) {\n const { t } = useTranslation()\n const { action } = props\n return (\n
\n
\n
\n
\n
\n
\n {action === 'sent' && (\n <>\n
\n \n
\n {t(\n // eslint-disable-next-line max-len\n \"user:Check your email. If your address is in our database, you'll received an email with a link to reset your password.\"\n )}\n \n )}\n {action === 'updated' && (\n <>\n
\n \n
\n \n {/* prettier-ignore */}\n Your password have been updated. Click\n here to log in.\n \n \n )}\n
\n
\n
\n
\n
\n
\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport TimezonePicker from 'react-timezone'\n\nimport Message from '../Common/Message'\nimport { deleteUser, handleProfileFormSubmit } from '../../actions/user'\nimport { history } from '../../index'\nimport { languages } from '../NavBar/LanguageDropdown'\nimport CustomModal from '../Common/CustomModal'\n\nclass ProfileEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.user !== this.props.user) {\n this.initForm()\n }\n }\n\n initForm() {\n const { user } = this.props\n const formData = {}\n Object.keys(user).map(k =>\n user[k] === null\n ? (formData[k] = '')\n : k === 'birth_date'\n ? (formData[k] = format(new Date(user[k]), 'yyyy-MM-DD'))\n : (formData[k] = user[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n if (e.target.name === 'weekm') {\n formData.weekm = e.target.value === 'Monday'\n } else {\n formData[e.target.name] = e.target.value\n }\n this.setState(formData)\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const {\n message,\n onDeleteUser,\n onHandleProfileFormSubmit,\n t,\n user,\n } = this.props\n const { displayModal, formData } = this.state\n return (\n
\n \n FitTrackee - {t('user:Profile Edition')}\n \n {formData.isAuthenticated && (\n
\n {displayModal && (\n {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n

{t('user:Profile Edition')}

\n
\n
\n
\n
\n
{user.username}
\n
\n
\n
\n {\n event.preventDefault()\n onHandleProfileFormSubmit(formData)\n }}\n >\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n \n {\n event.preventDefault()\n this.displayModal(true)\n }}\n >\n {t('user:Delete my account')}\n \n history.push('/profile')}\n >\n {t('common:Cancel')}\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n location: state.router.location,\n message: state.message,\n user: state.user,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username))\n },\n onHandleProfileFormSubmit: formData => {\n dispatch(handleProfileFormSubmit(formData))\n },\n })\n )(ProfileEdit)\n)\n","import {\n endOfMonth,\n endOfWeek,\n endOfYear,\n startOfMonth,\n startOfYear,\n startOfWeek,\n addMonths,\n addWeeks,\n addYears,\n subMonths,\n subWeeks,\n subYears,\n} from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport NoWorkouts from '../Common/NoWorkouts'\nimport Stats from '../Common/Stats'\nimport { workoutColors, translateSports } from '../../utils/workouts'\n\nconst durations = ['week', 'month', 'year']\n\nclass Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n displayedSports: props.sports.map(sport => sport.id),\n statsParams: {\n start: startOfMonth(subMonths(date, 11)),\n end: endOfMonth(date),\n duration: 'month',\n type: 'by_time',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.sports !== prevProps.sports) {\n this.updateDisplayedSports()\n }\n }\n\n updateDisplayedSports() {\n const { sports } = this.props\n this.setState({ displayedSports: sports.map(sport => sport.id) })\n }\n\n handleOnChangeDuration(e) {\n const duration = e.target.name\n\n const date = new Date()\n const start =\n duration === 'year'\n ? startOfYear(subYears(date, 9))\n : duration === 'week'\n ? startOfMonth(subMonths(date, 2))\n : startOfMonth(subMonths(date, 11))\n const end =\n duration === 'year'\n ? endOfYear(date)\n : duration === 'week'\n ? endOfWeek(date)\n : endOfMonth(date)\n this.setState({ statsParams: { duration, end, start, type: 'by_time' } })\n }\n\n handleOnChangeSports(sportId) {\n const { displayedSports } = this.state\n if (displayedSports.includes(sportId)) {\n this.setState({\n displayedSports: displayedSports.filter(s => s !== sportId),\n })\n } else {\n this.setState({ displayedSports: displayedSports.concat([sportId]) })\n }\n }\n\n handleOnClickArrows(forward) {\n const { start, end, duration } = this.state.statsParams\n let newStart, newEnd\n if (forward) {\n newStart =\n duration === 'year'\n ? startOfYear(subYears(start, 1))\n : duration === 'week'\n ? startOfWeek(subWeeks(start, 1))\n : startOfMonth(subMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(subYears(end, 1))\n : duration === 'week'\n ? endOfWeek(subWeeks(end, 1))\n : endOfMonth(subMonths(end, 1))\n } else {\n newStart =\n duration === 'year'\n ? startOfYear(addYears(start, 1))\n : duration === 'week'\n ? startOfWeek(addWeeks(start, 1))\n : startOfMonth(addMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(addYears(end, 1))\n : duration === 'week'\n ? endOfWeek(addWeeks(end, 1))\n : endOfMonth(addMonths(end, 1))\n }\n this.setState({\n statsParams: { duration, end: newEnd, start: newStart, type: 'by_time' },\n })\n }\n\n render() {\n const { displayedSports, statsParams } = this.state\n const { sports, t, user } = this.props\n const translatedSports = translateSports(\n sports.filter(sport => user.sports_list.includes(sport.id)),\n t\n )\n return (\n <>\n \n FitTrackee - {t('statistics:Statistics')}\n \n
\n
\n
{t('statistics:Statistics')}
\n \n
\n
\n

\n this.handleOnClickArrows(true)}\n />\n

\n
\n
\n {durations.map(d => (\n
\n \n
\n ))}\n
\n
\n

\n this.handleOnClickArrows(false)}\n />\n

\n
\n
\n \n
\n {translatedSports.map(sport => (\n \n ))}\n
\n
\n
\n {user.nb_workouts === 0 && }\n
\n \n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n sports: state.sports.data,\n user: state.user,\n }))(Statistics)\n)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Helmet } from 'react-helmet'\nimport { Link } from 'react-router-dom'\n\nimport { history } from '../../index'\n\nexport default function Form(props) {\n const { t } = useTranslation()\n const pageTitle = `user:${props.formType\n .charAt(0)\n .toUpperCase()}${props.formType.slice(1)}`\n return (\n
\n \n FitTrackee - {t(`user:${props.formType}`)}\n \n

{t(pageTitle)}

\n
\n
\n
\n
\n
\n {props.formType === 'register' && !props.isRegistrationAllowed ? (\n
\n
Registration is disabled.
\n
\n history.go(-1)}\n >\n Back\n \n
\n
\n ) : (\n <>\n \n props.handleUserFormSubmit(event, props.formType)\n }\n >\n {props.formType === 'register' && (\n
\n \n
\n )}\n {props.formType !== 'password reset' && (\n
\n \n
\n )}\n {props.formType !== 'reset your password' && (\n <>\n
\n \n
\n {props.formType !== 'login' && (\n
\n \n
\n )}\n \n )}\n \n \n

\n {props.formType === 'login' && (\n \n {t('user:Forgot password?')}\n \n )}\n

\n \n )}\n
\n
\n
\n
\n
\n )\n}\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Redirect } from 'react-router-dom'\n\nimport Form from './Form'\nimport Message from '../Common/Message'\nimport { handleUserFormSubmit } from '../../actions/user'\nimport { isLoggedIn } from '../../utils'\n\nclass UserForm extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {\n username: '',\n email: '',\n password: '',\n password_conf: '',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.pathname !== this.props.location.pathname) {\n this.emptyForm()\n }\n }\n\n emptyForm() {\n const { formData } = this.state\n Object.keys(formData).map(k => (formData[k] = ''))\n this.setState(formData)\n }\n\n onHandleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = e.target.value\n this.setState(formData)\n }\n\n render() {\n const {\n formType,\n isRegistrationAllowed,\n message,\n messages,\n onHandleUserFormSubmit,\n t,\n } = this.props\n const { formData } = this.state\n const { token } = this.props.location.query\n return (\n
\n {isLoggedIn() || (formType === 'password reset' && !token) ? (\n \n ) : (\n
\n \n this.onHandleFormChange(event)}\n handleUserFormSubmit={event => {\n event.preventDefault()\n if (formType === 'password reset') {\n formData.token = token\n }\n onHandleUserFormSubmit(formData, formType)\n }}\n />\n
\n )}\n
\n )\n }\n}\nexport default withTranslation()(\n connect(\n state => ({\n isRegistrationAllowed: state.application.config.is_registration_enabled,\n location: state.router.location,\n message: state.message,\n messages: state.messages,\n }),\n dispatch => ({\n onHandleUserFormSubmit: (formData, formType) => {\n formType =\n formType === 'password reset'\n ? 'password/update'\n : formType === 'reset your password'\n ? 'password/reset-request'\n : formType\n dispatch(handleUserFormSubmit(formData, formType))\n },\n })\n )(UserForm)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../Common/CustomModal'\nimport ProfileDetail from './ProfileDetail'\nimport { getOrUpdateData } from '../../actions'\nimport { deleteUser } from '../../actions/user'\n\nclass UserProfile extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.props.loadUser(this.props.match.params.userName)\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.match.params.userName !== this.props.match.params.userName) {\n this.props.loadUser(this.props.match.params.userName)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const { t, currentUser, onDeleteUser, users } = this.props\n const { displayModal } = this.state\n const [user] = users\n const editable = user ? currentUser.username === user.username : false\n return (\n
\n {displayModal && (\n {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {user && (\n this.displayModal(e)}\n t={t}\n user={user}\n />\n )}\n
\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n currentUser: state.user,\n users: state.users.data,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username, true))\n },\n loadUser: userName => {\n dispatch(getOrUpdateData('getData', 'users', { username: userName }))\n },\n })\n )(UserProfile)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport './App.css'\nimport Admin from './Admin'\nimport Workout from './Workout'\nimport Workouts from './Workouts'\nimport CurrentUserProfile from './User/CurrentUserProfile'\nimport Dashboard from './Dashboard'\nimport Footer from './Footer'\nimport Logout from './User/Logout'\nimport NavBar from './NavBar'\nimport NotFound from './Others/NotFound'\nimport PasswordReset from './User/PasswordReset'\nimport ProfileEdit from './User/ProfileEdit'\nimport Statistics from './Statistics'\nimport UserForm from './User/UserForm'\nimport UserProfile from './User/UserProfile'\nimport { getAppData } from '../actions/application'\n\nclass App extends React.Component {\n constructor(props) {\n super(props)\n this.props = props\n }\n componentDidMount() {\n this.props.loadAppConfig()\n }\n\n render() {\n return (\n
\n \n \n \n }\n />\n }\n />\n }\n />\n }\n />\n }\n />\n }\n />\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n )\n }\n}\nexport default connect(\n () => ({}),\n dispatch => ({\n loadAppConfig: () => {\n dispatch(getAppData('config'))\n },\n })\n)(App)\n","import React from 'react'\nimport { Provider } from 'react-redux'\nimport { ConnectedRouter } from 'connected-react-router'\n\nexport default function Root({ store, history, children }) {\n return (\n \n {children}\n \n )\n}\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n)\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location)\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets;\n // see https://github.com/facebookincubator/create-react-app/issues/2374\n return\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`\n\n if (isLocalhost) {\n // This is running on localhost.\n // Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl)\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl)\n }\n })\n }\n}\n\nfunction registerValidSW(swUrl) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n // eslint-disable-next-line no-console\n console.log('New content is available; please refresh.')\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n // eslint-disable-next-line no-console\n console.log('Content is cached for offline use.')\n }\n }\n }\n }\n })\n .catch(error => {\n console.error('Error during service worker registration:', error)\n })\n}\n\nfunction checkValidServiceWorker(swUrl) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload()\n })\n })\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl)\n }\n })\n .catch(() => {\n // eslint-disable-next-line no-console\n console.log(\n 'No internet connection found. App is running in offline mode.'\n )\n })\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister()\n })\n }\n}\n","const emptyData = {\n data: [],\n}\n\nexport default {\n language: 'en',\n message: '',\n messages: [],\n user: {\n isAuthenticated: false,\n },\n workouts: {\n ...emptyData,\n },\n application: {\n statistics: {},\n config: {\n gpx_limit_import: null,\n is_registration_enabled: null,\n max_single_file_size: null,\n max_users: null,\n max_zip_file_size: null,\n registration: null,\n },\n },\n calendarWorkouts: {\n ...emptyData,\n },\n chartData: [],\n // check if storing gpx content is OK\n gpx: null,\n loading: false,\n records: {\n ...emptyData,\n },\n sports: {\n ...emptyData,\n },\n statistics: {\n data: {},\n },\n users: {\n ...emptyData,\n },\n}\n","import { connectRouter } from 'connected-react-router'\nimport { combineReducers } from 'redux'\n\nimport initial from './initial'\n\nconst handleDataAndError = (state, type, action) => {\n if (action.target !== type) {\n return state\n }\n if (action.type === 'SET_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n }\n }\n if (action.type === 'SET_PAGINATED_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n pagination: action.pagination,\n }\n }\n return state\n}\n\nconst workouts = (state = initial.workouts, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.workouts\n case 'PUSH_WORKOUTS':\n return {\n ...state,\n data: state.data.concat(action.workouts),\n }\n case 'REMOVE_WORKOUT':\n return {\n ...state,\n data: state.data.filter(workout => workout.id !== action.workoutId),\n }\n default:\n return handleDataAndError(state, 'workouts', action)\n }\n}\n\nconst application = (state = initial.application, action) => {\n if (action.type === 'SET_APP_CONFIG') {\n return {\n ...state,\n config: action.data,\n }\n }\n if (action.type === 'SET_APP_STATS') {\n return {\n ...state,\n statistics: action.data,\n }\n }\n return state\n}\n\nconst calendarWorkouts = (state = initial.calendarWorkouts, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.calendarWorkouts\n case 'UPDATE_CALENDAR':\n return {\n ...state,\n data: action.workouts,\n }\n default:\n return handleDataAndError(state, 'calendarWorkouts', action)\n }\n}\n\nconst chartData = (state = initial.chartData, action) => {\n if (action.type === 'SET_CHART_DATA') {\n return action.chartData\n }\n return state\n}\n\nconst gpx = (state = initial.gpx, action) => {\n if (action.type === 'SET_GPX') {\n return action.gpxContent\n }\n return state\n}\n\nconst language = (state = initial.language, action) => {\n if (action.type === 'SET_LANGUAGE') {\n return action.language\n }\n return state\n}\n\nconst loading = (state = initial.loading, action) => {\n if (action.type === 'SET_LOADING') {\n return action.loading\n }\n return state\n}\n\nconst message = (state = initial.message, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'PROFILE_UPDATE_ERROR':\n case 'PICTURE_ERROR':\n case 'SET_ERROR':\n return action.message\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case 'SET_APP_CONFIG':\n case 'SET_RESULTS':\n case '@@router/LOCATION_CHANGE':\n return ''\n default:\n return state\n }\n}\n\nconst messages = (state = initial.messages, action) => {\n switch (action.type) {\n case 'AUTH_ERRORS':\n return action.messages\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case '@@router/LOCATION_CHANGE':\n return []\n default:\n return state\n }\n}\n\nconst records = (state = initial.records, action) => {\n if (action.type === 'LOGOUT') {\n return initial.records\n }\n return handleDataAndError(state, 'records', action)\n}\n\nconst sports = (state = initial.sports, action) => {\n if (action.type === 'UPDATE_SPORT_DATA') {\n return {\n ...state,\n data: state.data.map(sport => {\n if (sport.id === action.data.id) {\n sport.is_active = action.data.is_active\n }\n return sport\n }),\n }\n }\n return handleDataAndError(state, 'sports', action)\n}\n\nconst users = (state = initial.users, action) => {\n if (action.type === 'UPDATE_USER_DATA') {\n return {\n ...state,\n data: state.data.map(user => {\n if (user.username === action.data.username) {\n user.admin = action.data.admin\n }\n return user\n }),\n }\n }\n return handleDataAndError(state, 'users', action)\n}\n\nconst user = (state = initial.user, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'LOGOUT':\n window.localStorage.removeItem('authToken')\n return initial.user\n case 'PROFILE_SUCCESS':\n return action.profil\n default:\n return state\n }\n}\n\nconst statistics = (state = initial.statistics, action) => {\n if (action.type === 'LOGOUT') {\n return initial.statistics\n }\n return handleDataAndError(state, 'statistics', action)\n}\n\nexport default history =>\n combineReducers({\n workouts,\n application,\n calendarWorkouts,\n chartData,\n gpx,\n language,\n loading,\n message,\n messages,\n records,\n router: connectRouter(history),\n sports,\n statistics,\n user,\n users,\n })\n","const routesWithoutAuthentication = [\n '/login',\n '/register',\n '/password-reset',\n '/password-reset/request',\n '/password-reset/sent',\n '/updated-password',\n]\n\nconst updatePath = (toPath, newPath) => {\n if (typeof toPath === 'string' || toPath instanceof String) {\n toPath = newPath\n } else {\n toPath.pathname = newPath\n }\n return toPath\n}\n\nconst pathInterceptor = toPath => {\n if (\n !window.localStorage.authToken &&\n !routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/login')\n }\n if (\n window.localStorage.authToken &&\n routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/')\n }\n return toPath\n}\n\nexport const historyEnhancer = originalHistory => {\n originalHistory.location = pathInterceptor(originalHistory.location)\n return {\n ...originalHistory,\n push: (path, ...args) =>\n originalHistory.push(pathInterceptor(path), ...args),\n replace: (path, ...args) =>\n originalHistory.replace(pathInterceptor(path), ...args),\n }\n}\n","/* eslint-disable react/jsx-filename-extension */\nimport { createBrowserHistory } from 'history'\nimport React from 'react'\nimport { I18nextProvider } from 'react-i18next'\nimport ReactDOM from 'react-dom'\nimport { routerMiddleware } from 'connected-react-router'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport thunk from 'redux-thunk'\n\nimport i18n from './i18n'\nimport App from './components/App'\nimport Root from './components/Root'\nimport registerServiceWorker from './registerServiceWorker'\nimport createRootReducer from './reducers'\nimport { loadProfile } from './actions/user'\nimport { historyEnhancer } from './utils/history'\n\nexport const history = historyEnhancer(createBrowserHistory())\n\nhistory.listen(() => {\n window.scrollTo(0, 0)\n})\n\nexport const rootNode = document.getElementById('root')\n\nexport const store = createStore(\n createRootReducer(history),\n window.__STATE__, // Server state\n (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose)(\n applyMiddleware(routerMiddleware(history), thunk)\n )\n)\n\nif (window.localStorage.authToken !== null) {\n store.dispatch(loadProfile())\n}\n\nReactDOM.render(\n \n \n \n \n ,\n rootNode\n)\nregisterServiceWorker()\n"],"sourceRoot":""} \ No newline at end of file diff --git a/fittrackee/responses.py b/fittrackee/responses.py index 44976aec..b17d6888 100644 --- a/fittrackee/responses.py +++ b/fittrackee/responses.py @@ -32,7 +32,10 @@ class HttpResponse(Response): class GenericErrorResponse(HttpResponse): def __init__( - self, status_code: int, message: str, status: Optional[str] = None + self, + status_code: int, + message: Union[str, List], + status: Optional[str] = None, ) -> None: response = { 'status': 'error' if status is None else status, @@ -46,7 +49,9 @@ class GenericErrorResponse(HttpResponse): class InvalidPayloadErrorResponse(GenericErrorResponse): def __init__( - self, message: Optional[str] = None, status: Optional[str] = None + self, + message: Optional[Union[str, List]] = None, + status: Optional[str] = None, ) -> None: message = 'Invalid payload.' if message is None else message super().__init__(status_code=400, message=message, status=status) diff --git a/fittrackee/tests/application/test_app_config_api.py b/fittrackee/tests/application/test_app_config_api.py index f88431d0..94700540 100644 --- a/fittrackee/tests/application/test_app_config_api.py +++ b/fittrackee/tests/application/test_app_config_api.py @@ -276,3 +276,105 @@ class TestUpdateConfig: 'Max. size of zip archive must be equal or greater than max. size ' 'of uploaded files' ) in data['message'] + + def test_it_raises_error_if_archive_max_size_equals_0( + self, app_with_max_single_file_size: Flask, user_1_admin: User + ) -> None: + client = app_with_max_single_file_size.test_client() + resp_login = client.post( + '/api/auth/login', + data=json.dumps( + dict(email='admin@example.com', password='12345678') + ), + content_type='application/json', + ) + + response = client.patch( + '/api/config', + content_type='application/json', + data=json.dumps( + dict( + max_zip_file_size=0, + ) + ), + headers=dict( + Authorization='Bearer ' + + json.loads(resp_login.data.decode())['auth_token'] + ), + ) + + data = json.loads(response.data.decode()) + assert response.status_code == 400 + assert 'error' in data['status'] + assert ( + 'Max. size of zip archive must be greater than 0' + in data['message'] + ) + + def test_it_raises_error_if_files_max_size_equals_0( + self, app: Flask, user_1_admin: User + ) -> None: + client = app.test_client() + resp_login = client.post( + '/api/auth/login', + data=json.dumps( + dict(email='admin@example.com', password='12345678') + ), + content_type='application/json', + ) + + response = client.patch( + '/api/config', + content_type='application/json', + data=json.dumps( + dict( + max_single_file_size=0, + ) + ), + headers=dict( + Authorization='Bearer ' + + json.loads(resp_login.data.decode())['auth_token'] + ), + ) + + data = json.loads(response.data.decode()) + assert response.status_code == 400 + assert 'error' in data['status'] + assert ( + 'Max. size of uploaded files must be greater than 0' + in data['message'] + ) + + def test_it_raises_error_if_gpx_limit_import_equals_0( + self, app: Flask, user_1_admin: User + ) -> None: + client = app.test_client() + resp_login = client.post( + '/api/auth/login', + data=json.dumps( + dict(email='admin@example.com', password='12345678') + ), + content_type='application/json', + ) + + response = client.patch( + '/api/config', + content_type='application/json', + data=json.dumps( + dict( + gpx_limit_import=0, + ) + ), + headers=dict( + Authorization='Bearer ' + + json.loads(resp_login.data.decode())['auth_token'] + ), + ) + + data = json.loads(response.data.decode()) + assert response.status_code == 400 + assert 'error' in data['status'] + assert ( + 'Max. files in a zip archive must be greater than 0' + in data['message'] + ) diff --git a/fittrackee/tests/fixtures/fixtures_app.py b/fittrackee/tests/fixtures/fixtures_app.py index d46aaeb3..175dcc43 100644 --- a/fittrackee/tests/fixtures/fixtures_app.py +++ b/fittrackee/tests/fixtures/fixtures_app.py @@ -11,11 +11,16 @@ from fittrackee.application.utils import update_app_config_from_database def get_app_config( with_config: Optional[bool] = False, max_workouts: Optional[int] = None, + max_single_file_size: Optional[int] = None, ) -> Optional[AppConfig]: if with_config: config = AppConfig() config.gpx_limit_import = 10 if max_workouts is None else max_workouts - config.max_single_file_size = 1 * 1024 * 1024 + config.max_single_file_size = ( + 1 * 1024 * 1024 + if max_single_file_size is None + else max_single_file_size + ) config.max_zip_file_size = 1 * 1024 * 1024 * 10 config.max_users = 100 db.session.add(config) @@ -27,6 +32,7 @@ def get_app_config( def get_app( with_config: Optional[bool] = False, max_workouts: Optional[int] = None, + max_single_file_size: Optional[int] = None, ) -> Generator: app = create_app() with app.app_context(): @@ -64,6 +70,14 @@ def app_with_max_workouts(monkeypatch: pytest.MonkeyPatch) -> Generator: yield from get_app(with_config=True, max_workouts=2) +@pytest.fixture +def app_with_max_single_file_size( + monkeypatch: pytest.MonkeyPatch, +) -> Generator: + monkeypatch.setenv('EMAIL_URL', 'smtp://none:none@0.0.0.0:1025') + yield from get_app(with_config=True, max_single_file_size=0) + + @pytest.fixture def app_no_config() -> Generator: yield from get_app(with_config=False) diff --git a/fittrackee_client/src/actions/application.js b/fittrackee_client/src/actions/application.js index b511b59a..1749292a 100644 --- a/fittrackee_client/src/actions/application.js +++ b/fittrackee_client/src/actions/application.js @@ -1,6 +1,7 @@ import FitTrackeeGenericApi from '../fitTrackeeApi' import { history } from '../index' -import { setError } from './index' +import { generateIds } from '../utils' +import { emptyMessages, setError } from './index' export const setAppConfig = data => ({ type: 'SET_APP_CONFIG', @@ -12,6 +13,8 @@ export const setAppStats = data => ({ data, }) +const SetAppErrors = messages => ({ type: 'APP_ERRORS', messages }) + export const getAppData = target => dispatch => FitTrackeeGenericApi.getData(target) .then(ret => { @@ -27,14 +30,18 @@ export const getAppData = target => dispatch => }) .catch(error => dispatch(setError(`application|${error}`))) -export const updateAppConfig = formData => dispatch => +export const updateAppConfig = formData => dispatch => { + dispatch(emptyMessages()) FitTrackeeGenericApi.updateData('config', formData) .then(ret => { if (ret.status === 'success') { dispatch(setAppConfig(ret.data)) history.push('/admin/application') + } else if (Array.isArray(ret.message)) { + dispatch(SetAppErrors(generateIds(ret.message))) } else { - dispatch(setError(`application|${ret.message}`)) + dispatch(setError(ret.message)) } }) .catch(error => dispatch(setError(`application|${error}`))) +} diff --git a/fittrackee_client/src/actions/index.js b/fittrackee_client/src/actions/index.js index 6536f79a..d9dfefdd 100644 --- a/fittrackee_client/src/actions/index.js +++ b/fittrackee_client/src/actions/index.js @@ -3,11 +3,16 @@ import i18next from 'i18next' import FitTrackeeApi from '../fitTrackeeApi/index' import { history } from '../index' +export const emptyMessages = () => ({ + type: 'CLEAN_ALL_MESSAGES', +}) + export const setData = (target, data) => ({ type: 'SET_DATA', data, target, }) + export const setPaginatedData = (target, data, pagination) => ({ type: 'SET_PAGINATED_DATA', data, @@ -51,7 +56,7 @@ export const getOrUpdateData = ( dispatch(setLoading(false)) return dispatch(setError(`${target}|Incorrect id`)) } - dispatch(setError('')) + dispatch(emptyMessages()) return FitTrackeeApi[action](target, data) .then(ret => { if (ret.status === 'success') { diff --git a/fittrackee_client/src/components/Admin/AdminApplication.jsx b/fittrackee_client/src/components/Admin/AdminApplication.jsx index 1b5d5a8c..bc9a8ade 100644 --- a/fittrackee_client/src/components/Admin/AdminApplication.jsx +++ b/fittrackee_client/src/components/Admin/AdminApplication.jsx @@ -48,13 +48,16 @@ class AdminApplication extends React.Component { isInEdition, loadAppConfig, message, + messages, onHandleConfigFormSubmit, t, } = this.props const { formData } = this.state return (
- {message && } + {(message || messages) && ( + + )} {Object.keys(formData).length > 0 && (
@@ -209,6 +212,7 @@ class AdminApplication extends React.Component { export default connect( state => ({ message: state.message, + messages: state.messages, }), dispatch => ({ loadAppConfig: () => { diff --git a/fittrackee_client/src/locales/en/messages.json b/fittrackee_client/src/locales/en/messages.json index 0c7f388b..d4191cdc 100644 --- a/fittrackee_client/src/locales/en/messages.json +++ b/fittrackee_client/src/locales/en/messages.json @@ -14,7 +14,10 @@ "Invalid credentials.": "Invalid credentials.", "Invalid payload.": "Invalid payload.", "Invalid token. Please log in again.": "Invalid token. Please log in again.", + "Max. files in a zip archive must be greater than 0": "Max. files in a zip archive must be greater than 0", + "Max. size of uploaded files must be greater than 0": "Max. size of uploaded files must be greater than 0", "Max. size of zip archive must be equal or greater than max. size of uploaded files": "Max. size of zip archive must be equal or greater than max. size of uploaded files", + "Max. size of zip archive must be greater than 0": "Max. size of zip archive must be greater than 0", "No file part.": "No file part.", "No picture.": "No picture.", "No selected file.": "No selected file.", diff --git a/fittrackee_client/src/locales/fr/messages.json b/fittrackee_client/src/locales/fr/messages.json index f90dd789..4995f6f4 100644 --- a/fittrackee_client/src/locales/fr/messages.json +++ b/fittrackee_client/src/locales/fr/messages.json @@ -14,7 +14,10 @@ "Invalid credentials.": "Identifiants invalides.", "Invalid payload.": "Données incorrectes.", "Invalid token. Please log in again.": "Jeton invalide. Merci de vous reconnecter.", + "Max. files in a zip archive must be greater than 0": "Le nombre max. de fichiers dans une archive doit être supérieur à 0", + "Max. size of uploaded files must be greater than 0": "La taille max. des fichiers doit être supérieure à 0", "Max. size of zip archive must be equal or greater than max. size of uploaded files": "La taille max. d'une archive doit être supérieure ou égale à la taille max. d'un fichier", + "Max. size of zip archive must be greater than 0": "La taille max. d'une archive doit être supérieure à 0", "No file part.": "Pas de fichier fourni.", "No picture.": "Pas d'image.", "No selected file.": "Pas de fichier sélectionné.", diff --git a/fittrackee_client/src/reducers/index.js b/fittrackee_client/src/reducers/index.js index dbd9ff2e..b5e1c881 100644 --- a/fittrackee_client/src/reducers/index.js +++ b/fittrackee_client/src/reducers/index.js @@ -108,6 +108,7 @@ const message = (state = initial.message, action) => { case 'PICTURE_ERROR': case 'SET_ERROR': return action.message + case 'CLEAN_ALL_MESSAGES': case 'LOGOUT': case 'PROFILE_SUCCESS': case 'SET_APP_CONFIG': @@ -122,7 +123,9 @@ const message = (state = initial.message, action) => { const messages = (state = initial.messages, action) => { switch (action.type) { case 'AUTH_ERRORS': + case 'APP_ERRORS': return action.messages + case 'CLEAN_ALL_MESSAGES': case 'LOGOUT': case 'PROFILE_SUCCESS': case '@@router/LOCATION_CHANGE':