@instockng/storefront-ui 1.0.67 → 1.0.68

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.
Files changed (270) hide show
  1. package/dist/components/ProductAddOns.d.ts.map +1 -1
  2. package/dist/index10.mjs +36 -40
  3. package/dist/index100.mjs +41 -52
  4. package/dist/index101.mjs +2 -6
  5. package/dist/index102.mjs +2 -5
  6. package/dist/index103.mjs +25 -176
  7. package/dist/index104.mjs +17 -52
  8. package/dist/index105.mjs +215 -69
  9. package/dist/index106.mjs +180 -2
  10. package/dist/index107.mjs +22 -34
  11. package/dist/index108.mjs +22 -42
  12. package/dist/index109.mjs +33 -2
  13. package/dist/index110.mjs +155 -22
  14. package/dist/index111.mjs +11 -9
  15. package/dist/index112.mjs +23 -207
  16. package/dist/index113.mjs +74 -171
  17. package/dist/index114.mjs +31 -15
  18. package/dist/index115.mjs +139 -17
  19. package/dist/index116.mjs +50 -28
  20. package/dist/index117.mjs +19 -152
  21. package/dist/index118.mjs +20 -13
  22. package/dist/index119.mjs +17 -25
  23. package/dist/index120.mjs +17 -76
  24. package/dist/index121.mjs +14 -31
  25. package/dist/index122.mjs +17 -140
  26. package/dist/index123.mjs +16 -51
  27. package/dist/index124.mjs +59 -17
  28. package/dist/index125.mjs +11 -20
  29. package/dist/index126.mjs +33 -17
  30. package/dist/index127.mjs +17 -18
  31. package/dist/index128.mjs +26 -13
  32. package/dist/index129.mjs +18 -13
  33. package/dist/index13.mjs +1 -1
  34. package/dist/index130.mjs +12 -14
  35. package/dist/index131.mjs +13 -57
  36. package/dist/index132.mjs +40 -11
  37. package/dist/index133.mjs +15 -31
  38. package/dist/index134.mjs +263 -19
  39. package/dist/index135.mjs +61 -25
  40. package/dist/index136.mjs +7 -26
  41. package/dist/index137.mjs +2 -19
  42. package/dist/index138.mjs +2 -21
  43. package/dist/index139.mjs +28 -42
  44. package/dist/index140.mjs +2 -23
  45. package/dist/index141.mjs +20 -267
  46. package/dist/index142.mjs +54 -68
  47. package/dist/index143.mjs +28 -7
  48. package/dist/index144.mjs +7 -2
  49. package/dist/index145.mjs +52 -2
  50. package/dist/index146.mjs +6 -2
  51. package/dist/index147.mjs +11 -32
  52. package/dist/index148.mjs +7 -2
  53. package/dist/index149.mjs +30 -19
  54. package/dist/index15.mjs +4 -4
  55. package/dist/index150.mjs +4 -16
  56. package/dist/index151.mjs +70 -62
  57. package/dist/index152.mjs +167 -2
  58. package/dist/index156.mjs +13 -129
  59. package/dist/index157.mjs +26 -16
  60. package/dist/index158.mjs +32 -32
  61. package/dist/index159.mjs +18 -2
  62. package/dist/index16.mjs +2 -2
  63. package/dist/index160.mjs +13 -35
  64. package/dist/index161.mjs +2 -47
  65. package/dist/index162.mjs +19 -20
  66. package/dist/index163.mjs +44 -54
  67. package/dist/index164.mjs +2 -29
  68. package/dist/index165.mjs +29 -6
  69. package/dist/index166.mjs +16 -50
  70. package/dist/index167.mjs +2 -6
  71. package/dist/index168.mjs +2 -12
  72. package/dist/index169.mjs +2 -7
  73. package/dist/index170.mjs +2 -28
  74. package/dist/index171.mjs +72 -2
  75. package/dist/index172.mjs +2 -70
  76. package/dist/index173.mjs +50 -164
  77. package/dist/index174.mjs +2 -2
  78. package/dist/index175.mjs +36 -2
  79. package/dist/index176.mjs +152 -2
  80. package/dist/index177.mjs +2 -18
  81. package/dist/index178.mjs +2 -32
  82. package/dist/index179.mjs +14 -33
  83. package/dist/index18.mjs +1 -1
  84. package/dist/index180.mjs +2 -18
  85. package/dist/index181.mjs +2 -18
  86. package/dist/index182.mjs +26 -2
  87. package/dist/index183.mjs +2 -20
  88. package/dist/index184.mjs +2 -46
  89. package/dist/index185.mjs +24 -2
  90. package/dist/index186.mjs +19 -26
  91. package/dist/index187.mjs +2 -18
  92. package/dist/index188.mjs +2 -2
  93. package/dist/index189.mjs +2 -2
  94. package/dist/index19.mjs +1 -1
  95. package/dist/index190.mjs +23 -2
  96. package/dist/index191.mjs +2 -2
  97. package/dist/index192.mjs +18 -67
  98. package/dist/index193.mjs +2 -2
  99. package/dist/index194.mjs +2 -53
  100. package/dist/index196.mjs +15 -28
  101. package/dist/index197.mjs +2 -152
  102. package/dist/index198.mjs +23 -2
  103. package/dist/index199.mjs +2 -2
  104. package/dist/index200.mjs +2 -19
  105. package/dist/index201.mjs +2 -2
  106. package/dist/index202.mjs +2 -2
  107. package/dist/index203.mjs +2 -26
  108. package/dist/index204.mjs +2 -2
  109. package/dist/index205.mjs +2 -2
  110. package/dist/index206.mjs +2 -24
  111. package/dist/index207.mjs +124 -20
  112. package/dist/index209.mjs +74 -2
  113. package/dist/index210.mjs +74 -2
  114. package/dist/index211.mjs +2 -23
  115. package/dist/index212.mjs +31 -2
  116. package/dist/index213.mjs +10 -22
  117. package/dist/index214.mjs +4 -2
  118. package/dist/index215.mjs +4 -2
  119. package/dist/index216.mjs +13 -2
  120. package/dist/index217.mjs +7 -23
  121. package/dist/index218.mjs +12 -2
  122. package/dist/index219.mjs +4 -22
  123. package/dist/index22.mjs +2 -2
  124. package/dist/index220.mjs +33 -2
  125. package/dist/index221.mjs +31 -2
  126. package/dist/index222.mjs +28 -2
  127. package/dist/index223.mjs +61 -2
  128. package/dist/index224.mjs +2 -2
  129. package/dist/index225.mjs +108 -2
  130. package/dist/index226.mjs +2 -2
  131. package/dist/index227.mjs +2 -2
  132. package/dist/index228.mjs +2 -127
  133. package/dist/index230.mjs +2 -74
  134. package/dist/index231.mjs +2 -74
  135. package/dist/index232.mjs +2 -2
  136. package/dist/index233.mjs +34 -645
  137. package/dist/index234.mjs +2 -2
  138. package/dist/index235.mjs +2 -2
  139. package/dist/index236.mjs +2 -43
  140. package/dist/index237.mjs +2 -20
  141. package/dist/index238.mjs +243 -18
  142. package/dist/index240.mjs +33 -2
  143. package/dist/index241.mjs +64 -30
  144. package/dist/index242.mjs +24 -10
  145. package/dist/index243.mjs +2 -4
  146. package/dist/index244.mjs +2 -4
  147. package/dist/index245.mjs +2 -13
  148. package/dist/index246.mjs +2 -7
  149. package/dist/index247.mjs +2 -12
  150. package/dist/index248.mjs +2 -5
  151. package/dist/index249.mjs +2 -33
  152. package/dist/index25.mjs +2 -2
  153. package/dist/index250.mjs +2 -31
  154. package/dist/index251.mjs +2 -28
  155. package/dist/index252.mjs +2 -61
  156. package/dist/index253.mjs +2 -2
  157. package/dist/index254.mjs +4 -2
  158. package/dist/index255.mjs +3 -2
  159. package/dist/index256.mjs +2 -2
  160. package/dist/index257.mjs +2 -2
  161. package/dist/index258.mjs +17 -2
  162. package/dist/index259.mjs +12 -107
  163. package/dist/index26.mjs +1 -1
  164. package/dist/index260.mjs +6 -2
  165. package/dist/index261.mjs +30 -2
  166. package/dist/index262.mjs +2 -2
  167. package/dist/index263.mjs +2 -2
  168. package/dist/index264.mjs +2 -37
  169. package/dist/index265.mjs +18 -2
  170. package/dist/index266.mjs +47 -2
  171. package/dist/index267.mjs +2 -2
  172. package/dist/index268.mjs +2 -244
  173. package/dist/index270.mjs +89 -31
  174. package/dist/index271.mjs +2 -65
  175. package/dist/index272.mjs +2 -25
  176. package/dist/index274.mjs +2 -2
  177. package/dist/index34.mjs +11 -11
  178. package/dist/index40.mjs +2 -2
  179. package/dist/index42.mjs +2 -2
  180. package/dist/index43.mjs +32 -6
  181. package/dist/index44.mjs +7 -32
  182. package/dist/index45.mjs +1432 -6
  183. package/dist/index46.mjs +69 -1432
  184. package/dist/index47.mjs +2 -70
  185. package/dist/index48.mjs +60 -2
  186. package/dist/index49.mjs +48 -57
  187. package/dist/index50.mjs +33 -51
  188. package/dist/index51.mjs +15 -33
  189. package/dist/index52.mjs +2260 -12
  190. package/dist/index53.mjs +36 -2263
  191. package/dist/index54.mjs +44 -36
  192. package/dist/index55.mjs +99 -44
  193. package/dist/index56.mjs +113 -99
  194. package/dist/index57.mjs +50 -82
  195. package/dist/index58.mjs +79 -53
  196. package/dist/index59.mjs +63 -75
  197. package/dist/index60.mjs +57 -71
  198. package/dist/index61.mjs +55 -57
  199. package/dist/index62.mjs +15 -75
  200. package/dist/index63.mjs +14 -13
  201. package/dist/index64.mjs +59 -16
  202. package/dist/index65.mjs +105 -43
  203. package/dist/index66.mjs +93 -89
  204. package/dist/index67.mjs +23 -128
  205. package/dist/index68.mjs +149 -19
  206. package/dist/index69.mjs +2 -24
  207. package/dist/index70.mjs +23 -2
  208. package/dist/index71.mjs +74 -37
  209. package/dist/index72.mjs +15 -2
  210. package/dist/index73.mjs +58 -148
  211. package/dist/index75.mjs +2 -75
  212. package/dist/index76.mjs +6 -15
  213. package/dist/index77.mjs +1128 -57
  214. package/dist/index78.mjs +19 -5
  215. package/dist/index79.mjs +51 -352
  216. package/dist/index80.mjs +30 -216
  217. package/dist/index81.mjs +2 -59
  218. package/dist/index82.mjs +235 -2
  219. package/dist/index83.mjs +6 -2
  220. package/dist/index84.mjs +134 -2
  221. package/dist/index85.mjs +67 -1134
  222. package/dist/index86.mjs +86 -19
  223. package/dist/index87.mjs +28 -54
  224. package/dist/index88.mjs +8 -32
  225. package/dist/index89.mjs +69 -229
  226. package/dist/index90.mjs +3 -5
  227. package/dist/index91.mjs +2 -134
  228. package/dist/index92.mjs +79 -64
  229. package/dist/index93.mjs +51 -84
  230. package/dist/index94.mjs +5 -28
  231. package/dist/index95.mjs +4 -8
  232. package/dist/index96.mjs +173 -69
  233. package/dist/index97.mjs +53 -4
  234. package/dist/index98.mjs +69 -2
  235. package/dist/index99.mjs +31 -80
  236. package/package.json +1 -1
  237. package/src/components/ProductAddOns.tsx +4 -8
  238. package/dist/index275.mjs +0 -5
  239. package/dist/index276.mjs +0 -5
  240. package/dist/index277.mjs +0 -5
  241. package/dist/index278.mjs +0 -5
  242. package/dist/index279.mjs +0 -5
  243. package/dist/index280.mjs +0 -5
  244. package/dist/index281.mjs +0 -7
  245. package/dist/index282.mjs +0 -5
  246. package/dist/index283.mjs +0 -5
  247. package/dist/index284.mjs +0 -5
  248. package/dist/index285.mjs +0 -5
  249. package/dist/index286.mjs +0 -5
  250. package/dist/index287.mjs +0 -5
  251. package/dist/index288.mjs +0 -6
  252. package/dist/index289.mjs +0 -5
  253. package/dist/index290.mjs +0 -5
  254. package/dist/index291.mjs +0 -20
  255. package/dist/index292.mjs +0 -16
  256. package/dist/index293.mjs +0 -9
  257. package/dist/index294.mjs +0 -33
  258. package/dist/index295.mjs +0 -5
  259. package/dist/index296.mjs +0 -5
  260. package/dist/index297.mjs +0 -21
  261. package/dist/index298.mjs +0 -50
  262. package/dist/index299.mjs +0 -5
  263. package/dist/index300.mjs +0 -5
  264. package/dist/index301.mjs +0 -5
  265. package/dist/index302.mjs +0 -5
  266. package/dist/index303.mjs +0 -94
  267. package/dist/index304.mjs +0 -5
  268. package/dist/index305.mjs +0 -5
  269. package/dist/index306.mjs +0 -5
  270. package/dist/index307.mjs +0 -5
package/dist/index85.mjs CHANGED
@@ -1,1138 +1,71 @@
1
1
  'use client';
2
- import { __exports as ge } from "./index109.mjs";
3
- import "./index78.mjs";
4
- import "./index110.mjs";
5
- import { __require as Ye } from "./index111.mjs";
6
- import { __require as Ze } from "./index112.mjs";
7
- import { __require as et } from "./index113.mjs";
8
- import { __require as tt } from "./index87.mjs";
9
- import { __require as rt } from "./index114.mjs";
10
- import { __require as at } from "./index115.mjs";
11
- import { __require as st } from "./index116.mjs";
12
- import { __require as it } from "./index117.mjs";
13
- import { __require as ot } from "./index118.mjs";
14
- import { __require as nt } from "./index119.mjs";
15
- import { __require as lt } from "./index120.mjs";
16
- import { __require as ct } from "./index121.mjs";
17
- import { __require as ht } from "./index122.mjs";
18
- import { __require as ut } from "./index123.mjs";
19
- import { __require as dt } from "./index124.mjs";
20
- import { __require as ft } from "./index125.mjs";
21
- import { __require as pt } from "./index126.mjs";
22
- import { __require as mt } from "./index127.mjs";
23
- import { __require as _t } from "./index128.mjs";
24
- import { __require as gt } from "./index129.mjs";
25
- import { __require as vt } from "./index130.mjs";
26
- import { __require as wt } from "./index131.mjs";
27
- import { __require as Pt } from "./index132.mjs";
28
- import { __require as Rt } from "./index133.mjs";
29
- import { __require as St } from "./index134.mjs";
30
- import { __require as Et } from "./index135.mjs";
31
- import { __require as yt } from "./index136.mjs";
32
- import { __require as Nt } from "./index137.mjs";
33
- import { __require as Lt } from "./index138.mjs";
34
- import { __require as Tt } from "./index139.mjs";
35
- import { __require as At } from "./index140.mjs";
36
- import { __require as Ct } from "./index141.mjs";
37
- import { __require as qt } from "./index142.mjs";
38
- import { __require as It } from "./index143.mjs";
39
- import { __exports as Dt } from "./index144.mjs";
40
- import { __exports as bt } from "./index82.mjs";
41
- var Ue;
42
- function Pr() {
43
- return Ue ? ge : (Ue = 1, function(ve) {
44
- Object.defineProperty(ve, "__esModule", {
45
- value: !0
46
- });
47
- function Me(u, r) {
48
- for (var t in r) Object.defineProperty(u, t, {
49
- enumerable: !0,
50
- get: r[t]
51
- });
52
- }
53
- Me(ve, {
54
- createKey: function() {
55
- return me;
56
- },
57
- default: function() {
58
- return D;
59
- },
60
- matchesMiddleware: function() {
61
- return oe;
62
- }
63
- });
64
- const we = bt, We = Dt, U = Ye(), K = Ze(), je = et(), se = /* @__PURE__ */ We._(tt()), ke = rt(), F = at(), Fe = /* @__PURE__ */ we._(st()), J = it(), X = ot(), j = nt(), he = /* @__PURE__ */ we._(lt()), ie = ct(), te = ht(), A = ut(), Pe = dt(), re = ft(), M = pt(), ue = mt(), I = _t(), E = gt(), Q = vt(), Re = wt(), Xe = Pt(), le = Rt(), Se = St(), Ve = Et(), Ee = yt(), Ge = Nt(), ze = Lt(), Ke = Tt(), Je = At(), Qe = Ct();
65
- function ye() {
66
- return Object.assign(new Error("Route Cancelled"), {
67
- cancelled: !0
68
- });
69
- }
70
- async function oe(u) {
71
- const r = await Promise.resolve(u.router.pageLoader.getMiddleware());
72
- if (!r) return !1;
73
- const { pathname: t } = (0, re.parsePath)(u.asPath), e = (0, Q.hasBasePath)(t) ? (0, I.removeBasePath)(t) : t, a = (0, E.addBasePath)((0, M.addLocale)(e, u.locale));
74
- return r.some((d) => new RegExp(d.regexp).test(a));
75
- }
76
- function de(u) {
77
- const r = (0, J.getLocationOrigin)();
78
- return u.startsWith(r) ? u.substring(r.length) : u;
79
- }
80
- function fe(u, r, t) {
81
- let [e, a] = (0, Re.resolveHref)(u, r, !0);
82
- const d = (0, J.getLocationOrigin)(), p = e.startsWith(d), n = a && a.startsWith(d);
83
- e = de(e), a = a && de(a);
84
- const v = p ? e : (0, E.addBasePath)(e), i = t ? de((0, Re.resolveHref)(u, t)) : a || e;
85
- return {
86
- url: v,
87
- as: n ? i : (0, E.addBasePath)(i)
88
- };
89
- }
90
- function V(u, r) {
91
- const t = (0, U.removeTrailingSlash)((0, ke.denormalizePagePath)(u));
92
- return t === "/404" || t === "/_error" ? u : (r.includes(t) || r.some((e) => {
93
- if ((0, X.isDynamicRoute)(e) && (0, te.getRouteRegex)(e).re.test(t))
94
- return u = e, !0;
95
- }), (0, U.removeTrailingSlash)(u));
96
- }
97
- function $e(u, r, t) {
98
- const e = {
99
- basePath: t.router.basePath,
100
- i18n: {
101
- locales: t.router.locales
102
- },
103
- trailingSlash: !!process.env.__NEXT_TRAILING_SLASH
104
- }, a = r.headers.get("x-nextjs-rewrite");
105
- let d = a || r.headers.get("x-nextjs-matched-path");
106
- const p = r.headers.get(Qe.MATCHED_PATH_HEADER);
107
- if (p && !d && !p.includes("__next_data_catchall") && !p.includes("/_error") && !p.includes("/404") && (d = p), d) {
108
- if (d.startsWith("/") || process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE) {
109
- const f = (0, j.parseRelativeUrl)(d), R = (0, le.getNextPathnameInfo)(f.pathname, {
110
- nextConfig: e,
111
- parseData: !0
112
- });
113
- let l = (0, U.removeTrailingSlash)(R.pathname);
114
- return Promise.all([
115
- t.router.pageLoader.getPageList(),
116
- (0, K.getClientBuildManifest)()
117
- ]).then((g) => {
118
- let [c, { __rewrites: m }] = g, h = (0, M.addLocale)(R.pathname, R.locale);
119
- if ((0, X.isDynamicRoute)(h) || !a && c.includes((0, F.normalizeLocalePath)((0, I.removeBasePath)(h), t.router.locales).pathname)) {
120
- const S = (0, le.getNextPathnameInfo)((0, j.parseRelativeUrl)(u).pathname, {
121
- nextConfig: process.env.__NEXT_HAS_REWRITES ? void 0 : e,
122
- parseData: !0
123
- });
124
- h = (0, E.addBasePath)(S.pathname), f.pathname = h;
125
- }
126
- if (process.env.__NEXT_HAS_REWRITES) {
127
- const S = (0, he.default)(h, c, m, f.query, (y) => V(y, c), t.router.locales);
128
- S.matchedPage && (f.pathname = S.parsedAs.pathname, h = f.pathname, Object.assign(f.query, S.parsedAs.query));
129
- } else if (!c.includes(l)) {
130
- const S = V(l, c);
131
- S !== l && (l = S);
132
- }
133
- const w = c.includes(l) ? l : V((0, F.normalizeLocalePath)((0, I.removeBasePath)(f.pathname), t.router.locales).pathname, c);
134
- if ((0, X.isDynamicRoute)(w)) {
135
- const S = (0, ie.getRouteMatcher)((0, te.getRouteRegex)(w))(h);
136
- Object.assign(f.query, S || {});
137
- }
138
- return {
139
- type: "rewrite",
140
- parsedAs: f,
141
- resolvedHref: w
142
- };
143
- });
144
- }
145
- const v = (0, re.parsePath)(u), i = (0, Se.formatNextPathnameInfo)({
146
- ...(0, le.getNextPathnameInfo)(v.pathname, {
147
- nextConfig: e,
148
- parseData: !0
149
- }),
150
- defaultLocale: t.router.defaultLocale,
151
- buildId: ""
152
- });
153
- return Promise.resolve({
154
- type: "redirect-external",
155
- destination: "" + i + v.query + v.hash
156
- });
157
- }
158
- const n = r.headers.get("x-nextjs-redirect");
159
- if (n) {
160
- if (n.startsWith("/")) {
161
- const v = (0, re.parsePath)(n), i = (0, Se.formatNextPathnameInfo)({
162
- ...(0, le.getNextPathnameInfo)(v.pathname, {
163
- nextConfig: e,
164
- parseData: !0
165
- }),
166
- defaultLocale: t.router.defaultLocale,
167
- buildId: ""
168
- });
169
- return Promise.resolve({
170
- type: "redirect-internal",
171
- newAs: "" + i + v.query + v.hash,
172
- newUrl: "" + i + v.query + v.hash
173
- });
174
- }
175
- return Promise.resolve({
176
- type: "redirect-external",
177
- destination: n
178
- });
179
- }
180
- return Promise.resolve({
181
- type: "next"
182
- });
183
- }
184
- async function Ne(u) {
185
- if (!await oe(u) || !u.fetchData)
186
- return null;
187
- const t = await u.fetchData(), e = await $e(t.dataHref, t.response, u);
188
- return {
189
- dataHref: t.dataHref,
190
- json: t.json,
191
- response: t.response,
192
- text: t.text,
193
- cacheKey: t.cacheKey,
194
- effect: e
195
- };
196
- }
197
- const pe = process.env.__NEXT_SCROLL_RESTORATION && typeof window < "u" && "scrollRestoration" in window.history && !!function() {
198
- try {
199
- let u = "__next";
200
- return sessionStorage.setItem(u, u), sessionStorage.removeItem(u), !0;
201
- } catch {
202
- }
203
- }(), Le = Symbol("SSG_DATA_NOT_FOUND");
204
- function Te(u, r, t) {
205
- return fetch(u, {
206
- // Cookies are required to be present for Next.js' SSG "Preview Mode".
207
- // Cookies may also be required for `getServerSideProps`.
208
- //
209
- // > `fetch` won’t send cookies, unless you set the credentials init
210
- // > option.
211
- // https://developer.mozilla.org/docs/Web/API/Fetch_API/Using_Fetch
212
- //
213
- // > For maximum browser compatibility when it comes to sending &
214
- // > receiving cookies, always supply the `credentials: 'same-origin'`
215
- // > option instead of relying on the default.
216
- // https://github.com/github/fetch#caveats
217
- credentials: "same-origin",
218
- method: t.method || "GET",
219
- headers: Object.assign({}, t.headers, {
220
- "x-nextjs-data": "1"
221
- })
222
- }).then((e) => !e.ok && r > 1 && e.status >= 500 ? Te(u, r - 1, t) : e);
223
- }
224
- function Ae(u) {
225
- try {
226
- return JSON.parse(u);
227
- } catch {
228
- return null;
229
- }
230
- }
231
- function ne(u) {
232
- let { dataHref: r, inflightCache: t, isPrefetch: e, hasMiddleware: a, isServerRender: d, parseJSON: p, persistCache: n, isBackground: v, unstable_skipClientCache: i } = u;
233
- const { href: f } = new URL(r, window.location.href), R = (l) => {
234
- var g;
235
- return Te(r, d ? 3 : 1, {
236
- headers: Object.assign({}, e ? {
237
- purpose: "prefetch"
238
- } : {}, e && a ? {
239
- "x-middleware-prefetch": "1"
240
- } : {}),
241
- method: (g = l == null ? void 0 : l.method) != null ? g : "GET"
242
- }).then((c) => c.ok && (l == null ? void 0 : l.method) === "HEAD" ? {
243
- dataHref: r,
244
- response: c,
245
- text: "",
246
- json: {},
247
- cacheKey: f
248
- } : c.text().then((m) => {
249
- if (!c.ok) {
250
- if (a && [
251
- 301,
252
- 302,
253
- 307,
254
- 308
255
- ].includes(c.status))
256
- return {
257
- dataHref: r,
258
- response: c,
259
- text: m,
260
- json: {},
261
- cacheKey: f
262
- };
263
- if (c.status === 404) {
264
- var h;
265
- if ((h = Ae(m)) != null && h.notFound)
266
- return {
267
- dataHref: r,
268
- json: {
269
- notFound: Le
270
- },
271
- response: c,
272
- text: m,
273
- cacheKey: f
274
- };
275
- }
276
- const w = new Error("Failed to load static props");
277
- throw d || (0, K.markAssetError)(w), w;
278
- }
279
- return {
280
- dataHref: r,
281
- json: p ? Ae(m) : null,
282
- response: c,
283
- text: m,
284
- cacheKey: f
285
- };
286
- })).then((c) => ((!n || process.env.NODE_ENV !== "production" || c.response.headers.get("x-middleware-cache") === "no-cache") && delete t[f], c)).catch((c) => {
287
- throw i || delete t[f], // chrome
288
- (c.message === "Failed to fetch" || // firefox
289
- c.message === "NetworkError when attempting to fetch resource." || // safari
290
- c.message === "Load failed") && (0, K.markAssetError)(c), c;
291
- });
292
- };
293
- return i && n ? R({}).then((l) => (l.response.headers.get("x-middleware-cache") !== "no-cache" && (t[f] = Promise.resolve(l)), l)) : t[f] !== void 0 ? t[f] : t[f] = R(v ? {
294
- method: "HEAD"
295
- } : {});
296
- }
297
- function me() {
298
- return Math.random().toString(36).slice(2, 10);
299
- }
300
- function O(u) {
301
- let { url: r, router: t } = u;
302
- if (r === (0, E.addBasePath)((0, M.addLocale)(t.asPath, t.locale)))
303
- throw new Error("Invariant: attempted to hard navigate to the same URL " + r + " " + location.href);
304
- window.location.href = r;
305
- }
306
- const Ce = (u) => {
307
- let { route: r, router: t } = u, e = !1;
308
- const a = t.clc = () => {
309
- e = !0;
310
- };
311
- return () => {
312
- if (e) {
313
- const p = new Error('Abort fetching component for route: "' + r + '"');
314
- throw p.cancelled = !0, p;
315
- }
316
- a === t.clc && (t.clc = null);
317
- };
318
- };
319
- class D {
320
- reload() {
321
- window.location.reload();
322
- }
323
- /**
324
- * Go back in history
325
- */
326
- back() {
327
- window.history.back();
328
- }
329
- /**
330
- * Go forward in history
331
- */
332
- forward() {
333
- window.history.forward();
334
- }
335
- /**
336
- * Performs a `pushState` with arguments
337
- * @param url of the route
338
- * @param as masks `url` for the browser
339
- * @param options object you can define `shallow` and other options
340
- */
341
- push(r, t, e) {
342
- if (e === void 0 && (e = {}), process.env.__NEXT_SCROLL_RESTORATION && pe)
343
- try {
344
- sessionStorage.setItem("__next_scroll_" + this._key, JSON.stringify({
345
- x: self.pageXOffset,
346
- y: self.pageYOffset
347
- }));
348
- } catch {
349
- }
350
- return { url: r, as: t } = fe(this, r, t), this.change("pushState", r, t, e);
351
- }
352
- /**
353
- * Performs a `replaceState` with arguments
354
- * @param url of the route
355
- * @param as masks `url` for the browser
356
- * @param options object you can define `shallow` and other options
357
- */
358
- replace(r, t, e) {
359
- return e === void 0 && (e = {}), { url: r, as: t } = fe(this, r, t), this.change("replaceState", r, t, e);
360
- }
361
- async _bfl(r, t, e, a) {
362
- if (process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED) {
363
- if (!this._bfl_s && !this._bfl_d) {
364
- const { BloomFilter: R } = qt();
365
- let l, g;
366
- try {
367
- ({ __routerFilterStatic: l, __routerFilterDynamic: g } = await (0, K.getClientBuildManifest)());
368
- } catch (h) {
369
- return console.error(h), a ? !0 : (O({
370
- url: (0, E.addBasePath)((0, M.addLocale)(r, e || this.locale, this.defaultLocale)),
371
- router: this
372
- }), new Promise(() => {
373
- }));
374
- }
375
- const c = process.env.__NEXT_CLIENT_ROUTER_S_FILTER;
376
- !l && c && (l = c || void 0);
377
- const m = process.env.__NEXT_CLIENT_ROUTER_D_FILTER;
378
- !g && m && (g = m || void 0), l != null && l.numHashes && (this._bfl_s = new R(l.numItems, l.errorRate), this._bfl_s.import(l)), g != null && g.numHashes && (this._bfl_d = new R(g.numItems, g.errorRate), this._bfl_d.import(g));
379
- }
380
- let v = !1, i = !1;
381
- const f = [
382
- {
383
- as: r
384
- },
385
- {
386
- as: t
387
- }
388
- ];
389
- for (const { as: R, allowMatchCurrent: l } of f)
390
- if (R) {
391
- const g = (0, U.removeTrailingSlash)(new URL(R, "http://n").pathname), c = (0, E.addBasePath)((0, M.addLocale)(g, e || this.locale));
392
- if (l || g !== (0, U.removeTrailingSlash)(new URL(this.asPath, "http://n").pathname)) {
393
- var d, p;
394
- v = v || !!((d = this._bfl_s) != null && d.contains(g)) || !!((p = this._bfl_s) != null && p.contains(c));
395
- for (const m of [
396
- g,
397
- c
398
- ]) {
399
- const h = m.split("/");
400
- for (let w = 0; !i && w < h.length + 1; w++) {
401
- var n;
402
- const S = h.slice(0, w).join("/");
403
- if (S && ((n = this._bfl_d) != null && n.contains(S))) {
404
- i = !0;
405
- break;
406
- }
407
- }
408
- }
409
- if (v || i)
410
- return a ? !0 : (O({
411
- url: (0, E.addBasePath)((0, M.addLocale)(r, e || this.locale, this.defaultLocale)),
412
- router: this
413
- }), new Promise(() => {
414
- }));
415
- }
416
- }
417
- }
418
- return !1;
419
- }
420
- async change(r, t, e, a, d) {
421
- var p;
422
- if (!(0, Ee.isLocalURL)(t))
423
- return O({
424
- url: t,
425
- router: this
426
- }), !1;
427
- const n = a._h === 1;
428
- !n && !a.shallow && await this._bfl(e, void 0, a.locale);
429
- let v = n || a._shouldResolveHref || (0, re.parsePath)(t).pathname === (0, re.parsePath)(e).pathname;
430
- const i = {
431
- ...this.state
432
- }, f = this.isReady !== !0;
433
- this.isReady = !0;
434
- const R = this.isSsr;
435
- if (n || (this.isSsr = !1), n && this.clc)
436
- return !1;
437
- const l = i.locale;
438
- if (process.env.__NEXT_I18N_SUPPORT) {
439
- i.locale = a.locale === !1 ? this.defaultLocale : a.locale || i.locale, typeof a.locale > "u" && (a.locale = i.locale);
440
- const s = (0, j.parseRelativeUrl)((0, Q.hasBasePath)(e) ? (0, I.removeBasePath)(e) : e), B = (0, F.normalizeLocalePath)(s.pathname, this.locales);
441
- B.detectedLocale && (i.locale = B.detectedLocale, s.pathname = (0, E.addBasePath)(s.pathname), e = (0, A.formatWithValidation)(s), t = (0, E.addBasePath)((0, F.normalizeLocalePath)((0, Q.hasBasePath)(t) ? (0, I.removeBasePath)(t) : t, this.locales).pathname));
442
- let k = !1;
443
- if (process.env.__NEXT_I18N_SUPPORT) {
444
- var g;
445
- (g = this.locales) != null && g.includes(i.locale) || (s.pathname = (0, M.addLocale)(s.pathname, i.locale), O({
446
- url: (0, A.formatWithValidation)(s),
447
- router: this
448
- }), k = !0);
449
- }
450
- const q = (0, Pe.detectDomainLocale)(this.domainLocales, void 0, i.locale);
451
- if (process.env.__NEXT_I18N_SUPPORT && !k && q && this.isLocaleDomain && self.location.hostname !== q.domain) {
452
- const Z = (0, I.removeBasePath)(e);
453
- O({
454
- url: "http" + (q.http ? "" : "s") + "://" + q.domain + (0, E.addBasePath)((i.locale === q.defaultLocale ? "" : "/" + i.locale) + (Z === "/" ? "" : Z) || "/"),
455
- router: this
456
- }), k = !0;
457
- }
458
- if (k)
459
- return new Promise(() => {
460
- });
461
- }
462
- J.ST && performance.mark("routeChange");
463
- const { shallow: c = !1, scroll: m = !0 } = a, h = {
464
- shallow: c
465
- };
466
- this._inFlightRoute && this.clc && (R || D.events.emit("routeChangeError", ye(), this._inFlightRoute, h), this.clc(), this.clc = null), e = (0, E.addBasePath)((0, M.addLocale)((0, Q.hasBasePath)(e) ? (0, I.removeBasePath)(e) : e, a.locale, this.defaultLocale));
467
- const w = (0, ue.removeLocale)((0, Q.hasBasePath)(e) ? (0, I.removeBasePath)(e) : e, i.locale);
468
- this._inFlightRoute = e;
469
- const S = l !== i.locale;
470
- if (!n && this.onlyAHashChange(w) && !S) {
471
- i.asPath = w, D.events.emit("hashChangeStart", e, h), this.changeState(r, t, e, {
472
- ...a,
473
- scroll: !1
474
- }), m && this.scrollToHash(w);
475
- try {
476
- await this.set(i, this.components[i.route], null);
477
- } catch (s) {
478
- throw (0, se.default)(s) && s.cancelled && D.events.emit("routeChangeError", s, w, h), s;
479
- }
480
- return D.events.emit("hashChangeComplete", e, h), !0;
481
- }
482
- let y = (0, j.parseRelativeUrl)(t), { pathname: _, query: P } = y, W, G;
483
- try {
484
- [W, { __rewrites: G }] = await Promise.all([
485
- this.pageLoader.getPageList(),
486
- (0, K.getClientBuildManifest)(),
487
- this.pageLoader.getMiddleware()
488
- ]);
489
- } catch {
490
- return O({
491
- url: e,
492
- router: this
493
- }), !1;
494
- }
495
- !this.urlIsNew(w) && !S && (r = "replaceState");
496
- let b = e;
497
- _ = _ && (0, U.removeTrailingSlash)((0, I.removeBasePath)(_));
498
- let o = (0, U.removeTrailingSlash)(_);
499
- const N = e.startsWith("/") && (0, j.parseRelativeUrl)(e).pathname;
500
- if ((p = this.components[_]) != null && p.__appRouter)
501
- return O({
502
- url: e,
503
- router: this
504
- }), new Promise(() => {
505
- });
506
- const $ = !!(N && o !== N && (!(0, X.isDynamicRoute)(o) || !(0, ie.getRouteMatcher)((0, te.getRouteRegex)(o))(N))), C = !a.shallow && await oe({
507
- asPath: e,
508
- locale: i.locale,
509
- router: this
510
- });
511
- if (n && C && (v = !1), v && _ !== "/_error")
512
- if (a._shouldResolveHref = !0, process.env.__NEXT_HAS_REWRITES && e.startsWith("/")) {
513
- const s = (0, he.default)((0, E.addBasePath)((0, M.addLocale)(w, i.locale), !0), W, G, P, (B) => V(B, W), this.locales);
514
- if (s.externalDest)
515
- return O({
516
- url: e,
517
- router: this
518
- }), !0;
519
- C || (b = s.asPath), s.matchedPage && s.resolvedHref && (_ = s.resolvedHref, y.pathname = (0, E.addBasePath)(_), C || (t = (0, A.formatWithValidation)(y)));
520
- } else
521
- y.pathname = V(_, W), y.pathname !== _ && (_ = y.pathname, y.pathname = (0, E.addBasePath)(_), C || (t = (0, A.formatWithValidation)(y)));
522
- if (!(0, Ee.isLocalURL)(e)) {
523
- if (process.env.NODE_ENV !== "production")
524
- throw new Error('Invalid href: "' + t + '" and as: "' + e + `", received relative href and external as
525
- See more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);
526
- return O({
527
- url: e,
528
- router: this
529
- }), !1;
530
- }
531
- b = (0, ue.removeLocale)((0, I.removeBasePath)(b), i.locale), o = (0, U.removeTrailingSlash)(_);
532
- let H = !1;
533
- if ((0, X.isDynamicRoute)(o)) {
534
- const s = (0, j.parseRelativeUrl)(b), B = s.pathname, k = (0, te.getRouteRegex)(o);
535
- H = (0, ie.getRouteMatcher)(k)(B);
536
- const q = o === B, Z = q ? (0, Ke.interpolateAs)(o, B, P) : {};
537
- if (!H || q && !Z.result) {
538
- const ee = Object.keys(k.groups).filter((ae) => !P[ae] && !k.groups[ae].optional);
539
- if (ee.length > 0 && !C)
540
- throw process.env.NODE_ENV !== "production" && console.warn((q ? "Interpolating href" : "Mismatching `as` and `href`") + " failed to manually provide " + ("the params: " + ee.join(", ") + " in the `href`'s `query`")), new Error((q ? "The provided `href` (" + t + ") value is missing query values (" + ee.join(", ") + ") to be interpolated properly. " : "The provided `as` value (" + B + ") is incompatible with the `href` value (" + o + "). ") + ("Read more: https://nextjs.org/docs/messages/" + (q ? "href-interpolation-failed" : "incompatible-href-as")));
541
- } else q ? e = (0, A.formatWithValidation)(Object.assign({}, s, {
542
- pathname: Z.result,
543
- query: (0, ze.omit)(P, Z.params)
544
- })) : Object.assign(P, H);
545
- }
546
- n || D.events.emit("routeChangeStart", e, h);
547
- const ce = this.pathname === "/404" || this.pathname === "/_error";
548
- try {
549
- var T, Y, qe;
550
- let s = await this.getRouteInfo({
551
- route: o,
552
- pathname: _,
553
- query: P,
554
- as: e,
555
- resolvedAs: b,
556
- routeProps: h,
557
- locale: i.locale,
558
- isPreview: i.isPreview,
559
- hasMiddleware: C,
560
- unstable_skipClientCache: a.unstable_skipClientCache,
561
- isQueryUpdating: n && !this.isFallback,
562
- isMiddlewareRewrite: $
563
- });
564
- if (!n && !a.shallow && await this._bfl(e, "resolvedAs" in s ? s.resolvedAs : void 0, i.locale), "route" in s && C) {
565
- _ = s.route || o, o = _, h.shallow || (P = Object.assign({}, s.query || {}, P));
566
- const L = (0, Q.hasBasePath)(y.pathname) ? (0, I.removeBasePath)(y.pathname) : y.pathname;
567
- if (H && _ !== L && Object.keys(H).forEach((x) => {
568
- H && P[x] === H[x] && delete P[x];
569
- }), (0, X.isDynamicRoute)(_)) {
570
- let z = !h.shallow && s.resolvedAs ? s.resolvedAs : (0, E.addBasePath)((0, M.addLocale)(new URL(e, location.href).pathname, i.locale), !0);
571
- if ((0, Q.hasBasePath)(z) && (z = (0, I.removeBasePath)(z)), process.env.__NEXT_I18N_SUPPORT) {
572
- const Be = (0, F.normalizeLocalePath)(z, this.locales);
573
- i.locale = Be.detectedLocale || i.locale, z = Be.pathname;
574
- }
575
- const _e = (0, te.getRouteRegex)(_), He = (0, ie.getRouteMatcher)(_e)(new URL(z, location.href).pathname);
576
- He && Object.assign(P, He);
577
- }
578
- }
579
- if ("type" in s)
580
- return s.type === "redirect-internal" ? this.change(r, s.newUrl, s.newAs, a) : (O({
581
- url: s.destination,
582
- router: this
583
- }), new Promise(() => {
584
- }));
585
- const B = s.Component;
586
- if (B && B.unstable_scriptLoader && [].concat(B.unstable_scriptLoader()).forEach((x) => {
587
- (0, je.handleClientScriptLoad)(x.props);
588
- }), (s.__N_SSG || s.__N_SSP) && s.props) {
589
- if (s.props.pageProps && s.props.pageProps.__N_REDIRECT) {
590
- a.locale = !1;
591
- const L = s.props.pageProps.__N_REDIRECT;
592
- if (L.startsWith("/") && s.props.pageProps.__N_REDIRECT_BASE_PATH !== !1) {
593
- const x = (0, j.parseRelativeUrl)(L);
594
- x.pathname = V(x.pathname, W);
595
- const { url: z, as: _e } = fe(this, L, L);
596
- return this.change(r, z, _e, a);
597
- }
598
- return O({
599
- url: L,
600
- router: this
601
- }), new Promise(() => {
602
- });
603
- }
604
- if (i.isPreview = !!s.props.__N_PREVIEW, s.props.notFound === Le) {
605
- let L;
606
- try {
607
- await this.fetchComponent("/404"), L = "/404";
608
- } catch {
609
- L = "/_error";
610
- }
611
- if (s = await this.getRouteInfo({
612
- route: L,
613
- pathname: L,
614
- query: P,
615
- as: e,
616
- resolvedAs: b,
617
- routeProps: {
618
- shallow: !1
619
- },
620
- locale: i.locale,
621
- isPreview: i.isPreview,
622
- isNotFound: !0
623
- }), "type" in s)
624
- throw new Error("Unexpected middleware effect on /404");
625
- }
626
- }
627
- n && this.pathname === "/_error" && ((Y = self.__NEXT_DATA__.props) == null || (T = Y.pageProps) == null ? void 0 : T.statusCode) === 500 && ((qe = s.props) != null && qe.pageProps) && (s.props.pageProps.statusCode = 500);
628
- var Ie;
629
- const k = a.shallow && i.route === ((Ie = s.route) != null ? Ie : o);
630
- var De;
631
- const q = (De = a.scroll) != null ? De : !n && !k, ee = d ?? (q ? {
632
- x: 0,
633
- y: 0
634
- } : null), ae = {
635
- ...i,
636
- route: o,
637
- pathname: _,
638
- query: P,
639
- asPath: w,
640
- isFallback: !1
641
- };
642
- if (n && ce) {
643
- var be, xe, Oe;
644
- if (s = await this.getRouteInfo({
645
- route: this.pathname,
646
- pathname: this.pathname,
647
- query: P,
648
- as: e,
649
- resolvedAs: b,
650
- routeProps: {
651
- shallow: !1
652
- },
653
- locale: i.locale,
654
- isPreview: i.isPreview,
655
- isQueryUpdating: n && !this.isFallback
656
- }), "type" in s)
657
- throw new Error("Unexpected middleware effect on " + this.pathname);
658
- this.pathname === "/_error" && ((xe = self.__NEXT_DATA__.props) == null || (be = xe.pageProps) == null ? void 0 : be.statusCode) === 500 && ((Oe = s.props) != null && Oe.pageProps) && (s.props.pageProps.statusCode = 500);
659
- try {
660
- await this.set(ae, s, ee);
661
- } catch (L) {
662
- throw (0, se.default)(L) && L.cancelled && D.events.emit("routeChangeError", L, w, h), L;
663
- }
664
- return !0;
665
- }
666
- if (D.events.emit("beforeHistoryChange", e, h), this.changeState(r, t, e, a), !(n && !ee && !f && !S && (0, Ve.compareRouterStates)(ae, this.state))) {
667
- try {
668
- await this.set(ae, s, ee);
669
- } catch (x) {
670
- if (x.cancelled) s.error = s.error || x;
671
- else throw x;
672
- }
673
- if (s.error)
674
- throw n || D.events.emit("routeChangeError", s.error, w, h), s.error;
675
- process.env.__NEXT_I18N_SUPPORT && i.locale && (document.documentElement.lang = i.locale), n || D.events.emit("routeChangeComplete", e, h), q && /#.+$/.test(e) && this.scrollToHash(e);
676
- }
677
- return !0;
678
- } catch (s) {
679
- if ((0, se.default)(s) && s.cancelled)
680
- return !1;
681
- throw s;
682
- }
683
- }
684
- changeState(r, t, e, a) {
685
- if (a === void 0 && (a = {}), process.env.NODE_ENV !== "production") {
686
- if (typeof window.history > "u") {
687
- console.error("Warning: window.history is not available.");
688
- return;
689
- }
690
- if (typeof window.history[r] > "u") {
691
- console.error("Warning: window.history." + r + " is not available");
692
- return;
693
- }
694
- }
695
- (r !== "pushState" || (0, J.getURL)() !== e) && (this._shallow = a.shallow, window.history[r](
696
- {
697
- url: t,
698
- as: e,
699
- options: a,
700
- __N: !0,
701
- key: this._key = r !== "pushState" ? this._key : me()
702
- },
703
- // Most browsers currently ignores this parameter, although they may use it in the future.
704
- // Passing the empty string here should be safe against future changes to the method.
705
- // https://developer.mozilla.org/docs/Web/API/History/replaceState
706
- "",
707
- e
708
- ));
709
- }
710
- async handleRouteInfoError(r, t, e, a, d, p) {
711
- if (r.cancelled)
712
- throw r;
713
- if ((0, K.isAssetError)(r) || p)
714
- throw D.events.emit("routeChangeError", r, a, d), O({
715
- url: a,
716
- router: this
717
- }), ye();
718
- console.error(r);
719
- try {
720
- let n;
721
- const { page: v, styleSheets: i } = await this.fetchComponent("/_error"), f = {
722
- props: n,
723
- Component: v,
724
- styleSheets: i,
725
- err: r,
726
- error: r
727
- };
728
- if (!f.props)
729
- try {
730
- f.props = await this.getInitialProps(v, {
731
- err: r,
732
- pathname: t,
733
- query: e
734
- });
735
- } catch (R) {
736
- console.error("Error in error page `getInitialProps`: ", R), f.props = {};
737
- }
738
- return f;
739
- } catch (n) {
740
- return this.handleRouteInfoError((0, se.default)(n) ? n : new Error(n + ""), t, e, a, d, !0);
741
- }
742
- }
743
- async getRouteInfo(r) {
744
- let { route: t, pathname: e, query: a, as: d, resolvedAs: p, routeProps: n, locale: v, hasMiddleware: i, isPreview: f, unstable_skipClientCache: R, isQueryUpdating: l, isMiddlewareRewrite: g, isNotFound: c } = r, m = t;
745
- try {
746
- var h, w, S, y;
747
- let _ = this.components[m];
748
- if (n.shallow && _ && this.route === m)
749
- return _;
750
- const P = Ce({
751
- route: m,
752
- router: this
753
- });
754
- i && (_ = void 0);
755
- let W = _ && !("initial" in _) && process.env.NODE_ENV !== "development" ? _ : void 0;
756
- const G = l, b = {
757
- dataHref: this.pageLoader.getDataHref({
758
- href: (0, A.formatWithValidation)({
759
- pathname: e,
760
- query: a
761
- }),
762
- skipInterpolation: !0,
763
- asPath: c ? "/404" : p,
764
- locale: v
765
- }),
766
- hasMiddleware: !0,
767
- isServerRender: this.isSsr,
768
- parseJSON: !0,
769
- inflightCache: G ? this.sbc : this.sdc,
770
- persistCache: !f,
771
- isPrefetch: !1,
772
- unstable_skipClientCache: R,
773
- isBackground: G
774
- };
775
- let o = l && !g ? null : await Ne({
776
- fetchData: () => ne(b),
777
- asPath: c ? "/404" : p,
778
- locale: v,
779
- router: this
780
- }).catch((T) => {
781
- if (l)
782
- return null;
783
- throw T;
784
- });
785
- if (o && (e === "/_error" || e === "/404") && (o.effect = void 0), l && (o ? o.json = self.__NEXT_DATA__.props : o = {
786
- json: self.__NEXT_DATA__.props
787
- }), P(), (o == null || (h = o.effect) == null ? void 0 : h.type) === "redirect-internal" || (o == null || (w = o.effect) == null ? void 0 : w.type) === "redirect-external")
788
- return o.effect;
789
- if ((o == null || (S = o.effect) == null ? void 0 : S.type) === "rewrite") {
790
- const T = (0, U.removeTrailingSlash)(o.effect.resolvedHref), Y = await this.pageLoader.getPageList();
791
- if ((!l || Y.includes(T)) && (m = T, e = o.effect.resolvedHref, a = {
792
- ...a,
793
- ...o.effect.parsedAs.query
794
- }, p = (0, I.removeBasePath)((0, F.normalizeLocalePath)(o.effect.parsedAs.pathname, this.locales).pathname), _ = this.components[m], n.shallow && _ && this.route === m && !i))
795
- return {
796
- ..._,
797
- route: m
798
- };
799
- }
800
- if ((0, Xe.isAPIRoute)(m))
801
- return O({
802
- url: d,
803
- router: this
804
- }), new Promise(() => {
805
- });
806
- const N = W || await this.fetchComponent(m).then((T) => ({
807
- Component: T.page,
808
- styleSheets: T.styleSheets,
809
- __N_SSG: T.mod.__N_SSG,
810
- __N_SSP: T.mod.__N_SSP
811
- }));
812
- if (process.env.NODE_ENV !== "production") {
813
- const { isValidElementType: T } = It();
814
- if (!T(N.Component))
815
- throw new Error('The default export is not a React Component in page: "' + e + '"');
816
- }
817
- const $ = o == null || (y = o.response) == null ? void 0 : y.headers.get("x-middleware-skip"), C = N.__N_SSG || N.__N_SSP;
818
- $ && (o != null && o.dataHref) && delete this.sdc[o.dataHref];
819
- const { props: H, cacheKey: ce } = await this._getData(async () => {
820
- if (C) {
821
- if (o != null && o.json && !$)
822
- return {
823
- cacheKey: o.cacheKey,
824
- props: o.json
825
- };
826
- const T = o != null && o.dataHref ? o.dataHref : this.pageLoader.getDataHref({
827
- href: (0, A.formatWithValidation)({
828
- pathname: e,
829
- query: a
830
- }),
831
- asPath: p,
832
- locale: v
833
- }), Y = await ne({
834
- dataHref: T,
835
- isServerRender: this.isSsr,
836
- parseJSON: !0,
837
- inflightCache: $ ? {} : this.sdc,
838
- persistCache: !f,
839
- isPrefetch: !1,
840
- unstable_skipClientCache: R
841
- });
842
- return {
843
- cacheKey: Y.cacheKey,
844
- props: Y.json || {}
845
- };
846
- }
847
- return {
848
- headers: {},
849
- props: await this.getInitialProps(
850
- N.Component,
851
- // we provide AppTree later so this needs to be `any`
852
- {
853
- pathname: e,
854
- query: a,
855
- asPath: d,
856
- locale: v,
857
- locales: this.locales,
858
- defaultLocale: this.defaultLocale
859
- }
860
- )
861
- };
862
- });
863
- return N.__N_SSP && b.dataHref && ce && delete this.sdc[ce], !this.isPreview && N.__N_SSG && process.env.NODE_ENV !== "development" && !l && ne(Object.assign({}, b, {
864
- isBackground: !0,
865
- persistCache: !1,
866
- inflightCache: this.sbc
867
- })).catch(() => {
868
- }), H.pageProps = Object.assign({}, H.pageProps), N.props = H, N.route = m, N.query = a, N.resolvedAs = p, this.components[m] = N, N;
869
- } catch (_) {
870
- return this.handleRouteInfoError((0, se.getProperError)(_), e, a, d, n);
871
- }
872
- }
873
- set(r, t, e) {
874
- return this.state = r, this.sub(t, this.components["/_app"].Component, e);
875
- }
876
- /**
877
- * Callback to execute before replacing router state
878
- * @param cb callback to be executed
879
- */
880
- beforePopState(r) {
881
- this._bps = r;
882
- }
883
- onlyAHashChange(r) {
884
- if (!this.asPath) return !1;
885
- const [t, e] = this.asPath.split("#", 2), [a, d] = r.split("#", 2);
886
- return d && t === a && e === d ? !0 : t !== a ? !1 : e !== d;
887
- }
888
- scrollToHash(r) {
889
- const [, t = ""] = r.split("#", 2);
890
- (0, Je.handleSmoothScroll)(() => {
891
- if (t === "" || t === "top") {
892
- window.scrollTo(0, 0);
893
- return;
894
- }
895
- const e = decodeURIComponent(t), a = document.getElementById(e);
896
- if (a) {
897
- a.scrollIntoView();
898
- return;
899
- }
900
- const d = document.getElementsByName(e)[0];
901
- d && d.scrollIntoView();
902
- }, {
903
- onlyHashChange: this.onlyAHashChange(r)
904
- });
905
- }
906
- urlIsNew(r) {
907
- return this.asPath !== r;
908
- }
909
- /**
910
- * Prefetch page code, you may wait for the data during page rendering.
911
- * This feature only works in production!
912
- * @param url the href of prefetched page
913
- * @param asPath the as path of the prefetched page
914
- */
915
- async prefetch(r, t, e) {
916
- if (t === void 0 && (t = r), e === void 0 && (e = {}), process.env.NODE_ENV !== "production" || typeof window < "u" && (0, Ge.isBot)(window.navigator.userAgent))
917
- return;
918
- let a = (0, j.parseRelativeUrl)(r);
919
- const d = a.pathname;
920
- let { pathname: p, query: n } = a;
921
- const v = p;
922
- if (process.env.__NEXT_I18N_SUPPORT && e.locale === !1) {
923
- p = (0, F.normalizeLocalePath)(p, this.locales).pathname, a.pathname = p, r = (0, A.formatWithValidation)(a);
924
- let m = (0, j.parseRelativeUrl)(t);
925
- const h = (0, F.normalizeLocalePath)(m.pathname, this.locales);
926
- m.pathname = h.pathname, e.locale = h.detectedLocale || this.defaultLocale, t = (0, A.formatWithValidation)(m);
927
- }
928
- const i = await this.pageLoader.getPageList();
929
- let f = t;
930
- const R = typeof e.locale < "u" ? e.locale || void 0 : this.locale, l = await oe({
931
- asPath: t,
932
- locale: R,
933
- router: this
934
- });
935
- if (process.env.__NEXT_HAS_REWRITES && t.startsWith("/")) {
936
- let m;
937
- ({ __rewrites: m } = await (0, K.getClientBuildManifest)());
938
- const h = (0, he.default)((0, E.addBasePath)((0, M.addLocale)(t, this.locale), !0), i, m, a.query, (w) => V(w, i), this.locales);
939
- if (h.externalDest)
940
- return;
941
- l || (f = (0, ue.removeLocale)((0, I.removeBasePath)(h.asPath), this.locale)), h.matchedPage && h.resolvedHref && (p = h.resolvedHref, a.pathname = p, l || (r = (0, A.formatWithValidation)(a)));
942
- }
943
- a.pathname = V(a.pathname, i), (0, X.isDynamicRoute)(a.pathname) && (p = a.pathname, a.pathname = p, Object.assign(n, (0, ie.getRouteMatcher)((0, te.getRouteRegex)(a.pathname))((0, re.parsePath)(t).pathname) || {}), l || (r = (0, A.formatWithValidation)(a)));
944
- const g = process.env.__NEXT_MIDDLEWARE_PREFETCH === "strict" ? null : await Ne({
945
- fetchData: () => ne({
946
- dataHref: this.pageLoader.getDataHref({
947
- href: (0, A.formatWithValidation)({
948
- pathname: v,
949
- query: n
950
- }),
951
- skipInterpolation: !0,
952
- asPath: f,
953
- locale: R
954
- }),
955
- hasMiddleware: !0,
956
- isServerRender: !1,
957
- parseJSON: !0,
958
- inflightCache: this.sdc,
959
- persistCache: !this.isPreview,
960
- isPrefetch: !0
961
- }),
962
- asPath: t,
963
- locale: R,
964
- router: this
965
- });
966
- if ((g == null ? void 0 : g.effect.type) === "rewrite" && (a.pathname = g.effect.resolvedHref, p = g.effect.resolvedHref, n = {
967
- ...n,
968
- ...g.effect.parsedAs.query
969
- }, f = g.effect.parsedAs.pathname, r = (0, A.formatWithValidation)(a)), (g == null ? void 0 : g.effect.type) === "redirect-external")
970
- return;
971
- const c = (0, U.removeTrailingSlash)(p);
972
- await this._bfl(t, f, e.locale, !0) && (this.components[d] = {
973
- __appRouter: !0
974
- }), await Promise.all([
975
- this.pageLoader._isSsg(c).then((m) => m ? ne({
976
- dataHref: g != null && g.json ? g == null ? void 0 : g.dataHref : this.pageLoader.getDataHref({
977
- href: r,
978
- asPath: f,
979
- locale: R
980
- }),
981
- isServerRender: !1,
982
- parseJSON: !0,
983
- inflightCache: this.sdc,
984
- persistCache: !this.isPreview,
985
- isPrefetch: !0,
986
- unstable_skipClientCache: e.unstable_skipClientCache || e.priority && !!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE
987
- }).then(() => !1).catch(() => !1) : !1),
988
- this.pageLoader[e.priority ? "loadPage" : "prefetch"](c)
989
- ]);
990
- }
991
- async fetchComponent(r) {
992
- const t = Ce({
993
- route: r,
994
- router: this
995
- });
996
- try {
997
- const e = await this.pageLoader.loadPage(r);
998
- return t(), e;
999
- } catch (e) {
1000
- throw t(), e;
1001
- }
1002
- }
1003
- _getData(r) {
1004
- let t = !1;
1005
- const e = () => {
1006
- t = !0;
1007
- };
1008
- return this.clc = e, r().then((a) => {
1009
- if (e === this.clc && (this.clc = null), t) {
1010
- const d = new Error("Loading initial props cancelled");
1011
- throw d.cancelled = !0, d;
1012
- }
1013
- return a;
1014
- });
1015
- }
1016
- getInitialProps(r, t) {
1017
- const { Component: e } = this.components["/_app"], a = this._wrapApp(e);
1018
- return t.AppTree = a, (0, J.loadGetInitialProps)(e, {
1019
- AppTree: a,
1020
- Component: r,
1021
- router: this,
1022
- ctx: t
1023
- });
1024
- }
1025
- get route() {
1026
- return this.state.route;
1027
- }
1028
- get pathname() {
1029
- return this.state.pathname;
1030
- }
1031
- get query() {
1032
- return this.state.query;
1033
- }
1034
- get asPath() {
1035
- return this.state.asPath;
1036
- }
1037
- get locale() {
1038
- return this.state.locale;
1039
- }
1040
- get isFallback() {
1041
- return this.state.isFallback;
1042
- }
1043
- get isPreview() {
1044
- return this.state.isPreview;
1045
- }
1046
- constructor(r, t, e, { initialProps: a, pageLoader: d, App: p, wrapApp: n, Component: v, err: i, subscription: f, isFallback: R, locale: l, locales: g, defaultLocale: c, domainLocales: m, isPreview: h }) {
1047
- this.sdc = {}, this.sbc = {}, this.isFirstPopStateEvent = !0, this._key = me(), this.onPopState = (y) => {
1048
- const { isFirstPopStateEvent: _ } = this;
1049
- this.isFirstPopStateEvent = !1;
1050
- const P = y.state;
1051
- if (!P) {
1052
- const { pathname: C, query: H } = this;
1053
- this.changeState("replaceState", (0, A.formatWithValidation)({
1054
- pathname: (0, E.addBasePath)(C),
1055
- query: H
1056
- }), (0, J.getURL)());
1057
- return;
1058
- }
1059
- if (P.__NA) {
1060
- window.location.reload();
1061
- return;
1062
- }
1063
- if (!P.__N || _ && this.locale === P.options.locale && P.as === this.asPath)
1064
- return;
1065
- let W;
1066
- const { url: G, as: b, options: o, key: N } = P;
1067
- if (process.env.__NEXT_SCROLL_RESTORATION && pe && this._key !== N) {
1068
- try {
1069
- sessionStorage.setItem("__next_scroll_" + this._key, JSON.stringify({
1070
- x: self.pageXOffset,
1071
- y: self.pageYOffset
1072
- }));
1073
- } catch {
1074
- }
1075
- try {
1076
- const C = sessionStorage.getItem("__next_scroll_" + N);
1077
- W = JSON.parse(C);
1078
- } catch {
1079
- W = {
1080
- x: 0,
1081
- y: 0
1082
- };
1083
- }
1084
- }
1085
- this._key = N;
1086
- const { pathname: $ } = (0, j.parseRelativeUrl)(G);
1087
- this.isSsr && b === (0, E.addBasePath)(this.asPath) && $ === (0, E.addBasePath)(this.pathname) || this._bps && !this._bps(P) || this.change("replaceState", G, b, Object.assign({}, o, {
1088
- shallow: o.shallow && this._shallow,
1089
- locale: o.locale || this.defaultLocale,
1090
- // @ts-ignore internal value not exposed on types
1091
- _h: 0
1092
- }), W);
1093
- };
1094
- const w = (0, U.removeTrailingSlash)(r);
1095
- this.components = {}, r !== "/_error" && (this.components[w] = {
1096
- Component: v,
1097
- initial: !0,
1098
- props: a,
1099
- err: i,
1100
- __N_SSG: a && a.__N_SSG,
1101
- __N_SSP: a && a.__N_SSP
1102
- }), this.components["/_app"] = {
1103
- Component: p,
1104
- styleSheets: []
1105
- }, this.events = D.events, this.pageLoader = d;
1106
- const S = (0, X.isDynamicRoute)(r) && self.__NEXT_DATA__.autoExport;
1107
- if (this.basePath = process.env.__NEXT_ROUTER_BASEPATH || "", this.sub = f, this.clc = null, this._wrapApp = n, this.isSsr = !0, this.isLocaleDomain = !1, this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.isExperimentalCompile || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !S && !self.location.search && !process.env.__NEXT_HAS_REWRITES), process.env.__NEXT_I18N_SUPPORT && (this.locales = g, this.defaultLocale = c, this.domainLocales = m, this.isLocaleDomain = !!(0, Pe.detectDomainLocale)(m, self.location.hostname)), this.state = {
1108
- route: w,
1109
- pathname: r,
1110
- query: t,
1111
- asPath: S ? r : e,
1112
- isPreview: !!h,
1113
- locale: process.env.__NEXT_I18N_SUPPORT ? l : void 0,
1114
- isFallback: R
1115
- }, this._initialMatchesMiddlewarePromise = Promise.resolve(!1), typeof window < "u") {
1116
- if (!e.startsWith("//")) {
1117
- const y = {
1118
- locale: l
1119
- }, _ = (0, J.getURL)();
1120
- this._initialMatchesMiddlewarePromise = oe({
1121
- router: this,
1122
- locale: l,
1123
- asPath: _
1124
- }).then((P) => (y._shouldResolveHref = e !== r, this.changeState("replaceState", P ? _ : (0, A.formatWithValidation)({
1125
- pathname: (0, E.addBasePath)(r),
1126
- query: t
1127
- }), _, y), P));
1128
- }
1129
- window.addEventListener("popstate", this.onPopState), process.env.__NEXT_SCROLL_RESTORATION && pe && (window.history.scrollRestoration = "manual");
1130
- }
1131
- }
1132
- }
1133
- D.events = (0, Fe.default)();
1134
- }(ge), ge);
2
+ import i from "./index82.mjs";
3
+ import h from "./index96.mjs";
4
+ const c = (s) => s instanceof h ? { ...s } : s;
5
+ function C(s, f) {
6
+ f = f || {};
7
+ const u = {};
8
+ function d(t, e, r, o) {
9
+ return i.isPlainObject(t) && i.isPlainObject(e) ? i.merge.call({ caseless: o }, t, e) : i.isPlainObject(e) ? i.merge({}, e) : i.isArray(e) ? e.slice() : e;
10
+ }
11
+ function l(t, e, r, o) {
12
+ if (i.isUndefined(e)) {
13
+ if (!i.isUndefined(t))
14
+ return d(void 0, t, r, o);
15
+ } else return d(t, e, r, o);
16
+ }
17
+ function a(t, e) {
18
+ if (!i.isUndefined(e))
19
+ return d(void 0, e);
20
+ }
21
+ function n(t, e) {
22
+ if (i.isUndefined(e)) {
23
+ if (!i.isUndefined(t))
24
+ return d(void 0, t);
25
+ } else return d(void 0, e);
26
+ }
27
+ function m(t, e, r) {
28
+ if (r in f)
29
+ return d(t, e);
30
+ if (r in s)
31
+ return d(void 0, t);
32
+ }
33
+ const g = {
34
+ url: a,
35
+ method: a,
36
+ data: a,
37
+ baseURL: n,
38
+ transformRequest: n,
39
+ transformResponse: n,
40
+ paramsSerializer: n,
41
+ timeout: n,
42
+ timeoutMessage: n,
43
+ withCredentials: n,
44
+ withXSRFToken: n,
45
+ adapter: n,
46
+ responseType: n,
47
+ xsrfCookieName: n,
48
+ xsrfHeaderName: n,
49
+ onUploadProgress: n,
50
+ onDownloadProgress: n,
51
+ decompress: n,
52
+ maxContentLength: n,
53
+ maxBodyLength: n,
54
+ beforeRedirect: n,
55
+ transport: n,
56
+ httpAgent: n,
57
+ httpsAgent: n,
58
+ cancelToken: n,
59
+ socketPath: n,
60
+ responseEncoding: n,
61
+ validateStatus: m,
62
+ headers: (t, e, r) => l(c(t), c(e), r, !0)
63
+ };
64
+ return i.forEach(Object.keys({ ...s, ...f }), function(e) {
65
+ const r = g[e] || l, o = r(s[e], f[e], e);
66
+ i.isUndefined(o) && r !== m || (u[e] = o);
67
+ }), u;
1135
68
  }
1136
69
  export {
1137
- Pr as __require
70
+ C as default
1138
71
  };