@semiont/cli 0.4.9 → 0.4.11

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 (200) hide show
  1. package/dist/cli.mjs +25 -22
  2. package/dist/frontend/README.md +50 -0
  3. package/dist/frontend/dist/assets/ArrowsRightLeftIcon-CMDe963r.js +2 -0
  4. package/dist/frontend/dist/assets/ArrowsRightLeftIcon-CMDe963r.js.map +1 -0
  5. package/dist/frontend/dist/assets/AuthContext-CYne_gJM.js +2 -0
  6. package/dist/frontend/dist/assets/AuthContext-CYne_gJM.js.map +1 -0
  7. package/dist/frontend/dist/assets/ChevronLeftIcon-CMXd_XZQ.js +2 -0
  8. package/dist/frontend/dist/assets/ChevronLeftIcon-CMXd_XZQ.js.map +1 -0
  9. package/dist/frontend/dist/assets/CommandLineIcon-BBerq9Nd.js +2 -0
  10. package/dist/frontend/dist/assets/CommandLineIcon-BBerq9Nd.js.map +1 -0
  11. package/dist/frontend/dist/assets/CookiePreferences-DxD0u90z.js +2 -0
  12. package/dist/frontend/dist/assets/CookiePreferences-DxD0u90z.js.map +1 -0
  13. package/dist/frontend/dist/assets/KnowledgeBaseContext-CgnF8K-_.js +2 -0
  14. package/dist/frontend/dist/assets/KnowledgeBaseContext-CgnF8K-_.js.map +1 -0
  15. package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-CW6SKH2U-CVmEpRfP.js +2 -0
  16. package/dist/frontend/dist/assets/PdfAnnotationCanvas.client-CW6SKH2U-CVmEpRfP.js.map +1 -0
  17. package/dist/frontend/dist/assets/PlusIcon-qGFPUzg0.js +2 -0
  18. package/dist/frontend/dist/assets/PlusIcon-qGFPUzg0.js.map +1 -0
  19. package/dist/frontend/dist/assets/StreamStatusContext-BuPATpTz.js +2 -0
  20. package/dist/frontend/dist/assets/StreamStatusContext-BuPATpTz.js.map +1 -0
  21. package/dist/frontend/dist/assets/ToolbarPanels-tcvPzqNN.js +2 -0
  22. package/dist/frontend/dist/assets/ToolbarPanels-tcvPzqNN.js.map +1 -0
  23. package/dist/frontend/dist/assets/ar-R4CRNXEF-Ca4TvZQX.js +2 -0
  24. package/dist/frontend/dist/assets/ar-R4CRNXEF-Ca4TvZQX.js.map +1 -0
  25. package/dist/frontend/dist/assets/bn-CZKGRHTA-BYgoliLL.js +2 -0
  26. package/dist/frontend/dist/assets/bn-CZKGRHTA-BYgoliLL.js.map +1 -0
  27. package/dist/frontend/dist/assets/browser-ponyfill-DkbQZCyF.js +3 -0
  28. package/dist/frontend/dist/assets/browser-ponyfill-DkbQZCyF.js.map +1 -0
  29. package/dist/frontend/dist/assets/client-87q-RlKa.js +2 -0
  30. package/dist/frontend/dist/assets/client-87q-RlKa.js.map +1 -0
  31. package/dist/frontend/dist/assets/client-BZBaSaZ0.js +2 -0
  32. package/dist/frontend/dist/assets/client-BZBaSaZ0.js.map +1 -0
  33. package/dist/frontend/dist/assets/client-CKEJUXXb.js +2 -0
  34. package/dist/frontend/dist/assets/client-CKEJUXXb.js.map +1 -0
  35. package/dist/frontend/dist/assets/client-DWcJNpII.js +2 -0
  36. package/dist/frontend/dist/assets/client-DWcJNpII.js.map +1 -0
  37. package/dist/frontend/dist/assets/cs-4WIB2IHH-C7kYZeeH.js +2 -0
  38. package/dist/frontend/dist/assets/cs-4WIB2IHH-C7kYZeeH.js.map +1 -0
  39. package/dist/frontend/dist/assets/da-JWYEUYPX-ZaU3NHTl.js +2 -0
  40. package/dist/frontend/dist/assets/da-JWYEUYPX-ZaU3NHTl.js.map +1 -0
  41. package/dist/frontend/dist/assets/de-GWUQZGER-DsO9vSRx.js +2 -0
  42. package/dist/frontend/dist/assets/de-GWUQZGER-DsO9vSRx.js.map +1 -0
  43. package/dist/frontend/dist/assets/el-DM2GT7P5-Baqj4u37.js +2 -0
  44. package/dist/frontend/dist/assets/el-DM2GT7P5-Baqj4u37.js.map +1 -0
  45. package/dist/frontend/dist/assets/en-IUV4ZXKH-BjYNERUx.js +135 -0
  46. package/dist/frontend/dist/assets/en-IUV4ZXKH-BjYNERUx.js.map +1 -0
  47. package/dist/frontend/dist/assets/es-6LVQIM3D-iPWrspyh.js +2 -0
  48. package/dist/frontend/dist/assets/es-6LVQIM3D-iPWrspyh.js.map +1 -0
  49. package/dist/frontend/dist/assets/fa-IRUJY3QI-D7jhkhZq.js +2 -0
  50. package/dist/frontend/dist/assets/fa-IRUJY3QI-D7jhkhZq.js.map +1 -0
  51. package/dist/frontend/dist/assets/fi-53FBOEVT-DyL1QG5i.js +2 -0
  52. package/dist/frontend/dist/assets/fi-53FBOEVT-DyL1QG5i.js.map +1 -0
  53. package/dist/frontend/dist/assets/fr-Q5KY7QL6-CGM9feO_.js +2 -0
  54. package/dist/frontend/dist/assets/fr-Q5KY7QL6-CGM9feO_.js.map +1 -0
  55. package/dist/frontend/dist/assets/he-HJNKULBY-CiS3ww0i.js +2 -0
  56. package/dist/frontend/dist/assets/he-HJNKULBY-CiS3ww0i.js.map +1 -0
  57. package/dist/frontend/dist/assets/hi-UYZ4X6CR-Cb3OYOtm.js +2 -0
  58. package/dist/frontend/dist/assets/hi-UYZ4X6CR-Cb3OYOtm.js.map +1 -0
  59. package/dist/frontend/dist/assets/i18n-BYxb14hm.js +2 -0
  60. package/dist/frontend/dist/assets/i18n-BYxb14hm.js.map +1 -0
  61. package/dist/frontend/dist/assets/id-UAQMH6U2-CgqnTJaj.js +2 -0
  62. package/dist/frontend/dist/assets/id-UAQMH6U2-CgqnTJaj.js.map +1 -0
  63. package/dist/frontend/dist/assets/index-D4SjcYxX.js +27 -0
  64. package/dist/frontend/dist/assets/index-D4SjcYxX.js.map +1 -0
  65. package/dist/frontend/dist/assets/index-x79a-Q1-.css +1 -0
  66. package/dist/frontend/dist/assets/it-C7QEBNFA-BP64tE9N.js +2 -0
  67. package/dist/frontend/dist/assets/it-C7QEBNFA-BP64tE9N.js.map +1 -0
  68. package/dist/frontend/dist/assets/ja-THS6AOSJ-BlrsrgpZ.js +2 -0
  69. package/dist/frontend/dist/assets/ja-THS6AOSJ-BlrsrgpZ.js.map +1 -0
  70. package/dist/frontend/dist/assets/ko-XKK3TWQG-BnscEkav.js +2 -0
  71. package/dist/frontend/dist/assets/ko-XKK3TWQG-BnscEkav.js.map +1 -0
  72. package/dist/frontend/dist/assets/layout-B-TMNLm1.js +6 -0
  73. package/dist/frontend/dist/assets/layout-B-TMNLm1.js.map +1 -0
  74. package/dist/frontend/dist/assets/layout-C4uWiY4F.js +2 -0
  75. package/dist/frontend/dist/assets/layout-C4uWiY4F.js.map +1 -0
  76. package/dist/frontend/dist/assets/layout-D9y4fNSa.js +2 -0
  77. package/dist/frontend/dist/assets/layout-D9y4fNSa.js.map +1 -0
  78. package/dist/frontend/dist/assets/layout-DYXeBZ7E.js +2 -0
  79. package/dist/frontend/dist/assets/layout-DYXeBZ7E.js.map +1 -0
  80. package/dist/frontend/dist/assets/ms-GSK7LIF7-BWJ-3eXy.js +2 -0
  81. package/dist/frontend/dist/assets/ms-GSK7LIF7-BWJ-3eXy.js.map +1 -0
  82. package/dist/frontend/dist/assets/nl-KUBWITGY-DeqIcEFQ.js +2 -0
  83. package/dist/frontend/dist/assets/nl-KUBWITGY-DeqIcEFQ.js.map +1 -0
  84. package/dist/frontend/dist/assets/no-ECWZUHT6-DMgg097w.js +2 -0
  85. package/dist/frontend/dist/assets/no-ECWZUHT6-DMgg097w.js.map +1 -0
  86. package/dist/frontend/dist/assets/not-found-D39eX95i.js +2 -0
  87. package/dist/frontend/dist/assets/not-found-D39eX95i.js.map +1 -0
  88. package/dist/frontend/dist/assets/page-B68iiwby.js +2 -0
  89. package/dist/frontend/dist/assets/page-B68iiwby.js.map +1 -0
  90. package/dist/frontend/dist/assets/page-B8rInMTj.js +5 -0
  91. package/dist/frontend/dist/assets/page-B8rInMTj.js.map +1 -0
  92. package/dist/frontend/dist/assets/page-BBEm8LmA.js +2 -0
  93. package/dist/frontend/dist/assets/page-BBEm8LmA.js.map +1 -0
  94. package/dist/frontend/dist/assets/page-BjjPEFxE.js +2 -0
  95. package/dist/frontend/dist/assets/page-BjjPEFxE.js.map +1 -0
  96. package/dist/frontend/dist/assets/page-Bs0m7wcI.js +2 -0
  97. package/dist/frontend/dist/assets/page-Bs0m7wcI.js.map +1 -0
  98. package/dist/frontend/dist/assets/page-C2ievByA.js +2 -0
  99. package/dist/frontend/dist/assets/page-C2ievByA.js.map +1 -0
  100. package/dist/frontend/dist/assets/page-CEDbSdpB.js +2 -0
  101. package/dist/frontend/dist/assets/page-CEDbSdpB.js.map +1 -0
  102. package/dist/frontend/dist/assets/page-CnBwmYIE.js +20 -0
  103. package/dist/frontend/dist/assets/page-CnBwmYIE.js.map +1 -0
  104. package/dist/frontend/dist/assets/page-D9kiPafj.js +2 -0
  105. package/dist/frontend/dist/assets/page-D9kiPafj.js.map +1 -0
  106. package/dist/frontend/dist/assets/page-DU4gR5Xo.js +2 -0
  107. package/dist/frontend/dist/assets/page-DU4gR5Xo.js.map +1 -0
  108. package/dist/frontend/dist/assets/page-DVuwkaR0.js +2 -0
  109. package/dist/frontend/dist/assets/page-DVuwkaR0.js.map +1 -0
  110. package/dist/frontend/dist/assets/page-DX3FJ71G.js +2 -0
  111. package/dist/frontend/dist/assets/page-DX3FJ71G.js.map +1 -0
  112. package/dist/frontend/dist/assets/page-DfClTFD9.js +2 -0
  113. package/dist/frontend/dist/assets/page-DfClTFD9.js.map +1 -0
  114. package/dist/frontend/dist/assets/page-KDTjODvy.js +2 -0
  115. package/dist/frontend/dist/assets/page-KDTjODvy.js.map +1 -0
  116. package/dist/frontend/dist/assets/page-eebHZHg3.js +8 -0
  117. package/dist/frontend/dist/assets/page-eebHZHg3.js.map +1 -0
  118. package/dist/frontend/dist/assets/page-fN3EjI48.js +2 -0
  119. package/dist/frontend/dist/assets/page-fN3EjI48.js.map +1 -0
  120. package/dist/frontend/dist/assets/page-kM0Ep9uD.js +2 -0
  121. package/dist/frontend/dist/assets/page-kM0Ep9uD.js.map +1 -0
  122. package/dist/frontend/dist/assets/page-m23deNER.js +2 -0
  123. package/dist/frontend/dist/assets/page-m23deNER.js.map +1 -0
  124. package/dist/frontend/dist/assets/pl-PLVWSZWS-B9TKLToJ.js +2 -0
  125. package/dist/frontend/dist/assets/pl-PLVWSZWS-B9TKLToJ.js.map +1 -0
  126. package/dist/frontend/dist/assets/privacy-QEJYcmMw.js +2 -0
  127. package/dist/frontend/dist/assets/privacy-QEJYcmMw.js.map +1 -0
  128. package/dist/frontend/dist/assets/pt-AL74ZTKB-dm40issX.js +2 -0
  129. package/dist/frontend/dist/assets/pt-AL74ZTKB-dm40issX.js.map +1 -0
  130. package/dist/frontend/dist/assets/query-ATBhtd3K.js +10 -0
  131. package/dist/frontend/dist/assets/query-ATBhtd3K.js.map +1 -0
  132. package/dist/frontend/dist/assets/ro-WTPHLHGS-42q4gQmg.js +2 -0
  133. package/dist/frontend/dist/assets/ro-WTPHLHGS-42q4gQmg.js.map +1 -0
  134. package/dist/frontend/dist/assets/routing-BgsGBuSe.js +2 -0
  135. package/dist/frontend/dist/assets/routing-BgsGBuSe.js.map +1 -0
  136. package/dist/frontend/dist/assets/routing-nZgBtxly.js +2 -0
  137. package/dist/frontend/dist/assets/routing-nZgBtxly.js.map +1 -0
  138. package/dist/frontend/dist/assets/sv-QCLI7SG4-KVnre_zY.js +2 -0
  139. package/dist/frontend/dist/assets/sv-QCLI7SG4-KVnre_zY.js.map +1 -0
  140. package/dist/frontend/dist/assets/th-WCKVZU6U-CfRhC_Eg.js +2 -0
  141. package/dist/frontend/dist/assets/th-WCKVZU6U-CfRhC_Eg.js.map +1 -0
  142. package/dist/frontend/dist/assets/tr-2CAFS2XS-425EzbTD.js +2 -0
  143. package/dist/frontend/dist/assets/tr-2CAFS2XS-425EzbTD.js.map +1 -0
  144. package/dist/frontend/dist/assets/uk-TDE4JLCY-BUQpzvxx.js +2 -0
  145. package/dist/frontend/dist/assets/uk-TDE4JLCY-BUQpzvxx.js.map +1 -0
  146. package/dist/frontend/dist/assets/useAuth-CqtZE9nt.js +2 -0
  147. package/dist/frontend/dist/assets/useAuth-CqtZE9nt.js.map +1 -0
  148. package/dist/frontend/dist/assets/vendor-EnoIVk-c.js +29 -0
  149. package/dist/frontend/dist/assets/vendor-EnoIVk-c.js.map +1 -0
  150. package/dist/frontend/dist/assets/vi-KKXZ4PCX-BqlhZbBi.js +2 -0
  151. package/dist/frontend/dist/assets/vi-KKXZ4PCX-BqlhZbBi.js.map +1 -0
  152. package/dist/frontend/dist/assets/zh-VH4XN5PV-TNQ5FOx-.js +2 -0
  153. package/dist/frontend/dist/assets/zh-VH4XN5PV-TNQ5FOx-.js.map +1 -0
  154. package/dist/frontend/dist/favicons/android-chrome-192x192.png +0 -0
  155. package/dist/frontend/dist/favicons/android-chrome-512x512.png +0 -0
  156. package/dist/frontend/dist/favicons/apple-touch-icon.png +0 -0
  157. package/dist/frontend/dist/favicons/favicon-128x128.png +0 -0
  158. package/dist/frontend/dist/favicons/favicon-16x16.png +0 -0
  159. package/dist/frontend/dist/favicons/favicon-32x32.png +0 -0
  160. package/dist/frontend/dist/favicons/favicon-48x48.png +0 -0
  161. package/dist/frontend/dist/favicons/favicon-64x64.png +0 -0
  162. package/dist/frontend/dist/favicons/favicon-96x96.png +0 -0
  163. package/dist/frontend/dist/favicons/favicon.ico +0 -0
  164. package/dist/frontend/dist/favicons/favicon.svg +47 -0
  165. package/dist/frontend/dist/favicons/site.webmanifest +19 -0
  166. package/dist/frontend/dist/index.html +23 -0
  167. package/dist/frontend/dist/messages/ar.json +958 -0
  168. package/dist/frontend/dist/messages/bn.json +958 -0
  169. package/dist/frontend/dist/messages/cs.json +958 -0
  170. package/dist/frontend/dist/messages/da.json +958 -0
  171. package/dist/frontend/dist/messages/de.json +958 -0
  172. package/dist/frontend/dist/messages/el.json +958 -0
  173. package/dist/frontend/dist/messages/en.json +958 -0
  174. package/dist/frontend/dist/messages/es.json +958 -0
  175. package/dist/frontend/dist/messages/fa.json +958 -0
  176. package/dist/frontend/dist/messages/fi.json +958 -0
  177. package/dist/frontend/dist/messages/fr.json +958 -0
  178. package/dist/frontend/dist/messages/he.json +958 -0
  179. package/dist/frontend/dist/messages/hi.json +958 -0
  180. package/dist/frontend/dist/messages/id.json +958 -0
  181. package/dist/frontend/dist/messages/it.json +958 -0
  182. package/dist/frontend/dist/messages/ja.json +958 -0
  183. package/dist/frontend/dist/messages/ko.json +958 -0
  184. package/dist/frontend/dist/messages/ms.json +958 -0
  185. package/dist/frontend/dist/messages/nl.json +958 -0
  186. package/dist/frontend/dist/messages/no.json +958 -0
  187. package/dist/frontend/dist/messages/pl.json +958 -0
  188. package/dist/frontend/dist/messages/pt.json +958 -0
  189. package/dist/frontend/dist/messages/ro.json +958 -0
  190. package/dist/frontend/dist/messages/sv.json +958 -0
  191. package/dist/frontend/dist/messages/th.json +958 -0
  192. package/dist/frontend/dist/messages/tr.json +958 -0
  193. package/dist/frontend/dist/messages/uk.json +958 -0
  194. package/dist/frontend/dist/messages/vi.json +958 -0
  195. package/dist/frontend/dist/messages/zh.json +958 -0
  196. package/dist/frontend/dist/pdfjs/pdf.min.mjs +21 -0
  197. package/dist/frontend/dist/pdfjs/pdf.worker.min.mjs +21 -0
  198. package/dist/frontend/package.json +26 -0
  199. package/dist/frontend/server.js +82 -0
  200. package/package.json +7 -7
package/dist/cli.mjs CHANGED
@@ -7737,7 +7737,6 @@ var init_backend_start = __esm({
7737
7737
  const databaseUrl = `postgresql://${dbUser}:${dbPassword}@${dbHost}:${dbPort}/${dbName}`;
7738
7738
  const nodeEnv = envConfig.env?.NODE_ENV ?? "development";
7739
7739
  const enableLocalAuth = envConfig.app?.security?.enableLocalAuth ?? nodeEnv === "development";
7740
- const frontendUrl = envConfig.services.frontend.publicURL;
7741
7740
  const backendUrl = config.publicURL;
7742
7741
  const siteDomain = envConfig.site.domain;
7743
7742
  const allowedDomains = envConfig.site.oauthAllowedDomains.join(",");
@@ -7748,7 +7747,6 @@ var init_backend_start = __esm({
7748
7747
  HOST: "0.0.0.0",
7749
7748
  DATABASE_URL: databaseUrl,
7750
7749
  LOG_DIR: logsDir,
7751
- FRONTEND_URL: frontendUrl,
7752
7750
  BACKEND_URL: backendUrl,
7753
7751
  ENABLE_LOCAL_AUTH: enableLocalAuth.toString(),
7754
7752
  SITE_DOMAIN: siteDomain,
@@ -8519,7 +8517,7 @@ var init_backend_provision = __esm({
8519
8517
  init_cli_logger();
8520
8518
  init_backend_paths();
8521
8519
  init_preflight_utils();
8522
- SEMIONT_VERSION = "0.4.9";
8520
+ SEMIONT_VERSION = "0.4.11";
8523
8521
  provisionBackendService = async (context) => {
8524
8522
  const { service, options } = context;
8525
8523
  const projectRoot = service.projectRoot;
@@ -15037,17 +15035,19 @@ var init_platform3 = __esm({
15037
15035
  * Helper method to detect container runtime
15038
15036
  */
15039
15037
  detectContainerRuntime() {
15040
- try {
15041
- execFileSync30("docker", ["--version"], { stdio: "ignore" });
15042
- return "docker";
15043
- } catch {
15038
+ const candidates = ["container", "docker", "podman"];
15039
+ if (process.env.CONTAINER_RUNTIME) {
15040
+ const env = process.env.CONTAINER_RUNTIME.toLowerCase();
15041
+ if (candidates.includes(env)) return env;
15042
+ }
15043
+ for (const runtime of candidates) {
15044
15044
  try {
15045
- execFileSync30("podman", ["--version"], { stdio: "ignore" });
15046
- return "podman";
15045
+ execFileSync30(runtime, ["--version"], { stdio: "ignore" });
15046
+ return runtime;
15047
15047
  } catch {
15048
- throw new Error("No container runtime (Docker or Podman) found");
15049
15048
  }
15050
15049
  }
15050
+ throw new Error("No container runtime found. Install Apple Container, Docker, or Podman.");
15051
15051
  }
15052
15052
  /**
15053
15053
  * Get standardized resource name for container
@@ -15106,7 +15106,7 @@ var init_platform3 = __esm({
15106
15106
  }
15107
15107
  /**
15108
15108
  * Collect logs for a container service
15109
- * Uses docker/podman logs command
15109
+ * Uses container runtime logs command
15110
15110
  */
15111
15111
  async collectLogs(service, options) {
15112
15112
  const serviceType = this.determineServiceType(service);
@@ -15157,7 +15157,7 @@ var init_platform3 = __esm({
15157
15157
  }
15158
15158
  /**
15159
15159
  * Parse a container log line
15160
- * Docker/Podman format with --timestamps: 2024-01-01T12:00:00.000000000Z message
15160
+ * Container log format with --timestamps: 2024-01-01T12:00:00.000000000Z message
15161
15161
  */
15162
15162
  parseContainerLogLine(line, serviceType) {
15163
15163
  const timestampMatch = line.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.[\d]+Z)\s+(.*)$/);
@@ -25795,7 +25795,7 @@ var require_package = __commonJS({
25795
25795
  "package.json"(exports, module) {
25796
25796
  module.exports = {
25797
25797
  name: "@semiont/cli",
25798
- version: "0.4.9",
25798
+ version: "0.4.11",
25799
25799
  description: "Semiont CLI - Unified environment management tool",
25800
25800
  _comment: "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
25801
25801
  type: "module",
@@ -25858,12 +25858,12 @@ var require_package = __commonJS({
25858
25858
  "@aws-sdk/client-secrets-manager": "^3.600.0",
25859
25859
  "@aws-sdk/client-sts": "^3.859.0",
25860
25860
  "@aws-sdk/client-wafv2": "^3.859.0",
25861
- "@semiont/api-client": "^0.4.9",
25862
- "@semiont/content": "^0.4.9",
25863
- "@semiont/core": "^0.4.9",
25864
- "@semiont/event-sourcing": "^0.4.9",
25865
- "@semiont/graph": "^0.4.9",
25866
- "@semiont/make-meaning": "^0.4.9",
25861
+ "@semiont/api-client": "0.4.10",
25862
+ "@semiont/content": "0.4.10",
25863
+ "@semiont/core": "0.4.10",
25864
+ "@semiont/event-sourcing": "0.4.10",
25865
+ "@semiont/graph": "0.4.10",
25866
+ "@semiont/make-meaning": "0.4.10",
25867
25867
  arg: "^5.0.2",
25868
25868
  argon2: "^0.44.0",
25869
25869
  express: "^5.2.1",
@@ -28159,7 +28159,10 @@ function listDir(dir) {
28159
28159
  }
28160
28160
  }
28161
28161
  function containerRuntime() {
28162
- for (const rt of ["docker", "podman"]) {
28162
+ if (process.env.CONTAINER_RUNTIME) {
28163
+ return process.env.CONTAINER_RUNTIME.toLowerCase();
28164
+ }
28165
+ for (const rt of ["container", "docker", "podman"]) {
28163
28166
  try {
28164
28167
  execFileSync39(rt, ["info"], { stdio: "ignore" });
28165
28168
  return rt;
@@ -28276,7 +28279,7 @@ async function clean(options) {
28276
28279
  });
28277
28280
  } else if (cleanVolumes && !runtime) {
28278
28281
  if (!options.quiet) {
28279
- console.log(`${colors.yellow}\u26A0\uFE0F No container runtime found (docker/podman) \u2014 skipping volumes${colors.reset}`);
28282
+ console.log(`${colors.yellow}\u26A0\uFE0F No container runtime found \u2014 skipping volumes${colors.reset}`);
28280
28283
  }
28281
28284
  }
28282
28285
  if (targets.length === 0) {
@@ -31086,7 +31089,7 @@ async function generateGlobalHelp() {
31086
31089
  }
31087
31090
 
31088
31091
  // src/cli.ts
31089
- var VERSION2 = "0.4.9";
31092
+ var VERSION2 = "0.4.11";
31090
31093
  function printVersion() {
31091
31094
  console.log(`Semiont CLI v${VERSION2}`);
31092
31095
  }
@@ -0,0 +1,50 @@
1
+ # @semiont/frontend
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@semiont/frontend.svg)](https://www.npmjs.com/package/@semiont/frontend)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@semiont/frontend.svg)](https://www.npmjs.com/package/@semiont/frontend)
5
+ [![License](https://img.shields.io/npm/l/@semiont/frontend.svg)](https://github.com/The-AI-Alliance/semiont/blob/main/LICENSE)
6
+
7
+ Pre-built Semiont frontend as a Vite SPA with a zero-dependency Node.js static file server. This package contains the compiled frontend application ready to run with Node.js.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install -g @semiont/frontend
13
+ ```
14
+
15
+ This package is typically installed automatically by `semiont provision` when using the [Semiont CLI](https://www.npmjs.com/package/@semiont/cli).
16
+
17
+ ## Usage
18
+
19
+ The recommended way to run Semiont is through the CLI:
20
+
21
+ ```bash
22
+ npm install -g @semiont/cli
23
+ semiont init my-project
24
+ cd my-project
25
+ semiont provision
26
+ semiont start
27
+ ```
28
+
29
+ The CLI handles configuration, environment setup, and process management.
30
+
31
+ ## Direct Usage
32
+
33
+ ```bash
34
+ PORT=3000 semiont-frontend
35
+ # or
36
+ PORT=3000 node node_modules/@semiont/frontend/server.js
37
+ ```
38
+
39
+ Requires `PORT` and `SEMIONT_BACKEND_URL` environment variables to be configured.
40
+
41
+ ## What's Included
42
+
43
+ - `dist/` - Vite-built static SPA assets
44
+ - `server.js` - Zero-dependency Node.js static file server with SPA fallback
45
+
46
+ ## Links
47
+
48
+ - [Semiont GitHub](https://github.com/The-AI-Alliance/semiont)
49
+ - [Semiont CLI](https://www.npmjs.com/package/@semiont/cli)
50
+ - [Documentation](https://github.com/The-AI-Alliance/semiont#readme)
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./vendor-EnoIVk-c.js";function a({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}const i=e.forwardRef(a);export{i as F};
2
+ //# sourceMappingURL=ArrowsRightLeftIcon-CMDe963r.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrowsRightLeftIcon-CMDe963r.js","sources":["../../../../node_modules/@heroicons/react/24/outline/esm/ArrowsRightLeftIcon.js"],"sourcesContent":["import * as React from \"react\";\nfunction ArrowsRightLeftIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ArrowsRightLeftIcon);\nexport default ForwardRef;"],"names":["ArrowsRightLeftIcon","title","titleId","props","svgRef","React.createElement","ForwardRef","React.forwardRef"],"mappings":"yCACA,SAASA,EAAoB,CAC3B,MAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ,CACT,OAAoBC,gBAAoB,MAAO,OAAO,OAAO,CAC3D,MAAO,6BACP,KAAM,OACN,QAAS,YACT,YAAa,IACb,OAAQ,eACR,cAAe,OACf,YAAa,OACb,IAAKD,EACL,kBAAmBF,CACvB,EAAKC,CAAK,EAAGF,EAAqBI,EAAAA,cAAoB,QAAS,CAC3D,GAAIH,CACR,EAAKD,CAAK,EAAI,KAAmBI,EAAAA,cAAoB,OAAQ,CACzD,cAAe,QACf,eAAgB,QAChB,EAAG,4EACP,CAAG,CAAC,CACJ,CACK,MAACC,EAA2BC,EAAAA,WAAiBP,CAAmB","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+ import{j as x}from"./query-ATBhtd3K.js";import{r as e}from"./vendor-EnoIVk-c.js";import{G as S,H as p,I as C}from"./en-IUV4ZXKH-BjYNERUx.js";const l=e.createContext(void 0);function h({backendUrl:c,children:f}){const[t,s]=e.useState(null),[n,o]=e.useState(!0);e.useEffect(()=>{o(!0),s(null),new S({baseUrl:C(c),eventBus:new p}).getMe().then(i=>{s({token:i.token,user:i})}).catch(()=>{s(null)}).finally(()=>{o(!1)})},[]);const r=e.useCallback(a=>{s(a)},[]),u=e.useCallback(()=>{s(null)},[]),m=e.useMemo(()=>({session:t,isLoading:n,setSession:r,clearSession:u}),[t,n,r,u]);return x.jsx(l.Provider,{value:m,children:f})}const d={session:null,isLoading:!1,setSession:()=>{},clearSession:()=>{}};function k(){return e.useContext(l)??d}export{h as A,k as u};
2
+ //# sourceMappingURL=AuthContext-CYne_gJM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthContext-CYne_gJM.js","sources":["../../src/contexts/AuthContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useEffect, useCallback, useMemo } from 'react';\nimport { SemiontApiClient } from '@semiont/api-client';\nimport type { components } from '@semiont/core';\nimport { baseUrl, EventBus } from '@semiont/core';\n\ntype UserInfo = components['schemas']['UserResponse'];\n\nexport interface AuthSession {\n token: string;\n user: UserInfo;\n}\n\ninterface AuthContextValue {\n session: AuthSession | null;\n isLoading: boolean;\n setSession: (session: AuthSession) => void;\n clearSession: () => void;\n}\n\nconst AuthContext = createContext<AuthContextValue | undefined>(undefined);\n\nexport function AuthProvider({ backendUrl: backendUrlProp, children }: { backendUrl: string; children: React.ReactNode }) {\n const [session, setSessionState] = useState<AuthSession | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n setIsLoading(true);\n setSessionState(null);\n const client = new SemiontApiClient({ baseUrl: baseUrl(backendUrlProp), eventBus: new EventBus() });\n client.getMe()\n .then((data) => {\n setSessionState({ token: data.token, user: data });\n })\n .catch(() => {\n setSessionState(null);\n })\n .finally(() => {\n setIsLoading(false);\n });\n }, []);\n\n const setSession = useCallback((s: AuthSession) => {\n setSessionState(s);\n }, []);\n\n const clearSession = useCallback(() => {\n setSessionState(null);\n }, []);\n\n const value = useMemo(\n () => ({ session, isLoading, setSession, clearSession }),\n [session, isLoading, setSession, clearSession]\n );\n\n return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;\n}\n\nconst NO_AUTH: AuthContextValue = {\n session: null,\n isLoading: false,\n setSession: () => {},\n clearSession: () => {},\n};\n\nexport function useAuthContext(): AuthContextValue {\n return useContext(AuthContext) ?? NO_AUTH;\n}\n"],"names":["AuthContext","createContext","AuthProvider","backendUrlProp","children","session","setSessionState","useState","isLoading","setIsLoading","useEffect","SemiontApiClient","baseUrl","EventBus","data","setSession","useCallback","s","clearSession","value","useMemo","jsx","NO_AUTH","useAuthContext","useContext"],"mappings":"6IAmBA,MAAMA,EAAcC,EAAAA,cAA4C,MAAS,EAElE,SAASC,EAAa,CAAE,WAAYC,EAAgB,SAAAC,GAA+D,CACxH,KAAM,CAACC,EAASC,CAAe,EAAIC,EAAAA,SAA6B,IAAI,EAC9D,CAACC,EAAWC,CAAY,EAAIF,EAAAA,SAAS,EAAI,EAE/CG,EAAAA,UAAU,IAAM,CACdD,EAAa,EAAI,EACjBH,EAAgB,IAAI,EACL,IAAIK,EAAiB,CAAE,QAASC,EAAQT,CAAc,EAAG,SAAU,IAAIU,EAAY,EAC3F,MAAA,EACJ,KAAMC,GAAS,CACdR,EAAgB,CAAE,MAAOQ,EAAK,MAAO,KAAMA,EAAM,CACnD,CAAC,EACA,MAAM,IAAM,CACXR,EAAgB,IAAI,CACtB,CAAC,EACA,QAAQ,IAAM,CACbG,EAAa,EAAK,CACpB,CAAC,CACL,EAAG,CAAA,CAAE,EAEL,MAAMM,EAAaC,cAAaC,GAAmB,CACjDX,EAAgBW,CAAC,CACnB,EAAG,CAAA,CAAE,EAECC,EAAeF,EAAAA,YAAY,IAAM,CACrCV,EAAgB,IAAI,CACtB,EAAG,CAAA,CAAE,EAECa,EAAQC,EAAAA,QACZ,KAAO,CAAE,QAAAf,EAAS,UAAAG,EAAW,WAAAO,EAAY,aAAAG,CAAA,GACzC,CAACb,EAASG,EAAWO,EAAYG,CAAY,CAAA,EAG/C,OAAOG,EAAAA,IAACrB,EAAY,SAAZ,CAAqB,MAAAmB,EAAe,SAAAf,CAAA,CAAS,CACvD,CAEA,MAAMkB,EAA4B,CAChC,QAAS,KACT,UAAW,GACX,WAAY,IAAM,CAAC,EACnB,aAAc,IAAM,CAAC,CACvB,EAEO,SAASC,GAAmC,CACjD,OAAOC,EAAAA,WAAWxB,CAAW,GAAKsB,CACpC"}
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./vendor-EnoIVk-c.js";function a({title:r,titleId:t,...n},o){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const l=e.forwardRef(a);function s({title:r,titleId:t,...n},o){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const c=e.forwardRef(s);export{l as F,c as a};
2
+ //# sourceMappingURL=ChevronLeftIcon-CMXd_XZQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChevronLeftIcon-CMXd_XZQ.js","sources":["../../../../node_modules/@heroicons/react/24/outline/esm/Bars3Icon.js","../../../../node_modules/@heroicons/react/24/outline/esm/ChevronLeftIcon.js"],"sourcesContent":["import * as React from \"react\";\nfunction Bars3Icon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(Bars3Icon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ChevronLeftIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M15.75 19.5 8.25 12l7.5-7.5\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ChevronLeftIcon);\nexport default ForwardRef;"],"names":["Bars3Icon","title","titleId","props","svgRef","React.createElement","ForwardRef","React.forwardRef","ChevronLeftIcon"],"mappings":"yCACA,SAASA,EAAU,CACjB,MAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ,CACT,OAAoBC,gBAAoB,MAAO,OAAO,OAAO,CAC3D,MAAO,6BACP,KAAM,OACN,QAAS,YACT,YAAa,IACb,OAAQ,eACR,cAAe,OACf,YAAa,OACb,IAAKD,EACL,kBAAmBF,CACvB,EAAKC,CAAK,EAAGF,EAAqBI,EAAAA,cAAoB,QAAS,CAC3D,GAAIH,CACR,EAAKD,CAAK,EAAI,KAAmBI,EAAAA,cAAoB,OAAQ,CACzD,cAAe,QACf,eAAgB,QAChB,EAAG,8CACP,CAAG,CAAC,CACJ,CACK,MAACC,EAA2BC,EAAAA,WAAiBP,CAAS,ECvB3D,SAASQ,EAAgB,CACvB,MAAAP,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ,CACT,OAAoBC,gBAAoB,MAAO,OAAO,OAAO,CAC3D,MAAO,6BACP,KAAM,OACN,QAAS,YACT,YAAa,IACb,OAAQ,eACR,cAAe,OACf,YAAa,OACb,IAAKD,EACL,kBAAmBF,CACvB,EAAKC,CAAK,EAAGF,EAAqBI,EAAAA,cAAoB,QAAS,CAC3D,GAAIH,CACR,EAAKD,CAAK,EAAI,KAAmBI,EAAAA,cAAoB,OAAQ,CACzD,cAAe,QACf,eAAgB,QAChB,EAAG,6BACP,CAAG,CAAC,CACJ,CACK,MAACC,EAA2BC,EAAAA,WAAiBC,CAAe","x_google_ignoreList":[0,1]}
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./vendor-EnoIVk-c.js";function a({title:r,titleId:o,...t},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":o},t),r?e.createElement("title",{id:o},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"}))}const s=e.forwardRef(a);export{s as F};
2
+ //# sourceMappingURL=CommandLineIcon-BBerq9Nd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandLineIcon-BBerq9Nd.js","sources":["../../../../node_modules/@heroicons/react/24/outline/esm/CommandLineIcon.js"],"sourcesContent":["import * as React from \"react\";\nfunction CommandLineIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CommandLineIcon);\nexport default ForwardRef;"],"names":["CommandLineIcon","title","titleId","props","svgRef","React.createElement","ForwardRef","React.forwardRef"],"mappings":"yCACA,SAASA,EAAgB,CACvB,MAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ,CACT,OAAoBC,gBAAoB,MAAO,OAAO,OAAO,CAC3D,MAAO,6BACP,KAAM,OACN,QAAS,YACT,YAAa,IACb,OAAQ,eACR,cAAe,OACf,YAAa,OACb,IAAKD,EACL,kBAAmBF,CACvB,EAAKC,CAAK,EAAGF,EAAqBI,EAAAA,cAAoB,QAAS,CAC3D,GAAIH,CACR,EAAKD,CAAK,EAAI,KAAmBI,EAAAA,cAAoB,OAAQ,CACzD,cAAe,QACf,eAAgB,QAChB,EAAG,uJACP,CAAG,CAAC,CACJ,CACK,MAACC,EAA2BC,EAAAA,WAAiBP,CAAe","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+ import{j as e}from"./query-ATBhtd3K.js";import{r}from"./vendor-EnoIVk-c.js";import{g as v,C as N,e as k,s as C,d as E}from"./privacy-QEJYcmMw.js";import{u as L}from"./i18n-BYxb14hm.js";function M({title:a,titleId:n,...l},s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":n},l),a?r.createElement("title",{id:n},a):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const R=r.forwardRef(M);function D({title:a,titleId:n,...l},s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":n},l),a?r.createElement("title",{id:n},a):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12a7.5 7.5 0 0 0 15 0m-15 0a7.5 7.5 0 1 1 15 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077 1.41-.513m14.095-5.13 1.41-.513M5.106 17.785l1.15-.964m11.49-9.642 1.149-.964M7.501 19.795l.75-1.3m7.5-12.99.75-1.3m-6.063 16.658.26-1.477m2.605-14.772.26-1.477m0 17.726-.26-1.477M10.698 4.614l-.26-1.477M16.5 19.794l-.75-1.299M7.5 4.205 12 12m6.894 5.785-1.149-.964M6.256 7.178l-1.15-.964m15.352 8.864-1.41-.513M4.954 9.435l-1.41-.514M12.002 12l-3.75 6.495"}))}const S=r.forwardRef(D);function A({title:a,titleId:n,...l},s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":n},l),a?r.createElement("title",{id:n},a):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const O=r.forwardRef(A);function $({title:a,titleId:n,...l},s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":n},l),a?r.createElement("title",{id:n},a):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const g=r.forwardRef($);function F({title:a,titleId:n,...l},s){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":n},l),a?r.createElement("title",{id:n},a):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const T=r.forwardRef(F);function q({isOpen:a,onClose:n}){const{t:l}=L(),s=(t,i)=>l(`CookiePreferences.${t}`,i),[o,m]=r.useState(null),[d,u]=r.useState(!1),[b,x]=r.useState(!1),f=r.useRef(n);r.useEffect(()=>{f.current=n}),r.useEffect(()=>{if(a){const t=v();m(t||{necessary:!0,analytics:!1,marketing:!1,preferences:!1,timestamp:new Date().toISOString(),version:"1.0"})}},[a]),r.useEffect(()=>{if(!a)return;const t=i=>{i.key==="Escape"&&f.current()};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[a]);const p=async()=>{o&&(u(!0),C(o),u(!1),n())},w=t=>{t==="necessary"||!o||m(i=>i?{...i,[t]:!i[t]}:null)},j=()=>{const t=k(),i=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),h=URL.createObjectURL(i),c=document.createElement("a");c.href=h,c.download=`semiont-user-data-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(h)},y=()=>{E()};return!a||!o?null:e.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[e.jsxs("div",{className:"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[e.jsx("div",{className:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75",onClick:n}),e.jsxs("div",{className:"inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full sm:p-6 relative",children:[e.jsx("button",{onClick:n,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded-lg p-1","aria-label":"Close",children:e.jsx(T,{className:"h-6 w-6"})}),e.jsxs("div",{className:"sm:flex sm:items-start",children:[e.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10",children:e.jsx(S,{className:"h-6 w-6 text-blue-600"})}),e.jsxs("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left flex-1 pr-8",children:[e.jsx("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:s("title")}),e.jsx("div",{className:"mt-2",children:e.jsx("p",{className:"text-sm text-gray-500",children:s("description")})})]})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(O,{className:"h-5 w-5 text-green-500 mr-2"}),e.jsx("span",{className:"text-sm font-medium text-gray-900",children:s("currentSettings")})]}),e.jsxs("div",{className:"mt-2 text-xs text-gray-600",children:[e.jsx("p",{children:s("lastUpdated",{date:new Date(o.timestamp).toLocaleDateString()})}),e.jsx("p",{children:s("version",{version:o.version})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-base font-medium text-gray-900",children:s("cookieCategories")}),N.map(t=>e.jsx("div",{className:"border border-gray-200 rounded-lg p-4",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{id:`pref-${t.id}`,type:"checkbox",checked:o[t.id]||!1,onChange:()=>w(t.id),disabled:t.required||d,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded-sm disabled:opacity-50"}),e.jsxs("label",{htmlFor:`pref-${t.id}`,className:"ml-3 text-sm font-medium text-gray-900 cursor-pointer",children:[t.name,t.required&&e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:s("required")})]})]}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:t.description}),e.jsxs("details",{className:"mt-2",children:[e.jsx("summary",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800",children:s("viewCookies",{count:t.cookies.length})}),e.jsx("div",{className:"mt-1 text-xs text-gray-500 bg-gray-50 rounded-sm p-2",children:e.jsx("ul",{className:"list-disc list-inside space-y-1",children:t.cookies.map(i=>e.jsx("li",{children:i},i))})})]})]})})},t.id))]}),e.jsxs("div",{className:"border-t border-gray-200 pt-6",children:[e.jsx("h4",{className:"text-base font-medium text-gray-900 mb-4",children:s("dataManagement")}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("button",{onClick:j,className:"flex items-center justify-center px-4 py-2 border border-gray-300 rounded-md shadow-xs text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[e.jsx(R,{className:"h-4 w-4 mr-2"}),s("exportMyData")]}),e.jsxs("button",{onClick:()=>x(!0),className:"flex items-center justify-center px-4 py-2 border border-red-300 rounded-md shadow-xs text-sm font-medium text-red-700 bg-white hover:bg-red-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-red-500",children:[e.jsx(g,{className:"h-4 w-4 mr-2"}),s("deleteAllData")]})]}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:s("dataManagementDescription")})]})]})}),e.jsxs("div",{className:"mt-6 flex flex-wrap gap-2 justify-center",children:[e.jsx("button",{type:"button",onClick:()=>{m(t=>t?{...t,necessary:!0,analytics:!1,marketing:!1,preferences:!1}:null)},disabled:d,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 transition-colors",children:s("rejectAll")}),e.jsx("button",{type:"button",onClick:()=>{m(t=>t?{...t,necessary:!0,analytics:!0,marketing:!0,preferences:!0}:null)},disabled:d,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 transition-colors",children:s("acceptAll")})]}),e.jsxs("div",{className:"mt-6 sm:flex sm:flex-row-reverse",children:[e.jsx("button",{type:"button",onClick:p,disabled:d,className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-xs px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50",children:s(d?"saving":"saveChanges")}),e.jsx("button",{type:"button",onClick:n,className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-xs px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:w-auto sm:text-sm",children:s("cancel")})]})]})]}),b&&e.jsx("div",{className:"fixed inset-0 z-60 overflow-y-auto",children:e.jsxs("div",{className:"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[e.jsx("div",{className:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75"}),e.jsxs("div",{className:"inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6",children:[e.jsxs("div",{className:"sm:flex sm:items-start",children:[e.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:e.jsx(g,{className:"h-6 w-6 text-red-600"})}),e.jsxs("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[e.jsx("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:s("deleteConfirmTitle")}),e.jsx("div",{className:"mt-2",children:e.jsx("p",{className:"text-sm text-gray-500",children:s("deleteConfirmDescription")})})]})]}),e.jsxs("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[e.jsx("button",{type:"button",onClick:y,className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-xs px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm",children:s("deleteAllData")}),e.jsx("button",{type:"button",onClick:()=>x(!1),className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-xs px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:w-auto sm:text-sm",children:s("cancel")})]})]})]})})]})}export{q as C,O as F,T as a};
2
+ //# sourceMappingURL=CookiePreferences-DxD0u90z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CookiePreferences-DxD0u90z.js","sources":["../../../../node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js","../../../../node_modules/@heroicons/react/24/outline/esm/CogIcon.js","../../../../node_modules/@heroicons/react/24/outline/esm/ShieldCheckIcon.js","../../../../node_modules/@heroicons/react/24/outline/esm/TrashIcon.js","../../../../node_modules/@heroicons/react/24/outline/esm/XMarkIcon.js","../../src/components/CookiePreferences.tsx"],"sourcesContent":["import * as React from \"react\";\nfunction ArrowDownTrayIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ArrowDownTrayIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction CogIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M4.5 12a7.5 7.5 0 0 0 15 0m-15 0a7.5 7.5 0 1 1 15 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077 1.41-.513m14.095-5.13 1.41-.513M5.106 17.785l1.15-.964m11.49-9.642 1.149-.964M7.501 19.795l.75-1.3m7.5-12.99.75-1.3m-6.063 16.658.26-1.477m2.605-14.772.26-1.477m0 17.726-.26-1.477M10.698 4.614l-.26-1.477M16.5 19.794l-.75-1.299M7.5 4.205 12 12m6.894 5.785-1.149-.964M6.256 7.178l-1.15-.964m15.352 8.864-1.41-.513M4.954 9.435l-1.41-.514M12.002 12l-3.75 6.495\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CogIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ShieldCheckIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ShieldCheckIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction TrashIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(TrashIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction XMarkIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M6 18 18 6M6 6l12 12\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(XMarkIcon);\nexport default ForwardRef;","\"use client\";\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n getCookieConsent,\n setCookieConsent,\n COOKIE_CATEGORIES,\n CookieConsent,\n exportUserData,\n deleteAllUserData,\n type CookieCategory\n} from '@/lib/cookies';\nimport {\n CogIcon,\n TrashIcon,\n ArrowDownTrayIcon,\n ShieldCheckIcon,\n XMarkIcon\n} from '@heroicons/react/24/outline';\n\ninterface CookiePreferencesProps {\n isOpen: boolean;\n onClose: () => void;\n}\n\nexport function CookiePreferences({ isOpen, onClose }: CookiePreferencesProps) {\n const { t: _t } = useTranslation();\n const t = (k: string, p?: Record<string, unknown>) => _t(`CookiePreferences.${k}`, p as any) as string;\n const [consent, setConsent] = useState<CookieConsent | null>(null);\n const [isLoading, setIsLoading] = useState(false);\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n // Store callback in ref to avoid including in dependency arrays\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n });\n\n useEffect(() => {\n if (isOpen) {\n const currentConsent = getCookieConsent();\n setConsent(currentConsent || {\n necessary: true,\n analytics: false,\n marketing: false,\n preferences: false,\n timestamp: new Date().toISOString(),\n version: '1.0'\n });\n }\n }, [isOpen]);\n\n // Handle ESC key to close modal\n useEffect(() => {\n if (!isOpen) {\n return undefined;\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onCloseRef.current();\n }\n };\n\n document.addEventListener('keydown', handleEsc);\n return () => {\n document.removeEventListener('keydown', handleEsc);\n };\n }, [isOpen]);\n\n const handleSave = async () => {\n if (!consent) return;\n \n setIsLoading(true);\n setCookieConsent(consent);\n setIsLoading(false);\n onClose();\n };\n\n const handleCategoryToggle = (categoryId: keyof Omit<CookieConsent, 'timestamp' | 'version'>) => {\n if (categoryId === 'necessary' || !consent) return;\n \n setConsent(prev => prev ? {\n ...prev,\n [categoryId]: !prev[categoryId]\n } : null);\n };\n\n const handleExportData = () => {\n const data = exportUserData();\n const blob = new Blob([JSON.stringify(data, null, 2)], { \n type: 'application/json' \n });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = `semiont-user-data-${new Date().toISOString().split('T')[0]}.json`;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(url);\n };\n\n const handleDeleteAllData = () => {\n deleteAllUserData();\n };\n\n if (!isOpen || !consent) return null;\n\n return (\n <div className=\"fixed inset-0 z-50 overflow-y-auto\">\n <div className=\"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0\">\n {/* Background overlay */}\n <div \n className=\"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75\"\n onClick={onClose}\n />\n\n {/* Modal panel */}\n <div className=\"inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full sm:p-6 relative\">\n {/* Close button in upper right */}\n <button\n onClick={onClose}\n className=\"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 rounded-lg p-1\"\n aria-label=\"Close\"\n >\n <XMarkIcon className=\"h-6 w-6\" />\n </button>\n\n <div className=\"sm:flex sm:items-start\">\n <div className=\"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10\">\n <CogIcon className=\"h-6 w-6 text-blue-600\" />\n </div>\n <div className=\"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left flex-1 pr-8\">\n <h3 className=\"text-lg leading-6 font-medium text-gray-900\">\n {t('title')}\n </h3>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t('description')}\n </p>\n </div>\n </div>\n </div>\n\n <div className=\"mt-6\">\n <div className=\"space-y-6\">\n {/* Current consent info */}\n <div className=\"bg-gray-50 rounded-lg p-4\">\n <div className=\"flex items-center\">\n <ShieldCheckIcon className=\"h-5 w-5 text-green-500 mr-2\" />\n <span className=\"text-sm font-medium text-gray-900\">\n {t('currentSettings')}\n </span>\n </div>\n <div className=\"mt-2 text-xs text-gray-600\">\n <p>{t('lastUpdated', { date: new Date(consent.timestamp).toLocaleDateString() })}</p>\n <p>{t('version', { version: consent.version })}</p>\n </div>\n </div>\n\n {/* Cookie categories */}\n <div className=\"space-y-4\">\n <h4 className=\"text-base font-medium text-gray-900\">\n {t('cookieCategories')}\n </h4>\n \n {COOKIE_CATEGORIES.map((category: CookieCategory) => (\n <div key={category.id} className=\"border border-gray-200 rounded-lg p-4\">\n <div className=\"flex items-start justify-between\">\n <div className=\"flex-1\">\n <div className=\"flex items-center\">\n <input\n id={`pref-${category.id}`}\n type=\"checkbox\"\n checked={consent[category.id] || false}\n onChange={() => handleCategoryToggle(category.id)}\n disabled={category.required || isLoading}\n className=\"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded-sm disabled:opacity-50\"\n />\n <label\n htmlFor={`pref-${category.id}`}\n className=\"ml-3 text-sm font-medium text-gray-900 cursor-pointer\"\n >\n {category.name}\n {category.required && (\n <span className=\"text-xs text-gray-500 ml-1\">{t('required')}</span>\n )}\n </label>\n </div>\n <p className=\"mt-1 text-sm text-gray-600\">\n {category.description}\n </p>\n <details className=\"mt-2\">\n <summary className=\"text-xs text-blue-600 cursor-pointer hover:text-blue-800\">\n {t('viewCookies', { count: category.cookies.length })}\n </summary>\n <div className=\"mt-1 text-xs text-gray-500 bg-gray-50 rounded-sm p-2\">\n <ul className=\"list-disc list-inside space-y-1\">\n {category.cookies.map(cookie => (\n <li key={cookie}>{cookie}</li>\n ))}\n </ul>\n </div>\n </details>\n </div>\n </div>\n </div>\n ))}\n </div>\n\n {/* Data management section */}\n <div className=\"border-t border-gray-200 pt-6\">\n <h4 className=\"text-base font-medium text-gray-900 mb-4\">\n {t('dataManagement')}\n </h4>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <button\n onClick={handleExportData}\n className=\"flex items-center justify-center px-4 py-2 border border-gray-300 rounded-md shadow-xs text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500\"\n >\n <ArrowDownTrayIcon className=\"h-4 w-4 mr-2\" />\n {t('exportMyData')}\n </button>\n\n <button\n onClick={() => setShowDeleteConfirm(true)}\n className=\"flex items-center justify-center px-4 py-2 border border-red-300 rounded-md shadow-xs text-sm font-medium text-red-700 bg-white hover:bg-red-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-red-500\"\n >\n <TrashIcon className=\"h-4 w-4 mr-2\" />\n {t('deleteAllData')}\n </button>\n </div>\n\n <p className=\"mt-2 text-xs text-gray-500\">\n {t('dataManagementDescription')}\n </p>\n </div>\n </div>\n </div>\n\n {/* Quick Actions */}\n <div className=\"mt-6 flex flex-wrap gap-2 justify-center\">\n <button\n type=\"button\"\n onClick={() => {\n setConsent(prev => prev ? {\n ...prev,\n necessary: true,\n analytics: false,\n marketing: false,\n preferences: false\n } : null);\n }}\n disabled={isLoading}\n className=\"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 transition-colors\"\n >\n {t('rejectAll')}\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setConsent(prev => prev ? {\n ...prev,\n necessary: true,\n analytics: true,\n marketing: true,\n preferences: true\n } : null);\n }}\n disabled={isLoading}\n className=\"px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 transition-colors\"\n >\n {t('acceptAll')}\n </button>\n </div>\n\n {/* Action buttons */}\n <div className=\"mt-6 sm:flex sm:flex-row-reverse\">\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={isLoading}\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-xs px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm disabled:opacity-50\"\n >\n {isLoading ? t('saving') : t('saveChanges')}\n </button>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-xs px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:w-auto sm:text-sm\"\n >\n {t('cancel')}\n </button>\n </div>\n </div>\n </div>\n\n {/* Delete confirmation modal */}\n {showDeleteConfirm && (\n <div className=\"fixed inset-0 z-60 overflow-y-auto\">\n <div className=\"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0\">\n <div className=\"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75\" />\n <div className=\"inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full sm:p-6\">\n <div className=\"sm:flex sm:items-start\">\n <div className=\"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10\">\n <TrashIcon className=\"h-6 w-6 text-red-600\" />\n </div>\n <div className=\"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left\">\n <h3 className=\"text-lg leading-6 font-medium text-gray-900\">\n {t('deleteConfirmTitle')}\n </h3>\n <div className=\"mt-2\">\n <p className=\"text-sm text-gray-500\">\n {t('deleteConfirmDescription')}\n </p>\n </div>\n </div>\n </div>\n <div className=\"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse\">\n <button\n type=\"button\"\n onClick={handleDeleteAllData}\n className=\"w-full inline-flex justify-center rounded-md border border-transparent shadow-xs px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm\"\n >\n {t('deleteAllData')}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowDeleteConfirm(false)}\n className=\"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-xs px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:w-auto sm:text-sm\"\n >\n {t('cancel')}\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default CookiePreferences;"],"names":["ArrowDownTrayIcon","title","titleId","props","svgRef","React.createElement","ForwardRef","React.forwardRef","CogIcon","ShieldCheckIcon","TrashIcon","XMarkIcon","CookiePreferences","isOpen","onClose","_t","useTranslation","t","k","p","consent","setConsent","useState","isLoading","setIsLoading","showDeleteConfirm","setShowDeleteConfirm","onCloseRef","useRef","useEffect","currentConsent","getCookieConsent","handleEsc","event","handleSave","setCookieConsent","handleCategoryToggle","categoryId","prev","handleExportData","data","exportUserData","blob","url","a","handleDeleteAllData","deleteAllUserData","jsxs","jsx","COOKIE_CATEGORIES","category","cookie"],"mappings":"yLACA,SAASA,EAAkB,CACzB,MAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ,CACT,OAAoBC,gBAAoB,MAAO,OAAO,OAAO,CAC3D,MAAO,6BACP,KAAM,OACN,QAAS,YACT,YAAa,IACb,OAAQ,eACR,cAAe,OACf,YAAa,OACb,IAAKD,EACL,kBAAmBF,CACvB,EAAKC,CAAK,EAAGF,EAAqBI,EAAAA,cAAoB,QAAS,CA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1
+ import{j as S}from"./query-ATBhtd3K.js";import{r as t}from"./vendor-EnoIVk-c.js";const K="semiont.knowledgeBases",i="semiont.activeKnowledgeBaseId";function f(){try{const o=localStorage.getItem(K);return o?JSON.parse(o):[]}catch{return[]}}function C(o){localStorage.setItem(K,JSON.stringify(o))}const B=t.createContext(void 0);function p({children:o}){const[n,d]=t.useState(()=>f()),[a,c]=t.useState(()=>{var l;const e=localStorage.getItem(i),s=f();return e&&s.some(r=>r.id===e)?e:((l=s[0])==null?void 0:l.id)??null});t.useEffect(()=>{C(n)},[n]),t.useEffect(()=>{a?localStorage.setItem(i,a):localStorage.removeItem(i)},[a]);const u=t.useCallback(e=>{d(s=>[...s,e]),c(e.id)},[]),g=t.useCallback(e=>{d(s=>s.filter(r=>r.id!==e)),c(s=>{var r;return s!==e?s:((r=n.filter(x=>x.id!==e)[0])==null?void 0:r.id)??null})},[n]),w=t.useCallback(e=>{c(e)},[]),m=t.useMemo(()=>n.find(e=>e.id===a)??null,[n,a]),v=t.useMemo(()=>({knowledgeBases:n,activeKnowledgeBaseId:a,activeKnowledgeBase:m,addKnowledgeBase:u,removeKnowledgeBase:g,setActiveKnowledgeBase:w}),[n,a,m,u,g,w]);return S.jsx(B.Provider,{value:v,children:o})}function k(){const o=t.useContext(B);if(!o)throw new Error("useKnowledgeBaseContext must be used within KnowledgeBaseProvider");return o}export{p as K,k as u};
2
+ //# sourceMappingURL=KnowledgeBaseContext-CgnF8K-_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KnowledgeBaseContext-CgnF8K-_.js","sources":["../../src/contexts/KnowledgeBaseContext.tsx"],"sourcesContent":["import React, { createContext, useContext, useState, useCallback, useMemo, useEffect } from 'react';\n\nexport interface KnowledgeBase {\n id: string;\n label: string;\n backendUrl: string;\n}\n\ninterface KnowledgeBaseContextValue {\n knowledgeBases: KnowledgeBase[];\n activeKnowledgeBaseId: string | null;\n activeKnowledgeBase: KnowledgeBase | null;\n addKnowledgeBase: (kb: KnowledgeBase) => void;\n removeKnowledgeBase: (id: string) => void;\n setActiveKnowledgeBase: (id: string) => void;\n}\n\nconst STORAGE_KEY = 'semiont.knowledgeBases';\nconst ACTIVE_KEY = 'semiont.activeKnowledgeBaseId';\n\nfunction loadKnowledgeBases(): KnowledgeBase[] {\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n return raw ? (JSON.parse(raw) as KnowledgeBase[]) : [];\n } catch {\n return [];\n }\n}\n\nfunction saveKnowledgeBases(knowledgeBases: KnowledgeBase[]): void {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(knowledgeBases));\n}\n\nconst KnowledgeBaseContext = createContext<KnowledgeBaseContextValue | undefined>(undefined);\n\nexport function KnowledgeBaseProvider({ children }: { children: React.ReactNode }) {\n const [knowledgeBases, setKnowledgeBases] = useState<KnowledgeBase[]>(() => loadKnowledgeBases());\n const [activeKnowledgeBaseId, setActiveKnowledgeBaseId] = useState<string | null>(() => {\n const saved = localStorage.getItem(ACTIVE_KEY);\n const loaded = loadKnowledgeBases();\n // Use saved id only if it still exists in the list\n if (saved && loaded.some(kb => kb.id === saved)) return saved;\n return loaded[0]?.id ?? null;\n });\n\n useEffect(() => {\n saveKnowledgeBases(knowledgeBases);\n }, [knowledgeBases]);\n\n useEffect(() => {\n if (activeKnowledgeBaseId) {\n localStorage.setItem(ACTIVE_KEY, activeKnowledgeBaseId);\n } else {\n localStorage.removeItem(ACTIVE_KEY);\n }\n }, [activeKnowledgeBaseId]);\n\n const addKnowledgeBase = useCallback((kb: KnowledgeBase) => {\n setKnowledgeBases(prev => [...prev, kb]);\n setActiveKnowledgeBaseId(kb.id);\n }, []);\n\n const removeKnowledgeBase = useCallback((id: string) => {\n setKnowledgeBases(prev => {\n const next = prev.filter(kb => kb.id !== id);\n return next;\n });\n setActiveKnowledgeBaseId(prev => {\n if (prev !== id) return prev;\n const remaining = knowledgeBases.filter(kb => kb.id !== id);\n return remaining[0]?.id ?? null;\n });\n }, [knowledgeBases]);\n\n const setActiveKnowledgeBase = useCallback((id: string) => {\n setActiveKnowledgeBaseId(id);\n }, []);\n\n const activeKnowledgeBase = useMemo(\n () => knowledgeBases.find(kb => kb.id === activeKnowledgeBaseId) ?? null,\n [knowledgeBases, activeKnowledgeBaseId]\n );\n\n const value = useMemo(\n () => ({ knowledgeBases, activeKnowledgeBaseId, activeKnowledgeBase, addKnowledgeBase, removeKnowledgeBase, setActiveKnowledgeBase }),\n [knowledgeBases, activeKnowledgeBaseId, activeKnowledgeBase, addKnowledgeBase, removeKnowledgeBase, setActiveKnowledgeBase]\n );\n\n return <KnowledgeBaseContext.Provider value={value}>{children}</KnowledgeBaseContext.Provider>;\n}\n\nexport function useKnowledgeBaseContext(): KnowledgeBaseContextValue {\n const ctx = useContext(KnowledgeBaseContext);\n if (!ctx) throw new Error('useKnowledgeBaseContext must be used within KnowledgeBaseProvider');\n return ctx;\n}\n"],"names":["STORAGE_KEY","ACTIVE_KEY","loadKnowledgeBases","raw","saveKnowledgeBases","knowledgeBases","KnowledgeBaseContext","createContext","KnowledgeBaseProvider","children","setKnowledgeBases","useState","activeKnowledgeBaseId","setActiveKnowledgeBaseId","saved","loaded","kb","_a","useEffect","addKnowledgeBase","useCallback","prev","removeKnowledgeBase","id","setActiveKnowledgeBase","activeKnowledgeBase","useMemo","value","jsx","useKnowledgeBaseContext","ctx","useContext"],"mappings":"iFAiBA,MAAMA,EAAc,yBACdC,EAAa,gCAEnB,SAASC,GAAsC,CAC7C,GAAI,CACF,MAAMC,EAAM,aAAa,QAAQH,CAAW,EAC5C,OAAOG,EAAO,KAAK,MAAMA,CAAG,EAAwB,CAAA,CACtD,MAAQ,CACN,MAAO,CAAA,CACT,CACF,CAEA,SAASC,EAAmBC,EAAuC,CACjE,aAAa,QAAQL,EAAa,KAAK,UAAUK,CAAc,CAAC,CAClE,CAEA,MAAMC,EAAuBC,EAAAA,cAAqD,MAAS,EAEpF,SAASC,EAAsB,CAAE,SAAAC,GAA2C,CACjF,KAAM,CAACJ,EAAgBK,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AAAE,IAC5G,CAACnB,EAAgBO,EAAuBa,EAAqBN,EAAkBG,EAAqBE,CAAsB,CAAA,EAG5H,OAAOI,EAAAA,IAACtB,EAAqB,SAArB,CAA8B,MAAAqB,EAAe,SAAAlB,CAAA,CAAS,CAChE,CAEO,SAASoB,GAAqD,CACnE,MAAMC,EAAMC,EAAAA,WAAWzB,CAAoB,EAC3C,GAAI,CAACwB,EAAK,MAAM,IAAI,MAAM,mEAAmE,EAC7F,OAAOA,CACT"}
@@ -0,0 +1,2 @@
1
+ import{J as lt,K as dt}from"./en-IUV4ZXKH-BjYNERUx.js";import{r as l}from"./vendor-EnoIVk-c.js";import{j as u}from"./query-ATBhtd3K.js";import"./index-D4SjcYxX.js";import"./i18n-BYxb14hm.js";function ut(t,d,s,o,a=1){const w=Math.min(t.startX,t.endX),j=Math.min(t.startY,t.endY),S=Math.max(t.startX,t.endX),b=Math.max(t.startY,t.endY),F=w/a,D=(S-w)/a,E=o-b/a,h=(b-j)/a;return{page:d,x:Math.round(F),y:Math.round(E),width:Math.round(D),height:Math.round(h)}}function J(t,d,s=1){const o=t.x*s,a=t.width*s,w=(d-t.y-t.height)*s,j=t.height*s;return{x:o,y:w,width:a,height:j}}function ht(t){return`page=${t.page}&viewrect=${t.x},${t.y},${t.width},${t.height}`}function V(t){try{const d=t.match(/page=(\d+)/);if(!d)return null;const s=parseInt(d[1],10),o=t.match(/viewrect=([\d.]+),([\d.]+),([\d.]+),([\d.]+)/);return o?{page:s,x:parseFloat(o[1]),y:parseFloat(o[2]),width:parseFloat(o[3]),height:parseFloat(o[4])}:null}catch{return null}}function ft(t){const d=t.match(/page=(\d+)/);return d?parseInt(d[1],10):null}async function gt(){return typeof window<"u"&&window.pdfjsLib?window.pdfjsLib:new Promise((t,d)=>{const s=document.createElement("script");s.src="/pdfjs/pdf.min.mjs",s.type="module",s.onload=()=>{const o=window.pdfjsLib;if(!o){d(new Error("PDF.js loaded but pdfjsLib not available"));return}o.GlobalWorkerOptions.workerSrc="/pdfjs/pdf.worker.min.mjs",t(o)},s.onerror=()=>{d(new Error("Failed to load PDF.js from /pdfjs/pdf.min.mjs"))},document.head.appendChild(s)})}async function mt(t){return(await gt()).getDocument({url:t}).promise}async function pt(t,d=1){const s=t.getViewport({scale:d}),o=document.createElement("canvas"),a=o.getContext("2d");if(!a)throw new Error("Failed to get 2D context");return o.width=s.width,o.height=s.height,await t.render({canvasContext:a,viewport:s}).promise,{dataUrl:o.toDataURL("image/png"),width:s.width,height:s.height}}function K(t){if(!t)return{stroke:"rgb(156, 163, 175)",fill:"rgba(156, 163, 175, 0.2)"};switch(t){case"highlighting":return{stroke:"rgb(250, 204, 21)",fill:"rgba(250, 204, 21, 0.3)"};case"linking":return{stroke:"rgb(59, 130, 246)",fill:"rgba(59, 130, 246, 0.2)"};case"assessing":return{stroke:"rgb(239, 68, 68)",fill:"rgba(239, 68, 68, 0.2)"};case"commenting":return{stroke:"rgb(255, 255, 255)",fill:"rgba(255, 255, 255, 0.2)"};default:return{stroke:"rgb(156, 163, 175)",fill:"rgba(156, 163, 175, 0.2)"}}}function kt({pdfUrl:t,existingAnnotations:d=[],drawingMode:s,selectedMotivation:o,eventBus:a,hoveredAnnotationId:w,selectedAnnotationId:j,hoverDelayMs:S=150}){const[b,F]=l.useState(null),[D,E]=l.useState(0),[h,W]=l.useState(1),[N,Q]=l.useState(null),[A,C]=l.useState(!0),[H,L]=l.useState(null),[f,Z]=l.useState(null),[m,U]=l.useState(null),[z]=l.useState(1.5),[M,v]=l.useState(!1),[r,y]=l.useState(null),B=l.useRef(null),g=l.useRef(null);l.useEffect(()=>{let e=!1;async function n(){try{C(!0),L(null);const c=await mt(t);if(e)return;F(c),E(c.numPages),C(!1)}catch(c){if(e)return;console.error("Error loading PDF:",c),L("Failed to load PDF"),C(!1)}}return n(),()=>{e=!0}},[t]),l.useEffect(()=>{if(!b)return;let e=!1;const n=b;async function c(){try{const i=await n.getPage(h);if(e)return;const p=i.getViewport({scale:1});Z({width:p.width,height:p.height});const{dataUrl:x}=await pt(i,z);if(e)return;Q(x)}catch(i){if(e)return;console.error("Error loading page:",i),L("Failed to load page")}}return c(),()=>{e=!0}},[b,h,z]),l.useEffect(()=>{const e=()=>{g.current&&U({width:g.current.clientWidth,height:g.current.clientHeight})};e();let n=null;try{n=new ResizeObserver(e),g.current&&n.observe(g.current)}catch{console.warn("ResizeObserver not supported, falling back to window resize listener"),window.addEventListener("resize",e)}return()=>{n?n.disconnect():window.removeEventListener("resize",e)}},[N]);const tt=l.useCallback(e=>{if(!s||!g.current)return;const n=g.current.getBoundingClientRect(),c=e.clientX-n.left,i=e.clientY-n.top;v(!0),y({startX:c,startY:i,endX:c,endY:i})},[s]),et=l.useCallback(e=>{if(!M||!r||!g.current)return;const n=g.current.getBoundingClientRect();y({...r,endX:e.clientX-n.left,endY:e.clientY-n.top})},[M,r]),nt=l.useCallback(()=>{if(!M||!r||!f||!m||!a){v(!1),y(null);return}if(Math.sqrt(Math.pow(r.endX-r.startX,2)+Math.pow(r.endY-r.startY,2))<10){if(d.length>0){const k=$.find(T=>{const Y=I(T.target);if(!Y)return!1;const _=V(Y.value);if(!_)return!1;const P=J(_,f.height,1),R=m.width/f.width,q=m.height/f.height,O=P.x*R,G=P.y*q,it=P.width*R,ct=P.height*q;return r.endX>=O&&r.endX<=O+it&&r.endY>=G&&r.endY<=G+ct});if(k){a==null||a.get("browse:click").next({annotationId:k.id,motivation:k.motivation}),v(!1),y(null);return}}v(!1),y(null);return}const c=f.width/m.width,i=f.height/m.height,p={startX:r.startX*c,startY:r.startY*i,endX:r.endX*c,endY:r.endY*i},x=ut(p,h,f.width,f.height,1),X=ht(x);o&&a.get("mark:requested").next({selector:{type:"FragmentSelector",conformsTo:"http://tools.ietf.org/rfc/rfc3778",value:X},motivation:o}),v(!1)},[M,r,h,f,m,o,d]),I=e=>{const n=lt(e);if(!n)return null;const i=(Array.isArray(n)?n:[n]).find(p=>p.type==="FragmentSelector");return!i||i.type!=="FragmentSelector"?null:i},$=d.filter(e=>{const n=I(e.target);return n?ft(n.value)===h:!1}),{handleMouseEnter:rt,handleMouseLeave:st}=l.useMemo(()=>dt(e=>a==null?void 0:a.get("beckon:hover").next({annotationId:e}),S),[a,S]),{stroke:ot,fill:at}=K(o??null);return H?u.jsx("div",{className:"semiont-pdf-annotation-canvas__error",children:H}):u.jsxs("div",{className:"semiont-pdf-annotation-canvas",children:[A&&u.jsx("div",{className:"semiont-pdf-annotation-canvas__loading",children:"Loading PDF..."}),u.jsxs("div",{ref:B,className:"semiont-pdf-annotation-canvas__container",style:{display:A?"none":void 0},onMouseDown:tt,onMouseMove:et,onMouseUp:nt,onMouseLeave:()=>{M&&(v(!1),y(null))},"data-drawing-mode":s||"none",children:[N&&u.jsx("img",{ref:g,src:N,alt:`PDF page ${h}`,className:"semiont-pdf-annotation-canvas__image",draggable:!1,style:{pointerEvents:"none"},onLoad:()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{g.current&&U({width:g.current.clientWidth,height:g.current.clientHeight})})})}}),m&&f&&u.jsx("div",{className:"semiont-pdf-annotation-canvas__overlay-container",children:u.jsx("div",{className:"semiont-pdf-annotation-canvas__overlay",children:u.jsxs("svg",{className:"semiont-pdf-annotation-canvas__svg",width:m.width,height:m.height,children:[$.map(e=>{const n=I(e.target);if(!n)return null;const c=V(n.value);if(!c)return null;const i=J(c,f.height,1),p=m.width/f.width,x=m.height/f.height,X=e.id===w,k=e.id===j,T=e.motivation,{stroke:Y,fill:_}=K(T);return u.jsx("rect",{x:i.x*p,y:i.y*x,width:i.width*p,height:i.height*x,stroke:Y,strokeWidth:k?4:X?3:2,fill:_,style:{pointerEvents:"auto",cursor:"pointer",opacity:k?1:X?.9:.7},onClick:()=>a==null?void 0:a.get("browse:click").next({annotationId:e.id,motivation:e.motivation}),onMouseEnter:()=>rt(e.id),onMouseLeave:st},e.id)}),r&&(()=>{const e=Math.min(r.startX,r.endX),n=Math.min(r.startY,r.endY),c=Math.abs(r.endX-r.startX),i=Math.abs(r.endY-r.startY);return u.jsx("rect",{x:e,y:n,width:c,height:i,stroke:ot,strokeWidth:2,strokeDasharray:"5,5",fill:at,pointerEvents:"none"})})()]})})})]}),D>0&&u.jsxs("div",{className:"semiont-pdf-annotation-canvas__controls",children:[u.jsx("button",{disabled:h<=1,onClick:()=>W(h-1),className:"semiont-pdf-annotation-canvas__button",children:"Previous"}),u.jsxs("span",{className:"semiont-pdf-annotation-canvas__page-info",children:["Page ",h," of ",D]}),u.jsx("button",{disabled:h>=D,onClick:()=>W(h+1),className:"semiont-pdf-annotation-canvas__button",children:"Next"})]})]})}export{kt as PdfAnnotationCanvas};
2
+ //# sourceMappingURL=PdfAnnotationCanvas.client-CW6SKH2U-CVmEpRfP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdfAnnotationCanvas.client-CW6SKH2U-CVmEpRfP.js","sources":["../../../../packages/react-ui/dist/PdfAnnotationCanvas.client-CW6SKH2U.mjs"],"sourcesContent":["'use client';\n\"use client\";\nimport {\n createHoverHandlers\n} from \"./chunk-BQJWOK4C.mjs\";\nimport \"./chunk-HNZOXH4L.mjs\";\nimport \"./chunk-D4GAAQMM.mjs\";\n\n// src/components/pdf-annotation/PdfAnnotationCanvas.tsx\nimport { useRef, useState, useCallback, useEffect, useMemo } from \"react\";\nimport { getTargetSelector } from \"@semiont/api-client\";\n\n// src/lib/pdf-coordinates.ts\nfunction canvasToPdfCoordinates(canvasRect, page, _pageWidth, pageHeight, scale = 1) {\n const x1 = Math.min(canvasRect.startX, canvasRect.endX);\n const y1 = Math.min(canvasRect.startY, canvasRect.endY);\n const x2 = Math.max(canvasRect.startX, canvasRect.endX);\n const y2 = Math.max(canvasRect.startY, canvasRect.endY);\n const pdfX = x1 / scale;\n const pdfWidth = (x2 - x1) / scale;\n const pdfY = pageHeight - y2 / scale;\n const pdfHeight = (y2 - y1) / scale;\n return {\n page,\n x: Math.round(pdfX),\n y: Math.round(pdfY),\n width: Math.round(pdfWidth),\n height: Math.round(pdfHeight)\n };\n}\nfunction pdfToCanvasCoordinates(pdfCoord, pageHeight, scale = 1) {\n const canvasX = pdfCoord.x * scale;\n const canvasWidth = pdfCoord.width * scale;\n const canvasY = (pageHeight - pdfCoord.y - pdfCoord.height) * scale;\n const canvasHeight = pdfCoord.height * scale;\n return {\n x: canvasX,\n y: canvasY,\n width: canvasWidth,\n height: canvasHeight\n };\n}\nfunction createFragmentSelector(coord) {\n return `page=${coord.page}&viewrect=${coord.x},${coord.y},${coord.width},${coord.height}`;\n}\nfunction parseFragmentSelector(fragment) {\n try {\n const pageMatch = fragment.match(/page=(\\d+)/);\n if (!pageMatch) return null;\n const page = parseInt(pageMatch[1], 10);\n const viewrectMatch = fragment.match(/viewrect=([\\d.]+),([\\d.]+),([\\d.]+),([\\d.]+)/);\n if (!viewrectMatch) return null;\n return {\n page,\n x: parseFloat(viewrectMatch[1]),\n y: parseFloat(viewrectMatch[2]),\n width: parseFloat(viewrectMatch[3]),\n height: parseFloat(viewrectMatch[4])\n };\n } catch {\n return null;\n }\n}\nfunction getPageFromFragment(fragment) {\n const match = fragment.match(/page=(\\d+)/);\n return match ? parseInt(match[1], 10) : null;\n}\n\n// src/lib/browser-pdfjs.ts\nasync function ensurePdfJs() {\n if (typeof window !== \"undefined\" && window.pdfjsLib) {\n return window.pdfjsLib;\n }\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n script.src = \"/pdfjs/pdf.min.mjs\";\n script.type = \"module\";\n script.onload = () => {\n const pdfjsLib = window.pdfjsLib;\n if (!pdfjsLib) {\n reject(new Error(\"PDF.js loaded but pdfjsLib not available\"));\n return;\n }\n pdfjsLib.GlobalWorkerOptions.workerSrc = \"/pdfjs/pdf.worker.min.mjs\";\n resolve(pdfjsLib);\n };\n script.onerror = () => {\n reject(new Error(\"Failed to load PDF.js from /pdfjs/pdf.min.mjs\"));\n };\n document.head.appendChild(script);\n });\n}\nasync function loadPdfDocument(url) {\n const pdfjsLib = await ensurePdfJs();\n const loadingTask = pdfjsLib.getDocument({ url });\n return loadingTask.promise;\n}\nasync function renderPdfPageToDataUrl(page, scale = 1) {\n const viewport = page.getViewport({ scale });\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n if (!context) {\n throw new Error(\"Failed to get 2D context\");\n }\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n const renderTask = page.render({\n canvasContext: context,\n viewport\n });\n await renderTask.promise;\n return {\n dataUrl: canvas.toDataURL(\"image/png\"),\n width: viewport.width,\n height: viewport.height\n };\n}\n\n// src/components/pdf-annotation/PdfAnnotationCanvas.tsx\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nfunction getMotivationColor(motivation) {\n if (!motivation) {\n return { stroke: \"rgb(156, 163, 175)\", fill: \"rgba(156, 163, 175, 0.2)\" };\n }\n switch (motivation) {\n case \"highlighting\":\n return { stroke: \"rgb(250, 204, 21)\", fill: \"rgba(250, 204, 21, 0.3)\" };\n case \"linking\":\n return { stroke: \"rgb(59, 130, 246)\", fill: \"rgba(59, 130, 246, 0.2)\" };\n case \"assessing\":\n return { stroke: \"rgb(239, 68, 68)\", fill: \"rgba(239, 68, 68, 0.2)\" };\n case \"commenting\":\n return { stroke: \"rgb(255, 255, 255)\", fill: \"rgba(255, 255, 255, 0.2)\" };\n default:\n return { stroke: \"rgb(156, 163, 175)\", fill: \"rgba(156, 163, 175, 0.2)\" };\n }\n}\nfunction PdfAnnotationCanvas({\n pdfUrl,\n existingAnnotations = [],\n drawingMode,\n selectedMotivation,\n eventBus,\n hoveredAnnotationId,\n selectedAnnotationId,\n hoverDelayMs = 150\n}) {\n const [pdfDoc, setPdfDoc] = useState(null);\n const [numPages, setNumPages] = useState(0);\n const [pageNumber, setPageNumber] = useState(1);\n const [pageImageUrl, setPageImageUrl] = useState(null);\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState(null);\n const [pageDimensions, setPageDimensions] = useState(null);\n const [displayDimensions, setDisplayDimensions] = useState(null);\n const [scale] = useState(1.5);\n const [isDrawing, setIsDrawing] = useState(false);\n const [selection, setSelection] = useState(null);\n const containerRef = useRef(null);\n const imageRef = useRef(null);\n useEffect(() => {\n let cancelled = false;\n async function loadPdf() {\n try {\n setIsLoading(true);\n setError(null);\n const doc = await loadPdfDocument(pdfUrl);\n if (cancelled) return;\n setPdfDoc(doc);\n setNumPages(doc.numPages);\n setIsLoading(false);\n } catch (err) {\n if (cancelled) return;\n console.error(\"Error loading PDF:\", err);\n setError(\"Failed to load PDF\");\n setIsLoading(false);\n }\n }\n loadPdf();\n return () => {\n cancelled = true;\n };\n }, [pdfUrl]);\n useEffect(() => {\n if (!pdfDoc) return;\n let cancelled = false;\n const doc = pdfDoc;\n async function loadPage() {\n try {\n const page = await doc.getPage(pageNumber);\n if (cancelled) return;\n const viewport = page.getViewport({ scale: 1 });\n setPageDimensions({\n width: viewport.width,\n height: viewport.height\n });\n const { dataUrl } = await renderPdfPageToDataUrl(page, scale);\n if (cancelled) return;\n setPageImageUrl(dataUrl);\n } catch (err) {\n if (cancelled) return;\n console.error(\"Error loading page:\", err);\n setError(\"Failed to load page\");\n }\n }\n loadPage();\n return () => {\n cancelled = true;\n };\n }, [pdfDoc, pageNumber, scale]);\n useEffect(() => {\n const updateDisplayDimensions = () => {\n if (imageRef.current) {\n setDisplayDimensions({\n width: imageRef.current.clientWidth,\n height: imageRef.current.clientHeight\n });\n }\n };\n updateDisplayDimensions();\n let resizeObserver = null;\n try {\n resizeObserver = new ResizeObserver(updateDisplayDimensions);\n if (imageRef.current) {\n resizeObserver.observe(imageRef.current);\n }\n } catch (error2) {\n console.warn(\"ResizeObserver not supported, falling back to window resize listener\");\n window.addEventListener(\"resize\", updateDisplayDimensions);\n }\n return () => {\n if (resizeObserver) {\n resizeObserver.disconnect();\n } else {\n window.removeEventListener(\"resize\", updateDisplayDimensions);\n }\n };\n }, [pageImageUrl]);\n const handleMouseDown = useCallback((e) => {\n if (!drawingMode) return;\n if (!imageRef.current) return;\n const rect = imageRef.current.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n setIsDrawing(true);\n setSelection({\n startX: x,\n startY: y,\n endX: x,\n endY: y\n });\n }, [drawingMode]);\n const handleMouseMove = useCallback((e) => {\n if (!isDrawing || !selection || !imageRef.current) return;\n const rect = imageRef.current.getBoundingClientRect();\n setSelection({\n ...selection,\n endX: e.clientX - rect.left,\n endY: e.clientY - rect.top\n });\n }, [isDrawing, selection]);\n const handleMouseUp = useCallback(() => {\n if (!isDrawing || !selection || !pageDimensions || !displayDimensions || !eventBus) {\n setIsDrawing(false);\n setSelection(null);\n return;\n }\n const dragDistance = Math.sqrt(\n Math.pow(selection.endX - selection.startX, 2) + Math.pow(selection.endY - selection.startY, 2)\n );\n const MIN_DRAG_DISTANCE = 10;\n if (dragDistance < MIN_DRAG_DISTANCE) {\n if (existingAnnotations.length > 0) {\n const clickedAnnotation = pageAnnotations.find((ann) => {\n const fragmentSel = getFragmentSelector(ann.target);\n if (!fragmentSel) return false;\n const pdfCoord2 = parseFragmentSelector(fragmentSel.value);\n if (!pdfCoord2) return false;\n const rect = pdfToCanvasCoordinates(pdfCoord2, pageDimensions.height, 1);\n const scaleX2 = displayDimensions.width / pageDimensions.width;\n const scaleY2 = displayDimensions.height / pageDimensions.height;\n const displayX = rect.x * scaleX2;\n const displayY = rect.y * scaleY2;\n const displayWidth = rect.width * scaleX2;\n const displayHeight = rect.height * scaleY2;\n return selection.endX >= displayX && selection.endX <= displayX + displayWidth && selection.endY >= displayY && selection.endY <= displayY + displayHeight;\n });\n if (clickedAnnotation) {\n eventBus?.get(\"browse:click\").next({ annotationId: clickedAnnotation.id, motivation: clickedAnnotation.motivation });\n setIsDrawing(false);\n setSelection(null);\n return;\n }\n }\n setIsDrawing(false);\n setSelection(null);\n return;\n }\n const scaleX = pageDimensions.width / displayDimensions.width;\n const scaleY = pageDimensions.height / displayDimensions.height;\n const nativeSelection = {\n startX: selection.startX * scaleX,\n startY: selection.startY * scaleY,\n endX: selection.endX * scaleX,\n endY: selection.endY * scaleY\n };\n const pdfCoord = canvasToPdfCoordinates(\n nativeSelection,\n pageNumber,\n pageDimensions.width,\n pageDimensions.height,\n 1\n // Use scale 1.0 since we already scaled to native coords\n );\n const fragmentSelector = createFragmentSelector(pdfCoord);\n if (selectedMotivation) {\n eventBus.get(\"mark:requested\").next({\n selector: {\n type: \"FragmentSelector\",\n conformsTo: \"http://tools.ietf.org/rfc/rfc3778\",\n value: fragmentSelector\n },\n motivation: selectedMotivation\n });\n }\n setIsDrawing(false);\n }, [isDrawing, selection, pageNumber, pageDimensions, displayDimensions, selectedMotivation, existingAnnotations]);\n const getFragmentSelector = (target) => {\n const selector = getTargetSelector(target);\n if (!selector) return null;\n const selectors = Array.isArray(selector) ? selector : [selector];\n const found = selectors.find((s) => s.type === \"FragmentSelector\");\n if (!found || found.type !== \"FragmentSelector\") return null;\n return found;\n };\n const pageAnnotations = existingAnnotations.filter((ann) => {\n const fragmentSel = getFragmentSelector(ann.target);\n if (!fragmentSel) return false;\n const page = getPageFromFragment(fragmentSel.value);\n return page === pageNumber;\n });\n const { handleMouseEnter, handleMouseLeave } = useMemo(\n () => createHoverHandlers((annotationId) => eventBus?.get(\"beckon:hover\").next({ annotationId }), hoverDelayMs),\n [eventBus, hoverDelayMs]\n );\n const { stroke, fill } = getMotivationColor(selectedMotivation ?? null);\n if (error) {\n return /* @__PURE__ */ jsx(\"div\", { className: \"semiont-pdf-annotation-canvas__error\", children: error });\n }\n return /* @__PURE__ */ jsxs(\"div\", { className: \"semiont-pdf-annotation-canvas\", children: [\n isLoading && /* @__PURE__ */ jsx(\"div\", { className: \"semiont-pdf-annotation-canvas__loading\", children: \"Loading PDF...\" }),\n /* @__PURE__ */ jsxs(\n \"div\",\n {\n ref: containerRef,\n className: \"semiont-pdf-annotation-canvas__container\",\n style: { display: isLoading ? \"none\" : void 0 },\n onMouseDown: handleMouseDown,\n onMouseMove: handleMouseMove,\n onMouseUp: handleMouseUp,\n onMouseLeave: () => {\n if (isDrawing) {\n setIsDrawing(false);\n setSelection(null);\n }\n },\n \"data-drawing-mode\": drawingMode || \"none\",\n children: [\n pageImageUrl && /* @__PURE__ */ jsx(\n \"img\",\n {\n ref: imageRef,\n src: pageImageUrl,\n alt: `PDF page ${pageNumber}`,\n className: \"semiont-pdf-annotation-canvas__image\",\n draggable: false,\n style: { pointerEvents: \"none\" },\n onLoad: () => {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n if (imageRef.current) {\n setDisplayDimensions({\n width: imageRef.current.clientWidth,\n height: imageRef.current.clientHeight\n });\n }\n });\n });\n }\n }\n ),\n displayDimensions && pageDimensions && /* @__PURE__ */ jsx(\"div\", { className: \"semiont-pdf-annotation-canvas__overlay-container\", children: /* @__PURE__ */ jsx(\"div\", { className: \"semiont-pdf-annotation-canvas__overlay\", children: /* @__PURE__ */ jsxs(\n \"svg\",\n {\n className: \"semiont-pdf-annotation-canvas__svg\",\n width: displayDimensions.width,\n height: displayDimensions.height,\n children: [\n pageAnnotations.map((ann) => {\n const fragmentSel = getFragmentSelector(ann.target);\n if (!fragmentSel) return null;\n const pdfCoord = parseFragmentSelector(fragmentSel.value);\n if (!pdfCoord) return null;\n const rect = pdfToCanvasCoordinates(pdfCoord, pageDimensions.height, 1);\n const scaleX = displayDimensions.width / pageDimensions.width;\n const scaleY = displayDimensions.height / pageDimensions.height;\n const isHovered = ann.id === hoveredAnnotationId;\n const isSelected = ann.id === selectedAnnotationId;\n const annMotivation = ann.motivation;\n const { stroke: annStroke, fill: annFill } = getMotivationColor(annMotivation);\n return /* @__PURE__ */ jsx(\n \"rect\",\n {\n x: rect.x * scaleX,\n y: rect.y * scaleY,\n width: rect.width * scaleX,\n height: rect.height * scaleY,\n stroke: annStroke,\n strokeWidth: isSelected ? 4 : isHovered ? 3 : 2,\n fill: annFill,\n style: {\n pointerEvents: \"auto\",\n cursor: \"pointer\",\n opacity: isSelected ? 1 : isHovered ? 0.9 : 0.7\n },\n onClick: () => eventBus?.get(\"browse:click\").next({ annotationId: ann.id, motivation: ann.motivation }),\n onMouseEnter: () => handleMouseEnter(ann.id),\n onMouseLeave: handleMouseLeave\n },\n ann.id\n );\n }),\n selection && (() => {\n const rectX = Math.min(selection.startX, selection.endX);\n const rectY = Math.min(selection.startY, selection.endY);\n const rectWidth = Math.abs(selection.endX - selection.startX);\n const rectHeight = Math.abs(selection.endY - selection.startY);\n return /* @__PURE__ */ jsx(\n \"rect\",\n {\n x: rectX,\n y: rectY,\n width: rectWidth,\n height: rectHeight,\n stroke,\n strokeWidth: 2,\n strokeDasharray: \"5,5\",\n fill,\n pointerEvents: \"none\"\n }\n );\n })()\n ]\n }\n ) }) })\n ]\n }\n ),\n numPages > 0 && /* @__PURE__ */ jsxs(\"div\", { className: \"semiont-pdf-annotation-canvas__controls\", children: [\n /* @__PURE__ */ jsx(\n \"button\",\n {\n disabled: pageNumber <= 1,\n onClick: () => setPageNumber(pageNumber - 1),\n className: \"semiont-pdf-annotation-canvas__button\",\n children: \"Previous\"\n }\n ),\n /* @__PURE__ */ jsxs(\"span\", { className: \"semiont-pdf-annotation-canvas__page-info\", children: [\n \"Page \",\n pageNumber,\n \" of \",\n numPages\n ] }),\n /* @__PURE__ */ jsx(\n \"button\",\n {\n disabled: pageNumber >= numPages,\n onClick: () => setPageNumber(pageNumber + 1),\n className: \"semiont-pdf-annotation-canvas__button\",\n children: \"Next\"\n }\n )\n ] })\n ] });\n}\nexport {\n PdfAnnotationCanvas\n};\n//# sourceMappingURL=PdfAnnotationCanvas.client-CW6SKH2U.mjs.map"],"names":["canvasToPdfCoordinates","canvasRect","page","_pageWidth","pageHeight","scale","x1","y1","x2","y2","pdfX","pdfWidth","pdfY","pdfHeight","pdfToCanvasCoordinates","pdfCoord","canvasX","canvasWidth","canvasY","canvasHeight","createFragmentSelector","coord","parseFragmentSelector","fragment","pageMatch","viewrectMatch","getPageFromFragment","match","ensurePdfJs","resolve","reject","script","pdfjsLib","loadPdfDocument","url","renderPdfPageToDataUrl","viewport","canvas","context","getMotivationColor","motivation","PdfAnnotationCanvas","pdfUrl","existingAnnotations","drawingMode","selectedMotivation","eventBus","hoveredAnnotationId","selectedAnnotationId","hoverDelayMs","pdfDoc","setPdfDoc","useState","numPages","setNumPages","pageNumber","setPageNumber","pageImageUrl","setPageImageUrl","isLoading","setIsLoading","error","setError","pageDimensions","setPageDimensions","displayDimensions","setDisplayDimensions","isDrawing","setIsDrawing","selection","setSelection","containerRef","useRef","imageRef","useEffect","cancelled","loadPdf","doc","err","loadPage","dataUrl","updateDisplayDimensions","resizeObserver","handleMouseDown","useCallback","rect","x","y","handleMouseMove","handleMouseUp","clickedAnnotation","pageAnnotations","ann","fragmentSel","getFragmentSelector","pdfCoord2","scaleX2","scaleY2","displayX","displayY","displayWidth","displayHeight","scaleX","scaleY","nativeSelection","fragmentSelector","target","selector","getTargetSelector","found","s","handleMouseEnter","handleMouseLeave","useMemo","createHoverHandlers","annotationId","stroke","fill","jsx","jsxs","isHovered","isSelected","annMotivation","annStroke","annFill","rectX","rectY","rectWidth","rectHeight"],"mappings":"+LAaA,SAASA,GAAuBC,EAAYC,EAAMC,EAAYC,EAAYC,EAAQ,EAAG,CACnF,MAAMC,EAAK,KAAK,IAAIL,EAAW,OAAQA,EAAW,IAAI,EAChDM,EAAK,KAAK,IAAIN,EAAW,OAAQA,EAAW,IAAI,EAChDO,EAAK,KAAK,IAAIP,EAAW,OAAQA,EAAW,IAAI,EAChDQ,EAAK,KAAK,IAAIR,EAAW,OAAQA,EAAW,IAAI,EAChDS,EAAOJ,EAAKD,EACZM,GAAYH,EAAKF,GAAMD,EACvBO,EAAOR,EAAaK,EAAKJ,EACzBQ,GAAaJ,EAAKF,GAAMF,EAC9B,MAAO,CACL,KAAAH,EACA,EAAG,KAAK,MAAMQ,CAAI,EAClB,EAAG,KAAK,MAAME,CAAI,EAClB,MAAO,KAAK,MAAMD,CAAQ,EAC1B,OAAQ,KAAK,MAAME,CAAS,CAChC,CACA,CACA,SAASC,EAAuBC,E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O,EACH,EAAGC,EACH,MAAOC,EACP,OAAQC,EACR,OAAAZ,GACA,YAAa,EACb,gBAAiB,MACjB,KAAAC,GACA,cAAe,MACrC,CACA,CACgB,GAAC,CACjB,CACA,CACA,CAAW,CAAE,CAAC,CAAE,CAChB,CACA,CACA,EACIhE,EAAW,GAAqBkE,OAAK,MAAO,CAAE,UAAW,0CAA2C,SAAU,CAC5FD,EAAAA,IACd,SACA,CACE,SAAU/D,GAAc,EACxB,QAAS,IAAMC,EAAcD,EAAa,CAAC,EAC3C,UAAW,wCACX,SAAU,UACpB,CACA,EACsBgE,EAAAA,KAAK,OAAQ,CAAE,UAAW,2CAA4C,SAAU,CAC9F,QACAhE,EACA,OACAF,CACR,EAAS,EACaiE,EAAAA,IACd,SACA,CACE,SAAU/D,GAAcF,EACxB,QAAS,IAAMG,EAAcD,EAAa,CAAC,EAC3C,UAAW,wCACX,SAAU,MACpB,CACA,CACA,CAAK,CAAE,CACP,EAAK,CACL"}
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./vendor-EnoIVk-c.js";function a({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const i=e.forwardRef(a);export{i as F};
2
+ //# sourceMappingURL=PlusIcon-qGFPUzg0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlusIcon-qGFPUzg0.js","sources":["../../../../node_modules/@heroicons/react/24/outline/esm/PlusIcon.js"],"sourcesContent":["import * as React from \"react\";\nfunction PlusIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M12 4.5v15m7.5-7.5h-15\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(PlusIcon);\nexport default ForwardRef;"],"names":["PlusIcon","title","titleId","props","svgRef","React.createElement","ForwardRef","React.forwardRef"],"mappings":"yCACA,SAASA,EAAS,CAChB,MAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ,CACT,OAAoBC,gBAAoB,MAAO,OAAO,OAAO,CAC3D,MAAO,6BACP,KAAM,OACN,QAAS,YACT,YAAa,IACb,OAAQ,eACR,cAAe,OACf,YAAa,OACb,IAAKD,EACL,kBAAmBF,CACvB,EAAKC,CAAK,EAAGF,EAAqBI,EAAAA,cAAoB,QAAS,CAC3D,GAAIH,CACR,EAAKD,CAAK,EAAI,KAAmBI,EAAAA,cAAoB,OAAQ,CACzD,cAAe,QACf,eAAgB,QAChB,EAAG,wBACP,CAAG,CAAC,CACJ,CACK,MAACC,EAA2BC,EAAAA,WAAiBP,CAAQ","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+ import{r as t}from"./vendor-EnoIVk-c.js";const e=t.createContext("disconnected");function o(){return t.useContext(e)}export{e as S,o as u};
2
+ //# sourceMappingURL=StreamStatusContext-BuPATpTz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StreamStatusContext-BuPATpTz.js","sources":["../../src/contexts/StreamStatusContext.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { StreamStatus } from '@semiont/react-ui';\n\nexport const StreamStatusContext = createContext<StreamStatus>('disconnected');\n\nexport function useStreamStatus(): StreamStatus {\n return useContext(StreamStatusContext);\n}\n"],"names":["StreamStatusContext","createContext","useStreamStatus","useContext"],"mappings":"yCAGO,MAAMA,EAAsBC,EAAAA,cAA4B,cAAc,EAEtE,SAASC,GAAgC,CAC9C,OAAOC,EAAAA,WAAWH,CAAmB,CACvC"}
@@ -0,0 +1,2 @@
1
+ import{j as e}from"./query-ATBhtd3K.js";import{r as l}from"./vendor-EnoIVk-c.js";import{l as A,$ as M,a0 as b,a1 as w,a2 as y,g as E,a3 as D,a4 as L,a5 as C}from"./en-IUV4ZXKH-BjYNERUx.js";import{u as z}from"./useAuth-CqtZE9nt.js";import{u as T}from"./AuthContext-CYne_gJM.js";import{a as I,u as k,b as R}from"./routing-nZgBtxly.js";import{u as S}from"./i18n-BYxb14hm.js";import{u as _}from"./KnowledgeBaseContext-CgnF8K-_.js";import{F as U}from"./PlusIcon-qGFPUzg0.js";function O({title:i,titleId:s,...a},t){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":s},a),i?l.createElement("title",{id:s},i):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const Z=l.forwardRef(O),f="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTYiIGZpbGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTE2IDE2QzE4LjIwOTEgMTYgMjAgMTQuMjA5MSAyMCAxMkMyMCA5Ljc5MDg2IDE4LjIwOTEgOCAxNiA4QzEzLjc5MDkgOCAxMiA5Ljc5MDg2IDEyIDEyQzEyIDE0LjIwOTEgMTMuNzkwOSAxNiAxNiAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTI0IDI1QzI0IDIxLjY4NjMgMjAuNDE4MyAxOSAxNiAxOUMxMS41ODE3IDE5IDggMjEuNjg2MyA4IDI1IiBzdHJva2U9IiNFNUU3RUIiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPg==";function P(){const{t:i}=S(),s=(d,v)=>i(`UserPanel.${d}`,v),{displayName:a,avatarUrl:t,userDomain:n,isAdmin:c,isModerator:r}=z(),{clearSession:o}=T(),p=A(),m=I(),[h,x]=l.useState(!1),{timeRemaining:u}=M(),g=w(u)??"Unknown",j=(()=>{if(!t||h)return f;const d=b(t);return d||(console.warn("Invalid profile image URL detected, using fallback"),f)})(),N=async()=>{try{await p.logout()}catch{}o(),m.push("/")};return e.jsxs("div",{className:"semiont-user-panel",children:[e.jsx("h3",{className:"semiont-user-panel__title",children:s("account")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:j,alt:s("profileAlt",{name:a||s("user")}),width:48,height:48,className:"w-12 h-12 rounded-full object-cover",onError:()=>x(!0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"semiont-panel-text",children:a||s("user")}),n&&e.jsxs("div",{className:"semiont-panel-text-secondary",children:["@",n]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"semiont-panel-label",children:s("session")}),e.jsx("div",{className:"semiont-session-box",children:e.jsx("div",{className:"semiont-panel-hint",children:s("expiresIn",{time:g})})})]}),(c||r)&&e.jsxs("div",{children:[e.jsx("label",{className:"semiont-panel-label",children:s("privileges")}),e.jsxs("div",{className:"space-y-1",children:[c&&e.jsx("div",{className:"semiont-privilege-badge semiont-privilege-badge--admin",children:e.jsx("span",{className:"semiont-privilege-text",children:s("administrator")})}),r&&e.jsx("div",{className:"semiont-privilege-badge semiont-privilege-badge--moderator",children:e.jsx("span",{className:"semiont-privilege-text",children:s("moderator")})})]})]}),e.jsx("div",{className:"semiont-panel-divider",children:e.jsx("button",{onClick:N,className:"semiont-signout-button",children:s("signOut")})})]})]})}function G(){const{knowledgeBases:i,activeKnowledgeBase:s,setActiveKnowledgeBase:a}=_(),t=I();return e.jsxs("div",{className:"semiont-panel",children:[e.jsx("div",{className:"semiont-panel-header",children:e.jsxs("h2",{className:"semiont-panel-header__title",children:[e.jsx("span",{className:"semiont-panel-header__text",children:"Knowledge Bases"}),e.jsxs("span",{className:"semiont-panel-header__count",children:["(",i.length,")"]})]})}),e.jsx("div",{className:"semiont-panel__content",children:e.jsx("div",{className:"semiont-panel__list",children:i.map(n=>e.jsxs("button",{onClick:()=>a(n.id),className:`semiont-panel-item semiont-panel-item--clickable${n.id===(s==null?void 0:s.id)?" semiont-panel-item--selected":""}`,style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("span",{className:"semiont-panel-text",style:{flex:1},children:n.label}),e.jsx("span",{className:"semiont-panel-text-secondary",children:n.backendUrl.replace(/^https?:\/\//,"")}),n.id===(s==null?void 0:s.id)&&e.jsx(Z,{style:{width:"1rem",height:"1rem",color:"var(--semiont-color-primary-500)",flexShrink:0}})]},n.id))})}),e.jsx("div",{className:"semiont-panel-footer",children:e.jsxs("button",{onClick:()=>t.push("/auth/connect"),className:"semiont-panel-item semiont-panel-item--clickable",style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",color:"var(--semiont-color-primary-600)"},children:[e.jsx(U,{style:{width:"1rem",height:"1rem",flexShrink:0}}),e.jsx("span",{className:"semiont-panel-text",style:{color:"inherit"},children:"Add knowledge base"})]})})]})}function V({activePanel:i,theme:s,showLineNumbers:a,hoverDelayMs:t,children:n}){const c=k(),r=I(),o=R(),[p,m]=l.useTransition(),{width:h,setWidth:x,minWidth:u,maxWidth:g}=y(),j=l.useCallback(({locale:N})=>{o&&m(()=>{r.replace(o,{locale:N})})},[o,r,m]);return E({"settings:locale-changed":j}),!i||!n&&!D.includes(i)?null:e.jsxs("div",{className:"semiont-toolbar-panels",style:{width:`${h}px`,position:"relative"},children:[e.jsx(L,{onResize:x,minWidth:u,maxWidth:g,position:"left",ariaLabel:"Resize right panel"}),e.jsxs("div",{className:"semiont-toolbar-panels__content",children:[n,i==="knowledge-base"&&e.jsx(G,{}),i==="user"&&e.jsx(P,{}),i==="settings"&&e.jsx(C,{showLineNumbers:a,theme:s,hoverDelayMs:t,locale:c,isPendingLocaleChange:p})]})]})}export{V as T};
2
+ //# sourceMappingURL=ToolbarPanels-tcvPzqNN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolbarPanels-tcvPzqNN.js","sources":["../../../../node_modules/@heroicons/react/24/outline/esm/CheckIcon.js","../../src/components/UserPanel.tsx","../../src/components/KnowledgeBasePanel.tsx","../../src/components/toolbar/ToolbarPanels.tsx"],"sourcesContent":["import * as React from \"react\";\nfunction CheckIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 1.5,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"m4.5 12.75 6 6 9-13.5\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CheckIcon);\nexport default ForwardRef;","import React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { sanitizeImageURL, useSessionExpiry, formatTime, useApiClient } from '@semiont/react-ui';\nimport { useAuth } from '@/hooks/useAuth';\nimport { useAuthContext } from '@/contexts/AuthContext';\nimport { useRouter } from '@/i18n/routing';\n\n// Fallback avatar when image fails to load or is invalid\nconst FALLBACK_AVATAR = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMTYiIGN5PSIxNiIgcj0iMTYiIGZpbGw9IiM2QjcyODAiLz4KPHBhdGggZD0iTTE2IDE2QzE4LjIwOTEgMTYgMjAgMTQuMjA5MSAyMCAxMkMyMCA5Ljc5MDg2IDE4LjIwOTEgOCAxNiA4QzEzLjc5MDkgOCAxMiA5Ljc5MDg2IDEyIDEyQzEyIDE0LjIwOTEgMTMuNzkwOSAxNiAxNiAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTI0IDI1QzI0IDIxLjY4NjMgMjAuNDE4MyAxOSAxNiAxOUMxMS41ODE3IDE5IDggMjEuNjg2MyA4IDI1IiBzdHJva2U9IiNFNUU3RUIiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPg==';\n\nexport function UserPanel() {\n const { t: _t } = useTranslation();\n const t = (k: string, p?: Record<string, unknown>) => _t(`UserPanel.${k}`, p as any) as string;\n const { displayName, avatarUrl, userDomain, isAdmin, isModerator } = useAuth();\n const { clearSession } = useAuthContext();\n const apiClient = useApiClient();\n const router = useRouter();\n const [imageError, setImageError] = useState(false);\n const { timeRemaining } = useSessionExpiry();\n const sessionTimeFormatted = formatTime(timeRemaining) ?? 'Unknown';\n\n // Sanitize and validate the profile image URL\n const profileImageUrl = (() => {\n if (!avatarUrl || imageError) {\n return FALLBACK_AVATAR;\n }\n\n const sanitized = sanitizeImageURL(avatarUrl);\n if (!sanitized) {\n console.warn('Invalid profile image URL detected, using fallback');\n return FALLBACK_AVATAR;\n }\n\n return sanitized;\n })();\n\n const handleSignOut = async () => {\n try {\n await apiClient.logout();\n } catch {\n // best-effort — cookie already cleared server-side\n }\n clearSession();\n router.push('/');\n };\n\n return (\n <div className=\"semiont-user-panel\">\n <h3 className=\"semiont-user-panel__title\">\n {t('account')}\n </h3>\n\n <div className=\"space-y-4\">\n {/* User Profile */}\n <div className=\"flex items-center gap-3\">\n <img\n src={profileImageUrl}\n alt={t('profileAlt', { name: displayName || t('user') })}\n width={48}\n height={48}\n className=\"w-12 h-12 rounded-full object-cover\"\n onError={() => setImageError(true)}\n />\n <div className=\"flex-1 min-w-0\">\n <div className=\"semiont-panel-text\">\n {displayName || t('user')}\n </div>\n {userDomain && (\n <div className=\"semiont-panel-text-secondary\">\n @{userDomain}\n </div>\n )}\n </div>\n </div>\n\n {/* Session Info */}\n <div>\n <label className=\"semiont-panel-label\">\n {t('session')}\n </label>\n <div className=\"semiont-session-box\">\n <div className=\"semiont-panel-hint\">\n {t('expiresIn', { time: sessionTimeFormatted })}\n </div>\n </div>\n </div>\n\n {/* Privileges */}\n {(isAdmin || isModerator) && (\n <div>\n <label className=\"semiont-panel-label\">\n {t('privileges')}\n </label>\n <div className=\"space-y-1\">\n {isAdmin && (\n <div className=\"semiont-privilege-badge semiont-privilege-badge--admin\">\n <span className=\"semiont-privilege-text\">\n {t('administrator')}\n </span>\n </div>\n )}\n {isModerator && (\n <div className=\"semiont-privilege-badge semiont-privilege-badge--moderator\">\n <span className=\"semiont-privilege-text\">\n {t('moderator')}\n </span>\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Sign Out Button */}\n <div className=\"semiont-panel-divider\">\n <button\n onClick={handleSignOut}\n className=\"semiont-signout-button\"\n >\n {t('signOut')}\n </button>\n </div>\n </div>\n </div>\n );\n}\n","import { CheckIcon, PlusIcon } from '@heroicons/react/24/outline';\nimport { useKnowledgeBaseContext, type KnowledgeBase } from '@/contexts/KnowledgeBaseContext';\nimport { useRouter } from '@/i18n/routing';\n\nexport function KnowledgeBasePanel() {\n const { knowledgeBases, activeKnowledgeBase, setActiveKnowledgeBase } = useKnowledgeBaseContext();\n const router = useRouter();\n\n return (\n <div className=\"semiont-panel\">\n <div className=\"semiont-panel-header\">\n <h2 className=\"semiont-panel-header__title\">\n <span className=\"semiont-panel-header__text\">Knowledge Bases</span>\n <span className=\"semiont-panel-header__count\">({knowledgeBases.length})</span>\n </h2>\n </div>\n <div className=\"semiont-panel__content\">\n <div className=\"semiont-panel__list\">\n {knowledgeBases.map((kb: KnowledgeBase) => (\n <button\n key={kb.id}\n onClick={() => setActiveKnowledgeBase(kb.id)}\n className={`semiont-panel-item semiont-panel-item--clickable${kb.id === activeKnowledgeBase?.id ? ' semiont-panel-item--selected' : ''}`}\n style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}\n >\n <span className=\"semiont-panel-text\" style={{ flex: 1 }}>{kb.label}</span>\n <span className=\"semiont-panel-text-secondary\">\n {kb.backendUrl.replace(/^https?:\\/\\//, '')}\n </span>\n {kb.id === activeKnowledgeBase?.id && (\n <CheckIcon style={{ width: '1rem', height: '1rem', color: 'var(--semiont-color-primary-500)', flexShrink: 0 }} />\n )}\n </button>\n ))}\n </div>\n </div>\n <div className=\"semiont-panel-footer\">\n <button\n onClick={() => router.push('/auth/connect')}\n className=\"semiont-panel-item semiont-panel-item--clickable\"\n style={{ width: '100%', display: 'flex', alignItems: 'center', gap: '0.5rem', color: 'var(--semiont-color-primary-600)' }}\n >\n <PlusIcon style={{ width: '1rem', height: '1rem', flexShrink: 0 }} />\n <span className=\"semiont-panel-text\" style={{ color: 'inherit' }}>Add knowledge base</span>\n </button>\n </div>\n </div>\n );\n}\n","import React, { useTransition, useEffect, useCallback } from 'react';\nimport { SettingsPanel, ResizeHandle, usePanelWidth, EventBusProvider, useEventSubscriptions } from '@semiont/react-ui';\nimport { UserPanel } from '../UserPanel';\nimport { KnowledgeBasePanel } from '../KnowledgeBasePanel';\nimport { useLocale } from '@/i18n/routing';\nimport { usePathname, useRouter } from '@/i18n/routing';\nimport { COMMON_PANELS } from '@semiont/react-ui';\nimport type { ToolbarPanelType } from '@semiont/react-ui';\n\ninterface ToolbarPanelsProps {\n activePanel: ToolbarPanelType | null;\n /** Theme setting */\n theme: 'light' | 'dark' | 'system';\n /** Line numbers setting */\n showLineNumbers: boolean;\n /** Hover delay setting */\n hoverDelayMs: number;\n /** Custom panel content for context-specific panels */\n children?: React.ReactNode;\n}\n\n/**\n * Renders the toolbar panel container with common panels (user, settings)\n * and any context-specific panels passed as children.\n *\n * Settings changes are handled via GlobalSettingsEventBus - no callbacks needed.\n *\n * @example\n * // Simple context (compose, discover, moderate, admin pages)\n * <ToolbarPanels\n * activePanel={activePanel}\n * theme={theme}\n * showLineNumbers={showLineNumbers}\n * />\n *\n * @example\n * // Document context with custom panels\n * <ToolbarPanels\n * activePanel={activePanel}\n * theme={theme}\n * showLineNumbers={showLineNumbers}\n * >\n * {activePanel === 'annotations' && <UnifiedAnnotationsPanel ... />}\n * {activePanel === 'history' && <AnnotationHistory ... />}\n * {activePanel === 'info' && <ResourceInfoPanel ... />}\n * {activePanel === 'collaboration' && <CollaborationPanel ... />}\n * {activePanel === 'jsonld' && <JsonLdPanel ... />}\n * </ToolbarPanels>\n */\nexport function ToolbarPanels({\n activePanel,\n theme,\n showLineNumbers,\n hoverDelayMs,\n children\n}: ToolbarPanelsProps) {\n const locale = useLocale();\n const router = useRouter();\n const pathname = usePathname();\n const [isPending, startTransition] = useTransition();\n\n // Panel width management with localStorage persistence\n const { width, setWidth, minWidth, maxWidth } = usePanelWidth();\n\n // Handle locale change events\n const handleLocaleChanged = useCallback(({ locale: newLocale }: { locale: string }) => {\n if (!pathname) return;\n\n startTransition(() => {\n // The router from @/i18n/routing is locale-aware and will handle the locale prefix\n router.replace(pathname, { locale: newLocale });\n });\n }, [pathname, router, startTransition]);\n\n // Subscribe to locale change events\n useEventSubscriptions({\n 'settings:locale-changed': handleLocaleChanged,\n });\n\n // Don't render container if no panel is active\n if (!activePanel) {\n return null;\n }\n\n // In simple context (no children), only user and settings panels are valid.\n // If a resource-specific panel is still active from a previous route, hide the container.\n if (!children && !COMMON_PANELS.includes(activePanel)) {\n return null;\n }\n\n return (\n <div className=\"semiont-toolbar-panels\" style={{ width: `${width}px`, position: 'relative' }}>\n {/* Resize handle on left edge */}\n <ResizeHandle\n onResize={setWidth}\n minWidth={minWidth}\n maxWidth={maxWidth}\n position=\"left\"\n ariaLabel=\"Resize right panel\"\n />\n\n {/* Custom context-specific panels */}\n <div className=\"semiont-toolbar-panels__content\">\n {children}\n\n {/* Knowledge Base Panel - common to all contexts */}\n {activePanel === 'knowledge-base' && (\n <KnowledgeBasePanel />\n )}\n\n {/* User Panel - common to all contexts */}\n {activePanel === 'user' && (\n <UserPanel />\n )}\n\n {/* Settings Panel - common to all contexts */}\n {activePanel === 'settings' && (\n <SettingsPanel\n showLineNumbers={showLineNumbers}\n theme={theme}\n hoverDelayMs={hoverDelayMs}\n locale={locale}\n isPendingLocaleChange={isPending}\n />\n )}\n </div>\n </div>\n );\n}\n"],"names":["CheckIcon","title","titleId","props","svgRef","React.createElement","ForwardRef","React.forwardRef","FALLBACK_AVATAR","UserPanel","_t","useTranslation","t","k","p","displayName","avatarUrl","userDomain","isAdmin","isModerator","useAuth","clearSession","useAuthContext","apiClient","useApiClient","router","useRouter","imageError","setImageError","useState","timeRemaining","useSessionExpiry","sessionTimeFormatted","formatTime","profileImageUrl","sanitized","sanitizeImageURL","handleSignOut","jsxs","jsx","KnowledgeBasePanel","knowledgeBases","activeKnowledgeBase","setActiveKnowledgeBase","useKnowledgeBaseContext","kb","PlusIcon","ToolbarPanels","activePanel","theme","showLineNumbers","hoverDelayMs","children","locale","useLocale","pathname","usePathname","isPending","startTransition","useTransition","width","setWidth","minWidth","maxWidth","usePanelWidth","handleLocaleChanged","useCallback","newLocale","useEventSubscriptions","COMMON_PANELS","ResizeHandle","SettingsPanel"],"mappings":"sdACA,SAASA,EAAU,CACjB,MAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAGC,EAAQ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