diff --git a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/222/input.js b/crates/swc_ecma_minifier/tests/fixture/next/exceljs/222/input.js
deleted file mode 100644
index 881eadbac3132..0000000000000
--- a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/222/input.js
+++ /dev/null
@@ -1,100 +0,0 @@
-"use strict";
-exports.id = 222;
-exports.ids = [222];
-exports.modules = {
-
-/***/ 6249:
-/***/ ((__unused_webpack_module, exports) => {
-
-var __webpack_unused_export__;
-/**
- * Hoists a name from a module or promised module.
- *
- * @param module the module to hoist the name from
- * @param name the name to hoist
- * @returns the value on the module (or promised module)
- */
-__webpack_unused_export__ = ({
- value: true
-});
-Object.defineProperty(exports, "l", ({
- enumerable: true,
- get: function() {
- return hoist;
- }
-}));
-function hoist(module, name) {
- // If the name is available in the module, return it.
- if (name in module) {
- return module[name];
- }
- // If a property called `then` exists, assume it's a promise and
- // return a promise that resolves to the name.
- if ("then" in module && typeof module.then === "function") {
- return module.then((mod)=>hoist(mod, name));
- }
- // If we're trying to hoise the default export, and the module is a function,
- // return the module itself.
- if (typeof module === "function" && name === "default") {
- return module;
- }
- // Otherwise, return undefined.
- return undefined;
-}
-
-//# sourceMappingURL=helpers.js.map
-
-/***/ }),
-
-/***/ 7153:
-/***/ ((__unused_webpack_module, exports) => {
-
-var __webpack_unused_export__;
-
-__webpack_unused_export__ = ({
- value: true
-});
-Object.defineProperty(exports, "x", ({
- enumerable: true,
- get: function() {
- return RouteKind;
- }
-}));
-var RouteKind;
-(function(RouteKind) {
- RouteKind[/**
- * `PAGES` represents all the React pages that are under `pages/`.
- */ "PAGES"] = "PAGES";
- RouteKind[/**
- * `PAGES_API` represents all the API routes under `pages/api/`.
- */ "PAGES_API"] = "PAGES_API";
- RouteKind[/**
- * `APP_PAGE` represents all the React pages that are under `app/` with the
- * filename of `page.{j,t}s{,x}`.
- */ "APP_PAGE"] = "APP_PAGE";
- RouteKind[/**
- * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the
- * filename of `route.{j,t}s{,x}`.
- */ "APP_ROUTE"] = "APP_ROUTE";
-})(RouteKind || (RouteKind = {}));
-
-//# sourceMappingURL=route-kind.js.map
-
-/***/ }),
-
-/***/ 1802:
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-
-if (false) {} else {
- if (false) {} else if (false) {} else {
- module.exports = __webpack_require__(145);
- }
-}
-
-//# sourceMappingURL=module.compiled.js.map
-
-/***/ })
-
-};
-;
\ No newline at end of file
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/450/input.js b/crates/swc_ecma_minifier/tests/fixture/next/exceljs/450/input.js
deleted file mode 100644
index 675ea7eb8556c..0000000000000
--- a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/450/input.js
+++ /dev/null
@@ -1,86 +0,0 @@
-"use strict";
-exports.id = 450;
-exports.ids = [450];
-exports.modules = {
-
-/***/ 1323:
-/***/ ((__unused_webpack_module, exports) => {
-
-var __webpack_unused_export__;
-/**
- * Hoists a name from a module or promised module.
- *
- * @param module the module to hoist the name from
- * @param name the name to hoist
- * @returns the value on the module (or promised module)
- */
-__webpack_unused_export__ = ({
- value: true
-});
-Object.defineProperty(exports, "l", ({
- enumerable: true,
- get: function() {
- return hoist;
- }
-}));
-function hoist(module, name) {
- // If the name is available in the module, return it.
- if (name in module) {
- return module[name];
- }
- // If a property called `then` exists, assume it's a promise and
- // return a promise that resolves to the name.
- if ("then" in module && typeof module.then === "function") {
- return module.then((mod)=>hoist(mod, name));
- }
- // If we're trying to hoise the default export, and the module is a function,
- // return the module itself.
- if (typeof module === "function" && name === "default") {
- return module;
- }
- // Otherwise, return undefined.
- return undefined;
-}
-
-//# sourceMappingURL=helpers.js.map
-
-/***/ }),
-
-/***/ 5244:
-/***/ ((__unused_webpack_module, exports) => {
-
-var __webpack_unused_export__;
-
-__webpack_unused_export__ = ({
- value: true
-});
-Object.defineProperty(exports, "x", ({
- enumerable: true,
- get: function() {
- return RouteKind;
- }
-}));
-var RouteKind;
-(function(RouteKind) {
- RouteKind[/**
- * `PAGES` represents all the React pages that are under `pages/`.
- */ "PAGES"] = "PAGES";
- RouteKind[/**
- * `PAGES_API` represents all the API routes under `pages/api/`.
- */ "PAGES_API"] = "PAGES_API";
- RouteKind[/**
- * `APP_PAGE` represents all the React pages that are under `app/` with the
- * filename of `page.{j,t}s{,x}`.
- */ "APP_PAGE"] = "APP_PAGE";
- RouteKind[/**
- * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the
- * filename of `route.{j,t}s{,x}`.
- */ "APP_ROUTE"] = "APP_ROUTE";
-})(RouteKind || (RouteKind = {}));
-
-//# sourceMappingURL=route-kind.js.map
-
-/***/ })
-
-};
-;
\ No newline at end of file
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/480/input.js b/crates/swc_ecma_minifier/tests/fixture/next/exceljs/480/input.js
deleted file mode 100644
index 01c97bc599440..0000000000000
--- a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/480/input.js
+++ /dev/null
@@ -1,429 +0,0 @@
-"use strict";
-exports.id = 480;
-exports.ids = [480];
-exports.modules = {
-
-/***/ 5480:
-/***/ ((module, exports, __webpack_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "default", ({
- enumerable: true,
- get: function() {
- return Error;
- }
-}));
-const _interop_require_default = __webpack_require__(167);
-const _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(6689));
-const _head = /*#__PURE__*/ _interop_require_default._(__webpack_require__(4605));
-const statusCodes = {
- 400: "Bad Request",
- 404: "This page could not be found",
- 405: "Method Not Allowed",
- 500: "Internal Server Error"
-};
-function _getInitialProps(param) {
- let { res, err } = param;
- const statusCode = res && res.statusCode ? res.statusCode : err ? err.statusCode : 404;
- return {
- statusCode
- };
-}
-const styles = {
- error: {
- // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52
- fontFamily: 'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',
- height: "100vh",
- textAlign: "center",
- display: "flex",
- flexDirection: "column",
- alignItems: "center",
- justifyContent: "center"
- },
- desc: {
- lineHeight: "48px"
- },
- h1: {
- display: "inline-block",
- margin: "0 20px 0 0",
- paddingRight: 23,
- fontSize: 24,
- fontWeight: 500,
- verticalAlign: "top"
- },
- h2: {
- fontSize: 14,
- fontWeight: 400,
- lineHeight: "28px"
- },
- wrap: {
- display: "inline-block"
- }
-};
-class Error extends _react.default.Component {
- render() {
- const { statusCode, withDarkMode = true } = this.props;
- const title = this.props.title || statusCodes[statusCode] || "An unexpected error has occurred";
- return /*#__PURE__*/ _react.default.createElement("div", {
- style: styles.error
- }, /*#__PURE__*/ _react.default.createElement(_head.default, null, /*#__PURE__*/ _react.default.createElement("title", null, statusCode ? statusCode + ": " + title : "Application error: a client-side exception has occurred")), /*#__PURE__*/ _react.default.createElement("div", {
- style: styles.desc
- }, /*#__PURE__*/ _react.default.createElement("style", {
- dangerouslySetInnerHTML: {
- /* CSS minified from
- body { margin: 0; color: #000; background: #fff; }
- .next-error-h1 {
- border-right: 1px solid rgba(0, 0, 0, .3);
- }
-
- ${
- withDarkMode
- ? `@media (prefers-color-scheme: dark) {
- body { color: #fff; background: #000; }
- .next-error-h1 {
- border-right: 1px solid rgba(255, 255, 255, .3);
- }
- }`
- : ''
- }
- */ __html: "body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}" + (withDarkMode ? "@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}" : "")
- }
- }), statusCode ? /*#__PURE__*/ _react.default.createElement("h1", {
- className: "next-error-h1",
- style: styles.h1
- }, statusCode) : null, /*#__PURE__*/ _react.default.createElement("div", {
- style: styles.wrap
- }, /*#__PURE__*/ _react.default.createElement("h2", {
- style: styles.h2
- }, this.props.title || statusCode ? title : /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, "Application error: a client-side exception has occurred (see the browser console for more information)"), "."))));
- }
-}
-Error.displayName = "ErrorPage";
-Error.getInitialProps = _getInitialProps;
-Error.origGetInitialProps = _getInitialProps;
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=_error.js.map
-
-
-/***/ }),
-
-/***/ 5617:
-/***/ ((__unused_webpack_module, exports) => {
-
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "isInAmpMode", ({
- enumerable: true,
- get: function() {
- return isInAmpMode;
- }
-}));
-function isInAmpMode(param) {
- let { ampFirst = false, hybrid = false, hasQuery = false } = param === void 0 ? {} : param;
- return ampFirst || hybrid && hasQuery;
-} //# sourceMappingURL=amp-mode.js.map
-
-
-/***/ }),
-
-/***/ 4605:
-/***/ ((module, exports, __webpack_require__) => {
-
-/* __next_internal_client_entry_do_not_use__ cjs */
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- defaultHead: function() {
- return defaultHead;
- },
- default: function() {
- return _default;
- }
-});
-const _interop_require_default = __webpack_require__(167);
-const _interop_require_wildcard = __webpack_require__(8760);
-const _react = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(6689));
-const _sideeffect = /*#__PURE__*/ _interop_require_default._(__webpack_require__(3746));
-const _ampcontextsharedruntime = __webpack_require__(8039);
-const _headmanagercontextsharedruntime = __webpack_require__(1988);
-const _ampmode = __webpack_require__(5617);
-const _warnonce = __webpack_require__(3213);
-function defaultHead(inAmpMode) {
- if (inAmpMode === void 0) inAmpMode = false;
- const head = [
- /*#__PURE__*/ _react.default.createElement("meta", {
- charSet: "utf-8"
- })
- ];
- if (!inAmpMode) {
- head.push(/*#__PURE__*/ _react.default.createElement("meta", {
- name: "viewport",
- content: "width=device-width"
- }));
- }
- return head;
-}
-function onlyReactElement(list, child) {
- // React children can be "string" or "number" in this case we ignore them for backwards compat
- if (typeof child === "string" || typeof child === "number") {
- return list;
- }
- // Adds support for React.Fragment
- if (child.type === _react.default.Fragment) {
- return list.concat(_react.default.Children.toArray(child.props.children).reduce((fragmentList, fragmentChild)=>{
- if (typeof fragmentChild === "string" || typeof fragmentChild === "number") {
- return fragmentList;
- }
- return fragmentList.concat(fragmentChild);
- }, []));
- }
- return list.concat(child);
-}
-const METATYPES = [
- "name",
- "httpEquiv",
- "charSet",
- "itemProp"
-];
-/*
- returns a function for filtering head child elements
- which shouldn't be duplicated, like
- Also adds support for deduplicated `key` properties
-*/ function unique() {
- const keys = new Set();
- const tags = new Set();
- const metaTypes = new Set();
- const metaCategories = {};
- return (h)=>{
- let isUnique = true;
- let hasKey = false;
- if (h.key && typeof h.key !== "number" && h.key.indexOf("$") > 0) {
- hasKey = true;
- const key = h.key.slice(h.key.indexOf("$") + 1);
- if (keys.has(key)) {
- isUnique = false;
- } else {
- keys.add(key);
- }
- }
- // eslint-disable-next-line default-case
- switch(h.type){
- case "title":
- case "base":
- if (tags.has(h.type)) {
- isUnique = false;
- } else {
- tags.add(h.type);
- }
- break;
- case "meta":
- for(let i = 0, len = METATYPES.length; i < len; i++){
- const metatype = METATYPES[i];
- if (!h.props.hasOwnProperty(metatype)) continue;
- if (metatype === "charSet") {
- if (metaTypes.has(metatype)) {
- isUnique = false;
- } else {
- metaTypes.add(metatype);
- }
- } else {
- const category = h.props[metatype];
- const categories = metaCategories[metatype] || new Set();
- if ((metatype !== "name" || !hasKey) && categories.has(category)) {
- isUnique = false;
- } else {
- categories.add(category);
- metaCategories[metatype] = categories;
- }
- }
- }
- break;
- }
- return isUnique;
- };
-}
-/**
- *
- * @param headChildrenElements List of children of
- */ function reduceComponents(headChildrenElements, props) {
- const { inAmpMode } = props;
- return headChildrenElements.reduce(onlyReactElement, []).reverse().concat(defaultHead(inAmpMode).reverse()).filter(unique()).reverse().map((c, i)=>{
- const key = c.key || i;
- if ( true && !inAmpMode) {
- if (c.type === "link" && c.props["href"] && // TODO(prateekbh@): Replace this with const from `constants` when the tree shaking works.
- [
- "https://fonts.googleapis.com/css",
- "https://use.typekit.net/"
- ].some((url)=>c.props["href"].startsWith(url))) {
- const newProps = {
- ...c.props || {}
- };
- newProps["data-href"] = newProps["href"];
- newProps["href"] = undefined;
- // Add this attribute to make it easy to identify optimized tags
- newProps["data-optimized-fonts"] = true;
- return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
- }
- }
- if (false) {}
- return /*#__PURE__*/ _react.default.cloneElement(c, {
- key
- });
- });
-}
-/**
- * This component injects elements to `` of your page.
- * To avoid duplicated `tags` in `` you can use the `key` property, which will make sure every tag is only rendered once.
- */ function Head(param) {
- let { children } = param;
- const ampState = (0, _react.useContext)(_ampcontextsharedruntime.AmpStateContext);
- const headManager = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext);
- return /*#__PURE__*/ _react.default.createElement(_sideeffect.default, {
- reduceComponentsToState: reduceComponents,
- headManager: headManager,
- inAmpMode: (0, _ampmode.isInAmpMode)(ampState)
- }, children);
-}
-const _default = Head;
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=head.js.map
-
-
-/***/ }),
-
-/***/ 3746:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "default", ({
- enumerable: true,
- get: function() {
- return SideEffect;
- }
-}));
-const _interop_require_wildcard = __webpack_require__(8760);
-const _react = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(6689));
-const isServer = "undefined" === "undefined";
-const useClientOnlyLayoutEffect = isServer ? ()=>{} : _react.useLayoutEffect;
-const useClientOnlyEffect = isServer ? ()=>{} : _react.useEffect;
-function SideEffect(props) {
- const { headManager, reduceComponentsToState } = props;
- function emitChange() {
- if (headManager && headManager.mountedInstances) {
- const headElements = _react.Children.toArray(Array.from(headManager.mountedInstances).filter(Boolean));
- headManager.updateHead(reduceComponentsToState(headElements, props));
- }
- }
- if (isServer) {
- var _headManager_mountedInstances;
- headManager == null ? void 0 : (_headManager_mountedInstances = headManager.mountedInstances) == null ? void 0 : _headManager_mountedInstances.add(props.children);
- emitChange();
- }
- useClientOnlyLayoutEffect(()=>{
- var _headManager_mountedInstances;
- headManager == null ? void 0 : (_headManager_mountedInstances = headManager.mountedInstances) == null ? void 0 : _headManager_mountedInstances.add(props.children);
- return ()=>{
- var _headManager_mountedInstances;
- headManager == null ? void 0 : (_headManager_mountedInstances = headManager.mountedInstances) == null ? void 0 : _headManager_mountedInstances.delete(props.children);
- };
- });
- // We need to call `updateHead` method whenever the `SideEffect` is trigger in all
- // life-cycles: mount, update, unmount. However, if there are multiple `SideEffect`s
- // being rendered, we only trigger the method from the last one.
- // This is ensured by keeping the last unflushed `updateHead` in the `_pendingUpdate`
- // singleton in the layout effect pass, and actually trigger it in the effect pass.
- useClientOnlyLayoutEffect(()=>{
- if (headManager) {
- headManager._pendingUpdate = emitChange;
- }
- return ()=>{
- if (headManager) {
- headManager._pendingUpdate = emitChange;
- }
- };
- });
- useClientOnlyEffect(()=>{
- if (headManager && headManager._pendingUpdate) {
- headManager._pendingUpdate();
- headManager._pendingUpdate = null;
- }
- return ()=>{
- if (headManager && headManager._pendingUpdate) {
- headManager._pendingUpdate();
- headManager._pendingUpdate = null;
- }
- };
- });
- return null;
-} //# sourceMappingURL=side-effect.js.map
-
-
-/***/ }),
-
-/***/ 3213:
-/***/ ((__unused_webpack_module, exports) => {
-
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "warnOnce", ({
- enumerable: true,
- get: function() {
- return warnOnce;
- }
-}));
-let warnOnce = (_)=>{};
-if (false) {} //# sourceMappingURL=warn-once.js.map
-
-
-/***/ }),
-
-/***/ 8039:
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-
-module.exports = __webpack_require__(7093).vendored.contexts.AmpContext;
-
-//# sourceMappingURL=amp-context.js.map
-
-/***/ }),
-
-/***/ 1988:
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-
-module.exports = __webpack_require__(7093).vendored.contexts.HeadManagerContext;
-
-//# sourceMappingURL=head-manager-context.js.map
-
-/***/ })
-
-};
-;
\ No newline at end of file
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/664/input.js b/crates/swc_ecma_minifier/tests/fixture/next/exceljs/664/input.js
deleted file mode 100644
index 3cbc31af5d7a5..0000000000000
--- a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/664/input.js
+++ /dev/null
@@ -1,1663 +0,0 @@
-exports.id = 664;
-exports.ids = [664];
-exports.modules = {
-
-/***/ 1417:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "addBasePath", ({
- enumerable: true,
- get: function() {
- return addBasePath;
- }
-}));
-const _addpathprefix = __webpack_require__(7662);
-const _normalizetrailingslash = __webpack_require__(4005);
-const basePath = false || "";
-function addBasePath(path, required) {
- return (0, _normalizetrailingslash.normalizePathTrailingSlash)( false ? 0 : (0, _addpathprefix.addPathPrefix)(path, basePath));
-}
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=add-base-path.js.map
-
-
-/***/ }),
-
-/***/ 5017:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "addLocale", ({
- enumerable: true,
- get: function() {
- return addLocale;
- }
-}));
-const _normalizetrailingslash = __webpack_require__(4005);
-const addLocale = function(path) {
- for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
- args[_key - 1] = arguments[_key];
- }
- if (false) {}
- return path;
-};
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=add-locale.js.map
-
-
-/***/ }),
-
-/***/ 9783:
-/***/ ((module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- PrefetchKind: function() {
- return PrefetchKind;
- },
- ACTION_REFRESH: function() {
- return ACTION_REFRESH;
- },
- ACTION_NAVIGATE: function() {
- return ACTION_NAVIGATE;
- },
- ACTION_RESTORE: function() {
- return ACTION_RESTORE;
- },
- ACTION_SERVER_PATCH: function() {
- return ACTION_SERVER_PATCH;
- },
- ACTION_PREFETCH: function() {
- return ACTION_PREFETCH;
- },
- ACTION_FAST_REFRESH: function() {
- return ACTION_FAST_REFRESH;
- },
- ACTION_SERVER_ACTION: function() {
- return ACTION_SERVER_ACTION;
- }
-});
-const ACTION_REFRESH = "refresh";
-const ACTION_NAVIGATE = "navigate";
-const ACTION_RESTORE = "restore";
-const ACTION_SERVER_PATCH = "server-patch";
-const ACTION_PREFETCH = "prefetch";
-const ACTION_FAST_REFRESH = "fast-refresh";
-const ACTION_SERVER_ACTION = "server-action";
-var PrefetchKind;
-(function(PrefetchKind) {
- PrefetchKind["AUTO"] = "auto";
- PrefetchKind["FULL"] = "full";
- PrefetchKind["TEMPORARY"] = "temporary";
-})(PrefetchKind || (PrefetchKind = {}));
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=router-reducer-types.js.map
-
-
-/***/ }),
-
-/***/ 358:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "getDomainLocale", ({
- enumerable: true,
- get: function() {
- return getDomainLocale;
- }
-}));
-const _normalizetrailingslash = __webpack_require__(4005);
-const basePath = (/* unused pure expression or super */ null && ( false || ""));
-function getDomainLocale(path, locale, locales, domainLocales) {
- if (false) {} else {
- return false;
- }
-}
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=get-domain-locale.js.map
-
-
-/***/ }),
-
-/***/ 6732:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "hasBasePath", ({
- enumerable: true,
- get: function() {
- return hasBasePath;
- }
-}));
-const _pathhasprefix = __webpack_require__(2858);
-const basePath = false || "";
-function hasBasePath(path) {
- return (0, _pathhasprefix.pathHasPrefix)(path, basePath);
-}
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=has-base-path.js.map
-
-
-/***/ }),
-
-/***/ 2994:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-/* __next_internal_client_entry_do_not_use__ cjs */
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "default", ({
- enumerable: true,
- get: function() {
- return _default;
- }
-}));
-const _interop_require_default = __webpack_require__(167);
-const _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(6689));
-const _resolvehref = __webpack_require__(6722);
-const _islocalurl = __webpack_require__(4812);
-const _formaturl = __webpack_require__(7822);
-const _utils = __webpack_require__(9938);
-const _addlocale = __webpack_require__(5017);
-const _routercontextsharedruntime = __webpack_require__(5469);
-const _approutercontextsharedruntime = __webpack_require__(7443);
-const _useintersection = __webpack_require__(7549);
-const _getdomainlocale = __webpack_require__(358);
-const _addbasepath = __webpack_require__(1417);
-const _routerreducertypes = __webpack_require__(9783);
-const prefetched = new Set();
-function prefetch(router, href, as, options, appOptions, isAppRouter) {
- if (true) {
- return;
- }
- // app-router supports external urls out of the box so it shouldn't short-circuit here as support for e.g. `replace` is added in the app-router.
- if (!isAppRouter && !(0, _islocalurl.isLocalURL)(href)) {
- return;
- }
- // We should only dedupe requests when experimental.optimisticClientCache is
- // disabled.
- if (!options.bypassPrefetchedCheck) {
- const locale = typeof options.locale !== "undefined" ? options.locale : "locale" in router ? router.locale : undefined;
- const prefetchedKey = href + "%" + as + "%" + locale;
- // If we've already fetched the key, then don't prefetch it again!
- if (prefetched.has(prefetchedKey)) {
- return;
- }
- // Mark this URL as prefetched.
- prefetched.add(prefetchedKey);
- }
- const prefetchPromise = isAppRouter ? router.prefetch(href, appOptions) : router.prefetch(href, as, options);
- // Prefetch the JSON page if asked (only in the client)
- // We need to handle a prefetch error here since we may be
- // loading with priority which can reject but we don't
- // want to force navigation since this is only a prefetch
- Promise.resolve(prefetchPromise).catch((err)=>{
- if (false) {}
- });
-}
-function isModifiedEvent(event) {
- const eventTarget = event.currentTarget;
- const target = eventTarget.getAttribute("target");
- return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
- event.nativeEvent && event.nativeEvent.which === 2;
-}
-function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
- const { nodeName } = e.currentTarget;
- // anchors inside an svg have a lowercase nodeName
- const isAnchorNodeName = nodeName.toUpperCase() === "A";
- if (isAnchorNodeName && (isModifiedEvent(e) || // app-router supports external urls out of the box so it shouldn't short-circuit here as support for e.g. `replace` is added in the app-router.
- !isAppRouter && !(0, _islocalurl.isLocalURL)(href))) {
- // ignore click for browser’s default behavior
- return;
- }
- e.preventDefault();
- const navigate = ()=>{
- // If the router is an NextRouter instance it will have `beforePopState`
- const routerScroll = scroll != null ? scroll : true;
- if ("beforePopState" in router) {
- router[replace ? "replace" : "push"](href, as, {
- shallow,
- locale,
- scroll: routerScroll
- });
- } else {
- router[replace ? "replace" : "push"](as || href, {
- forceOptimisticNavigation: !prefetchEnabled,
- scroll: routerScroll
- });
- }
- };
- if (isAppRouter) {
- _react.default.startTransition(navigate);
- } else {
- navigate();
- }
-}
-function formatStringOrUrl(urlObjOrString) {
- if (typeof urlObjOrString === "string") {
- return urlObjOrString;
- }
- return (0, _formaturl.formatUrl)(urlObjOrString);
-}
-/**
- * React Component that enables client-side transitions between routes.
- */ const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
- let children;
- const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, locale, onClick, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, ...restProps } = props;
- children = childrenProp;
- if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
- children = /*#__PURE__*/ _react.default.createElement("a", null, children);
- }
- const pagesRouter = _react.default.useContext(_routercontextsharedruntime.RouterContext);
- const appRouter = _react.default.useContext(_approutercontextsharedruntime.AppRouterContext);
- const router = pagesRouter != null ? pagesRouter : appRouter;
- // We're in the app directory if there is no pages router.
- const isAppRouter = !pagesRouter;
- const prefetchEnabled = prefetchProp !== false;
- /**
- * The possible states for prefetch are:
- * - null: this is the default "auto" mode, where we will prefetch partially if the link is in the viewport
- * - true: we will prefetch if the link is visible and prefetch the full page, not just partially
- * - false: we will not prefetch if in the viewport at all
- */ const appPrefetchKind = prefetchProp === null ? _routerreducertypes.PrefetchKind.AUTO : _routerreducertypes.PrefetchKind.FULL;
- if (false) {}
- if (false) {}
- const { href, as } = _react.default.useMemo(()=>{
- if (!pagesRouter) {
- const resolvedHref = formatStringOrUrl(hrefProp);
- return {
- href: resolvedHref,
- as: asProp ? formatStringOrUrl(asProp) : resolvedHref
- };
- }
- const [resolvedHref, resolvedAs] = (0, _resolvehref.resolveHref)(pagesRouter, hrefProp, true);
- return {
- href: resolvedHref,
- as: asProp ? (0, _resolvehref.resolveHref)(pagesRouter, asProp) : resolvedAs || resolvedHref
- };
- }, [
- pagesRouter,
- hrefProp,
- asProp
- ]);
- const previousHref = _react.default.useRef(href);
- const previousAs = _react.default.useRef(as);
- // This will return the first child, if multiple are provided it will throw an error
- let child;
- if (legacyBehavior) {
- if (false) {} else {
- child = _react.default.Children.only(children);
- }
- } else {
- if (false) {}
- }
- const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
- const [setIntersectionRef, isVisible, resetVisible] = (0, _useintersection.useIntersection)({
- rootMargin: "200px"
- });
- const setRef = _react.default.useCallback((el)=>{
- // Before the link getting observed, check if visible state need to be reset
- if (previousAs.current !== as || previousHref.current !== href) {
- resetVisible();
- previousAs.current = as;
- previousHref.current = href;
- }
- setIntersectionRef(el);
- if (childRef) {
- if (typeof childRef === "function") childRef(el);
- else if (typeof childRef === "object") {
- childRef.current = el;
- }
- }
- }, [
- as,
- childRef,
- href,
- resetVisible,
- setIntersectionRef
- ]);
- // Prefetch the URL if we haven't already and it's visible.
- _react.default.useEffect(()=>{
- // in dev, we only prefetch on hover to avoid wasting resources as the prefetch will trigger compiling the page.
- if (false) {}
- if (!router) {
- return;
- }
- // If we don't need to prefetch the URL, don't do prefetch.
- if (!isVisible || !prefetchEnabled) {
- return;
- }
- // Prefetch the URL.
- prefetch(router, href, as, {
- locale
- }, {
- kind: appPrefetchKind
- }, isAppRouter);
- }, [
- as,
- href,
- isVisible,
- locale,
- prefetchEnabled,
- pagesRouter == null ? void 0 : pagesRouter.locale,
- router,
- isAppRouter,
- appPrefetchKind
- ]);
- const childProps = {
- ref: setRef,
- onClick (e) {
- if (false) {}
- if (!legacyBehavior && typeof onClick === "function") {
- onClick(e);
- }
- if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
- child.props.onClick(e);
- }
- if (!router) {
- return;
- }
- if (e.defaultPrevented) {
- return;
- }
- linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled);
- },
- onMouseEnter (e) {
- if (!legacyBehavior && typeof onMouseEnterProp === "function") {
- onMouseEnterProp(e);
- }
- if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
- child.props.onMouseEnter(e);
- }
- if (!router) {
- return;
- }
- if ((!prefetchEnabled || "production" === "development") && isAppRouter) {
- return;
- }
- prefetch(router, href, as, {
- locale,
- priority: true,
- // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
- bypassPrefetchedCheck: true
- }, {
- kind: appPrefetchKind
- }, isAppRouter);
- },
- onTouchStart (e) {
- if (!legacyBehavior && typeof onTouchStartProp === "function") {
- onTouchStartProp(e);
- }
- if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
- child.props.onTouchStart(e);
- }
- if (!router) {
- return;
- }
- if (!prefetchEnabled && isAppRouter) {
- return;
- }
- prefetch(router, href, as, {
- locale,
- priority: true,
- // @see {https://github.com/vercel/next.js/discussions/40268?sort=top#discussioncomment-3572642}
- bypassPrefetchedCheck: true
- }, {
- kind: appPrefetchKind
- }, isAppRouter);
- }
- };
- // If child is an tag and doesn't have a href attribute, or if the 'passHref' property is
- // defined, we specify the current 'href', so that repetition is not needed by the user.
- // If the url is absolute, we can bypass the logic to prepend the domain and locale.
- if ((0, _utils.isAbsoluteUrl)(as)) {
- childProps.href = as;
- } else if (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
- const curLocale = typeof locale !== "undefined" ? locale : pagesRouter == null ? void 0 : pagesRouter.locale;
- // we only render domain locales if we are currently on a domain locale
- // so that locale links are still visitable in development/preview envs
- const localeDomain = (pagesRouter == null ? void 0 : pagesRouter.isLocaleDomain) && (0, _getdomainlocale.getDomainLocale)(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.locales, pagesRouter == null ? void 0 : pagesRouter.domainLocales);
- childProps.href = localeDomain || (0, _addbasepath.addBasePath)((0, _addlocale.addLocale)(as, curLocale, pagesRouter == null ? void 0 : pagesRouter.defaultLocale));
- }
- return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", {
- ...restProps,
- ...childProps
- }, children);
-});
-const _default = Link;
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=link.js.map
-
-
-/***/ }),
-
-/***/ 4005:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "normalizePathTrailingSlash", ({
- enumerable: true,
- get: function() {
- return normalizePathTrailingSlash;
- }
-}));
-const _removetrailingslash = __webpack_require__(9620);
-const _parsepath = __webpack_require__(5754);
-const normalizePathTrailingSlash = (path)=>{
- if (!path.startsWith("/") || undefined) {
- return path;
- }
- const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
- if (false) {}
- return "" + (0, _removetrailingslash.removeTrailingSlash)(pathname) + query + hash;
-};
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=normalize-trailing-slash.js.map
-
-
-/***/ }),
-
-/***/ 517:
-/***/ ((module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- requestIdleCallback: function() {
- return requestIdleCallback;
- },
- cancelIdleCallback: function() {
- return cancelIdleCallback;
- }
-});
-const requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
- let start = Date.now();
- return self.setTimeout(function() {
- cb({
- didTimeout: false,
- timeRemaining: function() {
- return Math.max(0, 50 - (Date.now() - start));
- }
- });
- }, 1);
-};
-const cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
- return clearTimeout(id);
-};
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=request-idle-callback.js.map
-
-
-/***/ }),
-
-/***/ 6722:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "resolveHref", ({
- enumerable: true,
- get: function() {
- return resolveHref;
- }
-}));
-const _querystring = __webpack_require__(6507);
-const _formaturl = __webpack_require__(7822);
-const _omit = __webpack_require__(1162);
-const _utils = __webpack_require__(9938);
-const _normalizetrailingslash = __webpack_require__(4005);
-const _islocalurl = __webpack_require__(4812);
-const _utils1 = __webpack_require__(2778);
-const _interpolateas = __webpack_require__(5421);
-function resolveHref(router, href, resolveAs) {
- // we use a dummy base url for relative urls
- let base;
- let urlAsString = typeof href === "string" ? href : (0, _formaturl.formatWithValidation)(href);
- // repeated slashes and backslashes in the URL are considered
- // invalid and will never match a Next.js page/file
- const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
- const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
- const urlParts = urlAsStringNoProto.split("?");
- if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
- console.error("Invalid href '" + urlAsString + "' passed to next/router in page: '" + router.pathname + "'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");
- const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
- urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
- }
- // Return because it cannot be routed by the Next.js router
- if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
- return resolveAs ? [
- urlAsString
- ] : urlAsString;
- }
- try {
- base = new URL(urlAsString.startsWith("#") ? router.asPath : router.pathname, "http://n");
- } catch (_) {
- // fallback to / for invalid asPath values e.g. //
- base = new URL("/", "http://n");
- }
- try {
- const finalUrl = new URL(urlAsString, base);
- finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
- let interpolatedAs = "";
- if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
- const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
- const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
- if (result) {
- interpolatedAs = (0, _formaturl.formatWithValidation)({
- pathname: result,
- hash: finalUrl.hash,
- query: (0, _omit.omit)(query, params)
- });
- }
- }
- // if the origin didn't change, it means we received a relative href
- const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
- return resolveAs ? [
- resolvedHref,
- interpolatedAs || resolvedHref
- ] : resolvedHref;
- } catch (_) {
- return resolveAs ? [
- urlAsString
- ] : urlAsString;
- }
-}
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=resolve-href.js.map
-
-
-/***/ }),
-
-/***/ 7549:
-/***/ ((module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "useIntersection", ({
- enumerable: true,
- get: function() {
- return useIntersection;
- }
-}));
-const _react = __webpack_require__(6689);
-const _requestidlecallback = __webpack_require__(517);
-const hasIntersectionObserver = typeof IntersectionObserver === "function";
-const observers = new Map();
-const idList = [];
-function createObserver(options) {
- const id = {
- root: options.root || null,
- margin: options.rootMargin || ""
- };
- const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
- let instance;
- if (existing) {
- instance = observers.get(existing);
- if (instance) {
- return instance;
- }
- }
- const elements = new Map();
- const observer = new IntersectionObserver((entries)=>{
- entries.forEach((entry)=>{
- const callback = elements.get(entry.target);
- const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
- if (callback && isVisible) {
- callback(isVisible);
- }
- });
- }, options);
- instance = {
- id,
- observer,
- elements
- };
- idList.push(id);
- observers.set(id, instance);
- return instance;
-}
-function observe(element, callback, options) {
- const { id, observer, elements } = createObserver(options);
- elements.set(element, callback);
- observer.observe(element);
- return function unobserve() {
- elements.delete(element);
- observer.unobserve(element);
- // Destroy observer when there's nothing left to watch:
- if (elements.size === 0) {
- observer.disconnect();
- observers.delete(id);
- const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
- if (index > -1) {
- idList.splice(index, 1);
- }
- }
- };
-}
-function useIntersection(param) {
- let { rootRef, rootMargin, disabled } = param;
- const isDisabled = disabled || !hasIntersectionObserver;
- const [visible, setVisible] = (0, _react.useState)(false);
- const elementRef = (0, _react.useRef)(null);
- const setElement = (0, _react.useCallback)((element)=>{
- elementRef.current = element;
- }, []);
- (0, _react.useEffect)(()=>{
- if (hasIntersectionObserver) {
- if (isDisabled || visible) return;
- const element = elementRef.current;
- if (element && element.tagName) {
- const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
- root: rootRef == null ? void 0 : rootRef.current,
- rootMargin
- });
- return unobserve;
- }
- } else {
- if (!visible) {
- const idleCallback = (0, _requestidlecallback.requestIdleCallback)(()=>setVisible(true));
- return ()=>(0, _requestidlecallback.cancelIdleCallback)(idleCallback);
- }
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [
- isDisabled,
- rootMargin,
- rootRef,
- visible,
- elementRef.current
- ]);
- const resetVisible = (0, _react.useCallback)(()=>{
- setVisible(false);
- }, []);
- return [
- setElement,
- visible,
- resetVisible
- ];
-}
-if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
- Object.defineProperty(exports.default, "__esModule", {
- value: true
- });
- Object.assign(exports.default, exports);
- module.exports = exports.default;
-} //# sourceMappingURL=use-intersection.js.map
-
-
-/***/ }),
-
-/***/ 9314:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-// regexp is based on https://github.com/sindresorhus/escape-string-regexp
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "escapeStringRegexp", ({
- enumerable: true,
- get: function() {
- return escapeStringRegexp;
- }
-}));
-const reHasRegExp = /[|\\{}()[\]^$+*?.-]/;
-const reReplaceRegExp = /[|\\{}()[\]^$+*?.-]/g;
-function escapeStringRegexp(str) {
- // see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23
- if (reHasRegExp.test(str)) {
- return str.replace(reReplaceRegExp, "\\$&");
- }
- return str;
-} //# sourceMappingURL=escape-regexp.js.map
-
-
-/***/ }),
-
-/***/ 7662:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "addPathPrefix", ({
- enumerable: true,
- get: function() {
- return addPathPrefix;
- }
-}));
-const _parsepath = __webpack_require__(5754);
-function addPathPrefix(path, prefix) {
- if (!path.startsWith("/") || !prefix) {
- return path;
- }
- const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
- return "" + prefix + pathname + query + hash;
-} //# sourceMappingURL=add-path-prefix.js.map
-
-
-/***/ }),
-
-/***/ 3851:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- normalizeAppPath: function() {
- return normalizeAppPath;
- },
- normalizeRscPath: function() {
- return normalizeRscPath;
- }
-});
-const _ensureleadingslash = __webpack_require__(8034);
-const _segment = __webpack_require__(8181);
-function normalizeAppPath(route) {
- return (0, _ensureleadingslash.ensureLeadingSlash)(route.split("/").reduce((pathname, segment, index, segments)=>{
- // Empty segments are ignored.
- if (!segment) {
- return pathname;
- }
- // Groups are ignored.
- if ((0, _segment.isGroupSegment)(segment)) {
- return pathname;
- }
- // Parallel segments are ignored.
- if (segment[0] === "@") {
- return pathname;
- }
- // The last segment (if it's a leaf) should be ignored.
- if ((segment === "page" || segment === "route") && index === segments.length - 1) {
- return pathname;
- }
- return pathname + "/" + segment;
- }, ""));
-}
-function normalizeRscPath(pathname, enabled) {
- return enabled ? pathname.replace(/\.rsc($|\?)/, "$1") : pathname;
-} //# sourceMappingURL=app-paths.js.map
-
-
-/***/ }),
-
-/***/ 7822:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-// Format function modified from nodejs
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// 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.
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- formatUrl: function() {
- return formatUrl;
- },
- urlObjectKeys: function() {
- return urlObjectKeys;
- },
- formatWithValidation: function() {
- return formatWithValidation;
- }
-});
-const _interop_require_wildcard = __webpack_require__(8760);
-const _querystring = /*#__PURE__*/ _interop_require_wildcard._(__webpack_require__(6507));
-const slashedProtocols = /https?|ftp|gopher|file/;
-function formatUrl(urlObj) {
- let { auth, hostname } = urlObj;
- let protocol = urlObj.protocol || "";
- let pathname = urlObj.pathname || "";
- let hash = urlObj.hash || "";
- let query = urlObj.query || "";
- let host = false;
- auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ":") + "@" : "";
- if (urlObj.host) {
- host = auth + urlObj.host;
- } else if (hostname) {
- host = auth + (~hostname.indexOf(":") ? "[" + hostname + "]" : hostname);
- if (urlObj.port) {
- host += ":" + urlObj.port;
- }
- }
- if (query && typeof query === "object") {
- query = String(_querystring.urlQueryToSearchParams(query));
- }
- let search = urlObj.search || query && "?" + query || "";
- if (protocol && !protocol.endsWith(":")) protocol += ":";
- if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
- host = "//" + (host || "");
- if (pathname && pathname[0] !== "/") pathname = "/" + pathname;
- } else if (!host) {
- host = "";
- }
- if (hash && hash[0] !== "#") hash = "#" + hash;
- if (search && search[0] !== "?") search = "?" + search;
- pathname = pathname.replace(/[?#]/g, encodeURIComponent);
- search = search.replace("#", "%23");
- return "" + protocol + host + pathname + search + hash;
-}
-const urlObjectKeys = [
- "auth",
- "hash",
- "host",
- "hostname",
- "href",
- "path",
- "pathname",
- "port",
- "protocol",
- "query",
- "search",
- "slashes"
-];
-function formatWithValidation(url) {
- if (false) {}
- return formatUrl(url);
-} //# sourceMappingURL=format-url.js.map
-
-
-/***/ }),
-
-/***/ 5421:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "interpolateAs", ({
- enumerable: true,
- get: function() {
- return interpolateAs;
- }
-}));
-const _routematcher = __webpack_require__(2461);
-const _routeregex = __webpack_require__(2767);
-function interpolateAs(route, asPathname, query) {
- let interpolatedRoute = "";
- const dynamicRegex = (0, _routeregex.getRouteRegex)(route);
- const dynamicGroups = dynamicRegex.groups;
- const dynamicMatches = (asPathname !== route ? (0, _routematcher.getRouteMatcher)(dynamicRegex)(asPathname) : "") || // Fall back to reading the values from the href
- // TODO: should this take priority; also need to change in the router.
- query;
- interpolatedRoute = route;
- const params = Object.keys(dynamicGroups);
- if (!params.every((param)=>{
- let value = dynamicMatches[param] || "";
- const { repeat, optional } = dynamicGroups[param];
- // support single-level catch-all
- // TODO: more robust handling for user-error (passing `/`)
- let replaced = "[" + (repeat ? "..." : "") + param + "]";
- if (optional) {
- replaced = (!value ? "/" : "") + "[" + replaced + "]";
- }
- if (repeat && !Array.isArray(value)) value = [
- value
- ];
- return (optional || param in dynamicMatches) && // Interpolate group into data URL if present
- (interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map(// path delimiter escaped since they are being inserted
- // into the URL and we expect URL encoded segments
- // when parsing dynamic route params
- (segment)=>encodeURIComponent(segment)).join("/") : encodeURIComponent(value)) || "/");
- })) {
- interpolatedRoute = "" // did not satisfy all requirements
- ;
- // n.b. We ignore this error because we handle warning for this case in
- // development in the `` component directly.
- }
- return {
- params,
- result: interpolatedRoute
- };
-} //# sourceMappingURL=interpolate-as.js.map
-
-
-/***/ }),
-
-/***/ 4812:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "isLocalURL", ({
- enumerable: true,
- get: function() {
- return isLocalURL;
- }
-}));
-const _utils = __webpack_require__(9938);
-const _hasbasepath = __webpack_require__(6732);
-function isLocalURL(url) {
- // prevent a hydration mismatch on href for url with anchor refs
- if (!(0, _utils.isAbsoluteUrl)(url)) return true;
- try {
- // absolute urls can be local if they are on the same origin
- const locationOrigin = (0, _utils.getLocationOrigin)();
- const resolved = new URL(url, locationOrigin);
- return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
- } catch (_) {
- return false;
- }
-} //# sourceMappingURL=is-local-url.js.map
-
-
-/***/ }),
-
-/***/ 1162:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "omit", ({
- enumerable: true,
- get: function() {
- return omit;
- }
-}));
-function omit(object, keys) {
- const omitted = {};
- Object.keys(object).forEach((key)=>{
- if (!keys.includes(key)) {
- omitted[key] = object[key];
- }
- });
- return omitted;
-} //# sourceMappingURL=omit.js.map
-
-
-/***/ }),
-
-/***/ 5754:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-/**
- * Given a path this function will find the pathname, query and hash and return
- * them. This is useful to parse full paths on the client side.
- * @param path A path to parse e.g. /foo/bar?id=1#hash
- */
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "parsePath", ({
- enumerable: true,
- get: function() {
- return parsePath;
- }
-}));
-function parsePath(path) {
- const hashIndex = path.indexOf("#");
- const queryIndex = path.indexOf("?");
- const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
- if (hasQuery || hashIndex > -1) {
- return {
- pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
- query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : "",
- hash: hashIndex > -1 ? path.slice(hashIndex) : ""
- };
- }
- return {
- pathname: path,
- query: "",
- hash: ""
- };
-} //# sourceMappingURL=parse-path.js.map
-
-
-/***/ }),
-
-/***/ 2858:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "pathHasPrefix", ({
- enumerable: true,
- get: function() {
- return pathHasPrefix;
- }
-}));
-const _parsepath = __webpack_require__(5754);
-function pathHasPrefix(path, prefix) {
- if (typeof path !== "string") {
- return false;
- }
- const { pathname } = (0, _parsepath.parsePath)(path);
- return pathname === prefix || pathname.startsWith(prefix + "/");
-} //# sourceMappingURL=path-has-prefix.js.map
-
-
-/***/ }),
-
-/***/ 6507:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- searchParamsToUrlQuery: function() {
- return searchParamsToUrlQuery;
- },
- urlQueryToSearchParams: function() {
- return urlQueryToSearchParams;
- },
- assign: function() {
- return assign;
- }
-});
-function searchParamsToUrlQuery(searchParams) {
- const query = {};
- searchParams.forEach((value, key)=>{
- if (typeof query[key] === "undefined") {
- query[key] = value;
- } else if (Array.isArray(query[key])) {
- query[key].push(value);
- } else {
- query[key] = [
- query[key],
- value
- ];
- }
- });
- return query;
-}
-function stringifyUrlQueryParam(param) {
- if (typeof param === "string" || typeof param === "number" && !isNaN(param) || typeof param === "boolean") {
- return String(param);
- } else {
- return "";
- }
-}
-function urlQueryToSearchParams(urlQuery) {
- const result = new URLSearchParams();
- Object.entries(urlQuery).forEach((param)=>{
- let [key, value] = param;
- if (Array.isArray(value)) {
- value.forEach((item)=>result.append(key, stringifyUrlQueryParam(item)));
- } else {
- result.set(key, stringifyUrlQueryParam(value));
- }
- });
- return result;
-}
-function assign(target) {
- for(var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
- searchParamsList[_key - 1] = arguments[_key];
- }
- searchParamsList.forEach((searchParams)=>{
- Array.from(searchParams.keys()).forEach((key)=>target.delete(key));
- searchParams.forEach((value, key)=>target.append(key, value));
- });
- return target;
-} //# sourceMappingURL=querystring.js.map
-
-
-/***/ }),
-
-/***/ 9620:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-/**
- * Removes the trailing slash for a given route or page path. Preserves the
- * root page. Examples:
- * - `/foo/bar/` -> `/foo/bar`
- * - `/foo/bar` -> `/foo/bar`
- * - `/` -> `/`
- */
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "removeTrailingSlash", ({
- enumerable: true,
- get: function() {
- return removeTrailingSlash;
- }
-}));
-function removeTrailingSlash(route) {
- return route.replace(/\/$/, "") || "/";
-} //# sourceMappingURL=remove-trailing-slash.js.map
-
-
-/***/ }),
-
-/***/ 2461:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "getRouteMatcher", ({
- enumerable: true,
- get: function() {
- return getRouteMatcher;
- }
-}));
-const _utils = __webpack_require__(9938);
-function getRouteMatcher(param) {
- let { re, groups } = param;
- return (pathname)=>{
- const routeMatch = re.exec(pathname);
- if (!routeMatch) {
- return false;
- }
- const decode = (param)=>{
- try {
- return decodeURIComponent(param);
- } catch (_) {
- throw new _utils.DecodeError("failed to decode param");
- }
- };
- const params = {};
- Object.keys(groups).forEach((slugName)=>{
- const g = groups[slugName];
- const m = routeMatch[g.pos];
- if (m !== undefined) {
- params[slugName] = ~m.indexOf("/") ? m.split("/").map((entry)=>decode(entry)) : g.repeat ? [
- decode(m)
- ] : decode(m);
- }
- });
- return params;
- };
-} //# sourceMappingURL=route-matcher.js.map
-
-
-/***/ }),
-
-/***/ 2767:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- getRouteRegex: function() {
- return getRouteRegex;
- },
- getNamedRouteRegex: function() {
- return getNamedRouteRegex;
- },
- getNamedMiddlewareRegex: function() {
- return getNamedMiddlewareRegex;
- }
-});
-const _interceptionroutes = __webpack_require__(2407);
-const _escaperegexp = __webpack_require__(9314);
-const _removetrailingslash = __webpack_require__(9620);
-const NEXT_QUERY_PARAM_PREFIX = "nxtP";
-const NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
-/**
- * Parses a given parameter from a route to a data structure that can be used
- * to generate the parametrized route. Examples:
- * - `[...slug]` -> `{ key: 'slug', repeat: true, optional: true }`
- * - `...slug` -> `{ key: 'slug', repeat: true, optional: false }`
- * - `[foo]` -> `{ key: 'foo', repeat: false, optional: true }`
- * - `bar` -> `{ key: 'bar', repeat: false, optional: false }`
- */ function parseParameter(param) {
- const optional = param.startsWith("[") && param.endsWith("]");
- if (optional) {
- param = param.slice(1, -1);
- }
- const repeat = param.startsWith("...");
- if (repeat) {
- param = param.slice(3);
- }
- return {
- key: param,
- repeat,
- optional
- };
-}
-function getParametrizedRoute(route) {
- const segments = (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/");
- const groups = {};
- let groupIndex = 1;
- return {
- parameterizedRoute: segments.map((segment)=>{
- const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
- const paramMatches = segment.match(/\[((?:\[.*\])|.+)\]/) // Check for parameters
- ;
- if (markerMatch && paramMatches) {
- const { key, optional, repeat } = parseParameter(paramMatches[1]);
- groups[key] = {
- pos: groupIndex++,
- repeat,
- optional
- };
- return "/" + (0, _escaperegexp.escapeStringRegexp)(markerMatch) + "([^/]+?)";
- } else if (paramMatches) {
- const { key, repeat, optional } = parseParameter(paramMatches[1]);
- groups[key] = {
- pos: groupIndex++,
- repeat,
- optional
- };
- return repeat ? optional ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)";
- } else {
- return "/" + (0, _escaperegexp.escapeStringRegexp)(segment);
- }
- }).join(""),
- groups
- };
-}
-function getRouteRegex(normalizedRoute) {
- const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute);
- return {
- re: new RegExp("^" + parameterizedRoute + "(?:/)?$"),
- groups: groups
- };
-}
-/**
- * Builds a function to generate a minimal routeKey using only a-z and minimal
- * number of characters.
- */ function buildGetSafeRouteKey() {
- let i = 0;
- return ()=>{
- let routeKey = "";
- let j = ++i;
- while(j > 0){
- routeKey += String.fromCharCode(97 + (j - 1) % 26);
- j = Math.floor((j - 1) / 26);
- }
- return routeKey;
- };
-}
-function getSafeKeyFromSegment(param) {
- let { getSafeRouteKey, segment, routeKeys, keyPrefix } = param;
- const { key, optional, repeat } = parseParameter(segment);
- // replace any non-word characters since they can break
- // the named regex
- let cleanedKey = key.replace(/\W/g, "");
- if (keyPrefix) {
- cleanedKey = "" + keyPrefix + cleanedKey;
- }
- let invalidKey = false;
- // check if the key is still invalid and fallback to using a known
- // safe key
- if (cleanedKey.length === 0 || cleanedKey.length > 30) {
- invalidKey = true;
- }
- if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {
- invalidKey = true;
- }
- if (invalidKey) {
- cleanedKey = getSafeRouteKey();
- }
- if (keyPrefix) {
- routeKeys[cleanedKey] = "" + keyPrefix + key;
- } else {
- routeKeys[cleanedKey] = "" + key;
- }
- return repeat ? optional ? "(?:/(?<" + cleanedKey + ">.+?))?" : "/(?<" + cleanedKey + ">.+?)" : "/(?<" + cleanedKey + ">[^/]+?)";
-}
-function getNamedParametrizedRoute(route, prefixRouteKeys) {
- const segments = (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/");
- const getSafeRouteKey = buildGetSafeRouteKey();
- const routeKeys = {};
- return {
- namedParameterizedRoute: segments.map((segment)=>{
- const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m));
- const paramMatches = segment.match(/\[((?:\[.*\])|.+)\]/) // Check for parameters
- ;
- if (hasInterceptionMarker && paramMatches) {
- return getSafeKeyFromSegment({
- getSafeRouteKey,
- segment: paramMatches[1],
- routeKeys,
- keyPrefix: prefixRouteKeys ? NEXT_INTERCEPTION_MARKER_PREFIX : undefined
- });
- } else if (paramMatches) {
- return getSafeKeyFromSegment({
- getSafeRouteKey,
- segment: paramMatches[1],
- routeKeys,
- keyPrefix: prefixRouteKeys ? NEXT_QUERY_PARAM_PREFIX : undefined
- });
- } else {
- return "/" + (0, _escaperegexp.escapeStringRegexp)(segment);
- }
- }).join(""),
- routeKeys
- };
-}
-function getNamedRouteRegex(normalizedRoute, prefixRouteKey) {
- const result = getNamedParametrizedRoute(normalizedRoute, prefixRouteKey);
- return {
- ...getRouteRegex(normalizedRoute),
- namedRegex: "^" + result.namedParameterizedRoute + "(?:/)?$",
- routeKeys: result.routeKeys
- };
-}
-function getNamedMiddlewareRegex(normalizedRoute, options) {
- const { parameterizedRoute } = getParametrizedRoute(normalizedRoute);
- const { catchAll = true } = options;
- if (parameterizedRoute === "/") {
- let catchAllRegex = catchAll ? ".*" : "";
- return {
- namedRegex: "^/" + catchAllRegex + "$"
- };
- }
- const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false);
- let catchAllGroupedRegex = catchAll ? "(?:(/.*)?)" : "";
- return {
- namedRegex: "^" + namedParameterizedRoute + catchAllGroupedRegex + "$"
- };
-} //# sourceMappingURL=route-regex.js.map
-
-
-/***/ }),
-
-/***/ 8181:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-Object.defineProperty(exports, "isGroupSegment", ({
- enumerable: true,
- get: function() {
- return isGroupSegment;
- }
-}));
-function isGroupSegment(segment) {
- // Use array[0] for performant purpose
- return segment[0] === "(" && segment.endsWith(")");
-} //# sourceMappingURL=segment.js.map
-
-
-/***/ }),
-
-/***/ 2407:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- INTERCEPTION_ROUTE_MARKERS: function() {
- return INTERCEPTION_ROUTE_MARKERS;
- },
- isInterceptionRouteAppPath: function() {
- return isInterceptionRouteAppPath;
- },
- extractInterceptionRouteInformation: function() {
- return extractInterceptionRouteInformation;
- }
-});
-const _apppaths = __webpack_require__(3851);
-const INTERCEPTION_ROUTE_MARKERS = [
- "(..)(..)",
- "(.)",
- "(..)",
- "(...)"
-];
-function isInterceptionRouteAppPath(path) {
- // TODO-APP: add more serious validation
- return path.split("/").find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;
-}
-function extractInterceptionRouteInformation(path) {
- let interceptingRoute, marker, interceptedRoute;
- for (const segment of path.split("/")){
- marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
- if (marker) {
- [interceptingRoute, interceptedRoute] = path.split(marker, 2);
- break;
- }
- }
- if (!interceptingRoute || !marker || !interceptedRoute) {
- throw new Error(`Invalid interception route: ${path}. Must be in the format //(..|...|..)(..)/`);
- }
- interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed
- ;
- switch(marker){
- case "(.)":
- // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route
- if (interceptingRoute === "/") {
- interceptedRoute = `/${interceptedRoute}`;
- } else {
- interceptedRoute = interceptingRoute + "/" + interceptedRoute;
- }
- break;
- case "(..)":
- // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route
- if (interceptingRoute === "/") {
- throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);
- }
- interceptedRoute = interceptingRoute.split("/").slice(0, -1).concat(interceptedRoute).join("/");
- break;
- case "(...)":
- // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route
- interceptedRoute = "/" + interceptedRoute;
- break;
- case "(..)(..)":
- // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route
- const splitInterceptingRoute = interceptingRoute.split("/");
- if (splitInterceptingRoute.length <= 2) {
- throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);
- }
- interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join("/");
- break;
- default:
- throw new Error("Invariant: unexpected marker");
- }
- return {
- interceptingRoute,
- interceptedRoute
- };
-}
-
-//# sourceMappingURL=interception-routes.js.map
-
-/***/ }),
-
-/***/ 7443:
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-
-module.exports = __webpack_require__(7093).vendored.contexts.AppRouterContext;
-
-//# sourceMappingURL=app-router-context.js.map
-
-/***/ }),
-
-/***/ 5469:
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-"use strict";
-
-module.exports = __webpack_require__(7093).vendored.contexts.RouterContext;
-
-//# sourceMappingURL=router-context.js.map
-
-/***/ }),
-
-/***/ 1664:
-/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
-
-module.exports = __webpack_require__(2994)
-
-
-/***/ })
-
-};
-;
\ No newline at end of file
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/760/input.js b/crates/swc_ecma_minifier/tests/fixture/next/exceljs/760/input.js
deleted file mode 100644
index 1d4b9a50bcfdc..0000000000000
--- a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/760/input.js
+++ /dev/null
@@ -1,52 +0,0 @@
-"use strict";
-exports.id = 760;
-exports.ids = [760];
-exports.modules = {
-
-/***/ 8760:
-/***/ ((__unused_webpack_module, exports) => {
-
-
-
-function _getRequireWildcardCache(nodeInterop) {
- if (typeof WeakMap !== "function") return null;
-
- var cacheBabelInterop = new WeakMap();
- var cacheNodeInterop = new WeakMap();
-
- return (_getRequireWildcardCache = function(nodeInterop) {
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
- })(nodeInterop);
-}
-exports._ = exports._interop_require_wildcard = _interop_require_wildcard;
-function _interop_require_wildcard(obj, nodeInterop) {
- if (!nodeInterop && obj && obj.__esModule) return obj;
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
-
- var cache = _getRequireWildcardCache(nodeInterop);
-
- if (cache && cache.has(obj)) return cache.get(obj);
-
- var newObj = {};
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
-
- for (var key in obj) {
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
- if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
- else newObj[key] = obj[key];
- }
- }
-
- newObj.default = obj;
-
- if (cache) cache.set(obj, newObj);
-
- return newObj;
-}
-
-
-/***/ })
-
-};
-;
\ No newline at end of file
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/859/input.js b/crates/swc_ecma_minifier/tests/fixture/next/exceljs/859/input.js
deleted file mode 100644
index 7506bda03655b..0000000000000
--- a/crates/swc_ecma_minifier/tests/fixture/next/exceljs/859/input.js
+++ /dev/null
@@ -1,1981 +0,0 @@
-exports.id = 859;
-exports.ids = [859];
-exports.modules = {
-
-/***/ 7481:
-/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({
- value: true
-}));
-0 && (0);
-function _export(target, all) {
- for(var name in all)Object.defineProperty(target, name, {
- enumerable: true,
- get: all[name]
- });
-}
-_export(exports, {
- Head: function() {
- return Head;
- },
- NextScript: function() {
- return NextScript;
- },
- Html: function() {
- return Html;
- },
- Main: function() {
- return Main;
- },
- /**
- * `Document` component handles the initial `document` markup and renders only on the server side.
- * Commonly used for implementing server side rendering for `css-in-js` libraries.
- */ default: function() {
- return Document;
- }
-});
-const _react = /*#__PURE__*/ _interop_require_default(__webpack_require__(6689));
-const _constants = __webpack_require__(3755);
-const _getpagefiles = __webpack_require__(5778);
-const _htmlescape = __webpack_require__(9630);
-const _iserror = /*#__PURE__*/ _interop_require_default(__webpack_require__(676));
-const _htmlcontextsharedruntime = __webpack_require__(3112);
-function _interop_require_default(obj) {
- return obj && obj.__esModule ? obj : {
- default: obj
- };
-}
-/** Set of pages that have triggered a large data warning on production mode. */ const largePageDataWarnings = new Set();
-function getDocumentFiles(buildManifest, pathname, inAmpMode) {
- const sharedFiles = (0, _getpagefiles.getPageFiles)(buildManifest, "/_app");
- const pageFiles = true && inAmpMode ? [] : (0, _getpagefiles.getPageFiles)(buildManifest, pathname);
- return {
- sharedFiles,
- pageFiles,
- allFiles: [
- ...new Set([
- ...sharedFiles,
- ...pageFiles
- ])
- ]
- };
-}
-function getPolyfillScripts(context, props) {
- // polyfills.js has to be rendered as nomodule without async
- // It also has to be the first script to load
- const { assetPrefix, buildManifest, assetQueryString, disableOptimizedLoading, crossOrigin } = context;
- return buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith(".js") && !polyfill.endsWith(".module.js")).map((polyfill)=>/*#__PURE__*/ _react.default.createElement("script", {
- key: polyfill,
- defer: !disableOptimizedLoading,
- nonce: props.nonce,
- crossOrigin: props.crossOrigin || crossOrigin,
- noModule: true,
- src: `${assetPrefix}/_next/${polyfill}${assetQueryString}`
- }));
-}
-function hasComponentProps(child) {
- return !!child && !!child.props;
-}
-function AmpStyles({ styles }) {
- if (!styles) return null;
- // try to parse styles from fragment for backwards compat
- const curStyles = Array.isArray(styles) ? styles : [];
- if (styles.props && // @ts-ignore Property 'props' does not exist on type ReactElement
- Array.isArray(styles.props.children)) {
- const hasStyles = (el)=>{
- var _el_props_dangerouslySetInnerHTML, _el_props;
- 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;
- };
- // @ts-ignore Property 'props' does not exist on type ReactElement
- styles.props.children.forEach((child)=>{
- if (Array.isArray(child)) {
- child.forEach((el)=>hasStyles(el) && curStyles.push(el));
- } else if (hasStyles(child)) {
- curStyles.push(child);
- }
- });
- }
- /* Add custom styles before AMP styles to prevent accidental overrides */ return /*#__PURE__*/ _react.default.createElement("style", {
- "amp-custom": "",
- dangerouslySetInnerHTML: {
- __html: curStyles.map((style)=>style.props.dangerouslySetInnerHTML.__html).join("").replace(/\/\*# sourceMappingURL=.*\*\//g, "").replace(/\/\*@ sourceURL=.*?\*\//g, "")
- }
- });
-}
-function getDynamicChunks(context, props, files) {
- const { dynamicImports, assetPrefix, isDevelopment, assetQueryString, disableOptimizedLoading, crossOrigin } = context;
- return dynamicImports.map((file)=>{
- if (!file.endsWith(".js") || files.allFiles.includes(file)) return null;
- return /*#__PURE__*/ _react.default.createElement("script", {
- async: !isDevelopment && disableOptimizedLoading,
- defer: !disableOptimizedLoading,
- key: file,
- src: `${assetPrefix}/_next/${encodeURI(file)}${assetQueryString}`,
- nonce: props.nonce,
- crossOrigin: props.crossOrigin || crossOrigin
- });
- });
-}
-function getScripts(context, props, files) {
- var _buildManifest_lowPriorityFiles;
- const { assetPrefix, buildManifest, isDevelopment, assetQueryString, disableOptimizedLoading, crossOrigin } = context;
- const normalScripts = files.allFiles.filter((file)=>file.endsWith(".js"));
- const lowPriorityScripts = (_buildManifest_lowPriorityFiles = buildManifest.lowPriorityFiles) == null ? void 0 : _buildManifest_lowPriorityFiles.filter((file)=>file.endsWith(".js"));
- return [
- ...normalScripts,
- ...lowPriorityScripts
- ].map((file)=>{
- return /*#__PURE__*/ _react.default.createElement("script", {
- key: file,
- src: `${assetPrefix}/_next/${encodeURI(file)}${assetQueryString}`,
- nonce: props.nonce,
- async: !isDevelopment && disableOptimizedLoading,
- defer: !disableOptimizedLoading,
- crossOrigin: props.crossOrigin || crossOrigin
- });
- });
-}
-function getPreNextWorkerScripts(context, props) {
- const { assetPrefix, scriptLoader, crossOrigin, nextScriptWorkers } = context;
- // disable `nextScriptWorkers` in edge runtime
- if (!nextScriptWorkers || "nodejs" === "edge") return null;
- try {
- let { partytownSnippet } = require("@builder.io/partytown/integration");
- const children = Array.isArray(props.children) ? props.children : [
- props.children
- ];
- // Check to see if the user has defined their own Partytown configuration
- const userDefinedConfig = children.find((child)=>{
- var _child_props_dangerouslySetInnerHTML, _child_props;
- 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;
- });
- return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !userDefinedConfig && /*#__PURE__*/ _react.default.createElement("script", {
- "data-partytown-config": "",
- dangerouslySetInnerHTML: {
- __html: `
- partytown = {
- lib: "${assetPrefix}/_next/static/~partytown/"
- };
- `
- }
- }), /*#__PURE__*/ _react.default.createElement("script", {
- "data-partytown": "",
- dangerouslySetInnerHTML: {
- __html: partytownSnippet()
- }
- }), (scriptLoader.worker || []).map((file, index)=>{
- const { strategy, src, children: scriptChildren, dangerouslySetInnerHTML, ...scriptProps } = file;
- let srcProps = {};
- if (src) {
- // Use external src if provided
- srcProps.src = src;
- } else if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
- // Embed inline script if provided with dangerouslySetInnerHTML
- srcProps.dangerouslySetInnerHTML = {
- __html: dangerouslySetInnerHTML.__html
- };
- } else if (scriptChildren) {
- // Embed inline script if provided with children
- srcProps.dangerouslySetInnerHTML = {
- __html: typeof scriptChildren === "string" ? scriptChildren : Array.isArray(scriptChildren) ? scriptChildren.join("") : ""
- };
- } else {
- 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");
- }
- return /*#__PURE__*/ _react.default.createElement("script", {
- ...srcProps,
- ...scriptProps,
- type: "text/partytown",
- key: src || index,
- nonce: props.nonce,
- "data-nscript": "worker",
- crossOrigin: props.crossOrigin || crossOrigin
- });
- }));
- } catch (err) {
- if ((0, _iserror.default)(err) && err.code !== "MODULE_NOT_FOUND") {
- console.warn(`Warning: ${err.message}`);
- }
- return null;
- }
-}
-function getPreNextScripts(context, props) {
- const { scriptLoader, disableOptimizedLoading, crossOrigin } = context;
- const webWorkerScripts = getPreNextWorkerScripts(context, props);
- const beforeInteractiveScripts = (scriptLoader.beforeInteractive || []).filter((script)=>script.src).map((file, index)=>{
- const { strategy, ...scriptProps } = file;
- return /*#__PURE__*/ _react.default.createElement("script", {
- ...scriptProps,
- key: scriptProps.src || index,
- defer: scriptProps.defer ?? !disableOptimizedLoading,
- nonce: props.nonce,
- "data-nscript": "beforeInteractive",
- crossOrigin: props.crossOrigin || crossOrigin
- });
- });
- return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, webWorkerScripts, beforeInteractiveScripts);
-}
-function getHeadHTMLProps(props) {
- const { crossOrigin, nonce, ...restProps } = props;
- // This assignment is necessary for additional type checking to avoid unsupported attributes in
- const headProps = restProps;
- return headProps;
-}
-function getAmpPath(ampPath, asPath) {
- return ampPath || `${asPath}${asPath.includes("?") ? "&" : "?"}amp=1`;
-}
-function getNextFontLinkTags(nextFontManifest, dangerousAsPath, assetPrefix = "") {
- if (!nextFontManifest) {
- return {
- preconnect: null,
- preload: null
- };
- }
- const appFontsEntry = nextFontManifest.pages["/_app"];
- const pageFontsEntry = nextFontManifest.pages[dangerousAsPath];
- const preloadedFontFiles = [
- ...appFontsEntry ?? [],
- ...pageFontsEntry ?? []
- ];
- // If no font files should preload but there's an entry for the path, add a preconnect tag.
- const preconnectToSelf = !!(preloadedFontFiles.length === 0 && (appFontsEntry || pageFontsEntry));
- return {
- preconnect: preconnectToSelf ? /*#__PURE__*/ _react.default.createElement("link", {
- "data-next-font": nextFontManifest.pagesUsingSizeAdjust ? "size-adjust" : "",
- rel: "preconnect",
- href: "/",
- crossOrigin: "anonymous"
- }) : null,
- preload: preloadedFontFiles ? preloadedFontFiles.map((fontFile)=>{
- const ext = /\.(woff|woff2|eot|ttf|otf)$/.exec(fontFile)[1];
- return /*#__PURE__*/ _react.default.createElement("link", {
- key: fontFile,
- rel: "preload",
- href: `${assetPrefix}/_next/${encodeURI(fontFile)}`,
- as: "font",
- type: `font/${ext}`,
- crossOrigin: "anonymous",
- "data-next-font": fontFile.includes("-s") ? "size-adjust" : ""
- });
- }) : null
- };
-}
-class Head extends _react.default.Component {
- static #_ = this.contextType = _htmlcontextsharedruntime.HtmlContext;
- getCssLinks(files) {
- const { assetPrefix, assetQueryString, dynamicImports, crossOrigin, optimizeCss, optimizeFonts } = this.context;
- const cssFiles = files.allFiles.filter((f)=>f.endsWith(".css"));
- const sharedFiles = new Set(files.sharedFiles);
- // Unmanaged files are CSS files that will be handled directly by the
- // webpack runtime (`mini-css-extract-plugin`).
- let unmangedFiles = new Set([]);
- let dynamicCssFiles = Array.from(new Set(dynamicImports.filter((file)=>file.endsWith(".css"))));
- if (dynamicCssFiles.length) {
- const existing = new Set(cssFiles);
- dynamicCssFiles = dynamicCssFiles.filter((f)=>!(existing.has(f) || sharedFiles.has(f)));
- unmangedFiles = new Set(dynamicCssFiles);
- cssFiles.push(...dynamicCssFiles);
- }
- let cssLinkElements = [];
- cssFiles.forEach((file)=>{
- const isSharedFile = sharedFiles.has(file);
- if (!optimizeCss) {
- cssLinkElements.push(/*#__PURE__*/ _react.default.createElement("link", {
- key: `${file}-preload`,
- nonce: this.props.nonce,
- rel: "preload",
- href: `${assetPrefix}/_next/${encodeURI(file)}${assetQueryString}`,
- as: "style",
- crossOrigin: this.props.crossOrigin || crossOrigin
- }));
- }
- const isUnmanagedFile = unmangedFiles.has(file);
- cssLinkElements.push(/*#__PURE__*/ _react.default.createElement("link", {
- key: file,
- nonce: this.props.nonce,
- rel: "stylesheet",
- href: `${assetPrefix}/_next/${encodeURI(file)}${assetQueryString}`,
- crossOrigin: this.props.crossOrigin || crossOrigin,
- "data-n-g": isUnmanagedFile ? undefined : isSharedFile ? "" : undefined,
- "data-n-p": isUnmanagedFile ? undefined : isSharedFile ? undefined : ""
- }));
- });
- if ( true && optimizeFonts) {
- cssLinkElements = this.makeStylesheetInert(cssLinkElements);
- }
- return cssLinkElements.length === 0 ? null : cssLinkElements;
- }
- getPreloadDynamicChunks() {
- const { dynamicImports, assetPrefix, assetQueryString, crossOrigin } = this.context;
- return dynamicImports.map((file)=>{
- if (!file.endsWith(".js")) {
- return null;
- }
- return /*#__PURE__*/ _react.default.createElement("link", {
- rel: "preload",
- key: file,
- href: `${assetPrefix}/_next/${encodeURI(file)}${assetQueryString}`,
- as: "script",
- nonce: this.props.nonce,
- crossOrigin: this.props.crossOrigin || crossOrigin
- });
- }) // Filter out nulled scripts
- .filter(Boolean);
- }
- getPreloadMainLinks(files) {
- const { assetPrefix, assetQueryString, scriptLoader, crossOrigin } = this.context;
- const preloadFiles = files.allFiles.filter((file)=>{
- return file.endsWith(".js");
- });
- return [
- ...(scriptLoader.beforeInteractive || []).map((file)=>/*#__PURE__*/ _react.default.createElement("link", {
- key: file.src,
- nonce: this.props.nonce,
- rel: "preload",
- href: file.src,
- as: "script",
- crossOrigin: this.props.crossOrigin || crossOrigin
- })),
- ...preloadFiles.map((file)=>/*#__PURE__*/ _react.default.createElement("link", {
- key: file,
- nonce: this.props.nonce,
- rel: "preload",
- href: `${assetPrefix}/_next/${encodeURI(file)}${assetQueryString}`,
- as: "script",
- crossOrigin: this.props.crossOrigin || crossOrigin
- }))
- ];
- }
- getBeforeInteractiveInlineScripts() {
- const { scriptLoader } = this.context;
- const { nonce, crossOrigin } = this.props;
- return (scriptLoader.beforeInteractive || []).filter((script)=>!script.src && (script.dangerouslySetInnerHTML || script.children)).map((file, index)=>{
- const { strategy, children, dangerouslySetInnerHTML, src, ...scriptProps } = file;
- let html = "";
- if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
- html = dangerouslySetInnerHTML.__html;
- } else if (children) {
- html = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
- }
- return /*#__PURE__*/ _react.default.createElement("script", {
- ...scriptProps,
- dangerouslySetInnerHTML: {
- __html: html
- },
- key: scriptProps.id || index,
- nonce: nonce,
- "data-nscript": "beforeInteractive",
- crossOrigin: crossOrigin || undefined
- });
- });
- }
- getDynamicChunks(files) {
- return getDynamicChunks(this.context, this.props, files);
- }
- getPreNextScripts() {
- return getPreNextScripts(this.context, this.props);
- }
- getScripts(files) {
- return getScripts(this.context, this.props, files);
- }
- getPolyfillScripts() {
- return getPolyfillScripts(this.context, this.props);
- }
- makeStylesheetInert(node) {
- return _react.default.Children.map(node, (c)=>{
- var _c_props, _c_props1;
- 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 })=>{
- var _c_props_href, _c_props;
- 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);
- })) {
- const newProps = {
- ...c.props || {},
- "data-href": c.props.href,
- href: undefined
- };
- return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
- } else if (c == null ? void 0 : (_c_props1 = c.props) == null ? void 0 : _c_props1.children) {
- const newProps = {
- ...c.props || {},
- children: this.makeStylesheetInert(c.props.children)
- };
- return /*#__PURE__*/ _react.default.cloneElement(c, newProps);
- }
- return c;
- // @types/react bug. Returned value from .map will not be `null` if you pass in `[null]`
- }).filter(Boolean);
- }
- render() {
- const { styles, ampPath, inAmpMode, hybridAmp, canonicalBase, __NEXT_DATA__, dangerousAsPath, headTags, unstable_runtimeJS, unstable_JsPreload, disableOptimizedLoading, optimizeCss, optimizeFonts, assetPrefix, nextFontManifest } = this.context;
- const disableRuntimeJS = unstable_runtimeJS === false;
- const disableJsPreload = unstable_JsPreload === false || !disableOptimizedLoading;
- this.context.docComponentsRendered.Head = true;
- let { head } = this.context;
- let cssPreloads = [];
- let otherHeadElements = [];
- if (head) {
- head.forEach((c)=>{
- let metaTag;
- if (this.context.strictNextHead) {
- metaTag = /*#__PURE__*/ _react.default.createElement("meta", {
- name: "next-head",
- content: "1"
- });
- }
- if (c && c.type === "link" && c.props["rel"] === "preload" && c.props["as"] === "style") {
- metaTag && cssPreloads.push(metaTag);
- cssPreloads.push(c);
- } else {
- if (c) {
- if (metaTag && (c.type !== "meta" || !c.props["charSet"])) {
- otherHeadElements.push(metaTag);
- }
- otherHeadElements.push(c);
- }
- }
- });
- head = cssPreloads.concat(otherHeadElements);
- }
- let children = _react.default.Children.toArray(this.props.children).filter(Boolean);
- // show a warning if Head contains (only in development)
- if (false) {}
- if ( true && optimizeFonts && !( true && inAmpMode)) {
- children = this.makeStylesheetInert(children);
- }
- let hasAmphtmlRel = false;
- let hasCanonicalRel = false;
- // show warning and remove conflicting amp head tags
- head = _react.default.Children.map(head || [], (child)=>{
- if (!child) return child;
- const { type, props } = child;
- if ( true && inAmpMode) {
- let badProp = "";
- if (type === "meta" && props.name === "viewport") {
- badProp = 'name="viewport"';
- } else if (type === "link" && props.rel === "canonical") {
- hasCanonicalRel = true;
- } else if (type === "script") {
- // only block if
- // 1. it has a src and isn't pointing to ampproject's CDN
- // 2. it is using dangerouslySetInnerHTML without a type or
- // a type of text/javascript
- if (props.src && props.src.indexOf("ampproject") < -1 || props.dangerouslySetInnerHTML && (!props.type || props.type === "text/javascript")) {
- badProp = "