@worktango/ai-assistant 0.0.74 → 0.0.75

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.
Files changed (173) hide show
  1. package/dist/{Absenteeism-BiY2Bcdn.mjs → Absenteeism-DIwIpM7t.mjs} +1 -1
  2. package/dist/{ActivityFeed-Cqa28AJG.mjs → ActivityFeed-CUvN-gT5.mjs} +1 -1
  3. package/dist/{AddUser-CJGJEhh8.mjs → AddUser-CbpINGvz.mjs} +1 -1
  4. package/dist/{Admin-QN_rY_7x.mjs → Admin-Bg1jhzE8.mjs} +1 -1
  5. package/dist/{Admin-jx5_GCs4.mjs → Admin-CrgTqjbR.mjs} +1 -1
  6. package/dist/{AiGeneral-BSWT0C0r.mjs → AiGeneral-D7OFNz7l.mjs} +1 -1
  7. package/dist/{AiScoring-BBTEuhH9.mjs → AiScoring-BXmEn3D1.mjs} +1 -1
  8. package/dist/{AiText-CYmXoza8.mjs → AiText-DmP0_hNd.mjs} +1 -1
  9. package/dist/{Anniversary-BUHkJ0fz.mjs → Anniversary-Dp9DYWaN.mjs} +1 -1
  10. package/dist/{Appreciation-Dnd-xal6.mjs → Appreciation-B-HG8U8B.mjs} +1 -1
  11. package/dist/{ArrowDown-CwyPZsSE.mjs → ArrowDown-BzPXjJsI.mjs} +1 -1
  12. package/dist/{ArrowLeft-CKCbd0z0.mjs → ArrowLeft-B21AZrMn.mjs} +1 -1
  13. package/dist/{ArrowRight-Bh1xLpqq.mjs → ArrowRight-BQmbQJZS.mjs} +1 -1
  14. package/dist/{ArrowUp-CV-4CTly.mjs → ArrowUp-CYCxlz4o.mjs} +1 -1
  15. package/dist/{Attachment-DBNpXYow.mjs → Attachment-Bl1qDiSP.mjs} +1 -1
  16. package/dist/{BeQuickDontHurry-Bp-CPlAu.mjs → BeQuickDontHurry-BFYZGYJP.mjs} +1 -1
  17. package/dist/{Birthday-Bx3OVbvO.mjs → Birthday-DQ4-fLrh.mjs} +1 -1
  18. package/dist/{BrandPromise-nUQ6V9ph.mjs → BrandPromise-QfJJHQMs.mjs} +1 -1
  19. package/dist/{BrandVision-BDNTjtWJ.mjs → BrandVision-yCAeH84E.mjs} +1 -1
  20. package/dist/{Calendar-C6ABUOlj.mjs → Calendar-DjKY-maG.mjs} +1 -1
  21. package/dist/{CaretDn-DFBna2Xh.mjs → CaretDn-tEfTd0IQ.mjs} +1 -1
  22. package/dist/{CaretDown-DH5I6yGC.mjs → CaretDown-DKyjVrNg.mjs} +1 -1
  23. package/dist/{CaretLeft-B3QTzZ9B.mjs → CaretLeft-B2Ql1ntd.mjs} +1 -1
  24. package/dist/{CaretRight-Uwrc3Niu.mjs → CaretRight-Buu2bm1s.mjs} +1 -1
  25. package/dist/{CaretUp-B9EGFC8h.mjs → CaretUp-D1HNoxdL.mjs} +1 -1
  26. package/dist/{ChallengeAccepted-B3Fqzzc8.mjs → ChallengeAccepted-BCBt46bR.mjs} +1 -1
  27. package/dist/{CheckIn-C_zkZpVr.mjs → CheckIn-DaBAmDMO.mjs} +1 -1
  28. package/dist/{CheckIns-CL8hEsF6.mjs → CheckIns-Bd_76fx8.mjs} +1 -1
  29. package/dist/{CheckSeal-Dh_12Oo_.mjs → CheckSeal-vEE40ilO.mjs} +1 -1
  30. package/dist/{Checkmark-RV62SvRE.mjs → Checkmark-CznZnsBu.mjs} +1 -1
  31. package/dist/{Clock-CrjiFTq8.mjs → Clock-D-M6hPVI.mjs} +1 -1
  32. package/dist/{Close-jnA03prm.mjs → Close-75epgRj1.mjs} +1 -1
  33. package/dist/{CloudDownload-C88Q6eyQ.mjs → CloudDownload-B1f8BG3E.mjs} +1 -1
  34. package/dist/{Comment-B03Ueedp.mjs → Comment-CQRvQ-Pk.mjs} +1 -1
  35. package/dist/{Comments-WmXSdrgm.mjs → Comments-B6hStvXY.mjs} +1 -1
  36. package/dist/{Connections-DfQ7guwa.mjs → Connections-BDt_MD5m.mjs} +1 -1
  37. package/dist/{Copy-DRXGmDz-.mjs → Copy-aw6fxSsu.mjs} +1 -1
  38. package/dist/{CustomQuestion-BkaMVFc5.mjs → CustomQuestion-Bo9FmzV1.mjs} +1 -1
  39. package/dist/{CustomerSuccess-BiqzQvld.mjs → CustomerSuccess-mOYlCyja.mjs} +1 -1
  40. package/dist/{DatePicker-DHxIeV6O.mjs → DatePicker-LOEOEg7Y.mjs} +1 -1
  41. package/dist/{Dot-BwYqV_eS.mjs → Dot-HlPpH78g.mjs} +1 -1
  42. package/dist/{Download-BI0OcYdE.mjs → Download-C8QMoi4U.mjs} +1 -1
  43. package/dist/{Drag-D2clMMh6.mjs → Drag-hk2tI3tg.mjs} +1 -1
  44. package/dist/{Earn-CaVQpiw4.mjs → Earn-TxDwNITf.mjs} +1 -1
  45. package/dist/{Email-DaCU52Vm.mjs → Email-CkQKtHur.mjs} +1 -1
  46. package/dist/{EmojiDisplay-s8gOP2oo.mjs → EmojiDisplay-CVO60Y2H.mjs} +2 -2
  47. package/dist/{EmojiPicker-bgnse1Dc.mjs → EmojiPicker-CoFNA-5z.mjs} +2 -2
  48. package/dist/{EnpsSurvey-CNZB_0Qe.mjs → EnpsSurvey-DKBK3iK3.mjs} +1 -1
  49. package/dist/{Expired-uNUworXR.mjs → Expired-CsvM3LHC.mjs} +1 -1
  50. package/dist/{Eye-yTg8-jE4.mjs → Eye-fv5I7RMN.mjs} +1 -1
  51. package/dist/{Feedback-D8IkQWdD.mjs → Feedback-BCWJZXtR.mjs} +1 -1
  52. package/dist/{Feedback-C2zSo7rC.mjs → Feedback-CS-zVmYY.mjs} +1 -1
  53. package/dist/{Filter-B4s-ATA5.mjs → Filter-B2iyUqxi.mjs} +1 -1
  54. package/dist/{Flag-D6DvMtGL.mjs → Flag-BhD83I8_.mjs} +1 -1
  55. package/dist/{Giphy-B-XCCmVx.mjs → Giphy-DocEVhOz.mjs} +1 -1
  56. package/dist/{GoalCount-B5OiwB_k.mjs → GoalCount-dKzlM4fO.mjs} +1 -1
  57. package/dist/{GoalPercent-nuLzPZYK.mjs → GoalPercent-tABkvt-t.mjs} +1 -1
  58. package/dist/{GoalTask-DpZHp3Dn.mjs → GoalTask-BWisZYZ6.mjs} +1 -1
  59. package/dist/{GoalTask-g_gbungw.mjs → GoalTask-DDNwlyxP.mjs} +1 -1
  60. package/dist/{Goals-C3OOy7nz.mjs → Goals-DbNBEn5j.mjs} +1 -1
  61. package/dist/{Goals-B0SU8Aop.mjs → Goals-Dy6yHNif.mjs} +1 -1
  62. package/dist/{Growth-BbmsyFmN.mjs → Growth-CL45bMrB.mjs} +1 -1
  63. package/dist/{Hamburger-Cq0OrRKd.mjs → Hamburger-DZf1MnON.mjs} +1 -1
  64. package/dist/{Help-DEe8fSlk.mjs → Help-D_IKxNS7.mjs} +1 -1
  65. package/dist/{HighFive-C2rrGFU6.mjs → HighFive-4It_zgNH.mjs} +1 -1
  66. package/dist/{HighFive-BgVyTYVx.mjs → HighFive-Dt8NsFcJ.mjs} +1 -1
  67. package/dist/{Home-DU6Eq8RM.mjs → Home-BTthZAi5.mjs} +1 -1
  68. package/dist/{Home-DFHh-L7L.mjs → Home-COpEn8wH.mjs} +1 -1
  69. package/dist/{HorizontalLine-BjJ4FLV2.mjs → HorizontalLine-B2M7jVqj.mjs} +1 -1
  70. package/dist/{Hourglass-BRQ_3i-Y.mjs → Hourglass-ecMlqq5d.mjs} +1 -1
  71. package/dist/{Image-B7jgwMBo.mjs → Image-BlP7pk_i.mjs} +1 -1
  72. package/dist/{ImageFile-Ddq_Uhv7.mjs → ImageFile-BRQMzlm_.mjs} +1 -1
  73. package/dist/{InGoodCompany-BrKo6U_V.mjs → InGoodCompany-DpV0RMcX.mjs} +1 -1
  74. package/dist/{Incentives-J00vnXK4.mjs → Incentives-D-T8qcJm.mjs} +1 -1
  75. package/dist/{Info-DwR-L46w.mjs → Info-BbL4pf5k.mjs} +1 -1
  76. package/dist/{Insights-COQPZCbZ.mjs → Insights-Rmu7ZBRZ.mjs} +1 -1
  77. package/dist/{Insights-DmUqUdzU.mjs → Insights-cU3wV90z.mjs} +1 -1
  78. package/dist/{Integrations-U1J5EJS3.mjs → Integrations-DEMdyMQe.mjs} +1 -1
  79. package/dist/{KazooLogo-CdQRU6Iy.mjs → KazooLogo-BeFAH5uc.mjs} +1 -1
  80. package/dist/{KnowYourAudience-CQBwSauQ.mjs → KnowYourAudience-_6_4UB6U.mjs} +1 -1
  81. package/dist/{Launch-BPluegg3.mjs → Launch-D4r9Vaql.mjs} +1 -1
  82. package/dist/{Link-BBMRRaw0.mjs → Link-BPtF5kCL.mjs} +1 -1
  83. package/dist/{LinkArrow-Cem9bdNc.mjs → LinkArrow-wVc4WMUS.mjs} +1 -1
  84. package/dist/{Loading-Tiw7fi77.mjs → Loading-CSSqr3-a.mjs} +1 -1
  85. package/dist/{Lock-BF9brSUE.mjs → Lock-CUnaVuF3.mjs} +1 -1
  86. package/dist/{Management-ClTaf_Dy.mjs → Management-Bd_nOmrA.mjs} +1 -1
  87. package/dist/{MeatballMenu-ApSb_EEk.mjs → MeatballMenu-DwxgeRVL.mjs} +1 -1
  88. package/dist/{Messages-BecZK6v5.mjs → Messages-hKawJf0P.mjs} +1 -1
  89. package/dist/{Microphone-8fKu2RGE.mjs → Microphone-CWwMQydj.mjs} +1 -1
  90. package/dist/{Mobile-4eYm-tys.mjs → Mobile-Bixz3mXt.mjs} +1 -1
  91. package/dist/{Nomination-Dr7qMIWl.mjs → Nomination-Cf2xmLqp.mjs} +1 -1
  92. package/dist/{NominationsAndAwards-Xw9mNFQD.mjs → NominationsAndAwards-dEYMjpmX.mjs} +1 -1
  93. package/dist/{Notification-CA62TxY5.mjs → Notification-Bb-lpdtb.mjs} +1 -1
  94. package/dist/{Okrs-B4T4NXB7.mjs → Okrs-DHOvGkKw.mjs} +1 -1
  95. package/dist/{PeerToPeer-DsPiPtOO.mjs → PeerToPeer-Ci20Le6E.mjs} +1 -1
  96. package/dist/{Pencil-CBMlteVu.mjs → Pencil-DWJqebMj.mjs} +1 -1
  97. package/dist/{People-DM5M5GSm.mjs → People-D5bdN4Kx.mjs} +1 -1
  98. package/dist/{PerformanceManagement-B-khQJZT.mjs → PerformanceManagement-DlcD8s0_.mjs} +1 -1
  99. package/dist/{Pin-B__y-omT.mjs → Pin-Yj47FLzM.mjs} +1 -1
  100. package/dist/{PinnedIconAward-B99ZzuTj.mjs → PinnedIconAward-D46U4ad6.mjs} +1 -1
  101. package/dist/{PinnedIconBrightIdea-wbV7oR0y.mjs → PinnedIconBrightIdea-3EBnDUkZ.mjs} +1 -1
  102. package/dist/{PinnedIconBullseye--KgZkqTD.mjs → PinnedIconBullseye-og6iuxdG.mjs} +1 -1
  103. package/dist/{PinnedIconChampagne-BIs0AuLg.mjs → PinnedIconChampagne-CHczGpX-.mjs} +1 -1
  104. package/dist/{PinnedIconCheer-ALZ4BJsg.mjs → PinnedIconCheer-DLcRRMOT.mjs} +1 -1
  105. package/dist/{PinnedIconCrown-vA4Zzmw7.mjs → PinnedIconCrown-BhGPpOtE.mjs} +1 -1
  106. package/dist/{PinnedIconDiamond-BTezykzH.mjs → PinnedIconDiamond-B_fnxNjB.mjs} +1 -1
  107. package/dist/{PinnedIconHoleInOne-CrBiLiiM.mjs → PinnedIconHoleInOne-D_yPyjVa.mjs} +1 -1
  108. package/dist/{PinnedIconMedal-CQln7xgQ.mjs → PinnedIconMedal-BKFlrl06.mjs} +1 -1
  109. package/dist/{PinnedIconMetrics-B92UmxXS.mjs → PinnedIconMetrics-BcOGbnnV.mjs} +1 -1
  110. package/dist/{PinnedIconPin-CrjN84pz.mjs → PinnedIconPin-D_7IpX6w.mjs} +1 -1
  111. package/dist/{PinnedIconRockAndRoll-DeMJCeOG.mjs → PinnedIconRockAndRoll-jYEDFG4x.mjs} +1 -1
  112. package/dist/{PinnedIconRocket-BvJxZZXB.mjs → PinnedIconRocket-vm42WwFv.mjs} +1 -1
  113. package/dist/{PinnedIconStrength-DxCzlfH1.mjs → PinnedIconStrength-D-huSdBS.mjs} +1 -1
  114. package/dist/{PinnedIconTeddyBear-w3_9aIzq.mjs → PinnedIconTeddyBear-DS5_Z7K6.mjs} +1 -1
  115. package/dist/{PlatformLogo-C3K2Z-Ml.mjs → PlatformLogo-anhbUAQX.mjs} +1 -1
  116. package/dist/{Plus-dEOXS1rG.mjs → Plus-CIvzZFB_.mjs} +1 -1
  117. package/dist/{Popper-DrnbUuAX.mjs → Popper-Bjg0CA8r.mjs} +1 -1
  118. package/dist/{PrivateEye-CSatFtGv.mjs → PrivateEye-Be3C--fp.mjs} +1 -1
  119. package/dist/{PrivatePushPin-Sh_xRAPz.mjs → PrivatePushPin-BTekM_gt.mjs} +1 -1
  120. package/dist/{Processing-QH_pijzS.mjs → Processing-DM1QLOLX.mjs} +1 -1
  121. package/dist/{Productivity-ycnE_UYJ.mjs → Productivity-CuSZ9fBJ.mjs} +1 -1
  122. package/dist/{ProgressCircle-Ci2bGAr7.mjs → ProgressCircle-CHorY4JG.mjs} +1 -1
  123. package/dist/{PulseSurvey-C0VU1HW2.mjs → PulseSurvey-BUx1cs8c.mjs} +1 -1
  124. package/dist/{PushPin-BFykHmxD.mjs → PushPin-Bl-MTpSH.mjs} +1 -1
  125. package/dist/{Recognition-CpPAfSox.mjs → Recognition-Dpqz0ZRM.mjs} +1 -1
  126. package/dist/{Recognition-E-TCB_c1.mjs → Recognition-sM2fqvV2.mjs} +1 -1
  127. package/dist/{Retention-DYx4I6PR.mjs → Retention-C3USMai6.mjs} +1 -1
  128. package/dist/{Rewards-BSXeTKxB.mjs → Rewards-B1GwvsKs.mjs} +1 -1
  129. package/dist/{Rewards-G9x9ybpA.mjs → Rewards-C60OKVbp.mjs} +1 -1
  130. package/dist/{RewardsCatalog-DGZC_a_l.mjs → RewardsCatalog-Z-TdQb17.mjs} +1 -1
  131. package/dist/{Roadmap-rOH8TVpD.mjs → Roadmap-B5u31Opg.mjs} +1 -1
  132. package/dist/{Search-kt_DTRUm.mjs → Search-DFVKMffg.mjs} +1 -1
  133. package/dist/{Security-CCH4Obdc.mjs → Security-C2mb9Cln.mjs} +1 -1
  134. package/dist/{SendRecognition-ix6HhN2p.mjs → SendRecognition-1T-97Btc.mjs} +1 -1
  135. package/dist/{ShareLink-C_Wm9q1X.mjs → ShareLink-C1_XcyaC.mjs} +1 -1
  136. package/dist/{Skill-bnmQ6O1D.mjs → Skill-DoAgBzE4.mjs} +1 -1
  137. package/dist/{Skills-CpUnEeij.mjs → Skills-qlJ3nma9.mjs} +1 -1
  138. package/dist/{Smiley-ji7zcV_H.mjs → Smiley-nnpU-0ue.mjs} +1 -1
  139. package/dist/{Stop-BvrZ2DyD.mjs → Stop-ChvuC9fB.mjs} +1 -1
  140. package/dist/{Survey-DGn694kU.mjs → Survey-CT1_iEkv.mjs} +1 -1
  141. package/dist/{Surveys-DBmr1EY2.mjs → Surveys-pPZx4gCO.mjs} +1 -1
  142. package/dist/{SyncUps-BGD4AL1O.mjs → SyncUps-DDG2_r81.mjs} +1 -1
  143. package/dist/{Syncs-DzwT8Zl9.mjs → Syncs-C1wBX6zQ.mjs} +1 -1
  144. package/dist/{TalentReview-CYCi0Pfq.mjs → TalentReview-BMazLxIY.mjs} +1 -1
  145. package/dist/{TalentReview-CZGCMabH.mjs → TalentReview-CzhQjDzw.mjs} +1 -1
  146. package/dist/{TalentReviewInsights-BYq8FfM-.mjs → TalentReviewInsights-iyuyNgh3.mjs} +1 -1
  147. package/dist/{TaskCompleted-PS0-7GS9.mjs → TaskCompleted-SXlcrovA.mjs} +1 -1
  148. package/dist/{Team-BS8wfJlH.mjs → Team-C1-MUkGU.mjs} +1 -1
  149. package/dist/{Teams-yebs_v56.mjs → Teams-D-CgliwO.mjs} +1 -1
  150. package/dist/{TextBold--J6OhQPP.mjs → TextBold-Bd7OKcKE.mjs} +1 -1
  151. package/dist/{TextBulletList-DWA2R0Ya.mjs → TextBulletList-94XmPZh6.mjs} +1 -1
  152. package/dist/{TextInput-Cxjbqshr.mjs → TextInput-sPdVxXb5.mjs} +1 -1
  153. package/dist/{TextItalic-B64o8-rz.mjs → TextItalic-BUHexLOp.mjs} +1 -1
  154. package/dist/{TextNumberList-3NoUbocI.mjs → TextNumberList-DXV4vN1s.mjs} +1 -1
  155. package/dist/{TextUnderline-DHT7rFDA.mjs → TextUnderline-kBi9pXdb.mjs} +1 -1
  156. package/dist/{Toggle-DdyJu2L7.mjs → Toggle-CrG9IpKI.mjs} +1 -1
  157. package/dist/{Translate-DPPutGTv.mjs → Translate-K8IprFUP.mjs} +1 -1
  158. package/dist/{Trash-D_gEc2ZV.mjs → Trash-xgZLkUKt.mjs} +1 -1
  159. package/dist/{TrendDown-UmVIl1IK.mjs → TrendDown-BVJF5DcQ.mjs} +1 -1
  160. package/dist/{TrendUp-CxY6Gj6W.mjs → TrendUp-DROSp6XF.mjs} +1 -1
  161. package/dist/{Undo-BrwKHtmz.mjs → Undo-BvZpdKaQ.mjs} +1 -1
  162. package/dist/{Unplugged-BrNUn6if.mjs → Unplugged-BWZFofg4.mjs} +1 -1
  163. package/dist/{UpDownCaret-CQOb7cGR.mjs → UpDownCaret-DB-azao_.mjs} +1 -1
  164. package/dist/{VerticalLine-DJInWsnn.mjs → VerticalLine-C0OPBcFR.mjs} +1 -1
  165. package/dist/{Warning-BKs6vl-u.mjs → Warning-CiV1twpd.mjs} +1 -1
  166. package/dist/{WarningNoOutline-Bt8ko0ok.mjs → WarningNoOutline-DmVAp4gp.mjs} +1 -1
  167. package/dist/{YesAnd-sIcdK5Ky.mjs → YesAnd-BSE8AjCQ.mjs} +1 -1
  168. package/dist/{emoji-ll5MkJbw.mjs → emoji-BwKmEVKB.mjs} +1 -1
  169. package/dist/{react-apexcharts.min-JTUXZ6fg.mjs → react-apexcharts.min-CWrYSFHG.mjs} +1 -1
  170. package/dist/react.es.js +1 -1
  171. package/dist/react.umd.js +1 -1
  172. package/dist/{reactComponent-CjMd89_c.mjs → reactComponent-D0515gu0.mjs} +3269 -3269
  173. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { s as gs, r as ma, b as fs, g as ps } from "./reactComponent-CjMd89_c.mjs";
1
+ import { s as gs, r as ma, b as fs, g as ps } from "./reactComponent-D0515gu0.mjs";
2
2
  import xs from "react";
3
3
  function bs(o, e) {
4
4
  for (var t = 0; t < e.length; t++) {
package/dist/react.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as o, u as e, v as a, t as n, w as i, B as g, z as A, y as p, x as u } from "./reactComponent-CjMd89_c.mjs";
1
+ import { A as o, u as e, v as a, t as n, w as i, B as g, z as A, y as p, x as u } from "./reactComponent-D0515gu0.mjs";
2
2
  export {
3
3
  o as AiAssistant,
4
4
  e as AiAssistantSettingsComponent,
package/dist/react.umd.js CHANGED
@@ -303,7 +303,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
303
303
 
304
304
  `),tr):"";class NdJson{static parse(er){return er.trim().split(`
305
305
  `).map(ir=>JSON.parse(ir))}static stringify(er){return er.map(rr=>JSON.stringify(rr)).join(`
306
- `)}}const config={kazooUrlStrategy:tr=>tr,llmCallUrlStrategy:tr=>tr,pulseUrlStrategy:tr=>tr,pulseBearerTokenStrategy:()=>null,screenshotMainContentSelector:"#root",structuredResponseUrlStrategy:tr=>tr};function getSynthesizeUrl(){return config.llmCallUrlStrategy("/api/api-ai-assistant/v1/tts")}function getTranscribeUrl(){return config.llmCallUrlStrategy("/api/api-ai-assistant/v1/stt")}function getLlmCallUrl(){return config.llmCallUrlStrategy("/api/api-ai-assistant/v1/chat")}function getStructuredResponseUrl(){return config.structuredResponseUrlStrategy("/api/api-ai-assistant/v1/structured-response")}function getKazooUrl(tr){return config.kazooUrlStrategy(tr)}function getPulseUrl(tr){return config.pulseUrlStrategy(tr)}function getPulseBearerToken(){return config.pulseBearerTokenStrategy()}function getScreenshotMainContentSelector(){return config.screenshotMainContentSelector}function setScreenshotMainContentSelector(tr){config.screenshotMainContentSelector=tr}function setKazooUrlStrategy(tr){config.kazooUrlStrategy=tr}function setLlmCallUrlStrategy(tr){config.llmCallUrlStrategy=tr}function setPulseUrlStrategy(tr){config.pulseUrlStrategy=tr}function setPulseBearerTokenStrategy(tr){config.pulseBearerTokenStrategy=tr}function setStructuredResponseUrlStrategy(tr){config.structuredResponseUrlStrategy=tr}const config$1=Object.freeze(Object.defineProperty({__proto__:null,getKazooUrl,getLlmCallUrl,getPulseBearerToken,getPulseUrl,getScreenshotMainContentSelector,getStructuredResponseUrl,getSynthesizeUrl,getTranscribeUrl,setKazooUrlStrategy,setLlmCallUrlStrategy,setPulseBearerTokenStrategy,setPulseUrlStrategy,setScreenshotMainContentSelector,setStructuredResponseUrlStrategy},Symbol.toStringTag,{value:"Module"}));async function getChatCompletion({model:tr,temperature:er,stream:rr,messages:ir,tools:ar,onChunk:nr,onError:or,onComplete:lr,systemInstruction:fr}){var cr;const dr=getPulseBearerToken();try{const ur=await fetch(getLlmCallUrl(),{method:"POST",body:JSON.stringify({model:tr,temperature:er,stream:rr,messages:ir,tools:ar,systemInstruction:fr}),credentials:dr?void 0:"include",headers:{"Content-Type":"application/json",Accept:rr?"text/event-stream":"application/json",...dr?{Authorization:`Bearer ${dr}`}:{}}});if(!ur||!ur.ok)throw new Error("Unable to connect to LLM API. Please try again.");if(rr){const hr=(cr=ur.body)==null?void 0:cr.getReader();if(!hr)throw new Error("Unexpected client error. Response body reader not available.");const gr=new TextDecoder,_r=[],pr=nr||(Fr=>{_r.push(Fr)}),mr=1e4;for(;mr>0;){const{done:Fr,value:br}=await hr.read();if(Fr)break;const yr=gr.decode(br),xr=NdJson.parse(yr);for(const wr of xr)pr(wr)}return lr==null||lr(),_r}return(await ur.json()).parts}catch(ur){const sr=ur instanceof Error?ur:new Error("Unexpected error calling LLM API");throw or==null||or(sr),sr}}var Voice=(tr=>(tr.AOEDE="Aoede",tr.PUCK="Puck",tr.CHARON="Charon",tr.KORE="Kore",tr.FENRIR="Fenrir",tr.LEDA="Leda",tr.ORUS="Orus",tr.ZEPHYR="Zephyr",tr))(Voice||{});async function synthesizeText(tr,er){const rr=getPulseBearerToken(),ir=await fetch(getSynthesizeUrl(),{method:"POST",body:JSON.stringify({text:tr,voice:er}),credentials:rr?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...rr?{Authorization:`Bearer ${rr}`}:{}}});if(!ir||!ir.ok)throw new Error("Unable to connect to LLM API. Please try again.");const ar=await ir.json();if(!ar.synthesis)throw new Error("No synthesis data received.");return ar.synthesis}async function transcribeAudio(tr){const er=getPulseBearerToken(),rr=await fetch(getTranscribeUrl(),{method:"POST",body:JSON.stringify({audio:tr}),credentials:er?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...er?{Authorization:`Bearer ${er}`}:{}}});if(!rr||!rr.ok)throw new Error("Unable to connect to LLM API. Please try again.");const ir=await rr.json();if(!ir.transcription)throw new Error("No transcription data received.");return ir.transcription}function useAiAssistantSession({model:tr,initialMessages:er,temperature:rr,onAfterLlmCall:ir,onBeforeLlmCall:ar,onError:nr,tools:or,onChunkAdded:lr,systemInstruction:fr,onLlmTextReply:dr}={}){const[cr,ur]=React.useState(!1),[sr,hr]=React.useState(!1),[gr,_r]=React.useState(()=>(er==null?void 0:er.map(kr=>({...kr,timestamp:coalesce(kr.timestamp,new Date)})))??[]),[pr,mr]=React.useState(null),Fr=React.useRef([]),br=React.useRef({onAfterLlmCall:ir,onBeforeLlmCall:ar,onError:nr,tools:or,onLlmTextReply:dr});br.current={onAfterLlmCall:ir,onBeforeLlmCall:ar,onError:nr,tools:or,onLlmTextReply:dr};const yr=React.useCallback(async kr=>await transcribeAudio(kr),[]),xr=React.useCallback(async kr=>await synthesizeText(kr),[]),wr=React.useCallback(async kr=>{var Sr,Pr;mr(null);try{br.current.onBeforeLlmCall&&br.current.onBeforeLlmCall()}catch(Ir){Fr.current.push({time:new Date,message:"Error calling onBeforeLlmCall",data:Ir,level:"error"})}let Dr;try{fr&&(Dr=await fr())}catch(Ir){Fr.current.push({time:new Date,message:"Error getting system instruction",data:Ir,level:"error"}),(Pr=(Sr=br.current).onError)==null||Pr.call(Sr,Ir)}ur(!0);try{const Ir={type:"text",text:""},Br=[],Tr=[...kr];return _r(Tr),await getChatCompletion({model:tr,temperature:rr,stream:!0,messages:kr.filter(Ar=>!Ar.filterFromApiCalls),tools:or,systemInstruction:Dr,onChunk:Ar=>{Ar.type==="text"?Ir.text+=Ar.text:Ar.type==="toolCall"&&Br.push(Ar),_r(Lr=>{var qr;const Mr=[...Lr];return((qr=Mr[Mr.length-1])==null?void 0:qr.role)!=="model"&&Mr.push({role:"model",parts:[],timestamp:new Date}),Mr[Mr.length-1].parts=[...Br,...Ir.text?[Ir]:[]],lr&&lr(),Mr})},onError:Ar=>{var Mr,qr;const Lr=composeSimpleFunctions(getClosureFor(mr,null),getClosureFor(ur,!0),getClosureFor(wr,kr));ur(!1),Fr.current.push({time:new Date,message:"Error calling LLM API",data:Ar,level:"error"}),mr({message:jsxRuntimeExports.jsx(ConnectionError,{retry:Lr}),retry:Lr}),(qr=(Mr=br.current).onError)==null||qr.call(Mr,Ar)},onComplete:()=>{safelyInvokeUserCallback({condition:!!br.current.onAfterLlmCall,setMessages:_r,callbackToInvoke:br.current.onAfterLlmCall,callbackName:"onAfterLlmCall",debugInfo:Fr,onError:br.current.onError}),safelyInvokeUserCallback({condition:!!br.current.onLlmTextReply,setMessages:_r,callbackToInvoke:br.current.onLlmTextReply,callbackName:"onLlmTextReply",debugInfo:Fr,onError:br.current.onError}),handlePendingToolCalls({toolCalls:Br,setMessages:_r,sendMessages:wr,propRefs:br,debugInfo:Fr})}}),!0}catch{return!1}finally{ur(!1)}},[tr,rr]),vr=React.useCallback(async kr=>{const Dr=[...gr],Sr={role:"user",parts:[{type:"text",text:kr}],timestamp:new Date};Er(Sr),await wr([...Dr,Sr])||(Fr.current.push({time:new Date,message:"Error sending message. Reverting to original messages",data:Dr,level:"error"}),_r(Dr))},[gr]),Er=React.useCallback(kr=>{_r([...gr,kr])},[gr]);return{isLoading:cr,messages:gr,setMessages:_r,isVoiceEnabled:sr,setIsVoiceEnabled:hr,getSpeech:xr,getTranscription:yr,debugInfo:Fr.current,addMessage:Er,sendUserMessage:vr,connectionError:pr}}async function handlePendingToolCalls({toolCalls:tr,sendMessages:er,setMessages:rr,propRefs:ir,debugInfo:ar}){var lr,fr,dr;if(tr.length===0)return;const nr=[];for(const cr of tr){const ur=(lr=ir.current.tools)==null?void 0:lr.find(hr=>hr.name===cr.toolName);if(!ur){(dr=(fr=ir.current).onError)==null||dr.call(fr,new Error(`Tool ${cr.toolName} not found`)),ar.current.push({time:new Date,message:`Tool ${cr.toolName} not found`,data:{toolCall:cr,tools:ir.current.tools},level:"error"});continue}const sr=`${Date.now()}-${Math.random()}`;try{rr(pr=>{const mr=[...pr];return mr.push({role:"tool",parts:[cr],id:sr,timestamp:new Date,isPending:!0,filterFromApiCalls:!0}),mr}),ar.current.push({time:new Date,level:"info",message:"Fulfilling tool call",data:{toolCall:cr}});const hr=Date.now(),gr=await ur.fulfill(cr.args),_r=Date.now();typeof gr=="string"?nr.push({type:"toolResult",toolName:cr.toolName,result:gr}):(nr.push({type:"toolResult",toolName:cr.toolName,result:`Tool ${cr.toolName} returned the following file`}),nr.push({type:"file",fileUri:gr==null?void 0:gr.fileUri,mimeType:gr==null?void 0:gr.mimeType})),ar.current.push({time:new Date,level:"info",message:"Tool call fulfilled",data:{toolCall:cr,durationMs:_r-hr}})}catch(hr){ar.current.push({time:new Date,message:"Error calling tool",level:"error",data:{toolCall:cr,error:{message:hr.message,stack:hr.stack}}}),nr.push({type:"toolResult",toolName:cr.toolName,result:{error:{message:hr.message,stack:hr.stack}}})}finally{rr(hr=>hr.map(gr=>gr.id===sr?{...gr,isPending:!1}:gr))}}const or={role:"tool",parts:nr};rr(cr=>{const ur=[...cr,or];return er(ur),ur})}function ConnectionError({retry:tr}){const er=()=>{window.location.reload()};return jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"24px",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Spacer,{}),jsxRuntimeExports.jsxs(Flex,{direction:"row",gap:"8px",alignItems:"center",children:[jsxRuntimeExports.jsx(Icon,{icon:"warning",color:"#ff0000"}),jsxRuntimeExports.jsxs(Text,{children:["Error calling LLM API. If this persists, try"," ",jsxRuntimeExports.jsx("a",{href:"#",onClick:er,"data-testid":"connection-error-refresh-page",children:"refreshing the page"}),"."]})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"flex-end",gap:"8px",children:[jsxRuntimeExports.jsx(Button,{onClick:er,variant:"system",size:"small","data-testid":"connection-error-refresh-page-button",children:"Refresh Page"}),jsxRuntimeExports.jsx(Button,{onClick:tr,variant:"primary","data-testid":"connection-error-retry-button",children:"Retry"})]})]})}function safelyInvokeUserCallback({condition:tr,setMessages:er,callbackToInvoke:rr,callbackName:ir,debugInfo:ar,onError:nr}){!tr||!rr||(ar.current.push({time:new Date,message:`Calling ${ir}`,level:"info"}),er(or=>{try{return rr(or),or}catch(lr){ar.current.push({time:new Date,message:`Error calling ${ir}`,data:lr,level:"error"}),nr&&nr(lr)}finally{ar.current.push({time:new Date,message:`Finished calling ${ir}`,level:"info"})}return or}))}function createMessageHandlers({appendMessageToConversation:tr,errorToast:er,getConversationId:rr}){const ir=appendMessageFactory(tr,er,rr),ar=ir(fr=>({role:"MODEL",messageText:fr})),nr=ir((fr,dr)=>({role:"TOOL",messageText:fr,metadata:{toolName:dr}})),or=ir(fr=>({role:"USER",messageText:fr}));return{appendAssistantMessage:ar,appendToolMessage:nr,appendUserMessage:or,handleGeneratedMessages:fr=>{if(!rr())return;fr.filter(ur=>!ur.id).forEach(ur=>{if(ur.role==="model"){const sr=ur.parts.find(hr=>hr.type==="text");sr&&"text"in sr&&(ar(sr.text),ur.id=`saved-${Date.now()}`)}else if(ur.role==="tool"){const sr=ur.parts.find(hr=>hr.type==="toolResult");sr&&"result"in sr&&"toolName"in sr&&(nr(sr.result,sr.toolName),ur.id=`saved-${Date.now()}`)}})}}}function appendMessageFactory(tr,er,rr){return function(ar){return function(...or){const lr=rr();if(lr)try{return tr({variables:{input:{conversationId:lr,message:ar(...or)}}})}catch(fr){er(fr.message)}else er("No conversation ID available");return!1}}}const getConversationsByDateRange=(tr,er,rr=0)=>{const ir=new Date;return tr.filter(ar=>{const nr=ar.updatedAt instanceof Date?ar.updatedAt:new Date(ar.updatedAt||new Date),or=Math.abs(ir.getTime()-nr.getTime()),lr=Math.ceil(or/(1e3*60*60*24));return(er===null||lr<=er)&&lr>rr})},getTruncatedTitle=tr=>tr.length>30?`${tr.substring(0,30)}...`:tr,generateChatTitle=async tr=>{try{const er=await getChatCompletion({model:"small",temperature:.25,stream:!1,messages:[{role:"user",parts:[{type:"text",text:`Generate a concise 3-4 word title for this chat based on the first message. The title should be descriptive but brief. Do not use any punctuation. Return only the title, nothing else.
306
+ `)}}const config={kazooUrlStrategy:tr=>tr,llmCallUrlStrategy:tr=>tr,pulseUrlStrategy:tr=>tr,pulseBearerTokenStrategy:()=>null,screenshotMainContentSelector:"#root",structuredResponseUrlStrategy:tr=>tr};function getSynthesizeUrl(){return config.llmCallUrlStrategy("/api/api-ai-assistant/v1/tts")}function getTranscribeUrl(){return config.llmCallUrlStrategy("/api/api-ai-assistant/v1/stt")}function getLlmCallUrl(){return config.llmCallUrlStrategy("/api/api-ai-assistant/v1/chat")}function getStructuredResponseUrl(){return config.structuredResponseUrlStrategy("/api/api-ai-assistant/v1/structured-response")}function getKazooUrl(tr){return config.kazooUrlStrategy(tr)}function getPulseUrl(tr){return config.pulseUrlStrategy(tr)}function getPulseBearerToken(){return config.pulseBearerTokenStrategy()}function getScreenshotMainContentSelector(){return config.screenshotMainContentSelector}function setScreenshotMainContentSelector(tr){config.screenshotMainContentSelector=tr}function setKazooUrlStrategy(tr){config.kazooUrlStrategy=tr}function setLlmCallUrlStrategy(tr){config.llmCallUrlStrategy=tr}function setPulseUrlStrategy(tr){config.pulseUrlStrategy=tr}function setPulseBearerTokenStrategy(tr){config.pulseBearerTokenStrategy=tr}function setStructuredResponseUrlStrategy(tr){config.structuredResponseUrlStrategy=tr}const config$1=Object.freeze(Object.defineProperty({__proto__:null,getKazooUrl,getLlmCallUrl,getPulseBearerToken,getPulseUrl,getScreenshotMainContentSelector,getStructuredResponseUrl,getSynthesizeUrl,getTranscribeUrl,setKazooUrlStrategy,setLlmCallUrlStrategy,setPulseBearerTokenStrategy,setPulseUrlStrategy,setScreenshotMainContentSelector,setStructuredResponseUrlStrategy},Symbol.toStringTag,{value:"Module"}));async function getChatCompletion({model:tr,temperature:er,stream:rr,messages:ir,tools:ar,onChunk:nr,onError:or,onComplete:lr,systemInstruction:fr}){var cr;const dr=getPulseBearerToken();try{const ur=await fetch(getLlmCallUrl(),{method:"POST",body:JSON.stringify({model:tr,temperature:er,stream:rr,messages:ir,tools:ar,systemInstruction:fr}),credentials:dr?void 0:"include",headers:{"Content-Type":"application/json",Accept:rr?"text/event-stream":"application/json",...dr?{Authorization:`Bearer ${dr}`}:{}}});if(!ur||!ur.ok)throw new Error("Unable to connect to LLM API. Please try again.");if(rr){const hr=(cr=ur.body)==null?void 0:cr.getReader();if(!hr)throw new Error("Unexpected client error. Response body reader not available.");const gr=new TextDecoder,_r=[],pr=nr||(Fr=>{_r.push(Fr)}),mr=1e4;for(;mr>0;){const{done:Fr,value:br}=await hr.read();if(Fr)break;const yr=gr.decode(br),xr=NdJson.parse(yr);for(const wr of xr)pr(wr)}return lr==null||lr(),_r}return(await ur.json()).parts}catch(ur){const sr=ur instanceof Error?ur:new Error("Unexpected error calling LLM API");throw or==null||or(sr),sr}}var Voice=(tr=>(tr.AOEDE="Aoede",tr.PUCK="Puck",tr.CHARON="Charon",tr.KORE="Kore",tr.FENRIR="Fenrir",tr.LEDA="Leda",tr.ORUS="Orus",tr.ZEPHYR="Zephyr",tr))(Voice||{});async function synthesizeText(tr,er){const rr=getPulseBearerToken(),ir=await fetch(getSynthesizeUrl(),{method:"POST",body:JSON.stringify({text:tr,voice:er}),credentials:rr?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...rr?{Authorization:`Bearer ${rr}`}:{}}});if(!ir||!ir.ok)throw new Error("Unable to connect to LLM API. Please try again.");const ar=await ir.json();if(!ar.synthesis)throw new Error("No synthesis data received.");return ar.synthesis}async function transcribeAudio(tr){const er=getPulseBearerToken(),rr=await fetch(getTranscribeUrl(),{method:"POST",body:JSON.stringify({audio:tr}),credentials:er?void 0:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...er?{Authorization:`Bearer ${er}`}:{}}});if(!rr||!rr.ok)throw new Error("Unable to connect to LLM API. Please try again.");const ir=await rr.json();if(!ir.transcription)throw new Error("No transcription data received.");return ir.transcription}function useAiAssistantSession({model:tr,initialMessages:er,temperature:rr,onAfterLlmCall:ir,onBeforeLlmCall:ar,onError:nr,tools:or,onChunkAdded:lr,systemInstruction:fr,onLlmTextReply:dr}={}){const[cr,ur]=React.useState(!1),[sr,hr]=React.useState(!1),[gr,_r]=React.useState(()=>(er==null?void 0:er.map(kr=>({...kr,timestamp:coalesce(kr.timestamp,new Date)})))??[]),[pr,mr]=React.useState(null),Fr=React.useRef([]),br=React.useRef({onAfterLlmCall:ir,onBeforeLlmCall:ar,onError:nr,tools:or,onLlmTextReply:dr});br.current={onAfterLlmCall:ir,onBeforeLlmCall:ar,onError:nr,tools:or,onLlmTextReply:dr};const yr=React.useCallback(async kr=>await transcribeAudio(kr),[]),xr=React.useCallback(async kr=>await synthesizeText(kr),[]),wr=React.useCallback(async kr=>{var Sr,Pr;mr(null);try{br.current.onBeforeLlmCall&&br.current.onBeforeLlmCall()}catch(Ir){Fr.current.push({time:new Date,message:"Error calling onBeforeLlmCall",data:Ir,level:"error"})}let Dr;try{fr&&(Dr=await fr())}catch(Ir){Fr.current.push({time:new Date,message:"Error getting system instruction",data:Ir,level:"error"}),(Pr=(Sr=br.current).onError)==null||Pr.call(Sr,Ir)}ur(!0);try{const Ir={type:"text",text:""},Br=[],Tr=[...kr];return _r(Tr),await getChatCompletion({model:tr,temperature:rr,stream:!0,messages:kr.filter(Ar=>!Ar.filterFromApiCalls),tools:or,systemInstruction:Dr,onChunk:Ar=>{Ar.type==="text"?Ir.text+=Ar.text:Ar.type==="toolCall"&&Br.push(Ar),_r(Lr=>{var qr;const Mr=[...Lr];return((qr=Mr[Mr.length-1])==null?void 0:qr.role)!=="model"&&Mr.push({role:"model",parts:[],timestamp:new Date}),Mr[Mr.length-1].parts=[...Br,...Ir.text?[Ir]:[]],lr&&lr(),Mr})},onError:Ar=>{var Mr,qr;const Lr=composeSimpleFunctions(getClosureFor(mr,null),getClosureFor(ur,!0),getClosureFor(wr,kr));ur(!1),Fr.current.push({time:new Date,message:"Error calling LLM API",data:Ar,level:"error"}),mr({message:jsxRuntimeExports.jsx(ConnectionError,{retry:Lr}),retry:Lr}),(qr=(Mr=br.current).onError)==null||qr.call(Mr,Ar)},onComplete:()=>{safelyInvokeUserCallback({condition:!!br.current.onAfterLlmCall,setMessages:_r,callbackToInvoke:br.current.onAfterLlmCall,callbackName:"onAfterLlmCall",debugInfo:Fr,onError:br.current.onError}),safelyInvokeUserCallback({condition:!!br.current.onLlmTextReply,setMessages:_r,callbackToInvoke:br.current.onLlmTextReply,callbackName:"onLlmTextReply",debugInfo:Fr,onError:br.current.onError}),handlePendingToolCalls({toolCalls:Br,setMessages:_r,sendMessages:wr,propRefs:br,debugInfo:Fr})}}),!0}catch{return!1}finally{ur(!1)}},[tr,rr]),vr=React.useCallback(async kr=>{const Dr=[...gr],Sr={role:"user",parts:[{type:"text",text:kr}],timestamp:new Date};Er(Sr),await wr([...Dr,Sr])||(Fr.current.push({time:new Date,message:"Error sending message. Reverting to original messages",data:Dr,level:"error"}),_r(Dr))},[gr]),Er=React.useCallback(kr=>{_r([...gr,kr])},[gr]);return{isLoading:cr,messages:gr,setMessages:_r,isVoiceEnabled:sr,setIsVoiceEnabled:hr,getSpeech:xr,getTranscription:yr,debugInfo:Fr.current,addMessage:Er,sendUserMessage:vr,connectionError:pr}}async function handlePendingToolCalls({toolCalls:tr,sendMessages:er,setMessages:rr,propRefs:ir,debugInfo:ar}){var lr,fr,dr,cr;if(tr.length===0)return;const nr=[];for(const ur of tr){const sr=(lr=ir.current.tools)==null?void 0:lr.find(gr=>gr.name===ur.toolName);if(!sr){(dr=(fr=ir.current).onError)==null||dr.call(fr,new Error(`Tool ${ur.toolName} not found`)),ar.current.push({time:new Date,message:`Tool ${ur.toolName} not found`,data:{toolCall:ur,tools:ir.current.tools},level:"error"});continue}const hr=`${Date.now()}-${Math.random()}`;try{rr(Fr=>{const br=[...Fr];return br.push({role:"tool",parts:[ur],id:hr,timestamp:new Date,isPending:!0,filterFromApiCalls:!0}),br}),ar.current.push({time:new Date,level:"info",message:"Fulfilling tool call",data:{toolCall:ur}});const gr=Date.now(),_r=coalesce((cr=ur.args)==null?void 0:cr.args,ur.args),pr=await sr.fulfill(_r),mr=Date.now();typeof pr=="string"?nr.push({type:"toolResult",toolName:ur.toolName,result:pr}):(nr.push({type:"toolResult",toolName:ur.toolName,result:`Tool ${ur.toolName} returned the following file`}),nr.push({type:"file",fileUri:pr==null?void 0:pr.fileUri,mimeType:pr==null?void 0:pr.mimeType})),ar.current.push({time:new Date,level:"info",message:"Tool call fulfilled",data:{toolCall:ur,durationMs:mr-gr}})}catch(gr){ar.current.push({time:new Date,message:"Error calling tool",level:"error",data:{toolCall:ur,error:{message:gr.message,stack:gr.stack}}}),nr.push({type:"toolResult",toolName:ur.toolName,result:{error:{message:gr.message,stack:gr.stack}}})}finally{rr(gr=>gr.map(_r=>_r.id===hr?{..._r,isPending:!1}:_r))}}const or={role:"tool",parts:nr};rr(ur=>{const sr=[...ur,or];return er(sr),sr})}function ConnectionError({retry:tr}){const er=()=>{window.location.reload()};return jsxRuntimeExports.jsxs(Flex,{direction:"column",gap:"24px",children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(Spacer,{}),jsxRuntimeExports.jsxs(Flex,{direction:"row",gap:"8px",alignItems:"center",children:[jsxRuntimeExports.jsx(Icon,{icon:"warning",color:"#ff0000"}),jsxRuntimeExports.jsxs(Text,{children:["Error calling LLM API. If this persists, try"," ",jsxRuntimeExports.jsx("a",{href:"#",onClick:er,"data-testid":"connection-error-refresh-page",children:"refreshing the page"}),"."]})]}),jsxRuntimeExports.jsxs(Flex,{justifyContent:"flex-end",gap:"8px",children:[jsxRuntimeExports.jsx(Button,{onClick:er,variant:"system",size:"small","data-testid":"connection-error-refresh-page-button",children:"Refresh Page"}),jsxRuntimeExports.jsx(Button,{onClick:tr,variant:"primary","data-testid":"connection-error-retry-button",children:"Retry"})]})]})}function safelyInvokeUserCallback({condition:tr,setMessages:er,callbackToInvoke:rr,callbackName:ir,debugInfo:ar,onError:nr}){!tr||!rr||(ar.current.push({time:new Date,message:`Calling ${ir}`,level:"info"}),er(or=>{try{return rr(or),or}catch(lr){ar.current.push({time:new Date,message:`Error calling ${ir}`,data:lr,level:"error"}),nr&&nr(lr)}finally{ar.current.push({time:new Date,message:`Finished calling ${ir}`,level:"info"})}return or}))}function createMessageHandlers({appendMessageToConversation:tr,errorToast:er,getConversationId:rr}){const ir=appendMessageFactory(tr,er,rr),ar=ir(fr=>({role:"MODEL",messageText:fr})),nr=ir((fr,dr)=>({role:"TOOL",messageText:fr,metadata:{toolName:dr}})),or=ir(fr=>({role:"USER",messageText:fr}));return{appendAssistantMessage:ar,appendToolMessage:nr,appendUserMessage:or,handleGeneratedMessages:fr=>{if(!rr())return;fr.filter(ur=>!ur.id).forEach(ur=>{if(ur.role==="model"){const sr=ur.parts.find(hr=>hr.type==="text");sr&&"text"in sr&&(ar(sr.text),ur.id=`saved-${Date.now()}`)}else if(ur.role==="tool"){const sr=ur.parts.find(hr=>hr.type==="toolResult");sr&&"result"in sr&&"toolName"in sr&&(nr(sr.result,sr.toolName),ur.id=`saved-${Date.now()}`)}})}}}function appendMessageFactory(tr,er,rr){return function(ar){return function(...or){const lr=rr();if(lr)try{return tr({variables:{input:{conversationId:lr,message:ar(...or)}}})}catch(fr){er(fr.message)}else er("No conversation ID available");return!1}}}const getConversationsByDateRange=(tr,er,rr=0)=>{const ir=new Date;return tr.filter(ar=>{const nr=ar.updatedAt instanceof Date?ar.updatedAt:new Date(ar.updatedAt||new Date),or=Math.abs(ir.getTime()-nr.getTime()),lr=Math.ceil(or/(1e3*60*60*24));return(er===null||lr<=er)&&lr>rr})},getTruncatedTitle=tr=>tr.length>30?`${tr.substring(0,30)}...`:tr,generateChatTitle=async tr=>{try{const er=await getChatCompletion({model:"small",temperature:.25,stream:!1,messages:[{role:"user",parts:[{type:"text",text:`Generate a concise 3-4 word title for this chat based on the first message. The title should be descriptive but brief. Do not use any punctuation. Return only the title, nothing else.
307
307
 
308
308
  First message: "${tr}"`}]}]});if(er&&er.length>0){const rr=er[0];if(rr.type==="text")return rr.text.trim()}return"New Chat"}catch(er){return console.error("Error generating chat title:",er),"New Chat"}};function extractSources(tr){var ar;const er=/\[([^\]]+)\]\((https?:\/\/[^")]+)\)(?:\s*\n\s*([^\n]+))?/g,rr=[];let ir;for(;(ir=er.exec(tr))!==null;)rr.push({name:ir[1],url:ir[2],pageInfo:(ar=ir[3])==null?void 0:ar.trim()});return rr}function removeSourcesFromText(tr){return tr.replace(/<?Source[s]*>?[:]?(\s*)((\[[^\]]+\]\([^)]+\)(?:\s*\n\s*[^\n]+)?[, ]*)+)(?:\s*<\/Source[s]*>)?/gi,"")}const styles$6={"ai-assistant-textarea":"AiAssistantComponent-module_ai-assistant-textarea_dJrtB","ai-assistant-popup-container":"AiAssistantComponent-module_ai-assistant-popup-container_OH04M","ai-assistant-chat-history-container":"AiAssistantComponent-module_ai-assistant-chat-history-container_mIJ3y","ai-assistant-chat-history-header":"AiAssistantComponent-module_ai-assistant-chat-history-header_aR6OI","ai-assistant-chat-history-button":"AiAssistantComponent-module_ai-assistant-chat-history-button_Q34D6","conversation-selected":"AiAssistantComponent-module_conversation-selected_-ijIe","ai-assistant-chat-history-button-text":"AiAssistantComponent-module_ai-assistant-chat-history-button-text_cAi5Q","text-updated":"AiAssistantComponent-module_text-updated_bYi3h","textarea-container":"AiAssistantComponent-module_textarea-container_4eE9f","placeholder-content":"AiAssistantComponent-module_placeholder-content_8vmjp","placeholder-text":"AiAssistantComponent-module_placeholder-text_8edUF","messages-scroll-container":"AiAssistantComponent-module_messages-scroll-container_8O6Kb","search-input-label":"AiAssistantComponent-module_search-input-label_06Y-7","search-icon-active":"AiAssistantComponent-module_search-icon-active_XyFr1","ai-assistant-voice-btn-outer":"AiAssistantComponent-module_ai-assistant-voice-btn-outer_eyXW8","ai-assistant-voice-btn-outer--active":"AiAssistantComponent-module_ai-assistant-voice-btn-outer--active_cuUGO","ai-assistant-voice-btn-inner":"AiAssistantComponent-module_ai-assistant-voice-btn-inner_-gPf4","ai-assistant-voice-btn-icon":"AiAssistantComponent-module_ai-assistant-voice-btn-icon_JcZJw","ai-assistant-send-btn":"AiAssistantComponent-module_ai-assistant-send-btn_h2wdX"};var dist$1={},dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(tr,er,rr)=>{if(er&&typeof er.init=="function"&&typeof er.createSessionHandler=="function"){const ir=backends[tr];if(ir===void 0)backends[tr]={backend:er,priority:rr};else{if(ir.priority>rr)return;if(ir.priority===rr&&ir.backend!==er)throw new Error(`cannot register backend "${tr}" using priority ${rr}`)}if(rr>=0){const ar=backendsSortedByPriority.indexOf(tr);ar!==-1&&backendsSortedByPriority.splice(ar,1);for(let nr=0;nr<backendsSortedByPriority.length;nr++)if(backends[backendsSortedByPriority[nr]].priority<=rr){backendsSortedByPriority.splice(nr,0,tr);return}backendsSortedByPriority.push(tr)}return}throw new TypeError("not a valid backend")},resolveBackend=async tr=>{const er=tr.length===0?backendsSortedByPriority:tr,rr=[];for(const ir of er){const ar=backends[ir];if(ar){if(ar.initialized)return ar.backend;if(ar.aborted)continue;const nr=!!ar.initPromise;try{return nr||(ar.initPromise=ar.backend.init()),await ar.initPromise,ar.initialized=!0,ar.backend}catch(or){nr||rr.push({name:ir,err:or}),ar.aborted=!0}finally{delete ar.initPromise}}}throw new Error(`no available backend found. ERR: ${rr.map(ir=>`[${ir.name}] ${ir.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(er){if(er!==void 0){if(typeof er!="string"||["verbose","info","warning","error","fatal"].indexOf(er)===-1)throw new Error(`Unsupported logging level: ${er}`);this.logLevelInternal=er}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64")),isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=tr=>{let er=1;for(let rr=0;rr<tr.length;rr++){const ir=tr[rr];if(typeof ir!="number"||!Number.isSafeInteger(ir))throw new TypeError(`dims[${rr}] must be an integer, got: ${ir}`);if(ir<0)throw new RangeError(`dims[${rr}] must be a non-negative integer, got: ${ir}`);er*=ir}return er};let Tensor$1=class Zo{constructor(er,rr,ir){let ar,nr,or;if(typeof er=="string")if(ar=er,or=ir,er==="string"){if(!Array.isArray(rr))throw new TypeError("A string tensor's data must be a string array.");nr=rr}else{const fr=NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(er);if(fr===void 0)throw new TypeError(`Unsupported tensor type: ${er}.`);if(Array.isArray(rr))nr=fr.from(rr);else if(rr instanceof fr)nr=rr;else throw new TypeError(`A ${ar} tensor's data must be type of ${fr}`)}else if(or=rr,Array.isArray(er)){if(er.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const fr=typeof er[0];if(fr==="string")ar="string",nr=er;else if(fr==="boolean")ar="bool",nr=Uint8Array.from(er);else throw new TypeError(`Invalid element type of data array: ${fr}.`)}else{const fr=NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(er.constructor);if(fr===void 0)throw new TypeError(`Unsupported type for tensor data: ${er.constructor}.`);ar=fr,nr=er}if(or===void 0)or=[nr.length];else if(!Array.isArray(or))throw new TypeError("A tensor's dims must be a number array");const lr=calculateSize(or);if(lr!==nr.length)throw new Error(`Tensor's size(${lr}) does not match data length(${nr.length}).`);this.dims=or,this.type=ar,this.data=nr,this.size=lr}static bufferToTensor(er,rr){if(er===void 0)throw new Error("Image buffer must be defined");if(rr.height===void 0||rr.width===void 0)throw new Error("Image height and width must be defined");const{height:ir,width:ar}=rr,nr=rr.norm;let or,lr;nr===void 0||nr.mean===void 0?or=255:or=nr.mean,nr===void 0||nr.bias===void 0?lr=0:lr=nr.bias;const fr=rr.bitmapFormat!==void 0?rr.bitmapFormat:"RGBA",dr=rr.tensorFormat!==void 0&&rr.tensorFormat!==void 0?rr.tensorFormat:"RGB",cr=ir*ar,ur=dr==="RGBA"?new Float32Array(cr*4):new Float32Array(cr*3);let sr=4,hr=0,gr=1,_r=2,pr=3,mr=0,Fr=cr,br=cr*2,yr=-1;fr==="RGB"&&(sr=3,hr=0,gr=1,_r=2,pr=-1),dr==="RGBA"?yr=cr*3:dr==="RBG"?(mr=0,br=cr,Fr=cr*2):dr==="BGR"&&(br=0,Fr=cr,mr=cr*2);for(let wr=0;wr<cr;wr++,hr+=sr,_r+=sr,gr+=sr,pr+=sr)ur[mr++]=(er[hr]+lr)/or,ur[Fr++]=(er[gr]+lr)/or,ur[br++]=(er[_r]+lr)/or,yr!==-1&&pr!==-1&&(ur[yr++]=(er[pr]+lr)/or);return dr==="RGBA"?new Zo("float32",ur,[1,4,ir,ar]):new Zo("float32",ur,[1,3,ir,ar])}static async fromImage(er,rr){const ir=typeof HTMLImageElement<"u"&&er instanceof HTMLImageElement,ar=typeof ImageData<"u"&&er instanceof ImageData,nr=typeof ImageBitmap<"u"&&er instanceof ImageBitmap,or=typeof String<"u"&&(er instanceof String||typeof er=="string");let lr,fr={};if(ir){const dr=document.createElement("canvas"),cr=dr.getContext("2d");if(cr!=null){let ur=er.naturalHeight,sr=er.naturalWidth;if(rr!==void 0&&rr.resizedHeight!==void 0&&rr.resizedWidth!==void 0&&(ur=rr.resizedHeight,sr=rr.resizedWidth),rr!==void 0){if(fr=rr,rr.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");if(fr.tensorFormat="RGBA",rr.height!==void 0&&rr.height!==ur)throw new Error("Image input config height doesn't match HTMLImageElement height");if(fr.height=ur,rr.width!==void 0&&rr.width!==sr)throw new Error("Image input config width doesn't match HTMLImageElement width");fr.width=sr}else fr.tensorFormat="RGBA",fr.height=ur,fr.width=sr;dr.width=sr,dr.height=ur,cr.drawImage(er,0,0,sr,ur),lr=cr.getImageData(0,0,sr,ur).data}else throw new Error("Can not access image data")}else if(ar){const dr="RGBA";let cr,ur;if(rr!==void 0&&rr.resizedWidth!==void 0&&rr.resizedHeight!==void 0?(cr=rr.resizedHeight,ur=rr.resizedWidth):(cr=er.height,ur=er.width),rr!==void 0){if(fr=rr,rr.bitmapFormat!==void 0&&rr.bitmapFormat!==dr)throw new Error("Image input config format must be RGBA for ImageData");fr.bitmapFormat="RGBA"}else fr.bitmapFormat="RGBA";if(fr.height=cr,fr.width=ur,rr!==void 0){const sr=document.createElement("canvas");sr.width=ur,sr.height=cr;const hr=sr.getContext("2d");if(hr!=null)hr.putImageData(er,0,0),lr=hr.getImageData(0,0,ur,cr).data;else throw new Error("Can not access image data")}else lr=er.data}else if(nr){if(rr===void 0)throw new Error("Please provide image config with format for Imagebitmap");if(rr.bitmapFormat!==void 0)throw new Error("Image input config format must be defined for ImageBitmap");const dr=document.createElement("canvas").getContext("2d");if(dr!=null){const cr=er.height,ur=er.width;if(dr.drawImage(er,0,0,ur,cr),lr=dr.getImageData(0,0,ur,cr).data,rr!==void 0){if(rr.height!==void 0&&rr.height!==cr)throw new Error("Image input config height doesn't match ImageBitmap height");if(fr.height=cr,rr.width!==void 0&&rr.width!==ur)throw new Error("Image input config width doesn't match ImageBitmap width");fr.width=ur}else fr.height=cr,fr.width=ur;return Zo.bufferToTensor(lr,fr)}else throw new Error("Can not access image data")}else{if(or)return new Promise((dr,cr)=>{const ur=document.createElement("canvas"),sr=ur.getContext("2d");if(!er||!sr)return cr();const hr=new Image;hr.crossOrigin="Anonymous",hr.src=er,hr.onload=()=>{ur.width=hr.width,ur.height=hr.height,sr.drawImage(hr,0,0,ur.width,ur.height);const gr=sr.getImageData(0,0,ur.width,ur.height);if(rr!==void 0){if(rr.height!==void 0&&rr.height!==ur.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(fr.height=ur.height,rr.width!==void 0&&rr.width!==ur.width)throw new Error("Image input config width doesn't match ImageBitmap width");fr.width=ur.width}else fr.height=ur.height,fr.width=ur.width;dr(Zo.bufferToTensor(gr.data,fr))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(lr!==void 0)return Zo.bufferToTensor(lr,fr);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(er){var rr,ir;const ar=document.createElement("canvas").getContext("2d");let nr;if(ar!=null){const or=this.dims[3],lr=this.dims[2],fr=this.dims[1],dr=er!==void 0&&er.format!==void 0?er.format:"RGB",cr=er!==void 0&&((rr=er.norm)===null||rr===void 0?void 0:rr.mean)!==void 0?er.norm.mean:255,ur=er!==void 0&&((ir=er.norm)===null||ir===void 0?void 0:ir.bias)!==void 0?er.norm.bias:0,sr=lr*or;if(er!==void 0){if(er.height!==void 0&&er.height!==lr)throw new Error("Image output config height doesn't match tensor height");if(er.width!==void 0&&er.width!==or)throw new Error("Image output config width doesn't match tensor width");if(er.format!==void 0&&fr===4&&er.format!=="RGBA"||fr===3&&er.format!=="RGB"&&er.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const hr=4;let gr=0,_r=1,pr=2,mr=3,Fr=0,br=sr,yr=sr*2,xr=-1;dr==="RGBA"?(Fr=0,br=sr,yr=sr*2,xr=sr*3):dr==="RGB"?(Fr=0,br=sr,yr=sr*2):dr==="RBG"&&(Fr=0,yr=sr,br=sr*2),nr=ar.createImageData(or,lr);for(let wr=0;wr<lr*or;gr+=hr,_r+=hr,pr+=hr,mr+=hr,wr++)nr.data[gr]=(this.data[Fr++]-ur)*cr,nr.data[_r]=(this.data[br++]-ur)*cr,nr.data[pr]=(this.data[yr++]-ur)*cr,nr.data[mr]=xr===-1?255:(this.data[xr++]-ur)*cr}else throw new Error("Can not access image data");return nr}reshape(er){return new Zo(this.type,this.data,er)}};const Tensor=Tensor$1;let InferenceSession$1=class Rs{constructor(er){this.handler=er}async run(er,rr,ir){const ar={};let nr={};if(typeof er!="object"||er===null||er instanceof Tensor||Array.isArray(er))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let or=!0;if(typeof rr=="object"){if(rr===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(rr instanceof Tensor)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(rr)){if(rr.length===0)throw new TypeError("'fetches' cannot be an empty array.");or=!1;for(const dr of rr){if(typeof dr!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(dr)===-1)throw new RangeError(`'fetches' contains invalid output name: ${dr}.`);ar[dr]=null}if(typeof ir=="object"&&ir!==null)nr=ir;else if(typeof ir<"u")throw new TypeError("'options' must be an object.")}else{let dr=!1;const cr=Object.getOwnPropertyNames(rr);for(const ur of this.outputNames)if(cr.indexOf(ur)!==-1){const sr=rr[ur];(sr===null||sr instanceof Tensor)&&(dr=!0,or=!1,ar[ur]=sr)}if(dr){if(typeof ir=="object"&&ir!==null)nr=ir;else if(typeof ir<"u")throw new TypeError("'options' must be an object.")}else nr=rr}}else if(typeof rr<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const dr of this.inputNames)if(typeof er[dr]>"u")throw new Error(`input '${dr}' is missing in 'feeds'.`);if(or)for(const dr of this.outputNames)ar[dr]=null;const lr=await this.handler.run(er,ar,nr),fr={};for(const dr in lr)Object.hasOwnProperty.call(lr,dr)&&(fr[dr]=new Tensor(lr[dr].type,lr[dr].data,lr[dr].dims));return fr}static async create(er,rr,ir,ar){let nr,or={};if(typeof er=="string"){if(nr=er,typeof rr=="object"&&rr!==null)or=rr;else if(typeof rr<"u")throw new TypeError("'options' must be an object.")}else if(er instanceof Uint8Array){if(nr=er,typeof rr=="object"&&rr!==null)or=rr;else if(typeof rr<"u")throw new TypeError("'options' must be an object.")}else if(er instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&er instanceof SharedArrayBuffer){const ur=er;let sr=0,hr=er.byteLength;if(typeof rr=="object"&&rr!==null)or=rr;else if(typeof rr=="number"){if(sr=rr,!Number.isSafeInteger(sr))throw new RangeError("'byteOffset' must be an integer.");if(sr<0||sr>=ur.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${ur.byteLength}).`);if(hr=er.byteLength-sr,typeof ir=="number"){if(hr=ir,!Number.isSafeInteger(hr))throw new RangeError("'byteLength' must be an integer.");if(hr<=0||sr+hr>ur.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${ur.byteLength-sr}].`);if(typeof ar=="object"&&ar!==null)or=ar;else if(typeof ar<"u")throw new TypeError("'options' must be an object.")}else if(typeof ir<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof rr<"u")throw new TypeError("'options' must be an object.");nr=new Uint8Array(ur,sr,hr)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const fr=(or.executionProviders||[]).map(ur=>typeof ur=="string"?ur:ur.name),cr=await(await resolveBackend(fr)).createSessionHandler(nr,or);return new Rs(cr)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*!
309
309
  * ONNX Runtime Web v1.14.0