@sonordev/site-kit 8.8.1 → 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +9 -0
- package/agent-manifest.json +49 -42
- package/dist/AddressAutocomplete-LQS6GQ4R.js +241 -0
- package/dist/AnalyticsProvider-JWS7BLFY.js +19 -0
- package/dist/{ArticleViewTracker-PV2RD3P6.js → ArticleViewTracker-CDPVMUAO.js} +11 -10
- package/dist/{BlocksPopup-NEEFV2L3.js → BlocksPopup-C5PNJ7U6.js} +4 -5
- package/dist/ChatWidget-HEPOE3YC.js +30 -0
- package/dist/{FileField-MJ3RCNFJ.js → FileField-6R5LS5NU.js} +1 -3
- package/dist/{FormSpotlight-NQPQFZS7.js → FormSpotlight-2BSE7PD2.js} +5 -4
- package/dist/{FormStage-4T5PJR5K.js → FormStage-3G46OPPO.js} +5 -4
- package/dist/ManagedForm-LTXEU25N.js +29 -0
- package/dist/{ManagedNewsletterForm-TUYGN6O3.js → ManagedNewsletterForm-WE6P5DMV.js} +21 -11
- package/dist/{SignalCore-OW3YIH6M.js → SignalCore-IP7FE6SN.js} +90 -36
- package/dist/{SiteChat-XMKHBSEK.js → SiteChat-3FQYMHCP.js} +2 -2
- package/dist/{SiteDesignReporter-BRH7ORQS.js → SiteDesignReporter-HGTX4FX2.js} +5 -6
- package/dist/SitePopups-V7MCNSGE.js +19 -0
- package/dist/SitemapSync-OAJ7SIET.js +7 -0
- package/dist/SitemapSync.d.ts +1 -1
- package/dist/_client/booking-widget.d.ts +1 -1
- package/dist/_client/booking-widget.js +6 -7
- package/dist/_client/reviewed-signal-experiment.d.ts +9 -0
- package/dist/_client/reviewed-signal-experiment.js +89 -0
- package/dist/_client/testimonial-section.d.ts +1 -1
- package/dist/admin-auth/index.d.ts +3 -3
- package/dist/affiliates/AffiliatesWidget.d.ts +1 -1
- package/dist/affiliates/api.d.ts +1 -1
- package/dist/affiliates/index.d.ts +6 -6
- package/dist/affiliates/index.js +1 -3
- package/dist/affiliates/useAffiliates.d.ts +1 -1
- package/dist/analytics/AnalyticsProvider.d.ts +1 -1
- package/dist/analytics/dispatch.d.ts +1 -1
- package/dist/analytics/index.d.ts +6 -6
- package/dist/analytics/index.js +22 -12
- package/dist/analytics/publication-cta.d.ts +1 -1
- package/dist/analytics/send-gate.d.ts +8 -4
- package/dist/api-X6N6V2H3.js +5 -0
- package/dist/articles/Article.d.ts +1 -1
- package/dist/articles/ArticleFAQ.d.ts +1 -1
- package/dist/articles/ArticleFaqSection.d.ts +1 -1
- package/dist/articles/ArticleList.d.ts +1 -1
- package/dist/articles/ArticleViewTracker.d.ts +1 -1
- package/dist/articles/AuthorCard.d.ts +1 -1
- package/dist/articles/AuthorPage.d.ts +1 -1
- package/dist/articles/ClusterLandingPage.d.ts +1 -1
- package/dist/articles/ClusterNavigation.d.ts +1 -1
- package/dist/articles/ManagedNewsletterForm.d.ts +2 -2
- package/dist/articles/NewsletterShell.d.ts +1 -1
- package/dist/articles/NewsletterWidget.d.ts +1 -1
- package/dist/articles/PublicationLayout.d.ts +1 -1
- package/dist/articles/PublicationSidebar.d.ts +1 -1
- package/dist/articles/RelatedPosts.d.ts +1 -1
- package/dist/articles/ServiceCallout.d.ts +1 -1
- package/dist/articles/TableOfContents.d.ts +1 -1
- package/dist/articles/article-photos.d.ts +1 -1
- package/dist/articles/article-styles.d.ts +1 -1
- package/dist/articles/article-tables.d.ts +1 -1
- package/dist/articles/artwork.d.ts +1 -1
- package/dist/articles/author-schema.d.ts +1 -1
- package/dist/articles/author-social.d.ts +1 -1
- package/dist/articles/excerpt.d.ts +1 -1
- package/dist/articles/index.d.ts +1 -1
- package/dist/articles/index.js +3 -3
- package/dist/articles/news-sitemap.d.ts +1 -1
- package/dist/articles/processArticleHtml.d.ts +1 -1
- package/dist/articles/public-reads.d.ts +1 -1
- package/dist/articles/reading-time.d.ts +1 -1
- package/dist/articles/routes.d.ts +1 -1
- package/dist/articles/server-core.d.ts +1 -1
- package/dist/articles/server-ui.d.ts +1 -1
- package/dist/articles/server-ui.js +6 -6
- package/dist/articles/server.d.ts +1 -1
- package/dist/articles/server.js +5 -5
- package/dist/articles/types.d.ts +1 -1
- package/dist/articles/widget-styles.d.ts +1 -1
- package/dist/brand/extract-brand-profile.d.ts +1 -1
- package/dist/chat/ChatWidget.d.ts +1 -1
- package/dist/chat/EchoUiActions.d.ts +1 -1
- package/dist/chat/SiteChat.d.ts +2 -2
- package/dist/chat/chat-messages.d.ts +1 -1
- package/dist/chat/index.d.ts +7 -7
- package/dist/chat/index.js +17 -9
- package/dist/chat/launcher-placement.d.ts +1 -1
- package/dist/{chunk-OPUY4RS6.js → chunk-2LBKIE2K.js} +2 -1
- package/dist/chunk-3RBOES2C.js +36 -0
- package/dist/{chunk-XIDWNXZN.js → chunk-3W3MN6Z7.js} +2 -2
- package/dist/{chunk-CVADNHJ4.js → chunk-3WMNHFZH.js} +9 -0
- package/dist/chunk-533ZSRJF.js +147 -0
- package/dist/{chunk-UPFU63L4.js → chunk-55GFMOI6.js} +1 -1
- package/dist/chunk-5IVD6G77.js +37 -0
- package/dist/chunk-6CIO4X6P.js +77 -0
- package/dist/{chunk-G7BRCSV6.js → chunk-727353NY.js} +11 -7
- package/dist/{chunk-PSS6M4CG.js → chunk-75N2WALV.js} +2 -2
- package/dist/{chunk-ZQSCMYZO.js → chunk-7643MCD2.js} +6 -3
- package/dist/chunk-7IZUUXXO.js +1 -0
- package/dist/{chunk-GXWM5KNS.js → chunk-7PWXPN53.js} +40 -45
- package/dist/{chunk-C7TLGL3R.js → chunk-7VMA3KCN.js} +30 -4
- package/dist/{chunk-IDC5CVBR.js → chunk-A66TIJWU.js} +1 -1
- package/dist/chunk-ACZ5JNSL.js +78 -0
- package/dist/chunk-AG2RDHYZ.js +45 -0
- package/dist/{chunk-LNSNA3W4.js → chunk-C4XK472G.js} +4 -3
- package/dist/chunk-D4M5K6JN.js +25 -0
- package/dist/{chunk-F6WLHVMQ.js → chunk-D4R3FQED.js} +1 -1
- package/dist/{chunk-URLTBVRX.js → chunk-DW5X4BC7.js} +3 -3
- package/dist/chunk-FRY6PBT6.js +31 -0
- package/dist/{chunk-JYITKUUB.js → chunk-G5WUX7VE.js} +1 -1
- package/dist/{chunk-VPZJ7ZTL.js → chunk-HHEDRZOJ.js} +1 -1
- package/dist/{chunk-2WM4TNDF.js → chunk-HLN7A4GL.js} +1 -1
- package/dist/{chunk-DYROJGI2.js → chunk-HNVLINPI.js} +1 -1
- package/dist/{chunk-NFGAXWCN.js → chunk-J4R7MHV2.js} +31 -13
- package/dist/chunk-JT7GHHMV.js +56 -0
- package/dist/chunk-KMNHNCVG.js +20 -0
- package/dist/chunk-KQKUXIUD.js +25 -0
- package/dist/chunk-MDBXGN6W.js +13 -0
- package/dist/{chunk-IWNJCRXW.js → chunk-MIKVCYGX.js} +125 -118
- package/dist/{chunk-GQN4BGK6.js → chunk-MKU5ZORB.js} +2 -31
- package/dist/chunk-MOACHHOJ.js +20 -0
- package/dist/{chunk-M5JIHQ42.js → chunk-NBNDH2J6.js} +2 -2
- package/dist/{chunk-YRQS7VAH.js → chunk-NH7K252M.js} +6 -4
- package/dist/chunk-NHDRA4Y5.js +6 -0
- package/dist/{chunk-SLFYTELD.js → chunk-NWEIHCSE.js} +3 -1
- package/dist/{chunk-EATJPSTS.js → chunk-O5LQUBBN.js} +1 -1
- package/dist/chunk-OCNODBH4.js +2 -0
- package/dist/{chunk-TP32MRXV.js → chunk-OEHIXCYS.js} +2 -2
- package/dist/{chunk-Y6SHFILE.js → chunk-OEOSR5EG.js} +1 -1
- package/dist/{chunk-KG5IEV7I.js → chunk-ORSQKTMN.js} +1 -1
- package/dist/{chunk-SVHPILS3.js → chunk-P7S45DD7.js} +1 -1
- package/dist/chunk-PVY7X5UR.js +21 -0
- package/dist/{chunk-HN7GVGWC.js → chunk-Q2OE32TH.js} +3 -3
- package/dist/chunk-RMPXSEEU.js +62 -0
- package/dist/{chunk-THXELZTQ.js → chunk-RUV6DCKL.js} +1 -1
- package/dist/{chunk-2WDWQI7K.js → chunk-RYR6N4X4.js} +1 -1
- package/dist/{chunk-ODOV76VW.js → chunk-STIVFCWM.js} +1 -1
- package/dist/{chunk-6BFQI3ZE.js → chunk-TLKLHSRJ.js} +2 -2
- package/dist/chunk-TPHOIE4I.js +73 -0
- package/dist/{chunk-SBPUFTMP.js → chunk-UMF5OILQ.js} +2 -2
- package/dist/chunk-WYNDBJG7.js +66 -0
- package/dist/{chunk-OWZWRP7Y.js → chunk-XAPSYDVT.js} +2 -2
- package/dist/{chunk-PAYCK7FC.js → chunk-XJZLXUTG.js} +1 -1
- package/dist/{chunk-YEX5RAEU.js → chunk-Y7DZ2ND2.js} +38 -27
- package/dist/{chunk-AYQEIMGS.js → chunk-YJ6PRJ7Y.js} +103 -22
- package/dist/chunk-Z4XJOVQX.js +9 -0
- package/dist/{chunk-6DXQHNZK.js → chunk-Z62W7Q3T.js} +1 -1
- package/dist/client/index.d.ts +8 -8
- package/dist/client/index.js +9 -8
- package/dist/config/index.d.ts +1 -1
- package/dist/contracts/broadcast-layouts.d.ts +8 -0
- package/dist/contracts/crm-disposition.d.ts +87 -0
- package/dist/contracts/decision-roles.d.ts +39 -0
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/funnels.d.ts +85 -2
- package/dist/contracts/portfolio.d.ts +1 -1
- package/dist/contracts/publication-branding.d.ts +3 -3
- package/dist/contracts/resonance-constants.d.ts +4 -0
- package/dist/contracts/resonance.d.ts +8461 -0
- package/dist/contracts/signal-experiments.d.ts +219 -0
- package/dist/contracts/site-edit.d.ts +2 -2
- package/dist/contracts/sites.d.ts +1 -1
- package/dist/contracts/slots.d.ts +2 -2
- package/dist/contracts/wire-schema.d.ts +36 -0
- package/dist/controls-KLG6VQLO.js +14 -0
- package/dist/cta-bar/CtaBar.d.ts +1 -1
- package/dist/cta-bar/client.js +3 -2
- package/dist/cta-bar/index.d.ts +4 -4
- package/dist/cta-bar/index.js +4 -3
- package/dist/fleet/FleetHeartbeat.d.ts +2 -2
- package/dist/fleet/contract.d.ts +1 -1
- package/dist/fleet/heartbeat.d.ts +2 -2
- package/dist/fleet/index.d.ts +6 -6
- package/dist/fleet/index.js +4 -5
- package/dist/forms/AddressAutocomplete.d.ts +20 -0
- package/dist/forms/FileField.d.ts +1 -1
- package/dist/forms/FormClient.d.ts +4 -3
- package/dist/forms/FormEnhancer.d.ts +3 -2
- package/dist/forms/FormField.d.ts +3 -1
- package/dist/forms/FormSpotlight.d.ts +2 -2
- package/dist/forms/FormStage.d.ts +2 -2
- package/dist/forms/ManagedForm.d.ts +2 -2
- package/dist/forms/PrivateFileField.d.ts +1 -1
- package/dist/forms/ServerForm.d.ts +5 -4
- package/dist/forms/StaticForm.d.ts +1 -1
- package/dist/forms/contract.d.ts +1 -1
- package/dist/forms/controls.d.ts +5 -0
- package/dist/forms/experience-plan.d.ts +1 -1
- package/dist/forms/field-autocomplete.d.ts +1 -1
- package/dist/forms/field-controls.d.ts +4 -2
- package/dist/forms/field-rules.d.ts +1 -1
- package/dist/forms/form-dom-values.d.ts +1 -1
- package/dist/forms/index.d.ts +18 -18
- package/dist/forms/index.js +21 -11
- package/dist/forms/normalize-config.d.ts +1 -1
- package/dist/forms/server.d.ts +4 -4
- package/dist/forms/server.js +5 -5
- package/dist/forms/static.d.ts +2 -2
- package/dist/forms/static.js +2 -2
- package/dist/forms/submitForm.d.ts +2 -2
- package/dist/forms/tracking-session.d.ts +1 -1
- package/dist/forms/types.d.ts +9 -0
- package/dist/forms/useForm.d.ts +2 -2
- package/dist/forms/webmcp.d.ts +2 -2
- package/dist/images/api.d.ts +1 -1
- package/dist/images/index.d.ts +6 -6
- package/dist/images/index.js +2 -4
- package/dist/images/server.d.ts +2 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/landing/contract.d.ts +1 -1
- package/dist/landing/contract.js +2 -1
- package/dist/landing/index.d.ts +3 -3
- package/dist/landing/index.js +3 -2
- package/dist/landing/managed-server.d.ts +2 -2
- package/dist/landing/managed.d.ts +10 -2
- package/dist/landing/server.d.ts +7 -7
- package/dist/landing/server.js +13 -8
- package/dist/layout/AiDiscoveryLinks.d.ts +1 -1
- package/dist/layout/SiteKitClientProviders.d.ts +1 -1
- package/dist/layout/SiteKitLayout.d.ts +2 -2
- package/dist/layout/client.d.ts +1 -1
- package/dist/layout/client.js +15 -11
- package/dist/layout/index.d.ts +5 -5
- package/dist/layout/index.js +17 -13
- package/dist/layout/types.d.ts +2 -2
- package/dist/llms/AEOComponents.d.ts +1 -1
- package/dist/llms/SpeakableSchema.d.ts +1 -1
- package/dist/llms/api.d.ts +1 -1
- package/dist/llms/client.d.ts +3 -3
- package/dist/llms/contract.d.ts +1 -1
- package/dist/llms/generateLLMsTxt.d.ts +1 -1
- package/dist/llms/handlers.d.ts +1 -1
- package/dist/llms/index.d.ts +21 -21
- package/dist/llms/index.js +5 -5
- package/dist/llms/merge.d.ts +1 -1
- package/dist/llms/sourcedFacts.d.ts +1 -1
- package/dist/llms/types.d.ts +5 -5
- package/dist/llms/writeLLMsTxt.d.ts +3 -3
- package/dist/maps/GoogleMap.d.ts +1 -1
- package/dist/maps/NeighborhoodMap.d.ts +1 -1
- package/dist/maps/api.d.ts +1 -1
- package/dist/maps/index.d.ts +5 -5
- package/dist/maps/index.js +8 -80
- package/dist/maps/places-library.d.ts +34 -0
- package/dist/mcp/WebMcpTools.d.ts +1 -1
- package/dist/mcp/client.d.ts +2 -2
- package/dist/mcp/discovery.d.ts +2 -2
- package/dist/mcp/handlers.d.ts +4 -4
- package/dist/mcp/index.d.ts +12 -12
- package/dist/mcp/protocol.d.ts +1 -1
- package/dist/mcp/report.d.ts +1 -1
- package/dist/mcp/serverCard.d.ts +1 -1
- package/dist/mcp/sonor.d.ts +5 -5
- package/dist/mcp/sonor.js +12 -12
- package/dist/mcp/transport.d.ts +1 -1
- package/dist/motion/Parallax.d.ts +1 -1
- package/dist/motion/ScrollScene.d.ts +1 -1
- package/dist/motion/gsap.d.ts +2 -2
- package/dist/motion/index.d.ts +9 -9
- package/dist/motion/three.d.ts +1 -1
- package/dist/og/index.d.ts +5 -5
- package/dist/og/pages.d.ts +1 -1
- package/dist/og/route-fit.d.ts +17 -0
- package/dist/og/template.d.ts +1 -1
- package/dist/places-library-RU2YNKFK.js +54 -0
- package/dist/portfolio/contract.d.ts +1 -1
- package/dist/press-kit/articles/Article.d.ts +2 -2
- package/dist/press-kit/articles/ArticleFaqSection.d.ts +1 -1
- package/dist/press-kit/articles/ArticleList.d.ts +2 -2
- package/dist/press-kit/articles/AuthorCard.d.ts +1 -1
- package/dist/press-kit/articles/AuthorPage.d.ts +1 -1
- package/dist/press-kit/articles/ClusterLandingPage.d.ts +2 -2
- package/dist/press-kit/articles/ClusterNavigation.d.ts +2 -2
- package/dist/press-kit/articles/ManagedNewsletterForm.d.ts +2 -2
- package/dist/press-kit/articles/PublicationLayout.d.ts +2 -2
- package/dist/press-kit/articles/PublicationSidebar.d.ts +1 -1
- package/dist/press-kit/articles/RelatedPosts.d.ts +2 -2
- package/dist/press-kit/articles/TableOfContents.d.ts +1 -1
- package/dist/press-kit/articles/article-body.d.ts +1 -1
- package/dist/press-kit/articles/article-headings.d.ts +1 -1
- package/dist/press-kit/articles/article-photos.d.ts +1 -1
- package/dist/press-kit/articles/artwork.d.ts +2 -2
- package/dist/press-kit/articles/author-schema.d.ts +2 -2
- package/dist/press-kit/articles/author-social.d.ts +1 -1
- package/dist/press-kit/articles/index.d.ts +23 -23
- package/dist/press-kit/articles/news-sitemap.d.ts +2 -2
- package/dist/press-kit/articles/public-reads.d.ts +1 -1
- package/dist/press-kit/articles/publication-reads.d.ts +2 -2
- package/dist/press-kit/articles/reading-time.d.ts +1 -1
- package/dist/press-kit/articles/server-core.d.ts +20 -20
- package/dist/press-kit/articles/server-ui.d.ts +20 -20
- package/dist/press-kit/articles/types.d.ts +1 -1
- package/dist/proxy/index.d.ts +5 -5
- package/dist/proxy/index.js +1 -1
- package/dist/reputation/TestimonialSection.d.ts +1 -1
- package/dist/reputation/VisualReviewCard.d.ts +1 -1
- package/dist/reputation/api.d.ts +1 -1
- package/dist/reputation/index.d.ts +4 -4
- package/dist/reputation/server.d.ts +3 -3
- package/dist/resonance/ResonanceRuntime.d.ts +7 -0
- package/dist/resonance/bridge.d.ts +16 -0
- package/dist/resonance/consent-adapter.d.ts +26 -0
- package/dist/resonance/controller-registry.d.ts +14 -0
- package/dist/resonance/controller.d.ts +103 -0
- package/dist/resonance/form-context.d.ts +5 -0
- package/dist/resonance/index.d.ts +4 -0
- package/dist/resonance/index.js +9 -0
- package/dist/resonance/meta-pixel.d.ts +67 -0
- package/dist/resonance/providers.d.ts +32 -0
- package/dist/resonance/runtime-core.d.ts +5 -0
- package/dist/revalidate/index.d.ts +3 -3
- package/dist/revalidate/index.js +2 -2
- package/dist/robots/index.d.ts +3 -3
- package/dist/robots/indexnow.js +2 -2
- package/dist/runtime/index.d.ts +7 -7
- package/dist/runtime/index.js +4 -5
- package/dist/runtime-core-EU2RZMOL.js +2213 -0
- package/dist/seo/ManagedFAQ.d.ts +1 -1
- package/dist/seo/ManagedInternalLinks.d.ts +1 -1
- package/dist/seo/ManagedSchema.d.ts +1 -1
- package/dist/seo/ManagedScripts.d.ts +1 -1
- package/dist/seo/client.d.ts +1 -1
- package/dist/seo/client.js +3 -5
- package/dist/seo/entry-indexnow.d.ts +1 -1
- package/dist/seo/entry-llms-client.d.ts +1 -1
- package/dist/seo/entry-llms-contract.d.ts +1 -1
- package/dist/seo/entry-llms.d.ts +1 -1
- package/dist/seo/entry-meta-contract.d.ts +1 -1
- package/dist/seo/entry-og-route.d.ts +1 -1
- package/dist/seo/entry-og.d.ts +1 -1
- package/dist/seo/entry-pages-contract.d.ts +1 -1
- package/dist/seo/entry-redirects.d.ts +1 -1
- package/dist/seo/entry-robots.d.ts +1 -1
- package/dist/seo/entry-sitemap.d.ts +1 -1
- package/dist/seo/getManagedMetadata.d.ts +1 -1
- package/dist/seo/index.d.ts +12 -12
- package/dist/seo/index.js +9 -11
- package/dist/seo/indexnow.d.ts +1 -1
- package/dist/seo/indexnow.js +2 -2
- package/dist/seo/llms/client.d.ts +1 -1
- package/dist/seo/llms/contract.d.ts +1 -1
- package/dist/seo/llms.d.ts +1 -1
- package/dist/seo/llms.js +5 -5
- package/dist/seo/meta/contract.d.ts +1 -1
- package/dist/seo/og.d.ts +1 -1
- package/dist/seo/pages/contract.d.ts +1 -1
- package/dist/seo/redirects.d.ts +1 -1
- package/dist/seo/register-sitemap-cli-impl.d.ts +1 -1
- package/dist/seo/register-sitemap-cli.js +1 -1
- package/dist/seo/robots.d.ts +1 -1
- package/dist/seo/routing.d.ts +1 -1
- package/dist/seo/server.d.ts +4 -4
- package/dist/seo/server.js +3 -3
- package/dist/seo/sitemap.d.ts +1 -1
- package/dist/seo/sitemap.js +3 -3
- package/dist/seo/types.d.ts +1 -1
- package/dist/seo-meta/contract.d.ts +1 -1
- package/dist/seo-pages/contract.d.ts +1 -1
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +3 -3
- package/dist/server/mint-site-token.d.ts +1 -1
- package/dist/server/server-fetch.d.ts +8 -0
- package/dist/{server-api-XIKDWSNO.js → server-api-A34TABT2.js} +2 -2
- package/dist/shared/build-entries.d.ts +3 -1
- package/dist/shared/color.d.ts +1 -1
- package/dist/shared/fetchWithRetry.d.ts +6 -0
- package/dist/shared/frame.d.ts +1 -1
- package/dist/shared/identity-storage.d.ts +6 -4
- package/dist/shared/identity.d.ts +1 -3
- package/dist/shared/index.d.ts +5 -5
- package/dist/shared/index.js +1 -1
- package/dist/shared/measurement-analytics.d.ts +1 -0
- package/dist/shared/measurement-policy.d.ts +6 -0
- package/dist/shared/measurement-proof.d.ts +5 -0
- package/dist/shared/measurement-store.d.ts +34 -0
- package/dist/shared/measurement-writer.d.ts +6 -0
- package/dist/shared/publishCredential.d.ts +1 -1
- package/dist/shared/reporting-gate.d.ts +3 -1
- package/dist/shared/site-token-claims.d.ts +18 -0
- package/dist/shared/site-token-configuration.d.ts +9 -0
- package/dist/shared/site-token-refresh.d.ts +7 -0
- package/dist/shared/site-token-state.d.ts +23 -0
- package/dist/shared/siteToken.d.ts +5 -39
- package/dist/shared/sonor-auth-state.d.ts +3 -0
- package/dist/shared/sonor-beacon.d.ts +13 -0
- package/dist/shared/sonor-fetch-runtime.d.ts +2 -0
- package/dist/shared/sonor-fetch.d.ts +7 -0
- package/dist/shared/sonorFetch.d.ts +4 -49
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/ReviewedSignalExperiment.d.ts +9 -0
- package/dist/signal/SignalBridge.d.ts +4 -4
- package/dist/signal/SignalCore.d.ts +2 -1
- package/dist/signal/SignalExperiment.d.ts +13 -5
- package/dist/signal/index.d.ts +3 -3
- package/dist/signal/index.js +4 -73
- package/dist/signal/store.d.ts +10 -7
- package/dist/signal/types.d.ts +4 -0
- package/dist/sitemap/index.d.ts +5 -5
- package/dist/sitemap/index.js +3 -3
- package/dist/sites/contract.d.ts +1 -1
- package/dist/sites/normalize.d.ts +1 -1
- package/dist/slots/ManagedLink.d.ts +2 -2
- package/dist/slots/ManagedList.d.ts +2 -2
- package/dist/slots/ManagedRichText.d.ts +1 -1
- package/dist/slots/ManagedSlot.d.ts +1 -1
- package/dist/slots/contract.d.ts +1 -1
- package/dist/slots/edit/locate.d.ts +1 -1
- package/dist/slots/index.d.ts +14 -14
- package/dist/slots/index.js +2 -2
- package/dist/slots/server-api.d.ts +1 -1
- package/dist/{chunk-FLOJUMFR.js → sonor-fetch-runtime-SLPBNZY4.js} +27 -36
- package/dist/sync/AddToCalendar.d.ts +1 -1
- package/dist/sync/BookingWidget.d.ts +1 -1
- package/dist/sync/MeetingFormatStep.d.ts +1 -1
- package/dist/sync/api.d.ts +2 -2
- package/dist/sync/booking-flow.d.ts +1 -1
- package/dist/sync/index.d.ts +3 -3
- package/dist/sync/index.js +6 -7
- package/dist/types.d.ts +6 -6
- package/dist/website/BlocksPopup.d.ts +1 -1
- package/dist/website/PopupBlocks.d.ts +1 -1
- package/dist/website/SiteDesignReporter.d.ts +2 -2
- package/dist/website/SitePopups.d.ts +1 -1
- package/dist/website/contract.d.ts +1 -1
- package/dist/website/cta-bar.d.ts +1 -1
- package/dist/website/cta-bar.js +4 -3
- package/dist/website/design.d.ts +2 -2
- package/dist/website/images/server.d.ts +1 -1
- package/dist/website/images-server.d.ts +1 -1
- package/dist/website/images.d.ts +1 -1
- package/dist/website/images.js +2 -4
- package/dist/website/index.d.ts +4 -4
- package/dist/website/index.js +5 -6
- package/dist/website/landing/server.d.ts +1 -1
- package/dist/website/landing/server.js +13 -8
- package/dist/website/landing-server.d.ts +1 -1
- package/dist/website/landing.d.ts +1 -1
- package/dist/website/landing.js +3 -2
- package/dist/website/popup-rules.d.ts +2 -2
- package/dist/website/popup-types.d.ts +1 -1
- package/dist/website/popups.d.ts +4 -4
- package/dist/website/popups.js +14 -8
- package/dist/website/slots/contract.d.ts +1 -1
- package/dist/website/slots-contract.d.ts +1 -1
- package/dist/website/slots.d.ts +2 -2
- package/dist/website/slots.js +2 -2
- package/dist/{writeLLMsTxt-4HHUAOA6.js → writeLLMsTxt-2CBYGKZO.js} +2 -2
- package/docs.json +5 -0
- package/package.json +8 -2
- package/src/analytics/README.md +21 -0
- package/src/cta-bar/README.md +4 -0
- package/src/forms/README.md +76 -0
- package/src/landing/README.md +14 -0
- package/src/layout/README.md +3 -0
- package/src/resonance/README.md +273 -0
- package/src/runtime/README.md +6 -1
- package/src/signal/README.md +21 -0
- package/src/website/README.md +14 -2
- package/dist/AnalyticsProvider-7SBJ27SI.js +0 -13
- package/dist/ChatWidget-V46UBDOM.js +0 -20
- package/dist/ManagedForm-DDDVMKLJ.js +0 -19
- package/dist/SitePopups-VU2C3Z6B.js +0 -13
- package/dist/SitemapSync-C4H3HF3L.js +0 -9
- package/dist/chunk-5ROTTMBL.js +0 -19
- package/dist/chunk-5TM3WPCI.js +0 -7
- package/dist/chunk-7HW4TZB5.js +0 -148
- package/dist/chunk-IPQKQEWI.js +0 -52
- package/dist/chunk-LCDVPAMR.js +0 -24
- package/dist/chunk-LQJC5S2M.js +0 -236
- package/dist/chunk-SHAUX2MQ.js +0 -163
- /package/dist/{chunk-3MJNBOUO.js → chunk-2QPVU63T.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { registerAnalyticsDispatcher } from './chunk-
|
|
3
|
-
import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-
|
|
2
|
+
import { registerAnalyticsDispatcher } from './chunk-AG2RDHYZ.js';
|
|
3
|
+
import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-JT7GHHMV.js';
|
|
4
4
|
import { onPageLeave } from './chunk-L2V5PUFN.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
6
|
-
import {
|
|
7
|
-
import { createContext, useRef, useEffect, useState, useMemo, useCallback, useContext } from 'react';
|
|
5
|
+
import { resolveAnalyticsTarget, analyticsSend, analyticsBeacon } from './chunk-ACZ5JNSL.js';
|
|
6
|
+
import { subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot } from './chunk-FRY6PBT6.js';
|
|
7
|
+
import { createContext, useRef, useSyncExternalStore, useEffect, useState, useMemo, useCallback, useContext } from 'react';
|
|
8
8
|
import { usePathname } from 'next/navigation';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
@@ -73,33 +73,6 @@ function getMeasurementContext(options = {}) {
|
|
|
73
73
|
connectionType: connection?.effectiveType || connection?.type || void 0
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
// src/analytics/send-gate.ts
|
|
78
|
-
async function analyticsSend(path, body, options = {}) {
|
|
79
|
-
const target = resolveAnalyticsTarget(options);
|
|
80
|
-
if (!target) return null;
|
|
81
|
-
try {
|
|
82
|
-
return await sonorFetch(
|
|
83
|
-
`${target.apiUrl}${path}`,
|
|
84
|
-
{
|
|
85
|
-
method: options.method || "POST",
|
|
86
|
-
headers: { "Content-Type": "application/json" },
|
|
87
|
-
...options.keepalive ? { keepalive: true } : {},
|
|
88
|
-
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
89
|
-
},
|
|
90
|
-
{ apiKey: target.apiKey, retries: options.retries ?? 0 }
|
|
91
|
-
);
|
|
92
|
-
} catch {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function analyticsBeacon(path, body, options = {}) {
|
|
97
|
-
const target = resolveAnalyticsTarget(options);
|
|
98
|
-
if (!target) return;
|
|
99
|
-
sonorBeacon(`${target.apiUrl}${path}`, body, target.apiKey);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// src/analytics/WebVitals.tsx
|
|
103
76
|
function pathForMetric(metric, fallback) {
|
|
104
77
|
const url = metric.navigationURL;
|
|
105
78
|
if (url) {
|
|
@@ -165,15 +138,19 @@ function WebVitals({
|
|
|
165
138
|
const landingPathRef = useRef(pathname || "/");
|
|
166
139
|
const propsRef = useRef({ propApiUrl, propApiKey, propSite, allowInFrame, allowLocalhost, debug, visitorId, sessionId, sessionTimeout });
|
|
167
140
|
propsRef.current = { propApiUrl, propApiKey, propSite, allowInFrame, allowLocalhost, debug, visitorId, sessionId, sessionTimeout };
|
|
141
|
+
const policy = useSyncExternalStore(subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot);
|
|
168
142
|
useEffect(() => {
|
|
143
|
+
const epoch = policy.collectionEpoch;
|
|
144
|
+
const permitted = () => epoch === measurementPolicySnapshot().collectionEpoch && !!resolveAnalyticsTarget({ apiUrl: propApiUrl, apiKey: propApiKey, allowInFrame, allowLocalhost, debug });
|
|
145
|
+
if (!permitted()) return;
|
|
169
146
|
let cancelled = false;
|
|
170
147
|
let teardown;
|
|
171
148
|
import('./web-vitals.attribution-N2PCCF4Q.js').then(({ onCLS, onLCP, onTTFB, onINP, onFCP }) => {
|
|
172
|
-
if (cancelled) return;
|
|
149
|
+
if (cancelled || !permitted()) return;
|
|
173
150
|
const { propApiUrl: propApiUrl2, propApiKey: propApiKey2, propSite: propSite2, allowInFrame: allowInFrame2, allowLocalhost: allowLocalhost2, debug: debug2, visitorId: visitorId2, sessionId: sessionId2, sessionTimeout: sessionTimeout2 } = propsRef.current;
|
|
174
151
|
const sent = /* @__PURE__ */ new Map();
|
|
175
152
|
const report = (metric, viaBeacon = false) => {
|
|
176
|
-
if (!
|
|
153
|
+
if (cancelled || !permitted()) return;
|
|
177
154
|
if (sent.get(metric.id) === metric.value) return;
|
|
178
155
|
sent.set(metric.id, metric.value);
|
|
179
156
|
const site = propSite2 || (typeof window !== "undefined" ? window.__SITE_KIT_SITE__ || window.location.host : "");
|
|
@@ -202,6 +179,7 @@ function WebVitals({
|
|
|
202
179
|
const opts = { reportSoftNavs: true };
|
|
203
180
|
const pending = [];
|
|
204
181
|
const collect = (metric) => {
|
|
182
|
+
if (cancelled || !permitted()) return;
|
|
205
183
|
pending.push(metric);
|
|
206
184
|
report(metric);
|
|
207
185
|
};
|
|
@@ -225,7 +203,7 @@ function WebVitals({
|
|
|
225
203
|
cancelled = true;
|
|
226
204
|
teardown?.();
|
|
227
205
|
};
|
|
228
|
-
}, []);
|
|
206
|
+
}, [policy.collectionEpoch]);
|
|
229
207
|
return null;
|
|
230
208
|
}
|
|
231
209
|
|
|
@@ -656,21 +634,26 @@ function AnalyticsProvider({
|
|
|
656
634
|
allowLocalhost = false
|
|
657
635
|
}) {
|
|
658
636
|
const pathname = usePathname();
|
|
637
|
+
const policy = useSyncExternalStore(subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot);
|
|
659
638
|
const [queryString, setQueryString] = useState("");
|
|
639
|
+
const navigationRef = useRef({ path: pathname, serial: 0 });
|
|
640
|
+
if (navigationRef.current.path !== pathname) navigationRef.current = { path: pathname, serial: navigationRef.current.serial + 1 };
|
|
641
|
+
const currentNavigationKey = `${propSite ?? ""}:${policy.identityScope ?? "legacy"}:${navigationRef.current.serial}`;
|
|
642
|
+
const lastReportedNavigationRef = useRef("");
|
|
660
643
|
const site = propSite || (typeof window !== "undefined" ? window.__SITE_KIT_SITE__ || window.location.host : "");
|
|
661
644
|
const gate = useMemo(
|
|
662
|
-
() => ({ apiUrl: propApiUrl, apiKey: propApiKey, allowInFrame, allowLocalhost, debug }),
|
|
663
|
-
[propApiUrl, propApiKey, allowInFrame, allowLocalhost, debug]
|
|
645
|
+
() => ({ apiUrl: propApiUrl, apiKey: propApiKey, allowInFrame, allowLocalhost, debug, measurementEpoch: policy.collectionEpoch }),
|
|
646
|
+
[propApiUrl, propApiKey, allowInFrame, allowLocalhost, debug, policy.collectionEpoch]
|
|
664
647
|
);
|
|
665
648
|
useEffect(() => {
|
|
666
|
-
if (typeof window === "undefined") return;
|
|
649
|
+
if (typeof window === "undefined" || !resolveAnalyticsTarget(gate)) return;
|
|
667
650
|
setQueryString(window.location.search);
|
|
668
651
|
const handlePopState = () => {
|
|
669
652
|
setQueryString(window.location.search);
|
|
670
653
|
};
|
|
671
654
|
window.addEventListener("popstate", handlePopState);
|
|
672
655
|
return () => window.removeEventListener("popstate", handlePopState);
|
|
673
|
-
}, [pathname]);
|
|
656
|
+
}, [pathname, gate]);
|
|
674
657
|
const visitorIdRef = useRef("");
|
|
675
658
|
const sessionIdRef = useRef("");
|
|
676
659
|
const lastPathRef = useRef("");
|
|
@@ -680,9 +663,15 @@ function AnalyticsProvider({
|
|
|
680
663
|
const pageEnterTimeRef = useRef(0);
|
|
681
664
|
const currentScrollDepthRef = useRef(0);
|
|
682
665
|
useEffect(() => {
|
|
666
|
+
if (!resolveAnalyticsTarget(gate)) {
|
|
667
|
+
visitorIdRef.current = "";
|
|
668
|
+
sessionIdRef.current = "";
|
|
669
|
+
lastPathRef.current = "";
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
683
672
|
visitorIdRef.current = externalVisitorId || getOrCreateVisitorId();
|
|
684
673
|
sessionIdRef.current = externalSessionId || getOrCreateSessionId(sessionTimeout);
|
|
685
|
-
}, [sessionTimeout, externalVisitorId, externalSessionId]);
|
|
674
|
+
}, [sessionTimeout, externalVisitorId, externalSessionId, gate]);
|
|
686
675
|
useEffect(() => {
|
|
687
676
|
if (!validateAgainstSitemap) {
|
|
688
677
|
if (debug) console.log("[Analytics] Page validation disabled");
|
|
@@ -724,11 +713,12 @@ function AnalyticsProvider({
|
|
|
724
713
|
fetchValidPages();
|
|
725
714
|
}, [gate, validateAgainstSitemap, debug]);
|
|
726
715
|
useEffect(() => {
|
|
727
|
-
if (!trackPageViews) return;
|
|
716
|
+
if (!trackPageViews || !resolveAnalyticsTarget(gate)) return;
|
|
728
717
|
if (!pathname) return;
|
|
729
718
|
const normalizedPath = pathname === "/" ? "/" : pathname.replace(/\/+$/, "");
|
|
730
719
|
if (excludePaths.some((p) => normalizedPath.startsWith(p))) return;
|
|
731
|
-
if (
|
|
720
|
+
if (currentNavigationKey === lastReportedNavigationRef.current) return;
|
|
721
|
+
lastReportedNavigationRef.current = currentNavigationKey;
|
|
732
722
|
lastPathRef.current = normalizedPath;
|
|
733
723
|
const trackPageView = async () => {
|
|
734
724
|
if (!resolveAnalyticsTarget(gate)) {
|
|
@@ -738,8 +728,9 @@ function AnalyticsProvider({
|
|
|
738
728
|
const utmParams = getUTMParams();
|
|
739
729
|
const pageTitle = document.title;
|
|
740
730
|
const pageMetadata = await collectPageMetadata(
|
|
741
|
-
() => lastPathRef.current !== normalizedPath
|
|
731
|
+
() => lastPathRef.current !== normalizedPath || !resolveAnalyticsTarget(gate)
|
|
742
732
|
);
|
|
733
|
+
if (!resolveAnalyticsTarget(gate)) return;
|
|
743
734
|
if (onPageMetadata) {
|
|
744
735
|
onPageMetadata(pageMetadata);
|
|
745
736
|
}
|
|
@@ -794,7 +785,7 @@ function AnalyticsProvider({
|
|
|
794
785
|
}
|
|
795
786
|
};
|
|
796
787
|
scheduleIdleTask(() => trackPageView());
|
|
797
|
-
}, [pathname, queryString, gate, trackPageViews, excludePaths, debug, validateAgainstSitemap]);
|
|
788
|
+
}, [pathname, queryString, gate, trackPageViews, excludePaths, debug, validateAgainstSitemap, currentNavigationKey]);
|
|
798
789
|
useEffect(() => {
|
|
799
790
|
if (!trackJourneys) return;
|
|
800
791
|
if (!pathname) return;
|
|
@@ -959,6 +950,7 @@ function AnalyticsProvider({
|
|
|
959
950
|
if (typeof window === "undefined") return;
|
|
960
951
|
if (!resolveAnalyticsTarget(gate)) return;
|
|
961
952
|
const handleClick = async (e) => {
|
|
953
|
+
if (!resolveAnalyticsTarget(gate)) return;
|
|
962
954
|
const target = e.target;
|
|
963
955
|
if (!target) return;
|
|
964
956
|
const docHeight = document.documentElement.scrollHeight;
|
|
@@ -1016,7 +1008,9 @@ function AnalyticsProvider({
|
|
|
1016
1008
|
return () => document.removeEventListener("click", click);
|
|
1017
1009
|
}, [gate, site, pathname]);
|
|
1018
1010
|
const trackEvent = useCallback((options) => {
|
|
1011
|
+
if (!resolveAnalyticsTarget(gate)) return;
|
|
1019
1012
|
const doTrack = async () => {
|
|
1013
|
+
if (!resolveAnalyticsTarget(gate)) return;
|
|
1020
1014
|
const event = {
|
|
1021
1015
|
sessionId: sessionIdRef.current,
|
|
1022
1016
|
visitorId: visitorIdRef.current,
|
|
@@ -1040,6 +1034,7 @@ function AnalyticsProvider({
|
|
|
1040
1034
|
}, [gate, site, pathname, debug]);
|
|
1041
1035
|
const trackConversion = useCallback((options) => {
|
|
1042
1036
|
const doTrack = async () => {
|
|
1037
|
+
if (!resolveAnalyticsTarget(gate)) return;
|
|
1043
1038
|
const conversion = {
|
|
1044
1039
|
sessionId: sessionIdRef.current,
|
|
1045
1040
|
visitorId: visitorIdRef.current,
|
|
@@ -1073,7 +1068,7 @@ function AnalyticsProvider({
|
|
|
1073
1068
|
visitorId: visitorIdRef.current
|
|
1074
1069
|
}), [trackEvent, trackConversion]);
|
|
1075
1070
|
return /* @__PURE__ */ jsxs(AnalyticsContext.Provider, { value: contextValue, children: [
|
|
1076
|
-
trackWebVitals && /* @__PURE__ */ jsx(
|
|
1071
|
+
trackWebVitals && !!resolveAnalyticsTarget(gate) && /* @__PURE__ */ jsx(
|
|
1077
1072
|
WebVitals,
|
|
1078
1073
|
{
|
|
1079
1074
|
apiUrl: propApiUrl,
|
|
@@ -56,6 +56,14 @@ function isNextControlFlow(error) {
|
|
|
56
56
|
}
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
|
+
var ServerApiFetchError = class extends Error {
|
|
60
|
+
constructor(category, status = null) {
|
|
61
|
+
super(`Sonor server request failed (${category})`);
|
|
62
|
+
this.category = category;
|
|
63
|
+
this.status = status;
|
|
64
|
+
this.name = "ServerApiFetchError";
|
|
65
|
+
}
|
|
66
|
+
};
|
|
59
67
|
async function serverApiFetch(path, options = {}) {
|
|
60
68
|
const {
|
|
61
69
|
method = "GET",
|
|
@@ -70,16 +78,18 @@ async function serverApiFetch(path, options = {}) {
|
|
|
70
78
|
timeoutMs = DEFAULT_ATTEMPT_TIMEOUT_MS,
|
|
71
79
|
totalTimeoutMs = DEFAULT_TOTAL_TIMEOUT_MS,
|
|
72
80
|
requireKey = false,
|
|
81
|
+
throwOnError = false,
|
|
73
82
|
logPrefix = "@sonordev/site-kit",
|
|
74
83
|
init
|
|
75
84
|
} = options;
|
|
76
85
|
const overrides = { apiKey: overrideApiKey, apiUrl: overrideApiUrl };
|
|
77
86
|
let config;
|
|
78
|
-
if (requireKey) {
|
|
87
|
+
if (requireKey && !throwOnError) {
|
|
79
88
|
config = requireServerApiConfig(overrides);
|
|
80
89
|
} else {
|
|
81
90
|
const resolved = resolveServerApiConfig(overrides);
|
|
82
91
|
if (!resolved) {
|
|
92
|
+
if (throwOnError) throw new ServerApiFetchError("configuration");
|
|
83
93
|
console.warn(`${logPrefix}: Missing SONOR_API_KEY \u2014 request to ${path} skipped.`);
|
|
84
94
|
return null;
|
|
85
95
|
}
|
|
@@ -87,21 +97,32 @@ async function serverApiFetch(path, options = {}) {
|
|
|
87
97
|
}
|
|
88
98
|
const { apiUrl, apiKey } = config;
|
|
89
99
|
const url = `${apiUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
90
|
-
|
|
100
|
+
let serializedBody;
|
|
101
|
+
try {
|
|
102
|
+
serializedBody = body === void 0 ? void 0 : typeof body === "string" ? body : JSON.stringify(body);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
if (isNextControlFlow(error)) throw error;
|
|
105
|
+
if (throwOnError) throw new ServerApiFetchError("configuration");
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
91
108
|
const attempts = retry ? Math.max(1, maxAttempts) : 1;
|
|
92
109
|
const deadline = monotonicMs() + Math.max(1, totalTimeoutMs);
|
|
93
110
|
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
111
|
+
if (throwOnError && init?.signal?.aborted) throw new ServerApiFetchError("cancelled");
|
|
94
112
|
const remaining = deadline - monotonicMs();
|
|
95
113
|
if (remaining <= 0) {
|
|
114
|
+
if (throwOnError) throw new ServerApiFetchError("timeout");
|
|
96
115
|
console.warn(
|
|
97
116
|
`${logPrefix}: Time budget (${totalTimeoutMs}ms) exhausted for ${method} ${path} after ${attempt - 1} attempt(s).`
|
|
98
117
|
);
|
|
99
118
|
return null;
|
|
100
119
|
}
|
|
120
|
+
let signal;
|
|
101
121
|
try {
|
|
122
|
+
signal = attemptSignal(Math.min(timeoutMs, remaining), init?.signal);
|
|
102
123
|
const response = await fetch(url, {
|
|
103
124
|
...init,
|
|
104
|
-
signal
|
|
125
|
+
signal,
|
|
105
126
|
method,
|
|
106
127
|
headers: {
|
|
107
128
|
"Content-Type": "application/json",
|
|
@@ -124,6 +145,7 @@ async function serverApiFetch(path, options = {}) {
|
|
|
124
145
|
continue;
|
|
125
146
|
}
|
|
126
147
|
if (!response.ok) {
|
|
148
|
+
if (throwOnError) throw new ServerApiFetchError("http", response.status);
|
|
127
149
|
let detail = response.statusText;
|
|
128
150
|
try {
|
|
129
151
|
const err = await response.json().catch(() => ({}));
|
|
@@ -136,12 +158,15 @@ async function serverApiFetch(path, options = {}) {
|
|
|
136
158
|
return await response.json();
|
|
137
159
|
} catch (error) {
|
|
138
160
|
if (isNextControlFlow(error)) throw error;
|
|
161
|
+
if (throwOnError && error instanceof ServerApiFetchError) throw error;
|
|
162
|
+
if (throwOnError && init?.signal?.aborted) throw new ServerApiFetchError("cancelled");
|
|
139
163
|
if (retry && attempt < attempts && monotonicMs() < deadline) {
|
|
140
164
|
await sleep(
|
|
141
165
|
Math.min(200 * attempt * attempt + retryJitter() * 150, Math.max(0, deadline - monotonicMs()))
|
|
142
166
|
);
|
|
143
167
|
continue;
|
|
144
168
|
}
|
|
169
|
+
if (throwOnError) throw new ServerApiFetchError(signal?.aborted || monotonicMs() >= deadline ? "timeout" : "network");
|
|
145
170
|
console.warn(
|
|
146
171
|
`${logPrefix}: Network error for ${url}:`,
|
|
147
172
|
error instanceof Error ? error.message : error
|
|
@@ -149,7 +174,8 @@ async function serverApiFetch(path, options = {}) {
|
|
|
149
174
|
return null;
|
|
150
175
|
}
|
|
151
176
|
}
|
|
177
|
+
if (throwOnError) throw new ServerApiFetchError("timeout");
|
|
152
178
|
return null;
|
|
153
179
|
}
|
|
154
180
|
|
|
155
|
-
export { isNextControlFlow, requireServerApiConfig, resolveApiOrigin, resolveServerApiConfig, serverApiFetch };
|
|
181
|
+
export { ServerApiFetchError, isNextControlFlow, requireServerApiConfig, resolveApiOrigin, resolveServerApiConfig, serverApiFetch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeLLMsTxtToPublic } from './chunk-
|
|
1
|
+
import { writeLLMsTxtToPublic } from './chunk-ORSQKTMN.js';
|
|
2
2
|
import { getSiteConfig } from './chunk-Z22QVHT4.js';
|
|
3
3
|
import { buildFetch } from './chunk-UAYAJPEP.js';
|
|
4
4
|
import { findAppDirForDiscovery } from './chunk-ZEGVKVD5.js';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { RESONANCE_SUBJECT_HEADER } from './chunk-NHDRA4Y5.js';
|
|
2
|
+
import { currentCredential } from './chunk-D4M5K6JN.js';
|
|
3
|
+
import { sameSite } from './chunk-NZOJHERI.js';
|
|
4
|
+
import { currentSubjectProof } from './chunk-KMNHNCVG.js';
|
|
5
|
+
import { SITE_KIT_VERSION } from './chunk-D4R3FQED.js';
|
|
6
|
+
import { resolveAnalyticsTarget } from './chunk-7643MCD2.js';
|
|
7
|
+
import { sonorFetch } from './chunk-Z4XJOVQX.js';
|
|
8
|
+
import { readPublishedApiConfig } from './chunk-W7OPEMGJ.js';
|
|
9
|
+
import { normalizeSiteHost } from './chunk-A4CC4ZG3.js';
|
|
10
|
+
import { analyticsPurposePermitted, measurementPolicySnapshot } from './chunk-FRY6PBT6.js';
|
|
11
|
+
|
|
12
|
+
// src/shared/sonor-beacon.ts
|
|
13
|
+
function sonorBeaconWithContext(url, payload, apiKey, contextHeaders) {
|
|
14
|
+
const credential = currentCredential(apiKey);
|
|
15
|
+
const body = typeof payload === "string" ? payload : JSON.stringify(payload);
|
|
16
|
+
try {
|
|
17
|
+
void fetch(url, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
keepalive: true,
|
|
20
|
+
headers: {
|
|
21
|
+
...contextHeaders,
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
"x-sitekit-version": SITE_KIT_VERSION,
|
|
24
|
+
...credential ? { "x-api-key": credential } : {}
|
|
25
|
+
},
|
|
26
|
+
body
|
|
27
|
+
}).catch(() => {
|
|
28
|
+
});
|
|
29
|
+
} catch {
|
|
30
|
+
if (Object.keys(contextHeaders).length) return;
|
|
31
|
+
try {
|
|
32
|
+
if (typeof navigator !== "undefined" && navigator.sendBeacon) {
|
|
33
|
+
navigator.sendBeacon(url, new Blob([body], { type: "application/json" }));
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/analytics/send-gate.ts
|
|
41
|
+
function currentAnalyticsHeaders(path, apiUrl) {
|
|
42
|
+
if (!/^\/(?:api\/public\/analytics\/(?:page-view|session|scroll-depth|heatmap-click|web-vitals|event|conversion)|api\/public\/forms\/analytics\/(?:start|step|complete|abandon)|engage\/widget\/(?:event|impression|click))$/.test(path)) return {};
|
|
43
|
+
const proof = currentSubjectProof(), config = measurementPolicySnapshot().config;
|
|
44
|
+
if (!proof || !config || typeof window === "undefined" || readPublishedApiConfig().apiUrl !== apiUrl || !sameSite(normalizeSiteHost(window.location.hostname), config.site)) return {};
|
|
45
|
+
return { [RESONANCE_SUBJECT_HEADER]: proof.subjectProof };
|
|
46
|
+
}
|
|
47
|
+
var resolveAnalyticsTarget2 = (options = {}) => analyticsPurposePermitted() && (options.measurementEpoch === void 0 || options.measurementEpoch === measurementPolicySnapshot().collectionEpoch) ? resolveAnalyticsTarget(options) : null;
|
|
48
|
+
async function analyticsSend(path, body, options = {}) {
|
|
49
|
+
const dispatchOptions = { ...options, measurementEpoch: options.measurementEpoch ?? measurementPolicySnapshot().collectionEpoch };
|
|
50
|
+
const target = resolveAnalyticsTarget2(dispatchOptions);
|
|
51
|
+
if (!target) return null;
|
|
52
|
+
try {
|
|
53
|
+
return await sonorFetch(
|
|
54
|
+
`${target.apiUrl}${path}`,
|
|
55
|
+
{
|
|
56
|
+
method: options.method || "POST",
|
|
57
|
+
headers: { "Content-Type": "application/json" },
|
|
58
|
+
...options.keepalive ? { keepalive: true } : {},
|
|
59
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
apiKey: target.apiKey,
|
|
63
|
+
retries: options.retries ?? 0,
|
|
64
|
+
shouldSend: () => !!resolveAnalyticsTarget2(dispatchOptions),
|
|
65
|
+
prepareAttempt: (init) => ({ ...init, headers: { ...Object.fromEntries(new Headers(init.headers)), ...currentAnalyticsHeaders(path, target.apiUrl) } })
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
} catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function analyticsBeacon(path, body, options = {}) {
|
|
73
|
+
const target = resolveAnalyticsTarget2(options);
|
|
74
|
+
if (!target) return;
|
|
75
|
+
sonorBeaconWithContext(`${target.apiUrl}${path}`, body, target.apiKey, currentAnalyticsHeaders(path, target.apiUrl));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { analyticsBeacon, analyticsSend, resolveAnalyticsTarget2 as resolveAnalyticsTarget };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { subscribeMeasurementPolicy, measurementPolicySnapshot, analyticsPurposePermitted } from './chunk-FRY6PBT6.js';
|
|
2
|
+
|
|
3
|
+
// src/analytics/dispatch.ts
|
|
4
|
+
function isCurrentCall(call) {
|
|
5
|
+
const current = measurementPolicySnapshot();
|
|
6
|
+
return analyticsPurposePermitted() && call.collectionEpoch === current.collectionEpoch && call.identityScope === current.identityScope;
|
|
7
|
+
}
|
|
8
|
+
function enqueue(call) {
|
|
9
|
+
if (queue.length >= MAX_QUEUE) return;
|
|
10
|
+
const { collectionEpoch, identityScope } = measurementPolicySnapshot();
|
|
11
|
+
queue.push({ ...call, collectionEpoch, identityScope });
|
|
12
|
+
}
|
|
13
|
+
var MAX_QUEUE = 50;
|
|
14
|
+
var dispatcher = null;
|
|
15
|
+
var queue = [];
|
|
16
|
+
subscribeMeasurementPolicy(() => {
|
|
17
|
+
queue = queue.filter(isCurrentCall);
|
|
18
|
+
});
|
|
19
|
+
function registerAnalyticsDispatcher(next) {
|
|
20
|
+
dispatcher = next;
|
|
21
|
+
if (!next) return;
|
|
22
|
+
if (!analyticsPurposePermitted()) {
|
|
23
|
+
queue = [];
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const pending = queue;
|
|
27
|
+
queue = [];
|
|
28
|
+
for (const call of pending) {
|
|
29
|
+
if (!isCurrentCall(call)) continue;
|
|
30
|
+
if (call.kind === "event") next.trackEvent(call.options);
|
|
31
|
+
else next.trackConversion(call.options);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function trackEvent(options) {
|
|
35
|
+
if (!analyticsPurposePermitted()) return;
|
|
36
|
+
if (dispatcher) dispatcher.trackEvent(options);
|
|
37
|
+
else enqueue({ kind: "event", options });
|
|
38
|
+
}
|
|
39
|
+
function trackConversion(options) {
|
|
40
|
+
if (!analyticsPurposePermitted()) return;
|
|
41
|
+
if (dispatcher) dispatcher.trackConversion(options);
|
|
42
|
+
else enqueue({ kind: "conversion", options });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { registerAnalyticsDispatcher, trackConversion, trackEvent };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CtaBarBehavior } from './chunk-
|
|
1
|
+
import { CtaBarBehavior } from './chunk-55GFMOI6.js';
|
|
2
2
|
import { GlassStyles } from './chunk-JE4A5S4F.js';
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
var CTA_BAR_STYLE_HREF = "sk-cta-bar";
|
|
@@ -178,7 +179,7 @@ function CtaBar({
|
|
|
178
179
|
"data-hidden": showAfter ? "" : void 0,
|
|
179
180
|
children: [
|
|
180
181
|
children,
|
|
181
|
-
/* @__PURE__ */ jsx(
|
|
182
|
+
/* @__PURE__ */ jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
182
183
|
CtaBarBehavior,
|
|
183
184
|
{
|
|
184
185
|
showAfter,
|
|
@@ -187,7 +188,7 @@ function CtaBar({
|
|
|
187
188
|
compactOnScroll,
|
|
188
189
|
track
|
|
189
190
|
}
|
|
190
|
-
)
|
|
191
|
+
) })
|
|
191
192
|
]
|
|
192
193
|
}
|
|
193
194
|
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/shared/site-token-state.ts
|
|
2
|
+
function initialTokenState() {
|
|
3
|
+
return {
|
|
4
|
+
seed: void 0,
|
|
5
|
+
isToken: false,
|
|
6
|
+
apiUrl: "https://api.sonor.io",
|
|
7
|
+
token: null,
|
|
8
|
+
refreshing: null
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
var TOKEN_STATE_KEY = "__SONOR_SITE_TOKEN_STATE__";
|
|
12
|
+
var siteTokenState = (() => {
|
|
13
|
+
if (typeof window === "undefined") return initialTokenState();
|
|
14
|
+
const w = window;
|
|
15
|
+
return w[TOKEN_STATE_KEY] ?? (w[TOKEN_STATE_KEY] = initialTokenState());
|
|
16
|
+
})();
|
|
17
|
+
function isTokenMode() {
|
|
18
|
+
return siteTokenState.isToken;
|
|
19
|
+
}
|
|
20
|
+
function currentCredential(seed) {
|
|
21
|
+
if (!siteTokenState.isToken) return seed ?? siteTokenState.seed;
|
|
22
|
+
return siteTokenState.token ?? seed ?? siteTokenState.seed;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { currentCredential, isTokenMode, siteTokenState };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toHexColor, normalizeDesignTokens, designTokensHash } from './chunk-XHYE24HU.js';
|
|
2
2
|
import { contrastRatio, parseColor, relativeLuminance } from './chunk-S22FSH7C.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { SITE_KIT_VERSION } from './chunk-D4R3FQED.js';
|
|
4
|
+
import { resolveAnalyticsTarget } from './chunk-7643MCD2.js';
|
|
5
|
+
import { sonorFetch } from './chunk-Z4XJOVQX.js';
|
|
6
6
|
|
|
7
7
|
// src/website/design.ts
|
|
8
8
|
var SITE_DESIGN_PATH = "/api/public/site/design";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/shared/measurement-store.ts
|
|
2
|
+
var MEASUREMENT_PURPOSES = ["analytics_storage", "ad_storage", "ad_user_data", "ad_personalization"];
|
|
3
|
+
var unknownChoices = () => ({ analytics_storage: "unknown", ad_storage: "unknown", ad_user_data: "unknown", ad_personalization: "unknown" });
|
|
4
|
+
var initialMeasurementPolicy = { version: 0, collectionEpoch: 0, analyticsChoiceEpoch: 0, policy: "legacy_unconfigured", config: null, analyticsRequired: false, choices: unknownChoices(), cmpValid: false, preferencePending: false, proof: null, identityScope: null };
|
|
5
|
+
var makeStore = () => ({ current: initialMeasurementPolicy, primed: false, lastObservedAnalyticsChoice: "unknown", listeners: /* @__PURE__ */ new Set() });
|
|
6
|
+
var measurementStore = typeof window === "undefined" ? makeStore() : window.__SONOR_MEASUREMENT_POLICY_V1__ ?? (window.__SONOR_MEASUREMENT_POLICY_V1__ = makeStore());
|
|
7
|
+
function primeMeasurementPolicy() {
|
|
8
|
+
if (typeof window === "undefined" || measurementStore.primed) return;
|
|
9
|
+
measurementStore.primed = true;
|
|
10
|
+
if (!measurementStore.current.config) measurementStore.current = { ...measurementStore.current, policy: "resolving", collectionEpoch: measurementStore.current.collectionEpoch + 1, version: measurementStore.current.version + 1 };
|
|
11
|
+
}
|
|
12
|
+
var measurementPolicySnapshot = () => measurementStore.current;
|
|
13
|
+
var serverMeasurementPolicySnapshot = () => initialMeasurementPolicy;
|
|
14
|
+
var subscribeMeasurementPolicy = (listener) => {
|
|
15
|
+
measurementStore.listeners.add(listener);
|
|
16
|
+
return () => {
|
|
17
|
+
measurementStore.listeners.delete(listener);
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// src/shared/measurement-analytics.ts
|
|
22
|
+
function analyticsPurposePermitted() {
|
|
23
|
+
const current = measurementPolicySnapshot();
|
|
24
|
+
const { choices, analyticsRequired, policy } = current;
|
|
25
|
+
if (choices.analytics_storage === "denied" || choices.analytics_storage === "withdrawn") return false;
|
|
26
|
+
if (policy === "resolving" || current.preferencePending || policy === "configured" && !!current.config && Date.parse(current.config.expiresAt) <= Date.now()) return false;
|
|
27
|
+
if (choices.analytics_storage === "granted") return true;
|
|
28
|
+
return !analyticsRequired;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { MEASUREMENT_PURPOSES, analyticsPurposePermitted, measurementPolicySnapshot, measurementStore, primeMeasurementPolicy, serverMeasurementPolicySnapshot, subscribeMeasurementPolicy, unknownChoices };
|
|
@@ -4,7 +4,7 @@ import { stripHtmlTags } from './chunk-IBHBEUZV.js';
|
|
|
4
4
|
import { resolveArticleUrl, createPublicationRoutes, resolvePublicationUrl, articleCategorySlug } from './chunk-4K735O3J.js';
|
|
5
5
|
import { withoutSchemaPlaceholders } from './chunk-VWWITFWM.js';
|
|
6
6
|
import { withSiteParam, withSiteBody } from './chunk-MJP63SSS.js';
|
|
7
|
-
import { resolveServerApiConfig } from './chunk-
|
|
7
|
+
import { resolveServerApiConfig } from './chunk-7VMA3KCN.js';
|
|
8
8
|
import 'server-only';
|
|
9
9
|
import { notFound } from 'next/navigation';
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HoneypotField } from './chunk-DXO6SBMD.js';
|
|
2
|
-
import { FormField } from './chunk-
|
|
2
|
+
import { FormField } from './chunk-3WMNHFZH.js';
|
|
3
3
|
import { normalizeFormConfig } from './chunk-TYSIAWC3.js';
|
|
4
4
|
import { DEFAULT_HONEYPOT_FIELD } from './chunk-NJCTQH2P.js';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateLLMsTxt, generateLLMsFullTxt, appendAgentAccessSection } from './chunk-
|
|
1
|
+
import { generateLLMsTxt, generateLLMsFullTxt, appendAgentAccessSection } from './chunk-ORSQKTMN.js';
|
|
2
2
|
import { createHash } from 'crypto';
|
|
3
3
|
import { existsSync, readFileSync } from 'fs';
|
|
4
4
|
import { join } from 'path';
|