@epam/ai-dial-modulify-ui 0.23.0-rc.9 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -0
- package/index.esm.js +2464 -1
- package/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/lib/ComponentBuilder.d.ts +2 -0
- package/src/lib/Inversify.d.ts +1 -0
- package/src/lib/utils/appWithJss.d.ts +2 -0
- package/src/lib/utils/documentWithJss.d.ts +7 -0
package/index.esm.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import require$$3 from 'path';
|
|
2
|
+
|
|
3
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
|
+
|
|
1
5
|
var jsxRuntime = {exports: {}};
|
|
2
6
|
|
|
3
7
|
var reactJsxRuntime_production_min = {};
|
|
@@ -10160,6 +10164,34 @@ var create = function create(options) {
|
|
|
10160
10164
|
|
|
10161
10165
|
var preset = create;
|
|
10162
10166
|
|
|
10167
|
+
function shallowEqualObjects(objA, objB) {
|
|
10168
|
+
if (objA === objB) {
|
|
10169
|
+
return true;
|
|
10170
|
+
}
|
|
10171
|
+
|
|
10172
|
+
if (!objA || !objB) {
|
|
10173
|
+
return false;
|
|
10174
|
+
}
|
|
10175
|
+
|
|
10176
|
+
var aKeys = Object.keys(objA);
|
|
10177
|
+
var bKeys = Object.keys(objB);
|
|
10178
|
+
var len = aKeys.length;
|
|
10179
|
+
|
|
10180
|
+
if (bKeys.length !== len) {
|
|
10181
|
+
return false;
|
|
10182
|
+
}
|
|
10183
|
+
|
|
10184
|
+
for (var i = 0; i < len; i++) {
|
|
10185
|
+
var key = aKeys[i];
|
|
10186
|
+
|
|
10187
|
+
if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {
|
|
10188
|
+
return false;
|
|
10189
|
+
}
|
|
10190
|
+
}
|
|
10191
|
+
|
|
10192
|
+
return true;
|
|
10193
|
+
}
|
|
10194
|
+
|
|
10163
10195
|
/**
|
|
10164
10196
|
* Global index counter to preserve source order.
|
|
10165
10197
|
* As we create the style sheet during componentWillMount lifecycle,
|
|
@@ -10469,11 +10501,96 @@ var createUseStyles = function createUseStyles(styles, options) {
|
|
|
10469
10501
|
};
|
|
10470
10502
|
};
|
|
10471
10503
|
|
|
10504
|
+
var initialContext = {};
|
|
10505
|
+
function JssProvider(props) {
|
|
10506
|
+
var managersRef = react.exports.useRef({});
|
|
10507
|
+
var prevContextRef = react.exports.useRef();
|
|
10508
|
+
var registryRef = react.exports.useRef(null);
|
|
10509
|
+
|
|
10510
|
+
var createContext = function createContext(parentContext, prevContext) {
|
|
10511
|
+
if (prevContext === void 0) {
|
|
10512
|
+
prevContext = initialContext;
|
|
10513
|
+
}
|
|
10514
|
+
|
|
10515
|
+
var registry = props.registry,
|
|
10516
|
+
classNamePrefix = props.classNamePrefix,
|
|
10517
|
+
jss = props.jss,
|
|
10518
|
+
generateId = props.generateId,
|
|
10519
|
+
disableStylesGeneration = props.disableStylesGeneration,
|
|
10520
|
+
media = props.media,
|
|
10521
|
+
id = props.id,
|
|
10522
|
+
isSSR = props.isSSR;
|
|
10523
|
+
|
|
10524
|
+
var context = _extends$1({}, parentContext);
|
|
10525
|
+
|
|
10526
|
+
if (registry) {
|
|
10527
|
+
context.registry = registry; // This way we identify a new request on the server, because user will create
|
|
10528
|
+
// a new Registry instance for each.
|
|
10529
|
+
|
|
10530
|
+
if (registry !== registryRef.current) {
|
|
10531
|
+
// We reset managers because we have to regenerate all sheets for the new request.
|
|
10532
|
+
managersRef.current = {};
|
|
10533
|
+
registryRef.current = registry;
|
|
10534
|
+
}
|
|
10535
|
+
}
|
|
10536
|
+
|
|
10537
|
+
context.managers = managersRef.current;
|
|
10538
|
+
|
|
10539
|
+
if (id !== undefined) {
|
|
10540
|
+
context.id = id;
|
|
10541
|
+
}
|
|
10542
|
+
|
|
10543
|
+
if (generateId !== undefined) {
|
|
10544
|
+
context.generateId = generateId;
|
|
10545
|
+
} else if (!context.generateId || !prevContext || context.id !== prevContext.id) {
|
|
10546
|
+
context.generateId = createGenerateId(context.id);
|
|
10547
|
+
}
|
|
10548
|
+
|
|
10549
|
+
if (classNamePrefix) {
|
|
10550
|
+
context.classNamePrefix = (context.classNamePrefix || '') + classNamePrefix;
|
|
10551
|
+
}
|
|
10552
|
+
|
|
10553
|
+
if (media !== undefined) {
|
|
10554
|
+
context.media = media;
|
|
10555
|
+
}
|
|
10556
|
+
|
|
10557
|
+
if (jss) {
|
|
10558
|
+
context.jss = jss;
|
|
10559
|
+
}
|
|
10560
|
+
|
|
10561
|
+
if (disableStylesGeneration !== undefined) {
|
|
10562
|
+
context.disableStylesGeneration = disableStylesGeneration;
|
|
10563
|
+
}
|
|
10564
|
+
|
|
10565
|
+
if (isSSR !== undefined) {
|
|
10566
|
+
context.isSSR = isSSR;
|
|
10567
|
+
}
|
|
10568
|
+
|
|
10569
|
+
if (prevContext && shallowEqualObjects(prevContext, context)) {
|
|
10570
|
+
return prevContext;
|
|
10571
|
+
}
|
|
10572
|
+
|
|
10573
|
+
return context;
|
|
10574
|
+
};
|
|
10575
|
+
|
|
10576
|
+
var renderProvider = function renderProvider(parentContext) {
|
|
10577
|
+
var children = props.children;
|
|
10578
|
+
var context = createContext(parentContext, prevContextRef.current);
|
|
10579
|
+
prevContextRef.current = context;
|
|
10580
|
+
return react.exports.createElement(JssContext.Provider, {
|
|
10581
|
+
value: context
|
|
10582
|
+
}, children);
|
|
10583
|
+
};
|
|
10584
|
+
|
|
10585
|
+
return react.exports.createElement(JssContext.Consumer, null, renderProvider);
|
|
10586
|
+
}
|
|
10587
|
+
|
|
10472
10588
|
const DATA_CUSTOMIZE_ID = 'data-customize-id';
|
|
10473
10589
|
class ComponentBuilder {
|
|
10474
10590
|
constructor(component) {
|
|
10475
10591
|
this.htmlReplacements = {};
|
|
10476
10592
|
this.baseComponent = () => null;
|
|
10593
|
+
this.usedMethods = new Set();
|
|
10477
10594
|
this.stylesFn = () => ({});
|
|
10478
10595
|
this.classNamesFn = () => ({ host: [], component: [] });
|
|
10479
10596
|
this.htmlContentFn = () => null;
|
|
@@ -10511,6 +10628,7 @@ class ComponentBuilder {
|
|
|
10511
10628
|
return new ComponentBuilder(component);
|
|
10512
10629
|
}
|
|
10513
10630
|
updateClassNames(updateFn) {
|
|
10631
|
+
this.checkIfMethodIsUsed('updateClassNames');
|
|
10514
10632
|
if (typeof updateFn === 'function') {
|
|
10515
10633
|
const prevClassNamesFn = this.classNamesFn;
|
|
10516
10634
|
this.classNamesFn = (state) => updateFn(prevClassNamesFn(state), state);
|
|
@@ -10518,6 +10636,7 @@ class ComponentBuilder {
|
|
|
10518
10636
|
return this;
|
|
10519
10637
|
}
|
|
10520
10638
|
updateStyles(updateFn) {
|
|
10639
|
+
this.checkIfMethodIsUsed('updateStyles');
|
|
10521
10640
|
if (typeof updateFn === 'function') {
|
|
10522
10641
|
const prevStylesFn = this.stylesFn;
|
|
10523
10642
|
this.stylesFn = (state) => updateFn(prevStylesFn(state), state);
|
|
@@ -10525,6 +10644,7 @@ class ComponentBuilder {
|
|
|
10525
10644
|
return this;
|
|
10526
10645
|
}
|
|
10527
10646
|
updateHTML(htmlContentFnOrBlocks) {
|
|
10647
|
+
this.checkIfMethodIsUsed('updateHTML');
|
|
10528
10648
|
if (typeof htmlContentFnOrBlocks === 'function') {
|
|
10529
10649
|
this.htmlContentFn = htmlContentFnOrBlocks;
|
|
10530
10650
|
}
|
|
@@ -10537,6 +10657,7 @@ class ComponentBuilder {
|
|
|
10537
10657
|
return this;
|
|
10538
10658
|
}
|
|
10539
10659
|
updateHandlers(updateFn) {
|
|
10660
|
+
this.checkIfMethodIsUsed('updateHandlers');
|
|
10540
10661
|
if (typeof updateFn === 'function') {
|
|
10541
10662
|
const prevHandlersFn = this.handlersFn;
|
|
10542
10663
|
this.handlersFn = (state, setState) => updateFn(prevHandlersFn(state, setState), state, setState);
|
|
@@ -10544,10 +10665,12 @@ class ComponentBuilder {
|
|
|
10544
10665
|
return this;
|
|
10545
10666
|
}
|
|
10546
10667
|
addState(stateFn) {
|
|
10668
|
+
this.checkIfMethodIsUsed('addState');
|
|
10547
10669
|
this.stateFn = stateFn;
|
|
10548
10670
|
return this;
|
|
10549
10671
|
}
|
|
10550
10672
|
addEffects(effectsFn) {
|
|
10673
|
+
this.checkIfMethodIsUsed('addEffects');
|
|
10551
10674
|
this.effectsFn = effectsFn;
|
|
10552
10675
|
return this;
|
|
10553
10676
|
}
|
|
@@ -10607,6 +10730,12 @@ class ComponentBuilder {
|
|
|
10607
10730
|
})));
|
|
10608
10731
|
});
|
|
10609
10732
|
}
|
|
10733
|
+
checkIfMethodIsUsed(methodName) {
|
|
10734
|
+
if (this.usedMethods.has(methodName)) {
|
|
10735
|
+
throw new Error(`ComponentBuilder | Method ${methodName} is already used`);
|
|
10736
|
+
}
|
|
10737
|
+
this.usedMethods.add(methodName);
|
|
10738
|
+
}
|
|
10610
10739
|
}
|
|
10611
10740
|
|
|
10612
10741
|
class Inversify {
|
|
@@ -10667,4 +10796,2338 @@ class Inversify {
|
|
|
10667
10796
|
}
|
|
10668
10797
|
Inversify.container = new WeakMap();
|
|
10669
10798
|
|
|
10670
|
-
|
|
10799
|
+
const SERVER_SIDE_JSS_STYLES_ID$1 = 'server-side-jss-styles';
|
|
10800
|
+
const appWithJss = (App) => {
|
|
10801
|
+
return (props) => {
|
|
10802
|
+
react.exports.useEffect(() => {
|
|
10803
|
+
const animationFrameId = requestAnimationFrame(() => {
|
|
10804
|
+
var _a;
|
|
10805
|
+
const serverStyles = globalThis.document.getElementById(SERVER_SIDE_JSS_STYLES_ID$1);
|
|
10806
|
+
if (serverStyles) {
|
|
10807
|
+
(_a = serverStyles.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(serverStyles);
|
|
10808
|
+
}
|
|
10809
|
+
});
|
|
10810
|
+
return () => {
|
|
10811
|
+
cancelAnimationFrame(animationFrameId);
|
|
10812
|
+
};
|
|
10813
|
+
}, []);
|
|
10814
|
+
return jsxRuntime.exports.jsx(App, Object.assign({}, props));
|
|
10815
|
+
};
|
|
10816
|
+
};
|
|
10817
|
+
|
|
10818
|
+
/******************************************************************************
|
|
10819
|
+
Copyright (c) Microsoft Corporation.
|
|
10820
|
+
|
|
10821
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
10822
|
+
purpose with or without fee is hereby granted.
|
|
10823
|
+
|
|
10824
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10825
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10826
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10827
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
10828
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
10829
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
10830
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
10831
|
+
***************************************************************************** */
|
|
10832
|
+
|
|
10833
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
10834
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10835
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10836
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10837
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10838
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10839
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10840
|
+
});
|
|
10841
|
+
}
|
|
10842
|
+
|
|
10843
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
10844
|
+
var e = new Error(message);
|
|
10845
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
10846
|
+
};
|
|
10847
|
+
|
|
10848
|
+
var _document = {exports: {}};
|
|
10849
|
+
|
|
10850
|
+
var constants = {exports: {}};
|
|
10851
|
+
|
|
10852
|
+
var _interop_require_default$1 = {};
|
|
10853
|
+
|
|
10854
|
+
_interop_require_default$1._ = _interop_require_default$1._interop_require_default = _interop_require_default;
|
|
10855
|
+
function _interop_require_default(obj) {
|
|
10856
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
10857
|
+
}
|
|
10858
|
+
|
|
10859
|
+
const MODERN_BROWSERSLIST_TARGET = [
|
|
10860
|
+
"chrome 64",
|
|
10861
|
+
"edge 79",
|
|
10862
|
+
"firefox 67",
|
|
10863
|
+
"opera 51",
|
|
10864
|
+
"safari 12"
|
|
10865
|
+
];
|
|
10866
|
+
var modernBrowserslistTarget = MODERN_BROWSERSLIST_TARGET;
|
|
10867
|
+
|
|
10868
|
+
(function (module, exports) {
|
|
10869
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10870
|
+
value: true
|
|
10871
|
+
});
|
|
10872
|
+
function _export(target, all) {
|
|
10873
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
10874
|
+
enumerable: true,
|
|
10875
|
+
get: all[name]
|
|
10876
|
+
});
|
|
10877
|
+
}
|
|
10878
|
+
_export(exports, {
|
|
10879
|
+
APP_BUILD_MANIFEST: function() {
|
|
10880
|
+
return APP_BUILD_MANIFEST;
|
|
10881
|
+
},
|
|
10882
|
+
APP_CLIENT_INTERNALS: function() {
|
|
10883
|
+
return APP_CLIENT_INTERNALS;
|
|
10884
|
+
},
|
|
10885
|
+
APP_PATHS_MANIFEST: function() {
|
|
10886
|
+
return APP_PATHS_MANIFEST;
|
|
10887
|
+
},
|
|
10888
|
+
APP_PATH_ROUTES_MANIFEST: function() {
|
|
10889
|
+
return APP_PATH_ROUTES_MANIFEST;
|
|
10890
|
+
},
|
|
10891
|
+
AUTOMATIC_FONT_OPTIMIZATION_MANIFEST: function() {
|
|
10892
|
+
return AUTOMATIC_FONT_OPTIMIZATION_MANIFEST;
|
|
10893
|
+
},
|
|
10894
|
+
BARREL_OPTIMIZATION_PREFIX: function() {
|
|
10895
|
+
return BARREL_OPTIMIZATION_PREFIX;
|
|
10896
|
+
},
|
|
10897
|
+
BLOCKED_PAGES: function() {
|
|
10898
|
+
return BLOCKED_PAGES;
|
|
10899
|
+
},
|
|
10900
|
+
BUILD_ID_FILE: function() {
|
|
10901
|
+
return BUILD_ID_FILE;
|
|
10902
|
+
},
|
|
10903
|
+
BUILD_MANIFEST: function() {
|
|
10904
|
+
return BUILD_MANIFEST;
|
|
10905
|
+
},
|
|
10906
|
+
CLIENT_PUBLIC_FILES_PATH: function() {
|
|
10907
|
+
return CLIENT_PUBLIC_FILES_PATH;
|
|
10908
|
+
},
|
|
10909
|
+
CLIENT_REFERENCE_MANIFEST: function() {
|
|
10910
|
+
return CLIENT_REFERENCE_MANIFEST;
|
|
10911
|
+
},
|
|
10912
|
+
CLIENT_STATIC_FILES_PATH: function() {
|
|
10913
|
+
return CLIENT_STATIC_FILES_PATH;
|
|
10914
|
+
},
|
|
10915
|
+
CLIENT_STATIC_FILES_RUNTIME_AMP: function() {
|
|
10916
|
+
return CLIENT_STATIC_FILES_RUNTIME_AMP;
|
|
10917
|
+
},
|
|
10918
|
+
CLIENT_STATIC_FILES_RUNTIME_MAIN: function() {
|
|
10919
|
+
return CLIENT_STATIC_FILES_RUNTIME_MAIN;
|
|
10920
|
+
},
|
|
10921
|
+
CLIENT_STATIC_FILES_RUNTIME_MAIN_APP: function() {
|
|
10922
|
+
return CLIENT_STATIC_FILES_RUNTIME_MAIN_APP;
|
|
10923
|
+
},
|
|
10924
|
+
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS: function() {
|
|
10925
|
+
return CLIENT_STATIC_FILES_RUNTIME_POLYFILLS;
|
|
10926
|
+
},
|
|
10927
|
+
CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL: function() {
|
|
10928
|
+
return CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL;
|
|
10929
|
+
},
|
|
10930
|
+
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH: function() {
|
|
10931
|
+
return CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH;
|
|
10932
|
+
},
|
|
10933
|
+
CLIENT_STATIC_FILES_RUNTIME_WEBPACK: function() {
|
|
10934
|
+
return CLIENT_STATIC_FILES_RUNTIME_WEBPACK;
|
|
10935
|
+
},
|
|
10936
|
+
COMPILER_INDEXES: function() {
|
|
10937
|
+
return COMPILER_INDEXES;
|
|
10938
|
+
},
|
|
10939
|
+
COMPILER_NAMES: function() {
|
|
10940
|
+
return COMPILER_NAMES;
|
|
10941
|
+
},
|
|
10942
|
+
CONFIG_FILES: function() {
|
|
10943
|
+
return CONFIG_FILES;
|
|
10944
|
+
},
|
|
10945
|
+
DEFAULT_RUNTIME_WEBPACK: function() {
|
|
10946
|
+
return DEFAULT_RUNTIME_WEBPACK;
|
|
10947
|
+
},
|
|
10948
|
+
DEFAULT_SANS_SERIF_FONT: function() {
|
|
10949
|
+
return DEFAULT_SANS_SERIF_FONT;
|
|
10950
|
+
},
|
|
10951
|
+
DEFAULT_SERIF_FONT: function() {
|
|
10952
|
+
return DEFAULT_SERIF_FONT;
|
|
10953
|
+
},
|
|
10954
|
+
DEV_CLIENT_PAGES_MANIFEST: function() {
|
|
10955
|
+
return DEV_CLIENT_PAGES_MANIFEST;
|
|
10956
|
+
},
|
|
10957
|
+
DEV_MIDDLEWARE_MANIFEST: function() {
|
|
10958
|
+
return DEV_MIDDLEWARE_MANIFEST;
|
|
10959
|
+
},
|
|
10960
|
+
EDGE_RUNTIME_WEBPACK: function() {
|
|
10961
|
+
return EDGE_RUNTIME_WEBPACK;
|
|
10962
|
+
},
|
|
10963
|
+
EDGE_UNSUPPORTED_NODE_APIS: function() {
|
|
10964
|
+
return EDGE_UNSUPPORTED_NODE_APIS;
|
|
10965
|
+
},
|
|
10966
|
+
EXPORT_DETAIL: function() {
|
|
10967
|
+
return EXPORT_DETAIL;
|
|
10968
|
+
},
|
|
10969
|
+
EXPORT_MARKER: function() {
|
|
10970
|
+
return EXPORT_MARKER;
|
|
10971
|
+
},
|
|
10972
|
+
FUNCTIONS_CONFIG_MANIFEST: function() {
|
|
10973
|
+
return FUNCTIONS_CONFIG_MANIFEST;
|
|
10974
|
+
},
|
|
10975
|
+
GOOGLE_FONT_PROVIDER: function() {
|
|
10976
|
+
return GOOGLE_FONT_PROVIDER;
|
|
10977
|
+
},
|
|
10978
|
+
IMAGES_MANIFEST: function() {
|
|
10979
|
+
return IMAGES_MANIFEST;
|
|
10980
|
+
},
|
|
10981
|
+
INTERCEPTION_ROUTE_REWRITE_MANIFEST: function() {
|
|
10982
|
+
return INTERCEPTION_ROUTE_REWRITE_MANIFEST;
|
|
10983
|
+
},
|
|
10984
|
+
MIDDLEWARE_BUILD_MANIFEST: function() {
|
|
10985
|
+
return MIDDLEWARE_BUILD_MANIFEST;
|
|
10986
|
+
},
|
|
10987
|
+
MIDDLEWARE_MANIFEST: function() {
|
|
10988
|
+
return MIDDLEWARE_MANIFEST;
|
|
10989
|
+
},
|
|
10990
|
+
MIDDLEWARE_REACT_LOADABLE_MANIFEST: function() {
|
|
10991
|
+
return MIDDLEWARE_REACT_LOADABLE_MANIFEST;
|
|
10992
|
+
},
|
|
10993
|
+
MODERN_BROWSERSLIST_TARGET: function() {
|
|
10994
|
+
return _modernbrowserslisttarget.default;
|
|
10995
|
+
},
|
|
10996
|
+
NEXT_BUILTIN_DOCUMENT: function() {
|
|
10997
|
+
return NEXT_BUILTIN_DOCUMENT;
|
|
10998
|
+
},
|
|
10999
|
+
NEXT_FONT_MANIFEST: function() {
|
|
11000
|
+
return NEXT_FONT_MANIFEST;
|
|
11001
|
+
},
|
|
11002
|
+
OPTIMIZED_FONT_PROVIDERS: function() {
|
|
11003
|
+
return OPTIMIZED_FONT_PROVIDERS;
|
|
11004
|
+
},
|
|
11005
|
+
PAGES_MANIFEST: function() {
|
|
11006
|
+
return PAGES_MANIFEST;
|
|
11007
|
+
},
|
|
11008
|
+
PHASE_DEVELOPMENT_SERVER: function() {
|
|
11009
|
+
return PHASE_DEVELOPMENT_SERVER;
|
|
11010
|
+
},
|
|
11011
|
+
PHASE_EXPORT: function() {
|
|
11012
|
+
return PHASE_EXPORT;
|
|
11013
|
+
},
|
|
11014
|
+
PHASE_INFO: function() {
|
|
11015
|
+
return PHASE_INFO;
|
|
11016
|
+
},
|
|
11017
|
+
PHASE_PRODUCTION_BUILD: function() {
|
|
11018
|
+
return PHASE_PRODUCTION_BUILD;
|
|
11019
|
+
},
|
|
11020
|
+
PHASE_PRODUCTION_SERVER: function() {
|
|
11021
|
+
return PHASE_PRODUCTION_SERVER;
|
|
11022
|
+
},
|
|
11023
|
+
PHASE_TEST: function() {
|
|
11024
|
+
return PHASE_TEST;
|
|
11025
|
+
},
|
|
11026
|
+
PRERENDER_MANIFEST: function() {
|
|
11027
|
+
return PRERENDER_MANIFEST;
|
|
11028
|
+
},
|
|
11029
|
+
REACT_LOADABLE_MANIFEST: function() {
|
|
11030
|
+
return REACT_LOADABLE_MANIFEST;
|
|
11031
|
+
},
|
|
11032
|
+
ROUTES_MANIFEST: function() {
|
|
11033
|
+
return ROUTES_MANIFEST;
|
|
11034
|
+
},
|
|
11035
|
+
RSC_MODULE_TYPES: function() {
|
|
11036
|
+
return RSC_MODULE_TYPES;
|
|
11037
|
+
},
|
|
11038
|
+
SERVER_DIRECTORY: function() {
|
|
11039
|
+
return SERVER_DIRECTORY;
|
|
11040
|
+
},
|
|
11041
|
+
SERVER_FILES_MANIFEST: function() {
|
|
11042
|
+
return SERVER_FILES_MANIFEST;
|
|
11043
|
+
},
|
|
11044
|
+
SERVER_PROPS_ID: function() {
|
|
11045
|
+
return SERVER_PROPS_ID;
|
|
11046
|
+
},
|
|
11047
|
+
SERVER_REFERENCE_MANIFEST: function() {
|
|
11048
|
+
return SERVER_REFERENCE_MANIFEST;
|
|
11049
|
+
},
|
|
11050
|
+
STATIC_PROPS_ID: function() {
|
|
11051
|
+
return STATIC_PROPS_ID;
|
|
11052
|
+
},
|
|
11053
|
+
STATIC_STATUS_PAGES: function() {
|
|
11054
|
+
return STATIC_STATUS_PAGES;
|
|
11055
|
+
},
|
|
11056
|
+
STRING_LITERAL_DROP_BUNDLE: function() {
|
|
11057
|
+
return STRING_LITERAL_DROP_BUNDLE;
|
|
11058
|
+
},
|
|
11059
|
+
SUBRESOURCE_INTEGRITY_MANIFEST: function() {
|
|
11060
|
+
return SUBRESOURCE_INTEGRITY_MANIFEST;
|
|
11061
|
+
},
|
|
11062
|
+
SYSTEM_ENTRYPOINTS: function() {
|
|
11063
|
+
return SYSTEM_ENTRYPOINTS;
|
|
11064
|
+
},
|
|
11065
|
+
TRACE_OUTPUT_VERSION: function() {
|
|
11066
|
+
return TRACE_OUTPUT_VERSION;
|
|
11067
|
+
},
|
|
11068
|
+
TURBO_TRACE_DEFAULT_MEMORY_LIMIT: function() {
|
|
11069
|
+
return TURBO_TRACE_DEFAULT_MEMORY_LIMIT;
|
|
11070
|
+
},
|
|
11071
|
+
UNDERSCORE_NOT_FOUND_ROUTE: function() {
|
|
11072
|
+
return UNDERSCORE_NOT_FOUND_ROUTE;
|
|
11073
|
+
},
|
|
11074
|
+
UNDERSCORE_NOT_FOUND_ROUTE_ENTRY: function() {
|
|
11075
|
+
return UNDERSCORE_NOT_FOUND_ROUTE_ENTRY;
|
|
11076
|
+
}
|
|
11077
|
+
});
|
|
11078
|
+
const _interop_require_default = _interop_require_default$1;
|
|
11079
|
+
const _modernbrowserslisttarget = /*#__PURE__*/ _interop_require_default._(modernBrowserslistTarget);
|
|
11080
|
+
const COMPILER_NAMES = {
|
|
11081
|
+
client: "client",
|
|
11082
|
+
server: "server",
|
|
11083
|
+
edgeServer: "edge-server"
|
|
11084
|
+
};
|
|
11085
|
+
const COMPILER_INDEXES = {
|
|
11086
|
+
[COMPILER_NAMES.client]: 0,
|
|
11087
|
+
[COMPILER_NAMES.server]: 1,
|
|
11088
|
+
[COMPILER_NAMES.edgeServer]: 2
|
|
11089
|
+
};
|
|
11090
|
+
const UNDERSCORE_NOT_FOUND_ROUTE = "/_not-found";
|
|
11091
|
+
const UNDERSCORE_NOT_FOUND_ROUTE_ENTRY = "" + UNDERSCORE_NOT_FOUND_ROUTE + "/page";
|
|
11092
|
+
const PHASE_EXPORT = "phase-export";
|
|
11093
|
+
const PHASE_PRODUCTION_BUILD = "phase-production-build";
|
|
11094
|
+
const PHASE_PRODUCTION_SERVER = "phase-production-server";
|
|
11095
|
+
const PHASE_DEVELOPMENT_SERVER = "phase-development-server";
|
|
11096
|
+
const PHASE_TEST = "phase-test";
|
|
11097
|
+
const PHASE_INFO = "phase-info";
|
|
11098
|
+
const PAGES_MANIFEST = "pages-manifest.json";
|
|
11099
|
+
const APP_PATHS_MANIFEST = "app-paths-manifest.json";
|
|
11100
|
+
const APP_PATH_ROUTES_MANIFEST = "app-path-routes-manifest.json";
|
|
11101
|
+
const BUILD_MANIFEST = "build-manifest.json";
|
|
11102
|
+
const APP_BUILD_MANIFEST = "app-build-manifest.json";
|
|
11103
|
+
const FUNCTIONS_CONFIG_MANIFEST = "functions-config-manifest.json";
|
|
11104
|
+
const SUBRESOURCE_INTEGRITY_MANIFEST = "subresource-integrity-manifest";
|
|
11105
|
+
const NEXT_FONT_MANIFEST = "next-font-manifest";
|
|
11106
|
+
const EXPORT_MARKER = "export-marker.json";
|
|
11107
|
+
const EXPORT_DETAIL = "export-detail.json";
|
|
11108
|
+
const PRERENDER_MANIFEST = "prerender-manifest.json";
|
|
11109
|
+
const ROUTES_MANIFEST = "routes-manifest.json";
|
|
11110
|
+
const IMAGES_MANIFEST = "images-manifest.json";
|
|
11111
|
+
const SERVER_FILES_MANIFEST = "required-server-files.json";
|
|
11112
|
+
const DEV_CLIENT_PAGES_MANIFEST = "_devPagesManifest.json";
|
|
11113
|
+
const MIDDLEWARE_MANIFEST = "middleware-manifest.json";
|
|
11114
|
+
const DEV_MIDDLEWARE_MANIFEST = "_devMiddlewareManifest.json";
|
|
11115
|
+
const REACT_LOADABLE_MANIFEST = "react-loadable-manifest.json";
|
|
11116
|
+
const AUTOMATIC_FONT_OPTIMIZATION_MANIFEST = "font-manifest.json";
|
|
11117
|
+
const SERVER_DIRECTORY = "server";
|
|
11118
|
+
const CONFIG_FILES = [
|
|
11119
|
+
"next.config.js",
|
|
11120
|
+
"next.config.mjs"
|
|
11121
|
+
];
|
|
11122
|
+
const BUILD_ID_FILE = "BUILD_ID";
|
|
11123
|
+
const BLOCKED_PAGES = [
|
|
11124
|
+
"/_document",
|
|
11125
|
+
"/_app",
|
|
11126
|
+
"/_error"
|
|
11127
|
+
];
|
|
11128
|
+
const CLIENT_PUBLIC_FILES_PATH = "public";
|
|
11129
|
+
const CLIENT_STATIC_FILES_PATH = "static";
|
|
11130
|
+
const STRING_LITERAL_DROP_BUNDLE = "__NEXT_DROP_CLIENT_FILE__";
|
|
11131
|
+
const NEXT_BUILTIN_DOCUMENT = "__NEXT_BUILTIN_DOCUMENT__";
|
|
11132
|
+
const BARREL_OPTIMIZATION_PREFIX = "__barrel_optimize__";
|
|
11133
|
+
const CLIENT_REFERENCE_MANIFEST = "client-reference-manifest";
|
|
11134
|
+
const SERVER_REFERENCE_MANIFEST = "server-reference-manifest";
|
|
11135
|
+
const MIDDLEWARE_BUILD_MANIFEST = "middleware-build-manifest";
|
|
11136
|
+
const MIDDLEWARE_REACT_LOADABLE_MANIFEST = "middleware-react-loadable-manifest";
|
|
11137
|
+
const INTERCEPTION_ROUTE_REWRITE_MANIFEST = "interception-route-rewrite-manifest";
|
|
11138
|
+
const CLIENT_STATIC_FILES_RUNTIME_MAIN = "main";
|
|
11139
|
+
const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = "" + CLIENT_STATIC_FILES_RUNTIME_MAIN + "-app";
|
|
11140
|
+
const APP_CLIENT_INTERNALS = "app-pages-internals";
|
|
11141
|
+
const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = "react-refresh";
|
|
11142
|
+
const CLIENT_STATIC_FILES_RUNTIME_AMP = "amp";
|
|
11143
|
+
const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = "webpack";
|
|
11144
|
+
const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS = "polyfills";
|
|
11145
|
+
const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(CLIENT_STATIC_FILES_RUNTIME_POLYFILLS);
|
|
11146
|
+
const DEFAULT_RUNTIME_WEBPACK = "webpack-runtime";
|
|
11147
|
+
const EDGE_RUNTIME_WEBPACK = "edge-runtime-webpack";
|
|
11148
|
+
const STATIC_PROPS_ID = "__N_SSG";
|
|
11149
|
+
const SERVER_PROPS_ID = "__N_SSP";
|
|
11150
|
+
const GOOGLE_FONT_PROVIDER = "https://fonts.googleapis.com/";
|
|
11151
|
+
const OPTIMIZED_FONT_PROVIDERS = [
|
|
11152
|
+
{
|
|
11153
|
+
url: GOOGLE_FONT_PROVIDER,
|
|
11154
|
+
preconnect: "https://fonts.gstatic.com"
|
|
11155
|
+
},
|
|
11156
|
+
{
|
|
11157
|
+
url: "https://use.typekit.net",
|
|
11158
|
+
preconnect: "https://use.typekit.net"
|
|
11159
|
+
}
|
|
11160
|
+
];
|
|
11161
|
+
const DEFAULT_SERIF_FONT = {
|
|
11162
|
+
name: "Times New Roman",
|
|
11163
|
+
xAvgCharWidth: 821,
|
|
11164
|
+
azAvgWidth: 854.3953488372093,
|
|
11165
|
+
unitsPerEm: 2048
|
|
11166
|
+
};
|
|
11167
|
+
const DEFAULT_SANS_SERIF_FONT = {
|
|
11168
|
+
name: "Arial",
|
|
11169
|
+
xAvgCharWidth: 904,
|
|
11170
|
+
azAvgWidth: 934.5116279069767,
|
|
11171
|
+
unitsPerEm: 2048
|
|
11172
|
+
};
|
|
11173
|
+
const STATIC_STATUS_PAGES = [
|
|
11174
|
+
"/500"
|
|
11175
|
+
];
|
|
11176
|
+
const TRACE_OUTPUT_VERSION = 1;
|
|
11177
|
+
const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000;
|
|
11178
|
+
const RSC_MODULE_TYPES = {
|
|
11179
|
+
client: "client",
|
|
11180
|
+
server: "server"
|
|
11181
|
+
};
|
|
11182
|
+
const EDGE_UNSUPPORTED_NODE_APIS = [
|
|
11183
|
+
"clearImmediate",
|
|
11184
|
+
"setImmediate",
|
|
11185
|
+
"BroadcastChannel",
|
|
11186
|
+
"ByteLengthQueuingStrategy",
|
|
11187
|
+
"CompressionStream",
|
|
11188
|
+
"CountQueuingStrategy",
|
|
11189
|
+
"DecompressionStream",
|
|
11190
|
+
"DomException",
|
|
11191
|
+
"MessageChannel",
|
|
11192
|
+
"MessageEvent",
|
|
11193
|
+
"MessagePort",
|
|
11194
|
+
"ReadableByteStreamController",
|
|
11195
|
+
"ReadableStreamBYOBRequest",
|
|
11196
|
+
"ReadableStreamDefaultController",
|
|
11197
|
+
"TransformStreamDefaultController",
|
|
11198
|
+
"WritableStreamDefaultController"
|
|
11199
|
+
];
|
|
11200
|
+
const SYSTEM_ENTRYPOINTS = new Set([
|
|
11201
|
+
CLIENT_STATIC_FILES_RUNTIME_MAIN,
|
|
11202
|
+
CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,
|
|
11203
|
+
CLIENT_STATIC_FILES_RUNTIME_AMP,
|
|
11204
|
+
CLIENT_STATIC_FILES_RUNTIME_MAIN_APP
|
|
11205
|
+
]);
|
|
11206
|
+
|
|
11207
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
11208
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
11209
|
+
Object.assign(exports.default, exports);
|
|
11210
|
+
module.exports = exports.default;
|
|
11211
|
+
}
|
|
11212
|
+
|
|
11213
|
+
|
|
11214
|
+
}(constants, constants.exports));
|
|
11215
|
+
|
|
11216
|
+
var getPageFiles = {};
|
|
11217
|
+
|
|
11218
|
+
var denormalizePagePath = {};
|
|
11219
|
+
|
|
11220
|
+
var utils$2 = {exports: {}};
|
|
11221
|
+
|
|
11222
|
+
var sortedRoutes = {};
|
|
11223
|
+
|
|
11224
|
+
(function (exports) {
|
|
11225
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11226
|
+
value: true
|
|
11227
|
+
});
|
|
11228
|
+
Object.defineProperty(exports, "getSortedRoutes", {
|
|
11229
|
+
enumerable: true,
|
|
11230
|
+
get: function() {
|
|
11231
|
+
return getSortedRoutes;
|
|
11232
|
+
}
|
|
11233
|
+
});
|
|
11234
|
+
class UrlNode {
|
|
11235
|
+
insert(urlPath) {
|
|
11236
|
+
this._insert(urlPath.split("/").filter(Boolean), [], false);
|
|
11237
|
+
}
|
|
11238
|
+
smoosh() {
|
|
11239
|
+
return this._smoosh();
|
|
11240
|
+
}
|
|
11241
|
+
_smoosh(prefix) {
|
|
11242
|
+
if (prefix === void 0) prefix = "/";
|
|
11243
|
+
const childrenPaths = [
|
|
11244
|
+
...this.children.keys()
|
|
11245
|
+
].sort();
|
|
11246
|
+
if (this.slugName !== null) {
|
|
11247
|
+
childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
|
|
11248
|
+
}
|
|
11249
|
+
if (this.restSlugName !== null) {
|
|
11250
|
+
childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
|
|
11251
|
+
}
|
|
11252
|
+
if (this.optionalRestSlugName !== null) {
|
|
11253
|
+
childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
|
|
11254
|
+
}
|
|
11255
|
+
const routes = childrenPaths.map((c)=>this.children.get(c)._smoosh("" + prefix + c + "/")).reduce((prev, curr)=>[
|
|
11256
|
+
...prev,
|
|
11257
|
+
...curr
|
|
11258
|
+
], []);
|
|
11259
|
+
if (this.slugName !== null) {
|
|
11260
|
+
routes.push(...this.children.get("[]")._smoosh(prefix + "[" + this.slugName + "]/"));
|
|
11261
|
+
}
|
|
11262
|
+
if (!this.placeholder) {
|
|
11263
|
+
const r = prefix === "/" ? "/" : prefix.slice(0, -1);
|
|
11264
|
+
if (this.optionalRestSlugName != null) {
|
|
11265
|
+
throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("' + r + '" and "' + r + "[[..." + this.optionalRestSlugName + ']]").');
|
|
11266
|
+
}
|
|
11267
|
+
routes.unshift(r);
|
|
11268
|
+
}
|
|
11269
|
+
if (this.restSlugName !== null) {
|
|
11270
|
+
routes.push(...this.children.get("[...]")._smoosh(prefix + "[..." + this.restSlugName + "]/"));
|
|
11271
|
+
}
|
|
11272
|
+
if (this.optionalRestSlugName !== null) {
|
|
11273
|
+
routes.push(...this.children.get("[[...]]")._smoosh(prefix + "[[..." + this.optionalRestSlugName + "]]/"));
|
|
11274
|
+
}
|
|
11275
|
+
return routes;
|
|
11276
|
+
}
|
|
11277
|
+
_insert(urlPaths, slugNames, isCatchAll) {
|
|
11278
|
+
if (urlPaths.length === 0) {
|
|
11279
|
+
this.placeholder = false;
|
|
11280
|
+
return;
|
|
11281
|
+
}
|
|
11282
|
+
if (isCatchAll) {
|
|
11283
|
+
throw new Error("Catch-all must be the last part of the URL.");
|
|
11284
|
+
}
|
|
11285
|
+
// The next segment in the urlPaths list
|
|
11286
|
+
let nextSegment = urlPaths[0];
|
|
11287
|
+
// Check if the segment matches `[something]`
|
|
11288
|
+
if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
|
|
11289
|
+
// Strip `[` and `]`, leaving only `something`
|
|
11290
|
+
let segmentName = nextSegment.slice(1, -1);
|
|
11291
|
+
let isOptional = false;
|
|
11292
|
+
if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
|
|
11293
|
+
// Strip optional `[` and `]`, leaving only `something`
|
|
11294
|
+
segmentName = segmentName.slice(1, -1);
|
|
11295
|
+
isOptional = true;
|
|
11296
|
+
}
|
|
11297
|
+
if (segmentName.startsWith("...")) {
|
|
11298
|
+
// Strip `...`, leaving only `something`
|
|
11299
|
+
segmentName = segmentName.substring(3);
|
|
11300
|
+
isCatchAll = true;
|
|
11301
|
+
}
|
|
11302
|
+
if (segmentName.startsWith("[") || segmentName.endsWith("]")) {
|
|
11303
|
+
throw new Error("Segment names may not start or end with extra brackets ('" + segmentName + "').");
|
|
11304
|
+
}
|
|
11305
|
+
if (segmentName.startsWith(".")) {
|
|
11306
|
+
throw new Error("Segment names may not start with erroneous periods ('" + segmentName + "').");
|
|
11307
|
+
}
|
|
11308
|
+
function handleSlug(previousSlug, nextSlug) {
|
|
11309
|
+
if (previousSlug !== null) {
|
|
11310
|
+
// If the specific segment already has a slug but the slug is not `something`
|
|
11311
|
+
// This prevents collisions like:
|
|
11312
|
+
// pages/[post]/index.js
|
|
11313
|
+
// pages/[id]/index.js
|
|
11314
|
+
// Because currently multiple dynamic params on the same segment level are not supported
|
|
11315
|
+
if (previousSlug !== nextSlug) {
|
|
11316
|
+
// TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.
|
|
11317
|
+
throw new Error("You cannot use different slug names for the same dynamic path ('" + previousSlug + "' !== '" + nextSlug + "').");
|
|
11318
|
+
}
|
|
11319
|
+
}
|
|
11320
|
+
slugNames.forEach((slug)=>{
|
|
11321
|
+
if (slug === nextSlug) {
|
|
11322
|
+
throw new Error('You cannot have the same slug name "' + nextSlug + '" repeat within a single dynamic path');
|
|
11323
|
+
}
|
|
11324
|
+
if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) {
|
|
11325
|
+
throw new Error('You cannot have the slug names "' + slug + '" and "' + nextSlug + '" differ only by non-word symbols within a single dynamic path');
|
|
11326
|
+
}
|
|
11327
|
+
});
|
|
11328
|
+
slugNames.push(nextSlug);
|
|
11329
|
+
}
|
|
11330
|
+
if (isCatchAll) {
|
|
11331
|
+
if (isOptional) {
|
|
11332
|
+
if (this.restSlugName != null) {
|
|
11333
|
+
throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...' + this.restSlugName + ']" and "' + urlPaths[0] + '" ).');
|
|
11334
|
+
}
|
|
11335
|
+
handleSlug(this.optionalRestSlugName, segmentName);
|
|
11336
|
+
// slugName is kept as it can only be one particular slugName
|
|
11337
|
+
this.optionalRestSlugName = segmentName;
|
|
11338
|
+
// nextSegment is overwritten to [[...]] so that it can later be sorted specifically
|
|
11339
|
+
nextSegment = "[[...]]";
|
|
11340
|
+
} else {
|
|
11341
|
+
if (this.optionalRestSlugName != null) {
|
|
11342
|
+
throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...' + this.optionalRestSlugName + ']]" and "' + urlPaths[0] + '").');
|
|
11343
|
+
}
|
|
11344
|
+
handleSlug(this.restSlugName, segmentName);
|
|
11345
|
+
// slugName is kept as it can only be one particular slugName
|
|
11346
|
+
this.restSlugName = segmentName;
|
|
11347
|
+
// nextSegment is overwritten to [...] so that it can later be sorted specifically
|
|
11348
|
+
nextSegment = "[...]";
|
|
11349
|
+
}
|
|
11350
|
+
} else {
|
|
11351
|
+
if (isOptional) {
|
|
11352
|
+
throw new Error('Optional route parameters are not yet supported ("' + urlPaths[0] + '").');
|
|
11353
|
+
}
|
|
11354
|
+
handleSlug(this.slugName, segmentName);
|
|
11355
|
+
// slugName is kept as it can only be one particular slugName
|
|
11356
|
+
this.slugName = segmentName;
|
|
11357
|
+
// nextSegment is overwritten to [] so that it can later be sorted specifically
|
|
11358
|
+
nextSegment = "[]";
|
|
11359
|
+
}
|
|
11360
|
+
}
|
|
11361
|
+
// If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode
|
|
11362
|
+
if (!this.children.has(nextSegment)) {
|
|
11363
|
+
this.children.set(nextSegment, new UrlNode());
|
|
11364
|
+
}
|
|
11365
|
+
this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
|
11366
|
+
}
|
|
11367
|
+
constructor(){
|
|
11368
|
+
this.placeholder = true;
|
|
11369
|
+
this.children = new Map();
|
|
11370
|
+
this.slugName = null;
|
|
11371
|
+
this.restSlugName = null;
|
|
11372
|
+
this.optionalRestSlugName = null;
|
|
11373
|
+
}
|
|
11374
|
+
}
|
|
11375
|
+
function getSortedRoutes(normalizedPages) {
|
|
11376
|
+
// First the UrlNode is created, and every UrlNode can have only 1 dynamic segment
|
|
11377
|
+
// Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js
|
|
11378
|
+
// Only 1 dynamic segment per nesting level
|
|
11379
|
+
// So in the case that is test/integration/dynamic-routing it'll be this:
|
|
11380
|
+
// pages/[post]/comments.js
|
|
11381
|
+
// pages/blog/[post]/comment/[id].js
|
|
11382
|
+
// Both are fine because `pages/[post]` and `pages/blog` are on the same level
|
|
11383
|
+
// So in this case `UrlNode` created here has `this.slugName === 'post'`
|
|
11384
|
+
// And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities
|
|
11385
|
+
// Instead what has to be passed through is the upwards path's dynamic names
|
|
11386
|
+
const root = new UrlNode();
|
|
11387
|
+
// Here the `root` gets injected multiple paths, and insert will break them up into sublevels
|
|
11388
|
+
normalizedPages.forEach((pagePath)=>root.insert(pagePath));
|
|
11389
|
+
// Smoosh will then sort those sublevels up to the point where you get the correct route definition priority
|
|
11390
|
+
return root.smoosh();
|
|
11391
|
+
}
|
|
11392
|
+
|
|
11393
|
+
|
|
11394
|
+
}(sortedRoutes));
|
|
11395
|
+
|
|
11396
|
+
var isDynamic = {};
|
|
11397
|
+
|
|
11398
|
+
var interceptionRoutes = {exports: {}};
|
|
11399
|
+
|
|
11400
|
+
var appPaths = {exports: {}};
|
|
11401
|
+
|
|
11402
|
+
var ensureLeadingSlash = {};
|
|
11403
|
+
|
|
11404
|
+
/**
|
|
11405
|
+
* For a given page path, this function ensures that there is a leading slash.
|
|
11406
|
+
* If there is not a leading slash, one is added, otherwise it is noop.
|
|
11407
|
+
*/
|
|
11408
|
+
|
|
11409
|
+
(function (exports) {
|
|
11410
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11411
|
+
value: true
|
|
11412
|
+
});
|
|
11413
|
+
Object.defineProperty(exports, "ensureLeadingSlash", {
|
|
11414
|
+
enumerable: true,
|
|
11415
|
+
get: function() {
|
|
11416
|
+
return ensureLeadingSlash;
|
|
11417
|
+
}
|
|
11418
|
+
});
|
|
11419
|
+
function ensureLeadingSlash(path) {
|
|
11420
|
+
return path.startsWith("/") ? path : "/" + path;
|
|
11421
|
+
}
|
|
11422
|
+
|
|
11423
|
+
|
|
11424
|
+
}(ensureLeadingSlash));
|
|
11425
|
+
|
|
11426
|
+
var segment = {exports: {}};
|
|
11427
|
+
|
|
11428
|
+
(function (module, exports) {
|
|
11429
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11430
|
+
value: true
|
|
11431
|
+
});
|
|
11432
|
+
function _export(target, all) {
|
|
11433
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11434
|
+
enumerable: true,
|
|
11435
|
+
get: all[name]
|
|
11436
|
+
});
|
|
11437
|
+
}
|
|
11438
|
+
_export(exports, {
|
|
11439
|
+
DEFAULT_SEGMENT_KEY: function() {
|
|
11440
|
+
return DEFAULT_SEGMENT_KEY;
|
|
11441
|
+
},
|
|
11442
|
+
PAGE_SEGMENT_KEY: function() {
|
|
11443
|
+
return PAGE_SEGMENT_KEY;
|
|
11444
|
+
},
|
|
11445
|
+
isGroupSegment: function() {
|
|
11446
|
+
return isGroupSegment;
|
|
11447
|
+
}
|
|
11448
|
+
});
|
|
11449
|
+
function isGroupSegment(segment) {
|
|
11450
|
+
// Use array[0] for performant purpose
|
|
11451
|
+
return segment[0] === "(" && segment.endsWith(")");
|
|
11452
|
+
}
|
|
11453
|
+
const PAGE_SEGMENT_KEY = "__PAGE__";
|
|
11454
|
+
const DEFAULT_SEGMENT_KEY = "__DEFAULT__";
|
|
11455
|
+
|
|
11456
|
+
|
|
11457
|
+
}(segment, segment.exports));
|
|
11458
|
+
|
|
11459
|
+
(function (module, exports) {
|
|
11460
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11461
|
+
value: true
|
|
11462
|
+
});
|
|
11463
|
+
function _export(target, all) {
|
|
11464
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11465
|
+
enumerable: true,
|
|
11466
|
+
get: all[name]
|
|
11467
|
+
});
|
|
11468
|
+
}
|
|
11469
|
+
_export(exports, {
|
|
11470
|
+
normalizeAppPath: function() {
|
|
11471
|
+
return normalizeAppPath;
|
|
11472
|
+
},
|
|
11473
|
+
normalizeRscURL: function() {
|
|
11474
|
+
return normalizeRscURL;
|
|
11475
|
+
}
|
|
11476
|
+
});
|
|
11477
|
+
const _ensureleadingslash = ensureLeadingSlash;
|
|
11478
|
+
const _segment = segment.exports;
|
|
11479
|
+
function normalizeAppPath(route) {
|
|
11480
|
+
return (0, _ensureleadingslash.ensureLeadingSlash)(route.split("/").reduce((pathname, segment, index, segments)=>{
|
|
11481
|
+
// Empty segments are ignored.
|
|
11482
|
+
if (!segment) {
|
|
11483
|
+
return pathname;
|
|
11484
|
+
}
|
|
11485
|
+
// Groups are ignored.
|
|
11486
|
+
if ((0, _segment.isGroupSegment)(segment)) {
|
|
11487
|
+
return pathname;
|
|
11488
|
+
}
|
|
11489
|
+
// Parallel segments are ignored.
|
|
11490
|
+
if (segment[0] === "@") {
|
|
11491
|
+
return pathname;
|
|
11492
|
+
}
|
|
11493
|
+
// The last segment (if it's a leaf) should be ignored.
|
|
11494
|
+
if ((segment === "page" || segment === "route") && index === segments.length - 1) {
|
|
11495
|
+
return pathname;
|
|
11496
|
+
}
|
|
11497
|
+
return pathname + "/" + segment;
|
|
11498
|
+
}, ""));
|
|
11499
|
+
}
|
|
11500
|
+
function normalizeRscURL(url) {
|
|
11501
|
+
return url.replace(/\.rsc($|\?)/, // $1 ensures `?` is preserved
|
|
11502
|
+
"$1");
|
|
11503
|
+
}
|
|
11504
|
+
|
|
11505
|
+
|
|
11506
|
+
}(appPaths, appPaths.exports));
|
|
11507
|
+
|
|
11508
|
+
(function (module, exports) {
|
|
11509
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11510
|
+
value: true
|
|
11511
|
+
});
|
|
11512
|
+
function _export(target, all) {
|
|
11513
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11514
|
+
enumerable: true,
|
|
11515
|
+
get: all[name]
|
|
11516
|
+
});
|
|
11517
|
+
}
|
|
11518
|
+
_export(exports, {
|
|
11519
|
+
INTERCEPTION_ROUTE_MARKERS: function() {
|
|
11520
|
+
return INTERCEPTION_ROUTE_MARKERS;
|
|
11521
|
+
},
|
|
11522
|
+
extractInterceptionRouteInformation: function() {
|
|
11523
|
+
return extractInterceptionRouteInformation;
|
|
11524
|
+
},
|
|
11525
|
+
isInterceptionRouteAppPath: function() {
|
|
11526
|
+
return isInterceptionRouteAppPath;
|
|
11527
|
+
}
|
|
11528
|
+
});
|
|
11529
|
+
const _apppaths = appPaths.exports;
|
|
11530
|
+
const INTERCEPTION_ROUTE_MARKERS = [
|
|
11531
|
+
"(..)(..)",
|
|
11532
|
+
"(.)",
|
|
11533
|
+
"(..)",
|
|
11534
|
+
"(...)"
|
|
11535
|
+
];
|
|
11536
|
+
function isInterceptionRouteAppPath(path) {
|
|
11537
|
+
// TODO-APP: add more serious validation
|
|
11538
|
+
return path.split("/").find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;
|
|
11539
|
+
}
|
|
11540
|
+
function extractInterceptionRouteInformation(path) {
|
|
11541
|
+
let interceptingRoute, marker, interceptedRoute;
|
|
11542
|
+
for (const segment of path.split("/")){
|
|
11543
|
+
marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
|
|
11544
|
+
if (marker) {
|
|
11545
|
+
[interceptingRoute, interceptedRoute] = path.split(marker, 2);
|
|
11546
|
+
break;
|
|
11547
|
+
}
|
|
11548
|
+
}
|
|
11549
|
+
if (!interceptingRoute || !marker || !interceptedRoute) {
|
|
11550
|
+
throw new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);
|
|
11551
|
+
}
|
|
11552
|
+
interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed
|
|
11553
|
+
;
|
|
11554
|
+
switch(marker){
|
|
11555
|
+
case "(.)":
|
|
11556
|
+
// (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route
|
|
11557
|
+
if (interceptingRoute === "/") {
|
|
11558
|
+
interceptedRoute = `/${interceptedRoute}`;
|
|
11559
|
+
} else {
|
|
11560
|
+
interceptedRoute = interceptingRoute + "/" + interceptedRoute;
|
|
11561
|
+
}
|
|
11562
|
+
break;
|
|
11563
|
+
case "(..)":
|
|
11564
|
+
// (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route
|
|
11565
|
+
if (interceptingRoute === "/") {
|
|
11566
|
+
throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);
|
|
11567
|
+
}
|
|
11568
|
+
interceptedRoute = interceptingRoute.split("/").slice(0, -1).concat(interceptedRoute).join("/");
|
|
11569
|
+
break;
|
|
11570
|
+
case "(...)":
|
|
11571
|
+
// (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route
|
|
11572
|
+
interceptedRoute = "/" + interceptedRoute;
|
|
11573
|
+
break;
|
|
11574
|
+
case "(..)(..)":
|
|
11575
|
+
// (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route
|
|
11576
|
+
const splitInterceptingRoute = interceptingRoute.split("/");
|
|
11577
|
+
if (splitInterceptingRoute.length <= 2) {
|
|
11578
|
+
throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);
|
|
11579
|
+
}
|
|
11580
|
+
interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join("/");
|
|
11581
|
+
break;
|
|
11582
|
+
default:
|
|
11583
|
+
throw new Error("Invariant: unexpected marker");
|
|
11584
|
+
}
|
|
11585
|
+
return {
|
|
11586
|
+
interceptingRoute,
|
|
11587
|
+
interceptedRoute
|
|
11588
|
+
};
|
|
11589
|
+
}
|
|
11590
|
+
|
|
11591
|
+
|
|
11592
|
+
}(interceptionRoutes, interceptionRoutes.exports));
|
|
11593
|
+
|
|
11594
|
+
(function (exports) {
|
|
11595
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11596
|
+
value: true
|
|
11597
|
+
});
|
|
11598
|
+
Object.defineProperty(exports, "isDynamicRoute", {
|
|
11599
|
+
enumerable: true,
|
|
11600
|
+
get: function() {
|
|
11601
|
+
return isDynamicRoute;
|
|
11602
|
+
}
|
|
11603
|
+
});
|
|
11604
|
+
const _interceptionroutes = interceptionRoutes.exports;
|
|
11605
|
+
// Identify /[param]/ in route string
|
|
11606
|
+
const TEST_ROUTE = /\/\[[^/]+?\](?=\/|$)/;
|
|
11607
|
+
function isDynamicRoute(route) {
|
|
11608
|
+
if ((0, _interceptionroutes.isInterceptionRouteAppPath)(route)) {
|
|
11609
|
+
route = (0, _interceptionroutes.extractInterceptionRouteInformation)(route).interceptedRoute;
|
|
11610
|
+
}
|
|
11611
|
+
return TEST_ROUTE.test(route);
|
|
11612
|
+
}
|
|
11613
|
+
|
|
11614
|
+
|
|
11615
|
+
}(isDynamic));
|
|
11616
|
+
|
|
11617
|
+
(function (module, exports) {
|
|
11618
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11619
|
+
value: true
|
|
11620
|
+
});
|
|
11621
|
+
function _export(target, all) {
|
|
11622
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11623
|
+
enumerable: true,
|
|
11624
|
+
get: all[name]
|
|
11625
|
+
});
|
|
11626
|
+
}
|
|
11627
|
+
_export(exports, {
|
|
11628
|
+
getSortedRoutes: function() {
|
|
11629
|
+
return _sortedroutes.getSortedRoutes;
|
|
11630
|
+
},
|
|
11631
|
+
isDynamicRoute: function() {
|
|
11632
|
+
return _isdynamic.isDynamicRoute;
|
|
11633
|
+
}
|
|
11634
|
+
});
|
|
11635
|
+
const _sortedroutes = sortedRoutes;
|
|
11636
|
+
const _isdynamic = isDynamic;
|
|
11637
|
+
|
|
11638
|
+
|
|
11639
|
+
}(utils$2, utils$2.exports));
|
|
11640
|
+
|
|
11641
|
+
var normalizePathSep = {};
|
|
11642
|
+
|
|
11643
|
+
/**
|
|
11644
|
+
* For a given page path, this function ensures that there is no backslash
|
|
11645
|
+
* escaping slashes in the path. Example:
|
|
11646
|
+
* - `foo\/bar\/baz` -> `foo/bar/baz`
|
|
11647
|
+
*/
|
|
11648
|
+
|
|
11649
|
+
(function (exports) {
|
|
11650
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11651
|
+
value: true
|
|
11652
|
+
});
|
|
11653
|
+
Object.defineProperty(exports, "normalizePathSep", {
|
|
11654
|
+
enumerable: true,
|
|
11655
|
+
get: function() {
|
|
11656
|
+
return normalizePathSep;
|
|
11657
|
+
}
|
|
11658
|
+
});
|
|
11659
|
+
function normalizePathSep(path) {
|
|
11660
|
+
return path.replace(/\\/g, "/");
|
|
11661
|
+
}
|
|
11662
|
+
|
|
11663
|
+
|
|
11664
|
+
}(normalizePathSep));
|
|
11665
|
+
|
|
11666
|
+
(function (exports) {
|
|
11667
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11668
|
+
value: true
|
|
11669
|
+
});
|
|
11670
|
+
Object.defineProperty(exports, "denormalizePagePath", {
|
|
11671
|
+
enumerable: true,
|
|
11672
|
+
get: function() {
|
|
11673
|
+
return denormalizePagePath;
|
|
11674
|
+
}
|
|
11675
|
+
});
|
|
11676
|
+
const _utils = utils$2.exports;
|
|
11677
|
+
const _normalizepathsep = normalizePathSep;
|
|
11678
|
+
function denormalizePagePath(page) {
|
|
11679
|
+
let _page = (0, _normalizepathsep.normalizePathSep)(page);
|
|
11680
|
+
return _page.startsWith("/index/") && !(0, _utils.isDynamicRoute)(_page) ? _page.slice(6) : _page !== "/index" ? _page : "/";
|
|
11681
|
+
}
|
|
11682
|
+
|
|
11683
|
+
|
|
11684
|
+
}(denormalizePagePath));
|
|
11685
|
+
|
|
11686
|
+
var normalizePagePath = {};
|
|
11687
|
+
|
|
11688
|
+
var utils$1 = {exports: {}};
|
|
11689
|
+
|
|
11690
|
+
(function (module, exports) {
|
|
11691
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11692
|
+
value: true
|
|
11693
|
+
});
|
|
11694
|
+
function _export(target, all) {
|
|
11695
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11696
|
+
enumerable: true,
|
|
11697
|
+
get: all[name]
|
|
11698
|
+
});
|
|
11699
|
+
}
|
|
11700
|
+
_export(exports, {
|
|
11701
|
+
DecodeError: function() {
|
|
11702
|
+
return DecodeError;
|
|
11703
|
+
},
|
|
11704
|
+
MiddlewareNotFoundError: function() {
|
|
11705
|
+
return MiddlewareNotFoundError;
|
|
11706
|
+
},
|
|
11707
|
+
MissingStaticPage: function() {
|
|
11708
|
+
return MissingStaticPage;
|
|
11709
|
+
},
|
|
11710
|
+
NormalizeError: function() {
|
|
11711
|
+
return NormalizeError;
|
|
11712
|
+
},
|
|
11713
|
+
PageNotFoundError: function() {
|
|
11714
|
+
return PageNotFoundError;
|
|
11715
|
+
},
|
|
11716
|
+
SP: function() {
|
|
11717
|
+
return SP;
|
|
11718
|
+
},
|
|
11719
|
+
ST: function() {
|
|
11720
|
+
return ST;
|
|
11721
|
+
},
|
|
11722
|
+
WEB_VITALS: function() {
|
|
11723
|
+
return WEB_VITALS;
|
|
11724
|
+
},
|
|
11725
|
+
execOnce: function() {
|
|
11726
|
+
return execOnce;
|
|
11727
|
+
},
|
|
11728
|
+
getDisplayName: function() {
|
|
11729
|
+
return getDisplayName;
|
|
11730
|
+
},
|
|
11731
|
+
getLocationOrigin: function() {
|
|
11732
|
+
return getLocationOrigin;
|
|
11733
|
+
},
|
|
11734
|
+
getURL: function() {
|
|
11735
|
+
return getURL;
|
|
11736
|
+
},
|
|
11737
|
+
isAbsoluteUrl: function() {
|
|
11738
|
+
return isAbsoluteUrl;
|
|
11739
|
+
},
|
|
11740
|
+
isResSent: function() {
|
|
11741
|
+
return isResSent;
|
|
11742
|
+
},
|
|
11743
|
+
loadGetInitialProps: function() {
|
|
11744
|
+
return loadGetInitialProps;
|
|
11745
|
+
},
|
|
11746
|
+
normalizeRepeatedSlashes: function() {
|
|
11747
|
+
return normalizeRepeatedSlashes;
|
|
11748
|
+
},
|
|
11749
|
+
stringifyError: function() {
|
|
11750
|
+
return stringifyError;
|
|
11751
|
+
}
|
|
11752
|
+
});
|
|
11753
|
+
const WEB_VITALS = [
|
|
11754
|
+
"CLS",
|
|
11755
|
+
"FCP",
|
|
11756
|
+
"FID",
|
|
11757
|
+
"INP",
|
|
11758
|
+
"LCP",
|
|
11759
|
+
"TTFB"
|
|
11760
|
+
];
|
|
11761
|
+
function execOnce(fn) {
|
|
11762
|
+
let used = false;
|
|
11763
|
+
let result;
|
|
11764
|
+
return function() {
|
|
11765
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
11766
|
+
args[_key] = arguments[_key];
|
|
11767
|
+
}
|
|
11768
|
+
if (!used) {
|
|
11769
|
+
used = true;
|
|
11770
|
+
result = fn(...args);
|
|
11771
|
+
}
|
|
11772
|
+
return result;
|
|
11773
|
+
};
|
|
11774
|
+
}
|
|
11775
|
+
// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
|
11776
|
+
// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
|
11777
|
+
const ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
11778
|
+
const isAbsoluteUrl = (url)=>ABSOLUTE_URL_REGEX.test(url);
|
|
11779
|
+
function getLocationOrigin() {
|
|
11780
|
+
const { protocol, hostname, port } = window.location;
|
|
11781
|
+
return protocol + "//" + hostname + (port ? ":" + port : "");
|
|
11782
|
+
}
|
|
11783
|
+
function getURL() {
|
|
11784
|
+
const { href } = window.location;
|
|
11785
|
+
const origin = getLocationOrigin();
|
|
11786
|
+
return href.substring(origin.length);
|
|
11787
|
+
}
|
|
11788
|
+
function getDisplayName(Component) {
|
|
11789
|
+
return typeof Component === "string" ? Component : Component.displayName || Component.name || "Unknown";
|
|
11790
|
+
}
|
|
11791
|
+
function isResSent(res) {
|
|
11792
|
+
return res.finished || res.headersSent;
|
|
11793
|
+
}
|
|
11794
|
+
function normalizeRepeatedSlashes(url) {
|
|
11795
|
+
const urlParts = url.split("?");
|
|
11796
|
+
const urlNoQuery = urlParts[0];
|
|
11797
|
+
return urlNoQuery// first we replace any non-encoded backslashes with forward
|
|
11798
|
+
// then normalize repeated forward slashes
|
|
11799
|
+
.replace(/\\/g, "/").replace(/\/\/+/g, "/") + (urlParts[1] ? "?" + urlParts.slice(1).join("?") : "");
|
|
11800
|
+
}
|
|
11801
|
+
async function loadGetInitialProps(App, ctx) {
|
|
11802
|
+
if (process.env.NODE_ENV !== "production") {
|
|
11803
|
+
var _App_prototype;
|
|
11804
|
+
if ((_App_prototype = App.prototype) == null ? void 0 : _App_prototype.getInitialProps) {
|
|
11805
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';
|
|
11806
|
+
throw new Error(message);
|
|
11807
|
+
}
|
|
11808
|
+
}
|
|
11809
|
+
// when called from _app `ctx` is nested in `ctx`
|
|
11810
|
+
const res = ctx.res || ctx.ctx && ctx.ctx.res;
|
|
11811
|
+
if (!App.getInitialProps) {
|
|
11812
|
+
if (ctx.ctx && ctx.Component) {
|
|
11813
|
+
// @ts-ignore pageProps default
|
|
11814
|
+
return {
|
|
11815
|
+
pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)
|
|
11816
|
+
};
|
|
11817
|
+
}
|
|
11818
|
+
return {};
|
|
11819
|
+
}
|
|
11820
|
+
const props = await App.getInitialProps(ctx);
|
|
11821
|
+
if (res && isResSent(res)) {
|
|
11822
|
+
return props;
|
|
11823
|
+
}
|
|
11824
|
+
if (!props) {
|
|
11825
|
+
const message = '"' + getDisplayName(App) + '.getInitialProps()" should resolve to an object. But found "' + props + '" instead.';
|
|
11826
|
+
throw new Error(message);
|
|
11827
|
+
}
|
|
11828
|
+
if (process.env.NODE_ENV !== "production") {
|
|
11829
|
+
if (Object.keys(props).length === 0 && !ctx.ctx) {
|
|
11830
|
+
console.warn("" + getDisplayName(App) + " returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps");
|
|
11831
|
+
}
|
|
11832
|
+
}
|
|
11833
|
+
return props;
|
|
11834
|
+
}
|
|
11835
|
+
const SP = typeof performance !== "undefined";
|
|
11836
|
+
const ST = SP && [
|
|
11837
|
+
"mark",
|
|
11838
|
+
"measure",
|
|
11839
|
+
"getEntriesByName"
|
|
11840
|
+
].every((method)=>typeof performance[method] === "function");
|
|
11841
|
+
class DecodeError extends Error {
|
|
11842
|
+
}
|
|
11843
|
+
class NormalizeError extends Error {
|
|
11844
|
+
}
|
|
11845
|
+
class PageNotFoundError extends Error {
|
|
11846
|
+
constructor(page){
|
|
11847
|
+
super();
|
|
11848
|
+
this.code = "ENOENT";
|
|
11849
|
+
this.name = "PageNotFoundError";
|
|
11850
|
+
this.message = "Cannot find module for page: " + page;
|
|
11851
|
+
}
|
|
11852
|
+
}
|
|
11853
|
+
class MissingStaticPage extends Error {
|
|
11854
|
+
constructor(page, message){
|
|
11855
|
+
super();
|
|
11856
|
+
this.message = "Failed to load static file for page: " + page + " " + message;
|
|
11857
|
+
}
|
|
11858
|
+
}
|
|
11859
|
+
class MiddlewareNotFoundError extends Error {
|
|
11860
|
+
constructor(){
|
|
11861
|
+
super();
|
|
11862
|
+
this.code = "ENOENT";
|
|
11863
|
+
this.message = "Cannot find the middleware module";
|
|
11864
|
+
}
|
|
11865
|
+
}
|
|
11866
|
+
function stringifyError(error) {
|
|
11867
|
+
return JSON.stringify({
|
|
11868
|
+
message: error.message,
|
|
11869
|
+
stack: error.stack
|
|
11870
|
+
});
|
|
11871
|
+
}
|
|
11872
|
+
|
|
11873
|
+
|
|
11874
|
+
}(utils$1, utils$1.exports));
|
|
11875
|
+
|
|
11876
|
+
(function (exports) {
|
|
11877
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11878
|
+
value: true
|
|
11879
|
+
});
|
|
11880
|
+
Object.defineProperty(exports, "normalizePagePath", {
|
|
11881
|
+
enumerable: true,
|
|
11882
|
+
get: function() {
|
|
11883
|
+
return normalizePagePath;
|
|
11884
|
+
}
|
|
11885
|
+
});
|
|
11886
|
+
const _ensureleadingslash = ensureLeadingSlash;
|
|
11887
|
+
const _utils = utils$2.exports;
|
|
11888
|
+
const _utils1 = utils$1.exports;
|
|
11889
|
+
function normalizePagePath(page) {
|
|
11890
|
+
const normalized = /^\/index(\/|$)/.test(page) && !(0, _utils.isDynamicRoute)(page) ? "/index" + page : page === "/" ? "/index" : (0, _ensureleadingslash.ensureLeadingSlash)(page);
|
|
11891
|
+
if (process.env.NEXT_RUNTIME !== "edge") {
|
|
11892
|
+
const { posix } = require$$3;
|
|
11893
|
+
const resolvedPage = posix.normalize(normalized);
|
|
11894
|
+
if (resolvedPage !== normalized) {
|
|
11895
|
+
throw new _utils1.NormalizeError("Requested and resolved page mismatch: " + normalized + " " + resolvedPage);
|
|
11896
|
+
}
|
|
11897
|
+
}
|
|
11898
|
+
return normalized;
|
|
11899
|
+
}
|
|
11900
|
+
|
|
11901
|
+
|
|
11902
|
+
}(normalizePagePath));
|
|
11903
|
+
|
|
11904
|
+
(function (exports) {
|
|
11905
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11906
|
+
value: true
|
|
11907
|
+
});
|
|
11908
|
+
Object.defineProperty(exports, "getPageFiles", {
|
|
11909
|
+
enumerable: true,
|
|
11910
|
+
get: function() {
|
|
11911
|
+
return getPageFiles;
|
|
11912
|
+
}
|
|
11913
|
+
});
|
|
11914
|
+
const _denormalizepagepath = denormalizePagePath;
|
|
11915
|
+
const _normalizepagepath = normalizePagePath;
|
|
11916
|
+
function getPageFiles(buildManifest, page) {
|
|
11917
|
+
const normalizedPage = (0, _denormalizepagepath.denormalizePagePath)((0, _normalizepagepath.normalizePagePath)(page));
|
|
11918
|
+
let files = buildManifest.pages[normalizedPage];
|
|
11919
|
+
if (!files) {
|
|
11920
|
+
console.warn(`Could not find files for ${normalizedPage} in .next/build-manifest.json`);
|
|
11921
|
+
return [];
|
|
11922
|
+
}
|
|
11923
|
+
return files;
|
|
11924
|
+
}
|
|
11925
|
+
|
|
11926
|
+
|
|
11927
|
+
}(getPageFiles));
|
|
11928
|
+
|
|
11929
|
+
var htmlescape = {exports: {}};
|
|
11930
|
+
|
|
11931
|
+
(function (module, exports) {
|
|
11932
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11933
|
+
value: true
|
|
11934
|
+
});
|
|
11935
|
+
function _export(target, all) {
|
|
11936
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11937
|
+
enumerable: true,
|
|
11938
|
+
get: all[name]
|
|
11939
|
+
});
|
|
11940
|
+
}
|
|
11941
|
+
_export(exports, {
|
|
11942
|
+
ESCAPE_REGEX: function() {
|
|
11943
|
+
return ESCAPE_REGEX;
|
|
11944
|
+
},
|
|
11945
|
+
htmlEscapeJsonString: function() {
|
|
11946
|
+
return htmlEscapeJsonString;
|
|
11947
|
+
}
|
|
11948
|
+
});
|
|
11949
|
+
const ESCAPE_LOOKUP = {
|
|
11950
|
+
"&": "\\u0026",
|
|
11951
|
+
">": "\\u003e",
|
|
11952
|
+
"<": "\\u003c",
|
|
11953
|
+
"\u2028": "\\u2028",
|
|
11954
|
+
"\u2029": "\\u2029"
|
|
11955
|
+
};
|
|
11956
|
+
const ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
|
11957
|
+
function htmlEscapeJsonString(str) {
|
|
11958
|
+
return str.replace(ESCAPE_REGEX, (match)=>ESCAPE_LOOKUP[match]);
|
|
11959
|
+
}
|
|
11960
|
+
|
|
11961
|
+
|
|
11962
|
+
}(htmlescape, htmlescape.exports));
|
|
11963
|
+
|
|
11964
|
+
var isError = {exports: {}};
|
|
11965
|
+
|
|
11966
|
+
var isPlainObject = {exports: {}};
|
|
11967
|
+
|
|
11968
|
+
(function (module, exports) {
|
|
11969
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11970
|
+
value: true
|
|
11971
|
+
});
|
|
11972
|
+
function _export(target, all) {
|
|
11973
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
11974
|
+
enumerable: true,
|
|
11975
|
+
get: all[name]
|
|
11976
|
+
});
|
|
11977
|
+
}
|
|
11978
|
+
_export(exports, {
|
|
11979
|
+
getObjectClassLabel: function() {
|
|
11980
|
+
return getObjectClassLabel;
|
|
11981
|
+
},
|
|
11982
|
+
isPlainObject: function() {
|
|
11983
|
+
return isPlainObject;
|
|
11984
|
+
}
|
|
11985
|
+
});
|
|
11986
|
+
function getObjectClassLabel(value) {
|
|
11987
|
+
return Object.prototype.toString.call(value);
|
|
11988
|
+
}
|
|
11989
|
+
function isPlainObject(value) {
|
|
11990
|
+
if (getObjectClassLabel(value) !== "[object Object]") {
|
|
11991
|
+
return false;
|
|
11992
|
+
}
|
|
11993
|
+
const prototype = Object.getPrototypeOf(value);
|
|
11994
|
+
/**
|
|
11995
|
+
* this used to be previously:
|
|
11996
|
+
*
|
|
11997
|
+
* `return prototype === null || prototype === Object.prototype`
|
|
11998
|
+
*
|
|
11999
|
+
* but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.
|
|
12000
|
+
*
|
|
12001
|
+
* It was changed to the current implementation since it's resilient to serialization.
|
|
12002
|
+
*/ return prototype === null || prototype.hasOwnProperty("isPrototypeOf");
|
|
12003
|
+
}
|
|
12004
|
+
|
|
12005
|
+
|
|
12006
|
+
}(isPlainObject, isPlainObject.exports));
|
|
12007
|
+
|
|
12008
|
+
(function (module, exports) {
|
|
12009
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12010
|
+
value: true
|
|
12011
|
+
});
|
|
12012
|
+
function _export(target, all) {
|
|
12013
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
12014
|
+
enumerable: true,
|
|
12015
|
+
get: all[name]
|
|
12016
|
+
});
|
|
12017
|
+
}
|
|
12018
|
+
_export(exports, {
|
|
12019
|
+
default: function() {
|
|
12020
|
+
return isError;
|
|
12021
|
+
},
|
|
12022
|
+
getProperError: function() {
|
|
12023
|
+
return getProperError;
|
|
12024
|
+
}
|
|
12025
|
+
});
|
|
12026
|
+
const _isplainobject = isPlainObject.exports;
|
|
12027
|
+
function isError(err) {
|
|
12028
|
+
return typeof err === "object" && err !== null && "name" in err && "message" in err;
|
|
12029
|
+
}
|
|
12030
|
+
function getProperError(err) {
|
|
12031
|
+
if (isError(err)) {
|
|
12032
|
+
return err;
|
|
12033
|
+
}
|
|
12034
|
+
if (process.env.NODE_ENV === "development") {
|
|
12035
|
+
// provide better error for case where `throw undefined`
|
|
12036
|
+
// is called in development
|
|
12037
|
+
if (typeof err === "undefined") {
|
|
12038
|
+
return new Error("An undefined error was thrown, " + "see here for more info: https://nextjs.org/docs/messages/threw-undefined");
|
|
12039
|
+
}
|
|
12040
|
+
if (err === null) {
|
|
12041
|
+
return new Error("A null error was thrown, " + "see here for more info: https://nextjs.org/docs/messages/threw-undefined");
|
|
12042
|
+
}
|
|
12043
|
+
}
|
|
12044
|
+
return new Error((0, _isplainobject.isPlainObject)(err) ? JSON.stringify(err) : err + "");
|
|
12045
|
+
}
|
|
12046
|
+
|
|
12047
|
+
|
|
12048
|
+
}(isError, isError.exports));
|
|
12049
|
+
|
|
12050
|
+
var htmlContext_sharedRuntime = {exports: {}};
|
|
12051
|
+
|
|
12052
|
+
(function (module, exports) {
|
|
12053
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12054
|
+
value: true
|
|
12055
|
+
});
|
|
12056
|
+
function _export(target, all) {
|
|
12057
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
12058
|
+
enumerable: true,
|
|
12059
|
+
get: all[name]
|
|
12060
|
+
});
|
|
12061
|
+
}
|
|
12062
|
+
_export(exports, {
|
|
12063
|
+
HtmlContext: function() {
|
|
12064
|
+
return HtmlContext;
|
|
12065
|
+
},
|
|
12066
|
+
useHtmlContext: function() {
|
|
12067
|
+
return useHtmlContext;
|
|
12068
|
+
}
|
|
12069
|
+
});
|
|
12070
|
+
const _react = react.exports;
|
|
12071
|
+
const HtmlContext = (0, _react.createContext)(undefined);
|
|
12072
|
+
if (process.env.NODE_ENV !== "production") {
|
|
12073
|
+
HtmlContext.displayName = "HtmlContext";
|
|
12074
|
+
}
|
|
12075
|
+
function useHtmlContext() {
|
|
12076
|
+
const context = (0, _react.useContext)(HtmlContext);
|
|
12077
|
+
if (!context) {
|
|
12078
|
+
throw new Error("<Html> should not be imported outside of pages/_document.\n" + "Read more: https://nextjs.org/docs/messages/no-document-import-in-page");
|
|
12079
|
+
}
|
|
12080
|
+
return context;
|
|
12081
|
+
}
|
|
12082
|
+
|
|
12083
|
+
|
|
12084
|
+
}(htmlContext_sharedRuntime, htmlContext_sharedRuntime.exports));
|
|
12085
|
+
|
|
12086
|
+
var encodeUriPath = {};
|
|
12087
|
+
|
|
12088
|
+
(function (exports) {
|
|
12089
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12090
|
+
value: true
|
|
12091
|
+
});
|
|
12092
|
+
Object.defineProperty(exports, "encodeURIPath", {
|
|
12093
|
+
enumerable: true,
|
|
12094
|
+
get: function() {
|
|
12095
|
+
return encodeURIPath;
|
|
12096
|
+
}
|
|
12097
|
+
});
|
|
12098
|
+
function encodeURIPath(file) {
|
|
12099
|
+
return file.split("/").map((p)=>encodeURIComponent(p)).join("/");
|
|
12100
|
+
}
|
|
12101
|
+
|
|
12102
|
+
|
|
12103
|
+
}(encodeUriPath));
|
|
12104
|
+
|
|
12105
|
+
var utils = {exports: {}};
|
|
12106
|
+
|
|
12107
|
+
(function (module, exports) {
|
|
12108
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12109
|
+
value: true
|
|
12110
|
+
});
|
|
12111
|
+
function _export(target, all) {
|
|
12112
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
12113
|
+
enumerable: true,
|
|
12114
|
+
get: all[name]
|
|
12115
|
+
});
|
|
12116
|
+
}
|
|
12117
|
+
_export(exports, {
|
|
12118
|
+
cleanAmpPath: function() {
|
|
12119
|
+
return cleanAmpPath;
|
|
12120
|
+
},
|
|
12121
|
+
debounce: function() {
|
|
12122
|
+
return debounce;
|
|
12123
|
+
},
|
|
12124
|
+
isBlockedPage: function() {
|
|
12125
|
+
return isBlockedPage;
|
|
12126
|
+
}
|
|
12127
|
+
});
|
|
12128
|
+
const _constants = constants.exports;
|
|
12129
|
+
function isBlockedPage(page) {
|
|
12130
|
+
return _constants.BLOCKED_PAGES.includes(page);
|
|
12131
|
+
}
|
|
12132
|
+
function cleanAmpPath(pathname) {
|
|
12133
|
+
if (pathname.match(/\?amp=(y|yes|true|1)/)) {
|
|
12134
|
+
pathname = pathname.replace(/\?amp=(y|yes|true|1)&?/, "?");
|
|
12135
|
+
}
|
|
12136
|
+
if (pathname.match(/&=(y|yes|true|1)/)) {
|
|
12137
|
+
pathname = pathname.replace(/&=(y|yes|true|1)/, "");
|
|
12138
|
+
}
|
|
12139
|
+
pathname = pathname.replace(/\?$/, "");
|
|
12140
|
+
return pathname;
|
|
12141
|
+
}
|
|
12142
|
+
function debounce(fn, ms, maxWait = Infinity) {
|
|
12143
|
+
let timeoutId;
|
|
12144
|
+
// The time the debouncing function was first called during this debounce queue.
|
|
12145
|
+
let startTime = 0;
|
|
12146
|
+
// The time the debouncing function was last called.
|
|
12147
|
+
let lastCall = 0;
|
|
12148
|
+
// The arguments and this context of the last call to the debouncing function.
|
|
12149
|
+
let args, context;
|
|
12150
|
+
// A helper used to that either invokes the debounced function, or
|
|
12151
|
+
// reschedules the timer if a more recent call was made.
|
|
12152
|
+
function run() {
|
|
12153
|
+
const now = Date.now();
|
|
12154
|
+
const diff = lastCall + ms - now;
|
|
12155
|
+
// If the diff is non-positive, then we've waited at least `ms`
|
|
12156
|
+
// milliseconds since the last call. Or if we've waited for longer than the
|
|
12157
|
+
// max wait time, we must call the debounced function.
|
|
12158
|
+
if (diff <= 0 || startTime + maxWait >= now) {
|
|
12159
|
+
// It's important to clear the timeout id before invoking the debounced
|
|
12160
|
+
// function, in case the function calls the debouncing function again.
|
|
12161
|
+
timeoutId = undefined;
|
|
12162
|
+
fn.apply(context, args);
|
|
12163
|
+
} else {
|
|
12164
|
+
// Else, a new call was made after the original timer was scheduled. We
|
|
12165
|
+
// didn't clear the timeout (doing so is very slow), so now we need to
|
|
12166
|
+
// reschedule the timer for the time difference.
|
|
12167
|
+
timeoutId = setTimeout(run, diff);
|
|
12168
|
+
}
|
|
12169
|
+
}
|
|
12170
|
+
return function(...passedArgs) {
|
|
12171
|
+
// The arguments and this context of the most recent call are saved so the
|
|
12172
|
+
// debounced function can be invoked with them later.
|
|
12173
|
+
args = passedArgs;
|
|
12174
|
+
context = this;
|
|
12175
|
+
// Instead of constantly clearing and scheduling a timer, we record the
|
|
12176
|
+
// time of the last call. If a second call comes in before the timer fires,
|
|
12177
|
+
// then we'll reschedule in the run function. Doing this is considerably
|
|
12178
|
+
// faster.
|
|
12179
|
+
lastCall = Date.now();
|
|
12180
|
+
// Only schedule a new timer if we're not currently waiting.
|
|
12181
|
+
if (timeoutId === undefined) {
|
|
12182
|
+
startTime = lastCall;
|
|
12183
|
+
timeoutId = setTimeout(run, ms);
|
|
12184
|
+
}
|
|
12185
|
+
};
|
|
12186
|
+
}
|
|
12187
|
+
|
|
12188
|
+
|
|
12189
|
+
}(utils, utils.exports));
|
|
12190
|
+
|
|
12191
|
+
var prettyBytes = {};
|
|
12192
|
+
|
|
12193
|
+
/*
|
|
12194
|
+
MIT License
|
|
12195
|
+
|
|
12196
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
12197
|
+
|
|
12198
|
+
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:
|
|
12199
|
+
|
|
12200
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12201
|
+
|
|
12202
|
+
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.
|
|
12203
|
+
*/
|
|
12204
|
+
|
|
12205
|
+
(function (exports) {
|
|
12206
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12207
|
+
value: true
|
|
12208
|
+
});
|
|
12209
|
+
Object.defineProperty(exports, "default", {
|
|
12210
|
+
enumerable: true,
|
|
12211
|
+
get: function() {
|
|
12212
|
+
return prettyBytes;
|
|
12213
|
+
}
|
|
12214
|
+
});
|
|
12215
|
+
const UNITS = [
|
|
12216
|
+
"B",
|
|
12217
|
+
"kB",
|
|
12218
|
+
"MB",
|
|
12219
|
+
"GB",
|
|
12220
|
+
"TB",
|
|
12221
|
+
"PB",
|
|
12222
|
+
"EB",
|
|
12223
|
+
"ZB",
|
|
12224
|
+
"YB"
|
|
12225
|
+
];
|
|
12226
|
+
/*
|
|
12227
|
+
Formats the given number using `Number#toLocaleString`.
|
|
12228
|
+
- If locale is a string, the value is expected to be a locale-key (for example: `de`).
|
|
12229
|
+
- If locale is true, the system default locale is used for translation.
|
|
12230
|
+
- If no value for locale is specified, the number is returned unmodified.
|
|
12231
|
+
*/ const toLocaleString = (number, locale)=>{
|
|
12232
|
+
let result = number;
|
|
12233
|
+
if (typeof locale === "string") {
|
|
12234
|
+
result = number.toLocaleString(locale);
|
|
12235
|
+
} else if (locale === true) {
|
|
12236
|
+
result = number.toLocaleString();
|
|
12237
|
+
}
|
|
12238
|
+
return result;
|
|
12239
|
+
};
|
|
12240
|
+
function prettyBytes(number, options) {
|
|
12241
|
+
if (!Number.isFinite(number)) {
|
|
12242
|
+
throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
|
|
12243
|
+
}
|
|
12244
|
+
options = Object.assign({}, options);
|
|
12245
|
+
if (options.signed && number === 0) {
|
|
12246
|
+
return " 0 B";
|
|
12247
|
+
}
|
|
12248
|
+
const isNegative = number < 0;
|
|
12249
|
+
const prefix = isNegative ? "-" : options.signed ? "+" : "";
|
|
12250
|
+
if (isNegative) {
|
|
12251
|
+
number = -number;
|
|
12252
|
+
}
|
|
12253
|
+
if (number < 1) {
|
|
12254
|
+
const numberString = toLocaleString(number, options.locale);
|
|
12255
|
+
return prefix + numberString + " B";
|
|
12256
|
+
}
|
|
12257
|
+
const exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1);
|
|
12258
|
+
number = Number((number / Math.pow(1000, exponent)).toPrecision(3));
|
|
12259
|
+
const numberString = toLocaleString(number, options.locale);
|
|
12260
|
+
const unit = UNITS[exponent];
|
|
12261
|
+
return prefix + numberString + " " + unit;
|
|
12262
|
+
}
|
|
12263
|
+
|
|
12264
|
+
|
|
12265
|
+
}(prettyBytes));
|
|
12266
|
+
|
|
12267
|
+
(function (module, exports) {
|
|
12268
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12269
|
+
value: true
|
|
12270
|
+
});
|
|
12271
|
+
function _export(target, all) {
|
|
12272
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
12273
|
+
enumerable: true,
|
|
12274
|
+
get: all[name]
|
|
12275
|
+
});
|
|
12276
|
+
}
|
|
12277
|
+
_export(exports, {
|
|
12278
|
+
Head: function() {
|
|
12279
|
+
return Head;
|
|
12280
|
+
},
|
|
12281
|
+
Html: function() {
|
|
12282
|
+
return Html;
|
|
12283
|
+
},
|
|
12284
|
+
Main: function() {
|
|
12285
|
+
return Main;
|
|
12286
|
+
},
|
|
12287
|
+
NextScript: function() {
|
|
12288
|
+
return NextScript;
|
|
12289
|
+
},
|
|
12290
|
+
/**
|
|
12291
|
+
* `Document` component handles the initial `document` markup and renders only on the server side.
|
|
12292
|
+
* Commonly used for implementing server side rendering for `css-in-js` libraries.
|
|
12293
|
+
*/ default: function() {
|
|
12294
|
+
return Document;
|
|
12295
|
+
}
|
|
12296
|
+
});
|
|
12297
|
+
const _jsxruntime = jsxRuntime.exports;
|
|
12298
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard(react.exports);
|
|
12299
|
+
const _constants = constants.exports;
|
|
12300
|
+
const _getpagefiles = getPageFiles;
|
|
12301
|
+
const _htmlescape = htmlescape.exports;
|
|
12302
|
+
const _iserror = /*#__PURE__*/ _interop_require_default(isError.exports);
|
|
12303
|
+
const _htmlcontextsharedruntime = htmlContext_sharedRuntime.exports;
|
|
12304
|
+
const _encodeuripath = encodeUriPath;
|
|
12305
|
+
function _interop_require_default(obj) {
|
|
12306
|
+
return obj && obj.__esModule ? obj : {
|
|
12307
|
+
default: obj
|
|
12308
|
+
};
|
|
12309
|
+
}
|
|
12310
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
12311
|
+
if (typeof WeakMap !== "function") return null;
|
|
12312
|
+
var cacheBabelInterop = new WeakMap();
|
|
12313
|
+
var cacheNodeInterop = new WeakMap();
|
|
12314
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
12315
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
12316
|
+
})(nodeInterop);
|
|
12317
|
+
}
|
|
12318
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
12319
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
12320
|
+
return obj;
|
|
12321
|
+
}
|
|
12322
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
12323
|
+
return {
|
|
12324
|
+
default: obj
|
|
12325
|
+
};
|
|
12326
|
+
}
|
|
12327
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
12328
|
+
if (cache && cache.has(obj)) {
|
|
12329
|
+
return cache.get(obj);
|
|
12330
|
+
}
|
|
12331
|
+
var newObj = {
|
|
12332
|
+
__proto__: null
|
|
12333
|
+
};
|
|
12334
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
12335
|
+
for(var key in obj){
|
|
12336
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
12337
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
12338
|
+
if (desc && (desc.get || desc.set)) {
|
|
12339
|
+
Object.defineProperty(newObj, key, desc);
|
|
12340
|
+
} else {
|
|
12341
|
+
newObj[key] = obj[key];
|
|
12342
|
+
}
|
|
12343
|
+
}
|
|
12344
|
+
}
|
|
12345
|
+
newObj.default = obj;
|
|
12346
|
+
if (cache) {
|
|
12347
|
+
cache.set(obj, newObj);
|
|
12348
|
+
}
|
|
12349
|
+
return newObj;
|
|
12350
|
+
}
|
|
12351
|
+
/** Set of pages that have triggered a large data warning on production mode. */ const largePageDataWarnings = new Set();
|
|
12352
|
+
function getDocumentFiles(buildManifest, pathname, inAmpMode) {
|
|
12353
|
+
const sharedFiles = (0, _getpagefiles.getPageFiles)(buildManifest, "/_app");
|
|
12354
|
+
const pageFiles = process.env.NEXT_RUNTIME !== "edge" && inAmpMode ? [] : (0, _getpagefiles.getPageFiles)(buildManifest, pathname);
|
|
12355
|
+
return {
|
|
12356
|
+
sharedFiles,
|
|
12357
|
+
pageFiles,
|
|
12358
|
+
allFiles: [
|
|
12359
|
+
...new Set([
|
|
12360
|
+
...sharedFiles,
|
|
12361
|
+
...pageFiles
|
|
12362
|
+
])
|
|
12363
|
+
]
|
|
12364
|
+
};
|
|
12365
|
+
}
|
|
12366
|
+
function getPolyfillScripts(context, props) {
|
|
12367
|
+
// polyfills.js has to be rendered as nomodule without async
|
|
12368
|
+
// It also has to be the first script to load
|
|
12369
|
+
const { assetPrefix, buildManifest, assetQueryString, disableOptimizedLoading, crossOrigin } = context;
|
|
12370
|
+
return buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith(".js") && !polyfill.endsWith(".module.js")).map((polyfill)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
12371
|
+
defer: !disableOptimizedLoading,
|
|
12372
|
+
nonce: props.nonce,
|
|
12373
|
+
crossOrigin: props.crossOrigin || crossOrigin,
|
|
12374
|
+
noModule: true,
|
|
12375
|
+
src: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(polyfill)}${assetQueryString}`
|
|
12376
|
+
}, polyfill));
|
|
12377
|
+
}
|
|
12378
|
+
function hasComponentProps(child) {
|
|
12379
|
+
return !!child && !!child.props;
|
|
12380
|
+
}
|
|
12381
|
+
function AmpStyles({ styles }) {
|
|
12382
|
+
if (!styles) return null;
|
|
12383
|
+
// try to parse styles from fragment for backwards compat
|
|
12384
|
+
const curStyles = Array.isArray(styles) ? styles : [];
|
|
12385
|
+
if (// @ts-ignore Property 'props' does not exist on type ReactElement
|
|
12386
|
+
styles.props && // @ts-ignore Property 'props' does not exist on type ReactElement
|
|
12387
|
+
Array.isArray(styles.props.children)) {
|
|
12388
|
+
const hasStyles = (el)=>{
|
|
12389
|
+
var _el_props_dangerouslySetInnerHTML, _el_props;
|
|
12390
|
+
return el == null ? void 0 : (_el_props = el.props) == null ? void 0 : (_el_props_dangerouslySetInnerHTML = _el_props.dangerouslySetInnerHTML) == null ? void 0 : _el_props_dangerouslySetInnerHTML.__html;
|
|
12391
|
+
};
|
|
12392
|
+
// @ts-ignore Property 'props' does not exist on type ReactElement
|
|
12393
|
+
styles.props.children.forEach((child)=>{
|
|
12394
|
+
if (Array.isArray(child)) {
|
|
12395
|
+
child.forEach((el)=>hasStyles(el) && curStyles.push(el));
|
|
12396
|
+
} else if (hasStyles(child)) {
|
|
12397
|
+
curStyles.push(child);
|
|
12398
|
+
}
|
|
12399
|
+
});
|
|
12400
|
+
}
|
|
12401
|
+
/* Add custom styles before AMP styles to prevent accidental overrides */ return /*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
12402
|
+
"amp-custom": "",
|
|
12403
|
+
dangerouslySetInnerHTML: {
|
|
12404
|
+
__html: curStyles.map((style)=>style.props.dangerouslySetInnerHTML.__html).join("").replace(/\/\*# sourceMappingURL=.*\*\//g, "").replace(/\/\*@ sourceURL=.*?\*\//g, "")
|
|
12405
|
+
}
|
|
12406
|
+
});
|
|
12407
|
+
}
|
|
12408
|
+
function getDynamicChunks(context, props, files) {
|
|
12409
|
+
const { dynamicImports, assetPrefix, isDevelopment, assetQueryString, disableOptimizedLoading, crossOrigin } = context;
|
|
12410
|
+
return dynamicImports.map((file)=>{
|
|
12411
|
+
if (!file.endsWith(".js") || files.allFiles.includes(file)) return null;
|
|
12412
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
12413
|
+
async: !isDevelopment && disableOptimizedLoading,
|
|
12414
|
+
defer: !disableOptimizedLoading,
|
|
12415
|
+
src: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
12416
|
+
nonce: props.nonce,
|
|
12417
|
+
crossOrigin: props.crossOrigin || crossOrigin
|
|
12418
|
+
}, file);
|
|
12419
|
+
});
|
|
12420
|
+
}
|
|
12421
|
+
function getScripts(context, props, files) {
|
|
12422
|
+
var _buildManifest_lowPriorityFiles;
|
|
12423
|
+
const { assetPrefix, buildManifest, isDevelopment, assetQueryString, disableOptimizedLoading, crossOrigin } = context;
|
|
12424
|
+
const normalScripts = files.allFiles.filter((file)=>file.endsWith(".js"));
|
|
12425
|
+
const lowPriorityScripts = (_buildManifest_lowPriorityFiles = buildManifest.lowPriorityFiles) == null ? void 0 : _buildManifest_lowPriorityFiles.filter((file)=>file.endsWith(".js"));
|
|
12426
|
+
return [
|
|
12427
|
+
...normalScripts,
|
|
12428
|
+
...lowPriorityScripts
|
|
12429
|
+
].map((file)=>{
|
|
12430
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
12431
|
+
src: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
12432
|
+
nonce: props.nonce,
|
|
12433
|
+
async: !isDevelopment && disableOptimizedLoading,
|
|
12434
|
+
defer: !disableOptimizedLoading,
|
|
12435
|
+
crossOrigin: props.crossOrigin || crossOrigin
|
|
12436
|
+
}, file);
|
|
12437
|
+
});
|
|
12438
|
+
}
|
|
12439
|
+
function getPreNextWorkerScripts(context, props) {
|
|
12440
|
+
const { assetPrefix, scriptLoader, crossOrigin, nextScriptWorkers } = context;
|
|
12441
|
+
// disable `nextScriptWorkers` in edge runtime
|
|
12442
|
+
if (!nextScriptWorkers || process.env.NEXT_RUNTIME === "edge") return null;
|
|
12443
|
+
try {
|
|
12444
|
+
let { partytownSnippet } = __non_webpack_require__("@builder.io/partytown/integration");
|
|
12445
|
+
const children = Array.isArray(props.children) ? props.children : [
|
|
12446
|
+
props.children
|
|
12447
|
+
];
|
|
12448
|
+
// Check to see if the user has defined their own Partytown configuration
|
|
12449
|
+
const userDefinedConfig = children.find((child)=>{
|
|
12450
|
+
var _child_props_dangerouslySetInnerHTML, _child_props;
|
|
12451
|
+
return hasComponentProps(child) && (child == null ? void 0 : (_child_props = child.props) == null ? void 0 : (_child_props_dangerouslySetInnerHTML = _child_props.dangerouslySetInnerHTML) == null ? void 0 : _child_props_dangerouslySetInnerHTML.__html.length) && "data-partytown-config" in child.props;
|
|
12452
|
+
});
|
|
12453
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
12454
|
+
children: [
|
|
12455
|
+
!userDefinedConfig && /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
12456
|
+
"data-partytown-config": "",
|
|
12457
|
+
dangerouslySetInnerHTML: {
|
|
12458
|
+
__html: `
|
|
12459
|
+
partytown = {
|
|
12460
|
+
lib: "${assetPrefix}/_next/static/~partytown/"
|
|
12461
|
+
};
|
|
12462
|
+
`
|
|
12463
|
+
}
|
|
12464
|
+
}),
|
|
12465
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
12466
|
+
"data-partytown": "",
|
|
12467
|
+
dangerouslySetInnerHTML: {
|
|
12468
|
+
__html: partytownSnippet()
|
|
12469
|
+
}
|
|
12470
|
+
}),
|
|
12471
|
+
(scriptLoader.worker || []).map((file, index)=>{
|
|
12472
|
+
const { strategy, src, children: scriptChildren, dangerouslySetInnerHTML, ...scriptProps } = file;
|
|
12473
|
+
let srcProps = {};
|
|
12474
|
+
if (src) {
|
|
12475
|
+
// Use external src if provided
|
|
12476
|
+
srcProps.src = src;
|
|
12477
|
+
} else if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
|
|
12478
|
+
// Embed inline script if provided with dangerouslySetInnerHTML
|
|
12479
|
+
srcProps.dangerouslySetInnerHTML = {
|
|
12480
|
+
__html: dangerouslySetInnerHTML.__html
|
|
12481
|
+
};
|
|
12482
|
+
} else if (scriptChildren) {
|
|
12483
|
+
// Embed inline script if provided with children
|
|
12484
|
+
srcProps.dangerouslySetInnerHTML = {
|
|
12485
|
+
__html: typeof scriptChildren === "string" ? scriptChildren : Array.isArray(scriptChildren) ? scriptChildren.join("") : ""
|
|
12486
|
+
};
|
|
12487
|
+
} else {
|
|
12488
|
+
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");
|
|
12489
|
+
}
|
|
12490
|
+
return /*#__PURE__*/ (0, _react.createElement)("script", {
|
|
12491
|
+
...srcProps,
|
|
12492
|
+
...scriptProps,
|
|
12493
|
+
type: "text/partytown",
|
|
12494
|
+
key: src || index,
|
|
12495
|
+
nonce: props.nonce,
|
|
12496
|
+
"data-nscript": "worker",
|
|
12497
|
+
crossOrigin: props.crossOrigin || crossOrigin
|
|
12498
|
+
});
|
|
12499
|
+
})
|
|
12500
|
+
]
|
|
12501
|
+
});
|
|
12502
|
+
} catch (err) {
|
|
12503
|
+
if ((0, _iserror.default)(err) && err.code !== "MODULE_NOT_FOUND") {
|
|
12504
|
+
console.warn(`Warning: ${err.message}`);
|
|
12505
|
+
}
|
|
12506
|
+
return null;
|
|
12507
|
+
}
|
|
12508
|
+
}
|
|
12509
|
+
function getPreNextScripts(context, props) {
|
|
12510
|
+
const { scriptLoader, disableOptimizedLoading, crossOrigin } = context;
|
|
12511
|
+
const webWorkerScripts = getPreNextWorkerScripts(context, props);
|
|
12512
|
+
const beforeInteractiveScripts = (scriptLoader.beforeInteractive || []).filter((script)=>script.src).map((file, index)=>{
|
|
12513
|
+
const { strategy, ...scriptProps } = file;
|
|
12514
|
+
return /*#__PURE__*/ (0, _react.createElement)("script", {
|
|
12515
|
+
...scriptProps,
|
|
12516
|
+
key: scriptProps.src || index,
|
|
12517
|
+
defer: scriptProps.defer ?? !disableOptimizedLoading,
|
|
12518
|
+
nonce: props.nonce,
|
|
12519
|
+
"data-nscript": "beforeInteractive",
|
|
12520
|
+
crossOrigin: props.crossOrigin || crossOrigin
|
|
12521
|
+
});
|
|
12522
|
+
});
|
|
12523
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
12524
|
+
children: [
|
|
12525
|
+
webWorkerScripts,
|
|
12526
|
+
beforeInteractiveScripts
|
|
12527
|
+
]
|
|
12528
|
+
});
|
|
12529
|
+
}
|
|
12530
|
+
function getHeadHTMLProps(props) {
|
|
12531
|
+
const { crossOrigin, nonce, ...restProps } = props;
|
|
12532
|
+
// This assignment is necessary for additional type checking to avoid unsupported attributes in <head>
|
|
12533
|
+
const headProps = restProps;
|
|
12534
|
+
return headProps;
|
|
12535
|
+
}
|
|
12536
|
+
function getAmpPath(ampPath, asPath) {
|
|
12537
|
+
return ampPath || `${asPath}${asPath.includes("?") ? "&" : "?"}amp=1`;
|
|
12538
|
+
}
|
|
12539
|
+
function getNextFontLinkTags(nextFontManifest, dangerousAsPath, assetPrefix = "") {
|
|
12540
|
+
if (!nextFontManifest) {
|
|
12541
|
+
return {
|
|
12542
|
+
preconnect: null,
|
|
12543
|
+
preload: null
|
|
12544
|
+
};
|
|
12545
|
+
}
|
|
12546
|
+
const appFontsEntry = nextFontManifest.pages["/_app"];
|
|
12547
|
+
const pageFontsEntry = nextFontManifest.pages[dangerousAsPath];
|
|
12548
|
+
const preloadedFontFiles = Array.from(new Set([
|
|
12549
|
+
...appFontsEntry ?? [],
|
|
12550
|
+
...pageFontsEntry ?? []
|
|
12551
|
+
]));
|
|
12552
|
+
// If no font files should preload but there's an entry for the path, add a preconnect tag.
|
|
12553
|
+
const preconnectToSelf = !!(preloadedFontFiles.length === 0 && (appFontsEntry || pageFontsEntry));
|
|
12554
|
+
return {
|
|
12555
|
+
preconnect: preconnectToSelf ? /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12556
|
+
"data-next-font": nextFontManifest.pagesUsingSizeAdjust ? "size-adjust" : "",
|
|
12557
|
+
rel: "preconnect",
|
|
12558
|
+
href: "/",
|
|
12559
|
+
crossOrigin: "anonymous"
|
|
12560
|
+
}) : null,
|
|
12561
|
+
preload: preloadedFontFiles ? preloadedFontFiles.map((fontFile)=>{
|
|
12562
|
+
const ext = /\.(woff|woff2|eot|ttf|otf)$/.exec(fontFile)[1];
|
|
12563
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12564
|
+
rel: "preload",
|
|
12565
|
+
href: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(fontFile)}`,
|
|
12566
|
+
as: "font",
|
|
12567
|
+
type: `font/${ext}`,
|
|
12568
|
+
crossOrigin: "anonymous",
|
|
12569
|
+
"data-next-font": fontFile.includes("-s") ? "size-adjust" : ""
|
|
12570
|
+
}, fontFile);
|
|
12571
|
+
}) : null
|
|
12572
|
+
};
|
|
12573
|
+
}
|
|
12574
|
+
class Head extends _react.default.Component {
|
|
12575
|
+
static #_ = commonjsGlobal.contextType = _htmlcontextsharedruntime.HtmlContext;
|
|
12576
|
+
getCssLinks(files) {
|
|
12577
|
+
const { assetPrefix, assetQueryString, dynamicImports, crossOrigin, optimizeCss, optimizeFonts } = this.context;
|
|
12578
|
+
const cssFiles = files.allFiles.filter((f)=>f.endsWith(".css"));
|
|
12579
|
+
const sharedFiles = new Set(files.sharedFiles);
|
|
12580
|
+
// Unmanaged files are CSS files that will be handled directly by the
|
|
12581
|
+
// webpack runtime (`mini-css-extract-plugin`).
|
|
12582
|
+
let unmangedFiles = new Set([]);
|
|
12583
|
+
let dynamicCssFiles = Array.from(new Set(dynamicImports.filter((file)=>file.endsWith(".css"))));
|
|
12584
|
+
if (dynamicCssFiles.length) {
|
|
12585
|
+
const existing = new Set(cssFiles);
|
|
12586
|
+
dynamicCssFiles = dynamicCssFiles.filter((f)=>!(existing.has(f) || sharedFiles.has(f)));
|
|
12587
|
+
unmangedFiles = new Set(dynamicCssFiles);
|
|
12588
|
+
cssFiles.push(...dynamicCssFiles);
|
|
12589
|
+
}
|
|
12590
|
+
let cssLinkElements = [];
|
|
12591
|
+
cssFiles.forEach((file)=>{
|
|
12592
|
+
const isSharedFile = sharedFiles.has(file);
|
|
12593
|
+
if (!optimizeCss) {
|
|
12594
|
+
cssLinkElements.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12595
|
+
nonce: this.props.nonce,
|
|
12596
|
+
rel: "preload",
|
|
12597
|
+
href: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
12598
|
+
as: "style",
|
|
12599
|
+
crossOrigin: this.props.crossOrigin || crossOrigin
|
|
12600
|
+
}, `${file}-preload`));
|
|
12601
|
+
}
|
|
12602
|
+
const isUnmanagedFile = unmangedFiles.has(file);
|
|
12603
|
+
cssLinkElements.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12604
|
+
nonce: this.props.nonce,
|
|
12605
|
+
rel: "stylesheet",
|
|
12606
|
+
href: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
12607
|
+
crossOrigin: this.props.crossOrigin || crossOrigin,
|
|
12608
|
+
"data-n-g": isUnmanagedFile ? undefined : isSharedFile ? "" : undefined,
|
|
12609
|
+
"data-n-p": isUnmanagedFile ? undefined : isSharedFile ? undefined : ""
|
|
12610
|
+
}, file));
|
|
12611
|
+
});
|
|
12612
|
+
if (process.env.NODE_ENV !== "development" && optimizeFonts) {
|
|
12613
|
+
cssLinkElements = this.makeStylesheetInert(cssLinkElements);
|
|
12614
|
+
}
|
|
12615
|
+
return cssLinkElements.length === 0 ? null : cssLinkElements;
|
|
12616
|
+
}
|
|
12617
|
+
getPreloadDynamicChunks() {
|
|
12618
|
+
const { dynamicImports, assetPrefix, assetQueryString, crossOrigin } = this.context;
|
|
12619
|
+
return dynamicImports.map((file)=>{
|
|
12620
|
+
if (!file.endsWith(".js")) {
|
|
12621
|
+
return null;
|
|
12622
|
+
}
|
|
12623
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12624
|
+
rel: "preload",
|
|
12625
|
+
href: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
12626
|
+
as: "script",
|
|
12627
|
+
nonce: this.props.nonce,
|
|
12628
|
+
crossOrigin: this.props.crossOrigin || crossOrigin
|
|
12629
|
+
}, file);
|
|
12630
|
+
})// Filter out nulled scripts
|
|
12631
|
+
.filter(Boolean);
|
|
12632
|
+
}
|
|
12633
|
+
getPreloadMainLinks(files) {
|
|
12634
|
+
const { assetPrefix, assetQueryString, scriptLoader, crossOrigin } = this.context;
|
|
12635
|
+
const preloadFiles = files.allFiles.filter((file)=>{
|
|
12636
|
+
return file.endsWith(".js");
|
|
12637
|
+
});
|
|
12638
|
+
return [
|
|
12639
|
+
...(scriptLoader.beforeInteractive || []).map((file)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12640
|
+
nonce: this.props.nonce,
|
|
12641
|
+
rel: "preload",
|
|
12642
|
+
href: file.src,
|
|
12643
|
+
as: "script",
|
|
12644
|
+
crossOrigin: this.props.crossOrigin || crossOrigin
|
|
12645
|
+
}, file.src)),
|
|
12646
|
+
...preloadFiles.map((file)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12647
|
+
nonce: this.props.nonce,
|
|
12648
|
+
rel: "preload",
|
|
12649
|
+
href: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
12650
|
+
as: "script",
|
|
12651
|
+
crossOrigin: this.props.crossOrigin || crossOrigin
|
|
12652
|
+
}, file))
|
|
12653
|
+
];
|
|
12654
|
+
}
|
|
12655
|
+
getBeforeInteractiveInlineScripts() {
|
|
12656
|
+
const { scriptLoader } = this.context;
|
|
12657
|
+
const { nonce, crossOrigin } = this.props;
|
|
12658
|
+
return (scriptLoader.beforeInteractive || []).filter((script)=>!script.src && (script.dangerouslySetInnerHTML || script.children)).map((file, index)=>{
|
|
12659
|
+
const { strategy, children, dangerouslySetInnerHTML, src, ...scriptProps } = file;
|
|
12660
|
+
let html = "";
|
|
12661
|
+
if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
|
|
12662
|
+
html = dangerouslySetInnerHTML.__html;
|
|
12663
|
+
} else if (children) {
|
|
12664
|
+
html = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
|
|
12665
|
+
}
|
|
12666
|
+
return /*#__PURE__*/ (0, _react.createElement)("script", {
|
|
12667
|
+
...scriptProps,
|
|
12668
|
+
dangerouslySetInnerHTML: {
|
|
12669
|
+
__html: html
|
|
12670
|
+
},
|
|
12671
|
+
key: scriptProps.id || index,
|
|
12672
|
+
nonce: nonce,
|
|
12673
|
+
"data-nscript": "beforeInteractive",
|
|
12674
|
+
crossOrigin: crossOrigin || process.env.__NEXT_CROSS_ORIGIN
|
|
12675
|
+
});
|
|
12676
|
+
});
|
|
12677
|
+
}
|
|
12678
|
+
getDynamicChunks(files) {
|
|
12679
|
+
return getDynamicChunks(this.context, this.props, files);
|
|
12680
|
+
}
|
|
12681
|
+
getPreNextScripts() {
|
|
12682
|
+
return getPreNextScripts(this.context, this.props);
|
|
12683
|
+
}
|
|
12684
|
+
getScripts(files) {
|
|
12685
|
+
return getScripts(this.context, this.props, files);
|
|
12686
|
+
}
|
|
12687
|
+
getPolyfillScripts() {
|
|
12688
|
+
return getPolyfillScripts(this.context, this.props);
|
|
12689
|
+
}
|
|
12690
|
+
makeStylesheetInert(node) {
|
|
12691
|
+
return _react.default.Children.map(node, (c)=>{
|
|
12692
|
+
var _c_props, _c_props1;
|
|
12693
|
+
if ((c == null ? void 0 : c.type) === "link" && (c == null ? void 0 : (_c_props = c.props) == null ? void 0 : _c_props.href) && _constants.OPTIMIZED_FONT_PROVIDERS.some(({ url })=>{
|
|
12694
|
+
var _c_props_href, _c_props;
|
|
12695
|
+
return c == null ? void 0 : (_c_props = c.props) == null ? void 0 : (_c_props_href = _c_props.href) == null ? void 0 : _c_props_href.startsWith(url);
|
|
12696
|
+
})) {
|
|
12697
|
+
const newProps = {
|
|
12698
|
+
...c.props || {},
|
|
12699
|
+
"data-href": c.props.href,
|
|
12700
|
+
href: undefined
|
|
12701
|
+
};
|
|
12702
|
+
return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
|
|
12703
|
+
} else if (c == null ? void 0 : (_c_props1 = c.props) == null ? void 0 : _c_props1.children) {
|
|
12704
|
+
const newProps = {
|
|
12705
|
+
...c.props || {},
|
|
12706
|
+
children: this.makeStylesheetInert(c.props.children)
|
|
12707
|
+
};
|
|
12708
|
+
return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
|
|
12709
|
+
}
|
|
12710
|
+
return c;
|
|
12711
|
+
// @types/react bug. Returned value from .map will not be `null` if you pass in `[null]`
|
|
12712
|
+
}).filter(Boolean);
|
|
12713
|
+
}
|
|
12714
|
+
render() {
|
|
12715
|
+
const { styles, ampPath, inAmpMode, hybridAmp, canonicalBase, __NEXT_DATA__, dangerousAsPath, headTags, unstable_runtimeJS, unstable_JsPreload, disableOptimizedLoading, optimizeCss, optimizeFonts, assetPrefix, nextFontManifest } = this.context;
|
|
12716
|
+
const disableRuntimeJS = unstable_runtimeJS === false;
|
|
12717
|
+
const disableJsPreload = unstable_JsPreload === false || !disableOptimizedLoading;
|
|
12718
|
+
this.context.docComponentsRendered.Head = true;
|
|
12719
|
+
let { head } = this.context;
|
|
12720
|
+
let cssPreloads = [];
|
|
12721
|
+
let otherHeadElements = [];
|
|
12722
|
+
if (head) {
|
|
12723
|
+
head.forEach((c)=>{
|
|
12724
|
+
let metaTag;
|
|
12725
|
+
if (this.context.strictNextHead) {
|
|
12726
|
+
metaTag = /*#__PURE__*/ _react.default.createElement("meta", {
|
|
12727
|
+
name: "next-head",
|
|
12728
|
+
content: "1"
|
|
12729
|
+
});
|
|
12730
|
+
}
|
|
12731
|
+
if (c && c.type === "link" && c.props["rel"] === "preload" && c.props["as"] === "style") {
|
|
12732
|
+
metaTag && cssPreloads.push(metaTag);
|
|
12733
|
+
cssPreloads.push(c);
|
|
12734
|
+
} else {
|
|
12735
|
+
if (c) {
|
|
12736
|
+
if (metaTag && (c.type !== "meta" || !c.props["charSet"])) {
|
|
12737
|
+
otherHeadElements.push(metaTag);
|
|
12738
|
+
}
|
|
12739
|
+
otherHeadElements.push(c);
|
|
12740
|
+
}
|
|
12741
|
+
}
|
|
12742
|
+
});
|
|
12743
|
+
head = cssPreloads.concat(otherHeadElements);
|
|
12744
|
+
}
|
|
12745
|
+
let children = _react.default.Children.toArray(this.props.children).filter(Boolean);
|
|
12746
|
+
// show a warning if Head contains <title> (only in development)
|
|
12747
|
+
if (process.env.NODE_ENV !== "production") {
|
|
12748
|
+
children = _react.default.Children.map(children, (child)=>{
|
|
12749
|
+
var _child_props;
|
|
12750
|
+
const isReactHelmet = child == null ? void 0 : (_child_props = child.props) == null ? void 0 : _child_props["data-react-helmet"];
|
|
12751
|
+
if (!isReactHelmet) {
|
|
12752
|
+
var _child_props1;
|
|
12753
|
+
if ((child == null ? void 0 : child.type) === "title") {
|
|
12754
|
+
console.warn("Warning: <title> should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-title");
|
|
12755
|
+
} else if ((child == null ? void 0 : child.type) === "meta" && (child == null ? void 0 : (_child_props1 = child.props) == null ? void 0 : _child_props1.name) === "viewport") {
|
|
12756
|
+
console.warn("Warning: viewport meta tags should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-viewport-meta");
|
|
12757
|
+
}
|
|
12758
|
+
}
|
|
12759
|
+
return child;
|
|
12760
|
+
// @types/react bug. Returned value from .map will not be `null` if you pass in `[null]`
|
|
12761
|
+
});
|
|
12762
|
+
if (this.props.crossOrigin) console.warn("Warning: `Head` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated");
|
|
12763
|
+
}
|
|
12764
|
+
if (process.env.NODE_ENV !== "development" && optimizeFonts && !(process.env.NEXT_RUNTIME !== "edge" && inAmpMode)) {
|
|
12765
|
+
children = this.makeStylesheetInert(children);
|
|
12766
|
+
}
|
|
12767
|
+
let hasAmphtmlRel = false;
|
|
12768
|
+
let hasCanonicalRel = false;
|
|
12769
|
+
// show warning and remove conflicting amp head tags
|
|
12770
|
+
head = _react.default.Children.map(head || [], (child)=>{
|
|
12771
|
+
if (!child) return child;
|
|
12772
|
+
const { type, props } = child;
|
|
12773
|
+
if (process.env.NEXT_RUNTIME !== "edge" && inAmpMode) {
|
|
12774
|
+
let badProp = "";
|
|
12775
|
+
if (type === "meta" && props.name === "viewport") {
|
|
12776
|
+
badProp = 'name="viewport"';
|
|
12777
|
+
} else if (type === "link" && props.rel === "canonical") {
|
|
12778
|
+
hasCanonicalRel = true;
|
|
12779
|
+
} else if (type === "script") {
|
|
12780
|
+
// only block if
|
|
12781
|
+
// 1. it has a src and isn't pointing to ampproject's CDN
|
|
12782
|
+
// 2. it is using dangerouslySetInnerHTML without a type or
|
|
12783
|
+
// a type of text/javascript
|
|
12784
|
+
if (props.src && props.src.indexOf("ampproject") < -1 || props.dangerouslySetInnerHTML && (!props.type || props.type === "text/javascript")) {
|
|
12785
|
+
badProp = "<script";
|
|
12786
|
+
Object.keys(props).forEach((prop)=>{
|
|
12787
|
+
badProp += ` ${prop}="${props[prop]}"`;
|
|
12788
|
+
});
|
|
12789
|
+
badProp += "/>";
|
|
12790
|
+
}
|
|
12791
|
+
}
|
|
12792
|
+
if (badProp) {
|
|
12793
|
+
console.warn(`Found conflicting amp tag "${child.type}" with conflicting prop ${badProp} in ${__NEXT_DATA__.page}. https://nextjs.org/docs/messages/conflicting-amp-tag`);
|
|
12794
|
+
return null;
|
|
12795
|
+
}
|
|
12796
|
+
} else {
|
|
12797
|
+
// non-amp mode
|
|
12798
|
+
if (type === "link" && props.rel === "amphtml") {
|
|
12799
|
+
hasAmphtmlRel = true;
|
|
12800
|
+
}
|
|
12801
|
+
}
|
|
12802
|
+
return child;
|
|
12803
|
+
// @types/react bug. Returned value from .map will not be `null` if you pass in `[null]`
|
|
12804
|
+
});
|
|
12805
|
+
const files = getDocumentFiles(this.context.buildManifest, this.context.__NEXT_DATA__.page, process.env.NEXT_RUNTIME !== "edge" && inAmpMode);
|
|
12806
|
+
const nextFontLinkTags = getNextFontLinkTags(nextFontManifest, dangerousAsPath, assetPrefix);
|
|
12807
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("head", {
|
|
12808
|
+
...getHeadHTMLProps(this.props),
|
|
12809
|
+
children: [
|
|
12810
|
+
this.context.isDevelopment && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
12811
|
+
children: [
|
|
12812
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
12813
|
+
"data-next-hide-fouc": true,
|
|
12814
|
+
"data-ampdevmode": process.env.NEXT_RUNTIME !== "edge" && inAmpMode ? "true" : undefined,
|
|
12815
|
+
dangerouslySetInnerHTML: {
|
|
12816
|
+
__html: `body{display:none}`
|
|
12817
|
+
}
|
|
12818
|
+
}),
|
|
12819
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("noscript", {
|
|
12820
|
+
"data-next-hide-fouc": true,
|
|
12821
|
+
"data-ampdevmode": process.env.NEXT_RUNTIME !== "edge" && inAmpMode ? "true" : undefined,
|
|
12822
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
12823
|
+
dangerouslySetInnerHTML: {
|
|
12824
|
+
__html: `body{display:block}`
|
|
12825
|
+
}
|
|
12826
|
+
})
|
|
12827
|
+
})
|
|
12828
|
+
]
|
|
12829
|
+
}),
|
|
12830
|
+
head,
|
|
12831
|
+
this.context.strictNextHead ? null : /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
12832
|
+
name: "next-head-count",
|
|
12833
|
+
content: _react.default.Children.count(head || []).toString()
|
|
12834
|
+
}),
|
|
12835
|
+
children,
|
|
12836
|
+
optimizeFonts && /*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
12837
|
+
name: "next-font-preconnect"
|
|
12838
|
+
}),
|
|
12839
|
+
nextFontLinkTags.preconnect,
|
|
12840
|
+
nextFontLinkTags.preload,
|
|
12841
|
+
process.env.NEXT_RUNTIME !== "edge" && inAmpMode && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
12842
|
+
children: [
|
|
12843
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
12844
|
+
name: "viewport",
|
|
12845
|
+
content: "width=device-width,minimum-scale=1,initial-scale=1"
|
|
12846
|
+
}),
|
|
12847
|
+
!hasCanonicalRel && /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12848
|
+
rel: "canonical",
|
|
12849
|
+
href: canonicalBase + utils.exports.cleanAmpPath(dangerousAsPath)
|
|
12850
|
+
}),
|
|
12851
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12852
|
+
rel: "preload",
|
|
12853
|
+
as: "script",
|
|
12854
|
+
href: "https://cdn.ampproject.org/v0.js"
|
|
12855
|
+
}),
|
|
12856
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(AmpStyles, {
|
|
12857
|
+
styles: styles
|
|
12858
|
+
}),
|
|
12859
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
12860
|
+
"amp-boilerplate": "",
|
|
12861
|
+
dangerouslySetInnerHTML: {
|
|
12862
|
+
__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}}`
|
|
12863
|
+
}
|
|
12864
|
+
}),
|
|
12865
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("noscript", {
|
|
12866
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
12867
|
+
"amp-boilerplate": "",
|
|
12868
|
+
dangerouslySetInnerHTML: {
|
|
12869
|
+
__html: `body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}`
|
|
12870
|
+
}
|
|
12871
|
+
})
|
|
12872
|
+
}),
|
|
12873
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
12874
|
+
async: true,
|
|
12875
|
+
src: "https://cdn.ampproject.org/v0.js"
|
|
12876
|
+
})
|
|
12877
|
+
]
|
|
12878
|
+
}),
|
|
12879
|
+
!(process.env.NEXT_RUNTIME !== "edge" && inAmpMode) && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
12880
|
+
children: [
|
|
12881
|
+
!hasAmphtmlRel && hybridAmp && /*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
12882
|
+
rel: "amphtml",
|
|
12883
|
+
href: canonicalBase + getAmpPath(ampPath, dangerousAsPath)
|
|
12884
|
+
}),
|
|
12885
|
+
this.getBeforeInteractiveInlineScripts(),
|
|
12886
|
+
!optimizeCss && this.getCssLinks(files),
|
|
12887
|
+
!optimizeCss && /*#__PURE__*/ (0, _jsxruntime.jsx)("noscript", {
|
|
12888
|
+
"data-n-css": this.props.nonce ?? ""
|
|
12889
|
+
}),
|
|
12890
|
+
!disableRuntimeJS && !disableJsPreload && this.getPreloadDynamicChunks(),
|
|
12891
|
+
!disableRuntimeJS && !disableJsPreload && this.getPreloadMainLinks(files),
|
|
12892
|
+
!disableOptimizedLoading && !disableRuntimeJS && this.getPolyfillScripts(),
|
|
12893
|
+
!disableOptimizedLoading && !disableRuntimeJS && this.getPreNextScripts(),
|
|
12894
|
+
!disableOptimizedLoading && !disableRuntimeJS && this.getDynamicChunks(files),
|
|
12895
|
+
!disableOptimizedLoading && !disableRuntimeJS && this.getScripts(files),
|
|
12896
|
+
optimizeCss && this.getCssLinks(files),
|
|
12897
|
+
optimizeCss && /*#__PURE__*/ (0, _jsxruntime.jsx)("noscript", {
|
|
12898
|
+
"data-n-css": this.props.nonce ?? ""
|
|
12899
|
+
}),
|
|
12900
|
+
this.context.isDevelopment && // this element is used to mount development styles so the
|
|
12901
|
+
// ordering matches production
|
|
12902
|
+
// (by default, style-loader injects at the bottom of <head />)
|
|
12903
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("noscript", {
|
|
12904
|
+
id: "__next_css__DO_NOT_USE__"
|
|
12905
|
+
}),
|
|
12906
|
+
styles || null
|
|
12907
|
+
]
|
|
12908
|
+
}),
|
|
12909
|
+
/*#__PURE__*/ _react.default.createElement(_react.default.Fragment, {}, ...headTags || [])
|
|
12910
|
+
]
|
|
12911
|
+
});
|
|
12912
|
+
}
|
|
12913
|
+
}
|
|
12914
|
+
function handleDocumentScriptLoaderItems(scriptLoader, __NEXT_DATA__, props) {
|
|
12915
|
+
var _children_find_props, _children_find, _children_find_props1, _children_find1;
|
|
12916
|
+
if (!props.children) return;
|
|
12917
|
+
const scriptLoaderItems = [];
|
|
12918
|
+
const children = Array.isArray(props.children) ? props.children : [
|
|
12919
|
+
props.children
|
|
12920
|
+
];
|
|
12921
|
+
const headChildren = (_children_find = children.find((child)=>child.type === Head)) == null ? void 0 : (_children_find_props = _children_find.props) == null ? void 0 : _children_find_props.children;
|
|
12922
|
+
const bodyChildren = (_children_find1 = children.find((child)=>child.type === "body")) == null ? void 0 : (_children_find_props1 = _children_find1.props) == null ? void 0 : _children_find_props1.children;
|
|
12923
|
+
// Scripts with beforeInteractive can be placed inside Head or <body> so children of both needs to be traversed
|
|
12924
|
+
const combinedChildren = [
|
|
12925
|
+
...Array.isArray(headChildren) ? headChildren : [
|
|
12926
|
+
headChildren
|
|
12927
|
+
],
|
|
12928
|
+
...Array.isArray(bodyChildren) ? bodyChildren : [
|
|
12929
|
+
bodyChildren
|
|
12930
|
+
]
|
|
12931
|
+
];
|
|
12932
|
+
_react.default.Children.forEach(combinedChildren, (child)=>{
|
|
12933
|
+
var _child_type;
|
|
12934
|
+
if (!child) return;
|
|
12935
|
+
// When using the `next/script` component, register it in script loader.
|
|
12936
|
+
if ((_child_type = child.type) == null ? void 0 : _child_type.__nextScript) {
|
|
12937
|
+
if (child.props.strategy === "beforeInteractive") {
|
|
12938
|
+
scriptLoader.beforeInteractive = (scriptLoader.beforeInteractive || []).concat([
|
|
12939
|
+
{
|
|
12940
|
+
...child.props
|
|
12941
|
+
}
|
|
12942
|
+
]);
|
|
12943
|
+
return;
|
|
12944
|
+
} else if ([
|
|
12945
|
+
"lazyOnload",
|
|
12946
|
+
"afterInteractive",
|
|
12947
|
+
"worker"
|
|
12948
|
+
].includes(child.props.strategy)) {
|
|
12949
|
+
scriptLoaderItems.push(child.props);
|
|
12950
|
+
return;
|
|
12951
|
+
}
|
|
12952
|
+
}
|
|
12953
|
+
});
|
|
12954
|
+
__NEXT_DATA__.scriptLoader = scriptLoaderItems;
|
|
12955
|
+
}
|
|
12956
|
+
class NextScript extends _react.default.Component {
|
|
12957
|
+
static #_ = commonjsGlobal.contextType = _htmlcontextsharedruntime.HtmlContext;
|
|
12958
|
+
getDynamicChunks(files) {
|
|
12959
|
+
return getDynamicChunks(this.context, this.props, files);
|
|
12960
|
+
}
|
|
12961
|
+
getPreNextScripts() {
|
|
12962
|
+
return getPreNextScripts(this.context, this.props);
|
|
12963
|
+
}
|
|
12964
|
+
getScripts(files) {
|
|
12965
|
+
return getScripts(this.context, this.props, files);
|
|
12966
|
+
}
|
|
12967
|
+
getPolyfillScripts() {
|
|
12968
|
+
return getPolyfillScripts(this.context, this.props);
|
|
12969
|
+
}
|
|
12970
|
+
static getInlineScriptSource(context) {
|
|
12971
|
+
const { __NEXT_DATA__, largePageDataBytes } = context;
|
|
12972
|
+
try {
|
|
12973
|
+
const data = JSON.stringify(__NEXT_DATA__);
|
|
12974
|
+
if (largePageDataWarnings.has(__NEXT_DATA__.page)) {
|
|
12975
|
+
return (0, _htmlescape.htmlEscapeJsonString)(data);
|
|
12976
|
+
}
|
|
12977
|
+
const bytes = process.env.NEXT_RUNTIME === "edge" ? new TextEncoder().encode(data).buffer.byteLength : Buffer.from(data).byteLength;
|
|
12978
|
+
const prettyBytes$1 = prettyBytes.default;
|
|
12979
|
+
if (largePageDataBytes && bytes > largePageDataBytes) {
|
|
12980
|
+
if (process.env.NODE_ENV === "production") {
|
|
12981
|
+
largePageDataWarnings.add(__NEXT_DATA__.page);
|
|
12982
|
+
}
|
|
12983
|
+
console.warn(`Warning: data for page "${__NEXT_DATA__.page}"${__NEXT_DATA__.page === context.dangerousAsPath ? "" : ` (path "${context.dangerousAsPath}")`} is ${prettyBytes$1(bytes)} which exceeds the threshold of ${prettyBytes$1(largePageDataBytes)}, this amount of data can reduce performance.\nSee more info here: https://nextjs.org/docs/messages/large-page-data`);
|
|
12984
|
+
}
|
|
12985
|
+
return (0, _htmlescape.htmlEscapeJsonString)(data);
|
|
12986
|
+
} catch (err) {
|
|
12987
|
+
if ((0, _iserror.default)(err) && err.message.indexOf("circular structure") !== -1) {
|
|
12988
|
+
throw new Error(`Circular structure in "getInitialProps" result of page "${__NEXT_DATA__.page}". https://nextjs.org/docs/messages/circular-structure`);
|
|
12989
|
+
}
|
|
12990
|
+
throw err;
|
|
12991
|
+
}
|
|
12992
|
+
}
|
|
12993
|
+
render() {
|
|
12994
|
+
const { assetPrefix, inAmpMode, buildManifest, unstable_runtimeJS, docComponentsRendered, assetQueryString, disableOptimizedLoading, crossOrigin } = this.context;
|
|
12995
|
+
const disableRuntimeJS = unstable_runtimeJS === false;
|
|
12996
|
+
docComponentsRendered.NextScript = true;
|
|
12997
|
+
if (process.env.NEXT_RUNTIME !== "edge" && inAmpMode) {
|
|
12998
|
+
if (process.env.NODE_ENV === "production") {
|
|
12999
|
+
return null;
|
|
13000
|
+
}
|
|
13001
|
+
const ampDevFiles = [
|
|
13002
|
+
...buildManifest.devFiles,
|
|
13003
|
+
...buildManifest.polyfillFiles,
|
|
13004
|
+
...buildManifest.ampDevFiles
|
|
13005
|
+
];
|
|
13006
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
13007
|
+
children: [
|
|
13008
|
+
disableRuntimeJS ? null : /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
13009
|
+
id: "__NEXT_DATA__",
|
|
13010
|
+
type: "application/json",
|
|
13011
|
+
nonce: this.props.nonce,
|
|
13012
|
+
crossOrigin: this.props.crossOrigin || crossOrigin,
|
|
13013
|
+
dangerouslySetInnerHTML: {
|
|
13014
|
+
__html: NextScript.getInlineScriptSource(this.context)
|
|
13015
|
+
},
|
|
13016
|
+
"data-ampdevmode": true
|
|
13017
|
+
}),
|
|
13018
|
+
ampDevFiles.map((file)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
13019
|
+
src: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
13020
|
+
nonce: this.props.nonce,
|
|
13021
|
+
crossOrigin: this.props.crossOrigin || crossOrigin,
|
|
13022
|
+
"data-ampdevmode": true
|
|
13023
|
+
}, file))
|
|
13024
|
+
]
|
|
13025
|
+
});
|
|
13026
|
+
}
|
|
13027
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13028
|
+
if (this.props.crossOrigin) console.warn("Warning: `NextScript` attribute `crossOrigin` is deprecated. https://nextjs.org/docs/messages/doc-crossorigin-deprecated");
|
|
13029
|
+
}
|
|
13030
|
+
const files = getDocumentFiles(this.context.buildManifest, this.context.__NEXT_DATA__.page, process.env.NEXT_RUNTIME !== "edge" && inAmpMode);
|
|
13031
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
13032
|
+
children: [
|
|
13033
|
+
!disableRuntimeJS && buildManifest.devFiles ? buildManifest.devFiles.map((file)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
13034
|
+
src: `${assetPrefix}/_next/${(0, _encodeuripath.encodeURIPath)(file)}${assetQueryString}`,
|
|
13035
|
+
nonce: this.props.nonce,
|
|
13036
|
+
crossOrigin: this.props.crossOrigin || crossOrigin
|
|
13037
|
+
}, file)) : null,
|
|
13038
|
+
disableRuntimeJS ? null : /*#__PURE__*/ (0, _jsxruntime.jsx)("script", {
|
|
13039
|
+
id: "__NEXT_DATA__",
|
|
13040
|
+
type: "application/json",
|
|
13041
|
+
nonce: this.props.nonce,
|
|
13042
|
+
crossOrigin: this.props.crossOrigin || crossOrigin,
|
|
13043
|
+
dangerouslySetInnerHTML: {
|
|
13044
|
+
__html: NextScript.getInlineScriptSource(this.context)
|
|
13045
|
+
}
|
|
13046
|
+
}),
|
|
13047
|
+
disableOptimizedLoading && !disableRuntimeJS && this.getPolyfillScripts(),
|
|
13048
|
+
disableOptimizedLoading && !disableRuntimeJS && this.getPreNextScripts(),
|
|
13049
|
+
disableOptimizedLoading && !disableRuntimeJS && this.getDynamicChunks(files),
|
|
13050
|
+
disableOptimizedLoading && !disableRuntimeJS && this.getScripts(files)
|
|
13051
|
+
]
|
|
13052
|
+
});
|
|
13053
|
+
}
|
|
13054
|
+
}
|
|
13055
|
+
function Html(props) {
|
|
13056
|
+
const { inAmpMode, docComponentsRendered, locale, scriptLoader, __NEXT_DATA__ } = (0, _htmlcontextsharedruntime.useHtmlContext)();
|
|
13057
|
+
docComponentsRendered.Html = true;
|
|
13058
|
+
handleDocumentScriptLoaderItems(scriptLoader, __NEXT_DATA__, props);
|
|
13059
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("html", {
|
|
13060
|
+
...props,
|
|
13061
|
+
lang: props.lang || locale || undefined,
|
|
13062
|
+
amp: process.env.NEXT_RUNTIME !== "edge" && inAmpMode ? "" : undefined,
|
|
13063
|
+
"data-ampdevmode": process.env.NEXT_RUNTIME !== "edge" && inAmpMode && process.env.NODE_ENV !== "production" ? "" : undefined
|
|
13064
|
+
});
|
|
13065
|
+
}
|
|
13066
|
+
function Main() {
|
|
13067
|
+
const { docComponentsRendered } = (0, _htmlcontextsharedruntime.useHtmlContext)();
|
|
13068
|
+
docComponentsRendered.Main = true;
|
|
13069
|
+
// @ts-ignore
|
|
13070
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("next-js-internal-body-render-target", {});
|
|
13071
|
+
}
|
|
13072
|
+
class Document extends _react.default.Component {
|
|
13073
|
+
/**
|
|
13074
|
+
* `getInitialProps` hook returns the context object with the addition of `renderPage`.
|
|
13075
|
+
* `renderPage` callback executes `React` rendering logic synchronously to support server-rendering wrappers
|
|
13076
|
+
*/ static getInitialProps(ctx) {
|
|
13077
|
+
return ctx.defaultGetInitialProps(ctx);
|
|
13078
|
+
}
|
|
13079
|
+
render() {
|
|
13080
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(Html, {
|
|
13081
|
+
children: [
|
|
13082
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(Head, {}),
|
|
13083
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
|
|
13084
|
+
children: [
|
|
13085
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(Main, {}),
|
|
13086
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(NextScript, {})
|
|
13087
|
+
]
|
|
13088
|
+
})
|
|
13089
|
+
]
|
|
13090
|
+
});
|
|
13091
|
+
}
|
|
13092
|
+
}
|
|
13093
|
+
// Add a special property to the built-in `Document` component so later we can
|
|
13094
|
+
// identify if a user customized `Document` is used or not.
|
|
13095
|
+
const InternalFunctionDocument = function InternalFunctionDocument() {
|
|
13096
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(Html, {
|
|
13097
|
+
children: [
|
|
13098
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(Head, {}),
|
|
13099
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
|
|
13100
|
+
children: [
|
|
13101
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(Main, {}),
|
|
13102
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(NextScript, {})
|
|
13103
|
+
]
|
|
13104
|
+
})
|
|
13105
|
+
]
|
|
13106
|
+
});
|
|
13107
|
+
};
|
|
13108
|
+
Document[_constants.NEXT_BUILTIN_DOCUMENT] = InternalFunctionDocument;
|
|
13109
|
+
|
|
13110
|
+
|
|
13111
|
+
}(_document, _document.exports));
|
|
13112
|
+
|
|
13113
|
+
var document$1 = _document.exports;
|
|
13114
|
+
|
|
13115
|
+
const SERVER_SIDE_JSS_STYLES_ID = 'server-side-jss-styles';
|
|
13116
|
+
function documentWithJss(DocumentComponent) {
|
|
13117
|
+
DocumentComponent.getInitialProps = (ctx) => __awaiter(this, void 0, void 0, function* () {
|
|
13118
|
+
const registry = new SheetsRegistry();
|
|
13119
|
+
const generateId = createGenerateId();
|
|
13120
|
+
const originalRenderPage = ctx.renderPage;
|
|
13121
|
+
ctx.renderPage = () => originalRenderPage({
|
|
13122
|
+
enhanceApp: (App) => (props) => (jsxRuntime.exports.jsx(JssProvider, { registry: registry, generateId: generateId, children: jsxRuntime.exports.jsx(App, Object.assign({}, props)) })),
|
|
13123
|
+
});
|
|
13124
|
+
const initialProps = yield document$1.getInitialProps(ctx);
|
|
13125
|
+
const styles = registry.toString();
|
|
13126
|
+
return Object.assign(Object.assign({}, initialProps), { styles: (jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [initialProps.styles, jsxRuntime.exports.jsx("style", { id: SERVER_SIDE_JSS_STYLES_ID,
|
|
13127
|
+
// use dangerouslySetInnerHTML to avoid escaping
|
|
13128
|
+
dangerouslySetInnerHTML: { __html: styles } })] })) });
|
|
13129
|
+
});
|
|
13130
|
+
return DocumentComponent;
|
|
13131
|
+
}
|
|
13132
|
+
|
|
13133
|
+
export { ComponentBuilder, DATA_CUSTOMIZE_ID, Inversify, appWithJss, documentWithJss };
|