var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.FormattedText=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactAuthShared=require("@brightlayer-ui/react-auth-shared");var _jsxFileName="/home/circleci/login-workflow/login-workflow/src/components/FormattedText.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var makeStyles=function makeStyles(){return _reactNative.StyleSheet.create({b:{fontWeight:'bold'},none:{}});};var FormattedText=function FormattedText(props){var parseableText=props.parseableText,textStyle=props.textStyle;var _useState=(0,_react.useState)([]),_useState2=(0,_slicedToArray2.default)(_useState,2),parsedTextArray=_useState2[0],setTextArray=_useState2[1];var styles=makeStyles();(0,_react.useEffect)(function(){var parseableTextOrEmpty=parseableText!==null&&parseableText!==void 0?parseableText:'';var result=(0,_reactAuthShared.parseTextForJSX)(parseableTextOrEmpty);setTextArray(result);},[parseableText,setTextArray]);return _react.default.createElement(_react.default.Fragment,null,parsedTextArray.map(function(chunk,index){return _react.default.createElement(_reactNative.Text,{key:index,style:[textStyle,styles[chunk.tag]],__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:17}},chunk.text);}));};exports.FormattedText=FormattedText;
//# sourceMappingURL=FormattedText.js.map