react-native-timacare 3.3.29 → 3.3.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=CCCDCameraScreen;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeVisionCamera=require("react-native-vision-camera");var _icons=require("../../assets/icons");var _MText=require("../../components/MText");var _native=require("@react-navigation/native");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _CommonStyles=require("../CommonStyles");var _reactNativePermissions=require("react-native-permissions");var _jsxFileName="/Users/tima/Tima/react-native-timacare/src/screens/camera/CCCDCameraScreen.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function CCCDCameraScreen(props){var _props$route2,_props$route2$params;var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var navigation=(0,_native.useNavigation)();var isFocused=(0,_native.useIsFocused)();var myCamera=(0,_react.useRef)(null);var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),passPermission=_useState2[0],setPassPermission=_useState2[1];var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2.default)(_useState3,2),shouldRenderCamera=_useState4[0],setShouldRenderCamera=_useState4[1];var device=(0,_reactNativeVisionCamera.useCameraDevice)('back');var format=(0,_reactNativeVisionCamera.useCameraFormat)(device,[{photoResolution:{width:1280,height:720}}]);var takePicture=function _callee(){var _props$route,_props$route$params,data,_t;return _regenerator.default.async(function(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(myCamera.current==null)){_context.next=1;break;}return _context.abrupt("return");case 1:_context.prev=1;_context.next=2;return _regenerator.default.awrap(myCamera.current.takePhoto({qualityPrioritization:'quality'}));case 2:data=_context.sent;navigation.goBack();if((_props$route=props.route)!=null&&(_props$route$params=_props$route.params)!=null&&_props$route$params.callback){props.route.params.callback('file://'+data.path);}_context.next=4;break;case 3:_context.prev=3;_t=_context["catch"](1);console.error(_t);case 4:case"end":return _context.stop();}},null,null,[[1,3]],Promise);};var _requestPermissions=function requestPermissions(){(0,_reactNativePermissions.request)(_reactNative.Platform.OS==='ios'?_reactNativePermissions.PERMISSIONS.IOS.CAMERA:_reactNativePermissions.PERMISSIONS.ANDROID.CAMERA).then(function(result){switch(result){case _reactNativePermissions.RESULTS.UNAVAILABLE:console.log('This feature is not available (on this device / in this context)');_reactNative.Alert.alert('Thông báo','Máy ảnh trên thiết bị không tương thích.\nVui lòng kiểm tra lại thiết bị!',[{text:'Đồng ý'}]);break;case _reactNativePermissions.RESULTS.DENIED:console.log('The permission has not been requested / is denied but requestable');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.LIMITED:console.log('The permission is limited: some actions are possible');_reactNative.Alert.alert('Thông báo','Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.GRANTED:console.log('The permission is granted');setPassPermission(true);break;case _reactNativePermissions.RESULTS.BLOCKED:console.log('The permission is denied and not requestable anymore');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{(0,_reactNativePermissions.openSettings)();}}}]);break;}});};(0,_react.useEffect)(function(){_requestPermissions();},[]);(0,_react.useEffect)(function(){var timeout;if(isFocused){timeout=setTimeout(function(){setShouldRenderCamera(true);},500);}else{setShouldRenderCamera(false);}return function(){return clearTimeout(timeout);};},[isFocused]);if(!passPermission&&!shouldRenderCamera){return _react.default.createElement(_reactNative.View,{style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:160,columnNumber:7}},_react.default.createElement(_reactNative.ActivityIndicator,{size:"large",color:"#0000ff",__self:this,__source:{fileName:_jsxFileName,lineNumber:161,columnNumber:9}}));}return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'black'},pointerEvents:'box-none',__self:this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.fill,_CommonStyles.commonStyles.justifyCenter,{position:'absolute',width:_reactNative.Dimensions.get('window').width,height:_reactNative.Dimensions.get('window').height}],__self:this,__source:{fileName:_jsxFileName,lineNumber:171,columnNumber:7}},device?_react.default.createElement(_reactNativeVisionCamera.Camera,{ref:myCamera,style:{width:_reactNative.Dimensions.get('window').width,height:260,overflow:'hidden'},device:device,isActive:true,photo:true,format:format,__self:this,__source:{fileName:_jsxFileName,lineNumber:184,columnNumber:11}}):_react.default.createElement(_reactNative.ActivityIndicator,{__self:this,__source:{fileName:_jsxFileName,lineNumber:197,columnNumber:11}})),_react.default.createElement(_reactNative.View,{style:[$back,{top:insets.top+16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:201,columnNumber:7}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){navigation.goBack();},style:{position:'absolute',left:0,width:48,height:48,zIndex:1000,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:202,columnNumber:9}},_react.default.createElement(_icons.IconBackWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:215,columnNumber:11}})),_react.default.createElement(_MText.MText,{style:{textAlign:'center',zIndex:10,color:'#FFFFFF',fontSize:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:217,columnNumber:9}},props!=null&&(_props$route2=props.route)!=null&&(_props$route2$params=_props$route2.params)!=null&&_props$route2$params.front?'Chụp CMND/ CCCD mặt trước':'Chụp CMND/ CCCD mặt sau')),_react.default.createElement(_reactNative.View,{style:{position:'absolute',bottom:24+insets.bottom,alignSelf:'center',flexDirection:'column',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:230,columnNumber:7}},_react.default.createElement(_MText.MText,{style:{color:'#fff',marginBottom:16,textAlign:'center',paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:239,columnNumber:9}},"Vui l\xF2ng \u0111\u1EB7t gi\u1EA5y t\u1EDD n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:takePicture,__self:this,__source:{fileName:_jsxFileName,lineNumber:250,columnNumber:9}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:251,columnNumber:11}}))));}var overlayColor='rgba(22, 22, 22, 0.7)';var $back={position:'absolute',left:0,right:0};var $overlay=(0,_extends2.default)({},_reactNative.StyleSheet.absoluteFillObject,{justifyContent:'center',alignItems:'center'});var $container={flex:1,backgroundColor:'#000'};var $row={flexDirection:'row',alignItems:'center'};var $darkOverlayTop={width:'100%',backgroundColor:overlayColor};var $darkOverlayBottom={width:'100%',backgroundColor:overlayColor};var $darkOverlaySide={backgroundColor:overlayColor};var $frameBorder={};
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=CCCDCameraScreen;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeVisionCamera=require("react-native-vision-camera");var _icons=require("../../assets/icons");var _MText=require("../../components/MText");var _native=require("@react-navigation/native");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _CommonStyles=require("../CommonStyles");var _reactNativePermissions=require("react-native-permissions");var _jsxFileName="/Users/tima/Tima/react-native-timacare/src/screens/camera/CCCDCameraScreen.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function CCCDCameraScreen(props){var _props$route2,_props$route2$params;var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var navigation=(0,_native.useNavigation)();var isFocused=(0,_native.useIsFocused)();var myCamera=(0,_react.useRef)(null);var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),passPermission=_useState2[0],setPassPermission=_useState2[1];var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2.default)(_useState3,2),shouldRenderCamera=_useState4[0],setShouldRenderCamera=_useState4[1];var device=(0,_reactNativeVisionCamera.useCameraDevice)('back');var format=(0,_reactNativeVisionCamera.useCameraFormat)(device,[{photoResolution:{width:1280,height:720}}]);var takePicture=function _callee(){var _props$route,_props$route$params,data,_t;return _regenerator.default.async(function(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(myCamera.current==null)){_context.next=1;break;}return _context.abrupt("return");case 1:_context.prev=1;_context.next=2;return _regenerator.default.awrap(myCamera.current.takePhoto({qualityPrioritization:'quality'}));case 2:data=_context.sent;navigation.goBack();if((_props$route=props.route)!=null&&(_props$route$params=_props$route.params)!=null&&_props$route$params.callback){props.route.params.callback('file://'+data.path);}_context.next=4;break;case 3:_context.prev=3;_t=_context["catch"](1);console.error(_t);case 4:case"end":return _context.stop();}},null,null,[[1,3]],Promise);};var _requestPermissions=function requestPermissions(){(0,_reactNativePermissions.request)(_reactNative.Platform.OS==='ios'?_reactNativePermissions.PERMISSIONS.IOS.CAMERA:_reactNativePermissions.PERMISSIONS.ANDROID.CAMERA).then(function(result){switch(result){case _reactNativePermissions.RESULTS.UNAVAILABLE:console.log('This feature is not available (on this device / in this context)');_reactNative.Alert.alert('Thông báo','Máy ảnh trên thiết bị không tương thích.\nVui lòng kiểm tra lại thiết bị!',[{text:'Đồng ý'}]);break;case _reactNativePermissions.RESULTS.DENIED:console.log('The permission has not been requested / is denied but requestable');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.LIMITED:console.log('The permission is limited: some actions are possible');_reactNative.Alert.alert('Thông báo','Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.GRANTED:console.log('The permission is granted');setPassPermission(true);break;case _reactNativePermissions.RESULTS.BLOCKED:console.log('The permission is denied and not requestable anymore');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{(0,_reactNativePermissions.openSettings)();}}}]);break;}});};(0,_react.useEffect)(function(){_requestPermissions();},[]);(0,_react.useEffect)(function(){var timeout;if(isFocused){timeout=setTimeout(function(){setShouldRenderCamera(true);},500);}else{setShouldRenderCamera(false);}return function(){return clearTimeout(timeout);};},[isFocused]);if(!passPermission&&!shouldRenderCamera){return _react.default.createElement(_reactNative.View,{style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:160,columnNumber:7}},_react.default.createElement(_reactNative.ActivityIndicator,{size:"large",color:"#0000ff",__self:this,__source:{fileName:_jsxFileName,lineNumber:161,columnNumber:9}}));}return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'black'},pointerEvents:'box-none',__self:this,__source:{fileName:_jsxFileName,lineNumber:167,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.fill,_CommonStyles.commonStyles.justifyCenter,{position:'absolute',width:_reactNative.Dimensions.get('window').width,height:_reactNative.Dimensions.get('window').height}],__self:this,__source:{fileName:_jsxFileName,lineNumber:171,columnNumber:7}},device?_react.default.createElement(_reactNative.View,{style:$cameraFrame,__self:this,__source:{fileName:_jsxFileName,lineNumber:184,columnNumber:11}},_react.default.createElement(_reactNativeVisionCamera.Camera,{ref:myCamera,style:_reactNative.StyleSheet.absoluteFill,device:device,isActive:true,photo:true,format:format,__self:this,__source:{fileName:_jsxFileName,lineNumber:185,columnNumber:13}})):_react.default.createElement(_reactNative.ActivityIndicator,{__self:this,__source:{fileName:_jsxFileName,lineNumber:195,columnNumber:11}})),_react.default.createElement(_reactNative.View,{style:[$back,{top:insets.top+16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:199,columnNumber:7}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){navigation.goBack();},style:{position:'absolute',left:0,width:48,height:48,zIndex:1000,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:200,columnNumber:9}},_react.default.createElement(_icons.IconBackWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:213,columnNumber:11}})),_react.default.createElement(_MText.MText,{style:{textAlign:'center',zIndex:10,color:'#FFFFFF',fontSize:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:215,columnNumber:9}},props!=null&&(_props$route2=props.route)!=null&&(_props$route2$params=_props$route2.params)!=null&&_props$route2$params.front?'Chụp CMND/ CCCD mặt trước':'Chụp CMND/ CCCD mặt sau')),_react.default.createElement(_reactNative.View,{style:{position:'absolute',bottom:insets.bottom,alignSelf:'center',flexDirection:'column',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:228,columnNumber:7}},_react.default.createElement(_MText.MText,{style:{color:'#fff',marginBottom:16,textAlign:'center',paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:237,columnNumber:9}},"Vui l\xF2ng \u0111\u1EB7t gi\u1EA5y t\u1EDD n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:takePicture,__self:this,__source:{fileName:_jsxFileName,lineNumber:248,columnNumber:9}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:249,columnNumber:11}}))));}var overlayColor='rgba(22, 22, 22, 0.7)';var $back={position:'absolute',left:0,right:0};var $cameraFrame={width:_reactNative.Dimensions.get('window').width,height:260,overflow:'hidden',backgroundColor:'black'};var $overlay=(0,_extends2.default)({},_reactNative.StyleSheet.absoluteFillObject,{justifyContent:'center',alignItems:'center'});var $container={flex:1,backgroundColor:'#000'};var $row={flexDirection:'row',alignItems:'center'};var $darkOverlayTop={width:'100%',backgroundColor:overlayColor};var $darkOverlayBottom={width:'100%',backgroundColor:overlayColor};var $darkOverlaySide={backgroundColor:overlayColor};var $frameBorder={};
2
2
  //# sourceMappingURL=CCCDCameraScreen.js.map
@@ -181,18 +181,16 @@ export default function CCCDCameraScreen(props) {
181
181
  ]}
182
182
  >
183
183
  {device ? (
184
- <VisionCamera
185
- ref={myCamera}
186
- style={{
187
- width: Dimensions.get('window').width,
188
- height: 260,
189
- overflow: 'hidden',
190
- }}
191
- device={device}
192
- isActive={true}
193
- photo={true}
194
- format={format}
195
- />
184
+ <View style={$cameraFrame}>
185
+ <VisionCamera
186
+ ref={myCamera}
187
+ style={StyleSheet.absoluteFill}
188
+ device={device}
189
+ isActive={true}
190
+ photo={true}
191
+ format={format}
192
+ />
193
+ </View>
196
194
  ) : (
197
195
  <ActivityIndicator />
198
196
  )}
@@ -230,7 +228,7 @@ export default function CCCDCameraScreen(props) {
230
228
  <View
231
229
  style={{
232
230
  position: 'absolute',
233
- bottom: 24 + insets.bottom,
231
+ bottom: insets.bottom,
234
232
  alignSelf: 'center',
235
233
  flexDirection: 'column',
236
234
  alignItems: 'center',
@@ -262,6 +260,13 @@ const $back: ViewStyle = {
262
260
  right: 0,
263
261
  };
264
262
 
263
+ const $cameraFrame: ViewStyle = {
264
+ width: Dimensions.get('window').width,
265
+ height: 260,
266
+ overflow: 'hidden',
267
+ backgroundColor: 'black',
268
+ };
269
+
265
270
  const $overlay: ViewStyle = {
266
271
  ...StyleSheet.absoluteFillObject,
267
272
  justifyContent: 'center',
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeVisionCamera","_icons","_MText","_native","_reactNativeSafeAreaContext","_CommonStyles","_reactNativePermissions","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CCCDCameraScreen","props","_props$route2","_props$route2$params","insets","useSafeAreaInsets","navigation","useNavigation","isFocused","useIsFocused","myCamera","useRef","_useState","useState","_useState2","_slicedToArray2","passPermission","setPassPermission","_useState3","_useState4","shouldRenderCamera","setShouldRenderCamera","device","useCameraDevice","format","useCameraFormat","photoResolution","width","height","takePicture","_callee","_props$route","_props$route$params","data","_t","_regenerator","async","_context","prev","next","current","abrupt","awrap","takePhoto","qualityPrioritization","sent","goBack","route","params","callback","path","console","error","stop","Promise","requestPermissions","request","Platform","OS","PERMISSIONS","IOS","CAMERA","ANDROID","then","result","RESULTS","UNAVAILABLE","log","Alert","alert","text","DENIED","onPress","openSettings","LIMITED","GRANTED","BLOCKED","useEffect","timeout","setTimeout","clearTimeout","createElement","View","style","commonStyles","fill","__self","__source","fileName","lineNumber","columnNumber","ActivityIndicator","size","color","flex","backgroundColor","pointerEvents","alignCenter","justifyCenter","position","Dimensions","Camera","ref","overflow","isActive","photo","$back","top","TouchableOpacity","left","zIndex","alignItems","IconBackWhite","MText","textAlign","fontSize","front","bottom","alignSelf","flexDirection","marginBottom","paddingHorizontal","TakePhotoSvg","overlayColor","right","$overlay","_extends2","StyleSheet","absoluteFillObject","justifyContent","$container","$row","$darkOverlayTop","$darkOverlayBottom","$darkOverlaySide","$frameBorder"],"sourceRoot":"../../../../src","sources":["screens/camera/CCCDCameraScreen.tsx"],"mappings":"waACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,wBAAA,CAAAF,OAAA,+BAKA,IAAAG,MAAA,CAAAH,O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AK,CACpBR,UAAU,CAAE,QACd,CAAC,CAED,GAAM,CAAAqB,eAA0B,CAAG,CACjCzG,KAAK,CAAE,MAAM,CACboE,eAAe,CAAE4B,YACnB,CAAC,CAED,GAAM,CAAAU,kBAA6B,CAAG,CACpC1G,KAAK,CAAE,MAAM,CACboE,eAAe,CAAE4B,YACnB,CAAC,CACD,GAAM,CAAAW,gBAA2B,CAAG,CAClCvC,eAAe,CAAE4B,YACnB,CAAC,CACD,GAAM,CAAAY,YAAuB,CAAG,CAGhC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeVisionCamera","_icons","_MText","_native","_reactNativeSafeAreaContext","_CommonStyles","_reactNativePermissions","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CCCDCameraScreen","props","_props$route2","_props$route2$params","insets","useSafeAreaInsets","navigation","useNavigation","isFocused","useIsFocused","myCamera","useRef","_useState","useState","_useState2","_slicedToArray2","passPermission","setPassPermission","_useState3","_useState4","shouldRenderCamera","setShouldRenderCamera","device","useCameraDevice","format","useCameraFormat","photoResolution","width","height","takePicture","_callee","_props$route","_props$route$params","data","_t","_regenerator","async","_context","prev","next","current","abrupt","awrap","takePhoto","qualityPrioritization","sent","goBack","route","params","callback","path","console","error","stop","Promise","requestPermissions","request","Platform","OS","PERMISSIONS","IOS","CAMERA","ANDROID","then","result","RESULTS","UNAVAILABLE","log","Alert","alert","text","DENIED","onPress","openSettings","LIMITED","GRANTED","BLOCKED","useEffect","timeout","setTimeout","clearTimeout","createElement","View","style","commonStyles","fill","__self","__source","fileName","lineNumber","columnNumber","ActivityIndicator","size","color","flex","backgroundColor","pointerEvents","alignCenter","justifyCenter","position","Dimensions","$cameraFrame","Camera","ref","StyleSheet","absoluteFill","isActive","photo","$back","top","TouchableOpacity","left","zIndex","alignItems","IconBackWhite","MText","textAlign","fontSize","front","bottom","alignSelf","flexDirection","marginBottom","paddingHorizontal","TakePhotoSvg","overlayColor","right","overflow","$overlay","_extends2","absoluteFillObject","justifyContent","$container","$row","$darkOverlayTop","$darkOverlayBottom","$darkOverlaySide","$frameBorder"],"sourceRoot":"../../../../src","sources":["screens/camera/CCCDCameraScreen.tsx"],"mappings":"waACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,wBAAA,CAAAF,OAAA,+BAKA,IAAAG,MAAA,CAAAH,OAAA,uBACA,IAAAI,MAAA,CAAAJ,OAAA,2BACA,IAAAK,OAAA,CAAAL,OAAA,6BACA,IAAAM,2BAAA,CAAAN,OAAA,mCACA,IAAAO,aAAA,CAAAP,OAAA,oBACA,IAAAQ,uBAAA,CAAAR,OAAA,6BAKkC,IAAAS,YAAA,2FAAAV,wBAAAW,CAAA,CAAAC,CAAA,wBAAAC,OAAA,KAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAb,uBAAA,UAAAA,wBAAAW,CAAA,CAAAC,CAAA,MAAAA,CAAA,EAAAD,CAAA,EAAAA,CAAA,CAAAK,UAAA,QAAAL,CAAA,KAAAM,CAAA,CAAAC,CAAA,CAAAC,CAAA,EAAAC,SAAA,MAAAC,OAAA,CAAAV,CAAA,YAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAQ,CAAA,IAAAF,CAAA,CAAAL,CAAA,CAAAG,CAAA,CAAAD,CAAA,KAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,SAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,CAAAM,CAAA,EAAAO,GAAA,CAAAb,CAAA,CAAAQ,CAAA,WAAAM,GAAA,IAAAd,CAAA,aAAAc,GAAA,KAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,CAAAc,GAAA,KAAAP,CAAA,EAAAD,CAAA,CAAAW,MAAA,CAAAC,cAAA,GAAAD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,CAC5C,GAAM,CAAAjB,KAAgB,CAAG,CACvBT,QAAQ,CAAE,UAAU,CACpBY,IAAI,CAAE,CAAC,CACPe,KAAK,CAAE,CACT,CAAC,CAED,GAAM,CAAAzB,YAAuB,CAAG,CAC9B1E,KAAK,CAAEyE,uBAAU,CAAC5G,GAAG,CAAC,QAAQ,CAAC,CAACmC,KAAK,CACrCC,MAAM,CAAE,GAAG,CACXmG,QAAQ,CAAE,QAAQ,CAClBhC,eAAe,CAAE,OACnB,CAAC,CAED,GAAM,CAAAiC,QAAmB,IAAAC,SAAA,CAAA3I,OAAA,KACpBkH,uBAAU,CAAC0B,kBAAkB,EAChCC,cAAc,CAAE,QAAQ,CACxBlB,UAAU,CAAE,QAAQ,EACrB,CAED,GAAM,CAAAmB,UAAqB,CAAG,CAC5BtC,IAAI,CAAE,CAAC,CACPC,eAAe,CAAE,MACnB,CAAC,CAED,GAAM,CAAAsC,IAAe,CAAG,CACtBZ,aAAa,CAAE,KAAK,CACpBR,UAAU,CAAE,QACd,CAAC,CAED,GAAM,CAAAqB,eAA0B,CAAG,CACjC3G,KAAK,CAAE,MAAM,CACboE,eAAe,CAAE8B,YACnB,CAAC,CAED,GAAM,CAAAU,kBAA6B,CAAG,CACpC5G,KAAK,CAAE,MAAM,CACboE,eAAe,CAAE8B,YACnB,CAAC,CACD,GAAM,CAAAW,gBAA2B,CAAG,CAClCzC,eAAe,CAAE8B,YACnB,CAAC,CACD,GAAM,CAAAY,YAAuB,CAAG,CAGhC,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.OCR=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _mobxReactLite=require("mobx-react-lite");var _reactNative=require("react-native");var _MText=require("../../components/MText");var _storage=require("../../utils/storage");var _reactNativePermissions=require("react-native-permissions");var _reactNativeVisionCamera=require("react-native-vision-camera");var _reactNativeModal=_interopRequireDefault(require("react-native-modal"));var _reactNativeLinearGradient=_interopRequireDefault(require("react-native-linear-gradient"));var _icons=require("../../assets/icons");var _MButton=_interopRequireDefault(require("../../components/MButton"));var _CommonStyles=require("../CommonStyles");var _native=require("@react-navigation/native");var _textRecognition=_interopRequireDefault(require("@react-native-ml-kit/text-recognition"));var _navigation=require("../../navigation");var _api=require("../../services/api");var _Loading=_interopRequireDefault(require("../../components/Loading"));var _svgs=require("../../assets/svgs");var _reactNativeImageCropPicker=_interopRequireDefault(require("react-native-image-crop-picker"));var _reactNativeImagePicker=require("react-native-image-picker");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _jsxFileName="/Users/tima/Tima/react-native-timacare/src/screens/toan-trinh-so/OCR.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t3 in e)"default"!==_t3&&{}.hasOwnProperty.call(e,_t3)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t3))&&(i.get||i.set)?o(f,_t3,i):f[_t3]=e[_t3]);return f;})(e,t);}var NFCReader=_reactNative.NativeModules.NFCReader;var OCR=exports.OCR=(0,_mobxReactLite.observer)(function OCR(props){var _props$route22,_props$route22$params;var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var isFocused=(0,_native.useIsFocused)();var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isLoading=_useState2[0],setIsLoading=_useState2[1];var navigation=(0,_native.useNavigation)();var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2.default)(_useState3,2),showModal=_useState4[0],setShowModal=_useState4[1];var _useState5=(0,_react.useState)('passport'),_useState6=(0,_slicedToArray2.default)(_useState5,2),type=_useState6[0],setType=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),taking=_useState8[0],setTaking=_useState8[1];var _useState9=(0,_react.useState)(false),_useState0=(0,_slicedToArray2.default)(_useState9,2),passPermission=_useState0[0],setPassPermission=_useState0[1];var _useState1=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState1,2),shouldRenderCamera=_useState10[0],setShouldRenderCamera=_useState10[1];var myCamera=(0,_react.useRef)(null);var device=(0,_reactNativeVisionCamera.useCameraDevice)('back');var format=(0,_reactNativeVisionCamera.useCameraFormat)(device,[{photoResolution:{width:1280,height:720}}]);var _requestPermissions=function requestPermissions(){(0,_reactNativePermissions.request)(_reactNative.Platform.OS==='ios'?_reactNativePermissions.PERMISSIONS.IOS.CAMERA:_reactNativePermissions.PERMISSIONS.ANDROID.CAMERA).then(function(result){switch(result){case _reactNativePermissions.RESULTS.UNAVAILABLE:console.log('This feature is not available (on this device / in this context)');_reactNative.Alert.alert('Thông báo','Máy ảnh trên thiết bị không tương thích.\nVui lòng kiểm tra lại thiết bị!',[{text:'Đồng ý'}]);break;case _reactNativePermissions.RESULTS.DENIED:console.log('The permission has not been requested / is denied but requestable');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.LIMITED:console.log('The permission is limited: some actions are possible');_reactNative.Alert.alert('Thông báo','Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.GRANTED:console.log('The permission is granted');setPassPermission(true);break;case _reactNativePermissions.RESULTS.BLOCKED:console.log('The permission is denied and not requestable anymore');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{(0,_reactNativePermissions.openSettings)();}}}]);break;}});};(0,_react.useEffect)(function(){var timeout;if(isFocused){timeout=setTimeout(function(){setShouldRenderCamera(true);},500);}else{setShouldRenderCamera(false);}return function(){return clearTimeout(timeout);};},[isFocused]);var loadIntro=function _callee(){var intro;return _regenerator.default.async(function(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=1;return _regenerator.default.awrap((0,_storage.load)(_storage.OCR_V1));case 1:intro=_context.sent;if(!intro){setShowModal(true);}case 2:case"end":return _context.stop();}},null,null,null,Promise);};(0,_react.useEffect)(function(){_requestPermissions();loadIntro();},[]);var saveDataNfc=function _callee2(body){var _props$route,_props$route$params,_props$route$params$l,response,_response$data,_response$data$meta,_response$data2,_response$data2$meta,_t;return _regenerator.default.async(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=1;return _regenerator.default.awrap(_api.Api.getInstance().saveNfcInfo((0,_extends2.default)({},body,{loanBriefId:props==null?void 0:(_props$route=props.route)==null?void 0:(_props$route$params=_props$route.params)==null?void 0:(_props$route$params$l=_props$route$params.loan)==null?void 0:_props$route$params$l.id})));case 1:response=_context2.sent;if(response.kind==='ok'){if(((_response$data=response.data)==null?void 0:(_response$data$meta=_response$data.meta)==null?void 0:_response$data$meta.errorCode)===200){setTimeout(function(){var _props$route2,_props$route2$params;navigation.push(_navigation.ScreenNames.TTSSelfie,{loan:props==null?void 0:(_props$route2=props.route)==null?void 0:(_props$route2$params=_props$route2.params)==null?void 0:_props$route2$params.loan});},500);}else{_reactNative.Alert.alert('Thông báo',response==null?void 0:(_response$data2=response.data)==null?void 0:(_response$data2$meta=_response$data2.meta)==null?void 0:_response$data2$meta.errorMessage);}}else{_reactNative.Alert.alert('Thông báo','Có lỗi xảy ra. Vui lòng thử lại sau');}_context2.next=3;break;case 2:_context2.prev=2;_t=_context2["catch"](0);console.log(_t);case 3:case"end":return _context2.stop();}},null,null,[[0,2]],Promise);};var convertToDate=function convertToDate(input,end){var yearPrefix=input.substring(0,2);var year=end?'20'+yearPrefix:parseInt(yearPrefix)>20?'19'+yearPrefix:'20'+yearPrefix;var month=input.substring(2,4);var day=input.substring(4,6);return year+'-'+month+'-'+day;};var extractMRZInfo=function extractMRZInfo(text){var documentNumber='';var birthDate='';var expirationDate='';var regex1=/VNM(\d{9})/;var match1=text.match(regex1);if(match1){documentNumber=match1[1];}console.log('documentNumber',documentNumber);var regex=/(\d{6}).[MF](\d{6})/;var match=text.replace(/ /g,'').match(regex);if(match){console.log({documentNumber:documentNumber,birthDate:match[1],expirationDate:match[2]});birthDate=match[1],expirationDate=match[2];}else{return null;}if(documentNumber&&birthDate&&expirationDate){try{NFCReader.readNFCCard(documentNumber,convertToDate(birthDate,false),convertToDate(expirationDate,true),function(error,response){try{var convertData=JSON.parse(response);saveDataNfc(convertData);}catch(e){console.log(e);}});}catch(e){console.log(e);}}};var handleTextRecognition=function _callee3(imagePath){var result,_t2;return _regenerator.default.async(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=1;return _regenerator.default.awrap(_textRecognition.default.recognize(imagePath));case 1:result=_context3.sent;extractMRZInfo(result.text);_context3.next=3;break;case 2:_context3.prev=2;_t2=_context3["catch"](0);console.log(_t2);case 3:case"end":return _context3.stop();}},null,null,[[0,2]],Promise);};var scanNfc=function _callee4(){var data;return _regenerator.default.async(function(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!myCamera.current){_context4.next=2;break;}_context4.next=1;return _regenerator.default.awrap(myCamera.current.takePhoto({qualityPrioritization:'speed'}));case 1:data=_context4.sent;_context4.next=2;return _regenerator.default.awrap(handleTextRecognition('file://'+data.path));case 2:case"end":return _context4.stop();}},null,null,null,Promise);};var takePhoto=function _callee5(){var _props$route3,_props$route3$params,_props$route4,_props$route4$params,_props$route6,_props$route6$params,_props$route7,_props$route7$params;var data,uri,_props$route5,_props$route5$params,_props$route8,_props$route8$params,_props$route9,_props$route9$params;return _regenerator.default.async(function(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!(myCamera.current==null||taking)){_context5.next=1;break;}return _context5.abrupt("return");case 1:setTaking(true);_context5.next=2;return _regenerator.default.awrap(myCamera.current.takePhoto({qualityPrioritization:'quality'}));case 2:data=_context5.sent;uri='file://'+data.path;setTaking(false);if(props!=null&&(_props$route3=props.route)!=null&&(_props$route3$params=_props$route3.params)!=null&&_props$route3$params.front&&!((_props$route4=props.route)!=null&&(_props$route4$params=_props$route4.params)!=null&&_props$route4$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDFront,{uri:uri,loan:props==null?void 0:(_props$route5=props.route)==null?void 0:(_props$route5$params=_props$route5.params)==null?void 0:_props$route5$params.loan});}else if(!(props!=null&&(_props$route6=props.route)!=null&&(_props$route6$params=_props$route6.params)!=null&&_props$route6$params.front)&&!((_props$route7=props.route)!=null&&(_props$route7$params=_props$route7.params)!=null&&_props$route7$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDBack,{uri:uri,loan:props==null?void 0:(_props$route8=props.route)==null?void 0:(_props$route8$params=_props$route8.params)==null?void 0:_props$route8$params.loan});}else{navigation.goBack();(_props$route9=props.route)==null?void 0:(_props$route9$params=_props$route9.params)==null?void 0:_props$route9$params.callback(uri);}case 3:case"end":return _context5.stop();}},null,null,null,Promise);};var pickImageFromGallery=function _callee6(){var result,_props$route0,_props$route0$params,_props$route1,_props$route1$params,_props$route11,_props$route11$params,_props$route12,_props$route12$params,_result$assets$,_props$route10,_props$route10$params,_result$assets$2,_props$route13,_props$route13$params,_props$route14,_props$route14$params,_result$assets$3;return _regenerator.default.async(function(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!(_reactNative.Platform.OS==='android')){_context6.next=2;break;}_context6.next=1;return _regenerator.default.awrap((0,_reactNativeImagePicker.launchImageLibrary)({mediaType:'photo'}));case 1:result=_context6.sent;if(result.assets){if(props!=null&&(_props$route0=props.route)!=null&&(_props$route0$params=_props$route0.params)!=null&&_props$route0$params.front&&!((_props$route1=props.route)!=null&&(_props$route1$params=_props$route1.params)!=null&&_props$route1$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDFront,{uri:(_result$assets$=result.assets[0])==null?void 0:_result$assets$.uri,loan:props==null?void 0:(_props$route10=props.route)==null?void 0:(_props$route10$params=_props$route10.params)==null?void 0:_props$route10$params.loan});}else if(!(props!=null&&(_props$route11=props.route)!=null&&(_props$route11$params=_props$route11.params)!=null&&_props$route11$params.front)&&!((_props$route12=props.route)!=null&&(_props$route12$params=_props$route12.params)!=null&&_props$route12$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDBack,{uri:(_result$assets$2=result.assets[0])==null?void 0:_result$assets$2.uri,loan:props==null?void 0:(_props$route13=props.route)==null?void 0:(_props$route13$params=_props$route13.params)==null?void 0:_props$route13$params.loan});}else{navigation.goBack();(_props$route14=props.route)==null?void 0:(_props$route14$params=_props$route14.params)==null?void 0:_props$route14$params.callback((_result$assets$3=result.assets[0])==null?void 0:_result$assets$3.uri);}}_context6.next=3;break;case 2:_reactNativeImageCropPicker.default.openPicker({}).then(function(image){var _props$route15,_props$route15$params,_props$route16,_props$route16$params,_props$route18,_props$route18$params,_props$route19,_props$route19$params;if(props!=null&&(_props$route15=props.route)!=null&&(_props$route15$params=_props$route15.params)!=null&&_props$route15$params.front&&!((_props$route16=props.route)!=null&&(_props$route16$params=_props$route16.params)!=null&&_props$route16$params.callback)){var _props$route17,_props$route17$params;navigation.push(_navigation.ScreenNames.TTSNationalIDFront,{uri:_reactNative.Platform.OS==='android'?image==null?void 0:image.path:'file://'+(image==null?void 0:image.path),loan:props==null?void 0:(_props$route17=props.route)==null?void 0:(_props$route17$params=_props$route17.params)==null?void 0:_props$route17$params.loan});}else if(!(props!=null&&(_props$route18=props.route)!=null&&(_props$route18$params=_props$route18.params)!=null&&_props$route18$params.front)&&!((_props$route19=props.route)!=null&&(_props$route19$params=_props$route19.params)!=null&&_props$route19$params.callback)){var _props$route20,_props$route20$params;navigation.push(_navigation.ScreenNames.TTSNationalIDBack,{uri:_reactNative.Platform.OS==='android'?image==null?void 0:image.path:'file://'+(image==null?void 0:image.path),loan:props==null?void 0:(_props$route20=props.route)==null?void 0:(_props$route20$params=_props$route20.params)==null?void 0:_props$route20$params.loan});}else{var _props$route21,_props$route21$params;navigation.goBack();(_props$route21=props.route)==null?void 0:(_props$route21$params=_props$route21.params)==null?void 0:_props$route21$params.callback(_reactNative.Platform.OS==='android'?image==null?void 0:image.path:'file://'+(image==null?void 0:image.path));}});case 3:case"end":return _context6.stop();}},null,null,null,Promise);};return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'black'},pointerEvents:'box-none',__self:this,__source:{fileName:_jsxFileName,lineNumber:370,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:{alignItems:'center',position:'absolute',top:insets.top+16,left:0,right:0,zIndex:100},__self:this,__source:{fileName:_jsxFileName,lineNumber:374,columnNumber:7}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){navigation.navigate(_navigation.ScreenNames.Main);},style:{position:'absolute',left:10,top:4,width:24,height:24,alignItems:'center',justifyContent:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:384,columnNumber:9}},_react.default.createElement(_icons.IconBackWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:398,columnNumber:11}})),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',padding:2,borderRadius:4,alignItems:'center',backgroundColor:'transparent'},__self:this,__source:{fileName:_jsxFileName,lineNumber:400,columnNumber:9}}),_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:16,textAlign:'center',padding:16,marginTop:10},__self:this,__source:{fileName:_jsxFileName,lineNumber:485,columnNumber:9}},type==='passport'&&props!=null&&(_props$route22=props.route)!=null&&(_props$route22$params=_props$route22.params)!=null&&_props$route22$params.front?'Chụp CMND/ CCCD mặt trước':type==='passport'?'Chụp CMND/ CCCD mặt sau':'Dùng camera để quét chuỗi ký tự mặt sau thẻ CCCD gắn chíp ở phía dưới')),passPermission&&type==='passport'&&shouldRenderCamera?_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.fill,_CommonStyles.commonStyles.justifyCenter,{position:'absolute',width:_reactNative.Dimensions.get('window').width,height:_reactNative.Dimensions.get('window').height}],__self:this,__source:{fileName:_jsxFileName,lineNumber:503,columnNumber:9}},device?_react.default.createElement(_reactNativeVisionCamera.Camera,{ref:myCamera,style:{width:_reactNative.Dimensions.get('window').width,height:260,overflow:'hidden'},device:device,isActive:true,photo:true,format:format,__self:this,__source:{fileName:_jsxFileName,lineNumber:516,columnNumber:13}}):_react.default.createElement(_reactNative.ActivityIndicator,{__self:this,__source:{fileName:_jsxFileName,lineNumber:529,columnNumber:13}}),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){pickImageFromGallery();},style:{flexDirection:'row',alignItems:'center',gap:8,marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:531,columnNumber:11}},_react.default.createElement(_svgs.IconUpload,{__self:this,__source:{fileName:_jsxFileName,lineNumber:542,columnNumber:13}}),_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:543,columnNumber:13}},"T\u1EA3i \u1EA3nh t\u1EEB th\u01B0 vi\u1EC7n")),_react.default.createElement(_reactNative.View,{style:[styles.buttonContainer,{bottom:insets.bottom}],__self:this,__source:{fileName:_jsxFileName,lineNumber:553,columnNumber:11}},_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:14,textAlign:'center',padding:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:554,columnNumber:13}},"Vui l\xF2ng \u0111\u1EB7t gi\u1EA5y t\u1EDD n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_MButton.default,{onPress:function onPress(){takePhoto();},__self:this,__source:{fileName:_jsxFileName,lineNumber:565,columnNumber:13}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:570,columnNumber:15}})))):passPermission&&type==='nfc'&&shouldRenderCamera?_react.default.createElement(_react.default.Fragment,null,device?_react.default.createElement(_reactNativeVisionCamera.Camera,{ref:myCamera,style:styles.camera,device:device,isActive:true,photo:true,format:format,__self:this,__source:{fileName:_jsxFileName,lineNumber:577,columnNumber:13}}):null,_react.default.createElement(_reactNative.View,{style:styles.overlay,__self:this,__source:{fileName:_jsxFileName,lineNumber:586,columnNumber:11}},_react.default.createElement(_reactNative.View,{style:styles.overlayTop,__self:this,__source:{fileName:_jsxFileName,lineNumber:587,columnNumber:13}}),_react.default.createElement(_reactNative.View,{style:styles.overlayCenter,__self:this,__source:{fileName:_jsxFileName,lineNumber:588,columnNumber:13}},_react.default.createElement(_reactNative.View,{style:styles.overlayLeft,__self:this,__source:{fileName:_jsxFileName,lineNumber:589,columnNumber:15}}),_react.default.createElement(_reactNative.View,{style:styles.overlayRect,__self:this,__source:{fileName:_jsxFileName,lineNumber:590,columnNumber:15}}),_react.default.createElement(_reactNative.View,{style:styles.overlayRight,__self:this,__source:{fileName:_jsxFileName,lineNumber:591,columnNumber:15}})),_react.default.createElement(_reactNative.View,{style:styles.overlayBottom,__self:this,__source:{fileName:_jsxFileName,lineNumber:593,columnNumber:13}})),_react.default.createElement(_reactNative.View,{style:styles.buttonContainer,__self:this,__source:{fileName:_jsxFileName,lineNumber:595,columnNumber:11}},_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:14,textAlign:'center',padding:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:596,columnNumber:13}},"Vui l\xF2ng \u0111\u1EB7t chu\u1ED7i k\xED t\u1EF1 n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){scanNfc();},__self:this,__source:{fileName:_jsxFileName,lineNumber:607,columnNumber:13}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:612,columnNumber:15}})))):_react.default.createElement(_react.default.Fragment,null),_react.default.createElement(_reactNativeModal.default,{isVisible:showModal,style:$modal,backdropTransitionInTiming:0,nimationOutTiming:200,animationInTiming:200,animationIn:'slideInUp',animationOut:'fadeOutDown',useNativeDriverForBackdrop:true,useNativeDriver:true,__self:this,__source:{fileName:_jsxFileName,lineNumber:620,columnNumber:7}},_react.default.createElement(_reactNativeLinearGradient.default,{colors:['#FF8E4F','#EF592E'],style:$container,__self:this,__source:{fileName:_jsxFileName,lineNumber:631,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:$paddingV,__self:this,__source:{fileName:_jsxFileName,lineNumber:632,columnNumber:11}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){setShowModal(false);setTimeout(function(){navigation.goBack();},100);},style:{width:24,height:24,position:'absolute',left:16,top:24,alignItems:'center',zIndex:10000},__self:this,__source:{fileName:_jsxFileName,lineNumber:633,columnNumber:13}},_react.default.createElement(_icons.CloseIcon,{__self:this,__source:{fileName:_jsxFileName,lineNumber:650,columnNumber:15}})),_react.default.createElement(_MText.MText,{style:$title,__self:this,__source:{fileName:_jsxFileName,lineNumber:652,columnNumber:13}},"NH\u1EACN DI\u1EC6N GI\u1EA4Y T\u1EDC T\xD9Y TH\xC2N"),_react.default.createElement(_MText.MText,{style:$description,__self:this,__source:{fileName:_jsxFileName,lineNumber:653,columnNumber:13}},"Ch\u1EE5p \u1EA3nh 2 m\u1EB7t ho\u1EB7c NFC CCCD/ CMND"),_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/vehicleStep.png'),style:$step,__self:this,__source:{fileName:_jsxFileName,lineNumber:657,columnNumber:13}}),_react.default.createElement(_reactNative.View,{style:$bg,__self:this,__source:{fileName:_jsxFileName,lineNumber:662,columnNumber:13}},_react.default.createElement(_reactNative.View,{style:{flexDirection:'column',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:663,columnNumber:15}},_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/Frame1000011946.png'),style:{width:'60%',height:70,resizeMode:'contain',marginVertical:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:669,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{marginTop:10,paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:679,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[$title2,{textAlign:'left'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:680,columnNumber:17}},"C\xE1ch 1: NFC (\xC1p d\u1EE5ng cho CCCD g\u1EAFn chip)"),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:683,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:684,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:685,columnNumber:19}},"\u0110\u1EB7t ph\u1EA7n chip \u0111\u1ED3ng g\u1EA7n l\u1EA1i v\u1EDBi ph\u1EA7n ph\xEDa tr\xEAn c\u1EE7a",'\n',"m\u1EB7t l\u01B0ng \u0111i\u1EC7n tho\u1EA1i")),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:690,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:691,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:692,columnNumber:19}},"Gi\u1EEF nguy\xEAn cho \u0111\u1EBFn khi \u0111\u1ECDc xong th\xF4ng tin th\u1EBB")),_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/Frame1000011953.png'),style:{width:'100%',height:70,resizeMode:'contain',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:696,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{marginTop:10,paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:706,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[$title2,{textAlign:'left'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:707,columnNumber:17}},"C\xE1ch 2: Ch\u1EE5p 2 m\u1EB7t"),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:710,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:711,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:712,columnNumber:19}},"N\xEAn \u0111\u1EB7t CCCD/ CMND l\xEAn m\u1EB7t ph\u1EB3ng \u0111\u1EC3 ch\u1EE5p")),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:716,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:717,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:718,columnNumber:19}},"\u0110\u1EB7t CCCD/ CMND n\u1EB1m g\u1ECDn trong khung h\xECnh (Kh\xF4ng ",'\n'," qu\xE1 nh\u1ECF hay qu\xE1 to l\xE0m m\u1EA5t chi ti\u1EBFt)")),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:723,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:724,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:725,columnNumber:19}},"Ch\u1ECDn n\u01A1i \xE1nh s\xE1ng t\u1ED1t, tr\xE1nh l\xF3a/ ch\xF3i h\xECnh ch\u1EE5p")),_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/Frame1000011947.png'),style:{width:'100%',height:80,resizeMode:'contain',marginTop:10},__self:this,__source:{fileName:_jsxFileName,lineNumber:729,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',alignItems:'center',margin:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:740,columnNumber:15}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){setType('passport');setShowModal(false);(0,_storage.save)(_storage.OCR_V1,true);},style:{flex:1,borderWidth:1,borderColor:'#EF592E',height:40,alignItems:'center',justifyContent:'center',borderRadius:40},__self:this,__source:{fileName:_jsxFileName,lineNumber:747,columnNumber:17}},_react.default.createElement(_MText.MText,{style:{color:'#EF592E',fontSize:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:764,columnNumber:19}},"Ch\u1EE5p 2 m\u1EB7t"))),_react.default.createElement(_reactNative.View,{style:{height:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:806,columnNumber:15}}))))),_react.default.createElement(_Loading.default,{isLoading:isLoading,__self:this,__source:{fileName:_jsxFileName,lineNumber:812,columnNumber:7}}));});var $row={flexDirection:'row',alignItems:'center',marginTop:5};var $txt={fontSize:12,marginLeft:5};var $bg={backgroundColor:'white',borderTopRightRadius:26,borderTopLeftRadius:26};var $step={height:40,width:'100%',resizeMode:'contain',marginTop:10,marginBottom:10};var $paddingV={paddingTop:16};var $title={fontSize:16,color:'white',fontWeight:'bold',textAlign:'center'};var $title2={fontSize:16,color:'#333333',fontWeight:'bold',textAlign:'center'};var $description={fontSize:12,color:'white',textAlign:'center'};var $flex={flex:1};var $modal={justifyContent:'flex-end',margin:0};var $container={borderTopRightRadius:26,borderTopLeftRadius:26};var styles=_reactNative.StyleSheet.create({container:{flex:1},camera:{flex:1},buttonContainer:{flex:0,flexDirection:'column',justifyContent:'center',alignItems:'center',position:'absolute',left:0,right:0,zIndex:1000},captureButton:{width:56,height:56,borderRadius:35,backgroundColor:'white',justifyContent:'center',alignItems:'center'},innerCaptureButton:{width:60,height:60,borderRadius:30,backgroundColor:'red'},overlay:{position:'absolute',top:0,left:0,right:0,bottom:0,justifyContent:'center',alignItems:'center'},overlayTop:{flex:1,backgroundColor:'black',width:'100%'},overlayCenter:{flexDirection:'row'},overlayLeft:{flex:1,backgroundColor:'black'},overlayRect:{width:'90%',height:100,borderColor:'white',borderWidth:2,justifyContent:'center',alignItems:'center'},instructionText:{color:'white',textAlign:'center',paddingHorizontal:10,fontSize:14,position:'absolute',top:-50},overlayRight:{flex:1,backgroundColor:'black'},overlayBottom:{flex:1,backgroundColor:'black',width:'100%'},mrzContainer:{padding:10},mrzText:{fontSize:16}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.OCR=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _mobxReactLite=require("mobx-react-lite");var _reactNative=require("react-native");var _MText=require("../../components/MText");var _storage=require("../../utils/storage");var _reactNativePermissions=require("react-native-permissions");var _reactNativeVisionCamera=require("react-native-vision-camera");var _reactNativeModal=_interopRequireDefault(require("react-native-modal"));var _reactNativeLinearGradient=_interopRequireDefault(require("react-native-linear-gradient"));var _icons=require("../../assets/icons");var _MButton=_interopRequireDefault(require("../../components/MButton"));var _CommonStyles=require("../CommonStyles");var _native=require("@react-navigation/native");var _textRecognition=_interopRequireDefault(require("@react-native-ml-kit/text-recognition"));var _navigation=require("../../navigation");var _api=require("../../services/api");var _Loading=_interopRequireDefault(require("../../components/Loading"));var _svgs=require("../../assets/svgs");var _reactNativeImageCropPicker=_interopRequireDefault(require("react-native-image-crop-picker"));var _reactNativeImagePicker=require("react-native-image-picker");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _jsxFileName="/Users/tima/Tima/react-native-timacare/src/screens/toan-trinh-so/OCR.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t3 in e)"default"!==_t3&&{}.hasOwnProperty.call(e,_t3)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t3))&&(i.get||i.set)?o(f,_t3,i):f[_t3]=e[_t3]);return f;})(e,t);}var NFCReader=_reactNative.NativeModules.NFCReader;var OCR=exports.OCR=(0,_mobxReactLite.observer)(function OCR(props){var _props$route22,_props$route22$params;var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var isFocused=(0,_native.useIsFocused)();var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isLoading=_useState2[0],setIsLoading=_useState2[1];var navigation=(0,_native.useNavigation)();var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2.default)(_useState3,2),showModal=_useState4[0],setShowModal=_useState4[1];var _useState5=(0,_react.useState)('passport'),_useState6=(0,_slicedToArray2.default)(_useState5,2),type=_useState6[0],setType=_useState6[1];var _useState7=(0,_react.useState)(false),_useState8=(0,_slicedToArray2.default)(_useState7,2),taking=_useState8[0],setTaking=_useState8[1];var _useState9=(0,_react.useState)(false),_useState0=(0,_slicedToArray2.default)(_useState9,2),passPermission=_useState0[0],setPassPermission=_useState0[1];var _useState1=(0,_react.useState)(false),_useState10=(0,_slicedToArray2.default)(_useState1,2),shouldRenderCamera=_useState10[0],setShouldRenderCamera=_useState10[1];var myCamera=(0,_react.useRef)(null);var device=(0,_reactNativeVisionCamera.useCameraDevice)('back');var format=(0,_reactNativeVisionCamera.useCameraFormat)(device,[{photoResolution:{width:1280,height:720}}]);var _requestPermissions=function requestPermissions(){(0,_reactNativePermissions.request)(_reactNative.Platform.OS==='ios'?_reactNativePermissions.PERMISSIONS.IOS.CAMERA:_reactNativePermissions.PERMISSIONS.ANDROID.CAMERA).then(function(result){switch(result){case _reactNativePermissions.RESULTS.UNAVAILABLE:console.log('This feature is not available (on this device / in this context)');_reactNative.Alert.alert('Thông báo','Máy ảnh trên thiết bị không tương thích.\nVui lòng kiểm tra lại thiết bị!',[{text:'Đồng ý'}]);break;case _reactNativePermissions.RESULTS.DENIED:console.log('The permission has not been requested / is denied but requestable');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.LIMITED:console.log('The permission is limited: some actions are possible');_reactNative.Alert.alert('Thông báo','Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{_requestPermissions();}}}]);break;case _reactNativePermissions.RESULTS.GRANTED:console.log('The permission is granted');setPassPermission(true);break;case _reactNativePermissions.RESULTS.BLOCKED:console.log('The permission is denied and not requestable anymore');_reactNative.Alert.alert('Thông báo','Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',[{text:'Đồng ý',onPress:function onPress(){if(_reactNative.Platform.OS==='ios'){(0,_reactNativePermissions.openSettings)();}else{(0,_reactNativePermissions.openSettings)();}}}]);break;}});};(0,_react.useEffect)(function(){var timeout;if(isFocused){timeout=setTimeout(function(){setShouldRenderCamera(true);},500);}else{setShouldRenderCamera(false);}return function(){return clearTimeout(timeout);};},[isFocused]);var loadIntro=function _callee(){var intro;return _regenerator.default.async(function(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=1;return _regenerator.default.awrap((0,_storage.load)(_storage.OCR_V1));case 1:intro=_context.sent;if(!intro){setShowModal(true);}case 2:case"end":return _context.stop();}},null,null,null,Promise);};(0,_react.useEffect)(function(){_requestPermissions();loadIntro();},[]);var saveDataNfc=function _callee2(body){var _props$route,_props$route$params,_props$route$params$l,response,_response$data,_response$data$meta,_response$data2,_response$data2$meta,_t;return _regenerator.default.async(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;_context2.next=1;return _regenerator.default.awrap(_api.Api.getInstance().saveNfcInfo((0,_extends2.default)({},body,{loanBriefId:props==null?void 0:(_props$route=props.route)==null?void 0:(_props$route$params=_props$route.params)==null?void 0:(_props$route$params$l=_props$route$params.loan)==null?void 0:_props$route$params$l.id})));case 1:response=_context2.sent;if(response.kind==='ok'){if(((_response$data=response.data)==null?void 0:(_response$data$meta=_response$data.meta)==null?void 0:_response$data$meta.errorCode)===200){setTimeout(function(){var _props$route2,_props$route2$params;navigation.push(_navigation.ScreenNames.TTSSelfie,{loan:props==null?void 0:(_props$route2=props.route)==null?void 0:(_props$route2$params=_props$route2.params)==null?void 0:_props$route2$params.loan});},500);}else{_reactNative.Alert.alert('Thông báo',response==null?void 0:(_response$data2=response.data)==null?void 0:(_response$data2$meta=_response$data2.meta)==null?void 0:_response$data2$meta.errorMessage);}}else{_reactNative.Alert.alert('Thông báo','Có lỗi xảy ra. Vui lòng thử lại sau');}_context2.next=3;break;case 2:_context2.prev=2;_t=_context2["catch"](0);console.log(_t);case 3:case"end":return _context2.stop();}},null,null,[[0,2]],Promise);};var convertToDate=function convertToDate(input,end){var yearPrefix=input.substring(0,2);var year=end?'20'+yearPrefix:parseInt(yearPrefix)>20?'19'+yearPrefix:'20'+yearPrefix;var month=input.substring(2,4);var day=input.substring(4,6);return year+'-'+month+'-'+day;};var extractMRZInfo=function extractMRZInfo(text){var documentNumber='';var birthDate='';var expirationDate='';var regex1=/VNM(\d{9})/;var match1=text.match(regex1);if(match1){documentNumber=match1[1];}console.log('documentNumber',documentNumber);var regex=/(\d{6}).[MF](\d{6})/;var match=text.replace(/ /g,'').match(regex);if(match){console.log({documentNumber:documentNumber,birthDate:match[1],expirationDate:match[2]});birthDate=match[1],expirationDate=match[2];}else{return null;}if(documentNumber&&birthDate&&expirationDate){try{NFCReader.readNFCCard(documentNumber,convertToDate(birthDate,false),convertToDate(expirationDate,true),function(error,response){try{var convertData=JSON.parse(response);saveDataNfc(convertData);}catch(e){console.log(e);}});}catch(e){console.log(e);}}};var handleTextRecognition=function _callee3(imagePath){var result,_t2;return _regenerator.default.async(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;_context3.next=1;return _regenerator.default.awrap(_textRecognition.default.recognize(imagePath));case 1:result=_context3.sent;extractMRZInfo(result.text);_context3.next=3;break;case 2:_context3.prev=2;_t2=_context3["catch"](0);console.log(_t2);case 3:case"end":return _context3.stop();}},null,null,[[0,2]],Promise);};var scanNfc=function _callee4(){var data;return _regenerator.default.async(function(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!myCamera.current){_context4.next=2;break;}_context4.next=1;return _regenerator.default.awrap(myCamera.current.takePhoto({qualityPrioritization:'speed'}));case 1:data=_context4.sent;_context4.next=2;return _regenerator.default.awrap(handleTextRecognition('file://'+data.path));case 2:case"end":return _context4.stop();}},null,null,null,Promise);};var takePhoto=function _callee5(){var _props$route3,_props$route3$params,_props$route4,_props$route4$params,_props$route6,_props$route6$params,_props$route7,_props$route7$params;var data,uri,_props$route5,_props$route5$params,_props$route8,_props$route8$params,_props$route9,_props$route9$params;return _regenerator.default.async(function(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!(myCamera.current==null||taking)){_context5.next=1;break;}return _context5.abrupt("return");case 1:setTaking(true);_context5.next=2;return _regenerator.default.awrap(myCamera.current.takePhoto({qualityPrioritization:'quality'}));case 2:data=_context5.sent;uri='file://'+data.path;setTaking(false);if(props!=null&&(_props$route3=props.route)!=null&&(_props$route3$params=_props$route3.params)!=null&&_props$route3$params.front&&!((_props$route4=props.route)!=null&&(_props$route4$params=_props$route4.params)!=null&&_props$route4$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDFront,{uri:uri,loan:props==null?void 0:(_props$route5=props.route)==null?void 0:(_props$route5$params=_props$route5.params)==null?void 0:_props$route5$params.loan});}else if(!(props!=null&&(_props$route6=props.route)!=null&&(_props$route6$params=_props$route6.params)!=null&&_props$route6$params.front)&&!((_props$route7=props.route)!=null&&(_props$route7$params=_props$route7.params)!=null&&_props$route7$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDBack,{uri:uri,loan:props==null?void 0:(_props$route8=props.route)==null?void 0:(_props$route8$params=_props$route8.params)==null?void 0:_props$route8$params.loan});}else{navigation.goBack();(_props$route9=props.route)==null?void 0:(_props$route9$params=_props$route9.params)==null?void 0:_props$route9$params.callback(uri);}case 3:case"end":return _context5.stop();}},null,null,null,Promise);};var pickImageFromGallery=function _callee6(){var result,_props$route0,_props$route0$params,_props$route1,_props$route1$params,_props$route11,_props$route11$params,_props$route12,_props$route12$params,_result$assets$,_props$route10,_props$route10$params,_result$assets$2,_props$route13,_props$route13$params,_props$route14,_props$route14$params,_result$assets$3;return _regenerator.default.async(function(_context6){while(1)switch(_context6.prev=_context6.next){case 0:if(!(_reactNative.Platform.OS==='android')){_context6.next=2;break;}_context6.next=1;return _regenerator.default.awrap((0,_reactNativeImagePicker.launchImageLibrary)({mediaType:'photo'}));case 1:result=_context6.sent;if(result.assets){if(props!=null&&(_props$route0=props.route)!=null&&(_props$route0$params=_props$route0.params)!=null&&_props$route0$params.front&&!((_props$route1=props.route)!=null&&(_props$route1$params=_props$route1.params)!=null&&_props$route1$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDFront,{uri:(_result$assets$=result.assets[0])==null?void 0:_result$assets$.uri,loan:props==null?void 0:(_props$route10=props.route)==null?void 0:(_props$route10$params=_props$route10.params)==null?void 0:_props$route10$params.loan});}else if(!(props!=null&&(_props$route11=props.route)!=null&&(_props$route11$params=_props$route11.params)!=null&&_props$route11$params.front)&&!((_props$route12=props.route)!=null&&(_props$route12$params=_props$route12.params)!=null&&_props$route12$params.callback)){navigation.push(_navigation.ScreenNames.TTSNationalIDBack,{uri:(_result$assets$2=result.assets[0])==null?void 0:_result$assets$2.uri,loan:props==null?void 0:(_props$route13=props.route)==null?void 0:(_props$route13$params=_props$route13.params)==null?void 0:_props$route13$params.loan});}else{navigation.goBack();(_props$route14=props.route)==null?void 0:(_props$route14$params=_props$route14.params)==null?void 0:_props$route14$params.callback((_result$assets$3=result.assets[0])==null?void 0:_result$assets$3.uri);}}_context6.next=3;break;case 2:_reactNativeImageCropPicker.default.openPicker({}).then(function(image){var _props$route15,_props$route15$params,_props$route16,_props$route16$params,_props$route18,_props$route18$params,_props$route19,_props$route19$params;if(props!=null&&(_props$route15=props.route)!=null&&(_props$route15$params=_props$route15.params)!=null&&_props$route15$params.front&&!((_props$route16=props.route)!=null&&(_props$route16$params=_props$route16.params)!=null&&_props$route16$params.callback)){var _props$route17,_props$route17$params;navigation.push(_navigation.ScreenNames.TTSNationalIDFront,{uri:_reactNative.Platform.OS==='android'?image==null?void 0:image.path:'file://'+(image==null?void 0:image.path),loan:props==null?void 0:(_props$route17=props.route)==null?void 0:(_props$route17$params=_props$route17.params)==null?void 0:_props$route17$params.loan});}else if(!(props!=null&&(_props$route18=props.route)!=null&&(_props$route18$params=_props$route18.params)!=null&&_props$route18$params.front)&&!((_props$route19=props.route)!=null&&(_props$route19$params=_props$route19.params)!=null&&_props$route19$params.callback)){var _props$route20,_props$route20$params;navigation.push(_navigation.ScreenNames.TTSNationalIDBack,{uri:_reactNative.Platform.OS==='android'?image==null?void 0:image.path:'file://'+(image==null?void 0:image.path),loan:props==null?void 0:(_props$route20=props.route)==null?void 0:(_props$route20$params=_props$route20.params)==null?void 0:_props$route20$params.loan});}else{var _props$route21,_props$route21$params;navigation.goBack();(_props$route21=props.route)==null?void 0:(_props$route21$params=_props$route21.params)==null?void 0:_props$route21$params.callback(_reactNative.Platform.OS==='android'?image==null?void 0:image.path:'file://'+(image==null?void 0:image.path));}});case 3:case"end":return _context6.stop();}},null,null,null,Promise);};return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'black'},pointerEvents:'box-none',__self:this,__source:{fileName:_jsxFileName,lineNumber:370,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:{alignItems:'center',position:'absolute',top:insets.top+16,left:0,right:0,zIndex:100},__self:this,__source:{fileName:_jsxFileName,lineNumber:374,columnNumber:7}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){navigation.navigate(_navigation.ScreenNames.Main);},style:{position:'absolute',left:10,top:4,width:24,height:24,alignItems:'center',justifyContent:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:384,columnNumber:9}},_react.default.createElement(_icons.IconBackWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:398,columnNumber:11}})),_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:16,textAlign:'center',padding:16,marginTop:10},__self:this,__source:{fileName:_jsxFileName,lineNumber:401,columnNumber:9}},type==='passport'&&props!=null&&(_props$route22=props.route)!=null&&(_props$route22$params=_props$route22.params)!=null&&_props$route22$params.front?'Chụp CMND/ CCCD mặt trước':type==='passport'?'Chụp CMND/ CCCD mặt sau':'Dùng camera để quét chuỗi ký tự mặt sau thẻ CCCD gắn chíp ở phía dưới')),passPermission&&type==='passport'&&shouldRenderCamera?_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.fill,_CommonStyles.commonStyles.justifyCenter,{position:'absolute',width:_reactNative.Dimensions.get('window').width,height:_reactNative.Dimensions.get('window').height}],__self:this,__source:{fileName:_jsxFileName,lineNumber:419,columnNumber:9}},device?_react.default.createElement(_reactNative.View,{style:styles.passportCameraFrame,__self:this,__source:{fileName:_jsxFileName,lineNumber:432,columnNumber:13}},_react.default.createElement(_reactNativeVisionCamera.Camera,{ref:myCamera,style:_reactNative.StyleSheet.absoluteFill,device:device,isActive:true,photo:true,format:format,__self:this,__source:{fileName:_jsxFileName,lineNumber:433,columnNumber:15}})):_react.default.createElement(_reactNative.ActivityIndicator,{__self:this,__source:{fileName:_jsxFileName,lineNumber:443,columnNumber:13}}),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){pickImageFromGallery();},style:{flexDirection:'row',alignItems:'center',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:445,columnNumber:11}},_react.default.createElement(_svgs.IconUpload,{__self:this,__source:{fileName:_jsxFileName,lineNumber:455,columnNumber:13}}),_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:12,marginLeft:8},__self:this,__source:{fileName:_jsxFileName,lineNumber:456,columnNumber:13}},"T\u1EA3i \u1EA3nh t\u1EEB th\u01B0 vi\u1EC7n")),_react.default.createElement(_reactNative.View,{style:[styles.buttonContainer,{bottom:insets.bottom}],__self:this,__source:{fileName:_jsxFileName,lineNumber:467,columnNumber:11}},_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:14,textAlign:'center',padding:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:468,columnNumber:13}},"Vui l\xF2ng \u0111\u1EB7t gi\u1EA5y t\u1EDD n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_MButton.default,{onPress:function onPress(){takePhoto();},__self:this,__source:{fileName:_jsxFileName,lineNumber:479,columnNumber:13}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:484,columnNumber:15}})))):passPermission&&type==='nfc'&&shouldRenderCamera?_react.default.createElement(_react.default.Fragment,null,device?_react.default.createElement(_reactNativeVisionCamera.Camera,{ref:myCamera,style:styles.camera,device:device,isActive:true,photo:true,format:format,__self:this,__source:{fileName:_jsxFileName,lineNumber:491,columnNumber:13}}):null,_react.default.createElement(_reactNative.View,{style:styles.overlay,__self:this,__source:{fileName:_jsxFileName,lineNumber:500,columnNumber:11}},_react.default.createElement(_reactNative.View,{style:styles.overlayTop,__self:this,__source:{fileName:_jsxFileName,lineNumber:501,columnNumber:13}}),_react.default.createElement(_reactNative.View,{style:styles.overlayCenter,__self:this,__source:{fileName:_jsxFileName,lineNumber:502,columnNumber:13}},_react.default.createElement(_reactNative.View,{style:styles.overlayLeft,__self:this,__source:{fileName:_jsxFileName,lineNumber:503,columnNumber:15}}),_react.default.createElement(_reactNative.View,{style:styles.overlayRect,__self:this,__source:{fileName:_jsxFileName,lineNumber:504,columnNumber:15}}),_react.default.createElement(_reactNative.View,{style:styles.overlayRight,__self:this,__source:{fileName:_jsxFileName,lineNumber:505,columnNumber:15}})),_react.default.createElement(_reactNative.View,{style:styles.overlayBottom,__self:this,__source:{fileName:_jsxFileName,lineNumber:507,columnNumber:13}})),_react.default.createElement(_reactNative.View,{style:[styles.buttonContainer,{bottom:insets.bottom+24}],__self:this,__source:{fileName:_jsxFileName,lineNumber:509,columnNumber:11}},_react.default.createElement(_MText.MText,{style:{color:'white',fontSize:14,textAlign:'center',padding:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:512,columnNumber:13}},"Vui l\xF2ng \u0111\u1EB7t chu\u1ED7i k\xED t\u1EF1 n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){scanNfc();},__self:this,__source:{fileName:_jsxFileName,lineNumber:523,columnNumber:13}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:528,columnNumber:15}})))):_react.default.createElement(_react.default.Fragment,null),_react.default.createElement(_reactNativeModal.default,{isVisible:showModal,style:$modal,backdropTransitionInTiming:0,nimationOutTiming:200,animationInTiming:200,animationIn:'slideInUp',animationOut:'fadeOutDown',useNativeDriverForBackdrop:true,useNativeDriver:true,__self:this,__source:{fileName:_jsxFileName,lineNumber:536,columnNumber:7}},_react.default.createElement(_reactNativeLinearGradient.default,{colors:['#FF8E4F','#EF592E'],style:$container,__self:this,__source:{fileName:_jsxFileName,lineNumber:547,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:$paddingV,__self:this,__source:{fileName:_jsxFileName,lineNumber:548,columnNumber:11}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){setShowModal(false);setTimeout(function(){navigation.goBack();},100);},style:{width:24,height:24,position:'absolute',left:16,top:24,alignItems:'center',zIndex:10000},__self:this,__source:{fileName:_jsxFileName,lineNumber:549,columnNumber:13}},_react.default.createElement(_icons.CloseIcon,{__self:this,__source:{fileName:_jsxFileName,lineNumber:566,columnNumber:15}})),_react.default.createElement(_MText.MText,{style:$title,__self:this,__source:{fileName:_jsxFileName,lineNumber:568,columnNumber:13}},"NH\u1EACN DI\u1EC6N GI\u1EA4Y T\u1EDC T\xD9Y TH\xC2N"),_react.default.createElement(_MText.MText,{style:$description,__self:this,__source:{fileName:_jsxFileName,lineNumber:569,columnNumber:13}},"Ch\u1EE5p \u1EA3nh 2 m\u1EB7t ho\u1EB7c NFC CCCD/ CMND"),_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/vehicleStep.png'),style:$step,__self:this,__source:{fileName:_jsxFileName,lineNumber:573,columnNumber:13}}),_react.default.createElement(_reactNative.View,{style:$bg,__self:this,__source:{fileName:_jsxFileName,lineNumber:578,columnNumber:13}},_react.default.createElement(_reactNative.View,{style:{flexDirection:'column',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:579,columnNumber:15}},_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/Frame1000011946.png'),style:{width:'60%',height:70,resizeMode:'contain',marginVertical:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:585,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{marginTop:10,paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:595,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[$title2,{textAlign:'left'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:596,columnNumber:17}},"C\xE1ch 1: NFC (\xC1p d\u1EE5ng cho CCCD g\u1EAFn chip)"),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:599,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:600,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:601,columnNumber:19}},"\u0110\u1EB7t ph\u1EA7n chip \u0111\u1ED3ng g\u1EA7n l\u1EA1i v\u1EDBi ph\u1EA7n ph\xEDa tr\xEAn c\u1EE7a",'\n',"m\u1EB7t l\u01B0ng \u0111i\u1EC7n tho\u1EA1i")),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:606,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:607,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:608,columnNumber:19}},"Gi\u1EEF nguy\xEAn cho \u0111\u1EBFn khi \u0111\u1ECDc xong th\xF4ng tin th\u1EBB")),_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/Frame1000011953.png'),style:{width:'100%',height:70,resizeMode:'contain',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:612,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{marginTop:10,paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:622,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[$title2,{textAlign:'left'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:623,columnNumber:17}},"C\xE1ch 2: Ch\u1EE5p 2 m\u1EB7t"),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:626,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:627,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:628,columnNumber:19}},"N\xEAn \u0111\u1EB7t CCCD/ CMND l\xEAn m\u1EB7t ph\u1EB3ng \u0111\u1EC3 ch\u1EE5p")),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:632,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:633,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:634,columnNumber:19}},"\u0110\u1EB7t CCCD/ CMND n\u1EB1m g\u1ECDn trong khung h\xECnh (Kh\xF4ng ",'\n'," qu\xE1 nh\u1ECF hay qu\xE1 to l\xE0m m\u1EA5t chi ti\u1EBFt)")),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:639,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:640,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:$txt,__self:this,__source:{fileName:_jsxFileName,lineNumber:641,columnNumber:19}},"Ch\u1ECDn n\u01A1i \xE1nh s\xE1ng t\u1ED1t, tr\xE1nh l\xF3a/ ch\xF3i h\xECnh ch\u1EE5p")),_react.default.createElement(_reactNative.Image,{source:require('../../assets/tts/Frame1000011947.png'),style:{width:'100%',height:80,resizeMode:'contain',marginTop:10},__self:this,__source:{fileName:_jsxFileName,lineNumber:645,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',alignItems:'center',margin:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:656,columnNumber:15}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){setType('passport');setShowModal(false);(0,_storage.save)(_storage.OCR_V1,true);},style:{flex:1,borderWidth:1,borderColor:'#EF592E',height:40,alignItems:'center',justifyContent:'center',borderRadius:40},__self:this,__source:{fileName:_jsxFileName,lineNumber:663,columnNumber:17}},_react.default.createElement(_MText.MText,{style:{color:'#EF592E',fontSize:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:680,columnNumber:19}},"Ch\u1EE5p 2 m\u1EB7t"))),_react.default.createElement(_reactNative.View,{style:{height:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:722,columnNumber:15}}))))),_react.default.createElement(_Loading.default,{isLoading:isLoading,__self:this,__source:{fileName:_jsxFileName,lineNumber:728,columnNumber:7}}));});var $row={flexDirection:'row',alignItems:'center',marginTop:5};var $txt={fontSize:12,marginLeft:5};var $bg={backgroundColor:'white',borderTopRightRadius:26,borderTopLeftRadius:26};var $step={height:40,width:'100%',resizeMode:'contain',marginTop:10,marginBottom:10};var $paddingV={paddingTop:16};var $title={fontSize:16,color:'white',fontWeight:'bold',textAlign:'center'};var $title2={fontSize:16,color:'#333333',fontWeight:'bold',textAlign:'center'};var $description={fontSize:12,color:'white',textAlign:'center'};var $flex={flex:1};var $modal={justifyContent:'flex-end',margin:0};var $container={borderTopRightRadius:26,borderTopLeftRadius:26};var styles=_reactNative.StyleSheet.create({container:{flex:1},camera:{flex:1},passportCameraFrame:{width:_reactNative.Dimensions.get('window').width,height:260,overflow:'hidden',backgroundColor:'black'},buttonContainer:{flex:0,flexDirection:'column',justifyContent:'center',alignItems:'center',position:'absolute',left:0,right:0,zIndex:1000},captureButton:{width:56,height:56,borderRadius:35,backgroundColor:'white',justifyContent:'center',alignItems:'center'},innerCaptureButton:{width:60,height:60,borderRadius:30,backgroundColor:'red'},overlay:{position:'absolute',top:0,left:0,right:0,bottom:0,justifyContent:'center',alignItems:'center'},overlayTop:{flex:1,backgroundColor:'black',width:'100%'},overlayCenter:{flexDirection:'row'},overlayLeft:{flex:1,backgroundColor:'black'},overlayRect:{width:'90%',height:100,borderColor:'white',borderWidth:2,justifyContent:'center',alignItems:'center'},instructionText:{color:'white',textAlign:'center',paddingHorizontal:10,fontSize:14,position:'absolute',top:-50},overlayRight:{flex:1,backgroundColor:'black'},overlayBottom:{flex:1,backgroundColor:'black',width:'100%'},mrzContainer:{padding:10},mrzText:{fontSize:16}});
2
2
  //# sourceMappingURL=OCR.js.map
@@ -397,91 +397,7 @@ export const OCR = observer(function OCR(props: any) {
397
397
  >
398
398
  <IconBackWhite />
399
399
  </TouchableOpacity>
400
- <View
401
- style={{
402
- flexDirection: 'row',
403
- padding: 2,
404
- borderRadius: 4,
405
- alignItems: 'center',
406
- backgroundColor: 'transparent',
407
- }}
408
- >
409
- {/* <TouchableOpacity
410
- style={{}}
411
- onPress={() => {
412
- setType('passport');
413
- }}
414
- >
415
- <LinearGradient
416
- colors={
417
- type === 'passport'
418
- ? ['#FF8E4F', '#EF592E']
419
- : ['black', 'black']
420
- }
421
- style={{
422
- height: 28,
423
- paddingHorizontal: 8,
424
- borderRadius: 4,
425
- width: 100,
426
- flexDirection: 'row',
427
- alignItems: 'center',
428
- }}
429
- >
430
- <Cam2Svg />
431
- <MText
432
- style={{
433
- color: 'white',
434
- fontSize: 12,
435
- fontWeight: 'bold',
436
- marginLeft: 5,
437
- }}
438
- >
439
- Chụp 2 mặt
440
- </MText>
441
- </LinearGradient>
442
- </TouchableOpacity> */}
443
- {/* <View
444
- style={{
445
- backgroundColor: 'white',
446
- width: 1,
447
- borderRadius: 10,
448
- height: 20,
449
- marginHorizontal: 8,
450
- }}
451
- ></View> */}
452
- {/* <TouchableOpacity
453
- style={{}}
454
- onPress={() => {
455
- setType('nfc');
456
- }}
457
- >
458
- <LinearGradient
459
- colors={
460
- type === 'nfc' ? ['#FF8E4F', '#EF592E'] : ['black', 'black']
461
- }
462
- style={{
463
- height: 28,
464
- paddingHorizontal: 8,
465
- borderRadius: 4,
466
- width: 100,
467
- flexDirection: 'row',
468
- alignItems: 'center',
469
- }}
470
- >
471
- <ChipSvg />
472
- <MText
473
- style={{
474
- color: 'white',
475
- fontSize: 12,
476
- fontWeight: 'bold',
477
- marginLeft: 5,
478
- }}
479
- >
480
- NFC
481
- </MText>
482
- </LinearGradient>
483
- </TouchableOpacity> */}
484
- </View>
400
+
485
401
  <MText
486
402
  style={{
487
403
  color: 'white',
@@ -513,18 +429,16 @@ export const OCR = observer(function OCR(props: any) {
513
429
  ]}
514
430
  >
515
431
  {device ? (
516
- <VisionCamera
517
- ref={myCamera}
518
- style={{
519
- width: Dimensions.get('window').width,
520
- height: 260,
521
- overflow: 'hidden',
522
- }}
523
- device={device}
524
- isActive={true}
525
- photo={true}
526
- format={format}
527
- />
432
+ <View style={styles.passportCameraFrame}>
433
+ <VisionCamera
434
+ ref={myCamera}
435
+ style={StyleSheet.absoluteFill}
436
+ device={device}
437
+ isActive={true}
438
+ photo={true}
439
+ format={format}
440
+ />
441
+ </View>
528
442
  ) : (
529
443
  <ActivityIndicator />
530
444
  )}
@@ -535,7 +449,6 @@ export const OCR = observer(function OCR(props: any) {
535
449
  style={{
536
450
  flexDirection: 'row',
537
451
  alignItems: 'center',
538
- gap: 8,
539
452
  marginTop: 16,
540
453
  }}
541
454
  >
@@ -544,6 +457,7 @@ export const OCR = observer(function OCR(props: any) {
544
457
  style={{
545
458
  color: 'white',
546
459
  fontSize: 12,
460
+ marginLeft: 8,
547
461
  }}
548
462
  >
549
463
  Tải ảnh từ thư viện
@@ -592,7 +506,9 @@ export const OCR = observer(function OCR(props: any) {
592
506
  </View>
593
507
  <View style={styles.overlayBottom} />
594
508
  </View>
595
- <View style={styles.buttonContainer}>
509
+ <View
510
+ style={[styles.buttonContainer, { bottom: insets.bottom + 24 }]}
511
+ >
596
512
  <MText
597
513
  style={{
598
514
  color: 'white',
@@ -881,6 +797,12 @@ const styles = StyleSheet.create({
881
797
  camera: {
882
798
  flex: 1,
883
799
  },
800
+ passportCameraFrame: {
801
+ width: Dimensions.get('window').width,
802
+ height: 260,
803
+ overflow: 'hidden',
804
+ backgroundColor: 'black',
805
+ },
884
806
  buttonContainer: {
885
807
  flex: 0,
886
808
  flexDirection: 'column',