diff --git a/android/app/src/main/assets/index.android.bundle b/android/app/src/main/assets/index.android.bundle index 65c67834..0aed040c 100644 --- a/android/app/src/main/assets/index.android.bundle +++ b/android/app/src/main/assets/index.android.bundle @@ -1803,8 +1803,8 @@ __d(function(g,r,i,a,m,e,d){var t=r(d[0]),o=r(d[1]);Object.defineProperty(e,"__e __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 l=n(r(d[2])),o=n(r(d[3])),u=n(r(d[4])),s=n(r(d[5])),c=n(r(d[6])),f=n(r(d[7])),p=t(r(d[8])),y=r(d[9]),E=n(r(d[10])),D=n(r(d[11])),C=r(d[12]),R=n(r(d[13])),x=(r(d[14]),r(d[15])),T=n(r(d[16])),h=r(d[17]),b=r(d[18]),O=(r(d[19]),r(d[20]),r(d[21])),v=r(d[22]),G=n(r(d[23])),w=n(r(d[24])),U=r(d[25]),A=(n(r(d[26])),r(d[27])),S=(n(r(d[28])),r(d[29])),P=r(d[30]),L=(r(d[31]),r(d[32]));function j(t,n){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),l.push.apply(l,o)}return l}var _=r(d[33]),k='white',N=r(d[34]),F=r(d[35]);r(d[36]);(0,C.responsiveHeight)(100);var V=(function(t){function n(t){var l;return(0,o.default)(this,n),(l=(0,s.default)(this,(0,c.default)(n).call(this,t))).displayToast=function(t){G.default.show(t,{duration:G.default.durations.LONG,position:G.default.positions.BOTTOM,backgroundColor:U.Color.primaryColor,shadow:!0,animation:!0,hideOnPress:!0,delay:0,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){}})},l.onCancelDemand=function(){l.props.createGroupReset(),l.props.createGroupAction({id_demande:l.props.resultGetUniqueDemand.response.id,id_user:l.state.user.id,code_groupe:l.props.resultGetUniqueDemand.response.code_groupe})},l.renderAlertErrorDeleteDemand=function(){var t=l.props,n=t.errorTreatDemand,o=t.resultTreatDemand;t.resultCancelDemand,t.errorCancelDemand;null!==n&&void 0!==n.data&&y.Alert.alert(T.default.t("ERROR_TREATMENT_DEMAND"),n.data.error,[{text:T.default.t("OK"),onPress:function(){l.props.createGroupReset()}}],{cancelable:!1}),null!==o&&(console.log("resultTreatDemand",o),200===o.status&&(l.displayToast(o.response),l.props.navigation.goBack(),l.props.createGroupReset()))},l.renderLabelState=function(t){return 0===t?T.default.t('NO_TREAT'):1===t?T.default.t('TREAT'):T.default.t('REFUSED')},l.renderLoader=function(){return p.default.createElement(y.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},'android'===y.Platform.OS?p.default.createElement(p.default.Fragment,null,p.default.createElement(y.ProgressBarAndroid,null),p.default.createElement(y.Text,null,T.default.t('LOADING_DOTS'))):p.default.createElement(p.default.Fragment,null,p.default.createElement(ActivityIndicator,{size:"large",color:'#ccc'}),p.default.createElement(y.Text,null,T.default.t('LOADING_DOTS'))))},l.renderDetail=function(){var t=l.props.resultGetUniqueDemand,n=_.tz(t.response.date_creation,_.tz.guess()).format();return n=_(n),p.default.createElement(y.View,{style:z.container},p.default.createElement(E.default,{style:z.cardcontainer1},p.default.createElement(y.Text,{style:{fontSize:17,fontWeight:'bold',color:'black',marginLeft:(0,C.responsiveWidth)(5)}},t.response.nom),p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"account",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},T.default.t('CREATOR')+": "+t.response.createur)),p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"map-marker",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},T.default.t('COUNTRY')+": "+t.response.country))),p.default.createElement(E.default,{style:z.cardcontainer},p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"account-multiple",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},"SPONSOR 1: "+t.response.sponsor1)),p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"account-multiple",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},"SPONSOR 2: "+t.response.sponsor2)),p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"account-multiple",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},"SPONSOR 3: "+t.response.sponsor3))),p.default.createElement(E.default,{style:z.cardcontainer},p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"code-tags",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},t.response.code_groupe)),p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"cash",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},T.default.t('LIMITE_GROUP')+": "+t.response.limite_credit+" "+t.response.currency_code)),p.default.createElement(y.View,{style:{flexDirection:'row',justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"calendar",size:28,color:N.accent,style:{marginLeft:20}}),p.default.createElement(y.Text,{style:z.simpleuser},T.default.t('CREATION_DATE')+": "+n.format(" Do MMMM YYYY \xe0 HH:mm"))),p.default.createElement(y.View,{style:{flexDirection:'row',alignSelf:'flex-end',marginRight:20,justifyContent:'flex-start'}},p.default.createElement(R.default,{name:"update",size:28,color:N.accent}),p.default.createElement(y.Text,{style:{marginLeft:(0,C.responsiveWidth)(2),fontSize:16,color:N.accent}},n.fromNow()))),!w.default.isNil(l.state.user)&&w.default.isEqual(parseInt(l.state.user.id),t.response.id_createur)&&l.renderBtn())},l.renderError=function(){var t=l.props.errorGetUniqueDemand;if(null!==t)return void 0!==t.data?p.default.createElement(y.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},p.default.createElement(y.Text,{style:A.Typography.body1},t.data.error)):p.default.createElement(y.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},p.default.createElement(y.Text,{style:A.Typography.body1},t))},l.state={displayAmountModifyDialog:!1,user:null,networks:[],loadingTreat:!1,loadingCancel:!1,triggerTreatmentClick:!1,triggerCancelClick:!1,color:k,montant:null,isBtnModifyAmountEnabled:!1,id:l.props.navigation.getParam("id",null)},l.currentLocale=T.default.locale.includes("fr")?"fr":"en-gb",_.locale(l.currentLocale),l.props.createGroupReset(),(0,x.readUser)().then(function(t){console.log("USER",t),t&&void 0!==t&&l.props.getUserGroupDetailAction(t.user_code)}),l}return(0,f.default)(n,t),(0,u.default)(n,[{key:"componentDidMount",value:function(){var t=this;(0,x.readUser)().then(function(n){n&&void 0!==n&&t.setState({user:n})})}},{key:"renderBtn",value:function(){var t=this,n=this.props.resultGetUniqueDemand;return p.default.createElement(y.View,{style:{flexDirection:'row',paddingTop:10}},p.default.createElement(y.View,{style:{flex:1,alignItems:'center'}},p.default.createElement(D.default,{style:{borderColor:'transparent',borderRadius:6,marginLeft:5,marginRight:5,backgroundColor:'green'},onPress:function(){t.setState({triggerTreatmentClick:!0}),t.props.navigation.push(F.createGroupNanoCredit,{group:n.response})},textStyle:z.textbtnstyle},T.default.t('MODIFY_GROUP'))),p.default.createElement(y.View,{style:{flex:1,alignItems:'center'}},p.default.createElement(D.default,{style:{borderColor:'transparent',borderRadius:6,marginLeft:5,marginRight:5,backgroundColor:U.Color.redColor},isLoading:this.props.loadingTreatDemand,onPress:function(){t.setState({triggerCancelClick:!0}),t.onCancelDemand()},textStyle:z.textbtnstyle},T.default.t('DELETE_GROUP'))))}},{key:"render",value:function(){var t=this;return p.default.createElement(L.Provider,null,p.default.createElement(y.View,{style:{flex:1}},p.default.createElement(y.StatusBar,{backgroundColor:N.primaryDark,barStyle:"light-content",translucent:!1}),p.default.createElement(L.Appbar.Header,{dark:!0,style:{backgroundColor:N.primary}},p.default.createElement(L.Appbar.BackAction,{onPress:function(){t.props.navigation.pop()}}),p.default.createElement(L.Appbar.Content,{title:T.default.t('MY_GROUP')})),p.default.createElement(p.default.Fragment,null,(this.state.triggerTreatmentClick||this.state.triggerCancelClick)&&this.renderAlertErrorDeleteDemand(),this.props.loadingGetUniqueDemand?this.renderLoader():null!=this.props.resultGetUniqueDemand?this.renderDetail():null!==this.props.errorGetUniqueDemand?this.renderError():null)))}}]),n})(p.Component);V.navigatorStyle={navBarBackgroundColor:N.accentLight,statusBarColor:N.accent,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},V.navigationOptions=function(t){var n=t.navigation;return{drawerLabel:function(){return null},title:T.default.t('GROUP')+' N\xb0'+n.getParam("id","-")}};var q=(0,O.connect)(function(t){return{loadingGetUniqueDemand:t.getUserGroupDetailReducer.loading,resultGetUniqueDemand:t.getUserGroupDetailReducer.result,errorGetUniqueDemand:t.getUserGroupDetailReducer.error,loadingTreatDemand:t.createGroupReducer.loading,resultTreatDemand:t.createGroupReducer.result,errorTreatDemand:t.createGroupReducer.error}},function(t){return(0,v.bindActionCreators)({getUserGroupDetailAction:S.getUserGroupDetailAction,getUserGroupDetailReset:S.getUserGroupDetailReset,createGroupAction:P.createGroupAction,createGroupReset:P.createGroupReset,getNanoCreditUniqueDemandsAction:S.getNanoCreditUniqueDemandsAction,getNanoCreditUniqueDemandsReset:S.getNanoCreditUniqueDemandsReset,treatDemandGroupAction:P.treatDemandGroupAction,treatDemandGroupReset:P.treatDemandGroupReset,treatCreditDemand:h.treatCreditDemand,creditDemandResetReducer:h.creditDemandResetReducer,treatCancelDemand:b.treatCancelDemand,creditCancelResetReducer:b.creditCancelResetReducer},t)})(V);e.default=q;var z=y.StyleSheet.create({container:{flex:1},btnstyle:{},inputAmountText:(function(t){for(var n=1;nparseInt(l.state.comptePrincipal)?{errorMessage:b.default.t('AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT'),isValid:!1}:{errorMessage:'',isValid:!0}:{errorMessage:b.default.t('ENTER_VALID_AMOUNT'),isValid:!1}},l.renderGetDurationesponse=function(){var t=l.props,n=t.resultGetNanoCreditDuration,o=t.errorGetNanoCreditDuration;null!==n&&void 0!==n.response&&(n.response.length>0?l.setState({hasLoadDuration:!0,durations:n.response,durationSelect:n.response[0].value,modalVisible:!1}):0===n.response.length&&l.setState({hasLoadDuration:!0,durations:[],durationSelect:'',modalVisible:!1})),null!==o&&(void 0!==o.data?D.Alert.alert(b.default.t('ERROR_LABEL'),o.data.error,[{text:b.default.t("OK"),onPress:function(){l.props.getNanoCreditDemandDurationReset()}}],{cancelable:!1}):D.Alert.alert(b.default.t('ERROR_LABEL'),JSON.stringify(o),[{text:b.default.t("OK"),onPress:function(){l.props.getNanoCreditDemandDurationReset()}}],{cancelable:!1}))},l.renderAskNanoCreditResponse=function(){var t=l.props,n=t.result,o=t.error;null!==o&&void 0!==o.data&&D.Alert.alert(b.default.t("ERROR_LABLE"),o.data.error,[{text:b.default.t("OK"),onPress:function(){l.props.askNanoCreditReset()}}],{cancelable:!1}),null!==n&&null!==n.response&&D.Alert.alert(b.default.t("DEMAND_SEND"),n.response,[{text:b.default.t("OK"),onPress:function(){l.props.askNanoCreditReset(),l.props.navigation.pop()}}],{cancelable:!1})},l.onSubmitSendWalletToCard=function(){var t=l.state,n=t.montant,o=t.typeCautionName,u=t.durationSelect;l.ckeckIfFieldIsOK(o)?l.typeCautionAnim.shake(800):l.ckeckIfFieldIsOK(u)?l.typeCautionAnim.shake(800):l.ckeckIfFieldIsOK(n)||!l.isMontantValid().isValid?l.montantAnim.shake(800):l.props.askNanoCreditAction({id_user:l.state.user.id,type_caution:l.state.typeCautionToSend,duree_mois:l.state.durationSelect,montant:l.state.montant,password:l.state.password}),l.setState({isDataSubmit:!0})},l.renderLoader=function(){return h.default.createElement(v.ProgressDialog,{visible:l.props.loading||l.props.loadingGetNanoCredit,title:b.default.t('LOADING'),message:b.default.t('LOADING_INFO')})},l.state={codeGroupe:null,codeSponsor:null,nomGroupe:null,codeSponsor:null,user:null,montant:null,password:null,durations:[],durationSelect:null,triggerSubmitClick:!1,hasLoadDuration:!1,modalVisible:!1,isSubmitClick:!1,isDataSubmit:!1,isModalConfirmVisible:!1,typeCaution:(0,w.typeCaution)(),typeCautionName:b.default.t((0,w.typeCaution)()[0].name),typeCautionToSend:'groupe',wallet:_.store.getState().walletDetailReducer.result.response},l.props.getNanoCreditDemandDurationReset(),(0,O.readUser)().then(function(t){console.log("USER",t),t&&void 0!==t&&l.props.getNanoCreditDemandDurationAction({id_user:t.id,type:"nano_credit"})}),l}return(0,c.default)(n,t),(0,l.default)(n,[{key:"componentDidMount",value:function(){var t=this;(0,O.readUser)().then(function(n){n&&void 0!==n&&t.setState({user:n})})}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,C.default)(t)||(0,p.default)(t.length,0)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:b.default.t('DEPOSIT_TO_CARD')}),this.forceUpdate()}},{key:"render",value:function(){var t=this;return console.log(this.state),h.default.createElement(h.default.Fragment,null,(this.props.loading||this.props.loadingGetNanoCredit||this.state.modalVisible)&&this.renderLoader(),this.state.isDataSubmit&&this.renderAskNanoCreditResponse(),!this.state.hasLoadDuration&&this.renderGetDurationesponse(),h.default.createElement(D.ScrollView,{style:F.container},h.default.createElement(D.Text,{style:F.subbigtitle},b.default.t('DEMAND_NANO_CREDIT')),h.default.createElement(N.View,{ref:function(n){t.typeCautionAnim=n},style:{width:(0,S.responsiveWidth)(90),height:60,marginTop:20,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},h.default.createElement(L.Dropdown,{label:b.default.t('DEMAND_DURATION_IN_MONTH'),data:this.state.durations,useNativeDriver:!0,value:null!==this.state.durationSelect?this.state.durationSelect:'',onChangeText:function(n,o,l){t.setState({durationSelect:n})},valueExtractor:function(t){return t.value},labelExtractor:function(t){return t.value}})),h.default.createElement(N.View,{ref:function(n){t.typeCautionAnim=n},style:{width:(0,S.responsiveWidth)(90),height:60,marginTop:20,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},h.default.createElement(L.Dropdown,{label:b.default.t('CAUTION_TYPE'),data:this.state.typeCaution,useNativeDriver:!0,value:this.state.typeCautionName,onChangeText:function(n,o,l){n===b.default.t('INDIVIDUAL')?t.setState({typeCautionToSend:'individuel',typeCautionName:b.default.t('INDIVIDUAL')}):t.setState({typeCautionToSend:'groupe',typeCautionName:b.default.t('GROUP')})},valueExtractor:function(t){return b.default.t(t.name)},labelExtractor:function(t){return b.default.t(t.name)}})),h.default.createElement(N.View,{ref:function(n){t.montantAnim=n}},h.default.createElement(y.Fumi,{iconClass:R.default,iconName:'money',label:b.default.t('AMOUNT'),iconColor:'#f95a25',keyboardType:"numeric",iconSize:20,value:this.state.montant,onChangeText:function(n){t.setState({montant:n})},style:F.input}),h.default.createElement(D.View,{style:{position:'absolute',left:(0,S.responsiveWidth)(82),top:35,flexDirection:'row'}},h.default.createElement(D.View,{style:{width:1,borderLeftColor:'#f0f0f0',height:40,left:-8,top:-10,borderLeftWidth:1}}),h.default.createElement(D.Text,{style:[k.Typography.body1,k.FontWeight.bold]},this.state.wallet.currency_code))),h.default.createElement(N.View,{ref:function(n){t.passwordAnim=n}},h.default.createElement(y.Fumi,{iconClass:R.default,iconName:'lock',label:b.default.t('PASSWORD'),iconColor:'#f95a25',iconSize:20,secureTextEntry:!0,value:this.state.password,onChangeText:function(n){t.setState({password:n})},style:F.input})),h.default.createElement(f.default,{style:F.btnvalide,textStyle:F.textbtnvalide,onPress:function(){t.onSubmitSendWalletToCard()}},b.default.t('SUBMIT_LABEL'))))}}]),n})(h.Component));x.navigatorStyle={navBarBackgroundColor:T.Color.primaryColor,statusBarColor:T.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},x.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:b.default.t('DEMAND_NANO_CREDIT'),headerTintColor:'white',headerStyle:{backgroundColor:T.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:b.default.t('DEMAND_NANO_CREDIT')}};var V=(0,A.connect)(function(t){return{loading:t.askNanoCreditReducer.loading,result:t.askNanoCreditReducer.result,error:t.askNanoCreditReducer.error,loadingGetNanoCreditDuration:t.getNanoCreditDemandDurationReducer.loading,resultGetNanoCreditDuration:t.getNanoCreditDemandDurationReducer.result,errorGetNanoCreditDuration:t.getNanoCreditDemandDurationReducer.error}},function(t){return(0,E.bindActionCreators)({askNanoCreditAction:I.askNanoCreditAction,askNanoCreditReset:I.askNanoCreditReset,getNanoCreditDemandDurationAction:I.getNanoCreditDemandDurationAction,getNanoCreditDemandDurationReset:I.getNanoCreditDemandDurationReset},t)})(x);e.default=V;var F=D.StyleSheet.create({container:{flex:1,backgroundColor:T.Color.primaryDarkColor},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:T.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:T.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,S.responsiveHeight)(2),marginLeft:(0,S.responsiveWidth)(5),marginRight:(0,S.responsiveWidth)(5),borderRadius:5}})},1798,[4,1,8,9,10,12,13,716,688,1612,15,18,750,719,534,1515,703,538,1039,1056,1026,1015,1099,773,718,1645,1793,973,813,814]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=l(r(d[2])),n=l(r(d[3])),s=l(r(d[4])),u=l(r(d[5])),c=l(r(d[6])),f=l(r(d[7])),y=l(r(d[8])),p=t(r(d[9])),E=r(d[10]),C=l(r(d[11])),h=r(d[12]),T=r(d[13]),w=r(d[14]),x=l(r(d[15])),D=r(d[16]),b=r(d[17]),I=r(d[18]),_=r(d[19]),N=r(d[20]),V=r(d[21]),A=r(d[22]),R=r(d[23]),v=l(r(d[24])),S=l(r(d[25])),O=t(r(d[26])),P=l(r(d[27])),L=(r(d[28]),r(d[29]),(function(t){function l(t){var n;return(0,o.default)(this,l),(n=(0,s.default)(this,(0,u.default)(l).call(this,t))).renderRefundNanoCreditResponse=function(){var t=n.props,l=t.result,o=t.error;null!==o&&void 0!==o.data&&E.Alert.alert(C.default.t("ERROR_LABLE"),o.data.error,[{text:C.default.t("OK"),onPress:function(){n.props.refundCreditDemandUserReset()}}],{cancelable:!1}),null!==l&&null!==l.response&&E.Alert.alert(C.default.t("REFUND_DONE"),l.response,[{text:C.default.t("OK"),onPress:function(){n.props.refundCreditDemandUserReset(),I.IlinkEmitter.emit("refreshWallet"),I.IlinkEmitter.emit("updateNanoCreditAccount"),n.props.navigation.pop()}}],{cancelable:!1})},n.onSubmitRefundNanoCredit=function(){var t=n.state,l=t.idDemand,o=t.password;n.ckeckIfFieldIsOK(l)?n.idDemandAnim.shake(800):n.ckeckIfFieldIsOK(o)?n.passwordAnim.shake(800):n.props.refundCreditDemandUserAction({id_user:n.state.user.id,id_demande:n.state.idDemand,password:n.state.password},0),n.setState({isDataSubmit:!0})},n.renderLoader=function(){return p.default.createElement(T.ProgressDialog,{visible:n.props.loading||n.props.loadingGetCommission,title:C.default.t('LOADING'),message:C.default.t('LOADING_INFO')})},n.renderModalHistoryDetail=function(){return p.default.createElement(P.default.Container,{useNativeDriver:!0,visible:n.state.displayModalHistory},p.default.createElement(P.default.Title,null,C.default.t('DEMAND_DETAIL')),p.default.createElement(E.ScrollView,{persistentScrollbar:!0},p.default.createElement(E.View,{style:[B.blockView,{borderBottomColor:b.Color.borderColor}]},p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{style:[B.body2]},"Type")),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},C.default.t((0,R.displayTransactionType)(n.state.historyItemDetail.type_historique))))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{style:[B.body2]},C.default.t('ID_DEMAND'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.id_demande))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{style:[B.body2]},C.default.t('STATUS'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.etat))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{style:[B.body2]},C.default.t('DEMAND_DURATION_IN_MONTH'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.duree_mois))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('AMOUNT'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.montant+' '+n.state.wallet.currency_code))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('AMOUNT_REFUND'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.montant_rembourse+' '+n.state.wallet.currency_code))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('AMOUNT_PARTIALLY_REFUND'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.partiellement_rembourse+' '+n.state.wallet.currency_code))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('TAXES'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.taxe+' '+n.state.wallet.currency_code))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('INTERET'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.interet+' '+n.state.wallet.currency_code))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('WITHDRAWAL_IN_CASH'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},1==n.state.historyItemDetail.retrait_cash?C.default.t('YES'):C.default.t('NO')))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{style:[B.body2]},C.default.t('CREATION_DATE'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.date_creation))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('VALIDATION_DATE'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.date_validation))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('DATE_REMBOURSEMENT_PREVU'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.date_remboursement_prevu))),p.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},p.default.createElement(E.View,{style:{flex:1}},p.default.createElement(E.Text,{tyle:[A.Typography.body2]},C.default.t('DATE_REMBOURSEMENT'))),p.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},p.default.createElement(E.Text,{style:[A.Typography.caption1,b.Color.grayColor]},n.state.historyItemDetail.date_remboursement))))),p.default.createElement(P.default.Button,{bold:!0,label:C.default.t('CANCEL_LABEL'),onPress:function(){n.setState({displayModalHistory:!n.state.displayModalHistory})}}),p.default.createElement(P.default.Button,{bold:!0,label:C.default.t('SUBMIT_LABEL'),onPress:function(){n.setState({displayPasswordModal:!n.state.displayPasswordModal})}}))},n.renderPasswordDialog=function(){return p.default.createElement(P.default.Container,{useNativeDriver:!0,visible:n.state.displayPasswordModal},p.default.createElement(P.default.Title,null,C.default.t('PASSWORD')),p.default.createElement(P.default.Input,{placeholder:C.default.t('PLEASE_ENTER_THE_PASSWORD'),style:{borderBottomWidth:1,borderBottomColor:b.Color.borderColor},showSoftInputOnFocus:!0,onChangeText:function(t){n.setState({password:t})},secureTextEntry:!0,value:n.state.password,onSubmitEditing:function(){n.setState({displayPasswordModal:!1,displayModalHistory:!1,isDataSubmit:!0}),n.props.refundCreditDemandUserAction({id_user:n.state.user.id,id_demande:n.state.historyItemDetail.id_demande,password:n.state.password})}}),p.default.createElement(P.default.Button,{label:C.default.t('CANCEL_LABEL'),onPress:function(){n.setState({displayPasswordModal:!n.state.displayPasswordModal})}}),p.default.createElement(P.default.Button,{label:C.default.t('SUBMIT_LABEL'),onPress:function(){n.setState({displayPasswordModal:!1,displayModalHistory:!1,isDataSubmit:!0}),n.props.refundCreditDemandUserAction({id_user:n.state.user.id,id_demande:n.state.historyItemDetail.id_demande,password:n.state.password})}}))},n.renderNanoCreditItem=function(t,l){return p.default.createElement(E.TouchableOpacity,{onPress:function(){n.setState({displayModalHistory:!0,historyItemDetail:t})},style:[B.contentService,{borderBottomColor:b.Color.primaryColor}]},Object.keys((0,x.default)(t,['id','id_demande','agent','retrait_cash','date_remboursement_prevu','taxe','date_validation','duree_mois','interet','montant_rembourse','partiellement_rembourse'])).map(function(l,o){return p.default.createElement(E.View,{style:{alignItems:'center'},key:o},p.default.createElement(E.Text,{style:(A.Typography.overline,b.Color.grayColor,{marginTop:4})},(0,f.default)(l,'montant')?" "+(t[l].length>8?(0,R.cutString)((0,S.default)(t[l],' '),6):(0,S.default)(t[l],' '))+" "+n.state.wallet.currency_code:(0,f.default)(l,'date_creation')?(0,R.cutStringWithoutDot)(t[l],16):t[l]))}))},n.renderNanoCreditList=function(){var t=n.props,l=t.errorNanoCreditHistory,o=t.resultNanoCreditHistory;return null!==l?void 0!==l.data?p.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},p.default.createElement(E.Text,{style:A.Typography.body1},l.data.error)):p.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},p.default.createElement(E.Text,{style:A.Typography.body1},l)):null!==o&&null!==o.response?Array.isArray(o.response)&&o.response.length>0?p.default.createElement(p.default.Fragment,null,p.default.createElement(E.View,{style:[B.contentService,{borderBottomColor:b.Color.primaryColor}]},(0,R.nanoCreditHistoryLabel)().map(function(t,l){return p.default.createElement(E.View,{style:{alignItems:'center'},key:l},p.default.createElement(v.default,{name:t.icon,size:24,color:b.Color.primaryColor}),p.default.createElement(E.Text,{style:(A.Typography.overline,b.Color.grayColor,{marginTop:4})},C.default.t(t.label)))})),o.response.map(function(t,l){return n.renderNanoCreditItem(t,l)})):p.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'flex-start'}},p.default.createElement(E.Text,{style:A.Typography.body1},C.default.t('NO_NANO_CREDIT'))):void 0},n.renderNanoCreditHistory=function(){return p.default.createElement(E.View,{style:{backgroundColor:b.Color.containerBackgroundColor,flex:1}},n.props.loadingNanoCreditHistory?p.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},'android'===E.Platform.OS?p.default.createElement(p.default.Fragment,null,p.default.createElement(E.ProgressBarAndroid,null),p.default.createElement(E.Text,null,C.default.t('LOADING_DOTS'))):p.default.createElement(p.default.Fragment,null,p.default.createElement(E.ActivityIndicator,{size:"large",color:'#ccc'}),p.default.createElement(E.Text,null,C.default.t('LOADING_DOTS')))):n.renderNanoCreditList())},n.state={password:null,idDemand:null,codeGroup:null,loading:!1,user:null,triggerSubmitClick:!1,isSubmitClick:!1,isDataSubmit:!1,isModalConfirmVisible:!1,isGroupToModify:!1,displayModalHistory:!1,historyItemDetail:null,isDataHasLoaded:!1,displayPasswordModal:!1,wallet:n.props.navigation.state.params.wallet},n.props.getNanoCreditUserHistoryInProgressReset(),n}return(0,c.default)(l,t),(0,n.default)(l,[{key:"componentDidMount",value:function(){var t=this;(0,_.readUser)().then(function(l){l&&void 0!==l&&(t.setState({user:l}),t.props.getNanoCreditUserHistoryInProgressAction(l.id))})}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,y.default)(t)||(0,f.default)(t.length,0)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:C.default.t('REFUND_NANO_CREDIT')}),this.forceUpdate()}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,y.default)(t)||(0,f.default)(t.length,0)}},{key:"render",value:function(){return p.default.createElement(p.default.Fragment,null,(this.props.loading||this.props.loadingGetCommission)&&this.renderLoader(),this.state.isDataSubmit&&this.renderRefundNanoCreditResponse(),this.state.displayModalHistory&&this.renderModalHistoryDetail(),this.state.displayPasswordModal&&this.renderPasswordDialog(),p.default.createElement(E.ScrollView,{style:B.container},p.default.createElement(E.View,{style:[B.checkDefault,{borderBottomColor:b.Color.borderColor}]},p.default.createElement(E.Text,{style:[A.Typography.title3,A.Typography.semibold]},C.default.t('NANO_CREDIT_LIST'))),this.renderNanoCreditHistory()))}}]),l})(p.Component));L.navigatorStyle={navBarBackgroundColor:b.Color.primaryColor,statusBarColor:b.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},L.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:C.default.t('REFUND_NANO_CREDIT'),headerTintColor:'white',headerStyle:{backgroundColor:b.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:C.default.t('REFUND_NANO_CREDIT')}};var k=(0,w.connect)(function(t){return{loading:t.refundCreditDemandReducer.loading,result:t.refundCreditDemandReducer.result,error:t.refundCreditDemandReducer.error,loadingNanoCreditHistory:t.getNanoCreditUserHistoryInProgressReducer.loading,resultNanoCreditHistory:t.getNanoCreditUserHistoryInProgressReducer.result,errorNanoCreditHistory:t.getNanoCreditUserHistoryInProgressReducer.error}},function(t){return(0,D.bindActionCreators)({refundCreditDemandUserAction:N.refundCreditDemandUserAction,refundCreditDemandUserReset:N.refundCreditDemandUserReset,getNanoCreditUserHistoryInProgressAction:V.getNanoCreditUserHistoryInProgressAction,getNanoCreditUserHistoryInProgressReset:V.getNanoCreditUserHistoryInProgressReset},t)})(L);e.default=k;var B=E.StyleSheet.create({container:{flex:1,backgroundColor:b.Color.containerBackgroundColor,paddingHorizontal:20},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:b.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:b.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,h.responsiveHeight)(2),marginLeft:(0,h.responsiveWidth)(5),marginRight:(0,h.responsiveWidth)(5),borderRadius:5},circlePoint:{width:50,height:50,borderRadius:25,marginRight:5,alignItems:'center',justifyContent:'center'},checkDefault:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottomWidth:1,paddingVertical:10,marginTop:5},transactionContainer:{flexDirection:'row',paddingTop:10},containerTouch:{flex:1,flexDirection:'row',alignItems:'center',shadowColor:b.Color.borderColor,borderColor:b.Color.borderColor,borderWidth:.5,shadowOffset:{width:1.5,height:1.5},shadowOpacity:1,elevation:5,borderRadius:10,backgroundColor:b.Color.cardBackgroundColor},contain:{flexDirection:'row',justifyContent:'space-between'},imageBanner:{marginTop:15,marginLeft:5,width:O.scaleWithPixel(30),height:O.scaleWithPixel(30)},content:{height:O.scaleWithPixel(65),paddingHorizontal:10,justifyContent:'space-between',alignItems:'flex-start',flex:1},contentTitle:{paddingTop:12},contentService:{paddingVertical:10,borderBottomWidth:.5,flexDirection:'row',flexWrap:'wrap',justifyContent:'space-between'},containField:{padding:10,marginBottom:20,borderWidth:.5,shadowOffset:{width:1.5,height:1.5},shadowOpacity:1,elevation:5,flexDirection:"row",height:140,borderRadius:10},paymentItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottomWidth:1,paddingVertical:5,width:(0,h.responsiveWidth)(100),marginBottom:15},iconContent:{width:60,marginRight:10,alignItems:"center"},contentLeftItem:{flex:1,paddingTop:40,paddingLeft:10,paddingRight:10,alignItems:"center"}})},1799,[4,1,8,9,10,12,13,688,1612,15,18,719,534,1515,1039,552,1056,1026,773,718,1761,1793,1015,1645,875,1647,1014,1626,813,814]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(r(d[2])),o=l(r(d[3])),s=l(r(d[4])),u=l(r(d[5])),f=l(r(d[6])),c=l(r(d[7])),p=l(r(d[8])),C=l(r(d[9])),y=t(r(d[10])),D=r(d[11]),h=t(r(d[12])),E=l(r(d[13])),T=l(r(d[14])),w=r(d[15]),A=r(d[16]),N=r(d[17]),x=r(d[18]),b=r(d[19]),I=l(r(d[20])),R=r(d[21]),v=r(d[22]),_=r(d[23]),S=r(d[24]),V=r(d[25]),k=r(d[26]),L=r(d[27]),O=r(d[28]),F=l(r(d[29])),M=r(d[30]),W=(r(d[31]),r(d[32]),(function(t){function l(t){var o;return(0,n.default)(this,l),(o=(0,s.default)(this,(0,u.default)(l).call(this,t))).modalConfirmTransaction=function(t){var l=t.response.id_demande,n=t.response.montant,s=t.response.duree_mois,u=t.response.etat,f=t.response.taxe,c=t.response.interet,p=(t.response.date_demande,t.response.date_remboursement_prevu,t.response.date_remboursement,t.response.retrait_cash),C=t.response.date_creation;return y.default.createElement(E.default.Container,{useNativeDriver:!0,visible:o.state.isModalConfirmVisible},y.default.createElement(E.default.Title,null,T.default.t('DEMAND_DETAIL')),y.default.createElement(D.View,null,y.default.createElement(D.View,{style:[G.blockView,{borderBottomColor:_.Color.borderColor}]},y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{style:[G.body2]},T.default.t('ID_DEMAND'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},l))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{style:[G.body2]},T.default.t('AMOUNT'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},(0,F.default)(n,' ')+" "+o.state.wallet.currency_code))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('TAXES'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},(0,F.default)(f,' ')+" "+o.state.wallet.currency_code))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('INTERET'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},(0,F.default)(c,' ')+" "+o.state.wallet.currency_code))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('WITHDRAWAL_TYPE'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},p?T.default.t('WITHDRAWAL_IN_CASH'):T.default.t('TRANSFER_IN_ACCOUNT')))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('ETAT'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},u))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('DEMAND_DURATION_IN_MONTH'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},s))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('CREATION_DATE'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},M(C).format('DD-MM-YYYY')))))),y.default.createElement(E.default.Button,{bold:!0,label:T.default.t('CANCEL_LABEL'),onPress:function(){o.setState({isModalConfirmVisible:!1})}}),y.default.createElement(E.default.Button,{bold:!0,label:T.default.t('SUBMIT_LABEL'),onPress:function(){o.setState({isModalConfirmVisible:!1,isDataSubmit:!0}),o.props.cautionCreditDemandAgentAction({id_demande:o.state.idDemand,id_wallet_agent:o.state.wallet.id,retrait_cash:o.state.withdrawalInCash,password:o.state.password}),o.props.getNanoCreditDemandDetailReset()}}))},o.renderRefundNanoCreditResponse=function(){var t=o.props,l=t.result,n=t.error;null!==n&&void 0!==n.data&&D.Alert.alert(T.default.t("ERROR_LABLE"),n.data.error,[{text:T.default.t("OK"),onPress:function(){o.props.cautionCreditDemandAgentReset(),V.IlinkEmitter.emit("refreshWallet")}}],{cancelable:!1}),null!==l&&null!==l.response&&D.Alert.alert(T.default.t("CAUTIONNEMENT_DONE"),l.response,[{text:T.default.t("OK"),onPress:function(){o.props.cautionCreditDemandAgentReset(),V.IlinkEmitter.emit("refreshWallet"),o.props.navigation.pop()}}],{cancelable:!1})},o.onSubmitCautionnerNanoCredit=function(){var t=o.state,l=t.idDemand,n=t.password;o.ckeckIfFieldIsOK(l)?o.idDemandAnim.shake(800):o.ckeckIfFieldIsOK(n)?o.passwordAnim.shake(800):o.props.getNanoCreditDemandDetailAction(o.state.idDemand),o.setState({triggerSubmitClick:!0})},o.renderGetNanoCreditDemandDetailResponse=function(){var t=o.props,l=(t.resultGetNanoCreditDemandDetail,t.errorGetNanoCreditDemandDetail);null!==l&&(void 0!==l.data?D.Alert.alert(T.default.t('ERROR_LABEL'),l.data.error,[{text:T.default.t("OK"),onPress:function(){o.props.getNanoCreditDemandDetailReset()}}],{cancelable:!1}):D.Alert.alert(T.default.t('ERROR_LABEL'),JSON.stringify(l),[{text:T.default.t("OK"),onPress:function(){o.props.getNanoCreditDemandDetailAction()}}],{cancelable:!1}))},o.renderLoader=function(){return y.default.createElement(x.ProgressDialog,{visible:o.props.loading||o.props.loadingGetNanoCreditDemandDetail,title:T.default.t('LOADING'),message:T.default.t('LOADING_INFO')})},o.state={password:null,idDemand:null,codeGroup:null,loading:!1,user:null,triggerSubmitClick:!1,isSubmitClick:!1,isDataSubmit:!1,withdrawalInCashType:(0,O.withdrawalMode)(),withdrawalInCashTypeName:(0,O.withdrawalMode)()[0].name,isModalConfirmVisible:!1,isGroupToModify:!1,withdrawalInCash:!0,wallet:w.store.getState().walletDetailReducer.result.response},o.props.getNanoCreditDemandDetailReset(),o.props.cautionCreditDemandAgentReset(),o}return(0,f.default)(l,t),(0,o.default)(l,[{key:"componentDidMount",value:function(){var t=this;(0,L.readUser)().then(function(l){l&&void 0!==l&&t.setState({user:l})})}},{key:"componentWillReceiveProps",value:function(t){null!=t.resultGetNanoCreditDemandDetail&&void 0!==t.resultGetNanoCreditDemandDetail.response&&(t.loadingGetNanoCreditDemandDetail||this.setState({isModalConfirmVisible:!0}))}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,C.default)(t)||(0,p.default)(t.length,0)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:T.default.t('REFUND_NANO_CREDIT')}),this.forceUpdate()}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,C.default)(t)||(0,p.default)(t.length,0)}},{key:"render",value:function(){var t=this,l=this.props.resultGetNanoCreditDemandDetail;return y.default.createElement(y.default.Fragment,null,(this.props.loading||this.props.loadingGetNanoCreditDemandDetail)&&this.renderLoader(),this.state.isDataSubmit&&this.renderRefundNanoCreditResponse(),null!==l&&void 0!==l.response&&this.modalConfirmTransaction(l),y.default.createElement(D.ScrollView,{style:G.container},y.default.createElement(D.Text,{style:G.subbigtitle},T.default.t('DEMAND_INFO')),y.default.createElement(h.View,{ref:function(l){t.idDemandAnim=l}},y.default.createElement(b.Fumi,{iconClass:I.default,iconName:'id-card',label:T.default.t('ID_DEMAND'),iconColor:'#f95a25',iconSize:20,value:this.state.idDemand,onChangeText:function(l){t.setState({idDemand:l})},style:G.input})),y.default.createElement(h.View,{ref:function(l){t.typeRetraitAnim=l},style:{width:(0,N.responsiveWidth)(90),height:60,marginTop:20,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},y.default.createElement(A.Dropdown,{label:T.default.t('WITHDRAWAL_TYPE'),data:this.state.withdrawalInCashType,useNativeDriver:!0,value:T.default.t(this.state.withdrawalInCashTypeName),onChangeText:function(l,n,o){l===T.default.t('WITHDRAWAL_IN_CASH')?t.setState({withdrawalInCash:!0,withdrawalInCashTypeName:'WITHDRAWAL_IN_CASH'}):t.setState({withdrawalInCash:!1,withdrawalInCashTypeName:'TRANSFER_IN_ACCOUNT'})},valueExtractor:function(t){return T.default.t(t.name)},labelExtractor:function(t){return T.default.t(t.name)}})),y.default.createElement(h.View,{ref:function(l){t.passwordAnim=l}},y.default.createElement(b.Fumi,{iconClass:I.default,iconName:'lock',label:T.default.t('PASSWORD'),iconColor:'#f95a25',iconSize:20,secureTextEntry:!0,value:this.state.password,onChangeText:function(l){t.setState({password:l})},style:G.input})),y.default.createElement(c.default,{style:G.btnvalide,textStyle:G.textbtnvalide,onPress:function(){t.onSubmitCautionnerNanoCredit()}},this.state.isGroupToModify?T.default.t('MODIFY'):T.default.t('SUBMIT_LABEL'))))}}]),l})(y.Component));W.navigatorStyle={navBarBackgroundColor:_.Color.primaryColor,statusBarColor:_.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},W.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:T.default.t('CAUTION_CREDIT'),headerTintColor:'white',headerStyle:{backgroundColor:_.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:T.default.t('CAUTION_CREDIT')}};var B=(0,R.connect)(function(t){return{loading:t.cautionCreditDemandAgentReducer.loading,result:t.cautionCreditDemandAgentReducer.result,error:t.cautionCreditDemandAgentReducer.error,loadingGetNanoCreditDemandDetail:t.getNanoCreditDemandDetailReducer.loading,resultGetNanoCreditDemandDetail:t.getNanoCreditDemandDetailReducer.result,errorGetNanoCreditDemandDetail:t.getNanoCreditDemandDetailReducer.error}},function(t){return(0,v.bindActionCreators)({cautionCreditDemandAgentAction:k.cautionCreditDemandAgentAction,cautionCreditDemandAgentReset:k.cautionCreditDemandAgentReset,getNanoCreditDemandDetailAction:k.getNanoCreditDemandDetailAction,getNanoCreditDemandDetailReset:k.getNanoCreditDemandDetailReset},t)})(W);e.default=B;var G=D.StyleSheet.create({container:{flex:1,backgroundColor:_.Color.primaryDarkColor},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:_.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:_.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,N.responsiveHeight)(2),marginLeft:(0,N.responsiveWidth)(5),marginRight:(0,N.responsiveWidth)(5),borderRadius:5}})},1800,[4,1,8,9,10,12,13,716,688,1612,15,18,750,1626,719,1099,973,534,1515,703,538,1039,1056,1026,1015,773,1801,718,1645,1647,1031,813,814]); -__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.getNanoCreditDemandDetailReset=e.getNanoCreditDemandDetailAction=e.cautionCreditDemandAgentReset=e.cautionCreditDemandAgentAction=void 0;var n=r(d[1]),o=t(r(d[2])),c=t(r(d[3])),u=r(d[4]),s=r(d[5]);e.cautionCreditDemandAgentAction=function(t){var l=u.store.getState().authKeyReducer,D=null!==l?l.authKey.token_type+" "+l.authKey.access_token:'';return function(u){u((0,s.fetchCautionCreditDemandAgentPending)()),(0,o.default)({url:n.cautionCreditDemandtUrl,method:'POST',data:t,headers:{Authorization:D,'X-Localization':c.default.currentLocale()}}).then(function(t){console.log(t),u((0,s.fetchCautionCreditDemandAgentSuccess)(t))}).catch(function(t){t.response?u((0,s.fetchCautionCreditDemandAgentError)(t.response)):t.request?u((0,s.fetchCautionCreditDemandAgentError)(t.request)):u((0,s.fetchCautionCreditDemandAgentError)(t.message))})}};e.cautionCreditDemandAgentReset=function(){return function(t){t((0,s.fetchCautionCreditDemandAgentReset)())}};e.getNanoCreditDemandDetailAction=function(t){var l=u.store.getState().authKeyReducer,D=null!==l?l.authKey.token_type+" "+l.authKey.access_token:'';return function(u){u((0,s.fetchGetNanoCreditDemandDetailPending)()),(0,o.default)({url:n.getNanoCreditDemandUrl+"/"+t,method:'GET',headers:{Authorization:D,'X-Localization':c.default.currentLocale()}}).then(function(t){console.log(t),u((0,s.fetchGetNanoCreditDemandDetailSuccess)(t))}).catch(function(t){t.response?u(fetchGetNanoCreditDemandDetailError(t.response)):t.request?u(fetchGetNanoCreditDemandDetailError(t.request)):u(fetchGetNanoCreditDemandDetailError(t.message))})}};e.getNanoCreditDemandDetailReset=function(){return function(t){t((0,s.fetchGetNanoCreditDemandDetailReset)())}}},1801,[1,743,1073,719,1099,1175]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(r(d[2])),o=l(r(d[3])),s=l(r(d[4])),u=l(r(d[5])),f=l(r(d[6])),c=l(r(d[7])),p=l(r(d[8])),C=l(r(d[9])),y=t(r(d[10])),D=r(d[11]),h=t(r(d[12])),E=l(r(d[13])),T=l(r(d[14])),w=r(d[15]),A=r(d[16]),N=r(d[17]),b=r(d[18]),x=r(d[19]),I=l(r(d[20])),R=r(d[21]),v=r(d[22]),_=r(d[23]),S=r(d[24]),V=r(d[25]),k=r(d[26]),L=r(d[27]),O=r(d[28]),F=l(r(d[29])),M=r(d[30]),W=(r(d[31]),r(d[32]),(function(t){function l(t){var o;return(0,n.default)(this,l),(o=(0,s.default)(this,(0,u.default)(l).call(this,t))).modalConfirmTransaction=function(t){var l=t.response.id_demande,n=t.response.montant,s=t.response.duree_mois,u=t.response.etat,f=t.response.taxe,c=t.response.interet,p=(t.response.date_demande,t.response.date_remboursement_prevu,t.response.date_remboursement,t.response.retrait_cash),C=t.response.date_creation;return y.default.createElement(E.default.Container,{useNativeDriver:!0,visible:o.state.isModalConfirmVisible},y.default.createElement(E.default.Title,null,T.default.t('DEMAND_DETAIL')),y.default.createElement(D.View,null,y.default.createElement(D.View,{style:[G.blockView,{borderBottomColor:_.Color.borderColor}]},y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{style:[G.body2]},T.default.t('ID_DEMAND'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},l))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{style:[G.body2]},T.default.t('AMOUNT'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},(0,F.default)(n,' ')+" "+o.state.wallet.currency_code))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('TAXES'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},(0,F.default)(f,' ')+" "+o.state.wallet.currency_code))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('INTERET'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},(0,F.default)(c,' ')+" "+o.state.wallet.currency_code))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('WITHDRAWAL_TYPE'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},p?T.default.t('WITHDRAWAL_IN_CASH'):T.default.t('TRANSFER_IN_ACCOUNT')))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('ETAT'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},u))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('DEMAND_DURATION_IN_MONTH'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},s))),y.default.createElement(D.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(D.View,{style:{flex:1}},y.default.createElement(D.Text,{tyle:[S.Typography.body2]},T.default.t('CREATION_DATE'))),y.default.createElement(D.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(D.Text,{style:[S.Typography.caption1,_.Color.grayColor]},M(C).format('DD-MM-YYYY')))))),y.default.createElement(E.default.Button,{bold:!0,label:T.default.t('CANCEL_LABEL'),onPress:function(){o.setState({isModalConfirmVisible:!1})}}),y.default.createElement(E.default.Button,{bold:!0,label:T.default.t('SUBMIT_LABEL'),onPress:function(){o.setState({isModalConfirmVisible:!1,isDataSubmit:!0}),o.props.cautionCreditDemandAgentAction({id_demande:o.state.idDemand,id_wallet_agent:o.state.wallet.id,retrait_cash:o.state.withdrawalInCash,password:o.state.password}),o.props.getNanoCreditDemandDetailReset()}}))},o.renderRefundNanoCreditResponse=function(){var t=o.props,l=t.result,n=t.error;null!==n&&(console.log(n),void 0!==n.data&&D.Alert.alert(T.default.t("ERROR_LABLE"),n.data.error,[{text:T.default.t("OK"),onPress:function(){o.props.cautionCreditDemandAgentReset(),V.IlinkEmitter.emit("refreshWallet")}}],{cancelable:!1})),null!==l&&null!==l.response&&D.Alert.alert(T.default.t("CAUTIONNEMENT_DONE"),l.response,[{text:T.default.t("OK"),onPress:function(){o.props.cautionCreditDemandAgentReset(),V.IlinkEmitter.emit("refreshWallet"),o.props.navigation.pop()}}],{cancelable:!1})},o.onSubmitCautionnerNanoCredit=function(){var t=o.state,l=t.idDemand,n=t.password;o.ckeckIfFieldIsOK(l)?o.idDemandAnim.shake(800):o.ckeckIfFieldIsOK(n)?o.passwordAnim.shake(800):o.props.getNanoCreditDemandDetailAction(o.state.idDemand),o.setState({triggerSubmitClick:!0})},o.renderGetNanoCreditDemandDetailResponse=function(){var t=o.props,l=(t.resultGetNanoCreditDemandDetail,t.errorGetNanoCreditDemandDetail);null!==l&&(void 0!==l.data?D.Alert.alert(T.default.t('ERROR_LABEL'),l.data.error,[{text:T.default.t("OK"),onPress:function(){o.props.getNanoCreditDemandDetailReset()}}],{cancelable:!1}):D.Alert.alert(T.default.t('ERROR_LABEL'),JSON.stringify(l),[{text:T.default.t("OK"),onPress:function(){o.props.getNanoCreditDemandDetailAction()}}],{cancelable:!1}))},o.renderLoader=function(){return y.default.createElement(b.ProgressDialog,{visible:o.props.loading||o.props.loadingGetNanoCreditDemandDetail,title:T.default.t('LOADING'),message:T.default.t('LOADING_INFO')})},o.state={password:null,idDemand:null,codeGroup:null,loading:!1,user:null,triggerSubmitClick:!1,isSubmitClick:!1,isDataSubmit:!1,withdrawalInCashType:(0,O.withdrawalMode)(),withdrawalInCashTypeName:(0,O.withdrawalMode)()[0].name,isModalConfirmVisible:!1,isGroupToModify:!1,withdrawalInCash:!0,wallet:w.store.getState().walletDetailReducer.result.response},console.log("Wallet",o.state.wallet),o.props.getNanoCreditDemandDetailReset(),o.props.cautionCreditDemandAgentReset(),o}return(0,f.default)(l,t),(0,o.default)(l,[{key:"componentDidMount",value:function(){var t=this;(0,L.readUser)().then(function(l){l&&void 0!==l&&t.setState({user:l})})}},{key:"componentWillReceiveProps",value:function(t){null!=t.resultGetNanoCreditDemandDetail&&void 0!==t.resultGetNanoCreditDemandDetail.response&&(t.loadingGetNanoCreditDemandDetail||this.setState({isModalConfirmVisible:!0}))}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,C.default)(t)||(0,p.default)(t.length,0)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:T.default.t('REFUND_NANO_CREDIT')}),this.forceUpdate()}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,C.default)(t)||(0,p.default)(t.length,0)}},{key:"render",value:function(){var t=this,l=this.props.resultGetNanoCreditDemandDetail;return y.default.createElement(y.default.Fragment,null,(this.props.loading||this.props.loadingGetNanoCreditDemandDetail)&&this.renderLoader(),this.state.isDataSubmit&&this.renderRefundNanoCreditResponse(),this.state.triggerSubmitClick&&this.renderGetNanoCreditDemandDetailResponse(),null!==l&&void 0!==l.response&&this.modalConfirmTransaction(l),y.default.createElement(D.ScrollView,{style:G.container},y.default.createElement(D.Text,{style:G.subbigtitle},T.default.t('DEMAND_INFO')),y.default.createElement(h.View,{ref:function(l){t.idDemandAnim=l}},y.default.createElement(x.Fumi,{iconClass:I.default,iconName:'id-card',label:T.default.t('ID_DEMAND'),iconColor:'#f95a25',iconSize:20,value:this.state.idDemand,onChangeText:function(l){t.setState({idDemand:l})},style:G.input})),y.default.createElement(h.View,{ref:function(l){t.typeRetraitAnim=l},style:{width:(0,N.responsiveWidth)(90),height:60,marginTop:20,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},y.default.createElement(A.Dropdown,{label:T.default.t('WITHDRAWAL_TYPE'),data:this.state.withdrawalInCashType,useNativeDriver:!0,value:T.default.t(this.state.withdrawalInCashTypeName),onChangeText:function(l,n,o){l===T.default.t('WITHDRAWAL_IN_CASH')?t.setState({withdrawalInCash:!0,withdrawalInCashTypeName:'WITHDRAWAL_IN_CASH'}):t.setState({withdrawalInCash:!1,withdrawalInCashTypeName:'TRANSFER_IN_ACCOUNT'})},valueExtractor:function(t){return T.default.t(t.name)},labelExtractor:function(t){return T.default.t(t.name)}})),y.default.createElement(h.View,{ref:function(l){t.passwordAnim=l}},y.default.createElement(x.Fumi,{iconClass:I.default,iconName:'lock',label:T.default.t('PASSWORD'),iconColor:'#f95a25',iconSize:20,secureTextEntry:!0,value:this.state.password,onChangeText:function(l){t.setState({password:l})},style:G.input})),y.default.createElement(c.default,{style:G.btnvalide,textStyle:G.textbtnvalide,onPress:function(){t.onSubmitCautionnerNanoCredit()}},this.state.isGroupToModify?T.default.t('MODIFY'):T.default.t('SUBMIT_LABEL'))))}}]),l})(y.Component));W.navigatorStyle={navBarBackgroundColor:_.Color.primaryColor,statusBarColor:_.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},W.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:T.default.t('CAUTION_CREDIT'),headerTintColor:'white',headerStyle:{backgroundColor:_.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:T.default.t('CAUTION_CREDIT')}};var B=(0,R.connect)(function(t){return{loading:t.cautionCreditDemandAgentReducer.loading,result:t.cautionCreditDemandAgentReducer.result,error:t.cautionCreditDemandAgentReducer.error,loadingGetNanoCreditDemandDetail:t.getNanoCreditDemandDetailReducer.loading,resultGetNanoCreditDemandDetail:t.getNanoCreditDemandDetailReducer.result,errorGetNanoCreditDemandDetail:t.getNanoCreditDemandDetailReducer.error}},function(t){return(0,v.bindActionCreators)({cautionCreditDemandAgentAction:k.cautionCreditDemandAgentAction,cautionCreditDemandAgentReset:k.cautionCreditDemandAgentReset,getNanoCreditDemandDetailAction:k.getNanoCreditDemandDetailAction,getNanoCreditDemandDetailReset:k.getNanoCreditDemandDetailReset},t)})(W);e.default=B;var G=D.StyleSheet.create({container:{flex:1,backgroundColor:_.Color.primaryDarkColor},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:_.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:_.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,N.responsiveHeight)(2),marginLeft:(0,N.responsiveWidth)(5),marginRight:(0,N.responsiveWidth)(5),borderRadius:5}})},1800,[4,1,8,9,10,12,13,716,688,1612,15,18,750,1626,719,1099,973,534,1515,703,538,1039,1056,1026,1015,773,1801,718,1645,1647,1031,813,814]); +__d(function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.getNanoCreditDemandDetailReset=e.getNanoCreditDemandDetailAction=e.cautionCreditDemandAgentReset=e.cautionCreditDemandAgentAction=void 0;var n=r(d[1]),o=t(r(d[2])),c=t(r(d[3])),u=r(d[4]),s=r(d[5]);e.cautionCreditDemandAgentAction=function(t){var l=u.store.getState().authKeyReducer,D=null!==l?l.authKey.token_type+" "+l.authKey.access_token:'';return function(u){u((0,s.fetchCautionCreditDemandAgentPending)()),(0,o.default)({url:n.cautionCreditDemandtUrl,method:'POST',data:t,headers:{Authorization:D,'X-Localization':c.default.currentLocale()}}).then(function(t){console.log(t),u((0,s.fetchCautionCreditDemandAgentSuccess)(t))}).catch(function(t){t.response?u((0,s.fetchCautionCreditDemandAgentError)(t.response)):t.request?u((0,s.fetchCautionCreditDemandAgentError)(t.request)):u((0,s.fetchCautionCreditDemandAgentError)(t.message))})}};e.cautionCreditDemandAgentReset=function(){return function(t){t((0,s.fetchCautionCreditDemandAgentReset)())}};e.getNanoCreditDemandDetailAction=function(t){var l=u.store.getState().authKeyReducer,D=null!==l?l.authKey.token_type+" "+l.authKey.access_token:'';return function(u){u((0,s.fetchGetNanoCreditDemandDetailPending)()),(0,o.default)({url:n.getNanoCreditDemandUrl+"/"+t,method:'GET',headers:{Authorization:D,'X-Localization':c.default.currentLocale()}}).then(function(t){console.log(t),u((0,s.fetchGetNanoCreditDemandDetailSuccess)(t))}).catch(function(t){t.response?u((0,s.fetchGetNanoCreditDemandDetailError)(t.response)):t.request?u((0,s.fetchGetNanoCreditDemandDetailError)(t.request)):u((0,s.fetchGetNanoCreditDemandDetailError)(t.message))})}};e.getNanoCreditDemandDetailReset=function(){return function(t){t((0,s.fetchGetNanoCreditDemandDetailReset)())}}},1801,[1,743,1073,719,1099,1175]); __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])),p=n(r(d[6])),c=n(r(d[7])),f=n(r(d[8])),h=n(r(d[9])),E=t(r(d[10])),C=r(d[11]),D=t(r(d[12])),b=n(r(d[13])),S=r(d[14]),A=r(d[15]),y=r(d[16]),v=r(d[17]),N=n(r(d[18])),R=r(d[19]),O=r(d[20]),T=r(d[21]),L=r(d[22]),w=r(d[23]),_=r(d[24]),k=r(d[25]),I=r(d[26]),V=r(d[27]),x=r(d[28]),F=(r(d[29]),r(d[30]),(function(t){function n(t){var l;return(0,o.default)(this,n),(l=(0,s.default)(this,(0,u.default)(n).call(this,t))).isMontantValid=function(){var t=l.state.montant;return parseInt((0,f.default)(t,0))||t<0?{errorMessage:b.default.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),isValid:!1}:(0,_.isNormalInteger)(t)?t>parseInt(l.state.comptePrincipal)?{errorMessage:b.default.t('AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT'),isValid:!1}:{errorMessage:'',isValid:!0}:{errorMessage:b.default.t('ENTER_VALID_AMOUNT'),isValid:!1}},l.renderGetDurationesponse=function(){var t=l.props,n=t.resultGetNanoCreditDuration,o=t.errorGetNanoCreditDuration;null!==n&&void 0!==n.response&&(n.response.length>0?l.setState({hasLoadDuration:!0,durations:n.response,durationSelect:n.response[0].value,modalVisible:!1}):0===n.response.length&&l.setState({hasLoadDuration:!0,durations:[],durationSelect:'',modalVisible:!1})),null!==o&&(void 0!==o.data?C.Alert.alert(b.default.t('ERROR_LABEL'),o.data.error,[{text:b.default.t("OK"),onPress:function(){l.props.getNanoCreditDemandDurationReset()}}],{cancelable:!1}):C.Alert.alert(b.default.t('ERROR_LABEL'),JSON.stringify(o),[{text:b.default.t("OK"),onPress:function(){l.props.getNanoCreditDemandDurationReset()}}],{cancelable:!1}))},l.renderEpargnerArgentResponse=function(){var t=l.props,n=t.result,o=t.error;null!==o&&void 0!==o.data&&C.Alert.alert(b.default.t("ERROR_LABLE"),o.data.error,[{text:b.default.t("OK"),onPress:function(){l.props.epargnerArgentUserReset()}}],{cancelable:!1}),null!==n&&null!==n.response&&C.Alert.alert(b.default.t("EPARGNE_DEPOSE"),n.response,[{text:b.default.t("OK"),onPress:function(){l.props.epargnerArgentUserReset(),x.IlinkEmitter.emit("updateNanoCreditAccount"),l.props.navigation.pop()}}],{cancelable:!1})},l.onSubmitEpargnerArgent=function(){var t=l.state,n=t.montant,o=t.typeEpargneName,s=t.durationSelect;l.ckeckIfFieldIsOK(o)?l.typeEpargneAnim.shake(800):l.ckeckIfFieldIsOK(s)&&l.state.displayDuration?l.durationAnim.shake(800):l.ckeckIfFieldIsOK(n)||!l.isMontantValid().isValid?l.montantAnim.shake(800):l.props.epargnerArgentUserAction({id_user:l.state.user.id,type:l.state.typeEpargneToSend,duree_mois:l.state.durationSelect,montant:l.state.montant,password:l.state.password}),l.setState({isDataSubmit:!0})},l.renderLoader=function(){return E.default.createElement(y.ProgressDialog,{visible:l.props.loading||l.props.loadingGetNanoCredit,title:b.default.t('LOADING'),message:b.default.t('LOADING_INFO')})},l.state={codeGroupe:null,codeSponsor:null,nomGroupe:null,codeSponsor:null,displayDuration:!1,user:null,montant:null,password:null,durations:[],durationSelect:null,triggerSubmitClick:!1,hasLoadDuration:!1,modalVisible:!1,isSubmitClick:!1,isDataSubmit:!1,isModalConfirmVisible:!1,typeEpargne:(0,_.typeEpargne)(),typeEpargneName:b.default.t((0,_.typeEpargne)()[0].name),typeEpargneToSend:'simple',wallet:w.store.getState().walletDetailReducer.result.response},l.props.getNanoCreditDemandDurationReset(),(0,k.readUser)().then(function(t){console.log("USER",t),t&&void 0!==t&&l.props.getNanoCreditDemandDurationAction({id_user:t.id,type:"epargne"})}),l}return(0,p.default)(n,t),(0,l.default)(n,[{key:"componentDidMount",value:function(){var t=this;(0,k.readUser)().then(function(n){n&&void 0!==n&&t.setState({user:n})})}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,h.default)(t)||(0,f.default)(t.length,0)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:b.default.t('SAVE_MONEY')}),this.forceUpdate()}},{key:"render",value:function(){var t=this;return E.default.createElement(E.default.Fragment,null,(this.props.loading||this.props.loadingGetNanoCredit||this.state.modalVisible)&&this.renderLoader(),this.state.isDataSubmit&&this.renderEpargnerArgentResponse(),!this.state.hasLoadDuration&&this.renderGetDurationesponse(),E.default.createElement(C.ScrollView,{style:U.container},E.default.createElement(C.Text,{style:U.subbigtitle},b.default.t('FILL_INFORMATION')),E.default.createElement(D.View,{ref:function(n){t.typeEpargneAnim=n},style:{width:(0,A.responsiveWidth)(90),height:60,marginTop:20,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},E.default.createElement(S.Dropdown,{label:b.default.t('SAVE_MONEY_TYPE'),data:this.state.typeEpargne,useNativeDriver:!0,value:this.state.typeEpargneName,onChangeText:function(n,o,l){n===b.default.t('SIMPLE')?t.setState({typeEpargneToSend:'simple',typeEpargneName:b.default.t('SIMPLE'),displayDuration:!1}):t.setState({typeEpargneToSend:'blocked',typeEpargneName:b.default.t('BLOCKED'),displayDuration:!0})},valueExtractor:function(t){return b.default.t(t.name)},labelExtractor:function(t){return b.default.t(t.name)}})),this.state.displayDuration&&E.default.createElement(D.View,{ref:function(n){t.durationAnim=n},style:{width:(0,A.responsiveWidth)(90),height:60,marginTop:20,alignSelf:'center',borderRadius:10,paddingLeft:20,paddingRight:20,backgroundColor:'white'}},E.default.createElement(S.Dropdown,{label:b.default.t('DEMAND_DURATION_IN_MONTH'),data:this.state.durations,useNativeDriver:!0,value:null!==this.state.durationSelect?this.state.durationSelect:'',onChangeText:function(n,o,l){t.setState({durationSelect:n})},valueExtractor:function(t){return b.default.t(t.value)},labelExtractor:function(t){return b.default.t(t.value)}})),E.default.createElement(D.View,{ref:function(n){t.montantAnim=n}},E.default.createElement(v.Fumi,{iconClass:N.default,iconName:'money',label:b.default.t('AMOUNT'),iconColor:'#f95a25',keyboardType:"numeric",iconSize:20,value:this.state.montant,onChangeText:function(n){t.setState({montant:n})},style:U.input}),E.default.createElement(C.View,{style:{position:'absolute',left:(0,A.responsiveWidth)(82),top:35,flexDirection:'row'}},E.default.createElement(C.View,{style:{width:1,borderLeftColor:'#f0f0f0',height:40,left:-8,top:-10,borderLeftWidth:1}}),E.default.createElement(C.Text,{style:[L.Typography.body1,L.FontWeight.bold]},this.state.wallet.currency_code))),E.default.createElement(D.View,{ref:function(n){t.passwordAnim=n}},E.default.createElement(v.Fumi,{iconClass:N.default,iconName:'lock',label:b.default.t('PASSWORD'),iconColor:'#f95a25',iconSize:20,secureTextEntry:!0,value:this.state.password,onChangeText:function(n){t.setState({password:n})},style:U.input})),E.default.createElement(c.default,{style:U.btnvalide,textStyle:U.textbtnvalide,onPress:function(){t.onSubmitEpargnerArgent()}},b.default.t('SUBMIT_LABEL'))))}}]),n})(E.Component));F.navigatorStyle={navBarBackgroundColor:T.Color.primaryColor,statusBarColor:T.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},F.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:b.default.t('SAVE_MONEY'),headerTintColor:'white',headerStyle:{backgroundColor:T.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:b.default.t('SAVE_MONEY')}};var M=(0,R.connect)(function(t){return{loading:t.epargnerArgentUserReducer.loading,result:t.epargnerArgentUserReducer.result,error:t.epargnerArgentUserReducer.error,loadingGetNanoCreditDuration:t.getNanoCreditDemandDurationReducer.loading,resultGetNanoCreditDuration:t.getNanoCreditDemandDurationReducer.result,errorGetNanoCreditDuration:t.getNanoCreditDemandDurationReducer.error}},function(t){return(0,O.bindActionCreators)({epargnerArgentUserAction:V.epargnerArgentUserAction,epargnerArgentUserReset:V.epargnerArgentUserReset,getNanoCreditDemandDurationAction:I.getNanoCreditDemandDurationAction,getNanoCreditDemandDurationReset:I.getNanoCreditDemandDurationReset},t)})(F);e.default=M;var U=C.StyleSheet.create({container:{flex:1,backgroundColor:T.Color.primaryDarkColor},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:T.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:T.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,A.responsiveHeight)(2),marginLeft:(0,A.responsiveWidth)(5),marginRight:(0,A.responsiveWidth)(5),borderRadius:5}})},1802,[4,1,8,9,10,12,13,716,688,1612,15,18,750,719,973,534,1515,703,538,1039,1056,1026,1015,1099,1645,718,1793,1761,773,813,814]); __d(function(g,r,i,a,m,e,d){var t=r(d[0]),l=r(d[1]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=l(r(d[2])),n=l(r(d[3])),s=l(r(d[4])),u=l(r(d[5])),c=l(r(d[6])),f=l(r(d[7])),p=l(r(d[8])),y=t(r(d[9])),E=r(d[10]),h=l(r(d[11])),C=r(d[12]),w=r(d[13]),T=r(d[14]),x=r(d[15]),b=l(r(d[16])),I=r(d[17]),_=r(d[18]),D=r(d[19]),A=r(d[20]),S=r(d[21]),V=r(d[22]),v=r(d[23]),N=t(r(d[24])),P=l(r(d[25])),R=l(r(d[26])),B=l(r(d[27])),k=(r(d[28]),r(d[29]),(function(t){function l(t){var n;return(0,o.default)(this,l),(n=(0,s.default)(this,(0,u.default)(l).call(this,t))).renderBreakEpargneRespons=function(){var t=n.props,l=t.result,o=t.error;null!==o&&void 0!==o.data&&E.Alert.alert(h.default.t("ERROR_LABLE"),o.data.error,[{text:h.default.t("OK"),onPress:function(){n.props.casserEpargneUserReset()}}],{cancelable:!1}),null!==l&&null!==l.response&&E.Alert.alert(h.default.t("BREAK_EPARGNE_DONE"),l.response,[{text:h.default.t("OK"),onPress:function(){n.props.casserEpargneUserReset(),D.IlinkEmitter.emit("refreshWallet"),n.props.navigation.pop()}}],{cancelable:!1})},n.onSubmitCasserEpargne=function(){var t=n.state,l=t.idEpargne,o=t.password;n.ckeckIfFieldIsOK(l)?n.idEpargneAnim.shake(800):n.ckeckIfFieldIsOK(o)?n.passwordAnim.shake(800):n.props.casserEpargneUserAction({id_user:n.state.user.id,id_epargne:n.state.idEpargne,password:n.state.password},0),n.setState({isDataSubmit:!0})},n.renderLoader=function(){return y.default.createElement(w.ProgressDialog,{visible:n.props.loading||n.props.loadingGetCommission||n.props.loadingNanoCreditHistory,title:h.default.t('LOADING'),message:h.default.t('LOADING_INFO')})},n.renderModalHistoryDetail=function(){return y.default.createElement(B.default.Container,{useNativeDriver:!0,visible:n.state.displayModalHistory},y.default.createElement(B.default.Title,null,h.default.t('DEMAND_DETAIL')),y.default.createElement(E.ScrollView,null,y.default.createElement(E.View,{style:[O.blockView,{borderBottomColor:I.Color.borderColor}]},y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{style:[O.body2]},h.default.t('ID_SAVINGS'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.id_epargne))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{style:[O.body2]},h.default.t('STATUS'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.etat))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{style:[O.body2]},h.default.t('DEMAND_DURATION_IN_MONTH'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.duree_mois))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{style:[O.body2]},"Type")),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.type))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{tyle:[_.Typography.body2]},h.default.t('AMOUNT'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.montant+' '+n.state.wallet.currency_code))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{tyle:[_.Typography.body2]},h.default.t('AMOUNT_WITHDRAWAL'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.montant_retire+' '+n.state.wallet.currency_code))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{tyle:[_.Typography.body2]},h.default.t('TAXES'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.taxe+' '+n.state.wallet.currency_code))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{tyle:[_.Typography.body2]},h.default.t('INTERET'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.interet+' '+n.state.wallet.currency_code))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{style:[O.body2]},h.default.t('CREATION_DATE'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.date_creation))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{tyle:[_.Typography.body2]},h.default.t('FINAL_DATE'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},(0,f.default)(n.state.historyItemDetail.type,'SIMPLE')?h.default.t('NON_APPLICABLE'):n.state.historyItemDetail.date_fin))),y.default.createElement(E.View,{style:{flexDirection:'row',marginTop:10}},y.default.createElement(E.View,{style:{flex:1}},y.default.createElement(E.Text,{tyle:[_.Typography.body2]},h.default.t('CASSATION_DATE'))),y.default.createElement(E.View,{style:{flex:1,alignItems:'flex-end'}},y.default.createElement(E.Text,{style:[_.Typography.caption1,I.Color.grayColor]},n.state.historyItemDetail.date_cassation))))),y.default.createElement(B.default.Button,{bold:!0,label:h.default.t('CANCEL_LABEL'),onPress:function(){n.setState({displayModalHistory:!n.state.displayModalHistory})}}),y.default.createElement(B.default.Button,{bold:!0,label:h.default.t('SUBMIT_LABEL'),onPress:function(){n.setState({displayPasswordModal:!n.state.displayPasswordModal})}}))},n.renderPasswordDialog=function(){return y.default.createElement(B.default.Container,{useNativeDriver:!0,visible:n.state.displayPasswordModal},y.default.createElement(B.default.Title,null,h.default.t('PASSWORD')),y.default.createElement(B.default.Input,{placeholder:h.default.t('PLEASE_ENTER_THE_PASSWORD'),style:{borderBottomWidth:1,borderBottomColor:I.Color.borderColor},showSoftInputOnFocus:!0,onChangeText:function(t){n.setState({password:t})},secureTextEntry:!0,value:n.state.password,onSubmitEditing:function(){n.setState({displayPasswordModal:!1,displayModalHistory:!1,isDataSubmit:!0}),n.props.refundCreditDemandUserAction({id_user:n.state.user.id,id_epargne:n.state.historyItemDetail.id_epargne,password:n.state.password})}}),y.default.createElement(B.default.Button,{label:h.default.t('CANCEL_LABEL'),onPress:function(){n.setState({displayPasswordModal:!n.state.displayPasswordModal})}}),y.default.createElement(B.default.Button,{label:h.default.t('SUBMIT_LABEL'),onPress:function(){n.setState({displayPasswordModal:!1,displayModalHistory:!1,isDataSubmit:!0}),n.props.casserEpargneUserAction({id_user:n.state.user.id,id_epargne:n.state.historyItemDetail.id_epargne,password:n.state.password})}}))},n.renderNanoCreditItem=function(t,l){return y.default.createElement(E.TouchableOpacity,{onPress:function(){n.setState({displayModalHistory:!0,historyItemDetail:t})},style:[O.contentService,{borderBottomColor:I.Color.primaryColor}]},Object.keys((0,b.default)(t,['id','id_epargne','montant_retire','date_demande','date_fin','date_remboursement_prevu','date_validation','date_cassation','date_remboursement','id_demande','duree_mois','taxe','','date_fin','date_cassation','id_user','id_network','user','partiellement_rembourse','user_phone','interet','date_remboursement_prevu','date_remboursement','id_wallet_agent','retrait_cash','codeParrain','agent','montant_rembourse',''])).map(function(l,o){return y.default.createElement(E.View,{style:{alignItems:'center'},key:o},y.default.createElement(E.Text,{style:(_.Typography.overline,I.Color.grayColor,{marginTop:4})},(0,f.default)(l,'montant')?" "+(t[l].length>8?(0,v.cutString)((0,R.default)(t[l],' '),6):(0,R.default)(t[l],' '))+" "+n.state.wallet.currency_code:(0,f.default)(l,'date_creation')?(0,v.cutStringWithoutDot)(t[l],16):t[l]))}))},n.renderNanoCreditList=function(){var t=n.props,l=t.errorNanoCreditHistory,o=t.resultNanoCreditHistory;return null!==l?void 0!==l.data?y.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},y.default.createElement(E.Text,{style:_.Typography.body1},l.data.error)):y.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},y.default.createElement(E.Text,{style:_.Typography.body1},l)):null!==o&&null!==o.response?Array.isArray(o.response)&&o.response.length>0?y.default.createElement(y.default.Fragment,null,y.default.createElement(E.View,{style:[O.contentService,{borderBottomColor:I.Color.primaryColor}]},(0,v.nanoCreditHistoryLabel)().map(function(t,l){return y.default.createElement(E.View,{style:{alignItems:'center'},key:l},y.default.createElement(P.default,{name:t.icon,size:24,color:I.Color.primaryColor}),y.default.createElement(E.Text,{style:(_.Typography.overline,I.Color.grayColor,{marginTop:4})},h.default.t(t.label)))})),o.response.map(function(t,l){return n.renderNanoCreditItem(t,l)})):y.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'flex-start'}},y.default.createElement(E.Text,{style:_.Typography.body1},h.default.t('NO_SAVINGS'))):void 0},n.renderNanoCreditHistory=function(){return y.default.createElement(E.View,{style:{backgroundColor:I.Color.containerBackgroundColor,flex:1}},n.props.loadingNanoCreditHistory?y.default.createElement(E.View,{style:{flex:1,justifyContent:'center',alignItems:'center'}},y.default.createElement(y.default.Fragment,null,y.default.createElement(E.ProgressBarAndroid,null),y.default.createElement(E.Text,null,h.default.t('LOADING_DOTS')))):n.renderNanoCreditList())},n.state={password:null,idEpargne:null,codeGroup:null,loading:!1,user:null,triggerSubmitClick:!1,isSubmitClick:!1,isDataSubmit:!1,isModalConfirmVisible:!1,isGroupToModify:!1,displayModalHistory:!1,historyItemDetail:null,isDataHasLoaded:!1,displayPasswordModal:!1,wallet:n.props.navigation.state.params.wallet},n.props.getEpargneInProgressReset(),n}return(0,c.default)(l,t),(0,n.default)(l,[{key:"componentDidMount",value:function(){var t=this;(0,A.readUser)().then(function(l){l&&void 0!==l&&(t.setState({user:l}),t.props.getEpargneInProgressAction(l.id))})}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,p.default)(t)||(0,f.default)(t.length,0)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:h.default.t('REFUND_NANO_CREDIT')}),this.forceUpdate()}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,p.default)(t)||(0,f.default)(t.length,0)}},{key:"render",value:function(){return y.default.createElement(y.default.Fragment,null,(this.props.loading||this.props.loadingGetCommission||this.props.loadingNanoCreditHistory)&&this.renderLoader(),this.state.isDataSubmit&&this.renderBreakEpargneRespons(),this.state.displayModalHistory&&this.renderModalHistoryDetail(),this.state.displayPasswordModal&&this.renderPasswordDialog(),y.default.createElement(E.ScrollView,{style:O.container},y.default.createElement(E.View,{style:[O.checkDefault,{borderBottomColor:I.Color.borderColor}]},y.default.createElement(E.Text,{style:[_.Typography.title3,_.Typography.semibold]},h.default.t('SAVINGS_LIST'))),this.renderNanoCreditHistory()))}}]),l})(y.Component));k.navigatorStyle={navBarBackgroundColor:I.Color.primaryColor,statusBarColor:I.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},k.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:h.default.t('BREAK_EPARGNE'),headerTintColor:'white',headerStyle:{backgroundColor:I.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:h.default.t('BREAK_EPARGNE')}};var L=(0,T.connect)(function(t){return{loading:t.casserEpargneUserReducer.loading,result:t.casserEpargneUserReducer.result,error:t.casserEpargneUserReducer.error,errorNanoCreditHistory:t.getEpargneInProgressReducer.error,resultNanoCreditHistory:t.getEpargneInProgressReducer.result,loadingNanoCreditHistory:t.getEpargneInProgressReducer.loading}},function(t){return(0,x.bindActionCreators)({casserEpargneUserAction:V.casserEpargneUserAction,casserEpargneUserReset:V.casserEpargneUserReset,getEpargneInProgressAction:S.getEpargneInProgressAction,getEpargneInProgressReset:S.getEpargneInProgressReset},t)})(k);e.default=L;var O=E.StyleSheet.create({container:{flex:1,backgroundColor:I.Color.containerBackgroundColor,paddingHorizontal:20},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:I.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:I.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,C.responsiveHeight)(2),marginLeft:(0,C.responsiveWidth)(5),marginRight:(0,C.responsiveWidth)(5),borderRadius:5},circlePoint:{width:50,height:50,borderRadius:25,marginRight:5,alignItems:'center',justifyContent:'center'},checkDefault:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottomWidth:1,paddingVertical:10,marginTop:5},transactionContainer:{flexDirection:'row',paddingTop:10},containerTouch:{flex:1,flexDirection:'row',alignItems:'center',shadowColor:I.Color.borderColor,borderColor:I.Color.borderColor,borderWidth:.5,shadowOffset:{width:1.5,height:1.5},shadowOpacity:1,elevation:5,borderRadius:10,backgroundColor:I.Color.cardBackgroundColor},contain:{flexDirection:'row',justifyContent:'space-between'},imageBanner:{marginTop:15,marginLeft:5,width:N.scaleWithPixel(30),height:N.scaleWithPixel(30)},content:{height:N.scaleWithPixel(65),paddingHorizontal:10,justifyContent:'space-between',alignItems:'flex-start',flex:1},contentTitle:{paddingTop:12},contentService:{paddingVertical:10,borderBottomWidth:.5,flexDirection:'row',flexWrap:'wrap',justifyContent:'space-between'},containField:{padding:10,marginBottom:20,borderWidth:.5,shadowOffset:{width:1.5,height:1.5},shadowOpacity:1,elevation:5,flexDirection:"row",height:140,borderRadius:10},paymentItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottomWidth:1,paddingVertical:5,width:(0,C.responsiveWidth)(100),marginBottom:15},iconContent:{width:60,marginRight:10,alignItems:"center"},contentLeftItem:{flex:1,paddingTop:40,paddingLeft:10,paddingRight:10,alignItems:"center"}})},1803,[4,1,8,9,10,12,13,688,1612,15,18,719,534,1515,1039,1056,552,1026,1015,773,718,1793,1761,1645,1014,875,1647,1626,813,814]); __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])),p=n(r(d[8])),h=n(r(d[9])),v=t(r(d[10])),k=r(d[11]),b=t(r(d[12])),T=n(r(d[13])),E=r(d[14]),C=r(d[15]),S=n(r(d[16])),W=r(d[17]),w=r(d[18]),B=r(d[19]),y=r(d[20]),_=r(d[21]),A=r(d[22]),R=r(d[23]),I=r(d[24]),O=r(d[25]),F=r(d[26]),L=(r(d[27]),r(d[28]),(function(t){function n(t){var l;return(0,o.default)(this,n),(l=(0,s.default)(this,(0,u.default)(n).call(this,t))).renderEnvoieWalletToBankResponse=function(){var t=l.props,n=t.resultEnvoieWalletToBank,o=t.errorEnvoieWalletToBank;null!==o&&void 0!==o.data&&k.Alert.alert(T.default.t("ERROR_TRANSFER"),o.data.error,[{text:T.default.t("OK"),onPress:function(){l.props.envoieUserWalletToBankReset()}}],{cancelable:!1}),null!==n&&null!==n.response&&k.Alert.alert(T.default.t("SUCCESS_TRANSFER"),n.response,[{text:T.default.t("OK"),onPress:function(){l.props.envoieUserWalletToBankReset(),R.IlinkEmitter.emit("refreshWallet"),l.props.navigation.pop()}}],{cancelable:!1})},l.isMontantValid=function(){var t=l.state.montant;return parseInt((0,p.default)(t,0))||t<0?{errorMessage:T.default.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),isValid:!1}:(0,F.isNormalInteger)(t)?{errorMessage:'',isValid:!0}:{errorMessage:T.default.t('ENTER_VALID_AMOUNT'),isValid:!1}},l.onSubmitSendWalletToBank=function(){var t=l.state,n=t.montant,o=t.password,s=t.codeIban;l.ckeckIfFieldIsOK(s)?(s.length,l.codeIbanAnim.shake(800)):l.ckeckIfFieldIsOK(n)||!l.isMontantValid().isValid?l.montantAnim.shake(800):l.ckeckIfFieldIsOK(o)?l.passwordAnim.shake(800):(console.log("id wallet network",l.state.bank),l.props.envoieUserWalletToBankAction({type:18,id_wallet_agent:l.state.wallet.id,id_wallet_network:l.state.wallet.id_network,iban:s,id_bank:l.state.bank.id_operator,montant:n,password:o})),l.setState({isDataSubmit:!0})},l.renderLoader=function(){return v.default.createElement(C.ProgressDialog,{visible:l.props.loadingEnvoieWalletToBank,title:T.default.t('LOADING'),message:T.default.t('LOADING_INFO')})},l.state={montant:null,password:null,codeIban:null,loading:!1,user:null,triggerSubmitClick:!1,isSubmitClick:!1,isDataSubmit:!1,isModalConfirmVisible:!1,wallet:A.store.getState().walletDetailReducer.result.response,bank:l.props.navigation.state.params.bank},l.props.envoieUserWalletToBankReset(),l}return(0,c.default)(n,t),(0,l.default)(n,[{key:"componentDidMount",value:function(){var t=this;(0,I.readUser)().then(function(n){n&&void 0!==n&&t.setState({user:n})})}},{key:"componentWillReceiveProps",value:function(t){console.log('PROPS',t)}},{key:"updateLangue",value:function(){this.props.navigation.setParams({name:T.default.t('DEPOSIT_TO_CARD')}),this.forceUpdate()}},{key:"ckeckIfFieldIsOK",value:function(t){return(0,h.default)(t)||(0,p.default)(t.length,0)}},{key:"render",value:function(){var t=this;return v.default.createElement(v.default.Fragment,null,this.props.loadingEnvoieWalletToBank&&this.renderLoader(),this.state.isDataSubmit&&this.renderEnvoieWalletToBankResponse(),v.default.createElement(k.ScrollView,{style:U.container},v.default.createElement(k.Text,{style:U.subbigtitle},T.default.t('ENVOIE_WALLET_TO_BANK')),v.default.createElement(b.View,{ref:function(n){t.codeIbanAnim=n}},v.default.createElement(W.Fumi,{iconClass:S.default,iconName:'id-card',label:T.default.t('CODE_IBAN'),iconColor:'#f95a25',iconSize:20,value:this.state.codeIban,onChangeText:function(n){t.setState({codeIban:n})},style:U.input})),v.default.createElement(b.View,{ref:function(n){t.montantAnim=n}},v.default.createElement(W.Fumi,{iconClass:S.default,iconName:'money',label:T.default.t('AMOUNT'),iconColor:'#f95a25',keyboardType:"numeric",iconSize:20,value:this.state.montant,onChangeText:function(n){t.setState({montant:n})},style:U.input}),v.default.createElement(k.View,{style:{position:'absolute',left:(0,E.responsiveWidth)(82),top:35,flexDirection:'row'}},v.default.createElement(k.View,{style:{width:1,borderLeftColor:'#f0f0f0',height:40,left:-8,top:-10,borderLeftWidth:1}}),v.default.createElement(k.Text,{style:[_.Typography.body1,_.FontWeight.bold]},this.state.wallet.currency_code))),v.default.createElement(b.View,{ref:function(n){t.passwordAnim=n}},v.default.createElement(W.Fumi,{iconClass:S.default,iconName:'lock',label:T.default.t('PASSWORD'),iconColor:'#f95a25',iconSize:20,secureTextEntry:!0,value:this.state.password,onChangeText:function(n){t.setState({password:n})},style:U.input})),v.default.createElement(f.default,{style:U.btnvalide,textStyle:U.textbtnvalide,onPress:function(){t.onSubmitSendWalletToBank()}},T.default.t('SUBMIT_LABEL'))))}}]),n})(v.Component));L.navigatorStyle={navBarBackgroundColor:y.Color.primaryColor,statusBarColor:y.Color.primaryDarkColor,navBarTextColor:'#FFFFFF',navBarButtonColor:'#FFFFFF'},L.navigationOptions=function(){return{drawerLabel:function(){return null},headerTitle:T.default.t('DEPOSIT_WALLET_TO_BANK'),headerTintColor:'white',headerStyle:{backgroundColor:y.Color.primaryColor,marginTop:0,color:'white'},headerTitleStyle:{color:"white"},title:T.default.t('DEPOSIT_WALLET_TO_BANK')}};var N=(0,w.connect)(function(t){return{loadingEnvoieWalletToBank:t.envoieUserWalletToBank.loading,resultEnvoieWalletToBank:t.envoieUserWalletToBank.result,errorEnvoieWalletToBank:t.envoieUserWalletToBank.error}},function(t){return(0,B.bindActionCreators)({envoieUserWalletToBankAction:O.envoieUserWalletToBankAction,envoieUserWalletToBankReset:O.envoieUserWalletToBankReset},t)})(L);e.default=N;var U=k.StyleSheet.create({container:{flex:1,backgroundColor:y.Color.primaryDarkColor},textbtnvalide:{color:'white',fontWeight:'bold'},bigtitle:{color:'white',fontSize:20,flex:1,fontWeight:'bold',textAlign:'center',margin:20},blockView:{paddingVertical:10,borderBottomWidth:1},subbigtitle:{color:'white',fontSize:17,textAlign:'center',margin:5},btnvalide:{marginTop:20,marginLeft:20,marginRight:20,borderColor:'transparent',backgroundColor:y.Color.accentLightColor,height:52},btnSubmit:{marginTop:20,borderColor:'transparent',backgroundColor:y.Color.accentLightColor,height:52,width:"30%",marginLeft:20,marginRight:20},input:{height:60,marginTop:(0,E.responsiveHeight)(2),marginLeft:(0,E.responsiveWidth)(5),marginRight:(0,E.responsiveWidth)(5),borderRadius:5}})},1804,[4,1,8,9,10,12,13,716,688,1612,15,18,750,719,534,1515,538,703,1039,1056,1026,1015,1099,773,718,1774,1645,813,814]); diff --git a/screens/home/Home.js b/screens/home/Home.js index 67dca936..ebf4f7a9 100644 --- a/screens/home/Home.js +++ b/screens/home/Home.js @@ -1653,7 +1653,7 @@ class Home extends BaseScreen { translucent={true} /> {/* Start here to comment */} - { + {/*{ (this.state.loadingDialog || this.props.loading) ? + />*/} {this.makeCardSearch()} {this.makeSlidingUp()} {this.makeDialogLoader()} diff --git a/screens/nano-credit/CautionNanoCreditAgent.js b/screens/nano-credit/CautionNanoCreditAgent.js index 44a5cc7c..a474ed2b 100644 --- a/screens/nano-credit/CautionNanoCreditAgent.js +++ b/screens/nano-credit/CautionNanoCreditAgent.js @@ -54,6 +54,7 @@ class CautionNanoCreditAgent extends Component { withdrawalInCash: true, wallet: store.getState().walletDetailReducer.result.response }; + console.log("Wallet", this.state.wallet); this.props.getNanoCreditDemandDetailReset(); this.props.cautionCreditDemandAgentReset(); @@ -240,6 +241,7 @@ class CautionNanoCreditAgent extends Component { const {result, error} = this.props; if (error !== null) { + console.log(error); if (typeof error.data !== 'undefined') { Alert.alert( I18n.t("ERROR_LABLE"), @@ -255,6 +257,7 @@ class CautionNanoCreditAgent extends Component { {cancelable: false} ) } + } if (result !== null) { @@ -276,7 +279,7 @@ class CautionNanoCreditAgent extends Component { ) } } - } + }; updateLangue() { this.props.navigation.setParams({name: I18n.t('REFUND_NANO_CREDIT')}) @@ -357,6 +360,7 @@ class CautionNanoCreditAgent extends Component { <> {(this.props.loading || this.props.loadingGetNanoCreditDemandDetail) && this.renderLoader()} {this.state.isDataSubmit && this.renderRefundNanoCreditResponse()} + {this.state.triggerSubmitClick && this.renderGetNanoCreditDemandDetailResponse()} { (resultGetNanoCreditDemandDetail !== null) && (typeof resultGetNanoCreditDemandDetail.response !== 'undefined') && diff --git a/screens/wallet/WalletDetail.js b/screens/wallet/WalletDetail.js index ab27f504..7372ff0a 100644 --- a/screens/wallet/WalletDetail.js +++ b/screens/wallet/WalletDetail.js @@ -59,6 +59,7 @@ import { } from '../../webservice/WalletTransactionHistoryApi'; import {resetCommissionReducer, transferCommissionAction} from '../../webservice/WalletTransferCommission'; import {readUser} from '../../webservice/AuthApi'; +import {store} from "../../redux/store"; let moment = require('moment-timezone'); const thousands = require('thousands'); @@ -86,7 +87,7 @@ class WalletDetail extends Component { scrollHeaderY: 0, displayModalHistory: false, displaySuperHyperModalHistory: false, - historyItemDetail: null + historyItemDetail: null, }; this.renderContent = null; @@ -142,30 +143,34 @@ class WalletDetail extends Component { payload => { const {result} = this.props; console.log("will focus"); - if (result !== null) { - if (typeof result.response !== 'undefined') { - const wallet = result.response[0]; - readUser().then((user) => { - if (user !== null && user !== undefined) { - if (user.category !== undefined) { - switch (user.category) { - case "super": - this.props.getHyperSuperTransactionHistoryAction(user.code_membre, false); - break; - case "hyper": - this.props.getHyperSuperTransactionHistoryAction(user.network_id, true); - break; + this.setState({ + wallet: {currency_code: ''} + }, ()=>{ + if (result !== null) { + if (typeof result.response !== 'undefined') { + const wallet = result.response[0]; + readUser().then((user) => { + if (user !== null && user !== undefined) { + if (user.category !== undefined) { + switch (user.category) { + case "super": + this.props.getHyperSuperTransactionHistoryAction(user.code_membre, false); + break; + case "hyper": + this.props.getHyperSuperTransactionHistoryAction(user.network_id, true); + break; + } + this.setState({}); } - this.setState({}); } - } - }); - this.setState({ - wallet: wallet, - isTriggerRefresh: false - }) + }); + this.setState({ + wallet: wallet, + isTriggerRefresh: false + }) + } } - } + }) }); } @@ -735,7 +740,7 @@ class WalletDetail extends Component { { isEqual(element, 'montant') ? - ` ${item[element].length > 8 ? cutString(thousands(item[element], ' '), 6) : thousands(item[element], ' ')} ${this.state.wallet.currency_code}` + ` ${item[element].length > 8 ? cutString(thousands(item[element], ' '), 6) : thousands(item[element], ' ')} ${this.state.wallet !== undefined ? this.state.wallet.currency_code : ""}` : isEqual(element, 'destinataire') ? item[element].length > 13 ? cutString(item[element], 13) : item[element] : isEqual(element, 'date_creation') ? @@ -1584,7 +1589,7 @@ class WalletDetail extends Component { { isEqual(element, 'montant') ? - ` ${item[element].length > 8 ? cutString(thousands(item[element], ' '), 6) : thousands(item[element], ' ')} ${this.state.wallet.currency_code}` + ` ${item[element].length > 8 ? cutString(thousands(item[element], ' '), 6) : thousands(item[element], ' ')} ${this.state.wallet !== undefined ? this.state.wallet.currency_code : ""}` : isEqual(element, 'destinataire') ? item[element].length > 13 ? cutString(item[element], 13) : item[element] : isEqual(element, 'date') ? @@ -1599,7 +1604,7 @@ class WalletDetail extends Component { { isEqual(element, 'montant') ? - ` ${item[element].length > 8 ? cutString(thousands(item[element], ' '), 6) : thousands(item[element], ' ')} ${this.state.wallet.currency_code}` + ` ${item[element].length > 8 ? cutString(thousands(item[element], ' '), 6) : thousands(item[element], ' ')} ${this.state.wallet !== undefined ? this.state.wallet.currency_code : ""}` : isEqual(element, 'destinataire') ? item[element].length > 13 ? cutString(item[element], 13) : item[element] : isEqual(element, 'date') ? diff --git a/webservice/agent/NanoCreditAgentApi.js b/webservice/agent/NanoCreditAgentApi.js index 29484c90..6c739080 100644 --- a/webservice/agent/NanoCreditAgentApi.js +++ b/webservice/agent/NanoCreditAgentApi.js @@ -1,80 +1,89 @@ -import { cautionCreditDemandtUrl, getNanoCreditDemandUrl } from "../IlinkConstants"; +import {cautionCreditDemandtUrl, getNanoCreditDemandUrl} from "../IlinkConstants"; import axios from "axios"; import I18n from 'react-native-i18n'; -import { store } from "../../redux/store"; -import { fetchCautionCreditDemandAgentPending, fetchCautionCreditDemandAgentSuccess, fetchCautionCreditDemandAgentError, fetchCautionCreditDemandAgentReset, fetchGetNanoCreditDemandDetailPending, fetchGetNanoCreditDemandDetailSuccess, fetchGetNanoCreditDemandDetailReset } from "../../redux/actions/NanoCreditAction"; +import {store} from "../../redux/store"; +import { + fetchCautionCreditDemandAgentError, + fetchCautionCreditDemandAgentPending, + fetchCautionCreditDemandAgentReset, + fetchCautionCreditDemandAgentSuccess, + fetchGetNanoCreditDemandDetailError, + fetchGetNanoCreditDemandDetailPending, + fetchGetNanoCreditDemandDetailReset, + fetchGetNanoCreditDemandDetailSuccess +} from "../../redux/actions/NanoCreditAction"; export const cautionCreditDemandAgentAction = (data) => { - const auth = store.getState().authKeyReducer; - const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : ''; + const auth = store.getState().authKeyReducer; + const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : ''; - return dispatch => { - dispatch(fetchCautionCreditDemandAgentPending()); + return dispatch => { + dispatch(fetchCautionCreditDemandAgentPending()); - axios({ - url: cautionCreditDemandtUrl, - method: 'POST', - data, - headers: { - 'Authorization': authKey, - 'X-Localization': I18n.currentLocale() - }, - }) - .then(response => { - console.log(response); - dispatch(fetchCautionCreditDemandAgentSuccess(response)); - }) - .catch(error => { - if (error.response) - dispatch(fetchCautionCreditDemandAgentError(error.response)); - else if (error.request) - dispatch(fetchCautionCreditDemandAgentError(error.request)) - else - dispatch(fetchCautionCreditDemandAgentError(error.message)) - }); - } + axios({ + url: cautionCreditDemandtUrl, + method: 'POST', + data, + headers: { + 'Authorization': authKey, + 'X-Localization': I18n.currentLocale() + }, + }) + .then(response => { + console.log(response); + dispatch(fetchCautionCreditDemandAgentSuccess(response)); + }) + .catch(error => { + if (error.response) + dispatch(fetchCautionCreditDemandAgentError(error.response)); + else if (error.request) + dispatch(fetchCautionCreditDemandAgentError(error.request)) + else + dispatch(fetchCautionCreditDemandAgentError(error.message)) + }); + } } export const cautionCreditDemandAgentReset = () => { - return dispatch => { - dispatch(fetchCautionCreditDemandAgentReset()); - } + return dispatch => { + dispatch(fetchCautionCreditDemandAgentReset()); + } } export const getNanoCreditDemandDetailAction = (idDemand) => { - const auth = store.getState().authKeyReducer; - const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : ''; + const auth = store.getState().authKeyReducer; + const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : ''; - return dispatch => { - dispatch(fetchGetNanoCreditDemandDetailPending()); + return dispatch => { + dispatch(fetchGetNanoCreditDemandDetailPending()); - axios({ - url: `${getNanoCreditDemandUrl}/${idDemand}`, - method: 'GET', - headers: { - 'Authorization': authKey, - 'X-Localization': I18n.currentLocale() - }, - }) - .then(response => { - console.log(response); - dispatch(fetchGetNanoCreditDemandDetailSuccess(response)); - }) - .catch(error => { - if (error.response) - dispatch(fetchGetNanoCreditDemandDetailError(error.response)); - else if (error.request) - dispatch(fetchGetNanoCreditDemandDetailError(error.request)) - else - dispatch(fetchGetNanoCreditDemandDetailError(error.message)) - }); - } + axios({ + url: `${getNanoCreditDemandUrl}/${idDemand}`, + method: 'GET', + headers: { + 'Authorization': authKey, + 'X-Localization': I18n.currentLocale() + }, + }) + .then(response => { + console.log(response); + dispatch(fetchGetNanoCreditDemandDetailSuccess(response)); + }) + .catch(error => { + if (error.response) + dispatch(fetchGetNanoCreditDemandDetailError(error.response)); + else if (error.request) + dispatch(fetchGetNanoCreditDemandDetailError(error.request)); + else + dispatch(fetchGetNanoCreditDemandDetailError(error.message)); + }); + } } export const getNanoCreditDemandDetailReset = () => { - return dispatch => { - dispatch(fetchGetNanoCreditDemandDetailReset()); - } + return dispatch => { + dispatch(fetchGetNanoCreditDemandDetailReset()); + } } \ No newline at end of file