{"version":3,"file":"generateGoogleReCaptchaScriptSrc.mjs","sources":["../../../src/helpers/generateGoogleReCaptchaScriptSrc.ts"],"sourcesContent":["import type { GoogleReCaptcha } from '../types';\n\ninterface GenerateGoogleReCaptchaSrcParams {\n  badge?: Exclude<GoogleReCaptcha.Badge, 'hidden'>;\n  hl?: string;\n  host?: GoogleReCaptcha.Host;\n  isEnterprise?: boolean;\n  render: string;\n}\n\n/**\n * Generates the script source URL for the Google reCAPTCHA.\n *\n * @param {GenerateGoogleReCaptchaSrcParams} params - The parameters for generating the script source URL.\n * @param {string} params.host - The host for the script source URL.\n * @param {boolean} params.isEnterprise - Indicates if the enterprise version of reCAPTCHA should be used.\n * @param {string} params.render - The render parameter for the script source URL.\n * @param {string} params.hl - The hl parameter for the script source URL.\n * @param {string} params.badge - The badge parameter for the script source URL.\n * @return {string} The script source URL for the Google reCAPTCHA.\n */\nexport const generateGoogleReCaptchaScriptSrc = ({\n  host = 'google.com',\n  isEnterprise = false,\n  render,\n  hl,\n  badge\n}: GenerateGoogleReCaptchaSrcParams) => {\n  const queries = new URLSearchParams({\n    ...(hl && { hl }),\n    ...(badge && { badge }),\n    render\n  });\n\n  const file = isEnterprise ? 'enterprise.js' : 'api.js';\n\n  return `https://www.${host}/recaptcha/${file}?${queries}`;\n};\n"],"names":["generateGoogleReCaptchaScriptSrc","host","isEnterprise","render","hl","badge","queries"],"mappings":"AAqBO,MAAMA,IAAmC,CAAC;AAAA,EAC/C,MAAAC,IAAO;AAAA,EACP,cAAAC,IAAe;AAAA,EACf,QAAAC;AAAA,EACA,IAAAC;AAAA,EACA,OAAAC;AACF,MAAwC;AACtC,QAAMC,IAAU,IAAI,gBAAgB;AAAA,IAClC,GAAIF,KAAM,EAAE,IAAAA,EAAA;AAAA,IACZ,GAAIC,KAAS,EAAE,OAAAA,EAAA;AAAA,IACf,QAAAF;AAAA,EAAA,CACD;AAID,SAAO,eAAeF,CAAI,cAFbC,IAAe,kBAAkB,QAEF,IAAII,CAAO;AACzD;"}