@8wave/ai-elements 0.115.0-beta.34 → 0.115.0-beta.52

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 (185) hide show
  1. package/README.md +1 -0
  2. package/dist/_chunks/{Agent-Cu04vBnd.js → Agent-CJbRpoZG.js} +133 -122
  3. package/dist/_chunks/Agent-CJbRpoZG.js.map +1 -0
  4. package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js +256 -0
  5. package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js.map +1 -0
  6. package/dist/_chunks/PkHeldImage-BtaPh0Jr.js +42 -0
  7. package/dist/_chunks/PkHeldImage-BtaPh0Jr.js.map +1 -0
  8. package/dist/_chunks/{PkStreamingMarkdown-Qk9Tk_N7.js → PkStreamingMarkdown-B_qmgO9_.js} +801 -745
  9. package/dist/_chunks/PkStreamingMarkdown-B_qmgO9_.js.map +1 -0
  10. package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js +41 -0
  11. package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js.map +1 -0
  12. package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js → PkToolRequestGeolocation-YW0ilIxN.js} +2 -2
  13. package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js.map → PkToolRequestGeolocation-YW0ilIxN.js.map} +1 -1
  14. package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js → PkToolRequestOAuthConnection-Cx4aFL5g.js} +2 -2
  15. package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js.map → PkToolRequestOAuthConnection-Cx4aFL5g.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js → PkToolShowArtifact-Bgj02cPe.js} +2 -2
  17. package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js.map → PkToolShowArtifact-Bgj02cPe.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js → PkToolShowContactForm-Die8UpNv.js} +2 -2
  19. package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js.map → PkToolShowContactForm-Die8UpNv.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js → PkToolShowForm-Dmq95u6b.js} +5 -5
  21. package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js.map → PkToolShowForm-Dmq95u6b.js.map} +1 -1
  22. package/dist/_chunks/PkToolShowImageGallery-CKuyTxih.js +88 -0
  23. package/dist/_chunks/PkToolShowImageGallery-CKuyTxih.js.map +1 -0
  24. package/dist/_chunks/PkToolShowProductList-DjS9nvXe.js +72 -0
  25. package/dist/_chunks/PkToolShowProductList-DjS9nvXe.js.map +1 -0
  26. package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js → PkToolShowSources-MJRFeqMA.js} +3 -3
  27. package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js.map → PkToolShowSources-MJRFeqMA.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js → PkToolShowSuggestedReply-DPVS3C74.js} +2 -2
  29. package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js.map → PkToolShowSuggestedReply-DPVS3C74.js.map} +1 -1
  30. package/dist/_chunks/PkToolShowVideo-DnvvRE7H.js +142 -0
  31. package/dist/_chunks/PkToolShowVideo-DnvvRE7H.js.map +1 -0
  32. package/dist/_chunks/{PkToolShowWebPages-BOxbTe2X.js → PkToolShowWebPages-CYbiGa7e.js} +31 -24
  33. package/dist/_chunks/PkToolShowWebPages-CYbiGa7e.js.map +1 -0
  34. package/dist/_chunks/chatImagePolicy-C5eH4Cpq.js +46 -0
  35. package/dist/_chunks/chatImagePolicy-C5eH4Cpq.js.map +1 -0
  36. package/dist/_chunks/{markdown-_p-gd9w8.js → markdown-qIVVfGoX.js} +146 -73
  37. package/dist/_chunks/markdown-qIVVfGoX.js.map +1 -0
  38. package/dist/ai-elements.es.js +2975 -3134
  39. package/dist/ai-elements.es.js.map +1 -1
  40. package/dist-vue/PkChatbot.js +1 -1
  41. package/dist-vue/PkChatbotEmptyState.js +1 -1
  42. package/dist-vue/PkChatbotFilePreview.js +1 -1
  43. package/dist-vue/PkChatbotInput.js +1 -1
  44. package/dist-vue/PkChatbotMessages.js +1 -1
  45. package/dist-vue/PkChatbotStepPayload.js +1 -1
  46. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  47. package/dist-vue/PkChatbotSteps.js +1 -1
  48. package/dist-vue/PkChatbotViewChat.js +1 -1
  49. package/dist-vue/PkChatbotViewConversations.js +1 -1
  50. package/dist-vue/PkChatbotViewFiles.js +1 -1
  51. package/dist-vue/PkChatbotViewProfile.js +1 -1
  52. package/dist-vue/_chunks/{Agent-KbZm8GvA.js → Agent---jwXeaB.js} +57 -46
  53. package/dist-vue/_chunks/Agent---jwXeaB.js.map +1 -0
  54. package/dist-vue/_chunks/{Document-DCSWwcRE.js → Document-DmBTgjd4.js} +150 -77
  55. package/dist-vue/_chunks/Document-DmBTgjd4.js.map +1 -0
  56. package/dist-vue/_chunks/PkChatbot-W9tO1H9i.js +275 -0
  57. package/dist-vue/_chunks/PkChatbot-W9tO1H9i.js.map +1 -0
  58. package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js → PkChatbotEmptyState-BY3f3T0T.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js.map → PkChatbotEmptyState-BY3f3T0T.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotFilePreview-CwiVQDF2.js → PkChatbotFilePreview-Dq9JBX9U.js} +5 -3
  61. package/dist-vue/_chunks/PkChatbotFilePreview-Dq9JBX9U.js.map +1 -0
  62. package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js → PkChatbotInput-C5l6QDQY.js} +3 -3
  63. package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js.map → PkChatbotInput-C5l6QDQY.js.map} +1 -1
  64. package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js +769 -0
  65. package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js → PkChatbotStepPayload-C-xnhmzZ.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js.map → PkChatbotStepPayload-C-xnhmzZ.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js → PkChatbotStepToolDetail-Cko1vU0N.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js.map → PkChatbotStepToolDetail-Cko1vU0N.js.map} +1 -1
  70. package/dist-vue/_chunks/PkChatbotSteps-BkZ3Kq2M.js +191 -0
  71. package/dist-vue/_chunks/{PkChatbotSteps-Y6kQ00ui.js.map → PkChatbotSteps-BkZ3Kq2M.js.map} +1 -1
  72. package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js +789 -0
  73. package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js.map +1 -0
  74. package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js → PkChatbotViewConversations-C6T4ZxxX.js} +2 -2
  75. package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js.map → PkChatbotViewConversations-C6T4ZxxX.js.map} +1 -1
  76. package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js +125 -0
  77. package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js.map +1 -0
  78. package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js → PkChatbotViewProfile-CDCy1LEX.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js.map → PkChatbotViewProfile-CDCy1LEX.js.map} +1 -1
  80. package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js +41 -0
  81. package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js.map +1 -0
  82. package/dist-vue/_chunks/{PkStreamingMarkdown-CJlfq7ub.js → PkStreamingMarkdown-DJG-aPx2.js} +792 -780
  83. package/dist-vue/_chunks/PkStreamingMarkdown-DJG-aPx2.js.map +1 -0
  84. package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js → PkSvgViewer-D1y8hZRW.js} +2 -2
  85. package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js.map → PkSvgViewer-D1y8hZRW.js.map} +1 -1
  86. package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js +40 -0
  87. package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js.map +1 -0
  88. package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js → PkToolRequestGeolocation-Ccbhljmn.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js.map → PkToolRequestGeolocation-Ccbhljmn.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js → PkToolRequestOAuthConnection-BXf5ZRzR.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js.map → PkToolRequestOAuthConnection-BXf5ZRzR.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js → PkToolShowArtifact-BsfbvfVC.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js.map → PkToolShowArtifact-BsfbvfVC.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js → PkToolShowContactForm-C-YbtBlG.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js.map → PkToolShowContactForm-C-YbtBlG.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js → PkToolShowDiagram-CIHVrQ3e.js} +3 -3
  97. package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js.map → PkToolShowDiagram-CIHVrQ3e.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js → PkToolShowEmail-C591LR5N.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js.map → PkToolShowEmail-C591LR5N.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js → PkToolShowForm-BwYJhEVO.js} +6 -6
  101. package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js.map → PkToolShowForm-BwYJhEVO.js.map} +1 -1
  102. package/dist-vue/_chunks/PkToolShowImageGallery-1A9zyOVn.js +88 -0
  103. package/dist-vue/_chunks/PkToolShowImageGallery-1A9zyOVn.js.map +1 -0
  104. package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js → PkToolShowMessage-CbXERPHI.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js.map → PkToolShowMessage-CbXERPHI.js.map} +1 -1
  106. package/dist-vue/_chunks/PkToolShowProductList-D61i6AMs.js +72 -0
  107. package/dist-vue/_chunks/PkToolShowProductList-D61i6AMs.js.map +1 -0
  108. package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js → PkToolShowSources-BQpdJE_m.js} +4 -4
  109. package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js.map → PkToolShowSources-BQpdJE_m.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js → PkToolShowSuggestedReply-D3jLsbKJ.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js.map → PkToolShowSuggestedReply-D3jLsbKJ.js.map} +1 -1
  112. package/dist-vue/_chunks/PkToolShowVideo-DUdkb3qb.js +141 -0
  113. package/dist-vue/_chunks/PkToolShowVideo-DUdkb3qb.js.map +1 -0
  114. package/dist-vue/_chunks/PkToolShowWebPages-BeeBiv9R.js +86 -0
  115. package/dist-vue/_chunks/PkToolShowWebPages-BeeBiv9R.js.map +1 -0
  116. package/dist-vue/_chunks/{PkUrl-E12f7rn_.js → PkUrl-CN1kkZiH.js} +2 -2
  117. package/dist-vue/_chunks/{PkUrl-E12f7rn_.js.map → PkUrl-CN1kkZiH.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js → createChatbotApiClient-CDrs7NwO.js} +13 -9
  119. package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js.map → createChatbotApiClient-CDrs7NwO.js.map} +1 -1
  120. package/dist-vue/_chunks/{useChatbotStore-DEELIJ89.js → useChatbotStore-D6YNk8Rx.js} +6 -4
  121. package/dist-vue/_chunks/useChatbotStore-D6YNk8Rx.js.map +1 -0
  122. package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js +71 -0
  123. package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js.map +1 -0
  124. package/dist-vue/_chunks/utils-roi6YVNC.js +199 -0
  125. package/dist-vue/_chunks/utils-roi6YVNC.js.map +1 -0
  126. package/dist-vue/api.js +1 -1
  127. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  128. package/dist-vue/composables.js +73 -13
  129. package/dist-vue/composables.js.map +1 -1
  130. package/dist-vue/index.js +3614 -3559
  131. package/dist-vue/index.js.map +1 -1
  132. package/dist-vue/locales.js +26 -14
  133. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
  134. package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +5 -0
  135. package/dist-vue/packages/components/src/chat/PkHeldImage.d.ts +21 -0
  136. package/dist-vue/packages/components/src/chat/PkToolEditSpreadsheet.d.ts +14 -0
  137. package/dist-vue/packages/components/src/chat/chatImagePolicy.d.ts +55 -0
  138. package/dist-vue/packages/components/src/chat/index.d.ts +1 -0
  139. package/dist-vue/packages/components/src/chat/markdownHtml.d.ts +17 -1
  140. package/dist-vue/packages/components/src/chat/utils.d.ts +8 -0
  141. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +7 -1
  142. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
  143. package/dist-vue/packages/composable/src/useFileRow.d.ts +21 -0
  144. package/dist-vue/packages/models/src/schema/Agent.d.ts +28 -0
  145. package/dist-vue/packages/models/src/schema/Document.d.ts +173 -0
  146. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  147. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  148. package/dist-vue/packages/models/src/schema/Tabular.d.ts +181 -0
  149. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  150. package/dist-vue/style.css +1 -1
  151. package/package.json +1 -1
  152. package/dist/_chunks/Agent-Cu04vBnd.js.map +0 -1
  153. package/dist/_chunks/PkStreamingMarkdown-Qk9Tk_N7.js.map +0 -1
  154. package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js +0 -75
  155. package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js.map +0 -1
  156. package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js +0 -65
  157. package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js.map +0 -1
  158. package/dist/_chunks/PkToolShowVideo-DClps9oP.js +0 -123
  159. package/dist/_chunks/PkToolShowVideo-DClps9oP.js.map +0 -1
  160. package/dist/_chunks/PkToolShowWebPages-BOxbTe2X.js.map +0 -1
  161. package/dist/_chunks/markdown-_p-gd9w8.js.map +0 -1
  162. package/dist-vue/_chunks/Agent-KbZm8GvA.js.map +0 -1
  163. package/dist-vue/_chunks/Document-DCSWwcRE.js.map +0 -1
  164. package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js +0 -272
  165. package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js.map +0 -1
  166. package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +0 -1
  167. package/dist-vue/_chunks/PkChatbotMessages-UT72KC_z.js +0 -769
  168. package/dist-vue/_chunks/PkChatbotMessages-UT72KC_z.js.map +0 -1
  169. package/dist-vue/_chunks/PkChatbotSteps-Y6kQ00ui.js +0 -191
  170. package/dist-vue/_chunks/PkChatbotViewChat-D3PwREDw.js +0 -784
  171. package/dist-vue/_chunks/PkChatbotViewChat-D3PwREDw.js.map +0 -1
  172. package/dist-vue/_chunks/PkChatbotViewFiles-BStYLY2B.js +0 -111
  173. package/dist-vue/_chunks/PkChatbotViewFiles-BStYLY2B.js.map +0 -1
  174. package/dist-vue/_chunks/PkStreamingMarkdown-CJlfq7ub.js.map +0 -1
  175. package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js +0 -75
  176. package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js.map +0 -1
  177. package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js +0 -65
  178. package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js.map +0 -1
  179. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js +0 -122
  180. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js.map +0 -1
  181. package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js +0 -79
  182. package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js.map +0 -1
  183. package/dist-vue/_chunks/useChatbotStore-DEELIJ89.js.map +0 -1
  184. package/dist-vue/_chunks/utils-CtD8DCrq.js +0 -184
  185. package/dist-vue/_chunks/utils-CtD8DCrq.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkToolShowWebPages-CYbiGa7e.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_createElementVNode","_unref","_createBlock","PkHeldImage","PkLazyImg","_createCommentVNode","_toDisplayString","_createVNode","PkUrl","_createTextVNode","_sfc_main","defineComponent","openBlock","init_runtime_core_esm_bundler","toDisplayString","createCommentVNode","createTextVNode","unref","Fragment","createBlock","createBaseVNode","init_reactivity_esm_bundler","computed","ref","createElementBlock","createVNode","init_shared_esm_bundler","renderList","isSameSite","Ae","useChatImageGate","PkHeldImage_default","PkLazyImg_default","PkUrl_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","PkToolShowWebPages_default","props","__props","toolPart","imageGate","normalizeUrl","u","url","uniquePages","seen","result","page","key","showMore","pages","hasMore","_component_VvIcon","index","_ctx","_cache"],"sources":["../../../../packages/components/src/chat/PkToolShowWebPages.vue","../../../../packages/components/src/chat/PkToolShowWebPages.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul v-if=\"pages?.length\" class=\"u-pick-list w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"u-pick-list__row\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"u-pick-list__entry u-pick-list__entry--roomy u-pick-list__entry--top\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"u-pick-list__label font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"u-pick-list__row\">\n <button\n class=\"u-pick-list__entry text-12 text-word-3 justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref } from 'vue'\n import { isSameSite } from 'utils'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n pages: Array<{\n title: string\n url: string\n image?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n // The model often passes the same URL several times (e.g. multiple KB\n // chunks from one page), so collapse duplicates, keeping the first (richest)\n // entry. Normalize by dropping the hash and any trailing slash.\n const normalizeUrl = (url: string) => {\n try {\n const u = new URL(url)\n u.hash = ''\n return u.toString().replace(/\\/$/, '')\n } catch {\n return url.trim().replace(/\\/$/, '')\n }\n }\n const uniquePages = computed(() => {\n const seen = new Set<string>()\n const result: NonNullable<typeof toolPart.value.input>['pages'] = []\n for (const page of toolPart.value.input?.pages || []) {\n const key = normalizeUrl(page.url)\n if (seen.has(key)) {\n continue\n }\n seen.add(key)\n result.push(page)\n }\n return result\n })\n\n const showMore = ref(false)\n const pages = computed(() => {\n if (showMore.value) {\n return uniquePages.value\n }\n return uniquePages.value.slice(0, 2)\n })\n const hasMore = computed(() => uniquePages.value.length > 2)\n</script>\n\n<template>\n <ul v-if=\"pages?.length\" class=\"u-pick-list w-full shrink-0\">\n <li\n v-for=\"(page, index) in pages\"\n :key=\"index\"\n class=\"u-pick-list__row\">\n <a\n :href=\"page.url\"\n :title=\"$t('action.open')\"\n :target=\"isSameSite(page.url) ? undefined : '_blank'\"\n :rel=\"isSameSite(page.url) ? undefined : 'noopener noreferrer'\"\n class=\"u-pick-list__entry u-pick-list__entry--roomy u-pick-list__entry--top\">\n <!-- og:images the model scraped are third-party urls: a dead one\n degrades to an icon instead of breaking the card layout -->\n <PkHeldImage\n v-if=\"page.image && !imageGate.canLoad(page.image)\"\n :host=\"imageGate.hostOf(page.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(page.image)\" />\n <PkLazyImg\n v-else-if=\"page.image\"\n :src=\"page.image\"\n :alt=\"page.title\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong\n class=\"u-pick-list__label font-medium text-12 text-word-1\">\n {{ page.title }}\n </strong>\n <span\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"page.url\" />\n </span>\n <p\n v-if=\"page.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ page.description }}\n </p>\n </div>\n </a>\n </li>\n <li v-if=\"hasMore\" class=\"u-pick-list__row\">\n <button\n class=\"u-pick-list__entry text-12 text-word-3 justify-center cursor-pointer\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"\n showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\n \"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: uniquePages.length - 2,\n })\n }}\n </button>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQI,IAAMgD,IAAQC,GAIRC,IAAWtB,QACAoB,EAAM,IAWtB,GAIKG,IAAYf,EAAiB,GAK7BgB,KAAgB,MAAgB;GAClC,IAAI;IACA,IAAMC,IAAI,IAAI,IAAIC,CAAG;IAErB,OADA,EAAE,OAAO,IACFD,EAAE,SAAS,CAAC,CAAC,QAAQ,OAAO,EAAE;GACzC,QAAQ;IACJ,OAAOC,EAAI,KAAK,CAAC,CAAC,QAAQ,OAAO,EAAE;GACvC;EACJ,GACMC,IAAc3B,QAAe;GAC/B,IAAM4B,oBAAO,IAAI,IAAY,GACvBC,IAA4D,CAAC;GACn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as s } from "./url-validation-9DstIfq2.js";
5
+ import { n as c } from "./useShortUrlResolver-Ddb9IUei.js";
6
+ //#region ../../packages/components/src/chat/chatImagePolicy.ts
7
+ e(), n();
8
+ var l = Symbol("ChatImagePolicy");
9
+ function u(e, n) {
10
+ t(l, i(() => ({
11
+ hosts: (e() ?? []).map(o),
12
+ platformOrigins: [s(n())].filter((e) => !!e)
13
+ })));
14
+ }
15
+ function d(e, t) {
16
+ try {
17
+ return new URL(e, t).hostname || void 0;
18
+ } catch {
19
+ return;
20
+ }
21
+ }
22
+ var f = /^\/api\/v1\/(?:public\/medias\/[^/]+|[^/]+\/agents\/[^/]+\/chats\/[^/]+\/media\/[^/]+\/(?:view|download))$/;
23
+ function p(e, t, n) {
24
+ let r;
25
+ try {
26
+ r = new URL(e, n);
27
+ } catch {
28
+ return !1;
29
+ }
30
+ return r.protocol === "data:" || r.protocol === "blob:" ? !0 : t.platformOrigins.includes(r.origin) ? f.test(r.pathname) : r.protocol === "https:" && t.hosts.includes(r.hostname);
31
+ }
32
+ function m() {
33
+ let e = r(l, void 0), t = c(), n = a(/* @__PURE__ */ new Set()), o = () => typeof window > "u" ? "https://localhost/" : window.location.href, s = (e) => t.resolve(e).value.url ?? e;
34
+ return {
35
+ isGated: i(() => !!e),
36
+ canLoad: (t) => !t || !e || n.value.has(t) || p(s(t), e.value, o()),
37
+ release: (e) => {
38
+ n.value = new Set(n.value).add(e);
39
+ },
40
+ hostOf: (e) => d(s(e), o())
41
+ };
42
+ }
43
+ //#endregion
44
+ export { m as n, u as t };
45
+
46
+ //# sourceMappingURL=chatImagePolicy-C5eH4Cpq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatImagePolicy-C5eH4Cpq.js","names":["init_runtime_core_esm_bundler","provide","init_reactivity_esm_bundler","inject","computed","ref","normalizeImageHost","urlOrigin","useShortUrlResolver","ChatImagePolicyKey","provideChatImagePolicy","hosts","backendUrl","origin","imageHostOf","src","pageUrl","PLATFORM_MEDIA_PATH","isImageAllowed","url","policy","useChatImageGate","shortUrls","released","target"],"sources":["../../../../packages/components/src/chat/chatImagePolicy.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from 'vue'\nimport { computed, inject, provide, ref } from 'vue'\nimport { useShortUrlResolver } from 'composables'\nimport { normalizeImageHost } from 'models'\nimport { urlOrigin } from 'utils'\n\n/**\n * Which images a chat loads by itself: hole 20 of\n * docs/specs/organization-isolation.md.\n *\n * The model writes the url of every image in an answer and in the image tool\n * cards (gallery, products, web pages), and a prompt injected through a\n * document, a page or a tool result can make it put the conversation in that\n * url. The browser fetches it as soon as it renders, and the text is gone.\n * So an image loads by itself only from the media of the platform and from\n * the hosts the agent lists (`interface.imageHosts`); any other shows its host\n * and loads on a click, a choice made by whoever reads it.\n *\n * Provided by `PkChatbot` (the app and the widget) and by the pages that show\n * an agent's answers; where nothing is provided, images load as before.\n */\nexport interface ChatImagePolicy {\n /** Host names the agent lists, normalized (`normalizeImageHost`). */\n hosts: string[]\n /** Origins of the platform, which serve the media of a chat. */\n platformOrigins: string[]\n}\n\nexport const ChatImagePolicyKey: InjectionKey<ComputedRef<ChatImagePolicy>> =\n Symbol('ChatImagePolicy')\n\n/**\n * Applies the policy of an agent to the answers rendered below: its listed\n * hosts, and the backend the page talks to, which serves the chat's media.\n * The hosts are normalized again because a preview passes them as typed,\n * before the schema does.\n */\nexport function provideChatImagePolicy(\n hosts: () => string[] | undefined,\n backendUrl: () => string | undefined,\n) {\n provide(\n ChatImagePolicyKey,\n computed(() => ({\n hosts: (hosts() ?? []).map(normalizeImageHost),\n platformOrigins: [urlOrigin(backendUrl())].filter(\n (origin): origin is string => !!origin,\n ),\n })),\n )\n}\n\n/**\n * The host an image url points to, for the placeholder, or `undefined` when\n * it does not parse.\n */\nexport function imageHostOf(src: string, pageUrl: string): string | undefined {\n try {\n return new URL(src, pageUrl).hostname || undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * The paths the platform serves the media of a chat from (`media.service.ts`\n * and `chatMedia.service.ts` in the backend). Only these: the same origin\n * answers sign-in and OAuth routes that redirect to a url read from the query,\n * which would carry an answer anywhere. A short link (`/api/r/<hash>`) is not\n * among them either: `useChatImageGate` judges it by the url it stands for,\n * since a set of links prepared in advance could spell a secret out.\n */\nconst PLATFORM_MEDIA_PATH =\n /^\\/api\\/v1\\/(?:public\\/medias\\/[^/]+|[^/]+\\/agents\\/[^/]+\\/chats\\/[^/]+\\/media\\/[^/]+\\/(?:view|download))$/\n\n/**\n * Whether an image may load without a click. `data:` and `blob:` images never\n * reach the network; everything else needs the media of the platform or a\n * listed host, over https. The page's own origin gets no exception: a site,\n * the platform's included, often redirects wherever its query says.\n */\nexport function isImageAllowed(\n src: string,\n policy: ChatImagePolicy,\n pageUrl: string,\n): boolean {\n let url: URL\n try {\n url = new URL(src, pageUrl)\n } catch {\n return false\n }\n if (url.protocol === 'data:' || url.protocol === 'blob:') {\n return true\n }\n if (policy.platformOrigins.includes(url.origin)) {\n return PLATFORM_MEDIA_PATH.test(url.pathname)\n }\n return url.protocol === 'https:' && policy.hosts.includes(url.hostname)\n}\n\n/**\n * The policy of the surrounding chat, with the images released by a click.\n * A release is per url and lasts as long as the component that asked. A\n * short link of the platform is judged, and named, by the url it stands for:\n * it waits until the resolver brings that url back.\n */\nexport function useChatImageGate() {\n const policy = inject(ChatImagePolicyKey, undefined)\n const shortUrls = useShortUrlResolver()\n const released = ref(new Set<string>())\n const pageUrl = () =>\n typeof window === 'undefined'\n ? 'https://localhost/'\n : window.location.href\n const target = (src: string) => shortUrls.resolve(src).value.url ?? src\n\n const canLoad = (src: string | undefined): boolean =>\n !src ||\n !policy ||\n released.value.has(src) ||\n isImageAllowed(target(src), policy.value, pageUrl())\n\n const release = (src: string) => {\n released.value = new Set(released.value).add(src)\n }\n\n const hostOf = (src: string) => imageHostOf(target(src), pageUrl())\n\n return {\n /** Whether a policy applies here at all. */\n isGated: computed(() => !!policy),\n canLoad,\n release,\n hostOf,\n }\n}\n"],"mappings":";;;;;;;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,CAAC,CAAC,IAAIR,CAAG;EACpD;EASI,SAPY,MAAgBD,EAAYU,EAAOT,CAAG,GAAGC,EAAQ,CAAC;CAQlE;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { C as e, S as t, _ as n, a as r, b as i, f as a, g as o, h as s, l as c, n as l, o as u, t as d, v as f, x as p, y as m } from "./zod-DNKa_yZf.js";
2
- import { f as h, h as g, m as _ } from "./Agent-Cu04vBnd.js";
2
+ import { _ as h, g, m as _ } from "./Agent-CJbRpoZG.js";
3
3
  (/* @__PURE__ */ (function(e) {
4
4
  return e.textEmbedding3Small = "openai/text-embedding-3-small", e.textEmbedding3Large = "openai/text-embedding-3-large", e.geminiEmbedding2 = "google/gemini-embedding-2", e;
5
5
  })({})).geminiEmbedding2;
@@ -14,14 +14,14 @@ var y = /* @__PURE__ */ function(e) {
14
14
  }({}), x = o({
15
15
  key: m().optional(),
16
16
  value: m().optional()
17
- }), S = _(r(x), r(o({
17
+ }), S = g(r(x), r(o({
18
18
  key: m(),
19
19
  value: m()
20
20
  })), (e) => e?.filter((e) => e.key?.trim() && e.value?.trim()));
21
21
  o({
22
22
  key: m(),
23
23
  hasValue: u()
24
- }), _(r(o({
24
+ }), g(r(o({
25
25
  key: m().optional(),
26
26
  value: m().max(4096).optional()
27
27
  })), r(o({
@@ -32,12 +32,57 @@ o({
32
32
  value: t
33
33
  })));
34
34
  //#endregion
35
- //#region ../../packages/models/src/schema/Document.ts
36
- var C = /* @__PURE__ */ function(e) {
35
+ //#region ../../packages/models/src/schema/Tabular.ts
36
+ var C = o({
37
+ name: m(),
38
+ type: m(),
39
+ column: m().optional(),
40
+ formulas: s().optional(),
41
+ mostly: o({
42
+ kind: l([
43
+ "date",
44
+ "number",
45
+ "boolean"
46
+ ]),
47
+ share: m()
48
+ }).optional()
49
+ }), w = o({
50
+ sheet: m(),
51
+ table: m(),
52
+ headerRow: s().optional(),
53
+ rowCount: s(),
54
+ columns: r(C),
55
+ sample: r(f(m(), p()))
56
+ }), T = o({
57
+ sheet: m(),
58
+ reason: l([
59
+ "chart",
60
+ "no-table",
61
+ "too-wide",
62
+ "unreadable"
63
+ ])
64
+ }), E = o({
65
+ converterVersion: s(),
66
+ tables: r(w),
67
+ skipped: r(T),
68
+ staleFormulas: u()
69
+ });
70
+ o({
71
+ status: l([
72
+ "pending",
73
+ "ready",
74
+ "failed"
75
+ ]),
76
+ requestedAt: m(),
77
+ conversion: E.optional(),
78
+ failure: m().optional(),
79
+ failedConverterVersion: s().optional()
80
+ });
81
+ var D = E.extend({ sourceHash: m() }), O = /* @__PURE__ */ function(e) {
37
82
  return e.Pending = "pending", e.Processing = "processing", e.Success = "success", e.Failed = "failed", e;
38
- }({}), w = /* @__PURE__ */ function(e) {
83
+ }({}), k = /* @__PURE__ */ function(e) {
39
84
  return e.Indexed = "indexed", e.Pending = "pending", e.Failed = "failed", e.Unavailable = "unavailable", e.Empty = "empty", e;
40
- }({}), T = o({
85
+ }({}), A = o({
41
86
  extractionStrategy: l(y).optional(),
42
87
  browserEngine: l(b).optional().default(b.FETCH),
43
88
  headers: S.nullish(),
@@ -45,28 +90,29 @@ var C = /* @__PURE__ */ function(e) {
45
90
  aiDescriptionPrompt: m().max(5e3).optional(),
46
91
  language: m().optional(),
47
92
  forceOcr: u().default(!1),
48
- pages: m().max(100).regex(/^\d+(\s*-\s*\d+)?(\s*,\s*\d+(\s*-\s*\d+)?)*$/).optional()
49
- }), E = /* @__PURE__ */ function(e) {
93
+ pages: m().max(100).regex(/^\d+(\s*-\s*\d+)?(\s*,\s*\d+(\s*-\s*\d+)?)*$/).optional(),
94
+ asTables: u().optional()
95
+ }), j = /* @__PURE__ */ function(e) {
50
96
  return e.Web = "web", e.SharePoint = "sharepoint", e.GoogleDrive = "google-drive", e;
51
- }({}), D = /* @__PURE__ */ function(e) {
97
+ }({}), M = /* @__PURE__ */ function(e) {
52
98
  return e.Updated = "updated", e.Unchanged = "unchanged", e.Failed = "failed", e.Shrunk = "shrunk", e.Gone = "gone", e;
53
- }({}), O = /* @__PURE__ */ function(e) {
99
+ }({}), N = /* @__PURE__ */ function(e) {
54
100
  return e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e;
55
101
  }({});
56
- O.Daily, O.Weekly, O.Monthly;
57
- var k = o({
102
+ N.Daily, N.Weekly, N.Monthly;
103
+ var P = o({
58
104
  at: m(),
59
- result: l(D),
105
+ result: l(M),
60
106
  httpStatus: s().optional(),
61
107
  error: m().optional(),
62
108
  consecutiveFailures: s().optional(),
63
109
  previousWordCount: s().optional(),
64
110
  newWordCount: s().optional()
65
- }), A = {
111
+ }), F = {
66
112
  contentHash: m().optional(),
67
- lastRefresh: k.optional()
68
- }, j = o({
69
- provider: a(E.Web),
113
+ lastRefresh: P.optional()
114
+ }, I = o({
115
+ provider: a(j.Web),
70
116
  url: m(),
71
117
  lastScrapedAt: m().optional(),
72
118
  extractionInputHash: m().optional(),
@@ -74,8 +120,8 @@ var k = o({
74
120
  sourceId: e().optional(),
75
121
  lastSyncedAt: m().optional(),
76
122
  lastmod: m().optional(),
77
- ...A
78
- }), M = {
123
+ ...F
124
+ }), L = {
79
125
  sourceId: e(),
80
126
  remoteId: m(),
81
127
  webUrl: m(),
@@ -84,30 +130,55 @@ var k = o({
84
130
  lastSyncedAt: m(),
85
131
  lastModified: m().optional(),
86
132
  candidate: o({
87
- media: h,
133
+ media: _,
88
134
  fingerprint: m(),
89
135
  name: m(),
90
136
  webUrl: m(),
91
137
  path: m(),
92
138
  lastModified: m().optional()
93
139
  }).optional(),
94
- ...A
95
- }, N = o({
96
- provider: a(E.SharePoint),
97
- ...M
98
- }), P = o({
99
- provider: a(E.GoogleDrive),
100
- ...M
101
- }), F = n((e) => e && typeof e == "object" && !Array.isArray(e) && !("provider" in e) ? {
102
- provider: E.Web,
140
+ ...F
141
+ }, R = o({
142
+ provider: a(j.SharePoint),
143
+ ...L
144
+ }), z = o({
145
+ provider: a(j.GoogleDrive),
146
+ ...L
147
+ }), B = n((e) => e && typeof e == "object" && !Array.isArray(e) && !("provider" in e) ? {
148
+ provider: j.Web,
103
149
  ...e
104
150
  } : e, c("provider", [
105
- j,
106
- N,
107
- P
108
- ])), I = o({
109
- source: F.optional(),
110
- media: h.optional(),
151
+ I,
152
+ R,
153
+ z
154
+ ])), V = [
155
+ "gateway-disabled",
156
+ "endpoint-off",
157
+ "model-unavailable",
158
+ "no-model",
159
+ "format-unsupported",
160
+ "credit-exhausted"
161
+ ], H = [
162
+ "file-unreadable",
163
+ "file-protected",
164
+ "file-type-unsupported",
165
+ "spreadsheet-protected",
166
+ "spreadsheet-unreadable",
167
+ "spreadsheet-macros",
168
+ "spreadsheet-too-large",
169
+ "spreadsheet-no-table"
170
+ ];
171
+ [...V, ...H];
172
+ var U = o({
173
+ reason: m().optional(),
174
+ status: s().optional(),
175
+ url: m().optional(),
176
+ limitBytes: s().optional(),
177
+ message: m().optional(),
178
+ at: m().optional()
179
+ }).loose(), W = o({
180
+ source: B.optional(),
181
+ media: _.optional(),
111
182
  title: m().optional(),
112
183
  author: m().optional(),
113
184
  description: m().optional(),
@@ -118,7 +189,7 @@ var k = o({
118
189
  producer: m().optional(),
119
190
  creationDate: m().optional(),
120
191
  modificationDate: m().optional(),
121
- pageCount: _(i([s(), r(p())]), s(), (e) => Array.isArray(e) ? e.length : e).optional(),
192
+ pageCount: g(i([s(), r(p())]), s(), (e) => Array.isArray(e) ? e.length : e).optional(),
122
193
  encrypted: u().optional(),
123
194
  characterCount: s().optional(),
124
195
  lineCount: s().optional(),
@@ -144,10 +215,12 @@ var k = o({
144
215
  redundantChunksCount: s().optional(),
145
216
  hasRedundantChunks: u().optional(),
146
217
  searchIndexError: o({ at: m() }).optional(),
147
- conversionOptions: T.optional()
148
- }).loose(), L = /* @__PURE__ */ function(e) {
218
+ conversionOptions: A.optional(),
219
+ tabular: D.optional(),
220
+ lastIndexError: U.optional().catch(void 0)
221
+ }).loose(), G = /* @__PURE__ */ function(e) {
149
222
  return e.File = "file", e.Url = "url", e.RevisedAnswer = "revised-answer", e.PlainText = "plain-text", e;
150
- }({}), R = o({
223
+ }({}), K = o({
151
224
  id: m(),
152
225
  externalId: m().nullable(),
153
226
  name: m(),
@@ -166,24 +239,24 @@ var k = o({
166
239
  deletedBy: m().nullable(),
167
240
  organizationId: m(),
168
241
  priority: s().int().min(1).max(5).default(3),
169
- refreshInterval: l(O).nullable().optional(),
242
+ refreshInterval: l(N).nullable().optional(),
170
243
  nextRefreshAt: d().nullable().optional(),
171
- sourceProvider: l(E).nullable().optional()
244
+ sourceProvider: l(j).nullable().optional()
172
245
  }).extend({
173
- type: l(L),
174
- indexStatus: l(C),
175
- metadata: I,
246
+ type: l(G),
247
+ indexStatus: l(O),
248
+ metadata: W,
176
249
  chunksCount: s().optional(),
177
250
  redundantChunksCount: s().optional(),
178
251
  hasRedundantChunks: u().optional(),
179
- searchStatus: l(w).optional(),
252
+ searchStatus: l(k).optional(),
180
253
  agentIds: r(m()).optional(),
181
254
  folderId: m().nullable().optional(),
182
255
  folderPath: m().nullable().optional(),
183
256
  deletedByName: m().nullable().optional()
184
257
  });
185
- L.File, L.Url, L.PlainText, o({
186
- document: R,
258
+ G.File, G.Url, G.PlainText, o({
259
+ document: K,
187
260
  returnedToRoot: u()
188
261
  }), o({
189
262
  count: s().int(),
@@ -192,36 +265,36 @@ L.File, L.Url, L.PlainText, o({
192
265
  purged: s().int(),
193
266
  remaining: s().int()
194
267
  }), o({
195
- ...g.pagination(),
196
- ...g.sort([
268
+ ...h.pagination(),
269
+ ...h.sort([
197
270
  "id",
198
271
  "updatedAt",
199
272
  "createdAt",
200
273
  "name",
201
274
  "deletedAt"
202
275
  ]),
203
- ...g.filters([
276
+ ...h.filters([
204
277
  "type",
205
278
  "language",
206
279
  "agentId",
207
280
  "indexStatus"
208
281
  ]),
209
282
  "filter[deleted]": l(["true", "false"]).optional(),
210
- ...g.fullText(),
211
- ...g.ids(),
283
+ ...h.fullText(),
284
+ ...h.ids(),
212
285
  "filter[similarity]": m().optional(),
213
286
  "filter[folderId]": m().optional(),
214
287
  "filter[hasRedundantChunks]": m().optional(),
215
288
  "filter[refreshInterval]": m().optional(),
216
289
  "filter[sourceProvider]": m().optional()
217
290
  }), o({
218
- type: l(L).default(L.File),
291
+ type: l(G).default(G.File),
219
292
  name: m().min(1).max(255).optional(),
220
293
  language: l(v).optional(),
221
294
  organizationId: m(),
222
295
  agentIds: r(m()).min(1, "At least one agent is required"),
223
296
  folderId: e().nullable().optional(),
224
- media: h.optional(),
297
+ media: _.optional(),
225
298
  url: t().optional(),
226
299
  content: m().optional(),
227
300
  metadata: f(m(), p()).optional(),
@@ -233,26 +306,26 @@ L.File, L.Url, L.PlainText, o({
233
306
  forceOcr: u().default(!1),
234
307
  pages: m().max(100).regex(/^\d+(\s*-\s*\d+)?(\s*,\s*\d+(\s*-\s*\d+)?)*$/).optional(),
235
308
  priority: s().int().min(1).max(5).default(3).optional(),
236
- refreshInterval: l(O).nullable().optional(),
309
+ refreshInterval: l(N).nullable().optional(),
237
310
  syncSourceId: e().optional()
238
311
  }).superRefine((e, t) => {
239
- e.syncSourceId && e.type !== L.Url && t.addIssue({
312
+ e.syncSourceId && e.type !== G.Url && t.addIssue({
240
313
  code: "custom",
241
314
  params: { i18n: "errors.syncSourceUrlOnly" },
242
315
  path: ["syncSourceId"]
243
- }), e.type === L.File && !e.media ? t.addIssue({
316
+ }), e.type === G.File && !e.media ? t.addIssue({
244
317
  code: "custom",
245
318
  params: { i18n: "errors.required" },
246
319
  path: ["media"]
247
- }) : (e.type === L.Url && !e.url && t.addIssue({
320
+ }) : (e.type === G.Url && !e.url && t.addIssue({
248
321
  code: "custom",
249
322
  params: { i18n: "errors.required" },
250
323
  path: ["url"]
251
- }), e.refreshInterval && e.type !== L.Url && t.addIssue({
324
+ }), e.refreshInterval && e.type !== G.Url && t.addIssue({
252
325
  code: "custom",
253
326
  params: { i18n: "errors.refreshIntervalUrlOnly" },
254
327
  path: ["refreshInterval"]
255
- }), e.type === L.PlainText && !(e.name || e.language) && (e.name || t.addIssue({
328
+ }), e.type === G.PlainText && !(e.name || e.language) && (e.name || t.addIssue({
256
329
  code: "custom",
257
330
  params: { i18n: "errors.required" },
258
331
  path: ["name"]
@@ -270,21 +343,21 @@ L.File, L.Url, L.PlainText, o({
270
343
  priority: s().int().min(1).max(5).optional(),
271
344
  agentIds: r(m()).min(1).optional(),
272
345
  metadata: f(m(), p()).optional(),
273
- refreshInterval: l(O).nullable().optional()
274
- }), o({ refreshInterval: l(O).nullable() }), o({
346
+ refreshInterval: l(N).nullable().optional()
347
+ }), o({ refreshInterval: l(N).nullable() }), o({
275
348
  ids: r(e()).min(1).max(100),
276
- refreshInterval: l(O).nullable()
349
+ refreshInterval: l(N).nullable()
277
350
  }), o({ ids: r(e()).min(1).max(100) });
278
- var z = (e) => {
351
+ var q = (e) => {
279
352
  switch (e) {
280
- case L.File: return "ri:file-line";
281
- case L.Url: return "ri:link";
282
- case L.RevisedAnswer: return "ri:feedback-line";
353
+ case G.File: return "ri:file-line";
354
+ case G.Url: return "ri:link";
355
+ case G.RevisedAnswer: return "ri:feedback-line";
283
356
  default: return "ri:input-method-line";
284
357
  }
285
- }, B = (e) => (e ?? "").startsWith("image/"), V = (e) => B(e) || e === "application/pdf", H = (e) => {
358
+ }, J = (e) => (e ?? "").startsWith("image/"), Y = (e) => J(e) || e === "application/pdf", X = (e) => {
286
359
  let t = e ?? "";
287
- return B(t) ? {
360
+ return J(t) ? {
288
361
  icon: "ri:image-line",
289
362
  accent: "#ec4899",
290
363
  label: "Image"
@@ -325,10 +398,10 @@ var z = (e) => {
325
398
  accent: "#64748b",
326
399
  label: "File"
327
400
  };
328
- }, U = (e) => H(e).icon, W = (e) => {
401
+ }, Z = (e) => X(e).icon, Q = (e) => {
329
402
  if (e) return e.replace(/!\[.*?\]\(.*?\)/g, "").replace(/\[([^\]]+)\]\(.*?\)/g, "$1").replace(/`{1,3}[^`]*`{1,3}/g, "").replace(/#{1,6}\s/g, "").replace(/(\*{1,3}|_{1,3})(.*?)\1/g, "$2").replace(/~~(.*?)~~/g, "$1").replace(/^\s*[-*+>]\s+/gm, "").replace(/\n+/g, " ").trim();
330
403
  };
331
404
  //#endregion
332
- export { V as a, B as i, U as n, z as r, W as t };
405
+ export { Y as a, J as i, Z as n, q as r, Q as t };
333
406
 
334
- //# sourceMappingURL=markdown-_p-gd9w8.js.map
407
+ //# sourceMappingURL=markdown-qIVVfGoX.js.map