text: shadow$provide.module$node_modules$blockstack$lib$profiles$profileSchemas$personUtils=function(global,process,require,module,exports,shadow$shims){Object.defineProperty(exports,"__esModule",{value:!0});exports.getName=function(profile){if(!profile)return null;var name=null;if(profile.name)name=profile.name;else if(profile.givenName||profile.familyName)name="",profile.givenName&&(name=profile.givenName),profile.familyName&&(name+=" "+profile.familyName);return name};exports.getGivenName=function(profile){if(!profile)return null;
  var givenName=null;profile.givenName?givenName=profile.givenName:profile.name&&(givenName=profile.name.split(" ").slice(0,-1).join(" "));return givenName};exports.getFamilyName=function(profile){if(!profile)return null;var familyName=null;profile.familyName?familyName=profile.familyName:profile.name&&(familyName=profile.name.split(" ").pop());return familyName};exports.getDescription=function(profile){if(!profile)return null;var description=null;profile.description&&(description=profile.description);
  return description};exports.getAvatarUrl=function(profile){if(!profile)return null;var avatarContentUrl=null;profile.image&&profile.image.map(function(image){return"avatar"===image.name?avatarContentUrl=image.contentUrl:null});return avatarContentUrl};exports.getVerifiedAccounts=function(profile,verifications){if(!profile)return null;var filteredAccounts=[];profile.hasOwnProperty("account")&&verifications&&profile.account.map(function(account){var accountIsValid=!1,proofUrl=null;verifications.map(function(verification){verification.hasOwnProperty("proof_url")&&
  (verification.proofUrl=verification.proof_url);return verification.valid&&verification.service===account.service&&verification.identifier===account.identifier&&verification.proofUrl?(accountIsValid=!0,proofUrl=verification.proofUrl,!0):!1});return accountIsValid?(account.proofUrl=proofUrl,filteredAccounts.push(account),account):null});return filteredAccounts};exports.getOrganizations=function(profile){return profile?profile.hasOwnProperty("worksFor")?profile.worksFor:[]:null};exports.getConnections=
  function(profile){if(!profile)return null;var connections=[];profile.hasOwnProperty("knows")&&(connections=profile.knows);return connections};exports.getAddress=function(profile){if(!profile)return null;var addressString=null;if(profile.hasOwnProperty("address")){var addressParts=[];profile.address.hasOwnProperty("streetAddress")&&addressParts.push(profile.address.streetAddress);profile.address.hasOwnProperty("addressLocality")&&addressParts.push(profile.address.addressLocality);profile.address.hasOwnProperty("postalCode")&&
  addressParts.push(profile.address.postalCode);profile.address.hasOwnProperty("addressCountry")&&addressParts.push(profile.address.addressCountry);addressParts.length&&(addressString=addressParts.join(", "))}return addressString};exports.getBirthDate=function(profile){if(!profile)return null;var monthNames="January February March April May June July August September October November December".split(" "),birthDateString=null;profile.hasOwnProperty("birthDate")&&(profile=new Date(profile.birthDate),
  birthDateString=monthNames[profile.getMonth()]+" "+profile.getDate()+", "+profile.getFullYear());return birthDateString}}
  //# sourceMappingURL=module$node_modules$blockstack$lib$profiles$profileSchemas$personUtils.js.map
  