@exulu/frontend 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +153 -155
  3. package/dist/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/prerender-manifest.json +1 -1
  6. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
  7. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +8 -8
  11. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
  12. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
  16. package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
  18. package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
  19. package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
  21. package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
  22. package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
  24. package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
  25. package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
  31. package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
  32. package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/(application)/projects/page.js +1 -1
  34. package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
  35. package/dist/.next/server/app/(application)/prompts/page.js +1 -1
  36. package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
  37. package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
  38. package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
  40. package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
  41. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
  43. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
  44. package/dist/.next/server/app/(application)/workflows/page.js +1 -1
  45. package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
  46. package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
  47. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/_not-found.html +1 -1
  49. package/dist/.next/server/app/_not-found.rsc +1 -1
  50. package/dist/.next/server/app-paths-manifest.json +5 -5
  51. package/dist/.next/server/chunks/1025.js +1 -0
  52. package/dist/.next/server/chunks/2270.js +18 -44
  53. package/dist/.next/server/chunks/3434.js +1 -1
  54. package/dist/.next/server/chunks/3503.js +1 -0
  55. package/dist/.next/server/chunks/5084.js +1 -0
  56. package/dist/.next/server/chunks/5192.js +1 -1
  57. package/dist/.next/server/chunks/5485.js +1 -1
  58. package/dist/.next/server/chunks/5600.js +1 -1
  59. package/dist/.next/server/chunks/5974.js +1 -0
  60. package/dist/.next/server/chunks/6590.js +1 -1
  61. package/dist/.next/server/chunks/7471.js +1 -1
  62. package/dist/.next/server/chunks/8286.js +1 -1
  63. package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
  64. package/dist/.next/server/middleware-manifest.json +5 -5
  65. package/dist/.next/server/pages/404.html +1 -1
  66. package/dist/.next/server/pages/500.html +1 -1
  67. package/dist/.next/server/server-reference-manifest.json +1 -1
  68. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
  69. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
  70. package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
  71. package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
  72. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
  73. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
  74. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
  75. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
  76. package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js +2 -0
  77. package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js.map +1 -0
  78. package/dist/.next/static/chunks/{3832-417a5eeee712a793.js → 3832-d7782d6a2771ae6c.js} +1 -1
  79. package/dist/.next/static/chunks/{3832-417a5eeee712a793.js.map → 3832-d7782d6a2771ae6c.js.map} +1 -1
  80. package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
  81. package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
  82. package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js +2 -0
  83. package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js.map +1 -0
  84. package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
  85. package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
  86. package/dist/.next/static/chunks/6373-aef582adc575d3ca.js +2 -0
  87. package/dist/.next/static/chunks/6373-aef582adc575d3ca.js.map +1 -0
  88. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
  89. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
  90. package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-ba5cd36594e6fde1.js} +10 -10
  91. package/dist/.next/static/chunks/8293-ba5cd36594e6fde1.js.map +1 -0
  92. package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js +2 -0
  93. package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js.map +1 -0
  94. package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
  95. package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
  96. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
  97. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
  98. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js +2 -0
  99. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js.map +1 -0
  100. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js +2 -0
  101. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js.map +1 -0
  102. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js +2 -0
  103. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js.map +1 -0
  104. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
  105. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
  106. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
  107. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
  108. package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js → page-e6b1c034c07776e2.js} +1 -1
  109. package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js.map → page-e6b1c034c07776e2.js.map} +1 -1
  110. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
  111. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
  112. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
  113. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
  114. package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js → page-3acc39cb8a718331.js} +1 -1
  115. package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js.map → page-3acc39cb8a718331.js.map} +1 -1
  116. package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
  117. package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
  118. package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js +2 -0
  119. package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js.map +1 -0
  120. package/dist/.next/static/css/9c08ae5d990a6b14.css +4 -0
  121. package/dist/.next/static/css/9c08ae5d990a6b14.css.map +1 -0
  122. package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
  123. package/dist/package.json +1 -1
  124. package/package.json +1 -1
  125. package/dist/.next/server/chunks/2948.js +0 -1
  126. package/dist/.next/server/chunks/38.js +0 -1
  127. package/dist/.next/server/chunks/7958.js +0 -1
  128. package/dist/.next/server/chunks/8050.js +0 -1
  129. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +0 -2
  130. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +0 -1
  131. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +0 -2
  132. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +0 -1
  133. package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js +0 -2
  134. package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js.map +0 -1
  135. package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
  136. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
  137. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
  138. package/dist/.next/static/chunks/572-2940a399da1e3a3b.js +0 -2
  139. package/dist/.next/static/chunks/572-2940a399da1e3a3b.js.map +0 -1
  140. package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
  141. package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
  142. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js +0 -2
  143. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +0 -1
  144. package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
  145. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
  146. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
  147. package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js +0 -2
  148. package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js.map +0 -1
  149. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
  150. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
  151. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
  152. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
  153. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js +0 -2
  154. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +0 -1
  155. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +0 -2
  156. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +0 -1
  157. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js +0 -2
  158. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js.map +0 -1
  159. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +0 -2
  160. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +0 -1
  161. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +0 -2
  162. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +0 -1
  163. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js +0 -2
  164. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +0 -1
  165. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
  166. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
  167. package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
  168. package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js +0 -2
  169. package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js.map +0 -1
  170. package/dist/.next/static/css/c8c015815c72d053.css +0 -4
  171. package/dist/.next/static/css/c8c015815c72d053.css.map +0 -1
  172. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → 3j63p6b3zZZB_v1Hn8Mxp}/_buildManifest.js +0 -0
  173. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → 3j63p6b3zZZB_v1Hn8Mxp}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/chunks/3750-e3d1b2cccd265190.js","mappings":"8PAiBA,IAAMA,EAAmBC,CAAAA,EAAAA,EAAAA,aAAAA,EAAoC,CAC3DC,KAAM,EACR,GASaC,EAAY,OAAC,CACxBD,KAAAA,CAAI,CACJE,SAAAA,CAAQ,CACRC,gBAAAA,EAAkB,EAAK,CACvBC,UAAAA,CAAS,CACTC,SAAAA,CAAQ,CACR,GAAGC,EACY,CAAAC,QACf,GAAAC,EAAAC,GAAA,EAACX,EAAiBY,QAAQ,EAACC,MAAO,CAAEX,KAAAA,CAAK,WACvC,GAAAQ,EAAAC,GAAA,EAACG,MAAAA,CACCR,UAAWS,CAAAA,EAAAA,EAAAA,EAAAA,EACT,kFACAT,GAED,GAAGE,CAAK,UAET,GAAAE,EAAAM,IAAA,EAACF,MAAAA,CAAIR,UAAU,qBACb,GAAAI,EAAAC,GAAA,EAACM,EAAAA,CAAiBA,CAAAA,CAChBX,UAAU,8BACVY,aAAc,CACZZ,UAAW,mBACb,EACAa,YAAa,CACXC,OAAQ,EACRC,QAAS,OACTC,SAAU,WACVC,WAAY,yBACZC,MAAO,wBACT,EACApB,SAAUA,EACVqB,gBAAiB,CACfD,MAAO,+BACPE,aAAc,OACdC,SAAU,QACZ,EACAtB,gBAAiBA,EACjBuB,MAAOC,EAAAA,CAAQA,UAEd3B,IAEH,GAAAQ,EAAAC,GAAA,EAACM,EAAAA,CAAiBA,CAAAA,CAChBX,UAAU,oCACVY,aAAc,CACZZ,UAAW,mBACb,EACAa,YAAa,CACXC,OAAQ,EACRC,QAAS,OACTC,SAAU,WACVC,WAAY,yBACZC,MAAO,w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QAAQ,CAACsE,GAChCnE,EAAO,MAAMhD,EAASgD,IAAI,GAMhC,OALAlL,QAAQC,GAAG,CAAC,OAAQiL,GACpB0E,CAAc,CAACP,EAAQ,CAAG,CACxB/G,IAAK4C,EAAK5C,GAAG,CACbwH,UAAWvF,KAAKwF,GAAG,GAAK,GAC1B,EACO7E,EAAK5C,GAAG,EAGX8G,EAA6B,OAAC,CAAEC,QAAAA,CAAO,CAAuB,CAAAnU,EAElE8E,QAAQC,GAAG,CAAC,MAAOoP,GACnB,IAAMW,EAAQ5G,CAAAA,EAAAA,EAAAA,CAAAA,EAAiB,CAC7BC,SAAU,CAAC,aAAcgG,EAAQ,CACjCjC,UAAW,IACX9D,QAAS,SACAuG,EAAgBR,EAE3B,UAEA,EAAUnG,SAAS,CACV,GAAAQ,EAAAtO,GAAA,EAACG,MAAAA,UAAI,GAAAmO,EAAAtO,GAAA,EAAC6U,EAAAA,CAAUA,CAAAA,CAAAA,KAGrB,EAAO/G,SAAS,EAAK8G,EAAM/G,IAAI,CAI3B,GAAAS,EAAAtO,GAAA,EAAC8U,MAAAA,CACPC,IAAKH,EAAM/G,IAAI,CACfmH,IAAKf,EACLtU,UAAU,+BANH,GAAA2O,EAAAtO,GAAA,EAACG,MAAAA,UAAI,GAAAmO,EAAAtO,GAAA,EAAC6S,EAAAA,CAAWA,CAAAA,CAAAA,IAS5B","sources":["webpack://_N_E/./components/ai-elements/code-block.tsx","webpack://_N_E/./components/ai-elements/response.tsx","webpack://_N_E/./components/ui/alert.tsx","webpack://_N_E/./components/ui/collapsible.tsx","webpack://_N_E/./components/ui/tabs.tsx","webpack://_N_E/./components/ui/use-toast.ts","webpack://_N_E/./hooks/use-uppy.tsx","webpack://_N_E/./components/uppy-dashboard.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '@/components/ui/button';\nimport { cn } from '@/lib/utils';\nimport { CheckIcon, CopyIcon } from 'lucide-react';\nimport type { ComponentProps, HTMLAttributes, ReactNode } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport {\n oneDark,\n oneLight,\n} from 'react-syntax-highlighter/dist/esm/styles/prism';\n\ntype CodeBlockContextType = {\n code: string;\n};\n\nconst CodeBlockContext = createContext<CodeBlockContextType>({\n code: '',\n});\n\nexport type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {\n code: string;\n language: string;\n showLineNumbers?: boolean;\n children?: ReactNode;\n};\n\nexport const CodeBlock = ({\n code,\n language,\n showLineNumbers = false,\n className,\n children,\n ...props\n}: CodeBlockProps) => (\n <CodeBlockContext.Provider value={{ code }}>\n <div\n className={cn(\n 'relative w-full overflow-hidden rounded-md border bg-background text-foreground',\n className\n )}\n {...props}\n >\n <div className=\"relative\">\n <SyntaxHighlighter\n className=\"overflow-hidden dark:hidden\"\n codeTagProps={{\n className: 'font-mono text-sm',\n }}\n customStyle={{\n margin: 0,\n padding: '1rem',\n fontSize: '0.875rem',\n background: 'hsl(var(--background))',\n color: 'hsl(var(--foreground))',\n }}\n language={language}\n lineNumberStyle={{\n color: 'hsl(var(--muted-foreground))',\n paddingRight: '1rem',\n minWidth: '2.5rem',\n }}\n showLineNumbers={showLineNumbers}\n style={oneLight}\n >\n {code}\n </SyntaxHighlighter>\n <SyntaxHighlighter\n className=\"hidden overflow-hidden dark:block\"\n codeTagProps={{\n className: 'font-mono text-sm',\n }}\n customStyle={{\n margin: 0,\n padding: '1rem',\n fontSize: '0.875rem',\n background: 'hsl(var(--background))',\n color: 'hsl(var(--foreground))',\n }}\n language={language}\n lineNumberStyle={{\n color: 'hsl(var(--muted-foreground))',\n paddingRight: '1rem',\n minWidth: '2.5rem',\n }}\n showLineNumbers={showLineNumbers}\n style={oneDark}\n >\n {code}\n </SyntaxHighlighter>\n {children && (\n <div className=\"absolute top-2 right-2 flex items-center gap-2\">\n {children}\n </div>\n )}\n </div>\n </div>\n </CodeBlockContext.Provider>\n);\n\nexport type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {\n onCopy?: () => void;\n onError?: (error: Error) => void;\n timeout?: number;\n};\n\nexport const CodeBlockCopyButton = ({\n onCopy,\n onError,\n timeout = 2000,\n children,\n className,\n ...props\n}: CodeBlockCopyButtonProps) => {\n const [isCopied, setIsCopied] = useState(false);\n const { code } = useContext(CodeBlockContext);\n\n const copyToClipboard = async () => {\n if (typeof window === 'undefined' || !navigator.clipboard.writeText) {\n onError?.(new Error('Clipboard API not available'));\n return;\n }\n\n try {\n await navigator.clipboard.writeText(code);\n setIsCopied(true);\n onCopy?.();\n setTimeout(() => setIsCopied(false), timeout);\n } catch (error) {\n onError?.(error as Error);\n }\n };\n\n const Icon = isCopied ? CheckIcon : CopyIcon;\n\n return (\n <Button\n className={cn('shrink-0', className)}\n onClick={copyToClipboard}\n size=\"icon\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <Icon size={14} />}\n </Button>\n );\n};\n","'use client';\n\nimport { cn } from '@/lib/utils';\nimport type { ComponentProps, HTMLAttributes } from 'react';\nimport { isValidElement, memo } from 'react';\nimport ReactMarkdown, { type Options } from 'react-markdown';\nimport rehypeKatex from 'rehype-katex';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\nimport { CodeBlock, CodeBlockCopyButton } from './code-block';\nimport 'katex/dist/katex.min.css';\nimport hardenReactMarkdown from 'harden-react-markdown';\n\n/**\n * Parses markdown text and removes incomplete tokens to prevent partial rendering\n * of links, images, bold, and italic formatting during streaming.\n */\nfunction parseIncompleteMarkdown(text: string): string {\n if (!text || typeof text !== 'string') {\n return text;\n }\n\n let result = text;\n\n // Handle incomplete links and images\n // Pattern: [...] or ![...] where the closing ] is missing\n const linkImagePattern = /(!?\\[)([^\\]]*?)$/;\n const linkMatch = result.match(linkImagePattern);\n if (linkMatch) {\n // If we have an unterminated [ or ![, remove it and everything after\n const startIndex = result.lastIndexOf(linkMatch[1]);\n result = result.substring(0, startIndex);\n }\n\n // Handle incomplete bold formatting (**)\n const boldPattern = /(\\*\\*)([^*]*?)$/;\n const boldMatch = result.match(boldPattern);\n if (boldMatch) {\n // Count the number of ** in the entire string\n const asteriskPairs = (result.match(/\\*\\*/g) || []).length;\n // If odd number of **, we have an incomplete bold - complete it\n if (asteriskPairs % 2 === 1) {\n result = `${result}**`;\n }\n }\n\n // Handle incomplete italic formatting (__)\n const italicPattern = /(__)([^_]*?)$/;\n const italicMatch = result.match(italicPattern);\n if (italicMatch) {\n // Count the number of __ in the entire string\n const underscorePairs = (result.match(/__/g) || []).length;\n // If odd number of __, we have an incomplete italic - complete it\n if (underscorePairs % 2 === 1) {\n result = `${result}__`;\n }\n }\n\n // Handle incomplete single asterisk italic (*)\n const singleAsteriskPattern = /(\\*)([^*]*?)$/;\n const singleAsteriskMatch = result.match(singleAsteriskPattern);\n if (singleAsteriskMatch) {\n // Count single asterisks that aren't part of **\n const singleAsterisks = result.split('').reduce((acc, char, index) => {\n if (char === '*') {\n // Check if it's part of a ** pair\n const prevChar = result[index - 1];\n const nextChar = result[index + 1];\n if (prevChar !== '*' && nextChar !== '*') {\n return acc + 1;\n }\n }\n return acc;\n }, 0);\n\n // If odd number of single *, we have an incomplete italic - complete it\n if (singleAsterisks % 2 === 1) {\n result = `${result}*`;\n }\n }\n\n // Handle incomplete single underscore italic (_)\n const singleUnderscorePattern = /(_)([^_]*?)$/;\n const singleUnderscoreMatch = result.match(singleUnderscorePattern);\n if (singleUnderscoreMatch) {\n // Count single underscores that aren't part of __\n const singleUnderscores = result.split('').reduce((acc, char, index) => {\n if (char === '_') {\n // Check if it's part of a __ pair\n const prevChar = result[index - 1];\n const nextChar = result[index + 1];\n if (prevChar !== '_' && nextChar !== '_') {\n return acc + 1;\n }\n }\n return acc;\n }, 0);\n\n // If odd number of single _, we have an incomplete italic - complete it\n if (singleUnderscores % 2 === 1) {\n result = `${result}_`;\n }\n }\n\n // Handle incomplete inline code blocks (`) - but avoid code blocks (```)\n const inlineCodePattern = /(`)([^`]*?)$/;\n const inlineCodeMatch = result.match(inlineCodePattern);\n if (inlineCodeMatch) {\n // Check if we're dealing with a code block (triple backticks)\n const hasCodeBlockStart = result.includes('```');\n const codeBlockPattern = /```[\\s\\S]*?```/g;\n const completeCodeBlocks = (result.match(codeBlockPattern) || []).length;\n const allTripleBackticks = (result.match(/```/g) || []).length;\n\n // If we have an odd number of ``` sequences, we're inside an incomplete code block\n // In this case, don't complete inline code\n const insideIncompleteCodeBlock = allTripleBackticks % 2 === 1;\n\n if (!insideIncompleteCodeBlock) {\n // Count the number of single backticks that are NOT part of triple backticks\n let singleBacktickCount = 0;\n for (let i = 0; i < result.length; i++) {\n if (result[i] === '`') {\n // Check if this backtick is part of a triple backtick sequence\n const isTripleStart = result.substring(i, i + 3) === '```';\n const isTripleMiddle =\n i > 0 && result.substring(i - 1, i + 2) === '```';\n const isTripleEnd = i > 1 && result.substring(i - 2, i + 1) === '```';\n\n if (!(isTripleStart || isTripleMiddle || isTripleEnd)) {\n singleBacktickCount++;\n }\n }\n }\n\n // If odd number of single backticks, we have an incomplete inline code - complete it\n if (singleBacktickCount % 2 === 1) {\n result = `${result}\\``;\n }\n }\n }\n\n // Handle incomplete strikethrough formatting (~~)\n const strikethroughPattern = /(~~)([^~]*?)$/;\n const strikethroughMatch = result.match(strikethroughPattern);\n if (strikethroughMatch) {\n // Count the number of ~~ in the entire string\n const tildePairs = (result.match(/~~/g) || []).length;\n // If odd number of ~~, we have an incomplete strikethrough - complete it\n if (tildePairs % 2 === 1) {\n result = `${result}~~`;\n }\n }\n\n return result;\n}\n\n// Create a hardened version of ReactMarkdown\nconst HardenedMarkdown = hardenReactMarkdown(ReactMarkdown);\n\nexport type ResponseProps = HTMLAttributes<HTMLDivElement> & {\n options?: Options;\n children: Options['children'];\n allowedImagePrefixes?: ComponentProps<\n ReturnType<typeof hardenReactMarkdown>\n >['allowedImagePrefixes'];\n allowedLinkPrefixes?: ComponentProps<\n ReturnType<typeof hardenReactMarkdown>\n >['allowedLinkPrefixes'];\n defaultOrigin?: ComponentProps<\n ReturnType<typeof hardenReactMarkdown>\n >['defaultOrigin'];\n parseIncompleteMarkdown?: boolean;\n};\n\nconst components: Options['components'] = {\n ol: ({ node, children, className, ...props }) => (\n <ol className={cn('ml-4 list-outside list-decimal', className)} {...props}>\n {children}\n </ol>\n ),\n li: ({ node, children, className, ...props }) => (\n <li className={cn('py-1', className)} {...props}>\n {children}\n </li>\n ),\n ul: ({ node, children, className, ...props }) => (\n <ul className={cn('ml-4 list-outside list-disc', className)} {...props}>\n {children}\n </ul>\n ),\n hr: ({ node, className, ...props }) => (\n <hr className={cn('my-6 border-border', className)} {...props} />\n ),\n strong: ({ node, children, className, ...props }) => (\n <span className={cn('font-semibold', className)} {...props}>\n {children}\n </span>\n ),\n a: ({ node, children, className, ...props }) => (\n <a\n className={cn('font-medium text-primary underline', className)}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...props}\n >\n {children}\n </a>\n ),\n h1: ({ node, children, className, ...props }) => (\n <h1\n className={cn('mt-6 mb-2 font-semibold text-3xl', className)}\n {...props}\n >\n {children}\n </h1>\n ),\n h2: ({ node, children, className, ...props }) => (\n <h2\n className={cn('mt-6 mb-2 font-semibold text-2xl', className)}\n {...props}\n >\n {children}\n </h2>\n ),\n h3: ({ node, children, className, ...props }) => (\n <h3 className={cn('mt-6 mb-2 font-semibold text-xl', className)} {...props}>\n {children}\n </h3>\n ),\n h4: ({ node, children, className, ...props }) => (\n <h4 className={cn('mt-6 mb-2 font-semibold text-lg', className)} {...props}>\n {children}\n </h4>\n ),\n h5: ({ node, children, className, ...props }) => (\n <h5\n className={cn('mt-6 mb-2 font-semibold text-base', className)}\n {...props}\n >\n {children}\n </h5>\n ),\n h6: ({ node, children, className, ...props }) => (\n <h6 className={cn('mt-6 mb-2 font-semibold text-sm', className)} {...props}>\n {children}\n </h6>\n ),\n table: ({ node, children, className, ...props }) => (\n <div className=\"my-4 overflow-x-auto\">\n <table\n className={cn('w-full border-collapse border border-border', className)}\n {...props}\n >\n {children}\n </table>\n </div>\n ),\n thead: ({ node, children, className, ...props }) => (\n <thead className={cn('bg-muted/50', className)} {...props}>\n {children}\n </thead>\n ),\n tbody: ({ node, children, className, ...props }) => (\n <tbody className={cn('divide-y divide-border', className)} {...props}>\n {children}\n </tbody>\n ),\n tr: ({ node, children, className, ...props }) => (\n <tr className={cn('border-border border-b', className)} {...props}>\n {children}\n </tr>\n ),\n th: ({ node, children, className, ...props }) => (\n <th\n className={cn('px-4 py-2 text-left font-semibold text-sm', className)}\n {...props}\n >\n {children}\n </th>\n ),\n td: ({ node, children, className, ...props }) => (\n <td className={cn('px-4 py-2 text-sm', className)} {...props}>\n {children}\n </td>\n ),\n blockquote: ({ node, children, className, ...props }) => (\n <blockquote\n className={cn(\n 'my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic',\n className\n )}\n {...props}\n >\n {children}\n </blockquote>\n ),\n code: ({ node, className, ...props }) => {\n const inline = node?.position?.start.line === node?.position?.end.line;\n\n if (!inline) {\n return <code className={className} {...props} />;\n }\n\n return (\n <code\n className={cn(\n 'rounded bg-muted px-1.5 py-0.5 font-mono text-sm',\n className\n )}\n {...props}\n />\n );\n },\n pre: ({ node, className, children }) => {\n let language = 'javascript';\n\n if (typeof node?.properties?.className === 'string') {\n language = node.properties.className.replace('language-', '');\n }\n\n // Extract code content from children safely\n let code = '';\n if (\n isValidElement(children) &&\n children.props &&\n typeof children.props.children === 'string'\n ) {\n code = children.props.children;\n } else if (typeof children === 'string') {\n code = children;\n }\n\n return (\n <CodeBlock\n className={cn('my-4 h-auto', className)}\n code={code}\n language={language}\n >\n <CodeBlockCopyButton\n onCopy={() => console.log('Copied code to clipboard')}\n onError={() => console.error('Failed to copy code to clipboard')}\n />\n </CodeBlock>\n );\n },\n};\n\nexport const Response = memo(\n ({\n className,\n options,\n children,\n allowedImagePrefixes,\n allowedLinkPrefixes,\n defaultOrigin,\n parseIncompleteMarkdown: shouldParseIncompleteMarkdown = true,\n ...props\n }: ResponseProps) => {\n // Parse the children to remove incomplete markdown tokens if enabled\n const parsedChildren =\n typeof children === 'string' && shouldParseIncompleteMarkdown\n ? parseIncompleteMarkdown(children)\n : children;\n\n return (\n <div\n className={cn(\n 'size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n className\n )}\n {...props}\n >\n <HardenedMarkdown\n allowedImagePrefixes={allowedImagePrefixes ?? ['*']}\n allowedLinkPrefixes={allowedLinkPrefixes ?? ['*']}\n components={components}\n defaultOrigin={defaultOrigin}\n rehypePlugins={[rehypeKatex]}\n remarkPlugins={[remarkGfm, remarkMath]}\n {...options}\n >\n {parsedChildren}\n </HardenedMarkdown>\n </div>\n );\n },\n (prevProps, nextProps) => prevProps.children === nextProps.children\n);\n\nResponse.displayName = 'Response';\n","import { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n info: \"border-info/50 text-info dark:border-info [&>svg]:text-info\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n","\"use client\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","\"use client\";\n\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport type { ToastActionElement, ToastProps } from \"@/components/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t,\n ),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t,\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n","import { useEffect, useState, useContext } from \"react\";\nimport Uppy from \"@uppy/core\";\nimport AwsS3 from \"@uppy/aws-s3\";\nimport \"@uppy/core/dist/style.min.css\";\nimport \"@uppy/dashboard/dist/style.min.css\";\nimport '@uppy/core/dist/style.min.css';\nimport '@uppy/dashboard/dist/style.min.css';\nimport { getToken } from \"@/util/api\";\nimport { ConfigContext } from \"@/components/config-context\";\n\ninterface InitializeOptions {\n backend: string;\n callbacks?: {\n uploadSuccess?: (response: {\n file: any | null;\n url: string\n key: string\n }) => void;\n };\n fileKey?: string;\n fileKeyPrefix?: string;\n maxNumberOfFiles?: number;\n uppyOptions?: {\n id?: string;\n allowedFileTypes: string[];\n };\n useName?: boolean;\n}\n\nexport const initializeUppy = async (options: InitializeOptions): Promise<Uppy> => {\n if (!options.backend) {\n throw new Error(\"No backend set.\")\n }\n const { callbacks, maxNumberOfFiles, uppyOptions } = options || {};\n const { uploadSuccess } = callbacks || {};\n const { allowedFileTypes, id } = uppyOptions || {};\n const token = await getToken()\n\n const uppy = new Uppy({\n autoProceed: true,\n debug: false,\n id: id || \"uppy\",\n restrictions: {\n maxNumberOfFiles: maxNumberOfFiles || 5,\n allowedFileTypes: allowedFileTypes || [\".heic\", \".jpg\", \".jpeg\", \".png\", \".webp\", \".svg\"],\n }\n })\n .use(AwsS3, {\n id: \"Exulu\",\n endpoint: options.backend,\n headers: { \n Authorization: `Bearer ${token}`,\n Session: localStorage.getItem(\"session\") ?? \"\",\n }\n })\n .on(\"file-added\", async (file) => {\n console.debug(\"added\", file);\n })\n .on(\"upload-error\", (file, error) => {\n if (!file?.id) {\n return;\n }\n uppy.removeFile(file?.id);\n console.error(\"error\", error);\n })\n .on(\"upload-success\", (file, response) => {\n if (!response.uploadURL) {\n return;\n }\n if (uploadSuccess) {\n console.log(\"response\", response)\n uploadSuccess({\n file: file,\n key: response.uploadURL.split(\"/\").pop() || \"\",\n url: response.uploadURL,\n });\n }\n });\n\n return uppy;\n};\n\nfunction useUppy(options: InitializeOptions, deps: any[] = []) {\n const configContext = useContext(ConfigContext);\n const [uppy, setUppy] = useState<Uppy | undefined>(undefined);\n useEffect(() => {\n const initUppy = async () => {\n const uppyInstance = await initializeUppy({\n ...options,\n backend: configContext?.backend || \"\",\n });\n setUppy(uppyInstance);\n };\n initUppy()\n return () => {\n if (uppy) {\n uppy.destroy();\n setUppy(undefined);\n }\n };\n }, [...deps]);\n\n return uppy;\n}\n\nexport default useUppy;\n","import useUppy from \"@/hooks/use-uppy\";\nimport { Dashboard } from '@uppy/react';\nimport { useContext, useEffect, useState } from \"react\"\nimport { X, File, ImageIcon, FileText, FilePlus, Download, LoaderIcon, FileWarning, Upload, PlusSquareIcon, EyeIcon, PlusIcon, ChevronRightIcon, ChevronLeftIcon } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/ui/dialog\"\nimport { ScrollArea } from \"@/components/ui/scroll-area\"\nimport '@uppy/core/dist/style.min.css';\nimport '@uppy/dashboard/dist/style.min.css';\nimport { files, S3FileListOutput } from \"@/util/api\"\nimport { useTheme } from \"next-themes\";\nimport { ConfigContext } from \"./config-context\";\nimport { useQuery as useTanstackQuery, useMutation as useTanstackMutation } from \"@tanstack/react-query\";\nimport { Loading } from \"./ui/loading\";\nimport { allFileTypes } from \"@/types/models/agent\";\nimport { Input } from \"./ui/input\";\nimport { DoubleArrowLeftIcon } from \"@radix-ui/react-icons\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"./ui/card\";\nimport { Skeleton } from \"./ui/skeleton\";\n\nexport function FileDataCard({ s3key, children }: { s3key: string, children?: React.ReactNode }) {\n const { data, isLoading, error, refetch } = useTanstackQuery({\n queryKey: ['fileObject', s3key],\n queryFn: async () => {\n if (!s3key) {\n return null;\n }\n const result = await files.object(s3key);\n return result;\n },\n enabled: s3key !== undefined && s3key !== null,\n })\n\n useEffect(() => {\n if (s3key) {\n refetch();\n }\n }, [s3key]);\n\n if (!s3key) {\n return <Card>\n <CardContent className=\"p-3 flex\">\n <p className=\"text-sm text-muted-foreground m-auto\">No file selected</p>\n {children}\n </CardContent>\n </Card>;\n }\n\n let name = s3key;\n let bucket = s3key.split(\"/\")[0];\n name = s3key.split(\"/\").slice(1).join(\"/\");\n // Get the part after _EXULU_\n name = name.split(\"_EXULU_\").pop() || \"\";\n\n return <Card>\n <CardHeader className=\"pb-3\">\n <CardTitle className=\"text-sm max-w-[500px] truncate\">\n {name}\n </CardTitle>\n </CardHeader>\n <CardContent className=\"pt-0\">\n {\n isLoading && (\n <div className=\"space-y-2\">\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-2/3\" />\n </div>\n )\n }\n {!isLoading && data && (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span className=\"capitalize\">\n {data?.ContentType.split(\"/\").pop()}\n {bucket && ` Bucket: ${bucket}`}\n </span>\n <span>{(data?.ContentLength / 1024 / 1024).toFixed(2)} MB</span>\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>Last modified: {new Date(data?.LastModified).toLocaleDateString(\"en-US\", { year: \"numeric\", month: \"long\", day: \"numeric\", hour: \"2-digit\", minute: \"2-digit\" })}</span>\n <Button\n variant=\"secondary\"\n size=\"sm\"\n type=\"button\"\n className=\"h-7 px-2\"\n onClick={() => {\n files.download(s3key).then(async res => {\n console.log(\"res\", res);\n const json = await res.json()\n console.log(\"res\", json);\n const downloadUrl = json.url;\n window.open(downloadUrl, '_blank');\n return;\n })\n }}>\n <span className=\"mr-1 text-xs\">View</span>\n <Download className=\"h-3 w-3\" />\n </Button>\n </div>\n </div>\n )}\n {\n !isLoading && error && (\n <p className=\"text-xs text-muted-foreground\">{error.message}</p>\n )\n }\n {children}\n </CardContent>\n </Card>\n}\n\nexport default function UppyDashboard({ id, allowedFileTypes, dependencies, onConfirm, selectionLimit, buttonText }: {\n id: string,\n buttonText?: string,\n allowedFileTypes?: allFileTypes[],\n selectionLimit: number,\n dependencies: any[],\n onConfirm: (keys: string[]) => void\n}) {\n const [open, setOpen] = useState(false)\n return <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"outline\">\n {buttonText && (\n <span className=\"mr-2\">{buttonText}</span>\n )\n }\n <FilePlus className=\"h-4 w-4\" />\n </Button>\n </DialogTrigger>\n <DialogContent className=\"sm:max-w-[900px]\">\n <DialogHeader>\n <DialogTitle>File Gallery</DialogTitle>\n <DialogDescription>Browse your previously uploaded files or upload new ones.</DialogDescription>\n </DialogHeader>\n <FileGalleryAndUpload\n id={id}\n allowedFileTypes={allowedFileTypes}\n dependencies={dependencies}\n selectionLimit={selectionLimit}\n onConfirm={(data) => {\n onConfirm(data)\n setOpen(false)\n }}\n />\n </DialogContent>\n </Dialog>;\n}\n\nexport const FileGalleryAndUpload = ({ id, allowedFileTypes, dependencies, onConfirm, selectionLimit }: {\n id: string,\n allowedFileTypes?: allFileTypes[],\n dependencies: any[],\n selectionLimit: number,\n onConfirm: (keys: string[]) => void\n}) => {\n\n if (!allowedFileTypes) {\n allowedFileTypes = [\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.pdf',\n '.docx',\n '.xlsx',\n '.xls',\n '.csv',\n '.pptx',\n '.ppt',\n '.mp3',\n '.wav',\n '.m4a',\n '.mp4',\n '.mpeg',\n '.mp4',\n '.m4a',\n '.mp3',\n '.mpeg',\n '.wav'\n ]\n }\n\n const [search, setSearch] = useState<string | undefined>(undefined)\n const [previousContinuationToken, setPreviousContinuationToken] = useState<string | undefined>(undefined)\n const [currentContinuationToken, setCurrentContinuationToken] = useState<string | undefined>(undefined)\n const configContext = useContext(ConfigContext);\n const [selected, setSelected] = useState<string[]>([])\n\n const addSelected = (key: string) => {\n if (selected.includes(key)) {\n setSelected(selected.filter((s) => s !== key))\n return;\n }\n if (selectionLimit === 1) {\n setSelected([key])\n return;\n }\n if (selected.length >= selectionLimit) {\n return;\n }\n setSelected([...selected, key])\n }\n\n const deleteFile = useTanstackMutation({\n mutationFn: async ({ key }: { key: string }) => {\n await files.delete(key)\n refetch();\n return;\n }\n })\n\n const { data, isLoading: loading, error, refetch } = useTanstackQuery({\n queryKey: ['filesQuery', search, currentContinuationToken],\n staleTime: 30000,\n queryFn: async (): Promise<S3FileListOutput> => {\n return files.list({\n search,\n continuationToken: currentContinuationToken\n })\n },\n })\n\n console.log(\"!! data !!\", data)\n\n const { theme } = useTheme()\n const uppy = useUppy(\n {\n backend: configContext?.backend || \"\",\n uppyOptions: {\n id,\n allowedFileTypes\n },\n callbacks: {\n uploadSuccess: async (data) => {\n console.log(\"data\", data)\n /* \n We no longer create items automatically for files uploaded via uppy.\n const item = {\n name: data.file.name,\n type: data.file.type,\n rights_mode: \"private\",\n s3key: `${user?.id}/${data.key}`\n }\n await createItemMutation({ variables: { input: item } }) */\n },\n },\n maxNumberOfFiles: 10,\n },\n dependencies,\n );\n\n useEffect(() => {\n refetch();\n }, [search, currentContinuationToken]);\n\n // Loading state\n if (!uppy) {\n return null;\n }\n\n return <>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4\">\n {/* Left side - Gallery of previously uploaded files */}\n <div className=\"border rounded-lg p-4\">\n <h3 className=\"text-sm font-medium mb-3\">Previously Uploaded Files</h3>\n\n {/* search */}\n <Input\n placeholder=\"Search files...\"\n value={search}\n onChange={(e) => setSearch(e.target.value)}\n className=\"mb-3\"\n />\n <div className=\"flex items-center justify-between text-xs text-muted-foreground pb-2\">\n <span>{selected.length} / {selectionLimit} files selected</span>\n <span>Allowed file types: {allowedFileTypes?.map((type) => type).join(\", \")}</span>\n </div>\n <ScrollArea>\n {loading && (\n <div className=\"flex items-center justify-center h-full w-full grid grid-cols-2 sm:grid-cols-3 gap-3\">\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n <Skeleton className=\"h-[120px] w-full\" />\n </div>\n )}\n <div className=\"grid grid-cols-2 sm:grid-cols-3 gap-3\">\n {\n !loading && !data?.Contents?.length && (\n <div className=\"col-span-full flex flex-col items-center justify-center py-12 text-center\">\n <FileWarning className=\"h-12 w-12 text-muted-foreground/50 mb-3\" />\n <p className=\"text-sm font-medium text-muted-foreground\">Nothing to see here... yet!</p>\n <p className=\"text-xs text-muted-foreground/75 mt-1\">Upload some files to get started</p>\n </div>\n )\n }\n {data?.Contents?.map((item: S3FileListOutput[\"Contents\"][0]) => {\n return (\n <FileItem s3Key={item.Key} onSelect={addSelected} active={selected.some((s) => s === item.Key)} onRemove={() => {\n deleteFile.mutate({\n key: item.Key\n })\n }} disabled={!allowedFileTypes ? false : !allowedFileTypes?.some((type) => item.Key.endsWith(type))} />\n )\n })}\n </div>\n\n <div className=\"flex items-center space-x-6 lg:space-x-8 pt-3\">\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n className=\"hidden size-8 p-0 lg:flex\"\n onClick={() => {\n setCurrentContinuationToken(undefined)\n }}\n disabled={\n !currentContinuationToken ||\n loading\n }\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n className=\"size-8 p-0\"\n onClick={() => {\n setCurrentContinuationToken(previousContinuationToken)\n }}\n disabled={\n !currentContinuationToken ||\n loading\n }\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n className=\"size-8 p-0\"\n onClick={() => {\n setPreviousContinuationToken(currentContinuationToken)\n setCurrentContinuationToken(data?.NextContinuationToken)\n }}\n disabled={\n !data?.NextContinuationToken ||\n loading\n }>\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </ScrollArea>\n </div>\n {/* Right side - Upload area */}\n <div className=\"border rounded-lg p-4\">\n <h3 className=\"text-sm font-medium mb-3\">Upload New Files</h3>\n <Dashboard uppy={uppy} theme={theme === \"dark\" ? \"dark\" : \"light\"} />\n </div>\n </div>\n <div className=\"flex justify-end\">\n <Button variant=\"outline\" onClick={() => {\n onConfirm(selected)\n setSelected([])\n }}>\n Confirm\n </Button>\n </div>\n </>\n}\n\nexport const FileItem = ({ s3Key, onSelect, onRemove, active, disabled, addToContext }: {\n s3Key: string,\n onSelect?: (key: string) => void,\n onRemove?: (key: string) => void,\n active: boolean,\n disabled: boolean,\n addToContext?: (key: string) => void\n}) => {\n const getFileIcon = (s3Key: string) => {\n if (!s3Key) {\n return <FileText className=\"h-6 w-6 text-gray-500\" />\n }\n if (\n s3Key.toLowerCase().endsWith(\"jpg\") ||\n s3Key.toLowerCase().endsWith(\"jpeg\") ||\n s3Key.toLowerCase().endsWith(\"png\") ||\n s3Key.toLowerCase().endsWith(\"svg\")\n ) {\n return <ImageIcon className=\"h-6 w-6 text-blue-500\" />\n } else if (s3Key.endsWith(\"pdf\")) {\n return <File className=\"h-6 w-6 text-red-500\" />\n } else if (s3Key.endsWith(\"xls\") || s3Key.endsWith(\"xlsx\") || s3Key.endsWith(\"csv\")) {\n return <FileText className=\"h-6 w-6 text-green-500\" />\n } else if (s3Key.endsWith(\"ppt\") || s3Key.endsWith(\"pptx\")) {\n return <FileText className=\"h-6 w-6 text-orange-500\" />\n } else {\n return <FileText className=\"h-6 w-6 text-gray-500\" />\n }\n }\n\n return (\n <div\n key={s3Key}\n className={`${disabled ? 'opacity-50' : ''} group relative rounded-lg p-2 hover:bg-muted transition-colors cursor-pointer ${active ? 'border border-purple-500' : 'border'}`}\n onClick={() => {\n if (!disabled && onSelect) {\n onSelect(s3Key)\n }\n }}>\n <div className=\"aspect-square relative mb-2 bg-muted/50 rounded-md overflow-hidden flex items-center justify-center\">\n {(\n s3Key && (\n s3Key.toLowerCase().endsWith(\"jpg\") ||\n s3Key.toLowerCase().endsWith(\"jpeg\") ||\n s3Key.toLowerCase().endsWith(\"png\") ||\n s3Key.toLowerCase().endsWith(\"svg\")\n )\n ) ? (\n <SecureImageRenderComponent fileKey={s3Key} />\n ) : (\n <div className=\"flex flex-col items-center justify-center h-full\">\n {getFileIcon(s3Key)}\n <span className=\"text-xs text-muted-foreground mt-1 text-center\">{s3Key ? s3Key.split(\"_EXULU_\").pop() : s3Key}</span>\n </div>\n )}\n </div>\n <p className=\"text-xs truncate\">{s3Key ? s3Key.split(\"_EXULU_\").pop() : s3Key}</p>\n <div className=\"opacity-0 group-hover:opacity-100 flex absolute top-1 right-1\">\n\n {addToContext && (\n <Button variant=\"ghost\" size=\"icon\" type=\"button\" className=\"h-6 w-6 bg-background/80 hover:bg-background\" onClick={() => {\n addToContext(s3Key)\n }}>\n <PlusIcon className=\"h-3 w-3\" />\n <span className=\"sr-only\">Add</span>\n </Button>\n )}\n\n <Button\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n className=\"h-6 w-6 bg-background/80 hover:bg-background\"\n onClick={() => {\n files.download(s3Key).then(async res => {\n console.log(\"res\", res);\n const json = await res.json()\n console.log(\"res\", json);\n const downloadUrl = json.url;\n window.open(downloadUrl, '_blank');\n return;\n })\n }}>\n <Download className=\"h-3 w-3\" />\n <span className=\"sr-only\">View</span>\n </Button>\n\n {onRemove && (\n <Button\n onClick={(e) => {\n e.stopPropagation()\n onRemove(s3Key)\n }}\n variant=\"ghost\"\n type=\"button\"\n size=\"icon\"\n className=\"h-6 w-6 opacity-0 group-hover:opacity-100 bg-background/80 hover:bg-background ml-1\">\n <X className=\"h-3 w-3\" />\n <span className=\"sr-only\">Remove</span>\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nlet signedUrlCache: {\n [key: string]: {\n url: string;\n expiresAt: number;\n }\n} = {};\n\nexport const getPresignedUrl = async (fileKey: string) => {\n if (signedUrlCache[fileKey]) {\n if (signedUrlCache[fileKey].expiresAt < Date.now()) {\n delete signedUrlCache[fileKey];\n } else {\n return signedUrlCache[fileKey].url;\n }\n }\n const response = await files.download(fileKey)\n const json = await response.json();\n console.log(\"json\", json)\n signedUrlCache[fileKey] = {\n url: json.url,\n expiresAt: Date.now() + 60 * 1000, // 1 minute\n }\n return json.url;\n}\n\nconst SecureImageRenderComponent = ({ fileKey }: { fileKey: string }) => {\n // Gets a signed key to show the image\n console.log(\"key\", fileKey)\n const query = useTanstackQuery({\n queryKey: ['imageQuery', fileKey],\n staleTime: 30000,\n queryFn: async () => {\n return getPresignedUrl(fileKey)\n },\n })\n\n if (query.isLoading) {\n return <div><LoaderIcon /></div>\n }\n\n if (!query.isLoading && !query.data) {\n return <div><FileWarning /></div>\n }\n\n return (<img\n src={query.data}\n alt={fileKey}\n className=\"object-cover w-full h-full\"\n />)\n\n}"],"names":["CodeBlockContext","createContext","code","CodeBlock","language","showLineNumbers","className","children","props","param","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","Provider","value","div","cn","jsxs","SyntaxHighlighter","codeTagProps","customStyle","margin","padding","fontSize","background","color","lineNumberStyle","paddingRight","minWidth","style","oneLight","oneDark","CodeBlockCopyButton","onCopy","onError","timeout","isCopied","setIsCopied","useState","useContext","copyToClipboard","navigator","clipboard","writeText","setTimeout","error","Icon","CheckIcon","CopyIcon","Button","onClick","size","variant","HardenedMarkdown","hardenReactMarkdown","ReactMarkdown","components","ol","node","li","ul","hr","strong","span","a","rel","target","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","th","td","blockquote","position","start","line","end","pre","properties","replace","isValidElement","console","log","Response","memo","options","allowedImagePrefixes","allowedLinkPrefixes","defaultOrigin","parseIncompleteMarkdown","shouldParseIncompleteMarkdown","parsedChildren","text","result","linkMatch","match","startIndex","lastIndexOf","substring","asteriskPairs","length","concat","underscorePairs","singleAsterisks","split","reduce","acc","char","index","prevChar","nextChar","singleUnderscores","includes","singleBacktickCount","i","isTripleStart","isTripleMiddle","isTripleEnd","tildePairs","rehypePlugins","rehypeKatex","remarkPlugins","remarkGfm","remarkMath","prevProps","nextProps","displayName","alertVariants","cva","variants","default","destructive","info","defaultVariants","Alert","React","ref","role","AlertTitle","AlertDescription","Collapsible","CollapsiblePrimitive","CollapsibleTrigger","CollapsibleContent","Tabs","TabsPrimitive","TabsList","TabsTrigger","TabsContent","count","toastTimeouts","Map","addToRemoveQueue","has","toastId","delete","dispatch","type","set","reducer","state","action","toasts","toast","slice","map","t","id","forEach","undefined","open","filter","listeners","memoryState","listener","Number","MAX_SAFE_INTEGER","toString","dismiss","onOpenChange","update","useToast","setState","push","indexOf","splice","initializeUppy","localStorage","backend","callbacks","maxNumberOfFiles","uppyOptions","uploadSuccess","allowedFileTypes","token","getToken","uppy","Uppy","autoProceed","debug","restrictions","use","AwsS3","endpoint","headers","Authorization","Session","getItem","on","file","removeFile","response","uploadURL","key","pop","url","use_uppy","deps","configContext","ConfigContext","setUppy","useEffect","initUppy","destroy","FileDataCard","s3key","data","isLoading","refetch","useTanstackQuery","queryKey","queryFn","files","object","enabled","jsx_runtime","Card","CardContent","p","name","bucket","join","CardHeader","CardTitle","Skeleton","ContentType","ContentLength","toFixed","Date","LastModified","toLocaleDateString","year","month","day","hour","minute","download","then","res","json","downloadUrl","window","Download","message","UppyDashboard","dependencies","onConfirm","selectionLimit","buttonText","setOpen","Dialog","DialogTrigger","asChild","FilePlus","DialogContent","DialogHeader","DialogTitle","DialogDescription","FileGalleryAndUpload","search","setSearch","previousContinuationToken","setPreviousContinuationToken","currentContinuationToken","setCurrentContinuationToken","selected","setSelected","addSelected","s","deleteFile","useTanstackMutation","mutationFn","loading","staleTime","list","continuationToken","theme","useTheme","useUppy","Fragment","Input","placeholder","onChange","e","ScrollArea","Contents","FileWarning","FileItem","s3Key","item","Key","onSelect","active","some","onRemove","mutate","disabled","endsWith","DoubleArrowLeftIcon","ChevronLeftIcon","NextContinuationToken","ChevronRightIcon","Dashboard","addToContext","toLowerCase","SecureImageRenderComponent","fileKey","ImageIcon","File","FileText","PlusIcon","stopPropagation","X","signedUrlCache","getPresignedUrl","expiresAt","now","query","LoaderIcon","img","src","alt"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
1
  "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3832],{13832:function(e,a,t){t.d(a,{S:function(){return eu},default:function(){return ep}});var r=t(57437),s=t(24614),n=t(71946),i=t(81068),d=t(63761),o=t(51251),l=t(51451),c=t(80605),u=t(2265),f=t(27648),p=t(99376),m=t(37053),b=t(90535),h=t(30755),x=t(866),g=t(94508),v=t(62869),w=t(95186),j=t(6512),N=t(69304),y=t(93022),k=t(81103);let z=u.createContext(null);function R(){let e=u.useContext(z);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let S=u.forwardRef((e,a)=>{let{defaultOpen:t=!0,open:s,onOpenChange:n,className:i,style:d,children:o,...l}=e,c=(0,x.d)(),[f,p]=u.useState(!1),[m,b]=u.useState(t),h=null!=s?s:m,v=u.useCallback(e=>{let a="function"==typeof e?e(h):e;n?n(a):b(a),document.cookie="".concat("sidebar_state","=").concat(a,"; path=/; max-age=").concat(604800)},[n,h]),w=u.useCallback(()=>c?p(e=>!e):v(e=>!e),[c,v,p]);u.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),w())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[w]);let j=h?"expanded":"collapsed",N=u.useMemo(()=>({state:j,open:h,setOpen:v,isMobile:c,openMobile:f,setOpenMobile:p,toggleSidebar:w}),[j,h,v,c,f,p,w]);return(0,r.jsx)(z.Provider,{value:N,children:(0,r.jsx)(k.pn,{delayDuration:0,children:(0,r.jsx)("div",{style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...d},className:(0,g.cn)("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",i),ref:a,...l,children:o})})})});S.displayName="SidebarProvider";let _=u.forwardRef((e,a)=>{let{side:t="left",variant:s="sidebar",collapsible:n="offcanvas",className:i,children:d,...o}=e,{isMobile:l,state:c,openMobile:u,setOpenMobile:f}=R();return"none"===n?(0,r.jsx)("div",{className:(0,g.cn)("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",i),ref:a,...o,children:d}):l?(0,r.jsx)(N.yo,{open:u,onOpenChange:f,...o,children:(0,r.jsxs)(N.ue,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:t,children:[(0,r.jsxs)(N.Tu,{className:"sr-only",children:[(0,r.jsx)(N.bC,{children:"Sidebar"}),(0,r.jsx)(N.Ei,{children:"Displays the mobile sidebar."})]}),(0,r.jsx)("div",{className:"flex h-full w-full flex-col",children:d})]})}):(0,r.jsxs)("div",{ref:a,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":"collapsed"===c?n:"","data-variant":s,"data-side":t,children:[(0,r.jsx)("div",{className:(0,g.cn)("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===s||"inset"===s?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,r.jsx)("div",{className:(0,g.cn)("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex","left"===t?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===s||"inset"===s?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...o,children:(0,r.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:d})})]})});_.displayName="Sidebar";let C=u.forwardRef((e,a)=>{let{className:t,onClick:s,...n}=e,{toggleSidebar:i}=R();return(0,r.jsxs)(v.z,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,g.cn)("h-7 w-7",t),onClick:e=>{null==s||s(e),i()},...n,children:[(0,r.jsx)(h.Z,{}),(0,r.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});C.displayName="SidebarTrigger",u.forwardRef((e,a)=>{let{className:t,...s}=e,{toggleSidebar:n}=R();return(0,r.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:(0,g.cn)("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...s})}).displayName="SidebarRail",u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("main",{ref:a,className:(0,g.cn)("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",t),...s})}).displayName="SidebarInset",u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)(w.I,{ref:a,"data-sidebar":"input",className:(0,g.cn)("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",t),...s})}).displayName="SidebarInput",u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("div",{ref:a,"data-sidebar":"header",className:(0,g.cn)("flex flex-col gap-2 p-2",t),...s})}).displayName="SidebarHeader";let E=u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("div",{ref:a,"data-sidebar":"footer",className:(0,g.cn)("flex flex-col gap-2 p-2",t),...s})});E.displayName="SidebarFooter",u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)(j.Z,{ref:a,"data-sidebar":"separator",className:(0,g.cn)("mx-2 w-auto bg-sidebar-border",t),...s})}).displayName="SidebarSeparator";let Z=u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("div",{ref:a,"data-sidebar":"content",className:(0,g.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})});Z.displayName="SidebarContent";let T=u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("div",{ref:a,"data-sidebar":"group",className:(0,g.cn)("relative flex w-full min-w-0 flex-col p-0",t),...s})});T.displayName="SidebarGroup",u.forwardRef((e,a)=>{let{className:t,asChild:s=!1,...n}=e,i=s?m.g7:"div";return(0,r.jsx)(i,{ref:a,"data-sidebar":"group-label",className:(0,g.cn)("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}).displayName="SidebarGroupLabel",u.forwardRef((e,a)=>{let{className:t,asChild:s=!1,...n}=e,i=s?m.g7:"button";return(0,r.jsx)(i,{ref:a,"data-sidebar":"group-action",className:(0,g.cn)("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",t),...n})}).displayName="SidebarGroupAction";let P=u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("div",{ref:a,"data-sidebar":"group-content",className:(0,g.cn)("w-full text-sm",t),...s})});P.displayName="SidebarGroupContent";let O=u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("ul",{ref:a,"data-sidebar":"menu",className:(0,g.cn)("flex w-full min-w-0 flex-col gap-1",t),...s})});O.displayName="SidebarMenu";let A=u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:(0,g.cn)("group/menu-item relative",t),...s})});A.displayName="SidebarMenuItem";let M=(0,b.j)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-[0.40rem] [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),D=u.forwardRef((e,a)=>{let{asChild:t=!1,isActive:s=!1,variant:n="default",size:i="default",tooltip:d,className:o,...l}=e,c=t?m.g7:"button",{isMobile:u,state:f}=R(),p=(0,r.jsx)(c,{ref:a,"data-sidebar":"menu-button","data-size":i,"data-active":s,className:(0,g.cn)(M({variant:n,size:i}),o),...l});return d?("string"==typeof d&&(d={children:d}),(0,r.jsxs)(k.u,{children:[(0,r.jsx)(k.aJ,{asChild:!0,children:p}),(0,r.jsx)(k._v,{side:"right",align:"center",hidden:"collapsed"!==f||u,...d})]})):p});D.displayName="SidebarMenuButton",u.forwardRef((e,a)=>{let{className:t,asChild:s=!1,showOnHover:n=!1,...i}=e,d=s?m.g7:"button";return(0,r.jsx)(d,{ref:a,"data-sidebar":"menu-action",className:(0,g.cn)("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",t),...i})}).displayName="SidebarMenuAction",u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:(0,g.cn)("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...s})}).displayName="SidebarMenuBadge",u.forwardRef((e,a)=>{let{className:t,showIcon:s=!1,...n}=e,i=u.useMemo(()=>"".concat(Math.floor(40*Math.random())+50,"%"),[]);return(0,r.jsxs)("div",{ref:a,"data-sidebar":"menu-skeleton",className:(0,g.cn)("flex h-8 items-center gap-2 rounded-md px-2",t),...n,children:[s&&(0,r.jsx)(y.O,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,r.jsx)(y.O,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})}).displayName="SidebarMenuSkeleton",u.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:(0,g.cn)("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...s})}).displayName="SidebarMenuSub",u.forwardRef((e,a)=>{let{...t}=e;return(0,r.jsx)("li",{ref:a,...t})}).displayName="SidebarMenuSubItem",u.forwardRef((e,a)=>{let{asChild:t=!1,size:s="md",isActive:n,className:i,...d}=e,o=t?m.g7:"a";return(0,r.jsx)(o,{ref:a,"data-sidebar":"menu-sub-button","data-size":s,"data-active":n,className:(0,g.cn)("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===s&&"text-xs","md"===s&&"text-sm","group-data-[collapsible=icon]:hidden",i),...d})}).displayName="SidebarMenuSubButton";var L=t(84190),V=t(25466),B=t(50091),q=t(82222),I=t(56475),U=t(82718),Y=t(48713),F=t(64972),G=t(95805),J=t(54001),Q=t(32790),K=t(64935),W=t(98728),X=t(82023),H=t(22135),$=t(85929),ee=t(97226),ea=t(47692),et=t(78298),er=t(16831),es=t(21391);let en=(e,a)=>{let t=[];return e.super_admin&&t.push({label:"Dashboard",path:"dashboard",icon:(0,r.jsx)(V.Z,{})}),t.push({label:"Knowledge",path:"data",icon:(0,r.jsx)(B.Z,{})}),(e.super_admin||"write"===a.agents)&&t.push({label:"Agents",path:"agents",icon:(0,r.jsx)(q.Z,{})}),t.push({label:"Projects",path:"projects",icon:(0,r.jsx)(I.Z,{})}),t.push({label:"Chat",path:"chat",icon:(0,r.jsx)(U.Z,{})}),t.push({label:"Prompts",path:"prompts",icon:(0,r.jsx)(Y.Z,{})}),(e.super_admin||"read"===a.evals||"write"===a.evals)&&t.push({label:"Evals",path:"evals",icon:(0,r.jsx)(F.Z,{})}),(e.super_admin||"write"===a.users)&&t.push({label:"Users",path:"users",icon:(0,r.jsx)(G.Z,{})}),(e.super_admin||"write"===a.api)&&t.push({label:"Keys",path:"keys",icon:(0,r.jsx)(J.Z,{})}),(e.super_admin||"write"===a.variables)&&t.push({label:"Variables",path:"variables",icon:(0,r.jsx)(Q.Z,{})}),(e.super_admin||"write"===a.api)&&t.push({label:"API",path:"explorer",icon:(0,r.jsx)(K.Z,{})}),e.super_admin&&t.push({label:"Theme",path:"configuration",icon:(0,r.jsx)(W.Z,{})}),t};function ei(e){let{items:a}=e,t=(0,p.usePathname)();return(0,r.jsx)(O,{className:"space-y-1",children:a.map((e,a)=>{let s=t.includes(e.path);return(0,r.jsx)(A,{children:(0,r.jsx)(D,{asChild:!0,isActive:s,tooltip:e.label,className:(0,g.cn)("h-10 transition-all duration-200"),children:(0,r.jsxs)(f.default,{href:"/".concat(e.path),className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:(0,g.cn)("flex h-5 w-5 items-center justify-center transition-colors"),children:e.icon}),(0,r.jsx)("span",{className:(0,g.cn)("font-medium transition-colors"),children:e.label})]})})},a)})})}function ed(e){let{sidebarDefaultOpen:a}=e,{user:t}=(0,u.useContext)(eu),s=en(t,t.role),n=(0,p.useRouter)(),{setTheme:i,theme:d}=(0,et.F)(),o=(0,p.useParams)(),l=R();return(0,u.useEffect)(()=>{o.agent&&void 0===a&&l.setOpen(!1)},[o.agent]),(0,r.jsxs)(_,{collapsible:"icon",className:"border-r",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 border-b bg-background/80 backdrop-blur-sm p-[12px] sticky top-0 z-10",children:[(0,r.jsx)(C,{}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)(es.default,{alt:"Logo",width:100,height:40})})]}),(0,r.jsx)(Z,{className:"px-2",children:(0,r.jsx)(T,{className:"mt-4",children:(0,r.jsx)(P,{children:(0,r.jsx)(ei,{items:s})})})}),(0,r.jsxs)(E,{className:"border-t bg-muted/20 p-[5px]",children:[(0,r.jsx)("div",{className:"px-2 pb-1 group-data-[collapsible=icon]:hidden",children:(0,r.jsxs)("div",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/20 bg-primary/5 px-2.5 py-0.5",children:[(0,r.jsx)(X.Z,{className:"h-3 w-3 text-primary"}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:"Beta"})]})}),(0,r.jsx)(O,{children:(0,r.jsx)(A,{children:(0,r.jsxs)(L.h_,{modal:!1,children:[(0,r.jsx)(L.$F,{asChild:!0,children:(0,r.jsxs)(D,{className:"h-12 hover:bg-accent/50",children:[(0,r.jsx)(er.qE,{className:"h-5 w-5",children:(0,r.jsx)(er.Q5,{className:"bg-gradient-to-br from-primary/20 to-primary/60 text-white text-sm",children:t.email.charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"flex flex-col items-start group-data-[collapsible=icon]:hidden",children:[(0,r.jsx)("span",{className:"text-sm font-medium capitalize",children:t.email.split("@")[0]}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:t.email.split("@")[1]})})]}),(0,r.jsx)(H.Z,{className:"ml-auto h-4 w-4 group-data-[collapsible=icon]:hidden"})]})}),(0,r.jsxs)(L.AW,{side:"top",className:"w-[--radix-popper-anchor-width] mb-2",align:"start",children:[(0,r.jsx)(L.Xi,{onClick:()=>i("dark"===d?"light":"dark"),children:(0,r.jsxs)("div",{className:"flex items-center gap-2 w-full",children:["dark"===d?(0,r.jsx)($.Z,{className:"h-4 w-4"}):(0,r.jsx)(ee.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:"Theme"})]})}),(0,r.jsx)(L.Xi,{onClick:()=>n.push("/api/auth/signout"),children:(0,r.jsxs)("div",{className:"flex items-center gap-2 w-full",children:[(0,r.jsx)(ea.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:"Logout"})]})})]})]})})})]})]})}function eo(e){let{children:a,sidebarDefaultOpen:t}=e;return console.log("sidebarDefaultOpen",t),(0,r.jsx)(S,{defaultOpen:t,children:(0,r.jsxs)("div",{className:"flex w-full bg-background overflow-hidden",children:[(0,r.jsx)(ed,{sidebarDefaultOpen:t}),(0,r.jsx)("main",{className:"flex-1 overflow-auto",children:a})]})})}var el=t(6374),ec=t(44045);let eu=u.createContext(null),ef=e=>{let{children:a,user:t,sidebarDefaultOpen:s}=e;return(0,r.jsx)(eu.Provider,{value:{user:t},children:(0,r.jsx)(eo,{sidebarDefaultOpen:s,children:a})})};var ep=e=>{let{children:a,user:t,sidebarDefaultOpen:f}=e,p=u.useContext(ec.E),m=(null==p?void 0:p.backend)?(null==p?void 0:p.backend)+"/graphql":"http://localhost:9001/graphql",b=(0,l.v)((e,a)=>({headers:{Accept:"charset=utf-8"}})),h=(0,l.v)(async(e,a)=>{let t=await (0,el.LP)();return{headers:{Authorization:"Bearer ".concat(t)}}}),x=s.i.from([b,h,new n.u({uri:m})]),g=new i.f({uri:m,cache:new d.h({addTypename:!1}),link:x,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}});return(0,r.jsx)(o.e,{client:g,children:(0,r.jsx)(c.SessionProvider,{children:(0,r.jsx)(ef,{sidebarDefaultOpen:f,user:t,children:a})})})}},44045:function(e,a,t){t.d(a,{ConfigContextProvider:function(){return n},E:function(){return s}});var r=t(57437);let s=(0,t(2265).createContext)(null);function n(e){let{children:a,config:t}=e;if(console.log("[EXULU] Config: ",t),!t)throw Error("Config not found");return(0,r.jsx)(s.Provider,{value:t,children:a})}},21391:function(e,a,t){var r=t(57437),s=t(44045),n=t(2265);a.default=e=>{let{width:a=64,height:t=32,className:i="",alt:d="Logo"}=e,o=(0,n.useContext)(s.E);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:(null==o?void 0:o.backend)+"/logo_dark.png",alt:d,width:a,height:t,className:i+"hidden dark:block"}),(0,r.jsx)("img",{src:(null==o?void 0:o.backend)+"/logo_light.png",alt:d,width:a,height:t,className:i+"block dark:hidden"})]})}},16831:function(e,a,t){t.d(a,{Q5:function(){return o},qE:function(){return d}});var r=t(57437),s=t(61146),n=t(2265),i=t(94508);let d=n.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.fC,{ref:a,className:(0,i.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n})});d.displayName=s.fC.displayName,n.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.Ee,{ref:a,className:(0,i.cn)("aspect-square h-full w-full",t),...n})}).displayName=s.Ee.displayName;let o=n.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.NY,{ref:a,className:(0,i.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n})});o.displayName=s.NY.displayName},84190:function(e,a,t){t.d(a,{$F:function(){return u},AW:function(){return p},Ju:function(){return x},VD:function(){return g},Xi:function(){return m},_x:function(){return f},bO:function(){return b},h_:function(){return c},qB:function(){return h}});var r=t(57437),s=t(70085),n=t(10407),i=t(30401),d=t(40519),o=t(2265),l=t(94508);let c=s.fC,u=s.xz;s.ZA,s.Uv,s.Tr;let f=s.Ee;o.forwardRef((e,a)=>{let{className:t,inset:i,children:d,...o}=e;return(0,r.jsxs)(s.fF,{ref:a,className:(0,l.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",i&&"pl-8",t),...o,children:[d,(0,r.jsx)(n.Z,{className:"ml-auto size-4"})]})}).displayName=s.fF.displayName,o.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.tu,{ref:a,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}).displayName=s.tu.displayName;let p=o.forwardRef((e,a)=>{let{className:t,sideOffset:n=4,...i}=e;return(0,r.jsx)(s.Uv,{children:(0,r.jsx)(s.VY,{ref:a,sideOffset:n,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...i})})});p.displayName=s.VY.displayName;let m=o.forwardRef((e,a)=>{let{className:t,inset:n,...i}=e;return(0,r.jsx)(s.ck,{ref:a,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",t),...i})});m.displayName=s.ck.displayName;let b=o.forwardRef((e,a)=>{let{className:t,children:n,checked:d,...o}=e;return(0,r.jsxs)(s.oC,{ref:a,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:d,...o,children:[(0,r.jsx)("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(s.wU,{children:(0,r.jsx)(i.Z,{className:"size-4"})})}),n]})});b.displayName=s.oC.displayName;let h=o.forwardRef((e,a)=>{let{className:t,children:n,...i}=e;return(0,r.jsxs)(s.Rk,{ref:a,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...i,children:[(0,r.jsx)("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(s.wU,{children:(0,r.jsx)(d.Z,{className:"size-2 fill-current"})})}),n]})});h.displayName=s.Rk.displayName;let x=o.forwardRef((e,a)=>{let{className:t,inset:n,...i}=e;return(0,r.jsx)(s.__,{ref:a,className:(0,l.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",t),...i})});x.displayName=s.__.displayName;let g=o.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.Z0,{ref:a,className:(0,l.cn)("-mx-1 my-1 h-px bg-muted",t),...n})});g.displayName=s.Z0.displayName},95186:function(e,a,t){t.d(a,{I:function(){return i}});var r=t(57437),s=t(2265),n=t(94508);let i=s.forwardRef((e,a)=>{let{className:t,type:s,...i}=e;return(0,r.jsx)("input",{type:s,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...i})});i.displayName="Input"},6512:function(e,a,t){t.d(a,{Z:function(){return d}});var r=t(57437),s=t(55156),n=t(2265),i=t(94508);let d=n.forwardRef((e,a)=>{let{className:t,orientation:n="horizontal",decorative:d=!0,...o}=e;return(0,r.jsx)(s.f,{ref:a,decorative:d,orientation:n,className:(0,i.cn)("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...o})});d.displayName=s.f.displayName},69304:function(e,a,t){t.d(a,{Ei:function(){return x},Tu:function(){return b},aM:function(){return c},bC:function(){return h},ue:function(){return m},yo:function(){return l}});var r=t(57437),s=t(34567),n=t(90535),i=t(32489),d=t(2265),o=t(94508);let l=s.fC,c=s.xz;s.x8;let u=s.h_,f=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n,ref:a})});f.displayName=s.aV.displayName;let p=(0,n.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),m=d.forwardRef((e,a)=>{let{side:t="right",className:n,children:d,...l}=e;return(0,r.jsxs)(u,{children:[(0,r.jsx)(f,{}),(0,r.jsxs)(s.VY,{ref:a,className:(0,o.cn)(p({side:t}),n),...l,children:[d,(0,r.jsxs)(s.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,r.jsx)(i.Z,{className:"size-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});m.displayName=s.VY.displayName;let b=e=>{let{className:a,...t}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",a),...t})};b.displayName="SheetHeader";let h=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.Dx,{ref:a,className:(0,o.cn)("text-lg font-semibold text-foreground",t),...n})});h.displayName=s.Dx.displayName;let x=d.forwardRef((e,a)=>{let{className:t,...n}=e;return(0,r.jsx)(s.dk,{ref:a,className:(0,o.cn)("text-sm text-muted-foreground",t),...n})});x.displayName=s.dk.displayName},93022:function(e,a,t){t.d(a,{O:function(){return n}});var r=t(57437),s=t(94508);function n(e){let{className:a,...t}=e;return(0,r.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-md bg-muted",a),...t})}},81103:function(e,a,t){t.d(a,{_v:function(){return c},aJ:function(){return l},pn:function(){return d},u:function(){return o}});var r=t(57437),s=t(4957),n=t(2265),i=t(94508);let d=s.zt,o=s.fC,l=s.xz,c=n.forwardRef((e,a)=>{let{className:t,sideOffset:n=4,...d}=e;return(0,r.jsx)(s.VY,{ref:a,sideOffset:n,className:(0,i.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...d})});c.displayName=s.VY.displayName},866:function(e,a,t){t.d(a,{d:function(){return s}});var r=t(2265);function s(){let[e,a]=r.useState(void 0);return r.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),t=()=>{a(window.innerWidth<768)};return e.addEventListener("change",t),a(window.innerWidth<768),()=>e.removeEventListener("change",t)},[]),!!e}},6374:function(e,a,t){t.d(a,{DQ:function(){return i},LP:function(){return n},QZ:function(){return d}});var r=t(80605);let s=async()=>{let e=await fetch("/api/config").then(e=>e.json());if(!e.backend)throw Error("No backend set.");return{files:e.backend,base:e.backend}},n=async()=>{var e;let a=await (0,r.getSession)();return null==a?void 0:null===(e=a.user)||void 0===e?void 0:e.jwt},i={image:{generate:async e=>{let a=await s(),t="".concat(a.base,"/generate/agent/image"),r=await n();if(!r)throw Error("No valid session token available.");return fetch(t,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)}})}}},d={object:async e=>{let a=await s(),t="".concat(a.files,"/s3/object"),r=await n();return(await fetch(t,{method:"POST",body:JSON.stringify({key:e}),headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)}})).json()},list:async e=>{let{search:a,continuationToken:t}=e,r=await s(),i="".concat(r.files,"/s3/list"),d=await n();if(!d)throw Error("No valid session token available.");return a&&(i+="?search=".concat(a)),t&&(i+="?continuationToken=".concat(t)),(await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(d)}})).json()},download:async e=>{let a=await s(),t="".concat(a.files,"/s3/download?key=").concat(e),r=await n();if(!r)throw Error("No valid session token available.");return fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)}})},delete:async e=>{let a=await s(),t="".concat(a.files,"/s3/delete?key=").concat(e),r=await n();if(!r)throw Error("No valid session token available.");return fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)}})}}}}]);
2
- //# sourceMappingURL=3832-417a5eeee712a793.js.map
2
+ //# sourceMappingURL=3832-d7782d6a2771ae6c.js.map