@amoa/casting 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/_interop_require_default.js +3 -0
- package/dist/_virtual/_interop_require_wildcard.js +3 -0
- package/dist/_virtual/action-async-storage-instance.js +3 -0
- package/dist/_virtual/action-async-storage.external.js +3 -0
- package/dist/_virtual/add-base-path.js +3 -0
- package/dist/_virtual/add-locale.js +3 -0
- package/dist/_virtual/add-locale2.js +3 -0
- package/dist/_virtual/add-path-prefix.js +3 -0
- package/dist/_virtual/app-paths.js +3 -0
- package/dist/_virtual/app-router-context.shared-runtime.js +3 -0
- package/dist/_virtual/app-router-headers.js +3 -0
- package/dist/_virtual/app.js +3 -0
- package/dist/_virtual/async-local-storage.js +3 -0
- package/dist/_virtual/bailout-to-csr.js +3 -0
- package/dist/_virtual/boundary-constants.js +3 -0
- package/dist/_virtual/constants.js +3 -0
- package/dist/_virtual/deployment-id.js +3 -0
- package/dist/_virtual/detect-domain-locale.js +3 -0
- package/dist/_virtual/detect-domain-locale2.js +3 -0
- package/dist/_virtual/dynamic-rendering-utils.js +3 -0
- package/dist/_virtual/dynamic-rendering.js +3 -0
- package/dist/_virtual/ensure-leading-slash.js +3 -0
- package/dist/_virtual/error-once.js +3 -0
- package/dist/_virtual/escape-regexp.js +3 -0
- package/dist/_virtual/find-closest-quality.js +3 -0
- package/dist/_virtual/forbidden.js +3 -0
- package/dist/_virtual/format-url.js +3 -0
- package/dist/_virtual/get-domain-locale.js +3 -0
- package/dist/_virtual/get-dynamic-param.js +3 -0
- package/dist/_virtual/get-img-props.js +3 -0
- package/dist/_virtual/get-segment-param.js +3 -0
- package/dist/_virtual/has-base-path.js +3 -0
- package/dist/_virtual/head-manager-context.shared-runtime.js +3 -0
- package/dist/_virtual/head.js +3 -0
- package/dist/_virtual/hooks-client-context.shared-runtime.js +3 -0
- package/dist/_virtual/hooks-server-context.js +3 -0
- package/dist/_virtual/http-access-fallback.js +3 -0
- package/dist/_virtual/image-blur-svg.js +3 -0
- package/dist/_virtual/image-component.js +3 -0
- package/dist/_virtual/image-config-context.shared-runtime.js +3 -0
- package/dist/_virtual/image-config.js +3 -0
- package/dist/_virtual/image-external.js +3 -0
- package/dist/_virtual/image-loader.js +3 -0
- package/dist/_virtual/image.js +7 -0
- package/dist/_virtual/index.js +3 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/index3.js +3 -0
- package/dist/_virtual/interception-prefix-from-param-type.js +3 -0
- package/dist/_virtual/interception-routes.js +3 -0
- package/dist/_virtual/interpolate-as.js +3 -0
- package/dist/_virtual/invariant-error.js +3 -0
- package/dist/_virtual/is-dynamic.js +3 -0
- package/dist/_virtual/is-local-url.js +3 -0
- package/dist/_virtual/is-next-router-error.js +3 -0
- package/dist/_virtual/is-postpone.js +3 -0
- package/dist/_virtual/jsx-runtime.js +5 -0
- package/dist/_virtual/jsx-runtime2.js +3 -0
- package/dist/_virtual/link.js +7 -0
- package/dist/_virtual/link2.js +3 -0
- package/dist/_virtual/match-local-pattern.js +3 -0
- package/dist/_virtual/match-remote-pattern.js +3 -0
- package/dist/_virtual/navigation.js +3 -0
- package/dist/_virtual/navigation.react-server.js +3 -0
- package/dist/_virtual/navigation2.js +3 -0
- package/dist/_virtual/normalize-locale-path.js +3 -0
- package/dist/_virtual/normalize-locale-path2.js +3 -0
- package/dist/_virtual/normalize-trailing-slash.js +3 -0
- package/dist/_virtual/not-found.js +3 -0
- package/dist/_virtual/omit.js +3 -0
- package/dist/_virtual/parse-loader-tree.js +3 -0
- package/dist/_virtual/parse-path.js +3 -0
- package/dist/_virtual/path-has-prefix.js +3 -0
- package/dist/_virtual/querystring.js +3 -0
- package/dist/_virtual/react-jsx-runtime.development.js +3 -0
- package/dist/_virtual/react-jsx-runtime.production.js +3 -0
- package/dist/_virtual/readonly-url-search-params.js +3 -0
- package/dist/_virtual/redirect-error.js +3 -0
- package/dist/_virtual/redirect-status-code.js +3 -0
- package/dist/_virtual/redirect.js +3 -0
- package/dist/_virtual/remove-trailing-slash.js +3 -0
- package/dist/_virtual/request-idle-callback.js +3 -0
- package/dist/_virtual/resolve-href.js +3 -0
- package/dist/_virtual/resolve-param-value.js +3 -0
- package/dist/_virtual/route-match-utils.js +3 -0
- package/dist/_virtual/route-matcher.js +3 -0
- package/dist/_virtual/route-pattern-normalizer.js +3 -0
- package/dist/_virtual/route-regex.js +3 -0
- package/dist/_virtual/router-context.shared-runtime.js +3 -0
- package/dist/_virtual/scheduler.js +3 -0
- package/dist/_virtual/segment.js +3 -0
- package/dist/_virtual/server-inserted-html.shared-runtime.js +3 -0
- package/dist/_virtual/side-effect.js +3 -0
- package/dist/_virtual/sorted-routes.js +3 -0
- package/dist/_virtual/static-generation-bailout.js +3 -0
- package/dist/_virtual/unauthorized.js +3 -0
- package/dist/_virtual/unrecognized-action-error.js +3 -0
- package/dist/_virtual/unstable-rethrow.browser.js +3 -0
- package/dist/_virtual/unstable-rethrow.js +3 -0
- package/dist/_virtual/unstable-rethrow.server.js +3 -0
- package/dist/_virtual/use-intersection.js +3 -0
- package/dist/_virtual/use-merged-ref.js +3 -0
- package/dist/_virtual/utils.js +3 -0
- package/dist/_virtual/warn-once.js +3 -0
- package/dist/_virtual/work-async-storage-instance.js +3 -0
- package/dist/_virtual/work-async-storage.external.js +3 -0
- package/dist/_virtual/work-unit-async-storage-instance.js +3 -0
- package/dist/_virtual/work-unit-async-storage.external.js +3 -0
- package/dist/config/config.json.js +37 -0
- package/dist/export/index.js +46 -0
- package/dist/form/buttons/index.js +13 -0
- package/dist/form/buttons/index.module.css.js +7 -0
- package/dist/form/caption/index.js +13 -0
- package/dist/form/caption/index.module.css.js +7 -0
- package/dist/form/description/index.js +13 -0
- package/dist/form/description/index.module.css.js +7 -0
- package/dist/form/email/index.js +24 -0
- package/dist/form/index.js +17 -0
- package/dist/form/index.module.css.js +7 -0
- package/dist/form/inputs/index.js +13 -0
- package/dist/form/inputs/index.module.css.js +7 -0
- package/dist/form/password/index.js +24 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.js +16 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.js +48 -0
- package/dist/node_modules/next/dist/client/add-base-path.js +38 -0
- package/dist/node_modules/next/dist/client/add-locale.js +39 -0
- package/dist/node_modules/next/dist/client/components/app-router-headers.js +112 -0
- package/dist/node_modules/next/dist/client/components/forbidden.js +62 -0
- package/dist/node_modules/next/dist/client/components/hooks-server-context.js +50 -0
- package/dist/node_modules/next/dist/client/components/http-access-fallback/http-access-fallback.js +77 -0
- package/dist/node_modules/next/dist/client/components/is-next-router-error.js +37 -0
- package/dist/node_modules/next/dist/client/components/navigation.js +198 -0
- package/dist/node_modules/next/dist/client/components/navigation.react-server.js +80 -0
- package/dist/node_modules/next/dist/client/components/not-found.js +56 -0
- package/dist/node_modules/next/dist/client/components/readonly-url-search-params.js +58 -0
- package/dist/node_modules/next/dist/client/components/redirect-error.js +60 -0
- package/dist/node_modules/next/dist/client/components/redirect-status-code.js +36 -0
- package/dist/node_modules/next/dist/client/components/redirect.js +98 -0
- package/dist/node_modules/next/dist/client/components/static-generation-bailout.js +50 -0
- package/dist/node_modules/next/dist/client/components/unauthorized.js +63 -0
- package/dist/node_modules/next/dist/client/components/unrecognized-action-error.js +47 -0
- package/dist/node_modules/next/dist/client/components/unstable-rethrow.browser.js +42 -0
- package/dist/node_modules/next/dist/client/components/unstable-rethrow.js +41 -0
- package/dist/node_modules/next/dist/client/components/unstable-rethrow.server.js +50 -0
- package/dist/node_modules/next/dist/client/detect-domain-locale.js +36 -0
- package/dist/node_modules/next/dist/client/get-domain-locale.js +51 -0
- package/dist/node_modules/next/dist/client/has-base-path.js +36 -0
- package/dist/node_modules/next/dist/client/image-component.js +343 -0
- package/dist/node_modules/next/dist/client/link.js +466 -0
- package/dist/node_modules/next/dist/client/normalize-locale-path.js +40 -0
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +54 -0
- package/dist/node_modules/next/dist/client/request-idle-callback.js +52 -0
- package/dist/node_modules/next/dist/client/resolve-href.js +124 -0
- package/dist/node_modules/next/dist/client/use-intersection.js +126 -0
- package/dist/node_modules/next/dist/client/use-merged-ref.js +79 -0
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +439 -0
- package/dist/node_modules/next/dist/compiled/picomatch/index.js +1662 -0
- package/dist/node_modules/next/dist/lib/constants.js +339 -0
- package/dist/node_modules/next/dist/lib/framework/boundary-constants.js +41 -0
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.js +114 -0
- package/dist/node_modules/next/dist/lib/scheduler.js +69 -0
- package/dist/node_modules/next/dist/server/app-render/action-async-storage-instance.js +26 -0
- package/dist/node_modules/next/dist/server/app-render/action-async-storage.external.js +25 -0
- package/dist/node_modules/next/dist/server/app-render/async-local-storage.js +83 -0
- package/dist/node_modules/next/dist/server/app-render/dynamic-rendering.js +804 -0
- package/dist/node_modules/next/dist/server/app-render/work-async-storage-instance.js +26 -0
- package/dist/node_modules/next/dist/server/app-render/work-async-storage.external.js +25 -0
- package/dist/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js +26 -0
- package/dist/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +221 -0
- package/dist/node_modules/next/dist/server/dynamic-rendering-utils.js +90 -0
- package/dist/node_modules/next/dist/server/lib/router-utils/is-postpone.js +27 -0
- package/dist/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +56 -0
- package/dist/node_modules/next/dist/shared/lib/deployment-id.js +41 -0
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/find-closest-quality.js +30 -0
- package/dist/node_modules/next/dist/shared/lib/get-img-props.js +617 -0
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +31 -0
- package/dist/node_modules/next/dist/shared/lib/head.js +177 -0
- package/dist/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +65 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +36 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +66 -0
- package/dist/node_modules/next/dist/shared/lib/image-blur-svg.js +42 -0
- package/dist/node_modules/next/dist/shared/lib/image-config-context.shared-runtime.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/image-config.js +56 -0
- package/dist/node_modules/next/dist/shared/lib/image-external.js +60 -0
- package/dist/node_modules/next/dist/shared/lib/image-loader.js +119 -0
- package/dist/node_modules/next/dist/shared/lib/invariant-error.js +29 -0
- package/dist/node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js +43 -0
- package/dist/node_modules/next/dist/shared/lib/match-local-pattern.js +54 -0
- package/dist/node_modules/next/dist/shared/lib/match-remote-pattern.js +71 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +31 -0
- package/dist/node_modules/next/dist/shared/lib/router/routes/app.js +130 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +41 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +36 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +61 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +88 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +176 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +89 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +38 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +44 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +109 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.js +71 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +38 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.js +39 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +46 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +46 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +34 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +82 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +34 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +128 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +122 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +61 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +312 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +246 -0
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +31 -0
- package/dist/node_modules/next/dist/shared/lib/segment.js +102 -0
- package/dist/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js +44 -0
- package/dist/node_modules/next/dist/shared/lib/side-effect.js +78 -0
- package/dist/node_modules/next/dist/shared/lib/utils/error-once.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/utils/warn-once.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/utils.js +192 -0
- package/dist/node_modules/next/image.js +13 -0
- package/dist/node_modules/next/link.js +13 -0
- package/dist/node_modules/next/navigation.js +13 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +240 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +44 -0
- package/dist/node_modules/react/jsx-runtime.js +19 -0
- package/dist/node_modules/style-inject/dist/style-inject.es.js +26 -0
- package/dist/packages/carving/src/carving.js +34 -0
- package/dist/packages/carving/src/condo.js +17 -0
- package/dist/packages/carving/src/logos/amoa.js +17 -0
- package/dist/packages/forge/src/classes.js +17 -0
- package/dist/packages/forge/src/dates/date.js +8 -0
- package/dist/packages/forge/src/dates/day.js +7 -0
- package/dist/packages/forge/src/dates/index.js +31 -0
- package/dist/packages/forge/src/dates/month.js +35 -0
- package/dist/packages/forge/src/dates/year.js +16 -0
- package/dist/packages/forge/src/fetcher/index.js +37 -0
- package/dist/packages/forge/src/fetcher/querystring.js +9 -0
- package/dist/packages/forge/src/files.js +17 -0
- package/dist/packages/forge/src/numbers/index.js +5 -0
- package/dist/packages/forge/src/strings/characters.js +3 -0
- package/dist/packages/forge/src/strings/diacritics.js +261 -0
- package/dist/packages/forge/src/strings/index.js +24 -0
- package/dist/packages/hooks/src/use-debounce.js +19 -0
- package/dist/packages/hooks/src/use-tooltip.js +27 -0
- package/dist/packages/ingots/src/address/api/form.js +12 -0
- package/dist/packages/ingots/src/address/config.json.js +16 -0
- package/dist/packages/ingots/src/address/index.js +117 -0
- package/dist/packages/ingots/src/address/index.module.css.js +7 -0
- package/dist/packages/ingots/src/address/service.js +41 -0
- package/dist/packages/ingots/src/backdrop/index.js +18 -0
- package/dist/packages/ingots/src/backdrop/index.module.css.js +7 -0
- package/dist/packages/ingots/src/button/index.js +56 -0
- package/dist/packages/ingots/src/button/index.module.css.js +7 -0
- package/dist/packages/ingots/src/checkbox/index.js +47 -0
- package/dist/packages/ingots/src/checkbox/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/erase/index.js +22 -0
- package/dist/packages/ingots/src/date/erase/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/input/index.js +113 -0
- package/dist/packages/ingots/src/date/input/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/picker/day/index.js +35 -0
- package/dist/packages/ingots/src/date/picker/day/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/picker/days/index.js +59 -0
- package/dist/packages/ingots/src/date/picker/days/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/picker/handle/index.js +40 -0
- package/dist/packages/ingots/src/date/picker/handle/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/picker/index.js +154 -0
- package/dist/packages/ingots/src/date/picker/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/picker/menu/index.js +32 -0
- package/dist/packages/ingots/src/date/picker/menu/index.module.css.js +7 -0
- package/dist/packages/ingots/src/date/picker/menu/item.js +30 -0
- package/dist/packages/ingots/src/date/picker/menu/item.module.css.js +7 -0
- package/dist/packages/ingots/src/file/api/index.js +14 -0
- package/dist/packages/ingots/src/file/card/index.js +65 -0
- package/dist/packages/ingots/src/file/card/index.module.css.js +7 -0
- package/dist/packages/ingots/src/file/index.js +34 -0
- package/dist/packages/ingots/src/file/index.module.css.js +7 -0
- package/dist/packages/ingots/src/file/input/index.js +261 -0
- package/dist/packages/ingots/src/file/input/index.module.css.js +7 -0
- package/dist/packages/ingots/src/input/index.js +75 -0
- package/dist/packages/ingots/src/input/src/validation/index.js +3 -0
- package/dist/packages/ingots/src/loader/index.js +23 -0
- package/dist/packages/ingots/src/loader/index.module.css.js +7 -0
- package/dist/packages/ingots/src/loader/variants/spinner/index.js +31 -0
- package/dist/packages/ingots/src/loader/variants/spinner/index.module.css.js +7 -0
- package/dist/packages/ingots/src/select/card/index.js +33 -0
- package/dist/packages/ingots/src/select/card/index.module.css.js +7 -0
- package/dist/packages/ingots/src/select/category/index.js +13 -0
- package/dist/packages/ingots/src/select/category/index.module.css.js +7 -0
- package/dist/packages/ingots/src/select/content/index.js +46 -0
- package/dist/packages/ingots/src/select/index.js +155 -0
- package/dist/packages/ingots/src/select/index.module.css.js +7 -0
- package/dist/packages/ingots/src/select/option/index.js +35 -0
- package/dist/packages/ingots/src/select/option/index.module.css.js +7 -0
- package/dist/packages/ingots/src/select/options/index.js +59 -0
- package/dist/packages/ingots/src/select/options/index.module.css.js +7 -0
- package/dist/packages/ingots/src/snackbar/context.js +9 -0
- package/dist/packages/ingots/src/tag/index.js +16 -0
- package/dist/packages/ingots/src/tag/index.module.css.js +7 -0
- package/dist/packages/ingots/src/text/index.js +92 -0
- package/dist/packages/ingots/src/text/index.module.css.js +7 -0
- package/dist/packages/ingots/src/textarea/index.js +62 -0
- package/dist/packages/ingots/src/textarea/index.module.css.js +7 -0
- package/dist/packages/ingots/src/toggle/index.js +43 -0
- package/dist/packages/ingots/src/toggle/index.module.css.js +7 -0
- package/dist/packages/runes/src/icon.js +16 -0
- package/dist/packages/runes/src/paths/alert.js +18 -0
- package/dist/packages/runes/src/paths/arrow/path.js +18 -0
- package/dist/packages/runes/src/paths/calendar.js +18 -0
- package/dist/packages/runes/src/paths/check/fill.js +18 -0
- package/dist/packages/runes/src/paths/check/regular.js +18 -0
- package/dist/packages/runes/src/paths/chevron/down.js +18 -0
- package/dist/packages/runes/src/paths/chevron/left.js +18 -0
- package/dist/packages/runes/src/paths/chevron/right.js +18 -0
- package/dist/packages/runes/src/paths/click.js +18 -0
- package/dist/packages/runes/src/paths/cross/regular.js +16 -0
- package/dist/packages/runes/src/paths/download.js +18 -0
- package/dist/packages/runes/src/paths/file.js +18 -0
- package/dist/packages/runes/src/paths/link.js +23 -0
- package/dist/packages/wares/src/authentication/index.js +11 -0
- package/dist/waiter/index.js +41 -0
- package/dist/waiter/index.module.css.js +7 -0
- package/package.json +6 -6
- package/dist/export.js +0 -2
- package/dist/export.js.LICENSE.txt +0 -9
- package/dist/form.js +0 -2
- package/dist/form.js.LICENSE.txt +0 -9
- package/dist/waiter.js +0 -2
- package/dist/waiter.js.LICENSE.txt +0 -9
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { __exports as routeRegex } from '../../../../../../../_virtual/route-regex.js';
|
|
2
|
+
import { __require as requireConstants } from '../../../../lib/constants.js';
|
|
3
|
+
import { __require as requireInterceptionRoutes } from './interception-routes.js';
|
|
4
|
+
import { __require as requireEscapeRegexp } from '../../escape-regexp.js';
|
|
5
|
+
import { __require as requireRemoveTrailingSlash } from './remove-trailing-slash.js';
|
|
6
|
+
import { __require as requireGetDynamicParam } from './get-dynamic-param.js';
|
|
7
|
+
|
|
8
|
+
var hasRequiredRouteRegex;
|
|
9
|
+
|
|
10
|
+
function requireRouteRegex () {
|
|
11
|
+
if (hasRequiredRouteRegex) return routeRegex;
|
|
12
|
+
hasRequiredRouteRegex = 1;
|
|
13
|
+
(function (exports$1) {
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
function _export(target, all) {
|
|
19
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: all[name]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
_export(exports$1, {
|
|
25
|
+
getNamedMiddlewareRegex: function () {
|
|
26
|
+
return getNamedMiddlewareRegex;
|
|
27
|
+
},
|
|
28
|
+
getNamedRouteRegex: function () {
|
|
29
|
+
return getNamedRouteRegex;
|
|
30
|
+
},
|
|
31
|
+
getRouteRegex: function () {
|
|
32
|
+
return getRouteRegex;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const _constants = requireConstants();
|
|
36
|
+
const _interceptionroutes = requireInterceptionRoutes();
|
|
37
|
+
const _escaperegexp = requireEscapeRegexp();
|
|
38
|
+
const _removetrailingslash = requireRemoveTrailingSlash();
|
|
39
|
+
const _getdynamicparam = requireGetDynamicParam();
|
|
40
|
+
function getParametrizedRoute(route, includeSuffix, includePrefix) {
|
|
41
|
+
const groups = {};
|
|
42
|
+
let groupIndex = 1;
|
|
43
|
+
const segments = [];
|
|
44
|
+
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split('/')) {
|
|
45
|
+
const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find(m => segment.startsWith(m));
|
|
46
|
+
const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN) // Check for parameters
|
|
47
|
+
;
|
|
48
|
+
if (markerMatch && paramMatches && paramMatches[2]) {
|
|
49
|
+
const {
|
|
50
|
+
key,
|
|
51
|
+
optional,
|
|
52
|
+
repeat
|
|
53
|
+
} = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
|
|
54
|
+
groups[key] = {
|
|
55
|
+
pos: groupIndex++,
|
|
56
|
+
repeat,
|
|
57
|
+
optional
|
|
58
|
+
};
|
|
59
|
+
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(markerMatch)}([^/]+?)`);
|
|
60
|
+
} else if (paramMatches && paramMatches[2]) {
|
|
61
|
+
const {
|
|
62
|
+
key,
|
|
63
|
+
repeat,
|
|
64
|
+
optional
|
|
65
|
+
} = (0, _getdynamicparam.parseMatchedParameter)(paramMatches[2]);
|
|
66
|
+
groups[key] = {
|
|
67
|
+
pos: groupIndex++,
|
|
68
|
+
repeat,
|
|
69
|
+
optional
|
|
70
|
+
};
|
|
71
|
+
if (includePrefix && paramMatches[1]) {
|
|
72
|
+
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(paramMatches[1])}`);
|
|
73
|
+
}
|
|
74
|
+
let s = repeat ? optional ? '(?:/(.+?))?' : '/(.+?)' : '/([^/]+?)';
|
|
75
|
+
// Remove the leading slash if includePrefix already added it.
|
|
76
|
+
if (includePrefix && paramMatches[1]) {
|
|
77
|
+
s = s.substring(1);
|
|
78
|
+
}
|
|
79
|
+
segments.push(s);
|
|
80
|
+
} else {
|
|
81
|
+
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(segment)}`);
|
|
82
|
+
}
|
|
83
|
+
// If there's a suffix, add it to the segments if it's enabled.
|
|
84
|
+
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
85
|
+
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
parameterizedRoute: segments.join(''),
|
|
90
|
+
groups
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function getRouteRegex(normalizedRoute, {
|
|
94
|
+
includeSuffix = false,
|
|
95
|
+
includePrefix = false,
|
|
96
|
+
excludeOptionalTrailingSlash = false
|
|
97
|
+
} = {}) {
|
|
98
|
+
const {
|
|
99
|
+
parameterizedRoute,
|
|
100
|
+
groups
|
|
101
|
+
} = getParametrizedRoute(normalizedRoute, includeSuffix, includePrefix);
|
|
102
|
+
let re = parameterizedRoute;
|
|
103
|
+
if (!excludeOptionalTrailingSlash) {
|
|
104
|
+
re += '(?:/)?';
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
re: new RegExp(`^${re}$`),
|
|
108
|
+
groups: groups
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Builds a function to generate a minimal routeKey using only a-z and minimal
|
|
113
|
+
* number of characters.
|
|
114
|
+
*/
|
|
115
|
+
function buildGetSafeRouteKey() {
|
|
116
|
+
let i = 0;
|
|
117
|
+
return () => {
|
|
118
|
+
let routeKey = '';
|
|
119
|
+
let j = ++i;
|
|
120
|
+
while (j > 0) {
|
|
121
|
+
routeKey += String.fromCharCode(97 + (j - 1) % 26);
|
|
122
|
+
j = Math.floor((j - 1) / 26);
|
|
123
|
+
}
|
|
124
|
+
return routeKey;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function getSafeKeyFromSegment({
|
|
128
|
+
interceptionMarker,
|
|
129
|
+
getSafeRouteKey,
|
|
130
|
+
segment,
|
|
131
|
+
routeKeys,
|
|
132
|
+
keyPrefix,
|
|
133
|
+
backreferenceDuplicateKeys
|
|
134
|
+
}) {
|
|
135
|
+
const {
|
|
136
|
+
key,
|
|
137
|
+
optional,
|
|
138
|
+
repeat
|
|
139
|
+
} = (0, _getdynamicparam.parseMatchedParameter)(segment);
|
|
140
|
+
// replace any non-word characters since they can break
|
|
141
|
+
// the named regex
|
|
142
|
+
let cleanedKey = key.replace(/\W/g, '');
|
|
143
|
+
if (keyPrefix) {
|
|
144
|
+
cleanedKey = `${keyPrefix}${cleanedKey}`;
|
|
145
|
+
}
|
|
146
|
+
let invalidKey = false;
|
|
147
|
+
// check if the key is still invalid and fallback to using a known
|
|
148
|
+
// safe key
|
|
149
|
+
if (cleanedKey.length === 0 || cleanedKey.length > 30) {
|
|
150
|
+
invalidKey = true;
|
|
151
|
+
}
|
|
152
|
+
if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {
|
|
153
|
+
invalidKey = true;
|
|
154
|
+
}
|
|
155
|
+
if (invalidKey) {
|
|
156
|
+
cleanedKey = getSafeRouteKey();
|
|
157
|
+
}
|
|
158
|
+
const duplicateKey = cleanedKey in routeKeys;
|
|
159
|
+
if (keyPrefix) {
|
|
160
|
+
routeKeys[cleanedKey] = `${keyPrefix}${key}`;
|
|
161
|
+
} else {
|
|
162
|
+
routeKeys[cleanedKey] = key;
|
|
163
|
+
}
|
|
164
|
+
// if the segment has an interception marker, make sure that's part of the regex pattern
|
|
165
|
+
// this is to ensure that the route with the interception marker doesn't incorrectly match
|
|
166
|
+
// the non-intercepted route (ie /app/(.)[username] should not match /app/[username])
|
|
167
|
+
const interceptionPrefix = interceptionMarker ? (0, _escaperegexp.escapeStringRegexp)(interceptionMarker) : '';
|
|
168
|
+
let pattern;
|
|
169
|
+
if (duplicateKey && backreferenceDuplicateKeys) {
|
|
170
|
+
// Use a backreference to the key to ensure that the key is the same value
|
|
171
|
+
// in each of the placeholders.
|
|
172
|
+
pattern = `\\k<${cleanedKey}>`;
|
|
173
|
+
} else if (repeat) {
|
|
174
|
+
pattern = `(?<${cleanedKey}>.+?)`;
|
|
175
|
+
} else {
|
|
176
|
+
pattern = `(?<${cleanedKey}>[^/]+?)`;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
key,
|
|
180
|
+
pattern: optional ? `(?:/${interceptionPrefix}${pattern})?` : `/${interceptionPrefix}${pattern}`,
|
|
181
|
+
cleanedKey: cleanedKey,
|
|
182
|
+
optional,
|
|
183
|
+
repeat
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function getNamedParametrizedRoute(route, prefixRouteKeys, includeSuffix, includePrefix, backreferenceDuplicateKeys, reference = {
|
|
187
|
+
names: {},
|
|
188
|
+
intercepted: {}
|
|
189
|
+
}) {
|
|
190
|
+
const getSafeRouteKey = buildGetSafeRouteKey();
|
|
191
|
+
const routeKeys = {};
|
|
192
|
+
const segments = [];
|
|
193
|
+
const inverseParts = [];
|
|
194
|
+
// Ensure we don't mutate the original reference object.
|
|
195
|
+
reference = structuredClone(reference);
|
|
196
|
+
for (const segment of (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split('/')) {
|
|
197
|
+
const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some(m => segment.startsWith(m));
|
|
198
|
+
const paramMatches = segment.match(_getdynamicparam.PARAMETER_PATTERN) // Check for parameters
|
|
199
|
+
;
|
|
200
|
+
const interceptionMarker = hasInterceptionMarker ? paramMatches?.[1] : undefined;
|
|
201
|
+
let keyPrefix;
|
|
202
|
+
if (interceptionMarker && paramMatches?.[2]) {
|
|
203
|
+
keyPrefix = prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : undefined;
|
|
204
|
+
reference.intercepted[paramMatches[2]] = interceptionMarker;
|
|
205
|
+
} else if (paramMatches?.[2] && reference.intercepted[paramMatches[2]]) {
|
|
206
|
+
keyPrefix = prefixRouteKeys ? _constants.NEXT_INTERCEPTION_MARKER_PREFIX : undefined;
|
|
207
|
+
} else {
|
|
208
|
+
keyPrefix = prefixRouteKeys ? _constants.NEXT_QUERY_PARAM_PREFIX : undefined;
|
|
209
|
+
}
|
|
210
|
+
if (interceptionMarker && paramMatches && paramMatches[2]) {
|
|
211
|
+
// If there's an interception marker, add it to the segments.
|
|
212
|
+
const {
|
|
213
|
+
key,
|
|
214
|
+
pattern,
|
|
215
|
+
cleanedKey,
|
|
216
|
+
repeat,
|
|
217
|
+
optional
|
|
218
|
+
} = getSafeKeyFromSegment({
|
|
219
|
+
getSafeRouteKey,
|
|
220
|
+
interceptionMarker,
|
|
221
|
+
segment: paramMatches[2],
|
|
222
|
+
routeKeys,
|
|
223
|
+
keyPrefix,
|
|
224
|
+
backreferenceDuplicateKeys
|
|
225
|
+
});
|
|
226
|
+
segments.push(pattern);
|
|
227
|
+
inverseParts.push(`/${paramMatches[1]}:${reference.names[key] ?? cleanedKey}${repeat ? optional ? '*' : '+' : ''}`);
|
|
228
|
+
reference.names[key] ??= cleanedKey;
|
|
229
|
+
} else if (paramMatches && paramMatches[2]) {
|
|
230
|
+
// If there's a prefix, add it to the segments if it's enabled.
|
|
231
|
+
if (includePrefix && paramMatches[1]) {
|
|
232
|
+
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(paramMatches[1])}`);
|
|
233
|
+
inverseParts.push(`/${paramMatches[1]}`);
|
|
234
|
+
}
|
|
235
|
+
const {
|
|
236
|
+
key,
|
|
237
|
+
pattern,
|
|
238
|
+
cleanedKey,
|
|
239
|
+
repeat,
|
|
240
|
+
optional
|
|
241
|
+
} = getSafeKeyFromSegment({
|
|
242
|
+
getSafeRouteKey,
|
|
243
|
+
segment: paramMatches[2],
|
|
244
|
+
routeKeys,
|
|
245
|
+
keyPrefix,
|
|
246
|
+
backreferenceDuplicateKeys
|
|
247
|
+
});
|
|
248
|
+
// Remove the leading slash if includePrefix already added it.
|
|
249
|
+
let s = pattern;
|
|
250
|
+
if (includePrefix && paramMatches[1]) {
|
|
251
|
+
s = s.substring(1);
|
|
252
|
+
}
|
|
253
|
+
segments.push(s);
|
|
254
|
+
inverseParts.push(`/:${reference.names[key] ?? cleanedKey}${repeat ? optional ? '*' : '+' : ''}`);
|
|
255
|
+
reference.names[key] ??= cleanedKey;
|
|
256
|
+
} else {
|
|
257
|
+
segments.push(`/${(0, _escaperegexp.escapeStringRegexp)(segment)}`);
|
|
258
|
+
inverseParts.push(`/${segment}`);
|
|
259
|
+
}
|
|
260
|
+
// If there's a suffix, add it to the segments if it's enabled.
|
|
261
|
+
if (includeSuffix && paramMatches && paramMatches[3]) {
|
|
262
|
+
segments.push((0, _escaperegexp.escapeStringRegexp)(paramMatches[3]));
|
|
263
|
+
inverseParts.push(paramMatches[3]);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
namedParameterizedRoute: segments.join(''),
|
|
268
|
+
routeKeys,
|
|
269
|
+
pathToRegexpPattern: inverseParts.join(''),
|
|
270
|
+
reference
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function getNamedRouteRegex(normalizedRoute, options) {
|
|
274
|
+
const result = getNamedParametrizedRoute(normalizedRoute, options.prefixRouteKeys, options.includeSuffix ?? false, options.includePrefix ?? false, options.backreferenceDuplicateKeys ?? false, options.reference);
|
|
275
|
+
let namedRegex = result.namedParameterizedRoute;
|
|
276
|
+
if (!options.excludeOptionalTrailingSlash) {
|
|
277
|
+
namedRegex += '(?:/)?';
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
...getRouteRegex(normalizedRoute, options),
|
|
281
|
+
namedRegex: `^${namedRegex}$`,
|
|
282
|
+
routeKeys: result.routeKeys,
|
|
283
|
+
pathToRegexpPattern: result.pathToRegexpPattern,
|
|
284
|
+
reference: result.reference
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function getNamedMiddlewareRegex(normalizedRoute, options) {
|
|
288
|
+
const {
|
|
289
|
+
parameterizedRoute
|
|
290
|
+
} = getParametrizedRoute(normalizedRoute, false, false);
|
|
291
|
+
const {
|
|
292
|
+
catchAll = true
|
|
293
|
+
} = options;
|
|
294
|
+
if (parameterizedRoute === '/') {
|
|
295
|
+
let catchAllRegex = catchAll ? '.*' : '';
|
|
296
|
+
return {
|
|
297
|
+
namedRegex: `^/${catchAllRegex}$`
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
const {
|
|
301
|
+
namedParameterizedRoute
|
|
302
|
+
} = getNamedParametrizedRoute(normalizedRoute, false, false, false, false, undefined);
|
|
303
|
+
let catchAllGroupedRegex = catchAll ? '(?:(/.*)?)' : '';
|
|
304
|
+
return {
|
|
305
|
+
namedRegex: `^${namedParameterizedRoute}${catchAllGroupedRegex}$`
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
} (routeRegex));
|
|
309
|
+
return routeRegex;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export { requireRouteRegex as __require };
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { __exports as sortedRoutes } from '../../../../../../../_virtual/sorted-routes.js';
|
|
2
|
+
|
|
3
|
+
var hasRequiredSortedRoutes;
|
|
4
|
+
|
|
5
|
+
function requireSortedRoutes () {
|
|
6
|
+
if (hasRequiredSortedRoutes) return sortedRoutes;
|
|
7
|
+
hasRequiredSortedRoutes = 1;
|
|
8
|
+
(function (exports$1) {
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
11
|
+
value: true
|
|
12
|
+
});
|
|
13
|
+
function _export(target, all) {
|
|
14
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: all[name]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
_export(exports$1, {
|
|
20
|
+
getSortedRouteObjects: function () {
|
|
21
|
+
return getSortedRouteObjects;
|
|
22
|
+
},
|
|
23
|
+
getSortedRoutes: function () {
|
|
24
|
+
return getSortedRoutes;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
class UrlNode {
|
|
28
|
+
insert(urlPath) {
|
|
29
|
+
this._insert(urlPath.split('/').filter(Boolean), [], false);
|
|
30
|
+
}
|
|
31
|
+
smoosh() {
|
|
32
|
+
return this._smoosh();
|
|
33
|
+
}
|
|
34
|
+
_smoosh(prefix = '/') {
|
|
35
|
+
const childrenPaths = [...this.children.keys()].sort();
|
|
36
|
+
if (this.slugName !== null) {
|
|
37
|
+
childrenPaths.splice(childrenPaths.indexOf('[]'), 1);
|
|
38
|
+
}
|
|
39
|
+
if (this.restSlugName !== null) {
|
|
40
|
+
childrenPaths.splice(childrenPaths.indexOf('[...]'), 1);
|
|
41
|
+
}
|
|
42
|
+
if (this.optionalRestSlugName !== null) {
|
|
43
|
+
childrenPaths.splice(childrenPaths.indexOf('[[...]]'), 1);
|
|
44
|
+
}
|
|
45
|
+
const routes = childrenPaths.map(c => this.children.get(c)._smoosh(`${prefix}${c}/`)).reduce((prev, curr) => [...prev, ...curr], []);
|
|
46
|
+
if (this.slugName !== null) {
|
|
47
|
+
routes.push(...this.children.get('[]')._smoosh(`${prefix}[${this.slugName}]/`));
|
|
48
|
+
}
|
|
49
|
+
if (!this.placeholder) {
|
|
50
|
+
const r = prefix === '/' ? '/' : prefix.slice(0, -1);
|
|
51
|
+
if (this.optionalRestSlugName != null) {
|
|
52
|
+
throw Object.defineProperty(new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`), "__NEXT_ERROR_CODE", {
|
|
53
|
+
value: "E458",
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
routes.unshift(r);
|
|
59
|
+
}
|
|
60
|
+
if (this.restSlugName !== null) {
|
|
61
|
+
routes.push(...this.children.get('[...]')._smoosh(`${prefix}[...${this.restSlugName}]/`));
|
|
62
|
+
}
|
|
63
|
+
if (this.optionalRestSlugName !== null) {
|
|
64
|
+
routes.push(...this.children.get('[[...]]')._smoosh(`${prefix}[[...${this.optionalRestSlugName}]]/`));
|
|
65
|
+
}
|
|
66
|
+
return routes;
|
|
67
|
+
}
|
|
68
|
+
_insert(urlPaths, slugNames, isCatchAll) {
|
|
69
|
+
if (urlPaths.length === 0) {
|
|
70
|
+
this.placeholder = false;
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (isCatchAll) {
|
|
74
|
+
throw Object.defineProperty(new Error(`Catch-all must be the last part of the URL.`), "__NEXT_ERROR_CODE", {
|
|
75
|
+
value: "E392",
|
|
76
|
+
enumerable: false,
|
|
77
|
+
configurable: true
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// The next segment in the urlPaths list
|
|
81
|
+
let nextSegment = urlPaths[0];
|
|
82
|
+
// Check if the segment matches `[something]`
|
|
83
|
+
if (nextSegment.startsWith('[') && nextSegment.endsWith(']')) {
|
|
84
|
+
// Strip `[` and `]`, leaving only `something`
|
|
85
|
+
let segmentName = nextSegment.slice(1, -1);
|
|
86
|
+
let isOptional = false;
|
|
87
|
+
if (segmentName.startsWith('[') && segmentName.endsWith(']')) {
|
|
88
|
+
// Strip optional `[` and `]`, leaving only `something`
|
|
89
|
+
segmentName = segmentName.slice(1, -1);
|
|
90
|
+
isOptional = true;
|
|
91
|
+
}
|
|
92
|
+
if (segmentName.startsWith('…')) {
|
|
93
|
+
throw Object.defineProperty(new Error(`Detected a three-dot character ('…') at ('${segmentName}'). Did you mean ('...')?`), "__NEXT_ERROR_CODE", {
|
|
94
|
+
value: "E147",
|
|
95
|
+
enumerable: false,
|
|
96
|
+
configurable: true
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (segmentName.startsWith('...')) {
|
|
100
|
+
// Strip `...`, leaving only `something`
|
|
101
|
+
segmentName = segmentName.substring(3);
|
|
102
|
+
isCatchAll = true;
|
|
103
|
+
}
|
|
104
|
+
if (segmentName.startsWith('[') || segmentName.endsWith(']')) {
|
|
105
|
+
throw Object.defineProperty(new Error(`Segment names may not start or end with extra brackets ('${segmentName}').`), "__NEXT_ERROR_CODE", {
|
|
106
|
+
value: "E421",
|
|
107
|
+
enumerable: false,
|
|
108
|
+
configurable: true
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (segmentName.startsWith('.')) {
|
|
112
|
+
throw Object.defineProperty(new Error(`Segment names may not start with erroneous periods ('${segmentName}').`), "__NEXT_ERROR_CODE", {
|
|
113
|
+
value: "E288",
|
|
114
|
+
enumerable: false,
|
|
115
|
+
configurable: true
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function handleSlug(previousSlug, nextSlug) {
|
|
119
|
+
if (previousSlug !== null) {
|
|
120
|
+
// If the specific segment already has a slug but the slug is not `something`
|
|
121
|
+
// This prevents collisions like:
|
|
122
|
+
// pages/[post]/index.js
|
|
123
|
+
// pages/[id]/index.js
|
|
124
|
+
// Because currently multiple dynamic params on the same segment level are not supported
|
|
125
|
+
if (previousSlug !== nextSlug) {
|
|
126
|
+
// TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.
|
|
127
|
+
throw Object.defineProperty(new Error(`You cannot use different slug names for the same dynamic path ('${previousSlug}' !== '${nextSlug}').`), "__NEXT_ERROR_CODE", {
|
|
128
|
+
value: "E337",
|
|
129
|
+
enumerable: false,
|
|
130
|
+
configurable: true
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
slugNames.forEach(slug => {
|
|
135
|
+
if (slug === nextSlug) {
|
|
136
|
+
throw Object.defineProperty(new Error(`You cannot have the same slug name "${nextSlug}" repeat within a single dynamic path`), "__NEXT_ERROR_CODE", {
|
|
137
|
+
value: "E247",
|
|
138
|
+
enumerable: false,
|
|
139
|
+
configurable: true
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (slug.replace(/\W/g, '') === nextSegment.replace(/\W/g, '')) {
|
|
143
|
+
throw Object.defineProperty(new Error(`You cannot have the slug names "${slug}" and "${nextSlug}" differ only by non-word symbols within a single dynamic path`), "__NEXT_ERROR_CODE", {
|
|
144
|
+
value: "E499",
|
|
145
|
+
enumerable: false,
|
|
146
|
+
configurable: true
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
slugNames.push(nextSlug);
|
|
151
|
+
}
|
|
152
|
+
if (isCatchAll) {
|
|
153
|
+
if (isOptional) {
|
|
154
|
+
if (this.restSlugName != null) {
|
|
155
|
+
throw Object.defineProperty(new Error(`You cannot use both an required and optional catch-all route at the same level ("[...${this.restSlugName}]" and "${urlPaths[0]}" ).`), "__NEXT_ERROR_CODE", {
|
|
156
|
+
value: "E299",
|
|
157
|
+
enumerable: false,
|
|
158
|
+
configurable: true
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
handleSlug(this.optionalRestSlugName, segmentName);
|
|
162
|
+
// slugName is kept as it can only be one particular slugName
|
|
163
|
+
this.optionalRestSlugName = segmentName;
|
|
164
|
+
// nextSegment is overwritten to [[...]] so that it can later be sorted specifically
|
|
165
|
+
nextSegment = '[[...]]';
|
|
166
|
+
} else {
|
|
167
|
+
if (this.optionalRestSlugName != null) {
|
|
168
|
+
throw Object.defineProperty(new Error(`You cannot use both an optional and required catch-all route at the same level ("[[...${this.optionalRestSlugName}]]" and "${urlPaths[0]}").`), "__NEXT_ERROR_CODE", {
|
|
169
|
+
value: "E300",
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
handleSlug(this.restSlugName, segmentName);
|
|
175
|
+
// slugName is kept as it can only be one particular slugName
|
|
176
|
+
this.restSlugName = segmentName;
|
|
177
|
+
// nextSegment is overwritten to [...] so that it can later be sorted specifically
|
|
178
|
+
nextSegment = '[...]';
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
if (isOptional) {
|
|
182
|
+
throw Object.defineProperty(new Error(`Optional route parameters are not yet supported ("${urlPaths[0]}").`), "__NEXT_ERROR_CODE", {
|
|
183
|
+
value: "E435",
|
|
184
|
+
enumerable: false,
|
|
185
|
+
configurable: true
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
handleSlug(this.slugName, segmentName);
|
|
189
|
+
// slugName is kept as it can only be one particular slugName
|
|
190
|
+
this.slugName = segmentName;
|
|
191
|
+
// nextSegment is overwritten to [] so that it can later be sorted specifically
|
|
192
|
+
nextSegment = '[]';
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode
|
|
196
|
+
if (!this.children.has(nextSegment)) {
|
|
197
|
+
this.children.set(nextSegment, new UrlNode());
|
|
198
|
+
}
|
|
199
|
+
this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
|
200
|
+
}
|
|
201
|
+
constructor() {
|
|
202
|
+
this.placeholder = true;
|
|
203
|
+
this.children = new Map();
|
|
204
|
+
this.slugName = null;
|
|
205
|
+
this.restSlugName = null;
|
|
206
|
+
this.optionalRestSlugName = null;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function getSortedRoutes(normalizedPages) {
|
|
210
|
+
// First the UrlNode is created, and every UrlNode can have only 1 dynamic segment
|
|
211
|
+
// Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js
|
|
212
|
+
// Only 1 dynamic segment per nesting level
|
|
213
|
+
// So in the case that is test/integration/dynamic-routing it'll be this:
|
|
214
|
+
// pages/[post]/comments.js
|
|
215
|
+
// pages/blog/[post]/comment/[id].js
|
|
216
|
+
// Both are fine because `pages/[post]` and `pages/blog` are on the same level
|
|
217
|
+
// So in this case `UrlNode` created here has `this.slugName === 'post'`
|
|
218
|
+
// And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities
|
|
219
|
+
// Instead what has to be passed through is the upwards path's dynamic names
|
|
220
|
+
const root = new UrlNode();
|
|
221
|
+
// Here the `root` gets injected multiple paths, and insert will break them up into sublevels
|
|
222
|
+
normalizedPages.forEach(pagePath => root.insert(pagePath));
|
|
223
|
+
// Smoosh will then sort those sublevels up to the point where you get the correct route definition priority
|
|
224
|
+
return root.smoosh();
|
|
225
|
+
}
|
|
226
|
+
function getSortedRouteObjects(objects, getter) {
|
|
227
|
+
// We're assuming here that all the pathnames are unique, that way we can
|
|
228
|
+
// sort the list and use the index as the key.
|
|
229
|
+
const indexes = {};
|
|
230
|
+
const pathnames = [];
|
|
231
|
+
for (let i = 0; i < objects.length; i++) {
|
|
232
|
+
const pathname = getter(objects[i]);
|
|
233
|
+
indexes[pathname] = i;
|
|
234
|
+
pathnames[i] = pathname;
|
|
235
|
+
}
|
|
236
|
+
// Sort the pathnames.
|
|
237
|
+
const sorted = getSortedRoutes(pathnames);
|
|
238
|
+
// Map the sorted pathnames back to the original objects using the new sorted
|
|
239
|
+
// index.
|
|
240
|
+
return sorted.map(pathname => objects[indexes[pathname]]);
|
|
241
|
+
}
|
|
242
|
+
} (sortedRoutes));
|
|
243
|
+
return sortedRoutes;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { requireSortedRoutes as __require };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __exports as routerContext_sharedRuntime } from '../../../../../_virtual/router-context.shared-runtime.js';
|
|
2
|
+
import { __require as require_interop_require_default } from '../../../../@swc/helpers/cjs/_interop_require_default.js';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
|
|
5
|
+
var hasRequiredRouterContext_sharedRuntime;
|
|
6
|
+
|
|
7
|
+
function requireRouterContext_sharedRuntime () {
|
|
8
|
+
if (hasRequiredRouterContext_sharedRuntime) return routerContext_sharedRuntime;
|
|
9
|
+
hasRequiredRouterContext_sharedRuntime = 1;
|
|
10
|
+
(function (exports$1) {
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
13
|
+
value: true
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports$1, "RouterContext", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return RouterContext;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
|
|
22
|
+
const _react = /*#__PURE__*/_interop_require_default._(React__default);
|
|
23
|
+
const RouterContext = _react.default.createContext(null);
|
|
24
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
25
|
+
RouterContext.displayName = 'RouterContext';
|
|
26
|
+
}
|
|
27
|
+
} (routerContext_sharedRuntime));
|
|
28
|
+
return routerContext_sharedRuntime;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { requireRouterContext_sharedRuntime as __require };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { __exports as segment } from '../../../../../_virtual/segment.js';
|
|
2
|
+
|
|
3
|
+
var hasRequiredSegment;
|
|
4
|
+
|
|
5
|
+
function requireSegment () {
|
|
6
|
+
if (hasRequiredSegment) return segment;
|
|
7
|
+
hasRequiredSegment = 1;
|
|
8
|
+
(function (exports$1) {
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
11
|
+
value: true
|
|
12
|
+
});
|
|
13
|
+
function _export(target, all) {
|
|
14
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: all[name]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
_export(exports$1, {
|
|
20
|
+
DEFAULT_SEGMENT_KEY: function () {
|
|
21
|
+
return DEFAULT_SEGMENT_KEY;
|
|
22
|
+
},
|
|
23
|
+
NOT_FOUND_SEGMENT_KEY: function () {
|
|
24
|
+
return NOT_FOUND_SEGMENT_KEY;
|
|
25
|
+
},
|
|
26
|
+
PAGE_SEGMENT_KEY: function () {
|
|
27
|
+
return PAGE_SEGMENT_KEY;
|
|
28
|
+
},
|
|
29
|
+
addSearchParamsIfPageSegment: function () {
|
|
30
|
+
return addSearchParamsIfPageSegment;
|
|
31
|
+
},
|
|
32
|
+
computeSelectedLayoutSegment: function () {
|
|
33
|
+
return computeSelectedLayoutSegment;
|
|
34
|
+
},
|
|
35
|
+
getSegmentValue: function () {
|
|
36
|
+
return getSegmentValue;
|
|
37
|
+
},
|
|
38
|
+
getSelectedLayoutSegmentPath: function () {
|
|
39
|
+
return getSelectedLayoutSegmentPath;
|
|
40
|
+
},
|
|
41
|
+
isGroupSegment: function () {
|
|
42
|
+
return isGroupSegment;
|
|
43
|
+
},
|
|
44
|
+
isParallelRouteSegment: function () {
|
|
45
|
+
return isParallelRouteSegment;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
function getSegmentValue(segment) {
|
|
49
|
+
return Array.isArray(segment) ? segment[1] : segment;
|
|
50
|
+
}
|
|
51
|
+
function isGroupSegment(segment) {
|
|
52
|
+
// Use array[0] for performant purpose
|
|
53
|
+
return segment[0] === '(' && segment.endsWith(')');
|
|
54
|
+
}
|
|
55
|
+
function isParallelRouteSegment(segment) {
|
|
56
|
+
return segment.startsWith('@') && segment !== '@children';
|
|
57
|
+
}
|
|
58
|
+
function addSearchParamsIfPageSegment(segment, searchParams) {
|
|
59
|
+
const isPageSegment = segment.includes(PAGE_SEGMENT_KEY);
|
|
60
|
+
if (isPageSegment) {
|
|
61
|
+
const stringifiedQuery = JSON.stringify(searchParams);
|
|
62
|
+
return stringifiedQuery !== '{}' ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery : PAGE_SEGMENT_KEY;
|
|
63
|
+
}
|
|
64
|
+
return segment;
|
|
65
|
+
}
|
|
66
|
+
function computeSelectedLayoutSegment(segments, parallelRouteKey) {
|
|
67
|
+
if (!segments || segments.length === 0) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
// For 'children', use first segment; for other parallel routes, use last segment
|
|
71
|
+
const rawSegment = parallelRouteKey === 'children' ? segments[0] : segments[segments.length - 1];
|
|
72
|
+
// If the default slot is showing, return null since it's not technically "selected" (it's a fallback)
|
|
73
|
+
// Returning an internal value like `__DEFAULT__` would be confusing
|
|
74
|
+
return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment;
|
|
75
|
+
}
|
|
76
|
+
function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first = true, segmentPath = []) {
|
|
77
|
+
let node;
|
|
78
|
+
if (first) {
|
|
79
|
+
// Use the provided parallel route key on the first parallel route
|
|
80
|
+
node = tree[1][parallelRouteKey];
|
|
81
|
+
} else {
|
|
82
|
+
// After first parallel route prefer children, if there's no children pick the first parallel route.
|
|
83
|
+
const parallelRoutes = tree[1];
|
|
84
|
+
node = parallelRoutes.children ?? Object.values(parallelRoutes)[0];
|
|
85
|
+
}
|
|
86
|
+
if (!node) return segmentPath;
|
|
87
|
+
const segment = node[0];
|
|
88
|
+
let segmentValue = getSegmentValue(segment);
|
|
89
|
+
if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {
|
|
90
|
+
return segmentPath;
|
|
91
|
+
}
|
|
92
|
+
segmentPath.push(segmentValue);
|
|
93
|
+
return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
|
|
94
|
+
}
|
|
95
|
+
const PAGE_SEGMENT_KEY = '__PAGE__';
|
|
96
|
+
const DEFAULT_SEGMENT_KEY = '__DEFAULT__';
|
|
97
|
+
const NOT_FOUND_SEGMENT_KEY = '/_not-found';
|
|
98
|
+
} (segment));
|
|
99
|
+
return segment;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { requireSegment as __require };
|