{"version":3,"sources":["../../../src/shared/lib/image-config.ts"],"sourcesContent":["export const VALID_LOADERS = [\n  'default',\n  'imgix',\n  'cloudinary',\n  'akamai',\n  'custom',\n] as const\n\nexport type LoaderValue = (typeof VALID_LOADERS)[number]\n\nexport type ImageLoaderProps = {\n  src: string\n  width: number\n  quality?: number\n}\n\nexport type ImageLoaderPropsWithConfig = ImageLoaderProps & {\n  config: Readonly<ImageConfig>\n}\n\nexport type LocalPattern = {\n  /**\n   * Can be literal or wildcard.\n   * Single `*` matches a single path segment.\n   * Double `**` matches any number of path segments.\n   */\n  pathname?: string\n\n  /**\n   * Can be literal query string such as `?v=1` or\n   * empty string meaning no query string.\n   */\n  search?: string\n}\n\nexport type RemotePattern = {\n  /**\n   * Must be `http` or `https`.\n   */\n  protocol?: 'http' | 'https'\n\n  /**\n   * Can be literal or wildcard.\n   * Single `*` matches a single subdomain.\n   * Double `**` matches any number of subdomains.\n   */\n  hostname: string\n\n  /**\n   * Can be literal port such as `8080` or empty string\n   * meaning no port.\n   */\n  port?: string\n\n  /**\n   * Can be literal or wildcard.\n   * Single `*` matches a single path segment.\n   * Double `**` matches any number of path segments.\n   */\n  pathname?: string\n\n  /**\n   * Can be literal query string such as `?v=1` or\n   * empty string meaning no query string.\n   */\n  search?: string\n}\n\ntype ImageFormat = 'image/avif' | 'image/webp'\n\n/**\n * Image configurations\n *\n * @see [Image configuration options](https://nextjs.org/docs/api-reference/next/image#configuration-options)\n */\nexport type ImageConfigComplete = {\n  /** @see [Device sizes documentation](https://nextjs.org/docs/api-reference/next/image#device-sizes) */\n  deviceSizes: number[]\n\n  /** @see [Image sizing documentation](https://nextjs.org/docs/app/building-your-application/optimizing/images#image-sizing) */\n  imageSizes: number[]\n\n  /** @see [Image loaders configuration](https://nextjs.org/docs/api-reference/next/legacy/image#loader) */\n  loader: LoaderValue\n\n  /** @see [Image loader configuration](https://nextjs.org/docs/app/api-reference/components/image#path) */\n  path: string\n\n  /** @see [Image loader configuration](https://nextjs.org/docs/api-reference/next/image#loader-configuration) */\n  loaderFile: string\n\n  /**\n   * @deprecated Use `remotePatterns` instead.\n   */\n  domains: string[]\n\n  /** @see [Disable static image import configuration](https://nextjs.org/docs/api-reference/next/image#disable-static-imports) */\n  disableStaticImages: boolean\n\n  /** @see [Cache behavior](https://nextjs.org/docs/api-reference/next/image#caching-behavior) */\n  minimumCacheTTL: number\n\n  /** @see [Acceptable formats](https://nextjs.org/docs/api-reference/next/image#acceptable-formats) */\n  formats: ImageFormat[]\n\n  /** @see [Maximum Disk Cache Size (in bytes)](https://nextjs.org/docs/api-reference/next/image#maximumdiskcachesize) */\n  maximumDiskCacheSize: number | undefined\n\n  /** @see [Maximum Redirects](https://nextjs.org/docs/api-reference/next/image#maximumredirects) */\n  maximumRedirects: number\n\n  /** @see [Maximum Response Body](https://nextjs.org/docs/api-reference/next/image#maximumresponsebody) */\n  maximumResponseBody: number\n\n  /** @see [Dangerously Allow Local IP](https://nextjs.org/docs/api-reference/next/image#dangerously-allow-local-ip) */\n  dangerouslyAllowLocalIP: boolean\n\n  /** @see [Dangerously Allow SVG](https://nextjs.org/docs/api-reference/next/image#dangerously-allow-svg) */\n  dangerouslyAllowSVG: boolean\n\n  /** @see [Content Security Policy](https://nextjs.org/docs/api-reference/next/image#contentsecuritypolicy) */\n  contentSecurityPolicy: string\n\n  /** @see [Content Disposition Type](https://nextjs.org/docs/api-reference/next/image#contentdispositiontype) */\n  contentDispositionType: 'inline' | 'attachment'\n\n  /** @see [Remote Patterns](https://nextjs.org/docs/api-reference/next/image#remotepatterns) */\n  remotePatterns: Array<URL | RemotePattern>\n\n  /** @see [Local Patterns](https://nextjs.org/docs/api-reference/next/image#localPatterns) */\n  localPatterns: LocalPattern[] | undefined\n\n  /** @see [Qualities](https://nextjs.org/docs/api-reference/next/image#qualities) */\n  qualities: number[] | undefined\n\n  /** @see [Unoptimized](https://nextjs.org/docs/api-reference/next/image#unoptimized) */\n  unoptimized: boolean\n\n  /**\n   * When true, the `cacheHandler` configured in next.config.js will also be used\n   * for caching optimized images. When false, images use the default filesystem cache.\n   * @see [Image Optimization Caching](https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheHandler#image-optimization-caching)\n   */\n  customCacheHandler: boolean\n}\n\nexport type ImageConfig = Partial<ImageConfigComplete>\n\nexport const imageConfigDefault: ImageConfigComplete = {\n  deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n  imageSizes: [32, 48, 64, 96, 128, 256, 384],\n  path: '/_next/image',\n  loader: 'default',\n  loaderFile: '',\n  /**\n   * @deprecated Use `remotePatterns` instead to protect your application from malicious users.\n   */\n  domains: [],\n  disableStaticImages: false,\n  minimumCacheTTL: 14400, // 4 hours\n  formats: ['image/webp'],\n  maximumDiskCacheSize: undefined, // auto-detect by default\n  maximumRedirects: 3,\n  maximumResponseBody: 50_000_000, // 50 MB\n  dangerouslyAllowLocalIP: false,\n  dangerouslyAllowSVG: false,\n  contentSecurityPolicy: `script-src 'none'; frame-src 'none'; sandbox;`,\n  contentDispositionType: 'attachment',\n  localPatterns: undefined, // default: allow all local images\n  remotePatterns: [], // default: allow no remote images\n  qualities: [75],\n  unoptimized: false,\n  customCacheHandler: false,\n}\n"],"names":["VALID_LOADERS","imageConfigDefault","deviceSizes","imageSizes","path","loader","loaderFile","domains","disableStaticImages","minimumCacheTTL","formats","maximumDiskCacheSize","undefined","maximumRedirects","maximumResponseBody","dangerouslyAllowLocalIP","dangerouslyAllowSVG","contentSecurityPolicy","contentDispositionType","localPatterns","remotePatterns","qualities","unoptimized","customCacheHandler"],"mappings":";;;;;;;;;;;;;;;IAAaA,aAAa;eAAbA;;IAoJAC,kBAAkB;eAAlBA;;;AApJN,MAAMD,gBAAgB;IAC3B;IACA;IACA;IACA;IACA;CACD;AA8IM,MAAMC,qBAA0C;IACrDC,aAAa;QAAC;QAAK;QAAK;QAAK;QAAM;QAAM;QAAM;QAAM;KAAK;IAC1DC,YAAY;QAAC;QAAI;QAAI;QAAI;QAAI;QAAK;QAAK;KAAI;IAC3CC,MAAM;IACNC,QAAQ;IACRC,YAAY;IACZ;;GAEC,GACDC,SAAS,EAAE;IACXC,qBAAqB;IACrBC,iBAAiB;IACjBC,SAAS;QAAC;KAAa;IACvBC,sBAAsBC;IACtBC,kBAAkB;IAClBC,qBAAqB;IACrBC,yBAAyB;IACzBC,qBAAqB;IACrBC,uBAAuB,CAAC,6CAA6C,CAAC;IACtEC,wBAAwB;IACxBC,eAAeP;IACfQ,gBAAgB,EAAE;IAClBC,WAAW;QAAC;KAAG;IACfC,aAAa;IACbC,oBAAoB;AACtB","ignoreList":[0]}