From bed929ed63cf225338ace79e8cad93c8ddc1a271 Mon Sep 17 00:00:00 2001 From: Brice Zele Date: Mon, 6 Apr 2020 14:46:31 +0100 Subject: [PATCH] Fixing marker position text --- .../app/src/main/assets/index.android.bundle | 2 +- screens/home/Home.js | 28 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/android/app/src/main/assets/index.android.bundle b/android/app/src/main/assets/index.android.bundle index ea7b749e..b7a53b83 100644 --- a/android/app/src/main/assets/index.android.bundle +++ b/android/app/src/main/assets/index.android.bundle @@ -1155,7 +1155,7 @@ __d(function(g,r,i,a,m,e,d){var t,n;t=this,n=function(t){'use strict';return t.d __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.sendDemandeSpecificque=e.sendDemande=e.updateCreditDemand=e.loadMyDemandeCredit=e.loadDemandeCredit=void 0;var o=n(r(d[2])),c=(t(r(d[3])),n(r(d[4]))),s=r(d[5]),u=r(d[6]);r(d[7]).DBEvents,r(d[8]);e.loadDemandeCredit=function(){var t,n,l,p;return o.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,o.default.awrap((0,u.readUser)());case 2:return t=f.sent,n={tag:"credit_demands",id:t.code_membre,lang:c.default.currentLocale(),test:s.isDebugMode},f.next=6,o.default.awrap(fetch(s.demandeActionUrl,{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify(n)}));case 6:return l=f.sent,f.prev=7,console.log(l),f.next=11,o.default.awrap(l.json());case 11:return p=f.sent,console.log(p),f.abrupt("return",p);case 16:return f.prev=16,f.t0=f.catch(7),console.log(l.text()),f.abrupt("return",[]);case 20:case"end":return f.stop()}},null,null,[[7,16]],Promise)};e.loadMyDemandeCredit=function(){var t,n,l,p;return o.default.async(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,o.default.awrap((0,u.readUser)());case 2:return t=f.sent,n={tag:"credit_demands_of_agent",id:t.agentId,lang:c.default.currentLocale(),test:s.isDebugMode},console.log(n),f.next=7,o.default.awrap(fetch(s.demandeActionUrl,{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify(n)}));case 7:return l=f.sent,f.prev=8,console.log(l,"my demande"),f.next=12,o.default.awrap(l.json());case 12:return p=f.sent,console.log(p),f.abrupt("return",p);case 17:return f.prev=17,f.t0=f.catch(8),f.abrupt("return",[]);case 20:case"end":return f.stop()}},null,null,[[8,17]],Promise)};e.updateCreditDemand=function(t,n){var o={tag:"update_ask_credit",phone:t,id:n,lang:c.default.currentLocale(),test:s.isDebugMode};return fetch(s.demandeActionUrl,{method:"POST",headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify(o)}).then(function(t){return t.json()}).then(function(t){return t}).catch(function(t){console.warn(t)})};e.sendDemande=function(t){var n,l,p,f,h;return o.default.async(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,o.default.awrap((0,u.readUser)());case 2:if(void 0===(n=b.sent)||void 0===n.code_parrain||void 0===n.code_membre||n.code_membre===n.code_parrain){b.next=24;break}return l={tag:"ask_credit",phone:n.phone,code:n.code,lang:c.default.currentLocale(),test:s.isDebugMode,montant:t},b.next=7,o.default.awrap(fetch(s.demandeActionUrl,{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify(l)}));case 7:return p=b.sent,f="",b.prev=9,b.next=12,o.default.awrap(p.text());case 12:return f=b.sent,h=JSON.parse(f),b.abrupt("return",h);case 17:return b.prev=17,b.t0=b.catch(9),console.log(p),console.log("error",f),b.abrupt("return",[]);case 22:b.next=25;break;case 24:return b.abrupt("return",-1);case 25:case"end":return b.stop()}},null,null,[[9,17]],Promise)};e.sendDemandeSpecificque=function(t,n,u){var l,p,f;return o.default.async(function(h){for(;;)switch(h.prev=h.next){case 0:return l={tag:"ask_credit",phone:n,test:s.isDebugMode,code:u,montant:t,lang:c.default.currentLocale()},h.next=3,o.default.awrap(fetch(s.demandeActionUrl,{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json'},body:JSON.stringify(l)}));case 3:return p=h.sent,h.prev=4,h.next=7,o.default.awrap(p.json());case 7:return f=h.sent,console.log(f),h.abrupt("return",f);case 12:return h.prev=12,h.t0=h.catch(4),console.log(p),console.warn(h.t0),h.abrupt("return",[]);case 17:case"end":return h.stop()}},null,null,[[4,12]],Promise)}},1149,[4,1,273,15,712,736,711,738,714]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),u=n(r(d[3])),c=n(r(d[4])),l=n(r(d[5])),s=n(r(d[6])),f=n(r(d[7])),v=t(r(d[8])),h=r(d[9]),p=(n(r(d[10])),n(r(d[11]))),k=r(d[12]),y=(n(r(d[13])),r(d[14]),r(d[15])),I=r(d[16]),N=n(r(d[17])),A=n(r(d[18])),O=r(d[19]),T=r(d[20]),C=n(r(d[21])),E=(t(r(d[22])),n(r(d[23]))),S=r(d[24]);r(d[14]);r(d[25]);r(d[26]).DBEvents;var b=r(d[15]),U=(function(t){function n(t){var u;return(0,o.default)(this,n),(u=(0,c.default)(this,(0,l.default)(n).call(this,t)))._renderItem=function(t){if("creditrequest"===t||'historyItemDetails'===t||'filter'===t||'networks'===t)return null;u.state.currentId===t.id&&b.accent;return v.default.createElement(h.TouchableOpacity,{onPress:function(){u.props.navigation.toggleDrawer(),u.setState({currentId:t.id}),u.props.navigation.navigate(t)}},v.default.createElement(h.View,{style:M.content},v.default.createElement(p.default,{name:u.getIcon(t),size:32}),v.default.createElement(h.Text,{style:{marginLeft:20,fontSize:16}},u.getNameItems(t))))},u._onPress=function(t){u.setState({currentId:t.id});var n=u.state.menu.filter(function(t){return t.active})[0];n.active=!1,t.active=!0;var o=[];u.state.menu.forEach(function(u){u.id===n.id?o.push(n):u.id===t.id?o.push(t):o.push(u)}),u.setState({menu:o})},u.state=u.initState(),O.IlinkEmitter.on("menuLink",u.onMenuNavigationEvent.bind((0,s.default)(u))),O.IlinkEmitter.on("userconnect",u.onUserConnect.bind((0,s.default)(u))),O.IlinkEmitter.on("userdisconnect",u.hideSideMenu.bind((0,s.default)(u))),O.IlinkEmitter.on("langueChange",u.updateLangue.bind((0,s.default)(u))),u.configuration=new E.default,u}return(0,f.default)(n,t),(0,u.default)(n,[{key:"retrieveAndroidInformation",value:function(){var t=this;return this.configuration._getData().then(function(n){if(n)N.default.locale=n,(0,I.readUser)().then(function(n){setTimeout(function(){t.updateUser(n)},3e3)});else{var o=C.default.getDeviceLocale();N.default.locale=o.toLowerCase(),(0,I.readUser)().then(function(n){setTimeout(function(){t.updateUser(n)},3e3)}).catch(function(n){t.props.navigation.navigate("Auth")})}}).catch(function(n){var o=C.default.getDeviceLocale();N.default.locale=o.toLowerCase(),(0,I.readUser)().then(function(n){setTimeout(function(){t.updateUser(n)},3e3)}).catch(function(n){t.props.navigation.navigate("Auth")})}),""}},{key:"componentDidMount",value:function(){var t=this.props.navigation.router.childRouters.sta.childRouters;this.setState({items:t}),this.retrieveAndroidInformation()}},{key:"updateLangue",value:function(){this.setState({lang:"change"}),this.forceUpdate()}},{key:"componentWillUnmount",value:function(){}},{key:"onMenuNavigationEvent",value:function(t){}},{key:"onUserConnect",value:function(){var t=this;(0,I.readUser)().then(function(n){null!==n&&void 0!==n&&t.updateUser(n)})}},{key:"onNavigatorEvent",value:function(t){}},{key:"hideSideMenu",value:function(){}},{key:"initState",value:function(){return{user:null,menu:[],currentId:0}}},{key:"getGeolocatedUserMenu",value:function(){return[{title:N.default.t('MAP'),id:0,key:0,icon:'md-map',active:!0},{title:N.default.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:!1},{title:N.default.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:!1},{title:N.default.t('ADD_NETWORK'),id:11,key:11,icon:'md-people',active:!1},{title:N.default.t('CHANGE_INFORMATION'),id:13,key:13,icon:'md-person',active:!1},{title:N.default.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:!1},{title:N.default.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:!1}]}},{key:"getSuperUserMenu",value:function(){return[{title:N.default.t('MAP'),id:0,key:0,icon:'md-map',active:!0},{title:N.default.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:!1},{title:N.default.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:!1},{title:N.default.t('GROUP_MANAGE'),id:5,key:5,icon:'md-people',active:!1},{title:N.default.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:!1},{title:N.default.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:!1}]}},{key:"getHyperUsermenu",value:function(){return[{title:N.default.t('MAP'),id:0,key:0,icon:'md-map',active:!0},{title:N.default.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:!1},{title:N.default.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:!1},{title:N.default.t('GROUP_MANAGE'),id:5,key:5,icon:'md-people',active:!1},{title:N.default.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:!1},{title:N.default.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:!1}]}},{key:"updateUser",value:function(t){var n=[];if(void 0!==t)if(void 0!==t.category)switch(t.category){case"geolocated":n=this.getGeolocatedUserMenu();break;case"super":n=this.getSuperUserMenu();break;case"hyper":n=this.getHyperUsermenu()}else n=this.getUserMenu();this.setState({user:t,menu:n})}},{key:"getUserMenu",value:function(){return[{title:N.default.t('MAP'),id:0,key:0,icon:'md-map',active:!0},{title:N.default.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:!1},{title:N.default.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:!1},{title:N.default.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:!1}]}},{key:"getNameItems",value:function(t){var n=t;switch(t){case"home":n=N.default.t('MAP');break;case'useraccount':n=N.default.t('MY_ACCOUNT');break;case'Historique':n=N.default.t('CREDIT_MANAGE');break;case"superviseurgroup":n=N.default.t('GROUP_MANAGE');break;case"updateinformation":n=N.default.t("CHANGE_INFORMATION");break;case'notificationview':n=N.default.t('NOTIFICATIONS');break;case'configuration':n=N.default.t('CONFIGURATIONS');break;case'addNetwork':n=N.default.t('ADD_NETWORK');break;case'about':n=N.default.t('ABOUT')}return n}},{key:"getIcon",value:function(t){var n="md-map";switch(t){case"home":n="md-map";break;case'useraccount':n="md-person";break;case'Historique':n="md-card";break;case"superviseurgroup":n="md-people";break;case'notificationview':n="md-notifications";break;case"updateinformation":n="md-people";break;case'configuration':n='md-settings';break;case'addNetwork':n="md-people";break;case'about':n='md-contacts'}return n}},{key:"render",value:function(){var t=this,n=this.state.user?this.state.user.firstname:"",o=this.state.user?this.state.user.lastname:"";return this.state.lang||"change"===this.state.lang?(setTimeout(function(){return t.setState({lang:""})},500),v.default.createElement(h.View,null)):v.default.createElement(h.View,{style:w.container},v.default.createElement(h.View,{style:w.headercontent},v.default.createElement(h.Text,{style:w.headerTitle},n),v.default.createElement(h.Text,{style:w.headerTitle},o),v.default.createElement(h.Text,{style:w.headerPhone},this.state.user?""+this.state.user.phone:"")),v.default.createElement(S.ScrollView,{style:{flex:1,height:(0,k.responsiveHeight)(40)}},v.default.createElement(T.SafeAreaView,{forceInset:{top:'always',horizontal:'never'}},this.state.items&&Object.keys(this.state.items).map(function(n,o){return t._renderItem(n)}))),v.default.createElement(A.default,{textStyle:w.btntext,style:w.btnDeconnect,onPress:function(){return t.userDeconnect()}},N.default.t('DISCONNEXION')))}},{key:"userDeconnect",value:function(){var t=this;h.Alert.alert(N.default.t('DISCONNEXION'),N.default.t('DISCONNEXION_TEXT'),[{},{text:N.default.t('NO'),onPress:function(){return console.log('Cancel Pressed')},style:'cancel'},{text:N.default.t('YES'),onPress:function(){(0,I.disconnect)().then(function(){O.IlinkEmitter.emit("userdisconnect"),t.props.navigation.navigate("Auth")})}}],{cancelable:!1})}},{key:"watchUser",value:function(){var t=this;(0,I.readUser)().then(function(n){n.id!==t.state.user.id&&null!==n&&void 0!==n&&t.updateUser(n)})}}]),n})(v.Component);e.default=U,U.navigatorStyle={statusBarColor:y.primaryDarkAdvanced};var M=h.StyleSheet.create({content:{width:(0,k.responsiveWidth)(100),height:50,paddingLeft:20,flexDirection:'row',alignItems:'center'},itemText:{color:'#000000',marginLeft:20,fontSize:(0,k.responsiveFontSize)(2)}}),w=h.StyleSheet.create({container:{flex:1,backgroundColor:"white"},btnDeconnect:{borderColor:"transparent",marginLeft:20,marginRight:20,backgroundColor:b.accent},btntext:{color:"white",fontSize:17,fontWeight:"bold"},headerTitle:{fontSize:14,marginBottom:5,color:"white",fontWeight:'bold'},headerPhone:{fontSize:12,marginBottom:20,color:"white",justifyContent:'flex-end'},listMenu:{paddingTop:15},headercontent:{height:(0,k.responsiveHeight)(30),backgroundColor:y.primary,justifyContent:'flex-end',alignItems:'flex-start',paddingLeft:20},backgroundd_drawer:{backgroundColor:'#000'},listbackground:{},actionButtonIcon:{fontSize:20,height:22,color:'white'},welcome:{fontSize:20,textAlign:'center',margin:10},instructions:{textAlign:'center',color:'#333333',marginBottom:5}})},1150,[4,1,8,9,10,12,11,13,15,18,524,871,527,1151,807,806,711,712,709,766,405,930,404,737,2,808,738]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),u=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.HeaderMenu=void 0;var n=u(r(d[2])),l=u(r(d[3])),f=u(r(d[4])),o=u(r(d[5])),c=u(r(d[6])),v=t(r(d[7])),p=r(d[8]),s=(u(r(d[9])),(function(t){function u(){return(0,n.default)(this,u),(0,f.default)(this,(0,o.default)(u).apply(this,arguments))}return(0,c.default)(u,t),(0,l.default)(u,[{key:"render",value:function(){return v.default.createElement(p.View,null,v.default.createElement(p.Text,null,"Freud"))}}]),u})(v.PureComponent));e.HeaderMenu=s},1151,[4,1,8,9,10,12,13,15,18,68]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),l=n(r(d[3])),s=n(r(d[4])),u=n(r(d[5])),c=n(r(d[6])),f=n(r(d[7])),h=n(r(d[8])),p=t(r(d[9])),y=r(d[10]),k=n(r(d[11])),w=n(r(d[12])),v=r(d[13]),E=r(d[14]),b=r(d[15]),S=r(d[16]),C=r(d[17]),T=n(r(d[18])),P=n(r(d[19])),x=n(r(d[20])),R=n(r(d[21])),N=(r(d[22]),n(r(d[23]))),_=r(d[24]),I=r(d[25]),A=n(r(d[26])),M=n(r(d[27])),L=n(r(d[28])),D=n(r(d[29])),O=n(r(d[30])),B=n(r(d[31])),V=r(d[32]),z=n(r(d[33])),F=n(r(d[34])),U=r(d[35]),H=r(d[36]);r(d[37]);var W={enableHighAccuracy:!0,timeout:2e4,maximumAge:500,useSignificantChanges:!1,distanceFilter:0},j=[{label:"mon Reseau",value:0},{label:"Tout",value:1}],G=r(d[38]),K=r(d[39]),Y=y.Dimensions.get('window'),X=(Y.width,Y.height,(0,E.responsiveHeight)(30)>270?270:(0,E.responsiveHeight)(30)),q=(function(t){function n(t){var f;return(0,l.default)(this,n),(f=(0,s.default)(this,(0,u.default)(n).call(this,t,!0)))._draggedValue=new y.Animated.Value(0),f.renderIcon=function(t){return function(n){n.isActive;return p.default.createElement(L.default,{size:24,color:"white",name:t})}},f.openDrawer=function(){f.props.navigation.openDrawer()},f._retrieveData=function(){var t,n,l;return o.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,o.default.awrap(y.AsyncStorage.getItem('position'));case 3:null!==(t=s.sent)&&((n=JSON.parse(t)).longitudeDelta=.04,n.latitudeDelta=.01,l=JSON.parse(t),f.setState({region:n,oldPosition:l})),s.next=10;break;case 7:s.prev=7,s.t0=s.catch(0),console.warn(s.t0);case 10:case"end":return s.stop()}},null,null,[[0,7]],Promise)},f._storeData=function(t){return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o.default.awrap(y.AsyncStorage.setItem('position',JSON.stringify(t)));case 3:n.next=8;break;case 5:n.prev=5,n.t0=n.catch(0),console.warn(n.t0);case 8:case"end":return n.stop()}},null,null,[[0,5]],Promise)},f.backPressed=function(){return y.Alert.alert(R.default.t('EXIT_TITLE'),R.default.t('EXIT_DESC'),[{text:R.default.t('NO'),onPress:function(){return console.log('Cancel Pressed')},style:'cancel'},{text:R.default.t("YES"),onPress:function(){return y.BackHandler.exitApp()}}],{cancelable:!1}),!0},f.onMapReady=function(){(0,C.readUser)().then(function(t){if(t){f.setState({user:t}),f.setState({network:t.network});var n={latitude:parseFloat(t.latitude),longitude:parseFloat(t.longitude)};f.mapRef.animateCamera({center:{latitude:n.latitude,longitude:n.longitude},pitch:0,heading:0,altitude:5,zoom:12},1e3),t.category?(f.setState({loadingDialog:!1}),"geolocated"!==t.category?f.showMyMembers():n.latitude<=0&&n.longitude<=0&&f.props.navigation.push(K.updateinfo)):'android'===y.Platform.OS?f.requestCameraPermission():(f.getPosition(),f.watchLocation())}}).catch(function(t){console.log("ERROR LOADING USER",t.message)})},f.renderRow=function(t){return p.default.createElement(y.TouchableOpacity,{key:t,onPress:function(){return f.onRowPress(t)}},p.default.createElement(y.View,{style:Z.rowContainer},p.default.createElement(y.View,{style:Z.iconContainer},p.default.createElement(L.default,{name:f.state.filternetworkTemp&&t.name===f.state.filternetworkTemp.name?'radio-button-checked':'radio-button-unchecked',color:f.state.filternetworkTemp&&t.name===f.state.filternetworkTemp.name?G.accent:f.props.colorAccent,size:24})),p.default.createElement(y.Text,{style:b.material.subheading},t.name)))},f.state=f.geInitialState(),f.mounted=!1,f.filterOptions=[{value:5,label:"5 km"},{value:15,label:"15 km"},{value:20,label:"20 km"},{value:25,label:"25 km"}],L.default.getImageSource('md-car',24,'white').then(function(t){f.setState({caricon:t})}),f._renderFavoriteIcon=f._renderFavoriteIcon.bind((0,c.default)(f)),f.makeMarkerInformation=f.makeMarkerInformation.bind((0,c.default)(f)),f}return(0,h.default)(n,t),(0,f.default)(n,[{key:"onLoadMore",value:function(){var t=this,n=this.state,l=n.user;n.prevRegion,n.boundarie;void 0!==l.category&&null!==l.category||(this.promiseRegion&&this.promiseRegion.done(),this.promiseRegion=new Promise(function(n,s){var u,c,f,h,p;return o.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return t.setState({isNeedLoadMore:!1,isLoadingMap:!0}),s.next=3,o.default.awrap(t.mapRef.getCamera());case 3:if(u=s.sent,u.zoom-10,c=[],t.setState({isLoadingMap:!0}),void 0!==t.state.filternetworkTemp&&(f=t.state.filternetworkTemp.id,c=t.state.networks.filter(function(t){return t.id===f})),!(c.length>0)){s.next=24;break}return c[0],h={longitude:l.longitude,latitude:l.latitude},s.prev=11,s.next=14,o.default.awrap(t.loadingMarkers(t.state.myPosition,t.state.filternetwork,t.state.value));case 14:p=s.sent,t.treatNewData(h,p,!1),s.next=22;break;case 18:s.prev=18,s.t0=s.catch(11),console.debug(s.t0.message),t.setState({isNeedLoadMore:!1,isLoadingMap:!1});case 22:s.next=25;break;case 24:t.setState({isNeedLoadMore:!0,isLoadingMap:!1});case 25:t.map&&t.map.focusToUser(),n();case 27:case"end":return s.stop()}},null,null,[[11,18]],Promise)}))}},{key:"onslidingEvent",value:function(t){this.setState({maxHeightSliding:t.nativeEvent.layout.height})}},{key:"componentDidMount",value:function(){var t=this;this.mounted=!0,this.configuration=new N.default;var n=this.props.navigation;this.markerManager=new F.default,this.configuration.getCurrentPubValue().then(function(n){try{var o=parseInt(n);t.setState({isPubShow:o})}catch(t){}}),this.focusListener=n.addListener("didFocus",function(){t.configuration.getCurrentPasValue().then(function(n){try{t.setState({pas:parseInt(n)})}catch(t){}}),t.componentDidAppear()}),this.blurListener=n.addListener("didBlur",function(n){t.componentDidDisappear()}),this._retrieveData(),this.props.coordinate}},{key:"requestCameraPermission",value:function(){var t=this;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o.default.awrap(y.PermissionsAndroid.request(y.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,{title:'Cool Photo App Camera Permission',message:"Cool Photo App needs access to your camera so you can take awesome pictures."}));case 3:n.sent===y.PermissionsAndroid.RESULTS.GRANTED?((0,C.readUser)().then(function(n){if(console.log("MAP READY"),n)if(void 0!==n.category&&null!==n.category){var o={latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude)},l={latitude:o.latitude,longitude:o.longitude,latitudeDelta:.03,longitudeDelta:.01};t.setState({myPosition:o}),t.mapRef.animateToCoordinate({latitude:o.latitude,longitude:o.longitude},1e3),t.mapRef.animateToRegion(l,1e3),t.setState({isLoading:!1,isLoadingMap:!1,loadingDialog:!1}),"geolocated"!==n.category?t.showMyMembers():o.latitude<=0&&o.longitude<=0&&t.props.navigation.push(K.updateinfo)}else t.getPosition(),t.watchLocation()}),console.log("Camera permission granted")):console.log("Camera permission denied"),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.log(n.t0);case 10:case"end":return n.stop()}},null,null,[[0,7]],Promise)}},{key:"watchLocation",value:function(){var t=this;this.watchID=D.default.watchPosition(function(n){var o=t.state.myPosition,l=n.coords;t.state.oldPosition;o&&l.longitude===o.longitude&&l.latitude===o.latitude||(0!==l.longitude&&0!==l.latitude&&t._storeData(l),((0,P.default)(t.state.region,{})||(0,P.default)(t.state.region,void 0)||(0,P.default)(t.state.region,null))&&(t.state.myPosition.longitude||t.state.myPosition.latitude||null!==t.mapRef&&void 0!==t.mapRef&&(t.mapRef.animateToRegion({latitude:l.latitude,longitude:l.longitude,latitudeDelta:.03,longitudeDelta:.01},1e3),t.mapRef.animateCamera({center:t.myPosition,pitch:0,heading:0,altitude:0,zoom:12},1e3))),t.setState({region:{latitude:l.latitude,longitude:l.longitude,latitudeDelta:.003,longitudeDelta:.004}}),t.setState({myPosition:l}),t.map&&t.map.focusToUser())},function(t){return console.log("wat s",t)},W)}},{key:"getNetworks",value:function(t){var n=this;if(t)(0,C.getCountryNetwork)(t).then(function(o){n.reseaux=[];var l=o;for(var s in l)n.reseaux.push(l[s]);n.setState({networks:n.reseaux});var u=n.reseaux.filter(function(t){return t.name.includes(n.state.network)});void 0!==n.state.user.category&&null!==n.state.user.category||(console.log(n.state.user),u.length>0&&t?(n.setState({filternetwork:u[0],myNetwork:u[0],filternetworkTemp:u[0]}),n.retrieveAllPoint(t)):(console.log("on getnetworks",o),n.state.user&&(n.state.user.category||y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){null!==t&&void 0!==t?n.getNetworks(t):n.requestCameraPermission()}}],{cancelable:!1}))))},function(o){console.log("error getnetwork"+e.message),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){null!==t&&void 0!==t?n.getNetworks(t):n.requestCameraPermission()}}],{cancelable:!1})});else{console.log("get network missing pays");y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){n.requestCameraPermission()}}],{cancelable:!1})}}},{key:"getPosition",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;console.log("on get position"),D.default.getCurrentPosition(function(o){var l=t.state.myPosition,s=o.coords;t.state.oldPosition;if(!(0,P.default)(s,l)&&0!==s.longitude&&0!==s.latitude||l){t.map&&t.map.focusToUser(),(0,S.getPositionInformation)(s).then(function(o){if(o)if(void 0!==o.results){if(o.results.length>0){var l=o.results[0],s=l.address_components,u=l.formatted_address,c=l.place_id;t.setState({address:s,textadress:u,place:c});for(var f,h,p=o.results,k=0;k=v.length)break;S=v[b++]}else{if((b=v.next()).done)break;S=b.value}var C=S;C.code===f&&(t.setState({indicatif:C.dial_code}),t.getNetworks(C.dial_code))}}}else console.log("on else result null "),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){t.getPosition(n)}}],{cancelable:!1});else y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){t.getPosition(n)}}],{cancelable:!1})});var u={latitude:s.latitude,longitude:s.longitude,latitudeDelta:.03,longitudeDelta:.01};t.setState({myPosition:s,region:u}),t.mapRef&&!t.state.myPositionIsAnimated&&(t.mapRef.animateCamera({center:s,pitch:0,heading:0,altitude:5,zoom:13},1e3),t.setState({myPositionIsAnimated:!0}))}else console.warn("errror")},function(n){switch(console.warn(n.message),n.code){case 3:t.state.oldPosition&&t.treatPosition(t.state.oldPosition);break;default:console.log("onjjj",n.message)}},W)}},{key:"componentDidDisappear",value:function(){y.BackHandler.removeEventListener('hardwareBackPress',this.backPressed)}},{key:"componentDidAppear",value:function(){var t=this;y.BackHandler.addEventListener('hardwareBackPress',this.backPressed),(0,C.readUser)().then(function(n){if(n&&n.category){t.setState({user:n}),t.setState({network:n.network});var o={latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude)};t.setState({myPosition:o}),t.refocusMap(!1)}})}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.blurListener.remove(),this.focusListener.remove(),this.watchID&&D.default.clearWatch(this.watchID)}}]),(0,f.default)(n,[{key:"makeCardSearch",value:function(){var t=this;if(!this.state.isPubShow)return p.default.createElement(y.View,{style:Z.topBar},p.default.createElement(V.Surface,{style:{elevation:4,borderRadius:10}},p.default.createElement(y.View,{style:{flexDirection:'row',alignSelf:'center',justifyContent:'center',flex:1,borderRadius:10,margin:10,alignItems:'center',height:48}},p.default.createElement(y.TouchableOpacity,{onPress:function(){return t.openDrawer()}},p.default.createElement(y.Text,{style:Z.hambuger},"Menu")),p.default.createElement(y.View,{style:{flex:1}}),p.default.createElement(y.Text,{style:{backgroundColor:this.state.myNetwork.id===this.state.filternetwork.id?G.primary:G.accent,padding:5,color:"white",marginRight:10,fontSize:10,borderRadius:12}},this.state.filternetwork.name?this.state.filternetwork.name:this.state.network),this.renderSupplementInformation()),this.showLoadingMapView()))}},{key:"renderSupplementInformation",value:function(){var t=this;return this.state.user&&"geolocated"===this.state.user.category?p.default.createElement(y.View,null):p.default.createElement(y.View,{style:{flexDirection:"row"}},p.default.createElement(y.View,{style:{backgroundColor:"#FFFFFFA0",justifyContent:'center',alignItems:'center',alignSelf:'center'}},p.default.createElement(y.Text,null,this.state.markers.length+" "+(0===this.state.currentNetworkSize?"":"/"+this.state.currentNetworkSize)," ")),p.default.createElement(y.TouchableOpacity,{onPress:function(){t.setState({page:t.state.page+1}),t.onLoadMore()},style:{borderRadius:12,height:32,width:32,backgroundColor:"white",borderColor:"transparent"}},p.default.createElement(L.default,{name:this.state.markers.length>=this.state.currentNetworkSize?"close":"refresh",size:32,color:this.state.markers.length>=this.state.currentNetworkSize?"red":"grey"})))}},{key:"_renderMarker2",value:function(){var t=this,n=this.state,o=n.currentMarker,l=n.myPosition,s=o,u={latitude:parseFloat(o.latitude),longitude:parseFloat(o.longitude)},c=H.getDistance(l,u),f=(c>900?c/1e3+" Km":c+"m")+R.default.t('TO_YOU'),h=null===s.lastname?s.adresse:s.lastname;return p.default.createElement(y.View,{style:{flex:1,backgroundColor:"white"}},p.default.createElement(y.View,{style:{flexDirection:"row",justifyContent:"flex-end",alignItems:'center',backgroundColor:"white"}},p.default.createElement(y.Text,{style:Q.title},h),p.default.createElement(L.default.Button,{name:"close",size:24,color:"red",backgroundColor:"transparent",onPress:function(){t.toggleSlidingUp(!1)}})),p.default.createElement(y.Text,{style:Q.subtitle2},s.adresse),p.default.createElement(y.View,{style:{flexDirection:"row",alignItems:"center"}},p.default.createElement(y.Text,{style:Q.reseau},s.network),p.default.createElement(y.Text,{style:Q.solde},R.default.t('SOLDE_UNVAIBLE'))),p.default.createElement(y.Text,{style:Q.reseau},f),p.default.createElement(y.View,{style:{flexDirection:'row',marginTop:(0,E.responsiveHeight)(3),marginLeft:10}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(30),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return t.callItem(s)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))))}},{key:"_renderItemMarkerdetails",value:function(t){var n=this,o=t;if(void 0!==o&&null!==o){var l=this.state,s=l.currentMarker,u=l.myPosition,c={latitude:parseFloat(s.latitude),longitude:parseFloat(s.longitude)},f=H.getDistance(u,c),h=(f>900?f/1e3+" Km":f+"m")+R.default.t('TO_YOU'),k=null===o.lastname?o.adresse:o.lastname;return p.default.createElement(v.CardView,{style:Q.container,cardElevation:2,cardMaxElevation:2,cornerRadius:5},p.default.createElement(y.View,{style:{flexDirection:"row",justifyContent:"flex-end",alignItems:'center'}},p.default.createElement(y.Text,{style:Q.title},k),p.default.createElement(L.default.Button,{name:"close",size:24,color:"red",backgroundColor:"transparent",onPress:function(){n.toggleSlidingUp(!1)}})),p.default.createElement(y.Text,{style:Q.subtitle2},o.adresse),p.default.createElement(y.View,{style:{flexDirection:"row",alignItems:"center"}},p.default.createElement(y.Text,{style:Q.reseau},o.network),p.default.createElement(y.Text,{style:Q.solde},R.default.t('SOLDE_UNVAIBLE'))),p.default.createElement(y.Text,{style:Q.reseau},h),p.default.createElement(y.View,{style:{flexDirection:'row',marginTop:(0,E.responsiveHeight)(3),marginLeft:10}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(30),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return n.callItem(o)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))))}}},{key:"renderCurrentMarker",value:function(t){var n=this;if(t)return p.default.createElement(y.View,null,p.default.createElement(y.View,{style:{flexDirection:"row",justifyContent:"flex-end",alignItems:'center'}},p.default.createElement(y.Text,{style:Q.title},name),p.default.createElement(L.default.Button,{name:"close",size:24,color:"red",backgroundColor:"transparent",on:!0,dPress:function(){n.toggleSlidingUp(!1)}})),p.default.createElement(y.Text,{style:Q.title},t.adresse),p.default.createElement(y.View,{style:{flexDirection:"row"}},p.default.createElement(y.Text,{style:Q.reseau},t.network),p.default.createElement(y.Text,{style:Q.solde},R.default.t('SOLDE_UNVAIBLE'))),p.default.createElement(y.Text,{style:Q.reseau},distanceTxt),p.default.createElement(y.View,{style:{flexDirection:'row',marginTop:(0,E.responsiveHeight)(3),marginLeft:10}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(30),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return n.callItem(t)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))))}},{key:"callItem",value:function(t){var n={number:t.phone,prompt:!1};(0,M.default)(n).catch(function(t){return console.log(t)})}},{key:"makeMarkerInformation",value:function(){var t=this.state,n=t.currentMarker;t.myPosition;return void 0!==n&&null!==n?this._renderItemMarkerdetails(n):p.default.createElement(y.Text,null,"Impossible de'afficher l'element")}},{key:"makeActionButon",value:function(){var t=this.state.user;if(t)switch(t.category){case"super":return this.getSuperActionButton();case"geolocated":return this.geoLocatedAction();case"hyper":return this.getHypervisorActionButton();default:return this.getSimpleActionButton()}}},{key:"getSuperActionButton",value:function(){var t=this;return p.default.createElement(w.default,{buttonColor:G.accent},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("MY_GROUP"),onPress:function(){return t.showMyMembers()},size:48},p.default.createElement(L.default,{name:"group-work",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap(!1)},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:G.primary,title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"layers",style:Z.actionButtonIcon})))}},{key:"getSimpleActionButton",value:function(){var t=this;return p.default.createElement(w.default,{ref:function(n){return t.actionButton=n}},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("FILTER"),onPress:function(){return t.showFilterDialog()},size:48},p.default.createElement(L.default,{name:"filter-list",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap(!1)},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#9b59b6",title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"layers",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("PRINT_MY_NETWORK"),size:48,onPress:function(){t.showMynetworkMap()}},p.default.createElement(L.default,{name:"group-work",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("CHANGE_NETWORK"),size:48,onPress:function(){t.showNewDialogNetwork()}},p.default.createElement(L.default,{name:"rss-feed",style:Z.actionButtonIcon})))}},{key:"toggleSlidingUp",value:function(t){var n=this;t&&this.bottomSheetRef?(this.bottomSheetRef.snapTo(1),this.setState({showcurentMarker:t})):t||this.bottomSheetRef.snapTo(0);var o=t?X:0,l=t?0:X;this.setState({panelVisible:t}),!t&&this.state.needRoad&&this.setState({needRoad:!1}),this.state.animation.setValue(o),y.Animated.timing(this.state.animation,{toValue:l,duration:200}).start(function(o){!t&&n.map&&n.map.focusToUser()})}},{key:"makeSlidingUp",value:function(){var t=this;return p.default.createElement(z.default,{ref:function(n){t.bottomSheetRef=n},snapPoints:[0,"30%"],renderHeader:function(){return t.markerView()}})}},{key:"_renderFavoriteIcon",value:function(){var t=this,n=this.props.draggableRange,o=n.top,l=n.bottom,s=[{scale:this._draggedValue.interpolate({inputRange:[l,o],outputRange:[1,0],extrapolate:'clamp'})}];return p.default.createElement(y.TouchableNativeFeedback,{onPress:function(){t.setState({needRoad:!0})}},p.default.createElement(y.Animated.View,{style:[Z.favoriteIcon,{transform:s}]},p.default.createElement(L.default,{name:"car",size:24,color:"white",style:{alignSelf:'center'}})))}},{key:"geInitialState",value:function(){return{region:{latitude:0,longitude:0,latitudeDelta:.015,longitudeDelta:.0121},pas:100,prevRegion:{latitude:0,longitude:0},isPubShow:!0,loadingDialog:!0,textreach:"",currentNetworkSize:0,markersearchfilter:[],animation:new y.Animated.Value(0),myPosition:null,currentMarker:null,filterNetworkOption:j[1],needRoad:!1,initialAnim:!1,filternetwork:{},destinationPosition:{},panelVisible:!1,markers:[],isNeedLoadMore:!1,isLoadingMap:!1,value:5,page:0,valuePosition:0,markerfilter:null,allpoint:[],typeMap:'standard',indexTypeMap:0,user:null,snack_visible:!1,snack_text_message:"",networks:[],dialogSliderVisible:!1,showProgress:!1,myNetwork:{},dialogNetworkVisible:!1,myPositionMarkerText:R.default.t("YOUR_THERE")}}},{key:"onMarkerPress",value:function(t){console.warn(t),this.setState({currentMarker:t}),this.toggleSlidingUp(!0)}},{key:"onMapTypeChange",value:function(){var t={index:this.state.indexTypeMap,text:this.state.typeMap};switch(t.index=t.index+1,t.index=t.index%3,t.index){default:t.text='standard';break;case 1:t.text='hybrid';break;case 2:t.text="terrain"}this.setState({indexTypeMap:t.index,typeMap:t.text})}},{key:"showInterticiel",value:function(){var t=this;if(this.state.isPubShow)return p.default.createElement(O.default,{closeIntersticiel:function(){return t.setState({isPubShow:!1})},navigation:this.props.navigation})}},{key:"renderBottomHome",value:function(){var t=this;return p.default.createElement(y.View,{style:{flex:1,backgroundColor:"lightblue"}},p.default.createElement(k.default,{ref:function(n){t.map=n,null!=n&&(t.mapRef=n.getMapRef())},typeMap:this.state.typeMap,onMarkerClick:function(n){return t.onMarkerPress(n)},network:this.state.filternetwork,initialRegion:this.state.region,markers:this.state.markers,selectedMarker:this.state.currentMarker,myNetwork:this.state.myNetwork,lang:this.state.lang,myPosition:this.state.myPosition,onMapReady:function(){(0,C.readUser)().then(function(n){n&&(t.setState({user:n}),t.setState({network:n.network}),n.category?(t.setState({loadingDialog:!1}),"geolocated"!==n.category?t.showMyMembers():myPosition.latitude<=0&&myPosition.longitude<=0&&t.props.navigation.push(K.updateinfo)):'android'===y.Platform.OS?t.requestCameraPermission():t.watchLocation())})},needRoad:this.state.needRoad,onNeedRoadReady:function(n){t.setState({showProgress:!1})},onNeedRoadError:function(n){t.setState({showProgress:!1}),y.Alert.alert(R.default.t("PROBLEM_OCCUR"),R.default.t("PROBLEM_OCCUR_DIRECTION"),[{text:"Ok",onPress:function(){}}])}}),this.makeCardSearch(),p.default.createElement(z.default,{ref:function(n){t.bottomSheetRef=n},snapPoints:[60,"30%","100%"],renderHeader:function(){return t.renderHeader()}}))}},{key:"renderInner",value:function(){return p.default.createElement(y.View,{style:{flex:1,backgroundColor:"green"}},p.default.createElement(y.Text,null,"Freud junior"))}},{key:"markerView",value:function(){if(this.state.currentMarker)return this._renderMarker2()}},{key:"renderHeader",value:function(){var t=this;return p.default.createElement(p.default.Fragment,null,p.default.createElement(y.View,{style:{position:"absolute",width:32,height:this.state.currentMarker?200:100,bottom:80,right:0,justifyContent:'center'}},p.default.createElement(w.default,{size:32,style:{marginRight:15},buttonColor:"white"}),p.default.createElement(w.default,{size:42,renderIcon:function(){return p.default.createElement(L.default,{name:"group-work",style:Z.actionButtonIcon})},style:{marginTop:40,marginRight:20},buttonColor:G.primary})),p.default.createElement(y.View,{style:{flex:1,backgroundColor:"white"}},this.markerView(),this.renderFilterMarker(),p.default.createElement(y.View,{style:{flexDirection:'row',height:60,justifyContent:'space-evenly',alignItems:'flex-end'}},p.default.createElement(y.View,{style:{flexDirection:'row',flex:1,marginBottom:10,justifyContent:'space-around',alignItems:'flex-end'}},p.default.createElement(V.FAB,{small:!0,icon:this.state.showFilterDistance?"close":"filter",color:G.primary,style:{backgroundColor:"white"},onPress:function(){t.state.showFilterDistance?(t.bottomSheetRef.snapTo(0),t.setState({showFilterDistance:!1})):(t.bottomSheetRef.snapTo(2),t.setState({showFilterDistance:!0}))}}),p.default.createElement(V.FAB,{small:!0,icon:"add",color:"white",style:{backgroundColor:G.primary},onPress:function(){t.bottomSheetRef.snapTo(2),t.setState({showdialogNetworkVisible:!0})}})),this.makeMarkerButton())))}},{key:"renderFilterMarker",value:function(){var t=this;if(this.state.showFilterDistance)return p.default.createElement(y.View,{style:{height:(0,E.responsiveHeight)(80),justifyContent:'center',backgroundColor:'white',margin:20}},p.default.createElement(y.View,{style:{height:(0,E.responsiveHeight)(30),justifyContent:'center'}},p.default.createElement(y.Text,null,R.default.t('TEXT_FILTER_DISTANCE')," "),p.default.createElement(A.default,{items:this.filterOptions,defaultItem:this.state.valuePosition,labelPosition:"bottom",onSlidingComplete:function(n){return t.slidingComplete(n)}}),p.default.createElement(y.Text,null,p.default.createElement(y.Text,{style:{fontWeight:"bold"}},void 0===this.state.value?0:this.state.value)," km ",R.default.t("DISTANCE_ARROUND"))),p.default.createElement(y.View,{style:{flexDirection:"row",flex:1}},p.default.createElement(x.default,{style:{flex:1}}),p.default.createElement(x.default,{style:{flex:1}})))}},{key:"makeMarkerButton",value:function(){var t=this;return this.state.currentMarker?p.default.createElement(y.View,{style:{flex:2,flexDirection:'row',justifyContent:'flex-end',marginEnd:20}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(26),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return t.callItem(marker)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))):p.default.createElement(y.View,{style:{flex:2,flexDirection:'row',justifyContent:'flex-end',marginEnd:20}})}},{key:"renderOldHome",value:function(){var t=this;return p.default.createElement(y.View,{style:Z.container},p.default.createElement(y.StatusBar,{backgroundColor:"#00000030",barStyle:"light-content",translucent:!0}),this.state.loadingDialog?p.default.createElement(y.View,{style:{position:"absolute",zIndex:1,backgroundColor:"#00000050",width:this.state.loadingDialog?(0,E.responsiveWidth)(100):0,height:this.state.loadingDialog?(0,E.responsiveHeight)(100):0,flex:1,justifyContent:'center',alignItems:'center'}},p.default.createElement(y.Text,{style:{fontSize:20,color:'white',fontWeight:'bold'}},R.default.t("LOADING_DOTS"))):null,p.default.createElement(k.default,{ref:function(n){t.map=n,null!=n&&(t.mapRef=n.getMapRef())},typeMap:this.state.typeMap,onMarkerClick:function(n){return t.onMarkerPress(n)},network:this.state.filternetwork,initialRegion:this.state.region,markers:this.state.markers,selectedMarker:this.state.currentMarker,myNetwork:this.state.myNetwork,lang:this.state.lang,myPosition:this.state.myPosition,onMapReady:'android'===y.Platform.OS?this.onMapReady:null,onLayout:'ios'===y.Platform.OS?this.onMapReady:null,needRoad:this.state.needRoad,onNeedRoadReady:function(n){t.setState({showProgress:!1})},onNeedRoadError:function(n){t.setState({showProgress:!1}),y.Alert.alert(R.default.t("PROBLEM_OCCUR"),R.default.t("PROBLEM_OCCUR_DIRECTION"),[{text:"Ok",onPress:function(){}}])}}),this.makeCardSearch(),this.makeSlidingUp(),this.makeDialogLoader(),this.makeDistanceDialog(),this.makeNetworkChangeDialog(),p.default.createElement(B.default,{visible:this.state.snack_visible,textMessage:this.state.snack_text_message,autoHidingTime:5e3}),this.makeActionButon())}},{key:"renderTutoOldHome",value:function(){return p.default.createElement(y.View,{style:{flex:1}},p.default.createElement(CopilotStep,{text:"This is a hello world example!",order:1,name:"hello"},this.makeCardSearch()))}},{key:"render",value:function(){return this.renderOldHome()}},{key:"renderCurrentMarker",value:function(){if(this.state.currentMarker)return p.default.createElement(y.View,{style:{height:200,backgroundColor:'#fff'}},this.makeMarkerInformation())}},{key:"makeDialogLoader",value:function(){return p.default.createElement(I.ProgressDialog,{visible:this.state.showProgress,title:R.default.t("LOADING_PROGRESS"),message:R.default.t("WAITING_LONG"),animationType:"slide",activityIndicatorSize:"large",activityIndicatorColor:"blue"})}},{key:"showMynetworkMap",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=null===n?this.state.user:n,l=this.state.myNetwork;return this.setState({filternetwork:l,page:0,filternetworkTemp:l,loadingDialog:!0}),new Promise(function(){void 0!==l?t.loadingMarkers(t.state.myPosition,l,t.state.value).then(function(n){var l=n||[];if(t.setState({loadingDialog:!1}),void 0!==o.category&&null!==o.category){var s=l.filter(function(t){return t.code_parrain===o.code_membre});t.treatNewData(t.state.myPosition,s,!0)}else t.treatNewData(t.state.myPosition,l,!0)}).catch(function(n){t.setState({loadingDialog:!1}),console.log("error j"),console.log(n)}):(t.setState({loadingDialog:!1}),console.log("error no net"))})}},{key:"showMyMembers",value:function(){var t=this,n=this.state.user.code_membre;void 0!==n?(0,S.loadGroupeAgent)(n).then(function(n){if(1===n.success)return t.setState({markers:n.datas})}):console.log("error")}},{key:"slidingComplete",value:function(t){this.setState({value:this.filterOptions[t].value,valuePosition:t})}},{key:"makeDistanceDialog",value:function(){var t=this;return p.default.createElement(_.MaterialDialog,{visible:this.state.dialogSliderVisible,title:R.default.t('MENU_FILTER'),onOk:function(){t.setState({dialogSliderVisible:!1,showProgress:!0}),setTimeout(function(){return t.filterPoint()},300)},cancelLabel:R.default.t("QUIT_"),okLabel:R.default.t('FILTER'),onCancel:function(){t.setState({dialogSliderVisible:!1})},onTouchOutside:function(){return t.setState({dialogSliderVisible:!1})}},p.default.createElement(y.Text,null,R.default.t('TEXT_FILTER_DISTANCE')," "),p.default.createElement(A.default,{items:this.filterOptions,defaultItem:this.state.valuePosition,labelPosition:"bottom",onSlidingComplete:function(n){return t.slidingComplete(n)}}),p.default.createElement(y.Text,null,p.default.createElement(y.Text,{style:{fontWeight:"bold"}},void 0===this.state.value?0:this.state.value)," km ",R.default.t("DISTANCE_ARROUND")))}},{key:"showFilterDialog",value:function(){this.setState({dialogSliderVisible:!0})}},{key:"filterPoint",value:function(){var t,n,l,s,u,c=this;return o.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:t=this.state,n=t.value,l=t.myPosition,t.user,s=t.filternetwork,void 0!==n?(this.setState({page:0}),1e3*n,u=this.state.networks.filter(function(t){return t.id===s.id}),u[0],this.loadingMarkers(l,s,n).then(function(t){c.treatNewData(c.state.prevRegion,t,!0)}).catch(function(t){c.setState({showProgress:!1}),y.Alert.alert(R.default.t("ERROR_FILTER"),R.default.t("ERROR_FILTER_TEXT"),[{text:R.default.t("CANCEL")},{text:R.default.t("RESTART"),onPress:function(){c.filterPoint()}}])})):(this.setState({showProgress:!1}),this.setState({snack_visible:!0,snack_text_message:"impossible de filtrer les \xe9lements"}),setTimeout(function(){c.setState({snack_visible:!1})},5e3));case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"userChangeMarker",value:function(t){var n=this.state.markers[t];if(null!==this.mapRef&&void 0!==this.mapRef){var o={latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude),latitudeDelta:.03,longitudeDelta:.01};this.mapRef.animateToCoordinate({latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude)},1e3),this.mapRef.animateToRegion(o,1e3),console.log(n)}}},{key:"geoLocatedAction",value:function(){var t=this;return p.default.createElement(w.default,{buttonColor:G.accent},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap()},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:G.primary,title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"layers",style:Z.actionButtonIcon})))}},{key:"makeNetworkChangeDialog",value:function(){var t=this;return p.default.createElement(_.MaterialDialog,{title:R.default.t("CHOICE_NETWORK"),visible:this.state.dialogNetworkVisible,subtitle:R.default.t("CHOICE_NETWORK_TEXT"),onCancel:function(){return t.setState({dialogNetworkVisible:!1})},onOk:function(n){t.setState({dialogNetworkVisible:!1,page:0}),t.setState({showProgress:!0,filternetwork:t.state.filternetworkTemp}),setTimeout(function(){return t.showFilterNetwork()},500)}},p.default.createElement(y.FlatList,{style:{height:(0,E.responsiveHeight)(40)},data:this.state.networks,renderItem:function(n){var o=n.item;return t.renderRow(o)}}))}},{key:"onRowPress",value:function(t){this.setState({filternetworkTemp:t})}},{key:"showNewDialogNetwork",value:function(){this.setState({dialogNetworkVisible:!0})}},{key:"showFilterNetwork",value:function(){var t,n,l,s=this;return o.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:t=this.state,n=t.myPosition,t.user,void 0!==(l=t.filternetwork)?(this.setState({showProgress:!0}),this.loadingMarkers(this.state.myPosition,l,this.state.value,0).then(function(t){s.setState({showProgress:!1}),s.treatNewData(n,t,!0)}).catch(function(t){s.setState({snack_visible:!0,snack_text_message:"Probleme de connexion"}),console.log(t)})):console.log("error no net");case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"showBtnItineraire",value:function(){var t=this;return p.default.createElement(x.default,{style:{backgroundColor:G.primary,width:(0,E.responsiveWidth)(30),height:36,borderRadius:100,marginLeft:5,borderColor:"transparent",justifyContent:'center'},onPress:function(){t.setState({needRoad:!0,showProgress:!0})}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"near-me",size:16,color:"white",style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'white',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("WAY"))))}},{key:"showBtnClose",value:function(){var t=this;return p.default.createElement(x.default,{style:{backgroundColor:G.reddeconnect,height:36,width:(0,E.responsiveWidth)(30),borderRadius:100,borderColor:"transparent",justifyContent:'center'},onPress:function(){t.setState({needRoad:!1,showProgress:!1})}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"close",size:16,color:"white",style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'white',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CANCEL"))))}},{key:"getHypervisorActionButton",value:function(){var t=this;return p.default.createElement(w.default,{buttonColor:G.accent},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap(!1)},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:G.primary,title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"map",style:Z.actionButtonIcon})))}},{key:"moveToMarker",value:function(t){this.mapRef.animateToCoordinate({latitude:parseFloat(t.latitude),longitude:parseFloat(t.longitude)},1e3),this.setState({textreach:t.lastname,texta:!0}),this.setState({markersearchfilter:[]}),this.onMarkerPress(t)}},{key:"refocusMap",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.mapRef&&void 0!==this.state.myPosition&&this.mapRef.animateCamera({center:{latitude:this.state.myPosition.latitude,longitude:this.state.myPosition.longitude},pitch:0,heading:0},1e3):this.mapRef&&void 0!==this.state.myPosition&&this.mapRef.animateCamera({center:{latitude:this.state.myPosition.latitude,longitude:this.state.myPosition.longitude},pitch:0,heading:0,altitude:5,zoom:12},1e3),this.map&&this.map.focusToUser()}},{key:"renderCardSeashItem",value:function(t){var n=this;return p.default.createElement(y.TouchableOpacity,{key:t.id,style:{margin:5},onPress:function(){n.moveToMarker(t)}},p.default.createElement(y.Text,{style:{flex:1,fontSize:14,color:"#000"}},null===t.firstname?t.adresse:t.firstname),p.default.createElement(y.Text,{style:{flex:1,fontSize:12}},t.lastname),p.default.createElement(y.Text,{style:{flex:1,fontSize:13,alignSelf:'flex-end',color:G.accent}},t.network))}},{key:"retrieveAllPoint",value:function(t){var n=this;(0,S.getMakersFrom)(t).then(function(o){new Promise(function(t,l){try{var s=o.datas;n.setState({allpoint:s,loadingDialog:!1}),t(s)}catch(t){console.warn(t.message),l(new Error(t.message))}}).then(function(t){n.onLoadMore()}).catch(function(o){n.setState({loadingDialog:!1}),console.log("on get marker"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){n.setState({loadingDialog:!0}),null!==t&&void 0!==t?n.retrieveAllPoint(t):n.requestCameraPermission()}}],{cancelable:!1})})}).catch(function(o){console.log("on retreive>getmarkers",o.message),n.setState({loadingDialog:!1}),n.state.allpoint.length<=0&&(console.log("no point"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){n.state.allpoint.length<=0&&(n.setState({loadingDialog:!0}),null!==t&&void 0!==t?n.retrieveAllPoint(t):n.requestCameraPermission())}}],{cancelable:!1}))})}},{key:"showLoadMoreView",value:function(){var t=this;if(this.state.isNeedLoadMore)return p.default.createElement(y.View,{style:{flex:1,flexDirection:'row',width:(0,E.responsiveWidth)(90)}},p.default.createElement(x.default,{onPress:function(){t.setState({page:t.state.page+1}),t.onLoadMore()},style:{borderRadius:48,height:48,width:48,backgroundColor:"white",borderColor:"transparent",alignItems:"center",justifyContent:"center"}},p.default.createElement(L.default,{name:"refresh",size:32})),p.default.createElement(y.View,{style:{backgroundColor:"#FFFFFFA0",width:(0,E.responsiveWidth)(20),height:30,borderRadius:12,justifyContent:'center',alignItems:'center',alignSelf:'center'}},p.default.createElement(y.Text,null,(this.state.markers.length,this.state.markers.length)," / ",this.state.currentNetworkSize," ")))}},{key:"showLoadingMapView",value:function(){if(this.state.isLoadingMap)return p.default.createElement(y.View,{style:{flexDirection:'row',margin:10,width:(0,E.responsiveWidth)(95),backgroundColor:'white',justifyContent:"center",alignSelf:"center"}},p.default.createElement(y.Text,{style:{fontSize:12,alignSelf:'center'}},R.default.t("LOADING_TEXT_MARKERS")+" "+this.state.value+" km "+R.default.t("DISTANCE_ARROUND")),p.default.createElement(y.ProgressBarAndroid,{style:{alignSelf:'center'}}))}},{key:"loadingMarkers",value:function(t,n,o){var l=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return new Promise(function(u,c){var f=l.state.allpoint,h=void 0!==s?s:l.state.page,p=f.filter(function(l,s){var u={longitude:parseFloat(l.longitude),latitude:parseFloat(l.latitude)};return H.getDistance(t,u)<=1e3*o&&l.network===n.name}).slice(0,(h+1)*l.state.pas);try{var y=f.filter(function(l,s){var u={longitude:parseFloat(l.longitude),latitude:parseFloat(l.latitude)};return H.getDistance(t,u)<=1e3*o&&l.network===n.name});l.setState({currentNetworkSize:y.length,currentNetworkMarkers:y})}catch(t){console.debug("after "+t.message)}console.debug("data:",p,"value"+1e3*o),u(p)})}},{key:"treatNewData",value:function(t,n){var o=this,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.setState({isLoadingMap:!1});var s=n;if(n.length>0){var u=s;l&&this.setState({showProgress:!1}),u.length>0&&this.setState({markers:u,prevRegion:t}),s.length0){var o=n.results[0],l=o.address_components,u=o.formatted_address,c=o.place_id;s.setState({address:l,textadress:u,place:c});for(var f,h,p=n.results,k=0;k=v.length)break;S=v[b++]}else{if((b=v.next()).done)break;S=b.value}var C=S;C.code===f&&(s.setState({indicatif:C.dial_code}),s.getNetworks(C.dial_code))}}}else console.log("on treat 1"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){s.treatPosition(t)}}],{cancelable:!1});else console.log("on treat 2"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){s.treatPosition(t)}}],{cancelable:!1})}).catch(function(n){console.log("on treat 3"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){s.treatPosition(t)}}],{cancelable:!1})}),l={latitude:t.latitude,longitude:t.longitude,latitudeDelta:.03,longitudeDelta:.01},this.setState({myPosition:t,region:l}),this.mapRef&&!this.state.myPositionIsAnimated&&(this.mapRef.animateCamera({center:t,pitch:0,heading:0,altitude:5,zoom:13},1e3),this.setState({myPositionIsAnimated:!0})));case 3:case"end":return o.stop()}},null,this,null,Promise)}}]),n})(T.default);q.navigationOptions=function(t){return{headerMode:"none",headerStyle:{display:'none'},header:null,drawerLabel:t.navigation.getParam("name",R.default.t('MAP')),drawerIcon:function(t){var n=t.tintColor;return p.default.createElement(L.default,{name:'map',size:24,color:n})}}},q.defaultProps={draggableRange:{top:(0,E.responsiveHeight)(30),bottom:0},panel:null};var J=q;e.default=J;var Q=y.StyleSheet.create({solde:{backgroundColor:G.accent,color:"white",marginLeft:10,padding:5,fontSize:9,borderRadius:100},title:{color:'black',marginLeft:10,flex:1,fontSize:11,fontWeight:'bold'},subtitle2:{color:'black',marginLeft:10,flex:1,fontSize:10,fontWeight:'bold'},subtitle:{color:'black',marginLeft:9,fontSize:9},otherInformation:{marginLeft:13,fontSize:9},reseau:{marginLeft:10,fontWeight:'bold',color:G.accent,fontSize:10},container:{flex:1,width:(0,E.responsiveWidth)(95),alignSelf:"center",paddingTop:(0,E.responsiveHeight)(1),marginBottom:(0,E.responsiveHeight)(1),backgroundColor:"white",justifyContent:'flex-start'}}),Z=y.StyleSheet.create({container:{flex:1,backgroundColor:'#FFF'},panelContainer:{position:'absolute',top:0,bottom:0,left:0,right:0},panel:{height:600,padding:20,backgroundColor:'#f7f5eee8'},header:{backgroundColor:'#f7f5eee8',shadowColor:'#000000',paddingTop:20,borderTopLeftRadius:20,borderTopRightRadius:20},panelHandle:{width:40,height:8,borderRadius:4,backgroundColor:'#00000040',marginBottom:10},panelTitle:{fontSize:27,height:35},panelSubtitle:{fontSize:14,color:'gray',height:30,marginBottom:10},panelButton:{padding:20,borderRadius:10,backgroundColor:'#318bfb',alignItems:'center',marginVertical:10},panelButtonTitle:{fontSize:17,fontWeight:'bold',color:'white'},fab:{position:'absolute',margin:16,right:0,bottom:0},networkname:{backgroundColor:G.primary,padding:5,color:"white",marginRight:10,fontSize:10,borderRadius:12},myClusterTextStyle:{color:"white"},myClusterStyle:{backgroundColor:G.accent,height:32,justifyContent:'center',alignItems:'center',width:32,borderRadius:16},rowContainer:{height:52,flex:1,flexDirection:'row',justifyContent:'flex-start',alignItems:'center'},iconContainer:{marginRight:16},mapmarker:{width:52,height:52},slidingup:{backgroundColor:"transparent",position:"absolute",height:X,bottom:0,left:(0,E.responsiveWidth)(2.5),width:(0,E.responsiveWidth)(95),zIndex:1},panelHeader:{height:120,backgroundColor:'#b197fc',alignItems:'center',justifyContent:'center'},favoriteIcon:{left:(0,E.responsiveWidth)(75),backgroundColor:G.primary,width:64,justifyContent:'center',alignContent:'center',bottom:-64,position:'absolute',height:64,padding:8,zIndex:1,borderRadius:32},hambuger:{color:G.primary,borderColor:G.primary,borderWidth:1,alignSelf:'center',padding:5},topBar:{position:'absolute',alignSelf:'center',justifyContent:'center',borderRadius:10,alignItems:'center',marginTop:(0,E.responsiveHeight)(4),width:(0,E.responsiveWidth)(90)},searchInput:{flex:1,fontSize:14},search:{width:(0,E.responsiveWidth)(70),height:(0,E.responsiveHeight)(10),backgroundColor:'#00000000'},map:{width:(0,E.responsiveWidth)(100),height:(0,E.responsiveHeight)(100)},backgroundd_drawer:{backgroundColor:'#000'},cardsearch:{width:(0,E.responsiveWidth)(90),height:(0,E.responsiveHeight)(10),position:'absolute',alignSelf:'center',marginTop:5},actionButtonIcon:{fontSize:20,height:22,color:'white'},welcome:{fontSize:20,textAlign:'center',margin:10},instructions:{textAlign:'center',color:'#333333',marginBottom:5}})},1152,[4,1,273,8,10,12,11,9,13,15,18,1153,524,528,527,771,764,711,815,681,709,712,766,737,768,1373,1378,1379,827,804,826,1380,1029,1384,1444,813,1471,808,806,807]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),l=n(r(d[3])),s=n(r(d[4])),u=n(r(d[5])),c=n(r(d[6])),f=n(r(d[7])),h=n(r(d[8])),p=t(r(d[9])),y=r(d[10]),k=n(r(d[11])),w=n(r(d[12])),v=r(d[13]),E=r(d[14]),b=r(d[15]),S=r(d[16]),C=r(d[17]),T=n(r(d[18])),P=n(r(d[19])),x=n(r(d[20])),R=n(r(d[21])),N=(r(d[22]),n(r(d[23]))),_=r(d[24]),I=r(d[25]),M=n(r(d[26])),A=n(r(d[27])),L=n(r(d[28])),D=n(r(d[29])),O=n(r(d[30])),B=n(r(d[31])),V=r(d[32]),z=n(r(d[33])),F=n(r(d[34])),U=r(d[35]),H=r(d[36]);r(d[37]);var W={enableHighAccuracy:!0,timeout:2e4,maximumAge:500,useSignificantChanges:!1,distanceFilter:0},j=[{label:"mon Reseau",value:0},{label:"Tout",value:1}],G=r(d[38]),K=r(d[39]),Y=y.Dimensions.get('window'),X=(Y.width,Y.height,(0,E.responsiveHeight)(30)>270?270:(0,E.responsiveHeight)(30)),q=(function(t){function n(t){var f;return(0,l.default)(this,n),(f=(0,s.default)(this,(0,u.default)(n).call(this,t,!0)))._draggedValue=new y.Animated.Value(0),f.renderIcon=function(t){return function(n){n.isActive;return p.default.createElement(L.default,{size:24,color:"white",name:t})}},f.openDrawer=function(){f.props.navigation.openDrawer()},f._retrieveData=function(){var t,n,l;return o.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,o.default.awrap(y.AsyncStorage.getItem('position'));case 3:null!==(t=s.sent)&&((n=JSON.parse(t)).longitudeDelta=.04,n.latitudeDelta=.01,l=JSON.parse(t),f.setState({region:n,oldPosition:l})),s.next=10;break;case 7:s.prev=7,s.t0=s.catch(0),console.warn(s.t0);case 10:case"end":return s.stop()}},null,null,[[0,7]],Promise)},f._storeData=function(t){return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o.default.awrap(y.AsyncStorage.setItem('position',JSON.stringify(t)));case 3:n.next=8;break;case 5:n.prev=5,n.t0=n.catch(0),console.warn(n.t0);case 8:case"end":return n.stop()}},null,null,[[0,5]],Promise)},f.backPressed=function(){return y.Alert.alert(R.default.t('EXIT_TITLE'),R.default.t('EXIT_DESC'),[{text:R.default.t('NO'),onPress:function(){return console.log('Cancel Pressed')},style:'cancel'},{text:R.default.t("YES"),onPress:function(){return y.BackHandler.exitApp()}}],{cancelable:!1}),!0},f.onMapReady=function(){(0,C.readUser)().then(function(t){if(t){f.setState({user:t}),f.setState({network:t.network});var n={latitude:parseFloat(t.latitude),longitude:parseFloat(t.longitude)};f.setState({myPosition:n}),f.refocusMap(!1),t.category?(f.setState({loadingDialog:!1}),"geolocated"!==t.category?f.showMyMembers():n.latitude<=0&&n.longitude<=0&&f.props.navigation.push(K.updateinfo)):'android'===y.Platform.OS?f.requestCameraPermission():(f.getPosition(),f.watchLocation())}}).catch(function(t){console.log("ERROR LOADING USER",t.message)})},f.renderRow=function(t){return p.default.createElement(y.TouchableOpacity,{key:t,onPress:function(){return f.onRowPress(t)}},p.default.createElement(y.View,{style:Z.rowContainer},p.default.createElement(y.View,{style:Z.iconContainer},p.default.createElement(L.default,{name:f.state.filternetworkTemp&&t.name===f.state.filternetworkTemp.name?'radio-button-checked':'radio-button-unchecked',color:f.state.filternetworkTemp&&t.name===f.state.filternetworkTemp.name?G.accent:f.props.colorAccent,size:24})),p.default.createElement(y.Text,{style:b.material.subheading},t.name)))},f.state=f.geInitialState(),f.mounted=!1,f.filterOptions=[{value:5,label:"5 km"},{value:15,label:"15 km"},{value:20,label:"20 km"},{value:25,label:"25 km"}],L.default.getImageSource('md-car',24,'white').then(function(t){f.setState({caricon:t})}),f._renderFavoriteIcon=f._renderFavoriteIcon.bind((0,c.default)(f)),f.makeMarkerInformation=f.makeMarkerInformation.bind((0,c.default)(f)),f}return(0,h.default)(n,t),(0,f.default)(n,[{key:"onLoadMore",value:function(){var t=this,n=this.state,l=n.user;n.prevRegion,n.boundarie;void 0!==l.category&&null!==l.category||(this.promiseRegion&&this.promiseRegion.done(),this.promiseRegion=new Promise(function(n,s){var u,c,f,h,p;return o.default.async(function(s){for(;;)switch(s.prev=s.next){case 0:return t.setState({isNeedLoadMore:!1,isLoadingMap:!0}),s.next=3,o.default.awrap(t.mapRef.getCamera());case 3:if(u=s.sent,u.zoom-10,c=[],t.setState({isLoadingMap:!0}),void 0!==t.state.filternetworkTemp&&(f=t.state.filternetworkTemp.id,c=t.state.networks.filter(function(t){return t.id===f})),!(c.length>0)){s.next=24;break}return c[0],h={longitude:l.longitude,latitude:l.latitude},s.prev=11,s.next=14,o.default.awrap(t.loadingMarkers(t.state.myPosition,t.state.filternetwork,t.state.value));case 14:p=s.sent,t.treatNewData(h,p,!1),s.next=22;break;case 18:s.prev=18,s.t0=s.catch(11),console.debug(s.t0.message),t.setState({isNeedLoadMore:!1,isLoadingMap:!1});case 22:s.next=25;break;case 24:t.setState({isNeedLoadMore:!0,isLoadingMap:!1});case 25:t.map&&t.map.focusToUser(),n();case 27:case"end":return s.stop()}},null,null,[[11,18]],Promise)}))}},{key:"onslidingEvent",value:function(t){this.setState({maxHeightSliding:t.nativeEvent.layout.height})}},{key:"componentDidMount",value:function(){var t=this;this.mounted=!0,this.configuration=new N.default;var n=this.props.navigation;this.markerManager=new F.default,this.configuration.getCurrentPubValue().then(function(n){try{var o=parseInt(n);t.setState({isPubShow:o})}catch(t){}}),this.focusListener=n.addListener("didFocus",function(){t.configuration.getCurrentPasValue().then(function(n){try{t.setState({pas:parseInt(n)})}catch(t){}}),t.componentDidAppear()}),this.blurListener=n.addListener("didBlur",function(n){t.componentDidDisappear()}),this._retrieveData(),this.props.coordinate}},{key:"requestCameraPermission",value:function(){var t=this;return o.default.async(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o.default.awrap(y.PermissionsAndroid.request(y.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,{title:'Cool Photo App Camera Permission',message:"Cool Photo App needs access to your camera so you can take awesome pictures."}));case 3:n.sent===y.PermissionsAndroid.RESULTS.GRANTED?((0,C.readUser)().then(function(n){if(console.log("MAP READY"),n)if(void 0!==n.category&&null!==n.category){var o={latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude)},l={latitude:o.latitude,longitude:o.longitude,latitudeDelta:.03,longitudeDelta:.01};t.setState({myPosition:o}),t.mapRef.animateToCoordinate({latitude:o.latitude,longitude:o.longitude},1e3),t.mapRef.animateToRegion(l,1e3),t.setState({isLoading:!1,isLoadingMap:!1,loadingDialog:!1}),"geolocated"!==n.category?t.showMyMembers():o.latitude<=0&&o.longitude<=0&&t.props.navigation.push(K.updateinfo)}else t.getPosition(),t.watchLocation()}),console.log("Camera permission granted")):console.log("Camera permission denied"),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.log(n.t0);case 10:case"end":return n.stop()}},null,null,[[0,7]],Promise)}},{key:"watchLocation",value:function(){var t=this;this.watchID=D.default.watchPosition(function(n){var o=t.state.myPosition,l=n.coords;t.state.oldPosition;o&&l.longitude===o.longitude&&l.latitude===o.latitude||(0!==l.longitude&&0!==l.latitude&&t._storeData(l),((0,P.default)(t.state.region,{})||(0,P.default)(t.state.region,void 0)||(0,P.default)(t.state.region,null))&&(t.state.myPosition.longitude||t.state.myPosition.latitude||null!==t.mapRef&&void 0!==t.mapRef&&(t.mapRef.animateToRegion({latitude:l.latitude,longitude:l.longitude,latitudeDelta:.03,longitudeDelta:.01},1e3),t.mapRef.animateCamera({center:t.myPosition,pitch:0,heading:0,altitude:0,zoom:12},1e3))),t.setState({region:{latitude:l.latitude,longitude:l.longitude,latitudeDelta:.003,longitudeDelta:.004}}),t.setState({myPosition:l}),t.map&&t.map.focusToUser())},function(t){return console.log("wat s",t)},W)}},{key:"getNetworks",value:function(t){var n=this;if(t)(0,C.getCountryNetwork)(t).then(function(o){n.reseaux=[];var l=o;for(var s in l)n.reseaux.push(l[s]);n.setState({networks:n.reseaux});var u=n.reseaux.filter(function(t){return t.name.includes(n.state.network)});void 0!==n.state.user.category&&null!==n.state.user.category||(console.log(n.state.user),u.length>0&&t?(n.setState({filternetwork:u[0],myNetwork:u[0],filternetworkTemp:u[0]}),n.retrieveAllPoint(t)):(console.log("on getnetworks",o),n.state.user&&(n.state.user.category||y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){null!==t&&void 0!==t?n.getNetworks(t):n.requestCameraPermission()}}],{cancelable:!1}))))},function(o){console.log("error getnetwork"+e.message),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){null!==t&&void 0!==t?n.getNetworks(t):n.requestCameraPermission()}}],{cancelable:!1})});else{console.log("get network missing pays");y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){n.requestCameraPermission()}}],{cancelable:!1})}}},{key:"getPosition",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;console.log("on get position"),D.default.getCurrentPosition(function(o){var l=t.state.myPosition,s=o.coords;t.state.oldPosition;if(!(0,P.default)(s,l)&&0!==s.longitude&&0!==s.latitude||l){t.map&&t.map.focusToUser(),(0,S.getPositionInformation)(s).then(function(o){if(o)if(void 0!==o.results){if(o.results.length>0){var l=o.results[0],s=l.address_components,u=l.formatted_address,c=l.place_id;t.setState({address:s,textadress:u,place:c});for(var f,h,p=o.results,k=0;k=v.length)break;S=v[b++]}else{if((b=v.next()).done)break;S=b.value}var C=S;C.code===f&&(t.setState({indicatif:C.dial_code}),t.getNetworks(C.dial_code))}}}else console.log("on else result null "),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){t.getPosition(n)}}],{cancelable:!1});else y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){t.getPosition(n)}}],{cancelable:!1})});var u={latitude:s.latitude,longitude:s.longitude,latitudeDelta:.03,longitudeDelta:.01};t.setState({myPosition:s,region:u}),t.mapRef&&!t.state.myPositionIsAnimated&&(t.mapRef.animateCamera({center:s,pitch:0,heading:0,altitude:5,zoom:12},1e3),t.setState({myPositionIsAnimated:!0}))}else console.warn("errror")},function(n){switch(console.warn(n.message),n.code){case 3:t.state.oldPosition&&t.treatPosition(t.state.oldPosition);break;default:console.log("onjjj",n.message)}},W)}},{key:"componentDidDisappear",value:function(){y.BackHandler.removeEventListener('hardwareBackPress',this.backPressed)}},{key:"componentDidAppear",value:function(){var t=this;y.BackHandler.addEventListener('hardwareBackPress',this.backPressed),(0,C.readUser)().then(function(n){if(n&&n.category){t.setState({user:n}),t.setState({network:n.network});var o={latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude)};t.setState({myPosition:o}),t.refocusMap(!0)}})}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.blurListener.remove(),this.focusListener.remove(),this.watchID&&D.default.clearWatch(this.watchID)}}]),(0,f.default)(n,[{key:"makeCardSearch",value:function(){var t=this;if(!this.state.isPubShow)return p.default.createElement(y.View,{style:Z.topBar},p.default.createElement(V.Surface,{style:{elevation:4,borderRadius:10}},p.default.createElement(y.View,{style:{flexDirection:'row',alignSelf:'center',justifyContent:'center',flex:1,borderRadius:10,margin:10,alignItems:'center',height:48}},p.default.createElement(y.TouchableOpacity,{onPress:function(){return t.openDrawer()}},p.default.createElement(y.Text,{style:Z.hambuger},"Menu")),p.default.createElement(y.View,{style:{flex:1}}),p.default.createElement(y.Text,{style:{backgroundColor:this.state.myNetwork.id===this.state.filternetwork.id?G.primary:G.accent,padding:5,color:"white",marginRight:10,fontSize:10,borderRadius:12}},this.state.filternetwork.name?this.state.filternetwork.name:this.state.network),this.renderSupplementInformation()),this.showLoadingMapView()))}},{key:"renderSupplementInformation",value:function(){var t=this;return this.state.user&&"geolocated"===this.state.user.category?p.default.createElement(y.View,null):p.default.createElement(y.View,{style:{flexDirection:"row"}},p.default.createElement(y.View,{style:{backgroundColor:"#FFFFFFA0",justifyContent:'center',alignItems:'center',alignSelf:'center'}},p.default.createElement(y.Text,null,this.state.markers.length+" "+(0===this.state.currentNetworkSize?"":"/"+this.state.currentNetworkSize)," ")),p.default.createElement(y.TouchableOpacity,{onPress:function(){t.setState({page:t.state.page+1}),t.onLoadMore()},style:{borderRadius:12,height:32,width:32,backgroundColor:"white",borderColor:"transparent"}},p.default.createElement(L.default,{name:this.state.markers.length>=this.state.currentNetworkSize?"close":"refresh",size:32,color:this.state.markers.length>=this.state.currentNetworkSize?"red":"grey"})))}},{key:"_renderMarker2",value:function(){var t=this,n=this.state,o=n.currentMarker,l=n.myPosition,s=o,u={latitude:parseFloat(o.latitude),longitude:parseFloat(o.longitude)},c=H.getDistance(l,u),f=(c>900?c/1e3+" Km":c+"m")+R.default.t('TO_YOU'),h=null===s.lastname?s.adresse:s.lastname;return p.default.createElement(y.View,{style:{flex:1,backgroundColor:"white"}},p.default.createElement(y.View,{style:{flexDirection:"row",justifyContent:"flex-end",alignItems:'center',backgroundColor:"white"}},p.default.createElement(y.Text,{style:Q.title},h),p.default.createElement(L.default.Button,{name:"close",size:24,color:"red",backgroundColor:"transparent",onPress:function(){t.toggleSlidingUp(!1)}})),p.default.createElement(y.Text,{style:Q.subtitle2},s.adresse),p.default.createElement(y.View,{style:{flexDirection:"row",alignItems:"center"}},p.default.createElement(y.Text,{style:Q.reseau},s.network),p.default.createElement(y.Text,{style:Q.solde},R.default.t('SOLDE_UNVAIBLE'))),p.default.createElement(y.Text,{style:Q.reseau},f),p.default.createElement(y.View,{style:{flexDirection:'row',marginTop:(0,E.responsiveHeight)(3),marginLeft:10}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(30),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return t.callItem(s)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))))}},{key:"_renderItemMarkerdetails",value:function(t){var n=this,o=t;if(void 0!==o&&null!==o){var l=this.state,s=l.currentMarker,u=l.myPosition,c={latitude:parseFloat(s.latitude),longitude:parseFloat(s.longitude)},f=H.getDistance(u,c),h=(f>900?f/1e3+" Km":f+"m")+R.default.t('TO_YOU'),k=null===o.lastname?o.adresse:o.lastname;return p.default.createElement(v.CardView,{style:Q.container,cardElevation:2,cardMaxElevation:2,cornerRadius:5},p.default.createElement(y.View,{style:{flexDirection:"row",justifyContent:"flex-end",alignItems:'center'}},p.default.createElement(y.Text,{style:Q.title},k),p.default.createElement(L.default.Button,{name:"close",size:24,color:"red",backgroundColor:"transparent",onPress:function(){n.toggleSlidingUp(!1)}})),p.default.createElement(y.Text,{style:Q.subtitle2},o.adresse),p.default.createElement(y.View,{style:{flexDirection:"row",alignItems:"center"}},p.default.createElement(y.Text,{style:Q.reseau},o.network),p.default.createElement(y.Text,{style:Q.solde},R.default.t('SOLDE_UNVAIBLE'))),p.default.createElement(y.Text,{style:Q.reseau},h),p.default.createElement(y.View,{style:{flexDirection:'row',marginTop:(0,E.responsiveHeight)(3),marginLeft:10}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(30),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return n.callItem(o)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))))}}},{key:"renderCurrentMarker",value:function(t){var n=this;if(t)return p.default.createElement(y.View,null,p.default.createElement(y.View,{style:{flexDirection:"row",justifyContent:"flex-end",alignItems:'center'}},p.default.createElement(y.Text,{style:Q.title},name),p.default.createElement(L.default.Button,{name:"close",size:24,color:"red",backgroundColor:"transparent",on:!0,dPress:function(){n.toggleSlidingUp(!1)}})),p.default.createElement(y.Text,{style:Q.title},t.adresse),p.default.createElement(y.View,{style:{flexDirection:"row"}},p.default.createElement(y.Text,{style:Q.reseau},t.network),p.default.createElement(y.Text,{style:Q.solde},R.default.t('SOLDE_UNVAIBLE'))),p.default.createElement(y.Text,{style:Q.reseau},distanceTxt),p.default.createElement(y.View,{style:{flexDirection:'row',marginTop:(0,E.responsiveHeight)(3),marginLeft:10}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(30),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return n.callItem(t)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))))}},{key:"callItem",value:function(t){var n={number:t.phone,prompt:!1};(0,A.default)(n).catch(function(t){return console.log(t)})}},{key:"makeMarkerInformation",value:function(){var t=this.state,n=t.currentMarker;t.myPosition;return void 0!==n&&null!==n?this._renderItemMarkerdetails(n):p.default.createElement(y.Text,null,"Impossible de'afficher l'element")}},{key:"makeActionButon",value:function(){var t=this.state.user;if(t)switch(t.category){case"super":return this.getSuperActionButton();case"geolocated":return this.geoLocatedAction();case"hyper":return this.getHypervisorActionButton();default:return this.getSimpleActionButton()}}},{key:"getSuperActionButton",value:function(){var t=this;return p.default.createElement(w.default,{buttonColor:G.accent},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("MY_GROUP"),onPress:function(){return t.showMyMembers()},size:48},p.default.createElement(L.default,{name:"group-work",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap(!1)},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:G.primary,title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"layers",style:Z.actionButtonIcon})))}},{key:"getSimpleActionButton",value:function(){var t=this;return p.default.createElement(w.default,{ref:function(n){return t.actionButton=n}},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("FILTER"),onPress:function(){return t.showFilterDialog()},size:48},p.default.createElement(L.default,{name:"filter-list",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap(!1)},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#9b59b6",title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"layers",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("PRINT_MY_NETWORK"),size:48,onPress:function(){t.showMynetworkMap()}},p.default.createElement(L.default,{name:"group-work",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("CHANGE_NETWORK"),size:48,onPress:function(){t.showNewDialogNetwork()}},p.default.createElement(L.default,{name:"rss-feed",style:Z.actionButtonIcon})))}},{key:"toggleSlidingUp",value:function(t){var n=this;t&&this.bottomSheetRef?(this.bottomSheetRef.snapTo(1),this.setState({showcurentMarker:t})):t||this.bottomSheetRef.snapTo(0);var o=t?X:0,l=t?0:X;this.setState({panelVisible:t}),!t&&this.state.needRoad&&this.setState({needRoad:!1}),this.state.animation.setValue(o),y.Animated.timing(this.state.animation,{toValue:l,duration:200}).start(function(o){!t&&n.map&&n.map.focusToUser()})}},{key:"makeSlidingUp",value:function(){var t=this;return p.default.createElement(z.default,{ref:function(n){t.bottomSheetRef=n},snapPoints:[0,"30%"],renderHeader:function(){return t.markerView()}})}},{key:"_renderFavoriteIcon",value:function(){var t=this,n=this.props.draggableRange,o=n.top,l=n.bottom,s=[{scale:this._draggedValue.interpolate({inputRange:[l,o],outputRange:[1,0],extrapolate:'clamp'})}];return p.default.createElement(y.TouchableNativeFeedback,{onPress:function(){t.setState({needRoad:!0})}},p.default.createElement(y.Animated.View,{style:[Z.favoriteIcon,{transform:s}]},p.default.createElement(L.default,{name:"car",size:24,color:"white",style:{alignSelf:'center'}})))}},{key:"geInitialState",value:function(){return{region:{latitude:0,longitude:0,latitudeDelta:.015,longitudeDelta:.0121},pas:100,prevRegion:{latitude:0,longitude:0},isPubShow:!0,loadingDialog:!0,textreach:"",currentNetworkSize:0,markersearchfilter:[],animation:new y.Animated.Value(0),myPosition:null,currentMarker:null,filterNetworkOption:j[1],needRoad:!1,initialAnim:!1,filternetwork:{},destinationPosition:{},panelVisible:!1,markers:[],isNeedLoadMore:!1,isLoadingMap:!1,value:5,page:0,valuePosition:0,markerfilter:null,allpoint:[],typeMap:'standard',indexTypeMap:0,user:null,snack_visible:!1,snack_text_message:"",networks:[],dialogSliderVisible:!1,showProgress:!1,myNetwork:{},dialogNetworkVisible:!1,myPositionMarkerText:R.default.t("YOUR_THERE")}}},{key:"onMarkerPress",value:function(t){console.warn(t),this.setState({currentMarker:t}),this.toggleSlidingUp(!0)}},{key:"onMapTypeChange",value:function(){var t={index:this.state.indexTypeMap,text:this.state.typeMap};switch(t.index=t.index+1,t.index=t.index%3,t.index){default:t.text='standard';break;case 1:t.text='hybrid';break;case 2:t.text="terrain"}this.setState({indexTypeMap:t.index,typeMap:t.text})}},{key:"showInterticiel",value:function(){var t=this;if(this.state.isPubShow)return p.default.createElement(O.default,{closeIntersticiel:function(){return t.setState({isPubShow:!1})},navigation:this.props.navigation})}},{key:"renderBottomHome",value:function(){var t=this;return p.default.createElement(y.View,{style:{flex:1,backgroundColor:"lightblue"}},p.default.createElement(k.default,{ref:function(n){t.map=n,null!=n&&(t.mapRef=n.getMapRef())},typeMap:this.state.typeMap,onMarkerClick:function(n){return t.onMarkerPress(n)},network:this.state.filternetwork,initialRegion:this.state.region,markers:this.state.markers,selectedMarker:this.state.currentMarker,myNetwork:this.state.myNetwork,lang:this.state.lang,myPosition:this.state.myPosition,onMapReady:function(){(0,C.readUser)().then(function(n){n&&(t.setState({user:n}),t.setState({network:n.network}),n.category?(t.setState({loadingDialog:!1}),"geolocated"!==n.category?t.showMyMembers():myPosition.latitude<=0&&myPosition.longitude<=0&&t.props.navigation.push(K.updateinfo)):'android'===y.Platform.OS?t.requestCameraPermission():t.watchLocation())})},needRoad:this.state.needRoad,onNeedRoadReady:function(n){t.setState({showProgress:!1})},onNeedRoadError:function(n){t.setState({showProgress:!1}),y.Alert.alert(R.default.t("PROBLEM_OCCUR"),R.default.t("PROBLEM_OCCUR_DIRECTION"),[{text:"Ok",onPress:function(){}}])}}),this.makeCardSearch(),p.default.createElement(z.default,{ref:function(n){t.bottomSheetRef=n},snapPoints:[60,"30%","100%"],renderHeader:function(){return t.renderHeader()}}))}},{key:"renderInner",value:function(){return p.default.createElement(y.View,{style:{flex:1,backgroundColor:"green"}},p.default.createElement(y.Text,null,"Freud junior"))}},{key:"markerView",value:function(){if(this.state.currentMarker)return this._renderMarker2()}},{key:"renderHeader",value:function(){var t=this;return p.default.createElement(p.default.Fragment,null,p.default.createElement(y.View,{style:{position:"absolute",width:32,height:this.state.currentMarker?200:100,bottom:80,right:0,justifyContent:'center'}},p.default.createElement(w.default,{size:32,style:{marginRight:15},buttonColor:"white"}),p.default.createElement(w.default,{size:42,renderIcon:function(){return p.default.createElement(L.default,{name:"group-work",style:Z.actionButtonIcon})},style:{marginTop:40,marginRight:20},buttonColor:G.primary})),p.default.createElement(y.View,{style:{flex:1,backgroundColor:"white"}},this.markerView(),this.renderFilterMarker(),p.default.createElement(y.View,{style:{flexDirection:'row',height:60,justifyContent:'space-evenly',alignItems:'flex-end'}},p.default.createElement(y.View,{style:{flexDirection:'row',flex:1,marginBottom:10,justifyContent:'space-around',alignItems:'flex-end'}},p.default.createElement(V.FAB,{small:!0,icon:this.state.showFilterDistance?"close":"filter",color:G.primary,style:{backgroundColor:"white"},onPress:function(){t.state.showFilterDistance?(t.bottomSheetRef.snapTo(0),t.setState({showFilterDistance:!1})):(t.bottomSheetRef.snapTo(2),t.setState({showFilterDistance:!0}))}}),p.default.createElement(V.FAB,{small:!0,icon:"add",color:"white",style:{backgroundColor:G.primary},onPress:function(){t.bottomSheetRef.snapTo(2),t.setState({showdialogNetworkVisible:!0})}})),this.makeMarkerButton())))}},{key:"renderFilterMarker",value:function(){var t=this;if(this.state.showFilterDistance)return p.default.createElement(y.View,{style:{height:(0,E.responsiveHeight)(80),justifyContent:'center',backgroundColor:'white',margin:20}},p.default.createElement(y.View,{style:{height:(0,E.responsiveHeight)(30),justifyContent:'center'}},p.default.createElement(y.Text,null,R.default.t('TEXT_FILTER_DISTANCE')," "),p.default.createElement(M.default,{items:this.filterOptions,defaultItem:this.state.valuePosition,labelPosition:"bottom",onSlidingComplete:function(n){return t.slidingComplete(n)}}),p.default.createElement(y.Text,null,p.default.createElement(y.Text,{style:{fontWeight:"bold"}},void 0===this.state.value?0:this.state.value)," km ",R.default.t("DISTANCE_ARROUND"))),p.default.createElement(y.View,{style:{flexDirection:"row",flex:1}},p.default.createElement(x.default,{style:{flex:1}}),p.default.createElement(x.default,{style:{flex:1}})))}},{key:"makeMarkerButton",value:function(){var t=this;return this.state.currentMarker?p.default.createElement(y.View,{style:{flex:2,flexDirection:'row',justifyContent:'flex-end',marginEnd:20}},this.state.needRoad?this.showBtnClose():this.showBtnItineraire(),p.default.createElement(x.default,{style:{backgroundColor:"white",width:(0,E.responsiveWidth)(26),height:36,marginLeft:5,borderRadius:100,borderColor:"#9e9e9e",justifyContent:'center'},onPress:function(){return t.callItem(marker)}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"phone",size:16,color:G.primary,style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'#9e9e9e',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CALL"))))):p.default.createElement(y.View,{style:{flex:2,flexDirection:'row',justifyContent:'flex-end',marginEnd:20}})}},{key:"renderOldHome",value:function(){var t=this;return p.default.createElement(y.View,{style:Z.container},p.default.createElement(y.StatusBar,{backgroundColor:"#00000030",barStyle:"light-content",translucent:!0}),this.state.loadingDialog?p.default.createElement(y.View,{style:{position:"absolute",zIndex:1,backgroundColor:"#00000050",width:this.state.loadingDialog?(0,E.responsiveWidth)(100):0,height:this.state.loadingDialog?(0,E.responsiveHeight)(100):0,flex:1,justifyContent:'center',alignItems:'center'}},p.default.createElement(y.Text,{style:{fontSize:20,color:'white',fontWeight:'bold'}},R.default.t("LOADING_DOTS"))):null,p.default.createElement(k.default,{ref:function(n){t.map=n,null!=n&&(t.mapRef=n.getMapRef())},typeMap:this.state.typeMap,onMarkerClick:function(n){return t.onMarkerPress(n)},network:this.state.filternetwork,initialRegion:this.state.region,markers:this.state.markers,selectedMarker:this.state.currentMarker,myNetwork:this.state.myNetwork,lang:this.state.lang,myPosition:this.state.myPosition,onMapReady:'android'===y.Platform.OS?this.onMapReady:null,onLayout:'ios'===y.Platform.OS?this.onMapReady:null,needRoad:this.state.needRoad,onNeedRoadReady:function(n){t.setState({showProgress:!1})},onNeedRoadError:function(n){t.setState({showProgress:!1}),y.Alert.alert(R.default.t("PROBLEM_OCCUR"),R.default.t("PROBLEM_OCCUR_DIRECTION"),[{text:"Ok",onPress:function(){}}])}}),this.makeCardSearch(),this.makeSlidingUp(),this.makeDialogLoader(),this.makeDistanceDialog(),this.makeNetworkChangeDialog(),p.default.createElement(B.default,{visible:this.state.snack_visible,textMessage:this.state.snack_text_message,autoHidingTime:5e3}),this.makeActionButon())}},{key:"renderTutoOldHome",value:function(){return p.default.createElement(y.View,{style:{flex:1}},p.default.createElement(CopilotStep,{text:"This is a hello world example!",order:1,name:"hello"},this.makeCardSearch()))}},{key:"render",value:function(){return this.renderOldHome()}},{key:"renderCurrentMarker",value:function(){if(this.state.currentMarker)return p.default.createElement(y.View,{style:{height:200,backgroundColor:'#fff'}},this.makeMarkerInformation())}},{key:"makeDialogLoader",value:function(){return p.default.createElement(I.ProgressDialog,{visible:this.state.showProgress,title:R.default.t("LOADING_PROGRESS"),message:R.default.t("WAITING_LONG"),animationType:"slide",activityIndicatorSize:"large",activityIndicatorColor:"blue"})}},{key:"showMynetworkMap",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=null===n?this.state.user:n,l=this.state.myNetwork;return this.setState({filternetwork:l,page:0,filternetworkTemp:l,loadingDialog:!0}),new Promise(function(){void 0!==l?t.loadingMarkers(t.state.myPosition,l,t.state.value).then(function(n){var l=n||[];if(t.setState({loadingDialog:!1}),void 0!==o.category&&null!==o.category){var s=l.filter(function(t){return t.code_parrain===o.code_membre});t.treatNewData(t.state.myPosition,s,!0)}else t.treatNewData(t.state.myPosition,l,!0)}).catch(function(n){t.setState({loadingDialog:!1}),console.log("error j"),console.log(n)}):(t.setState({loadingDialog:!1}),console.log("error no net"))})}},{key:"showMyMembers",value:function(){var t=this,n=this.state.user.code_membre;void 0!==n?(0,S.loadGroupeAgent)(n).then(function(n){if(1===n.success)return t.setState({markers:n.datas})}):console.log("error")}},{key:"slidingComplete",value:function(t){this.setState({value:this.filterOptions[t].value,valuePosition:t})}},{key:"makeDistanceDialog",value:function(){var t=this;return p.default.createElement(_.MaterialDialog,{visible:this.state.dialogSliderVisible,title:R.default.t('MENU_FILTER'),onOk:function(){t.setState({dialogSliderVisible:!1,showProgress:!0}),setTimeout(function(){return t.filterPoint()},300)},cancelLabel:R.default.t("QUIT_"),okLabel:R.default.t('FILTER'),onCancel:function(){t.setState({dialogSliderVisible:!1})},onTouchOutside:function(){return t.setState({dialogSliderVisible:!1})}},p.default.createElement(y.Text,null,R.default.t('TEXT_FILTER_DISTANCE')," "),p.default.createElement(M.default,{items:this.filterOptions,defaultItem:this.state.valuePosition,labelPosition:"bottom",onSlidingComplete:function(n){return t.slidingComplete(n)}}),p.default.createElement(y.Text,null,p.default.createElement(y.Text,{style:{fontWeight:"bold"}},void 0===this.state.value?0:this.state.value)," km ",R.default.t("DISTANCE_ARROUND")))}},{key:"showFilterDialog",value:function(){this.setState({dialogSliderVisible:!0})}},{key:"filterPoint",value:function(){var t,n,l,s,u,c=this;return o.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:t=this.state,n=t.value,l=t.myPosition,t.user,s=t.filternetwork,void 0!==n?(this.setState({page:0}),1e3*n,u=this.state.networks.filter(function(t){return t.id===s.id}),u[0],this.loadingMarkers(l,s,n).then(function(t){c.treatNewData(c.state.prevRegion,t,!0)}).catch(function(t){c.setState({showProgress:!1}),y.Alert.alert(R.default.t("ERROR_FILTER"),R.default.t("ERROR_FILTER_TEXT"),[{text:R.default.t("CANCEL")},{text:R.default.t("RESTART"),onPress:function(){c.filterPoint()}}])})):(this.setState({showProgress:!1}),this.setState({snack_visible:!0,snack_text_message:"impossible de filtrer les \xe9lements"}),setTimeout(function(){c.setState({snack_visible:!1})},5e3));case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"userChangeMarker",value:function(t){var n=this.state.markers[t];if(null!==this.mapRef&&void 0!==this.mapRef){var o={latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude),latitudeDelta:.03,longitudeDelta:.01};this.mapRef.animateToCoordinate({latitude:parseFloat(n.latitude),longitude:parseFloat(n.longitude)},1e3),this.mapRef.animateToRegion(o,1e3),console.log(n)}}},{key:"geoLocatedAction",value:function(){var t=this;return p.default.createElement(w.default,{buttonColor:G.accent},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap()},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:G.primary,title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"layers",style:Z.actionButtonIcon})))}},{key:"makeNetworkChangeDialog",value:function(){var t=this;return p.default.createElement(_.MaterialDialog,{title:R.default.t("CHOICE_NETWORK"),visible:this.state.dialogNetworkVisible,subtitle:R.default.t("CHOICE_NETWORK_TEXT"),onCancel:function(){return t.setState({dialogNetworkVisible:!1})},onOk:function(n){t.setState({dialogNetworkVisible:!1,page:0}),t.setState({showProgress:!0,filternetwork:t.state.filternetworkTemp}),setTimeout(function(){return t.showFilterNetwork()},500)}},p.default.createElement(y.FlatList,{style:{height:(0,E.responsiveHeight)(40)},data:this.state.networks,renderItem:function(n){var o=n.item;return t.renderRow(o)}}))}},{key:"onRowPress",value:function(t){this.setState({filternetworkTemp:t})}},{key:"showNewDialogNetwork",value:function(){this.setState({dialogNetworkVisible:!0})}},{key:"showFilterNetwork",value:function(){var t,n,l,s=this;return o.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:t=this.state,n=t.myPosition,t.user,void 0!==(l=t.filternetwork)?(this.setState({showProgress:!0}),this.loadingMarkers(this.state.myPosition,l,this.state.value,0).then(function(t){s.setState({showProgress:!1}),s.treatNewData(n,t,!0)}).catch(function(t){s.setState({snack_visible:!0,snack_text_message:"Probleme de connexion"}),console.log(t)})):console.log("error no net");case 2:case"end":return o.stop()}},null,this,null,Promise)}},{key:"showBtnItineraire",value:function(){var t=this;return p.default.createElement(x.default,{style:{backgroundColor:G.primary,width:(0,E.responsiveWidth)(30),height:36,borderRadius:100,marginLeft:5,borderColor:"transparent",justifyContent:'center'},onPress:function(){t.setState({needRoad:!0,showProgress:!0})}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"near-me",size:16,color:"white",style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'white',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("WAY"))))}},{key:"showBtnClose",value:function(){var t=this;return p.default.createElement(x.default,{style:{backgroundColor:G.reddeconnect,height:36,width:(0,E.responsiveWidth)(30),borderRadius:100,borderColor:"transparent",justifyContent:'center'},onPress:function(){t.setState({needRoad:!1,showProgress:!1})}},p.default.createElement(y.View,{style:{flexDirection:'row'}},p.default.createElement(L.default,{name:"close",size:16,color:"white",style:{alignSelf:'center'}}),p.default.createElement(y.Text,{style:{fontSize:15,color:'white',marginLeft:(0,E.responsiveWidth)(2)}},R.default.t("CANCEL"))))}},{key:"getHypervisorActionButton",value:function(){var t=this;return p.default.createElement(w.default,{buttonColor:G.accent},p.default.createElement(w.default.Item,{buttonColor:"#3498db",title:R.default.t("REPOSITIONNING"),onPress:function(){return t.refocusMap(!1)},size:48},p.default.createElement(L.default,{name:"person-pin",style:Z.actionButtonIcon})),p.default.createElement(w.default.Item,{buttonColor:G.primary,title:R.default.t("CHANGE_MAP"),onPress:function(){t.onMapTypeChange()},size:48},p.default.createElement(L.default,{name:"map",style:Z.actionButtonIcon})))}},{key:"moveToMarker",value:function(t){this.mapRef.animateToCoordinate({latitude:parseFloat(t.latitude),longitude:parseFloat(t.longitude)},1e3),this.setState({textreach:t.lastname,texta:!0}),this.setState({markersearchfilter:[]}),this.onMarkerPress(t)}},{key:"refocusMap",value:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.mapRef&&void 0!==this.state.myPosition&&this.mapRef.animateCamera({center:{latitude:this.state.myPosition.latitude,longitude:this.state.myPosition.longitude},pitch:0,heading:0},1e3):this.mapRef&&void 0!==this.state.myPosition&&this.mapRef.animateCamera({center:{latitude:this.state.myPosition.latitude,longitude:this.state.myPosition.longitude},pitch:0,heading:0,altitude:5,zoom:12},1e3),this.map&&this.map.focusToUser()}},{key:"renderCardSeashItem",value:function(t){var n=this;return p.default.createElement(y.TouchableOpacity,{key:t.id,style:{margin:5},onPress:function(){n.moveToMarker(t)}},p.default.createElement(y.Text,{style:{flex:1,fontSize:14,color:"#000"}},null===t.firstname?t.adresse:t.firstname),p.default.createElement(y.Text,{style:{flex:1,fontSize:12}},t.lastname),p.default.createElement(y.Text,{style:{flex:1,fontSize:13,alignSelf:'flex-end',color:G.accent}},t.network))}},{key:"retrieveAllPoint",value:function(t){var n=this;(0,S.getMakersFrom)(t).then(function(o){new Promise(function(t,l){try{var s=o.datas;n.setState({allpoint:s,loadingDialog:!1}),t(s)}catch(t){console.warn(t.message),l(new Error(t.message))}}).then(function(t){n.onLoadMore()}).catch(function(o){n.setState({loadingDialog:!1}),console.log("on get marker"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){n.setState({loadingDialog:!0}),null!==t&&void 0!==t?n.retrieveAllPoint(t):n.requestCameraPermission()}}],{cancelable:!1})})}).catch(function(o){console.log("on retreive>getmarkers",o.message),n.setState({loadingDialog:!1}),n.state.allpoint.length<=0&&(console.log("no point"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){n.state.allpoint.length<=0&&(n.setState({loadingDialog:!0}),null!==t&&void 0!==t?n.retrieveAllPoint(t):n.requestCameraPermission())}}],{cancelable:!1}))})}},{key:"showLoadMoreView",value:function(){var t=this;if(this.state.isNeedLoadMore)return p.default.createElement(y.View,{style:{flex:1,flexDirection:'row',width:(0,E.responsiveWidth)(90)}},p.default.createElement(x.default,{onPress:function(){t.setState({page:t.state.page+1}),t.onLoadMore()},style:{borderRadius:48,height:48,width:48,backgroundColor:"white",borderColor:"transparent",alignItems:"center",justifyContent:"center"}},p.default.createElement(L.default,{name:"refresh",size:32})),p.default.createElement(y.View,{style:{backgroundColor:"#FFFFFFA0",width:(0,E.responsiveWidth)(20),height:30,borderRadius:12,justifyContent:'center',alignItems:'center',alignSelf:'center'}},p.default.createElement(y.Text,null,(this.state.markers.length,this.state.markers.length)," / ",this.state.currentNetworkSize," ")))}},{key:"showLoadingMapView",value:function(){if(this.state.isLoadingMap)return p.default.createElement(y.View,{style:{flexDirection:'row',margin:10,width:(0,E.responsiveWidth)(95),backgroundColor:'white',justifyContent:"center",alignSelf:"center"}},p.default.createElement(y.Text,{style:{fontSize:12,alignSelf:'center'}},R.default.t("LOADING_TEXT_MARKERS")+" "+this.state.value+" km "+R.default.t("DISTANCE_ARROUND")),p.default.createElement(y.ProgressBarAndroid,{style:{alignSelf:'center'}}))}},{key:"loadingMarkers",value:function(t,n,o){var l=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return new Promise(function(u,c){var f=l.state.allpoint,h=void 0!==s?s:l.state.page,p=f.filter(function(l,s){var u={longitude:parseFloat(l.longitude),latitude:parseFloat(l.latitude)};return H.getDistance(t,u)<=1e3*o&&l.network===n.name}).slice(0,(h+1)*l.state.pas);try{var y=f.filter(function(l,s){var u={longitude:parseFloat(l.longitude),latitude:parseFloat(l.latitude)};return H.getDistance(t,u)<=1e3*o&&l.network===n.name});l.setState({currentNetworkSize:y.length,currentNetworkMarkers:y})}catch(t){console.debug("after "+t.message)}console.debug("data:",p,"value"+1e3*o),u(p)})}},{key:"treatNewData",value:function(t,n){var o=this,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.setState({isLoadingMap:!1});var s=n;if(n.length>0){var u=s;l&&this.setState({showProgress:!1}),u.length>0&&this.setState({markers:u,prevRegion:t}),s.length0){var o=n.results[0],l=o.address_components,u=o.formatted_address,c=o.place_id;s.setState({address:l,textadress:u,place:c});for(var f,h,p=n.results,k=0;k=v.length)break;S=v[b++]}else{if((b=v.next()).done)break;S=b.value}var C=S;C.code===f&&(s.setState({indicatif:C.dial_code}),s.getNetworks(C.dial_code))}}}else console.log("on treat 1"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){s.treatPosition(t)}}],{cancelable:!1});else console.log("on treat 2"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){s.treatPosition(t)}}],{cancelable:!1})}).catch(function(n){console.log("on treat 3"),y.Alert.alert(R.default.t("UNABLE_TO_CONNECT_TITLE"),R.default.t('TEXT_NETWORK_UNABLE'),[{text:R.default.t("NO"),onPress:function(){y.BackHandler.exitApp()}},{text:R.default.t("YES"),onPress:function(){s.treatPosition(t)}}],{cancelable:!1})}),l={latitude:t.latitude,longitude:t.longitude,latitudeDelta:.03,longitudeDelta:.01},this.setState({myPosition:t,region:l}),this.mapRef&&!this.state.myPositionIsAnimated&&(this.mapRef.animateCamera({center:t,pitch:0,heading:0,altitude:5,zoom:13},1e3),this.setState({myPositionIsAnimated:!0})));case 3:case"end":return o.stop()}},null,this,null,Promise)}}]),n})(T.default);q.navigationOptions=function(t){return{headerMode:"none",headerStyle:{display:'none'},header:null,drawerLabel:t.navigation.getParam("name",R.default.t('MAP')),drawerIcon:function(t){var n=t.tintColor;return p.default.createElement(L.default,{name:'map',size:24,color:n})}}},q.defaultProps={draggableRange:{top:(0,E.responsiveHeight)(30),bottom:0},panel:null};var J=q;e.default=J;var Q=y.StyleSheet.create({solde:{backgroundColor:G.accent,color:"white",marginLeft:10,padding:5,fontSize:9,borderRadius:100},title:{color:'black',marginLeft:10,flex:1,fontSize:11,fontWeight:'bold'},subtitle2:{color:'black',marginLeft:10,flex:1,fontSize:10,fontWeight:'bold'},subtitle:{color:'black',marginLeft:9,fontSize:9},otherInformation:{marginLeft:13,fontSize:9},reseau:{marginLeft:10,fontWeight:'bold',color:G.accent,fontSize:10},container:{flex:1,width:(0,E.responsiveWidth)(95),alignSelf:"center",paddingTop:(0,E.responsiveHeight)(1),marginBottom:(0,E.responsiveHeight)(1),backgroundColor:"white",justifyContent:'flex-start'}}),Z=y.StyleSheet.create({container:{flex:1,backgroundColor:'#FFF'},panelContainer:{position:'absolute',top:0,bottom:0,left:0,right:0},panel:{height:600,padding:20,backgroundColor:'#f7f5eee8'},header:{backgroundColor:'#f7f5eee8',shadowColor:'#000000',paddingTop:20,borderTopLeftRadius:20,borderTopRightRadius:20},panelHandle:{width:40,height:8,borderRadius:4,backgroundColor:'#00000040',marginBottom:10},panelTitle:{fontSize:27,height:35},panelSubtitle:{fontSize:14,color:'gray',height:30,marginBottom:10},panelButton:{padding:20,borderRadius:10,backgroundColor:'#318bfb',alignItems:'center',marginVertical:10},panelButtonTitle:{fontSize:17,fontWeight:'bold',color:'white'},fab:{position:'absolute',margin:16,right:0,bottom:0},networkname:{backgroundColor:G.primary,padding:5,color:"white",marginRight:10,fontSize:10,borderRadius:12},myClusterTextStyle:{color:"white"},myClusterStyle:{backgroundColor:G.accent,height:32,justifyContent:'center',alignItems:'center',width:32,borderRadius:16},rowContainer:{height:52,flex:1,flexDirection:'row',justifyContent:'flex-start',alignItems:'center'},iconContainer:{marginRight:16},mapmarker:{width:52,height:52},slidingup:{backgroundColor:"transparent",position:"absolute",height:X,bottom:0,left:(0,E.responsiveWidth)(2.5),width:(0,E.responsiveWidth)(95),zIndex:1},panelHeader:{height:120,backgroundColor:'#b197fc',alignItems:'center',justifyContent:'center'},favoriteIcon:{left:(0,E.responsiveWidth)(75),backgroundColor:G.primary,width:64,justifyContent:'center',alignContent:'center',bottom:-64,position:'absolute',height:64,padding:8,zIndex:1,borderRadius:32},hambuger:{color:G.primary,borderColor:G.primary,borderWidth:1,alignSelf:'center',padding:5},topBar:{position:'absolute',alignSelf:'center',justifyContent:'center',borderRadius:10,alignItems:'center',marginTop:(0,E.responsiveHeight)(4),width:(0,E.responsiveWidth)(90)},searchInput:{flex:1,fontSize:14},search:{width:(0,E.responsiveWidth)(70),height:(0,E.responsiveHeight)(10),backgroundColor:'#00000000'},map:{width:(0,E.responsiveWidth)(100),height:(0,E.responsiveHeight)(100)},backgroundd_drawer:{backgroundColor:'#000'},cardsearch:{width:(0,E.responsiveWidth)(90),height:(0,E.responsiveHeight)(10),position:'absolute',alignSelf:'center',marginTop:5},actionButtonIcon:{fontSize:20,height:22,color:'white'},welcome:{fontSize:20,textAlign:'center',margin:10},instructions:{textAlign:'center',color:'#333333',marginBottom:5}})},1152,[4,1,273,8,10,12,11,9,13,15,18,1153,524,528,527,771,764,711,815,681,709,712,766,737,768,1373,1378,1379,827,804,826,1380,1029,1384,1444,813,1471,808,806,807]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),o=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(r(d[2])),s=o(r(d[3])),u=o(r(d[4])),l=o(r(d[5])),c=o(r(d[6])),f=o(r(d[7])),p=t(r(d[8])),h=t(r(d[9])),k=o(r(d[10])),y=r(d[11]),v=r(d[12]),R=o(r(d[13])),b=o(r(d[14])),C=o(r(d[15])),w=(r(d[16]),r(d[17])),M=(o(r(d[18])),r(d[19])),S=(r(d[20]),r(d[21]),(function(t){function o(t){var s;return(0,n.default)(this,o),(s=(0,u.default)(this,(0,l.default)(o).call(this,t))).mapRef=function(t){s.mapview=t},s.getMapRef=function(){return s.mapview},s.state={markers:[],roadReady:!1,isNeedUserFocus:!1,positionMarkerText:b.default.t("YOUR_THERE")},w.IlinkEmitter.on("langueChange",s.updateLangue.bind((0,c.default)(s))),s}return(0,f.default)(o,t),(0,s.default)(o,[{key:"getPositionMarkerText",value:function(){var t=null;switch(b.default.currentLocale()){case"fr":t="Vous \xeates ici";break;case"en":t="Your are here";break;default:t=b.default.t("YOUR_THERE")}return t}},{key:"updateLangue",value:function(){this.setState({positionMarkerText:this.getPositionMarkerText()})}},{key:"componentDidUpdate",value:function(t,o){o.positionMarkerText!==this.state.positionMarkerText&&this.forceUpdate()}},{key:"componentWillReceiveProps",value:function(t,o){var n=this.state.markers,s=t.markers;n.length<=0?this.setState({markers:s}):n.length!==s&&this.setState({markers:s}),this.setState({isNeedUserFocus:t.isNeedUserFocus})}},{key:"render",value:function(){var t=this,o=this.props,n=(o.markers,o.initialRegion),s=(o.myPosition,o.myNetwork),u=o.typeMap,l=o.selectedMarker;return null!==n&&null!==s?p.default.createElement(y.View,{style:N.container},p.default.createElement(h.default,{style:{flex:1},initialRegion:n,mapType:u,ref:function(o){return t.mapview=o},onMapReady:this.props.onMapReady,onLayout:this.props.onLayout,onRegionChangeComplete:function(o){t.onRegionChangeOver(o)}},this.state.markers.map(function(o,n){return p.default.createElement(R.default,{isUser:!1,title:o.lastname,isSelected:l&&l.id===o.id,data:o,onPress:function(o,n){return t.props.onMarkerClick(o,n)},network:s})}),this.renderMyPosition(),this.makeDirection())):p.default.createElement(y.View,null)}},{key:"focusToUser",value:function(){this.setState({isNeedUserFocus:!0})}},{key:"closeUserFocus",value:function(){this.setState({isNeedUserFocus:!1})}},{key:"onRegionChangeOver",value:function(t){}},{key:"makeDirection",value:function(){var t=this,o=this.props,n=o.myPosition,s=o.selectedMarker,u=o.needRoad;if(null!==n&&null!==s&&void 0!==s&&void 0!==n&&u)return setTimeout(function(){t.state.roadReady||(t.setState({roadReady:!0}),t.props.onNeedRoadError())},1e4),p.default.createElement(C.default,{origin:n,destination:s,apikey:"AIzaSyAYOEp-Pckvc3TwOIulCICokKgmp14rGHI",strokeWidth:3,onReady:function(o){t.setState({roadReady:!0}),t.props.onNeedRoadReady(o)},onError:function(){t.setState({roadReady:!0}),t.props.onNeedRoadError()},strokeColor:M.primary})}},{key:"renderMyPosition",value:function(){var t=this.props,o=t.myPosition;t.myNetwork;if(null!=o)return p.default.createElement(R.default,{isUser:!0,lang:this.props.lang,isNeedFocus:this.state.isNeedUserFocus,title:this.state.positionMarkerText,data:{longitude:o.longitude,latitude:o.latitude}})}}]),o})(p.Component));S.propTypes={markers:k.default.array,map:k.default.object,network:k.default.object,myNetwork:k.default.object,selectedMarker:k.default.object,myPosition:k.default.object,onMarkerClick:k.default.func,initialRegion:k.default.object,typeMap:k.default.string,needRoad:k.default.bool,isNeedUserFocus:k.default.bool,onNeedRoadReady:k.default.func,onNeedRoadError:k.default.func,onMapReady:k.default.func,onLayout:k.default.func},S.defaultProps={isNeedUserFocus:!1};var x=S;e.default=x;var N=y.StyleSheet.create({container:{flex:1,backgroundColor:'#FFF'},myClusterTextStyle:{color:"white"},myClusterStyle:{backgroundColor:M.accent,height:32,justifyContent:'center',alignItems:'center',width:32,borderRadius:16},rowContainer:{height:52,flex:1,flexDirection:'row',justifyContent:'flex-start',alignItems:'center'},iconContainer:{marginRight:16},mapmarker:{width:52,height:52},slidingup:{backgroundColor:"transparent",position:"absolute",height:300,bottom:0,right:35,zIndex:1},panel:{flex:1,backgroundColor:'white',position:'relative'},panelHeader:{height:120,backgroundColor:'#b197fc',alignItems:'center',justifyContent:'center'},favoriteIcon:{left:(0,v.responsiveWidth)(75),backgroundColor:M.primary,width:64,justifyContent:'center',alignContent:'center',bottom:-64,position:'absolute',height:64,padding:8,zIndex:1,borderRadius:32},hambuger:{},topBar:{position:'absolute',alignSelf:'center',justifyContent:'center',alignItems:'center',marginTop:(0,v.responsiveHeight)(4),width:(0,v.responsiveWidth)(95)},searchInput:{width:(0,v.responsiveWidth)(70),fontSize:14},search:{width:(0,v.responsiveWidth)(70),height:(0,v.responsiveHeight)(10),backgroundColor:'#00000000'},map:{width:(0,v.responsiveWidth)(100),height:(0,v.responsiveHeight)(100)},backgroundd_drawer:{backgroundColor:'#000'},cardsearch:{width:(0,v.responsiveWidth)(90),height:(0,v.responsiveHeight)(10),position:'absolute',alignSelf:'center',marginTop:5},actionButtonIcon:{fontSize:20,height:22,color:'white'},welcome:{fontSize:20,textAlign:'center',margin:10},instructions:{textAlign:'center',color:'#333333',marginBottom:5}})},1153,[4,1,8,9,10,12,11,13,15,950,68,18,527,1154,712,1158,1160,766,930,806,1156,1157]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),n=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r(d[2])),l=n(r(d[3])),s=n(r(d[4])),u=n(r(d[5])),c=n(r(d[6])),p=t(r(d[7])),f=t(r(d[8])),h=(n(r(d[9])),r(d[10])),v=r(d[11]),k=r(d[12]),y=r(d[13]),w=(function(t){function n(t){var l;(0,o.default)(this,n),(l=(0,s.default)(this,(0,u.default)(n).call(this,t))).handleViewRef=function(t){return l.view=t};var c=l.props.data;return l.state={animation:new h.Animated.Value(0),subanimation:new h.Animated.Value(0),coordinate:{longitude:parseFloat(c.longitude),latitude:parseFloat(c.latitude)}},l}return(0,c.default)(n,t),(0,l.default)(n,[{key:"componentWillReceiveProps",value:function(t){var n=parseFloat(this.props.data.longitude),o=parseFloat(this.props.data.latitude),l={longitude:parseFloat(t.data.longitude),latitude:parseFloat(t.data.latitude)};n===l.longitude&&o===l.latitude||'android'===h.Platform.OS&&this.markerRef&&this.markerRef._component.animateMarkerToCoordinate(l,500)}},{key:"startAnimation",value:function(){this.state.animation.setValue(0),h.Animated.timing(this.state.animation,{toValue:1,duration:500,easing:h.Easing.linear(),useNativeDriver:!0}).start()}},{key:"render",value:function(){var t=this,n=this.props,o=n.data;n.network,n.isSelected;return o.longitude&&o.latitude?p.default.createElement(f.Marker.Animated,{coordinate:this.state.coordinate.longitude?this.state.coordinate:{longitude:o.longitude,latitude:o.latitude},id:o.id,title:this.props.title,ref:function(n){t.markerRef=n},onPress:function(n){t.props.isUser||t.props.onPress(o)},image:this.getImage(o)}):p.default.createElement(h.View,null)}},{key:"error",value:function(t){console.log("on error render image"),console.log(t)}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(t,n,o){this.props.isUser&&this.markerRef&&this.props.isNeedFocus&&this.markerRef._component.showCallout()}},{key:"getImage",value:function(t){var n=this.props,o=n.isUser,l=n.network;return o?v:l&&t.network===l.name?k:y}},{key:"getIcon",value:function(t){var n=this.props.isSelected;return n?p.default.createElement(h.Animated.View,{style:{width:32,height:32,justifyContent:'center',alignItems:'center',borderRadius:16,backgroundColor:n?"#81D4FAA0":"transparent",transform:[{scaleX:this.animatedValue.interpolate({inputRange:[0,1],outputRange:[1,32]})},{scaleY:this.animatedValue.interpolate({inputRange:[0,1],outputRange:[1,32]})}]}},p.default.createElement(h.Image,{style:{alignSelf:'center'},source:this.getImage(t)})):p.default.createElement(h.Image,{style:{alignSelf:'center'},source:this.getImage(t)})}},{key:"startLoopSelectedAnimation",value:function(){this.state.animation.setValue(0),h.Animated.loop(h.Animated.timing(this.state.subanimation,{toValue:1,duration:1e3,easing:h.Easing.linear(),useNativeDriver:!0}),{iteration:-1}).start()}}]),n})(p.PureComponent),R=(h.StyleSheet.create({container:{flex:1,width:52,height:52},ring:{}}),w);e.default=R},1154,[4,1,8,9,10,12,13,15,950,68,18,1155,1156,1157]); __d(function(g,r,i,a,m,e,d){m.exports=r(d[0]).registerAsset({__packager_asset:!0,httpServerLocation:"/assets/datas/img/png",width:24,height:24,scales:[1],hash:"d06bce4cbcb1e05fdef054d57b75acb3",name:"user_place",type:"png"})},1155,[175]); diff --git a/screens/home/Home.js b/screens/home/Home.js index e852b72a..45cb2603 100644 --- a/screens/home/Home.js +++ b/screens/home/Home.js @@ -475,7 +475,7 @@ class Home extends BaseScreen { pitch: 0, heading: 0, altitude: 5, - zoom: 13 + zoom: 12 }, 1000) this.setState({ myPositionIsAnimated: true }) @@ -542,7 +542,7 @@ class Home extends BaseScreen { longitudeDelta: 0.01, } this.setState({ myPosition: myPosition }); - this.refocusMap(false); + this.refocusMap(true); } /*if (Platform.OS === 'android') { @@ -1417,17 +1417,19 @@ class Home extends BaseScreen { latitude: parseFloat(user.latitude), longitude: parseFloat(user.longitude) } - - this.mapRef.animateCamera({ - center: { - latitude: myPosition.latitude, - longitude: myPosition.longitude - }, - pitch: 0, - heading: 0, - altitude: 5, - zoom: 12 - }, 1000); + this.setState({ myPosition }); + this.refocusMap(false); + /* + this.mapRef.animateCamera({ + center: { + latitude: myPosition.latitude, + longitude: myPosition.longitude + }, + pitch: 0, + heading: 0, + altitude: 5, + zoom: 12 + }, 1000); */ if (user.category) { this.setState({ loadingDialog: false })