"use strict";var o=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var x=(n,e)=>{for(var r in e)o(n,r,{get:e[r],enumerable:!0})},y=(n,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of g(e))!c.call(n,t)&&t!==r&&o(n,t,{get:()=>e[t],enumerable:!(s=_(e,t))||s.enumerable});return n};var N=n=>y(o({},"__esModule",{value:!0}),n);var E={};x(E,{PersonModule:()=>T,Sex:()=>p});module.exports=N(E);var m=require("../../errors/faker-error"),u=require("../../internal/module-base"),k=require("../../locale-proxy"),p=(r=>(r.Female="female",r.Male="male",r))(p||{});function f(n,e,r,{generic:s,female:t,male:a},l){let i;switch(r){case"female":i=t;break;case"male":i=a;break;default:i=s;break}return i==null&&(t!=null&&a!=null?i=n.helpers.arrayElement([t,a]):i=s,(0,k.assertLocaleData)(i,`person.{${l}, female_${l}, male_${l}}`)),e(i)}class T extends u.ModuleBase{firstName(e){var a;const{first_name:r,female_first_name:s,male_first_name:t}=(a=this.faker.rawDefinitions.person)!=null?a:{};return f(this.faker,this.faker.helpers.arrayElement,e,{generic:r,female:s,male:t},"first_name")}lastName(e){var h;const{last_name:r,female_last_name:s,male_last_name:t,last_name_pattern:a,male_last_name_pattern:l,female_last_name_pattern:i}=(h=this.faker.rawDefinitions.person)!=null?h:{};if(a!=null||l!=null||i!=null){const d=f(this.faker,this.faker.helpers.weightedArrayElement,e,{generic:a,female:i,male:l},"last_name_pattern");return this.faker.helpers.fake(d)}return f(this.faker,this.faker.helpers.arrayElement,e,{generic:r,female:s,male:t},"last_name")}middleName(e){var a;const{middle_name:r,female_middle_name:s,male_middle_name:t}=(a=this.faker.rawDefinitions.person)!=null?a:{};return f(this.faker,this.faker.helpers.arrayElement,e,{generic:r,female:s,male:t},"middle_name")}fullName(e={}){const{sex:r=this.faker.helpers.arrayElement(["female","male"]),firstName:s=this.firstName(r),lastName:t=this.lastName(r)}=e,a=this.faker.helpers.weightedArrayElement(this.faker.definitions.person.name);return this.faker.helpers.mustache(a,{"person.prefix":()=>this.prefix(r),"person.firstName":()=>s,"person.middleName":()=>this.middleName(r),"person.lastName":()=>t,"person.suffix":()=>this.suffix()})}gender(){return this.faker.helpers.arrayElement(this.faker.definitions.person.gender)}sex(){return this.faker.helpers.arrayElement(this.faker.definitions.person.sex)}sexType(){return this.faker.helpers.enumValue(p)}bio(){const{bio_pattern:e}=this.faker.definitions.person;return this.faker.helpers.fake(e)}prefix(e){var a;const{prefix:r,female_prefix:s,male_prefix:t}=(a=this.faker.rawDefinitions.person)!=null?a:{};return f(this.faker,this.faker.helpers.arrayElement,e,{generic:r,female:s,male:t},"prefix")}suffix(){return this.faker.helpers.arrayElement(this.faker.definitions.person.suffix)}jobTitle(){return this.faker.helpers.fake(this.faker.definitions.person.job_title_pattern)}jobDescriptor(){const e=this.faker.definitions.person.title.descriptor;if(e==null)throw new m.FakerError("No person.title.descriptor definitions available.");return this.faker.helpers.arrayElement(e)}jobArea(){const e=this.faker.definitions.person.title.level;if(e==null)throw new m.FakerError("No person.title.area definitions available.");return this.faker.helpers.arrayElement(e)}jobType(){const e=this.faker.definitions.person.title.job;if(e==null)throw new m.FakerError("No person.title.job definitions available.");return this.faker.helpers.arrayElement(e)}zodiacSign(){return this.faker.helpers.arrayElement(this.faker.definitions.person.western_zodiac_sign)}}0&&(module.exports={PersonModule,Sex});
