@softistx/alxia-react-router 0.0.0-stage → 0.83.1
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/LICENSE +21 -0
- package/README.md +2085 -2
- package/dist/api-keys/api-keys.d.ts +93 -0
- package/dist/api-keys/api-keys.d.ts.map +1 -0
- package/dist/api-keys/index.d.ts +9 -0
- package/dist/api-keys/index.d.ts.map +1 -0
- package/dist/api-keys/index.js +66 -0
- package/dist/api-keys/index.js.map +10 -0
- package/dist/assets.d.ts +14 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/chunks/index-0786n4qe.js +25 -0
- package/dist/chunks/index-0786n4qe.js.map +10 -0
- package/dist/chunks/index-1nw5yeek.js +169 -0
- package/dist/chunks/index-1nw5yeek.js.map +11 -0
- package/dist/chunks/index-59vhfj6n.js +10 -0
- package/dist/chunks/index-59vhfj6n.js.map +10 -0
- package/dist/chunks/index-5gqcpyyg.js +34 -0
- package/dist/chunks/index-5gqcpyyg.js.map +10 -0
- package/dist/chunks/index-6jf7zpxz.js +119 -0
- package/dist/chunks/index-6jf7zpxz.js.map +11 -0
- package/dist/chunks/index-8as4j8m3.js +340 -0
- package/dist/chunks/index-8as4j8m3.js.map +16 -0
- package/dist/chunks/index-9xv2a8et.js +108 -0
- package/dist/chunks/index-9xv2a8et.js.map +11 -0
- package/dist/chunks/index-ajtvyq35.js +16 -0
- package/dist/chunks/index-ajtvyq35.js.map +10 -0
- package/dist/chunks/index-c55hxgr5.js +124 -0
- package/dist/chunks/index-c55hxgr5.js.map +14 -0
- package/dist/chunks/index-d42p3mdp.js +19 -0
- package/dist/chunks/index-d42p3mdp.js.map +10 -0
- package/dist/chunks/index-gac44rs5.js +42 -0
- package/dist/chunks/index-gac44rs5.js.map +11 -0
- package/dist/chunks/index-j4ktpcke.js +62 -0
- package/dist/chunks/index-j4ktpcke.js.map +10 -0
- package/dist/chunks/index-mscfme4r.js +12 -0
- package/dist/chunks/index-mscfme4r.js.map +10 -0
- package/dist/chunks/index-pghmb2dm.js +30 -0
- package/dist/chunks/index-pghmb2dm.js.map +10 -0
- package/dist/chunks/index-rfr02vg4.js +40 -0
- package/dist/chunks/index-rfr02vg4.js.map +10 -0
- package/dist/chunks/index-sfhshxqz.js +31 -0
- package/dist/chunks/index-sfhshxqz.js.map +10 -0
- package/dist/chunks/index-skwypsjz.js +357 -0
- package/dist/chunks/index-skwypsjz.js.map +12 -0
- package/dist/chunks/index-sxh06ged.js +118 -0
- package/dist/chunks/index-sxh06ged.js.map +11 -0
- package/dist/chunks/index-t2ph23wk.js +96 -0
- package/dist/chunks/index-t2ph23wk.js.map +13 -0
- package/dist/chunks/index-thyabr5n.js +19 -0
- package/dist/chunks/index-thyabr5n.js.map +10 -0
- package/dist/chunks/index-tx36swjx.js +134 -0
- package/dist/chunks/index-tx36swjx.js.map +11 -0
- package/dist/chunks/index-v2z5k640.js +54 -0
- package/dist/chunks/index-v2z5k640.js.map +11 -0
- package/dist/chunks/index-vr82typq.js +23 -0
- package/dist/chunks/index-vr82typq.js.map +11 -0
- package/dist/chunks/index-whj6h5eg.js +9 -0
- package/dist/chunks/index-whj6h5eg.js.map +10 -0
- package/dist/chunks/index-wyypkfdv.js +130 -0
- package/dist/chunks/index-wyypkfdv.js.map +13 -0
- package/dist/chunks/index-xd5aqy3g.js +90 -0
- package/dist/chunks/index-xd5aqy3g.js.map +10 -0
- package/dist/chunks/index-zdbqzcjp.js +97 -0
- package/dist/chunks/index-zdbqzcjp.js.map +12 -0
- package/dist/chunks/index-zyg8amjc.js +23 -0
- package/dist/chunks/index-zyg8amjc.js.map +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +215 -0
- package/dist/cli/index.js.map +13 -0
- package/dist/cli/main.d.ts +13 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/reveal.d.ts +18 -0
- package/dist/cli/reveal.d.ts.map +1 -0
- package/dist/cli/template.d.ts +8 -0
- package/dist/cli/template.d.ts.map +1 -0
- package/dist/context.d.ts +104 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/document/index.d.ts +11 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +19 -0
- package/dist/document/index.js.map +9 -0
- package/dist/document/inline-script.d.ts +27 -0
- package/dist/document/inline-script.d.ts.map +1 -0
- package/dist/document/language-store.d.ts +8 -0
- package/dist/document/language-store.d.ts.map +1 -0
- package/dist/document/nonce.d.ts +34 -0
- package/dist/document/nonce.d.ts.map +1 -0
- package/dist/document/page-language.d.ts +39 -0
- package/dist/document/page-language.d.ts.map +1 -0
- package/dist/document/text-direction.d.ts +10 -0
- package/dist/document/text-direction.d.ts.map +1 -0
- package/dist/entry/abort.d.ts +21 -0
- package/dist/entry/abort.d.ts.map +1 -0
- package/dist/entry/create-entry.d.ts +41 -0
- package/dist/entry/create-entry.d.ts.map +1 -0
- package/dist/entry/index.d.ts +8 -0
- package/dist/entry/index.d.ts.map +1 -0
- package/dist/entry/index.js +154 -0
- package/dist/entry/index.js.map +13 -0
- package/dist/entry/root-data.d.ts +27 -0
- package/dist/entry/root-data.d.ts.map +1 -0
- package/dist/entry/whole-page.d.ts +10 -0
- package/dist/entry/whole-page.d.ts.map +1 -0
- package/dist/errors/api-error.d.ts +117 -0
- package/dist/errors/api-error.d.ts.map +1 -0
- package/dist/errors/api-errors.d.ts +122 -0
- package/dist/errors/api-errors.d.ts.map +1 -0
- package/dist/errors/call-failure.d.ts +45 -0
- package/dist/errors/call-failure.d.ts.map +1 -0
- package/dist/errors/catalogue-check.d.ts +24 -0
- package/dist/errors/catalogue-check.d.ts.map +1 -0
- package/dist/errors/catalogue-read.d.ts +33 -0
- package/dist/errors/catalogue-read.d.ts.map +1 -0
- package/dist/errors/catalogue.d.ts +59 -0
- package/dist/errors/catalogue.d.ts.map +1 -0
- package/dist/errors/code-resolver.d.ts +44 -0
- package/dist/errors/code-resolver.d.ts.map +1 -0
- package/dist/errors/cross-site.d.ts +8 -0
- package/dist/errors/cross-site.d.ts.map +1 -0
- package/dist/errors/describe-refusal.d.ts +6 -0
- package/dist/errors/describe-refusal.d.ts.map +1 -0
- package/dist/errors/describe.d.ts +3 -0
- package/dist/errors/describe.d.ts.map +1 -0
- package/dist/errors/fetcher-result.d.ts +33 -0
- package/dist/errors/fetcher-result.d.ts.map +1 -0
- package/dist/errors/field-placement.d.ts +12 -0
- package/dist/errors/field-placement.d.ts.map +1 -0
- package/dist/errors/form-errors.d.ts +8 -0
- package/dist/errors/form-errors.d.ts.map +1 -0
- package/dist/errors/form-refusal.d.ts +25 -0
- package/dist/errors/form-refusal.d.ts.map +1 -0
- package/dist/errors/index.d.ts +21 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +588 -0
- package/dist/errors/index.js.map +26 -0
- package/dist/errors/json-actions.d.ts +38 -0
- package/dist/errors/json-actions.d.ts.map +1 -0
- package/dist/errors/log.d.ts +8 -0
- package/dist/errors/log.d.ts.map +1 -0
- package/dist/errors/message-values.d.ts +11 -0
- package/dist/errors/message-values.d.ts.map +1 -0
- package/dist/errors/messages.d.ts +63 -0
- package/dist/errors/messages.d.ts.map +1 -0
- package/dist/errors/page-path.d.ts +9 -0
- package/dist/errors/page-path.d.ts.map +1 -0
- package/dist/errors/problem-error.d.ts +50 -0
- package/dist/errors/problem-error.d.ts.map +1 -0
- package/dist/errors/provider.d.ts +20 -0
- package/dist/errors/provider.d.ts.map +1 -0
- package/dist/errors/request-id.d.ts +5 -0
- package/dist/errors/request-id.d.ts.map +1 -0
- package/dist/errors/route-error.d.ts +33 -0
- package/dist/errors/route-error.d.ts.map +1 -0
- package/dist/errors/route-refusal.d.ts +20 -0
- package/dist/errors/route-refusal.d.ts.map +1 -0
- package/dist/errors/same-site.d.ts +49 -0
- package/dist/errors/same-site.d.ts.map +1 -0
- package/dist/errors/section-action.d.ts +46 -0
- package/dist/errors/section-action.d.ts.map +1 -0
- package/dist/errors/standard-schema.d.ts +34 -0
- package/dist/errors/standard-schema.d.ts.map +1 -0
- package/dist/errors/submit-form.d.ts +16 -0
- package/dist/errors/submit-form.d.ts.map +1 -0
- package/dist/errors/upstream-headers.d.ts +18 -0
- package/dist/errors/upstream-headers.d.ts.map +1 -0
- package/dist/errors/use-json-fetcher.d.ts +18 -0
- package/dist/errors/use-json-fetcher.d.ts.map +1 -0
- package/dist/fetcher/auth-refusal.d.ts +29 -0
- package/dist/fetcher/auth-refusal.d.ts.map +1 -0
- package/dist/fetcher/index.d.ts +20 -0
- package/dist/fetcher/index.d.ts.map +1 -0
- package/dist/fetcher/index.js +392 -0
- package/dist/fetcher/index.js.map +21 -0
- package/dist/fetcher/section-form.d.ts +24 -0
- package/dist/fetcher/section-form.d.ts.map +1 -0
- package/dist/fetcher/section-reload.d.ts +17 -0
- package/dist/fetcher/section-reload.d.ts.map +1 -0
- package/dist/fetcher/section-save.d.ts +29 -0
- package/dist/fetcher/section-save.d.ts.map +1 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts +57 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-answer.d.ts +16 -0
- package/dist/fetcher/use-fetcher-answer.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-done.d.ts +15 -0
- package/dist/fetcher/use-fetcher-done.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-promise.d.ts +48 -0
- package/dist/fetcher/use-fetcher-promise.d.ts.map +1 -0
- package/dist/fetcher/use-form-refusal.d.ts +20 -0
- package/dist/fetcher/use-form-refusal.d.ts.map +1 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts +20 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts.map +1 -0
- package/dist/fetcher/use-row-save.d.ts +32 -0
- package/dist/fetcher/use-row-save.d.ts.map +1 -0
- package/dist/fetcher/use-section-save.d.ts +46 -0
- package/dist/fetcher/use-section-save.d.ts.map +1 -0
- package/dist/fetcher/use-visible-interval.d.ts +24 -0
- package/dist/fetcher/use-visible-interval.d.ts.map +1 -0
- package/dist/fetcher/use-visible-revalidation.d.ts +10 -0
- package/dist/fetcher/use-visible-revalidation.d.ts.map +1 -0
- package/dist/health.d.ts +21 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/help/check/check.d.ts +35 -0
- package/dist/help/check/check.d.ts.map +1 -0
- package/dist/help/check/index.d.ts +8 -0
- package/dist/help/check/index.d.ts.map +1 -0
- package/dist/help/check/index.js +17 -0
- package/dist/help/check/index.js.map +9 -0
- package/dist/help/check/routes.d.ts +22 -0
- package/dist/help/check/routes.d.ts.map +1 -0
- package/dist/help/guide.d.ts +33 -0
- package/dist/help/guide.d.ts.map +1 -0
- package/dist/help/index.d.ts +16 -0
- package/dist/help/index.d.ts.map +1 -0
- package/dist/help/index.js +192 -0
- package/dist/help/index.js.map +14 -0
- package/dist/help/load.d.ts +39 -0
- package/dist/help/load.d.ts.map +1 -0
- package/dist/help/panel.d.ts +69 -0
- package/dist/help/panel.d.ts.map +1 -0
- package/dist/help/parse-flow.d.ts +27 -0
- package/dist/help/parse-flow.d.ts.map +1 -0
- package/dist/help/react.d.ts +12 -0
- package/dist/help/react.d.ts.map +1 -0
- package/dist/help/resolve.d.ts +24 -0
- package/dist/help/resolve.d.ts.map +1 -0
- package/dist/help/types.d.ts +50 -0
- package/dist/help/types.d.ts.map +1 -0
- package/dist/help/yaml.d.ts +18 -0
- package/dist/help/yaml.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +14 -0
- package/dist/link/index.d.ts +7 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +16 -0
- package/dist/link/index.js.map +10 -0
- package/dist/link/router-link.d.ts +27 -0
- package/dist/link/router-link.d.ts.map +1 -0
- package/dist/lists/connection-page.d.ts +50 -0
- package/dist/lists/connection-page.d.ts.map +1 -0
- package/dist/lists/index.d.ts +13 -0
- package/dist/lists/index.d.ts.map +1 -0
- package/dist/lists/index.js +205 -0
- package/dist/lists/index.js.map +15 -0
- package/dist/lists/newest-first.d.ts +5 -0
- package/dist/lists/newest-first.d.ts.map +1 -0
- package/dist/lists/nodes-of.d.ts +21 -0
- package/dist/lists/nodes-of.d.ts.map +1 -0
- package/dist/lists/or-failed.d.ts +19 -0
- package/dist/lists/or-failed.d.ts.map +1 -0
- package/dist/lists/use-paged-rows.d.ts +40 -0
- package/dist/lists/use-paged-rows.d.ts.map +1 -0
- package/dist/lists/use-same-route-loading.d.ts +8 -0
- package/dist/lists/use-same-route-loading.d.ts.map +1 -0
- package/dist/lists/use-search-change.d.ts +20 -0
- package/dist/lists/use-search-change.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +105 -0
- package/dist/mcp/index.js.map +11 -0
- package/dist/mcp/mcp-relay.d.ts +58 -0
- package/dist/mcp/mcp-relay.d.ts.map +1 -0
- package/dist/mcp/relay.d.ts +38 -0
- package/dist/mcp/relay.d.ts.map +1 -0
- package/dist/media/client/error.d.ts +29 -0
- package/dist/media/client/error.d.ts.map +1 -0
- package/dist/media/client/index.d.ts +8 -0
- package/dist/media/client/index.d.ts.map +1 -0
- package/dist/media/client/index.js +133 -0
- package/dist/media/client/index.js.map +11 -0
- package/dist/media/client/upload.d.ts +32 -0
- package/dist/media/client/upload.d.ts.map +1 -0
- package/dist/media/forward.d.ts +14 -0
- package/dist/media/forward.d.ts.map +1 -0
- package/dist/media/headers.d.ts +11 -0
- package/dist/media/headers.d.ts.map +1 -0
- package/dist/media/index.d.ts +9 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +396 -0
- package/dist/media/index.js.map +16 -0
- package/dist/media/options.d.ts +114 -0
- package/dist/media/options.d.ts.map +1 -0
- package/dist/media/path.d.ts +12 -0
- package/dist/media/path.d.ts.map +1 -0
- package/dist/media/read.d.ts +11 -0
- package/dist/media/read.d.ts.map +1 -0
- package/dist/media/refusal.d.ts +11 -0
- package/dist/media/refusal.d.ts.map +1 -0
- package/dist/media/respond.d.ts +8 -0
- package/dist/media/respond.d.ts.map +1 -0
- package/dist/media/write.d.ts +13 -0
- package/dist/media/write.d.ts.map +1 -0
- package/dist/navigation/index.d.ts +9 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +48 -0
- package/dist/navigation/index.js.map +11 -0
- package/dist/navigation/use-focus-on-navigate.d.ts +16 -0
- package/dist/navigation/use-focus-on-navigate.d.ts.map +1 -0
- package/dist/navigation/use-route-transition.d.ts +19 -0
- package/dist/navigation/use-route-transition.d.ts.map +1 -0
- package/dist/nonce.d.ts +16 -0
- package/dist/nonce.d.ts.map +1 -0
- package/dist/oauth/answer.d.ts +33 -0
- package/dist/oauth/answer.d.ts.map +1 -0
- package/dist/oauth/binding.d.ts +43 -0
- package/dist/oauth/binding.d.ts.map +1 -0
- package/dist/oauth/consent.d.ts +134 -0
- package/dist/oauth/consent.d.ts.map +1 -0
- package/dist/oauth/grants.d.ts +88 -0
- package/dist/oauth/grants.d.ts.map +1 -0
- package/dist/oauth/index.d.ts +16 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +207 -0
- package/dist/oauth/index.js.map +12 -0
- package/dist/oauth/model.d.ts +13 -0
- package/dist/oauth/model.d.ts.map +1 -0
- package/dist/oauth/react/index.d.ts +7 -0
- package/dist/oauth/react/index.d.ts.map +1 -0
- package/dist/oauth/react/index.js +99 -0
- package/dist/oauth/react/index.js.map +10 -0
- package/dist/oauth/react/use-consent.d.ts +52 -0
- package/dist/oauth/react/use-consent.d.ts.map +1 -0
- package/dist/oidc/dpop.d.ts +80 -0
- package/dist/oidc/dpop.d.ts.map +1 -0
- package/dist/oidc/errors.d.ts +16 -0
- package/dist/oidc/errors.d.ts.map +1 -0
- package/dist/oidc/flow.d.ts +59 -0
- package/dist/oidc/flow.d.ts.map +1 -0
- package/dist/oidc/index.d.ts +11 -0
- package/dist/oidc/index.d.ts.map +1 -0
- package/dist/oidc/index.js +742 -0
- package/dist/oidc/index.js.map +15 -0
- package/dist/oidc/oidc.d.ts +132 -0
- package/dist/oidc/oidc.d.ts.map +1 -0
- package/dist/oidc/revoke.d.ts +28 -0
- package/dist/oidc/revoke.d.ts.map +1 -0
- package/dist/oidc/seal.d.ts +20 -0
- package/dist/oidc/seal.d.ts.map +1 -0
- package/dist/pwa/build/build-worker.d.ts +41 -0
- package/dist/pwa/build/build-worker.d.ts.map +1 -0
- package/dist/pwa/build/index.d.ts +9 -0
- package/dist/pwa/build/index.d.ts.map +1 -0
- package/dist/pwa/build/index.js +9 -0
- package/dist/pwa/build/index.js.map +9 -0
- package/dist/pwa/build/precache.d.ts +17 -0
- package/dist/pwa/build/precache.d.ts.map +1 -0
- package/dist/pwa/index.d.ts +16 -0
- package/dist/pwa/index.d.ts.map +1 -0
- package/dist/pwa/index.js +110 -0
- package/dist/pwa/index.js.map +12 -0
- package/dist/pwa/model/caching.d.ts +46 -0
- package/dist/pwa/model/caching.d.ts.map +1 -0
- package/dist/pwa/model/clear-app-caches.d.ts +9 -0
- package/dist/pwa/model/clear-app-caches.d.ts.map +1 -0
- package/dist/pwa/model/font-precache.d.ts +15 -0
- package/dist/pwa/model/font-precache.d.ts.map +1 -0
- package/dist/pwa/model/manifest.d.ts +80 -0
- package/dist/pwa/model/manifest.d.ts.map +1 -0
- package/dist/pwa/model/precache-list.d.ts +40 -0
- package/dist/pwa/model/precache-list.d.ts.map +1 -0
- package/dist/pwa/model/registration.d.ts +39 -0
- package/dist/pwa/model/registration.d.ts.map +1 -0
- package/dist/pwa/model/start-service-worker.d.ts +24 -0
- package/dist/pwa/model/start-service-worker.d.ts.map +1 -0
- package/dist/pwa/model/storable.d.ts +8 -0
- package/dist/pwa/model/storable.d.ts.map +1 -0
- package/dist/pwa/model/theme-color.d.ts +20 -0
- package/dist/pwa/model/theme-color.d.ts.map +1 -0
- package/dist/pwa/model/update-notice.d.ts +38 -0
- package/dist/pwa/model/update-notice.d.ts.map +1 -0
- package/dist/pwa/model/worker-contract.d.ts +61 -0
- package/dist/pwa/model/worker-contract.d.ts.map +1 -0
- package/dist/pwa/react/index.d.ts +9 -0
- package/dist/pwa/react/index.d.ts.map +1 -0
- package/dist/pwa/react/index.js +75 -0
- package/dist/pwa/react/index.js.map +13 -0
- package/dist/pwa/react/use-online.d.ts +6 -0
- package/dist/pwa/react/use-online.d.ts.map +1 -0
- package/dist/pwa/react/use-service-worker.d.ts +33 -0
- package/dist/pwa/react/use-service-worker.d.ts.map +1 -0
- package/dist/pwa/react/use-update-notice.d.ts +14 -0
- package/dist/pwa/react/use-update-notice.d.ts.map +1 -0
- package/dist/pwa/server/index.d.ts +7 -0
- package/dist/pwa/server/index.d.ts.map +1 -0
- package/dist/pwa/server/index.js +18 -0
- package/dist/pwa/server/index.js.map +10 -0
- package/dist/pwa/server/no-cache.d.ts +22 -0
- package/dist/pwa/server/no-cache.d.ts.map +1 -0
- package/dist/pwa/worker/index.d.ts +9 -0
- package/dist/pwa/worker/index.d.ts.map +1 -0
- package/dist/pwa/worker/index.js +144 -0
- package/dist/pwa/worker/index.js.map +12 -0
- package/dist/pwa/worker/injected.d.ts +15 -0
- package/dist/pwa/worker/injected.d.ts.map +1 -0
- package/dist/pwa/worker/plan.d.ts +65 -0
- package/dist/pwa/worker/plan.d.ts.map +1 -0
- package/dist/pwa/worker/scope.d.ts +18 -0
- package/dist/pwa/worker/scope.d.ts.map +1 -0
- package/dist/pwa/worker/start-worker.d.ts +17 -0
- package/dist/pwa/worker/start-worker.d.ts.map +1 -0
- package/dist/react-router.d.ts +68 -0
- package/dist/react-router.d.ts.map +1 -0
- package/dist/server.d.ts +127 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/session/codes.d.ts +9 -0
- package/dist/session/codes.d.ts.map +1 -0
- package/dist/session/cookies.d.ts +128 -0
- package/dist/session/cookies.d.ts.map +1 -0
- package/dist/session/flow-types.d.ts +235 -0
- package/dist/session/flow-types.d.ts.map +1 -0
- package/dist/session/guard.d.ts +10 -0
- package/dist/session/guard.d.ts.map +1 -0
- package/dist/session/index.d.ts +22 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +1090 -0
- package/dist/session/index.js.map +27 -0
- package/dist/session/land.d.ts +28 -0
- package/dist/session/land.d.ts.map +1 -0
- package/dist/session/link-json.d.ts +22 -0
- package/dist/session/link-json.d.ts.map +1 -0
- package/dist/session/link-land.d.ts +20 -0
- package/dist/session/link-land.d.ts.map +1 -0
- package/dist/session/link-token.d.ts +24 -0
- package/dist/session/link-token.d.ts.map +1 -0
- package/dist/session/link-types.d.ts +142 -0
- package/dist/session/link-types.d.ts.map +1 -0
- package/dist/session/links.d.ts +14 -0
- package/dist/session/links.d.ts.map +1 -0
- package/dist/session/model/index.d.ts +8 -0
- package/dist/session/model/index.d.ts.map +1 -0
- package/dist/session/model/index.js +35 -0
- package/dist/session/model/index.js.map +9 -0
- package/dist/session/model/link-post.d.ts +35 -0
- package/dist/session/model/link-post.d.ts.map +1 -0
- package/dist/session/model/paths.d.ts +24 -0
- package/dist/session/model/paths.d.ts.map +1 -0
- package/dist/session/model/safe-next.d.ts +15 -0
- package/dist/session/model/safe-next.d.ts.map +1 -0
- package/dist/session/model/second-factor.d.ts +16 -0
- package/dist/session/model/second-factor.d.ts.map +1 -0
- package/dist/session/model/site-path.d.ts +10 -0
- package/dist/session/model/site-path.d.ts.map +1 -0
- package/dist/session/model/step-up-answers.d.ts +45 -0
- package/dist/session/model/step-up-answers.d.ts.map +1 -0
- package/dist/session/model/step-up-props.d.ts +22 -0
- package/dist/session/model/step-up-props.d.ts.map +1 -0
- package/dist/session/model/step-up.d.ts +48 -0
- package/dist/session/model/step-up.d.ts.map +1 -0
- package/dist/session/react/index.d.ts +13 -0
- package/dist/session/react/index.d.ts.map +1 -0
- package/dist/session/react/index.js +196 -0
- package/dist/session/react/index.js.map +14 -0
- package/dist/session/react/step-up/answers.d.ts +9 -0
- package/dist/session/react/step-up/answers.d.ts.map +1 -0
- package/dist/session/react/step-up/dialog-props.d.ts +27 -0
- package/dist/session/react/step-up/dialog-props.d.ts.map +1 -0
- package/dist/session/react/step-up/index.d.ts +7 -0
- package/dist/session/react/step-up/index.d.ts.map +1 -0
- package/dist/session/react/step-up/pending-runs.d.ts +21 -0
- package/dist/session/react/step-up/pending-runs.d.ts.map +1 -0
- package/dist/session/react/step-up/phase.d.ts +8 -0
- package/dist/session/react/step-up/phase.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts +59 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts +70 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up.d.ts +51 -0
- package/dist/session/react/step-up/use-step-up.d.ts.map +1 -0
- package/dist/session/react/use-code-field.d.ts +37 -0
- package/dist/session/react/use-code-field.d.ts.map +1 -0
- package/dist/session/react/use-link-fragment.d.ts +22 -0
- package/dist/session/react/use-link-fragment.d.ts.map +1 -0
- package/dist/session/react/use-link-param.d.ts +26 -0
- package/dist/session/react/use-link-param.d.ts.map +1 -0
- package/dist/session/react/use-link-post.d.ts +39 -0
- package/dist/session/react/use-link-post.d.ts.map +1 -0
- package/dist/session/react/use-sign-out.d.ts +46 -0
- package/dist/session/react/use-sign-out.d.ts.map +1 -0
- package/dist/session/second-factor.d.ts +22 -0
- package/dist/session/second-factor.d.ts.map +1 -0
- package/dist/session/serialize.d.ts +42 -0
- package/dist/session/serialize.d.ts.map +1 -0
- package/dist/session/sign-in.d.ts +19 -0
- package/dist/session/sign-in.d.ts.map +1 -0
- package/dist/session/signed.d.ts +44 -0
- package/dist/session/signed.d.ts.map +1 -0
- package/dist/session/social-flow.d.ts +22 -0
- package/dist/session/social-flow.d.ts.map +1 -0
- package/dist/session/social-land.d.ts +31 -0
- package/dist/session/social-land.d.ts.map +1 -0
- package/dist/session/social-types.d.ts +136 -0
- package/dist/session/social-types.d.ts.map +1 -0
- package/dist/session/social.d.ts +32 -0
- package/dist/session/social.d.ts.map +1 -0
- package/dist/session/step-up-codes.d.ts +9 -0
- package/dist/session/step-up-codes.d.ts.map +1 -0
- package/dist/session/step-up-signed-out.d.ts +21 -0
- package/dist/session/step-up-signed-out.d.ts.map +1 -0
- package/dist/session/step-up-types.d.ts +127 -0
- package/dist/session/step-up-types.d.ts.map +1 -0
- package/dist/session/step-up.d.ts +17 -0
- package/dist/session/step-up.d.ts.map +1 -0
- package/dist/session/step.d.ts +22 -0
- package/dist/session/step.d.ts.map +1 -0
- package/dist/session/throttle.d.ts +73 -0
- package/dist/session/throttle.d.ts.map +1 -0
- package/dist/session/timed-wait.d.ts +4 -0
- package/dist/session/timed-wait.d.ts.map +1 -0
- package/dist/session/viewer.d.ts +34 -0
- package/dist/session/viewer.d.ts.map +1 -0
- package/dist/subscription/documents.d.ts +3 -0
- package/dist/subscription/documents.d.ts.map +1 -0
- package/dist/subscription/index.d.ts +7 -0
- package/dist/subscription/index.d.ts.map +1 -0
- package/dist/subscription/index.js +359 -0
- package/dist/subscription/index.js.map +14 -0
- package/dist/subscription/proxy.d.ts +54 -0
- package/dist/subscription/proxy.d.ts.map +1 -0
- package/dist/subscription/react/backoff.d.ts +8 -0
- package/dist/subscription/react/backoff.d.ts.map +1 -0
- package/dist/subscription/react/classify.d.ts +15 -0
- package/dist/subscription/react/classify.d.ts.map +1 -0
- package/dist/subscription/react/controller.d.ts +40 -0
- package/dist/subscription/react/controller.d.ts.map +1 -0
- package/dist/subscription/react/fake-timers.d.ts +8 -0
- package/dist/subscription/react/fake-timers.d.ts.map +1 -0
- package/dist/subscription/react/index.d.ts +15 -0
- package/dist/subscription/react/index.d.ts.map +1 -0
- package/dist/subscription/react/index.js +227 -0
- package/dist/subscription/react/index.js.map +17 -0
- package/dist/subscription/react/reconnect.d.ts +9 -0
- package/dist/subscription/react/reconnect.d.ts.map +1 -0
- package/dist/subscription/react/scheduler.d.ts +13 -0
- package/dist/subscription/react/scheduler.d.ts.map +1 -0
- package/dist/subscription/react/timers.d.ts +7 -0
- package/dist/subscription/react/timers.d.ts.map +1 -0
- package/dist/subscription/react/use-live-subscription.d.ts +36 -0
- package/dist/subscription/react/use-live-subscription.d.ts.map +1 -0
- package/dist/subscription/react/versions.d.ts +6 -0
- package/dist/subscription/react/versions.d.ts.map +1 -0
- package/dist/subscription/read.d.ts +17 -0
- package/dist/subscription/read.d.ts.map +1 -0
- package/dist/subscription/refusal.d.ts +11 -0
- package/dist/subscription/refusal.d.ts.map +1 -0
- package/dist/subscription/relay.d.ts +16 -0
- package/dist/subscription/relay.d.ts.map +1 -0
- package/dist/vite/bun.d.ts +21 -0
- package/dist/vite/bun.d.ts.map +1 -0
- package/dist/vite/bundle.d.ts +33 -0
- package/dist/vite/bundle.d.ts.map +1 -0
- package/dist/vite/compress.d.ts +18 -0
- package/dist/vite/compress.d.ts.map +1 -0
- package/dist/vite/config.d.ts +33 -0
- package/dist/vite/config.d.ts.map +1 -0
- package/dist/vite/dev.d.ts +28 -0
- package/dist/vite/dev.d.ts.map +1 -0
- package/dist/vite/entry.d.ts +20 -0
- package/dist/vite/entry.d.ts.map +1 -0
- package/dist/vite/hosts.d.ts +16 -0
- package/dist/vite/hosts.d.ts.map +1 -0
- package/dist/vite/index.d.ts +68 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +635 -0
- package/dist/vite/index.js.map +22 -0
- package/dist/vite/inline.d.ts +18 -0
- package/dist/vite/inline.d.ts.map +1 -0
- package/dist/vite/node.d.ts +16 -0
- package/dist/vite/node.d.ts.map +1 -0
- package/dist/vite/preview.d.ts +8 -0
- package/dist/vite/preview.d.ts.map +1 -0
- package/dist/vite/runtime.d.ts +8 -0
- package/dist/vite/runtime.d.ts.map +1 -0
- package/dist/vite/socket.d.ts +75 -0
- package/dist/vite/socket.d.ts.map +1 -0
- package/dist/vite/worker.d.ts +16 -0
- package/dist/vite/worker.d.ts.map +1 -0
- package/dist/with-alxia.d.ts +36 -0
- package/dist/with-alxia.d.ts.map +1 -0
- package/docs/README.md +42 -0
- package/docs/guide/api-keys.md +216 -0
- package/docs/guide/beside-the-pages.md +201 -0
- package/docs/guide/csp-nonce.md +166 -0
- package/docs/guide/customising-the-server.md +324 -0
- package/docs/guide/deploying.md +102 -0
- package/docs/guide/document.md +334 -0
- package/docs/guide/errors.md +1147 -0
- package/docs/guide/fetcher.md +355 -0
- package/docs/guide/getting-started.md +112 -0
- package/docs/guide/help.md +325 -0
- package/docs/guide/how-it-works.md +274 -0
- package/docs/guide/link.md +32 -0
- package/docs/guide/lists.md +225 -0
- package/docs/guide/mcp.md +173 -0
- package/docs/guide/media.md +273 -0
- package/docs/guide/navigation.md +52 -0
- package/docs/guide/oauth.md +342 -0
- package/docs/guide/oidc.md +262 -0
- package/docs/guide/openapi.md +51 -0
- package/docs/guide/pwa.md +670 -0
- package/docs/guide/session.md +2105 -0
- package/docs/guide/subscriptions.md +211 -0
- package/docs/guide/testing.md +42 -0
- package/docs/guide/typing-the-loaders.md +311 -0
- package/docs/guide.md +82 -0
- package/docs/roadmap.md +474 -0
- package/docs/troubleshooting.md +3837 -0
- package/package.json +301 -5
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PRECACHE_DEFINE
|
|
3
|
+
} from "./index-59vhfj6n.js";
|
|
4
|
+
import {
|
|
5
|
+
parseBrowserManifest2,
|
|
6
|
+
precacheList2,
|
|
7
|
+
assetPrecache2
|
|
8
|
+
} from "./index-5gqcpyyg.js";
|
|
9
|
+
import {
|
|
10
|
+
SERVICE_WORKER_URL2,
|
|
11
|
+
OFFLINE_URL2
|
|
12
|
+
} from "./index-rfr02vg4.js";
|
|
13
|
+
|
|
14
|
+
// src/pwa/build/build-worker.ts
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
17
|
+
import { basename, dirname, join, resolve, sep } from "node:path";
|
|
18
|
+
|
|
19
|
+
// src/pwa/build/precache.ts
|
|
20
|
+
import { createHash } from "node:crypto";
|
|
21
|
+
function browserManifestFile(files) {
|
|
22
|
+
const found = files.filter((file) => /^manifest-[\w-]+\.js$/.test(file));
|
|
23
|
+
const [only] = found;
|
|
24
|
+
if (found.length !== 1 || only === undefined) {
|
|
25
|
+
throw new Error(`buildWorker(): expected one React Router browser manifest, build/client/assets/manifest-*.js, found ${found.length}. Run react-router build first.`);
|
|
26
|
+
}
|
|
27
|
+
return only;
|
|
28
|
+
}
|
|
29
|
+
function revisionOf(bytes) {
|
|
30
|
+
return createHash("sha256").update(bytes).digest("hex").slice(0, 16);
|
|
31
|
+
}
|
|
32
|
+
function workerPrecache(input) {
|
|
33
|
+
const all = [
|
|
34
|
+
...input.offline ? [input.offline] : [],
|
|
35
|
+
...precacheList2(parseBrowserManifest2(input.manifestSource)),
|
|
36
|
+
...input.include ? assetPrecache2(input.assetFiles, input.include) : []
|
|
37
|
+
];
|
|
38
|
+
const seen = new Set;
|
|
39
|
+
return all.filter(({ url }) => !seen.has(url) && seen.add(url));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/pwa/build/build-worker.ts
|
|
43
|
+
function assertBun(onBun = globalThis.Bun !== undefined) {
|
|
44
|
+
if (onBun)
|
|
45
|
+
return;
|
|
46
|
+
throw new Error("buildWorker() runs on Bun: it is running on Node. Run it with bun, or run react-router build with bun --bun.");
|
|
47
|
+
}
|
|
48
|
+
function urlInClient(client, url) {
|
|
49
|
+
const path = join(client, url);
|
|
50
|
+
if (!url.startsWith("/") || /^[a-z][a-z0-9+.-]*:|^\/\//i.test(url) || !path.startsWith(client + sep) || path.endsWith(sep)) {
|
|
51
|
+
throw new Error(`buildWorker(): ${url} is outside ${client}.`);
|
|
52
|
+
}
|
|
53
|
+
return path;
|
|
54
|
+
}
|
|
55
|
+
async function buildWorker2(options) {
|
|
56
|
+
assertBun();
|
|
57
|
+
const root = resolve(options.root ?? process.cwd());
|
|
58
|
+
const client = resolve(root, options.client ?? "build/client");
|
|
59
|
+
const source = resolve(root, options.file);
|
|
60
|
+
const workerUrl = options.contract?.serviceWorkerUrl ?? SERVICE_WORKER_URL2;
|
|
61
|
+
const offlineUrl = options.contract?.offlineUrl ?? OFFLINE_URL2;
|
|
62
|
+
if (!existsSync(source)) {
|
|
63
|
+
throw new Error(`buildWorker(): ${options.file} does not exist.`);
|
|
64
|
+
}
|
|
65
|
+
const assets = join(client, "assets");
|
|
66
|
+
const files = await readdir(assets).catch(() => []);
|
|
67
|
+
const manifest = browserManifestFile(files);
|
|
68
|
+
let offline;
|
|
69
|
+
if (options.offline !== false) {
|
|
70
|
+
const page = urlInClient(client, offlineUrl);
|
|
71
|
+
if (!existsSync(page)) {
|
|
72
|
+
throw new Error(`buildWorker(): ${options.client ?? "build/client"}${offlineUrl} does not exist. Add public${offlineUrl}, or pass offline: false (\`worker: { offline: false }\` in alxia()), or pass the app's contract (\`worker: { contract }\` in alxia()).`);
|
|
73
|
+
}
|
|
74
|
+
offline = { url: offlineUrl, revision: revisionOf(await readFile(page)) };
|
|
75
|
+
}
|
|
76
|
+
const precache = workerPrecache({
|
|
77
|
+
manifestSource: await readFile(join(assets, manifest), "utf8"),
|
|
78
|
+
assetFiles: files,
|
|
79
|
+
offline,
|
|
80
|
+
include: options.precacheAssets
|
|
81
|
+
});
|
|
82
|
+
const out = urlInClient(client, workerUrl);
|
|
83
|
+
const result = await Bun.build({
|
|
84
|
+
entrypoints: [source],
|
|
85
|
+
outdir: dirname(out),
|
|
86
|
+
naming: basename(out),
|
|
87
|
+
target: "browser",
|
|
88
|
+
format: "iife",
|
|
89
|
+
minify: options.minify ?? true,
|
|
90
|
+
define: {
|
|
91
|
+
"process.env.NODE_ENV": '"production"',
|
|
92
|
+
[PRECACHE_DEFINE]: JSON.stringify(precache)
|
|
93
|
+
}
|
|
94
|
+
}).catch((error) => {
|
|
95
|
+
const detail = error instanceof AggregateError ? error.errors.map(String).join(`
|
|
96
|
+
`) : String(error);
|
|
97
|
+
throw new Error(`buildWorker(): Bun.build failed:
|
|
98
|
+
${detail}`);
|
|
99
|
+
});
|
|
100
|
+
if (!result.success) {
|
|
101
|
+
throw new Error(`buildWorker(): Bun.build failed:
|
|
102
|
+
${result.logs.map(String).join(`
|
|
103
|
+
`)}`);
|
|
104
|
+
}
|
|
105
|
+
let precacheBytes = 0;
|
|
106
|
+
for (const { url } of precache) {
|
|
107
|
+
precacheBytes += (await stat(join(client, url))).size;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
file: out,
|
|
111
|
+
precache,
|
|
112
|
+
precacheBytes,
|
|
113
|
+
bytes: (await stat(out)).size
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export { buildWorker2 };
|
|
117
|
+
|
|
118
|
+
//# debugId=705C996D7C991BF164756E2164756E21
|
|
119
|
+
//# sourceMappingURL=index-6jf7zpxz.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/pwa/build/build-worker.ts", "../src/pwa/build/precache.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from 'node:fs';\nimport { readdir, readFile, stat } from 'node:fs/promises';\nimport { basename, dirname, join, resolve, sep } from 'node:path';\nimport type { PrecacheEntry } from '../model/precache-list';\nimport {\n\tOFFLINE_URL,\n\tSERVICE_WORKER_URL,\n\ttype WorkerContract,\n} from '../model/worker-contract';\nimport { PRECACHE_DEFINE } from '../worker/injected';\nimport { browserManifestFile, revisionOf, workerPrecache } from './precache';\n\nexport interface BuildWorkerOptions {\n\t/**\n\t * The worker's source, relative to `root`: `app/service-worker.ts`. Named\n\t * `file`, not `entry`: `reveal` reads `alxia({ entry })`.\n\t */\n\tfile: string;\n\t/** `process.cwd()` by default. */\n\troot?: string;\n\t/** The client build, relative to `root`: `build/client` by default. */\n\tclient?: string;\n\t/** Where the worker is written and which offline page is precached. */\n\tcontract?: Pick<WorkerContract, 'serviceWorkerUrl' | 'offlineUrl'>;\n\t/** Precache the offline page, which must then exist. `true` by default. */\n\toffline?: boolean;\n\t/** More files of `assets/` to precache, such as fonts: the app's regex. */\n\tprecacheAssets?: RegExp;\n\t/** `true` by default. */\n\tminify?: boolean;\n}\n\nexport interface WorkerBuild {\n\t/** The absolute path of the worker written. */\n\tfile: string;\n\tprecache: PrecacheEntry[];\n\t/** The precached files' size, before compression. */\n\tprecacheBytes: number;\n\t/** The worker's own size. */\n\tbytes: number;\n}\n\n/** Not `requireBun` of `vite/`: `/pwa/build` imports Node's built-ins only. */\nexport function assertBun(\n\tonBun = (globalThis as { Bun?: unknown }).Bun !== undefined,\n): void {\n\tif (onBun) return;\n\tthrow new Error(\n\t\t'buildWorker() runs on Bun: it is running on Node. Run it with bun, or run react-router build with bun --bun.',\n\t);\n}\n\n/**\n * The file a root-relative URL names inside `client`. It fails closed: a URL\n * that is absolute, protocol-relative, not rooted at `/`, or that resolves to\n * `client` itself or outside it, is refused.\n */\nfunction urlInClient(client: string, url: string): string {\n\tconst path = join(client, url);\n\tif (\n\t\t!url.startsWith('/') ||\n\t\t/^[a-z][a-z0-9+.-]*:|^\\/\\//i.test(url) ||\n\t\t!path.startsWith(client + sep) ||\n\t\tpath.endsWith(sep)\n\t) {\n\t\tthrow new Error(`buildWorker(): ${url} is outside ${client}.`);\n\t}\n\treturn path;\n}\n\n/**\n * Bundles the worker (Workbox included) into the client build, after\n * `react-router build`, with the precache list written in: the offline page\n * by its content, every route's code and `precacheAssets`. A new build\n * changes the list, so the worker's bytes, so the browser installs it.\n * Runs on Bun; the only imports of this module are Node's built-ins.\n */\nexport async function buildWorker(\n\toptions: BuildWorkerOptions,\n): Promise<WorkerBuild> {\n\tassertBun();\n\tconst root = resolve(options.root ?? process.cwd());\n\tconst client = resolve(root, options.client ?? 'build/client');\n\tconst source = resolve(root, options.file);\n\tconst workerUrl = options.contract?.serviceWorkerUrl ?? SERVICE_WORKER_URL;\n\tconst offlineUrl = options.contract?.offlineUrl ?? OFFLINE_URL;\n\tif (!existsSync(source)) {\n\t\tthrow new Error(`buildWorker(): ${options.file} does not exist.`);\n\t}\n\tconst assets = join(client, 'assets');\n\tconst files = await readdir(assets).catch(() => []);\n\tconst manifest = browserManifestFile(files);\n\tlet offline: PrecacheEntry | undefined;\n\tif (options.offline !== false) {\n\t\tconst page = urlInClient(client, offlineUrl);\n\t\tif (!existsSync(page)) {\n\t\t\tthrow new Error(\n\t\t\t\t`buildWorker(): ${options.client ?? 'build/client'}${offlineUrl} does not exist. Add public${offlineUrl}, or pass offline: false (\\`worker: { offline: false }\\` in alxia()), or pass the app's contract (\\`worker: { contract }\\` in alxia()).`,\n\t\t\t);\n\t\t}\n\t\toffline = { url: offlineUrl, revision: revisionOf(await readFile(page)) };\n\t}\n\tconst precache = workerPrecache({\n\t\tmanifestSource: await readFile(join(assets, manifest), 'utf8'),\n\t\tassetFiles: files,\n\t\toffline,\n\t\tinclude: options.precacheAssets,\n\t});\n\tconst out = urlInClient(client, workerUrl);\n\tconst result = await Bun.build({\n\t\tentrypoints: [source],\n\t\toutdir: dirname(out),\n\t\tnaming: basename(out),\n\t\ttarget: 'browser',\n\t\tformat: 'iife',\n\t\tminify: options.minify ?? true,\n\t\tdefine: {\n\t\t\t// Workbox's production build: no logging, no dev assertions.\n\t\t\t'process.env.NODE_ENV': '\"production\"',\n\t\t\t[PRECACHE_DEFINE]: JSON.stringify(precache),\n\t\t},\n\t}).catch((error: unknown) => {\n\t\tconst detail =\n\t\t\terror instanceof AggregateError\n\t\t\t\t? error.errors.map(String).join('\\n')\n\t\t\t\t: String(error);\n\t\tthrow new Error(`buildWorker(): Bun.build failed:\\n${detail}`);\n\t});\n\tif (!result.success) {\n\t\tthrow new Error(\n\t\t\t`buildWorker(): Bun.build failed:\\n${result.logs.map(String).join('\\n')}`,\n\t\t);\n\t}\n\tlet precacheBytes = 0;\n\tfor (const { url } of precache) {\n\t\tprecacheBytes += (await stat(join(client, url))).size;\n\t}\n\treturn {\n\t\tfile: out,\n\t\tprecache,\n\t\tprecacheBytes,\n\t\tbytes: (await stat(out)).size,\n\t};\n}\n",
|
|
6
|
+
"import { createHash } from 'node:crypto';\nimport {\n\tassetPrecache,\n\ttype PrecacheEntry,\n\tparseBrowserManifest,\n\tprecacheList,\n} from '../model/precache-list';\n\n/** The one React Router browser manifest among the names in build/client/assets. */\nexport function browserManifestFile(files: readonly string[]): string {\n\tconst found = files.filter((file) => /^manifest-[\\w-]+\\.js$/.test(file));\n\tconst [only] = found;\n\tif (found.length !== 1 || only === undefined) {\n\t\tthrow new Error(\n\t\t\t`buildWorker(): expected one React Router browser manifest, build/client/assets/manifest-*.js, found ${found.length}. Run react-router build first.`,\n\t\t);\n\t}\n\treturn only;\n}\n\n/** A file's revision: the first 16 hex characters of its sha256. */\nexport function revisionOf(bytes: Uint8Array): string {\n\treturn createHash('sha256').update(bytes).digest('hex').slice(0, 16);\n}\n\n/**\n * The worker's precache list: the offline page (revisioned by its content),\n * every route's code, then the asset files `include` matches. Each URL once,\n * the first kept.\n */\nexport function workerPrecache(input: {\n\tmanifestSource: string;\n\tassetFiles: readonly string[];\n\toffline?: PrecacheEntry | undefined;\n\tinclude?: RegExp | undefined;\n}): PrecacheEntry[] {\n\tconst all = [\n\t\t...(input.offline ? [input.offline] : []),\n\t\t...precacheList(parseBrowserManifest(input.manifestSource)),\n\t\t...(input.include ? assetPrecache(input.assetFiles, input.include) : []),\n\t];\n\tconst seen = new Set<string>();\n\treturn all.filter(({ url }) => !seen.has(url) && seen.add(url));\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AACA;AACA;;;ACFA;AASO,SAAS,mBAAmB,CAAC,OAAkC;AAAA,EACrE,MAAM,QAAQ,MAAM,OAAO,CAAC,SAAS,wBAAwB,KAAK,IAAI,CAAC;AAAA,EACvE,OAAO,QAAQ;AAAA,EACf,IAAI,MAAM,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,CAAC,EAAE,MAAM,CAAC,UAAmB;AAAA,IAC5B,MAAM,SACL,iBAAiB,iBACd,MAAM,OAAO,IAAI,MAAM,EAAE,KAAK;AAAA,CAAI,IAClC,OAAO,KAAK;AAAA,IAChB,MAAM,IAAI,MAAM;AAAA,EAAqC,QAAQ;AAAA,GAC7D;AAAA,EACD,IAAI,CAAC,OAAO,SAAS;AAAA,IACpB,MAAM,IAAI,MACT;AAAA,EAAqC,OAAO,KAAK,IAAI,MAAM,EAAE,KAAK;AAAA,CAAI,GACvE;AAAA,EACD;AAAA,EACA,IAAI,gBAAgB;AAAA,EACpB,aAAa,SAAS,UAAU;AAAA,IAC/B,kBAAkB,MAAM,KAAK,KAAK,QAAQ,GAAG,CAAC,GAAG;AAAA,EAClD;AAAA,EACA,OAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ,MAAM,KAAK,GAAG,GAAG;AAAA,EAC1B;AAAA;",
|
|
9
|
+
"debugId": "705C996D7C991BF164756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INITIAL_STEP_UP2,
|
|
3
|
+
stepUpReducer2,
|
|
4
|
+
stepUpProps2
|
|
5
|
+
} from "./index-sxh06ged.js";
|
|
6
|
+
|
|
7
|
+
// src/session/react/step-up/answers.ts
|
|
8
|
+
var intentOf = (data) => typeof data === "object" && data !== null ? data.intent : undefined;
|
|
9
|
+
function requestAnswerOf2(data) {
|
|
10
|
+
return intentOf(data) === "request-step-up" ? data : undefined;
|
|
11
|
+
}
|
|
12
|
+
function confirmAnswerOf2(data) {
|
|
13
|
+
return intentOf(data) === "confirm-step-up" ? data : undefined;
|
|
14
|
+
}
|
|
15
|
+
// src/session/react/step-up/dialog-props.ts
|
|
16
|
+
function dialogPropsOf2(stepUp, open, cancel) {
|
|
17
|
+
return {
|
|
18
|
+
open,
|
|
19
|
+
phase: stepUp.phase,
|
|
20
|
+
via: stepUp.via,
|
|
21
|
+
props: stepUp.props,
|
|
22
|
+
message: stepUp.message,
|
|
23
|
+
busy: stepUp.busy,
|
|
24
|
+
confirming: stepUp.phase === "confirmed",
|
|
25
|
+
onCancel: cancel,
|
|
26
|
+
onRetry: () => stepUp.start(),
|
|
27
|
+
onSubmit: (code) => stepUp.submit(code),
|
|
28
|
+
onResend: stepUp.via === "email" ? () => stepUp.start() : undefined
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// src/session/react/step-up/phase.ts
|
|
32
|
+
function stepUpDialogPhase2(state) {
|
|
33
|
+
if (state.phase === "done")
|
|
34
|
+
return "confirmed";
|
|
35
|
+
if (state.challenge)
|
|
36
|
+
return "code";
|
|
37
|
+
if (state.error === "expired")
|
|
38
|
+
return "expired";
|
|
39
|
+
return state.error ? "failed" : "asking";
|
|
40
|
+
}
|
|
41
|
+
function asksStepUp2(answer) {
|
|
42
|
+
if (typeof answer !== "object" || answer === null)
|
|
43
|
+
return false;
|
|
44
|
+
const a = answer;
|
|
45
|
+
return !a.ok && Boolean(a.stepUp);
|
|
46
|
+
}
|
|
47
|
+
// src/session/react/step-up/use-step-up.ts
|
|
48
|
+
import { useEffect, useReducer, useRef } from "react";
|
|
49
|
+
function useStepUp2({ request, confirm, onConfirmed }) {
|
|
50
|
+
const [state, dispatch] = useReducer(stepUpReducer2, INITIAL_STEP_UP2);
|
|
51
|
+
const confirmedRun = useRef(onConfirmed);
|
|
52
|
+
confirmedRun.current = onConfirmed;
|
|
53
|
+
const live = useRef(false);
|
|
54
|
+
const handledRequest = useRef(request.answer);
|
|
55
|
+
const handledConfirm = useRef(confirm.answer);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const answer = request.answer;
|
|
58
|
+
if (!answer || handledRequest.current === answer)
|
|
59
|
+
return;
|
|
60
|
+
handledRequest.current = answer;
|
|
61
|
+
if (!live.current)
|
|
62
|
+
return;
|
|
63
|
+
dispatch({ type: "requested", answer });
|
|
64
|
+
}, [request.answer]);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const answer = confirm.answer;
|
|
67
|
+
if (!answer || handledConfirm.current === answer)
|
|
68
|
+
return;
|
|
69
|
+
handledConfirm.current = answer;
|
|
70
|
+
if (!live.current)
|
|
71
|
+
return;
|
|
72
|
+
dispatch({ type: "confirmed", answer });
|
|
73
|
+
if (answer.ok)
|
|
74
|
+
confirmedRun.current();
|
|
75
|
+
}, [confirm.answer]);
|
|
76
|
+
return {
|
|
77
|
+
phase: stepUpDialogPhase2(state),
|
|
78
|
+
via: state.via,
|
|
79
|
+
props: stepUpProps2(state),
|
|
80
|
+
message: state.message,
|
|
81
|
+
busy: request.busy || confirm.busy,
|
|
82
|
+
start() {
|
|
83
|
+
live.current = true;
|
|
84
|
+
dispatch({ type: "start" });
|
|
85
|
+
request.post({});
|
|
86
|
+
},
|
|
87
|
+
submit(code) {
|
|
88
|
+
if (!state.challenge)
|
|
89
|
+
return;
|
|
90
|
+
dispatch({ type: "submit" });
|
|
91
|
+
confirm.post({ challenge: state.challenge, code, via: state.via });
|
|
92
|
+
},
|
|
93
|
+
release() {
|
|
94
|
+
live.current = false;
|
|
95
|
+
request.reset?.();
|
|
96
|
+
confirm.reset?.();
|
|
97
|
+
handledRequest.current = request.answer;
|
|
98
|
+
handledConfirm.current = confirm.answer;
|
|
99
|
+
dispatch({ type: "release" });
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// src/session/react/step-up/use-step-up-replay.ts
|
|
104
|
+
import { useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
|
105
|
+
function useStepUpReplay2({
|
|
106
|
+
answer,
|
|
107
|
+
replay,
|
|
108
|
+
action,
|
|
109
|
+
spendsCode,
|
|
110
|
+
request,
|
|
111
|
+
confirm
|
|
112
|
+
}) {
|
|
113
|
+
const [open, setOpen] = useState(false);
|
|
114
|
+
const [confirmedNotice, setConfirmedNotice] = useState(false);
|
|
115
|
+
const isOpen = useRef2(false);
|
|
116
|
+
const replaying = useRef2(false);
|
|
117
|
+
const latest = useRef2({ replay, action, spendsCode });
|
|
118
|
+
latest.current = { replay, action, spendsCode };
|
|
119
|
+
function show(value) {
|
|
120
|
+
isOpen.current = value;
|
|
121
|
+
setOpen(value);
|
|
122
|
+
}
|
|
123
|
+
const noticeFor = useRef2(action);
|
|
124
|
+
useEffect2(() => {
|
|
125
|
+
if (noticeFor.current === action)
|
|
126
|
+
return;
|
|
127
|
+
noticeFor.current = action;
|
|
128
|
+
setConfirmedNotice(false);
|
|
129
|
+
}, [action]);
|
|
130
|
+
const stepUp = useStepUp2({
|
|
131
|
+
request,
|
|
132
|
+
confirm,
|
|
133
|
+
onConfirmed() {
|
|
134
|
+
if (!isOpen.current)
|
|
135
|
+
return;
|
|
136
|
+
const { replay, action, spendsCode } = latest.current;
|
|
137
|
+
const spent = stepUpRef.current.via === "secondFactor" && action !== undefined && spendsCode?.(action) === true;
|
|
138
|
+
if (spent) {
|
|
139
|
+
stepUpRef.current.release();
|
|
140
|
+
show(false);
|
|
141
|
+
setConfirmedNotice(true);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
replaying.current = true;
|
|
145
|
+
replay();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
const stepUpRef = useRef2(stepUp);
|
|
149
|
+
stepUpRef.current = stepUp;
|
|
150
|
+
const handled = useRef2(answer);
|
|
151
|
+
useEffect2(() => {
|
|
152
|
+
if (!answer || handled.current === answer)
|
|
153
|
+
return;
|
|
154
|
+
handled.current = answer;
|
|
155
|
+
if (asksStepUp2(answer)) {
|
|
156
|
+
replaying.current = false;
|
|
157
|
+
setConfirmedNotice(false);
|
|
158
|
+
show(true);
|
|
159
|
+
stepUpRef.current.start();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
setConfirmedNotice(false);
|
|
163
|
+
if (replaying.current) {
|
|
164
|
+
replaying.current = false;
|
|
165
|
+
show(false);
|
|
166
|
+
stepUpRef.current.release();
|
|
167
|
+
}
|
|
168
|
+
}, [answer]);
|
|
169
|
+
function cancel() {
|
|
170
|
+
replaying.current = false;
|
|
171
|
+
stepUp.release();
|
|
172
|
+
show(false);
|
|
173
|
+
setConfirmedNotice(false);
|
|
174
|
+
}
|
|
175
|
+
function dismissNotice() {
|
|
176
|
+
setConfirmedNotice(false);
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
open,
|
|
180
|
+
confirmedNotice,
|
|
181
|
+
dialogProps: dialogPropsOf2(stepUp, open, cancel),
|
|
182
|
+
cancel,
|
|
183
|
+
dismissNotice,
|
|
184
|
+
stepUp
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
// src/session/react/step-up/use-step-up-runner.ts
|
|
188
|
+
import { useCallback, useEffect as useEffect3, useRef as useRef3, useState as useState2 } from "react";
|
|
189
|
+
|
|
190
|
+
// src/session/react/step-up/pending-runs.ts
|
|
191
|
+
function isThenable(value) {
|
|
192
|
+
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
193
|
+
}
|
|
194
|
+
function pendingRuns() {
|
|
195
|
+
let pending;
|
|
196
|
+
let last;
|
|
197
|
+
let counter = 0;
|
|
198
|
+
return {
|
|
199
|
+
start(request, resolve, reject) {
|
|
200
|
+
pending = { n: ++counter, request, resolve, reject };
|
|
201
|
+
last = request;
|
|
202
|
+
},
|
|
203
|
+
current: () => pending?.request,
|
|
204
|
+
id: () => pending ? pending.n : 0,
|
|
205
|
+
last: () => last,
|
|
206
|
+
sent(n, sent) {
|
|
207
|
+
if (pending?.n === n)
|
|
208
|
+
pending.sent = sent;
|
|
209
|
+
},
|
|
210
|
+
settle(outcome) {
|
|
211
|
+
const current = pending;
|
|
212
|
+
pending = undefined;
|
|
213
|
+
current?.resolve(outcome);
|
|
214
|
+
return current !== undefined;
|
|
215
|
+
},
|
|
216
|
+
reject(error) {
|
|
217
|
+
const current = pending;
|
|
218
|
+
pending = undefined;
|
|
219
|
+
current?.reject(error);
|
|
220
|
+
},
|
|
221
|
+
replace() {
|
|
222
|
+
const current = pending;
|
|
223
|
+
pending = undefined;
|
|
224
|
+
if (!current)
|
|
225
|
+
return;
|
|
226
|
+
const own = current.sent;
|
|
227
|
+
if (!own)
|
|
228
|
+
return current.resolve("cancelled");
|
|
229
|
+
own.then((value) => current.resolve(value === undefined || asksStepUp2(value) ? "cancelled" : value), current.reject);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// src/session/react/step-up/use-step-up-runner.ts
|
|
235
|
+
function useStepUpRunner2({
|
|
236
|
+
answer,
|
|
237
|
+
post,
|
|
238
|
+
request,
|
|
239
|
+
confirm,
|
|
240
|
+
spendsCode
|
|
241
|
+
}) {
|
|
242
|
+
const runs = useRef3(pendingRuns()).current;
|
|
243
|
+
const poster = useRef3(post);
|
|
244
|
+
poster.current = post;
|
|
245
|
+
const [busy, setBusy] = useState2(false);
|
|
246
|
+
const [direct, setDirect] = useState2(undefined);
|
|
247
|
+
const mounted = useRef3(true);
|
|
248
|
+
const latest = useRef3(answer);
|
|
249
|
+
latest.current = answer;
|
|
250
|
+
const seen = useRef3(undefined);
|
|
251
|
+
const cancelReplay = useRef3(() => {});
|
|
252
|
+
const finishRef = useRef3(() => {});
|
|
253
|
+
const send = useCallback((req) => {
|
|
254
|
+
const id = runs.id();
|
|
255
|
+
const fail = (error) => {
|
|
256
|
+
if (runs.id() !== id)
|
|
257
|
+
return;
|
|
258
|
+
cancelReplay.current();
|
|
259
|
+
runs.reject(error);
|
|
260
|
+
if (mounted.current)
|
|
261
|
+
setBusy(false);
|
|
262
|
+
};
|
|
263
|
+
try {
|
|
264
|
+
const sent = poster.current(req);
|
|
265
|
+
if (!isThenable(sent))
|
|
266
|
+
return;
|
|
267
|
+
runs.sent(id, sent);
|
|
268
|
+
sent.then((value) => {
|
|
269
|
+
if (runs.id() !== id || value === undefined)
|
|
270
|
+
return;
|
|
271
|
+
setDirect(value);
|
|
272
|
+
if (!asksStepUp2(value))
|
|
273
|
+
finishRef.current(value);
|
|
274
|
+
}, fail);
|
|
275
|
+
} catch (error) {
|
|
276
|
+
fail(error);
|
|
277
|
+
}
|
|
278
|
+
}, [runs]);
|
|
279
|
+
const replay = useStepUpReplay2({
|
|
280
|
+
answer: direct ?? (runs.current() !== undefined && answer !== seen.current ? answer : undefined),
|
|
281
|
+
action: runs.last(),
|
|
282
|
+
replay() {
|
|
283
|
+
const current = runs.current();
|
|
284
|
+
if (current !== undefined) {
|
|
285
|
+
setDirect(undefined);
|
|
286
|
+
send(current);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
request,
|
|
290
|
+
confirm,
|
|
291
|
+
...spendsCode ? { spendsCode } : {}
|
|
292
|
+
});
|
|
293
|
+
cancelReplay.current = replay.cancel;
|
|
294
|
+
useEffect3(() => {
|
|
295
|
+
mounted.current = true;
|
|
296
|
+
return () => {
|
|
297
|
+
mounted.current = false;
|
|
298
|
+
runs.settle("cancelled");
|
|
299
|
+
};
|
|
300
|
+
}, [runs]);
|
|
301
|
+
const finish = useCallback((outcome) => {
|
|
302
|
+
if (runs.settle(outcome) && mounted.current)
|
|
303
|
+
setBusy(false);
|
|
304
|
+
}, [runs]);
|
|
305
|
+
finishRef.current = finish;
|
|
306
|
+
useEffect3(() => {
|
|
307
|
+
if (answer === undefined || asksStepUp2(answer))
|
|
308
|
+
return;
|
|
309
|
+
finish(answer);
|
|
310
|
+
}, [answer, finish]);
|
|
311
|
+
useEffect3(() => {
|
|
312
|
+
if (replay.confirmedNotice)
|
|
313
|
+
finish("cancelled");
|
|
314
|
+
}, [replay.confirmedNotice, finish]);
|
|
315
|
+
const run = useCallback((req) => new Promise((resolve, reject) => {
|
|
316
|
+
runs.replace();
|
|
317
|
+
cancelReplay.current();
|
|
318
|
+
setDirect(undefined);
|
|
319
|
+
seen.current = latest.current;
|
|
320
|
+
runs.start(req, resolve, reject);
|
|
321
|
+
setBusy(true);
|
|
322
|
+
send(req);
|
|
323
|
+
}), [runs, send]);
|
|
324
|
+
const cancel = useCallback(() => {
|
|
325
|
+
cancelReplay.current();
|
|
326
|
+
finish("cancelled");
|
|
327
|
+
}, [finish]);
|
|
328
|
+
return {
|
|
329
|
+
run,
|
|
330
|
+
busy,
|
|
331
|
+
dialogProps: { ...replay.dialogProps, onCancel: cancel },
|
|
332
|
+
cancel,
|
|
333
|
+
confirmedNotice: replay.confirmedNotice,
|
|
334
|
+
dismissNotice: replay.dismissNotice
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
export { requestAnswerOf2, confirmAnswerOf2, dialogPropsOf2, stepUpDialogPhase2, asksStepUp2, useStepUp2, useStepUpReplay2, useStepUpRunner2 };
|
|
338
|
+
|
|
339
|
+
//# debugId=1C93D5D00D71108864756E2164756E21
|
|
340
|
+
//# sourceMappingURL=index-8as4j8m3.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/session/react/step-up/answers.ts", "../src/session/react/step-up/dialog-props.ts", "../src/session/react/step-up/phase.ts", "../src/session/react/step-up/use-step-up.ts", "../src/session/react/step-up/use-step-up-replay.ts", "../src/session/react/step-up/use-step-up-runner.ts", "../src/session/react/step-up/pending-runs.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type {\n\tStepUpConfirmAnswer,\n\tStepUpRequestAnswer,\n} from '../../model/step-up-answers';\n\nconst intentOf = (data: unknown) =>\n\ttypeof data === 'object' && data !== null\n\t\t? (data as { intent?: unknown }).intent\n\t\t: undefined;\n\n/**\n * The step-up route answers both intents from one action, so a fetcher's data\n * is their union: this is the request's answer, or `undefined` for any other.\n */\nexport function requestAnswerOf(\n\tdata: unknown,\n): StepUpRequestAnswer | undefined {\n\treturn intentOf(data) === 'request-step-up'\n\t\t? (data as StepUpRequestAnswer)\n\t\t: undefined;\n}\n\n/** The confirm's answer out of the route's union, or `undefined` for any other. */\nexport function confirmAnswerOf(\n\tdata: unknown,\n): StepUpConfirmAnswer | undefined {\n\treturn intentOf(data) === 'confirm-step-up'\n\t\t? (data as StepUpConfirmAnswer)\n\t\t: undefined;\n}\n",
|
|
6
|
+
"import type { StepUpVia } from '../../model/second-factor';\nimport type { StepUpProps } from '../../model/step-up-props';\nimport type { StepUpDialogPhase } from './phase';\nimport type { useStepUp } from './use-step-up';\n\n/** What a step-up dialog is given: the phase to show and the handlers. */\nexport interface StepUpDialogProps {\n\topen: boolean;\n\tphase: StepUpDialogPhase;\n\t/** How the code is confirmed, in every phase once a challenge was granted (`undefined` before). */\n\tvia: StepUpVia | undefined;\n\t/** The words of the code form (`stepUpProps`). */\n\tprops: StepUpProps;\n\t/** The last refusal worded by the server. */\n\tmessage: string | undefined;\n\tbusy: boolean;\n\t/** The code was accepted and the action is being sent again. */\n\tconfirming: boolean;\n\tonCancel(): void;\n\t/** \"Retry\" after a refused request or an over challenge. */\n\tonRetry(): void;\n\tonSubmit(code: string): void;\n\t/** \"Resend code\", for a mailed code only. */\n\tonResend: (() => void) | undefined;\n}\n\n/** The dialog's props out of a step-up: plain, so any host can build them. */\nexport function dialogPropsOf(\n\tstepUp: ReturnType<typeof useStepUp>,\n\topen: boolean,\n\tcancel: () => void,\n): StepUpDialogProps {\n\treturn {\n\t\topen,\n\t\tphase: stepUp.phase,\n\t\tvia: stepUp.via,\n\t\tprops: stepUp.props,\n\t\tmessage: stepUp.message,\n\t\tbusy: stepUp.busy,\n\t\tconfirming: stepUp.phase === 'confirmed',\n\t\tonCancel: cancel,\n\t\tonRetry: () => stepUp.start(),\n\t\tonSubmit: (code) => stepUp.submit(code),\n\t\tonResend: stepUp.via === 'email' ? () => stepUp.start() : undefined,\n\t};\n}\n",
|
|
7
|
+
"import type { StepUpState } from '../../model/step-up';\n\n/** Where a step-up is, as a dialog shows it. */\nexport type StepUpDialogPhase =\n\t| 'asking'\n\t| 'failed'\n\t| 'code'\n\t| 'expired'\n\t| 'confirmed';\n\n/** The phase a reducer state is in: what the dialog shows. */\nexport function stepUpDialogPhase(state: StepUpState): StepUpDialogPhase {\n\tif (state.phase === 'done') return 'confirmed';\n\tif (state.challenge) return 'code';\n\tif (state.error === 'expired') return 'expired';\n\treturn state.error ? 'failed' : 'asking';\n}\n\n/** Whether an answer is a refusal asking for a step-up (`stepUp` set, not ok). */\nexport function asksStepUp(answer: unknown): boolean {\n\tif (typeof answer !== 'object' || answer === null) return false;\n\tconst a = answer as { ok?: unknown; stepUp?: unknown };\n\treturn !a.ok && Boolean(a.stepUp);\n}\n",
|
|
8
|
+
"import { useEffect, useReducer, useRef } from 'react';\nimport type { StepUpVia } from '../../model/second-factor';\nimport { INITIAL_STEP_UP, stepUpReducer } from '../../model/step-up';\nimport type {\n\tStepUpConfirmAnswer,\n\tStepUpRequestAnswer,\n} from '../../model/step-up-answers';\nimport { stepUpProps } from '../../model/step-up-props';\nimport { stepUpDialogPhase } from './phase';\n\n/**\n * One step-up intent as the host posts it: its own `post` (so the fields stay\n * typed by the host's action), the settled answer it got since it mounted\n * (`undefined` before), and whether it is in flight. `reset` forgets the\n * answer (a fetcher's `reset`).\n */\nexport interface StepUpChannel<Fields, Answer> {\n\tpost(fields: Fields): void;\n\treadonly answer: Answer | undefined;\n\treadonly busy: boolean;\n\treset?(): void;\n}\n\nexport interface StepUpOptions {\n\t/** Posts `{ intent: 'request-step-up' }`, to the route that serves `stepUpSteps().route`. */\n\trequest: StepUpChannel<Record<string, never>, StepUpRequestAnswer>;\n\t/** Posts `{ intent: 'confirm-step-up', challenge, code, via }`. */\n\tconfirm: StepUpChannel<\n\t\t{ challenge: string; code: string; via: StepUpVia | undefined },\n\t\tStepUpConfirmAnswer\n\t>;\n\t/** Runs once the API accepted the code. */\n\tonConfirmed(): void;\n}\n\n/**\n * The step-up as the page lives it, on `stepUpReducer`: `start` asks for a\n * challenge, `submit` posts the code, and once it is accepted `onConfirmed`\n * runs. The challenge lives in the reducer's state and the channels' answers\n * only; `release` forgets everything, and an answer that lands after it (a\n * request or a code in flight when the host closed) is ignored.\n */\nexport function useStepUp({ request, confirm, onConfirmed }: StepUpOptions) {\n\tconst [state, dispatch] = useReducer(stepUpReducer, INITIAL_STEP_UP);\n\tconst confirmedRun = useRef(onConfirmed);\n\tconfirmedRun.current = onConfirmed;\n\t// True from `start` to `release`: only then are answers this step-up's.\n\tconst live = useRef(false);\n\n\t// Each settled answer once, even one worded as the last (a new object).\n\tconst handledRequest = useRef(request.answer);\n\tconst handledConfirm = useRef(confirm.answer);\n\tuseEffect(() => {\n\t\tconst answer = request.answer;\n\t\tif (!answer || handledRequest.current === answer) return;\n\t\thandledRequest.current = answer;\n\t\tif (!live.current) return;\n\t\tdispatch({ type: 'requested', answer });\n\t}, [request.answer]);\n\tuseEffect(() => {\n\t\tconst answer = confirm.answer;\n\t\tif (!answer || handledConfirm.current === answer) return;\n\t\thandledConfirm.current = answer;\n\t\tif (!live.current) return;\n\t\tdispatch({ type: 'confirmed', answer });\n\t\tif (answer.ok) confirmedRun.current();\n\t}, [confirm.answer]);\n\n\treturn {\n\t\tphase: stepUpDialogPhase(state),\n\t\t/** How the challenge held (or the last one) is confirmed. */\n\t\tvia: state.via,\n\t\t/** What a dialog words its texts from (`stepUpProps`). */\n\t\tprops: stepUpProps(state),\n\t\t/** The last refusal worded by the server: the fallback of the dialog's own words. */\n\t\tmessage: state.message,\n\t\t/** A request or a code is in flight. */\n\t\tbusy: request.busy || confirm.busy,\n\t\t/** Asks for a challenge: the first, or \"Resend code\" / \"New code\". */\n\t\tstart() {\n\t\t\tlive.current = true;\n\t\t\tdispatch({ type: 'start' });\n\t\t\trequest.post({});\n\t\t},\n\t\t/** Posts the code for the challenge held. */\n\t\tsubmit(code: string) {\n\t\t\tif (!state.challenge) return;\n\t\t\tdispatch({ type: 'submit' });\n\t\t\tconfirm.post({ challenge: state.challenge, code, via: state.via });\n\t\t},\n\t\t/** Forgets the challenge, the answers and the errors. */\n\t\trelease() {\n\t\t\tlive.current = false;\n\t\t\trequest.reset?.();\n\t\t\tconfirm.reset?.();\n\t\t\thandledRequest.current = request.answer;\n\t\t\thandledConfirm.current = confirm.answer;\n\t\t\tdispatch({ type: 'release' });\n\t\t},\n\t};\n}\n",
|
|
9
|
+
"import { useEffect, useRef, useState } from 'react';\nimport { dialogPropsOf } from './dialog-props';\nimport { asksStepUp } from './phase';\nimport { type StepUpOptions, useStepUp } from './use-step-up';\n\nexport interface StepUpReplayOptions<Action>\n\textends Pick<StepUpOptions, 'request' | 'confirm'> {\n\t/**\n\t * The settled answer of the sensitive action. A refusal carrying `stepUp`\n\t * opens the step-up; the first answer after the replay closes it.\n\t */\n\tanswer: unknown;\n\t/** Sends the refused action again, once the session is confirmed. */\n\treplay(): void;\n\t/** The action that was refused, for `spendsCode`. */\n\taction?: Action | undefined;\n\t/**\n\t * Whether the action carries a one-time code that a step-up by the\n\t * second factor just spent. Such an action is not replayed: the dialog\n\t * closes and `confirmedNotice` is true (\"confirmed, type a new code\").\n\t * The notice clears when `action` becomes another value (a new action was\n\t * posted), at once and not at its answer, so pass the action as you post\n\t * it, a new object for each post.\n\t */\n\tspendsCode?(action: Action): boolean;\n}\n\n/**\n * The step-up a sensitive action asks for: an answer carrying `stepUp` opens\n * it; once the session is confirmed the same action is sent again by itself\n * (`replay`), except an action that `spendsCode` after a step-up by the\n * second factor, whose code was just spent: the user types the next one\n * (`confirmedNotice`). The dialog stays, saying so, until the replayed\n * action is answered; if that is refused for a step-up again, it asks again.\n * If `replay` posts nothing, no answer ends that wait: call `cancel()`.\n * Generic over the host's `post`s, so each intent keeps its typed fields.\n *\n * @example\n * const { open, dialogProps, cancel, confirmedNotice } = useStepUpReplay({\n * \tanswer: fetcher.data,\n * \treplay: () => post(lastAction.current),\n * \trequest: { post: () => stepUpPost({ intent: 'request-step-up' }), answer, busy },\n * \tconfirm: { post: (f) => stepUpPost({ intent: 'confirm-step-up', ...f }), answer, busy },\n * });\n */\nexport function useStepUpReplay<Action = never>({\n\tanswer,\n\treplay,\n\taction,\n\tspendsCode,\n\trequest,\n\tconfirm,\n}: StepUpReplayOptions<Action>) {\n\tconst [open, setOpen] = useState(false);\n\tconst [confirmedNotice, setConfirmedNotice] = useState(false);\n\tconst isOpen = useRef(false);\n\tconst replaying = useRef(false);\n\tconst latest = useRef({ replay, action, spendsCode });\n\tlatest.current = { replay, action, spendsCode };\n\n\tfunction show(value: boolean) {\n\t\tisOpen.current = value;\n\t\tsetOpen(value);\n\t}\n\n\t// The notice belongs to the action it was shown for: another action\n\t// posted clears it at once, not at that action's answer.\n\tconst noticeFor = useRef(action);\n\tuseEffect(() => {\n\t\tif (noticeFor.current === action) return;\n\t\tnoticeFor.current = action;\n\t\tsetConfirmedNotice(false);\n\t}, [action]);\n\n\tconst stepUp = useStepUp({\n\t\trequest,\n\t\tconfirm,\n\t\tonConfirmed() {\n\t\t\t// A code accepted after the host cancelled replays nothing.\n\t\t\tif (!isOpen.current) return;\n\t\t\tconst { replay, action, spendsCode } = latest.current;\n\t\t\tconst spent =\n\t\t\t\tstepUpRef.current.via === 'secondFactor' &&\n\t\t\t\taction !== undefined &&\n\t\t\t\tspendsCode?.(action) === true;\n\t\t\tif (spent) {\n\t\t\t\tstepUpRef.current.release();\n\t\t\t\tshow(false);\n\t\t\t\tsetConfirmedNotice(true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// The dialog stays, saying so, until the action is answered.\n\t\t\treplaying.current = true;\n\t\t\treplay();\n\t\t},\n\t});\n\tconst stepUpRef = useRef(stepUp);\n\tstepUpRef.current = stepUp;\n\n\t// Each answer once: a refusal asking for a step-up opens it; the answer\n\t// of the replayed action closes it (a new step-up opens it again).\n\tconst handled = useRef(answer);\n\tuseEffect(() => {\n\t\tif (!answer || handled.current === answer) return;\n\t\thandled.current = answer;\n\t\tif (asksStepUp(answer)) {\n\t\t\treplaying.current = false;\n\t\t\tsetConfirmedNotice(false);\n\t\t\tshow(true);\n\t\t\tstepUpRef.current.start();\n\t\t\treturn;\n\t\t}\n\t\tsetConfirmedNotice(false);\n\t\tif (replaying.current) {\n\t\t\treplaying.current = false;\n\t\t\tshow(false);\n\t\t\tstepUpRef.current.release();\n\t\t}\n\t}, [answer]);\n\n\tfunction cancel() {\n\t\treplaying.current = false;\n\t\tstepUp.release();\n\t\tshow(false);\n\t\tsetConfirmedNotice(false);\n\t}\n\n\t/** Clears `confirmedNotice` without sending or cancelling anything. */\n\tfunction dismissNotice() {\n\t\tsetConfirmedNotice(false);\n\t}\n\n\treturn {\n\t\topen,\n\t\t/** True after a step-up by the second factor spent the action's own code. */\n\t\tconfirmedNotice,\n\t\tdialogProps: dialogPropsOf(stepUp, open, cancel),\n\t\t/** Closes the dialog without sending the action again. */\n\t\tcancel,\n\t\tdismissNotice,\n\t\tstepUp,\n\t};\n}\n",
|
|
10
|
+
"import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { StepUpDialogProps } from './dialog-props';\nimport { isThenable, pendingRuns } from './pending-runs';\nimport { asksStepUp } from './phase';\nimport {\n\ttype StepUpReplayOptions,\n\tuseStepUpReplay,\n} from './use-step-up-replay';\n\nexport interface StepUpRunnerOptions<Request>\n\textends Pick<\n\t\tStepUpReplayOptions<Request>,\n\t\t'request' | 'confirm' | 'spendsCode'\n\t> {\n\t/**\n\t * The settled answer of the sensitive action: the fetcher's `data` once it\n\t * is idle (`fetcher.state === 'idle' ? fetcher.data : undefined`). A new\n\t * answer settles the pending run, unless it asks for a step-up.\n\t */\n\tanswer: unknown;\n\t/** Sends one request (a JSON submit of your fetcher). Also used for the replay. */\n\tpost(request: Request): void | Promise<unknown>;\n}\n\n/**\n * Runs sensitive actions as promises. `run(request)` posts the request and\n * resolves with the answer that settles it, or with `'cancelled'` when the\n * step-up dialog is cancelled or another `run` replaces it. An answer asking\n * for a step-up opens the dialog and keeps the promise pending; once the\n * session is confirmed the same request is posted again and its answer\n * settles the run. One dialog serves every feature that shares the runner.\n *\n * `post` may return a promise of the outcome (`post: (r) => save(r)`, then\n * `await run(input)`): when it resolves with a value, the run settles with\n * it, a refusal asking for a step-up included (it opens the dialog and the\n * replay's value settles the run). A promise resolving with `undefined` (a\n * fetcher's `submit`) leaves the settling to the `answer` channel. An error\n * thrown by `post`, synchronously or as a rejection (the replay included),\n * rejects `run()` and clears `busy`.\n *\n * A run replaced by another `run` settles with its own action's outcome once\n * its promise arrives (or rejects with its error), so a replaced fetcher\n * `submit` resolves `'cancelled'` once that promise settles; when its `post`\n * returned no promise it resolves `'cancelled'` at once. Its late value never settles the next run.\n *\n * `run` keeps one identity for the life of the component and reads the latest\n * `post`. Not tied to a UI library: `dialogProps` are plain.\n *\n * One runner is backed by one fetcher key (one fetcher): a new submit on a\n * fetcher supersedes the one in flight, so the answer of a replaced run never\n * arrives to settle the run that replaced it. A run pending when the component\n * unmounts resolves as `'cancelled'`. When the step-up spent the action's own\n * code (`spendsCode`), the run resolves as `'cancelled'` and `confirmedNotice`\n * is true: the page shows \"confirmed, type a new code\".\n *\n * @example\n * const fetcher = useFetcher<Outcome>({ key: 'item-actions' });\n * const { run, busy, dialogProps } = useStepUpRunner<ItemRequest, Outcome>({\n * \tanswer: fetcher.state === 'idle' ? fetcher.data : undefined,\n * \tpost: (r) => void fetcher.submit(r, { method: 'post', encType: 'application/json' }),\n * \trequest, // the step-up channels, as for useStepUpReplay\n * \tconfirm,\n * });\n * const outcome = await run({ intent: 'remove', id });\n * if (outcome !== 'cancelled' && outcome.ok) { ... }\n * return <StepUpDialog {...dialogProps} />;\n */\nexport function useStepUpRunner<Request, Outcome = unknown>({\n\tanswer,\n\tpost,\n\trequest,\n\tconfirm,\n\tspendsCode,\n}: StepUpRunnerOptions<Request>): {\n\t/** Posts the request; resolves with its outcome, or `'cancelled'`. */\n\trun(request: Request): Promise<Outcome | 'cancelled'>;\n\t/** A run is pending (posted, or waiting behind the step-up). */\n\tbusy: boolean;\n\t/** Props of your step-up dialog; its `onCancel` also cancels the pending run. */\n\tdialogProps: StepUpDialogProps;\n\t/** Cancels the pending run and closes the dialog. */\n\tcancel(): void;\n\t/** A second-factor step-up spent the request's code: the run is cancelled, ask for a new code. */\n\tconfirmedNotice: boolean;\n\t/** Clears `confirmedNotice` without starting a run. */\n\tdismissNotice(): void;\n} {\n\tconst runs = useRef(pendingRuns<Request, Outcome>()).current;\n\tconst poster = useRef(post);\n\tposter.current = post;\n\tconst [busy, setBusy] = useState(false);\n\t// A step-up refusal that `post` returned itself (not through `answer`).\n\tconst [direct, setDirect] = useState<unknown>(undefined);\n\tconst mounted = useRef(true);\n\tconst latest = useRef(answer);\n\tlatest.current = answer;\n\t// The answer held when the pending run started: it is not that run's answer.\n\tconst seen = useRef<unknown>(undefined);\n\tconst cancelReplay = useRef<() => void>(() => {});\n\tconst finishRef = useRef<(o: Outcome | 'cancelled') => void>(() => {});\n\n\t// Sends the pending run's request; its own promise, when `post` returns\n\t// one, settles it (or rejects it) while it is still the pending run.\n\tconst send = useCallback(\n\t\t(req: Request) => {\n\t\t\tconst id = runs.id();\n\t\t\tconst fail = (error: unknown) => {\n\t\t\t\tif (runs.id() !== id) return;\n\t\t\t\tcancelReplay.current();\n\t\t\t\truns.reject(error);\n\t\t\t\tif (mounted.current) setBusy(false);\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tconst sent = poster.current(req);\n\t\t\t\tif (!isThenable(sent)) return;\n\t\t\t\truns.sent(id, sent);\n\t\t\t\tsent.then((value) => {\n\t\t\t\t\tif (runs.id() !== id || value === undefined) return;\n\t\t\t\t\t// The replay hook sees it too: a refusal opens the step-up, any\n\t\t\t\t\t// other value closes the one waiting on the replay.\n\t\t\t\t\tsetDirect(value);\n\t\t\t\t\tif (!asksStepUp(value)) finishRef.current(value as Outcome);\n\t\t\t\t}, fail);\n\t\t\t} catch (error) {\n\t\t\t\tfail(error);\n\t\t\t}\n\t\t},\n\t\t[runs],\n\t);\n\n\tconst replay = useStepUpReplay<Request>({\n\t\t// Only the answers of the pending run can open the step-up dialog.\n\t\tanswer:\n\t\t\tdirect ??\n\t\t\t(runs.current() !== undefined && answer !== seen.current\n\t\t\t\t? answer\n\t\t\t\t: undefined),\n\t\taction: runs.last(),\n\t\treplay() {\n\t\t\tconst current = runs.current();\n\t\t\tif (current !== undefined) {\n\t\t\t\tsetDirect(undefined);\n\t\t\t\tsend(current);\n\t\t\t}\n\t\t},\n\t\trequest,\n\t\tconfirm,\n\t\t...(spendsCode ? { spendsCode } : {}),\n\t});\n\tcancelReplay.current = replay.cancel;\n\n\tuseEffect(() => {\n\t\tmounted.current = true;\n\t\treturn () => {\n\t\t\tmounted.current = false;\n\t\t\truns.settle('cancelled');\n\t\t};\n\t}, [runs]);\n\n\tconst finish = useCallback(\n\t\t(outcome: Outcome | 'cancelled') => {\n\t\t\tif (runs.settle(outcome) && mounted.current) setBusy(false);\n\t\t},\n\t\t[runs],\n\t);\n\tfinishRef.current = finish;\n\n\tuseEffect(() => {\n\t\tif (answer === undefined || asksStepUp(answer)) return;\n\t\tfinish(answer as Outcome);\n\t}, [answer, finish]);\n\n\t// The code was spent by the step-up: nothing is replayed.\n\tuseEffect(() => {\n\t\tif (replay.confirmedNotice) finish('cancelled');\n\t}, [replay.confirmedNotice, finish]);\n\n\tconst run = useCallback(\n\t\t(req: Request) =>\n\t\t\tnew Promise<Outcome | 'cancelled'>((resolve, reject) => {\n\t\t\t\t// A replaced run is closed with its own outcome, and its step-up\n\t\t\t\t// is closed, never left hanging.\n\t\t\t\truns.replace();\n\t\t\t\tcancelReplay.current();\n\t\t\t\tsetDirect(undefined);\n\t\t\t\tseen.current = latest.current;\n\t\t\t\truns.start(req, resolve, reject);\n\t\t\t\tsetBusy(true);\n\t\t\t\tsend(req);\n\t\t\t}),\n\t\t[runs, send],\n\t);\n\n\tconst cancel = useCallback(() => {\n\t\tcancelReplay.current();\n\t\tfinish('cancelled');\n\t}, [finish]);\n\n\treturn {\n\t\trun,\n\t\tbusy,\n\t\tdialogProps: { ...replay.dialogProps, onCancel: cancel },\n\t\tcancel,\n\t\tconfirmedNotice: replay.confirmedNotice,\n\t\tdismissNotice: replay.dismissNotice,\n\t};\n}\n",
|
|
11
|
+
"import { asksStepUp } from './phase';\n\nexport function isThenable(value: unknown): value is PromiseLike<unknown> {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof (value as { then?: unknown }).then === 'function'\n\t);\n}\n\n/** The one pending run: its request (kept as `last` for the replay hook), its settle and its own promise. */\nexport function pendingRuns<Request, Outcome>() {\n\tinterface Pending {\n\t\tn: number;\n\t\trequest: Request;\n\t\tresolve(o: Outcome | 'cancelled'): void;\n\t\treject(error: unknown): void;\n\t\tsent?: PromiseLike<unknown>;\n\t}\n\tlet pending: Pending | undefined;\n\tlet last: Request | undefined;\n\tlet counter = 0;\n\treturn {\n\t\tstart(\n\t\t\trequest: Request,\n\t\t\tresolve: (o: Outcome | 'cancelled') => void,\n\t\t\treject: (error: unknown) => void,\n\t\t) {\n\t\t\tpending = { n: ++counter, request, resolve, reject };\n\t\t\tlast = request;\n\t\t},\n\t\tcurrent: () => pending?.request,\n\t\t/** The pending run's number, to tell it from the one that replaced it. */\n\t\tid: () => (pending ? pending.n : 0),\n\t\tlast: () => last,\n\t\t/** Keeps the promise `post` returned for the run `n`, if still pending. */\n\t\tsent(n: number, sent: PromiseLike<unknown>) {\n\t\t\tif (pending?.n === n) pending.sent = sent;\n\t\t},\n\t\t/** Settles the pending run; false when none was pending. */\n\t\tsettle(outcome: Outcome | 'cancelled') {\n\t\t\tconst current = pending;\n\t\t\tpending = undefined;\n\t\t\tcurrent?.resolve(outcome);\n\t\t\treturn current !== undefined;\n\t\t},\n\t\t/** Rejects the pending run with the error of its `post`. */\n\t\treject(error: unknown) {\n\t\t\tconst current = pending;\n\t\t\tpending = undefined;\n\t\t\tcurrent?.reject(error);\n\t\t},\n\t\t/**\n\t\t * Closes the pending run for a new one: it settles with its own\n\t\t * promise's outcome (or error) when `post` returned one, else cancelled.\n\t\t */\n\t\treplace() {\n\t\t\tconst current = pending;\n\t\t\tpending = undefined;\n\t\t\tif (!current) return;\n\t\t\tconst own = current.sent;\n\t\t\tif (!own) return current.resolve('cancelled');\n\t\t\town.then(\n\t\t\t\t(value) =>\n\t\t\t\t\tcurrent.resolve(\n\t\t\t\t\t\tvalue === undefined || asksStepUp(value)\n\t\t\t\t\t\t\t? 'cancelled'\n\t\t\t\t\t\t\t: (value as Outcome),\n\t\t\t\t\t),\n\t\t\t\tcurrent.reject,\n\t\t\t);\n\t\t},\n\t};\n}\n"
|
|
12
|
+
],
|
|
13
|
+
"mappings": ";;;;;;;AAKA,IAAM,WAAW,CAAC,SACjB,OAAO,SAAS,YAAY,SAAS,OACjC,KAA8B,SAC/B;AAMG,SAAS,gBAAe,CAC9B,MACkC;AAAA,EAClC,OAAO,SAAS,IAAI,MAAM,oBACtB,OACD;AAAA;AAIG,SAAS,gBAAe,CAC9B,MACkC;AAAA,EAClC,OAAO,SAAS,IAAI,MAAM,oBACtB,OACD;AAAA;;ACDG,SAAS,cAAa,CAC5B,QACA,MACA,QACoB;AAAA,EACpB,OAAO;AAAA,IACN;AAAA,IACA,OAAO,OAAO;AAAA,IACd,KAAK,OAAO;AAAA,IACZ,OAAO,OAAO;AAAA,IACd,SAAS,OAAO;AAAA,IAChB,MAAM,OAAO;AAAA,IACb,YAAY,OAAO,UAAU;AAAA,IAC7B,UAAU;AAAA,IACV,SAAS,MAAM,OAAO,MAAM;AAAA,IAC5B,UAAU,CAAC,SAAS,OAAO,OAAO,IAAI;AAAA,IACtC,UAAU,OAAO,QAAQ,UAAU,MAAM,OAAO,MAAM,IAAI;AAAA,EAC3D;AAAA;;ACjCM,SAAS,kBAAiB,CAAC,OAAuC;AAAA,EACxE,IAAI,MAAM,UAAU;AAAA,IAAQ,OAAO;AAAA,EACnC,IAAI,MAAM;AAAA,IAAW,OAAO;AAAA,EAC5B,IAAI,MAAM,UAAU;AAAA,IAAW,OAAO;AAAA,EACtC,OAAO,MAAM,QAAQ,WAAW;AAAA;AAI1B,SAAS,WAAU,CAAC,QAA0B;AAAA,EACpD,IAAI,OAAO,WAAW,Y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EA,MAAM,SAAS,YAAY,MAAM;AAAA,IAChC,aAAa,QAAQ;AAAA,IACrB,OAAO,WAAW;AAAA,KAChB,CAAC,MAAM,CAAC;AAAA,EAEX,OAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA,aAAa,KAAK,OAAO,aAAa,UAAU,OAAO;AAAA,IACvD;AAAA,IACA,iBAAiB,OAAO;AAAA,IACxB,eAAe,OAAO;AAAA,EACvB;AAAA;",
|
|
14
|
+
"debugId": "1C93D5D00D71108864756E2164756E21",
|
|
15
|
+
"names": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SERVICE_WORKER_URL2,
|
|
3
|
+
SKIP_WAITING2
|
|
4
|
+
} from "./index-rfr02vg4.js";
|
|
5
|
+
|
|
6
|
+
// src/pwa/model/registration.ts
|
|
7
|
+
function watchForUpdates2(registration, container, onWaiting) {
|
|
8
|
+
const offer = (worker) => {
|
|
9
|
+
if (worker && container.controller)
|
|
10
|
+
onWaiting(worker);
|
|
11
|
+
};
|
|
12
|
+
offer(registration.waiting);
|
|
13
|
+
registration.addEventListener("updatefound", () => {
|
|
14
|
+
const installing = registration.installing;
|
|
15
|
+
installing?.addEventListener("statechange", () => {
|
|
16
|
+
if (installing.state === "installed")
|
|
17
|
+
offer(installing);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function createUpdater2(container, reload = () => window.location.reload()) {
|
|
22
|
+
let requested = false;
|
|
23
|
+
let reloaded = false;
|
|
24
|
+
const reloadOnce = () => {
|
|
25
|
+
if (reloaded)
|
|
26
|
+
return;
|
|
27
|
+
reloaded = true;
|
|
28
|
+
reload();
|
|
29
|
+
};
|
|
30
|
+
container.addEventListener("controllerchange", () => {
|
|
31
|
+
if (requested)
|
|
32
|
+
reloadOnce();
|
|
33
|
+
});
|
|
34
|
+
return (worker) => {
|
|
35
|
+
const active = worker.state === "activating" || worker.state === "activated" || container.controller === worker;
|
|
36
|
+
if (active)
|
|
37
|
+
return reloadOnce();
|
|
38
|
+
requested = true;
|
|
39
|
+
worker.postMessage({ type: SKIP_WAITING2 });
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function afterLoad2(run) {
|
|
43
|
+
if (document.readyState === "complete")
|
|
44
|
+
run();
|
|
45
|
+
else
|
|
46
|
+
window.addEventListener("load", run, { once: true });
|
|
47
|
+
}
|
|
48
|
+
var updater;
|
|
49
|
+
async function registerServiceWorker2(container, onWaiting, options = {}) {
|
|
50
|
+
updater ??= createUpdater2(container);
|
|
51
|
+
const apply = updater;
|
|
52
|
+
const registration = await container.register(options.url ?? SERVICE_WORKER_URL2, { scope: options.scope ?? "/" });
|
|
53
|
+
watchForUpdates2(registration, container, (worker) => onWaiting(worker, apply));
|
|
54
|
+
document.addEventListener("visibilitychange", () => {
|
|
55
|
+
if (document.visibilityState === "visible")
|
|
56
|
+
registration.update().catch(() => {});
|
|
57
|
+
});
|
|
58
|
+
return registration;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/pwa/model/update-notice.ts
|
|
62
|
+
var UPDATE_LATER_KEY2 = "alxia.update-later";
|
|
63
|
+
function createUpdateNotice2(storage, key = UPDATE_LATER_KEY2) {
|
|
64
|
+
let reload;
|
|
65
|
+
let laterThisPage = false;
|
|
66
|
+
let notice;
|
|
67
|
+
const listeners = new Set;
|
|
68
|
+
const later = () => {
|
|
69
|
+
laterThisPage = true;
|
|
70
|
+
try {
|
|
71
|
+
storage()?.setItem(key, "1");
|
|
72
|
+
} catch {}
|
|
73
|
+
refresh();
|
|
74
|
+
};
|
|
75
|
+
const laterAsked = () => {
|
|
76
|
+
if (laterThisPage)
|
|
77
|
+
return true;
|
|
78
|
+
try {
|
|
79
|
+
return storage()?.getItem(key) === "1";
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
function refresh() {
|
|
85
|
+
notice = reload && !laterAsked() ? { reload, later } : undefined;
|
|
86
|
+
for (const listener of listeners)
|
|
87
|
+
listener();
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
offer(apply) {
|
|
91
|
+
reload = apply;
|
|
92
|
+
refresh();
|
|
93
|
+
},
|
|
94
|
+
current: () => notice,
|
|
95
|
+
subscribe(listener) {
|
|
96
|
+
listeners.add(listener);
|
|
97
|
+
return () => {
|
|
98
|
+
listeners.delete(listener);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
var sessionStore2 = () => typeof sessionStorage === "undefined" ? undefined : sessionStorage;
|
|
104
|
+
|
|
105
|
+
export { watchForUpdates2, createUpdater2, afterLoad2, registerServiceWorker2, UPDATE_LATER_KEY2, createUpdateNotice2, sessionStore2 };
|
|
106
|
+
|
|
107
|
+
//# debugId=824F7298E795FD3C64756E2164756E21
|
|
108
|
+
//# sourceMappingURL=index-9xv2a8et.js.map
|