@onlive.ai/common-121 0.2.184 → 0.2.190
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/README.md +300 -89
- package/{audi-dark.theme-B8g9SRrd.d.cts → audi-dark.theme-a2WmOyVS.d.cts} +1 -1
- package/{audi-dark.theme-B8g9SRrd.d.ts → audi-dark.theme-a2WmOyVS.d.ts} +1 -1
- package/{audi.theme-CbqEkKLD.d.cts → audi.theme-DkdflnT8.d.cts} +1 -1
- package/{audi.theme-CbqEkKLD.d.ts → audi.theme-DkdflnT8.d.ts} +1 -1
- package/{australia.theme-Cs0cygOQ.d.cts → australia.theme-B5n8F3QH.d.cts} +1 -1
- package/{australia.theme-Cs0cygOQ.d.ts → australia.theme-B5n8F3QH.d.ts} +1 -1
- package/{chunk-UTOVVCSU.js → chunk-4DKWCKNT.js} +1 -1
- package/components/asset/asset-modal-portal.cjs +1 -1
- package/components/asset/asset-modal-portal.d.cts +1 -1
- package/components/asset/asset-modal-portal.d.ts +1 -1
- package/components/asset/asset-modal-portal.js +1 -1
- package/components/asset/asset.cjs +1 -1
- package/components/asset/asset.d.cts +1 -1
- package/components/asset/asset.d.ts +1 -1
- package/components/asset/asset.js +1 -1
- package/components/asset/asset.loaders.cjs +1 -1
- package/components/asset/asset.loaders.d.cts +1 -1
- package/components/asset/asset.loaders.d.ts +1 -1
- package/components/asset/asset.loaders.js +1 -1
- package/components/asset/asset.renderer.cjs +1 -1
- package/components/asset/asset.renderer.d.cts +1 -1
- package/components/asset/asset.renderer.d.ts +1 -1
- package/components/asset/asset.renderer.js +1 -1
- package/components/asset/asset.styles.cjs +1 -1
- package/components/asset/asset.styles.d.cts +1 -1
- package/components/asset/asset.styles.d.ts +1 -1
- package/components/asset/asset.styles.js +1 -1
- package/components/asset/asset.types.cjs +1 -1
- package/components/asset/asset.types.d.cts +1 -1
- package/components/asset/asset.types.d.ts +1 -1
- package/components/asset/asset.types.js +1 -1
- package/components/asset/index.cjs +1 -1
- package/components/asset/index.d.cts +1 -1
- package/components/asset/index.d.ts +1 -1
- package/components/asset/index.js +1 -1
- package/components/player/player.cjs +1 -1
- package/components/player/player.d.cts +1 -1
- package/components/player/player.d.ts +1 -1
- package/components/player/player.js +1 -1
- package/components/player/player.styles.cjs +1 -1
- package/components/player/player.styles.d.cts +1 -1
- package/components/player/player.styles.d.ts +1 -1
- package/components/player/player.styles.js +1 -1
- package/components/side-bar/index.cjs +1 -1
- package/components/side-bar/index.d.cts +1 -1
- package/components/side-bar/index.d.ts +1 -1
- package/components/side-bar/index.js +1 -1
- package/components/side-bar/side-bar.cjs +1 -1
- package/components/side-bar/side-bar.d.cts +1 -1
- package/components/side-bar/side-bar.d.ts +1 -1
- package/components/side-bar/side-bar.js +1 -1
- package/components/side-bar/side-bar.styles.cjs +1 -1
- package/components/side-bar/side-bar.styles.d.cts +1 -1
- package/components/side-bar/side-bar.styles.d.ts +1 -1
- package/components/side-bar/side-bar.styles.js +1 -1
- package/components/side-bar/side-bar.types.cjs +1 -1
- package/components/side-bar/side-bar.types.d.cts +1 -1
- package/components/side-bar/side-bar.types.d.ts +1 -1
- package/components/side-bar/side-bar.types.js +1 -1
- package/components/upload/index.cjs +1 -1
- package/components/upload/index.d.cts +1 -1
- package/components/upload/index.d.ts +1 -1
- package/components/upload/index.js +1 -1
- package/components/upload/upload.cjs +1 -1
- package/components/upload/upload.d.cts +1 -1
- package/components/upload/upload.d.ts +1 -1
- package/components/upload/upload.js +1 -1
- package/components/upload/upload.styles.cjs +1 -1
- package/components/upload/upload.styles.d.cts +1 -1
- package/components/upload/upload.styles.d.ts +1 -1
- package/components/upload/upload.styles.js +1 -1
- package/components/upload/upload.types.cjs +1 -1
- package/components/upload/upload.types.d.cts +1 -1
- package/components/upload/upload.types.d.ts +1 -1
- package/components/upload/upload.types.js +1 -1
- package/{cuernavaca.theme-0UFX1MeG.d.cts → cuernavaca.theme-BzcZX1EJ.d.cts} +1 -1
- package/{cuernavaca.theme-0UFX1MeG.d.ts → cuernavaca.theme-BzcZX1EJ.d.ts} +1 -1
- package/{cupra-diagonal.theme-DVrQr2iv.d.cts → cupra-diagonal.theme-CKxsGYdb.d.cts} +1 -1
- package/{cupra-diagonal.theme-DVrQr2iv.d.ts → cupra-diagonal.theme-CKxsGYdb.d.ts} +1 -1
- package/{cupra-events.theme-D2xJeafa.d.cts → cupra-events.theme-kGaXJptG.d.cts} +1 -1
- package/{cupra-events.theme-D2xJeafa.d.ts → cupra-events.theme-kGaXJptG.d.ts} +1 -1
- package/{cupra.theme-CqgKWLYE.d.cts → cupra.theme-C-oFRdQw.d.cts} +1 -1
- package/{cupra.theme-CqgKWLYE.d.ts → cupra.theme-C-oFRdQw.d.ts} +1 -1
- package/{germany.theme-CnwD309P.d.cts → germany.theme-Cxz60Lv5.d.cts} +1 -1
- package/{germany.theme-CnwD309P.d.ts → germany.theme-Cxz60Lv5.d.ts} +1 -1
- package/{hyundai.theme-E2ZiyZmJ.d.cts → hyundai.theme-DNFeBfk4.d.cts} +1 -1
- package/{hyundai.theme-E2ZiyZmJ.d.ts → hyundai.theme-DNFeBfk4.d.ts} +1 -1
- package/index.cjs +40 -40
- package/index.css +1 -0
- package/index.d.cts +108 -3
- package/index.d.ts +108 -3
- package/index.js +140 -139
- package/{italy.theme-BjfPp7rU.d.cts → italy.theme-YKt3PHQM.d.cts} +1 -1
- package/{italy.theme-BjfPp7rU.d.ts → italy.theme-YKt3PHQM.d.ts} +1 -1
- package/{magimix.theme-7cd19P1X.d.cts → magimix.theme-lIo3UAYh.d.cts} +1 -1
- package/{magimix.theme-7cd19P1X.d.ts → magimix.theme-lIo3UAYh.d.ts} +1 -1
- package/{media-SB4RDT6E.js → media-BU4KDZMS.js} +2 -2
- package/{onlive-ai.theme-CASPoRHr.d.cts → onlive-ai.theme-Dk4K7dnu.d.cts} +1 -1
- package/{onlive-ai.theme-CASPoRHr.d.ts → onlive-ai.theme-Dk4K7dnu.d.ts} +1 -1
- package/{onlive.theme-nKZQHG1I.d.cts → onlive.theme-BU4h4zKz.d.cts} +1 -1
- package/{onlive.theme-nKZQHG1I.d.ts → onlive.theme-BU4h4zKz.d.ts} +1 -1
- package/package.json +7 -5
- package/react/components/asset/Asset.cjs +1 -1
- package/react/components/asset/Asset.jsx +1 -1
- package/react/components/side-bar/SideBar.cjs +1 -1
- package/react/components/side-bar/SideBar.jsx +1 -1
- package/react/components/upload/Upload.cjs +1 -1
- package/react/components/upload/Upload.jsx +1 -1
- package/{seat-cupra.theme-B4ylEjOZ.d.cts → seat-cupra.theme-C-PJk0pi.d.cts} +1 -1
- package/{seat-cupra.theme-B4ylEjOZ.d.ts → seat-cupra.theme-C-PJk0pi.d.ts} +1 -1
- package/services/audio.service.cjs +1 -1
- package/services/audio.service.d.cts +1 -1
- package/services/audio.service.d.ts +1 -1
- package/services/audio.service.js +1 -1
- package/services/conversation/conversation.service.cjs +2 -2
- package/services/conversation/conversation.service.d.cts +1 -1
- package/services/conversation/conversation.service.d.ts +1 -1
- package/services/conversation/conversation.service.js +2 -2
- package/services/conversation/conversation.types.cjs +2 -2
- package/services/conversation/conversation.types.d.cts +3 -1
- package/services/conversation/conversation.types.d.ts +3 -1
- package/services/conversation/conversation.types.js +1 -1
- package/services/conversation/index.cjs +2 -2
- package/services/conversation/index.d.cts +1 -1
- package/services/conversation/index.d.ts +1 -1
- package/services/conversation/index.js +2 -2
- package/services/conversation/mock/actor/agent.cjs +1 -1
- package/services/conversation/mock/actor/agent.d.cts +1 -1
- package/services/conversation/mock/actor/agent.d.ts +1 -1
- package/services/conversation/mock/actor/agent.js +1 -1
- package/services/conversation/mock/actor/index.cjs +1 -1
- package/services/conversation/mock/actor/index.d.cts +1 -1
- package/services/conversation/mock/actor/index.d.ts +1 -1
- package/services/conversation/mock/actor/index.js +1 -1
- package/services/conversation/mock/actor/strategies.cjs +1 -1
- package/services/conversation/mock/actor/strategies.d.cts +1 -1
- package/services/conversation/mock/actor/strategies.d.ts +1 -1
- package/services/conversation/mock/actor/strategies.js +1 -1
- package/services/conversation/mock/errors.cjs +1 -1
- package/services/conversation/mock/errors.d.cts +1 -1
- package/services/conversation/mock/errors.d.ts +1 -1
- package/services/conversation/mock/errors.js +1 -1
- package/services/conversation/mock/events.cjs +1 -1
- package/services/conversation/mock/events.d.cts +1 -1
- package/services/conversation/mock/events.d.ts +1 -1
- package/services/conversation/mock/events.js +1 -1
- package/services/conversation/mock/factory.cjs +2 -2
- package/services/conversation/mock/factory.d.cts +1 -1
- package/services/conversation/mock/factory.d.ts +1 -1
- package/services/conversation/mock/factory.js +2 -2
- package/services/conversation/mock/fixtures.cjs +1 -1
- package/services/conversation/mock/fixtures.d.cts +1 -1
- package/services/conversation/mock/fixtures.d.ts +1 -1
- package/services/conversation/mock/fixtures.js +1 -1
- package/services/conversation/mock/generators.cjs +1 -1
- package/services/conversation/mock/generators.d.cts +1 -1
- package/services/conversation/mock/generators.d.ts +1 -1
- package/services/conversation/mock/generators.js +1 -1
- package/services/conversation/mock/index.cjs +2 -2
- package/services/conversation/mock/index.d.cts +1 -1
- package/services/conversation/mock/index.d.ts +1 -1
- package/services/conversation/mock/index.js +2 -2
- package/services/conversation/mock/livekit/index.cjs +1 -1
- package/services/conversation/mock/livekit/index.d.cts +1 -1
- package/services/conversation/mock/livekit/index.d.ts +1 -1
- package/services/conversation/mock/livekit/index.js +1 -1
- package/services/conversation/mock/livekit/local-participant.cjs +1 -1
- package/services/conversation/mock/livekit/local-participant.d.cts +1 -1
- package/services/conversation/mock/livekit/local-participant.d.ts +1 -1
- package/services/conversation/mock/livekit/local-participant.js +1 -1
- package/services/conversation/mock/livekit/participant.cjs +1 -1
- package/services/conversation/mock/livekit/participant.d.cts +1 -1
- package/services/conversation/mock/livekit/participant.d.ts +1 -1
- package/services/conversation/mock/livekit/participant.js +1 -1
- package/services/conversation/mock/livekit/room.cjs +1 -1
- package/services/conversation/mock/livekit/room.d.cts +1 -1
- package/services/conversation/mock/livekit/room.d.ts +1 -1
- package/services/conversation/mock/livekit/room.js +1 -1
- package/services/conversation/mock/livekit/streams.cjs +1 -1
- package/services/conversation/mock/livekit/streams.d.cts +1 -1
- package/services/conversation/mock/livekit/streams.d.ts +1 -1
- package/services/conversation/mock/livekit/streams.js +1 -1
- package/services/conversation/mock/livekit/tracks.cjs +1 -1
- package/services/conversation/mock/livekit/tracks.d.cts +1 -1
- package/services/conversation/mock/livekit/tracks.d.ts +1 -1
- package/services/conversation/mock/livekit/tracks.js +1 -1
- package/services/conversation/mock/media.cjs +1 -1
- package/services/conversation/mock/media.d.cts +1 -1
- package/services/conversation/mock/media.d.ts +1 -1
- package/services/conversation/mock/media.js +1 -1
- package/services/conversation/mock/service.cjs +2 -2
- package/services/conversation/mock/service.d.cts +1 -1
- package/services/conversation/mock/service.d.ts +1 -1
- package/services/conversation/mock/service.js +2 -2
- package/services/conversation/mock/service.test.cjs +2 -2
- package/services/conversation/mock/service.test.d.cts +1 -1
- package/services/conversation/mock/service.test.d.ts +1 -1
- package/services/conversation/mock/service.test.js +2 -2
- package/services/conversation/mock/state.cjs +1 -1
- package/services/conversation/mock/state.d.cts +1 -1
- package/services/conversation/mock/state.d.ts +1 -1
- package/services/conversation/mock/state.js +1 -1
- package/services/conversation/mock/storybook.cjs +2 -2
- package/services/conversation/mock/storybook.d.cts +1 -1
- package/services/conversation/mock/storybook.d.ts +1 -1
- package/services/conversation/mock/storybook.js +2 -2
- package/services/conversation/mock/types.cjs +1 -1
- package/services/conversation/mock/types.d.cts +1 -1
- package/services/conversation/mock/types.d.ts +1 -1
- package/services/conversation/mock/types.js +1 -1
- package/services/deep-link.service.cjs +2 -0
- package/services/deep-link.service.d.cts +77 -0
- package/services/deep-link.service.d.ts +77 -0
- package/services/deep-link.service.js +2 -0
- package/services/faqs/faqs.service.cjs +1 -1
- package/services/faqs/faqs.service.d.cts +1 -1
- package/services/faqs/faqs.service.d.ts +1 -1
- package/services/faqs/faqs.service.js +1 -1
- package/services/faqs/faqs.types.cjs +1 -1
- package/services/faqs/faqs.types.d.cts +1 -1
- package/services/faqs/faqs.types.d.ts +1 -1
- package/services/faqs/faqs.types.js +1 -1
- package/services/faqs/index.cjs +1 -1
- package/services/faqs/index.d.cts +1 -1
- package/services/faqs/index.d.ts +1 -1
- package/services/faqs/index.js +1 -1
- package/services/file/file.service.cjs +1 -1
- package/services/file/file.service.d.cts +1 -1
- package/services/file/file.service.d.ts +1 -1
- package/services/file/file.service.js +1 -1
- package/services/file/file.types.cjs +1 -1
- package/services/file/file.types.d.cts +1 -1
- package/services/file/file.types.d.ts +1 -1
- package/services/file/file.types.js +1 -1
- package/services/file/index.cjs +1 -1
- package/services/file/index.d.cts +1 -1
- package/services/file/index.d.ts +1 -1
- package/services/file/index.js +1 -1
- package/services/firebase/firebase-api.cjs +1 -1
- package/services/firebase/firebase-api.d.cts +1 -1
- package/services/firebase/firebase-api.d.ts +1 -1
- package/services/firebase/firebase-api.js +1 -1
- package/services/multimedia/config.example.cjs +1 -1
- package/services/multimedia/config.example.d.cts +1 -1
- package/services/multimedia/config.example.d.ts +1 -1
- package/services/multimedia/config.example.js +1 -1
- package/services/multimedia/index.cjs +1 -1
- package/services/multimedia/index.d.cts +1 -1
- package/services/multimedia/index.d.ts +1 -1
- package/services/multimedia/index.js +1 -1
- package/services/multimedia/multimedia.service.cjs +1 -1
- package/services/multimedia/multimedia.service.d.cts +1 -1
- package/services/multimedia/multimedia.service.d.ts +1 -1
- package/services/multimedia/multimedia.service.js +1 -1
- package/services/multimedia/multimedia.types.cjs +1 -1
- package/services/multimedia/multimedia.types.d.cts +1 -1
- package/services/multimedia/multimedia.types.d.ts +1 -1
- package/services/multimedia/multimedia.types.js +1 -1
- package/services/product/index.cjs +1 -1
- package/services/product/index.d.cts +1 -1
- package/services/product/index.d.ts +1 -1
- package/services/product/index.js +1 -1
- package/services/product/product.service.cjs +1 -1
- package/services/product/product.service.d.cts +1 -1
- package/services/product/product.service.d.ts +1 -1
- package/services/product/product.service.js +1 -1
- package/services/product/product.types.cjs +1 -1
- package/services/product/product.types.d.cts +1 -1
- package/services/product/product.types.d.ts +1 -1
- package/services/product/product.types.js +1 -1
- package/services/request.provider.cjs +1 -1
- package/services/request.provider.d.cts +1 -1
- package/services/request.provider.d.ts +1 -1
- package/services/request.provider.js +1 -1
- package/services/session.service.cjs +1 -1
- package/services/session.service.d.cts +1 -1
- package/services/session.service.d.ts +1 -1
- package/services/session.service.js +1 -1
- package/services/upload/index.cjs +1 -1
- package/services/upload/index.d.cts +1 -1
- package/services/upload/index.d.ts +1 -1
- package/services/upload/index.js +1 -1
- package/services/upload/upload.service.cjs +1 -1
- package/services/upload/upload.service.d.cts +1 -1
- package/services/upload/upload.service.d.ts +1 -1
- package/services/upload/upload.service.js +1 -1
- package/themes/custom/audi-dark.theme.cjs +7 -3
- package/themes/custom/audi-dark.theme.css +921 -0
- package/themes/custom/audi-dark.theme.d.cts +2 -2
- package/themes/custom/audi-dark.theme.d.ts +2 -2
- package/themes/custom/audi-dark.theme.js +6 -2
- package/themes/custom/audi.theme.cjs +1 -1
- package/themes/custom/audi.theme.css +774 -0
- package/themes/custom/audi.theme.d.cts +2 -2
- package/themes/custom/audi.theme.d.ts +2 -2
- package/themes/custom/audi.theme.js +1 -1
- package/themes/custom/australia.theme.cjs +1 -1
- package/themes/custom/australia.theme.css +383 -0
- package/themes/custom/australia.theme.d.cts +2 -2
- package/themes/custom/australia.theme.d.ts +2 -2
- package/themes/custom/australia.theme.js +1 -1
- package/themes/custom/cuernavaca.theme.cjs +1 -1
- package/themes/custom/cuernavaca.theme.css +193 -0
- package/themes/custom/cuernavaca.theme.d.cts +2 -2
- package/themes/custom/cuernavaca.theme.d.ts +2 -2
- package/themes/custom/cuernavaca.theme.js +1 -1
- package/themes/custom/cupra-diagonal.theme.cjs +5 -22
- package/themes/custom/cupra-diagonal.theme.css +1009 -0
- package/themes/custom/cupra-diagonal.theme.d.cts +2 -2
- package/themes/custom/cupra-diagonal.theme.d.ts +2 -2
- package/themes/custom/cupra-diagonal.theme.js +5 -22
- package/themes/custom/cupra-events.theme.cjs +1 -1
- package/themes/custom/cupra-events.theme.css +552 -0
- package/themes/custom/cupra-events.theme.d.cts +2 -2
- package/themes/custom/cupra-events.theme.d.ts +2 -2
- package/themes/custom/cupra-events.theme.js +1 -1
- package/themes/custom/cupra.theme.cjs +1 -1
- package/themes/custom/cupra.theme.css +144 -0
- package/themes/custom/cupra.theme.d.cts +2 -2
- package/themes/custom/cupra.theme.d.ts +2 -2
- package/themes/custom/cupra.theme.js +1 -1
- package/themes/custom/germany.theme.cjs +5 -5
- package/themes/custom/germany.theme.css +713 -0
- package/themes/custom/germany.theme.d.cts +2 -2
- package/themes/custom/germany.theme.d.ts +2 -2
- package/themes/custom/germany.theme.js +4 -4
- package/themes/custom/hyundai.theme.cjs +1 -1
- package/themes/custom/hyundai.theme.css +291 -0
- package/themes/custom/hyundai.theme.d.cts +2 -2
- package/themes/custom/hyundai.theme.d.ts +2 -2
- package/themes/custom/hyundai.theme.js +1 -1
- package/themes/custom/italy.theme.cjs +3 -23
- package/themes/custom/italy.theme.css +827 -0
- package/themes/custom/italy.theme.d.cts +2 -2
- package/themes/custom/italy.theme.d.ts +2 -2
- package/themes/custom/italy.theme.js +3 -23
- package/themes/custom/magimix.theme.cjs +1 -1
- package/themes/custom/magimix.theme.css +116 -0
- package/themes/custom/magimix.theme.d.cts +2 -2
- package/themes/custom/magimix.theme.d.ts +2 -2
- package/themes/custom/magimix.theme.js +1 -1
- package/themes/custom/onlive-ai.theme.cjs +1 -1
- package/themes/custom/onlive-ai.theme.css +71 -0
- package/themes/custom/onlive-ai.theme.d.cts +2 -2
- package/themes/custom/onlive-ai.theme.d.ts +2 -2
- package/themes/custom/onlive-ai.theme.js +1 -1
- package/themes/custom/onlive.theme.cjs +1 -1
- package/themes/custom/onlive.theme.css +30 -0
- package/themes/custom/onlive.theme.d.cts +2 -2
- package/themes/custom/onlive.theme.d.ts +2 -2
- package/themes/custom/onlive.theme.js +1 -1
- package/themes/custom/seat-cupra.theme.cjs +1 -1
- package/themes/custom/seat-cupra.theme.css +475 -0
- package/themes/custom/seat-cupra.theme.d.cts +2 -2
- package/themes/custom/seat-cupra.theme.d.ts +2 -2
- package/themes/custom/seat-cupra.theme.js +1 -1
- package/themes/dark.cjs +367 -369
- package/themes/dark.css +413 -0
- package/themes/dark.d.cts +1 -1
- package/themes/dark.d.ts +1 -1
- package/themes/dark.js +367 -369
- package/themes/light.cjs +365 -366
- package/themes/light.css +411 -0
- package/themes/light.d.cts +1 -1
- package/themes/light.d.ts +1 -1
- package/themes/light.js +365 -366
- package/types/deep-link.types.cjs +2 -0
- package/types/deep-link.types.d.cts +32 -0
- package/types/deep-link.types.d.ts +32 -0
- package/types/deep-link.types.js +2 -0
- package/types/globals.cjs +1 -1
- package/types/globals.d.cts +1 -1
- package/types/globals.d.ts +1 -1
- package/types/globals.js +1 -1
- package/types/tracking-options.cjs +1 -1
- package/types/tracking-options.d.cts +1 -1
- package/types/tracking-options.d.ts +1 -1
- package/types/tracking-options.js +1 -1
- package/utils/adopt-styles.cjs +1 -1
- package/utils/adopt-styles.d.cts +1 -1
- package/utils/adopt-styles.d.ts +1 -1
- package/utils/adopt-styles.js +1 -1
- package/utils/apply-optional-styles.cjs +30 -63
- package/utils/apply-optional-styles.d.cts +15 -15
- package/utils/apply-optional-styles.d.ts +15 -15
- package/utils/apply-optional-styles.js +30 -63
- package/utils/browser-preferences.cjs +1 -1
- package/utils/browser-preferences.d.cts +1 -1
- package/utils/browser-preferences.d.ts +1 -1
- package/utils/browser-preferences.js +1 -1
- package/utils/classify-media.cjs +1 -1
- package/utils/classify-media.d.cts +1 -1
- package/utils/classify-media.d.ts +1 -1
- package/utils/classify-media.js +1 -1
- package/utils/decorators.cjs +1 -1
- package/utils/decorators.d.cts +1 -1
- package/utils/decorators.d.ts +1 -1
- package/utils/decorators.js +1 -1
- package/utils/detected-lang.cjs +1 -1
- package/utils/detected-lang.d.cts +1 -1
- package/utils/detected-lang.d.ts +1 -1
- package/utils/detected-lang.js +1 -1
- package/utils/fullscreen.cjs +1 -1
- package/utils/fullscreen.d.cts +1 -1
- package/utils/fullscreen.d.ts +1 -1
- package/utils/fullscreen.js +1 -1
- package/utils/insert-script.cjs +1 -1
- package/utils/insert-script.d.cts +1 -1
- package/utils/insert-script.d.ts +1 -1
- package/utils/insert-script.js +1 -1
- package/utils/is-map-compatible.cjs +1 -1
- package/utils/is-map-compatible.d.cts +1 -1
- package/utils/is-map-compatible.d.ts +1 -1
- package/utils/is-map-compatible.js +1 -1
- package/utils/markdown.cjs +1 -1
- package/utils/markdown.d.cts +1 -1
- package/utils/markdown.d.ts +1 -1
- package/utils/markdown.js +1 -1
- package/utils/merge.cjs +1 -1
- package/utils/merge.d.cts +1 -1
- package/utils/merge.d.ts +1 -1
- package/utils/merge.js +1 -1
- package/utils/multiband-track-volume.cjs +1 -1
- package/utils/multiband-track-volume.d.cts +1 -1
- package/utils/multiband-track-volume.d.ts +1 -1
- package/utils/multiband-track-volume.js +1 -1
- package/utils/onlive-url-params.cjs +1 -1
- package/utils/onlive-url-params.d.cts +1 -1
- package/utils/onlive-url-params.d.ts +1 -1
- package/utils/onlive-url-params.js +1 -1
- package/utils/pretty-distance.cjs +1 -1
- package/utils/pretty-distance.d.cts +1 -1
- package/utils/pretty-distance.d.ts +1 -1
- package/utils/pretty-distance.js +1 -1
- package/utils/pretty-time.cjs +1 -1
- package/utils/pretty-time.d.cts +1 -1
- package/utils/pretty-time.d.ts +1 -1
- package/utils/pretty-time.js +1 -1
- package/utils/random-string.cjs +1 -1
- package/utils/random-string.d.cts +1 -1
- package/utils/random-string.d.ts +1 -1
- package/utils/random-string.js +1 -1
- package/utils/resource-type.cjs +1 -1
- package/utils/resource-type.d.cts +1 -1
- package/utils/resource-type.d.ts +1 -1
- package/utils/resource-type.js +1 -1
- package/utils/round-number.cjs +1 -1
- package/utils/round-number.d.cts +1 -1
- package/utils/round-number.d.ts +1 -1
- package/utils/round-number.js +1 -1
- package/utils/safe-html.cjs +1 -1
- package/utils/safe-html.d.cts +1 -1
- package/utils/safe-html.d.ts +1 -1
- package/utils/safe-html.js +1 -1
- package/utils/sanitize.cjs +1 -1
- package/utils/sanitize.d.cts +1 -1
- package/utils/sanitize.d.ts +1 -1
- package/utils/sanitize.js +1 -1
- package/utils/spread.cjs +1 -1
- package/utils/spread.d.cts +1 -1
- package/utils/spread.d.ts +1 -1
- package/utils/spread.js +1 -1
- package/utils/watch.cjs +1 -1
- package/utils/watch.d.cts +1 -1
- package/utils/watch.d.ts +1 -1
- package/utils/watch.js +1 -1
package/README.md
CHANGED
|
@@ -1,154 +1,365 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @onlive.ai/common-121
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Shared foundation package for the Onlive 121 ecosystem — services, utilities, UI components, and themes for building interactive chat, flow, and video meeting applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@onlive.ai/flow-client)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://lit.dev/)
|
|
8
|
+
[](https://react.dev/)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
13
|
npm install @onlive.ai/common-121
|
|
14
|
+
# or
|
|
15
|
+
pnpm add @onlive.ai/common-121
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
**Prerequisites**: Node.js 18+, TypeScript 5.7+
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
---
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
- **FirebaseService**: Manages real-time Firebase connections for chat requests and agent presence
|
|
17
|
-
- **LivekitService**: Provides WebRTC functionality for video/audio communication using LiveKit
|
|
22
|
+
## Package Structure
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
```
|
|
25
|
+
common-121/
|
|
26
|
+
├── services/ # Core application services
|
|
27
|
+
├── utils/ # Framework-agnostic utility functions
|
|
28
|
+
├── components/ # Lit web components (OSBAsset, OSBSideBar, OSBUpload)
|
|
29
|
+
├── react/ # React wrapper components
|
|
30
|
+
├── themes/ # CSS themes (light, dark, brand-specific)
|
|
31
|
+
└── types/ # Shared TypeScript type definitions
|
|
32
|
+
```
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
- **browser-preferences**: Browser preference detection and management
|
|
23
|
-
- **classify-media**: Media file classification and type detection
|
|
24
|
-
- **decorators**: Custom element decorators and helpers
|
|
25
|
-
- **detected-lang**: Language detection utilities
|
|
26
|
-
- **fullscreen**: Fullscreen API helpers
|
|
27
|
-
- **markdown**: Markdown parsing with sanitization
|
|
28
|
-
- **merge**: Deep object merging utilities
|
|
29
|
-
- **sanitize**: HTML content sanitization
|
|
30
|
-
- **watch**: Reactive property watching utilities
|
|
34
|
+
---
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
## Services
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
- **Dark Theme**: Dark mode color scheme
|
|
36
|
-
- **Custom Themes**: Brand-specific themes (Audi, Cupra, Hyundai, Magimix, Onlive)
|
|
38
|
+
### AudioService
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
Singleton service for managing audio notifications during calls and interactions. Preloads sounds on initialization.
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
```typescript
|
|
43
|
+
import { AudioService } from "@onlive.ai/common-121/services/audio.service.js";
|
|
44
|
+
|
|
45
|
+
const audio = AudioService.getInstance();
|
|
46
|
+
|
|
47
|
+
audio.playRinging(); // Play ringing tone (looped by default)
|
|
48
|
+
audio.playIncoming(); // Play incoming call tone (looped by default)
|
|
49
|
+
audio.playSound("ringing", false); // Play a named sound, no loop
|
|
50
|
+
audio.stopCurrentSound(); // Stop whatever is currently playing
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### FirebaseApi
|
|
54
|
+
|
|
55
|
+
Low-level wrapper around the Firebase Realtime Database SDK. Provides a typed interface for reading, writing, and subscribing to database nodes.
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { FirebaseApi, type FirebaseConfig } from "@onlive.ai/common-121/services/firebase/firebase-api.js";
|
|
59
|
+
|
|
60
|
+
const config: FirebaseConfig = {
|
|
61
|
+
apiKey: "...",
|
|
62
|
+
authDomain: "...",
|
|
63
|
+
databaseURL: "...",
|
|
64
|
+
projectId: "...",
|
|
65
|
+
storageBucket: "...",
|
|
66
|
+
messagingSenderId: "...",
|
|
67
|
+
appId: "...",
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const firebase = new FirebaseApi({ config });
|
|
71
|
+
|
|
72
|
+
// Get a reference and read data
|
|
73
|
+
const snapshot = await firebase.get(firebase.ref("rooms/room-id"));
|
|
74
|
+
|
|
75
|
+
// Subscribe to child additions
|
|
76
|
+
firebase.onChildAdded(firebase.ref("requests"), (key, data, snap) => {
|
|
77
|
+
console.log("New request:", key, data);
|
|
78
|
+
});
|
|
79
|
+
```
|
|
42
80
|
|
|
43
|
-
|
|
81
|
+
### ConversationService
|
|
44
82
|
|
|
45
|
-
|
|
83
|
+
Manages the full lifecycle of a LiveKit-powered conversation room, including connection, messaging, typing indicators, media tracks, and agent interactions.
|
|
46
84
|
|
|
47
85
|
```typescript
|
|
48
|
-
import {
|
|
49
|
-
|
|
50
|
-
|
|
86
|
+
import { ConversationServiceFactory } from "@onlive.ai/common-121/services/conversation/index.js";
|
|
87
|
+
|
|
88
|
+
const service = ConversationServiceFactory.create(options);
|
|
89
|
+
|
|
90
|
+
// Connect and join a room
|
|
91
|
+
await service.quickStart({ installationId: "...", language: "en" });
|
|
92
|
+
|
|
93
|
+
// Send a message
|
|
94
|
+
service.sendMessage("Hello!");
|
|
95
|
+
|
|
96
|
+
// Listen for incoming messages
|
|
97
|
+
service.onMessage((message) => {
|
|
98
|
+
console.log("Received:", message);
|
|
99
|
+
});
|
|
51
100
|
```
|
|
52
101
|
|
|
53
|
-
###
|
|
102
|
+
### SessionService
|
|
103
|
+
|
|
104
|
+
Manages persistent chat sessions via cookies, with support for role-based sessions (agent vs. guest).
|
|
54
105
|
|
|
55
106
|
```typescript
|
|
56
|
-
import {
|
|
107
|
+
import { SessionService } from "@onlive.ai/common-121/services/session.service.js";
|
|
57
108
|
|
|
58
|
-
|
|
109
|
+
if (!SessionService.hasSession()) {
|
|
110
|
+
const session = SessionService.getSession({ role: "guest" });
|
|
111
|
+
console.log("Session created:", session.externalId);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
59
114
|
|
|
60
|
-
|
|
61
|
-
audioService.playIncoming();
|
|
115
|
+
### DeepLinkService
|
|
62
116
|
|
|
63
|
-
|
|
64
|
-
|
|
117
|
+
Parses and manages Onlive-specific deep link parameters (`ol*` prefix) from the current page URL.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { DeepLinkService } from "@onlive.ai/common-121/services/deep-link.service.js";
|
|
121
|
+
|
|
122
|
+
const deepLink = new DeepLinkService();
|
|
123
|
+
|
|
124
|
+
if (deepLink.has("action")) {
|
|
125
|
+
const action = deepLink.get("action");
|
|
126
|
+
deepLink.clean(); // Remove ol* params from the URL
|
|
127
|
+
}
|
|
65
128
|
```
|
|
66
129
|
|
|
67
|
-
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Utilities
|
|
133
|
+
|
|
134
|
+
All utilities are tree-shakeable and framework-agnostic unless noted.
|
|
135
|
+
|
|
136
|
+
| Utility | Description |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `adopt-styles` | Adopts CSS `CSSStyleSheet` into a shadow root |
|
|
139
|
+
| `apply-optional-styles` | Conditionally applies styles based on a predicate |
|
|
140
|
+
| `browser-preferences` | Detects browser preferences (reduced motion, color scheme) |
|
|
141
|
+
| `classify-media` | Classifies a URL or MIME type into a media category |
|
|
142
|
+
| `decorators` | Lit element decorators and helpers |
|
|
143
|
+
| `detected-lang` | Detects the user's preferred language from browser/DOM signals |
|
|
144
|
+
| `fullscreen` | Fullscreen API helpers with cross-browser support |
|
|
145
|
+
| `insert-script` | Dynamically inserts a `<script>` tag with dedup protection |
|
|
146
|
+
| `is-map-compatible` | Checks if a value is safe to use as a `Map` key |
|
|
147
|
+
| `markdown` | Parses Markdown to sanitized HTML, safe for Lit `unsafeHTML` |
|
|
148
|
+
| `merge` | Deep merges objects recursively (objects merged, arrays overwritten) |
|
|
149
|
+
| `multiband-track-volume` | Analyzes audio track volume across frequency bands |
|
|
150
|
+
| `onlive-url-params` | Reads and writes Onlive-specific URL query parameters |
|
|
151
|
+
| `pretty-distance` | Formats a geographic distance into a human-readable string |
|
|
152
|
+
| `pretty-time` | Formats a duration (seconds) into `mm:ss` or `hh:mm:ss` |
|
|
153
|
+
| `random-string` | Generates a cryptographically-random alphanumeric string |
|
|
154
|
+
| `resource-type` | Determines the resource type of a URL (image, video, document…) |
|
|
155
|
+
| `round-number` | Rounds a number to a given number of decimal places |
|
|
156
|
+
| `safe-html` | Tags template literal for safe HTML rendering in Lit |
|
|
157
|
+
| `sanitize` | Sanitizes an HTML string with DOMPurify |
|
|
158
|
+
| `spread` | Spreads an object as Lit element attributes/properties |
|
|
159
|
+
| `watch` | Observes reactive property changes in Lit elements |
|
|
160
|
+
|
|
161
|
+
### Usage examples
|
|
68
162
|
|
|
69
163
|
```typescript
|
|
70
|
-
import {
|
|
164
|
+
import { markdown } from "@onlive.ai/common-121/utils/markdown.js";
|
|
165
|
+
import { merge } from "@onlive.ai/common-121/utils/merge.js";
|
|
166
|
+
import { sanitize } from "@onlive.ai/common-121/utils/sanitize.js";
|
|
167
|
+
import { randomString } from "@onlive.ai/common-121/utils/random-string.js";
|
|
71
168
|
|
|
72
|
-
|
|
169
|
+
// Parse Markdown safely (returns a Lit TemplateResult)
|
|
170
|
+
const content = markdown("# Hello **World**");
|
|
73
171
|
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
172
|
+
// Deep merge configuration objects
|
|
173
|
+
const config = merge(defaults, userConfig);
|
|
174
|
+
|
|
175
|
+
// Sanitize arbitrary HTML input
|
|
176
|
+
const clean = sanitize(userProvidedHtml);
|
|
177
|
+
|
|
178
|
+
// Generate a random ID
|
|
179
|
+
const id = randomString(16);
|
|
78
180
|
```
|
|
79
181
|
|
|
80
|
-
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Components
|
|
185
|
+
|
|
186
|
+
### Lit Web Components
|
|
81
187
|
|
|
82
188
|
```typescript
|
|
83
|
-
import {
|
|
189
|
+
import { OSBAsset } from "@onlive.ai/common-121/components/asset/asset.js";
|
|
190
|
+
import { OSBSideBar } from "@onlive.ai/common-121/components/side-bar/side-bar.js";
|
|
191
|
+
import { OSBUpload } from "@onlive.ai/common-121/components/upload/upload.js";
|
|
192
|
+
```
|
|
84
193
|
|
|
85
|
-
|
|
194
|
+
Or import everything from the package root:
|
|
86
195
|
|
|
87
|
-
|
|
88
|
-
|
|
196
|
+
```typescript
|
|
197
|
+
import { OSBAsset, OSBSideBar, OSBUpload } from "@onlive.ai/common-121";
|
|
89
198
|
```
|
|
90
199
|
|
|
91
|
-
###
|
|
200
|
+
### React Components
|
|
201
|
+
|
|
202
|
+
React wrappers are provided for all Lit components via `@lit/react`:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
import { Asset } from "@onlive.ai/common-121/react/components/asset/Asset.js";
|
|
206
|
+
import { SideBar } from "@onlive.ai/common-121/react/components/side-bar/SideBar.js";
|
|
207
|
+
import { Upload } from "@onlive.ai/common-121/react/components/upload/Upload.js";
|
|
208
|
+
|
|
209
|
+
// Use as standard React components
|
|
210
|
+
function MyApp() {
|
|
211
|
+
return <Asset src="https://cdn.example.com/image.jpg" />;
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Themes
|
|
218
|
+
|
|
219
|
+
Themes are CSS files applied directly to Lit components via `adoptedStyleSheets` or `<link>` tags. Two base themes and fourteen brand themes are included.
|
|
220
|
+
|
|
221
|
+
### Base themes
|
|
92
222
|
|
|
93
223
|
```typescript
|
|
94
|
-
import
|
|
95
|
-
import
|
|
96
|
-
import { sanitize } from "@onlive.ai/common-121/utils/sanitize";
|
|
224
|
+
import lightTheme from "@onlive.ai/common-121/themes/light.css" assert { type: "css" };
|
|
225
|
+
import darkTheme from "@onlive.ai/common-121/themes/dark.css" assert { type: "css" };
|
|
97
226
|
|
|
98
|
-
|
|
99
|
-
|
|
227
|
+
document.adoptedStyleSheets = [lightTheme];
|
|
228
|
+
```
|
|
100
229
|
|
|
101
|
-
|
|
102
|
-
|
|
230
|
+
### Brand themes
|
|
231
|
+
|
|
232
|
+
| Theme file | Brand |
|
|
233
|
+
|---|---|
|
|
234
|
+
| `themes/custom/onlive.theme.css` | Onlive (default brand) |
|
|
235
|
+
| `themes/custom/onlive-ai.theme.css` | Onlive AI |
|
|
236
|
+
| `themes/custom/audi.theme.css` | Audi |
|
|
237
|
+
| `themes/custom/audi-dark.theme.css` | Audi (dark variant) |
|
|
238
|
+
| `themes/custom/cupra.theme.css` | Cupra |
|
|
239
|
+
| `themes/custom/cupra-diagonal.theme.css` | Cupra Diagonal |
|
|
240
|
+
| `themes/custom/cupra-events.theme.css` | Cupra Events |
|
|
241
|
+
| `themes/custom/seat-cupra.theme.css` | SEAT/Cupra |
|
|
242
|
+
| `themes/custom/hyundai.theme.css` | Hyundai |
|
|
243
|
+
| `themes/custom/magimix.theme.css` | Magimix |
|
|
244
|
+
| `themes/custom/australia.theme.css` | Australia market |
|
|
245
|
+
| `themes/custom/cuernavaca.theme.css` | Cuernavaca market |
|
|
246
|
+
| `themes/custom/germany.theme.css` | Germany market |
|
|
247
|
+
| `themes/custom/italy.theme.css` | Italy market |
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Types
|
|
103
252
|
|
|
104
|
-
|
|
105
|
-
|
|
253
|
+
```typescript
|
|
254
|
+
import type { TrackingOptions } from "@onlive.ai/common-121/types/tracking-options.js";
|
|
255
|
+
import type { DeepLinkParams } from "@onlive.ai/common-121/types/deep-link.types.js";
|
|
106
256
|
```
|
|
107
257
|
|
|
108
|
-
|
|
258
|
+
**`TrackingOptions<T>`** — Configuration for the analytics tracking layer:
|
|
259
|
+
|
|
260
|
+
| Property | Type | Description |
|
|
261
|
+
|---|---|---|
|
|
262
|
+
| `enabled` | `boolean` | Enable or disable tracking |
|
|
263
|
+
| `apiUrl` | `string` | Base URL for the tracking API |
|
|
264
|
+
| `data` | `Partial<T>` | Additional event payload data |
|
|
265
|
+
| `removeExtraneousValues` | `boolean` | Strip non-essential fields from events |
|
|
266
|
+
| `allowBotTraffic` | `boolean` | Include bot-originated traffic in tracking |
|
|
267
|
+
| `adapters` | `string[]` | List of tracking adapter identifiers |
|
|
268
|
+
| `emitters.windowEvent` | `boolean` | Emit as `window` custom events |
|
|
269
|
+
| `emitters.dataLayer` | `boolean` | Push to GTM `dataLayer` |
|
|
270
|
+
| `emitters.windowPostMessage` | `boolean` | Emit via `window.postMessage` |
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Testing & Mocks
|
|
275
|
+
|
|
276
|
+
This package exports a full mock implementation of `ConversationService` for use in unit tests, Storybook stories, and development environments — no real LiveKit or Firebase connection required.
|
|
109
277
|
|
|
110
278
|
```typescript
|
|
111
|
-
import {
|
|
112
|
-
|
|
279
|
+
import {
|
|
280
|
+
MockConversationService,
|
|
281
|
+
createMockConversationService,
|
|
282
|
+
createConversationFixture,
|
|
283
|
+
createMessageFixture,
|
|
284
|
+
createRoomWithAgent,
|
|
285
|
+
generateMockToken,
|
|
286
|
+
} from "@onlive.ai/common-121";
|
|
287
|
+
|
|
288
|
+
const mockService = createMockConversationService();
|
|
289
|
+
|
|
290
|
+
// Seed a fixture room with an agent
|
|
291
|
+
const room = createRoomWithAgent();
|
|
292
|
+
|
|
293
|
+
// Generate message fixtures
|
|
294
|
+
const messages = [
|
|
295
|
+
createMessageFixture({ content: "Hello from agent" }),
|
|
296
|
+
createMessageFixture({ content: "How can I help?" }),
|
|
297
|
+
];
|
|
298
|
+
```
|
|
113
299
|
|
|
114
|
-
|
|
115
|
-
|
|
300
|
+
For Storybook, use the dedicated helpers:
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
import {
|
|
304
|
+
getStorybookMockService,
|
|
305
|
+
destroyStorybookMockService,
|
|
306
|
+
} from "@onlive.ai/common-121";
|
|
116
307
|
```
|
|
117
308
|
|
|
118
|
-
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Architecture
|
|
119
312
|
|
|
120
|
-
|
|
313
|
+
- **ESM + CJS**: Dual output for Node.js and browser environments
|
|
314
|
+
- **Modular imports**: Every service, utility, and component is independently importable — no side effects from unused exports
|
|
315
|
+
- **Full type safety**: TypeScript `.d.ts` declarations shipped alongside every module
|
|
316
|
+
- **Build-time minification**: All outputs are minified (whitespace, identifiers, syntax) via `tsup` + `esbuild`
|
|
317
|
+
- **Versioned banner**: Each built file includes a `©` copyright banner with the package version
|
|
121
318
|
|
|
122
|
-
|
|
123
|
-
- **Type Safety**: Full TypeScript support with comprehensive type definitions
|
|
124
|
-
- **Performance**: Optimized for production use with efficient caching and lazy loading
|
|
125
|
-
- **Extensibility**: Easy to extend and customize for specific use cases
|
|
319
|
+
---
|
|
126
320
|
|
|
127
|
-
##
|
|
321
|
+
## Dependencies
|
|
128
322
|
|
|
129
|
-
|
|
323
|
+
| Package | Version | Purpose |
|
|
324
|
+
|---|---|---|
|
|
325
|
+
| `lit` | `^3.3` | Web components framework |
|
|
326
|
+
| `@lit/react` | `^1.0` | React wrappers for Lit elements |
|
|
327
|
+
| `livekit-client` | `^2.17` | WebRTC infrastructure for real-time audio/video |
|
|
328
|
+
| `@livekit/components-core` | `^0.12` | LiveKit component primitives |
|
|
329
|
+
| `firebase` | `^11.10` | Firebase Realtime Database |
|
|
330
|
+
| `rxjs` | `^7.8` | Reactive programming utilities |
|
|
331
|
+
| `marked` | `^15.0` | Markdown parsing |
|
|
332
|
+
| `dompurify` | `^3.3` | HTML sanitization |
|
|
333
|
+
| `video.js` | `^8.23` | Video playback |
|
|
334
|
+
| `@onlive.ai/tracker` | `^1.0` | Onlive analytics tracking |
|
|
335
|
+
| `@onlive.ai/ui` | `^1.9` | Onlive UI design system |
|
|
130
336
|
|
|
131
|
-
|
|
132
|
-
- **LiveKit**: WebRTC infrastructure for video/audio
|
|
133
|
-
- **Lit**: Web components framework
|
|
134
|
-
- **RxJS**: Reactive programming utilities
|
|
135
|
-
- **Marked**: Markdown parsing
|
|
136
|
-
- **DOMPurify**: HTML sanitization
|
|
337
|
+
**Peer dependencies**: `react ^19.1`
|
|
137
338
|
|
|
138
|
-
|
|
339
|
+
---
|
|
139
340
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- **
|
|
341
|
+
## Compatibility
|
|
342
|
+
|
|
343
|
+
- **Browsers**: Modern browsers with ES2020+ support (Chrome 90+, Firefox 88+, Safari 14+)
|
|
344
|
+
- **Node.js**: 18.x or higher (for build tooling only — not required at runtime)
|
|
143
345
|
- **TypeScript**: 5.7.x
|
|
346
|
+
- **React**: 19.x (peer dependency, optional — only required when using React components)
|
|
347
|
+
- **Module format**: ESM primary (`import`), CJS secondary (`require`)
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Related Packages
|
|
144
352
|
|
|
145
|
-
|
|
353
|
+
| Package | Description |
|
|
354
|
+
|---|---|
|
|
355
|
+
| [`@onlive.ai/chat`](../chat) | Chat UI components and messaging |
|
|
356
|
+
| [`@onlive.ai/flow`](../flow) | Interactive flow builder components |
|
|
357
|
+
| [`@onlive.ai/meet`](../meet) | Video conferencing components |
|
|
358
|
+
| [`@onlive.ai/flow-client`](../flow-client) | Flow client SDK |
|
|
359
|
+
| [`@onlive.ai/calendar`](../calendar) | Calendar integration components |
|
|
146
360
|
|
|
147
|
-
|
|
148
|
-
- [`@onlive.ai/flow`](../flow): Interactive flow components
|
|
149
|
-
- [`@onlive.ai/meet`](../meet): Video conferencing components
|
|
150
|
-
- [`@onlive.ai/flow-client`](../flow-client): Flow client SDK
|
|
361
|
+
---
|
|
151
362
|
|
|
152
|
-
##
|
|
363
|
+
## License
|
|
153
364
|
|
|
154
365
|
This package is part of the Onlive 121 ecosystem and follows the project's licensing terms.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @onlive.ai/common-121 v0.2.
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.190 | © 2026 Onlive.ai */
|
|
2
2
|
var w=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var I=(s,a,t,i)=>{for(var n=i>1?void 0:i?x(a,t):a,d=s.length-1,l;d>=0;d--)(l=s[d])&&(n=(i?l(a,t,n):l(n))||n);return i&&n&&w(a,t,n),n};function A(s={}){let{width:a=640,height:t=480,fps:i=30,backgroundColor:n="#1a1a2e",foregroundColor:d="#4361ee",label:l="Mock Video",animation:S="wave"}=s,r=document.createElement("canvas");r.width=a,r.height=t;let e=r.getContext("2d"),m,h=Date.now(),v={wave:u=>{e.fillStyle=n,e.fillRect(0,0,a,t),e.strokeStyle=d,e.lineWidth=3,e.beginPath();for(let o=0;o<a;o++){let c=t/2+Math.sin(o/a*4*Math.PI+u*.002)*(t/4);o===0?e.moveTo(o,c):e.lineTo(o,c)}e.stroke()},pulse:u=>{e.fillStyle=n,e.fillRect(0,0,a,t);let o=Math.sin(u*.003)*.3+.7,c=Math.min(a,t)*.3*o;e.beginPath(),e.arc(a/2,t/2,c,0,Math.PI*2),e.fillStyle=d,e.fill()},bars:u=>{e.fillStyle=n,e.fillRect(0,0,a,t);let o=20,c=a/o,f=t*.7;e.fillStyle=d;for(let g=0;g<o;g++){let k=Math.abs(Math.sin(g/o*Math.PI*2+u*.004))*f,T=g*c,C=t-k;e.fillRect(T+2,C,c-4,k)}},avatar:u=>{e.fillStyle=n,e.fillRect(0,0,a,t);let o=a/2,c=t/2-20,f=Math.min(a,t)*.15;e.beginPath(),e.arc(o,c,f,0,Math.PI*2),e.fillStyle=d,e.fill(),e.beginPath(),e.ellipse(o,c+f*2.2,f*1.5,f,0,Math.PI,0),e.fill(),Math.sin(u*.01)>0&&(e.beginPath(),e.arc(o,c+f*3,5+Math.sin(u*.02)*3,0,Math.PI*2),e.fillStyle="#22c55e",e.fill())},none:()=>{e.fillStyle=n,e.fillRect(0,0,a,t)}},y=()=>{e.fillStyle="rgba(255, 255, 255, 0.8)",e.font=`${Math.floor(t*.04)}px system-ui, sans-serif`,e.textAlign="center",e.fillText(l,a/2,t-20)},b=()=>{let u=Date.now()-h;v[S](u),y(),m=requestAnimationFrame(b)};b();let p=r.captureStream(i),M=p.getVideoTracks()[0];return{track:M,stream:p,cleanup:()=>{cancelAnimationFrame(m),M.stop()}}}function E(s={}){let{frequency:a=440,volume:t=.1,waveType:i="sine",addVariation:n=!0,enabled:d=!1}=s,l=new AudioContext,S=l.createMediaStreamDestination(),r=l.createOscillator();r.type=i,r.frequency.value=a;let e=l.createGain();e.gain.value=d?t:0;let m=null,h=null;n&&(m=l.createOscillator(),m.frequency.value=.5,h=l.createGain(),h.gain.value=10,m.connect(h),h.connect(r.frequency),m.start()),r.connect(e),e.connect(S),r.start();let v=S.stream,y=v.getAudioTracks()[0];return{track:y,stream:v,setVolume:b=>{e.gain.value=Math.max(0,Math.min(1,b))},setEnabled:b=>{e.gain.value=b?t:0},cleanup:()=>{r.stop(),m?.stop(),l.close(),y.stop()}}}function P(s,a){let t=A(s),i=E(a),n=new MediaStream([t.track,i.track]);return{videoTrack:t.track,audioTrack:i.track,combinedStream:n,setAudioVolume:i.setVolume,setAudioEnabled:i.setEnabled,cleanup:()=>{t.cleanup(),i.cleanup()}}}var V={localCamera:{video:{width:640,height:480,animation:"avatar",label:"You",foregroundColor:"#4361ee"},audio:{enabled:!1}},agentCamera:{video:{width:640,height:480,animation:"avatar",label:"AI Agent",foregroundColor:"#22c55e",backgroundColor:"#0f172a"},audio:{enabled:!1,frequency:300}},screenShare:{video:{width:1920,height:1080,animation:"bars",label:"Screen Share",backgroundColor:"#0a0a0a",foregroundColor:"#f59e0b"},audio:{enabled:!1}},voiceOnly:{video:{width:320,height:240,animation:"wave",label:"Voice Call"},audio:{enabled:!1,volume:.05}}};function q(s){let a=V[s];return P(a.video,a.audio)}export{I as a,A as b,E as c,P as d,V as e,q as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @onlive.ai/common-121 v0.2.
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.190 | © 2026 Onlive.ai */
|
|
2
2
|
"use strict";var f=Object.create;var r=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var b=(t,a)=>{for(var e in a)r(t,e,{get:a[e],enumerable:!0})},v=(t,a,e,l)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of y(a))!w.call(t,o)&&o!==e&&r(t,o,{get:()=>a[o],enumerable:!(l=x(a,o))||l.enumerable});return t};var m=(t,a,e)=>(e=t!=null?f($(t)):{},v(a||!t||!t.__esModule?r(e,"default",{value:t,enumerable:!0}):e,t)),z=t=>v(r({},"__esModule",{value:!0}),t);var M={};b(M,{AssetModalPortal:()=>p});module.exports=z(M);var p=class{constructor(a,e){this.asset=a,this.onClose=e}getMultimediaSubtype(a){let e=a.format||"";return e.startsWith("video/")?"video":e.startsWith("image/")?"image":e.includes("presentation")||e.includes("pdf")||e.includes("powerpoint")||e.includes("slides")||e.includes("application/vnd.ms-powerpoint")||e.includes("application/vnd.openxmlformats-officedocument.presentationml")||a.slides&&a.slides.length>0?"presentation":a.duration||a.vodUrl?"video":"image"}formatDuration(a){let e=Math.floor(a/60),l=Math.floor(a%60);return`${e}:${l.toString().padStart(2,"0")}`}async open(){await import("@onlive.ai/ui/dist/components/dialog/dialog.js"),await import("@onlive.ai/ui/dist/components/icon-button/icon-button.js"),await import("@onlive.ai/ui/dist/components/button/button.js"),await import("@onlive.ai/ui/dist/components/icon/icon.js");let a=this.asset;this.getMultimediaSubtype(a)==="presentation"&&(a.slides?.length??0)>0&&await Promise.all([import("@onlive.ai/ui/dist/components/carousel/carousel.js"),import("@onlive.ai/ui/dist/components/carousel-item/carousel-item.js")]),this.injectStyles(),this.createDialog(),this.dialog?.show()}close(){this.dialog?.hide(),setTimeout(()=>{this.removeDialog()},300)}createDialog(){if(this.dialog||!this.asset)return;let a=this.createDialogHTML(),e=document.createElement("div");e.innerHTML=a,this.dialog=e.firstElementChild,this.dialog&&(document.body.appendChild(this.dialog),this.attachEventListeners())}removeDialog(){this.dialog&&(this.dialog.parentNode&&this.dialog.parentNode.removeChild(this.dialog),this.dialog=void 0)}injectStyles(){if(document.getElementById("asset-modal-styles"))return;let a=document.createElement("style");a.id="asset-modal-styles",a.textContent=this.getModalStyles(),document.head.appendChild(a)}getModalStyles(){return`
|
|
3
3
|
|
|
4
4
|
ol-dialog::part(base){
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @onlive.ai/common-121 v0.2.
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.190 | © 2026 Onlive.ai */
|
|
2
2
|
var c=class{constructor(e,a){this.asset=e,this.onClose=a}getMultimediaSubtype(e){let a=e.format||"";return a.startsWith("video/")?"video":a.startsWith("image/")?"image":a.includes("presentation")||a.includes("pdf")||a.includes("powerpoint")||a.includes("slides")||a.includes("application/vnd.ms-powerpoint")||a.includes("application/vnd.openxmlformats-officedocument.presentationml")||e.slides&&e.slides.length>0?"presentation":e.duration||e.vodUrl?"video":"image"}formatDuration(e){let a=Math.floor(e/60),l=Math.floor(e%60);return`${a}:${l.toString().padStart(2,"0")}`}async open(){await import("@onlive.ai/ui/dist/components/dialog/dialog.js"),await import("@onlive.ai/ui/dist/components/icon-button/icon-button.js"),await import("@onlive.ai/ui/dist/components/button/button.js"),await import("@onlive.ai/ui/dist/components/icon/icon.js");let e=this.asset;this.getMultimediaSubtype(e)==="presentation"&&(e.slides?.length??0)>0&&await Promise.all([import("@onlive.ai/ui/dist/components/carousel/carousel.js"),import("@onlive.ai/ui/dist/components/carousel-item/carousel-item.js")]),this.injectStyles(),this.createDialog(),this.dialog?.show()}close(){this.dialog?.hide(),setTimeout(()=>{this.removeDialog()},300)}createDialog(){if(this.dialog||!this.asset)return;let e=this.createDialogHTML(),a=document.createElement("div");a.innerHTML=e,this.dialog=a.firstElementChild,this.dialog&&(document.body.appendChild(this.dialog),this.attachEventListeners())}removeDialog(){this.dialog&&(this.dialog.parentNode&&this.dialog.parentNode.removeChild(this.dialog),this.dialog=void 0)}injectStyles(){if(document.getElementById("asset-modal-styles"))return;let e=document.createElement("style");e.id="asset-modal-styles",e.textContent=this.getModalStyles(),document.head.appendChild(e)}getModalStyles(){return`
|
|
3
3
|
|
|
4
4
|
ol-dialog::part(base){
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @onlive.ai/common-121 v0.2.
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.190 | © 2026 Onlive.ai */
|
|
2
2
|
"use strict";var K=Object.create;var w=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var ee=(i,e)=>{for(var t in e)w(i,t,{get:e[t],enumerable:!0})},$=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of X(e))!Z.call(i,s)&&s!==t&&w(i,s,{get:()=>e[s],enumerable:!(o=I(e,s))||o.enumerable});return i};var u=(i,e,t)=>(t=i!=null?K(W(i)):{},$(e||!i||!i.__esModule?w(t,"default",{value:i,enumerable:!0}):t,i)),te=i=>$(w({},"__esModule",{value:!0}),i),c=(i,e,t,o)=>{for(var s=o>1?void 0:o?I(e,t):e,l=i.length-1,a;l>=0;l--)(a=i[l])&&(s=(o?a(e,t,s):a(s))||s);return o&&s&&w(e,t,s),s};var ae={};ee(ae,{OSBAsset:()=>v});module.exports=te(ae);var g=require("lit"),p=require("lit/decorators.js"),G=require("lit/directives/class-map.js");var oe=(i,e)=>(customElements.get(i)?console.debug(`Custom element <${i}> is already defined, skipping definition of ${e.name}.`):window.customElements.define(i,e),e),se=(i,e)=>{let{kind:t,elements:o}=e;return{kind:t,elements:o,finisher(s){customElements.get(i)||window.customElements.define(i,s)}}},A=i=>e=>typeof e=="function"?oe(i,e):se(i,e);var k=class i{constructor(e){this.config=e}static initialize(e){return new i(e)}getBaseUrl(){return`${this.config.baseUrl}`}getHeaders(){return{"Content-Type":"application/json"}}async makeRequest(e,t={}){let o=`${this.getBaseUrl()}${e}`,s=await fetch(o,{...t,headers:{...this.getHeaders(),...t.headers}});if(!s.ok)throw new Error(`FAQs API error: ${s.status} ${s.statusText}`);return s.json()}async getSettingsByOrganization(e,t){try{let o=new URLSearchParams;t&&o.append("userGroupId",t);let s=o.toString(),l=`${this.getBaseUrl()}/settings/organization/${e}${s?`?${s}`:""}`,a=await fetch(l,{method:"GET",headers:this.getHeaders(),credentials:"include"});if(a.status===404)return null;if(!a.ok)throw new Error(`Failed to fetch settings: ${a.statusText}`);return await a.json()}catch(o){return console.error("Error fetching settings:",o),null}}async getFaqs(e={}){let t=new URLSearchParams;if(e.search&&t.append("search",e.search),e.organizationId&&t.append("organizationId",e.organizationId),e.groupId&&t.append("groupId",e.groupId),e.isActive!==void 0&&t.append("isActive",e.isActive.toString()),e.page&&t.append("page",e.page.toString()),e.limit&&t.append("limit",e.limit.toString()),e.sortBy&&t.append("sortBy",e.sortBy),e.sortOrder&&t.append("sortOrder",e.sortOrder),e.extraFilters){for(let[l,a]of Object.entries(e.extraFilters))if(a&&(Array.isArray(a)?a.length>0:a.toString().trim()!=="")){let d=Array.isArray(a)?a.join(","):a.toString();t.append(`extra_${l}`,d)}}let o=t.toString(),s=`/faqs${o?`?${o}`:""}`;return this.makeRequest(s)}async getFaqById(e){return this.makeRequest(`/faqs/${e}`,{})}};var b=async(i,e)=>{let t=await fetch(i,e);if(!t.ok){let o=await t.json().catch(()=>({}));throw new Error(JSON.stringify({status:t.status,statusText:t.statusText,...o}))}return t&&t.json()};var S=class i{constructor(e){this.config=e,this.enableUpload=e.enableUpload||!1}static getInstance(e){if(!i.instance&&e&&(i.instance=new i(e)),!i.instance)throw new Error("FileService must be initialized with config first");return i.instance}static initialize(e){return i.instance=new i(e),i.instance}async uploadFile(e,t={}){try{let o=await this.requestSignedUrl({filename:e.name,description:t.description,loadDirection:"up",bucketType:t.bucketType||"conversations",path:t.path||".temp",mimeType:e.type});return await this.uploadToSignedUrl(o.data.signedUrlData.signedUrl,e),{success:!0,id:o.data.file.id,name:o.data.file.name,url:o.data.file.url,type:o.data.file.type}}catch(o){return console.error("Error uploading file:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error"}}}async requestSignedUrl(e){let t=`${this.config.baseUrl}/files/upload-url`;return this.makeRequest(t,{method:"POST",body:JSON.stringify(e)})}async uploadToSignedUrl(e,t){let o=await fetch(e,{method:"PUT",body:t,headers:{"Content-Type":t.type}});if(!o.ok){let s=await o.text().catch(()=>"No response");throw new Error(`Upload failed with status: ${o.status}. Response: ${s}`)}}async uploadFileWithRetry(e,t={}){let o=t.maxRetries||3,s=null;for(let l=1;l<=o;l++)try{let a=await this.uploadFile(e,t);if(a.success)return a;throw new Error(a.error||"Upload failed")}catch(a){if(s=a instanceof Error?a:new Error("Unknown error"),l===o)break;let d=2**l*1e3;await new Promise(r=>setTimeout(r,d))}return{success:!1,error:s?.message||"Upload failed after retries"}}async getFileById(e){let t=`${this.config.baseUrl}/files/${e}`,o=await this.makeRequest(t);if(!o.success)throw new Error("Failed to get file");return o.data}async makeRequest(e,t){let o={"Content-Type":"application/json"};return this.config.organizationId&&(o["X-Onlive-Organization-Id"]=this.config.organizationId),t?.headers&&Object.assign(o,t.headers),b(e,{...t,headers:o})}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};var z=class i{constructor(e){this.config=e}static getInstance(e){if(!i.instance&&e&&(i.instance=new i(e)),!i.instance)throw new Error("MultimediaService must be initialized with config first");return i.instance}static initialize(e){return i.instance=new i(e),i.instance}async getImages(e={}){let t=new URLSearchParams({type:"image",page:(e.page||1).toString(),limit:(e.limit||12).toString(),...e.search&&{search:e.search},...e.labels&&{labels:e.labels.join(",")},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});this.appendExtraFilters(t,e.extraFilters);let o=`${this.config.baseUrl}/multimedia?${t}`;return this.makeRequest(o)}async getVideos(e={}){let t=new URLSearchParams({type:"video",page:(e.page||1).toString(),limit:(e.limit||12).toString(),...e.search&&{search:e.search},...e.labels&&{labels:e.labels.join(",")},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});this.appendExtraFilters(t,e.extraFilters);let o=`${this.config.baseUrl}/multimedia?${t}`;return this.makeRequest(o)}async getPresentations(e={}){let t=new URLSearchParams({type:"presentation",page:(e.page||1).toString(),limit:(e.limit||12).toString(),...e.search&&{search:e.search},...e.labels&&{labels:e.labels.join(",")},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});this.appendExtraFilters(t,e.extraFilters);let o=`${this.config.baseUrl}/multimedia?${t}`;return this.makeRequest(o)}async getAllMultimedia(e={}){let[t,o,s]=await Promise.all([this.getImages(e),this.getVideos(e),this.getPresentations(e)]);return{images:t,videos:o,presentations:s}}async getMultimediaByToken(e){let t=`${this.config.baseUrl}/multimedia/secure-token/${e}`;return this.makeRequest(t,!1)}async searchMultimedia(e,t){let o={search:e,page:1,limit:50,includeSecureToken:!0};if(t)return this.getMultimediaByType(t,o);let[s,l,a]=await Promise.all([this.getImages(o),this.getVideos(o),this.getPresentations(o)]),d=[...s.items,...l.items,...a.items];return{items:d,total:d.length,count:d.length,currentPage:1,totalPages:1}}async getMultimediaByType(e,t){switch(e){case"image":return this.getImages(t);case"video":return this.getVideos(t);case"presentation":return this.getPresentations(t);default:throw new Error(`Invalid multimedia type: ${e}`)}}appendExtraFilters(e,t){if(t){for(let[o,s]of Object.entries(t))if(s&&(Array.isArray(s)?s.length>0:s.toString().trim()!=="")){let l=Array.isArray(s)?s.join(","):s.toString();e.append(`extra_${o}`,l)}}}async makeRequest(e,t=!0){let o={"Content-Type":"application/json","X-Onlive-Organization-Id":this.config.organizationId};return b(e,{method:"GET",headers:o,credentials:t?"include":void 0})}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};var x=class i{constructor(e){this.config=e}static getInstance(e){if(!i.instance&&e&&(i.instance=new i(e)),!i.instance)throw new Error("ProductService must be initialized with config first");return i.instance}static initialize(e){return i.instance=new i(e),i.instance}async getProducts(e={}){let t=new URLSearchParams({...e.title&&{title:e.title},...e.search&&{search:e.search},...e.category&&{category:e.category},...e.tags&&{tags:e.tags.join(",")},...e.sortBy&&{sortBy:e.sortBy},...e.sortOrder&&{sortOrder:e.sortOrder},...e.minPrice&&{minPrice:e.minPrice.toString()},...e.maxPrice&&{maxPrice:e.maxPrice.toString()},...e.inStock!==void 0&&{inStock:e.inStock.toString()},...e.offset&&{offset:e.offset.toString()},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});e.extraFields&&Object.keys(e.extraFields).length>0&&t.append("extraFields",JSON.stringify(e.extraFields));let o=`${this.config.baseUrl}/products?${t}`;return this.makeRequest(o,!0)}async getProductByToken(e){let t=`${this.config.baseUrl}/products/secure-token/${e}`;return this.makeRequest(t)}async searchProducts(e,t={}){return this.getProducts({...t,search:e})}async makeRequest(e,t=!1){let o={"Content-Type":"application/json","X-Onlive-Organization-Id":this.config.organizationId};return b(e,{method:"GET",headers:o,credentials:t?"include":"same-origin"})}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};var P=class{constructor(e){e?.multimediaService&&(this.multimediaService=z.initialize(e.multimediaService)),e?.faqsService&&(this.faqsService=k.initialize(e.faqsService)),e?.productService&&(this.productService=x.initialize(e.productService)),e?.fileService&&(this.fileService=S.initialize(e.fileService))}async loadAsset(e,t){switch(e){case"multimedia":return this.loadMultimediaAsset(t);case"product":return this.loadProductAsset(t);case"faq":return this.loadFaqAsset(t);case"file":return this.loadFileAsset(t);default:throw new Error(`Unsupported asset type: ${e}`)}}async loadMultimediaAsset(e){if(!this.multimediaService)throw new Error("MultimediaService not configured");let t=await this.multimediaService.getMultimediaByToken(e);if(!t)throw new Error("Multimedia not found");return{id:t.id,name:t.name,description:t.description||"",url:t.url,thumbnail:t.animatedCoverUrl||t.url,type:"multimedia",externalId:t.id,format:t.format,size:t.size||void 0,duration:t.duration||void 0,vodUrl:t.vodUrl||void 0,slides:t.slides||[],labels:t.labels,animatedCoverUrl:t.animatedCoverUrl||void 0,metadata:{organizationId:t.organizationId,status:t.status,createdAt:t.createdAt,updatedAt:t.updatedAt}}}async loadProductAsset(e){if(!this.productService)throw new Error("MultimediaService not configured");let t=await this.productService.getProductByToken(e);if(!t)throw new Error("Product not found");return{id:t.id,name:t.name,description:t.description,url:t.url,thumbnail:t.images?.[0],type:"product",externalId:t.externalId,price:t.price,currency:t.currency,category:t.category,tags:t.tags,images:t.images,variants:t.variants?.map(o=>({id:o.id,externalId:o.externalId,price:o.price,currency:o.currency,images:o.images})),options:t.options,metadata:{providerType:t.providerType,providerId:t.providerId,discountType:t.discountType,discount:t.discount,stock:t.stock,broken:t.broken}}}async loadFaqAsset(e){if(!this.faqsService)throw new Error("FaqsService not configured");let t=await this.faqsService.getFaqById(e);return{id:t.id,name:t.question,description:t.answer,url:`#faq-${t.id}`,type:"faq",externalId:t.id,question:t.question,answer:t.answer,priority:t.priority,isActive:t.isActive,metadata:{organizationId:t.organizationId,createdAt:t.createdAt,updatedAt:t.updatedAt}}}async loadFileAsset(e){if(!this.fileService)throw new Error("FileService not configured");let t=await this.fileService.getFileById(e),o=t.type||"",s=o.startsWith("video/"),l=o.startsWith("image/");return{id:t.id,name:t.name,description:t.description||"",url:t.url,thumbnail:l?t.url:void 0,type:"file",externalId:t.id,format:o,size:t.metadata?.size,duration:void 0,vodUrl:s?t.url:void 0,labels:[],animatedCoverUrl:s?t.url:void 0,metadata:{path:t.metadata?.path,bucketType:t.metadata?.bucketType,loadDirection:t.metadata?.loadDirection,createdAt:t.createdAt,updatedAt:t.updatedAt}}}};var n=require("lit"),J=require("lit/directives/class-map.js"),y=require("lit/directives/if-defined.js"),f=require("lit/directives/when.js");var L=require("lit/directives/unsafe-html.js");var E=u(require("dompurify"),1),ie={ALLOWED_TAGS:["p","br","span","b","strong","i","em","u","s","del","ul","ol","li","code","pre","a","h1","h2","h3","h4","table","thead","tbody","tr","th","td"],ALLOWED_ATTR:["href","target","rel","title","aria-label","role","colspan","rowspan"],FORCE_HTTPS:!0,ALLOW_DATA_ATTR:!1};E.default.addHook("afterSanitizeAttributes",i=>{"target"in i&&i.target==="_blank"&&i.setAttribute("rel","noopener noreferrer")});var U=(i,e=ie)=>E.default.sanitize(i,e);function V(i=""){return(0,L.unsafeHTML)(ne(i))}function ne(i=""){return U(i,{ADD_ATTR:["target","rel"],ADD_TAGS:["ol-"],CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^ol-/,attributeNameCheck:null,allowCustomizedBuiltInElements:!0}})}var Te=require("@onlive.ai/ui/dist/components/button/button.js"),Fe=require("@onlive.ai/ui/dist/components/icon/icon.js"),_=require("lit"),T=require("lit/decorators.js"),Y=require("lit/directives/repeat.js"),H=u(require("video.js"),1);var M=require("lit"),D=u(require("video.js/dist/video-js.min.css?inline"),1),B=M.css`
|
|
3
3
|
${(0,M.unsafeCSS)(D.default)}
|
|
4
4
|
.och__player {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @onlive.ai/common-121 v0.2.
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.190 | © 2026 Onlive.ai */
|
|
2
2
|
var U=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var c=(n,e,t,o)=>{for(var s=o>1?void 0:o?L(e,t):e,l=n.length-1,a;l>=0;l--)(a=n[l])&&(s=(o?a(e,t,s):a(s))||s);return o&&s&&U(e,t,s),s};import{html as z,LitElement as te}from"lit";import{property as T,state as h}from"lit/decorators.js";import{classMap as oe}from"lit/directives/class-map.js";var V=(n,e)=>(customElements.get(n)?console.debug(`Custom element <${n}> is already defined, skipping definition of ${e.name}.`):window.customElements.define(n,e),e),D=(n,e)=>{let{kind:t,elements:o}=e;return{kind:t,elements:o,finisher(s){customElements.get(n)||window.customElements.define(n,s)}}},y=n=>e=>typeof e=="function"?V(n,e):D(n,e);var w=class n{constructor(e){this.config=e}static initialize(e){return new n(e)}getBaseUrl(){return`${this.config.baseUrl}`}getHeaders(){return{"Content-Type":"application/json"}}async makeRequest(e,t={}){let o=`${this.getBaseUrl()}${e}`,s=await fetch(o,{...t,headers:{...this.getHeaders(),...t.headers}});if(!s.ok)throw new Error(`FAQs API error: ${s.status} ${s.statusText}`);return s.json()}async getSettingsByOrganization(e,t){try{let o=new URLSearchParams;t&&o.append("userGroupId",t);let s=o.toString(),l=`${this.getBaseUrl()}/settings/organization/${e}${s?`?${s}`:""}`,a=await fetch(l,{method:"GET",headers:this.getHeaders(),credentials:"include"});if(a.status===404)return null;if(!a.ok)throw new Error(`Failed to fetch settings: ${a.statusText}`);return await a.json()}catch(o){return console.error("Error fetching settings:",o),null}}async getFaqs(e={}){let t=new URLSearchParams;if(e.search&&t.append("search",e.search),e.organizationId&&t.append("organizationId",e.organizationId),e.groupId&&t.append("groupId",e.groupId),e.isActive!==void 0&&t.append("isActive",e.isActive.toString()),e.page&&t.append("page",e.page.toString()),e.limit&&t.append("limit",e.limit.toString()),e.sortBy&&t.append("sortBy",e.sortBy),e.sortOrder&&t.append("sortOrder",e.sortOrder),e.extraFilters){for(let[l,a]of Object.entries(e.extraFilters))if(a&&(Array.isArray(a)?a.length>0:a.toString().trim()!=="")){let d=Array.isArray(a)?a.join(","):a.toString();t.append(`extra_${l}`,d)}}let o=t.toString(),s=`/faqs${o?`?${o}`:""}`;return this.makeRequest(s)}async getFaqById(e){return this.makeRequest(`/faqs/${e}`,{})}};var j=async(n,e)=>{let t=await fetch(n,e);if(!t.ok){let o=await t.json().catch(()=>({}));throw new Error(JSON.stringify({status:t.status,statusText:t.statusText,...o}))}return t&&t.json()};var x=class n{constructor(e){this.config=e,this.enableUpload=e.enableUpload||!1}static getInstance(e){if(!n.instance&&e&&(n.instance=new n(e)),!n.instance)throw new Error("FileService must be initialized with config first");return n.instance}static initialize(e){return n.instance=new n(e),n.instance}async uploadFile(e,t={}){try{let o=await this.requestSignedUrl({filename:e.name,description:t.description,loadDirection:"up",bucketType:t.bucketType||"conversations",path:t.path||".temp",mimeType:e.type});return await this.uploadToSignedUrl(o.data.signedUrlData.signedUrl,e),{success:!0,id:o.data.file.id,name:o.data.file.name,url:o.data.file.url,type:o.data.file.type}}catch(o){return console.error("Error uploading file:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error"}}}async requestSignedUrl(e){let t=`${this.config.baseUrl}/files/upload-url`;return this.makeRequest(t,{method:"POST",body:JSON.stringify(e)})}async uploadToSignedUrl(e,t){let o=await fetch(e,{method:"PUT",body:t,headers:{"Content-Type":t.type}});if(!o.ok){let s=await o.text().catch(()=>"No response");throw new Error(`Upload failed with status: ${o.status}. Response: ${s}`)}}async uploadFileWithRetry(e,t={}){let o=t.maxRetries||3,s=null;for(let l=1;l<=o;l++)try{let a=await this.uploadFile(e,t);if(a.success)return a;throw new Error(a.error||"Upload failed")}catch(a){if(s=a instanceof Error?a:new Error("Unknown error"),l===o)break;let d=2**l*1e3;await new Promise(r=>setTimeout(r,d))}return{success:!1,error:s?.message||"Upload failed after retries"}}async getFileById(e){let t=`${this.config.baseUrl}/files/${e}`,o=await this.makeRequest(t);if(!o.success)throw new Error("Failed to get file");return o.data}async makeRequest(e,t){let o={"Content-Type":"application/json"};return this.config.organizationId&&(o["X-Onlive-Organization-Id"]=this.config.organizationId),t?.headers&&Object.assign(o,t.headers),j(e,{...t,headers:o})}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};var _=class n{constructor(e){this.config=e}static getInstance(e){if(!n.instance&&e&&(n.instance=new n(e)),!n.instance)throw new Error("MultimediaService must be initialized with config first");return n.instance}static initialize(e){return n.instance=new n(e),n.instance}async getImages(e={}){let t=new URLSearchParams({type:"image",page:(e.page||1).toString(),limit:(e.limit||12).toString(),...e.search&&{search:e.search},...e.labels&&{labels:e.labels.join(",")},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});this.appendExtraFilters(t,e.extraFilters);let o=`${this.config.baseUrl}/multimedia?${t}`;return this.makeRequest(o)}async getVideos(e={}){let t=new URLSearchParams({type:"video",page:(e.page||1).toString(),limit:(e.limit||12).toString(),...e.search&&{search:e.search},...e.labels&&{labels:e.labels.join(",")},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});this.appendExtraFilters(t,e.extraFilters);let o=`${this.config.baseUrl}/multimedia?${t}`;return this.makeRequest(o)}async getPresentations(e={}){let t=new URLSearchParams({type:"presentation",page:(e.page||1).toString(),limit:(e.limit||12).toString(),...e.search&&{search:e.search},...e.labels&&{labels:e.labels.join(",")},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});this.appendExtraFilters(t,e.extraFilters);let o=`${this.config.baseUrl}/multimedia?${t}`;return this.makeRequest(o)}async getAllMultimedia(e={}){let[t,o,s]=await Promise.all([this.getImages(e),this.getVideos(e),this.getPresentations(e)]);return{images:t,videos:o,presentations:s}}async getMultimediaByToken(e){let t=`${this.config.baseUrl}/multimedia/secure-token/${e}`;return this.makeRequest(t,!1)}async searchMultimedia(e,t){let o={search:e,page:1,limit:50,includeSecureToken:!0};if(t)return this.getMultimediaByType(t,o);let[s,l,a]=await Promise.all([this.getImages(o),this.getVideos(o),this.getPresentations(o)]),d=[...s.items,...l.items,...a.items];return{items:d,total:d.length,count:d.length,currentPage:1,totalPages:1}}async getMultimediaByType(e,t){switch(e){case"image":return this.getImages(t);case"video":return this.getVideos(t);case"presentation":return this.getPresentations(t);default:throw new Error(`Invalid multimedia type: ${e}`)}}appendExtraFilters(e,t){if(t){for(let[o,s]of Object.entries(t))if(s&&(Array.isArray(s)?s.length>0:s.toString().trim()!=="")){let l=Array.isArray(s)?s.join(","):s.toString();e.append(`extra_${o}`,l)}}}async makeRequest(e,t=!0){let o={"Content-Type":"application/json","X-Onlive-Organization-Id":this.config.organizationId};return j(e,{method:"GET",headers:o,credentials:t?"include":void 0})}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};var g=class n{constructor(e){this.config=e}static getInstance(e){if(!n.instance&&e&&(n.instance=new n(e)),!n.instance)throw new Error("ProductService must be initialized with config first");return n.instance}static initialize(e){return n.instance=new n(e),n.instance}async getProducts(e={}){let t=new URLSearchParams({...e.title&&{title:e.title},...e.search&&{search:e.search},...e.category&&{category:e.category},...e.tags&&{tags:e.tags.join(",")},...e.sortBy&&{sortBy:e.sortBy},...e.sortOrder&&{sortOrder:e.sortOrder},...e.minPrice&&{minPrice:e.minPrice.toString()},...e.maxPrice&&{maxPrice:e.maxPrice.toString()},...e.inStock!==void 0&&{inStock:e.inStock.toString()},...e.offset&&{offset:e.offset.toString()},...e.includeSecureToken&&{includeSecureToken:e.includeSecureToken.toString()}});e.extraFields&&Object.keys(e.extraFields).length>0&&t.append("extraFields",JSON.stringify(e.extraFields));let o=`${this.config.baseUrl}/products?${t}`;return this.makeRequest(o,!0)}async getProductByToken(e){let t=`${this.config.baseUrl}/products/secure-token/${e}`;return this.makeRequest(t)}async searchProducts(e,t={}){return this.getProducts({...t,search:e})}async makeRequest(e,t=!1){let o={"Content-Type":"application/json","X-Onlive-Organization-Id":this.config.organizationId};return j(e,{method:"GET",headers:o,credentials:t?"include":"same-origin"})}updateConfig(e){this.config={...this.config,...e}}getConfig(){return{...this.config}}};var A=class{constructor(e){e?.multimediaService&&(this.multimediaService=_.initialize(e.multimediaService)),e?.faqsService&&(this.faqsService=w.initialize(e.faqsService)),e?.productService&&(this.productService=g.initialize(e.productService)),e?.fileService&&(this.fileService=x.initialize(e.fileService))}async loadAsset(e,t){switch(e){case"multimedia":return this.loadMultimediaAsset(t);case"product":return this.loadProductAsset(t);case"faq":return this.loadFaqAsset(t);case"file":return this.loadFileAsset(t);default:throw new Error(`Unsupported asset type: ${e}`)}}async loadMultimediaAsset(e){if(!this.multimediaService)throw new Error("MultimediaService not configured");let t=await this.multimediaService.getMultimediaByToken(e);if(!t)throw new Error("Multimedia not found");return{id:t.id,name:t.name,description:t.description||"",url:t.url,thumbnail:t.animatedCoverUrl||t.url,type:"multimedia",externalId:t.id,format:t.format,size:t.size||void 0,duration:t.duration||void 0,vodUrl:t.vodUrl||void 0,slides:t.slides||[],labels:t.labels,animatedCoverUrl:t.animatedCoverUrl||void 0,metadata:{organizationId:t.organizationId,status:t.status,createdAt:t.createdAt,updatedAt:t.updatedAt}}}async loadProductAsset(e){if(!this.productService)throw new Error("MultimediaService not configured");let t=await this.productService.getProductByToken(e);if(!t)throw new Error("Product not found");return{id:t.id,name:t.name,description:t.description,url:t.url,thumbnail:t.images?.[0],type:"product",externalId:t.externalId,price:t.price,currency:t.currency,category:t.category,tags:t.tags,images:t.images,variants:t.variants?.map(o=>({id:o.id,externalId:o.externalId,price:o.price,currency:o.currency,images:o.images})),options:t.options,metadata:{providerType:t.providerType,providerId:t.providerId,discountType:t.discountType,discount:t.discount,stock:t.stock,broken:t.broken}}}async loadFaqAsset(e){if(!this.faqsService)throw new Error("FaqsService not configured");let t=await this.faqsService.getFaqById(e);return{id:t.id,name:t.question,description:t.answer,url:`#faq-${t.id}`,type:"faq",externalId:t.id,question:t.question,answer:t.answer,priority:t.priority,isActive:t.isActive,metadata:{organizationId:t.organizationId,createdAt:t.createdAt,updatedAt:t.updatedAt}}}async loadFileAsset(e){if(!this.fileService)throw new Error("FileService not configured");let t=await this.fileService.getFileById(e),o=t.type||"",s=o.startsWith("video/"),l=o.startsWith("image/");return{id:t.id,name:t.name,description:t.description||"",url:t.url,thumbnail:l?t.url:void 0,type:"file",externalId:t.id,format:o,size:t.metadata?.size,duration:void 0,vodUrl:s?t.url:void 0,labels:[],animatedCoverUrl:s?t.url:void 0,metadata:{path:t.metadata?.path,bucketType:t.metadata?.bucketType,loadDirection:t.metadata?.loadDirection,createdAt:t.createdAt,updatedAt:t.updatedAt}}}};import{html as i}from"lit";import{classMap as Z}from"lit/directives/class-map.js";import{ifDefined as b}from"lit/directives/if-defined.js";import{when as m}from"lit/directives/when.js";import{unsafeHTML as Y}from"lit/directives/unsafe-html.js";import F from"dompurify";var B={ALLOWED_TAGS:["p","br","span","b","strong","i","em","u","s","del","ul","ol","li","code","pre","a","h1","h2","h3","h4","table","thead","tbody","tr","th","td"],ALLOWED_ATTR:["href","target","rel","title","aria-label","role","colspan","rowspan"],FORCE_HTTPS:!0,ALLOW_DATA_ATTR:!1};F.addHook("afterSanitizeAttributes",n=>{"target"in n&&n.target==="_blank"&&n.setAttribute("rel","noopener noreferrer")});var q=(n,e=B)=>F.sanitize(n,e);function C(n=""){return Y(H(n))}function H(n=""){return q(n,{ADD_ATTR:["target","rel"],ADD_TAGS:["ol-"],CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^ol-/,attributeNameCheck:null,allowCustomizedBuiltInElements:!0}})}import"@onlive.ai/ui/dist/components/button/button.js";import"@onlive.ai/ui/dist/components/icon/icon.js";import{html as E,LitElement as G}from"lit";import{property as Q,query as K}from"lit/decorators.js";import{repeat as X}from"lit/directives/repeat.js";import W from"video.js";import{css as J,unsafeCSS as O}from"lit";import N from"video.js/dist/video-js.min.css?inline";var R=J`
|
|
3
3
|
${O(N)}
|
|
4
4
|
.och__player {
|