libre-webui 0.19.2 → 0.19.4

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 (143) hide show
  1. package/backend/dist/index.d.ts.map +1 -1
  2. package/backend/dist/index.js +61 -2
  3. package/backend/dist/index.js.map +1 -1
  4. package/backend/dist/routes/artifacts.d.ts +3 -0
  5. package/backend/dist/routes/artifacts.d.ts.map +1 -0
  6. package/backend/dist/routes/artifacts.js +167 -0
  7. package/backend/dist/routes/artifacts.js.map +1 -0
  8. package/backend/dist/routes/ollama.d.ts.map +1 -1
  9. package/backend/dist/routes/ollama.js +25 -0
  10. package/backend/dist/routes/ollama.js.map +1 -1
  11. package/backend/dist/routes/preferences.d.ts.map +1 -1
  12. package/backend/dist/routes/preferences.js +44 -0
  13. package/backend/dist/routes/preferences.js.map +1 -1
  14. package/backend/dist/services/chatGenerationService.d.ts +11 -0
  15. package/backend/dist/services/chatGenerationService.d.ts.map +1 -1
  16. package/backend/dist/services/chatGenerationService.js +20 -1
  17. package/backend/dist/services/chatGenerationService.js.map +1 -1
  18. package/backend/dist/services/ollamaService.d.ts +9 -0
  19. package/backend/dist/services/ollamaService.d.ts.map +1 -1
  20. package/backend/dist/services/ollamaService.js +27 -0
  21. package/backend/dist/services/ollamaService.js.map +1 -1
  22. package/backend/dist/services/preferencesService.d.ts +7 -0
  23. package/backend/dist/services/preferencesService.d.ts.map +1 -1
  24. package/backend/dist/services/preferencesService.js +22 -0
  25. package/backend/dist/services/preferencesService.js.map +1 -1
  26. package/backend/dist/types/index.d.ts +5 -0
  27. package/backend/dist/types/index.d.ts.map +1 -1
  28. package/backend/dist/types/index.js.map +1 -1
  29. package/backend/dist/utils/ollamaModelDefaults.d.ts +39 -0
  30. package/backend/dist/utils/ollamaModelDefaults.d.ts.map +1 -0
  31. package/backend/dist/utils/ollamaModelDefaults.js +157 -0
  32. package/backend/dist/utils/ollamaModelDefaults.js.map +1 -0
  33. package/backend/package.json +1 -1
  34. package/frontend/dist/apple-touch-icon.png +0 -0
  35. package/frontend/dist/artifact-runtime/.build-fingerprint +1 -0
  36. package/frontend/dist/artifact-runtime/babel.js +613 -0
  37. package/frontend/dist/artifact-runtime/chart.js +3 -0
  38. package/frontend/dist/artifact-runtime/d3.js +5 -0
  39. package/frontend/dist/artifact-runtime/fonts.js +255 -0
  40. package/frontend/dist/artifact-runtime/framer-motion.js +10 -0
  41. package/frontend/dist/artifact-runtime/lodash.js +20 -0
  42. package/frontend/dist/artifact-runtime/lucide-react.js +1 -0
  43. package/frontend/dist/artifact-runtime/mathjs.js +54 -0
  44. package/frontend/dist/artifact-runtime/mermaid.js +3535 -0
  45. package/frontend/dist/artifact-runtime/papaparse.js +10 -0
  46. package/frontend/dist/artifact-runtime/plotly.js +3790 -0
  47. package/frontend/dist/artifact-runtime/react.js +9 -0
  48. package/frontend/dist/artifact-runtime/recharts.js +69 -0
  49. package/frontend/dist/artifact-runtime/runtime.js +1 -0
  50. package/frontend/dist/artifact-runtime/tailwind.js +952 -0
  51. package/frontend/dist/artifact-runtime/three.js +5271 -0
  52. package/frontend/dist/artifact-runtime/tone.js +210 -0
  53. package/frontend/dist/assets/index-DrcHGnwk.js +64 -0
  54. package/frontend/dist/assets/index-DtkGuqvC.css +1 -0
  55. package/frontend/dist/favicon-dark.png +0 -0
  56. package/frontend/dist/favicon-light.png +0 -0
  57. package/frontend/dist/favicon.svg +1 -0
  58. package/frontend/dist/fonts/inter.css +254 -0
  59. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2 +0 -0
  60. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2 +0 -0
  61. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2 +0 -0
  62. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2 +0 -0
  63. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2 +0 -0
  64. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2 +0 -0
  65. package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2 +0 -0
  66. package/frontend/dist/icon-192.png +0 -0
  67. package/frontend/dist/icon-512.png +0 -0
  68. package/frontend/dist/index.html +16 -11
  69. package/frontend/dist/js/ArtifactContainer-CEBbQqtg.js +1 -0
  70. package/frontend/dist/js/{ArtifactDemoPage-BlVBMy6a.js → ArtifactDemoPage-BDTtUPjk.js} +58 -2
  71. package/frontend/dist/js/ArtifactSandboxFrame-DOQWmEAm.js +151 -0
  72. package/frontend/dist/js/ArtifactSlideOutPanel-BMhWWM3P.js +1 -0
  73. package/frontend/dist/js/ChatPage-B64xgIPZ.js +16 -0
  74. package/frontend/dist/js/FirstTimeSetup-1IqkWCsV.js +1 -0
  75. package/frontend/dist/js/{GalleryPage-BnaFZERr.js → GalleryPage-CKgQAYmH.js} +1 -1
  76. package/frontend/dist/js/{HomePage-BvpoUzGG.js → HomePage-aNO615Go.js} +1 -1
  77. package/frontend/dist/js/{LibreClawPage-B-6rO5Jl.js → LibreClawPage-DZqgIOgT.js} +1 -1
  78. package/frontend/dist/js/ModelSelector-DhmVTh2d.js +1 -0
  79. package/frontend/dist/js/{ModelsPage-D5H70fs3.js → ModelsPage-tzXaut3l.js} +1 -1
  80. package/frontend/dist/js/{NotesPage-D9b3JxCx.js → NotesPage-Ciwrazz9.js} +1 -1
  81. package/frontend/dist/js/{PersonasPage-CJOGnyQV.js → PersonasPage-C9Pkl4yH.js} +2 -2
  82. package/frontend/dist/js/{PluginUsagePage-DHNMWquK.js → PluginUsagePage-DPfyos1y.js} +1 -1
  83. package/frontend/dist/js/{RichMessageContent-C7NG7gs-.js → RichMessageContent-CUcmvdXW.js} +1 -1
  84. package/frontend/dist/js/SettingsModal-DhrjNMcd.js +1 -0
  85. package/frontend/dist/js/{SystemPage-BsPen2Qb.js → SystemPage-CkUsJ-UR.js} +1 -1
  86. package/frontend/dist/js/{UserManagementPage-I9i5r0V3.js → UserManagementPage-DClRsCeA.js} +1 -1
  87. package/frontend/dist/js/WorkPage-cJEe9LZ_.js +5 -0
  88. package/frontend/dist/js/api-iDBo7I0x.js +19 -0
  89. package/frontend/dist/js/{appStore-CLIS0fvz.js → appStore-BAFz_6aP.js} +2 -2
  90. package/frontend/dist/js/{ar-B_uYj5Gv.js → ar-D3PgKaYD.js} +1 -1
  91. package/frontend/dist/js/{authStore-CsCkBmaG.js → authStore-2665PsVB.js} +2 -2
  92. package/frontend/dist/js/{bn-Pd4HHYsG.js → bn-DJiNo5j1.js} +1 -1
  93. package/frontend/dist/js/chatStore-fX9gMb9B.js +2 -0
  94. package/frontend/dist/js/config-CmH3hRFc.js +1 -0
  95. package/frontend/dist/js/{cs-CgVXogHE.js → cs-BJ7pToPB.js} +1 -1
  96. package/frontend/dist/js/{da-DTUIrClO.js → da-Cqw35YeI.js} +1 -1
  97. package/frontend/dist/js/{de-CKITtmnY.js → de-DLw7O2DX.js} +1 -1
  98. package/frontend/dist/js/{es-DKDhsL9J.js → es-CLg6Zl_p.js} +1 -1
  99. package/frontend/dist/js/{estree-CrfVSazx.js → estree-63s2XfPj.js} +1 -1
  100. package/frontend/dist/js/{fr-CUvNp0pc.js → fr-BUmG4BWs.js} +1 -1
  101. package/frontend/dist/js/{hi-Bwdmc__g.js → hi-CGktbsaL.js} +1 -1
  102. package/frontend/dist/js/{html-BbJLJMaV.js → html-CRbptZf3.js} +1 -1
  103. package/frontend/dist/js/{i18n-ZJQSoIuM.js → i18n-DFbHZ75-.js} +2 -2
  104. package/frontend/dist/js/{id-CWTPw3NJ.js → id-C7FnPtw9.js} +1 -1
  105. package/frontend/dist/js/{is-4dV6F4Bo.js → is-_FSS24Pj.js} +1 -1
  106. package/frontend/dist/js/{it-8uw2-j2s.js → it-DWTgF8my.js} +1 -1
  107. package/frontend/dist/js/{ja-Bl7gd3kp.js → ja-jYrlZiIs.js} +1 -1
  108. package/frontend/dist/js/{ko-C_CYwJnL.js → ko-3PZ87sc7.js} +1 -1
  109. package/frontend/dist/js/{markdown-DiMg1QLf.js → markdown-C23cybKA.js} +1 -1
  110. package/frontend/dist/js/{messageCodeStyles-CfzjQF-R.js → messageCodeStyles-BJVb4sK7.js} +1 -1
  111. package/frontend/dist/js/{ms-Dznw3AkA.js → ms-BfySq07T.js} +1 -1
  112. package/frontend/dist/js/{nl-fW-4lPWK.js → nl-DupdNsDK.js} +1 -1
  113. package/frontend/dist/js/{pl-CanprK04.js → pl-DYoPcTNe.js} +1 -1
  114. package/frontend/dist/js/{pt-JhTaVvKa.js → pt-p_-S_r1k.js} +1 -1
  115. package/frontend/dist/js/{ru-uPtHQATq.js → ru-CuJFlVPc.js} +1 -1
  116. package/frontend/dist/js/{standalone-Vs6LnjM6.js → standalone-BwzoPJoZ.js} +1 -1
  117. package/frontend/dist/js/{sv-yr6iqxR-.js → sv-DyZJcYOQ.js} +1 -1
  118. package/frontend/dist/js/{th-Bx4U5yKy.js → th-Cd6fTxUn.js} +1 -1
  119. package/frontend/dist/js/{tr-C7tCwYuZ.js → tr-BB1gefYF.js} +1 -1
  120. package/frontend/dist/js/{typescript-BhVG1zGU.js → typescript-CS-sPC9m.js} +1 -1
  121. package/frontend/dist/js/{ui-Dj9IFugT.js → ui-B-C2BCTb.js} +2 -2
  122. package/frontend/dist/js/{uk-C4SbiAUn.js → uk-DFURilqa.js} +1 -1
  123. package/frontend/dist/js/{vi-C3-TmuzC.js → vi-BXclLwGp.js} +1 -1
  124. package/frontend/dist/js/{zh-CRfqIC_I.js → zh-BS8f68w1.js} +1 -1
  125. package/frontend/dist/logo-dark.png +0 -0
  126. package/frontend/dist/logo-dark.svg +1 -0
  127. package/frontend/dist/logo-light.png +0 -0
  128. package/frontend/dist/logo-light.svg +1 -0
  129. package/frontend/dist/logo.svg +1 -6
  130. package/frontend/dist/maskable-512.png +0 -0
  131. package/package.json +3 -3
  132. package/frontend/dist/assets/index-B9H3vQ-n.css +0 -1
  133. package/frontend/dist/assets/index-D4LhtFTX.js +0 -38
  134. package/frontend/dist/js/ArtifactContainer-DvuGeXXu.js +0 -1
  135. package/frontend/dist/js/ArtifactSlideOutPanel-CaPMk1Qj.js +0 -1
  136. package/frontend/dist/js/ChatPage-D4UBhGLk.js +0 -16
  137. package/frontend/dist/js/FirstTimeSetup-DJiDNTXY.js +0 -1
  138. package/frontend/dist/js/ModelSelector-BV1kuaVg.js +0 -1
  139. package/frontend/dist/js/SettingsModal-DEBxDPne.js +0 -1
  140. package/frontend/dist/js/WorkPage-e30yqvJe.js +0 -5
  141. package/frontend/dist/js/api-jwjnjqx6.js +0 -19
  142. package/frontend/dist/js/artifactHtml-C0Hu9I1u.js +0 -41
  143. package/frontend/dist/js/chatStore-DRY8C0J1.js +0 -2
@@ -0,0 +1,254 @@
1
+ /* Inter, self-hosted. Generated by scripts/vendor-inter.mjs — do not edit.
2
+ Vendored so no page load contacts a third-party font host. */
3
+ /* cyrillic-ext */
4
+ @font-face {
5
+ font-family: 'Inter';
6
+ font-style: normal;
7
+ font-weight: 400;
8
+ font-display: swap;
9
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
10
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
11
+ }
12
+ /* cyrillic */
13
+ @font-face {
14
+ font-family: 'Inter';
15
+ font-style: normal;
16
+ font-weight: 400;
17
+ font-display: swap;
18
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
19
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
20
+ }
21
+ /* greek-ext */
22
+ @font-face {
23
+ font-family: 'Inter';
24
+ font-style: normal;
25
+ font-weight: 400;
26
+ font-display: swap;
27
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
28
+ unicode-range: U+1F00-1FFF;
29
+ }
30
+ /* greek */
31
+ @font-face {
32
+ font-family: 'Inter';
33
+ font-style: normal;
34
+ font-weight: 400;
35
+ font-display: swap;
36
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
37
+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
38
+ }
39
+ /* vietnamese */
40
+ @font-face {
41
+ font-family: 'Inter';
42
+ font-style: normal;
43
+ font-weight: 400;
44
+ font-display: swap;
45
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
46
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
47
+ }
48
+ /* latin-ext */
49
+ @font-face {
50
+ font-family: 'Inter';
51
+ font-style: normal;
52
+ font-weight: 400;
53
+ font-display: swap;
54
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
55
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
56
+ }
57
+ /* latin */
58
+ @font-face {
59
+ font-family: 'Inter';
60
+ font-style: normal;
61
+ font-weight: 400;
62
+ font-display: swap;
63
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
64
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
65
+ }
66
+ /* cyrillic-ext */
67
+ @font-face {
68
+ font-family: 'Inter';
69
+ font-style: normal;
70
+ font-weight: 500;
71
+ font-display: swap;
72
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
73
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
74
+ }
75
+ /* cyrillic */
76
+ @font-face {
77
+ font-family: 'Inter';
78
+ font-style: normal;
79
+ font-weight: 500;
80
+ font-display: swap;
81
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
82
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
83
+ }
84
+ /* greek-ext */
85
+ @font-face {
86
+ font-family: 'Inter';
87
+ font-style: normal;
88
+ font-weight: 500;
89
+ font-display: swap;
90
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
91
+ unicode-range: U+1F00-1FFF;
92
+ }
93
+ /* greek */
94
+ @font-face {
95
+ font-family: 'Inter';
96
+ font-style: normal;
97
+ font-weight: 500;
98
+ font-display: swap;
99
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
100
+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
101
+ }
102
+ /* vietnamese */
103
+ @font-face {
104
+ font-family: 'Inter';
105
+ font-style: normal;
106
+ font-weight: 500;
107
+ font-display: swap;
108
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
109
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
110
+ }
111
+ /* latin-ext */
112
+ @font-face {
113
+ font-family: 'Inter';
114
+ font-style: normal;
115
+ font-weight: 500;
116
+ font-display: swap;
117
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
118
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
119
+ }
120
+ /* latin */
121
+ @font-face {
122
+ font-family: 'Inter';
123
+ font-style: normal;
124
+ font-weight: 500;
125
+ font-display: swap;
126
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
127
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
128
+ }
129
+ /* cyrillic-ext */
130
+ @font-face {
131
+ font-family: 'Inter';
132
+ font-style: normal;
133
+ font-weight: 600;
134
+ font-display: swap;
135
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
136
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
137
+ }
138
+ /* cyrillic */
139
+ @font-face {
140
+ font-family: 'Inter';
141
+ font-style: normal;
142
+ font-weight: 600;
143
+ font-display: swap;
144
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
145
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
146
+ }
147
+ /* greek-ext */
148
+ @font-face {
149
+ font-family: 'Inter';
150
+ font-style: normal;
151
+ font-weight: 600;
152
+ font-display: swap;
153
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
154
+ unicode-range: U+1F00-1FFF;
155
+ }
156
+ /* greek */
157
+ @font-face {
158
+ font-family: 'Inter';
159
+ font-style: normal;
160
+ font-weight: 600;
161
+ font-display: swap;
162
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
163
+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
164
+ }
165
+ /* vietnamese */
166
+ @font-face {
167
+ font-family: 'Inter';
168
+ font-style: normal;
169
+ font-weight: 600;
170
+ font-display: swap;
171
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
172
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
173
+ }
174
+ /* latin-ext */
175
+ @font-face {
176
+ font-family: 'Inter';
177
+ font-style: normal;
178
+ font-weight: 600;
179
+ font-display: swap;
180
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
181
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
182
+ }
183
+ /* latin */
184
+ @font-face {
185
+ font-family: 'Inter';
186
+ font-style: normal;
187
+ font-weight: 600;
188
+ font-display: swap;
189
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
190
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
191
+ }
192
+ /* cyrillic-ext */
193
+ @font-face {
194
+ font-family: 'Inter';
195
+ font-style: normal;
196
+ font-weight: 700;
197
+ font-display: swap;
198
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2');
199
+ unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
200
+ }
201
+ /* cyrillic */
202
+ @font-face {
203
+ font-family: 'Inter';
204
+ font-style: normal;
205
+ font-weight: 700;
206
+ font-display: swap;
207
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2');
208
+ unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
209
+ }
210
+ /* greek-ext */
211
+ @font-face {
212
+ font-family: 'Inter';
213
+ font-style: normal;
214
+ font-weight: 700;
215
+ font-display: swap;
216
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2');
217
+ unicode-range: U+1F00-1FFF;
218
+ }
219
+ /* greek */
220
+ @font-face {
221
+ font-family: 'Inter';
222
+ font-style: normal;
223
+ font-weight: 700;
224
+ font-display: swap;
225
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2');
226
+ unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
227
+ }
228
+ /* vietnamese */
229
+ @font-face {
230
+ font-family: 'Inter';
231
+ font-style: normal;
232
+ font-weight: 700;
233
+ font-display: swap;
234
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2');
235
+ unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
236
+ }
237
+ /* latin-ext */
238
+ @font-face {
239
+ font-family: 'Inter';
240
+ font-style: normal;
241
+ font-weight: 700;
242
+ font-display: swap;
243
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2');
244
+ unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
245
+ }
246
+ /* latin */
247
+ @font-face {
248
+ font-family: 'Inter';
249
+ font-style: normal;
250
+ font-weight: 700;
251
+ font-display: swap;
252
+ src: url(/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2');
253
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
254
+ }
Binary file
Binary file
@@ -22,35 +22,40 @@
22
22
  document.documentElement.style.colorScheme = mode;
23
23
  })();
24
24
  </script>
25
- <!-- Always use dark favicon -->
26
- <link rel="icon" type="image/png" href="/favicon-dark.png" />
25
+ <!-- The SVG mark carries its own prefers-color-scheme rule, so the favicon
26
+ inverts with the OS theme. The PNG stays for browsers that do not
27
+ support SVG favicons. -->
28
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
29
+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-dark.png" />
30
+ <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
27
31
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
28
32
  <title>Libre WebUI</title>
29
33
  <meta
30
34
  name="description"
31
35
  content="A modern, minimalist WebUI for interacting with local LLMs through Ollama API"
32
36
  />
33
- <script type="module" crossorigin src="/assets/index-D4LhtFTX.js"></script>
37
+ <script type="module" crossorigin src="/assets/index-DrcHGnwk.js"></script>
34
38
  <link rel="modulepreload" crossorigin href="/js/rolldown-runtime-hePW80VL.js">
35
39
  <link rel="modulepreload" crossorigin href="/js/markdown-core-DHnR5Hw8.js">
36
40
  <link rel="modulepreload" crossorigin href="/js/react-vendor-DPNXrO-8.js">
37
41
  <link rel="modulepreload" crossorigin href="/js/router-vendor-Ca9zqOqT.js">
38
42
  <link rel="modulepreload" crossorigin href="/js/useTranslation-CdeLZqSW.js">
39
43
  <link rel="modulepreload" crossorigin href="/js/i18next-DgmgtwsV.js">
40
- <link rel="modulepreload" crossorigin href="/js/i18n-ZJQSoIuM.js">
44
+ <link rel="modulepreload" crossorigin href="/js/i18n-DFbHZ75-.js">
41
45
  <link rel="modulepreload" crossorigin href="/js/ui-vendor-D_pYT79f.js">
42
46
  <link rel="modulepreload" crossorigin href="/js/utils-vendor-1zob7nK9.js">
43
47
  <link rel="modulepreload" crossorigin href="/js/logger-DSXjF4ye.js">
44
- <link rel="modulepreload" crossorigin href="/js/api-jwjnjqx6.js">
48
+ <link rel="modulepreload" crossorigin href="/js/config-CmH3hRFc.js">
49
+ <link rel="modulepreload" crossorigin href="/js/api-iDBo7I0x.js">
45
50
  <link rel="modulepreload" crossorigin href="/js/utils-BhpNrGnR.js">
46
- <link rel="modulepreload" crossorigin href="/js/chatStore-DRY8C0J1.js">
47
- <link rel="modulepreload" crossorigin href="/js/appStore-CLIS0fvz.js">
48
- <link rel="modulepreload" crossorigin href="/js/authStore-CsCkBmaG.js">
51
+ <link rel="modulepreload" crossorigin href="/js/chatStore-fX9gMb9B.js">
52
+ <link rel="modulepreload" crossorigin href="/js/appStore-BAFz_6aP.js">
53
+ <link rel="modulepreload" crossorigin href="/js/authStore-2665PsVB.js">
49
54
  <link rel="modulepreload" crossorigin href="/js/welcomePrompts-to5mv_gx.js">
50
- <link rel="modulepreload" crossorigin href="/js/messageCodeStyles-CfzjQF-R.js">
55
+ <link rel="modulepreload" crossorigin href="/js/messageCodeStyles-BJVb4sK7.js">
51
56
  <link rel="modulepreload" crossorigin href="/js/Button-X9TT9gTD.js">
52
- <link rel="modulepreload" crossorigin href="/js/ui-Dj9IFugT.js">
53
- <link rel="stylesheet" crossorigin href="/assets/index-B9H3vQ-n.css">
57
+ <link rel="modulepreload" crossorigin href="/js/ui-B-C2BCTb.js">
58
+ <link rel="stylesheet" crossorigin href="/assets/index-DtkGuqvC.css">
54
59
  </head>
55
60
  <body>
56
61
  <div id="root"></div>
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,f as n}from"./markdown-core-DHnR5Hw8.js";import{t as r}from"./useTranslation-CdeLZqSW.js";import{Bt as i,Gt as a,Ht as o,Jt as s,Pt as c,Rt as l,bt as u,f as d,on as f,qt as p,rt as m}from"./ui-vendor-D_pYT79f.js";import{t as h}from"./logger-DSXjF4ye.js";import{t as g}from"./utils-BhpNrGnR.js";import{t as _}from"./appStore-BAFz_6aP.js";import{t as v}from"./Button-X9TT9gTD.js";import{t as y}from"./OptimizedSyntaxHighlighter-CWYUn9Oe.js";import{a as b,i as x,l as S,n as C,o as w,r as T,t as E}from"./ArtifactSandboxFrame-DOQWmEAm.js";var D=e(n(),1),O=t(),k=h(`components:artifact-renderer`),A=({artifact:e,className:t})=>{let{t:n}=r(),[h,A]=(0,D.useState)(!1),[j,M]=(0,D.useState)(`preview`),{theme:N,openArtifactPanel:P}=_(),F=async e=>{try{await navigator.clipboard.writeText(e),A(!0),setTimeout(()=>A(!1),2e3)}catch(e){k.error(`Failed to copy:`,e)}},I=()=>{let t=e.type===`html`?b(e.content,e.title):e.content,n=new Blob([t],{type:L(e.type)}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${e.title}.${R(e.type)}`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)},L=e=>{switch(e){case`html`:return`text/html`;case`react`:return`text/javascript`;case`svg`:return`image/svg+xml`;case`css`:return`text/css`;case`json`:return`application/json`;default:return`text/plain`}},R=e=>{switch(e){case`html`:return`html`;case`react`:return`jsx`;case`svg`:return`svg`;case`css`:return`css`;case`json`:return`json`;default:return`txt`}},z=()=>{switch(e.type){case`html`:return(0,O.jsx)(u,{className:`h-4 w-4`});case`react`:return(0,O.jsx)(p,{className:`h-4 w-4`});case`svg`:return(0,O.jsx)(c,{className:`h-4 w-4`});case`code`:return(0,O.jsx)(p,{className:`h-4 w-4`});default:return(0,O.jsx)(c,{className:`h-4 w-4`})}},B=()=>(0,O.jsx)(`div`,{"data-testid":`artifact-html-fallback`,className:`w-full h-64 sm:h-80 lg:h-96 flex items-center justify-center bg-gray-50 dark:bg-dark-100 rounded-lg border border-gray-200 dark:border-dark-200 p-4`,children:(0,O.jsxs)(`div`,{className:`max-w-sm text-center`,children:[(0,O.jsx)(d,{className:`h-8 w-8 text-primary-500 mx-auto mb-3`}),(0,O.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100`,children:n(`artifacts.previewUnavailable`)}),(0,O.jsx)(`p`,{className:`mt-1 text-sm text-gray-600 dark:text-gray-400`,children:n(`artifacts.previewUnavailableDescription`)}),(0,O.jsxs)(v,{variant:`outline`,size:`sm`,onClick:()=>M(`code`),className:`mt-4`,children:[(0,O.jsx)(s,{className:`h-3.5 w-3.5 mr-1.5`}),n(`artifacts.code`)]})]})}),V=async()=>{try{let t=await T(C(e.type)??`html`,e.content,e.title,{colorScheme:N.mode===`dark`?`dark`:`light`});S(t,x,e.title)}catch(e){k.error(`Failed to open the artifact preview:`,e)}},H=t=>e.content.trim()?(0,O.jsx)(E,{content:e.content,title:e.title,kind:t,colorScheme:N.mode===`dark`?`dark`:`light`,className:`w-full h-64 sm:h-80 lg:h-96 border-0 rounded-lg`,fallback:B()}):B(),U=()=>(0,O.jsx)(`iframe`,{"data-testid":`artifact-svg-preview`,srcDoc:w(e.content,e.title),className:`w-full h-64 sm:h-80 lg:h-96 border-0 rounded-lg bg-white`,sandbox:``,title:e.title}),W=()=>(0,O.jsx)(`div`,{className:`relative max-h-64 sm:max-h-80 lg:max-h-96 overflow-auto`,children:(0,O.jsx)(y,{language:(()=>{if(e.language)return e.language;switch(e.type){case`html`:return`html`;case`react`:return`jsx`;case`svg`:return`xml`;case`json`:return`json`;default:return`text`}})(),isDark:N.mode===`dark`,className:`!m-0 !rounded-lg`,children:e.content})}),G=()=>{try{let t=JSON.parse(e.content),n=JSON.stringify(t,null,2);return(0,O.jsx)(`div`,{className:`relative max-h-64 sm:max-h-80 lg:max-h-96 overflow-auto`,children:(0,O.jsx)(y,{language:`json`,isDark:N.mode===`dark`,className:`!m-0 !rounded-lg`,children:n})})}catch{return(0,O.jsx)(`div`,{className:`w-full h-32 flex items-center justify-center bg-gray-50 dark:bg-dark-100 rounded-lg border border-gray-200 dark:border-dark-200`,children:(0,O.jsxs)(`div`,{className:`text-center`,children:[(0,O.jsx)(d,{className:`h-8 w-8 text-primary-500 mx-auto mb-2`}),(0,O.jsx)(`p`,{className:`text-sm text-gray-600 dark:text-dark-600`,children:n(`artifacts.invalidJson`)})]})})}},K=()=>{if(j===`code`)return W();switch(e.type){case`html`:return H(`html`);case`react`:return H(`react`);case`mermaid`:return H(`mermaid`);case`svg`:return U();case`json`:return G();default:return W()}},q=()=>e.type===`html`||e.type===`svg`||e.type===`react`||e.type===`mermaid`;return(0,O.jsxs)(`div`,{className:g(`border border-gray-200 dark:border-dark-200 rounded-xl bg-white dark:bg-dark-25 shadow-lg transition-all duration-300 hover:shadow-xl`,`w-full max-w-full overflow-hidden animate-fade-in`,`max-h-[400px] flex flex-col`,t),children:[(0,O.jsxs)(`div`,{className:`px-1.5 py-1.5 sm:p-4 border-b border-gray-100 dark:border-dark-200 flex-shrink-0`,children:[(0,O.jsxs)(`div`,{className:`flex flex-col gap-2 sm:hidden`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`div`,{className:`h-4 w-4 flex-shrink-0 flex items-center justify-center`,children:z()}),(0,O.jsx)(`h3`,{className:`font-medium text-gray-900 dark:text-gray-100 truncate text-sm leading-tight flex-1`,children:e.title})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[q()&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(v,{variant:j===`preview`?`primary`:`ghost`,size:`sm`,onClick:()=>M(`preview`),className:`h-5 px-0.5 text-xs`,title:n(`artifacts.previewMode`),children:(0,O.jsx)(l,{className:`h-2.5 w-2.5`})}),(0,O.jsx)(v,{variant:j===`code`?`primary`:`ghost`,size:`sm`,onClick:()=>M(`code`),className:`h-5 px-0.5 text-xs`,title:n(`artifacts.codeMode`),children:(0,O.jsx)(s,{className:`h-2.5 w-2.5`})}),(0,O.jsx)(`div`,{className:`w-px h-2 bg-gray-300 dark:bg-gray-600 mx-0.5`})]}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>F(e.content),className:`h-5 w-5 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 touch-manipulation`,title:n(`artifacts.copyContent`),children:h?(0,O.jsx)(f,{className:`h-2.5 w-2.5 text-green-500`}):(0,O.jsx)(a,{className:`h-2.5 w-2.5`})}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:I,className:`h-5 w-5 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 touch-manipulation`,title:n(`artifacts.download`),children:(0,O.jsx)(o,{className:`h-2.5 w-2.5`})}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>P(e),className:`h-5 w-5 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 touch-manipulation border border-gray-200 dark:border-dark-300 hover:border-gray-300 dark:hover:border-dark-400`,title:n(`artifacts.openInPanel`),children:(0,O.jsx)(m,{className:`h-2.5 w-2.5`})})]})]}),(0,O.jsxs)(`div`,{className:`hidden sm:flex items-center justify-between gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0 flex-1`,children:[(0,O.jsx)(`div`,{className:`flex-shrink-0`,children:z()}),(0,O.jsx)(`h3`,{className:`font-semibold text-gray-900 dark:text-gray-100 truncate`,children:e.title})]}),(0,O.jsx)(`span`,{className:`text-xs bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300 px-2 py-1 rounded-full font-medium flex-shrink-0`,children:e.type.toUpperCase()})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[q()&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(v,{variant:j===`preview`?`primary`:`ghost`,size:`sm`,onClick:()=>M(`preview`),className:`h-8 px-3 text-xs`,title:n(`artifacts.previewMode`),children:[(0,O.jsx)(l,{className:`h-3 w-3 mr-1`}),n(`artifacts.preview`)]}),(0,O.jsxs)(v,{variant:j===`code`?`primary`:`ghost`,size:`sm`,onClick:()=>M(`code`),className:`h-8 px-3 text-xs`,title:n(`artifacts.codeMode`),children:[(0,O.jsx)(s,{className:`h-3 w-3 mr-1`}),n(`artifacts.code`)]}),(0,O.jsx)(`div`,{className:`w-px h-4 bg-gray-300 dark:bg-gray-600 mx-1`})]}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>F(e.content),className:`h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200`,title:n(`artifacts.copyContent`),children:h?(0,O.jsx)(f,{className:`h-4 w-4 text-green-500`}):(0,O.jsx)(a,{className:`h-4 w-4`})}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:I,className:`h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200`,title:n(`artifacts.download`),children:(0,O.jsx)(o,{className:`h-4 w-4`})}),(0,O.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>P(e),className:`h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200`,title:n(`artifacts.openInPanel`),children:(0,O.jsx)(m,{className:`h-4 w-4`})})]})]})]}),(0,O.jsxs)(`div`,{className:`p-4 flex-1 overflow-hidden min-h-0`,children:[e.description&&(0,O.jsx)(`p`,{className:`text-sm text-gray-600 dark:text-gray-400 mb-4`,children:e.description}),(0,O.jsx)(`div`,{className:`h-full overflow-auto`,children:K()})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between p-3 border-t border-gray-100 dark:border-dark-200 bg-gray-50 dark:bg-dark-100/50 flex-shrink-0`,children:[(0,O.jsxs)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:[n(`artifacts.created`),`:`,` `,new Date(e.createdAt).toLocaleString()]}),C(e.type)&&(0,O.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>V(),className:`text-xs hover:bg-gray-100 dark:hover:bg-dark-200`,children:[(0,O.jsx)(i,{className:`h-3 w-3 mr-1`}),n(`artifacts.openInNewWindow`)]})]})]})},j=({artifacts:e,className:t})=>!e||e.length===0?null:(0,O.jsx)(`div`,{className:g(`space-y-3`,t),children:e.map(e=>(0,O.jsx)(A,{artifact:e},e.id))});export{j as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,f as n}from"./markdown-core-DHnR5Hw8.js";import{t as r}from"./Button-X9TT9gTD.js";import{n as i}from"./ui-Dj9IFugT.js";import{t as a}from"./ArtifactContainer-DvuGeXXu.js";var o=e(n(),1),s=t(),c=[{id:`demo-html-1`,type:`html`,title:`Interactive Button Demo`,description:`A simple HTML page with interactive elements`,content:`<div style="text-align: center; padding: 20px;">
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,f as n}from"./markdown-core-DHnR5Hw8.js";import{t as r}from"./Button-X9TT9gTD.js";import{n as i}from"./ui-B-C2BCTb.js";import{t as a}from"./ArtifactContainer-CEBbQqtg.js";var o=e(n(),1),s=t(),c=[{id:`demo-html-1`,type:`html`,title:`Interactive Button Demo`,description:`A simple HTML page with interactive elements`,content:`<div style="text-align: center; padding: 20px;">
2
2
  <h1 style="color: #333; font-family: Arial, sans-serif;">Welcome to Libre WebUI!</h1>
3
3
  <p style="color: #666; font-size: 16px;">This is an interactive HTML artifact.</p>
4
4
  <button
@@ -112,7 +112,63 @@ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,f as n}from"./m
112
112
  loop();
113
113
  <\/script>
114
114
  </body>
115
- </html>`,createdAt:Date.now(),updatedAt:Date.now()},{id:`demo-svg-1`,type:`svg`,title:`Animated SVG Logo`,description:`An animated SVG graphic`,content:`<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
115
+ </html>`,createdAt:Date.now(),updatedAt:Date.now()},{id:`demo-react-1`,type:`react`,title:`Revenue Dashboard`,description:`A React component using Tailwind, Recharts and Lucide icons`,content:`import { useState } from 'react';
116
+ import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'recharts';
117
+ import { TrendingUp } from 'lucide-react';
118
+
119
+ const data = [
120
+ { month: 'Jan', revenue: 4200 },
121
+ { month: 'Feb', revenue: 5100 },
122
+ { month: 'Mar', revenue: 4800 },
123
+ { month: 'Apr', revenue: 6300 },
124
+ { month: 'May', revenue: 7400 },
125
+ { month: 'Jun', revenue: 8100 },
126
+ ];
127
+
128
+ export default function RevenueDashboard() {
129
+ const [highlight, setHighlight] = useState(false);
130
+ const total = data.reduce((sum, point) => sum + point.revenue, 0);
131
+
132
+ return (
133
+ <div className="p-6 font-sans">
134
+ <div className="flex items-center gap-2 mb-1">
135
+ <TrendingUp className="w-5 h-5 text-emerald-600" />
136
+ <h2 className="text-xl font-semibold text-slate-900">Revenue</h2>
137
+ </div>
138
+ <p id="total" className="text-sm text-slate-500 mb-4">
139
+ \${total.toLocaleString()} over six months
140
+ </p>
141
+ <div className="h-56 w-full">
142
+ <ResponsiveContainer width="100%" height="100%">
143
+ <LineChart data={data}>
144
+ <XAxis dataKey="month" stroke="#94a3b8" fontSize={12} />
145
+ <YAxis stroke="#94a3b8" fontSize={12} />
146
+ <Tooltip />
147
+ <Line
148
+ type="monotone"
149
+ dataKey="revenue"
150
+ stroke={highlight ? '#059669' : '#2563eb'}
151
+ strokeWidth={2}
152
+ dot={false}
153
+ />
154
+ </LineChart>
155
+ </ResponsiveContainer>
156
+ </div>
157
+ <button
158
+ id="toggle"
159
+ onClick={() => setHighlight(value => !value)}
160
+ className="mt-4 rounded-lg bg-slate-900 px-4 py-2 text-sm font-medium text-white hover:bg-slate-700"
161
+ >
162
+ {highlight ? 'Reset colour' : 'Highlight growth'}
163
+ </button>
164
+ </div>
165
+ );
166
+ }`,createdAt:Date.now(),updatedAt:Date.now()},{id:`demo-mermaid-1`,type:`mermaid`,title:`Request Flow`,description:`A Mermaid diagram rendered in the sandbox`,content:`flowchart LR
167
+ User[Browser] --> Sandbox[Artifact sandbox]
168
+ Sandbox --> Runtime[Vendored runtime]
169
+ Runtime --> Render[Rendered artifact]
170
+ Sandbox -.-> Internet((Internet))
171
+ linkStyle 3 stroke-dasharray: 4, stroke: #dc2626`,createdAt:Date.now(),updatedAt:Date.now()},{id:`demo-svg-1`,type:`svg`,title:`Animated SVG Logo`,description:`An animated SVG graphic`,content:`<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
116
172
  <circle cx="100" cy="100" r="80" fill="none" stroke="#007bff" stroke-width="4">
117
173
  <animate attributeName="r" values="80;90;80" dur="2s" repeatCount="indefinite"/>
118
174
  </circle>
@@ -0,0 +1,151 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,f as n}from"./markdown-core-DHnR5Hw8.js";import{t as r}from"./logger-DSXjF4ye.js";import{t as i}from"./config-CmH3hRFc.js";var a=e(n(),1),o=`allow-scripts allow-forms allow-modals allow-popups allow-pointer-lock allow-downloads`,s=`clipboard-read; clipboard-write; fullscreen; gamepad`,c=`libre-artifact:render`;function l(e,t){if(!t||e.source!==t.contentWindow)return!1;let n=e.origin,r=typeof window>`u`?void 0:window.location?.origin;if(typeof n==`string`&&n!==``&&n!==`null`&&n!==r)return!1;let i=e.data;return!!i&&i?.type===`libre-artifact:ready`}function u(e,t){e?.contentWindow?.postMessage({type:c,html:t},`*`)}var d=`
2
+ body {
3
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
4
+ margin: 0;
5
+ padding: 16px;
6
+ background: white;
7
+ color: #333;
8
+ }
9
+ * { box-sizing: border-box; }
10
+ `;function f(e){let t=e.trim();return/^<!doctype\s+html/i.test(t)||/<html[\s>]/i.test(t)||/<head[\s>]/i.test(t)&&/<body[\s>]/i.test(t)}function p(e,t,n){let r=e.trim();if(t.length>0){let e=`\n<style>\n${t.join(`
11
+
12
+ `)}\n</style>\n`;r=y(r,e)}if(n.length>0){let e=`\n<script>\n${n.join(`
13
+
14
+ `)}\n<\/script>\n`;r=b(r,e)}return r}function m(e,t=`HTML Artifact`){let n=e.trim();return f(n)?_(n,t):`<!DOCTYPE html>
15
+ <html>
16
+ <head>
17
+ <meta charset="UTF-8">
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ <base target="_blank">
20
+ <title>${S(t)}</title>
21
+ <style>${d}</style>
22
+ </head>
23
+ <body>
24
+ ${n}
25
+ </body>
26
+ </html>`}function h(e,t=`SVG Artifact`){return`<!DOCTYPE html>
27
+ <html>
28
+ <head>
29
+ <meta charset="UTF-8">
30
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'">
31
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
32
+ <title>${S(t)}</title>
33
+ <style>
34
+ html, body { width: 100%; height: 100%; margin: 0; }
35
+ body { display: flex; align-items: center; justify-content: center; overflow: auto; }
36
+ svg { max-width: 100%; max-height: 100%; }
37
+ </style>
38
+ </head>
39
+ <body>${e}</body>
40
+ </html>`}function g(e,t,n=`Artifact`){let r=window.open(``,`_blank`);if(!r)return null;r.opener=null;let{document:i}=r;i.title=n,i.documentElement.style.width=`100%`,i.documentElement.style.height=`100%`,i.body.style.width=`100%`,i.body.style.height=`100%`,i.body.style.margin=`0`,i.body.replaceChildren();let a=i.createElement(`iframe`);return a.title=n,a.src=t,a.setAttribute(`sandbox`,o),a.setAttribute(`allow`,s),a.style.width=`100%`,a.style.height=`100%`,a.style.border=`0`,r.addEventListener(`message`,t=>{l(t,a)&&u(a,e)}),i.body.appendChild(a),r}function _(e,t){let n=e;/<head[\s>]/i.test(n)||(n=n.replace(/<html([^>]*)>/i,`<html$1><head></head>`));let r=[];return/<meta\s+charset=/i.test(n)||r.push(`<meta charset="UTF-8">`),/<meta\s+name=["']viewport["']/i.test(n)||r.push(`<meta name="viewport" content="width=device-width, initial-scale=1.0">`),/<base\s/i.test(n)||r.push(`<base target="_blank">`),/<title[\s>]/i.test(n)||r.push(`<title>${S(t)}</title>`),r.length===0?n:v(n,`\n ${r.join(`
41
+ `)}`)}function v(e,t){let n=/<head(\s[^>]*)?>/i;return n.test(e)?e.replace(n,e=>`${e}${t}`):`${t}\n${e}`}function y(e,t){return/<\/head>/i.test(e)?e.replace(/<\/head>/i,`${t}</head>`):/<html[^>]*>/i.test(e)?e.replace(/<html([^>]*)>/i,`<html$1><head>${t}</head>`):`${t}${e}`}function b(e,t){return/<\/body>/i.test(e)?e.replace(/<\/body>/i,`${t}</body>`):`${e}${t}`}function x(e){return S(e)}function S(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var C=`${i.replace(/\/+$/,``)}/artifacts/sandbox`,ee=window.location.protocol===`file:`?new URL(C).origin:window.location.origin,te=`/artifact-runtime`,w=`runtime`,T=`react`,E=`babel`,D=`tailwind`,O=`fonts`,k={react:T,"react-dom":T,"react-dom/client":T,"react/jsx-runtime":T,"react/jsx-dev-runtime":T,recharts:`recharts`,"lucide-react":`lucide-react`,d3:`d3`,three:`three`,papaparse:`papaparse`,lodash:`lodash`,"lodash-es":`lodash`,mermaid:`mermaid`,"chart.js":`chart`,"chart.js/auto":`chart`,tone:`tone`,mathjs:`mathjs`,"plotly.js":`plotly`,"plotly.js-dist-min":`plotly`,"framer-motion":`framer-motion`,"motion/react":`framer-motion`,motion:`framer-motion`,"three/addons/controls/OrbitControls.js":`three`,"three/examples/jsm/controls/OrbitControls.js":`three`},ne=[w,T,E,D],re=[w,`mermaid`],A=[{pattern:/cdn\.tailwindcss\.com/i,bundle:D},{pattern:/(?:^|\/)tailwindcss(?:@[\d.]+)?(?:\/|$)/i,bundle:D},{pattern:/(?:^|\/)chart\.js(?:@[\d.]+)?(?:\/|$|\?)/i,bundle:`chart`},{pattern:/(?:^|\/)chart(?:\.min)?\.js(?:$|\?)/i,bundle:`chart`},{pattern:/(?:^|\/)d3(?:@[\d.]+)?(?:\/|$|\?)/i,bundle:`d3`},{pattern:/(?:^|\/)d3(?:\.min)?\.js(?:$|\?)/i,bundle:`d3`},{pattern:/(?:^|\/)three(?:@[\d.]+)?(?:\/|$|\?)/i,bundle:`three`},{pattern:/(?:^|\/)three(?:\.min)?\.js(?:$|\?)/i,bundle:`three`},{pattern:/papaparse/i,bundle:`papaparse`},{pattern:/(?:^|\/)lodash(?:@[\d.]+)?(?:\/|$|\?)/i,bundle:`lodash`},{pattern:/(?:^|\/)lodash(?:\.min)?\.js(?:$|\?)/i,bundle:`lodash`},{pattern:/fonts\.(?:googleapis|gstatic)\.com/i,bundle:O},{pattern:/mermaid/i,bundle:`mermaid`},{pattern:/(?:^|\/)tone(?:@[\d.]+)?(?:\/|$|\?)|tone(?:\.min)?\.js/i,bundle:`tone`},{pattern:/mathjs|math(?:\.min)?\.js/i,bundle:`mathjs`},{pattern:/plotly/i,bundle:`plotly`},{pattern:/framer-motion|(?:^|\/)motion(?:@[\d.]+)?(?:\/|$)/i,bundle:`framer-motion`},{pattern:/react-dom/i,bundle:T},{pattern:/(?:^|\/)react(?:@[\d.]+)?(?:\/|$|\?)/i,bundle:T},{pattern:/babel(?:-standalone|\/standalone)/i,bundle:E}],j=`__libreArtifactRuntime`;function ie(e){if(k[e])return e;let t=A.find(({pattern:t})=>t.test(e))?.bundle??Object.values(k).find(t=>e.startsWith(`${t}/`));return t?Object.entries(k).find(([,e])=>e===t)?.[0]??null:null}function ae(e){let t=new Set,n=e.matchAll(/(?:from|import|require)\s*\(?\s*['"`]([^'"`]+)['"`]/g);for(let[,e]of n){let n=ie(e);n&&t.add(k[n])}return[...t]}var M=/\b(?:flex|grid|hidden|absolute|relative|(?:p|m|px|py|mx|my|mt|mb|ml|mr|gap|space)-\d|(?:w|h|max-w|min-h)-(?:\d|full|screen|auto)|text-(?:xs|sm|base|lg|xl|\dxl|center|left|right|white|black|gray-\d)|bg-(?:white|black|transparent|[a-z]+-\d)|rounded(?:-[a-z]+)?|shadow(?:-[a-z]+)?|border(?:-\d)?|items-(?:center|start|end)|justify-(?:center|between|around|end)|font-(?:bold|medium|semibold|light)|hover:[a-z-]+|(?:sm|md|lg|xl):[a-z-]+)\b/g;function N(e){let t=[...e.matchAll(/class\s*=\s*("|')(.*?)\1/gi)].map(e=>e[2]).join(` `);return new Set(t.match(M)??[]).size>=3}function P(e){let t=new Set;for(let[n,r]of Object.entries(k)){let i=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);RegExp(`(?:from|import|require)\\s*\\(?\\s*['"\`]${i}['"\`]`).test(e)&&t.add(r)}return[...t]}function F(e){return A.find(({pattern:t})=>t.test(e))?.bundle??null}function I(e){let t=new Set;for(let n of e.matchAll(/\b(?:src|href)\s*=\s*("|')(.*?)\1/gi))t.add(n[2]);for(let n of e.matchAll(/(?:from|import|require)\s*\(?\s*['"`]([^'"`]+)['"`]/g))t.add(n[1]);return[...t]}function L(e){let t=new Set;for(let n of I(e)){let e=F(n);e&&t.add(e)}return[...t]}var R=`bc6fb2127968ce0d`,z=new Map;function B(e){let t=z.get(e);if(t)return t;let n=fetch(`${ee}${te}/${e}.js?v=${R}`,{credentials:`same-origin`,cache:`no-cache`}).then(t=>{if(!t.ok)throw Error(`The artifact runtime bundle "${e}" is unavailable (HTTP ${t.status}).`);return t.text()});return n.catch(()=>z.delete(e)),z.set(e,n),n}async function V(e){let t=await Promise.all(e.map(B));return Object.fromEntries(e.map((e,n)=>[e,t[n]]))}function H(e){return e===`html`||e===`react`||e===`mermaid`?e:null}var U=`
42
+ html, body { margin: 0; min-height: 100%; }
43
+ body {
44
+ background: #ffffff;
45
+ color: #111827;
46
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
47
+ }
48
+ #root { min-height: 100vh; }
49
+ * { box-sizing: border-box; }
50
+ `,W=e=>JSON.stringify(e).replace(/</g,`\\u003c`).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`),G=e=>`<script>${e}<\/script>`,K=`(function () {
51
+ function createStorage() {
52
+ var data = Object.create(null);
53
+ var api = {
54
+ getItem: function (key) {
55
+ key = String(key);
56
+ return Object.prototype.hasOwnProperty.call(data, key) ? data[key] : null;
57
+ },
58
+ setItem: function (key, value) { data[String(key)] = String(value); },
59
+ removeItem: function (key) { delete data[String(key)]; },
60
+ clear: function () { data = Object.create(null); },
61
+ key: function (index) {
62
+ var keys = Object.keys(data);
63
+ return index < keys.length ? keys[index] : null;
64
+ },
65
+ };
66
+ Object.defineProperty(api, 'length', { get: function () { return Object.keys(data).length; } });
67
+ return api;
68
+ }
69
+
70
+ for (const name of ['localStorage', 'sessionStorage']) {
71
+ try {
72
+ void window[name];
73
+ } catch (error) {
74
+ Object.defineProperty(window, name, { value: createStorage(), configurable: true });
75
+ }
76
+ }
77
+
78
+ // Generated code sometimes appends a font stylesheet itself. It cannot load
79
+ // — artifacts have no network — and the vendored face is already injected,
80
+ // so the tag is dropped instead of failing against the policy.
81
+ var appendChild = Node.prototype.appendChild;
82
+ var blocked = /fonts\\.(?:googleapis|gstatic)\\.com|^https?:\\/\\//i;
83
+ Node.prototype.appendChild = function (node) {
84
+ if (
85
+ node &&
86
+ node.tagName === 'LINK' &&
87
+ String(node.rel || '').toLowerCase().indexOf('stylesheet') !== -1 &&
88
+ blocked.test(String(node.href || ''))
89
+ ) {
90
+ return node;
91
+ }
92
+ return appendChild.call(this, node);
93
+ };
94
+
95
+ try {
96
+ void document.cookie;
97
+ } catch (error) {
98
+ var jar = '';
99
+ Object.defineProperty(document, 'cookie', {
100
+ configurable: true,
101
+ get: function () { return jar; },
102
+ set: function (value) {
103
+ var pair = String(value).split(';')[0];
104
+ jar = jar ? jar + '; ' + pair : pair;
105
+ },
106
+ });
107
+ }
108
+ })();`,q=new Set([`module`,`text/babel`,`application/babel`]),J=e=>/^(?:https?:)?\/\//i.test(e);function oe(e){return[...new DOMParser().parseFromString(e,`text/html`).querySelectorAll(`script`)].filter(e=>!e.getAttribute(`src`)&&q.has((e.getAttribute(`type`)??``).trim().toLowerCase())).map(e=>e.textContent??``).join(`
109
+ `)}function Y(e,t){if(e===`react`)return[...new Set([...ne,...P(t)])];if(e===`mermaid`)return[...re];let n=oe(t),r=new Set(L(t));for(let e of ae(n))r.add(e);return N(t)&&r.add(D),n.trim()&&(r.add(E),/\bReact\b|jsx|<[A-Z]/.test(n)&&r.add(T)),[w,...[...r].filter(e=>e!==w)]}function se(e,t,n,r){let i=new DOMParser().parseFromString(e,`text/html`),a=e=>i.createComment(` ${e} `),o=e=>{let n=F(e);return n&&t[n]?n:null};for(let e of[...i.querySelectorAll(`script`)]){let t=(e.getAttribute(`type`)??``).trim().toLowerCase(),n=e.getAttribute(`src`);if(t===`importmap`){e.replaceWith(a(`import map removed: modules resolve from the local runtime`));continue}if(n){let t=o(n);t?e.replaceWith(a(`${t} is provided by the local runtime`)):J(n)&&(r.push(n),e.replaceWith(a(`unavailable offline: ${n}`)));continue}if(q.has(t)){let t=i.createElement(`script`);t.textContent=`(function () {
110
+ var runtime = window.${j};
111
+ if (runtime && typeof runtime.runInline === 'function') {
112
+ runtime.runInline(${W(e.textContent??``)});
113
+ return;
114
+ }
115
+ var report = document.createElement('pre');
116
+ report.setAttribute('data-testid', 'artifact-runtime-missing');
117
+ report.style.cssText = 'margin:16px;padding:12px;border:1px solid #f0a5a5;border-radius:8px;background:#fff5f5;color:#7f1d1d;font:12px/1.5 ui-monospace,Menlo,monospace;white-space:pre-wrap;';
118
+ report.textContent = 'The artifact runtime did not load.\\n\\nregistry: ' +
119
+ (runtime ? 'present, keys: ' + Object.keys(runtime).join(', ') : 'absent') +
120
+ '\\nscripts in document: ' + document.querySelectorAll('script').length;
121
+ (document.body || document.documentElement).appendChild(report);
122
+ })();`,e.replaceWith(t)}}for(let e of[...i.querySelectorAll(`link`)]){let t=(e.getAttribute(`rel`)??``).toLowerCase();if(/preconnect|dns-prefetch|icon|manifest/.test(t))continue;let n=e.getAttribute(`href`);if(!n||!t.includes(`stylesheet`)&&!/\.css|fonts\.googleapis/i.test(n))continue;let i=o(n);i?e.replaceWith(a(`${i} is provided by the local runtime`)):J(n)&&(r.push(n),e.replaceWith(a(`unavailable offline: ${n}`)))}let s=i.head,c=[...n,r.length?ce(r):``].filter(Boolean);for(let e of[...c].reverse()){let t=i.createElement(`script`);t.textContent=e,s.insertBefore(t,s.firstChild)}return`<!DOCTYPE html>${i.documentElement.outerHTML}`}var ce=e=>{let t=e.map(e=>e.split(`/`).pop()||e).filter((e,t,n)=>n.indexOf(e)===t);return`(function () {
123
+ var notice = document.createElement('div');
124
+ notice.setAttribute('data-testid', 'artifact-missing-library');
125
+ notice.style.cssText = 'position:sticky;top:0;z-index:2147483647;margin:0;padding:10px 14px;' +
126
+ 'background:#fff7ed;border-bottom:1px solid #fdba74;color:#7c2d12;' +
127
+ 'font:13px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;';
128
+ notice.textContent = ${JSON.stringify(`This artifact asked for ${t.join(`, `)}, which is not available offline. Artifacts run without network access; ask for a version that uses the built-in libraries.`)};
129
+ var place = function () {
130
+ if (document.body) document.body.insertBefore(notice, document.body.firstChild);
131
+ };
132
+ if (document.body) place();
133
+ else document.addEventListener('DOMContentLoaded', place);
134
+ })();`},X=(e,t,n,r,i)=>`<!DOCTYPE html>
135
+ <html lang="en" data-color-scheme="${i.colorScheme??`light`}">
136
+ <head>
137
+ <meta charset="UTF-8" />
138
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
139
+ <base target="_blank" />
140
+ <title>${x(e)}</title>
141
+ <style>${U}</style>
142
+ </head>
143
+ <body>
144
+ <div id="root"></div>
145
+ ${G(K)}
146
+ <script>window.__libreArtifactSource = ${W(t)};<\/script>
147
+ ${n.map(G).join(`
148
+ `)}
149
+ <script>window.${j}.${r}();<\/script>
150
+ </body>
151
+ </html>`;function le(e,t,n,r,i={}){let a=Y(e,t).map(e=>r[e]).filter(e=>!!e);if(e===`react`)return X(n,t,a,`runReact`,i);if(e===`mermaid`)return X(n,t,a,`runMermaid`,i);let o=[];return se(m(t,n),r,[K,...a],o)}async function Z(e,t,n,r={}){return le(e,t,n,await V(Y(e,t)),r)}var Q=t(),$=r(`components:artifact-sandbox-frame`),ue=8e3,de=({content:e,title:t,kind:n=`html`,colorScheme:r=`light`,className:i,testId:c=`artifact-html-preview`,fallback:d})=>{let f=(0,a.useRef)(null),p=(0,a.useRef)(!1),m=(0,a.useRef)(null),[h,g]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let i=!1;return Z(n,e,t,{colorScheme:r}).then(e=>{i||(m.current=e,p.current&&u(f.current,e))}).catch(e=>{i||($.error(`Failed to prepare the artifact runtime:`,e),g(!0))}),()=>{i=!0}},[n,e,t,r]),(0,a.useEffect)(()=>{let e=e=>{l(e,f.current)&&(p.current=!0,m.current&&u(f.current,m.current))};window.addEventListener(`message`,e);let t=window.setTimeout(()=>{p.current||g(!0)},ue);return()=>{window.removeEventListener(`message`,e),window.clearTimeout(t)}},[]),h&&d?(0,Q.jsx)(Q.Fragment,{children:d}):(0,Q.jsx)(`iframe`,{ref:f,"data-testid":c,src:C,className:i,sandbox:o,allow:s,title:t})};export{m as a,p as c,C as i,g as l,H as n,h as o,Z as r,f as s,de as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{d as t,f as n}from"./markdown-core-DHnR5Hw8.js";import{n as r}from"./react-vendor-DPNXrO-8.js";import{t as i}from"./useTranslation-CdeLZqSW.js";import{i as a}from"./i18n-DFbHZ75-.js";import{Bt as ee,Gt as o,Ht as s,Jt as c,Pt as l,Rt as te,bt as ne,f as u,in as re,n as ie,on as d,qt as f,rn as p,yt as m}from"./ui-vendor-D_pYT79f.js";import{t as h}from"./logger-DSXjF4ye.js";import{t as g}from"./utils-BhpNrGnR.js";import{t as ae}from"./chatStore-fX9gMb9B.js";import{t as oe}from"./appStore-BAFz_6aP.js";import{t as _}from"./Button-X9TT9gTD.js";import{t as v}from"./OptimizedSyntaxHighlighter-CWYUn9Oe.js";import{a as se,i as ce,l as le,n as y,o as ue,r as de,t as fe}from"./ArtifactSandboxFrame-DOQWmEAm.js";var b=e(n(),1),pe=r(),x=t(),S=h(`components:artifact-slide-out-panel`),me=320,C=.9,w=600,T=()=>{let{t:e,i18n:t}=i(),n=a(t.language),{artifactPanelOpen:r,artifactPanelArtifact:h,openArtifactPanel:T,closeArtifactPanel:E,theme:D}=oe(),O=ae(e=>e.currentSession),k=b.useMemo(()=>{if(!h)return[];let e=h.title.trim().toLowerCase(),t=(O?.messages??[]).flatMap(e=>e.artifacts??[]).filter(t=>t.title.trim().toLowerCase()===e);return t.some(e=>e.id===h.id)?t:[...t,h]},[O,h]),A=k.findIndex(e=>e.id===h?.id),[he,j]=(0,b.useState)(!1),[M,N]=(0,b.useState)(`preview`),[P,F]=(0,b.useState)(w),[I,L]=(0,b.useState)(!1),R=(0,b.useRef)(null),z=(0,b.useRef)(null),B=(0,b.useRef)(0),V=(0,b.useRef)(0),H=(0,b.useRef)(null),U=(0,b.useRef)(null),W=(0,b.useRef)(P),G=h?.id??null;G!==z.current&&(z.current=G,M!==`preview`&&N(`preview`));let K=(0,b.useCallback)(e=>{W.current=e,U.current===null&&(U.current=window.requestAnimationFrame(()=>{U.current=null,F(W.current)}))},[]),q=(0,b.useCallback)(()=>{H.current=null,L(!1),U.current!==null&&(window.cancelAnimationFrame(U.current),U.current=null,F(W.current))},[]),ge=(0,b.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),H.current=e.pointerId,V.current=P,B.current=e.clientX,W.current=P,e.currentTarget.setPointerCapture(e.pointerId),L(!0)},[P]),J=(0,b.useCallback)(e=>{if(!I||H.current!==null&&e.pointerId!==H.current)return;e.preventDefault();let t=(B.current-e.clientX)*(n?-1:1),r=window.innerWidth*C,i=Math.min(r,Math.max(me,V.current+t));K(i)},[I,n,K]);if((0,b.useEffect)(()=>{if(!I){document.body.style.userSelect=``,document.body.style.cursor=``;return}let e=e=>{(H.current===null||e.pointerId===H.current)&&q()};return window.addEventListener(`pointermove`,J,{passive:!1}),window.addEventListener(`pointerup`,e),window.addEventListener(`pointercancel`,e),window.addEventListener(`blur`,q),document.body.style.userSelect=`none`,document.body.style.cursor=`col-resize`,()=>{window.removeEventListener(`pointermove`,J),window.removeEventListener(`pointerup`,e),window.removeEventListener(`pointercancel`,e),window.removeEventListener(`blur`,q),document.body.style.userSelect=``,document.body.style.cursor=``}},[I,J,q]),(0,b.useEffect)(()=>{let e=()=>{let e=window.innerWidth*C;P>e&&F(e)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[P]),(0,b.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r&&E()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,E]),(0,b.useEffect)(()=>{let e=e=>{I||R.current&&!R.current.contains(e.target)&&r&&E()},t=setTimeout(()=>{window.addEventListener(`mousedown`,e)},100);return()=>{clearTimeout(t),window.removeEventListener(`mousedown`,e)}},[r,E,I]),!h)return null;let Y=h,_e=async e=>{try{await navigator.clipboard.writeText(e),j(!0),setTimeout(()=>j(!1),2e3)}catch(e){S.error(`Failed to copy:`,e)}},ve=()=>{let e=Y.type===`html`?se(Y.content,Y.title):Y.content,t=new Blob([e],{type:ye(Y.type)}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${Y.title}.${be(Y.type)}`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)},ye=e=>{switch(e){case`html`:return`text/html`;case`react`:return`text/javascript`;case`svg`:return`image/svg+xml`;case`css`:return`text/css`;case`json`:return`application/json`;default:return`text/plain`}},be=e=>{switch(e){case`html`:return`html`;case`react`:return`jsx`;case`svg`:return`svg`;case`css`:return`css`;case`json`:return`json`;default:return`txt`}},xe=()=>{switch(Y.type){case`html`:return(0,x.jsx)(ne,{className:`h-5 w-5`});case`react`:return(0,x.jsx)(f,{className:`h-5 w-5`});case`svg`:return(0,x.jsx)(l,{className:`h-5 w-5`});case`code`:return(0,x.jsx)(f,{className:`h-5 w-5`});default:return(0,x.jsx)(l,{className:`h-5 w-5`})}},X=()=>(0,x.jsx)(`div`,{"data-testid":`artifact-html-fallback`,className:`w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 rounded-lg border border-gray-200 dark:border-dark-200 p-4`,children:(0,x.jsxs)(`div`,{className:`max-w-sm text-center`,children:[(0,x.jsx)(u,{className:`h-8 w-8 text-primary-500 mx-auto mb-3`}),(0,x.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100`,children:e(`artifacts.previewUnavailable`)}),(0,x.jsx)(`p`,{className:`mt-1 text-sm text-gray-600 dark:text-gray-400`,children:e(`artifacts.previewUnavailableDescription`)}),(0,x.jsxs)(_,{variant:`outline`,size:`sm`,onClick:()=>N(`code`),className:`mt-4`,children:[(0,x.jsx)(c,{className:`h-3.5 w-3.5 me-1.5`}),e(`artifacts.code`)]})]})}),Se=async()=>{try{let e=await de(y(Y.type)??`html`,Y.content,Y.title,{colorScheme:D.mode===`dark`?`dark`:`light`});le(e,ce,Y.title)}catch(e){S.error(`Failed to open the artifact preview:`,e)}},Z=e=>Y.content.trim()?(0,x.jsx)(fe,{content:Y.content,title:Y.title,kind:e,colorScheme:D.mode===`dark`?`dark`:`light`,className:g(`w-full h-full border-0 rounded-lg bg-white`,I&&`pointer-events-none`),fallback:X()}):X(),Ce=()=>(0,x.jsx)(`iframe`,{"data-testid":`artifact-svg-preview`,srcDoc:ue(Y.content,Y.title),className:`w-full h-full border-0 rounded-lg bg-white`,sandbox:``,title:Y.title}),Q=()=>(0,x.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,x.jsx)(v,{language:(()=>{if(Y.language)return Y.language;switch(Y.type){case`html`:return`html`;case`react`:return`jsx`;case`svg`:return`xml`;case`json`:return`json`;default:return`text`}})(),isDark:D.mode===`dark`,className:`!m-0 !rounded-lg !h-full`,children:Y.content})}),we=()=>{try{let e=JSON.parse(Y.content),t=JSON.stringify(e,null,2);return(0,x.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,x.jsx)(v,{language:`json`,isDark:D.mode===`dark`,className:`!m-0 !rounded-lg !h-full`,children:t})})}catch{return(0,x.jsx)(`div`,{className:`w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 rounded-lg`,children:(0,x.jsxs)(`div`,{className:`text-center`,children:[(0,x.jsx)(u,{className:`h-8 w-8 text-primary-500 mx-auto mb-2`}),(0,x.jsx)(`p`,{className:`text-sm text-gray-600 dark:text-dark-600`,children:e(`artifacts.invalidJson`)})]})})}},Te=()=>{if(M===`code`)return Q();switch(Y.type){case`html`:return Z(`html`);case`react`:return Z(`react`);case`mermaid`:return Z(`mermaid`);case`svg`:return Ce();case`json`:return we();default:return Q()}},Ee=()=>Y.type===`html`||Y.type===`svg`||Y.type===`react`||Y.type===`mermaid`,$=typeof window<`u`&&window.innerWidth<640,De=$?`100%`:`${P}px`,Oe=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:g(`fixed inset-0 bg-black/30 dark:bg-black/50 z-40 transition-opacity duration-300`,r?`opacity-100`:`opacity-0 pointer-events-none`)}),I&&(0,x.jsx)(`div`,{className:`fixed inset-0 z-[55] cursor-col-resize select-none`,"aria-hidden":`true`}),(0,x.jsxs)(`div`,{ref:R,"data-testid":`artifact-slide-out-panel`,style:{width:De},className:g(`fixed top-0 end-0 h-full z-50`,`bg-white dark:bg-dark-25`,`shadow-2xl border-s border-gray-200 dark:border-dark-200`,`flex flex-col`,`transform transition-transform duration-300 ease-out`,r?`translate-x-0`:`translate-x-full rtl:-translate-x-full`),children:[!$&&(0,x.jsxs)(`div`,{onPointerDown:ge,"data-testid":`artifact-resize-handle`,className:g(`absolute start-0 top-0 bottom-0 w-4 -ms-2 cursor-col-resize z-[56]`,`flex items-center justify-center`,`touch-none select-none group`),children:[(0,x.jsx)(`div`,{className:g(`w-1 h-16 rounded-full transition-all duration-200`,`bg-gray-300 dark:bg-dark-300`,`group-hover:bg-primary-500 group-hover:h-24`,I&&`bg-primary-500 h-24`)}),(0,x.jsx)(`div`,{className:g(`absolute left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity`,`text-gray-400 dark:text-dark-500`,I&&`opacity-100`),children:(0,x.jsx)(m,{className:`h-4 w-4`})})]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between p-4 border-b border-gray-200 dark:border-dark-200`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`text-gray-600 dark:text-gray-400 flex-shrink-0`,children:xe()}),(0,x.jsx)(`h2`,{className:`font-semibold text-gray-900 dark:text-gray-100 truncate`,children:Y.title}),(0,x.jsx)(`span`,{className:`text-xs bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300 px-2 py-1 rounded-full font-medium flex-shrink-0`,children:Y.type.toUpperCase()})]}),(0,x.jsx)(_,{variant:`ghost`,size:`sm`,onClick:E,className:`h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 flex-shrink-0`,title:e(`artifacts.closePanelEsc`),children:(0,x.jsx)(ie,{className:`h-5 w-5`})})]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-gray-100 dark:border-dark-200 bg-gray-50 dark:bg-dark-100/50`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[k.length>1&&A!==-1&&(0,x.jsxs)(`div`,{className:`me-1 flex items-center gap-0.5`,children:[(0,x.jsx)(_,{variant:`ghost`,size:`sm`,disabled:A===0,onClick:()=>T(k[A-1]),className:`h-8 w-8 p-0`,title:e(`artifacts.previousVersion`),children:(0,x.jsx)(re,{className:`h-3.5 w-3.5 rtl:rotate-180`})}),(0,x.jsx)(`span`,{className:`whitespace-nowrap text-xs tabular-nums text-gray-500 dark:text-dark-600`,children:e(`artifacts.versionOf`,{current:A+1,total:k.length})}),(0,x.jsx)(_,{variant:`ghost`,size:`sm`,disabled:A===k.length-1,onClick:()=>T(k[A+1]),className:`h-8 w-8 p-0`,title:e(`artifacts.nextVersion`),children:(0,x.jsx)(p,{className:`h-3.5 w-3.5 rtl:rotate-180`})})]}),Ee()&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(_,{variant:M===`preview`?`primary`:`ghost`,size:`sm`,onClick:()=>N(`preview`),className:`h-8 px-3 text-xs`,title:e(`artifacts.previewMode`),children:[(0,x.jsx)(te,{className:`h-3.5 w-3.5 me-1.5`}),e(`artifacts.preview`)]}),(0,x.jsxs)(_,{variant:M===`code`?`primary`:`ghost`,size:`sm`,onClick:()=>N(`code`),className:`h-8 px-3 text-xs`,title:e(`artifacts.codeMode`),children:[(0,x.jsx)(c,{className:`h-3.5 w-3.5 me-1.5`}),e(`artifacts.code`)]})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(_,{variant:`ghost`,size:`sm`,onClick:()=>_e(Y.content),className:`h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200`,title:e(`artifacts.copyContent`),children:he?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(d,{className:`h-3.5 w-3.5 me-1.5 text-green-500`}),e(`artifacts.copied`)]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(o,{className:`h-3.5 w-3.5 me-1.5`}),e(`artifacts.copyButton`)]})}),(0,x.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:ve,className:`h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200`,title:e(`artifacts.download`),children:[(0,x.jsx)(s,{className:`h-3.5 w-3.5 me-1.5`}),e(`artifacts.download`)]}),y(Y.type)&&(0,x.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:()=>Se(),className:`h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200`,title:e(`artifacts.openInNewWindow`),children:[(0,x.jsx)(ee,{className:`h-3.5 w-3.5 me-1.5`}),e(`artifacts.open`)]})]})]}),Y.description&&(0,x.jsx)(`div`,{className:`px-4 py-3 border-b border-gray-100 dark:border-dark-200`,children:(0,x.jsx)(`p`,{className:`text-sm text-gray-600 dark:text-gray-400`,children:Y.description})}),(0,x.jsx)(`div`,{className:`flex-1 p-4 overflow-hidden`,children:Te()}),(0,x.jsx)(`div`,{className:`px-4 py-2 border-t border-gray-100 dark:border-dark-200 bg-gray-50 dark:bg-dark-100/50`,children:(0,x.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,x.jsxs)(`div`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:[e(`artifacts.created`),`:`,` `,new Date(Y.createdAt).toLocaleString()]}),!$&&(0,x.jsx)(`div`,{className:`text-xs text-gray-400 dark:text-dark-500`,children:e(`artifacts.dragEdgeToResize`)})]})})]})]});return(0,pe.createPortal)(Oe,document.body)};export{T as ArtifactSlideOutPanel};