@absolutejs/absolute 0.20.0-beta.169 → 0.20.0-beta.170
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/CHANGELOG.md +80 -0
- package/README.md +232 -0
- package/changelog.json +228 -0
- package/dist/angular/browser.js +7 -8
- package/dist/angular/browser.js.map +6 -5
- package/dist/angular/components/core/streamingSlotRegistrar.js +6 -2
- package/dist/angular/components/core/streamingSlotRegistry.js +7 -3
- package/dist/angular/index.js +555 -156
- package/dist/angular/index.js.map +29 -23
- package/dist/angular/server.js +555 -156
- package/dist/angular/server.js.map +29 -23
- package/dist/build/buildWorker.js +14 -8
- package/dist/build.js +4949 -1941
- package/dist/build.js.map +72 -42
- package/dist/cli/{add-7azr0c83.js → add-6a7pjkn9.js} +11 -7
- package/dist/cli/{analyze-3cyek6v3.js → analyze-606fshwa.js} +1 -1
- package/dist/cli/{build-25rz8v25.js → build-g81xqbb9.js} +1 -1
- package/dist/cli/{compile-4jnfxts9.js → compile-9y1w9zpj.js} +3 -3
- package/dist/cli/config/server.js +10699 -1538
- package/dist/cli/{dev-9tk5hn2e.js → dev-hyeb89hp.js} +5 -1
- package/dist/cli/{doctor-4nv2c2j3.js → doctor-h55y9hj1.js} +1 -1
- package/dist/cli/{generate-v75p2fct.js → generate-20x1pkf7.js} +4 -4
- package/dist/cli/{htmx-427swtdz.js → htmx-6mz2h7k1.js} +2 -2
- package/dist/cli/{index-bhbs6d5z.js → index-32ge2w1f.js} +12 -4
- package/dist/cli/{index-a4ws2jwd.js → index-3wz3mktm.js} +1 -1
- package/dist/cli/{index-b7hjgknf.js → index-9sksd8c8.js} +13 -4
- package/dist/cli/{index-eyzwc7gz.js → index-qbrzvmh9.js} +4 -2
- package/dist/cli/index-qw98g1p6.js +269 -0
- package/dist/cli/{index-434b7j4a.js → index-vtp20gwf.js} +69 -1
- package/dist/cli/{index-h7qhz02e.js → index-wk0pyxrg.js} +3 -0
- package/dist/cli/{index-k3y8cb6c.js → index-z6f43b20.js} +1 -1
- package/dist/cli/index.js +16 -16
- package/dist/cli/{islands-8sgky9gh.js → islands-dc54e5y1.js} +1 -1
- package/dist/cli/{ls-4m4yqwww.js → ls-b6zz24nt.js} +1 -1
- package/dist/cli/{mobile-hcxjr2gf.js → mobile-ajnnvqtv.js} +3 -3
- package/dist/cli/prerender-fqpp0m1j.js +10 -0
- package/dist/cli/{remove-1ycjx85k.js → remove-t8x1mrxg.js} +4 -4
- package/dist/cli/{start-mbaejxhm.js → start-d6p831ny.js} +3 -3
- package/dist/cli/{typecheck-dr068pmh.js → typecheck-stbt0qt5.js} +6 -1
- package/dist/cli/{workspace-1sycp9g1.js → workspace-61hh6jq1.js} +1 -1
- package/dist/client/chunks/index-6b66nzyf.js +381 -0
- package/dist/client/chunks/index-6b66nzyf.js.map +11 -0
- package/dist/client/chunks/{islands-rc28k5sx.js → islands-s2ta5ajb.js} +5 -2
- package/dist/client/chunks/{islands-rc28k5sx.js.map → islands-s2ta5ajb.js.map} +7 -6
- package/dist/client/index.js +160 -3
- package/dist/client/index.js.map +6 -4
- package/dist/client/navigation.js +764 -0
- package/dist/client/navigation.js.map +10 -0
- package/dist/client/prefetch.js +33 -375
- package/dist/client/prefetch.js.map +3 -4
- package/dist/core/streamingSlotRegistrar.js +5 -2
- package/dist/core/streamingSlotRegistrar.js.map +5 -4
- package/dist/core/streamingSlotRegistry.js +5 -2
- package/dist/core/streamingSlotRegistry.js.map +5 -4
- package/dist/dev/client/cspNonce.ts +28 -0
- package/dist/dev/client/handlers/html.ts +4 -3
- package/dist/dev/client/handlers/htmx.ts +3 -2
- package/dist/dev/client/handlers/svelte.ts +15 -90
- package/dist/dev/client/syncDevtools.ts +2 -1
- package/dist/dev/serverBootstrap.js +11 -4
- package/dist/i18n/index.js +543 -0
- package/dist/i18n/index.js.map +15 -0
- package/dist/index.js +6339 -2233
- package/dist/index.js.map +89 -54
- package/dist/islands/index.js +282 -40
- package/dist/islands/index.js.map +14 -10
- package/dist/mobile/browser.js +7 -2
- package/dist/mobile/browser.js.map +5 -4
- package/dist/mobile/index.js +7 -2
- package/dist/mobile/index.js.map +5 -4
- package/dist/mobile/remoteMacAgentEntry.js +1 -1
- package/dist/react/components/browser/index.js +94 -4
- package/dist/react/components/index.js +150 -10
- package/dist/react/components/index.js.map +15 -10
- package/dist/react/hooks/index.js +479 -13
- package/dist/react/hooks/index.js.map +12 -4
- package/dist/react/index.js +769 -166
- package/dist/react/index.js.map +32 -21
- package/dist/react/router/browser.js +21 -4
- package/dist/react/router/browser.js.map +5 -4
- package/dist/react/router/index.js +21 -4
- package/dist/react/router/index.js.map +5 -4
- package/dist/react/server.js +597 -203
- package/dist/react/server.js.map +25 -15
- package/dist/src/angular/zoneRuntime.d.ts +5 -0
- package/dist/src/build/buildReactServerComponents.d.ts +22 -0
- package/dist/src/build/downlevelAsyncForZone.d.ts +1 -0
- package/dist/src/build/fileRoutes.d.ts +65 -0
- package/dist/src/build/fonts/buildFonts.d.ts +25 -0
- package/dist/src/build/fonts/fallbackMetrics.d.ts +13 -0
- package/dist/src/build/fonts/googleFonts.d.ts +18 -0
- package/dist/src/build/fonts/injectFontTags.d.ts +7 -0
- package/dist/src/build/fonts/parseFontMetrics.d.ts +4 -0
- package/dist/src/build/generateReactIndexes.d.ts +7 -1
- package/dist/src/build/htmlIncludes.d.ts +16 -0
- package/dist/src/build/inlineSourceMapComment.d.ts +1 -0
- package/dist/src/build/scanConventions.d.ts +3 -0
- package/dist/src/build/vitals.d.ts +21 -0
- package/dist/src/client/formActions.d.ts +29 -0
- package/dist/src/client/index.d.ts +2 -0
- package/dist/src/client/navigation.d.ts +16 -0
- package/dist/src/client/prefetch.d.ts +2 -30
- package/dist/src/core/build.d.ts +2 -2
- package/dist/src/core/cspNonce.d.ts +12 -0
- package/dist/src/core/fileRouteAdapter.d.ts +15 -0
- package/dist/src/core/fileRoutes.d.ts +5 -0
- package/dist/src/core/formActionFlash.d.ts +25 -0
- package/dist/src/core/formActions.d.ts +249 -0
- package/dist/src/core/index.d.ts +5 -0
- package/dist/src/core/partialPrerender.d.ts +28 -0
- package/dist/src/core/partialPrerenderServe.d.ts +24 -0
- package/dist/src/core/precompressed.d.ts +11 -1
- package/dist/src/core/prerenderNonce.d.ts +9 -0
- package/dist/src/core/productionRuntime.d.ts +4 -2
- package/dist/src/core/serverOnlyStaticFiles.d.ts +8 -0
- package/dist/src/core/staticHtmlNonce.d.ts +2 -0
- package/dist/src/core/vitals.d.ts +108 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +1 -1
- package/dist/src/dev/client/cspNonce.d.ts +2 -0
- package/dist/src/dev/fileRouteRefresher.d.ts +5 -0
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/reactServerComponentsRebuild.d.ts +3 -0
- package/dist/src/i18n/defineMessages.d.ts +5 -0
- package/dist/src/i18n/formatMessage.d.ts +26 -0
- package/dist/src/i18n/index.d.ts +6 -0
- package/dist/src/i18n/intlCache.d.ts +5 -0
- package/dist/src/i18n/routing.d.ts +28 -0
- package/dist/src/i18n/translator.d.ts +11 -0
- package/dist/src/mobile/androidRelease.d.ts +2 -2
- package/dist/src/mobile/iosRelease.d.ts +4 -4
- package/dist/src/mobile/materializedBundle.d.ts +1 -1
- package/dist/src/mobile/mobileInspect.d.ts +1 -1
- package/dist/src/mobile/releaseArtifact.d.ts +2 -2
- package/dist/src/mobile/remoteMacProtocol.d.ts +2 -2
- package/dist/src/plugins/i18n.d.ts +30 -0
- package/dist/src/plugins/index.d.ts +2 -1
- package/dist/src/plugins/secureHeaders.d.ts +48 -0
- package/dist/src/react/components/Head.d.ts +1 -1
- package/dist/src/react/components/StreamSlot.browser.d.ts +1 -0
- package/dist/src/react/components/StreamSlot.d.ts +5 -1
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +2 -0
- package/dist/src/react/components/SuspenseSlot.d.ts +12 -0
- package/dist/src/react/fileRoute.d.ts +18 -0
- package/dist/src/react/hooks/index.d.ts +4 -0
- package/dist/src/react/hooks/useFormAction.d.ts +42 -0
- package/dist/src/react/hooks/useI18n.d.ts +15 -0
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/react/server.d.ts +2 -0
- package/dist/src/react/serverComponents/constants.d.ts +11 -0
- package/dist/src/react/serverComponents/flightPayload.d.ts +2 -0
- package/dist/src/react/serverComponents/pageHandler.d.ts +14 -0
- package/dist/src/svelte/browser.d.ts +1 -0
- package/dist/src/svelte/fileRoute.d.ts +15 -0
- package/dist/src/svelte/i18n.d.ts +8 -0
- package/dist/src/svelte/index.d.ts +2 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +5 -1
- package/dist/src/svelte/renderToReadableStream.d.ts +10 -2
- package/dist/src/svelte/router/browser.d.ts +3 -1
- package/dist/src/svelte/router/goto.d.ts +13 -10
- package/dist/src/svelte/router/guards.d.ts +43 -0
- package/dist/src/svelte/router/index.d.ts +3 -1
- package/dist/src/svelte/router/lazy.d.ts +17 -0
- package/dist/src/svelte/router/lazyModule.d.ts +29 -0
- package/dist/src/svelte/router/navigation.d.ts +55 -0
- package/dist/src/svelte/router/pushState.d.ts +4 -2
- package/dist/src/svelte/router/scroll.d.ts +34 -0
- package/dist/src/svelte/routerSsr.d.ts +9 -0
- package/dist/src/svelte/server.d.ts +1 -0
- package/dist/src/utils/cspNonceRef.d.ts +8 -0
- package/dist/src/utils/fontAssets.d.ts +17 -0
- package/dist/src/utils/formActionProtocol.d.ts +10 -0
- package/dist/src/utils/generateHeadElement.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/inlinePageCss.d.ts +18 -0
- package/dist/src/utils/loadConfig.d.ts +5 -0
- package/dist/src/utils/localeRef.d.ts +10 -0
- package/dist/src/utils/resolveConvention.d.ts +6 -1
- package/dist/src/utils/streamingSlots.d.ts +5 -0
- package/dist/src/vue/browser.d.ts +2 -0
- package/dist/src/vue/components/Image.d.ts +2 -2
- package/dist/src/vue/index.d.ts +2 -0
- package/dist/src/vue/serverDataPayload.d.ts +32 -0
- package/dist/src/vue/serverDataState.d.ts +9 -0
- package/dist/src/vue/useServerData.browser.d.ts +6 -0
- package/dist/src/vue/useServerData.d.ts +24 -0
- package/dist/svelte/browser.js +330 -3
- package/dist/svelte/browser.js.map +8 -4
- package/dist/svelte/components/AwaitSlot.svelte +5 -0
- package/dist/svelte/components/Head.svelte +50 -0
- package/dist/svelte/components/JsonLd.svelte +9 -1
- package/dist/svelte/components/StreamSlot.svelte +5 -0
- package/dist/svelte/index.js +1017 -117
- package/dist/svelte/index.js.map +38 -24
- package/dist/svelte/router/Link.svelte +40 -8
- package/dist/svelte/router/Route.svelte +157 -12
- package/dist/svelte/router/Route.svelte.d.ts +39 -5
- package/dist/svelte/router/Router.svelte +140 -25
- package/dist/svelte/router/Router.svelte.d.ts +5 -1
- package/dist/svelte/router/browser.ts +10 -0
- package/dist/svelte/router/goto.ts +15 -86
- package/dist/svelte/router/guards.ts +112 -0
- package/dist/svelte/router/index.ts +10 -0
- package/dist/svelte/router/lazy.ts +82 -0
- package/dist/svelte/router/lazyModule.ts +74 -0
- package/dist/svelte/router/navigation.ts +412 -0
- package/dist/svelte/router/pushState.ts +7 -4
- package/dist/svelte/router/scroll.ts +286 -0
- package/dist/svelte/server.js +747 -252
- package/dist/svelte/server.js.map +30 -20
- package/dist/types/angular.d.ts +2 -0
- package/dist/types/build.d.ts +37 -0
- package/dist/types/conventions.d.ts +3 -0
- package/dist/types/fileRoutes.d.ts +72 -0
- package/dist/types/fonts.d.ts +86 -0
- package/dist/types/formAction.d.ts +54 -0
- package/dist/types/globals.d.ts +10 -0
- package/dist/types/i18n.d.ts +185 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/metadata.d.ts +11 -0
- package/dist/types/navigation.d.ts +37 -0
- package/dist/types/prefetch.d.ts +10 -0
- package/dist/types/sitemap.d.ts +4 -0
- package/dist/types/svelteRouter.d.ts +89 -2
- package/dist/types/svelteRouter.ts +112 -2
- package/dist/types/vue.d.ts +46 -1
- package/dist/utils/iconVersion.ts +34 -0
- package/dist/vue/browser.js +107 -11
- package/dist/vue/browser.js.map +7 -4
- package/dist/vue/components/index.js +5 -2
- package/dist/vue/components/index.js.map +5 -4
- package/dist/vue/index.js +712 -158
- package/dist/vue/index.js.map +32 -23
- package/dist/vue/server.js +310 -79
- package/dist/vue/server.js.map +20 -15
- package/package.json +9 -1
- package/dist/cli/prerender-mfnwsvyt.js +0 -7
- package/dist/src/plugins/pageRouter.d.ts +0 -1
- /package/dist/cli/{index-j7m8pq48.js → index-rervww4p.js} +0 -0
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/react/hooks/useIslandStore.ts", "../node_modules/zustand/esm/vanilla.mjs", "../node_modules/zustand/esm/middleware.mjs", "../src/client/islandStore.ts", "../src/react/hooks/useMediaQuery.ts", "../src/react/hooks/usePrefetch.ts", "../src/client/prefetch.ts"],
|
|
3
|
+
"sources": ["../src/utils/formActionProtocol.ts", "../src/react/hooks/useI18n.ts", "../src/i18n/intlCache.ts", "../src/i18n/formatMessage.ts", "../src/i18n/translator.ts", "../src/react/hooks/useIslandStore.ts", "../node_modules/zustand/esm/vanilla.mjs", "../node_modules/zustand/esm/middleware.mjs", "../src/client/islandStore.ts", "../src/react/hooks/useMediaQuery.ts", "../src/react/hooks/usePrefetch.ts", "../src/dev/client/cspNonce.ts", "../src/client/prefetch.ts", "../src/react/hooks/useFormAction.ts", "../src/client/formActions.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import type { ActionResult } from '../../types/formAction';\n\n/* The wire contract between `defineAction` (server) and the browser\n * helpers (`submitFormAction`, `enhanceForms`, `useFormAction`). Browser\n * safe: no server imports. */\n\n/* - ACTION_ERROR_ATTRIBUTE: element whose text becomes the named field's\n * error (`data-action-error=\"email\"`).\n * - ACTION_FORM_ATTRIBUTE: marks a plain <form> for `enhanceForms()` and\n * for the server's no-JS result rendering.\n * - ACTION_MESSAGE_ATTRIBUTE: element whose text becomes the form-level\n * error message.\n * - ACTION_REQUEST_HEADER: sent by the browser helpers so the action\n * answers with JSON instead of redirecting.\n * - ACTION_STATUS_ATTRIBUTE: set on the form, `success` or `error`.\n * - ACTION_SUCCESS_ATTRIBUTE: element shown (its `hidden` removed) after\n * a successful submission. */\nexport const ACTION_ERROR_ATTRIBUTE = 'data-action-error';\nexport const ACTION_FORM_ATTRIBUTE = 'data-absolute-action';\nexport const ACTION_MESSAGE_ATTRIBUTE = 'data-action-message';\nexport const ACTION_REQUEST_HEADER = 'x-absolute-action';\nexport const ACTION_STATUS_ATTRIBUTE = 'data-action-status';\nexport const ACTION_SUCCESS_ATTRIBUTE = 'data-action-success';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst isStringRecord = (value: unknown) =>\n\tisRecord(value) &&\n\tObject.values(value).every((entry) => typeof entry === 'string');\n\nconst isOptionalString = (value: unknown) =>\n\tvalue === undefined || typeof value === 'string';\n\n/** True for a well-formed action result. The type parameters let callers\n * name the action's data and fields; only the shape is checked. */\nexport const isActionResult = <Data = unknown, Fields extends string = string>(\n\tvalue: unknown\n): value is ActionResult<Data, Fields> => {\n\tif (!isRecord(value)) return false;\n\tif (value.status === 'success') return isOptionalString(value.redirect);\n\n\treturn (\n\t\tvalue.status === 'error' &&\n\t\tisStringRecord(value.errors) &&\n\t\tisOptionalString(value.message)\n\t);\n};\n",
|
|
6
|
+
"import {\n\tcreateContext,\n\tcreateElement,\n\tuseContext,\n\tuseMemo,\n\ttype ReactNode\n} from 'react';\nimport type { I18nPayload, MessageCatalog } from '../../../types/i18n';\nimport { createTranslator } from '../../i18n/translator';\n\nconst I18nContext = createContext<I18nPayload | null>(null);\n\ntype I18nProviderProps = {\n\t/** The payload from the server (`i18n.payload()`), passed down as a\n\t * page prop so the browser hydrates with the same messages. */\n\tvalue: I18nPayload;\n\tchildren?: ReactNode;\n};\n\n/** Makes a locale's messages available to `useI18n()` below it. */\nexport const I18nProvider = ({ value, children }: I18nProviderProps) =>\n\tcreateElement(I18nContext.Provider, { value }, children);\n\n/** The translator for the nearest `I18nProvider`. Pass your default\n * catalog's type to type-check keys and ICU parameters:\n * `const { t } = useI18n<typeof en>()`. */\nexport const useI18n = <Catalog = MessageCatalog>() => {\n\tconst payload = useContext(I18nContext);\n\tif (payload === null) {\n\t\tthrow new Error('useI18n must be used within an I18nProvider');\n\t}\n\n\treturn useMemo(() => createTranslator<Catalog>(payload), [payload]);\n};\n",
|
|
7
|
+
"/* Intl formatters are expensive to construct; keep one per locale and\n * options. Options are keyed by their JSON, which is stable for the plain\n * option objects callers pass. */\n\nconst numberFormats = new Map<string, Intl.NumberFormat>();\nconst dateTimeFormats = new Map<string, Intl.DateTimeFormat>();\nconst pluralRules = new Map<string, Intl.PluralRules>();\nconst relativeTimeFormats = new Map<string, Intl.RelativeTimeFormat>();\nconst listFormats = new Map<string, Intl.ListFormat>();\n\nconst cacheKey = (locale: string, options: object | undefined) =>\n\t`${locale}|${options ? JSON.stringify(options) : ''}`;\n\nconst cached = <Formatter>(\n\tcache: Map<string, Formatter>,\n\tkey: string,\n\tcreate: () => Formatter\n) => {\n\tconst existing = cache.get(key);\n\tif (existing) return existing;\n\tconst created = create();\n\tcache.set(key, created);\n\n\treturn created;\n};\n\nexport const getDateTimeFormat = (\n\tlocale: string,\n\toptions?: Intl.DateTimeFormatOptions\n) =>\n\tcached(\n\t\tdateTimeFormats,\n\t\tcacheKey(locale, options),\n\t\t() => new Intl.DateTimeFormat(locale, options)\n\t);\nexport const getListFormat = (\n\tlocale: string,\n\toptions?: Intl.ListFormatOptions\n) =>\n\tcached(\n\t\tlistFormats,\n\t\tcacheKey(locale, options),\n\t\t() => new Intl.ListFormat(locale, options)\n\t);\nexport const getNumberFormat = (\n\tlocale: string,\n\toptions?: Intl.NumberFormatOptions\n) =>\n\tcached(\n\t\tnumberFormats,\n\t\tcacheKey(locale, options),\n\t\t() => new Intl.NumberFormat(locale, options)\n\t);\nexport const getPluralRules = (\n\tlocale: string,\n\toptions?: Intl.PluralRulesOptions\n) =>\n\tcached(\n\t\tpluralRules,\n\t\tcacheKey(locale, options),\n\t\t() => new Intl.PluralRules(locale, options)\n\t);\nexport const getRelativeTimeFormat = (\n\tlocale: string,\n\toptions?: Intl.RelativeTimeFormatOptions\n) =>\n\tcached(\n\t\trelativeTimeFormats,\n\t\tcacheKey(locale, options),\n\t\t() => new Intl.RelativeTimeFormat(locale, options)\n\t);\n",
|
|
8
|
+
"/* A small ICU MessageFormat formatter on the platform's Intl APIs.\n *\n * Supported: `{name}`, `{name, number[, integer|percent|::currency/EUR]}`,\n * `{name, date|time[, short|medium|long|full]}`,\n * `{name, plural|selectordinal, [offset:N] =N {…} one {…} other {…}}` with\n * `#`, `{name, select, a {…} other {…}}`, nesting, and apostrophe quoting\n * (`''` is a quote, `'{…}'` is literal text). Parsed messages are cached\n * per string; Intl formatters are cached per locale and options. */\n\nimport {\n\tgetDateTimeFormat,\n\tgetNumberFormat,\n\tgetPluralRules\n} from './intlCache';\n\ntype TextNode = { kind: 'text'; value: string };\ntype PoundNode = { kind: 'pound' };\ntype ArgumentNode = {\n\tkind: 'argument';\n\tname: string;\n\tformat: string | undefined;\n\tstyle: string | undefined;\n};\ntype BranchNode = {\n\tkind: 'plural' | 'select' | 'selectordinal';\n\tname: string;\n\toffset: number;\n\toptions: Record<string, MessageNode[]>;\n};\nexport type MessageNode = ArgumentNode | BranchNode | PoundNode | TextNode;\n\ntype Cursor = { source: string; index: number };\ntype Branches = { offset: number; options: Record<string, MessageNode[]> };\n\nconst SYNTAX_CHARS = new Set(['{', '}', '#', '|']);\nconst WHITESPACE = /\\s/;\n\nconst isBranchKind = (\n\tvalue: string\n): value is 'plural' | 'select' | 'selectordinal' =>\n\tvalue === 'plural' || value === 'select' || value === 'selectordinal';\n\nconst skipWhitespace = (cursor: Cursor) => {\n\twhile (\n\t\tcursor.index < cursor.source.length &&\n\t\tWHITESPACE.test(cursor.source.charAt(cursor.index))\n\t) {\n\t\tcursor.index += 1;\n\t}\n};\n\nconst syntaxError = (cursor: Cursor, expected: string) =>\n\tnew SyntaxError(\n\t\t`Invalid ICU message (expected ${expected} at ${cursor.index}): ${cursor.source}`\n\t);\n\n/** Read up to (not including) the first of `stops`, trimmed. */\nconst readToken = (cursor: Cursor, stops: string) => {\n\tconst start = cursor.index;\n\twhile (\n\t\tcursor.index < cursor.source.length &&\n\t\t!stops.includes(cursor.source.charAt(cursor.index))\n\t) {\n\t\tcursor.index += 1;\n\t}\n\n\treturn cursor.source.slice(start, cursor.index).trim();\n};\n\nconst expectChar = (cursor: Cursor, char: string) => {\n\tskipWhitespace(cursor);\n\tif (cursor.source.charAt(cursor.index) !== char)\n\t\tthrow syntaxError(cursor, `\"${char}\"`);\n\tcursor.index += 1;\n};\n\n/** `'` handling: `''` → `'`; `'` before a syntax char opens a quoted run\n * that ends at the next lone `'`; any other `'` is literal. */\nconst readQuoted = (cursor: Cursor, inPlural: boolean) => {\n\tconst next = cursor.source.charAt(cursor.index + 1);\n\tif (next === \"'\") {\n\t\tcursor.index += 2;\n\n\t\treturn \"'\";\n\t}\n\tconst opensQuote = SYNTAX_CHARS.has(next) && (next !== '#' || inPlural);\n\tif (!opensQuote) {\n\t\tcursor.index += 1;\n\n\t\treturn \"'\";\n\t}\n\tcursor.index += 1;\n\tlet text = '';\n\twhile (cursor.index < cursor.source.length) {\n\t\tconst char = cursor.source.charAt(cursor.index);\n\t\tconst isEscapedQuote =\n\t\t\tchar === \"'\" && cursor.source.charAt(cursor.index + 1) === \"'\";\n\t\tif (char === \"'\" && !isEscapedQuote) break;\n\t\ttext += char;\n\t\tcursor.index += isEscapedQuote ? 2 : 1;\n\t}\n\tcursor.index += 1;\n\n\treturn text;\n};\n\nconst pushText = (nodes: MessageNode[], value: string) => {\n\tconst last = nodes[nodes.length - 1];\n\tif (last?.kind === 'text') {\n\t\tlast.value += value;\n\n\t\treturn;\n\t}\n\tnodes.push({ kind: 'text', value });\n};\n\n/** Read one `selector {message}` pair (or an `offset:N`) into `branches`. */\nconst parseBranchOption = (\n\tcursor: Cursor,\n\tkind: BranchNode['kind'],\n\tbranches: Branches\n) => {\n\tif (cursor.index >= cursor.source.length) throw syntaxError(cursor, '\"}\"');\n\tconst selector = readToken(cursor, '{} \\n\\t\\r');\n\tconst offsetMatch = /^offset:(\\d+)$/.exec(selector);\n\tif (offsetMatch && kind !== 'select') {\n\t\tbranches.offset = Number(offsetMatch[1]);\n\t\tskipWhitespace(cursor);\n\n\t\treturn;\n\t}\n\tif (selector === '') throw syntaxError(cursor, 'a selector');\n\texpectChar(cursor, '{');\n\tbranches.options[selector] = parseNodes(cursor, kind !== 'select');\n\texpectChar(cursor, '}');\n\tskipWhitespace(cursor);\n};\n\nconst parseBranchOptions = (cursor: Cursor, kind: BranchNode['kind']) => {\n\tconst branches: Branches = { offset: 0, options: {} };\n\tskipWhitespace(cursor);\n\twhile (cursor.source.charAt(cursor.index) !== '}') {\n\t\tparseBranchOption(cursor, kind, branches);\n\t}\n\tif (branches.options.other === undefined)\n\t\tthrow syntaxError(cursor, 'an \"other\" branch');\n\n\treturn branches;\n};\n\nconst parseArgument = (cursor: Cursor): MessageNode => {\n\tskipWhitespace(cursor);\n\tconst name = readToken(cursor, ',}');\n\tif (name === '') throw syntaxError(cursor, 'an argument name');\n\tif (cursor.source.charAt(cursor.index) === '}') {\n\t\tcursor.index += 1;\n\n\t\treturn { format: undefined, kind: 'argument', name, style: undefined };\n\t}\n\tcursor.index += 1;\n\tconst format = readToken(cursor, ',}');\n\tif (isBranchKind(format)) {\n\t\texpectChar(cursor, ',');\n\t\tconst { offset, options } = parseBranchOptions(cursor, format);\n\t\texpectChar(cursor, '}');\n\n\t\treturn { kind: format, name, offset, options };\n\t}\n\tlet style: string | undefined;\n\tif (cursor.source.charAt(cursor.index) === ',') {\n\t\tcursor.index += 1;\n\t\tstyle = readToken(cursor, '}');\n\t}\n\texpectChar(cursor, '}');\n\n\treturn { format, kind: 'argument', name, style };\n};\n\n/** Consume the node starting at the cursor (not a closing `}`). */\nconst parseNode = (cursor: Cursor, inPlural: boolean, nodes: MessageNode[]) => {\n\tconst char = cursor.source.charAt(cursor.index);\n\tif (char === '{') {\n\t\tcursor.index += 1;\n\t\tnodes.push(parseArgument(cursor));\n\n\t\treturn;\n\t}\n\tif (char === '#' && inPlural) {\n\t\tcursor.index += 1;\n\t\tnodes.push({ kind: 'pound' });\n\n\t\treturn;\n\t}\n\tif (char === \"'\") {\n\t\tpushText(nodes, readQuoted(cursor, inPlural));\n\n\t\treturn;\n\t}\n\tpushText(nodes, char);\n\tcursor.index += 1;\n};\n\nconst parseNodes = (cursor: Cursor, inPlural: boolean) => {\n\tconst nodes: MessageNode[] = [];\n\twhile (\n\t\tcursor.index < cursor.source.length &&\n\t\tcursor.source.charAt(cursor.index) !== '}'\n\t) {\n\t\tparseNode(cursor, inPlural, nodes);\n\t}\n\n\treturn nodes;\n};\n\n/** Parse an ICU message into nodes. Throws `SyntaxError` on bad syntax. */\nexport const parseMessage = (source: string) => {\n\tconst cursor: Cursor = { index: 0, source };\n\tconst nodes = parseNodes(cursor, false);\n\tif (cursor.index < source.length)\n\t\tthrow syntaxError(cursor, 'end of message');\n\n\treturn nodes;\n};\n\nconst parsedCache = new Map<string, MessageNode[] | SyntaxError>();\n\nconst parseCached = (source: string) => {\n\tconst cached = parsedCache.get(source);\n\tif (cached) return cached;\n\tlet parsed: MessageNode[] | SyntaxError;\n\ttry {\n\t\tparsed = parseMessage(source);\n\t} catch (error) {\n\t\tparsed =\n\t\t\terror instanceof SyntaxError\n\t\t\t\t? error\n\t\t\t\t: new SyntaxError(String(error));\n\t}\n\tparsedCache.set(source, parsed);\n\n\treturn parsed;\n};\n\nconst INTEGER_OPTIONS: Intl.NumberFormatOptions = { maximumFractionDigits: 0 };\nconst PERCENT_OPTIONS: Intl.NumberFormatOptions = { style: 'percent' };\n\nconst numberOptions = (style: string | undefined) => {\n\tif (style === 'integer') return INTEGER_OPTIONS;\n\tif (style === 'percent') return PERCENT_OPTIONS;\n\tconst currency = /^::currency\\/([A-Za-z]{3})$/.exec(style ?? '');\n\tconst options: Intl.NumberFormatOptions = currency?.[1]\n\t\t? { currency: currency[1].toUpperCase(), style: 'currency' }\n\t\t: {};\n\n\treturn options;\n};\n\nconst toDate = (value: unknown) => {\n\tif (value instanceof Date) return value;\n\tif (typeof value === 'number' || typeof value === 'string')\n\t\treturn new Date(value);\n\n\treturn undefined;\n};\n\nconst dateStyleOf = (style: string | undefined) => {\n\tif (style === 'full' || style === 'long' || style === 'short') return style;\n\n\treturn 'medium';\n};\n\nconst formatDateArgument = (\n\tlocale: string,\n\tvalue: unknown,\n\tformat: 'date' | 'time',\n\tstyle: string | undefined\n) => {\n\tconst date = toDate(value);\n\tif (!date || Number.isNaN(date.getTime())) return String(value);\n\tconst resolvedStyle = dateStyleOf(style);\n\tconst options: Intl.DateTimeFormatOptions =\n\t\tformat === 'date'\n\t\t\t? { dateStyle: resolvedStyle }\n\t\t\t: { timeStyle: resolvedStyle };\n\n\treturn getDateTimeFormat(locale, options).format(date);\n};\n\nconst formatValue = (locale: string, value: unknown) => {\n\tif (typeof value === 'number' || typeof value === 'bigint')\n\t\treturn getNumberFormat(locale).format(value);\n\tif (value instanceof Date) return getDateTimeFormat(locale).format(value);\n\n\treturn String(value);\n};\n\nconst formatArgument = (\n\tlocale: string,\n\tnode: ArgumentNode,\n\tparams: Record<string, unknown>\n) => {\n\tif (!(node.name in params)) return `{${node.name}}`;\n\tconst value = params[node.name];\n\tif (node.format === 'number') {\n\t\tconst numeric = typeof value === 'bigint' ? value : Number(value);\n\n\t\treturn getNumberFormat(locale, numberOptions(node.style)).format(\n\t\t\tnumeric\n\t\t);\n\t}\n\tif (node.format === 'date' || node.format === 'time')\n\t\treturn formatDateArgument(locale, value, node.format, node.style);\n\n\treturn formatValue(locale, value);\n};\n\nconst selectBranch = (locale: string, node: BranchNode, value: unknown) => {\n\tif (node.kind === 'select') {\n\t\treturn node.options[String(value)] ?? node.options.other ?? [];\n\t}\n\tconst numeric = Number(value);\n\tconst exact = node.options[`=${numeric}`];\n\tif (exact) return exact;\n\tconst category = getPluralRules(locale, {\n\t\ttype: node.kind === 'selectordinal' ? 'ordinal' : 'cardinal'\n\t}).select(numeric - node.offset);\n\n\treturn node.options[category] ?? node.options.other ?? [];\n};\n\nconst formatNodes = (\n\tlocale: string,\n\tnodes: MessageNode[],\n\tparams: Record<string, unknown>,\n\tpound: string | undefined\n): string =>\n\tnodes\n\t\t.map((node) => {\n\t\t\tif (node.kind === 'text') return node.value;\n\t\t\tif (node.kind === 'pound') return pound ?? '#';\n\t\t\tif (node.kind === 'argument')\n\t\t\t\treturn formatArgument(locale, node, params);\n\t\t\tif (!(node.name in params)) return `{${node.name}}`;\n\t\t\tconst value = params[node.name];\n\t\t\tconst branch = selectBranch(locale, node, value);\n\t\t\tconst branchPound =\n\t\t\t\tnode.kind === 'select'\n\t\t\t\t\t? pound\n\t\t\t\t\t: getNumberFormat(locale).format(\n\t\t\t\t\t\t\tNumber(value) - node.offset\n\t\t\t\t\t\t);\n\n\t\t\treturn formatNodes(locale, branch, params, branchPound);\n\t\t})\n\t\t.join('');\n\n/** Format an ICU message for `locale`. A message that fails to parse is\n * returned as written; a missing parameter renders as `{name}`. */\nexport const formatMessage = (\n\tlocale: string,\n\tmessage: string,\n\tparams: Record<string, unknown> = {}\n) => {\n\tif (!message.includes('{') && !message.includes(\"'\")) return message;\n\tconst parsed = parseCached(message);\n\tif (parsed instanceof SyntaxError) return message;\n\n\treturn formatNodes(locale, parsed, params, undefined);\n};\n",
|
|
9
|
+
"import type {\n\tDateInput,\n\tI18nPayload,\n\tMessageCatalog,\n\tMessageTree,\n\tTranslate,\n\tTranslator\n} from '../../types/i18n';\nimport { formatMessage } from './formatMessage';\nimport {\n\tgetDateTimeFormat,\n\tgetListFormat,\n\tgetNumberFormat,\n\tgetRelativeTimeFormat\n} from './intlCache';\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** The message at a dot-separated key, or undefined. */\nexport const lookupMessage = (messages: MessageTree, key: string) => {\n\tlet node: string | MessageTree | undefined = messages;\n\tfor (const segment of key.split('.')) {\n\t\tif (typeof node !== 'object') return undefined;\n\t\tnode = node[segment];\n\t}\n\n\treturn typeof node === 'string' ? node : undefined;\n};\n\nconst isMessageTreeValue = (value: unknown): value is string | MessageTree =>\n\ttypeof value === 'string' || isMessageTree(value);\n\n/** Whether `value` is an i18n payload (as passed through page props). */\nexport const isI18nPayload = (value: unknown): value is I18nPayload =>\n\tisRecord(value) &&\n\ttypeof value.locale === 'string' &&\n\ttypeof value.defaultLocale === 'string' &&\n\t(value.dir === 'ltr' || value.dir === 'rtl') &&\n\tisMessageTree(value.messages);\n/** Whether `value` is a catalog: nested plain objects of strings. */\nexport const isMessageTree = (value: unknown): value is MessageTree =>\n\tisRecord(value) && Object.values(value).every(isMessageTreeValue);\n\nconst toDate = (value: DateInput) =>\n\tvalue instanceof Date ? value : new Date(value);\n\nconst warnedKeys = new Set<string>();\n\nconst warnMissing = (locale: string, key: string) => {\n\tconst id = `${locale}:${key}`;\n\tif (warnedKeys.has(id)) return;\n\twarnedKeys.add(id);\n\tconsole.warn(`[i18n] Missing message \"${key}\" for locale \"${locale}\"`);\n};\n\n/** A translator over a payload's messages. Pass your default catalog's\n * type (`createTranslator<typeof en>(payload)`) to type-check keys and\n * ICU parameters. */\nexport const createTranslator = <Catalog = MessageCatalog>(\n\tpayload: I18nPayload\n) => {\n\tconst { locale, messages } = payload;\n\tconst t: Translate<Catalog> = (key, ...args: unknown[]) => {\n\t\tconst message = lookupMessage(messages, key);\n\t\tif (message === undefined) {\n\t\t\twarnMissing(locale, key);\n\n\t\t\treturn key;\n\t\t}\n\t\tconst [params] = args;\n\n\t\treturn formatMessage(locale, message, isRecord(params) ? params : {});\n\t};\n\tconst translator: Translator<Catalog> = {\n\t\tdir: payload.dir,\n\t\tlocale,\n\t\tt,\n\t\tformatDate: (value, options) =>\n\t\t\tgetDateTimeFormat(locale, options).format(toDate(value)),\n\t\tformatList: (items, options) =>\n\t\t\tgetListFormat(locale, options).format(items),\n\t\tformatNumber: (value, options) =>\n\t\t\tgetNumberFormat(locale, options).format(value),\n\t\tformatRelativeTime: (value, unit, options) =>\n\t\t\tgetRelativeTimeFormat(locale, options).format(value, unit),\n\t\thas: (key) => lookupMessage(messages, key) !== undefined\n\t};\n\n\treturn translator;\n};\n",
|
|
5
10
|
"import { useSyncExternalStore } from 'react';\nimport type { StoreApi } from 'zustand/vanilla';\nimport {\n\tgetIslandStoreServerSnapshot,\n\treadIslandStore,\n\tsubscribeIslandStore,\n\ttype IslandStoreState\n} from '../../client/islandStore';\n\nexport const useIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) =>\n\tuseSyncExternalStore(\n\t\t(listener) =>\n\t\t\tsubscribeIslandStore(store, selector, () => {\n\t\t\t\tlistener();\n\t\t\t}),\n\t\t() => readIslandStore(store, selector),\n\t\t() => getIslandStoreServerSnapshot(store, selector)\n\t);\n",
|
|
6
11
|
"const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n",
|
|
7
12
|
"const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...args) => api.dispatch(...args), ...initial };\n};\nconst redux = reduxImpl;\n\nconst shouldDispatchFromDevtools = (api) => !!api.dispatchFromDevtools && typeof api.dispatch === \"function\";\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst removeStoreFromTrackedConnections = (name, store) => {\n if (store === void 0) return;\n const connectionInfo = trackedConnections.get(name);\n if (!connectionInfo) return;\n delete connectionInfo.stores[store];\n if (Object.keys(connectionInfo.stores).length === 0) {\n trackedConnections.delete(name);\n }\n};\nconst findCallerName = (stack) => {\n var _a, _b;\n if (!stack) return void 0;\n const traceLines = stack.split(\"\\n\");\n const apiSetStateLineIndex = traceLines.findIndex(\n (traceLine) => traceLine.includes(\"api.setState\")\n );\n if (apiSetStateLineIndex < 0) return void 0;\n const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || \"\";\n return (_b = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b[1];\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = ((state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? {\n type: anonymousActionType || findCallerName(new Error().stack) || \"anonymous\"\n } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n });\n api.devtools = {\n cleanup: () => {\n if (connection && typeof connection.unsubscribe === \"function\") {\n connection.unsubscribe();\n }\n removeStoreFromTrackedConnections(options.name, store);\n }\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (shouldDispatchFromDevtools(api)) {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...args) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && args[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...args);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (shouldDispatchFromDevtools(api)) {\n api.dispatch(action);\n }\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, fn) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) fn(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = ((selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n });\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nfunction combine(initialState, create) {\n return (...args) => Object.assign({}, initialState, create(...args));\n}\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => window.localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n let hydrationVersion = 0;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n return setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n return setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n const currentVersion = ++hydrationVersion;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n if (currentVersion !== hydrationVersion) {\n return;\n }\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(get(), void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nfunction ssrSafe(config, isSSR = typeof window === \"undefined\") {\n return (set, get, api) => {\n if (!isSSR) {\n return config(set, get, api);\n }\n const ssrSet = () => {\n throw new Error(\"Cannot set state of Zustand store in SSR\");\n };\n api.setState = ssrSet;\n return config(ssrSet, get, api);\n };\n}\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector, ssrSafe as unstable_ssrSafe };\n",
|
|
8
13
|
"import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\nexport const ABSOLUTE_ISLAND_STATE = '__ABS_ISLAND_STATE__';\nexport const ABSOLUTE_ISLAND_STORES = '__ABS_ISLAND_STORES__';\n\ndeclare global {\n\tvar __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;\n\tvar __ABS_ISLAND_STORES__:\n\t\tMap<string, Set<IslandStoreInstance>> | undefined;\n}\n\nconst getIslandStoreSnapshot = () => {\n\tglobalThis.__ABS_ISLAND_STATE__ ??= {};\n\n\treturn globalThis.__ABS_ISLAND_STATE__;\n};\n\nconst getIslandStores = () => {\n\tglobalThis.__ABS_ISLAND_STORES__ ??= new Map();\n\n\treturn globalThis.__ABS_ISLAND_STORES__;\n};\n\nconst isSerializableValue = (value: unknown) =>\n\ttypeof value !== 'function' && value !== undefined;\n\nconst toSerializableState = <T extends object>(state: T) =>\n\tObject.fromEntries(\n\t\tObject.entries(state).filter(([, value]) => isSerializableValue(value))\n\t);\n\nconst applySnapshot = <T extends object>(\n\tstore: StoreApi<T>,\n\tsnapshot: IslandStoreSnapshot | undefined\n) => {\n\tif (!snapshot) {\n\t\treturn;\n\t}\n\n\tstore.setState({\n\t\t...store.getState(),\n\t\t...snapshot\n\t});\n};\n\nconst getPeerStores = (\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => [...storeInstances].filter((peer) => peer.store !== ownerStore);\n\nconst syncIslandSnapshot = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tstate: IslandStoreShape<TState, TActions>,\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => {\n\tconst nextSnapshot = toSerializableState(state);\n\tgetIslandStoreSnapshot()[storeId] = nextSnapshot;\n\n\tfor (const peerStore of getPeerStores(storeInstances, ownerStore)) {\n\t\tpeerStore.applyExternalSnapshot(nextSnapshot);\n\t}\n};\n\nexport const createIslandStore = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tinitialState: TState,\n\tcreateState: StateCreator<TState, [], [], TActions>\n) => {\n\tconst store = createStore(combine(initialState, createState));\n\tconst stores = getIslandStores();\n\tconst storeInstances =\n\t\tstores.get(storeId) ?? new Set<IslandStoreInstance>();\n\tconst initialSnapshot = getIslandStoreSnapshot()[storeId];\n\tapplySnapshot(store, initialSnapshot);\n\tlet isApplyingExternalSnapshot = false;\n\n\tconst applyExternalSnapshot = (snapshot: IslandStoreSnapshot) => {\n\t\tisApplyingExternalSnapshot = true;\n\t\tapplySnapshot(store, snapshot);\n\t};\n\n\tstoreInstances.add({\n\t\tapplyExternalSnapshot,\n\t\tstore\n\t});\n\tstores.set(storeId, storeInstances);\n\n\tsyncIslandSnapshot(storeId, store.getState(), storeInstances, store);\n\tstore.subscribe((state) => {\n\t\tif (isApplyingExternalSnapshot) {\n\t\t\tisApplyingExternalSnapshot = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tsyncIslandSnapshot(storeId, state, storeInstances, store);\n\t});\n\n\treturn store;\n};\nexport const getIslandStoreServerSnapshot = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getInitialState());\nconst applySnapshotToStoreInstances = (\n\tstoreId: string,\n\tinstances: Set<IslandStoreInstance>,\n\tsnapshot: IslandStateSnapshot\n) => {\n\tfor (const instance of instances) {\n\t\tinstance.applyExternalSnapshot(snapshot[storeId] ?? {});\n\t}\n};\n\nexport const initializeIslandStores = (state: IslandStateSnapshot) => {\n\tconst currentSnapshot = getIslandStoreSnapshot();\n\tconst nextSnapshot: IslandStateSnapshot = {\n\t\t...state,\n\t\t...currentSnapshot\n\t};\n\n\tglobalThis.__ABS_ISLAND_STATE__ = nextSnapshot;\n\n\tfor (const [storeId, store] of getIslandStores()) {\n\t\tapplySnapshotToStoreInstances(storeId, store, nextSnapshot);\n\t}\n};\nexport const readIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getState());\nexport const resetIslandStoreForTesting = () => {\n\tdelete globalThis.__ABS_ISLAND_STATE__;\n\tdelete globalThis.__ABS_ISLAND_STORES__;\n};\nexport const subscribeIslandStore = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected,\n\tlistener: (value: TSelected) => void\n) => {\n\tlet currentSelection = selector(store.getState());\n\n\treturn store.subscribe((state) => {\n\t\tconst nextSelection = selector(state);\n\t\tif (Object.is(nextSelection, currentSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcurrentSelection = nextSelection;\n\t\tlistener(nextSelection);\n\t});\n};\n",
|
|
9
14
|
"import {\n\tcreateContext,\n\tuseContext,\n\tuseSyncExternalStore,\n\ttype Provider\n} from 'react';\nimport { Breakpoint, Breakpoints } from '../../../types/mediaQuery';\nimport { UserAgentType } from '../../../types/userAgentTypes';\n\nconst UserAgentContext = createContext<UserAgentType | null>(null);\n\n// eslint-disable-next-line absolute/no-redundant-type-annotation -- Keep a stable named declaration; inferred union order varies between builds.\nexport const UserAgentProvider: Provider<UserAgentType | null> =\n\tUserAgentContext.Provider;\n\nconst useUserAgentType = () => {\n\tconst context = useContext(UserAgentContext);\n\tif (context === null) {\n\t\tthrow new Error(\n\t\t\t'useMediaQuery must be used within a UserAgentProvider'\n\t\t);\n\t}\n\n\treturn context;\n};\n\nconst defaultBreakpoints: Breakpoints = {\n\t'2xl': 1536,\n\tlg: 1024,\n\tmd: 768,\n\tsm: 640,\n\txl: 1280,\n\txs: 0\n};\n\nconst userAgentInitialWidth: Record<UserAgentType, number> = {\n\tbot: 1024,\n\tcar: 768,\n\tconsole: 1024,\n\tdesktop: 1024,\n\tiot: 640,\n\tother: 768,\n\tphone: 375,\n\ttablet: 768,\n\ttv: 1280\n};\n\nconst subscribers = new Set<() => void>();\nlet width = typeof window !== 'undefined' ? window.innerWidth : 0;\nlet isListening = false;\n\nconst ensureListener = () => {\n\tif (isListening || typeof window === 'undefined') return;\n\tisListening = true;\n\n\tlet isTicking = false;\n\tconst onResize = () => {\n\t\tif (isTicking) return;\n\t\tisTicking = true;\n\t\trequestAnimationFrame(() => {\n\t\t\tisTicking = false;\n\t\t\twidth = window.innerWidth;\n\t\t\tsubscribers.forEach((notify) => notify());\n\t\t});\n\t};\n\n\twindow.addEventListener('resize', onResize, { passive: true });\n};\n\nconst subscribe = (callback: () => void) => {\n\tensureListener();\n\tsubscribers.add(callback);\n\n\treturn () => subscribers.delete(callback);\n};\n\nconst getViewportWidth = () => width;\n\nconst computeBreakpoint = (widthValue: number, breakpoints: Breakpoints) => {\n\tif (widthValue < breakpoints.sm) return 'xs';\n\tif (widthValue < breakpoints.md) return 'sm';\n\tif (widthValue < breakpoints.lg) return 'md';\n\tif (widthValue < breakpoints.xl) return 'lg';\n\tif (widthValue < breakpoints['2xl']) return 'xl';\n\n\treturn '2xl';\n};\n\nexport const useMediaQuery = (\n\tcustomBreakpoints: Breakpoints = defaultBreakpoints\n) => {\n\tconst userAgentType = useUserAgentType();\n\tconst getServerWidth = () => userAgentInitialWidth[userAgentType];\n\n\tconst currentWidth = useSyncExternalStore(\n\t\tsubscribe,\n\t\tgetViewportWidth,\n\t\tgetServerWidth\n\t);\n\n\tconst breakpoint = computeBreakpoint(currentWidth, customBreakpoints);\n\n\tconst isSizeOrGreater = (target: Breakpoint) =>\n\t\tcustomBreakpoints[breakpoint] >= customBreakpoints[target];\n\n\tconst isSizeOrLess = (target: Breakpoint) =>\n\t\tcustomBreakpoints[breakpoint] <= customBreakpoints[target];\n\n\treturn { breakpoint, isSizeOrGreater, isSizeOrLess };\n};\n",
|
|
10
15
|
"import { useCallback, useEffect, useRef } from 'react';\nimport type {\n\tHoverPrefetchHandle,\n\tPrefetchKind,\n\tPrefetchMode\n} from '../../../types/prefetch';\nimport {\n\tisPrefetchableHref,\n\tobserveViewport,\n\tprefetch,\n\tresolveDefaultPrefetchMode,\n\tscheduleHoverPrefetch,\n\tspeculate\n} from '../../client/prefetch';\n\nexport type UsePrefetchOptions = {\n\t/** `'viewport'` (production default), `'hover'` (development default)\n\t * or `'none'`. */\n\tmode?: PrefetchMode;\n\t/** What to warm. Defaults to `'document'` for the viewport trigger and\n\t * `'route'` (document + route data + the modules / CSS it names) for\n\t * hover and pointerdown. */\n\tkind?: PrefetchKind;\n\t/** Also inject a prerender speculation rule when the hover /\n\t * pointerdown trigger fires. */\n\tprerender?: boolean;\n};\n\n/**\n * Prefetch `href` when the returned handlers fire. Spread the handlers on\n * any element and attach `ref` to it for viewport-triggered prefetching:\n *\n * const { ref, ...prefetchHandlers } = usePrefetch('/pricing');\n * <a href=\"/pricing\" ref={ref} {...prefetchHandlers}>Pricing</a>\n *\n * Cross-origin, hash-only and empty hrefs are ignored, as is everything\n * when the user has data-saver on or the page set\n * `window.__ABSOLUTE_PREFETCH__ = false`.\n */\nexport const usePrefetch = <TElement extends HTMLElement = HTMLElement>(\n\thref: string | undefined,\n\toptions: UsePrefetchOptions = {}\n) => {\n\tconst { kind, mode, prerender = false } = options;\n\tconst viewportKind = kind ?? 'document';\n\tconst triggerKind = kind ?? 'route';\n\tconst elementRef = useRef<TElement | null>(null);\n\tconst hoverHandle = useRef<HoverPrefetchHandle | null>(null);\n\n\tconst cancelHover = useCallback(() => {\n\t\thoverHandle.current?.cancel();\n\t\thoverHandle.current = null;\n\t}, []);\n\n\tconst isActive = useCallback(() => {\n\t\tif (href === undefined || !isPrefetchableHref(href)) return false;\n\t\tconst resolved = mode ?? resolveDefaultPrefetchMode();\n\n\t\treturn resolved !== 'none';\n\t}, [href, mode]);\n\n\tuseEffect(() => {\n\t\tconst element = elementRef.current;\n\t\tif (!element || href === undefined || !isActive()) return undefined;\n\t\tconst resolved = mode ?? resolveDefaultPrefetchMode();\n\t\tif (resolved !== 'viewport') return undefined;\n\n\t\treturn observeViewport(element, href, { kind: viewportKind });\n\t}, [href, isActive, mode, viewportKind]);\n\n\tuseEffect(() => cancelHover, [cancelHover]);\n\n\tconst onPointerEnter = useCallback(() => {\n\t\tif (href === undefined || !isActive()) return;\n\t\tcancelHover();\n\t\thoverHandle.current = scheduleHoverPrefetch(href, {\n\t\t\tkind: triggerKind,\n\t\t\tprerender\n\t\t});\n\t}, [cancelHover, href, isActive, prerender, triggerKind]);\n\n\tconst onPointerDown = useCallback(() => {\n\t\tif (href === undefined || !isActive()) return;\n\t\tcancelHover();\n\t\tprefetch(href, { kind: triggerKind });\n\t\tif (prerender) speculate(href);\n\t}, [cancelHover, href, isActive, prerender, triggerKind]);\n\n\treturn {\n\t\tonBlur: cancelHover,\n\t\tonFocus: onPointerEnter,\n\t\tonPointerDown,\n\t\tonPointerEnter,\n\t\tonPointerLeave: cancelHover,\n\t\tref: elementRef\n\t};\n};\n",
|
|
11
|
-
"/**\n * Framework-neutral navigation prefetch primitive.\n *\n * Pure DOM + `fetch` — no framework imports — so the React, Vue and Svelte\n * `<Link>` components (and user code) share one cache, one in-flight\n * budget, one IntersectionObserver and one set of data-saver guards.\n *\n * import { prefetch, speculate } from '@absolutejs/absolute/client/prefetch';\n *\n * What a prefetch buys the click that follows:\n * - `'document'` — the HTML lands in the browser's HTTP cache (pages\n * carry a content-hash `ETag`), so the real navigation revalidates\n * with a 304 instead of re-rendering.\n * - `'module'` — `<link rel=\"modulepreload\">` parses + compiles the\n * client module graph ahead of time.\n * - `'data'` — the route-data payload\n * (`application/vnd.absolute.route+json`): the page's props plus the\n * client entry and stylesheets it needs, which are `modulepreload`ed\n * / prefetched as the payload lands. A 404 / 406 from a server that\n * doesn't speak route data is remembered as \"no data\".\n * - `'route'` — `'document'` + `'data'`, i.e. everything a click\n * needs. What a `<Link>` warms on hover / pointerdown.\n * - `speculate()` — a prerender speculation rule; the browser renders\n * the whole target page in a hidden tab so the click is instant.\n *\n * Global opt-out: `window.__ABSOLUTE_PREFETCH__ = false` disables every\n * entry point in this module (useful for analytics-sensitive pages).\n */\nimport type {\n\tHoverPrefetchHandle,\n\tHoverPrefetchOptions,\n\tPrefetchKind,\n\tPrefetchOptions\n} from '../../types/prefetch';\n\nconst PREFETCH_CACHE_LIMIT = 16;\nconst HOVER_DEBOUNCE_MS = 250;\nconst MAX_IN_FLIGHT = 2;\nconst MAX_LIVE_SPECULATION_RULES = 2;\nconst VIEWPORT_ROOT_MARGIN = '128px';\nconst SLOW_EFFECTIVE_TYPES = new Set(['slow-2g', '2g']);\nconst NOT_FOUND = 404;\nconst NOT_ACCEPTABLE = 406;\n\nexport const ROUTE_DATA_MEDIA_TYPE = 'application/vnd.absolute.route+json';\n\ntype CacheEntry = {\n\tabort: () => void;\n\tkind: PrefetchKind;\n\tpromise: Promise<Response>;\n\turl: string;\n};\n\ntype QueuedTask = {\n\tcancelled: boolean;\n\tstart: () => void;\n};\n\nconst cache = new Map<string, CacheEntry>();\nconst queue: QueuedTask[] = [];\nlet inFlight = 0;\n\nconst preloadedModules = new Set<string>();\nconst prefetchedStyles = new Set<string>();\nconst liveSpeculationRules = new Map<string, HTMLScriptElement>();\n\nconst offlineResponse = () => new Response(null, { status: 0 });\n\n/** `'route'` is a compound trigger, not a cache entry of its own: it\n * warms the `'document'` and `'data'` entries, so lookups for it read\n * the document it warmed. */\nconst storageKind = (kind: PrefetchKind) =>\n\tkind === 'route' ? 'document' : kind;\n\nconst cacheKey = (kind: PrefetchKind, url: string) =>\n\t`${storageKind(kind)}:${url}`;\n\nconst resolveHref = (url: string) => {\n\tif (typeof window === 'undefined') return url;\n\n\ttry {\n\t\treturn new URL(url, window.location.href).href;\n\t} catch {\n\t\treturn url;\n\t}\n};\n\n/* ------------------------------------------------------------------ */\n/* Guards */\n/* ------------------------------------------------------------------ */\n\nconst isGloballyDisabled = () =>\n\ttypeof window !== 'undefined' &&\n\tReflect.get(window, '__ABSOLUTE_PREFETCH__') === false;\n\nconst isSlowConnection = () => {\n\tif (typeof navigator === 'undefined') return false;\n\n\tconst connection = Reflect.get(navigator, 'connection');\n\tif (typeof connection !== 'object' || connection === null) return false;\n\tif (Reflect.get(connection, 'saveData') === true) return true;\n\n\tconst effectiveType = Reflect.get(connection, 'effectiveType');\n\n\treturn (\n\t\ttypeof effectiveType === 'string' &&\n\t\tSLOW_EFFECTIVE_TYPES.has(effectiveType)\n\t);\n};\n\nconst prefersReducedData = () => {\n\tif (typeof window === 'undefined' || !window.matchMedia) return false;\n\n\treturn window.matchMedia('(prefers-reduced-data: reduce)').matches;\n};\n\n/** `true` when prefetching is allowed right now: we're in a browser, the\n * page hasn't opted out via `window.__ABSOLUTE_PREFETCH__ = false`, and\n * the user hasn't asked for less data (Save-Data, 2g, reduced-data). */\nexport const canPrefetch = () =>\n\ttypeof window !== 'undefined' &&\n\t!isGloballyDisabled() &&\n\t!isSlowConnection() &&\n\t!prefersReducedData();\n\nconst readNodeEnv = () => {\n\t// Deliberately not the bare `process.env.NODE_ENV` member expression:\n\t// bundlers substitute that at build time, which would bake this\n\t// package's own build environment into the shipped client entry. In a\n\t// browser `process` is undefined and this yields `undefined`.\n\tconst processLike = Reflect.get(globalThis, 'process');\n\tif (typeof processLike !== 'object' || processLike === null) {\n\t\treturn undefined;\n\t}\n\tconst env = Reflect.get(processLike, 'env');\n\tif (typeof env !== 'object' || env === null) return undefined;\n\tconst value = Reflect.get(env, 'NODE_ENV');\n\n\treturn typeof value === 'string' ? value : undefined;\n};\n\n/** Whether the page was served by the AbsoluteJS dev server. The HMR\n * client is only injected in dev, so its markers are the reliable\n * signal; `NODE_ENV` is the fallback for environments that bundle\n * without the dev server (tests, custom hosts). */\nexport const isDevelopmentClient = () => {\n\tif (typeof window === 'undefined') return false;\n\tif (Reflect.get(window, '__HMR_FRAMEWORK__') !== undefined) return true;\n\tif (Reflect.get(window, '__HMR_WS__') !== undefined) return true;\n\tif (\n\t\ttypeof document !== 'undefined' &&\n\t\tdocument.querySelector('script[data-hmr-client]') !== null\n\t) {\n\t\treturn true;\n\t}\n\n\treturn readNodeEnv() === 'development';\n};\n\n/** Same-origin, non-hash, http(s) URL — the only kind worth prefetching. */\nexport const isPrefetchableHref = (href: string) => {\n\tif (typeof window === 'undefined') return false;\n\tif (href === '' || href.startsWith('#')) return false;\n\n\ttry {\n\t\tconst url = new URL(href, window.location.href);\n\t\tif (url.protocol !== 'http:' && url.protocol !== 'https:') return false;\n\n\t\treturn url.origin === window.location.origin;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** Production → `'viewport'` (viewport + hover). Development → `'hover'`\n * only, so a page full of links doesn't fan out into the dev server. */\nexport const resolveDefaultPrefetchMode = () =>\n\tisDevelopmentClient() ? 'hover' : 'viewport';\n\n/* ------------------------------------------------------------------ */\n/* In-flight budget */\n/* ------------------------------------------------------------------ */\n\nconst runQueue = () => {\n\twhile (inFlight < MAX_IN_FLIGHT) {\n\t\tconst next = queue.shift();\n\t\tif (!next) return;\n\t\tif (next.cancelled) continue;\n\t\tnext.start();\n\t}\n};\n\nconst finishTask = () => {\n\tinFlight = Math.max(0, inFlight - 1);\n\trunQueue();\n};\n\n/** Run `task` when one of the `MAX_IN_FLIGHT` slots frees up. The\n * returned promise never rejects — network failures resolve to a\n * status-0 response so consumers can treat \"no prefetch\" uniformly. */\nconst runWhenReleased = async (\n\tgate: Promise<void>,\n\ttask: (signal: AbortSignal) => Promise<Response>,\n\tsignal: AbortSignal\n) => {\n\tawait gate;\n\ttry {\n\t\treturn await task(signal);\n\t} catch {\n\t\treturn offlineResponse();\n\t} finally {\n\t\tfinishTask();\n\t}\n};\n\nconst enqueue = (task: (signal: AbortSignal) => Promise<Response>) => {\n\tconst controller = new AbortController();\n\tlet release: () => void = () => undefined;\n\tconst gate = new Promise<void>((resolve) => {\n\t\trelease = resolve;\n\t});\n\tconst queued: QueuedTask = {\n\t\tcancelled: false,\n\t\tstart: () => {\n\t\t\t// Count the slot synchronously so `runQueue` can't overshoot the\n\t\t\t// budget while the async runner is still waiting on the gate.\n\t\t\tinFlight += 1;\n\t\t\trelease();\n\t\t}\n\t};\n\tconst promise = runWhenReleased(gate, task, controller.signal);\n\tqueue.push(queued);\n\trunQueue();\n\n\tconst abort = () => {\n\t\tif (queued.cancelled) return;\n\t\tqueued.cancelled = true;\n\t\tcontroller.abort();\n\t};\n\n\treturn { abort, promise };\n};\n\n/* ------------------------------------------------------------------ */\n/* Cache */\n/* ------------------------------------------------------------------ */\n\nconst evictOldest = () => {\n\tconst oldest = cache.keys().next();\n\tif (oldest.done) return;\n\tcache.get(oldest.value)?.abort();\n\tcache.delete(oldest.value);\n};\n\nconst touch = (key: string, entry: CacheEntry) => {\n\t// Re-insert so Map iteration order doubles as LRU recency.\n\tcache.delete(key);\n\tcache.set(key, entry);\n};\n\nexport const clearPrefetchCache = () => {\n\tfor (const entry of cache.values()) entry.abort();\n\tcache.clear();\n};\n\n/** Take the prefetched response for `url` out of the cache. Returns\n * `undefined` when nothing was prefetched (or it was evicted). Callers\n * that fetch the same URL themselves can await this instead. */\nexport const consumePrefetch = (\n\turl: string,\n\tkind: PrefetchKind = 'document'\n) => {\n\tconst key = cacheKey(kind, url);\n\tconst entry = cache.get(key);\n\tif (!entry) return undefined;\n\tcache.delete(key);\n\n\treturn entry.promise;\n};\n\n/** Whether `url` is already prefetched (in flight, queued or settled). */\nexport const hasPrefetched = (url: string, kind: PrefetchKind = 'document') =>\n\tcache.has(cacheKey(kind, url));\n\n/* ------------------------------------------------------------------ */\n/* Kinds */\n/* ------------------------------------------------------------------ */\n\nconst injectLink = (rel: string, href: string, asType?: string) => {\n\tif (typeof document === 'undefined') return;\n\tconst link = document.createElement('link');\n\tlink.rel = rel;\n\tlink.href = href;\n\tif (asType) link.setAttribute('as', asType);\n\tdocument.head.append(link);\n};\n\n/** Without `fetch` (very old engines) fall back to a `<link rel=\"prefetch\">`\n * for documents; other kinds have no declarative equivalent. */\nconst injectPrefetchFallback = (kind: PrefetchKind, url: string) => {\n\tif (kind !== 'document' || !supportsLinkRel('prefetch')) return;\n\tinjectLink('prefetch', url, 'document');\n};\n\nconst supportsLinkRel = (rel: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst link = document.createElement('link');\n\n\treturn (\n\t\ttypeof link.relList?.supports === 'function' &&\n\t\tlink.relList.supports(rel)\n\t);\n};\n\n/** Inject `<link rel=\"prefetch\" as=\"style\">` once per resolved href, so\n * the target page's stylesheets are in the HTTP cache before the click.\n * `prefetch` rather than `preload`: the sheet is for the NEXT document,\n * so preloading it would warn about an unused preload on this one. */\nexport const prefetchStylesheet = (href: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst resolved = resolveHref(href);\n\tif (prefetchedStyles.has(resolved)) return false;\n\tprefetchedStyles.add(resolved);\n\t// No `relList.supports` gate: a browser that doesn't know `prefetch`\n\t// simply ignores the tag, and there is no fallback worth branching to.\n\tinjectLink('prefetch', href, 'style');\n\n\treturn true;\n};\n\n/** Inject `<link rel=\"modulepreload\">` once per resolved href. Returns\n * `true` when a new tag was added. */\nexport const preloadModule = (href: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst resolved = resolveHref(href);\n\tif (preloadedModules.has(resolved)) return false;\n\n\tconst existing = Array.from(\n\t\tdocument.querySelectorAll<HTMLLinkElement>('link[rel=\"modulepreload\"]')\n\t);\n\tif (existing.some((link) => resolveHref(link.href) === resolved)) {\n\t\tpreloadedModules.add(resolved);\n\n\t\treturn false;\n\t}\n\n\tpreloadedModules.add(resolved);\n\tinjectLink('modulepreload', href);\n\n\treturn true;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isHref = (value: unknown): value is string =>\n\ttypeof value === 'string' && value.length > 0;\n\n/** Warm what a route-data envelope points at: `modulepreload` for the\n * page's client entry (and a separate client module when it has one),\n * `<link rel=\"prefetch\">` for its stylesheets. Anything unexpected in\n * the payload is ignored — a prefetch must never break a page. */\nconst warmRouteDataAssets = (envelope: unknown) => {\n\tif (!isRecord(envelope)) return;\n\tconst { assets } = envelope;\n\tif (!isRecord(assets)) return;\n\tconst { client, css, index } = assets;\n\tfor (const href of [index, client].filter(isHref)) preloadModule(href);\n\tif (!Array.isArray(css)) return;\n\tfor (const href of css.filter(isHref)) prefetchStylesheet(href);\n};\n\n/** Read the envelope out of a clone so the cached response body is still\n * unconsumed for whoever calls `consumePrefetch`. */\nconst warmFromRouteData = async (response: Response) => {\n\ttry {\n\t\twarmRouteDataAssets(await response.clone().json());\n\t} catch {\n\t\t/* malformed payload — the document prefetch still stands */\n\t}\n\n\treturn response;\n};\n\nconst fetchDocument = (url: string, signal: AbortSignal) =>\n\tfetch(url, { credentials: 'same-origin', signal });\n\nconst fetchRouteData = async (url: string, signal: AbortSignal) => {\n\tconst response = await fetch(url, {\n\t\tcredentials: 'same-origin',\n\t\theaders: { Accept: ROUTE_DATA_MEDIA_TYPE },\n\t\tsignal\n\t});\n\tconst contentType = response.headers.get('content-type') ?? '';\n\tconst isRouteData =\n\t\tresponse.ok && contentType.includes(ROUTE_DATA_MEDIA_TYPE);\n\tif (isRouteData) return warmFromRouteData(response);\n\n\t// The server doesn't speak route data (yet) — 404 / 406 / HTML fallback.\n\t// Remember that as \"no data\" so the URL isn't asked again, and drain\n\t// the body so the connection can be reused.\n\tawait response.body?.cancel().catch(() => undefined);\n\tconst status =\n\t\tresponse.status === NOT_FOUND || response.status === NOT_ACCEPTABLE\n\t\t\t? response.status\n\t\t\t: NOT_ACCEPTABLE;\n\n\treturn new Response(null, { status });\n};\n\n/**\n * Prefetch `url`. No-op when the user signalled data-saver / reduced-data\n * / 2g, when the page opted out, or when the URL is already cached. At\n * most two prefetches are in flight at once; the rest queue in order.\n */\nexport const prefetch = (url: string, options: PrefetchOptions = {}) => {\n\tconst kind = options.kind ?? 'document';\n\tif (!canPrefetch()) return;\n\n\tif (kind === 'module') {\n\t\tpreloadModule(url);\n\n\t\treturn;\n\t}\n\n\t// `'route'` is document + data: the HTML for the navigation itself and\n\t// the payload that names the modules and CSS to warm alongside it.\n\tif (kind === 'route') {\n\t\tprefetch(url, { kind: 'document' });\n\t\tprefetch(url, { kind: 'data' });\n\n\t\treturn;\n\t}\n\n\tconst key = cacheKey(kind, url);\n\tconst existing = cache.get(key);\n\tif (existing) {\n\t\ttouch(key, existing);\n\n\t\treturn;\n\t}\n\n\tif (typeof fetch === 'undefined') {\n\t\tinjectPrefetchFallback(kind, url);\n\n\t\treturn;\n\t}\n\n\twhile (cache.size >= PREFETCH_CACHE_LIMIT) evictOldest();\n\n\tconst { abort, promise } = enqueue((signal) =>\n\t\tkind === 'data'\n\t\t\t? fetchRouteData(url, signal)\n\t\t\t: fetchDocument(url, signal)\n\t);\n\tcache.set(key, { abort, kind, promise, url });\n};\n\n/* ------------------------------------------------------------------ */\n/* Speculation rules */\n/* ------------------------------------------------------------------ */\n\nconst supportsSpeculationRules = () =>\n\ttypeof HTMLScriptElement !== 'undefined' &&\n\ttypeof HTMLScriptElement.supports === 'function' &&\n\tHTMLScriptElement.supports('speculationrules');\n\n/**\n * Ask the browser to prerender `url` right away via a speculation-rules\n * script. Deduped per URL and capped to two live rules — the oldest is\n * removed when a third arrives, so a hover trail can't pile up hidden\n * prerendered tabs. Silently no-ops where the API is unsupported.\n */\nexport const speculate = (url: string) => {\n\tif (!canPrefetch() || !supportsSpeculationRules()) return false;\n\tif (typeof document === 'undefined') return false;\n\n\tconst resolved = resolveHref(url);\n\tif (liveSpeculationRules.has(resolved)) return false;\n\n\twhile (liveSpeculationRules.size >= MAX_LIVE_SPECULATION_RULES) {\n\t\tconst oldest = liveSpeculationRules.keys().next();\n\t\tif (oldest.done) break;\n\t\tliveSpeculationRules.get(oldest.value)?.remove();\n\t\tliveSpeculationRules.delete(oldest.value);\n\t}\n\n\tconst script = document.createElement('script');\n\tscript.type = 'speculationrules';\n\tscript.textContent = JSON.stringify({\n\t\tprerender: [{ eagerness: 'immediate', urls: [url] }]\n\t});\n\tdocument.head.append(script);\n\tliveSpeculationRules.set(resolved, script);\n\n\treturn true;\n};\n\n/* ------------------------------------------------------------------ */\n/* Triggers */\n/* ------------------------------------------------------------------ */\n\nconst noopHandle: HoverPrefetchHandle = {\n\tcancel: () => {\n\t\t/* nothing scheduled */\n\t}\n};\n\n/**\n * Wrap a prefetch trigger in a hover-debounce so glancing across many links\n * doesn't fire a fetch storm. The returned handle's `cancel()` aborts the\n * pending hover prefetch (e.g. on `pointerleave`).\n *\n * Defaults to `kind: 'route'` — a hover is deliberate enough to be worth\n * the document AND the route data (and the modules + CSS that payload\n * names). Viewport prefetching stays document-only.\n */\nexport const scheduleHoverPrefetch = (\n\turl: string,\n\toptions: HoverPrefetchOptions = {}\n): HoverPrefetchHandle => {\n\tif (typeof window === 'undefined') return noopHandle;\n\n\tconst timer = window.setTimeout(() => {\n\t\tprefetch(url, { kind: options.kind ?? 'route' });\n\t\tif (options.prerender) speculate(url);\n\t}, HOVER_DEBOUNCE_MS);\n\n\treturn {\n\t\tcancel: () => window.clearTimeout(timer)\n\t};\n};\n\ntype ViewportTarget = {\n\toptions: PrefetchOptions;\n\turl: string;\n};\n\nconst viewportTargets = new WeakMap<Element, ViewportTarget>();\nlet viewportObserver: IntersectionObserver | null = null;\n\nconst handleIntersections = (entries: IntersectionObserverEntry[]) => {\n\tfor (const entry of entries) {\n\t\tif (!entry.isIntersecting) continue;\n\t\tconst target = viewportTargets.get(entry.target);\n\t\tviewportObserver?.unobserve(entry.target);\n\t\tviewportTargets.delete(entry.target);\n\t\tif (target) prefetch(target.url, target.options);\n\t}\n};\n\nconst getViewportObserver = () => {\n\tif (viewportObserver) return viewportObserver;\n\tif (typeof IntersectionObserver === 'undefined') return null;\n\tviewportObserver = new IntersectionObserver(handleIntersections, {\n\t\trootMargin: VIEWPORT_ROOT_MARGIN\n\t});\n\n\treturn viewportObserver;\n};\n\n/**\n * Prefetch `url` once `element` scrolls within 128px of the viewport. One\n * IntersectionObserver is shared by every link on the page. Returns an\n * unobserve function for the caller's unmount hook.\n */\nexport const observeViewport = (\n\telement: Element,\n\turl: string,\n\toptions: PrefetchOptions = {}\n) => {\n\tconst observer = getViewportObserver();\n\tif (!observer || !canPrefetch()) return () => undefined;\n\n\tviewportTargets.set(element, { options, url });\n\tobserver.observe(element);\n\n\treturn () => {\n\t\tobserver.unobserve(element);\n\t\tviewportTargets.delete(element);\n\t};\n};\n\n/** Test / teardown helper — forgets injected modulepreload + speculation\n * rule bookkeeping and cancels any queued fetches. */\nexport const resetPrefetchState = () => {\n\tclearPrefetchCache();\n\tqueue.length = 0;\n\tpreloadedModules.clear();\n\tprefetchedStyles.clear();\n\tfor (const script of liveSpeculationRules.values()) script.remove();\n\tliveSpeculationRules.clear();\n\tviewportObserver?.disconnect();\n\tviewportObserver = null;\n};\n"
|
|
16
|
+
"/* The page's CSP nonce, read back in the browser from an element the server\n * gave it to. Browsers hide the attribute's value but keep the `nonce`\n * property, so a script that runs can hand the nonce to the <style>/<script>\n * elements it creates; a nonce-based policy blocks them otherwise. Without\n * secureHeaders() there is no nonce and this does nothing.\n *\n * Lives in the dev client because that ships as raw TypeScript and may only\n * import from its own directory; the bundled client runtime\n * (src/client/prefetch.ts) imports it from here. */\n\nexport const applyPageNonce = <Element extends HTMLElement>(\n\telement: Element\n) => {\n\tconst nonce = readPageNonce();\n\tif (nonce) element.nonce = nonce;\n\n\treturn element;\n};\n\nexport const readPageNonce = () => {\n\tif (typeof document === 'undefined') return undefined;\n\tconst carrier = document.querySelector<HTMLElement>(\n\t\t'script[nonce], style[nonce]'\n\t);\n\n\treturn carrier?.nonce || undefined;\n};\n",
|
|
17
|
+
"/**\n * Framework-neutral navigation prefetch primitive.\n *\n * Pure DOM + `fetch` — no framework imports — so the React, Vue and Svelte\n * `<Link>` components (and user code) share one cache, one in-flight\n * budget, one IntersectionObserver and one set of data-saver guards.\n *\n * import { prefetch, speculate } from '@absolutejs/absolute/client/prefetch';\n *\n * What a prefetch buys the click that follows:\n * - `'document'` — the HTML lands in the browser's HTTP cache (pages\n * carry a content-hash `ETag`), so the real navigation revalidates\n * with a 304 instead of re-rendering.\n * - `'module'` — `<link rel=\"modulepreload\">` parses + compiles the\n * client module graph ahead of time.\n * - `'data'` — the route-data payload\n * (`application/vnd.absolute.route+json`): the page's props plus the\n * client entry and stylesheets it needs, which are `modulepreload`ed\n * / prefetched as the payload lands. A 404 / 406 from a server that\n * doesn't speak route data is remembered as \"no data\".\n * - `'route'` — `'document'` + `'data'`, i.e. everything a click\n * needs. What a `<Link>` warms on hover / pointerdown.\n * - `speculate()` — a prerender speculation rule; the browser renders\n * the whole target page in a hidden tab so the click is instant.\n *\n * Global opt-out: `window.__ABSOLUTE_PREFETCH__ = false` disables every\n * entry point in this module (useful for analytics-sensitive pages).\n */\nimport { applyPageNonce } from '../dev/client/cspNonce';\nimport type {\n\tHoverPrefetchHandle,\n\tHoverPrefetchOptions,\n\tPrefetchKind,\n\tPrefetchOptions,\n\tViewportPrefetchOptions\n} from '../../types/prefetch';\n\nconst PREFETCH_CACHE_LIMIT = 16;\nconst HOVER_DEBOUNCE_MS = 250;\nconst MAX_IN_FLIGHT = 2;\nconst MAX_LIVE_SPECULATION_RULES = 2;\nconst VIEWPORT_ROOT_MARGIN = '128px';\nconst SLOW_EFFECTIVE_TYPES = new Set(['slow-2g', '2g']);\nconst NOT_FOUND = 404;\nconst NOT_ACCEPTABLE = 406;\n\nexport const ROUTE_DATA_MEDIA_TYPE = 'application/vnd.absolute.route+json';\n\ntype CacheEntry = {\n\tabort: () => void;\n\tkind: PrefetchKind;\n\tpromise: Promise<Response>;\n\turl: string;\n};\n\ntype QueuedTask = {\n\tcancelled: boolean;\n\tstart: () => void;\n};\n\nconst cache = new Map<string, CacheEntry>();\nconst queue: QueuedTask[] = [];\nlet inFlight = 0;\n\nconst preloadedModules = new Set<string>();\nconst prefetchedStyles = new Set<string>();\nconst liveSpeculationRules = new Map<string, HTMLScriptElement>();\n\nconst offlineResponse = () => new Response(null, { status: 0 });\n\n/** `'route'` is a compound trigger, not a cache entry of its own: it\n * warms the `'document'` and `'data'` entries, so lookups for it read\n * the document it warmed. */\nconst storageKind = (kind: PrefetchKind) =>\n\tkind === 'route' ? 'document' : kind;\n\nconst cacheKey = (kind: PrefetchKind, url: string) =>\n\t`${storageKind(kind)}:${url}`;\n\nconst resolveHref = (url: string) => {\n\tif (typeof window === 'undefined') return url;\n\n\ttry {\n\t\treturn new URL(url, window.location.href).href;\n\t} catch {\n\t\treturn url;\n\t}\n};\n\n/* ------------------------------------------------------------------ */\n/* Guards */\n/* ------------------------------------------------------------------ */\n\nconst isGloballyDisabled = () =>\n\ttypeof window !== 'undefined' &&\n\tReflect.get(window, '__ABSOLUTE_PREFETCH__') === false;\n\nconst isSlowConnection = () => {\n\tif (typeof navigator === 'undefined') return false;\n\n\tconst connection = Reflect.get(navigator, 'connection');\n\tif (typeof connection !== 'object' || connection === null) return false;\n\tif (Reflect.get(connection, 'saveData') === true) return true;\n\n\tconst effectiveType = Reflect.get(connection, 'effectiveType');\n\n\treturn (\n\t\ttypeof effectiveType === 'string' &&\n\t\tSLOW_EFFECTIVE_TYPES.has(effectiveType)\n\t);\n};\n\nconst prefersReducedData = () => {\n\tif (typeof window === 'undefined' || !window.matchMedia) return false;\n\n\treturn window.matchMedia('(prefers-reduced-data: reduce)').matches;\n};\n\n/** `true` when prefetching is allowed right now: we're in a browser, the\n * page hasn't opted out via `window.__ABSOLUTE_PREFETCH__ = false`, and\n * the user hasn't asked for less data (Save-Data, 2g, reduced-data). */\nexport const canPrefetch = () =>\n\ttypeof window !== 'undefined' &&\n\t!isGloballyDisabled() &&\n\t!isSlowConnection() &&\n\t!prefersReducedData();\n\nconst readNodeEnv = () => {\n\t// Deliberately not the bare `process.env.NODE_ENV` member expression:\n\t// bundlers substitute that at build time, which would bake this\n\t// package's own build environment into the shipped client entry. In a\n\t// browser `process` is undefined and this yields `undefined`.\n\tconst processLike = Reflect.get(globalThis, 'process');\n\tif (typeof processLike !== 'object' || processLike === null) {\n\t\treturn undefined;\n\t}\n\tconst env = Reflect.get(processLike, 'env');\n\tif (typeof env !== 'object' || env === null) return undefined;\n\tconst value = Reflect.get(env, 'NODE_ENV');\n\n\treturn typeof value === 'string' ? value : undefined;\n};\n\n/** Whether the page was served by the AbsoluteJS dev server. The HMR\n * client is only injected in dev, so its markers are the reliable\n * signal; `NODE_ENV` is the fallback for environments that bundle\n * without the dev server (tests, custom hosts). */\nexport const isDevelopmentClient = () => {\n\tif (typeof window === 'undefined') return false;\n\tif (Reflect.get(window, '__HMR_FRAMEWORK__') !== undefined) return true;\n\tif (Reflect.get(window, '__HMR_WS__') !== undefined) return true;\n\tif (\n\t\ttypeof document !== 'undefined' &&\n\t\tdocument.querySelector('script[data-hmr-client]') !== null\n\t) {\n\t\treturn true;\n\t}\n\n\treturn readNodeEnv() === 'development';\n};\n\n/** Same-origin, non-hash, http(s) URL — the only kind worth prefetching. */\nexport const isPrefetchableHref = (href: string) => {\n\tif (typeof window === 'undefined') return false;\n\tif (href === '' || href.startsWith('#')) return false;\n\n\ttry {\n\t\tconst url = new URL(href, window.location.href);\n\t\tif (url.protocol !== 'http:' && url.protocol !== 'https:') return false;\n\n\t\treturn url.origin === window.location.origin;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** Production → `'viewport'` (viewport + hover). Development → `'hover'`\n * only, so a page full of links doesn't fan out into the dev server. */\nexport const resolveDefaultPrefetchMode = () =>\n\tisDevelopmentClient() ? 'hover' : 'viewport';\n\n/* ------------------------------------------------------------------ */\n/* In-flight budget */\n/* ------------------------------------------------------------------ */\n\nconst runQueue = () => {\n\twhile (inFlight < MAX_IN_FLIGHT) {\n\t\tconst next = queue.shift();\n\t\tif (!next) return;\n\t\tif (next.cancelled) continue;\n\t\tnext.start();\n\t}\n};\n\nconst finishTask = () => {\n\tinFlight = Math.max(0, inFlight - 1);\n\trunQueue();\n};\n\n/** Run `task` when one of the `MAX_IN_FLIGHT` slots frees up. The\n * returned promise never rejects — network failures resolve to a\n * status-0 response so consumers can treat \"no prefetch\" uniformly. */\nconst runWhenReleased = async (\n\tgate: Promise<void>,\n\ttask: (signal: AbortSignal) => Promise<Response>,\n\tsignal: AbortSignal\n) => {\n\tawait gate;\n\ttry {\n\t\treturn await task(signal);\n\t} catch {\n\t\treturn offlineResponse();\n\t} finally {\n\t\tfinishTask();\n\t}\n};\n\nconst enqueue = (task: (signal: AbortSignal) => Promise<Response>) => {\n\tconst controller = new AbortController();\n\tlet release: () => void = () => undefined;\n\tconst gate = new Promise<void>((resolve) => {\n\t\trelease = resolve;\n\t});\n\tconst queued: QueuedTask = {\n\t\tcancelled: false,\n\t\tstart: () => {\n\t\t\t// Count the slot synchronously so `runQueue` can't overshoot the\n\t\t\t// budget while the async runner is still waiting on the gate.\n\t\t\tinFlight += 1;\n\t\t\trelease();\n\t\t}\n\t};\n\tconst promise = runWhenReleased(gate, task, controller.signal);\n\tqueue.push(queued);\n\trunQueue();\n\n\tconst abort = () => {\n\t\tif (queued.cancelled) return;\n\t\tqueued.cancelled = true;\n\t\tcontroller.abort();\n\t};\n\n\treturn { abort, promise };\n};\n\n/* ------------------------------------------------------------------ */\n/* Cache */\n/* ------------------------------------------------------------------ */\n\nconst evictOldest = () => {\n\tconst oldest = cache.keys().next();\n\tif (oldest.done) return;\n\tcache.get(oldest.value)?.abort();\n\tcache.delete(oldest.value);\n};\n\nconst touch = (key: string, entry: CacheEntry) => {\n\t// Re-insert so Map iteration order doubles as LRU recency.\n\tcache.delete(key);\n\tcache.set(key, entry);\n};\n\nexport const clearPrefetchCache = () => {\n\tfor (const entry of cache.values()) entry.abort();\n\tcache.clear();\n};\n\n/** Take the prefetched response for `url` out of the cache. Returns\n * `undefined` when nothing was prefetched (or it was evicted). Callers\n * that fetch the same URL themselves can await this instead. */\nexport const consumePrefetch = (\n\turl: string,\n\tkind: PrefetchKind = 'document'\n) => {\n\tconst key = cacheKey(kind, url);\n\tconst entry = cache.get(key);\n\tif (!entry) return undefined;\n\tcache.delete(key);\n\n\treturn entry.promise;\n};\n\n/** Whether `url` is already prefetched (in flight, queued or settled). */\nexport const hasPrefetched = (url: string, kind: PrefetchKind = 'document') =>\n\tcache.has(cacheKey(kind, url));\n\n/* ------------------------------------------------------------------ */\n/* Kinds */\n/* ------------------------------------------------------------------ */\n\nconst injectLink = (rel: string, href: string, asType?: string) => {\n\tif (typeof document === 'undefined') return;\n\tconst link = document.createElement('link');\n\tlink.rel = rel;\n\tlink.href = href;\n\tif (asType) link.setAttribute('as', asType);\n\tdocument.head.append(link);\n};\n\n/** Without `fetch` (very old engines) fall back to a `<link rel=\"prefetch\">`\n * for documents; other kinds have no declarative equivalent. */\nconst injectPrefetchFallback = (kind: PrefetchKind, url: string) => {\n\tif (kind !== 'document' || !supportsLinkRel('prefetch')) return;\n\tinjectLink('prefetch', url, 'document');\n};\n\nconst supportsLinkRel = (rel: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst link = document.createElement('link');\n\n\treturn (\n\t\ttypeof link.relList?.supports === 'function' &&\n\t\tlink.relList.supports(rel)\n\t);\n};\n\n/** Inject `<link rel=\"prefetch\" as=\"style\">` once per resolved href, so\n * the target page's stylesheets are in the HTTP cache before the click.\n * `prefetch` rather than `preload`: the sheet is for the NEXT document,\n * so preloading it would warn about an unused preload on this one. */\nexport const prefetchStylesheet = (href: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst resolved = resolveHref(href);\n\tif (prefetchedStyles.has(resolved)) return false;\n\tprefetchedStyles.add(resolved);\n\t// No `relList.supports` gate: a browser that doesn't know `prefetch`\n\t// simply ignores the tag, and there is no fallback worth branching to.\n\tinjectLink('prefetch', href, 'style');\n\n\treturn true;\n};\n\n/** Inject `<link rel=\"modulepreload\">` once per resolved href. Returns\n * `true` when a new tag was added. */\nexport const preloadModule = (href: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst resolved = resolveHref(href);\n\tif (preloadedModules.has(resolved)) return false;\n\n\tconst existing = Array.from(\n\t\tdocument.querySelectorAll<HTMLLinkElement>('link[rel=\"modulepreload\"]')\n\t);\n\tif (existing.some((link) => resolveHref(link.href) === resolved)) {\n\t\tpreloadedModules.add(resolved);\n\n\t\treturn false;\n\t}\n\n\tpreloadedModules.add(resolved);\n\tinjectLink('modulepreload', href);\n\n\treturn true;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isHref = (value: unknown): value is string =>\n\ttypeof value === 'string' && value.length > 0;\n\n/** Warm what a route-data envelope points at: `modulepreload` for the\n * page's client entry (and a separate client module when it has one),\n * `<link rel=\"prefetch\">` for its stylesheets. Anything unexpected in\n * the payload is ignored — a prefetch must never break a page. */\nconst warmRouteDataAssets = (envelope: unknown) => {\n\tif (!isRecord(envelope)) return;\n\tconst { assets } = envelope;\n\tif (!isRecord(assets)) return;\n\tconst { client, css, index } = assets;\n\tfor (const href of [index, client].filter(isHref)) preloadModule(href);\n\tif (!Array.isArray(css)) return;\n\tfor (const href of css.filter(isHref)) prefetchStylesheet(href);\n};\n\n/** Read the envelope out of a clone so the cached response body is still\n * unconsumed for whoever calls `consumePrefetch`. */\nconst warmFromRouteData = async (response: Response) => {\n\ttry {\n\t\twarmRouteDataAssets(await response.clone().json());\n\t} catch {\n\t\t/* malformed payload — the document prefetch still stands */\n\t}\n\n\treturn response;\n};\n\nconst fetchDocument = (url: string, signal: AbortSignal) =>\n\tfetch(url, { credentials: 'same-origin', signal });\n\nconst fetchRouteData = async (url: string, signal: AbortSignal) => {\n\tconst response = await fetch(url, {\n\t\tcredentials: 'same-origin',\n\t\theaders: { Accept: ROUTE_DATA_MEDIA_TYPE },\n\t\tsignal\n\t});\n\tconst contentType = response.headers.get('content-type') ?? '';\n\tconst isRouteData =\n\t\tresponse.ok && contentType.includes(ROUTE_DATA_MEDIA_TYPE);\n\tif (isRouteData) return warmFromRouteData(response);\n\n\t// The server doesn't speak route data (yet) — 404 / 406 / HTML fallback.\n\t// Remember that as \"no data\" so the URL isn't asked again, and drain\n\t// the body so the connection can be reused.\n\tawait response.body?.cancel().catch(() => undefined);\n\tconst status =\n\t\tresponse.status === NOT_FOUND || response.status === NOT_ACCEPTABLE\n\t\t\t? response.status\n\t\t\t: NOT_ACCEPTABLE;\n\n\treturn new Response(null, { status });\n};\n\n/**\n * Prefetch `url`. No-op when the user signalled data-saver / reduced-data\n * / 2g, when the page opted out, or when the URL is already cached. At\n * most two prefetches are in flight at once; the rest queue in order.\n */\nexport const prefetch = (url: string, options: PrefetchOptions = {}) => {\n\tconst kind = options.kind ?? 'document';\n\tif (!canPrefetch()) return;\n\n\tif (kind === 'module') {\n\t\tpreloadModule(url);\n\n\t\treturn;\n\t}\n\n\t// `'route'` is document + data: the HTML for the navigation itself and\n\t// the payload that names the modules and CSS to warm alongside it.\n\tif (kind === 'route') {\n\t\tprefetch(url, { kind: 'document' });\n\t\tprefetch(url, { kind: 'data' });\n\n\t\treturn;\n\t}\n\n\tconst key = cacheKey(kind, url);\n\tconst existing = cache.get(key);\n\tif (existing) {\n\t\ttouch(key, existing);\n\n\t\treturn;\n\t}\n\n\tif (typeof fetch === 'undefined') {\n\t\tinjectPrefetchFallback(kind, url);\n\n\t\treturn;\n\t}\n\n\twhile (cache.size >= PREFETCH_CACHE_LIMIT) evictOldest();\n\n\tconst { abort, promise } = enqueue((signal) =>\n\t\tkind === 'data'\n\t\t\t? fetchRouteData(url, signal)\n\t\t\t: fetchDocument(url, signal)\n\t);\n\tcache.set(key, { abort, kind, promise, url });\n};\n\n/* ------------------------------------------------------------------ */\n/* Speculation rules */\n/* ------------------------------------------------------------------ */\n\nconst supportsSpeculationRules = () =>\n\ttypeof HTMLScriptElement !== 'undefined' &&\n\ttypeof HTMLScriptElement.supports === 'function' &&\n\tHTMLScriptElement.supports('speculationrules');\n\n/**\n * Ask the browser to prerender `url` right away via a speculation-rules\n * script. Deduped per URL and capped to two live rules — the oldest is\n * removed when a third arrives, so a hover trail can't pile up hidden\n * prerendered tabs. Silently no-ops where the API is unsupported.\n */\nexport const speculate = (url: string) => {\n\tif (!canPrefetch() || !supportsSpeculationRules()) return false;\n\tif (typeof document === 'undefined') return false;\n\n\tconst resolved = resolveHref(url);\n\tif (liveSpeculationRules.has(resolved)) return false;\n\n\twhile (liveSpeculationRules.size >= MAX_LIVE_SPECULATION_RULES) {\n\t\tconst oldest = liveSpeculationRules.keys().next();\n\t\tif (oldest.done) break;\n\t\tliveSpeculationRules.get(oldest.value)?.remove();\n\t\tliveSpeculationRules.delete(oldest.value);\n\t}\n\n\tconst script = applyPageNonce(document.createElement('script'));\n\tscript.type = 'speculationrules';\n\tscript.textContent = JSON.stringify({\n\t\tprerender: [{ eagerness: 'immediate', urls: [url] }]\n\t});\n\tdocument.head.append(script);\n\tliveSpeculationRules.set(resolved, script);\n\n\treturn true;\n};\n\n/* ------------------------------------------------------------------ */\n/* Triggers */\n/* ------------------------------------------------------------------ */\n\nconst noopHandle: HoverPrefetchHandle = {\n\tcancel: () => {\n\t\t/* nothing scheduled */\n\t}\n};\n\n/**\n * Wrap a prefetch trigger in a hover-debounce so glancing across many links\n * doesn't fire a fetch storm. The returned handle's `cancel()` aborts the\n * pending hover prefetch (e.g. on `pointerleave`).\n *\n * Defaults to `kind: 'route'` — a hover is deliberate enough to be worth\n * the document AND the route data (and the modules + CSS that payload\n * names). Viewport prefetching stays document-only.\n */\nexport const scheduleHoverPrefetch = (\n\turl: string,\n\toptions: HoverPrefetchOptions = {}\n): HoverPrefetchHandle => {\n\tif (typeof window === 'undefined') return noopHandle;\n\n\tconst timer = window.setTimeout(() => {\n\t\tprefetch(url, { kind: options.kind ?? 'route' });\n\t\tif (options.prerender) speculate(url);\n\t\toptions.onPrefetch?.();\n\t}, HOVER_DEBOUNCE_MS);\n\n\treturn {\n\t\tcancel: () => window.clearTimeout(timer)\n\t};\n};\n\ntype ViewportTarget = {\n\toptions: ViewportPrefetchOptions;\n\turl: string;\n};\n\nconst viewportTargets = new WeakMap<Element, ViewportTarget>();\nlet viewportObserver: IntersectionObserver | null = null;\n\nconst handleIntersections = (entries: IntersectionObserverEntry[]) => {\n\tfor (const entry of entries) {\n\t\tif (!entry.isIntersecting) continue;\n\t\tconst target = viewportTargets.get(entry.target);\n\t\tviewportObserver?.unobserve(entry.target);\n\t\tviewportTargets.delete(entry.target);\n\t\tif (!target) continue;\n\t\tprefetch(target.url, { kind: target.options.kind });\n\t\ttarget.options.onVisible?.();\n\t}\n};\n\nconst getViewportObserver = () => {\n\tif (viewportObserver) return viewportObserver;\n\tif (typeof IntersectionObserver === 'undefined') return null;\n\tviewportObserver = new IntersectionObserver(handleIntersections, {\n\t\trootMargin: VIEWPORT_ROOT_MARGIN\n\t});\n\n\treturn viewportObserver;\n};\n\n/**\n * Prefetch `url` once `element` scrolls within 128px of the viewport. One\n * IntersectionObserver is shared by every link on the page. Returns an\n * unobserve function for the caller's unmount hook.\n */\nexport const observeViewport = (\n\telement: Element,\n\turl: string,\n\toptions: ViewportPrefetchOptions = {}\n) => {\n\tconst observer = getViewportObserver();\n\tif (!observer || !canPrefetch()) return () => undefined;\n\n\tviewportTargets.set(element, { options, url });\n\tobserver.observe(element);\n\n\treturn () => {\n\t\tobserver.unobserve(element);\n\t\tviewportTargets.delete(element);\n\t};\n};\n\n/** Test / teardown helper — forgets injected modulepreload + speculation\n * rule bookkeeping and cancels any queued fetches. */\nexport const resetPrefetchState = () => {\n\tclearPrefetchCache();\n\tqueue.length = 0;\n\tpreloadedModules.clear();\n\tprefetchedStyles.clear();\n\tfor (const script of liveSpeculationRules.values()) script.remove();\n\tliveSpeculationRules.clear();\n\tviewportObserver?.disconnect();\n\tviewportObserver = null;\n};\n",
|
|
18
|
+
"import {\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\ttype FormEvent\n} from 'react';\nimport type {\n\tActionFieldErrors,\n\tActionFields,\n\tActionFormValues,\n\tActionIdleState,\n\tActionPath,\n\tActionStateOf,\n\tAnyFormAction\n} from '../../../types/formAction';\nimport { submitFormAction } from '../../client/formActions';\n\nexport type UseFormActionOptions<Action extends AnyFormAction> = {\n\t/** The result a submission without JavaScript left for this page:\n\t * `getActionState(action)` in the route, passed down as a prop. */\n\tinitialState?: ActionStateOf<Action>;\n\t/** Clear the form's fields after a successful submission that doesn't\n\t * redirect. Default true. */\n\tresetOnSuccess?: boolean;\n};\n\nconst IDLE: ActionIdleState = { status: 'idle' };\n\nconst submitterOf = (event: FormEvent<HTMLFormElement>) => {\n\tconst { nativeEvent } = event;\n\n\treturn 'submitter' in nativeEvent &&\n\t\tnativeEvent.submitter instanceof HTMLElement\n\t\t? nativeEvent.submitter\n\t\t: null;\n};\n\n/**\n * Progressive-enhancement form state for a `defineAction` action:\n *\n * const signup = useFormAction<typeof createUser>('/users', {\n * \tinitialState: props.signupState\n * });\n * <form {...signup.formProps}>\n * \t<input name=\"name\" defaultValue={signup.values.name} />\n * \t{signup.errors.name && <p>{signup.errors.name}</p>}\n * \t<button disabled={signup.pending}>Save</button>\n * </form>\n *\n * `formProps` renders a real `method=\"post\"` form, so it works before\n * hydration and without JavaScript; once hydrated, submissions go through\n * fetch and `state` / `pending` / `errors` update in place.\n */\nexport const useFormAction = <Action extends AnyFormAction = AnyFormAction>(\n\tpath: ActionPath<Action>,\n\toptions: UseFormActionOptions<Action> = {}\n) => {\n\tconst [state, setState] = useState<ActionStateOf<Action>>(\n\t\t() => options.initialState ?? IDLE\n\t);\n\tconst [pending, setPending] = useState(false);\n\tconst controllerRef = useRef<AbortController | null>(null);\n\tconst resetOnSuccess = options.resetOnSuccess !== false;\n\n\tuseEffect(() => () => controllerRef.current?.abort(), []);\n\n\tconst submit = useCallback(\n\t\tasync (body: FormData) => {\n\t\t\tcontrollerRef.current?.abort();\n\t\t\tconst controller = new AbortController();\n\t\t\tcontrollerRef.current = controller;\n\t\t\tsetPending(true);\n\t\t\ttry {\n\t\t\t\tconst result = await submitFormAction<Action>(path, body, {\n\t\t\t\t\tsignal: controller.signal\n\t\t\t\t});\n\t\t\t\tsetState(result);\n\t\t\t\tif (result.status === 'success' && result.redirect)\n\t\t\t\t\twindow.location.assign(result.redirect);\n\n\t\t\t\treturn result;\n\t\t\t} finally {\n\t\t\t\tif (controllerRef.current === controller) setPending(false);\n\t\t\t}\n\t\t},\n\t\t[path]\n\t);\n\n\tconst onSubmit = useCallback(\n\t\t(event: FormEvent<HTMLFormElement>) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst form = event.currentTarget;\n\t\t\tconst body = new FormData(form, submitterOf(event));\n\t\t\tconst clearOnSuccess = async () => {\n\t\t\t\tconst result = await submit(body);\n\t\t\t\tif (\n\t\t\t\t\tresult.status === 'success' &&\n\t\t\t\t\t!result.redirect &&\n\t\t\t\t\tresetOnSuccess\n\t\t\t\t)\n\t\t\t\t\tform.reset();\n\t\t\t};\n\t\t\t// An aborted submission (a newer one replaced it) is not an error.\n\t\t\tclearOnSuccess().catch(() => undefined);\n\t\t},\n\t\t[resetOnSuccess, submit]\n\t);\n\n\tconst reset = useCallback(() => setState(IDLE), []);\n\tconst errors: ActionFieldErrors<ActionFields<Action>> =\n\t\tstate.status === 'error' ? state.errors : {};\n\tconst values: ActionFormValues<ActionFields<Action>> =\n\t\tstate.status === 'error' ? (state.values ?? {}) : {};\n\n\treturn {\n\t\tdata: state.status === 'success' ? state.data : undefined,\n\t\terrors,\n\t\tformProps: {\n\t\t\taction: path,\n\t\t\tencType: 'multipart/form-data',\n\t\t\tmethod: 'post',\n\t\t\tonSubmit\n\t\t},\n\t\tmessage: state.status === 'error' ? state.message : undefined,\n\t\tpending,\n\t\treset,\n\t\tstate,\n\t\tsubmit,\n\t\tvalues\n\t};\n};\n",
|
|
19
|
+
"import type {\n\tActionData,\n\tActionErrorState,\n\tActionFields,\n\tActionPath,\n\tActionResult,\n\tAnyFormAction\n} from '../../types/formAction';\nimport {\n\tACTION_ERROR_ATTRIBUTE,\n\tACTION_FORM_ATTRIBUTE,\n\tACTION_MESSAGE_ATTRIBUTE,\n\tACTION_REQUEST_HEADER,\n\tACTION_STATUS_ATTRIBUTE,\n\tACTION_SUCCESS_ATTRIBUTE,\n\tisActionResult\n} from '../utils/formActionProtocol';\n\n/* Browser side of form actions. `submitFormAction` posts a FormData and\n * returns the typed result; `enhanceForms` upgrades plain\n * `<form data-absolute-action>` markup (static HTML and HTMX pages) so it\n * submits without a reload. Without JavaScript the same forms post\n * normally and the server renders the result. */\n\nexport type SubmitFormActionOptions = {\n\tsignal?: AbortSignal;\n};\n\nconst failure = (message: string): ActionErrorState => ({\n\terrors: {},\n\tmessage,\n\tstatus: 'error'\n});\n\nconst readPayload = async (response: Response) => {\n\ttry {\n\t\tconst payload: unknown = await response.json();\n\n\t\treturn payload;\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\n/** A reducer for React 19's `useActionState` (JavaScript-only: React\n * renders function form actions as `javascript:` URLs on the server; use\n * `useFormAction` for forms that also work without JavaScript). */\nexport const formActionReducer =\n\t<Action extends AnyFormAction = AnyFormAction>(path: ActionPath<Action>) =>\n\tasync (_previous: unknown, body: FormData) =>\n\t\tsubmitFormAction<Action>(path, body);\n\n/** Posts `body` to the action at `path` and returns its result. Network\n * and unexpected server failures come back as an error state with a\n * `message`; an aborted request rejects with the abort error. */\nexport const submitFormAction = async <\n\tAction extends AnyFormAction = AnyFormAction\n>(\n\tpath: ActionPath<Action>,\n\tbody: FormData,\n\toptions: SubmitFormActionOptions = {}\n) => {\n\ttype Result = ActionResult<ActionData<Action>, ActionFields<Action>>;\n\tconst response = await fetch(path, {\n\t\tbody,\n\t\tcredentials: 'same-origin',\n\t\theaders: { accept: 'application/json', [ACTION_REQUEST_HEADER]: '1' },\n\t\tmethod: 'POST',\n\t\tsignal: options.signal\n\t}).catch((error: unknown) => {\n\t\tif (options.signal?.aborted) throw error;\n\n\t\treturn undefined;\n\t});\n\tif (!response) {\n\t\tconst result: Result = failure('Network error: the form was not sent.');\n\n\t\treturn result;\n\t}\n\tconst payload = await readPayload(response);\n\tif (isActionResult<ActionData<Action>, ActionFields<Action>>(payload))\n\t\treturn payload;\n\tconst result: Result = failure(\n\t\t`The server could not handle the form (HTTP ${response.status}).`\n\t);\n\n\treturn result;\n};\n\n/* ---------------------------------------------------------------- *\n * Plain <form data-absolute-action> enhancement\n * ---------------------------------------------------------------- */\n\nexport type FormActionEventDetail = { result: ActionResult };\n\n/** Fired on the form after every enhanced submission. */\nexport const FORM_ACTION_EVENT = 'absolute:form-action';\n\nconst namedControls = (form: HTMLFormElement) =>\n\tArray.from(form.elements).filter(\n\t\t(element): element is HTMLElement & { name: string } =>\n\t\t\telement instanceof HTMLElement &&\n\t\t\t'name' in element &&\n\t\t\ttypeof element.name === 'string' &&\n\t\t\telement.name !== ''\n\t);\n\nconst markControls = (form: HTMLFormElement, result: ActionResult) => {\n\tconst errors = result.status === 'error' ? result.errors : {};\n\tconst invalid = namedControls(form).filter((control) => {\n\t\tconst message = errors[control.name];\n\t\tif (message) control.setAttribute('aria-invalid', 'true');\n\t\telse control.removeAttribute('aria-invalid');\n\n\t\treturn Boolean(message);\n\t});\n\n\treturn invalid[0];\n};\n\nconst fillErrors = (form: HTMLFormElement, result: ActionResult) => {\n\tconst errors = result.status === 'error' ? result.errors : {};\n\tform.querySelectorAll<HTMLElement>(`[${ACTION_ERROR_ATTRIBUTE}]`).forEach(\n\t\t(element) => {\n\t\t\tconst name = element.getAttribute(ACTION_ERROR_ATTRIBUTE) ?? '';\n\t\t\tconst message = errors[name] ?? '';\n\t\t\telement.textContent = message;\n\t\t\telement.hidden = message === '';\n\t\t}\n\t);\n};\n\nconst fillMessages = (form: HTMLFormElement, result: ActionResult) => {\n\tconst message = result.status === 'error' ? (result.message ?? '') : '';\n\tform.querySelectorAll<HTMLElement>(`[${ACTION_MESSAGE_ATTRIBUTE}]`).forEach(\n\t\t(element) => {\n\t\t\telement.textContent = message;\n\t\t\telement.hidden = message === '';\n\t\t}\n\t);\n\tform.querySelectorAll<HTMLElement>(`[${ACTION_SUCCESS_ATTRIBUTE}]`).forEach(\n\t\t(element) => {\n\t\t\telement.hidden = result.status !== 'success';\n\t\t}\n\t);\n};\n\n/** Writes `result` into a plain form: field errors into\n * `[data-action-error=\"field\"]`, the message into `[data-action-message]`,\n * `[data-action-success]` shown on success, `aria-invalid` on the fields\n * and `data-action-status` on the form. Focuses the first invalid field. */\nexport const applyActionResult = (\n\tform: HTMLFormElement,\n\tresult: ActionResult\n) => {\n\tform.setAttribute(ACTION_STATUS_ATTRIBUTE, result.status);\n\tfillErrors(form, result);\n\tfillMessages(form, result);\n\tconst firstInvalid = markControls(form, result);\n\tfirstInvalid?.focus();\n};\n\nconst setPending = (form: HTMLFormElement, pending: boolean) => {\n\tform.toggleAttribute('aria-busy', pending);\n\tform.toggleAttribute('data-action-pending', pending);\n\tform.querySelectorAll<HTMLButtonElement | HTMLInputElement>(\n\t\t'button[type=\"submit\"], button:not([type]), input[type=\"submit\"]'\n\t).forEach((button) => {\n\t\tbutton.disabled = pending;\n\t});\n};\n\nconst finishSubmission = (form: HTMLFormElement, result: ActionResult) => {\n\tapplyActionResult(form, result);\n\tconst detail: FormActionEventDetail = { result };\n\tform.dispatchEvent(\n\t\tnew CustomEvent(FORM_ACTION_EVENT, { bubbles: true, detail })\n\t);\n\tif (result.status !== 'success') return;\n\tif (result.redirect) window.location.assign(result.redirect);\n\telse form.reset();\n};\n\nconst formActionUrl = (form: HTMLFormElement) => {\n\tconst url = new URL(form.action, window.location.href);\n\n\treturn `${url.pathname}${url.search}`;\n};\n\n/** Submits `form` with fetch instead of a page load. Returns a function\n * that removes the enhancement. */\nexport const enhanceForm = (form: HTMLFormElement) => {\n\tlet controller: AbortController | undefined;\n\tconst submit = async (event: SubmitEvent) => {\n\t\tevent.preventDefault();\n\t\tcontroller?.abort();\n\t\tconst current = new AbortController();\n\t\tcontroller = current;\n\t\tconst body = new FormData(form, event.submitter);\n\t\tsetPending(form, true);\n\t\tconst result = await submitFormAction(formActionUrl(form), body, {\n\t\t\tsignal: current.signal\n\t\t}).catch(() => undefined);\n\t\tif (controller !== current) return;\n\t\tsetPending(form, false);\n\t\tif (result) finishSubmission(form, result);\n\t};\n\tconst listener = (event: SubmitEvent) => {\n\t\tvoid submit(event);\n\t};\n\tform.addEventListener('submit', listener);\n\n\treturn () => {\n\t\tcontroller?.abort();\n\t\tform.removeEventListener('submit', listener);\n\t};\n};\n\n/* HTMX already submits these; enhancing them too would post twice. */\nconst isHtmxForm = (form: HTMLFormElement) =>\n\tform.hasAttribute('hx-post') || form.hasAttribute('data-hx-post');\n\n/** Enhances every `<form data-absolute-action>` under `root` (except\n * `hx-post` forms, which HTMX submits). Returns a function that removes\n * the enhancements. */\nexport const enhanceForms = (root: ParentNode = document) => {\n\tconst cleanups = Array.from(\n\t\troot.querySelectorAll<HTMLFormElement>(`form[${ACTION_FORM_ATTRIBUTE}]`)\n\t)\n\t\t.filter((form) => !isHtmxForm(form))\n\t\t.map((form) => enhanceForm(form));\n\n\treturn () => cleanups.forEach((cleanup) => cleanup());\n};\n"
|
|
12
20
|
],
|
|
13
|
-
"mappings": ";;AAAA;;;ACAA,IAAM,kBAAkB,CAAC,gBAAgB;AAAA,EACvC,IAAI;AAAA,EACJ,MAAM,4BAA4B,IAAI;AAAA,EACtC,MAAM,WAAW,CAAC,SAAS,YAAY;AAAA,IACrC,MAAM,YAAY,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAAA,IACnE,IAAI,CAAC,OAAO,GAAG,WAAW,KAAK,GAAG;AAAA,MAChC,MAAM,gBAAgB;AAAA,MACtB,SAAS,WAAW,OAAO,UAAU,OAAO,cAAc,YAAY,cAAc,QAAQ,YAAY,OAAO,OAAO,CAAC,GAAG,OAAO,SAAS;A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