@piu-company/react-toolkit 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -34374,10 +34374,10 @@ function require_interop_require_default () {
34374
34374
  if (hasRequired_interop_require_default) return _interop_require_default;
34375
34375
  hasRequired_interop_require_default = 1;
34376
34376
 
34377
- _interop_require_default._ = _interop_require_default._interop_require_default = _interop_require_default$1;
34378
34377
  function _interop_require_default$1(obj) {
34379
34378
  return obj && obj.__esModule ? obj : { default: obj };
34380
34379
  }
34380
+ _interop_require_default._ = _interop_require_default$1;
34381
34381
  return _interop_require_default;
34382
34382
  }
34383
34383
 
@@ -34401,7 +34401,7 @@ function requireWarnOnce () {
34401
34401
  }
34402
34402
  });
34403
34403
  let warnOnce = (_)=>{};
34404
- if (process.env.NODE_ENV !== "production") {
34404
+ if (process.env.NODE_ENV !== 'production') {
34405
34405
  const warnings = new Set();
34406
34406
  warnOnce = (msg)=>{
34407
34407
  if (!warnings.has(msg)) {
@@ -34442,8 +34442,8 @@ function requireImageBlurSvg () {
34442
34442
  const std = 20;
34443
34443
  const svgWidth = blurWidth ? blurWidth * 40 : widthInt;
34444
34444
  const svgHeight = blurHeight ? blurHeight * 40 : heightInt;
34445
- const viewBox = svgWidth && svgHeight ? "viewBox='0 0 " + svgWidth + " " + svgHeight + "'" : "";
34446
- const preserveAspectRatio = viewBox ? "none" : objectFit === "contain" ? "xMidYMid" : objectFit === "cover" ? "xMidYMid slice" : "none";
34445
+ const viewBox = svgWidth && svgHeight ? "viewBox='0 0 " + svgWidth + " " + svgHeight + "'" : '';
34446
+ const preserveAspectRatio = viewBox ? 'none' : objectFit === 'contain' ? 'xMidYMid' : objectFit === 'cover' ? 'xMidYMid slice' : 'none';
34447
34447
  return "%3Csvg xmlns='http://www.w3.org/2000/svg' " + viewBox + "%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='" + std + "'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='" + preserveAspectRatio + "' style='filter: url(%23b);' href='" + blurDataURL + "'/%3E%3C/svg%3E";
34448
34448
  }
34449
34449
 
@@ -34478,11 +34478,11 @@ function requireImageConfig () {
34478
34478
  }
34479
34479
  });
34480
34480
  const VALID_LOADERS = [
34481
- "default",
34482
- "imgix",
34483
- "cloudinary",
34484
- "akamai",
34485
- "custom"
34481
+ 'default',
34482
+ 'imgix',
34483
+ 'cloudinary',
34484
+ 'akamai',
34485
+ 'custom'
34486
34486
  ];
34487
34487
  const imageConfigDefault = {
34488
34488
  deviceSizes: [
@@ -34505,18 +34505,20 @@ function requireImageConfig () {
34505
34505
  256,
34506
34506
  384
34507
34507
  ],
34508
- path: "/_next/image",
34509
- loader: "default",
34510
- loaderFile: "",
34508
+ path: '/_next/image',
34509
+ loader: 'default',
34510
+ loaderFile: '',
34511
34511
  domains: [],
34512
34512
  disableStaticImages: false,
34513
34513
  minimumCacheTTL: 60,
34514
34514
  formats: [
34515
- "image/webp"
34515
+ 'image/webp'
34516
34516
  ],
34517
+ maximumDiskCacheSize: undefined,
34518
+ maximumResponseBody: 50000000,
34517
34519
  dangerouslyAllowSVG: false,
34518
34520
  contentSecurityPolicy: "script-src 'none'; frame-src 'none'; sandbox;",
34519
- contentDispositionType: "inline",
34521
+ contentDispositionType: 'attachment',
34520
34522
  localPatterns: undefined,
34521
34523
  remotePatterns: [],
34522
34524
  qualities: undefined,
@@ -34547,8 +34549,16 @@ function requireGetImgProps () {
34547
34549
  const _imageblursvg = requireImageBlurSvg();
34548
34550
  const _imageconfig = requireImageConfig();
34549
34551
  const VALID_LOADING_VALUES = [
34550
- "lazy",
34551
- "eager",
34552
+ 'lazy',
34553
+ 'eager',
34554
+ undefined
34555
+ ];
34556
+ // Object-fit values that are not valid background-size values
34557
+ const INVALID_BACKGROUND_SIZE_VALUES = [
34558
+ '-moz-initial',
34559
+ 'fill',
34560
+ 'none',
34561
+ 'scale-down',
34552
34562
  undefined
34553
34563
  ];
34554
34564
  function isStaticRequire(src) {
@@ -34558,18 +34568,18 @@ function requireGetImgProps () {
34558
34568
  return src.src !== undefined;
34559
34569
  }
34560
34570
  function isStaticImport(src) {
34561
- return typeof src === "object" && (isStaticRequire(src) || isStaticImageData(src));
34571
+ return !!src && typeof src === 'object' && (isStaticRequire(src) || isStaticImageData(src));
34562
34572
  }
34563
34573
  const allImgs = new Map();
34564
34574
  let perfObserver;
34565
34575
  function getInt(x) {
34566
- if (typeof x === "undefined") {
34576
+ if (typeof x === 'undefined') {
34567
34577
  return x;
34568
34578
  }
34569
- if (typeof x === "number") {
34579
+ if (typeof x === 'number') {
34570
34580
  return Number.isFinite(x) ? x : NaN;
34571
34581
  }
34572
- if (typeof x === "string" && /^[0-9]+$/.test(x)) {
34582
+ if (typeof x === 'string' && /^[0-9]+$/.test(x)) {
34573
34583
  return parseInt(x, 10);
34574
34584
  }
34575
34585
  return NaN;
@@ -34587,18 +34597,18 @@ function requireGetImgProps () {
34587
34597
  const smallestRatio = Math.min(...percentSizes) * 0.01;
34588
34598
  return {
34589
34599
  widths: allSizes.filter((s)=>s >= deviceSizes[0] * smallestRatio),
34590
- kind: "w"
34600
+ kind: 'w'
34591
34601
  };
34592
34602
  }
34593
34603
  return {
34594
34604
  widths: allSizes,
34595
- kind: "w"
34605
+ kind: 'w'
34596
34606
  };
34597
34607
  }
34598
- if (typeof width !== "number") {
34608
+ if (typeof width !== 'number') {
34599
34609
  return {
34600
34610
  widths: deviceSizes,
34601
- kind: "w"
34611
+ kind: 'w'
34602
34612
  };
34603
34613
  }
34604
34614
  const widths = [
@@ -34617,7 +34627,7 @@ function requireGetImgProps () {
34617
34627
  ];
34618
34628
  return {
34619
34629
  widths,
34620
- kind: "x"
34630
+ kind: 'x'
34621
34631
  };
34622
34632
  }
34623
34633
  function generateImgAttrs(param) {
@@ -34632,13 +34642,13 @@ function requireGetImgProps () {
34632
34642
  const { widths, kind } = getWidths(config, width, sizes);
34633
34643
  const last = widths.length - 1;
34634
34644
  return {
34635
- sizes: !sizes && kind === "w" ? "100vw" : sizes,
34645
+ sizes: !sizes && kind === 'w' ? '100vw' : sizes,
34636
34646
  srcSet: widths.map((w, i)=>loader({
34637
34647
  config,
34638
34648
  src,
34639
34649
  quality,
34640
34650
  width: w
34641
- }) + " " + (kind === "w" ? w : i + 1) + kind).join(", "),
34651
+ }) + " " + (kind === 'w' ? w : i + 1) + kind).join(', '),
34642
34652
  // It's intended to keep `src` the last attribute because React updates
34643
34653
  // attributes in order. If we keep `src` the first one, Safari will
34644
34654
  // immediately start to fetch `src`, before `sizes` and `srcSet` are even
@@ -34654,11 +34664,11 @@ function requireGetImgProps () {
34654
34664
  };
34655
34665
  }
34656
34666
  function getImgProps(param, _state) {
34657
- let { src, sizes, unoptimized = false, priority = false, loading, className, quality, width, height, fill = false, style, overrideSrc, onLoad, onLoadingComplete, placeholder = "empty", blurDataURL, fetchPriority, decoding = "async", layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest } = param;
34667
+ let { src, sizes, unoptimized = false, priority = false, loading, className, quality, width, height, fill = false, style, overrideSrc, onLoad, onLoadingComplete, placeholder = 'empty', blurDataURL, fetchPriority, decoding = 'async', layout, objectFit, objectPosition, lazyBoundary, lazyRoot, ...rest } = param;
34658
34668
  const { imgConf, showAltText, blurComplete, defaultLoader } = _state;
34659
34669
  let config;
34660
34670
  let c = imgConf || _imageconfig.imageConfigDefault;
34661
- if ("allSizes" in c) {
34671
+ if ('allSizes' in c) {
34662
34672
  config = c;
34663
34673
  } else {
34664
34674
  var _c_qualities;
@@ -34675,8 +34685,12 @@ function requireGetImgProps () {
34675
34685
  qualities
34676
34686
  };
34677
34687
  }
34678
- if (typeof defaultLoader === "undefined") {
34679
- throw new Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");
34688
+ if (typeof defaultLoader === 'undefined') {
34689
+ throw Object.defineProperty(new Error('images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config'), "__NEXT_ERROR_CODE", {
34690
+ value: "E163",
34691
+ enumerable: false,
34692
+ configurable: true
34693
+ });
34680
34694
  }
34681
34695
  let loader = rest.loader || defaultLoader;
34682
34696
  // Remove property so it's not spread on <img> element
@@ -34684,10 +34698,14 @@ function requireGetImgProps () {
34684
34698
  delete rest.srcSet;
34685
34699
  // This special value indicates that the user
34686
34700
  // didn't define a "loader" prop or "loader" config.
34687
- const isDefaultLoader = "__next_img_default" in loader;
34701
+ const isDefaultLoader = '__next_img_default' in loader;
34688
34702
  if (isDefaultLoader) {
34689
- if (config.loader === "custom") {
34690
- throw new Error('Image with src "' + src + '" is missing "loader" prop.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader");
34703
+ if (config.loader === 'custom') {
34704
+ throw Object.defineProperty(new Error('Image with src "' + src + '" is missing "loader" prop.' + "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader"), "__NEXT_ERROR_CODE", {
34705
+ value: "E252",
34706
+ enumerable: false,
34707
+ configurable: true
34708
+ });
34691
34709
  }
34692
34710
  } else {
34693
34711
  // The user defined a "loader" prop or config.
@@ -34700,22 +34718,22 @@ function requireGetImgProps () {
34700
34718
  };
34701
34719
  }
34702
34720
  if (layout) {
34703
- if (layout === "fill") {
34721
+ if (layout === 'fill') {
34704
34722
  fill = true;
34705
34723
  }
34706
34724
  const layoutToStyle = {
34707
34725
  intrinsic: {
34708
- maxWidth: "100%",
34709
- height: "auto"
34726
+ maxWidth: '100%',
34727
+ height: 'auto'
34710
34728
  },
34711
34729
  responsive: {
34712
- width: "100%",
34713
- height: "auto"
34730
+ width: '100%',
34731
+ height: 'auto'
34714
34732
  }
34715
34733
  };
34716
34734
  const layoutToSizes = {
34717
- responsive: "100vw",
34718
- fill: "100vw"
34735
+ responsive: '100vw',
34736
+ fill: '100vw'
34719
34737
  };
34720
34738
  const layoutStyle = layoutToStyle[layout];
34721
34739
  if (layoutStyle) {
@@ -34729,7 +34747,7 @@ function requireGetImgProps () {
34729
34747
  sizes = layoutSizes;
34730
34748
  }
34731
34749
  }
34732
- let staticSrc = "";
34750
+ let staticSrc = '';
34733
34751
  let widthInt = getInt(width);
34734
34752
  let heightInt = getInt(height);
34735
34753
  let blurWidth;
@@ -34737,10 +34755,18 @@ function requireGetImgProps () {
34737
34755
  if (isStaticImport(src)) {
34738
34756
  const staticImageData = isStaticRequire(src) ? src.default : src;
34739
34757
  if (!staticImageData.src) {
34740
- throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " + JSON.stringify(staticImageData));
34758
+ throw Object.defineProperty(new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " + JSON.stringify(staticImageData)), "__NEXT_ERROR_CODE", {
34759
+ value: "E460",
34760
+ enumerable: false,
34761
+ configurable: true
34762
+ });
34741
34763
  }
34742
34764
  if (!staticImageData.height || !staticImageData.width) {
34743
- throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " + JSON.stringify(staticImageData));
34765
+ throw Object.defineProperty(new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " + JSON.stringify(staticImageData)), "__NEXT_ERROR_CODE", {
34766
+ value: "E48",
34767
+ enumerable: false,
34768
+ configurable: true
34769
+ });
34744
34770
  }
34745
34771
  blurWidth = staticImageData.blurWidth;
34746
34772
  blurHeight = staticImageData.blurHeight;
@@ -34759,9 +34785,9 @@ function requireGetImgProps () {
34759
34785
  }
34760
34786
  }
34761
34787
  }
34762
- src = typeof src === "string" ? src : staticSrc;
34763
- let isLazy = !priority && (loading === "lazy" || typeof loading === "undefined");
34764
- if (!src || src.startsWith("data:") || src.startsWith("blob:")) {
34788
+ src = typeof src === 'string' ? src : staticSrc;
34789
+ let isLazy = !priority && (loading === 'lazy' || typeof loading === 'undefined');
34790
+ if (!src || src.startsWith('data:') || src.startsWith('blob:')) {
34765
34791
  // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
34766
34792
  unoptimized = true;
34767
34793
  isLazy = false;
@@ -34769,18 +34795,20 @@ function requireGetImgProps () {
34769
34795
  if (config.unoptimized) {
34770
34796
  unoptimized = true;
34771
34797
  }
34772
- if (isDefaultLoader && src.endsWith(".svg") && !config.dangerouslyAllowSVG) {
34798
+ if (isDefaultLoader && !config.dangerouslyAllowSVG && src.split('?', 1)[0].endsWith('.svg')) {
34773
34799
  // Special case to make svg serve as-is to avoid proxying
34774
34800
  // through the built-in Image Optimization API.
34775
34801
  unoptimized = true;
34776
34802
  }
34777
- if (priority) {
34778
- fetchPriority = "high";
34779
- }
34780
34803
  const qualityInt = getInt(quality);
34781
- if (process.env.NODE_ENV !== "production") {
34782
- if (config.output === "export" && isDefaultLoader && !unoptimized) {
34783
- throw new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api");
34804
+ if (process.env.NODE_ENV !== 'production') {
34805
+ var _config_localPatterns;
34806
+ if (config.output === 'export' && isDefaultLoader && !unoptimized) {
34807
+ throw Object.defineProperty(new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api"), "__NEXT_ERROR_CODE", {
34808
+ value: "E500",
34809
+ enumerable: false,
34810
+ configurable: true
34811
+ });
34784
34812
  }
34785
34813
  if (!src) {
34786
34814
  // React doesn't show the stack trace and there's
@@ -34790,58 +34818,132 @@ function requireGetImgProps () {
34790
34818
  } else {
34791
34819
  if (fill) {
34792
34820
  if (width) {
34793
- throw new Error('Image with src "' + src + '" has both "width" and "fill" properties. Only one should be used.');
34821
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has both "width" and "fill" properties. Only one should be used.'), "__NEXT_ERROR_CODE", {
34822
+ value: "E96",
34823
+ enumerable: false,
34824
+ configurable: true
34825
+ });
34794
34826
  }
34795
34827
  if (height) {
34796
- throw new Error('Image with src "' + src + '" has both "height" and "fill" properties. Only one should be used.');
34828
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has both "height" and "fill" properties. Only one should be used.'), "__NEXT_ERROR_CODE", {
34829
+ value: "E115",
34830
+ enumerable: false,
34831
+ configurable: true
34832
+ });
34797
34833
  }
34798
- if ((style == null ? void 0 : style.position) && style.position !== "absolute") {
34799
- throw new Error('Image with src "' + src + '" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.');
34834
+ if ((style == null ? void 0 : style.position) && style.position !== 'absolute') {
34835
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.'), "__NEXT_ERROR_CODE", {
34836
+ value: "E216",
34837
+ enumerable: false,
34838
+ configurable: true
34839
+ });
34800
34840
  }
34801
- if ((style == null ? void 0 : style.width) && style.width !== "100%") {
34802
- throw new Error('Image with src "' + src + '" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.');
34841
+ if ((style == null ? void 0 : style.width) && style.width !== '100%') {
34842
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.'), "__NEXT_ERROR_CODE", {
34843
+ value: "E73",
34844
+ enumerable: false,
34845
+ configurable: true
34846
+ });
34803
34847
  }
34804
- if ((style == null ? void 0 : style.height) && style.height !== "100%") {
34805
- throw new Error('Image with src "' + src + '" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.');
34848
+ if ((style == null ? void 0 : style.height) && style.height !== '100%') {
34849
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.'), "__NEXT_ERROR_CODE", {
34850
+ value: "E404",
34851
+ enumerable: false,
34852
+ configurable: true
34853
+ });
34806
34854
  }
34807
34855
  } else {
34808
- if (typeof widthInt === "undefined") {
34809
- throw new Error('Image with src "' + src + '" is missing required "width" property.');
34856
+ if (typeof widthInt === 'undefined') {
34857
+ throw Object.defineProperty(new Error('Image with src "' + src + '" is missing required "width" property.'), "__NEXT_ERROR_CODE", {
34858
+ value: "E451",
34859
+ enumerable: false,
34860
+ configurable: true
34861
+ });
34810
34862
  } else if (isNaN(widthInt)) {
34811
- throw new Error('Image with src "' + src + '" has invalid "width" property. Expected a numeric value in pixels but received "' + width + '".');
34863
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has invalid "width" property. Expected a numeric value in pixels but received "' + width + '".'), "__NEXT_ERROR_CODE", {
34864
+ value: "E66",
34865
+ enumerable: false,
34866
+ configurable: true
34867
+ });
34812
34868
  }
34813
- if (typeof heightInt === "undefined") {
34814
- throw new Error('Image with src "' + src + '" is missing required "height" property.');
34869
+ if (typeof heightInt === 'undefined') {
34870
+ throw Object.defineProperty(new Error('Image with src "' + src + '" is missing required "height" property.'), "__NEXT_ERROR_CODE", {
34871
+ value: "E397",
34872
+ enumerable: false,
34873
+ configurable: true
34874
+ });
34815
34875
  } else if (isNaN(heightInt)) {
34816
- throw new Error('Image with src "' + src + '" has invalid "height" property. Expected a numeric value in pixels but received "' + height + '".');
34876
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has invalid "height" property. Expected a numeric value in pixels but received "' + height + '".'), "__NEXT_ERROR_CODE", {
34877
+ value: "E444",
34878
+ enumerable: false,
34879
+ configurable: true
34880
+ });
34881
+ }
34882
+ // eslint-disable-next-line no-control-regex
34883
+ if (/^[\x00-\x20]/.test(src)) {
34884
+ throw Object.defineProperty(new Error('Image with src "' + src + '" cannot start with a space or control character. Use src.trimStart() to remove it or encodeURIComponent(src) to keep it.'), "__NEXT_ERROR_CODE", {
34885
+ value: "E176",
34886
+ enumerable: false,
34887
+ configurable: true
34888
+ });
34889
+ }
34890
+ // eslint-disable-next-line no-control-regex
34891
+ if (/[\x00-\x20]$/.test(src)) {
34892
+ throw Object.defineProperty(new Error('Image with src "' + src + '" cannot end with a space or control character. Use src.trimEnd() to remove it or encodeURIComponent(src) to keep it.'), "__NEXT_ERROR_CODE", {
34893
+ value: "E21",
34894
+ enumerable: false,
34895
+ configurable: true
34896
+ });
34817
34897
  }
34818
34898
  }
34819
34899
  }
34820
34900
  if (!VALID_LOADING_VALUES.includes(loading)) {
34821
- throw new Error('Image with src "' + src + '" has invalid "loading" property. Provided "' + loading + '" should be one of ' + VALID_LOADING_VALUES.map(String).join(",") + ".");
34901
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has invalid "loading" property. Provided "' + loading + '" should be one of ' + VALID_LOADING_VALUES.map(String).join(',') + "."), "__NEXT_ERROR_CODE", {
34902
+ value: "E357",
34903
+ enumerable: false,
34904
+ configurable: true
34905
+ });
34822
34906
  }
34823
- if (priority && loading === "lazy") {
34824
- throw new Error('Image with src "' + src + '" has both "priority" and "loading=\'lazy\'" properties. Only one should be used.');
34907
+ if (priority && loading === 'lazy') {
34908
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has both "priority" and "loading=\'lazy\'" properties. Only one should be used.'), "__NEXT_ERROR_CODE", {
34909
+ value: "E218",
34910
+ enumerable: false,
34911
+ configurable: true
34912
+ });
34825
34913
  }
34826
- if (placeholder !== "empty" && placeholder !== "blur" && !placeholder.startsWith("data:image/")) {
34827
- throw new Error('Image with src "' + src + '" has invalid "placeholder" property "' + placeholder + '".');
34914
+ if (placeholder !== 'empty' && placeholder !== 'blur' && !placeholder.startsWith('data:image/')) {
34915
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has invalid "placeholder" property "' + placeholder + '".'), "__NEXT_ERROR_CODE", {
34916
+ value: "E431",
34917
+ enumerable: false,
34918
+ configurable: true
34919
+ });
34828
34920
  }
34829
- if (placeholder !== "empty") {
34921
+ if (placeholder !== 'empty') {
34830
34922
  if (widthInt && heightInt && widthInt * heightInt < 1600) {
34831
34923
  (0, _warnonce.warnOnce)('Image with src "' + src + '" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.');
34832
34924
  }
34833
34925
  }
34834
- if (placeholder === "blur" && !blurDataURL) {
34926
+ if (qualityInt && qualityInt !== 75 && !config.qualities) {
34927
+ (0, _warnonce.warnOnce)('Image with src "' + src + '" is using quality "' + qualityInt + '" which is not configured in images.qualities. This config will be required starting in Next.js 16.' + "\nRead more: https://nextjs.org/docs/messages/next-image-unconfigured-qualities");
34928
+ }
34929
+ if (src.startsWith('/') && src.includes('?') && (!(config == null ? void 0 : (_config_localPatterns = config.localPatterns) == null ? void 0 : _config_localPatterns.length) || config.localPatterns.length === 1 && config.localPatterns[0].pathname === '/_next/static/media/**')) {
34930
+ (0, _warnonce.warnOnce)('Image with src "' + src + '" is using a query string which is not configured in images.localPatterns. This config will be required starting in Next.js 16.' + "\nRead more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns");
34931
+ }
34932
+ if (placeholder === 'blur' && !blurDataURL) {
34835
34933
  const VALID_BLUR_EXT = [
34836
- "jpeg",
34837
- "png",
34838
- "webp",
34839
- "avif"
34934
+ 'jpeg',
34935
+ 'png',
34936
+ 'webp',
34937
+ 'avif'
34840
34938
  ] // should match next-image-loader
34841
34939
  ;
34842
- throw new Error('Image with src "' + src + '" has "placeholder=\'blur\'" property but is missing the "blurDataURL" property.\n Possible solutions:\n - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image\n - Change the "src" property to a static import with one of the supported file types: ' + VALID_BLUR_EXT.join(",") + ' (animated images not supported)\n - Remove the "placeholder" property, effectively no blur effect\n Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url');
34940
+ throw Object.defineProperty(new Error('Image with src "' + src + '" has "placeholder=\'blur\'" property but is missing the "blurDataURL" property.\n Possible solutions:\n - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image\n - Change the "src" property to a static import with one of the supported file types: ' + VALID_BLUR_EXT.join(',') + ' (animated images not supported)\n - Remove the "placeholder" property, effectively no blur effect\n Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url'), "__NEXT_ERROR_CODE", {
34941
+ value: "E371",
34942
+ enumerable: false,
34943
+ configurable: true
34944
+ });
34843
34945
  }
34844
- if ("ref" in rest) {
34946
+ if ('ref' in rest) {
34845
34947
  (0, _warnonce.warnOnce)('Image with src "' + src + '" is using unsupported "ref" property. Consider using the "onLoad" property instead.');
34846
34948
  }
34847
34949
  if (!unoptimized && !isDefaultLoader) {
@@ -34873,14 +34975,14 @@ function requireGetImgProps () {
34873
34975
  (0, _warnonce.warnOnce)('Image with src "' + src + '" has legacy prop "' + legacyKey + '". Did you forget to run the codemod?' + "\nRead more: https://nextjs.org/docs/messages/next-image-upgrade-to-13");
34874
34976
  }
34875
34977
  }
34876
- if (typeof window !== "undefined" && !perfObserver && window.PerformanceObserver) {
34978
+ if (typeof window !== 'undefined' && !perfObserver && window.PerformanceObserver) {
34877
34979
  perfObserver = new PerformanceObserver((entryList)=>{
34878
34980
  for (const entry of entryList.getEntries()){
34879
34981
  var _entry_element;
34880
34982
  // @ts-ignore - missing "LargestContentfulPaint" class with "element" prop
34881
- const imgSrc = (entry == null ? void 0 : (_entry_element = entry.element) == null ? void 0 : _entry_element.src) || "";
34983
+ const imgSrc = (entry == null ? void 0 : (_entry_element = entry.element) == null ? void 0 : _entry_element.src) || '';
34882
34984
  const lcpImage = allImgs.get(imgSrc);
34883
- if (lcpImage && !lcpImage.priority && lcpImage.placeholder === "empty" && !lcpImage.src.startsWith("data:") && !lcpImage.src.startsWith("blob:")) {
34985
+ if (lcpImage && !lcpImage.priority && lcpImage.placeholder === 'empty' && !lcpImage.src.startsWith('data:') && !lcpImage.src.startsWith('blob:')) {
34884
34986
  // https://web.dev/lcp/#measure-lcp-in-javascript
34885
34987
  (0, _warnonce.warnOnce)('Image with src "' + lcpImage.src + '" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.' + "\nRead more: https://nextjs.org/docs/api-reference/next/image#priority");
34886
34988
  }
@@ -34888,7 +34990,7 @@ function requireGetImgProps () {
34888
34990
  });
34889
34991
  try {
34890
34992
  perfObserver.observe({
34891
- type: "largest-contentful-paint",
34993
+ type: 'largest-contentful-paint',
34892
34994
  buffered: true
34893
34995
  });
34894
34996
  } catch (err) {
@@ -34898,9 +35000,9 @@ function requireGetImgProps () {
34898
35000
  }
34899
35001
  }
34900
35002
  const imgStyle = Object.assign(fill ? {
34901
- position: "absolute",
34902
- height: "100%",
34903
- width: "100%",
35003
+ position: 'absolute',
35004
+ height: '100%',
35005
+ width: '100%',
34904
35006
  left: 0,
34905
35007
  top: 0,
34906
35008
  right: 0,
@@ -34908,25 +35010,27 @@ function requireGetImgProps () {
34908
35010
  objectFit,
34909
35011
  objectPosition
34910
35012
  } : {}, showAltText ? {} : {
34911
- color: "transparent"
35013
+ color: 'transparent'
34912
35014
  }, style);
34913
- const backgroundImage = !blurComplete && placeholder !== "empty" ? placeholder === "blur" ? 'url("data:image/svg+xml;charset=utf-8,' + (0, _imageblursvg.getImageBlurSvg)({
35015
+ const backgroundImage = !blurComplete && placeholder !== 'empty' ? placeholder === 'blur' ? 'url("data:image/svg+xml;charset=utf-8,' + (0, _imageblursvg.getImageBlurSvg)({
34914
35016
  widthInt,
34915
35017
  heightInt,
34916
35018
  blurWidth,
34917
35019
  blurHeight,
34918
- blurDataURL: blurDataURL || "",
35020
+ blurDataURL: blurDataURL || '',
34919
35021
  objectFit: imgStyle.objectFit
34920
35022
  }) + '")' : 'url("' + placeholder + '")' // assume `data:image/`
34921
35023
  : null;
35024
+ const backgroundSize = !INVALID_BACKGROUND_SIZE_VALUES.includes(imgStyle.objectFit) ? imgStyle.objectFit : imgStyle.objectFit === 'fill' ? '100% 100%' // the background-size equivalent of `fill`
35025
+ : 'cover';
34922
35026
  let placeholderStyle = backgroundImage ? {
34923
- backgroundSize: imgStyle.objectFit || "cover",
34924
- backgroundPosition: imgStyle.objectPosition || "50% 50%",
34925
- backgroundRepeat: "no-repeat",
35027
+ backgroundSize,
35028
+ backgroundPosition: imgStyle.objectPosition || '50% 50%',
35029
+ backgroundRepeat: 'no-repeat',
34926
35030
  backgroundImage
34927
35031
  } : {};
34928
- if (process.env.NODE_ENV === "development") {
34929
- if (placeholderStyle.backgroundImage && placeholder === "blur" && (blurDataURL == null ? void 0 : blurDataURL.startsWith("/"))) {
35032
+ if (process.env.NODE_ENV === 'development') {
35033
+ if (placeholderStyle.backgroundImage && placeholder === 'blur' && (blurDataURL == null ? void 0 : blurDataURL.startsWith('/'))) {
34930
35034
  // During `next dev`, we don't want to generate blur placeholders with webpack
34931
35035
  // because it can delay starting the dev server. Instead, `next-image-loader.js`
34932
35036
  // will inline a special url to lazily generate the blur placeholder at request time.
@@ -34942,8 +35046,8 @@ function requireGetImgProps () {
34942
35046
  sizes,
34943
35047
  loader
34944
35048
  });
34945
- if (process.env.NODE_ENV !== "production") {
34946
- if (typeof window !== "undefined") {
35049
+ if (process.env.NODE_ENV !== 'production') {
35050
+ if (typeof window !== 'undefined') {
34947
35051
  let fullUrl;
34948
35052
  try {
34949
35053
  fullUrl = new URL(imgAttributes.src);
@@ -34959,7 +35063,7 @@ function requireGetImgProps () {
34959
35063
  }
34960
35064
  const props = {
34961
35065
  ...rest,
34962
- loading: isLazy ? "lazy" : loading,
35066
+ loading: isLazy ? 'lazy' : loading,
34963
35067
  fetchPriority,
34964
35068
  width: widthInt,
34965
35069
  height: heightInt,
@@ -35010,7 +35114,6 @@ function require_interop_require_wildcard () {
35010
35114
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
35011
35115
  })(nodeInterop);
35012
35116
  }
35013
- _interop_require_wildcard._ = _interop_require_wildcard._interop_require_wildcard = _interop_require_wildcard$1;
35014
35117
  function _interop_require_wildcard$1(obj, nodeInterop) {
35015
35118
  if (!nodeInterop && obj && obj.__esModule) return obj;
35016
35119
  if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
@@ -35036,6 +35139,7 @@ function require_interop_require_wildcard () {
35036
35139
 
35037
35140
  return newObj;
35038
35141
  }
35142
+ _interop_require_wildcard._ = _interop_require_wildcard$1;
35039
35143
  return _interop_require_wildcard;
35040
35144
  }
35041
35145
 
@@ -35059,7 +35163,7 @@ function requireSideEffect () {
35059
35163
  }
35060
35164
  });
35061
35165
  const _react = o;
35062
- const isServer = typeof window === "undefined";
35166
+ const isServer = typeof window === 'undefined';
35063
35167
  const useClientOnlyLayoutEffect = isServer ? ()=>{} : _react.useLayoutEffect;
35064
35168
  const useClientOnlyEffect = isServer ? ()=>{} : _react.useEffect;
35065
35169
  function SideEffect(props) {
@@ -35138,8 +35242,8 @@ function requireAmpContext_sharedRuntime () {
35138
35242
  const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
35139
35243
  const _react = /*#__PURE__*/ _interop_require_default._(o);
35140
35244
  const AmpStateContext = _react.default.createContext({});
35141
- if (process.env.NODE_ENV !== "production") {
35142
- AmpStateContext.displayName = "AmpStateContext";
35245
+ if (process.env.NODE_ENV !== 'production') {
35246
+ AmpStateContext.displayName = 'AmpStateContext';
35143
35247
  }
35144
35248
 
35145
35249
 
@@ -35167,8 +35271,8 @@ function requireHeadManagerContext_sharedRuntime () {
35167
35271
  const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
35168
35272
  const _react = /*#__PURE__*/ _interop_require_default._(o);
35169
35273
  const HeadManagerContext = _react.default.createContext({});
35170
- if (process.env.NODE_ENV !== "production") {
35171
- HeadManagerContext.displayName = "HeadManagerContext";
35274
+ if (process.env.NODE_ENV !== 'production') {
35275
+ HeadManagerContext.displayName = 'HeadManagerContext';
35172
35276
  }
35173
35277
 
35174
35278
 
@@ -35209,7 +35313,7 @@ function requireHead () {
35209
35313
  if (hasRequiredHead) return head.exports;
35210
35314
  hasRequiredHead = 1;
35211
35315
  (function (module, exports$1) {
35212
- "use client";
35316
+ 'use client';
35213
35317
  Object.defineProperty(exports$1, "__esModule", {
35214
35318
  value: true
35215
35319
  });
@@ -35241,19 +35345,19 @@ function requireHead () {
35241
35345
  const head = [
35242
35346
  /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
35243
35347
  charSet: "utf-8"
35244
- })
35348
+ }, "charset")
35245
35349
  ];
35246
35350
  if (!inAmpMode) {
35247
35351
  head.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
35248
35352
  name: "viewport",
35249
35353
  content: "width=device-width"
35250
- }));
35354
+ }, "viewport"));
35251
35355
  }
35252
35356
  return head;
35253
35357
  }
35254
35358
  function onlyReactElement(list, child) {
35255
35359
  // React children can be "string" or "number" in this case we ignore them for backwards compat
35256
- if (typeof child === "string" || typeof child === "number") {
35360
+ if (typeof child === 'string' || typeof child === 'number') {
35257
35361
  return list;
35258
35362
  }
35259
35363
  // Adds support for React.Fragment
@@ -35261,7 +35365,7 @@ function requireHead () {
35261
35365
  return list.concat(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
35262
35366
  _react.default.Children.toArray(child.props.children).reduce(// @ts-expect-error @types/react does not remove fragments but this could also return ReactPortal[]
35263
35367
  (fragmentList, fragmentChild)=>{
35264
- if (typeof fragmentChild === "string" || typeof fragmentChild === "number") {
35368
+ if (typeof fragmentChild === 'string' || typeof fragmentChild === 'number') {
35265
35369
  return fragmentList;
35266
35370
  }
35267
35371
  return fragmentList.concat(fragmentChild);
@@ -35270,10 +35374,10 @@ function requireHead () {
35270
35374
  return list.concat(child);
35271
35375
  }
35272
35376
  const METATYPES = [
35273
- "name",
35274
- "httpEquiv",
35275
- "charSet",
35276
- "itemProp"
35377
+ 'name',
35378
+ 'httpEquiv',
35379
+ 'charSet',
35380
+ 'itemProp'
35277
35381
  ];
35278
35382
  /*
35279
35383
  returns a function for filtering head child elements
@@ -35287,9 +35391,9 @@ function requireHead () {
35287
35391
  return (h)=>{
35288
35392
  let isUnique = true;
35289
35393
  let hasKey = false;
35290
- if (h.key && typeof h.key !== "number" && h.key.indexOf("$") > 0) {
35394
+ if (h.key && typeof h.key !== 'number' && h.key.indexOf('$') > 0) {
35291
35395
  hasKey = true;
35292
- const key = h.key.slice(h.key.indexOf("$") + 1);
35396
+ const key = h.key.slice(h.key.indexOf('$') + 1);
35293
35397
  if (keys.has(key)) {
35294
35398
  isUnique = false;
35295
35399
  } else {
@@ -35298,19 +35402,19 @@ function requireHead () {
35298
35402
  }
35299
35403
  // eslint-disable-next-line default-case
35300
35404
  switch(h.type){
35301
- case "title":
35302
- case "base":
35405
+ case 'title':
35406
+ case 'base':
35303
35407
  if (tags.has(h.type)) {
35304
35408
  isUnique = false;
35305
35409
  } else {
35306
35410
  tags.add(h.type);
35307
35411
  }
35308
35412
  break;
35309
- case "meta":
35413
+ case 'meta':
35310
35414
  for(let i = 0, len = METATYPES.length; i < len; i++){
35311
35415
  const metatype = METATYPES[i];
35312
35416
  if (!h.props.hasOwnProperty(metatype)) continue;
35313
- if (metatype === "charSet") {
35417
+ if (metatype === 'charSet') {
35314
35418
  if (metaTypes.has(metatype)) {
35315
35419
  isUnique = false;
35316
35420
  } else {
@@ -35319,7 +35423,7 @@ function requireHead () {
35319
35423
  } else {
35320
35424
  const category = h.props[metatype];
35321
35425
  const categories = metaCategories[metatype] || new Set();
35322
- if ((metatype !== "name" || !hasKey) && categories.has(category)) {
35426
+ if ((metatype !== 'name' || !hasKey) && categories.has(category)) {
35323
35427
  isUnique = false;
35324
35428
  } else {
35325
35429
  categories.add(category);
@@ -35339,29 +35443,13 @@ function requireHead () {
35339
35443
  const { inAmpMode } = props;
35340
35444
  return headChildrenElements.reduce(onlyReactElement, []).reverse().concat(defaultHead(inAmpMode).reverse()).filter(unique()).reverse().map((c, i)=>{
35341
35445
  const key = c.key || i;
35342
- if (process.env.NODE_ENV !== "development" && process.env.__NEXT_OPTIMIZE_FONTS && !inAmpMode) {
35343
- if (c.type === "link" && c.props["href"] && // TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.
35344
- [
35345
- "https://fonts.googleapis.com/css",
35346
- "https://use.typekit.net/"
35347
- ].some((url)=>c.props["href"].startsWith(url))) {
35348
- const newProps = {
35349
- ...c.props || {}
35350
- };
35351
- newProps["data-href"] = newProps["href"];
35352
- newProps["href"] = undefined;
35353
- // Add this attribute to make it easy to identify optimized tags
35354
- newProps["data-optimized-fonts"] = true;
35355
- return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
35356
- }
35357
- }
35358
- if (process.env.NODE_ENV === "development") {
35446
+ if (process.env.NODE_ENV === 'development') {
35359
35447
  // omit JSON-LD structured data snippets from the warning
35360
- if (c.type === "script" && c.props["type"] !== "application/ld+json") {
35361
- const srcMessage = c.props["src"] ? '<script> tag with src="' + c.props["src"] + '"' : "inline <script>";
35448
+ if (c.type === 'script' && c.props['type'] !== 'application/ld+json') {
35449
+ const srcMessage = c.props['src'] ? '<script> tag with src="' + c.props['src'] + '"' : "inline <script>";
35362
35450
  (0, _warnonce.warnOnce)("Do not add <script> tags using next/head (see " + srcMessage + "). Use next/script instead. \nSee more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component");
35363
- } else if (c.type === "link" && c.props["rel"] === "stylesheet") {
35364
- (0, _warnonce.warnOnce)('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="' + c.props["href"] + '"). Use Document instead. \nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component');
35451
+ } else if (c.type === 'link' && c.props['rel'] === 'stylesheet') {
35452
+ (0, _warnonce.warnOnce)('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="' + c.props['href'] + '"). Use Document instead. \nSee more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component');
35365
35453
  }
35366
35454
  }
35367
35455
  return /*#__PURE__*/ _react.default.cloneElement(c, {
@@ -35417,8 +35505,8 @@ function requireImageConfigContext_sharedRuntime () {
35417
35505
  const _react = /*#__PURE__*/ _interop_require_default._(o);
35418
35506
  const _imageconfig = requireImageConfig();
35419
35507
  const ImageConfigContext = _react.default.createContext(_imageconfig.imageConfigDefault);
35420
- if (process.env.NODE_ENV !== "production") {
35421
- ImageConfigContext.displayName = "ImageConfigContext";
35508
+ if (process.env.NODE_ENV !== 'production') {
35509
+ ImageConfigContext.displayName = 'ImageConfigContext';
35422
35510
  }
35423
35511
 
35424
35512
 
@@ -35446,8 +35534,8 @@ function requireRouterContext_sharedRuntime () {
35446
35534
  const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
35447
35535
  const _react = /*#__PURE__*/ _interop_require_default._(o);
35448
35536
  const RouterContext = _react.default.createContext(null);
35449
- if (process.env.NODE_ENV !== "production") {
35450
- RouterContext.displayName = "RouterContext";
35537
+ if (process.env.NODE_ENV !== 'production') {
35538
+ RouterContext.displayName = 'RouterContext';
35451
35539
  }
35452
35540
 
35453
35541
 
@@ -35501,7 +35589,7 @@ function requireMatchLocalPattern () {
35501
35589
  }
35502
35590
  }
35503
35591
  var _pattern_pathname;
35504
- if (!(0, _picomatch.makeRe)((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : "**", {
35592
+ if (!(0, _picomatch.makeRe)((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : '**', {
35505
35593
  dot: true
35506
35594
  }).test(url.pathname)) {
35507
35595
  return false;
@@ -35513,7 +35601,7 @@ function requireMatchLocalPattern () {
35513
35601
  // if the user didn't define "localPatterns", we allow all local images
35514
35602
  return true;
35515
35603
  }
35516
- const url = new URL(urlPathAndQuery, "http://n");
35604
+ const url = new URL(urlPathAndQuery, 'http://n');
35517
35605
  return localPatterns.some((p)=>matchLocalPattern(p, url));
35518
35606
  }
35519
35607
 
@@ -35550,8 +35638,7 @@ function requireMatchRemotePattern () {
35550
35638
  const _picomatch = requirePicomatch();
35551
35639
  function matchRemotePattern(pattern, url) {
35552
35640
  if (pattern.protocol !== undefined) {
35553
- const actualProto = url.protocol.slice(0, -1);
35554
- if (pattern.protocol !== actualProto) {
35641
+ if (pattern.protocol.replace(/:$/, '') !== url.protocol.replace(/:$/, '')) {
35555
35642
  return false;
35556
35643
  }
35557
35644
  }
@@ -35561,7 +35648,11 @@ function requireMatchRemotePattern () {
35561
35648
  }
35562
35649
  }
35563
35650
  if (pattern.hostname === undefined) {
35564
- throw new Error("Pattern should define hostname but found\n" + JSON.stringify(pattern));
35651
+ throw Object.defineProperty(new Error("Pattern should define hostname but found\n" + JSON.stringify(pattern)), "__NEXT_ERROR_CODE", {
35652
+ value: "E410",
35653
+ enumerable: false,
35654
+ configurable: true
35655
+ });
35565
35656
  } else {
35566
35657
  if (!(0, _picomatch.makeRe)(pattern.hostname).test(url.hostname)) {
35567
35658
  return false;
@@ -35574,7 +35665,7 @@ function requireMatchRemotePattern () {
35574
35665
  }
35575
35666
  var _pattern_pathname;
35576
35667
  // Should be the same as writeImagesManifest()
35577
- if (!(0, _picomatch.makeRe)((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : "**", {
35668
+ if (!(0, _picomatch.makeRe)((_pattern_pathname = pattern.pathname) != null ? _pattern_pathname : '**', {
35578
35669
  dot: true
35579
35670
  }).test(url.pathname)) {
35580
35671
  return false;
@@ -35609,54 +35700,78 @@ function requireImageLoader () {
35609
35700
  function defaultLoader(param) {
35610
35701
  let { config, src, width, quality } = param;
35611
35702
  var _config_qualities;
35612
- if (process.env.NODE_ENV !== "production") {
35703
+ if (process.env.NODE_ENV !== 'production') {
35613
35704
  const missingValues = [];
35614
35705
  // these should always be provided but make sure they are
35615
- if (!src) missingValues.push("src");
35616
- if (!width) missingValues.push("width");
35706
+ if (!src) missingValues.push('src');
35707
+ if (!width) missingValues.push('width');
35617
35708
  if (missingValues.length > 0) {
35618
- throw new Error("Next Image Optimization requires " + missingValues.join(", ") + " to be provided. Make sure you pass them as props to the `next/image` component. Received: " + JSON.stringify({
35709
+ throw Object.defineProperty(new Error("Next Image Optimization requires " + missingValues.join(', ') + " to be provided. Make sure you pass them as props to the `next/image` component. Received: " + JSON.stringify({
35619
35710
  src,
35620
35711
  width,
35621
35712
  quality
35622
- }));
35713
+ })), "__NEXT_ERROR_CODE", {
35714
+ value: "E188",
35715
+ enumerable: false,
35716
+ configurable: true
35717
+ });
35623
35718
  }
35624
- if (src.startsWith("//")) {
35625
- throw new Error('Failed to parse src "' + src + '" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)');
35719
+ if (src.startsWith('//')) {
35720
+ throw Object.defineProperty(new Error('Failed to parse src "' + src + '" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)'), "__NEXT_ERROR_CODE", {
35721
+ value: "E360",
35722
+ enumerable: false,
35723
+ configurable: true
35724
+ });
35626
35725
  }
35627
- if (src.startsWith("/") && config.localPatterns) {
35628
- if (process.env.NODE_ENV !== "test" && // micromatch isn't compatible with edge runtime
35629
- process.env.NEXT_RUNTIME !== "edge") {
35726
+ if (src.startsWith('/') && config.localPatterns) {
35727
+ if (process.env.NODE_ENV !== 'test' && // micromatch isn't compatible with edge runtime
35728
+ process.env.NEXT_RUNTIME !== 'edge') {
35630
35729
  // We use dynamic require because this should only error in development
35631
35730
  const { hasLocalMatch } = requireMatchLocalPattern();
35632
35731
  if (!hasLocalMatch(config.localPatterns, src)) {
35633
- throw new Error("Invalid src prop (" + src + ") on `next/image` does not match `images.localPatterns` configured in your `next.config.js`\n" + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns");
35732
+ throw Object.defineProperty(new Error("Invalid src prop (" + src + ") on `next/image` does not match `images.localPatterns` configured in your `next.config.js`\n" + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns"), "__NEXT_ERROR_CODE", {
35733
+ value: "E426",
35734
+ enumerable: false,
35735
+ configurable: true
35736
+ });
35634
35737
  }
35635
35738
  }
35636
35739
  }
35637
- if (!src.startsWith("/") && (config.domains || config.remotePatterns)) {
35740
+ if (!src.startsWith('/') && (config.domains || config.remotePatterns)) {
35638
35741
  let parsedSrc;
35639
35742
  try {
35640
35743
  parsedSrc = new URL(src);
35641
35744
  } catch (err) {
35642
35745
  console.error(err);
35643
- throw new Error('Failed to parse src "' + src + '" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)');
35746
+ throw Object.defineProperty(new Error('Failed to parse src "' + src + '" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)'), "__NEXT_ERROR_CODE", {
35747
+ value: "E63",
35748
+ enumerable: false,
35749
+ configurable: true
35750
+ });
35644
35751
  }
35645
- if (process.env.NODE_ENV !== "test" && // micromatch isn't compatible with edge runtime
35646
- process.env.NEXT_RUNTIME !== "edge") {
35752
+ if (process.env.NODE_ENV !== 'test' && // micromatch isn't compatible with edge runtime
35753
+ process.env.NEXT_RUNTIME !== 'edge') {
35647
35754
  // We use dynamic require because this should only error in development
35648
35755
  const { hasRemoteMatch } = requireMatchRemotePattern();
35649
35756
  if (!hasRemoteMatch(config.domains, config.remotePatterns, parsedSrc)) {
35650
- throw new Error("Invalid src prop (" + src + ') on `next/image`, hostname "' + parsedSrc.hostname + '" is not configured under images in your `next.config.js`\n' + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host");
35757
+ throw Object.defineProperty(new Error("Invalid src prop (" + src + ') on `next/image`, hostname "' + parsedSrc.hostname + '" is not configured under images in your `next.config.js`\n' + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host"), "__NEXT_ERROR_CODE", {
35758
+ value: "E231",
35759
+ enumerable: false,
35760
+ configurable: true
35761
+ });
35651
35762
  }
35652
35763
  }
35653
35764
  }
35654
35765
  if (quality && config.qualities && !config.qualities.includes(quality)) {
35655
- throw new Error("Invalid quality prop (" + quality + ") on `next/image` does not match `images.qualities` configured in your `next.config.js`\n" + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-qualities");
35766
+ throw Object.defineProperty(new Error("Invalid quality prop (" + quality + ") on `next/image` does not match `images.qualities` configured in your `next.config.js`\n" + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-qualities"), "__NEXT_ERROR_CODE", {
35767
+ value: "E623",
35768
+ enumerable: false,
35769
+ configurable: true
35770
+ });
35656
35771
  }
35657
35772
  }
35658
35773
  const q = quality || ((_config_qualities = config.qualities) == null ? void 0 : _config_qualities.reduce((prev, cur)=>Math.abs(cur - DEFAULT_Q) < Math.abs(prev - DEFAULT_Q) ? cur : prev)) || DEFAULT_Q;
35659
- return config.path + "?url=" + encodeURIComponent(src) + "&w=" + width + "&q=" + q + (process.env.NEXT_DEPLOYMENT_ID ? "&dpl=" + process.env.NEXT_DEPLOYMENT_ID : "");
35774
+ return config.path + "?url=" + encodeURIComponent(src) + "&w=" + width + "&q=" + q + (src.startsWith('/_next/static/media/') && process.env.NEXT_DEPLOYMENT_ID ? "&dpl=" + process.env.NEXT_DEPLOYMENT_ID : '');
35660
35775
  }
35661
35776
  // We use this to determine if the import is the default loader
35662
35777
  // or a custom loader defined by the user in next.config.js
@@ -35668,13 +35783,93 @@ function requireImageLoader () {
35668
35783
  return imageLoader;
35669
35784
  }
35670
35785
 
35786
+ var useMergedRef = {exports: {}};
35787
+
35788
+ var hasRequiredUseMergedRef;
35789
+
35790
+ function requireUseMergedRef () {
35791
+ if (hasRequiredUseMergedRef) return useMergedRef.exports;
35792
+ hasRequiredUseMergedRef = 1;
35793
+ (function (module, exports$1) {
35794
+ Object.defineProperty(exports$1, "__esModule", {
35795
+ value: true
35796
+ });
35797
+ Object.defineProperty(exports$1, "useMergedRef", {
35798
+ enumerable: true,
35799
+ get: function() {
35800
+ return useMergedRef;
35801
+ }
35802
+ });
35803
+ const _react = o;
35804
+ function useMergedRef(refA, refB) {
35805
+ const cleanupA = (0, _react.useRef)(null);
35806
+ const cleanupB = (0, _react.useRef)(null);
35807
+ // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
35808
+ // (this happens often if the user doesn't pass a ref to Link/Form/Image)
35809
+ // But this can cause us to leak a cleanup-ref into user code (e.g. via `<Link legacyBehavior>`),
35810
+ // and the user might pass that ref into ref-merging library that doesn't support cleanup refs
35811
+ // (because it hasn't been updated for React 19)
35812
+ // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
35813
+ // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
35814
+ return (0, _react.useCallback)((current)=>{
35815
+ if (current === null) {
35816
+ const cleanupFnA = cleanupA.current;
35817
+ if (cleanupFnA) {
35818
+ cleanupA.current = null;
35819
+ cleanupFnA();
35820
+ }
35821
+ const cleanupFnB = cleanupB.current;
35822
+ if (cleanupFnB) {
35823
+ cleanupB.current = null;
35824
+ cleanupFnB();
35825
+ }
35826
+ } else {
35827
+ if (refA) {
35828
+ cleanupA.current = applyRef(refA, current);
35829
+ }
35830
+ if (refB) {
35831
+ cleanupB.current = applyRef(refB, current);
35832
+ }
35833
+ }
35834
+ }, [
35835
+ refA,
35836
+ refB
35837
+ ]);
35838
+ }
35839
+ function applyRef(refA, current) {
35840
+ if (typeof refA === 'function') {
35841
+ const cleanup = refA(current);
35842
+ if (typeof cleanup === 'function') {
35843
+ return cleanup;
35844
+ } else {
35845
+ return ()=>refA(null);
35846
+ }
35847
+ } else {
35848
+ refA.current = current;
35849
+ return ()=>{
35850
+ refA.current = null;
35851
+ };
35852
+ }
35853
+ }
35854
+
35855
+ if ((typeof exports$1.default === 'function' || (typeof exports$1.default === 'object' && exports$1.default !== null)) && typeof exports$1.default.__esModule === 'undefined') {
35856
+ Object.defineProperty(exports$1.default, '__esModule', { value: true });
35857
+ Object.assign(exports$1.default, exports$1);
35858
+ module.exports = exports$1.default;
35859
+ }
35860
+
35861
+
35862
+ } (useMergedRef, useMergedRef.exports));
35863
+ return useMergedRef.exports;
35864
+ }
35865
+
35671
35866
  var hasRequiredImageComponent;
35672
35867
 
35673
35868
  function requireImageComponent () {
35674
35869
  if (hasRequiredImageComponent) return imageComponent.exports;
35675
35870
  hasRequiredImageComponent = 1;
35676
35871
  (function (module, exports$1) {
35677
- "use client";
35872
+ 'use client';
35678
35873
  Object.defineProperty(exports$1, "__esModule", {
35679
35874
  value: true
35680
35875
  });
@@ -35696,20 +35891,21 @@ function requireImageComponent () {
35696
35891
  const _warnonce = requireWarnOnce();
35697
35892
  const _routercontextsharedruntime = requireRouterContext_sharedRuntime();
35698
35893
  const _imageloader = /*#__PURE__*/ _interop_require_default._(requireImageLoader());
35894
+ const _usemergedref = requireUseMergedRef();
35699
35895
  // This is replaced by webpack define plugin
35700
35896
  const configEnv = process.env.__NEXT_IMAGE_OPTS;
35701
- if (typeof window === "undefined") {
35897
+ if (typeof window === 'undefined') {
35702
35898
  globalThis.__NEXT_IMAGE_IMPORTED = true;
35703
35899
  }
35704
35900
  // See https://stackoverflow.com/q/39777833/266535 for why we use this ref
35705
35901
  // handler instead of the img's onLoad attribute.
35706
35902
  function handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput) {
35707
35903
  const src = img == null ? void 0 : img.src;
35708
- if (!img || img["data-loaded-src"] === src) {
35904
+ if (!img || img['data-loaded-src'] === src) {
35709
35905
  return;
35710
35906
  }
35711
- img["data-loaded-src"] = src;
35712
- const p = "decode" in img ? img.decode() : Promise.resolve();
35907
+ img['data-loaded-src'] = src;
35908
+ const p = 'decode' in img ? img.decode() : Promise.resolve();
35713
35909
  p.catch(()=>{}).then(()=>{
35714
35910
  if (!img.parentElement || !img.isConnected) {
35715
35911
  // Exit early in case of race condition:
@@ -35719,15 +35915,15 @@ function requireImageComponent () {
35719
35915
  // - decode() completes
35720
35916
  return;
35721
35917
  }
35722
- if (placeholder !== "empty") {
35918
+ if (placeholder !== 'empty') {
35723
35919
  setBlurComplete(true);
35724
35920
  }
35725
35921
  if (onLoadRef == null ? void 0 : onLoadRef.current) {
35726
35922
  // Since we don't have the SyntheticEvent here,
35727
35923
  // we must create one with the same shape.
35728
35924
  // See https://reactjs.org/docs/events.html
35729
- const event = new Event("load");
35730
- Object.defineProperty(event, "target", {
35925
+ const event = new Event('load');
35926
+ Object.defineProperty(event, 'target', {
35731
35927
  writable: false,
35732
35928
  value: img
35733
35929
  });
@@ -35754,13 +35950,13 @@ function requireImageComponent () {
35754
35950
  if (onLoadingCompleteRef == null ? void 0 : onLoadingCompleteRef.current) {
35755
35951
  onLoadingCompleteRef.current(img);
35756
35952
  }
35757
- if (process.env.NODE_ENV !== "production") {
35758
- const origSrc = new URL(src, "http://n").searchParams.get("url") || src;
35759
- if (img.getAttribute("data-nimg") === "fill") {
35760
- if (!unoptimized && (!sizesInput || sizesInput === "100vw")) {
35953
+ if (process.env.NODE_ENV !== 'production') {
35954
+ const origSrc = new URL(src, 'http://n').searchParams.get('url') || src;
35955
+ if (img.getAttribute('data-nimg') === 'fill') {
35956
+ if (!unoptimized && (!sizesInput || sizesInput === '100vw')) {
35761
35957
  let widthViewportRatio = img.getBoundingClientRect().width / window.innerWidth;
35762
35958
  if (widthViewportRatio < 0.6) {
35763
- if (sizesInput === "100vw") {
35959
+ if (sizesInput === '100vw') {
35764
35960
  (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes');
35765
35961
  } else {
35766
35962
  (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes');
@@ -35770,20 +35966,20 @@ function requireImageComponent () {
35770
35966
  if (img.parentElement) {
35771
35967
  const { position } = window.getComputedStyle(img.parentElement);
35772
35968
  const valid = [
35773
- "absolute",
35774
- "fixed",
35775
- "relative"
35969
+ 'absolute',
35970
+ 'fixed',
35971
+ 'relative'
35776
35972
  ];
35777
35973
  if (!valid.includes(position)) {
35778
- (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" and parent element with invalid "position". Provided "' + position + '" should be one of ' + valid.map(String).join(",") + ".");
35974
+ (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" and parent element with invalid "position". Provided "' + position + '" should be one of ' + valid.map(String).join(',') + ".");
35779
35975
  }
35780
35976
  }
35781
35977
  if (img.height === 0) {
35782
35978
  (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.');
35783
35979
  }
35784
35980
  }
35785
- const heightModified = img.height.toString() !== img.getAttribute("height");
35786
- const widthModified = img.width.toString() !== img.getAttribute("width");
35981
+ const heightModified = img.height.toString() !== img.getAttribute('height');
35982
+ const widthModified = img.width.toString() !== img.getAttribute('width');
35787
35983
  if (heightModified && !widthModified || !heightModified && widthModified) {
35788
35984
  (0, _warnonce.warnOnce)('Image with src "' + origSrc + '" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles \'width: "auto"\' or \'height: "auto"\' to maintain the aspect ratio.');
35789
35985
  }
@@ -35807,6 +36003,39 @@ function requireImageComponent () {
35807
36003
  }
35808
36004
  const ImageElement = /*#__PURE__*/ (0, _react.forwardRef)((param, forwardedRef)=>{
35809
36005
  let { src, srcSet, sizes, height, width, decoding, className, style, fetchPriority, placeholder, loading, unoptimized, fill, onLoadRef, onLoadingCompleteRef, setBlurComplete, setShowAltText, sizesInput, onLoad, onError, ...rest } = param;
36006
+ const ownRef = (0, _react.useCallback)((img)=>{
36007
+ if (!img) {
36008
+ return;
36009
+ }
36010
+ if (onError) {
36011
+ // If the image has an error before react hydrates, then the error is lost.
36012
+ // The workaround is to wait until the image is mounted which is after hydration,
36013
+ // then we set the src again to trigger the error handler (if there was an error).
36014
+ // eslint-disable-next-line no-self-assign
36015
+ img.src = img.src;
36016
+ }
36017
+ if (process.env.NODE_ENV !== 'production') {
36018
+ if (!src) {
36019
+ console.error('Image is missing required "src" property:', img);
36020
+ }
36021
+ if (img.getAttribute('alt') === null) {
36022
+ console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.');
36023
+ }
36024
+ }
36025
+ if (img.complete) {
36026
+ handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput);
36027
+ }
36028
+ }, [
36029
+ src,
36030
+ placeholder,
36031
+ onLoadRef,
36032
+ onLoadingCompleteRef,
36033
+ setBlurComplete,
36034
+ onError,
36035
+ unoptimized,
36036
+ sizesInput
36037
+ ]);
36038
+ const ref = (0, _usemergedref.useMergedRef)(forwardedRef, ownRef);
35810
36039
  return /*#__PURE__*/ (0, _jsxruntime.jsx)("img", {
35811
36040
  ...rest,
35812
36041
  ...getDynamicProps(fetchPriority),
@@ -35817,7 +36046,7 @@ function requireImageComponent () {
35817
36046
  width: width,
35818
36047
  height: height,
35819
36048
  decoding: decoding,
35820
- "data-nimg": fill ? "fill" : "1",
36049
+ "data-nimg": fill ? 'fill' : '1',
35821
36050
  className: className,
35822
36051
  style: style,
35823
36052
  // It's intended to keep `src` the last attribute because React updates
@@ -35829,46 +36058,7 @@ function requireImageComponent () {
35829
36058
  sizes: sizes,
35830
36059
  srcSet: srcSet,
35831
36060
  src: src,
35832
- ref: (0, _react.useCallback)((img)=>{
35833
- if (forwardedRef) {
35834
- if (typeof forwardedRef === "function") forwardedRef(img);
35835
- else if (typeof forwardedRef === "object") {
35836
- // @ts-ignore - .current is read only it's usually assigned by react internally
35837
- forwardedRef.current = img;
35838
- }
35839
- }
35840
- if (!img) {
35841
- return;
35842
- }
35843
- if (onError) {
35844
- // If the image has an error before react hydrates, then the error is lost.
35845
- // The workaround is to wait until the image is mounted which is after hydration,
35846
- // then we set the src again to trigger the error handler (if there was an error).
35847
- // eslint-disable-next-line no-self-assign
35848
- img.src = img.src;
35849
- }
35850
- if (process.env.NODE_ENV !== "production") {
35851
- if (!src) {
35852
- console.error('Image is missing required "src" property:', img);
35853
- }
35854
- if (img.getAttribute("alt") === null) {
35855
- console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.');
35856
- }
35857
- }
35858
- if (img.complete) {
35859
- handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput);
35860
- }
35861
- }, [
35862
- src,
35863
- placeholder,
35864
- onLoadRef,
35865
- onLoadingCompleteRef,
35866
- setBlurComplete,
35867
- onError,
35868
- unoptimized,
35869
- sizesInput,
35870
- forwardedRef
35871
- ]),
36061
+ ref: ref,
35872
36062
  onLoad: (event)=>{
35873
36063
  const img = event.currentTarget;
35874
36064
  handleLoading(img, placeholder, onLoadRef, onLoadingCompleteRef, setBlurComplete, unoptimized, sizesInput);
@@ -35876,7 +36066,7 @@ function requireImageComponent () {
35876
36066
  onError: (event)=>{
35877
36067
  // if the real image fails to load, this will ensure "alt" is visible
35878
36068
  setShowAltText(true);
35879
- if (placeholder !== "empty") {
36069
+ if (placeholder !== 'empty') {
35880
36070
  // If the real image fails to load, this will still remove the placeholder.
35881
36071
  setBlurComplete(true);
35882
36072
  }
@@ -35889,7 +36079,7 @@ function requireImageComponent () {
35889
36079
  function ImagePreload(param) {
35890
36080
  let { isAppRouter, imgAttributes } = param;
35891
36081
  const opts = {
35892
- as: "image",
36082
+ as: 'image',
35893
36083
  imageSrcSet: imgAttributes.srcSet,
35894
36084
  imageSizes: imgAttributes.sizes,
35895
36085
  crossOrigin: imgAttributes.crossOrigin,
@@ -35897,9 +36087,7 @@ function requireImageComponent () {
35897
36087
  ...getDynamicProps(imgAttributes.fetchPriority)
35898
36088
  };
35899
36089
  if (isAppRouter && _reactdom.default.preload) {
35900
- // See https://github.com/facebook/react/pull/26940
35901
- _reactdom.default.preload(imgAttributes.src, // @ts-expect-error TODO: upgrade to `@types/react-dom@18.3.x`
35902
- opts);
36090
+ _reactdom.default.preload(imgAttributes.src, opts);
35903
36091
  return null;
35904
36092
  }
35905
36093
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_head.default, {
@@ -35912,7 +36100,7 @@ function requireImageComponent () {
35912
36100
  // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-imagesrcset
35913
36101
  href: imgAttributes.srcSet ? undefined : imgAttributes.src,
35914
36102
  ...opts
35915
- }, "__nimg-" + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes)
36103
+ }, '__nimg-' + imgAttributes.src + imgAttributes.srcSet + imgAttributes.sizes)
35916
36104
  });
35917
36105
  }
35918
36106
  const Image = /*#__PURE__*/ (0, _react.forwardRef)((props, forwardedRef)=>{