21927.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. exports.id = 21927;
  2. exports.ids = [21927];
  3. exports.modules = {
  4. /***/ 28264:
  5. /***/ ((__unused_webpack_module, exports) => {
  6. "use strict";
  7. var __webpack_unused_export__;
  8. __webpack_unused_export__ = ({
  9. value: true
  10. });
  11. exports.Z = prettyBytes;
  12. function prettyBytes(number, options) {
  13. if (!Number.isFinite(number)) {
  14. throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
  15. }
  16. options = Object.assign({}, options);
  17. if (options.signed && number === 0) {
  18. return " 0 B";
  19. }
  20. const isNegative = number < 0;
  21. const prefix = isNegative ? "-" : options.signed ? "+" : "";
  22. if (isNegative) {
  23. number = -number;
  24. }
  25. if (number < 1) {
  26. const numberString = toLocaleString(number, options.locale);
  27. return prefix + numberString + " B";
  28. }
  29. const exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1);
  30. number = Number((number / Math.pow(1000, exponent)).toPrecision(3));
  31. const numberString = toLocaleString(number, options.locale);
  32. const unit = UNITS[exponent];
  33. return prefix + numberString + " " + unit;
  34. }
  35. /*
  36. MIT License
  37. Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
  38. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  39. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  40. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  41. */ const UNITS = [
  42. "B",
  43. "kB",
  44. "MB",
  45. "GB",
  46. "TB",
  47. "PB",
  48. "EB",
  49. "ZB",
  50. "YB"
  51. ];
  52. /*
  53. Formats the given number using `Number#toLocaleString`.
  54. - If locale is a string, the value is expected to be a locale-key (for example: `de`).
  55. - If locale is true, the system default locale is used for translation.
  56. - If no value for locale is specified, the number is returned unmodified.
  57. */ const toLocaleString = (number, locale)=>{
  58. let result = number;
  59. if (typeof locale === "string") {
  60. result = number.toLocaleString(locale);
  61. } else if (locale === true) {
  62. result = number.toLocaleString();
  63. }
  64. return result;
  65. };
  66. //# sourceMappingURL=pretty-bytes.js.map
  67. /***/ }),
  68. /***/ 21927:
  69. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  70. module.exports = __webpack_require__(16631)
  71. /***/ }),
  72. /***/ 16631:
  73. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  74. "use strict";
  75. var __webpack_unused_export__;
  76. __webpack_unused_export__ = ({
  77. value: true
  78. });
  79. exports.Html = Html;
  80. exports.Main = Main;
  81. exports["default"] = void 0;
  82. var _react = _interopRequireWildcard(__webpack_require__(16689));
  83. var _constants = __webpack_require__(56724);
  84. var _getPageFiles = __webpack_require__(94140);
  85. var _htmlescape = __webpack_require__(89716);
  86. var _isError = _interopRequireDefault(__webpack_require__(11497));
  87. var _htmlContext = __webpack_require__(18743);
  88. class Document extends _react.default.Component {
  89. /**
  90. * `getInitialProps` hook returns the context object with the addition of `renderPage`.
  91. * `renderPage` callback executes `React` rendering logic synchronously to support server-rendering wrappers
  92. */ static getInitialProps(ctx) {
  93. return ctx.defaultGetInitialProps(ctx);
  94. }
  95. render() {
  96. return /*#__PURE__*/ _react.default.createElement(Html, null, /*#__PURE__*/ _react.default.createElement(Head, null), /*#__PURE__*/ _react.default.createElement("body", null, /*#__PURE__*/ _react.default.createElement(Main, null), /*#__PURE__*/ _react.default.createElement(NextScript, null)));
  97. }
  98. }
  99. exports["default"] = Document;
  100. function _interopRequireDefault(obj) {
  101. return obj && obj.__esModule ? obj : {
  102. default: obj
  103. };
  104. }
  105. function _getRequireWildcardCache() {
  106. if (typeof WeakMap !== "function") return null;
  107. var cache = new WeakMap();
  108. _getRequireWildcardCache = function() {
  109. return cache;
  110. };
  111. return cache;
  112. }
  113. function _interopRequireWildcard(obj) {
  114. if (obj && obj.__esModule) {
  115. return obj;
  116. }
  117. if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
  118. return {
  119. default: obj
  120. };
  121. }
  122. var cache = _getRequireWildcardCache();
  123. if (cache && cache.has(obj)) {
  124. return cache.get(obj);
  125. }
  126. var newObj = {};
  127. var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
  128. for(var key in obj){
  129. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  130. var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
  131. if (desc && (desc.get || desc.set)) {
  132. Object.defineProperty(newObj, key, desc);
  133. } else {
  134. newObj[key] = obj[key];
  135. }
  136. }
  137. }
  138. newObj.default = obj;
  139. if (cache) {
  140. cache.set(obj, newObj);
  141. }
  142. return newObj;
  143. }
  144. function getDocumentFiles(buildManifest, pathname, inAmpMode) {
  145. const sharedFiles = (0, _getPageFiles).getPageFiles(buildManifest, "/_app");
  146. const pageFiles = true && inAmpMode ? [] : (0, _getPageFiles).getPageFiles(buildManifest, pathname);
  147. return {
  148. sharedFiles,
  149. pageFiles,
  150. allFiles: [
  151. ...new Set([
  152. ...sharedFiles,
  153. ...pageFiles
  154. ])
  155. ]
  156. };
  157. }
  158. function getPolyfillScripts(context, props) {
  159. // polyfills.js has to be rendered as nomodule without async
  160. // It also has to be the first script to load
  161. const { assetPrefix , buildManifest , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin , } = context;
  162. return buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith(".js") && !polyfill.endsWith(".module.js")).map((polyfill)=>/*#__PURE__*/ _react.default.createElement("script", {
  163. key: polyfill,
  164. defer: !disableOptimizedLoading,
  165. nonce: props.nonce,
  166. crossOrigin: props.crossOrigin || crossOrigin,
  167. noModule: true,
  168. src: `${assetPrefix}/_next/${polyfill}${devOnlyCacheBusterQueryString}`
  169. }));
  170. }
  171. function hasComponentProps(child) {
  172. return !!child && !!child.props;
  173. }
  174. function AmpStyles({ styles }) {
  175. if (!styles) return null;
  176. // try to parse styles from fragment for backwards compat
  177. const curStyles = Array.isArray(styles) ? styles : [];
  178. if (styles.props && // @ts-ignore Property 'props' does not exist on type ReactElement
  179. Array.isArray(styles.props.children)) {
  180. const hasStyles = (el)=>{
  181. var ref, ref1;
  182. return el == null ? void 0 : (ref = el.props) == null ? void 0 : (ref1 = ref.dangerouslySetInnerHTML) == null ? void 0 : ref1.__html;
  183. };
  184. // @ts-ignore Property 'props' does not exist on type ReactElement
  185. styles.props.children.forEach((child)=>{
  186. if (Array.isArray(child)) {
  187. child.forEach((el)=>hasStyles(el) && curStyles.push(el));
  188. } else if (hasStyles(child)) {
  189. curStyles.push(child);
  190. }
  191. });
  192. }
  193. /* Add custom styles before AMP styles to prevent accidental overrides */ return /*#__PURE__*/ _react.default.createElement("style", {
  194. "amp-custom": "",
  195. dangerouslySetInnerHTML: {
  196. __html: curStyles.map((style)=>style.props.dangerouslySetInnerHTML.__html).join("").replace(/\/\*# sourceMappingURL=.*\*\//g, "").replace(/\/\*@ sourceURL=.*?\*\//g, "")
  197. }
  198. });
  199. }
  200. function getDynamicChunks(context, props, files) {
  201. const { dynamicImports , assetPrefix , isDevelopment , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin , } = context;
  202. return dynamicImports.map((file)=>{
  203. if (!file.endsWith(".js") || files.allFiles.includes(file)) return null;
  204. return /*#__PURE__*/ _react.default.createElement("script", {
  205. async: !isDevelopment && disableOptimizedLoading,
  206. defer: !disableOptimizedLoading,
  207. key: file,
  208. src: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  209. nonce: props.nonce,
  210. crossOrigin: props.crossOrigin || crossOrigin
  211. });
  212. });
  213. }
  214. function getScripts(context, props, files) {
  215. var ref;
  216. const { assetPrefix , buildManifest , isDevelopment , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin , } = context;
  217. const normalScripts = files.allFiles.filter((file)=>file.endsWith(".js"));
  218. const lowPriorityScripts = (ref = buildManifest.lowPriorityFiles) == null ? void 0 : ref.filter((file)=>file.endsWith(".js"));
  219. return [
  220. ...normalScripts,
  221. ...lowPriorityScripts
  222. ].map((file)=>{
  223. return /*#__PURE__*/ _react.default.createElement("script", {
  224. key: file,
  225. src: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  226. nonce: props.nonce,
  227. async: !isDevelopment && disableOptimizedLoading,
  228. defer: !disableOptimizedLoading,
  229. crossOrigin: props.crossOrigin || crossOrigin
  230. });
  231. });
  232. }
  233. function getPreNextWorkerScripts(context, props) {
  234. const { assetPrefix , scriptLoader , crossOrigin , nextScriptWorkers } = context;
  235. // disable `nextScriptWorkers` in edge runtime
  236. if (!nextScriptWorkers || "nodejs" === "edge") return null;
  237. try {
  238. let { partytownSnippet } = require("@builder.io/partytown/integration");
  239. const children = Array.isArray(props.children) ? props.children : [
  240. props.children
  241. ];
  242. // Check to see if the user has defined their own Partytown configuration
  243. const userDefinedConfig = children.find((child)=>{
  244. var ref, ref2;
  245. return hasComponentProps(child) && (child == null ? void 0 : (ref = child.props) == null ? void 0 : (ref2 = ref.dangerouslySetInnerHTML) == null ? void 0 : ref2.__html.length) && "data-partytown-config" in child.props;
  246. });
  247. return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !userDefinedConfig && /*#__PURE__*/ _react.default.createElement("script", {
  248. "data-partytown-config": "",
  249. dangerouslySetInnerHTML: {
  250. __html: `
  251. partytown = {
  252. lib: "${assetPrefix}/_next/static/~partytown/"
  253. };
  254. `
  255. }
  256. }), /*#__PURE__*/ _react.default.createElement("script", {
  257. "data-partytown": "",
  258. dangerouslySetInnerHTML: {
  259. __html: partytownSnippet()
  260. }
  261. }), (scriptLoader.worker || []).map((file, index)=>{
  262. const { strategy , src , children: scriptChildren , dangerouslySetInnerHTML , ...scriptProps } = file;
  263. let srcProps = {};
  264. if (src) {
  265. // Use external src if provided
  266. srcProps.src = src;
  267. } else if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
  268. // Embed inline script if provided with dangerouslySetInnerHTML
  269. srcProps.dangerouslySetInnerHTML = {
  270. __html: dangerouslySetInnerHTML.__html
  271. };
  272. } else if (scriptChildren) {
  273. // Embed inline script if provided with children
  274. srcProps.dangerouslySetInnerHTML = {
  275. __html: typeof scriptChildren === "string" ? scriptChildren : Array.isArray(scriptChildren) ? scriptChildren.join("") : ""
  276. };
  277. } else {
  278. throw new Error("Invalid usage of next/script. Did you forget to include a src attribute or an inline script? https://nextjs.org/docs/messages/invalid-script");
  279. }
  280. return /*#__PURE__*/ _react.default.createElement("script", Object.assign({}, srcProps, scriptProps, {
  281. type: "text/partytown",
  282. key: src || index,
  283. nonce: props.nonce,
  284. "data-nscript": "worker",
  285. crossOrigin: props.crossOrigin || crossOrigin
  286. }));
  287. }));
  288. } catch (err) {
  289. if ((0, _isError).default(err) && err.code !== "MODULE_NOT_FOUND") {
  290. console.warn(`Warning: ${err.message}`);
  291. }
  292. return null;
  293. }
  294. }
  295. function getPreNextScripts(context, props) {
  296. const { scriptLoader , disableOptimizedLoading , crossOrigin } = context;
  297. const webWorkerScripts = getPreNextWorkerScripts(context, props);
  298. const beforeInteractiveScripts = (scriptLoader.beforeInteractive || []).filter((script)=>script.src).map((file, index)=>{
  299. const { strategy , ...scriptProps } = file;
  300. var _defer;
  301. return /*#__PURE__*/ _react.default.createElement("script", Object.assign({}, scriptProps, {
  302. key: scriptProps.src || index,
  303. defer: (_defer = scriptProps.defer) != null ? _defer : !disableOptimizedLoading,
  304. nonce: props.nonce,
  305. "data-nscript": "beforeInteractive",
  306. crossOrigin: props.crossOrigin || crossOrigin
  307. }));
  308. });
  309. return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, webWorkerScripts, beforeInteractiveScripts);
  310. }
  311. function getHeadHTMLProps(props) {
  312. const { crossOrigin , nonce , ...restProps } = props;
  313. // This assignment is necessary for additional type checking to avoid unsupported attributes in <head>
  314. const headProps = restProps;
  315. return headProps;
  316. }
  317. function getAmpPath(ampPath, asPath) {
  318. return ampPath || `${asPath}${asPath.includes("?") ? "&" : "?"}amp=1`;
  319. }
  320. class Head extends _react.default.Component {
  321. static contextType = _htmlContext.HtmlContext;
  322. getCssLinks(files) {
  323. const { assetPrefix , devOnlyCacheBusterQueryString , dynamicImports , crossOrigin , optimizeCss , optimizeFonts , } = this.context;
  324. const cssFiles = files.allFiles.filter((f)=>f.endsWith(".css"));
  325. const sharedFiles = new Set(files.sharedFiles);
  326. // Unmanaged files are CSS files that will be handled directly by the
  327. // webpack runtime (`mini-css-extract-plugin`).
  328. let unmangedFiles = new Set([]);
  329. let dynamicCssFiles = Array.from(new Set(dynamicImports.filter((file)=>file.endsWith(".css"))));
  330. if (dynamicCssFiles.length) {
  331. const existing = new Set(cssFiles);
  332. dynamicCssFiles = dynamicCssFiles.filter((f)=>!(existing.has(f) || sharedFiles.has(f)));
  333. unmangedFiles = new Set(dynamicCssFiles);
  334. cssFiles.push(...dynamicCssFiles);
  335. }
  336. let cssLinkElements = [];
  337. cssFiles.forEach((file)=>{
  338. const isSharedFile = sharedFiles.has(file);
  339. if (!optimizeCss) {
  340. cssLinkElements.push(/*#__PURE__*/ _react.default.createElement("link", {
  341. key: `${file}-preload`,
  342. nonce: this.props.nonce,
  343. rel: "preload",
  344. href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  345. as: "style",
  346. crossOrigin: this.props.crossOrigin || crossOrigin
  347. }));
  348. }
  349. const isUnmanagedFile = unmangedFiles.has(file);
  350. cssLinkElements.push(/*#__PURE__*/ _react.default.createElement("link", {
  351. key: file,
  352. nonce: this.props.nonce,
  353. rel: "stylesheet",
  354. href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  355. crossOrigin: this.props.crossOrigin || crossOrigin,
  356. "data-n-g": isUnmanagedFile ? undefined : isSharedFile ? "" : undefined,
  357. "data-n-p": isUnmanagedFile ? undefined : isSharedFile ? undefined : ""
  358. }));
  359. });
  360. if ( true && optimizeFonts) {
  361. cssLinkElements = this.makeStylesheetInert(cssLinkElements);
  362. }
  363. return cssLinkElements.length === 0 ? null : cssLinkElements;
  364. }
  365. getPreloadDynamicChunks() {
  366. const { dynamicImports , assetPrefix , devOnlyCacheBusterQueryString , crossOrigin , } = this.context;
  367. return dynamicImports.map((file)=>{
  368. if (!file.endsWith(".js")) {
  369. return null;
  370. }
  371. return /*#__PURE__*/ _react.default.createElement("link", {
  372. rel: "preload",
  373. key: file,
  374. href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  375. as: "script",
  376. nonce: this.props.nonce,
  377. crossOrigin: this.props.crossOrigin || crossOrigin
  378. });
  379. }) // Filter out nulled scripts
  380. .filter(Boolean);
  381. }
  382. getPreloadMainLinks(files) {
  383. const { assetPrefix , devOnlyCacheBusterQueryString , scriptLoader , crossOrigin , } = this.context;
  384. const preloadFiles = files.allFiles.filter((file)=>{
  385. return file.endsWith(".js");
  386. });
  387. return [
  388. ...(scriptLoader.beforeInteractive || []).map((file)=>/*#__PURE__*/ _react.default.createElement("link", {
  389. key: file.src,
  390. nonce: this.props.nonce,
  391. rel: "preload",
  392. href: file.src,
  393. as: "script",
  394. crossOrigin: this.props.crossOrigin || crossOrigin
  395. })),
  396. ...preloadFiles.map((file)=>/*#__PURE__*/ _react.default.createElement("link", {
  397. key: file,
  398. nonce: this.props.nonce,
  399. rel: "preload",
  400. href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  401. as: "script",
  402. crossOrigin: this.props.crossOrigin || crossOrigin
  403. })),
  404. ];
  405. }
  406. getBeforeInteractiveInlineScripts() {
  407. const { scriptLoader } = this.context;
  408. const { nonce , crossOrigin } = this.props;
  409. return (scriptLoader.beforeInteractive || []).filter((script)=>!script.src && (script.dangerouslySetInnerHTML || script.children)).map((file, index)=>{
  410. const { strategy , children , dangerouslySetInnerHTML , src , ...scriptProps } = file;
  411. let html = "";
  412. if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
  413. html = dangerouslySetInnerHTML.__html;
  414. } else if (children) {
  415. html = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
  416. }
  417. return /*#__PURE__*/ _react.default.createElement("script", Object.assign({}, scriptProps, {
  418. dangerouslySetInnerHTML: {
  419. __html: html
  420. },
  421. key: scriptProps.id || index,
  422. nonce: nonce,
  423. "data-nscript": "beforeInteractive",
  424. crossOrigin: crossOrigin || undefined
  425. }));
  426. });
  427. }
  428. getDynamicChunks(files) {
  429. return getDynamicChunks(this.context, this.props, files);
  430. }
  431. getPreNextScripts() {
  432. return getPreNextScripts(this.context, this.props);
  433. }
  434. getScripts(files) {
  435. return getScripts(this.context, this.props, files);
  436. }
  437. getPolyfillScripts() {
  438. return getPolyfillScripts(this.context, this.props);
  439. }
  440. makeStylesheetInert(node) {
  441. return _react.default.Children.map(node, (c)=>{
  442. var ref5, ref3;
  443. if ((c == null ? void 0 : c.type) === "link" && (c == null ? void 0 : (ref5 = c.props) == null ? void 0 : ref5.href) && _constants.OPTIMIZED_FONT_PROVIDERS.some(({ url })=>{
  444. var ref, ref4;
  445. return c == null ? void 0 : (ref = c.props) == null ? void 0 : (ref4 = ref.href) == null ? void 0 : ref4.startsWith(url);
  446. })) {
  447. const newProps = {
  448. ...c.props || {},
  449. "data-href": c.props.href,
  450. href: undefined
  451. };
  452. return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
  453. } else if (c == null ? void 0 : (ref3 = c.props) == null ? void 0 : ref3.children) {
  454. const newProps1 = {
  455. ...c.props || {},
  456. children: this.makeStylesheetInert(c.props.children)
  457. };
  458. return /*#__PURE__*/ _react.default.cloneElement(c, newProps1);
  459. }
  460. return c;
  461. }).filter(Boolean);
  462. }
  463. render() {
  464. const { styles , ampPath , inAmpMode , hybridAmp , canonicalBase , __NEXT_DATA__ , dangerousAsPath , headTags , unstable_runtimeJS , unstable_JsPreload , disableOptimizedLoading , optimizeCss , optimizeFonts , } = this.context;
  465. const disableRuntimeJS = unstable_runtimeJS === false;
  466. const disableJsPreload = unstable_JsPreload === false || !disableOptimizedLoading;
  467. this.context.docComponentsRendered.Head = true;
  468. let { head } = this.context;
  469. let cssPreloads = [];
  470. let otherHeadElements = [];
  471. if (head) {
  472. head.forEach((c)=>{
  473. if (c && c.type === "link" && c.props["rel"] === "preload" && c.props["as"] === "style") {
  474. cssPreloads.push(c);
  475. } else {
  476. c && otherHeadElements.push(c);
  477. }
  478. });
  479. head = cssPreloads.concat(otherHeadElements);
  480. }
  481. let children = _react.default.Children.toArray(this.props.children).filter(Boolean);
  482. // show a warning if Head contains <title> (only in development)
  483. if (false) {}
  484. if ( true && optimizeFonts && !( true && inAmpMode)) {
  485. children = this.makeStylesheetInert(children);
  486. }
  487. let hasAmphtmlRel = false;
  488. let hasCanonicalRel = false;
  489. // show warning and remove conflicting amp head tags
  490. head = _react.default.Children.map(head || [], (child)=>{
  491. if (!child) return child;
  492. const { type , props } = child;
  493. if ( true && inAmpMode) {
  494. let badProp = "";
  495. if (type === "meta" && props.name === "viewport") {
  496. badProp = 'name="viewport"';
  497. } else if (type === "link" && props.rel === "canonical") {
  498. hasCanonicalRel = true;
  499. } else if (type === "script") {
  500. // only block if
  501. // 1. it has a src and isn't pointing to ampproject's CDN
  502. // 2. it is using dangerouslySetInnerHTML without a type or
  503. // a type of text/javascript
  504. if (props.src && props.src.indexOf("ampproject") < -1 || props.dangerouslySetInnerHTML && (!props.type || props.type === "text/javascript")) {
  505. badProp = "<script";
  506. Object.keys(props).forEach((prop)=>{
  507. badProp += ` ${prop}="${props[prop]}"`;
  508. });
  509. badProp += "/>";
  510. }
  511. }
  512. if (badProp) {
  513. console.warn(`Found conflicting amp tag "${child.type}" with conflicting prop ${badProp} in ${__NEXT_DATA__.page}. https://nextjs.org/docs/messages/conflicting-amp-tag`);
  514. return null;
  515. }
  516. } else {
  517. // non-amp mode
  518. if (type === "link" && props.rel === "amphtml") {
  519. hasAmphtmlRel = true;
  520. }
  521. }
  522. return child;
  523. });
  524. const files = getDocumentFiles(this.context.buildManifest, this.context.__NEXT_DATA__.page, true && inAmpMode);
  525. var _nonce, _nonce1;
  526. return /*#__PURE__*/ _react.default.createElement("head", Object.assign({}, getHeadHTMLProps(this.props)), this.context.isDevelopment && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement("style", {
  527. "data-next-hide-fouc": true,
  528. "data-ampdevmode": true && inAmpMode ? "true" : undefined,
  529. dangerouslySetInnerHTML: {
  530. __html: `body{display:none}`
  531. }
  532. }), /*#__PURE__*/ _react.default.createElement("noscript", {
  533. "data-next-hide-fouc": true,
  534. "data-ampdevmode": true && inAmpMode ? "true" : undefined
  535. }, /*#__PURE__*/ _react.default.createElement("style", {
  536. dangerouslySetInnerHTML: {
  537. __html: `body{display:block}`
  538. }
  539. }))), head, /*#__PURE__*/ _react.default.createElement("meta", {
  540. name: "next-head-count",
  541. content: _react.default.Children.count(head || []).toString()
  542. }), children, optimizeFonts && /*#__PURE__*/ _react.default.createElement("meta", {
  543. name: "next-font-preconnect"
  544. }), true && inAmpMode && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/ _react.default.createElement("meta", {
  545. name: "viewport",
  546. content: "width=device-width,minimum-scale=1,initial-scale=1"
  547. }), !hasCanonicalRel && /*#__PURE__*/ _react.default.createElement("link", {
  548. rel: "canonical",
  549. href: canonicalBase + (__webpack_require__(76368).cleanAmpPath)(dangerousAsPath)
  550. }), /*#__PURE__*/ _react.default.createElement("link", {
  551. rel: "preload",
  552. as: "script",
  553. href: "https://cdn.ampproject.org/v0.js"
  554. }), /*#__PURE__*/ _react.default.createElement(AmpStyles, {
  555. styles: styles
  556. }), /*#__PURE__*/ _react.default.createElement("style", {
  557. "amp-boilerplate": "",
  558. dangerouslySetInnerHTML: {
  559. __html: `body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}`
  560. }
  561. }), /*#__PURE__*/ _react.default.createElement("noscript", null, /*#__PURE__*/ _react.default.createElement("style", {
  562. "amp-boilerplate": "",
  563. dangerouslySetInnerHTML: {
  564. __html: `body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}`
  565. }
  566. })), /*#__PURE__*/ _react.default.createElement("script", {
  567. async: true,
  568. src: "https://cdn.ampproject.org/v0.js"
  569. })), !( true && inAmpMode) && /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !hasAmphtmlRel && hybridAmp && /*#__PURE__*/ _react.default.createElement("link", {
  570. rel: "amphtml",
  571. href: canonicalBase + getAmpPath(ampPath, dangerousAsPath)
  572. }), this.getBeforeInteractiveInlineScripts(), !optimizeCss && this.getCssLinks(files), !optimizeCss && /*#__PURE__*/ _react.default.createElement("noscript", {
  573. "data-n-css": (_nonce = this.props.nonce) != null ? _nonce : ""
  574. }), !disableRuntimeJS && !disableJsPreload && this.getPreloadDynamicChunks(), !disableRuntimeJS && !disableJsPreload && this.getPreloadMainLinks(files), !disableOptimizedLoading && !disableRuntimeJS && this.getPolyfillScripts(), !disableOptimizedLoading && !disableRuntimeJS && this.getPreNextScripts(), !disableOptimizedLoading && !disableRuntimeJS && this.getDynamicChunks(files), !disableOptimizedLoading && !disableRuntimeJS && this.getScripts(files), optimizeCss && this.getCssLinks(files), optimizeCss && /*#__PURE__*/ _react.default.createElement("noscript", {
  575. "data-n-css": (_nonce1 = this.props.nonce) != null ? _nonce1 : ""
  576. }), this.context.isDevelopment && // this element is used to mount development styles so the
  577. // ordering matches production
  578. // (by default, style-loader injects at the bottom of <head />)
  579. /*#__PURE__*/ _react.default.createElement("noscript", {
  580. id: "__next_css__DO_NOT_USE__"
  581. }), styles || null), /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, {}, ...headTags || []));
  582. }
  583. }
  584. exports.Head = Head;
  585. function handleDocumentScriptLoaderItems(scriptLoader, __NEXT_DATA__, props) {
  586. var ref10, ref7, ref8, ref9;
  587. if (!props.children) return;
  588. const scriptLoaderItems = [];
  589. const children = Array.isArray(props.children) ? props.children : [
  590. props.children
  591. ];
  592. const headChildren = (ref10 = children.find((child)=>child.type === Head)) == null ? void 0 : (ref7 = ref10.props) == null ? void 0 : ref7.children;
  593. const bodyChildren = (ref8 = children.find((child)=>child.type === "body")) == null ? void 0 : (ref9 = ref8.props) == null ? void 0 : ref9.children;
  594. // Scripts with beforeInteractive can be placed inside Head or <body> so children of both needs to be traversed
  595. const combinedChildren = [
  596. ...Array.isArray(headChildren) ? headChildren : [
  597. headChildren
  598. ],
  599. ...Array.isArray(bodyChildren) ? bodyChildren : [
  600. bodyChildren
  601. ],
  602. ];
  603. _react.default.Children.forEach(combinedChildren, (child)=>{
  604. var ref;
  605. if (!child) return;
  606. // When using the `next/script` component, register it in script loader.
  607. if ((ref = child.type) == null ? void 0 : ref.__nextScript) {
  608. if (child.props.strategy === "beforeInteractive") {
  609. scriptLoader.beforeInteractive = (scriptLoader.beforeInteractive || []).concat([
  610. {
  611. ...child.props
  612. },
  613. ]);
  614. return;
  615. } else if ([
  616. "lazyOnload",
  617. "afterInteractive",
  618. "worker"
  619. ].includes(child.props.strategy)) {
  620. scriptLoaderItems.push(child.props);
  621. return;
  622. }
  623. }
  624. });
  625. __NEXT_DATA__.scriptLoader = scriptLoaderItems;
  626. }
  627. class NextScript extends _react.default.Component {
  628. static contextType = _htmlContext.HtmlContext;
  629. getDynamicChunks(files) {
  630. return getDynamicChunks(this.context, this.props, files);
  631. }
  632. getPreNextScripts() {
  633. return getPreNextScripts(this.context, this.props);
  634. }
  635. getScripts(files) {
  636. return getScripts(this.context, this.props, files);
  637. }
  638. getPolyfillScripts() {
  639. return getPolyfillScripts(this.context, this.props);
  640. }
  641. static getInlineScriptSource(context) {
  642. const { __NEXT_DATA__ , largePageDataBytes } = context;
  643. try {
  644. const data = JSON.stringify(__NEXT_DATA__);
  645. const bytes = false ? 0 : Buffer.from(data).byteLength;
  646. const prettyBytes = (__webpack_require__(28264)/* ["default"] */ .Z);
  647. if (largePageDataBytes && bytes > largePageDataBytes) {
  648. console.warn(`Warning: data for page "${__NEXT_DATA__.page}"${__NEXT_DATA__.page === context.dangerousAsPath ? "" : ` (path "${context.dangerousAsPath}")`} is ${prettyBytes(bytes)} which exceeds the threshold of ${prettyBytes(largePageDataBytes)}, this amount of data can reduce performance.\nSee more info here: https://nextjs.org/docs/messages/large-page-data`);
  649. }
  650. return (0, _htmlescape).htmlEscapeJsonString(data);
  651. } catch (err) {
  652. if ((0, _isError).default(err) && err.message.indexOf("circular structure") !== -1) {
  653. throw new Error(`Circular structure in "getInitialProps" result of page "${__NEXT_DATA__.page}". https://nextjs.org/docs/messages/circular-structure`);
  654. }
  655. throw err;
  656. }
  657. }
  658. render() {
  659. const { assetPrefix , inAmpMode , buildManifest , unstable_runtimeJS , docComponentsRendered , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin , } = this.context;
  660. const disableRuntimeJS = unstable_runtimeJS === false;
  661. docComponentsRendered.NextScript = true;
  662. if ( true && inAmpMode) {
  663. if (true) {
  664. return null;
  665. }
  666. const ampDevFiles = [
  667. ...buildManifest.devFiles,
  668. ...buildManifest.polyfillFiles,
  669. ...buildManifest.ampDevFiles,
  670. ];
  671. return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, disableRuntimeJS ? null : /*#__PURE__*/ _react.default.createElement("script", {
  672. id: "__NEXT_DATA__",
  673. type: "application/json",
  674. nonce: this.props.nonce,
  675. crossOrigin: this.props.crossOrigin || crossOrigin,
  676. dangerouslySetInnerHTML: {
  677. __html: NextScript.getInlineScriptSource(this.context)
  678. },
  679. "data-ampdevmode": true
  680. }), ampDevFiles.map((file)=>/*#__PURE__*/ _react.default.createElement("script", {
  681. key: file,
  682. src: `${assetPrefix}/_next/${file}${devOnlyCacheBusterQueryString}`,
  683. nonce: this.props.nonce,
  684. crossOrigin: this.props.crossOrigin || crossOrigin,
  685. "data-ampdevmode": true
  686. })));
  687. }
  688. if (false) {}
  689. const files = getDocumentFiles(this.context.buildManifest, this.context.__NEXT_DATA__.page, true && inAmpMode);
  690. return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !disableRuntimeJS && buildManifest.devFiles ? buildManifest.devFiles.map((file)=>/*#__PURE__*/ _react.default.createElement("script", {
  691. key: file,
  692. src: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`,
  693. nonce: this.props.nonce,
  694. crossOrigin: this.props.crossOrigin || crossOrigin
  695. })) : null, disableRuntimeJS ? null : /*#__PURE__*/ _react.default.createElement("script", {
  696. id: "__NEXT_DATA__",
  697. type: "application/json",
  698. nonce: this.props.nonce,
  699. crossOrigin: this.props.crossOrigin || crossOrigin,
  700. dangerouslySetInnerHTML: {
  701. __html: NextScript.getInlineScriptSource(this.context)
  702. }
  703. }), disableOptimizedLoading && !disableRuntimeJS && this.getPolyfillScripts(), disableOptimizedLoading && !disableRuntimeJS && this.getPreNextScripts(), disableOptimizedLoading && !disableRuntimeJS && this.getDynamicChunks(files), disableOptimizedLoading && !disableRuntimeJS && this.getScripts(files));
  704. }
  705. }
  706. exports.NextScript = NextScript;
  707. function Html(props) {
  708. const { inAmpMode , docComponentsRendered , locale , scriptLoader , __NEXT_DATA__ , } = (0, _react).useContext(_htmlContext.HtmlContext);
  709. docComponentsRendered.Html = true;
  710. handleDocumentScriptLoaderItems(scriptLoader, __NEXT_DATA__, props);
  711. return /*#__PURE__*/ _react.default.createElement("html", Object.assign({}, props, {
  712. lang: props.lang || locale || undefined,
  713. amp: true && inAmpMode ? "" : undefined,
  714. "data-ampdevmode": true && inAmpMode && "production" !== "production" ? 0 : undefined
  715. }));
  716. }
  717. function Main() {
  718. const { docComponentsRendered } = (0, _react).useContext(_htmlContext.HtmlContext);
  719. docComponentsRendered.Main = true;
  720. // @ts-ignore
  721. return /*#__PURE__*/ _react.default.createElement("next-js-internal-body-render-target", null);
  722. }
  723. // Add a special property to the built-in `Document` component so later we can
  724. // identify if a user customized `Document` is used or not.
  725. const InternalFunctionDocument = function InternalFunctionDocument() {
  726. return /*#__PURE__*/ _react.default.createElement(Html, null, /*#__PURE__*/ _react.default.createElement(Head, null), /*#__PURE__*/ _react.default.createElement("body", null, /*#__PURE__*/ _react.default.createElement(Main, null), /*#__PURE__*/ _react.default.createElement(NextScript, null)));
  727. };
  728. Document[_constants.NEXT_BUILTIN_DOCUMENT] = InternalFunctionDocument; //# sourceMappingURL=_document.js.map
  729. /***/ })
  730. };
  731. ;
  732. //# sourceMappingURL=21927.js.map