@sonordev/site-kit 6.1.1 → 6.2.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/agent-manifest.json +1 -1
- package/dist/{AnalyticsProvider-5G5AFHZN.js → AnalyticsProvider-AT5XFQKT.js} +10 -10
- package/dist/{AnalyticsProvider-5G5AFHZN.js.map → AnalyticsProvider-AT5XFQKT.js.map} +1 -1
- package/dist/{AnalyticsProvider-33L4E6LO.mjs → AnalyticsProvider-KPK3N52Q.mjs} +6 -6
- package/dist/{AnalyticsProvider-33L4E6LO.mjs.map → AnalyticsProvider-KPK3N52Q.mjs.map} +1 -1
- package/dist/{ArticleViewTracker-U2KFUSZF.js → ArticleViewTracker-3PFASMTC.js} +6 -6
- package/dist/{ArticleViewTracker-U2KFUSZF.js.map → ArticleViewTracker-3PFASMTC.js.map} +1 -1
- package/dist/{ArticleViewTracker-VZRMPK4S.mjs → ArticleViewTracker-KIKKHBO6.mjs} +5 -5
- package/dist/{ArticleViewTracker-VZRMPK4S.mjs.map → ArticleViewTracker-KIKKHBO6.mjs.map} +1 -1
- package/dist/ChatWidget-6PXV6RSI.mjs +17 -0
- package/dist/{ChatWidget-LH3QZYKR.mjs.map → ChatWidget-6PXV6RSI.mjs.map} +1 -1
- package/dist/ChatWidget-D27PSWMO.js +34 -0
- package/dist/{ChatWidget-RUCQMCMN.js.map → ChatWidget-D27PSWMO.js.map} +1 -1
- package/dist/EngageWidget-SPZL3KPX.js +21 -0
- package/dist/{EngageWidget-X2CBW7DV.js.map → EngageWidget-SPZL3KPX.js.map} +1 -1
- package/dist/EngageWidget-YRTVPYAY.mjs +12 -0
- package/dist/{EngageWidget-34BQXU7K.mjs.map → EngageWidget-YRTVPYAY.mjs.map} +1 -1
- package/dist/{FileField-2MMV53BG.js → FileField-6RC33ORG.js} +6 -6
- package/dist/{FileField-2MMV53BG.js.map → FileField-6RC33ORG.js.map} +1 -1
- package/dist/{FileField-REUU36RJ.mjs → FileField-GXNG2LH2.mjs} +5 -5
- package/dist/{FileField-REUU36RJ.mjs.map → FileField-GXNG2LH2.mjs.map} +1 -1
- package/dist/{FormSpotlight-Y27TPQ4G.js → FormSpotlight-73E2CMV6.js} +9 -9
- package/dist/{FormSpotlight-Y27TPQ4G.js.map → FormSpotlight-73E2CMV6.js.map} +1 -1
- package/dist/{FormSpotlight-ZV3IS66K.mjs → FormSpotlight-YDUF3TSC.mjs} +3 -3
- package/dist/{FormSpotlight-ZV3IS66K.mjs.map → FormSpotlight-YDUF3TSC.mjs.map} +1 -1
- package/dist/{FormStage-K7Z6IEPM.js → FormStage-BL5FREFE.js} +9 -9
- package/dist/{FormStage-K7Z6IEPM.js.map → FormStage-BL5FREFE.js.map} +1 -1
- package/dist/{FormStage-6NUGCDJR.mjs → FormStage-VJZHYW6J.mjs} +3 -3
- package/dist/{FormStage-6NUGCDJR.mjs.map → FormStage-VJZHYW6J.mjs.map} +1 -1
- package/dist/ManagedForm-FUIOTKSI.js +25 -0
- package/dist/{ManagedForm-O67ILXN7.js.map → ManagedForm-FUIOTKSI.js.map} +1 -1
- package/dist/ManagedForm-Z2S37RFX.mjs +16 -0
- package/dist/{ManagedForm-EUDKMS5G.mjs.map → ManagedForm-Z2S37RFX.mjs.map} +1 -1
- package/dist/{ManagedNewsletterForm-QBJODAIA.js → ManagedNewsletterForm-3D3IW6JG.js} +8 -8
- package/dist/{ManagedNewsletterForm-QBJODAIA.js.map → ManagedNewsletterForm-3D3IW6JG.js.map} +1 -1
- package/dist/{ManagedNewsletterForm-IGWTZW7X.mjs → ManagedNewsletterForm-ZXASCHZV.mjs} +7 -7
- package/dist/{ManagedNewsletterForm-IGWTZW7X.mjs.map → ManagedNewsletterForm-ZXASCHZV.mjs.map} +1 -1
- package/dist/{SignalCore-UR4KVU5X.mjs → SignalCore-LKSU7UYG.mjs} +5 -5
- package/dist/{SignalCore-UR4KVU5X.mjs.map → SignalCore-LKSU7UYG.mjs.map} +1 -1
- package/dist/{SignalCore-KQDRH44V.js → SignalCore-RNMT4ZP4.js} +11 -11
- package/dist/{SignalCore-KQDRH44V.js.map → SignalCore-RNMT4ZP4.js.map} +1 -1
- package/dist/SitemapSync-IDJ3PXER.js +18 -0
- package/dist/{SitemapSync-DQALPBTR.js.map → SitemapSync-IDJ3PXER.js.map} +1 -1
- package/dist/SitemapSync-NTYKLAEH.mjs +9 -0
- package/dist/{SitemapSync-QYV3X5LH.mjs.map → SitemapSync-NTYKLAEH.mjs.map} +1 -1
- package/dist/analytics/index.js +9 -9
- package/dist/analytics/index.mjs +4 -4
- package/dist/articles/index.js +1 -1
- package/dist/articles/index.mjs +1 -1
- package/dist/articles/server-ui.js +1 -1
- package/dist/articles/server-ui.mjs +1 -1
- package/dist/brand/extract-brand-profile.d.ts +2 -7
- package/dist/brand/extract-brand-profile.d.ts.map +1 -1
- package/dist/{chunk-3SHAY7PK.mjs → chunk-22WIVF4O.mjs} +234 -197
- package/dist/chunk-22WIVF4O.mjs.map +1 -0
- package/dist/{chunk-VNJTU6LG.js → chunk-3NDDCSWR.js} +15 -15
- package/dist/{chunk-VNJTU6LG.js.map → chunk-3NDDCSWR.js.map} +1 -1
- package/dist/{chunk-MSSFRRXJ.mjs → chunk-3T74AR7S.mjs} +4 -4
- package/dist/{chunk-MSSFRRXJ.mjs.map → chunk-3T74AR7S.mjs.map} +1 -1
- package/dist/{chunk-OP42HO3Z.mjs → chunk-4FWJ5K5O.mjs} +3 -3
- package/dist/{chunk-OP42HO3Z.mjs.map → chunk-4FWJ5K5O.mjs.map} +1 -1
- package/dist/{chunk-CJ5YPYAE.mjs → chunk-53OU4TGU.mjs} +4 -4
- package/dist/{chunk-CJ5YPYAE.mjs.map → chunk-53OU4TGU.mjs.map} +1 -1
- package/dist/{chunk-NJSD5QY6.js → chunk-5IOMLUQS.js} +7 -7
- package/dist/{chunk-NJSD5QY6.js.map → chunk-5IOMLUQS.js.map} +1 -1
- package/dist/{chunk-S24WZNFP.js → chunk-5L46GS7N.js} +6 -6
- package/dist/{chunk-S24WZNFP.js.map → chunk-5L46GS7N.js.map} +1 -1
- package/dist/{chunk-6K3YRSYN.js → chunk-7JRFYQKN.js} +10 -10
- package/dist/{chunk-6K3YRSYN.js.map → chunk-7JRFYQKN.js.map} +1 -1
- package/dist/{chunk-MJTHYT3D.js → chunk-7JYLE3X6.js} +4 -4
- package/dist/{chunk-MJTHYT3D.js.map → chunk-7JYLE3X6.js.map} +1 -1
- package/dist/{chunk-JOYMIGR2.mjs → chunk-7K6L33BX.mjs} +22 -22
- package/dist/{chunk-R2BHRDPZ.mjs → chunk-7OOPIYLP.mjs} +3 -3
- package/dist/{chunk-R2BHRDPZ.mjs.map → chunk-7OOPIYLP.mjs.map} +1 -1
- package/dist/{chunk-WWJQGMMN.js → chunk-A4WTX36Y.js} +12 -12
- package/dist/{chunk-WWJQGMMN.js.map → chunk-A4WTX36Y.js.map} +1 -1
- package/dist/{chunk-AEW7EFYU.js → chunk-AEN7EL6N.js} +20 -6
- package/dist/chunk-AEN7EL6N.js.map +1 -0
- package/dist/{chunk-JS75ORH7.js → chunk-ATPQ6264.js} +24 -24
- package/dist/{chunk-7IM7VG4E.js → chunk-BYVAXSH5.js} +6 -6
- package/dist/{chunk-7IM7VG4E.js.map → chunk-BYVAXSH5.js.map} +1 -1
- package/dist/{chunk-ME5636V6.js → chunk-CRIZNSD2.js} +3 -3
- package/dist/{chunk-ME5636V6.js.map → chunk-CRIZNSD2.js.map} +1 -1
- package/dist/{chunk-YZMI7QQ2.mjs → chunk-EG3F5AHL.mjs} +4 -4
- package/dist/{chunk-YZMI7QQ2.mjs.map → chunk-EG3F5AHL.mjs.map} +1 -1
- package/dist/{chunk-VPZUQXZV.mjs → chunk-EJTRU275.mjs} +4 -4
- package/dist/{chunk-VPZUQXZV.mjs.map → chunk-EJTRU275.mjs.map} +1 -1
- package/dist/{chunk-MWX6QO7A.mjs → chunk-GSH4DBAD.mjs} +3 -3
- package/dist/{chunk-MWX6QO7A.mjs.map → chunk-GSH4DBAD.mjs.map} +1 -1
- package/dist/chunk-IMWON7OV.mjs +27 -0
- package/dist/chunk-IMWON7OV.mjs.map +1 -0
- package/dist/{chunk-HH5EMIXK.js → chunk-IPLOSM5F.js} +14 -14
- package/dist/{chunk-HH5EMIXK.js.map → chunk-IPLOSM5F.js.map} +1 -1
- package/dist/{chunk-OTCJRVFJ.js → chunk-ITJ5ZF33.js} +3 -3
- package/dist/{chunk-OTCJRVFJ.js.map → chunk-ITJ5ZF33.js.map} +1 -1
- package/dist/{chunk-U3SQBAUQ.mjs → chunk-IXJ2H4MU.mjs} +8 -8
- package/dist/{chunk-U3SQBAUQ.mjs.map → chunk-IXJ2H4MU.mjs.map} +1 -1
- package/dist/{chunk-7PCXI25T.mjs → chunk-JLVKZTYZ.mjs} +3 -3
- package/dist/{chunk-7PCXI25T.mjs.map → chunk-JLVKZTYZ.mjs.map} +1 -1
- package/dist/{chunk-U2DWXE2A.mjs → chunk-JOSSKN4J.mjs} +3 -3
- package/dist/{chunk-U2DWXE2A.mjs.map → chunk-JOSSKN4J.mjs.map} +1 -1
- package/dist/chunk-LGFRHT34.js +8 -0
- package/dist/{chunk-QWUDHOUE.js.map → chunk-LGFRHT34.js.map} +1 -1
- package/dist/chunk-M2N7NY3V.js +103 -0
- package/dist/chunk-M2N7NY3V.js.map +1 -0
- package/dist/{chunk-QYRJ4IQD.js → chunk-NJVU2DCX.js} +243 -204
- package/dist/chunk-NJVU2DCX.js.map +1 -0
- package/dist/chunk-NYXENHD2.mjs +96 -0
- package/dist/chunk-NYXENHD2.mjs.map +1 -0
- package/dist/{chunk-Y4A4G5XJ.js → chunk-OASA6M53.js} +5 -5
- package/dist/{chunk-Y4A4G5XJ.js.map → chunk-OASA6M53.js.map} +1 -1
- package/dist/{chunk-AG7MWWGP.mjs → chunk-P2UCNCQZ.mjs} +4 -4
- package/dist/{chunk-AG7MWWGP.mjs.map → chunk-P2UCNCQZ.mjs.map} +1 -1
- package/dist/{chunk-NNZDWY3L.mjs → chunk-RH4XEXTK.mjs} +3 -3
- package/dist/{chunk-46GMNQWN.js → chunk-RKRCWQBU.js} +3 -3
- package/dist/{chunk-46GMNQWN.js.map → chunk-RKRCWQBU.js.map} +1 -1
- package/dist/{chunk-VNSV5SY7.mjs → chunk-RKWBC43M.mjs} +3 -3
- package/dist/{chunk-VNSV5SY7.mjs.map → chunk-RKWBC43M.mjs.map} +1 -1
- package/dist/{chunk-BRED7YSL.js → chunk-RPDSNMVR.js} +11 -11
- package/dist/{chunk-BRED7YSL.js.map → chunk-RPDSNMVR.js.map} +1 -1
- package/dist/{chunk-3E7ZXPOB.mjs → chunk-RT7XKV6A.mjs} +4 -4
- package/dist/{chunk-3E7ZXPOB.mjs.map → chunk-RT7XKV6A.mjs.map} +1 -1
- package/dist/{chunk-JZCG25XK.js → chunk-RWJ3IJUP.js} +14 -14
- package/dist/{chunk-JZCG25XK.js.map → chunk-RWJ3IJUP.js.map} +1 -1
- package/dist/{chunk-22KPMJIQ.mjs → chunk-S4LTYXPR.mjs} +3 -3
- package/dist/{chunk-22KPMJIQ.mjs.map → chunk-S4LTYXPR.mjs.map} +1 -1
- package/dist/chunk-SIHPFJ6C.mjs +6 -0
- package/dist/{chunk-HQWPCX3N.mjs.map → chunk-SIHPFJ6C.mjs.map} +1 -1
- package/dist/{chunk-IPGIFBRN.js → chunk-T742S2CY.js} +4 -4
- package/dist/{chunk-IPGIFBRN.js.map → chunk-T742S2CY.js.map} +1 -1
- package/dist/{chunk-YCA4KCRF.mjs → chunk-TBAP7JNJ.mjs} +3 -3
- package/dist/{chunk-YCA4KCRF.mjs.map → chunk-TBAP7JNJ.mjs.map} +1 -1
- package/dist/{chunk-5YA6SI4Z.mjs → chunk-TIFVAASU.mjs} +2 -2
- package/dist/{chunk-MLXUMVBK.mjs → chunk-UCMMIGC6.mjs} +20 -6
- package/dist/chunk-UCMMIGC6.mjs.map +1 -0
- package/dist/{chunk-U577PJLH.mjs → chunk-UPF6HX5C.mjs} +7 -7
- package/dist/{chunk-U577PJLH.mjs.map → chunk-UPF6HX5C.mjs.map} +1 -1
- package/dist/{chunk-OB7K6EFK.js → chunk-UTCZNQ4G.js} +5 -5
- package/dist/{chunk-OB7K6EFK.js.map → chunk-UTCZNQ4G.js.map} +1 -1
- package/dist/{chunk-DGWFHL35.mjs → chunk-UV3HJDMT.mjs} +3 -3
- package/dist/{chunk-DGWFHL35.mjs.map → chunk-UV3HJDMT.mjs.map} +1 -1
- package/dist/{chunk-EF7QCYLF.js → chunk-W6GQNGIM.js} +4 -4
- package/dist/{chunk-EF7QCYLF.js.map → chunk-W6GQNGIM.js.map} +1 -1
- package/dist/{chunk-WVNUOUQI.mjs → chunk-W7D27SYJ.mjs} +3 -3
- package/dist/{chunk-WVNUOUQI.mjs.map → chunk-W7D27SYJ.mjs.map} +1 -1
- package/dist/{chunk-NK7ZWPAO.js → chunk-WI6RV2U4.js} +18 -18
- package/dist/{chunk-NK7ZWPAO.js.map → chunk-WI6RV2U4.js.map} +1 -1
- package/dist/{chunk-GZLMMX76.mjs → chunk-XAPGVZNN.mjs} +3 -3
- package/dist/{chunk-GZLMMX76.mjs.map → chunk-XAPGVZNN.mjs.map} +1 -1
- package/dist/{chunk-I7AZC5ZQ.js → chunk-XXSSUCJB.js} +2 -2
- package/dist/{chunk-3H3DTYFQ.js → chunk-Y63EG5CW.js} +8 -8
- package/dist/{chunk-3H3DTYFQ.js.map → chunk-Y63EG5CW.js.map} +1 -1
- package/dist/{chunk-D6VMDDQR.js → chunk-YNI7WQJN.js} +8 -8
- package/dist/{chunk-D6VMDDQR.js.map → chunk-YNI7WQJN.js.map} +1 -1
- package/dist/chunk-YZJ22HUQ.js +29 -0
- package/dist/chunk-YZJ22HUQ.js.map +1 -0
- package/dist/{chunk-OUZQL5PV.js → chunk-ZRCA5YGZ.js} +4 -4
- package/dist/{chunk-OUZQL5PV.js.map → chunk-ZRCA5YGZ.js.map} +1 -1
- package/dist/{chunk-7DMAVD7W.mjs → chunk-ZRD75SE5.mjs} +3 -3
- package/dist/{chunk-7DMAVD7W.mjs.map → chunk-ZRD75SE5.mjs.map} +1 -1
- package/dist/{chunk-NN2YE5WT.js → chunk-ZUQSVCMD.js} +3 -3
- package/dist/{chunk-6ZMEJSNX.mjs → chunk-ZZ6P27A5.mjs} +4 -4
- package/dist/{chunk-6ZMEJSNX.mjs.map → chunk-ZZ6P27A5.mjs.map} +1 -1
- package/dist/cli/index.js +211 -211
- package/dist/cli/index.mjs +151 -151
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/commerce/index.js +57 -57
- package/dist/commerce/index.mjs +5 -5
- package/dist/cta-bar/CtaBar.d.ts +15 -4
- package/dist/cta-bar/CtaBar.d.ts.map +1 -1
- package/dist/cta-bar/index.js +6 -12
- package/dist/cta-bar/index.js.map +1 -1
- package/dist/cta-bar/index.mjs +6 -12
- package/dist/cta-bar/index.mjs.map +1 -1
- package/dist/engage/ChatWidget.d.ts +60 -1
- package/dist/engage/ChatWidget.d.ts.map +1 -1
- package/dist/engage/EchoUiActions.d.ts +5 -2
- package/dist/engage/EchoUiActions.d.ts.map +1 -1
- package/dist/engage/brand-color.d.ts +37 -0
- package/dist/engage/brand-color.d.ts.map +1 -0
- package/dist/engage/chat-messages.d.ts +86 -0
- package/dist/engage/chat-messages.d.ts.map +1 -0
- package/dist/engage/index.js +11 -10
- package/dist/engage/index.js.map +1 -1
- package/dist/engage/index.mjs +8 -7
- package/dist/engage/index.mjs.map +1 -1
- package/dist/fleet/index.js +8 -8
- package/dist/fleet/index.mjs +4 -4
- package/dist/forms/index.js +16 -16
- package/dist/forms/index.mjs +9 -9
- package/dist/forms/server.js +10 -10
- package/dist/forms/server.mjs +8 -8
- package/dist/forms/static.js +7 -7
- package/dist/forms/static.mjs +6 -6
- package/dist/images/index.js +11 -11
- package/dist/images/index.mjs +4 -4
- package/dist/index.js +63 -63
- package/dist/index.mjs +9 -9
- package/dist/layout/client.js +8 -8
- package/dist/layout/client.mjs +7 -7
- package/dist/layout/index.js +10 -10
- package/dist/layout/index.mjs +8 -8
- package/dist/{lib-6HOOMENJ.js → lib-6GWWPDJR.js} +7 -7
- package/dist/lib-BD4KKQBI.mjs +4 -0
- package/dist/{lib-R7IQ4ZHE.mjs → lib-N5PD6JNJ.mjs} +2 -2
- package/dist/{lib-BGAWCSUH.js → lib-WFB5RLEQ.js} +8 -8
- package/dist/maps/index.js +5 -5
- package/dist/maps/index.mjs +3 -3
- package/dist/motion/CountUp.d.ts +49 -0
- package/dist/motion/CountUp.d.ts.map +1 -0
- package/dist/motion/Parallax.d.ts +14 -0
- package/dist/motion/Parallax.d.ts.map +1 -1
- package/dist/motion/ScrollScene.d.ts +1 -1
- package/dist/motion/ScrollScene.d.ts.map +1 -1
- package/dist/motion/engine.d.ts +19 -0
- package/dist/motion/engine.d.ts.map +1 -1
- package/dist/motion/gsap.d.ts +55 -6
- package/dist/motion/gsap.d.ts.map +1 -1
- package/dist/motion/gsap.js +101 -4
- package/dist/motion/gsap.js.map +1 -1
- package/dist/motion/gsap.mjs +96 -3
- package/dist/motion/gsap.mjs.map +1 -1
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js +21 -40
- package/dist/motion/index.js.map +1 -1
- package/dist/motion/index.mjs +11 -32
- package/dist/motion/index.mjs.map +1 -1
- package/dist/motion/three.js +5 -5
- package/dist/motion/three.mjs +1 -1
- package/dist/search/index.js +4 -4
- package/dist/search/index.mjs +3 -3
- package/dist/seo/client.js +5 -5
- package/dist/seo/client.mjs +4 -4
- package/dist/seo/index.js +5 -5
- package/dist/seo/index.mjs +4 -4
- package/dist/seo/register-sitemap-cli.js +12 -93
- package/dist/seo/register-sitemap-cli.mjs +2 -83
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/shared/color.d.ts +39 -0
- package/dist/shared/color.d.ts.map +1 -0
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +11 -11
- package/dist/signal/index.mjs +2 -2
- package/dist/sync/index.js +17 -17
- package/dist/sync/index.mjs +4 -4
- package/dist/{web-vitals.attribution-7LKLZ5GR.mjs → web-vitals.attribution-CHXXWO72.mjs} +3 -3
- package/dist/web-vitals.attribution-CHXXWO72.mjs.map +1 -0
- package/dist/{web-vitals.attribution-ONVYQNRB.js → web-vitals.attribution-SQVZNHN3.js} +3 -3
- package/dist/web-vitals.attribution-SQVZNHN3.js.map +1 -0
- package/package.json +1 -1
- package/dist/ChatWidget-LH3QZYKR.mjs +0 -16
- package/dist/ChatWidget-RUCQMCMN.js +0 -25
- package/dist/EngageWidget-34BQXU7K.mjs +0 -12
- package/dist/EngageWidget-X2CBW7DV.js +0 -21
- package/dist/ManagedForm-EUDKMS5G.mjs +0 -16
- package/dist/ManagedForm-O67ILXN7.js +0 -25
- package/dist/SitemapSync-DQALPBTR.js +0 -18
- package/dist/SitemapSync-QYV3X5LH.mjs +0 -9
- package/dist/chunk-3SHAY7PK.mjs.map +0 -1
- package/dist/chunk-AEW7EFYU.js.map +0 -1
- package/dist/chunk-HQWPCX3N.mjs +0 -6
- package/dist/chunk-MLXUMVBK.mjs.map +0 -1
- package/dist/chunk-QWUDHOUE.js +0 -8
- package/dist/chunk-QYRJ4IQD.js.map +0 -1
- package/dist/lib-RSDMEKDQ.mjs +0 -4
- package/dist/web-vitals.attribution-7LKLZ5GR.mjs.map +0 -1
- package/dist/web-vitals.attribution-ONVYQNRB.js.map +0 -1
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkESP5RMB7_js = require('./chunk-ESP5RMB7.js');
|
|
5
5
|
var chunkNBOBOYMT_js = require('./chunk-NBOBOYMT.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var chunkA4WTX36Y_js = require('./chunk-A4WTX36Y.js');
|
|
7
|
+
var chunkM2N7NY3V_js = require('./chunk-M2N7NY3V.js');
|
|
8
|
+
var chunk3NDDCSWR_js = require('./chunk-3NDDCSWR.js');
|
|
8
9
|
var react = require('react');
|
|
9
10
|
var ReactMarkdown = require('react-markdown');
|
|
10
11
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -13,6 +14,58 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
13
14
|
|
|
14
15
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
15
16
|
|
|
17
|
+
// src/engage/brand-color.ts
|
|
18
|
+
var TEXT_CONTRAST = 4.5;
|
|
19
|
+
var RESTING_TINT = 0.082;
|
|
20
|
+
var UNREADABLE_BRAND_SHARE = 40;
|
|
21
|
+
var WHITE = { r: 255, g: 255, b: 255 };
|
|
22
|
+
var BLACK = { r: 0, g: 0, b: 0 };
|
|
23
|
+
function mix(a, b, share) {
|
|
24
|
+
return {
|
|
25
|
+
r: a.r * share + b.r * (1 - share),
|
|
26
|
+
g: a.g * share + b.g * (1 - share),
|
|
27
|
+
b: a.b * share + b.b * (1 - share)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function round({ r, g, b }) {
|
|
31
|
+
const c = (v) => Math.round(Math.min(255, Math.max(0, v)));
|
|
32
|
+
return { r: c(r), g: c(g), b: c(b) };
|
|
33
|
+
}
|
|
34
|
+
function toHex(rgb) {
|
|
35
|
+
const { r, g, b } = round(rgb);
|
|
36
|
+
return `#${[r, g, b].map((c) => c.toString(16).padStart(2, "0")).join("")}`;
|
|
37
|
+
}
|
|
38
|
+
function isLightColor(color) {
|
|
39
|
+
const rgb = chunkM2N7NY3V_js.parseColor(color);
|
|
40
|
+
if (!rgb) return false;
|
|
41
|
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3 > 160;
|
|
42
|
+
}
|
|
43
|
+
function onBrandColor(brand) {
|
|
44
|
+
return isLightColor(brand) ? "#1a1a1a" : "white";
|
|
45
|
+
}
|
|
46
|
+
function rgbTriplet(color, fallback = "37, 99, 235") {
|
|
47
|
+
const rgb = chunkM2N7NY3V_js.parseColor(color);
|
|
48
|
+
if (!rgb) return fallback;
|
|
49
|
+
const { r, g, b } = round(rgb);
|
|
50
|
+
return `${r}, ${g}, ${b}`;
|
|
51
|
+
}
|
|
52
|
+
function brandTextColor(brand, panelTint) {
|
|
53
|
+
const tint = panelTint && chunkM2N7NY3V_js.parseColor(panelTint) || WHITE;
|
|
54
|
+
const pole = chunkM2N7NY3V_js.relativeLuminance(tint) < chunkM2N7NY3V_js.DARK_LUMINANCE ? WHITE : BLACK;
|
|
55
|
+
const rgb = chunkM2N7NY3V_js.parseColor(brand);
|
|
56
|
+
if (!rgb) return `color-mix(in srgb, ${brand} ${UNREADABLE_BRAND_SHARE}%, ${toHex(pole)})`;
|
|
57
|
+
const surface = chunkM2N7NY3V_js.relativeLuminance(mix(rgb, tint, RESTING_TINT));
|
|
58
|
+
const reads = (c) => chunkM2N7NY3V_js.contrastRatio(chunkM2N7NY3V_js.relativeLuminance(c), surface) >= TEXT_CONTRAST;
|
|
59
|
+
if (reads(rgb)) return brand;
|
|
60
|
+
let lo = 0;
|
|
61
|
+
let hi = 1;
|
|
62
|
+
for (let i = 0; i < 12; i++) {
|
|
63
|
+
const share = (lo + hi) / 2;
|
|
64
|
+
if (reads(round(mix(rgb, pole, share)))) lo = share;
|
|
65
|
+
else hi = share;
|
|
66
|
+
}
|
|
67
|
+
return toHex(mix(rgb, pole, lo));
|
|
68
|
+
}
|
|
16
69
|
function alpha(rgb, a) {
|
|
17
70
|
return `rgba(var(--sk-primary-rgb, ${rgb}), ${a})`;
|
|
18
71
|
}
|
|
@@ -39,7 +92,7 @@ function InlineManagedForm({ slug, prefill, primaryColor, primaryRgb }) {
|
|
|
39
92
|
submit,
|
|
40
93
|
isSubmitting,
|
|
41
94
|
isComplete
|
|
42
|
-
} =
|
|
95
|
+
} = chunkA4WTX36Y_js.useForm(slug, { initialValues: prefill || {} });
|
|
43
96
|
const cardStyle = {
|
|
44
97
|
marginTop: 8,
|
|
45
98
|
padding: 12,
|
|
@@ -198,7 +251,7 @@ function InlineManagedForm({ slug, prefill, primaryColor, primaryRgb }) {
|
|
|
198
251
|
borderRadius: 8,
|
|
199
252
|
border: "none",
|
|
200
253
|
backgroundColor: primaryColor,
|
|
201
|
-
color:
|
|
254
|
+
color: onBrandColor(primaryColor),
|
|
202
255
|
fontSize: 13.5,
|
|
203
256
|
fontWeight: 600,
|
|
204
257
|
cursor: isSubmitting ? "default" : "pointer",
|
|
@@ -211,7 +264,7 @@ function InlineManagedForm({ slug, prefill, primaryColor, primaryRgb }) {
|
|
|
211
264
|
}
|
|
212
265
|
);
|
|
213
266
|
}
|
|
214
|
-
function SuggestActionChip({ action, message, primaryColor, primaryRgb, onSuggest }) {
|
|
267
|
+
function SuggestActionChip({ action, message, primaryColor, primaryRgb, brandText, onSuggest }) {
|
|
215
268
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
216
269
|
"button",
|
|
217
270
|
{
|
|
@@ -222,7 +275,7 @@ function SuggestActionChip({ action, message, primaryColor, primaryRgb, onSugges
|
|
|
222
275
|
borderRadius: 16,
|
|
223
276
|
border: `1px solid ${primaryColor}`,
|
|
224
277
|
backgroundColor: alpha(primaryRgb, 0.063),
|
|
225
|
-
color:
|
|
278
|
+
color: brandText,
|
|
226
279
|
fontSize: 13,
|
|
227
280
|
cursor: "pointer"
|
|
228
281
|
},
|
|
@@ -230,7 +283,7 @@ function SuggestActionChip({ action, message, primaryColor, primaryRgb, onSugges
|
|
|
230
283
|
}
|
|
231
284
|
);
|
|
232
285
|
}
|
|
233
|
-
function EchoUiActions({ actions, primaryColor, primaryRgb, onSuggest }) {
|
|
286
|
+
function EchoUiActions({ actions, primaryColor, primaryRgb, brandText, onSuggest }) {
|
|
234
287
|
if (!actions?.length) return null;
|
|
235
288
|
const chips = actions.filter((a) => a?.type === "suggest_action");
|
|
236
289
|
const forms = actions.filter((a) => a?.type === "show_form");
|
|
@@ -262,6 +315,7 @@ function EchoUiActions({ actions, primaryColor, primaryRgb, onSuggest }) {
|
|
|
262
315
|
message: label,
|
|
263
316
|
primaryColor,
|
|
264
317
|
primaryRgb,
|
|
318
|
+
brandText,
|
|
265
319
|
onSuggest
|
|
266
320
|
},
|
|
267
321
|
`chip-${i}`
|
|
@@ -269,6 +323,71 @@ function EchoUiActions({ actions, primaryColor, primaryRgb, onSuggest }) {
|
|
|
269
323
|
}) }) : null
|
|
270
324
|
] });
|
|
271
325
|
}
|
|
326
|
+
|
|
327
|
+
// src/engage/chat-messages.ts
|
|
328
|
+
function userRequestedHandoff(text) {
|
|
329
|
+
const lower = text.toLowerCase().trim();
|
|
330
|
+
const patterns = [
|
|
331
|
+
/\b(talk|speak)\s+(to|with)\s+(a\s+)?(person|human|agent|representative|someone)\b/,
|
|
332
|
+
/\b(real|live)\s+(person|human|agent|support)\b/,
|
|
333
|
+
/\bconnect\s+(me\s+)?(with|to)\s+(a\s+)?(person|human|agent)\b/,
|
|
334
|
+
/\b(need|want)\s+(to\s+)?(talk|speak)\s+(to|with)\s+(someone|a\s+person)\b/,
|
|
335
|
+
/\bhuman\s+(support|agent|help)\b/,
|
|
336
|
+
/\b(talk|speak)\s+to\s+(a\s+)?person\b/,
|
|
337
|
+
/\bget\s+(a\s+)?(person|human)\b/
|
|
338
|
+
];
|
|
339
|
+
return patterns.some((p) => p.test(lower));
|
|
340
|
+
}
|
|
341
|
+
function visitorMessage(content, attachments = []) {
|
|
342
|
+
return {
|
|
343
|
+
id: `user-${Date.now()}`,
|
|
344
|
+
role: "user",
|
|
345
|
+
content,
|
|
346
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
347
|
+
...attachments.length ? { attachments } : {}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function openingMessages(welcome, initialMessage) {
|
|
351
|
+
const opening = [{ id: "welcome", role: "assistant", content: welcome, timestamp: /* @__PURE__ */ new Date() }];
|
|
352
|
+
if (initialMessage) opening.push(visitorMessage(initialMessage));
|
|
353
|
+
return opening;
|
|
354
|
+
}
|
|
355
|
+
function echoReplyMessage(reply, probe) {
|
|
356
|
+
return {
|
|
357
|
+
id: `ai-${Date.now()}`,
|
|
358
|
+
role: "assistant",
|
|
359
|
+
content: reply.content,
|
|
360
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
361
|
+
...reply.suggestions?.length ? { suggestions: reply.suggestions } : {},
|
|
362
|
+
...reply.uiActions?.length ? { uiActions: reply.uiActions } : {},
|
|
363
|
+
...reply.offerHandoff || userRequestedHandoff(probe) ? { offerHandoff: true } : {}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
function echoErrorMessage() {
|
|
367
|
+
return {
|
|
368
|
+
id: `err-${Date.now()}`,
|
|
369
|
+
role: "assistant",
|
|
370
|
+
content: "I apologize, but I encountered an error. Would you like to speak with a team member?",
|
|
371
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
372
|
+
suggestions: ["Talk to a person", "Try again"],
|
|
373
|
+
offerHandoff: true
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
async function askEcho(content, deps) {
|
|
377
|
+
deps.setLoading(true);
|
|
378
|
+
try {
|
|
379
|
+
const reply = await deps.send(content);
|
|
380
|
+
deps.append(echoReplyMessage(reply, content));
|
|
381
|
+
} catch (err) {
|
|
382
|
+
deps.onError?.(err);
|
|
383
|
+
deps.append(echoErrorMessage());
|
|
384
|
+
} finally {
|
|
385
|
+
deps.setLoading(false);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function deliverOpeningMessage(pending, route) {
|
|
389
|
+
return route.signalEnabled ? route.ask(pending) : route.emitLive(pending);
|
|
390
|
+
}
|
|
272
391
|
function getApiConfig() {
|
|
273
392
|
const isDev = typeof process !== "undefined" && process.env?.NODE_ENV === "development";
|
|
274
393
|
const defaultApiUrl = isDev && process.env?.SONOR_API_URL ? process.env.SONOR_API_URL : "https://api.sonor.io";
|
|
@@ -291,19 +410,6 @@ function linkifyUrls(text) {
|
|
|
291
410
|
(_, before, url) => `${before}[${url}](${url})`
|
|
292
411
|
);
|
|
293
412
|
}
|
|
294
|
-
function userRequestedHandoff(text) {
|
|
295
|
-
const lower = text.toLowerCase().trim();
|
|
296
|
-
const patterns = [
|
|
297
|
-
/\b(talk|speak)\s+(to|with)\s+(a\s+)?(person|human|agent|representative|someone)\b/,
|
|
298
|
-
/\b(real|live)\s+(person|human|agent|support)\b/,
|
|
299
|
-
/\bconnect\s+(me\s+)?(with|to)\s+(a\s+)?(person|human|agent)\b/,
|
|
300
|
-
/\b(need|want)\s+(to\s+)?(talk|speak)\s+(to|with)\s+(someone|a\s+person)\b/,
|
|
301
|
-
/\bhuman\s+(support|agent|help)\b/,
|
|
302
|
-
/\b(talk|speak)\s+to\s+(a\s+)?person\b/,
|
|
303
|
-
/\bget\s+(a\s+)?(person|human)\b/
|
|
304
|
-
];
|
|
305
|
-
return patterns.some((p) => p.test(lower));
|
|
306
|
-
}
|
|
307
413
|
var BUBBLE_BG = "color-mix(in srgb, var(--sk-bg, #ffffff) 94%, transparent)";
|
|
308
414
|
var HAIRLINE = "1px solid color-mix(in srgb, var(--sk-text-primary, #111827) 9%, transparent)";
|
|
309
415
|
var ECHO_STYLE_HREF = "sk-echo";
|
|
@@ -315,27 +421,58 @@ var ECHO_CSS = `
|
|
|
315
421
|
[data-sk-echo-panel] { animation: none !important; }
|
|
316
422
|
}
|
|
317
423
|
`;
|
|
318
|
-
function isLightColor(hex) {
|
|
319
|
-
const num = parseInt(hex.replace("#", ""), 16);
|
|
320
|
-
const r = num >> 16;
|
|
321
|
-
const g = num >> 8 & 255;
|
|
322
|
-
const b = num & 255;
|
|
323
|
-
return (r * 299 + g * 587 + b * 114) / 1e3 > 160;
|
|
324
|
-
}
|
|
325
424
|
function staticPrimaryColor(apiFallback, hardDefault) {
|
|
326
425
|
return apiFallback || hardDefault;
|
|
327
426
|
}
|
|
328
|
-
function hexToRgbString(hex, fallback = "37, 99, 235") {
|
|
329
|
-
const match = hex.replace("#", "").match(/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);
|
|
330
|
-
if (!match) return fallback;
|
|
331
|
-
return `${parseInt(match[1], 16)}, ${parseInt(match[2], 16)}, ${parseInt(match[3], 16)}`;
|
|
332
|
-
}
|
|
333
427
|
function hexAlpha(rgbVar, alpha2, fallbackRgb = "37, 99, 235") {
|
|
334
428
|
return `rgba(var(${rgbVar}, ${fallbackRgb}), ${alpha2})`;
|
|
335
429
|
}
|
|
336
|
-
function
|
|
430
|
+
function isChatEnabled(config) {
|
|
431
|
+
return config !== null && config.is_enabled !== false;
|
|
432
|
+
}
|
|
433
|
+
function ChatWidget(props) {
|
|
434
|
+
const { projectId: propProjectId, apiUrl: propApiUrl } = props;
|
|
337
435
|
const [resolvedProjectId, setResolvedProjectId] = react.useState(propProjectId || null);
|
|
338
436
|
const projectId = propProjectId || resolvedProjectId || "";
|
|
437
|
+
const [widgetConfig, setWidgetConfig] = react.useState(null);
|
|
438
|
+
const baseUrl = propApiUrl || getApiConfig().apiUrl;
|
|
439
|
+
react.useEffect(() => {
|
|
440
|
+
if (propProjectId || resolvedProjectId) return;
|
|
441
|
+
const { apiKey } = getApiConfig();
|
|
442
|
+
if (!apiKey) return;
|
|
443
|
+
let cancelled = false;
|
|
444
|
+
chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/api/public/seo/project-info`, {}, { apiKey, retries: 0 }).then((res) => res.ok ? res.json() : null).then((data) => {
|
|
445
|
+
if (cancelled || !data?.valid || !data?.project_id) return;
|
|
446
|
+
setResolvedProjectId(data.project_id);
|
|
447
|
+
}).catch(() => {
|
|
448
|
+
});
|
|
449
|
+
return () => {
|
|
450
|
+
cancelled = true;
|
|
451
|
+
};
|
|
452
|
+
}, [propProjectId, resolvedProjectId, baseUrl]);
|
|
453
|
+
react.useEffect(() => {
|
|
454
|
+
if (!projectId) return;
|
|
455
|
+
const { apiKey } = getApiConfig();
|
|
456
|
+
if (!apiKey) {
|
|
457
|
+
console.warn("[ChatWidget] No site credential found. Render SiteKitLayout in app/layout.tsx and set SONOR_API_KEY on the server.");
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
let cancelled = false;
|
|
461
|
+
chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/config?projectId=${projectId}`, {}, { apiKey, retries: 0 }).then((res) => res.ok ? res.json() : null).then((json) => {
|
|
462
|
+
if (!cancelled) setWidgetConfig(json?.data ?? null);
|
|
463
|
+
}).catch((error) => {
|
|
464
|
+
if (process.env.NODE_ENV === "development") {
|
|
465
|
+
console.warn("[ChatWidget] Config fetch failed:", error instanceof Error ? error.message : error);
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
return () => {
|
|
469
|
+
cancelled = true;
|
|
470
|
+
};
|
|
471
|
+
}, [projectId, baseUrl]);
|
|
472
|
+
if (!isChatEnabled(widgetConfig)) return null;
|
|
473
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EchoChat, { ...props, projectId, widgetConfig });
|
|
474
|
+
}
|
|
475
|
+
function EchoChat({ projectId, widgetConfig, config, apiUrl: propApiUrl, signalUrl: propSignalUrl, suggested_questions: propSuggestedQuestions, assistant_name: propAssistantName, welcome_message: propWelcomeMessage, assistant_avatar: propAssistantAvatar }) {
|
|
339
476
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
340
477
|
const [messages, setMessages] = react.useState([]);
|
|
341
478
|
const [inputValue, setInputValue] = react.useState("");
|
|
@@ -348,7 +485,6 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
348
485
|
const [offlineForm, setOfflineForm] = react.useState({ name: "", email: "", phone: "", message: "" });
|
|
349
486
|
const [offlineSubmitted, setOfflineSubmitted] = react.useState(false);
|
|
350
487
|
const [connectionStatus, setConnectionStatus] = react.useState("disconnected");
|
|
351
|
-
const [widgetConfig, setWidgetConfig] = react.useState(null);
|
|
352
488
|
const [handoffOfflinePrompt, setHandoffOfflinePrompt] = react.useState(null);
|
|
353
489
|
const [pendingFiles, setPendingFiles] = react.useState([]);
|
|
354
490
|
const [lastFailedSend, setLastFailedSend] = react.useState(null);
|
|
@@ -382,11 +518,19 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
382
518
|
const primaryFallback = staticPrimaryColor(widgetConfig?.brand_primary || config?.buttonColor, "#2563eb");
|
|
383
519
|
const [primaryFromCssVar, setPrimaryFromCssVar] = react.useState(null);
|
|
384
520
|
const primaryColor = primaryFromCssVar ?? primaryFallback;
|
|
385
|
-
const primaryRgb =
|
|
521
|
+
const primaryRgb = rgbTriplet(primaryColor);
|
|
386
522
|
react.useEffect(() => {
|
|
387
523
|
const cssValue = getComputedStyle(document.documentElement).getPropertyValue("--sk-primary").trim();
|
|
388
524
|
setPrimaryFromCssVar(cssValue || null);
|
|
389
525
|
}, []);
|
|
526
|
+
const onBrand = onBrandColor(primaryColor);
|
|
527
|
+
const panelRef = react.useRef(null);
|
|
528
|
+
const [panelTint, setPanelTint] = react.useState(null);
|
|
529
|
+
react.useLayoutEffect(() => {
|
|
530
|
+
if (!isOpen || !panelRef.current) return;
|
|
531
|
+
setPanelTint(getComputedStyle(panelRef.current).getPropertyValue("--sk-glass-t").trim() || null);
|
|
532
|
+
}, [isOpen]);
|
|
533
|
+
const brandText = brandTextColor(primaryColor, panelTint);
|
|
390
534
|
const businessName = propAssistantName || widgetConfig?.project_name || widgetConfig?.business_info?.name || "Chat with us";
|
|
391
535
|
const logoUrl = propAssistantAvatar || widgetConfig?.logo_url || null;
|
|
392
536
|
const welcomeEnabled = widgetConfig?.welcome_screen_enabled !== false;
|
|
@@ -397,42 +541,12 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
397
541
|
const offlineSubheading = handoffOfflinePrompt ?? widgetConfig?.offline_subheading ?? widgetConfig?.form_description ?? widgetConfig?.offline_message ?? config?.offlineMessage ?? "Leave us a message and we'll get back to you!";
|
|
398
542
|
const baseUrl = propApiUrl || getApiConfig().apiUrl;
|
|
399
543
|
const signalUrl = propSignalUrl || getApiConfig().signalUrl;
|
|
400
|
-
react.useEffect(() => {
|
|
401
|
-
if (propProjectId || resolvedProjectId) return;
|
|
402
|
-
const { apiKey } = getApiConfig();
|
|
403
|
-
if (!apiKey) return;
|
|
404
|
-
let cancelled = false;
|
|
405
|
-
chunkVNJTU6LG_js.sonorFetch(`${baseUrl}/api/public/seo/project-info`, {}, { apiKey, retries: 0 }).then((res) => res.ok ? res.json() : null).then((data) => {
|
|
406
|
-
if (cancelled || !data?.valid || !data?.project_id) return;
|
|
407
|
-
setResolvedProjectId(data.project_id);
|
|
408
|
-
}).catch(() => {
|
|
409
|
-
});
|
|
410
|
-
return () => {
|
|
411
|
-
cancelled = true;
|
|
412
|
-
};
|
|
413
|
-
}, [propProjectId, resolvedProjectId, baseUrl]);
|
|
414
|
-
const fetchWidgetConfig = react.useCallback(async () => {
|
|
415
|
-
if (!projectId) return;
|
|
416
|
-
const apiKey = ensureApiKey();
|
|
417
|
-
if (!apiKey) return;
|
|
418
|
-
try {
|
|
419
|
-
const response = await chunkVNJTU6LG_js.sonorFetch(`${baseUrl}/engage/widget/config?projectId=${projectId}`, {}, { apiKey, retries: 0 });
|
|
420
|
-
if (response.ok) {
|
|
421
|
-
const { data } = await response.json();
|
|
422
|
-
setWidgetConfig(data ?? null);
|
|
423
|
-
}
|
|
424
|
-
} catch (error) {
|
|
425
|
-
if (process.env.NODE_ENV === "development") {
|
|
426
|
-
console.warn("[ChatWidget] Config fetch failed:", error instanceof Error ? error.message : error);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}, [projectId, baseUrl]);
|
|
430
544
|
const checkAvailability = react.useCallback(async () => {
|
|
431
545
|
if (!projectId) return null;
|
|
432
546
|
const apiKey = ensureApiKey();
|
|
433
547
|
if (!apiKey) return null;
|
|
434
548
|
try {
|
|
435
|
-
const response = await
|
|
549
|
+
const response = await chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/availability?projectId=${projectId}`, {}, { apiKey, retries: 0 });
|
|
436
550
|
if (response.ok) {
|
|
437
551
|
const { data } = await response.json();
|
|
438
552
|
setAvailability(data);
|
|
@@ -449,7 +563,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
449
563
|
const apiKey = ensureApiKey();
|
|
450
564
|
if (!apiKey) return null;
|
|
451
565
|
try {
|
|
452
|
-
const response = await
|
|
566
|
+
const response = await chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/session`, {
|
|
453
567
|
method: "POST",
|
|
454
568
|
headers: { "Content-Type": "application/json" },
|
|
455
569
|
body: JSON.stringify({
|
|
@@ -510,7 +624,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
510
624
|
pageUrl: typeof window !== "undefined" ? window.location.href : void 0,
|
|
511
625
|
...siteContext ? { siteContext } : {}
|
|
512
626
|
};
|
|
513
|
-
const res = await
|
|
627
|
+
const res = await chunk3NDDCSWR_js.sonorFetch(url, {
|
|
514
628
|
method: "POST",
|
|
515
629
|
headers: {
|
|
516
630
|
"Content-Type": "application/json"
|
|
@@ -531,22 +645,14 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
531
645
|
},
|
|
532
646
|
[signalUrl, visitorId, fetchSiteContext]
|
|
533
647
|
);
|
|
534
|
-
const
|
|
535
|
-
(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
543
|
-
...reply.suggestions?.length ? { suggestions: reply.suggestions } : {},
|
|
544
|
-
...reply.uiActions?.length ? { uiActions: reply.uiActions } : {},
|
|
545
|
-
...reply.offerHandoff || userRequestedHandoff(probeContent) ? { offerHandoff: true } : {}
|
|
546
|
-
}
|
|
547
|
-
]);
|
|
548
|
-
},
|
|
549
|
-
[]
|
|
648
|
+
const sendTurnToEcho = react.useCallback(
|
|
649
|
+
(content, conversationId) => askEcho(content, {
|
|
650
|
+
send: (text) => sendToSignalApi(text, conversationId),
|
|
651
|
+
append: (message) => setMessages((prev) => [...prev, message]),
|
|
652
|
+
setLoading: setIsLoading,
|
|
653
|
+
onError: (err) => console.error("[ChatWidget] Signal API error:", err)
|
|
654
|
+
}),
|
|
655
|
+
[sendToSignalApi]
|
|
550
656
|
);
|
|
551
657
|
const handleSocketMessage = react.useCallback((data) => {
|
|
552
658
|
switch (data.type || data.event) {
|
|
@@ -621,7 +727,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
621
727
|
if (currentSessionId) {
|
|
622
728
|
const apiKey = ensureApiKey();
|
|
623
729
|
if (apiKey) {
|
|
624
|
-
|
|
730
|
+
chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/messages?sessionId=${currentSessionId}`, {}, { apiKey, retries: 0 }).then((res) => res.ok ? res.json() : null).then((json) => {
|
|
625
731
|
const data = json?.data ?? json;
|
|
626
732
|
if (Array.isArray(data) && data.length) {
|
|
627
733
|
setMessages((prev) => {
|
|
@@ -684,7 +790,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
684
790
|
try {
|
|
685
791
|
const apiKey = ensureApiKey();
|
|
686
792
|
if (!apiKey) return;
|
|
687
|
-
const response = await
|
|
793
|
+
const response = await chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/messages?sessionId=${currentSessionId}`, {}, { apiKey, retries: 0 });
|
|
688
794
|
if (response.ok) {
|
|
689
795
|
const { data } = await response.json();
|
|
690
796
|
setMessages((prev) => {
|
|
@@ -719,7 +825,6 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
719
825
|
if (isOpen && !showWelcome && inputRef.current) inputRef.current.focus();
|
|
720
826
|
}, [isOpen, showWelcome]);
|
|
721
827
|
react.useEffect(() => {
|
|
722
|
-
fetchWidgetConfig();
|
|
723
828
|
checkAvailability();
|
|
724
829
|
const interval = setInterval(checkAvailability, 6e4);
|
|
725
830
|
return () => {
|
|
@@ -729,7 +834,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
729
834
|
socketRef.current = null;
|
|
730
835
|
}
|
|
731
836
|
};
|
|
732
|
-
}, [
|
|
837
|
+
}, [checkAvailability]);
|
|
733
838
|
react.useEffect(() => {
|
|
734
839
|
if (isOpen && !showWelcome && !checkingAvailability && !showOfflineForm && !sessionId) {
|
|
735
840
|
initSession().then(async (result) => {
|
|
@@ -739,58 +844,38 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
739
844
|
if (pending) {
|
|
740
845
|
pendingInitialMessageRef.current = null;
|
|
741
846
|
}
|
|
742
|
-
if (signalEnabled && pending) {
|
|
743
|
-
setIsLoading(true);
|
|
744
|
-
setMessages((prev) => [
|
|
745
|
-
...prev,
|
|
746
|
-
{ id: `u-${Date.now()}`, role: "user", content: pending, timestamp: /* @__PURE__ */ new Date() }
|
|
747
|
-
]);
|
|
748
|
-
try {
|
|
749
|
-
const reply = await sendToSignalApi(pending, id);
|
|
750
|
-
pushEchoReply(reply, pending);
|
|
751
|
-
} catch (err) {
|
|
752
|
-
console.error("[ChatWidget] Signal API error:", err);
|
|
753
|
-
setMessages((prev) => [
|
|
754
|
-
...prev,
|
|
755
|
-
{
|
|
756
|
-
id: `err-${Date.now()}`,
|
|
757
|
-
role: "assistant",
|
|
758
|
-
content: "I apologize, but I encountered an error. Would you like to speak with a team member?",
|
|
759
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
760
|
-
suggestions: ["Talk to a person", "Try again"],
|
|
761
|
-
offerHandoff: true
|
|
762
|
-
}
|
|
763
|
-
]);
|
|
764
|
-
} finally {
|
|
765
|
-
setIsLoading(false);
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
847
|
if (!signalEnabled) {
|
|
769
848
|
setConnectionStatus("connecting");
|
|
770
849
|
await connectSocket(id);
|
|
771
850
|
}
|
|
772
|
-
if (
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
851
|
+
if (pending) {
|
|
852
|
+
await deliverOpeningMessage(pending, {
|
|
853
|
+
signalEnabled,
|
|
854
|
+
ask: (content) => sendTurnToEcho(content, id),
|
|
855
|
+
emitLive: async (content) => {
|
|
856
|
+
const waitForSocket = () => new Promise((resolve) => {
|
|
857
|
+
const check = (attempts = 0) => {
|
|
858
|
+
if (socketRef.current?.connected || attempts > 20) {
|
|
859
|
+
resolve();
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
setTimeout(() => check(attempts + 1), 150);
|
|
863
|
+
};
|
|
864
|
+
check();
|
|
865
|
+
});
|
|
866
|
+
await waitForSocket();
|
|
867
|
+
if (socketRef.current?.connected) {
|
|
868
|
+
socketRef.current.emit("visitor:message", { content });
|
|
778
869
|
}
|
|
779
|
-
|
|
780
|
-
};
|
|
781
|
-
check();
|
|
870
|
+
}
|
|
782
871
|
});
|
|
783
|
-
await waitForSocket();
|
|
784
|
-
if (socketRef.current?.connected) {
|
|
785
|
-
socketRef.current.emit("visitor:message", { content: pending });
|
|
786
|
-
}
|
|
787
872
|
}
|
|
788
873
|
});
|
|
789
874
|
}
|
|
790
875
|
return () => {
|
|
791
876
|
if (pollingIntervalRef.current) clearInterval(pollingIntervalRef.current);
|
|
792
877
|
};
|
|
793
|
-
}, [isOpen, showWelcome, checkingAvailability, showOfflineForm, sessionId, initSession, connectSocket,
|
|
878
|
+
}, [isOpen, showWelcome, checkingAvailability, showOfflineForm, sessionId, initSession, connectSocket, sendTurnToEcho]);
|
|
794
879
|
const handleToggle = react.useCallback(() => {
|
|
795
880
|
setIsOpen((prev) => !prev);
|
|
796
881
|
}, []);
|
|
@@ -798,11 +883,9 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
798
883
|
async (initialMessage) => {
|
|
799
884
|
setShowWelcome(false);
|
|
800
885
|
const beginChatSession = () => {
|
|
801
|
-
setMessages(
|
|
886
|
+
setMessages(openingMessages(welcomeMessage, initialMessage));
|
|
802
887
|
if (initialMessage) {
|
|
803
888
|
pendingInitialMessageRef.current = initialMessage;
|
|
804
|
-
const userMsg = { id: `user-${Date.now()}`, role: "user", content: initialMessage, timestamp: /* @__PURE__ */ new Date() };
|
|
805
|
-
setMessages((prev) => [...prev, userMsg]);
|
|
806
889
|
setIsLoading(true);
|
|
807
890
|
}
|
|
808
891
|
};
|
|
@@ -837,7 +920,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
837
920
|
form.append("file", file);
|
|
838
921
|
form.append("sessionId", sessionId);
|
|
839
922
|
form.append("visitorId", visitorId);
|
|
840
|
-
const res = await
|
|
923
|
+
const res = await chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/upload`, {
|
|
841
924
|
method: "POST",
|
|
842
925
|
body: form
|
|
843
926
|
}, { apiKey, retries: 0 });
|
|
@@ -869,37 +952,12 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
869
952
|
return;
|
|
870
953
|
}
|
|
871
954
|
}
|
|
872
|
-
const userMessage =
|
|
873
|
-
id: `user-${Date.now()}`,
|
|
874
|
-
role: "user",
|
|
875
|
-
content,
|
|
876
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
877
|
-
...attachments.length ? { attachments } : {}
|
|
878
|
-
};
|
|
955
|
+
const userMessage = visitorMessage(content, attachments);
|
|
879
956
|
setMessages((prev) => [...prev, userMessage]);
|
|
880
957
|
setInputValue("");
|
|
881
958
|
setIsLoading(true);
|
|
882
959
|
if (widgetConfig?.signal_enabled && !isHandedOff && hasText) {
|
|
883
|
-
|
|
884
|
-
const reply = await sendToSignalApi(content, sessionId);
|
|
885
|
-
const lastUserContent = messages.filter((m) => m.role === "user").slice(-1)[0]?.content ?? "";
|
|
886
|
-
pushEchoReply(reply, lastUserContent);
|
|
887
|
-
} catch (err) {
|
|
888
|
-
console.error("[ChatWidget] Signal API error:", err);
|
|
889
|
-
setMessages((prev) => [
|
|
890
|
-
...prev,
|
|
891
|
-
{
|
|
892
|
-
id: `err-${Date.now()}`,
|
|
893
|
-
role: "assistant",
|
|
894
|
-
content: "I apologize, but I encountered an error. Would you like to speak with a team member?",
|
|
895
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
896
|
-
suggestions: ["Talk to a person", "Try again"],
|
|
897
|
-
offerHandoff: true
|
|
898
|
-
}
|
|
899
|
-
]);
|
|
900
|
-
} finally {
|
|
901
|
-
setIsLoading(false);
|
|
902
|
-
}
|
|
960
|
+
await sendTurnToEcho(content, sessionId);
|
|
903
961
|
return;
|
|
904
962
|
}
|
|
905
963
|
const socket = socketRef.current;
|
|
@@ -919,38 +977,16 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
919
977
|
}
|
|
920
978
|
}, 3e3);
|
|
921
979
|
},
|
|
922
|
-
[inputValue, isLoading, pendingFiles, uploadWidgetFile, widgetConfig?.signal_enabled, isHandedOff,
|
|
980
|
+
[inputValue, isLoading, pendingFiles, uploadWidgetFile, widgetConfig?.signal_enabled, isHandedOff, sendTurnToEcho, sessionId]
|
|
923
981
|
);
|
|
924
982
|
const sendEchoText = react.useCallback(
|
|
925
983
|
async (text) => {
|
|
926
984
|
const content = text.trim();
|
|
927
985
|
if (!content || isLoading) return;
|
|
928
|
-
setMessages((prev) => [
|
|
929
|
-
|
|
930
|
-
{ id: `user-${Date.now()}`, role: "user", content, timestamp: /* @__PURE__ */ new Date() }
|
|
931
|
-
]);
|
|
932
|
-
setIsLoading(true);
|
|
933
|
-
try {
|
|
934
|
-
const reply = await sendToSignalApi(content, sessionId);
|
|
935
|
-
pushEchoReply(reply, content);
|
|
936
|
-
} catch (err) {
|
|
937
|
-
console.error("[ChatWidget] Signal API error:", err);
|
|
938
|
-
setMessages((prev) => [
|
|
939
|
-
...prev,
|
|
940
|
-
{
|
|
941
|
-
id: `err-${Date.now()}`,
|
|
942
|
-
role: "assistant",
|
|
943
|
-
content: "I apologize, but I encountered an error. Would you like to speak with a team member?",
|
|
944
|
-
timestamp: /* @__PURE__ */ new Date(),
|
|
945
|
-
suggestions: ["Talk to a person", "Try again"],
|
|
946
|
-
offerHandoff: true
|
|
947
|
-
}
|
|
948
|
-
]);
|
|
949
|
-
} finally {
|
|
950
|
-
setIsLoading(false);
|
|
951
|
-
}
|
|
986
|
+
setMessages((prev) => [...prev, visitorMessage(content)]);
|
|
987
|
+
await sendTurnToEcho(content, sessionId);
|
|
952
988
|
},
|
|
953
|
-
[isLoading, sessionId,
|
|
989
|
+
[isLoading, sessionId, sendTurnToEcho]
|
|
954
990
|
);
|
|
955
991
|
const handleSuggestAction = react.useCallback(
|
|
956
992
|
(action, message) => {
|
|
@@ -984,7 +1020,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
984
1020
|
if (!apiKey) return;
|
|
985
1021
|
setCheckingHandoff(true);
|
|
986
1022
|
try {
|
|
987
|
-
const res = await
|
|
1023
|
+
const res = await chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/handoff`, {
|
|
988
1024
|
method: "POST",
|
|
989
1025
|
headers: { "Content-Type": "application/json" },
|
|
990
1026
|
body: JSON.stringify({ sessionId })
|
|
@@ -1023,7 +1059,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1023
1059
|
setIsLoading(true);
|
|
1024
1060
|
setOfflineError(null);
|
|
1025
1061
|
try {
|
|
1026
|
-
const response = await
|
|
1062
|
+
const response = await chunk3NDDCSWR_js.sonorFetch(`${baseUrl}/engage/widget/offline-form`, {
|
|
1027
1063
|
method: "POST",
|
|
1028
1064
|
headers: { "Content-Type": "application/json" },
|
|
1029
1065
|
body: JSON.stringify({
|
|
@@ -1072,7 +1108,6 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1072
1108
|
if (availability && availability.agentsOnline > 0) return { dot: "#22c55e", text: "Online" };
|
|
1073
1109
|
return { dot: "var(--sk-text-tertiary, #9ca3af)", text: "We'll respond soon" };
|
|
1074
1110
|
})();
|
|
1075
|
-
const launcherIcon = isLightColor(primaryColor) ? "#1a1a1a" : "white";
|
|
1076
1111
|
const ChatButton = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1077
1112
|
"button",
|
|
1078
1113
|
{
|
|
@@ -1101,10 +1136,10 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1101
1136
|
onMouseLeave: (e) => {
|
|
1102
1137
|
e.currentTarget.style.transform = "scale(1)";
|
|
1103
1138
|
},
|
|
1104
|
-
children: isOpen ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
1139
|
+
children: isOpen ? /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: onBrand, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1105
1140
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1106
1141
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1107
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
1142
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: onBrand, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) })
|
|
1108
1143
|
}
|
|
1109
1144
|
);
|
|
1110
1145
|
const Header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1128,7 +1163,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1128
1163
|
height: 40,
|
|
1129
1164
|
borderRadius: "50%",
|
|
1130
1165
|
backgroundColor: primaryColor,
|
|
1131
|
-
color:
|
|
1166
|
+
color: onBrand,
|
|
1132
1167
|
boxShadow: "inset 0 1px 0 color-mix(in srgb, #ffffff 30%, transparent), 0 2px 6px rgba(0, 0, 0, 0.12)",
|
|
1133
1168
|
display: "flex",
|
|
1134
1169
|
alignItems: "center",
|
|
@@ -1165,7 +1200,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1165
1200
|
borderRadius: 12,
|
|
1166
1201
|
border: `1px solid ${hexAlpha("--sk-primary-rgb", 0.2, primaryRgb)}`,
|
|
1167
1202
|
backgroundColor: hexAlpha("--sk-primary-rgb", 0.031, primaryRgb),
|
|
1168
|
-
color:
|
|
1203
|
+
color: brandText,
|
|
1169
1204
|
fontSize: 14,
|
|
1170
1205
|
cursor: "pointer",
|
|
1171
1206
|
textAlign: "left",
|
|
@@ -1194,7 +1229,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1194
1229
|
borderRadius: 12,
|
|
1195
1230
|
border: "none",
|
|
1196
1231
|
backgroundColor: primaryColor,
|
|
1197
|
-
color:
|
|
1232
|
+
color: onBrand,
|
|
1198
1233
|
fontSize: 14,
|
|
1199
1234
|
fontWeight: 600,
|
|
1200
1235
|
cursor: "pointer",
|
|
@@ -1206,11 +1241,11 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1206
1241
|
widgetConfig?.business_info?.phone && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center", fontSize: 13, color: "var(--sk-text-secondary, #6b7280)" }, children: [
|
|
1207
1242
|
"Or call us at",
|
|
1208
1243
|
" ",
|
|
1209
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: `tel:${widgetConfig.business_info.phone}`, style: { color:
|
|
1244
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: `tel:${widgetConfig.business_info.phone}`, style: { color: brandText, textDecoration: "none", fontWeight: 500 }, children: widgetConfig.business_info.phone })
|
|
1210
1245
|
] })
|
|
1211
1246
|
] });
|
|
1212
1247
|
const OfflineFormView = /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 20, flex: 1, overflowY: "auto" }, children: offlineSubmitted ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center", padding: 20 }, children: [
|
|
1213
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: 56, height: 56, borderRadius: "50%", backgroundColor: hexAlpha("--sk-primary-rgb", 0.082, primaryRgb), display: "flex", alignItems: "center", justifyContent: "center", margin: "0 auto 16px" }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
1248
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: 56, height: 56, borderRadius: "50%", backgroundColor: hexAlpha("--sk-primary-rgb", 0.082, primaryRgb), display: "flex", alignItems: "center", justifyContent: "center", margin: "0 auto 16px" }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: brandText, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) }) }),
|
|
1214
1249
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 8px", fontSize: 18, fontWeight: 600, color: "var(--sk-text-primary, #111827)" }, children: "Message Sent!" }),
|
|
1215
1250
|
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, color: "var(--sk-text-secondary, #6b7280)", fontSize: 14 }, children: offlineSubheading })
|
|
1216
1251
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleOfflineSubmit, children: [
|
|
@@ -1257,7 +1292,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1257
1292
|
borderRadius: 8,
|
|
1258
1293
|
border: "none",
|
|
1259
1294
|
backgroundColor: primaryColor,
|
|
1260
|
-
color:
|
|
1295
|
+
color: onBrand,
|
|
1261
1296
|
fontSize: 14,
|
|
1262
1297
|
fontWeight: 600,
|
|
1263
1298
|
cursor: isLoading ? "wait" : "pointer",
|
|
@@ -1305,7 +1340,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1305
1340
|
alignItems: "center",
|
|
1306
1341
|
justifyContent: "center"
|
|
1307
1342
|
},
|
|
1308
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
1343
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: onBrand, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1309
1344
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }),
|
|
1310
1345
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8.5", cy: "7", r: "4" }),
|
|
1311
1346
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "20", y1: "8", x2: "20", y2: "14" }),
|
|
@@ -1354,7 +1389,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1354
1389
|
// Bubbles on glass stay near-opaque: the glass behind them
|
|
1355
1390
|
// is for depth, never for the text to read against.
|
|
1356
1391
|
backgroundColor: message.role === "user" ? primaryColor : message.role === "system" ? "color-mix(in srgb, var(--sk-text-primary, #111827) 7%, transparent)" : BUBBLE_BG,
|
|
1357
|
-
color: message.role === "user" ?
|
|
1392
|
+
color: message.role === "user" ? onBrand : message.role === "system" ? "var(--sk-text-secondary, #6b7280)" : "var(--sk-text-primary, #111827)",
|
|
1358
1393
|
border: message.role === "user" || message.role === "system" ? "none" : HAIRLINE,
|
|
1359
1394
|
boxShadow: message.role === "system" ? "none" : message.role === "user" ? "inset 0 1px 0 color-mix(in srgb, #ffffff 22%, transparent), 0 1px 2px rgba(0,0,0,0.10)" : "0 1px 2px rgba(0,0,0,0.06)",
|
|
1360
1395
|
fontSize: message.role === "system" ? 13 : 14,
|
|
@@ -1390,7 +1425,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1390
1425
|
padding: "8px 14px",
|
|
1391
1426
|
borderRadius: 8,
|
|
1392
1427
|
backgroundColor: hexAlpha("--sk-primary-rgb", 0.082, primaryRgb),
|
|
1393
|
-
color:
|
|
1428
|
+
color: brandText,
|
|
1394
1429
|
fontWeight: 600,
|
|
1395
1430
|
fontSize: 13,
|
|
1396
1431
|
textDecoration: "none",
|
|
@@ -1436,7 +1471,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1436
1471
|
borderRadius: 16,
|
|
1437
1472
|
border: `1px solid ${primaryColor}`,
|
|
1438
1473
|
backgroundColor: hexAlpha("--sk-primary-rgb", 0.063, primaryRgb),
|
|
1439
|
-
color:
|
|
1474
|
+
color: brandText,
|
|
1440
1475
|
fontSize: 13,
|
|
1441
1476
|
cursor: "pointer"
|
|
1442
1477
|
},
|
|
@@ -1450,6 +1485,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1450
1485
|
actions: message.uiActions,
|
|
1451
1486
|
primaryColor,
|
|
1452
1487
|
primaryRgb,
|
|
1488
|
+
brandText,
|
|
1453
1489
|
onSuggest: handleSuggestAction
|
|
1454
1490
|
}
|
|
1455
1491
|
) : null,
|
|
@@ -1473,7 +1509,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1473
1509
|
borderRadius: 6,
|
|
1474
1510
|
border: `1px solid ${primaryColor}`,
|
|
1475
1511
|
backgroundColor: "transparent",
|
|
1476
|
-
color:
|
|
1512
|
+
color: brandText,
|
|
1477
1513
|
fontSize: 13,
|
|
1478
1514
|
cursor: "pointer"
|
|
1479
1515
|
},
|
|
@@ -1555,7 +1591,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1555
1591
|
borderRadius: "50%",
|
|
1556
1592
|
border: "none",
|
|
1557
1593
|
backgroundColor: (inputValue.trim() || pendingFiles.length) && !isLoading ? primaryColor : "var(--sk-border, #e5e7eb)",
|
|
1558
|
-
color: (inputValue.trim() || pendingFiles.length) && !isLoading
|
|
1594
|
+
color: (inputValue.trim() || pendingFiles.length) && !isLoading ? onBrand : "white",
|
|
1559
1595
|
cursor: inputValue.trim() && !isLoading ? "pointer" : "not-allowed",
|
|
1560
1596
|
display: "flex",
|
|
1561
1597
|
alignItems: "center",
|
|
@@ -1571,6 +1607,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1571
1607
|
const ChatPopup = isOpen && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1572
1608
|
"div",
|
|
1573
1609
|
{
|
|
1610
|
+
ref: panelRef,
|
|
1574
1611
|
"data-sk-echo-panel": true,
|
|
1575
1612
|
className: "sk-glass sk-glass--panel",
|
|
1576
1613
|
style: {
|
|
@@ -1634,5 +1671,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1634
1671
|
}
|
|
1635
1672
|
|
|
1636
1673
|
exports.ChatWidget = ChatWidget;
|
|
1637
|
-
|
|
1638
|
-
|
|
1674
|
+
exports.EchoChat = EchoChat;
|
|
1675
|
+
exports.isChatEnabled = isChatEnabled;
|
|
1676
|
+
//# sourceMappingURL=chunk-NJVU2DCX.js.map
|
|
1677
|
+
//# sourceMappingURL=chunk-NJVU2DCX.js.map
|