"use strict";var l=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var _=(n,e)=>{for(var r in e)l(n,r,{get:e[r],enumerable:!0})},$=(n,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of v(e))!M.call(n,t)&&t!==r&&l(n,t,{get:()=>e[t],enumerable:!(m=j(e,t))||m.enumerable});return n};var N=n=>$(l({},"__esModule",{value:!0}),n);var A={};_(A,{CommerceModule:()=>w});module.exports=N(A);var f=require("../../errors/faker-error"),g=require("../../internal/deprecated"),h=require("../../internal/module-base");const S={0:[[1999999,2],[2279999,3],[2289999,4],[3689999,3],[3699999,4],[6389999,3],[6397999,4],[6399999,7],[6449999,3],[6459999,7],[6479999,3],[6489999,7],[6549999,3],[6559999,4],[6999999,3],[8499999,4],[8999999,5],[9499999,6],[9999999,7]],1:[[99999,3],[299999,2],[349999,3],[399999,4],[499999,3],[699999,2],[999999,4],[3979999,3],[5499999,4],[6499999,5],[6799999,4],[6859999,5],[7139999,4],[7169999,3],[7319999,4],[7399999,7],[7749999,5],[7753999,7],[7763999,5],[7764999,7],[7769999,5],[7782999,7],[7899999,5],[7999999,4],[8004999,5],[8049999,5],[8379999,5],[8384999,7],[8671999,5],[8675999,4],[8697999,5],[9159999,6],[9165059,7],[9168699,6],[9169079,7],[9195999,6],[9196549,7],[9729999,6],[9877999,4],[9911499,6],[9911999,7],[9989899,6],[9999999,7]]};class w extends h.ModuleBase{department(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.department)}productName(){return`${this.productAdjective()} ${this.productMaterial()} ${this.product()}`}price(e={},r=1e3,m=2,t=""){typeof e=="number"&&((0,g.deprecated)({deprecated:"faker.commerce.price(min, max, dec, symbol)",proposed:"faker.commerce.price({ min, max, dec, symbol })",since:"8.0",until:"9.0"}),e={min:e,dec:m,max:r,symbol:t});const{dec:o=2,max:u=1e3,min:s=1,symbol:d=""}=e;if(s<0||u<0)return`${d}0`;const c=this.faker.number.int({min:s,max:u});return d+c.toFixed(o)}productAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.adjective)}productMaterial(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.material)}product(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.product)}productDescription(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_description)}isbn(e={}){var b;typeof e=="number"&&(e={variant:e});const{variant:r=13,separator:m="-"}=e,t="978",[o,u]=this.faker.helpers.objectEntry(S),s=this.faker.string.numeric(8),d=Number.parseInt(s.slice(0,-1)),c=(b=u.find(([i])=>d<=i))==null?void 0:b[1];if(!c)throw new f.FakerError(`Unable to find a registrant length for the group ${o}`);const y=s.slice(0,c),k=s.slice(c),p=[t,o,y,k];r===10&&p.shift();const x=p.join("");let a=0;for(let i=0;i<r-1;i++){const E=r===10?i+1:i%2?3:1;a+=E*Number.parseInt(x[i])}return a=r===10?a%11:(10-a%10)%10,p.push(a===10?"X":a.toString()),p.join(m)}}0&&(module.exports={CommerceModule});
