graphdb-workbench 3.3.2-TR1 → 3.3.3-RC1

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 (270) hide show
  1. package/dist/{10759.b2e1d643d681ebd9c124.bundle.js → 10759.57059f90014058a86952.bundle.js} +2 -2
  2. package/dist/10759.57059f90014058a86952.bundle.js.map +1 -0
  3. package/dist/13231.8bbbe30c10e6c0dfdba3.bundle.js +2 -0
  4. package/dist/13231.8bbbe30c10e6c0dfdba3.bundle.js.map +1 -0
  5. package/dist/{18961.01ff5fcc0f4b9f99236e.bundle.js → 18961.732c0c355509452ac6da.bundle.js} +2 -2
  6. package/dist/18961.732c0c355509452ac6da.bundle.js.map +1 -0
  7. package/dist/{20694.a738f5634ec09369dc85.bundle.js → 20694.03b5abf23347ae0bad65.bundle.js} +2 -2
  8. package/dist/20694.03b5abf23347ae0bad65.bundle.js.map +1 -0
  9. package/dist/21015.6db2b66597f78d4b83cc.bundle.js +2 -0
  10. package/dist/21015.6db2b66597f78d4b83cc.bundle.js.map +1 -0
  11. package/dist/2975.c5ebc3e3ad52df3ab907.bundle.js +2 -0
  12. package/dist/2975.c5ebc3e3ad52df3ab907.bundle.js.map +1 -0
  13. package/dist/{38644.37a8cd71112da94401d9.bundle.js → 38644.8585127c40697ea58e00.bundle.js} +2 -2
  14. package/dist/{38644.37a8cd71112da94401d9.bundle.js.map → 38644.8585127c40697ea58e00.bundle.js.map} +1 -1
  15. package/dist/{39518.2871b32c37b20075dba3.bundle.js → 39518.0acc5eb68f38cc6b62a5.bundle.js} +2 -2
  16. package/dist/{39518.2871b32c37b20075dba3.bundle.js.map → 39518.0acc5eb68f38cc6b62a5.bundle.js.map} +1 -1
  17. package/dist/39874.17dde6245fc4cc91bb58.bundle.js +2 -0
  18. package/dist/39874.17dde6245fc4cc91bb58.bundle.js.map +1 -0
  19. package/dist/{45758.1212136a37dd4f7528f8.bundle.js → 45758.b9ce5fe0ed6c8c4fc141.bundle.js} +2 -2
  20. package/dist/45758.b9ce5fe0ed6c8c4fc141.bundle.js.map +1 -0
  21. package/dist/60560.62ed0cb0b3d07fecbf28.bundle.js +2 -0
  22. package/dist/60560.62ed0cb0b3d07fecbf28.bundle.js.map +1 -0
  23. package/dist/{60730.35493812d428872eddb6.bundle.js → 60730.a9fc5342637039776562.bundle.js} +2 -2
  24. package/dist/60730.a9fc5342637039776562.bundle.js.map +1 -0
  25. package/dist/{64118.b06aebc9f8d7e822244f.bundle.js → 64118.177457589341de779668.bundle.js} +2 -2
  26. package/dist/64118.177457589341de779668.bundle.js.map +1 -0
  27. package/dist/{67888.b75d9678cf65cd82f065.bundle.js → 67888.0f7d008c6f62683e2c62.bundle.js} +2 -2
  28. package/dist/{67888.b75d9678cf65cd82f065.bundle.js.map → 67888.0f7d008c6f62683e2c62.bundle.js.map} +1 -1
  29. package/dist/71099.ba1073458b96d9789756.bundle.js +2 -0
  30. package/dist/71099.ba1073458b96d9789756.bundle.js.map +1 -0
  31. package/dist/75881.148ce498d06784abfd6c.bundle.js +2 -0
  32. package/dist/75881.148ce498d06784abfd6c.bundle.js.map +1 -0
  33. package/dist/78070.d54ede951a08e1c8689d.bundle.js +2 -0
  34. package/dist/78070.d54ede951a08e1c8689d.bundle.js.map +1 -0
  35. package/dist/7815.89cc59b6625e84913351.bundle.js +2 -0
  36. package/dist/7815.89cc59b6625e84913351.bundle.js.map +1 -0
  37. package/dist/78681.6c8614aad7e5465be505.bundle.js +2 -0
  38. package/dist/78681.6c8614aad7e5465be505.bundle.js.map +1 -0
  39. package/dist/{82206.229877d7931849236456.bundle.js → 82206.473f6d4f79e12f6a9da6.bundle.js} +2 -2
  40. package/dist/82206.473f6d4f79e12f6a9da6.bundle.js.map +1 -0
  41. package/dist/{82926.99231caacc379c66487a.bundle.js → 82926.7d300bdaae879f385185.bundle.js} +2 -2
  42. package/dist/{82926.99231caacc379c66487a.bundle.js.map → 82926.7d300bdaae879f385185.bundle.js.map} +1 -1
  43. package/dist/{94229.47dbdba202106c61dff1.bundle.js → 94229.5a853fae006f6ef633af.bundle.js} +2 -2
  44. package/dist/94229.5a853fae006f6ef633af.bundle.js.map +1 -0
  45. package/dist/95953.1350a9dc14b22372b4e2.bundle.js +2 -0
  46. package/dist/95953.1350a9dc14b22372b4e2.bundle.js.map +1 -0
  47. package/dist/98268.a1bd17e40ede031a0a00.bundle.js +2 -0
  48. package/dist/98268.a1bd17e40ede031a0a00.bundle.js.map +1 -0
  49. package/dist/{99448.272a4ba1ce8032167bea.bundle.js → 99448.147164e93b1ab3a87d36.bundle.js} +2 -2
  50. package/dist/{99448.272a4ba1ce8032167bea.bundle.js.map → 99448.147164e93b1ab3a87d36.bundle.js.map} +1 -1
  51. package/dist/api/models/cookie/cookie-options.d.ts +17 -0
  52. package/dist/api/models/cookie/index.d.ts +1 -1
  53. package/dist/api/models/security/authenticated-user.d.ts +2 -0
  54. package/dist/api/models/tracking/cookie-consent.d.ts +39 -0
  55. package/dist/api/models/tracking/index.d.ts +1 -0
  56. package/dist/api/models/users/app-settings.d.ts +2 -2
  57. package/dist/api/ontotext-workbench-api.d.ts +3 -1
  58. package/dist/api/ontotext-workbench-api.js +1 -1
  59. package/dist/api/ontotext-workbench-api.js.map +1 -1
  60. package/dist/api/services/cookie/browser-cookie-store.d.ts +19 -0
  61. package/dist/api/services/cookie/cookie-builder.d.ts +77 -0
  62. package/dist/api/services/cookie/cookie-store.d.ts +16 -0
  63. package/dist/api/services/cookie/cookie.service.d.ts +34 -7
  64. package/dist/api/services/cookie/error/invalid-cookie-expiration.d.ts +8 -0
  65. package/dist/api/services/cookie/index.d.ts +3 -0
  66. package/dist/api/services/cookie/test/cookie-builder.spec.d.ts +1 -0
  67. package/dist/api/services/cookie/test/in-memory-cookie-store.d.ts +11 -0
  68. package/dist/api/services/security/auth-strategies/tests/provider-response-mocks.d.ts +2 -2
  69. package/dist/api/services/security/security-context.service.d.ts +6 -0
  70. package/dist/api/services/tracking/google-analytics-cookie.service.d.ts +50 -0
  71. package/dist/api/services/tracking/index.d.ts +4 -0
  72. package/dist/api/services/tracking/installation-cookie.service.d.ts +37 -0
  73. package/dist/api/services/tracking/test/tracking-storage.service.spec.d.ts +1 -0
  74. package/dist/api/services/tracking/test/tracking.service.spec.d.ts +1 -0
  75. package/dist/api/services/tracking/tracking-storage.service.d.ts +27 -0
  76. package/dist/api/services/tracking/tracking.service.d.ts +56 -0
  77. package/dist/api/services/users/response/user-response.d.ts +1 -1
  78. package/dist/api/services/utils/date-util.d.ts +11 -0
  79. package/dist/api/services/utils/index.d.ts +1 -0
  80. package/dist/api/services/window/window.service.d.ts +6 -0
  81. package/dist/assets/i18n/fr.json +1 -1
  82. package/dist/index.html +9 -9
  83. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  84. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  85. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  86. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  87. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  88. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  89. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
  90. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  91. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  92. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  93. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  94. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  95. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  96. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  97. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  98. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  99. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  100. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  101. package/dist/js/angular/security/templates/user.html +5 -2
  102. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  103. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  104. package/dist/js/angular/ttyg/templates/chat-item-detail.html +3 -2
  105. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  106. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  107. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  108. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  109. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  110. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  111. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  112. package/dist/legacyWorkbench.f1ed8e359786e8adeab2.js +3 -0
  113. package/dist/{legacyWorkbench.88e1d4d209e51c6f9b65.js.map → legacyWorkbench.f1ed8e359786e8adeab2.js.map} +1 -1
  114. package/dist/license-checker-static.json +0 -7
  115. package/dist/main.a67c284710a8b9a98ca2.js +3 -0
  116. package/dist/main.a67c284710a8b9a98ca2.js.map +1 -0
  117. package/dist/pages/aclmanagement.html +1 -1
  118. package/dist/pages/autocomplete.html +1 -1
  119. package/dist/pages/choose-repository-type.html +1 -1
  120. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  121. package/dist/pages/create-index.html +1 -1
  122. package/dist/pages/dependencies.html +1 -1
  123. package/dist/pages/domainRangeInfo.html +2 -2
  124. package/dist/pages/edit.html +1 -1
  125. package/dist/pages/explore.html +1 -1
  126. package/dist/pages/export.html +1 -1
  127. package/dist/pages/find.html +1 -1
  128. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  129. package/dist/pages/graphs-visualizations.html +7 -7
  130. package/dist/pages/guides.html +1 -1
  131. package/dist/pages/home.html +1 -1
  132. package/dist/pages/import.html +2 -2
  133. package/dist/pages/jdbc-create.html +1 -1
  134. package/dist/pages/jdbc.html +1 -1
  135. package/dist/pages/monitor/backup-and-restore.html +1 -1
  136. package/dist/pages/monitor/queries.html +1 -1
  137. package/dist/pages/monitor/resources.html +1 -1
  138. package/dist/pages/namespaces.html +2 -2
  139. package/dist/pages/plugins.html +1 -1
  140. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  141. package/dist/pages/rdfrank.html +2 -2
  142. package/dist/pages/repositories.html +1 -1
  143. package/dist/pages/repository.html +1 -1
  144. package/dist/pages/similarity-indexes.html +1 -1
  145. package/dist/pages/sparql-editor.html +1 -1
  146. package/dist/pages/sparql-template-create.html +1 -1
  147. package/dist/pages/sparql-templates.html +1 -1
  148. package/dist/pages/ux-test1.html +2 -2
  149. package/dist/pages/webapi.html +4 -3
  150. package/dist/res/swagger5/index.html +11 -11
  151. package/dist/res/swagger5/swagger-initializer.js +1 -1
  152. package/dist/shared-components/cjs/function-utils-WB47AWpR.js +1 -0
  153. package/dist/shared-components/cjs/index-CTK5NoJt.js +2 -0
  154. package/dist/shared-components/cjs/loader.cjs.js +1 -1
  155. package/dist/shared-components/cjs/onto-cookie-consent_2.cjs.entry.js +1 -1
  156. package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
  157. package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
  158. package/dist/shared-components/cjs/onto-footer_5.cjs.entry.js +1 -1
  159. package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
  160. package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
  161. package/dist/shared-components/cjs/onto-permission-banner.cjs.entry.js +1 -1
  162. package/dist/shared-components/cjs/onto-test-context.cjs.entry.js +1 -1
  163. package/dist/shared-components/cjs/onto-toastr.cjs.entry.js +1 -1
  164. package/dist/shared-components/cjs/shared-components.cjs.js +1 -1
  165. package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
  166. package/dist/shared-components/collection/collection-manifest.json +2 -2
  167. package/dist/shared-components/collection/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.js +1 -1
  168. package/dist/shared-components/collection/components/dialogs/onto-dialog.js +1 -1
  169. package/dist/shared-components/collection/components/onto-cookie-consent/onto-cookie-consent.css +1 -1
  170. package/dist/shared-components/collection/components/onto-cookie-consent/onto-cookie-consent.js +1 -1
  171. package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
  172. package/dist/shared-components/collection/components/onto-footer/onto-footer.js +1 -1
  173. package/dist/shared-components/collection/components/onto-language-selector/onto-language-selector.js +1 -1
  174. package/dist/shared-components/collection/components/onto-license-alert/onto-license-alert.js +1 -1
  175. package/dist/shared-components/collection/components/onto-loader/onto-loader.js +1 -1
  176. package/dist/shared-components/collection/components/onto-navbar/onto-navbar.js +1 -1
  177. package/dist/shared-components/collection/components/onto-operations-notification/onto-operations-notification.js +1 -1
  178. package/dist/shared-components/collection/components/onto-repository-selector/onto-repository-selector.js +1 -1
  179. package/dist/shared-components/collection/components/onto-search-resource-input/onto-search-resource-input.js +1 -1
  180. package/dist/shared-components/collection/components/onto-test-context/onto-test-context.js +1 -1
  181. package/dist/shared-components/collection/components/onto-toggle-switch/onto-toggle-switch.js +1 -1
  182. package/dist/shared-components/collection/components/onto-user-menu/onto-user-menu.js +1 -1
  183. package/dist/shared-components/collection/components/translate-label/translate-label.js +1 -1
  184. package/dist/shared-components/esm/function-utils-D1ZpXQQS.js +1 -0
  185. package/dist/shared-components/esm/index-EiAqSNMq.js +2 -0
  186. package/dist/shared-components/esm/loader.js +1 -1
  187. package/dist/shared-components/esm/onto-cookie-consent_2.entry.js +1 -1
  188. package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
  189. package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
  190. package/dist/shared-components/esm/onto-footer_5.entry.js +1 -1
  191. package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
  192. package/dist/shared-components/esm/onto-layout.entry.js +1 -1
  193. package/dist/shared-components/esm/onto-permission-banner.entry.js +1 -1
  194. package/dist/shared-components/esm/onto-test-context.entry.js +1 -1
  195. package/dist/shared-components/esm/onto-toastr.entry.js +1 -1
  196. package/dist/shared-components/esm/shared-components.js +1 -1
  197. package/dist/shared-components/esm/translate-label.entry.js +1 -1
  198. package/dist/shared-components/shared-components/p-1103d100.entry.js +1 -0
  199. package/dist/shared-components/shared-components/{p-9b2c6e80.entry.js → p-2e2bb175.entry.js} +1 -1
  200. package/dist/shared-components/shared-components/{p-b754971e.entry.js → p-50735428.entry.js} +1 -1
  201. package/dist/shared-components/shared-components/{p-7e47d850.entry.js → p-59707503.entry.js} +1 -1
  202. package/dist/shared-components/shared-components/p-6a37f808.entry.js +1 -0
  203. package/dist/shared-components/shared-components/{p-9214bb16.entry.js → p-6fb5eec5.entry.js} +1 -1
  204. package/dist/shared-components/shared-components/{p-c27fe716.entry.js → p-97930684.entry.js} +1 -1
  205. package/dist/shared-components/shared-components/p-D1ZpXQQS.js +1 -0
  206. package/dist/shared-components/shared-components/p-EiAqSNMq.js +2 -0
  207. package/dist/shared-components/shared-components/p-a5a49d87.entry.js +1 -0
  208. package/dist/shared-components/shared-components/p-d134e207.entry.js +1 -0
  209. package/dist/shared-components/shared-components/{p-279a026b.entry.js → p-ec2f4ea5.entry.js} +1 -1
  210. package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
  211. package/dist/shared-components/types/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.d.ts +31 -7
  212. package/dist/shared-components/types/components/onto-cookie-consent/onto-cookie-consent.d.ts +2 -2
  213. package/dist/shared-components/types/components/onto-footer/onto-footer.d.ts +9 -2
  214. package/dist/shared-components/types/components.d.ts +17 -8
  215. package/dist/shared-components/types/models/dialog/dialog-handler.d.ts +4 -0
  216. package/dist/shared-components/types/stencil-public-runtime.d.ts +10 -147
  217. package/package.json +1 -1
  218. package/dist/10759.b2e1d643d681ebd9c124.bundle.js.map +0 -1
  219. package/dist/13231.9b625e487e6385faa36f.bundle.js +0 -2
  220. package/dist/13231.9b625e487e6385faa36f.bundle.js.map +0 -1
  221. package/dist/18961.01ff5fcc0f4b9f99236e.bundle.js.map +0 -1
  222. package/dist/20694.a738f5634ec09369dc85.bundle.js.map +0 -1
  223. package/dist/21015.68c7c667ef64ad8e8e0d.bundle.js +0 -2
  224. package/dist/21015.68c7c667ef64ad8e8e0d.bundle.js.map +0 -1
  225. package/dist/2975.8be1a79816fd811be223.bundle.js +0 -2
  226. package/dist/2975.8be1a79816fd811be223.bundle.js.map +0 -1
  227. package/dist/39874.47a6948df3520a7bf37a.bundle.js +0 -2
  228. package/dist/39874.47a6948df3520a7bf37a.bundle.js.map +0 -1
  229. package/dist/45758.1212136a37dd4f7528f8.bundle.js.map +0 -1
  230. package/dist/60560.275a89ab1375e91de0aa.bundle.js +0 -2
  231. package/dist/60560.275a89ab1375e91de0aa.bundle.js.map +0 -1
  232. package/dist/60730.35493812d428872eddb6.bundle.js.map +0 -1
  233. package/dist/64118.b06aebc9f8d7e822244f.bundle.js.map +0 -1
  234. package/dist/71099.ca7720893604e9d908d6.bundle.js +0 -2
  235. package/dist/71099.ca7720893604e9d908d6.bundle.js.map +0 -1
  236. package/dist/75881.54dc716f79b6fe29232a.bundle.js +0 -2
  237. package/dist/75881.54dc716f79b6fe29232a.bundle.js.map +0 -1
  238. package/dist/78070.13538271878de6a98862.bundle.js +0 -2
  239. package/dist/78070.13538271878de6a98862.bundle.js.map +0 -1
  240. package/dist/7815.f09f8d6953d2c964e04d.bundle.js +0 -2
  241. package/dist/7815.f09f8d6953d2c964e04d.bundle.js.map +0 -1
  242. package/dist/78681.0cfa1e86d4dac1b7e7e8.bundle.js +0 -2
  243. package/dist/78681.0cfa1e86d4dac1b7e7e8.bundle.js.map +0 -1
  244. package/dist/82206.229877d7931849236456.bundle.js.map +0 -1
  245. package/dist/94229.47dbdba202106c61dff1.bundle.js.map +0 -1
  246. package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js +0 -2
  247. package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js.map +0 -1
  248. package/dist/98268.86ff371dde616b4e2a76.bundle.js +0 -2
  249. package/dist/98268.86ff371dde616b4e2a76.bundle.js.map +0 -1
  250. package/dist/api/models/cookie/cookie-consent.d.ts +0 -14
  251. package/dist/legacyWorkbench.88e1d4d209e51c6f9b65.js +0 -3
  252. package/dist/main.1be0fc11ab24b99f8800.js +0 -3
  253. package/dist/main.1be0fc11ab24b99f8800.js.map +0 -1
  254. package/dist/shared-components/cjs/app-globals-V2Kpy_OQ.js +0 -1
  255. package/dist/shared-components/cjs/index-L_ZmIeD5.js +0 -2
  256. package/dist/shared-components/collection/models/dialog/onto-dialog.js +0 -1
  257. package/dist/shared-components/esm/app-globals-DQuL1Twl.js +0 -1
  258. package/dist/shared-components/esm/index-CGqARDX4.js +0 -2
  259. package/dist/shared-components/shared-components/p-2075209c.entry.js +0 -1
  260. package/dist/shared-components/shared-components/p-30e4880f.entry.js +0 -1
  261. package/dist/shared-components/shared-components/p-413b3789.entry.js +0 -1
  262. package/dist/shared-components/shared-components/p-67199a46.entry.js +0 -1
  263. package/dist/shared-components/shared-components/p-CGqARDX4.js +0 -2
  264. package/dist/shared-components/shared-components/p-DQuL1Twl.js +0 -1
  265. package/dist/shared-components/types/models/dialog/onto-dialog.d.ts +0 -4
  266. /package/dist/{legacyWorkbench.88e1d4d209e51c6f9b65.js.LICENSE.txt → legacyWorkbench.f1ed8e359786e8adeab2.js.LICENSE.txt} +0 -0
  267. /package/dist/{main.1be0fc11ab24b99f8800.js.LICENSE.txt → main.a67c284710a8b9a98ca2.js.LICENSE.txt} +0 -0
  268. /package/dist/shared-components/cjs/{index-L_ZmIeD5.js.LICENSE.txt → index-CTK5NoJt.js.LICENSE.txt} +0 -0
  269. /package/dist/shared-components/esm/{index-CGqARDX4.js.LICENSE.txt → index-EiAqSNMq.js.LICENSE.txt} +0 -0
  270. /package/dist/shared-components/shared-components/{p-CGqARDX4.js.LICENSE.txt → p-EiAqSNMq.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=60560;export const __webpack_esm_ids__=[60560];export const __webpack_esm_modules__={60560(e,a,t){t.r(a),t.d(a,{onto_cookie_consent:()=>n,onto_cookie_policy_dialog:()=>s});var o=t(55508),c=t(79939),i=t(57154);const n=class{constructor(e){(0,o.r)(this,e),this.consentGiven=(0,o.c)(this,"consentGiven"),this.showModal=!1,this.openModal=e=>{e.preventDefault(),this.showModal=!0},this.handleConsentClick=()=>{this.consentGiven.emit()}}onDialogClose(){this.showModal=!1}render(){return(0,o.h)(o.a,{key:"dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d"},(0,o.h)("div",{key:"414c970a3a4b263e8f3f5d066dc8bb22b8194c48",class:"cookie-consent-modal"},(0,o.h)("section",{key:"6a1cccadb167b301738fb6a453b7d300e93ba18b",class:"cookie-consent-content"},(0,o.h)("span",{key:"aa62410b522125feeb48eaa568a78c761e6b9596"},(0,o.h)("translate-label",{key:"0696068c1aa8738bb3ddf0e548d9140ba12609e1",labelKey:"cookie.cookie_consent"}),(0,o.h)("a",{key:"efd9792a6a424b86606b3904615c53f19a2cdb6e",id:"cookie-policy-link",href:"#",onClick:this.openModal,class:"btn btn-link p-0"},(0,o.h)("translate-label",{key:"12e95d1446f81b47c973e285ee71da5fbfa4934f",labelKey:"cookie.cookie_policy_url_label"})),"."),(0,o.h)("button",{key:"a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0",id:"accept-cookie-policy",class:"onto-btn onto-btn-primary",onClick:this.handleConsentClick},(0,o.h)("translate-label",{key:"5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a",labelKey:"common.button.ok"})))),this.showModal&&(0,o.h)("onto-cookie-policy-dialog",{key:"e54d3f134771ff5f59a288d0d6c9949c6f59567f",dialogHandler:this}))}};var l;n.style=".cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:var(--gw-dialog-background);box-shadow:0 -2px 10px rgba(0, 0, 0, 0.1);padding:20px;z-index:1050;width:100%}.cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-content button{margin-left:12px}.cookie-policy-modal{padding:24px 40px;overflow-y:auto}.cookie-policy-modal .modal-dialog{width:60% !important;max-width:60% !important}.cookie-policy-modal .title{font-size:xx-large;font-weight:bolder}.cookie-policy-modal .heading{font-size:x-large;font-weight:bolder;margin-top:12px}.cookie-policy-modal .subheading{font-size:large;font-weight:bolder;margin-top:8px}.cookie-policy-modal .text{font-size:math}",function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(l||(l={}));const s=class{constructor(e){(0,o.r)(this,e),this.logger=c.L.logger,this.user=i.ServiceProvider.get(i.SecurityContextService).getAuthenticatedUser(),this.securityService=i.ServiceProvider.get(i.SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateAuthenticatedUser(this.user.toUser()).catch(this.logger.error)}render(){var e,a;const t={dialogTitle:c.T.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},n=new i.CookieConsent(null===(a=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return(0,o.h)("onto-dialog",{key:"c76529daf7d24ad06970ba3b8e7f87446daeec37",config:t},(0,o.h)("div",{key:"412c71cf9a3b8e094962a4e4299679f16394869a",slot:"body"},(0,o.h)("section",{key:"0d730d3c02ab298d66de7ab56100bc1f13d989c6"},(0,o.h)("h4",{key:"4cbcc42d566ebf8e4c7507df9b367e9caa847565"},(0,o.h)("translate-label",{key:"ceed3f8d2aa7de9b614af25c6c4cb66ac1d74869",labelKey:"cookie.policy.purpose_heading"})),(0,o.h)("p",{key:"f9a72d8c3fbc9a04ea488e6045e6d8d74d8e7265"},(0,o.h)("translate-label",{key:"046cacb46e54bc228dcb7bf3a692f9fb28798de5",labelKey:"cookie.policy.purpose_text"})),(0,o.h)("p",{key:"70bbd5c2f6d30771477b3ee6e822a8def976e050"},(0,o.h)("translate-label",{key:"cc95a3b4ea1292ea33226bfb27db8fdc8a03969a",labelKey:"cookie.policy.purpose_enterprise_text"}))),(0,o.h)("section",{key:"4340f499aaa0de9b0bd7a5b089efd93a66f864bd"},(0,o.h)("h4",{key:"c31244de543a54f52382d572c203f15c9f6bc61d"},(0,o.h)("translate-label",{key:"3193fab62ec3f9132793a3100600017c12606546",labelKey:"cookie.policy.privacy_commitment_heading"})),(0,o.h)("p",{key:"ba75b0d207a6e4423ad87317abdae05a386109cd"},(0,o.h)("translate-label",{key:"8362dabe248988373af6ffe8219ddd229b585d45",labelKey:"cookie.policy.privacy_commitment_text"})),(0,o.h)("ul",{key:"ac3a59a29d8ff17f59834734e10fa38c5891024e"},(0,o.h)("li",{key:"d8cda68c7424c76138f7da948cd522d4994cbd4f"},(0,o.h)("translate-label",{key:"9f10c3678b02c7153a3aef73e86d9fe6b4fd5557",labelKey:"cookie.policy.privacy_commitment_1"})),(0,o.h)("li",{key:"623c725c85c2706425b8f5f27750393c8b88a761"},(0,o.h)("translate-label",{key:"acdbad3cc0590aa0094ae6d0e0d5a00964291c41",labelKey:"cookie.policy.privacy_commitment_2"})))),(0,o.h)("section",{key:"aecf76c57fcfce12f1f67643a587f390b975eb95"},(0,o.h)("h4",{key:"5264365da2a50c4c24cb5a8d14dd039ff7c3f5de"},(0,o.h)("translate-label",{key:"c3b7711c0959ddcce90986b2dcc5e42e2aacedcb",labelKey:"cookie.policy.cookies_heading"})),(0,o.h)("p",{key:"92b79942b35a9e6224c95c0b955505a49cc67b00"},(0,o.h)("translate-label",{key:"86822629019ad073ef2d90899da1397a87d5796f",labelKey:"cookie.policy.cookies_text"}))),(0,o.h)("section",{key:"3ea0f6201a2d78b40045adb4aa26eb8baa382adc"},(0,o.h)("h4",{key:"b96b6a082351c803d229038c2ca7acc99294ab86"},(0,o.h)("translate-label",{key:"6aab9024ff0fd8734706bd7caec59335c3ddc7ac",labelKey:"cookie.policy.manage_cookies_heading"})),(0,o.h)("onto-toggle-switch",{key:"c97358e1147cbb36d950302ee2fc29733e088ef9",checked:null==n?void 0:n.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:l.STATISTIC}),(0,o.h)("p",{key:"e6172a9fb3b8e1b0ab10609b1ebda7fcf350e93b"},(0,o.h)("translate-label",{key:"701fb389671ed440a1080e6e76fd1344cb4e5b6e",labelKey:"cookie.policy.statistic_text"})),(0,o.h)("onto-toggle-switch",{key:"e36a2699b2140e33288dd2cac9702d8fca6784db",checked:null==n?void 0:n.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:l.THIRD_PARTY}),(0,o.h)("p",{key:"98cced78a81c9942b5f5169fee662c368192946e"},(0,o.h)("translate-label",{key:"df1ba989e1fc792fa9f56e4f9661fdb28fa55f90",labelKey:"cookie.policy.third_party_cookies_text"}))),(0,o.h)("p",{key:"a892129a7183dd84e10eb31cf5a6a1698b61b5d7"},(0,o.h)("span",{key:"c2b6a400347f2019c7647273c3d7029f0ad9b039"},(0,o.h)("translate-label",{key:"d43317f8f68615516c7a81e8aa787756bdec1205",labelKey:"cookie.policy.change_cookies"}),(0,o.h)("i",{key:"8f9efc29f7630c1d6e58fdf50241ff625fc8c7bf"}," ",(0,o.h)("translate-label",{key:"6c906a77d90237a17b5c3e1887c41b532830040d",labelKey:"menu.setup.label"})," > ",(0,o.h)("translate-label",{key:"75f59cf20cd4a1fbee4afb3388b5f341fd957613",labelKey:"menu.my.settings.label"})," > ",(0,o.h)("translate-label",{key:"352f8f0b324655e86bc9175e8c70567e34e68f2a",labelKey:"security.user.settings"})," > ",(0,o.h)("translate-label",{key:"0067f9f65859f946006115d1957337f42a805274",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new i.CookieConsent(null===(t=null===(a=this.user)||void 0===a?void 0:a.appSettings)||void 0===t?void 0:t.COOKIE_CONSENT);return o[e.context]=e.checked,o.updatedAt=(new Date).getTime(),o}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings=new i.AppSettings),this.user.appSettings.COOKIE_CONSENT=e}};s.style="section h4{font-size:x-large;font-weight:bolder;margin-top:12px}"},79939(e,a,t){t.d(a,{L:()=>i,T:()=>l,s:()=>c});var o=t(57154);function c(e){const a=document.createElement("textarea");return a.innerHTML=e,a.value}class i{static get logger(){return o.Loggers.getLoggerInstance("SharedComponents")}}class n{constructor(){this.languageContextService=o.ServiceProvider.get(o.LanguageContextService),this.translationChangedObservers={},this.logger=i.logger,this.defaultBundle=this.languageContextService.getDefaultBundle(),this.subscribeToBundleChange()}onTranslate(e,a=[],t=()=>{}){this.translationChangedObservers[e]=this.translationChangedObservers[e]||[];const o={parameters:a,callback:t};return this.translationChangedObservers[e].push(o),t(this.translate(e,a)),()=>{const a=this.translationChangedObservers[e].indexOf(o);-1!==a&&this.translationChangedObservers[e].splice(a,1)}}translate(e,a){return this.translateInLocale(e,a)}translateInLocale(e,a){let t=this.translateFromBundle(this.currentBundle,e);return t||(t=this.translateFromBundle(this.defaultBundle,e)),t?(t=this.applyParameters(t,a),c(t)):(this.logger.warn(`Missing translation for key: [${e}]`),e)}translateFromBundle(e,a){if(!e)return;let t=e[a];return"string"!=typeof t&&(t=this.translateAsJsonObject(e,a)),t}translateAsJsonObject(e,a){let t=a.split(".");return this.getTranslation(e,t)}getTranslation(e,a){if(!a||!e)return;const t=e[a.splice(0,1)[0]];return 0===a.length?t:"string"!=typeof t?a.length>0?this.getTranslation(t,a):t:void 0}applyParameters(e,a){return a?a.reduce((e,a)=>n.replaceAll(e,a),e):e}static replaceAll(e,a){return a?e.split(`{{${a.key}}}`).join(a.value):e}notifyTranslationsChanged(){Object.keys(this.translationChangedObservers).forEach(e=>{(this.translationChangedObservers[e]||[]).forEach(a=>a.callback(this.translate(e,a.parameters)))})}subscribeToBundleChange(){this.languageChangeSubscription=this.languageContextService.onLanguageBundleChanged(e=>{e&&(this.currentBundle=e,this.notifyTranslationsChanged())})}destroy(){this.languageChangeSubscription&&this.languageChangeSubscription()}}const l=new n}};
2
- //# sourceMappingURL=60560.275a89ab1375e91de0aa.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"60560.275a89ab1375e91de0aa.bundle.js","mappings":"iPAIA,MAEMA,EAAoB,MACtBC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBC,KAAMF,GACvBE,KAAKC,cAAeC,EAAAA,EAAAA,GAAYF,KAAM,gBAEtCA,KAAKG,WAAY,EAKjBH,KAAKI,UAAaC,IACdA,EAAMC,iBACNN,KAAKG,WAAY,GAMrBH,KAAKO,mBAAqB,KACtBP,KAAKC,aAAaO,OAE1B,CAMAC,aAAAA,GACIT,KAAKG,WAAY,CACrB,CACAO,MAAAA,GACI,OAAQC,EAAAA,EAAAA,GAAEC,EAAAA,EAAM,CAAEC,IAAK,6CAA8CF,EAAAA,EAAAA,GAAE,MAAO,CAAEE,IAAK,2CAA4CC,MAAO,yBAA0BH,EAAAA,EAAAA,GAAE,UAAW,CAAEE,IAAK,2CAA4CC,MAAO,2BAA4BH,EAAAA,EAAAA,GAAE,OAAQ,CAAEE,IAAK,6CAA8CF,EAAAA,EAAAA,GAAE,kBAAmB,CAAEE,IAAK,2CAA4CE,SAAU,2BAA4BJ,EAAAA,EAAAA,GAAE,IAAK,CAAEE,IAAK,2CAA4CG,GAAI,qBAAsBC,KAAM,IAAKC,QAASlB,KAAKI,UAAWU,MAAO,qBAAsBH,EAAAA,EAAAA,GAAE,kBAAmB,CAAEE,IAAK,2CAA4CE,SAAU,oCAAsC,MAAMJ,EAAAA,EAAAA,GAAE,SAAU,CAAEE,IAAK,2CAA4CG,GAAI,uBAAwBF,MAAO,4BAA6BI,QAASlB,KAAKO,qBAAsBI,EAAAA,EAAAA,GAAE,kBAAmB,CAAEE,IAAK,2CAA4CE,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ByC,wBAAyBlB,IAC/EA,IACAlG,KAAK+F,cAAgBG,EACrBlG,KAAK8G,8BAGjB,CACAO,OAAAA,GACQrH,KAAKmH,4BACLnH,KAAKmH,4BAEb,EAEJ,MAAMvE,EAAqB,IAAI8B,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/onto-cookie-consent_2.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-nljGIprK.js"],"sourcesContent":["import { r as registerInstance, c as createEvent, h, a as Host } from './index-CGqARDX4.js';\nimport { L as LoggerProvider, T as TranslationService } from './translation.service-nljGIprK.js';\nimport { ServiceProvider, SecurityContextService, SecurityService, CookieConsent, AppSettings } from '@ontotext/workbench-api';\n\nconst ontoCookieConsentCss = () => `.cookie-consent-modal{position:fixed;bottom:0;left:0;right:0;background-color:var(--gw-dialog-background);box-shadow:0 -2px 10px rgba(0, 0, 0, 0.1);padding:20px;z-index:1050;width:100%}.cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-content button{margin-left:12px}.cookie-policy-modal{padding:24px 40px;overflow-y:auto}.cookie-policy-modal .modal-dialog{width:60% !important;max-width:60% !important}.cookie-policy-modal .title{font-size:xx-large;font-weight:bolder}.cookie-policy-modal .heading{font-size:x-large;font-weight:bolder;margin-top:12px}.cookie-policy-modal .subheading{font-size:large;font-weight:bolder;margin-top:8px}.cookie-policy-modal .text{font-size:math}`;\n\nconst OntoCookieConsent = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.consentGiven = createEvent(this, \"consentGiven\");\n /** State to control the visibility of the cookie policy modal */\n this.showModal = false;\n /**\n * Opens the cookie policy modal.\n * @param {Event} event - The event that triggered the modal opening.\n */\n this.openModal = (event) => {\n event.preventDefault();\n this.showModal = true;\n };\n /**\n * Handles the click event on the consent button.\n * Emits the consentGiven event.\n */\n this.handleConsentClick = () => {\n this.consentGiven.emit();\n };\n }\n /**\n * Closes the cookie policy dialog.\n * This method is called when the dialog is closed.\n */\n // eslint-disable-next-line @stencil-community/own-methods-must-be-private\n onDialogClose() {\n this.showModal = false;\n }\n render() {\n return (h(Host, { key: 'dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d' }, h(\"div\", { key: '414c970a3a4b263e8f3f5d066dc8bb22b8194c48', class: \"cookie-consent-modal\" }, h(\"section\", { key: '6a1cccadb167b301738fb6a453b7d300e93ba18b', class: \"cookie-consent-content\" }, h(\"span\", { key: 'aa62410b522125feeb48eaa568a78c761e6b9596' }, h(\"translate-label\", { key: '0696068c1aa8738bb3ddf0e548d9140ba12609e1', labelKey: 'cookie.cookie_consent' }), h(\"a\", { key: 'efd9792a6a424b86606b3904615c53f19a2cdb6e', id: \"cookie-policy-link\", href: \"#\", onClick: this.openModal, class: \"btn btn-link p-0\" }, h(\"translate-label\", { key: '12e95d1446f81b47c973e285ee71da5fbfa4934f', labelKey: 'cookie.cookie_policy_url_label' })), \".\"), h(\"button\", { key: 'a91e7d9e7eddef1b50d82570f4211a0e1e1ae7b0', id: \"accept-cookie-policy\", class: \"onto-btn onto-btn-primary\", onClick: this.handleConsentClick }, h(\"translate-label\", { key: '5ca81d4f299a7b7f13ed0f77ac7d1ceaeaad318a', labelKey: 'common.button.ok' })))), this.showModal && h(\"onto-cookie-policy-dialog\", { key: 'e54d3f134771ff5f59a288d0d6c9949c6f59567f', dialogHandler: this })));\n }\n};\nOntoCookieConsent.style = ontoCookieConsentCss();\n\nconst ontoCookiePolicyDialogCss = () => `section h4{font-size:x-large;font-weight:bolder;margin-top:12px}`;\n\nvar CookieType;\n(function (CookieType) {\n CookieType[\"THIRD_PARTY\"] = \"thirdParty\";\n CookieType[\"STATISTIC\"] = \"statistic\";\n})(CookieType || (CookieType = {}));\nconst OntoCookiePolicyDialog = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.logger = LoggerProvider.logger;\n this.user = ServiceProvider.get(SecurityContextService).getAuthenticatedUser();\n this.securityService = ServiceProvider.get(SecurityService);\n }\n toggleChanged(event) {\n this.setUserCookieConsent(this.updateCookieConsent(event.detail));\n this.securityService.updateAuthenticatedUser(this.user.toUser())\n .catch(this.logger.error);\n }\n render() {\n var _a, _b;\n const config = {\n dialogTitle: TranslationService.translate('cookie.policy.title'),\n onClose: () => this.dialogHandler.onDialogClose(),\n modalClass: 'cookie-policy-modal',\n };\n const cookieConsent = new CookieConsent((_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.appSettings) === null || _b === void 0 ? void 0 : _b.COOKIE_CONSENT);\n return (h(\"onto-dialog\", { key: 'c76529daf7d24ad06970ba3b8e7f87446daeec37', config: config }, h(\"div\", { key: '412c71cf9a3b8e094962a4e4299679f16394869a', slot: 'body' }, h(\"section\", { key: '0d730d3c02ab298d66de7ab56100bc1f13d989c6' }, h(\"h4\", { key: '4cbcc42d566ebf8e4c7507df9b367e9caa847565' }, h(\"translate-label\", { key: 'ceed3f8d2aa7de9b614af25c6c4cb66ac1d74869', labelKey: 'cookie.policy.purpose_heading' })), h(\"p\", { key: 'f9a72d8c3fbc9a04ea488e6045e6d8d74d8e7265' }, h(\"translate-label\", { key: '046cacb46e54bc228dcb7bf3a692f9fb28798de5', labelKey: 'cookie.policy.purpose_text' })), h(\"p\", { key: '70bbd5c2f6d30771477b3ee6e822a8def976e050' }, h(\"translate-label\", { key: 'cc95a3b4ea1292ea33226bfb27db8fdc8a03969a', labelKey: 'cookie.policy.purpose_enterprise_text' }))), h(\"section\", { key: '4340f499aaa0de9b0bd7a5b089efd93a66f864bd' }, h(\"h4\", { key: 'c31244de543a54f52382d572c203f15c9f6bc61d' }, h(\"translate-label\", { key: '3193fab62ec3f9132793a3100600017c12606546', labelKey: 'cookie.policy.privacy_commitment_heading' })), h(\"p\", { key: 'ba75b0d207a6e4423ad87317abdae05a386109cd' }, h(\"translate-label\", { key: '8362dabe248988373af6ffe8219ddd229b585d45', labelKey: 'cookie.policy.privacy_commitment_text' })), h(\"ul\", { key: 'ac3a59a29d8ff17f59834734e10fa38c5891024e' }, h(\"li\", { key: 'd8cda68c7424c76138f7da948cd522d4994cbd4f' }, h(\"translate-label\", { key: '9f10c3678b02c7153a3aef73e86d9fe6b4fd5557', labelKey: 'cookie.policy.privacy_commitment_1' })), h(\"li\", { key: '623c725c85c2706425b8f5f27750393c8b88a761' }, h(\"translate-label\", { key: 'acdbad3cc0590aa0094ae6d0e0d5a00964291c41', labelKey: 'cookie.policy.privacy_commitment_2' })))), h(\"section\", { key: 'aecf76c57fcfce12f1f67643a587f390b975eb95' }, h(\"h4\", { key: '5264365da2a50c4c24cb5a8d14dd039ff7c3f5de' }, h(\"translate-label\", { key: 'c3b7711c0959ddcce90986b2dcc5e42e2aacedcb', labelKey: 'cookie.policy.cookies_heading' })), h(\"p\", { key: '92b79942b35a9e6224c95c0b955505a49cc67b00' }, h(\"translate-label\", { key: '86822629019ad073ef2d90899da1397a87d5796f', labelKey: 'cookie.policy.cookies_text' }))), h(\"section\", { key: '3ea0f6201a2d78b40045adb4aa26eb8baa382adc' }, h(\"h4\", { key: 'b96b6a082351c803d229038c2ca7acc99294ab86' }, h(\"translate-label\", { key: '6aab9024ff0fd8734706bd7caec59335c3ddc7ac', labelKey: 'cookie.policy.manage_cookies_heading' })), h(\"onto-toggle-switch\", { key: 'c97358e1147cbb36d950302ee2fc29733e088ef9', checked: cookieConsent === null || cookieConsent === void 0 ? void 0 : cookieConsent.statistic, labelKey: 'cookie.policy.statistic_cookies', tooltipTranslationKey: 'cookie.policy.statistic_tooltip', context: CookieType.STATISTIC }), h(\"p\", { key: 'e6172a9fb3b8e1b0ab10609b1ebda7fcf350e93b' }, h(\"translate-label\", { key: '701fb389671ed440a1080e6e76fd1344cb4e5b6e', labelKey: 'cookie.policy.statistic_text' })), h(\"onto-toggle-switch\", { key: 'e36a2699b2140e33288dd2cac9702d8fca6784db', checked: cookieConsent === null || cookieConsent === void 0 ? void 0 : cookieConsent.thirdParty, labelKey: 'cookie.policy.third_party_cookies', tooltipTranslationKey: 'cookie.policy.third_party_tooltip', context: CookieType.THIRD_PARTY }), h(\"p\", { key: '98cced78a81c9942b5f5169fee662c368192946e' }, h(\"translate-label\", { key: 'df1ba989e1fc792fa9f56e4f9661fdb28fa55f90', labelKey: 'cookie.policy.third_party_cookies_text' }))), h(\"p\", { key: 'a892129a7183dd84e10eb31cf5a6a1698b61b5d7' }, h(\"span\", { key: 'c2b6a400347f2019c7647273c3d7029f0ad9b039' }, h(\"translate-label\", { key: 'd43317f8f68615516c7a81e8aa787756bdec1205', labelKey: 'cookie.policy.change_cookies' }), h(\"i\", { key: '8f9efc29f7630c1d6e58fdf50241ff625fc8c7bf' }, \"\\u00A0\", h(\"translate-label\", { key: '6c906a77d90237a17b5c3e1887c41b532830040d', labelKey: 'menu.setup.label' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: '75f59cf20cd4a1fbee4afb3388b5f341fd957613', labelKey: 'menu.my.settings.label' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: '352f8f0b324655e86bc9175e8c70567e34e68f2a', labelKey: 'security.user.settings' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: '0067f9f65859f946006115d1957337f42a805274', labelKey: 'cookie.policy.change_cookies_location4' }), \"\\u00A0\"))))));\n }\n updateCookieConsent(payload) {\n var _a, _b;\n const cookieConsent = new CookieConsent((_b = (_a = this.user) === null || _a === void 0 ? void 0 : _a.appSettings) === null || _b === void 0 ? void 0 : _b.COOKIE_CONSENT);\n // Context is either 'thirdParty' or 'statistic'\n cookieConsent[payload.context] = payload.checked;\n cookieConsent.updatedAt = new Date().getTime();\n return cookieConsent;\n }\n setUserCookieConsent(cookieConsent) {\n if (!this.user.appSettings) {\n this.user.appSettings = new AppSettings();\n }\n this.user.appSettings.COOKIE_CONSENT = cookieConsent;\n }\n};\nOntoCookiePolicyDialog.style = ontoCookiePolicyDialogCss();\n\nexport { OntoCookieConsent as onto_cookie_consent, OntoCookiePolicyDialog as onto_cookie_policy_dialog };\n","import { Loggers, ServiceProvider, LanguageContextService } from '@ontotext/workbench-api';\n\nfunction sanitizeHTML(html) {\n const element = document.createElement('textarea');\n element.innerHTML = html;\n return element.value;\n}\n\nconst MODULE_NAME = 'SharedComponents';\n/**\n * Logger for the Shared Components module.\n */\nclass LoggerProvider {\n /**\n * Gets the logger instance for the Shared Components module.\n *\n * @returns LoggerService instance for the Shared Components module\n */\n static get logger() {\n return Loggers.getLoggerInstance(MODULE_NAME);\n }\n}\n\n/**\n * Service responsible for translation operations in the component.\n */\nclass TranslationServiceClassDefinition {\n constructor() {\n this.languageContextService = ServiceProvider.get(LanguageContextService);\n this.translationChangedObservers = {};\n this.logger = LoggerProvider.logger;\n // log with background color\n this.defaultBundle = this.languageContextService.getDefaultBundle();\n this.subscribeToBundleChange();\n }\n /**\n * Translates the <code>messageLabelKey</code> with <code>translationParameter</code> and call <code>translationCallback</code> with translation of current language.\n * The <code>translationCallback</code> is called upon subscription and whenever the selected language is changed.\n *\n * @param messageLabelKey - The label key for the translation.\n * @param translationParameter - Parameters, if needed, for translation.\n * @param translationCallback - A function to be called when translating the `messageLabelKey`.\n * @returns A function that, when called, unsubscribes the provided callback from further translation updates.\n */\n onTranslate(messageLabelKey, translationParameter = [], translationCallback = () => { }) {\n this.translationChangedObservers[messageLabelKey] = this.translationChangedObservers[messageLabelKey] || [];\n const observer = { parameters: translationParameter, callback: translationCallback };\n this.translationChangedObservers[messageLabelKey].push(observer);\n translationCallback(this.translate(messageLabelKey, translationParameter));\n return () => {\n const index = this.translationChangedObservers[messageLabelKey].indexOf(observer);\n if (index !== -1) {\n this.translationChangedObservers[messageLabelKey].splice(index, 1);\n }\n };\n }\n /**\n * Translates the provided key using the currently selected language by applying the parameters if\n * provided.\n * @param key The key for the label which needs to be translated.\n * @param parameters Optional parameters which to be applied during the translation.\n */\n translate(key, parameters) {\n return this.translateInLocale(key, parameters);\n }\n /**\n * Translates a given key into the specified locale. If parameters are provided,\n * they will be applied to the translation.\n *\n * @param key - The translation key, which can be dot-separated for nested translations.\n * @param parameters - Optional parameters to be substituted into the translation string.\n * @returns The translated string with parameters applied if available, or the key itself if not found.\n */\n translateInLocale(key, parameters) {\n // Attempt to retrieve the translation from the specified locale's bundle.\n let translation = this.translateFromBundle(this.currentBundle, key);\n // If not found, fall back to the default language bundle.\n if (!translation) {\n translation = this.translateFromBundle(this.defaultBundle, key);\n }\n // If translation was found, apply any parameters provided and return the result.\n if (translation) {\n translation = this.applyParameters(translation, parameters);\n return sanitizeHTML(translation);\n }\n this.logger.warn(`Missing translation for key: [${key}]`);\n return key;\n }\n /**\n * Retrieves a translation from a specified translation bundle using the given key.\n * If the key represents a nested JSON path, it attempts to resolve the key as such.\n *\n * @param bundle - The translation bundle for the specified locale.\n * @param key - The key to translate, which may be a simple key or dot-separated for nested keys.\n * @returns The translation string if found, or `undefined` if not available.\n */\n translateFromBundle(bundle, key) {\n if (!bundle) {\n return undefined;\n }\n // Try to retrieve the translation directly if it is defined as a whole string,\n // for instance as \"some_function.btn.label\".\n let translation = bundle[key];\n // If not found, attempt to retrieve the translation if it is defined as a JSON object.\n if (typeof translation !== 'string') {\n translation = this.translateAsJsonObject(bundle, key);\n }\n return translation;\n }\n /**\n * Resolves a nested translation key by treating it as a path in a JSON object.\n * For example, if the key is \"some.key.path\", this method will navigate through\n * the JSON object structure to retrieve the value at that path.\n *\n * @param bundle - The translation bundle containing nested keys.\n * @param key - The dot-separated key representing the path to the translation.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n translateAsJsonObject(bundle, key) {\n let path = key.split('.');\n return this.getTranslation(bundle, path);\n }\n /**\n * Recursively navigates through a JSON object based on a path array to retrieve\n * a translation string. Each element in the path array represents a nested key.\n *\n * @param jsonObject - The current JSON object or nested object being searched.\n * @param path - An array representing the path to the translation, where each element is a key.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n getTranslation(jsonObject, path) {\n // Stop the recursion if path or reach the inner element\n if (!path || !jsonObject) {\n return undefined;\n }\n const jsonOrTranslation = jsonObject[path.splice(0, 1)[0]];\n if (path.length === 0) {\n return jsonOrTranslation;\n }\n if (typeof jsonOrTranslation !== 'string') {\n // continue if the inner element is not reached.\n if (path.length > 0) {\n return this.getTranslation(jsonOrTranslation, path);\n }\n return jsonOrTranslation;\n }\n return undefined;\n }\n applyParameters(translation, parameters) {\n if (parameters) {\n return parameters.reduce(\n // replace all occurrence of parameter key with parameter value.\n (translation, parameter) => TranslationServiceClassDefinition.replaceAll(translation, parameter), translation);\n }\n return translation;\n }\n static replaceAll(translation, parameter) {\n return parameter ? translation.split(`{{${parameter.key}}}`).join(parameter.value) : translation;\n }\n notifyTranslationsChanged() {\n Object.keys(this.translationChangedObservers).forEach((eventName) => {\n const observers = this.translationChangedObservers[eventName] || [];\n observers.forEach((observer) => observer.callback(this.translate(eventName, observer.parameters)));\n });\n }\n subscribeToBundleChange() {\n this.languageChangeSubscription = this.languageContextService.onLanguageBundleChanged((bundle) => {\n if (bundle) {\n this.currentBundle = bundle;\n this.notifyTranslationsChanged();\n }\n });\n }\n destroy() {\n if (this.languageChangeSubscription) {\n this.languageChangeSubscription();\n }\n }\n}\nconst TranslationService = new TranslationServiceClassDefinition();\n\nexport { LoggerProvider as L, TranslationService as T, sanitizeHTML as s };\n"],"names":["OntoCookieConsent","constructor","hostRef","registerInstance","this","consentGiven","createEvent","showModal","openModal","event","preventDefault","handleConsentClick","emit","onDialogClose","render","h","Host","key","class","labelKey","id","href","onClick","dialogHandler","CookieType","style","OntoCookiePolicyDialog","logger","LoggerProvider","user","ServiceProvider","get","SecurityContextService","getAuthenticatedUser","securityService","SecurityService","toggleChanged","setUserCookieConsent","updateCookieConsent","detail","updateAuthenticatedUser","toUser","catch","error","_a","_b","config","dialogTitle","TranslationService","translate","onClose","modalClass","cookieConsent","CookieConsent","appSettings","COOKIE_CONSENT","slot","checked","statistic","tooltipTranslationKey","context","STATISTIC","thirdParty","THIRD_PARTY","payload","updatedAt","Date","getTime","AppSettings","sanitizeHTML","html","element","document","createElement","innerHTML","value","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","onTranslate","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","index","indexOf","splice","translateInLocale","translation","translateFromBundle","currentBundle","applyParameters","warn","bundle","translateAsJsonObject","path","split","getTranslation","jsonObject","jsonOrTranslation","length","reduce","parameter","replaceAll","join","notifyTranslationsChanged","Object","keys","forEach","eventName","languageChangeSubscription","onLanguageBundleChanged","destroy"],"ignoreList":[],"sourceRoot":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"60730.35493812d428872eddb6.bundle.js","mappings":"8LAEA,MAEMA,EAAuB,MACzBC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBC,KAAMF,EAC3B,CACAG,MAAAA,GACI,OAAQC,EAAAA,EAAAA,GAAEC,EAAAA,EAAM,CAAEC,IAAK,2CAA4CC,MAAO,sBAAuBH,EAAAA,EAAAA,GAAE,IAAK,CAAEE,IAAK,2CAA4CC,MAAO,2DAA4DH,EAAAA,EAAAA,GAAE,MAAO,CAAEE,IAAK,2CAA4CC,MAAO,mBAAoBH,EAAAA,EAAAA,GAAE,MAAO,CAAEE,IAAK,2CAA4CC,MAAO,oBAAqBH,EAAAA,EAAAA,GAAE,kBAAmB,CAAEE,IAAK,2CAA4CE,SAAU,uCAAwCJ,EAAAA,EAAAA,GAAE,kBAAmB,CAAEE,IAAK,2CAA4CE,SAAU,oDAC7lB,GAEJV,EAAqBW,MAViB,uV","sources":["webpack://root-config/./packages/shared-components/dist/esm/onto-permission-banner.entry.js"],"sourcesContent":["import { r as registerInstance, h, a as Host } from './index-CGqARDX4.js';\n\nconst ontoPermissionBannerCss = () => `:host{display:block}.permission-banner{margin:0 1rem}.permission-banner-content{display:flex;align-items:center;margin:1rem;padding:0 2rem 3rem 2rem}.label-container{display:flex;flex-direction:column;margin-left:1rem}.icon-warning::before{font-family:\"icomoon\", sans-serif;content:\"\\\\e920\";display:block;font-size:1.5em;pointer-events:none}`;\n\nconst OntoPermissionBanner = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n }\n render() {\n return (h(Host, { key: '9119b184de876a5409f0f5335b644fb4e2325a0f', class: \"permission-banner\" }, h(\"p\", { key: '1b54e279971683070fdb30b923e4943827be42a4', class: \"permission-banner-content onto-alert onto-alert-danger\" }, h(\"div\", { key: 'eaf0e5a1e4803c2aaf039ff34f83137429646fec', class: \"ri-alert-line\" }), h(\"div\", { key: '1b77e50106a3f09621328ce78d92194dfe6a3509', class: \"label-container\" }, h(\"translate-label\", { key: '1aeefa5016d3c4dc3494433f5a9e9f17851c6c52', labelKey: 'permission_banner.no_access_error' }), h(\"translate-label\", { key: '68f57ed9009c2c89056ef763ece875eeeb927e35', labelKey: 'permission_banner.change_menu_or_user_warning' })))));\n }\n};\nOntoPermissionBanner.style = ontoPermissionBannerCss();\n\nexport { OntoPermissionBanner as onto_permission_banner };\n"],"names":["OntoPermissionBanner","constructor","hostRef","registerInstance","this","render","h","Host","key","class","labelKey","style"],"ignoreList":[],"sourceRoot":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"64118.b06aebc9f8d7e822244f.bundle.js","mappings":"+NAKA,MAAMA,EAAgC,CAClCC,YAAa,4DAGXC,EAASC,EAAAA,EAAeD,OAa9B,SAASE,EAAgBC,GACrB,MAAMC,GAAmBC,EAAAA,EAAAA,KACpBC,IAAIC,EAAAA,GACJD,IAAIE,EAAAA,EAAkCV,GAiC3C,MAAO,CACHW,eAXmBA,CAACC,EAAMC,KAC1B,IACI,OAAOR,EAAKS,YAjBCD,IACbA,GACON,EAAAA,EAAAA,KACFC,IAAIC,EAAAA,EAAwBI,GAC5BL,IAAIE,EAAAA,EAAkCK,EAAEC,MAAM,CAAC,EAAGhB,EAA+Ba,IAEnFP,EAWqBW,CAAYJ,GAAQK,OAAON,GACvD,CAAE,MAAOO,GAGL,OAFAjB,EAAOkB,MAAM,4BAA6BD,GAEnCd,EAAKS,YAAYF,EAC5B,GAMR,CA7CAS,QACKC,OAAO,mDA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ACZ,qDAuBCyG,UAAU,kBAAmB0G,GAElCA,EAAyBjN,QAAU,CAAC,WAAY,kB,8BCYhD,SAASwN,EAA4BC,EAAehM,EAAYiM,EAAcC,GAC1E,MAAO,CAGHC,SAAU,mvBAiBV/L,SAAU,IACVE,MAAO,CACHmC,MAAO,IACPjD,aAAc,IACdD,aAAc,KAElBsB,KAAM,SAASC,EAAQC,GAKnBD,EAAOsL,YAAc,oDAIrB,MAAMC,EAAkC,SAAxBvL,EAAOvB,aASvBuB,EAAOwL,uBAAyB,KAC5B,MAAMC,EAAqBP,EAAcQ,sBACpCD,GAAsBA,IAAuBzL,EAAOtB,aAerDiN,EAA2B3L,EAAO2B,OAblCwJ,EAAaS,sBACT,CACIC,MAAO3M,EAAWiC,QAAQ,kBAC1B2K,SAASC,EAAAA,EAAAA,IAAW7M,EAAWiC,QAAQ,wDAAyD,CAACzC,aAAcsB,EAAOtB,gBACtHsN,iBAAkB,qCAEtB,KACId,EAAce,cAAcf,EAAcgB,cAAclM,EAAOtB,eAC/DiN,EAA2B3L,EAAO2B,UAgBlD,MAAMgK,EAA8BhK,IAEhCyJ,EAAQe,KAAK,gBAAgBC,mBAAmBzK,cAAkB4J,IAAW,UAErF,EAER,CArFAjO,QACKC,OAAO,0DAA2D,IAClEyG,UAAU,qBAAsBiH,GAErCA,EAA4BxN,QAAU,CAAC,gBAAiB,aAAc,eAAgB,U","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/services/markdown/markdown.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/services/markdown/plugins/markdown-open-in-sparql-editor-plugin.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/directives/chat-item-detail.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg.utils.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/ttyg-context.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/services/markdown/plugins/markdown-code-copy-plugin.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/markdown-content/markdown-content.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/open-in-sparql-editor/open-in-sparql-editor.directive.js"],"sourcesContent":["import markdownIt from 'markdown-it';\nimport {markdownCodeCopyPlugin} from \"./plugins/markdown-code-copy-plugin\";\nimport {markdownOpenInSparqlEditorPlugin} from \"./plugins/markdown-open-in-sparql-editor-plugin\";\nimport {LoggerProvider} from \"../logger-provider\";\n\nconst OPEN_IN_SPARQL_PLUGIN_OPTIONS = {\n buttonStyle: 'position: absolute; top: 0; right: 0; margin-right: 24px',\n};\n\nconst logger = LoggerProvider.logger;\n\n/**\n * AngularJS service that provides methods for rendering Markdown text.\n * @class MarkdownService\n * @param {$sce} $sce - AngularJS service for Strict Contextual Escaping.\n */\nangular\n .module('graphdb.framework.core.services.markdown-service', [])\n .service('MarkdownService', MarkdownService);\n\nMarkdownService.$inject = ['$sce'];\n\nfunction MarkdownService($sce) {\n const markdownInstance = markdownIt()\n .use(markdownCodeCopyPlugin)\n .use(markdownOpenInSparqlEditorPlugin, OPEN_IN_SPARQL_PLUGIN_OPTIONS);\n\n /**\n * Retrieves a Markdown-it instance with optional custom configuration.\n * @function getMarkdown\n * @param {Object} [config] - Optional custom configuration for Markdown-it.\n * @return {Object} The Markdown instance.\n */\n const getMarkdown = (config) => {\n if (config) {\n return markdownIt()\n .use(markdownCodeCopyPlugin, config)\n .use(markdownOpenInSparqlEditorPlugin, _.merge({}, OPEN_IN_SPARQL_PLUGIN_OPTIONS, config));\n }\n return markdownInstance;\n };\n\n /**\n * Renders Markdown text into HTML.\n * @function renderMarkdown\n * @param {string} text - The Markdown text to render.\n * @return {string} The rendered HTML, or the original text in case of an error.\n */\n const renderMarkdown = (text, config) => {\n try {\n return $sce.trustAsHtml(getMarkdown(config).render(text));\n } catch (e) {\n logger.error('Error rendering markdown:', e);\n // Return the original text in case of an error\n return $sce.trustAsHtml(text);\n }\n };\n\n return {\n renderMarkdown,\n };\n}\n","const DEFAULT_MARKDOWN_CONFIGURATION = {\n buttonStyle: \"position: absolute; top: 0; right: 0;\",\n buttonClass: \"\"\n};\n\n/**\n * This function enhances the rendering of fenced code blocks in markdown that contain SPARQL queries\n * by appending an \"open in SPARQL editor\" button to each SPARQL code block.\n *\n * @param {Function} origRule The original rule function responsible for rendering code blocks.\n * @param {Object} options The options to customize the rendering. These will be merged with the default configuration.\n * Options model description:\n * ```JSON\n * {\n * // Inline CSS styles applied to position the button inside the code block. Defaults to positioning the button at the top-right of the block.\n * buttonStyle: \"position: absolute; top: 0; right: 0;\",\n * // The CSS class for styling the button.\n * buttonClass: \"\",\n * // A flag that determines whether the SPARQL query should be automatically executed when opened in the SPARQL editor. Defaults to `false`.\n * executeQuery: false,\n * // The ID of the repository that the SPARQL query will be executed against.\n * repositoryId: ''\n * }\n * ```\n *\n * @return {Function} A function that renders a fenced code block with an \"open in SPARQL editor\" button when the block is recognized as containing SPARQL code.\n */\nfunction renderCode(origRule, options) {\n options = _.merge({}, DEFAULT_MARKDOWN_CONFIGURATION, options);\n return (...args) => {\n const [tokens, idx] = args;\n const token = tokens[idx];\n\n const content = tokens[idx].content\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", \"&apos;\");\n const origRendered = origRule(...args);\n\n if (token.type === 'fence' && token.info === 'sparql' && origRendered.trim()) {\n return `<div style=\"position: relative\">\n ${origRendered}\n <open-in-sparql-editor\n style=\"${options.buttonStyle}\"\n class=\"${options.buttonClass}\"\n execute-query=\"${options.executeQuery}\"\n repository-id=\"${options.repositoryId}\"\n query=\"${content}\">\n </open-in-sparql-editor>\n </div>`;\n } else {\n return origRendered;\n }\n };\n}\n\nexport const markdownOpenInSparqlEditorPlugin = (md, options) => {\n md.renderer.rules.code_block = renderCode(md.renderer.rules.code_block, options);\n md.renderer.rules.fence = renderCode(md.renderer.rules.fence, options);\n};\n","import 'angular/core/directives/markdown-content/markdown-content';\nimport 'angular/core/directives/open-in-sparql-editor/open-in-sparql-editor.directive';\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {ExplainQueryType} from \"../../models/ttyg/explain-response\";\nimport {getHumanReadableTimestamp} from \"../services/ttyg.utils\";\n\nconst modules = [\n 'graphdb.framework.core.directives.open-in-sparql-editor',\n 'graphdb.framework.core.directives.markdown-content',\n];\n\nangular\n .module('graphdb.framework.ttyg.directives.chat-item-detail', modules)\n .directive('chatItemDetail', ChatItemDetailComponent);\n\nChatItemDetailComponent.$inject = ['toastr', '$translate', 'TTYGContextService', 'TTYGService', '$filter'];\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.ttyg.directives.chat-detail:chatItemDetail\n * @restrict E\n * @description\n *\n * This directive represents a component that displays a chat data.\n *\n * @example\n * <chat-item-detail chat-item=\"chatItem\"></chat-item-detail>\n */\nfunction ChatItemDetailComponent(toastr, $translate, TTYGContextService, TTYGService, $filter) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/ttyg/templates/chat-item-detail.html',\n scope: {\n chatItemDetail: '=',\n showActions: '=',\n asking: '=',\n disabled: '=',\n onRegenerateQuestion: '&',\n onAskHowDeliveredAnswer: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n\n $scope.ExplainQueryType = ExplainQueryType;\n $scope.repositoryId = undefined;\n $scope.markdownContentOptions = undefined;\n /**\n * Flag that indicates if answer cancellation is in progress.\n * @type {boolean}\n */\n $scope.isCancellingAnswer = false;\n\n /**\n * Mapping of agent id to agent name which is used to display the agent name in the UI.\n * @type {{[key: string]: string}}\n */\n $scope.agentNameByIdMap = {};\n\n /**\n * @type {{[key: string]: ExplainResponseModel}}\n */\n $scope.explainResponseModel = {};\n\n /**\n * Mapping of answer id to a boolean value indicating whether the explanation of how the answer was\n * generated is being loaded.\n * @type {{[key: string]: boolean}}\n */\n $scope.loadingExplainResponse = {};\n\n // =========================\n // Private variables\n // =========================\n\n // =========================\n // Public functions\n // =========================\n $scope.regenerateQuestion = () => {\n $scope.onRegenerateQuestion({chatItem: $scope.chatItemDetail});\n };\n\n /**\n * Extract the explanation of how the answer was generated.\n * @param {string} answerId\n */\n $scope.explainResponse = (answerId) => {\n if (TTYGContextService.hasExplainResponse(answerId)) {\n TTYGContextService.toggleExplainResponse(answerId);\n } else {\n $scope.loadingExplainResponse[answerId] = true;\n TTYGService.explainResponse($scope.chatItemDetail, answerId)\n .then((explainResponse) => {\n TTYGContextService.addExplainResponseCache(explainResponse);\n })\n .catch(() => {\n toastr.error($translate.instant('ttyg.chat_panel.messages.explain_response_failure'));\n })\n .finally(() => $scope.loadingExplainResponse[answerId] = false);\n }\n };\n\n /**\n * Triggers an asking how the answer was generated.\n */\n $scope.onAskHowAnswerWasDerived = () => {\n $scope.onAskHowDeliveredAnswer();\n };\n\n /**\n * Handles the click event on the token usage info button.\n * No additional actions are needed at this time; the handler simply prevents\n * the default button behavior and stops the event from bubbling up.\n *\n * @param {Event} event - The click event object.\n */\n $scope.onTokenUsageInfo = (event) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n /**\n * Opens <code>query</code> in sparql editor.\n * @param {string} query\n */\n $scope.onOpenInSparqlEditor = (query) => {\n if ($scope.chatItemDetail.agentId) {\n TTYGContextService.emit(TTYGEventName.GO_TO_SPARQL_EDITOR, {\n query,\n repositoryId: $scope.repositoryId,\n });\n }\n };\n\n $scope.showRawQuery = (queryMethod) => {\n // TODO: Create a chat panel model and move this check there when the model is updated.\n const rawQueryNoSpaces = queryMethod.rawQuery.replace(/\\s+/g, '');\n const queryNoSpaces = queryMethod.query.replace(/\\s+/g, '');\n return rawQueryNoSpaces && rawQueryNoSpaces !== queryNoSpaces;\n };\n\n $scope.getRepositoryId = (f) => {\n const agent = TTYGContextService.getAgent($scope.chatItemDetail.agentId);\n return agent ? agent.repositoryId : '';\n };\n\n $scope.getHumanReadableQuestionTimestamp = (timestamp) => {\n return getHumanReadableTimestamp($translate, $filter, timestamp);\n };\n\n // =========================\n // Private functions\n // =========================\n const init = () => {\n $scope.repositoryId = $scope.getRepositoryId();\n $scope.markdownContentOptions = {repositoryId: $scope.repositoryId};\n updateExplainResponseModel();\n };\n\n const onExplainResponseCacheUpdated = () => {\n updateExplainResponseModel();\n };\n\n const updateExplainResponseModel = () => {\n $scope.chatItemDetail.answers.forEach((answer) => {\n $scope.explainResponseModel[answer.id] = TTYGContextService.getExplainResponse(answer.id);\n });\n };\n\n const onAgentsListChanged = () => {\n $scope.agentNameByIdMap = TTYGContextService.getAgents().agentNameByIdMap;\n };\n\n const onPendingQuestionCancelled = () => {\n $scope.isCancellingAnswer = false;\n };\n\n const onCancelPendingQuestion = (chatItem) => {\n // If the chat item is not the same as the one in scope, do nothing.\n // We check by timestamp because it's the only unique identifier we have for the question.\n // The question has an ID, but it’s not always available in the chat item.\n // When the chat is loaded, all questions are loaded with their IDs.\n // However, when we ask a new question, it does not yet have an ID.\n // This means we can have multiple questions with no ID, which may cause issues\n // like displaying more than one loader indicator.\n if ($scope.chatItemDetail.question.timestamp !== chatItem.question.timestamp) {\n return;\n }\n $scope.isCancellingAnswer = true;\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [\n TTYGContextService.onExplainResponseCacheUpdated(onExplainResponseCacheUpdated),\n TTYGContextService.onAgentsListChanged(onAgentsListChanged),\n TTYGContextService.subscribe(TTYGEventName.PENDING_QUESTION_CANCELED_SUCCESSFUL, onPendingQuestionCancelled),\n TTYGContextService.subscribe(TTYGEventName.CANCEL_PENDING_QUESTION_FAILURE, onPendingQuestionCancelled),\n TTYGContextService.subscribe(TTYGEventName.CANCEL_PENDING_QUESTION, onCancelPendingQuestion),\n ];\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n // =========================\n // Initialization\n // =========================\n init();\n },\n };\n}\n","export const getHumanReadableTimestamp = ($translate, $filter, timestamp, options = {}) => {\n\n if (!timestamp) {\n return '';\n }\n\n const date = new Date(timestamp);\n const today = new Date();\n\n // Get start of today\n const todayStart = new Date(today.getFullYear(), today.getMonth(), today.getDate());\n\n // Get start of yesterday\n const yesterdayStart = new Date(todayStart);\n yesterdayStart.setDate(todayStart.getDate() - 1);\n\n // Get start of the timestamp's day\n const dateStart = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n const time = options.timeFormat ? $filter('date')(date, options.timeFormat) : '';\n\n if (dateStart.getTime() === todayStart.getTime()) {\n return $translate.instant('common.dates.today') + time;\n } else if (dateStart.getTime() === yesterdayStart.getTime()) {\n return $translate.instant('common.dates.yesterday') + time;\n } else {\n // ISO format is the least ambiguous if no date format is passed.\n const dateFormat = options.dateFormat || 'yyyy-MM-dd';\n return $filter('date')(date, dateFormat) + time;\n }\n};\n","import {cloneDeep} from 'lodash';\n\nangular\n .module('graphdb.framework.ttyg.services.ttygcontext', [])\n .factory('TTYGContextService', TTYGContextService);\n\nTTYGContextService.$inject = ['EventEmitterService', 'TTYGService'];\n\nfunction TTYGContextService(EventEmitterService) {\n /**\n * The list of agents.\n * @type {AgentListModel}\n * @private\n */\n let _agents = undefined;\n\n /**\n * The ChatsListModel.\n * @type {ChatsListModel}\n * @private\n */\n let _chats = undefined;\n\n /**\n * The currently selected in the UI chat which is used for conversation.\n * @type {ChatModel|undefined}\n * @private\n */\n let _selectedChat = undefined;\n\n /**\n * The currently selected in the UI agent which is used for conversation.\n * @type {AgentModel|undefined}\n * @private\n */\n let _selectedAgent = undefined;\n\n /**\n * Stores information about loaded explain responses.\n * The key is the answer ID, and the value is an instance of {@see ExplainResponseModel} that holds the explanation message.\n *\n * @type {{[key: string]: ExplainResponseModel}}\n */\n let _explainCache = {};\n\n /**\n * The default agent values.\n * @type {AgentModel|undefined}\n * @private\n */\n let _defaultAgent = undefined;\n\n let _canModifyAgent = false;\n\n const resetContext = () => {\n _agents = undefined;\n _chats = undefined;\n _selectedChat = undefined;\n _selectedAgent = undefined;\n _explainCache = {};\n _defaultAgent = undefined;\n _canModifyAgent = false;\n };\n\n /**\n * @return {Promise<AgentModel>}\n */\n const getDefaultAgent = () => {\n return cloneDeep(_defaultAgent);\n };\n\n const setDefaultAgent = (agent) => {\n _defaultAgent = agent;\n };\n\n /**\n * @return {AgentListModel}\n */\n const getAgents = () => {\n return cloneDeep(_agents);\n };\n\n const getAgent = (agentId) => {\n if (_agents) {\n return cloneDeep(_agents.getAgent(agentId));\n }\n };\n\n /**\n * @return {ChatsListModel}\n */\n const getChats = () => {\n return cloneDeep(_chats);\n };\n\n /**\n * @param {ChatsListModel} chats\n */\n const updateChats = (chats) => {\n _chats = cloneDeep(chats);\n emit(TTYGEventName.CHAT_LIST_UPDATED, getChats());\n };\n\n /**\n * Deletes the chat with the provided <code>chatId</code>.\n * @param {ChatModel} chat\n */\n const deleteChat = (chat) => {\n _chats.deleteChat(chat);\n updateChats(_chats);\n };\n\n const addChat = (newChat) => {\n _chats.appendChat(newChat);\n updateChats(_chats);\n };\n\n const replaceChat = (newChat, oldChat) => {\n _chats.replaceChat(newChat, oldChat);\n updateChats(_chats);\n };\n\n const createChat = (newChat) => {\n addChat(newChat);\n selectChat(newChat);\n emit(TTYGEventName.CREATE_CHAT_SUCCESSFUL, newChat);\n };\n\n /** Subscribes to the 'chatListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onChatsListChanged = (callback) => {\n if (_chats && angular.isFunction(callback)) {\n callback(getChats());\n }\n return subscribe(TTYGEventName.CHAT_LIST_UPDATED, (chats) => callback(chats));\n };\n\n /**\n * @return {ChatModel}\n */\n const getSelectedChat = () => {\n return cloneDeep(_selectedChat);\n };\n\n /**\n * Updates the selected chat with the provided <code>selectedChat</code> and emits the 'selectChat' event\n * to notify listeners that a new chat has been selected.\n *\n * @param {ChatModel} selectedChat - The chat object to select.\n */\n const selectChat = (selectedChat) => {\n if (!_selectedChat || _selectedChat.id !== selectedChat.id) {\n _selectedChat = cloneDeep(selectedChat);\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n }\n };\n\n const deselectChat = () => {\n _selectedChat = undefined;\n emit(TTYGEventName.SELECT_CHAT, getSelectedChat());\n };\n\n /**\n * Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatChanged = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECT_CHAT, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the selected chat and emits the 'selectChatUpdated' event to notify listeners that a property\n * of the selected chat has changed.\n *\n * If the ID of the passed chat differs from the current selected chat, no action will occur.\n *\n * The selected chat can be updated through {@link TTYGContextService#selectChat}.\n *\n * @param {ChatModel} chat - The chat object that is being updated.\n */\n const updateSelectedChat = (chat) => {\n if (!_selectedChat || !_selectedChat.id || !chat || _selectedChat.id === chat.id) {\n _selectedChat = cloneDeep(chat);\n emit(TTYGEventName.SELECTED_CHAT_UPDATED, getSelectedChat());\n }\n };\n\n /** Subscribes to the 'selectChat' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedChatUpdated = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.SELECTED_CHAT_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /** Subscribes to the 'lastMessageReceived' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onLastMessageReceived = (callback) => {\n if (_selectedChat && angular.isFunction(callback)) {\n callback(getSelectedChat());\n }\n return subscribe(TTYGEventName.LAST_MESSAGE_RECEIVED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @param {AgentListModel} agents\n */\n const updateAgents = (agents) => {\n _agents = cloneDeep(agents);\n emit(TTYGEventName.AGENT_LIST_UPDATED, getAgents());\n };\n\n /**\n * Subscribes to the 'agentListUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onAgentsListChanged = (callback) => {\n if (_agents && angular.isFunction(callback)) {\n callback(getAgents());\n }\n return subscribe(TTYGEventName.AGENT_LIST_UPDATED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * @return {AgentModel}\n */\n const getSelectedAgent = () => {\n return cloneDeep(_selectedAgent);\n };\n\n /**\n * Updates the selected agent with the provided <code>selectedAgent</code> and emits the 'agentSelected' event\n * to notify listeners that a new agent has been selected.\n *\n * @param {AgentModel} selectedAgent - The instance of selected agent.\n */\n const selectAgent = (selectedAgent) => {\n _selectedAgent = cloneDeep(selectedAgent);\n emit(TTYGEventName.AGENT_SELECTED, getSelectedAgent());\n };\n\n const _getExplainResponseCache = () => {\n return cloneDeep(_explainCache);\n };\n\n /**\n * Gets the explain response.\n * @param {string} answerId\n * @return {ExplainResponseModel}\n */\n const getExplainResponse = (answerId) => {\n return cloneDeep(_explainCache[answerId]);\n };\n\n /**\n * Adds the <code>explainResponse</code> into the explain response cache.\n *\n * @param {ExplainResponseModel} explainResponse\n */\n const addExplainResponseCache = (explainResponse) => {\n _explainCache[explainResponse.answerId] = cloneDeep(explainResponse);\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n };\n\n const hasExplainResponse = (answerId) => {\n return !!_explainCache[answerId];\n };\n\n const toggleExplainResponse = (answerId) => {\n if (hasExplainResponse(answerId)) {\n _explainCache[answerId].expanded = !_explainCache[answerId].expanded;\n emit(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, _getExplainResponseCache());\n }\n };\n\n /**\n * Subscribes to the 'explainResponseCacheUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onExplainResponseCacheUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(_getExplainResponseCache());\n }\n return subscribe(TTYGEventName.EXPLAIN_RESPONSE_CACHE_UPDATED, (explainResponses) => callback(explainResponses));\n };\n\n /**\n * Subscribes to the 'agentSelected' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onSelectedAgentChanged = (callback) => {\n if (_selectedAgent && angular.isFunction(callback)) {\n callback(getSelectedAgent());\n }\n return subscribe(TTYGEventName.AGENT_SELECTED, (selectedChat) => callback(selectedChat));\n };\n\n /**\n * Updates the \"canModifyAgent\" flag and emits the 'canModifyAgentUpdated' event to notify listeners that the canModifyAgent flag is changed.\n *\n * @param {boolean} canModifyAgent\n */\n const setCanModifyAgent = (canModifyAgent) => {\n _canModifyAgent = cloneDeep(canModifyAgent);\n emit(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, getCanModifyAgent());\n };\n\n const getCanModifyAgent = () => {\n return _canModifyAgent;\n };\n\n /**\n * Subscribes to the 'canModifyAgentUpdated' event.\n * @param {function} callback - The callback to be called when the event is fired.\n *\n * @return {function} unsubscribe function.\n */\n const onCanUpdateAgentUpdated = (callback) => {\n if (angular.isFunction(callback)) {\n callback(getCanModifyAgent());\n }\n return subscribe(TTYGEventName.CAN_MODIFY_AGENT_UPDATED, (canModifyAgent) => callback(canModifyAgent));\n };\n\n /**\n * Emits an event with a deep-cloned payload using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to emit. It must be a value from {@link TTYGEventName}.\n * @param {*} payload - The data to emit with the event. The payload is deep-cloned before emission.\n */\n const emit = (tTYGEventName, payload) => {\n EventEmitterService.emitSync(tTYGEventName, cloneDeep(payload));\n };\n\n /**\n * Subscribes to an event with the specified callback using the EventEmitterService.\n *\n * @param {string} tTYGEventName - The name of the event to subscribe to. It must be a value from {@link TTYGEventName}.\n * @param {function} callback - The function to call when the event is emitted.\n * @return {function} - Returns a function that can be called to unsubscribe from the event.\n */\n const subscribe = (tTYGEventName, callback) => {\n return EventEmitterService.subscribeSync(tTYGEventName, (payload) => callback(payload));\n };\n\n return {\n resetContext,\n emit,\n subscribe,\n // chats\n getChats,\n updateChats,\n addChat,\n replaceChat,\n createChat,\n onChatsListChanged,\n getSelectedChat,\n selectChat,\n deselectChat,\n deleteChat,\n onSelectedChatChanged,\n updateSelectedChat,\n onSelectedChatUpdated,\n onLastMessageReceived,\n // agents\n updateAgents,\n onAgentsListChanged,\n getAgents,\n getAgent,\n selectAgent,\n getSelectedAgent,\n onSelectedAgentChanged,\n getDefaultAgent,\n setDefaultAgent,\n setCanModifyAgent,\n getCanModifyAgent,\n onCanUpdateAgentUpdated,\n // chat explain\n hasExplainResponse,\n toggleExplainResponse,\n getExplainResponse,\n addExplainResponseCache,\n onExplainResponseCacheUpdated,\n };\n}\n\nexport const TTYGEventName = {\n /**\n * Emitting the \"createChat\" event triggers a backend request to create a new chat.\n */\n CREATE_CHAT: 'createChat',\n\n /**\n * This event is emitted when a chat is successfully created.\n */\n CREATE_CHAT_SUCCESSFUL: 'chatCreated',\n\n /**\n * This event is emitted when the creation of a chat fails.\n */\n CREATE_CHAT_FAILURE: 'chatCreationFailed',\n\n RENAME_CHAT: 'renameChat',\n RENAME_CHAT_SUCCESSFUL: 'chatRenamed',\n RENAME_CHAT_FAILURE: 'chatRenamedFailure',\n\n /**\n * Emitting the \"selectChat\" event when the selected chat has been changed.\n */\n SELECT_CHAT: 'selectChat',\n\n /**\n * Emitting the \"selectChatUpdated\" event when the selected chat has been updated.\n */\n SELECTED_CHAT_UPDATED: 'selectChatUpdated',\n\n /**\n * Emitting the \"lastMessageReceived\" event when the final answer message has been received.\n */\n LAST_MESSAGE_RECEIVED: 'lastMessageReceived',\n\n /**\n * This event will be emitted when the chat delete request is in progress. The payload will contain the chat ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_CHAT: 'deletingChat',\n\n /**\n * This event will be emitted when the delete chat process is triggered but before the chat delete request is sent.\n */\n DELETE_CHAT: 'deleteChat',\n\n /**\n * This event will be emitted when the chat was successfully deleted.\n */\n DELETE_CHAT_SUCCESSFUL: 'chatDeleted',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n\n /**\n * This event is emitted when the deletion of a chat fails.\n */\n DELETE_CHAT_FAILURE: 'chatDeletedFailure',\n\n CHAT_EXPORT: 'chatExport',\n CHAT_EXPORT_SUCCESSFUL: 'chatExportSuccess',\n CHAT_EXPORT_FAILURE: 'chatExportFailure',\n CHAT_LIST_UPDATED: 'chatListUpdated',\n\n /**\n * Emitting the \"askQuestion\" event triggers a request to the backend to retrieve an answer to a question.\n */\n ASK_QUESTION: 'askQuestion',\n\n /**\n * This event will be emitted when the attempt to answer the question fails.\n */\n ASK_QUESTION_FAILURE: 'askQuestionFailure',\n\n /**\n * Emitting the \"continueChatRun\" event triggers a request to the backend to retrieve more remaining answers from the same chat run.\n */\n CONTINUE_CHAT_RUN: 'continueChatRun',\n\n /**\n * Emitting the \"cancelPendingQuestion\" event triggers the cancellation of a pending question in a chat.\n */\n CANCEL_PENDING_QUESTION: \"cancelPendingQuestion\",\n\n /**\n * This event is emitted when the cancellation of the pending question succeeds.\n */\n PENDING_QUESTION_CANCELED_SUCCESSFUL: \"pendingQuestionCanceledSuccessful\",\n\n /**\n * This event is emitted when the cancellation of the pending question fails.\n */\n CANCEL_PENDING_QUESTION_FAILURE: \"cancelPendingQuestionFailed\",\n\n /**\n * This event will be fired before a question is sent to BE for processing.\n */\n ASK_QUESTION_STARTING: \"askQuestionStarting\",\n\n /**\n * Emitting the \"loadChats\" event will trigger an action to loads all chats from backend server.\n */\n LOAD_CHATS: 'loadChats',\n LOAD_CHAT_SUCCESSFUL: 'loadChatSuccess',\n LOAD_CHAT_FAILURE: 'loadChatFailure',\n\n AGENT_LIST_UPDATED: 'agentListUpdated',\n\n /**\n * This event will be emitted when the create agent process is triggered through the UI but before the agent create\n * request is sent. This is used to open the agent settings dialog.\n */\n OPEN_AGENT_SETTINGS: 'openAgentSettings',\n\n /**\n * This event will be emitted when an agent needs to be edited.\n */\n EDIT_AGENT: 'editAgent',\n\n /**\n * This event will be emitted when an agent needs to be cloned.\n */\n CLONE_AGENT: 'cloneAgent',\n\n /**\n * This event will be emitted when the delete agent process is triggered but before the agent delete request is sent.\n */\n DELETE_AGENT: 'deleteAgent',\n\n /**\n * This event will be emitted when the agent was successfully deleted.\n */\n AGENT_DELETED: 'agentDeleted',\n\n /**\n * This event will be emitted when the agent delete request is in progress. The payload will contain the agent ID\n * and a boolean indicating if the deletion is in progress.\n */\n DELETING_AGENT: 'deletingAgent',\n\n /**\n * This event will be emitted when an agent is selected by the user through the UI.\n */\n AGENT_SELECTED: 'agentSelected',\n\n /**\n * This event will trigger the opening of the similarity view.\n */\n GO_TO_CREATE_SIMILARITY_VIEW: \"goToCreateSimilarityView\",\n\n /**\n * This event will trigger the opening of the connectors view.\n */\n GO_TO_CONNECTORS_VIEW: \"goToConnectorsView\",\n\n /**\n * This event will trigger the opening of the \"Autocomplete index\" view.\n */\n GO_TO_AUTOCOMPLETE_INDEX_VIEW: \"goToAutocompleteIndexView\",\n\n /**\n * This event will trigger fetching a new explanation of how the answer was generated.\n */\n EXPLAIN_RESPONSE: \"explainResponse\",\n\n /**\n * This event will be emitted when the cache with explain responses changed.\n */\n EXPLAIN_RESPONSE_CACHE_UPDATED: \"explainResponseCacheUpdated\",\n\n /**\n * This event will trigger the opening of the sparql view.\n */\n GO_TO_SPARQL_EDITOR: \"openQueryInSparqlEditor\",\n\n CAN_MODIFY_AGENT_UPDATED: \"canModifyAgentUpdated\",\n\n /**\n * This event will be emitted when there is a change in the state of the question being asked. (e.g., currently being sent)\n */\n ASK_QUESTION_STATE_CHANGED: \"askQuestionStateChanged\",\n};\n","const DEFAULT_MARKDOWN_CONFIGURATION = {\n buttonStyle: \"position: absolute; top: 0; right: 0;\",\n buttonClass: \"\"\n};\n\n/**\n * This function enhances the rendering of code blocks in markdown by appending a \"copy to clipboard\" button to each code block.\n *\n * @param {Function} origRule The original rule function responsible for rendering code blocks.\n * @param {Object} options The options to customize the rendering. These will be merged with the default configuration.\n * Options model description:\n * ```JSON\n * {\n * // Inline CSS styles applied to position the button inside the code block. Defaults to positioning the button at the top-right of the block.\n * buttonStyle: \"position: absolute; top: 0; right: 0;\",\n * // The CSS class for styling the button. The default applies Bootstrap-like styles with a small button size and a secondary theme\n * buttonClass: \"btn btn-link btn-sm secondary\",\n * }\n * ```\n * @return {Function} A function that renders a code block with a \"copy to clipboard\" button, when a fenced code block is detected.\n */\nfunction renderCode(origRule, options) {\n options = _.merge({}, DEFAULT_MARKDOWN_CONFIGURATION, options);\n return (...args) => {\n const [tokens, idx] = args;\n const token = tokens[idx];\n\n const content = tokens[idx].content\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", \"&apos;\");\n const origRendered = origRule(...args);\n\n if (token.type === 'fence' && origRendered.trim()) {\n return `<div style=\"position: relative\">\n ${origRendered}\n <copy-to-clipboard\n style=\"${options.buttonStyle}\"\n class=\"${options.buttonClass}\"\n tooltip-text=\"ttyg.chat_panel.btn.copy_sparql.tooltip\"\n text-to-copy=\"${content}\">\n </copy-to-clipboard>\n </div>`;\n } else {\n return origRendered;\n }\n };\n}\n\nexport const markdownCodeCopyPlugin = (md, options) => {\n md.renderer.rules.code_block = renderCode(md.renderer.rules.code_block, options);\n md.renderer.rules.fence = renderCode(md.renderer.rules.fence, options);\n};\n","import 'angular/core/services/markdown/markdown.service';\n\nconst modules = [\n 'graphdb.framework.core.services.markdown-service'\n];\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.core.directives.markdown-content:markdownContent\n * @restrict E\n *\n * @description\n * The `markdownContent` directive is used to render and compile Markdown content inside AngularJS applications.\n * It dynamically compiles any AngularJS directives within the rendered Markdown content, ensuring that the\n * directives are properly recognized and executed.\n *\n * @param {string=} content The markdown content to be rendered. This can be passed dynamically from the scope.\n * @param {object=} options Optional configuration object to pass to the Markdown rendering engine, providing\n * customization for how the Markdown is rendered.\n *\n * @example\n * Usage:\n * <markdown-content content=\"markdownText\" options=\"markdownOptions\"></markdown-content>\n */\nangular\n .module('graphdb.framework.core.directives.markdown-content', modules)\n .directive('markdownContent', markdownContentDirective);\n\nmarkdownContentDirective.$inject = ['$compile', 'MarkdownService'];\n\nfunction markdownContentDirective($compile, MarkdownService) {\n return {\n templateUrl: 'js/angular/core/templates/markdown-content/markdown-content.html',\n restrict: 'E',\n scope: {\n content: '@',\n options: '='\n },\n link: function ($scope, element) {\n\n // =========================\n // Public variables\n // =========================\n\n /**\n * The rendered HTML content generated from the provided Markdown.\n *\n * @type {string} markdownContent\n */\n $scope.markdownContent = undefined;\n\n // =========================\n // Private functions\n // =========================\n\n const init = () => {\n $scope.markdownContent = MarkdownService.renderMarkdown($scope.content, $scope.options);\n compileMarkdownAnswerContents();\n };\n\n /**\n * Manually compiles AngularJS directives within the dynamically generated markdown HTML content.\n * AngularJS does not automatically detect and compile directives inside HTML that is dynamically\n * inserted, so this function ensures that the content is compiled after it is rendered.\n */\n const compileMarkdownAnswerContents = () => {\n $scope.$evalAsync(() => {\n // Find the dynamically rendered element that needs to be compiled\n const markdownElement = element.find('.markdown-content');\n $compile(angular.element(markdownElement).contents())($scope);\n });\n };\n\n init();\n }\n };\n}\n","import {decodeHTML} from \"../../../../../app\";\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.core.directives.open-in-sparql-editor.directive:openInSparqlEditor\n * @restrict E\n *\n * @description\n * This directive provides a button that allows users to open the SPARQL editor with a pre-defined query.\n * Optionally, it can handle repository switching before opening the editor and executing the query.\n * The directive can also trigger the query execution automatically if specified.\n *\n * @scope\n *\n * @param {string} query The SPARQL query to be opened and optionally executed in the SPARQL editor.\n * @param {string} repositoryId The ID of the repository to be selected before opening the SPARQL editor.\n * @param {string} executeQuery Flag that determines whether the query should be executed upon opening the editor.\n * It accepts 'true' or 'false'. If 'true', the query will be automatically executed.\n *\n * @example\n * <open-in-sparql-editor\n * query=\"SELECT * WHERE {?s ?p ?o}\"\n * repository-id=\"myRepository\"\n * execute-query=\"true\">\n * </open-in-sparql-editor>\n *\n * @requires $repositories\n * @requires $translate\n * @requires ModalService\n * @requires $window\n *\n * @param {string} query The SPARQL query to be executed in the new tab.\n */\n\nangular\n .module('graphdb.framework.core.directives.open-in-sparql-editor', [])\n .directive('openInSparqlEditor', openInSparqlEditorDirective);\n\nopenInSparqlEditorDirective.$inject = ['$repositories', '$translate', 'ModalService', '$window'];\n\nfunction openInSparqlEditorDirective($repositories, $translate, ModalService, $window) {\n return {\n // Note: the line-height of the element must match the line-height of the icon.\n // This defines a composite FontAwesome icon to match the style of the surrounding icons.\n template: `\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class=\"btn btn-link btn-sm open-in-sparql-editor-btn\"\n data-test=\"open-in-sparql-editor-btn\"\n gdb-tooltip=\"{{'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip' | translate}}\" ng-click=\"onGoToSparqlEditorView()\" guide-selector=\"open-in-sparql-editor-btn\">\n <i class=\"ri-braces-line\"></i>\n </button>\n `,\n restrict: 'E',\n scope: {\n query: '@',\n repositoryId: '@',\n executeQuery: '@',\n },\n link: function($scope, element) {\n // =========================\n // Public variables\n // =========================\n\n $scope.tooltipText = 'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip';\n // =========================\n // Private functions\n // =========================\n const execute = $scope.executeQuery === 'true';\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Opens the SPARQL editor in a new browser tab with the specified query and optional execution.\n */\n $scope.onGoToSparqlEditorView = () => {\n const activeRepositoryId = $repositories.getActiveRepository();\n if (!activeRepositoryId || activeRepositoryId !== $scope.repositoryId) {\n // Open a confirmation modal before switching the repository\n ModalService.openConfirmationModal(\n {\n title: $translate.instant('common.confirm'),\n message: decodeHTML($translate.instant('ttyg.chat_panel.dialog.confirm_repository_change.body', {repositoryId: $scope.repositoryId})),\n confirmButtonKey: 'ttyg.chat_panel.btn.proceed.label',\n },\n () => {\n $repositories.setRepository($repositories.getRepository($scope.repositoryId));\n openInSparqlEditorInNewTab($scope.query);\n },\n );\n } else {\n // No repository switch needed, just open the SPARQL editor\n openInSparqlEditorInNewTab($scope.query);\n }\n };\n // =========================\n // Private functions\n // =========================\n\n /**\n * Opens SPARQL editor view with passed query and handles repository switch if necessary.\n * @param {string} query\n */\n const openInSparqlEditorInNewTab = (query) => {\n // Open the SPARQL editor in a new tab and execute the query\n $window.open(`sparql?query=${encodeURIComponent(query)}&execute=${execute}`, '_blank');\n };\n },\n };\n}\n"],"names":["OPEN_IN_SPARQL_PLUGIN_OPTIONS","buttonStyle","logger","LoggerProvider","MarkdownService","$sce","markdownInstance","markdownIt","use","markdownCodeCopyPlugin","markdownOpenInSparqlEditorPlugin","renderMarkdown","text","config","trustAsHtml","_","merge","getMarkdown","render","e","error","angular","module","service","$inject","DEFAULT_MARKDOWN_CONFIGURATION","buttonClass","renderCode","origRule","options","args","tokens","idx","token","content","replaceAll","origRendered","type","info","trim","executeQuery","repositoryId","md","renderer","rules","code_block","fence","ChatItemDetailComponent","toastr","$translate","TTYGContextService","TTYGService","$filter","restrict","templateUrl","scope","chatItemDetail","showActions","asking","disabled","onRegenerateQuestion","onAskHowDeliveredAnswer","link","$scope","element","attrs","ExplainQueryType","undefined","markdownContentOptions","isCancellingAnswer","agentNameByIdMap","explainResponseModel","loadingExplainResponse","regenerateQuestion","chatItem","explainResponse","answerId","hasExplainResponse","toggleExplainResponse","then","addExplainResponseCache","catch","instant","finally","onAskHowAnswerWasDerived","onTokenUsageInfo","event","preventDefault","stopPropagation","onOpenInSparqlEditor","query","agentId","emit","TTYGEventName","GO_TO_SPARQL_EDITOR","showRawQuery","queryMethod","rawQueryNoSpaces","rawQuery","replace","queryNoSpaces","getRepositoryId","f","agent","getAgent","getHumanReadableQuestionTimestamp","timestamp","getHumanReadableTimestamp","updateExplainResponseModel","answers","forEach","answer","id","getExplainResponse","onPendingQuestionCancelled","subscriptions","onExplainResponseCacheUpdated","onAgentsListChanged","getAgents","subscribe","PENDING_QUESTION_CANCELED_SUCCESSFUL","CANCEL_PENDING_QUESTION_FAILURE","CANCEL_PENDING_QUESTION","question","$on","removeAllSubscribers","subscription","directive","date","Date","today","todayStart","getFullYear","getMonth","getDate","yesterdayStart","setDate","dateStart","time","timeFormat","getTime","dateFormat","EventEmitterService","_agents","_chats","_selectedChat","_selectedAgent","_defaultAgent","_explainCache","_canModifyAgent","cloneDeep","getChats","updateChats","chats","CHAT_LIST_UPDATED","addChat","newChat","appendChat","getSelectedChat","selectChat","selectedChat","SELECT_CHAT","getSelectedAgent","_getExplainResponseCache","getCanModifyAgent","tTYGEventName","payload","emitSync","callback","subscribeSync","resetContext","replaceChat","oldChat","createChat","CREATE_CHAT_SUCCESSFUL","onChatsListChanged","isFunction","deselectChat","deleteChat","chat","onSelectedChatChanged","updateSelectedChat","SELECTED_CHAT_UPDATED","onSelectedChatUpdated","onLastMessageReceived","LAST_MESSAGE_RECEIVED","updateAgents","agents","AGENT_LIST_UPDATED","selectAgent","selectedAgent","AGENT_SELECTED","onSelectedAgentChanged","getDefaultAgent","setDefaultAgent","setCanModifyAgent","canModifyAgent","CAN_MODIFY_AGENT_UPDATED","onCanUpdateAgentUpdated","expanded","EXPLAIN_RESPONSE_CACHE_UPDATED","explainResponses","factory","CREATE_CHAT","CREATE_CHAT_FAILURE","RENAME_CHAT","RENAME_CHAT_SUCCESSFUL","RENAME_CHAT_FAILURE","DELETING_CHAT","DELETE_CHAT","DELETE_CHAT_SUCCESSFUL","DELETE_CHAT_FAILURE","CHAT_EXPORT","CHAT_EXPORT_SUCCESSFUL","CHAT_EXPORT_FAILURE","ASK_QUESTION","ASK_QUESTION_FAILURE","CONTINUE_CHAT_RUN","ASK_QUESTION_STARTING","LOAD_CHATS","LOAD_CHAT_SUCCESSFUL","LOAD_CHAT_FAILURE","OPEN_AGENT_SETTINGS","EDIT_AGENT","CLONE_AGENT","DELETE_AGENT","AGENT_DELETED","DELETING_AGENT","GO_TO_CREATE_SIMILARITY_VIEW","GO_TO_CONNECTORS_VIEW","GO_TO_AUTOCOMPLETE_INDEX_VIEW","EXPLAIN_RESPONSE","ASK_QUESTION_STATE_CHANGED","markdownContentDirective","$compile","markdownContent","$evalAsync","markdownElement","find","contents","openInSparqlEditorDirective","$repositories","ModalService","$window","template","tooltipText","execute","onGoToSparqlEditorView","activeRepositoryId","getActiveRepository","openInSparqlEditorInNewTab","openConfirmationModal","title","message","decodeHTML","confirmButtonKey","setRepository","getRepository","open","encodeURIComponent"],"ignoreList":[],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=71099;export const __webpack_esm_ids__=[71099];export const __webpack_esm_modules__={71099(e,a,s){s(82493),s(98599),s(76933),s(98977);const n=angular.module("graphdb.framework.namespaces.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.framework.rest.repositories.service","graphdb.framework.rest.rdf4j.repositories.service","toastr"]),t=function(){const e="[A-Z]|[a-z]|[À-Ö]|[Ø-ö]|[ø-˿]|[Ͱ-ͽ]|[Ϳ-῿]|[‌-‍]|[⁰-↏]|[Ⰰ-⿯]|[、-퟿]|[豈-﷏]|[ﷰ-�]",a=e+"|_|-|[0-9]|·|[̀-ͯ]|[‿-⁀]";return new RegExp("^(?:"+e+")(?:(?:"+a+"|\\.)*(?:"+a+"))?$")}();n.controller("NamespacesCtrl",["$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate",function(e,a,s,n,c,r,i,o,p){e.namespaces={},e.namespace={},e.loader=!1,e.haveSelected=!1,e.pageSizeOptions=[10,20,50,100],e.page=1,e.pageSize=e.pageSizeOptions[0],e.displayedNamespaces=[],e.getNamespaces=function(){s.getActiveRepository()&&(e.loader=!0,e.namespaces={},o.getNamespaces(s.getActiveRepository()).success(function(a){e.namespaces=a.results.bindings.map(function(e){return{prefix:e.prefix.value,namespace:e.namespace.value}}),e.namespaces.length>0&&(e.namespaces.sort(function(e,a){const s=e.prefix.toUpperCase(),n=a.prefix.toUpperCase();return s<n?-1:s>n?1:0}),e.matchedElements=e.namespaces,e.changePagination()),0===e.namespaces.length&&(e.loader=!1)}).error(function(a){const s=getError(a);n.error(s),e.loader=!1}))},e.changePagination=function(){angular.isDefined(e.namespaces)&&(e.displayedNamespaces=e.namespaces.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(a){$(".ot-graph-page-size").removeClass("active"),e.page=1,e.searchNamespaces="",a&&(e.getNamespaces(),e.pageSize=a)},e.$watch("matchedElements",function(){angular.isDefined(e.matchedElements)&&(e.displayedNamespaces=e.matchedElements.slice(e.pageSize*(e.page-1),e.pageSize*e.page))}),e.$watch(function(){return s.getActiveRepository()},function(){e.searchNamespaces="",e.getNamespaces(),e.selectedAll=!1}),e.onNamespaceSearch=function(){e.haveSelected=!1,e.selectedAll=!1,e.matchedElements=[],g(),l()};const l=function(){angular.forEach(e.namespaces,function(a){-1===a.namespace.indexOf(e.searchNamespaces)&&-1===a.prefix.indexOf(e.searchNamespaces)||e.matchedElements.push(a)})};e.saveNamespace=function(a,t){return e.loader=!0,o.updateNamespacePrefix(s.getActiveRepository(),t,a).then(function(){e.getNamespaces(),n.success(p.instant("namespace.saved")),e.loader=!1}).catch(function(a){const s=getError(a);return n.error(s,p.instant("common.error")),e.loader=!1,Promise.reject(a)})},e.editPrefix=function(a,t){e.loader=!0,i.getPrefix(s.getActiveRepository(),{from:a,to:t,location:s.getActiveRepositoryObject().location}).success(function(){e.getNamespaces(),e.loader=!1}).error(function(a){const s=getError(a);n.error(s,p.instant("common.error")),e.loader=!1})},e.editPrefixAndNamespace=async(e,a,s)=>{try{const n=a;let t=e;if(e||(t=""),!h(t,n))return"Prefix or namespace is invalid";const c=s.prefix;return m(t,c)&&await r.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result,d(t,c,n)}catch(e){return"Prefix overwrite cancelled"}};const m=(a,s)=>!!e.namespaces.find(e=>e.prefix===a&&s!==a),d=(a,s,n)=>e.saveNamespace(s,n).then(function(){s!==a&&e.editPrefix(s,a)});e.addNamespace=function(){if(e.namespace.prefix||(e.namespace.prefix=""),!h(e.namespace.prefix,e.namespace.namespace))return;e.selectedAll=!1;let a=!1;for(let s=0;s<e.namespaces.length;s++)e.namespaces[s].prefix===e.namespace.prefix&&(a=!0);a?r.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result.then(f):f()};const f=()=>{e.saveNamespace(e.namespace.prefix,e.namespace.namespace).then(()=>{e.namespace.namespace="",e.namespace.prefix="",setTimeout(()=>{e.form.$setUntouched(),e.form.$setPristine()})}).catch(()=>{})};e.removeNamespace=function(e){r.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.msg",{prefix:e.prefix}),warning:!0}).result.then(function(){u(e)})},e.checkAll=function(){angular.forEach(e.displayedNamespaces,function(a){a.selected=e.selectedAll})},e.deleteSelected=function(){let a=!1;angular.forEach(e.displayedNamespaces,function(s){a||s.selected&&(a=!0,r.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.selected"),warning:!0}).result.then(function(){e.loader=!0;const a=[];angular.forEach(e.displayedNamespaces,function(e){e.selected&&a.push(e)}),u(a.shift(),a),e.selectedAll=!1},function(){e.getNamespaces(),e.selectedAll=!1,e.searchNamespaces=""}))})};const u=(a,t)=>{let c;c="object"==typeof a?a.prefix:a,o.deleteNamespacePrefix(s.getActiveRepository(),c).success(function(){t&&t.length>0?(a=t.shift(),u(a,t)):(e.selectedAll=!1,e.namespace={},e.getNamespaces(),e.searchNamespaces="",e.haveSelected=!1,e.loader=!1,e.displayedNamespaces=[],void 0===t?n.success(p.instant("namespace.prefix.deleted.successfully",{prefix:c}),""):n.success(p.instant("namespace.selected.namespaces.deleted.successfully"),""))}).error(function(a){const s=getError(a);n.error(s,p.instant("common.error")),e.loader=!1})};e.checkIfSelectedNamespace=function(){e.haveSelected=!1,angular.forEach(e.namespaces,function(a){a.selected&&(e.haveSelected=!0)})};const g=function(){angular.forEach(e.namespaces,function(e){e.selected=!1})},h=(e,a)=>function(e){return""===e||e.match(t)}(e)?!angular.isUndefined(a)&&""!==a||(n.error(p.instant("namespace.warning.provide.namespace"),p.instant("common.error")),!1):(n.error(p.instant("namespace.invalid.prefix",{prefix:e},p.instant("common.error"))),!1)}]),n.controller("StandartModalCtrl",["$scope","$uibModalInstance",function(e,a){e.ok=function(){a.close(!0)},e.cancel=function(){a.dismiss("cancel")}}])}};
2
- //# sourceMappingURL=71099.ca7720893604e9d908d6.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"71099.ca7720893604e9d908d6.bundle.js","mappings":"sKAKA,MASMA,EAAaC,QAAQC,OAAO,2CATlB,CACZ,eACA,+CACA,0CACA,8CACA,oDACA,WAOEC,EAAa,WACf,MAAMC,EAAc,gFAIdC,EADWD,EACDE,2BAEhB,OAAO,IAAIC,OAAO,OAASH,EAAc,UAAYC,EAAU,YAAcA,EAAU,OAC3F,CARmB,GAcnBL,EAAWQ,WAAW,iBAAkB,CAAC,SAAU,QAAS,gBAAiB,SAAU,YAAa,eAAgB,0BAA2B,+BAAgC,aAC3K,SAAUC,EAAQC,EAAOC,EAAeC,EAAQC,EAAWC,EAAcC,EAAyBC,EAA8BC,GAC5HR,EAAOT,WAAa,CAAC,EACrBS,EAAOS,UAAY,CAAC,EACpBT,EAAOU,QAAS,EAChBV,EAAOW,cAAe,EACtBX,EAAOY,gBAAkB,CAAC,GAAI,GAAI,GAAI,KACtCZ,EAAOa,KAAO,EACdb,EAAOc,SAAWd,EAAOY,gBAAgB,GACzCZ,EAAOe,oBAAsB,GAE7Bf,EAAOgB,cAAgB,WACdd,EAAce,wBAInBjB,EAAOU,QAAS,EAChBV,EAAOT,WAAa,CAAC,EACrBgB,EAA6BS,cAAcd,EAAce,uBACpDC,QAAQ,SAAUC,GACfnB,EAAOT,WAAa4B,EAAKC,QAAQC,SAASC,IAAI,SAAUC,GACpD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WiD,QAAQ,sDAAuD,IAGrG,GAAGtB,MAAM,SAAUhB,GACnB,MAAMiB,EAAMC,SAASlB,GACrBhB,EAAOgC,MAAMC,EAAK5B,EAAWiD,QAAQ,iBACrCzD,EAAOU,QAAS,CACpB,IAGJV,EAAOsG,yBAA2B,WAC9BtG,EAAOW,cAAe,EACtBnB,QAAQ0D,QAAQlD,EAAOT,WAAY,SAAU4D,GACrCA,EAAK6C,WACLhG,EAAOW,cAAe,EAE9B,EACJ,EAEA,MAAMqC,EAAc,WAChBxD,QAAQ0D,QAAQlD,EAAOT,WAAY,SAAU4D,GACzCA,EAAK6C,UAAW,CACpB,EACJ,EAEMtB,EAA6BA,CAAClD,EAAQf,IAnWpD,SAAwBe,GACpB,MAAkB,KAAXA,GAAiBA,EAAO+E,MAAM7G,EACzC,CAkWiB8G,CAAehF,IAKhBhC,QAAQiH,YAAYhG,IAA4B,KAAdA,IAClCN,EAAOgC,MAAM3B,EAAWiD,QAAQ,uCAAwCjD,EAAWiD,QAAQ,kBACpF,IANPtD,EAAOgC,MAAM3B,EAAWiD,QAAQ,2BAA4B,CAACjC,OAAQA,GAAShB,EAAWiD,QAAQ,mBAC1F,EAUnB,IAEJlE,EAAWQ,WAAW,oBAAqB,CAAC,SAAU,oBAAqB,SAAUC,EAAQ0G,GAEzF1G,EAAO2G,GAAK,WAERD,EAAkBE,OADH,EAEnB,EAEA5G,EAAO6G,OAAS,WACZH,EAAkBI,QAAQ,SAC9B,CACJ,G","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/controllers.js"],"sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\nimport 'angular/core/services/repositories.service';\nimport 'angular/rest/rdf4j.repositories.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.services.jwtauth',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'toastr'\n];\n\nconst namespaces = angular.module('graphdb.framework.namespaces.controllers', modules);\n\n// A regular expression that validates a prefix according to the SPARQL 1.1 specification.\n// XXX: Technically this should include Unicode chars > 0xFFFF but those aren't fully supported in JavaScript\nconst pnPrefixRe = function () {\n const pnCharsBase = '[A-Z]|[a-z]|[\\u00C0-\\u00D6]|[\\u00D8-\\u00F6]|[\\u00F8-\\u02FF]|[\\u0370-\\u037D]'\n + '|[\\u037F-\\u1FFF]|[\\u200C-\\u200D]|[\\u2070-\\u218F]|[\\u2C00-\\u2FEF]|[\\u3001-\\uD7FF]'\n + '|[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFFD]';\n const pnCharsU = pnCharsBase + '|_';\n const pnChars = pnCharsU + '|-|[0-9]|\\u00B7|[\\u0300-\\u036F]|[\\u203F-\\u2040]';\n\n return new RegExp('^(?:' + pnCharsBase + ')(?:(?:' + pnChars + '|\\\\.)*(?:' + pnChars + '))?$');\n}();\n\nfunction validatePrefix(prefix) {\n return prefix === '' || prefix.match(pnPrefixRe);\n}\n\nnamespaces.controller('NamespacesCtrl', ['$scope', '$http', '$repositories', 'toastr', '$uibModal', 'ModalService', 'RepositoriesRestService', 'RDF4JRepositoriesRestService', '$translate',\n function ($scope, $http, $repositories, toastr, $uibModal, ModalService, RepositoriesRestService, RDF4JRepositoriesRestService, $translate) {\n $scope.namespaces = {};\n $scope.namespace = {};\n $scope.loader = false;\n $scope.haveSelected = false;\n $scope.pageSizeOptions = [10, 20, 50, 100];\n $scope.page = 1;\n $scope.pageSize = $scope.pageSizeOptions[0];\n $scope.displayedNamespaces = [];\n\n $scope.getNamespaces = function () {\n if (!$repositories.getActiveRepository()) {\n return;\n }\n\n $scope.loader = true;\n $scope.namespaces = {};\n RDF4JRepositoriesRestService.getNamespaces($repositories.getActiveRepository())\n .success(function (data) {\n $scope.namespaces = data.results.bindings.map(function (e) {\n return {\n prefix: e.prefix.value,\n namespace: e.namespace.value\n };\n });\n if ($scope.namespaces.length > 0) {\n $scope.namespaces.sort(function (a, b) {\n const prefixA = a.prefix.toUpperCase(); // ignore upper and lowercase\n const prefixB = b.prefix.toUpperCase(); // ignore upper and lowercase\n if (prefixA < prefixB) {\n return -1;\n }\n if (prefixA > prefixB) {\n return 1;\n }\n return 0;\n });\n $scope.matchedElements = $scope.namespaces;\n $scope.changePagination();\n }\n if ($scope.namespaces.length === 0) {\n // Remove the loader ourselves\n $scope.loader = false;\n } // else let the loaderPostRepeatDirective do it\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg);\n $scope.loader = false;\n });\n };\n\n $scope.changePagination = function () {\n if (angular.isDefined($scope.namespaces)) {\n $scope.displayedNamespaces = $scope.namespaces.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n };\n\n $scope.changePageSize = function (size) {\n $('.ot-graph-page-size').removeClass('active');\n $scope.page = 1;\n $scope.searchNamespaces = '';\n if (size) {\n $scope.getNamespaces();\n $scope.pageSize = size;\n }\n };\n\n $scope.$watch('matchedElements', function () {\n if (angular.isDefined($scope.matchedElements)) {\n $scope.displayedNamespaces = $scope.matchedElements.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n });\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, function () {\n $scope.searchNamespaces = '';\n $scope.getNamespaces();\n $scope.selectedAll = false;\n });\n\n $scope.onNamespaceSearch = function() {\n $scope.haveSelected = false;\n $scope.selectedAll = false;\n $scope.matchedElements = [];\n deselectAll();\n filterResults();\n };\n\n const filterResults = function() {\n angular.forEach($scope.namespaces, function (item) {\n if (item.namespace.indexOf($scope.searchNamespaces) !== -1 || item.prefix.indexOf($scope.searchNamespaces) !== -1) {\n $scope.matchedElements.push(item);\n }\n });\n };\n\n $scope.saveNamespace = function (prefix, namespace) {\n $scope.loader = true;\n return RDF4JRepositoriesRestService.updateNamespacePrefix($repositories.getActiveRepository(), namespace, prefix)\n .then(function () {\n $scope.getNamespaces();\n toastr.success($translate.instant('namespace.saved'));\n $scope.loader = false;\n }).catch(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n // Reject the promise so that the caller can handle the error as well. Some callers don't care about\n // the error and just want to know if the operation was successful or not. But there are also callers\n // that want to know the error details.\n return Promise.reject(data);\n });\n };\n\n $scope.editPrefix = function (oldPrefix, newPrefix) {\n $scope.loader = true;\n RepositoriesRestService.getPrefix($repositories.getActiveRepository(), {\n from: oldPrefix, to: newPrefix, location: $repositories.getActiveRepositoryObject().location})\n .success(function () {\n $scope.getNamespaces();\n $scope.loader = false;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n const confirmReplace = function (okCallback, cancelCallback) {\n return ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true\n }).result;\n };\n\n /**\n * Validates the prefix and namespace and checks if the prefix already exists. If the prefix already exists,\n * a confirmation dialog is shown to the user. If the user confirms the dialog, the flow continues and the\n * namespace is updated. If the user rejects the dialog, the flow continues in the catch block.\n *\n * <strong>Using async/await in order to be able to control the flow of the function and to be able to return a value\n * which is expected by the xeditable component. Otherwise, it won't behave as expected.</strong>\n *\n * @param {string} prefixValue The new prefix value.\n * @param {string} namespaceValue The new namespace value.\n * @param {*} namespaceObject The namespace object holding the old values.\n * @return {Promise<boolean|string>}\n */\n $scope.editPrefixAndNamespace = async (prefixValue, namespaceValue, namespaceObject) => {\n try {\n const namespace = namespaceValue;\n let prefix = prefixValue;\n if (!prefixValue) {\n prefix = '';\n }\n\n if (!validatePrefixAndNamespace(prefix, namespace)) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix or namespace is invalid';\n }\n\n const oldPrefix = namespaceObject.prefix;\n if (isPrefixExist(prefix, oldPrefix)) {\n // If the user rejects the confirmation dialog, the flow continues in the catch block.\n await ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true\n }).result;\n }\n return updateNamespace(prefix, oldPrefix, namespace);\n } catch (err) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix overwrite cancelled';\n }\n };\n\n /**\n * Checks if the prefix already exists in the list of namespaces.\n * @param {string} prefix The prefix to check.\n * @param {string} oldPrefix The old prefix value.\n * @return {boolean} True if the prefix already exists, false otherwise.\n */\n const isPrefixExist = (prefix, oldPrefix) => {\n return !!$scope.namespaces.find((elem) => elem.prefix === prefix && oldPrefix !== prefix);\n };\n\n /**\n * Updates the namespace and if the operation is successful, updates the prefix as well.\n * @param {string} newPrefix The new prefix value.\n * @param {string} oldPrefix The old prefix value.\n * @param {*} namespace The namespace object holding the old values.\n * @return {Promise<void>}\n */\n const updateNamespace = (newPrefix, oldPrefix, namespace) => {\n return $scope.saveNamespace(oldPrefix, namespace)\n .then(function () {\n if (oldPrefix !== newPrefix) {\n $scope.editPrefix(oldPrefix, newPrefix);\n }\n });\n };\n\n $scope.addNamespace = function () {\n if (!$scope.namespace.prefix) {\n $scope.namespace.prefix = '';\n }\n\n if (!validatePrefixAndNamespace($scope.namespace.prefix, $scope.namespace.namespace)) {\n return;\n }\n\n $scope.selectedAll = false;\n let prefixExist = false;\n for (let i = 0; i < $scope.namespaces.length; i++) {\n if ($scope.namespaces[i].prefix === $scope.namespace.prefix) {\n prefixExist = true;\n }\n }\n if (prefixExist) {\n confirmReplace().then(saveNamespaceAndUpdateTheUI);\n } else {\n saveNamespaceAndUpdateTheUI();\n }\n };\n\n /**\n * Saves the namespace and if operation is successful, resets the form state.\n */\n const saveNamespaceAndUpdateTheUI = () => {\n $scope.saveNamespace($scope.namespace.prefix, $scope.namespace.namespace)\n .then(() => {\n $scope.namespace.namespace = '';\n $scope.namespace.prefix = '';\n // Not sure why the timeout is needed here. Probably resetting the values above needs to be\n // reflected first in the form state and then the form validation model needs to be reset.\n setTimeout(() => {\n $scope.form.$setUntouched();\n $scope.form.$setPristine();\n });\n })\n .catch(() => {\n // Do nothing, the error is already handled in the saveNamespace function\n });\n };\n\n $scope.removeNamespace = function (namespace) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.msg', {prefix: namespace.prefix}),\n warning: true\n }).result.then(function () {\n deleteNamespace(namespace);\n });\n };\n\n $scope.checkAll = function () {\n angular.forEach($scope.displayedNamespaces, function (item) {\n item.selected = $scope.selectedAll;\n });\n };\n\n $scope.deleteSelected = function () {\n const openModalInstance = function () {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.selected'),\n warning: true\n }).result.then(function () {\n $scope.loader = true;\n const namespaces = [];\n angular.forEach($scope.displayedNamespaces, function (namespace) {\n if (namespace.selected) {\n namespaces.push(namespace);\n }\n });\n deleteNamespace(namespaces.shift(), namespaces);\n $scope.selectedAll = false;\n }, function () {\n $scope.getNamespaces();\n $scope.selectedAll = false;\n $scope.searchNamespaces = '';\n });\n };\n\n let modalInstanceOpened = false;\n angular.forEach($scope.displayedNamespaces, function (namespace) {\n if (!modalInstanceOpened) {\n if (namespace.selected) {\n modalInstanceOpened = true;\n openModalInstance();\n }\n }\n });\n };\n\n const deleteNamespace = (namespace, namespaces)=> {\n let prefix;\n if (typeof namespace === 'object') {\n prefix = namespace.prefix;\n } else {\n prefix = namespace;\n }\n RDF4JRepositoriesRestService.deleteNamespacePrefix($repositories.getActiveRepository(), prefix)\n .success(function () {\n if (namespaces && namespaces.length > 0) {\n namespace = namespaces.shift();\n deleteNamespace(namespace, namespaces);\n } else {\n $scope.selectedAll = false;\n $scope.namespace = {};\n $scope.getNamespaces();\n $scope.searchNamespaces = '';\n $scope.haveSelected = false;\n $scope.loader = false;\n $scope.displayedNamespaces = [];\n if (namespaces === undefined) {\n toastr.success($translate.instant('namespace.prefix.deleted.successfully', {prefix: prefix}), '');\n } else {\n toastr.success($translate.instant('namespace.selected.namespaces.deleted.successfully'), '');\n }\n }\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n $scope.checkIfSelectedNamespace = function () {\n $scope.haveSelected = false;\n angular.forEach($scope.namespaces, function (item) {\n if (item.selected) {\n $scope.haveSelected = true;\n }\n });\n };\n\n const deselectAll = function () {\n angular.forEach($scope.namespaces, function (item) {\n item.selected = false;\n });\n };\n\n const validatePrefixAndNamespace = (prefix, namespace) => {\n if (!validatePrefix(prefix)) {\n toastr.error($translate.instant('namespace.invalid.prefix', {prefix: prefix}, $translate.instant('common.error')));\n return false;\n }\n\n if (angular.isUndefined(namespace) || namespace === '') {\n toastr.error($translate.instant('namespace.warning.provide.namespace'), $translate.instant('common.error'));\n return false;\n }\n\n return true;\n };\n }]);\n\nnamespaces.controller('StandartModalCtrl', ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n\n $scope.ok = function () {\n const result = true;\n $uibModalInstance.close(result);\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}]);\n"],"names":["namespaces","angular","module","pnPrefixRe","pnCharsBase","pnChars","pnCharsU","RegExp","controller","$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate","namespace","loader","haveSelected","pageSizeOptions","page","pageSize","displayedNamespaces","getNamespaces","getActiveRepository","success","data","results","bindings","map","e","prefix","value","length","sort","a","b","prefixA","toUpperCase","prefixB","matchedElements","changePagination","error","msg","getError","isDefined","slice","changePageSize","size","$","removeClass","searchNamespaces","$watch","selectedAll","onNamespaceSearch","deselectAll","filterResults","forEach","item","indexOf","push","saveNamespace","updateNamespacePrefix","then","instant","catch","Promise","reject","editPrefix","oldPrefix","newPrefix","getPrefix","from","to","location","getActiveRepositoryObject","editPrefixAndNamespace","async","prefixValue","namespaceValue","namespaceObject","validatePrefixAndNamespace","isPrefixExist","openSimpleModal","title","message","warning","result","updateNamespace","err","find","elem","addNamespace","prefixExist","i","saveNamespaceAndUpdateTheUI","setTimeout","form","$setUntouched","$setPristine","removeNamespace","deleteNamespace","checkAll","selected","deleteSelected","modalInstanceOpened","shift","deleteNamespacePrefix","undefined","checkIfSelectedNamespace","match","validatePrefix","isUndefined","$uibModalInstance","ok","close","cancel","dismiss"],"ignoreList":[],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=75881;export const __webpack_esm_ids__=[41482,54745,71099,75881];export const __webpack_esm_modules__={41482(){angular.module("graphdb.framework.namespaces.directives",["ngRoute"]).directive("loaderPostRepeatDirective",["$timeout",function(e){return function(a){a.$last&&e(function(){a.$parent.loader=!1},0)}}])},54745(){angular.module("graphdb.framework.core.directives.paginations",[]).directive("paginations",["$translate","$rootScope","$compile",function(e,a,t){return{link:function(e,s){const n=()=>{const a=t('<uib-pagination class="nav navbar-right" total-items="matchedElements.length" items-per-page="pageSize" ng-model="page" ng-change="changePagination()" direction-links="false" boundary-links="true" max-size="5" rotate="true" first-text="{{\'paginator.first.page.label\' | translate}}" last-text="{{\'paginator.last.page.label\' | translate}}"></uib-pagination>')(e);s.html(a)};n();const r=a.$on("$translateChangeSuccess",n);e.$on("$destroy",r)}}}])},71099(e,a,t){t(82493),t(98599),t(76933),t(98977);const s=angular.module("graphdb.framework.namespaces.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.framework.rest.repositories.service","graphdb.framework.rest.rdf4j.repositories.service","toastr"]),n=function(){const e="[A-Z]|[a-z]|[À-Ö]|[Ø-ö]|[ø-˿]|[Ͱ-ͽ]|[Ϳ-῿]|[‌-‍]|[⁰-↏]|[Ⰰ-⿯]|[、-퟿]|[豈-﷏]|[ﷰ-�]",a=e+"|_|-|[0-9]|·|[̀-ͯ]|[‿-⁀]";return new RegExp("^(?:"+e+")(?:(?:"+a+"|\\.)*(?:"+a+"))?$")}();s.controller("NamespacesCtrl",["$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate",function(e,a,t,s,r,c,i,o,p){e.namespaces={},e.namespace={},e.loader=!1,e.haveSelected=!1,e.pageSizeOptions=[10,20,50,100],e.page=1,e.pageSize=e.pageSizeOptions[0],e.displayedNamespaces=[],e.getNamespaces=function(){t.getActiveRepository()&&(e.loader=!0,e.namespaces={},o.getNamespaces(t.getActiveRepository()).success(function(a){e.namespaces=a.results.bindings.map(function(e){return{prefix:e.prefix.value,namespace:e.namespace.value}}),e.namespaces.length>0&&(e.namespaces.sort(function(e,a){const t=e.prefix.toUpperCase(),s=a.prefix.toUpperCase();return t<s?-1:t>s?1:0}),e.matchedElements=e.namespaces,e.changePagination()),0===e.namespaces.length&&(e.loader=!1)}).error(function(a){const t=getError(a);s.error(t),e.loader=!1}))},e.changePagination=function(){angular.isDefined(e.namespaces)&&(e.displayedNamespaces=e.namespaces.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(a){$(".ot-graph-page-size").removeClass("active"),e.page=1,e.searchNamespaces="",a&&(e.getNamespaces(),e.pageSize=a)},e.$watch("matchedElements",function(){angular.isDefined(e.matchedElements)&&(e.displayedNamespaces=e.matchedElements.slice(e.pageSize*(e.page-1),e.pageSize*e.page))}),e.$watch(function(){return t.getActiveRepository()},function(){e.searchNamespaces="",e.getNamespaces(),e.selectedAll=!1}),e.onNamespaceSearch=function(){e.haveSelected=!1,e.selectedAll=!1,e.matchedElements=[],g(),l()};const l=function(){angular.forEach(e.namespaces,function(a){-1===a.namespace.indexOf(e.searchNamespaces)&&-1===a.prefix.indexOf(e.searchNamespaces)||e.matchedElements.push(a)})};e.saveNamespace=function(a,n){return e.loader=!0,o.updateNamespacePrefix(t.getActiveRepository(),n,a).then(function(){e.getNamespaces(),s.success(p.instant("namespace.saved")),e.loader=!1}).catch(function(a){const t=getError(a);return s.error(t,p.instant("common.error")),e.loader=!1,Promise.reject(a)})},e.editPrefix=function(a,n){e.loader=!0,i.getPrefix(t.getActiveRepository(),{from:a,to:n,location:t.getActiveRepositoryObject().location}).success(function(){e.getNamespaces(),e.loader=!1}).error(function(a){const t=getError(a);s.error(t,p.instant("common.error")),e.loader=!1})},e.editPrefixAndNamespace=async(e,a,t)=>{try{const s=a;let n=e;if(e||(n=""),!h(n,s))return"Prefix or namespace is invalid";const r=t.prefix;return m(n,r)&&await c.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result,d(n,r,s)}catch(e){return"Prefix overwrite cancelled"}};const m=(a,t)=>!!e.namespaces.find(e=>e.prefix===a&&t!==a),d=(a,t,s)=>e.saveNamespace(t,s).then(function(){t!==a&&e.editPrefix(t,a)});e.addNamespace=function(){if(e.namespace.prefix||(e.namespace.prefix=""),!h(e.namespace.prefix,e.namespace.namespace))return;e.selectedAll=!1;let a=!1;for(let t=0;t<e.namespaces.length;t++)e.namespaces[t].prefix===e.namespace.prefix&&(a=!0);a?c.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result.then(f):f()};const f=()=>{e.saveNamespace(e.namespace.prefix,e.namespace.namespace).then(()=>{e.namespace.namespace="",e.namespace.prefix="",setTimeout(()=>{e.form.$setUntouched(),e.form.$setPristine()})}).catch(()=>{})};e.removeNamespace=function(e){c.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.msg",{prefix:e.prefix}),warning:!0}).result.then(function(){u(e)})},e.checkAll=function(){angular.forEach(e.displayedNamespaces,function(a){a.selected=e.selectedAll})},e.deleteSelected=function(){let a=!1;angular.forEach(e.displayedNamespaces,function(t){a||t.selected&&(a=!0,c.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.selected"),warning:!0}).result.then(function(){e.loader=!0;const a=[];angular.forEach(e.displayedNamespaces,function(e){e.selected&&a.push(e)}),u(a.shift(),a),e.selectedAll=!1},function(){e.getNamespaces(),e.selectedAll=!1,e.searchNamespaces=""}))})};const u=(a,n)=>{let r;r="object"==typeof a?a.prefix:a,o.deleteNamespacePrefix(t.getActiveRepository(),r).success(function(){n&&n.length>0?(a=n.shift(),u(a,n)):(e.selectedAll=!1,e.namespace={},e.getNamespaces(),e.searchNamespaces="",e.haveSelected=!1,e.loader=!1,e.displayedNamespaces=[],void 0===n?s.success(p.instant("namespace.prefix.deleted.successfully",{prefix:r}),""):s.success(p.instant("namespace.selected.namespaces.deleted.successfully"),""))}).error(function(a){const t=getError(a);s.error(t,p.instant("common.error")),e.loader=!1})};e.checkIfSelectedNamespace=function(){e.haveSelected=!1,angular.forEach(e.namespaces,function(a){a.selected&&(e.haveSelected=!0)})};const g=function(){angular.forEach(e.namespaces,function(e){e.selected=!1})},h=(e,a)=>function(e){return""===e||e.match(n)}(e)?!angular.isUndefined(a)&&""!==a||(s.error(p.instant("namespace.warning.provide.namespace"),p.instant("common.error")),!1):(s.error(p.instant("namespace.invalid.prefix",{prefix:e},p.instant("common.error"))),!1)}]),s.controller("StandartModalCtrl",["$scope","$uibModalInstance",function(e,a){e.ok=function(){a.close(!0)},e.cancel=function(){a.dismiss("cancel")}}])},75881(e,a,t){t(82493),t(5687),t(76933),t(71099),t(41482),t(54745),t(35596),angular.module("graphdb.framework.namespaces",["LocalStorageModule","xeditable","ngAnimate","ngRoute","toastr","graphdb.framework.namespaces.controllers","graphdb.framework.namespaces.directives","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.directives.paginations"]).run(["editableOptions",function(e){e.theme="bs3"}])}};
2
- //# sourceMappingURL=75881.54dc716f79b6fe29232a.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"75881.54dc716f79b6fe29232a.bundle.js","mappings":"+IAA6BA,QAAQC,OAAO,0CAA2C,CAAC,YAGnEC,UAAU,4BAA6B,CAAC,WAAY,SAAUC,GAC/E,OAAO,SAAUC,GACTA,EAAMC,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AE9FnB,EAAOa,QAAQjC,EAAWwE,QAAQ,sDAAuD,IAGrG,GAAGtB,MAAM,SAAUhB,GACnB,MAAMiB,EAAMC,SAASlB,GACrBd,EAAO8B,MAAMC,EAAKnD,EAAWwE,QAAQ,iBACrCpE,EAAOL,QAAS,CACpB,IAGJK,EAAOiH,yBAA2B,WAC9BjH,EAAOsB,cAAe,EACtBlC,QAAQyE,QAAQ7D,EAAOO,WAAY,SAAUuD,GACrCA,EAAK6C,WACL3G,EAAOsB,cAAe,EAE9B,EACJ,EAEA,MAAMqC,EAAc,WAChBvE,QAAQyE,QAAQ7D,EAAOO,WAAY,SAAUuD,GACzCA,EAAK6C,UAAW,CACpB,EACJ,EAEMtB,EAA6BA,CAAClD,EAAQd,IAnWpD,SAAwBc,GACpB,MAAkB,KAAXA,GAAiBA,EAAO+E,MAAM1G,EACzC,CAkWiB2G,CAAehF,IAKhB/C,QAAQgI,YAAY/F,IAA4B,KAAdA,IAClCL,EAAO8B,MAAMlD,EAAWwE,QAAQ,uCAAwCxE,EAAWwE,QAAQ,kBACpF,IANPpD,EAAO8B,MAAMlD,EAAWwE,QAAQ,2BAA4B,CAACjC,OAAQA,GAASvC,EAAWwE,QAAQ,mBAC1F,EAUnB,IAEJ7D,EAAWM,WAAW,oBAAqB,CAAC,SAAU,oBAAqB,SAAUb,EAAQqH,GAEzFrH,EAAOsH,GAAK,WAERD,EAAkBE,OADH,EAEnB,EAEAvH,EAAOwH,OAAS,WACZH,EAAkBI,QAAQ,SAC9B,CACJ,G,6ECnYsBrI,QAAQC,OAAO,+BAbrB,CACZ,qBACA,YACA,YACA,UACA,SACA,2CACA,0CACA,+CACA,oCACA,kDAKUqI,IAAI,CAAC,kBAAmB,SAAUC,GAC5CA,EAAgBC,MAAQ,KAC5B,G","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/directives.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/paginations.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/app.js"],"sourcesContent":["const namespacesDirectives = angular.module('graphdb.framework.namespaces.directives', ['ngRoute']);\n\n// This directive will set the loader to false once the respective ngRepeat is done loading\nnamespacesDirectives.directive('loaderPostRepeatDirective', ['$timeout', function ($timeout) {\n return function (scope) {\n if (scope.$last) {\n // It's important to do this with timeout:\n // \"...since the setTimeout function gets pushed to the end of the queue of the browser,\n // its always right after everything is done in angular, usually ngRepeat which continues\n // after its parents postLinking function\"\n $timeout(function () {\n scope.$parent.loader = false;\n }, 0);\n }\n };\n}]);\n","// Due to a problem in the uib-pagination library, the template needs to be recompiled, in order to set the first and last text in a new language\nangular.module('graphdb.framework.core.directives.paginations', [])\n .directive('paginations', [\"$translate\", \"$rootScope\", \"$compile\", function ($translate, $rootScope, $compile) {\n return {\n link: function ($scope, element) {\n const template = '<uib-pagination class=\"nav navbar-right\" ' +\n 'total-items=\"matchedElements.length\" ' +\n 'items-per-page=\"pageSize\" ' +\n 'ng-model=\"page\" ' +\n 'ng-change=\"changePagination()\" ' +\n 'direction-links=\"false\" ' +\n 'boundary-links=\"true\" ' +\n 'max-size=\"5\" ' +\n 'rotate=\"true\" ' +\n 'first-text=\"{{\\'paginator.first.page.label\\' | translate}}\" ' +\n 'last-text=\"{{\\'paginator.last.page.label\\' | translate}}\"></uib-pagination>';\n\n const recompileDirective = () => {\n const compiledTemplate = $compile(template)($scope);\n element.html(compiledTemplate);\n };\n\n recompileDirective();\n const languageChangedSubscription = $rootScope.$on('$translateChangeSuccess', recompileDirective);\n $scope.$on('$destroy', languageChangedSubscription);\n }\n };\n }]);\n","import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\nimport 'angular/core/services/repositories.service';\nimport 'angular/rest/rdf4j.repositories.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.services.jwtauth',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'toastr'\n];\n\nconst namespaces = angular.module('graphdb.framework.namespaces.controllers', modules);\n\n// A regular expression that validates a prefix according to the SPARQL 1.1 specification.\n// XXX: Technically this should include Unicode chars > 0xFFFF but those aren't fully supported in JavaScript\nconst pnPrefixRe = function () {\n const pnCharsBase = '[A-Z]|[a-z]|[\\u00C0-\\u00D6]|[\\u00D8-\\u00F6]|[\\u00F8-\\u02FF]|[\\u0370-\\u037D]'\n + '|[\\u037F-\\u1FFF]|[\\u200C-\\u200D]|[\\u2070-\\u218F]|[\\u2C00-\\u2FEF]|[\\u3001-\\uD7FF]'\n + '|[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFFD]';\n const pnCharsU = pnCharsBase + '|_';\n const pnChars = pnCharsU + '|-|[0-9]|\\u00B7|[\\u0300-\\u036F]|[\\u203F-\\u2040]';\n\n return new RegExp('^(?:' + pnCharsBase + ')(?:(?:' + pnChars + '|\\\\.)*(?:' + pnChars + '))?$');\n}();\n\nfunction validatePrefix(prefix) {\n return prefix === '' || prefix.match(pnPrefixRe);\n}\n\nnamespaces.controller('NamespacesCtrl', ['$scope', '$http', '$repositories', 'toastr', '$uibModal', 'ModalService', 'RepositoriesRestService', 'RDF4JRepositoriesRestService', '$translate',\n function ($scope, $http, $repositories, toastr, $uibModal, ModalService, RepositoriesRestService, RDF4JRepositoriesRestService, $translate) {\n $scope.namespaces = {};\n $scope.namespace = {};\n $scope.loader = false;\n $scope.haveSelected = false;\n $scope.pageSizeOptions = [10, 20, 50, 100];\n $scope.page = 1;\n $scope.pageSize = $scope.pageSizeOptions[0];\n $scope.displayedNamespaces = [];\n\n $scope.getNamespaces = function () {\n if (!$repositories.getActiveRepository()) {\n return;\n }\n\n $scope.loader = true;\n $scope.namespaces = {};\n RDF4JRepositoriesRestService.getNamespaces($repositories.getActiveRepository())\n .success(function (data) {\n $scope.namespaces = data.results.bindings.map(function (e) {\n return {\n prefix: e.prefix.value,\n namespace: e.namespace.value\n };\n });\n if ($scope.namespaces.length > 0) {\n $scope.namespaces.sort(function (a, b) {\n const prefixA = a.prefix.toUpperCase(); // ignore upper and lowercase\n const prefixB = b.prefix.toUpperCase(); // ignore upper and lowercase\n if (prefixA < prefixB) {\n return -1;\n }\n if (prefixA > prefixB) {\n return 1;\n }\n return 0;\n });\n $scope.matchedElements = $scope.namespaces;\n $scope.changePagination();\n }\n if ($scope.namespaces.length === 0) {\n // Remove the loader ourselves\n $scope.loader = false;\n } // else let the loaderPostRepeatDirective do it\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg);\n $scope.loader = false;\n });\n };\n\n $scope.changePagination = function () {\n if (angular.isDefined($scope.namespaces)) {\n $scope.displayedNamespaces = $scope.namespaces.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n };\n\n $scope.changePageSize = function (size) {\n $('.ot-graph-page-size').removeClass('active');\n $scope.page = 1;\n $scope.searchNamespaces = '';\n if (size) {\n $scope.getNamespaces();\n $scope.pageSize = size;\n }\n };\n\n $scope.$watch('matchedElements', function () {\n if (angular.isDefined($scope.matchedElements)) {\n $scope.displayedNamespaces = $scope.matchedElements.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n });\n\n $scope.$watch(function () {\n return $repositories.getActiveRepository();\n }, function () {\n $scope.searchNamespaces = '';\n $scope.getNamespaces();\n $scope.selectedAll = false;\n });\n\n $scope.onNamespaceSearch = function() {\n $scope.haveSelected = false;\n $scope.selectedAll = false;\n $scope.matchedElements = [];\n deselectAll();\n filterResults();\n };\n\n const filterResults = function() {\n angular.forEach($scope.namespaces, function (item) {\n if (item.namespace.indexOf($scope.searchNamespaces) !== -1 || item.prefix.indexOf($scope.searchNamespaces) !== -1) {\n $scope.matchedElements.push(item);\n }\n });\n };\n\n $scope.saveNamespace = function (prefix, namespace) {\n $scope.loader = true;\n return RDF4JRepositoriesRestService.updateNamespacePrefix($repositories.getActiveRepository(), namespace, prefix)\n .then(function () {\n $scope.getNamespaces();\n toastr.success($translate.instant('namespace.saved'));\n $scope.loader = false;\n }).catch(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n // Reject the promise so that the caller can handle the error as well. Some callers don't care about\n // the error and just want to know if the operation was successful or not. But there are also callers\n // that want to know the error details.\n return Promise.reject(data);\n });\n };\n\n $scope.editPrefix = function (oldPrefix, newPrefix) {\n $scope.loader = true;\n RepositoriesRestService.getPrefix($repositories.getActiveRepository(), {\n from: oldPrefix, to: newPrefix, location: $repositories.getActiveRepositoryObject().location})\n .success(function () {\n $scope.getNamespaces();\n $scope.loader = false;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n const confirmReplace = function (okCallback, cancelCallback) {\n return ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true\n }).result;\n };\n\n /**\n * Validates the prefix and namespace and checks if the prefix already exists. If the prefix already exists,\n * a confirmation dialog is shown to the user. If the user confirms the dialog, the flow continues and the\n * namespace is updated. If the user rejects the dialog, the flow continues in the catch block.\n *\n * <strong>Using async/await in order to be able to control the flow of the function and to be able to return a value\n * which is expected by the xeditable component. Otherwise, it won't behave as expected.</strong>\n *\n * @param {string} prefixValue The new prefix value.\n * @param {string} namespaceValue The new namespace value.\n * @param {*} namespaceObject The namespace object holding the old values.\n * @return {Promise<boolean|string>}\n */\n $scope.editPrefixAndNamespace = async (prefixValue, namespaceValue, namespaceObject) => {\n try {\n const namespace = namespaceValue;\n let prefix = prefixValue;\n if (!prefixValue) {\n prefix = '';\n }\n\n if (!validatePrefixAndNamespace(prefix, namespace)) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix or namespace is invalid';\n }\n\n const oldPrefix = namespaceObject.prefix;\n if (isPrefixExist(prefix, oldPrefix)) {\n // If the user rejects the confirmation dialog, the flow continues in the catch block.\n await ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true\n }).result;\n }\n return updateNamespace(prefix, oldPrefix, namespace);\n } catch (err) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix overwrite cancelled';\n }\n };\n\n /**\n * Checks if the prefix already exists in the list of namespaces.\n * @param {string} prefix The prefix to check.\n * @param {string} oldPrefix The old prefix value.\n * @return {boolean} True if the prefix already exists, false otherwise.\n */\n const isPrefixExist = (prefix, oldPrefix) => {\n return !!$scope.namespaces.find((elem) => elem.prefix === prefix && oldPrefix !== prefix);\n };\n\n /**\n * Updates the namespace and if the operation is successful, updates the prefix as well.\n * @param {string} newPrefix The new prefix value.\n * @param {string} oldPrefix The old prefix value.\n * @param {*} namespace The namespace object holding the old values.\n * @return {Promise<void>}\n */\n const updateNamespace = (newPrefix, oldPrefix, namespace) => {\n return $scope.saveNamespace(oldPrefix, namespace)\n .then(function () {\n if (oldPrefix !== newPrefix) {\n $scope.editPrefix(oldPrefix, newPrefix);\n }\n });\n };\n\n $scope.addNamespace = function () {\n if (!$scope.namespace.prefix) {\n $scope.namespace.prefix = '';\n }\n\n if (!validatePrefixAndNamespace($scope.namespace.prefix, $scope.namespace.namespace)) {\n return;\n }\n\n $scope.selectedAll = false;\n let prefixExist = false;\n for (let i = 0; i < $scope.namespaces.length; i++) {\n if ($scope.namespaces[i].prefix === $scope.namespace.prefix) {\n prefixExist = true;\n }\n }\n if (prefixExist) {\n confirmReplace().then(saveNamespaceAndUpdateTheUI);\n } else {\n saveNamespaceAndUpdateTheUI();\n }\n };\n\n /**\n * Saves the namespace and if operation is successful, resets the form state.\n */\n const saveNamespaceAndUpdateTheUI = () => {\n $scope.saveNamespace($scope.namespace.prefix, $scope.namespace.namespace)\n .then(() => {\n $scope.namespace.namespace = '';\n $scope.namespace.prefix = '';\n // Not sure why the timeout is needed here. Probably resetting the values above needs to be\n // reflected first in the form state and then the form validation model needs to be reset.\n setTimeout(() => {\n $scope.form.$setUntouched();\n $scope.form.$setPristine();\n });\n })\n .catch(() => {\n // Do nothing, the error is already handled in the saveNamespace function\n });\n };\n\n $scope.removeNamespace = function (namespace) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.msg', {prefix: namespace.prefix}),\n warning: true\n }).result.then(function () {\n deleteNamespace(namespace);\n });\n };\n\n $scope.checkAll = function () {\n angular.forEach($scope.displayedNamespaces, function (item) {\n item.selected = $scope.selectedAll;\n });\n };\n\n $scope.deleteSelected = function () {\n const openModalInstance = function () {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.selected'),\n warning: true\n }).result.then(function () {\n $scope.loader = true;\n const namespaces = [];\n angular.forEach($scope.displayedNamespaces, function (namespace) {\n if (namespace.selected) {\n namespaces.push(namespace);\n }\n });\n deleteNamespace(namespaces.shift(), namespaces);\n $scope.selectedAll = false;\n }, function () {\n $scope.getNamespaces();\n $scope.selectedAll = false;\n $scope.searchNamespaces = '';\n });\n };\n\n let modalInstanceOpened = false;\n angular.forEach($scope.displayedNamespaces, function (namespace) {\n if (!modalInstanceOpened) {\n if (namespace.selected) {\n modalInstanceOpened = true;\n openModalInstance();\n }\n }\n });\n };\n\n const deleteNamespace = (namespace, namespaces)=> {\n let prefix;\n if (typeof namespace === 'object') {\n prefix = namespace.prefix;\n } else {\n prefix = namespace;\n }\n RDF4JRepositoriesRestService.deleteNamespacePrefix($repositories.getActiveRepository(), prefix)\n .success(function () {\n if (namespaces && namespaces.length > 0) {\n namespace = namespaces.shift();\n deleteNamespace(namespace, namespaces);\n } else {\n $scope.selectedAll = false;\n $scope.namespace = {};\n $scope.getNamespaces();\n $scope.searchNamespaces = '';\n $scope.haveSelected = false;\n $scope.loader = false;\n $scope.displayedNamespaces = [];\n if (namespaces === undefined) {\n toastr.success($translate.instant('namespace.prefix.deleted.successfully', {prefix: prefix}), '');\n } else {\n toastr.success($translate.instant('namespace.selected.namespaces.deleted.successfully'), '');\n }\n }\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n $scope.checkIfSelectedNamespace = function () {\n $scope.haveSelected = false;\n angular.forEach($scope.namespaces, function (item) {\n if (item.selected) {\n $scope.haveSelected = true;\n }\n });\n };\n\n const deselectAll = function () {\n angular.forEach($scope.namespaces, function (item) {\n item.selected = false;\n });\n };\n\n const validatePrefixAndNamespace = (prefix, namespace) => {\n if (!validatePrefix(prefix)) {\n toastr.error($translate.instant('namespace.invalid.prefix', {prefix: prefix}, $translate.instant('common.error')));\n return false;\n }\n\n if (angular.isUndefined(namespace) || namespace === '') {\n toastr.error($translate.instant('namespace.warning.provide.namespace'), $translate.instant('common.error'));\n return false;\n }\n\n return true;\n };\n }]);\n\nnamespaces.controller('StandartModalCtrl', ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n\n $scope.ok = function () {\n const result = true;\n $uibModalInstance.close(result);\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}]);\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/core/services/repositories.service';\nimport 'angular/namespaces/controllers';\nimport 'angular/namespaces/directives';\nimport 'angular/core/directives/paginations';\nimport 'angular-xeditable/dist/js/xeditable.min';\n\nconst modules = [\n 'LocalStorageModule',\n 'xeditable',\n 'ngAnimate',\n 'ngRoute',\n 'toastr',\n 'graphdb.framework.namespaces.controllers',\n 'graphdb.framework.namespaces.directives',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.directives',\n 'graphdb.framework.core.directives.paginations'\n];\n\nconst namespacesApp = angular.module('graphdb.framework.namespaces', modules);\n\nnamespacesApp.run(['editableOptions', function (editableOptions) {\n editableOptions.theme = 'bs3';\n}]);\n"],"names":["angular","module","directive","$timeout","scope","$last","$parent","loader","$translate","$rootScope","$compile","link","$scope","element","recompileDirective","compiledTemplate","html","languageChangedSubscription","$on","namespaces","pnPrefixRe","pnCharsBase","pnChars","pnCharsU","RegExp","controller","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","namespace","haveSelected","pageSizeOptions","page","pageSize","displayedNamespaces","getNamespaces","getActiveRepository","success","data","results","bindings","map","e","prefix","value","length","sort","a","b","prefixA","toUpperCase","prefixB","matchedElements","changePagination","error","msg","getError","isDefined","slice","changePageSize","size","$","removeClass","searchNamespaces","$watch","selectedAll","onNamespaceSearch","deselectAll","filterResults","forEach","item","indexOf","push","saveNamespace","updateNamespacePrefix","then","instant","catch","Promise","reject","editPrefix","oldPrefix","newPrefix","getPrefix","from","to","location","getActiveRepositoryObject","editPrefixAndNamespace","async","prefixValue","namespaceValue","namespaceObject","validatePrefixAndNamespace","isPrefixExist","openSimpleModal","title","message","warning","result","updateNamespace","err","find","elem","addNamespace","prefixExist","i","saveNamespaceAndUpdateTheUI","setTimeout","form","$setUntouched","$setPristine","removeNamespace","deleteNamespace","checkAll","selected","deleteSelected","modalInstanceOpened","shift","deleteNamespacePrefix","undefined","checkIfSelectedNamespace","match","validatePrefix","isUndefined","$uibModalInstance","ok","close","cancel","dismiss","run","editableOptions","theme"],"ignoreList":[],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- export const __webpack_esm_id__=78070;export const __webpack_esm_ids__=[2134,27899,43006,78070,78618];export const __webpack_esm_modules__={2134(e,t,n){n.d(t,{x:()=>r});class r extends Error{}},27899(e,t,n){n.d(t,{Q:()=>o,y:()=>r});class r{constructor(e,t,n,r){this.status=e,this.mesage=r,this.messageLabelKey=t,this.parameters=n}}const o={ERROR:"error",SUCCESS:"success"}},43006(e,t,n){n.d(t,{H:()=>r});const r={CREATE:"create",REPAIR:"repair",DROP:"drop"}},78070(e,t,n){var r=n(98857),o=n(85694),a=(n(61105),n(20227),n(85727)),s=n(14604),i=n(43006),c=n(27899),u=n(97421),d=n(60529),l=n(78618),p=n(22201),g=n(2134),m=n(10799),y=(n(81655),n(304)),h=n(57154);const S=y.I.logger;function v(e,t,n,y,v,E,f,C,R,w,q,A,_,b,x,L,T){const P=(0,h.service)(h.SecurityContextService);this.repository="";const O="#query-editor";let U=E.getActiveRepository(),Q=E.isActiveRepoOntopType();t.yasguiConfig=void 0,t.savedQueryConfig=void 0,t.prefixes={},t.inferUserSetting=!0,t.sameAsUserSetting=!0;const N=new Map;let k=!1;t.updateConfig=e=>{t.yasguiConfig={endpoint:I,componentId:p.y,prefixes:t.prefixes,infer:Q||t.inferUserSetting,sameAs:Q||t.sameAsUserSetting,yasrToolbarPlugins:[z],beforeUpdateQuery:V(),outputHandlers:new Map([[u.r.QUERY_EXECUTED,$],[u.r.REQUEST_ABORTED,M]]),clearState:void 0!==e&&e}},t.getActiveRepositoryNoError=()=>U;const I=e=>{const t=(e=>{const t=e.getTab();if(t)return t.getYasqe()})(e);if(t)return E.resolveSparqlEndpoint(t.getQueryMode())},$=e=>{const t=N.get(e.tabId);t&&(t.dismiss(),N.delete(e.tabId))},M=e=>{if(e&&m.g.UPDATE!==e.queryMode){const t=e.getRepository(),n=e.getQueryTrackAlias();t&&n&&b.deleteQuery(n,t)}},D=e=>a.p3.getOntotextYasguiElementAsync(O).then(t=>t.openTab(e)).then(e=>a.p3.highlightTabName(e)),Y=()=>{k=!0;const e=y.search()[h.REPOSITORY_ID_PARAM];y.search(e?{repositoryId:e}:{}),y.replace()},G=e=>e?a.p3.getOntotextYasguiElementAsync(O).then(H).then(j):Promise.resolve(),H=e=>e.getQueryMode().then(t=>({yasguiComponent:e,queryMode:t})),j=({yasguiComponent:e,queryMode:t})=>"update"!==t?e.query():new Promise(t=>{const n=R.instant("confirm.execute"),r=(0,d.Gz)(R.instant("query.editor.automatically.execute.update.warning"));_.openConfirmation(n,r,()=>t(e.query()),()=>t())}),z={createElement:e=>{const t=document.createElement("span");t.classList.add("explore-visual-graph-button-name");const n=document.createElement("button");return n.classList.add("explore-visual-graph-button"),n.classList.add("icon-data"),n.onclick=function(){const t={query:e.yasqe.getValue(),sameAs:e.yasqe.getSameAs(),inference:e.yasqe.getInfer()};y.path("graphs-visualizations").search(t)},n.appendChild(t),n},updateElement:(e,t)=>{if(e.classList.add("hidden"),!t.hasResults())return;const n=t.yasqe.getQueryType();s.b.CONSTRUCT!==n&&s.b.DESCRIBE!==n||e.classList.remove("hidden"),e.querySelector(".explore-visual-graph-button-name").innerText=R.instant("query.editor.visual.btn")},getOrder:()=>2},B=(e,t)=>({key:e,value:t}),F=e=>[B("name",e.data.name)],K=(e,n,r)=>{const o=t.$new(!0);o.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:e,eta:"-",inline:!1,iri:n,name:r,doneCallback:function(){a.dismiss("cancel")}},o.getHumanReadableSeconds=t.getHumanReadableSeconds;const a=f.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:o});return a},V=()=>(e,t)=>q.checkConnector(e).then(e=>e.data.command?e.data.hasSupport?i.H.CREATE===e.data.command?((e,t)=>{const n=K(R.instant("externalsync.creating"),e.data.iri,e.data.name);return N.set(t,n),new c.y(c.Q.SUCCESS,"created.connector",F(e))})(e,t):i.H.REPAIR===e.data.command?((e,t)=>{const n=K(R.instant("externalsync.repairing"),e.data.iri,e.data.name);return N.set(t,n),new c.y(c.Q.SUCCESS,"query.editor.repaired.connector",F(e))})(e,t):i.H.DROP===e.data.command?(e=>new c.y(c.Q.SUCCESS,"externalsync.delete.success.msg",F(e)))(e):void 0:(e=>{const t=[B("connectorName",e.data.connectorName),B("pluginName",e.data.pluginName)];return new c.y(c.Q.ERROR,"query.editor.inactive.plugin.warning.msg",t)})(e):new c.y(c.Q.SUCCESS)).catch(e=>{S.error("Checking connector error: ",e)}),X=e=>{const a=document.querySelectorAll('script[src*="https://www.gstatic.com/"]');if(a.length>0){const e=v.getLanguage();let t="module.js";if("en"!==e&&(t=`module__${e}.js`),!Array.prototype.some.call(a,e=>e.src.includes(t)))return void location.reload()}const s=P.getAuthenticatedUser();n.when(E.getPrefixes(U)).then(n=>{t.prefixes=n,(e=>{t.inferUserSetting=e?.appSettings.DEFAULT_INFERENCE,t.sameAsUserSetting=e?.appSettings.DEFAULT_SAMEAS})(s),((e=!1)=>{t.updateConfig(e);const n=y.search();n.hasOwnProperty(o.L.savedQueryName)?(e=>{const t=e[o.L.savedQueryName],n=e[o.L.savedQueryOwner],a=(0,l.G4)(e.execute);w.getSavedQuery(t,n).then(e=>{const t=(0,r.YS)(e);D(t).then(Y).then(()=>G(a))}).catch(e=>{C.error(R.instant("query.editor.missing.saved.query.data.error",{savedQueryName:t,error:getError(e)}))})})(n):n.hasOwnProperty(o.L.query)?(e=>{const t=e[o.L.name],n=e[o.L.query],a=e[o.L.owner],s=(0,l.G4)(e.execute),i=(0,r.mX)(n,t,a,!0);D(i).then(Y).then(()=>G(s))})(n):A.isActive()&&D()})(e)})},J=[],W=e=>{const t=a.p3.getOntotextYasguiElement(O);t&&t.abortAllRequests().then(()=>{})};window.addEventListener("beforeunload",W);let Z;J.push(h.ServiceProvider.get(h.EventService).subscribe(h.EventName.NAVIGATION_START,e=>(e=>{if(k)return void(k=!1);const t=a.p3.getOntotextYasguiElement(O);if(!t||Z)return;const n=new URL(e.newUrl),r=n.pathname+n.search+n.hash;e.cancelNavigation(),t.getOngoingRequestsInfo().then(e=>{return t=e,new Promise((e,n)=>{if(!t||t.queriesCount<1&&t.updatesCount<1)return void e();const r=R.instant("common.confirm"),o=(0,d.Gz)((e=>{let t="view.sparql-editor.leave_page.run_queries.confirmation.";!e||e.queriesCount<1?t+="none_queries_":1===e.queriesCount?t+="one_query_":t+="queries_",e.updatesCount&&0!==e.updatesCount?1===e.updatesCount?t+="one_update":t+="updates":t+="non_updates",t+=".message";const n={queriesCount:e.queriesCount,updatesCount:e.updatesCount};return R.instant(t,n)})(t));_.openSimpleModal({title:r,message:o,warning:!0}).result.then(function(){e()},function(){n(new g.x)})});var t}).then(()=>t.abortAllRequests()).then(()=>{Z=!0,(0,h.navigateTo)(r)()}).catch(e=>{e instanceof g.x||(S.error(e),Z=!0,(0,h.navigateTo)(r)())})})(e)));const ee=()=>{L.set(T.SPARQL_LAST_REPO,U)};J.push(t.$on("language-changed",function(){location.reload()}));const te=h.ServiceProvider.get(h.LanguageContextService).onSelectedLanguageChanged(()=>{},()=>new Promise(e=>{_.openSimpleModal({title:R.instant("query.editor.language.change.warning.title"),message:R.instant("query.editor.reload.page.warning"),warning:!0}).result.then(function(){e(!0)},function(){e(!1)})}));J.push(te),J.push(t.$on("$destroy",()=>{ee(),J.forEach(e=>e()),window.removeEventListener("beforeunload",W)})),J.push(t.$watch(t.getActiveRepositoryObject,e=>{e&&(U=E.getActiveRepository(),Q=E.isActiveRepoOntopType(e),L.get(T.SPARQL_LAST_REPO)!==U?(X(!0),ee()):X(!1))}))}angular.module("graphdb.framework.sparql-editor.controllers",["ui.bootstrap","graphdb.framework.rest.connectors.service","graphdb.framework.externalsync.controllers","graphdb.framework.utils.event-emitter-service","graphdb.framework.utils.localstorageadapter"]).controller("SparqlEditorCtrl",v),v.$inject=["$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys"]},78618(e,t,n){n.d(t,{G4:()=>a,Sn:()=>s,hK:()=>o});var r=n(98980);const o=e=>e.replace(/[()']/g,""),a=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?(0,r.upperFirst)(e.toLowerCase()):e}};
2
- //# sourceMappingURL=78070.13538271878de6a98862.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"78070.13538271878de6a98862.bundle.js","mappings":"yKAAO,MAAMA,UAA4BC,O,wCCAlC,MAAMC,EACTC,WAAAA,CA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ACA,SACA,KACA,YACA,mBACA,gBACA,YACA,SACA,aACA,oBACA,wBACA,gBACA,eACA,wBACA,sBACA,sBACA,S,kECjDJ,MAAMC,EAAsBC,GACjBA,EAAO1L,QAAQ,SAAU,IAG9BkH,EAAazE,GACM,iBAAVA,EACU,SAAVA,EAEJkJ,QAAQlJ,GAGbmJ,EAAeC,GACZA,GAGEC,EAAAA,EAAAA,YAAWD,EAAKE,eAFZF,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/sparql/cancel-aborting-query.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ontotext-yasgui/before-update-query-result.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/connectors/connector-command.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/sparql-editor/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/utils/string-utils.js"],"sourcesContent":["export class CancelAbortingQuery extends Error {}\n","export class BeforeUpdateQueryResult {\n constructor(status, messageLabelKey, parameters, mesage) {\n this.status = status;\n this.mesage = mesage;\n this.messageLabelKey = messageLabelKey;\n this.parameters = parameters;\n }\n}\n\nexport const BeforeUpdateQueryResultStatus = {\n ERROR: 'error',\n SUCCESS: 'success'\n};\n","export const ConnectorCommand = {\n 'CREATE': 'create',\n 'REPAIR': 'repair',\n 'DROP': 'drop'\n};\n","import {\n savedQueryResponseMapper, buildQueryModel,\n} from \"../rest/mappers/saved-query-mapper\";\nimport {RouteConstants} from \"../utils/route-constants\";\nimport 'angular/rest/connectors.rest.service';\nimport 'angular/externalsync/controllers';\nimport {YasguiComponentDirectiveUtil} from \"../core/directives/yasgui-component/yasgui-component-directive.util\";\nimport {QueryType} from \"../models/ontotext-yasgui/query-type\";\nimport {ConnectorCommand} from \"../models/connectors/connector-command\";\nimport {BeforeUpdateQueryResult, BeforeUpdateQueryResultStatus} from \"../models/ontotext-yasgui/before-update-query-result\";\nimport {EventDataType} from \"../models/ontotext-yasgui/event-data-type\";\nimport {decodeHTML} from \"../../../app\";\nimport {toBoolean} from \"../utils/string-utils\";\nimport {VIEW_SPARQL_EDITOR} from \"../models/sparql/constants\";\nimport {CancelAbortingQuery} from \"../models/sparql/cancel-aborting-query\";\nimport {QueryMode} from \"../models/ontotext-yasgui/query-mode\";\nimport 'angular/core/services/event-emitter-service';\nimport {LoggerProvider} from \"../core/services/logger-provider\";\nimport {\n navigateTo,\n LanguageContextService,\n ServiceProvider,\n EventService,\n EventName,\n SecurityContextService,\n service,\n REPOSITORY_ID_PARAM,\n} from \"@ontotext/workbench-api\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.rest.connectors.service',\n 'graphdb.framework.externalsync.controllers',\n 'graphdb.framework.utils.event-emitter-service',\n 'graphdb.framework.utils.localstorageadapter',\n];\n\nconst logger = LoggerProvider.logger;\n\nangular\n .module('graphdb.framework.sparql-editor.controllers', modules)\n .controller('SparqlEditorCtrl', SparqlEditorCtrl);\n\nSparqlEditorCtrl.$inject = [\n '$rootScope',\n '$scope',\n '$q',\n '$location',\n '$languageService',\n '$repositories',\n '$uibModal',\n 'toastr',\n '$translate',\n 'SparqlRestService',\n 'ConnectorsRestService',\n 'GuidesService',\n 'ModalService',\n 'MonitoringRestService',\n 'EventEmitterService',\n 'LocalStorageAdapter',\n 'LSKeys'];\n\nfunction SparqlEditorCtrl($rootScope,\n $scope,\n $q,\n $location,\n $languageService,\n $repositories,\n $uibModal,\n toastr,\n $translate,\n SparqlRestService,\n ConnectorsRestService,\n GuidesService,\n ModalService,\n MonitoringRestService,\n EventEmitterService,\n LocalStorageAdapter,\n LSKeys) {\n const securityContextService = service(SecurityContextService);\n\n this.repository = '';\n\n const QUERY_EDITOR_ID = '#query-editor';\n let activeRepository = $repositories.getActiveRepository();\n let isOntopRepo = $repositories.isActiveRepoOntopType();\n\n /**\n * @type {OntotextYasguiConfig}\n */\n $scope.yasguiConfig = undefined;\n $scope.savedQueryConfig = undefined;\n $scope.prefixes = {};\n $scope.inferUserSetting = true;\n $scope.sameAsUserSetting = true;\n\n const tabIdToConnectorProgressModalMapping = new Map();\n let internallyReloaded = false;\n\n // =========================\n // Public functions\n // =========================\n /**\n * Updates the Yasgui configuration\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n */\n $scope.updateConfig = (clearYasguiState) => {\n $scope.yasguiConfig = {\n endpoint: getEndpoint,\n componentId: VIEW_SPARQL_EDITOR,\n prefixes: $scope.prefixes,\n infer: isOntopRepo || $scope.inferUserSetting,\n sameAs: isOntopRepo || $scope.sameAsUserSetting,\n yasrToolbarPlugins: [exploreVisualGraphYasrToolbarElementBuilder],\n beforeUpdateQuery: getBeforeUpdateQueryHandler(),\n outputHandlers: new Map([\n [EventDataType.QUERY_EXECUTED, queryExecutedHandler],\n [EventDataType.REQUEST_ABORTED, requestAbortedHandler],\n ]),\n clearState: clearYasguiState !== undefined ? clearYasguiState : false,\n };\n };\n\n $scope.getActiveRepositoryNoError = () => {\n return activeRepository;\n };\n\n // =========================\n // Private functions\n // =========================\n const getYasqe = (yasgui) => {\n const tab = yasgui.getTab();\n if (!tab) {\n return;\n }\n return tab.getYasqe();\n };\n\n const getEndpoint = (yasgui) => {\n const yasqe = getYasqe(yasgui);\n if (!yasqe) {\n // this can happen if open saprql view for first time (browser local store is clear);\n return;\n }\n return $repositories.resolveSparqlEndpoint(yasqe.getQueryMode());\n };\n\n /**\n * Initializes the editor from the URL parameters.\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n * The default is false.\n */\n const initViewFromUrlParams = (clearYasguiState = false) => {\n $scope.updateConfig(clearYasguiState);\n const queryParams = $location.search();\n if (queryParams.hasOwnProperty(RouteConstants.savedQueryName)) {\n // init new tab from shared saved query link\n initTabFromSavedQuery(queryParams);\n } else if (queryParams.hasOwnProperty(RouteConstants.query)) {\n // init new tab from shared query link\n initTabFromSharedQuery(queryParams);\n } else if (GuidesService.isActive()) {\n openNewTab();\n }\n };\n\n // ================================\n // = Setup output handlers\n // ================================\n /**\n * Handles the \"queryExecuted\" event emitted by ontotext-yasgui. The event is fired immediately after the request is executed, whether it succeeds or fails.\n * @param {QueryExecutedEvent} queryExecutedRequest - the event payload.\n */\n const queryExecutedHandler = (queryExecutedRequest) => {\n const connectorProgressModal = tabIdToConnectorProgressModalMapping.get(queryExecutedRequest.tabId);\n if (connectorProgressModal) {\n connectorProgressModal.dismiss();\n tabIdToConnectorProgressModalMapping.delete(queryExecutedRequest.tabId);\n }\n };\n\n /**\n * Handles the \"requestAborted\" event emitted by the ontotext-yasgui. The event is fired when a request is aborted.\n *\n * @param {RequestAbortedEvent} requestAbortedEvent the event payload containing the request object and the query mode.\n */\n const requestAbortedHandler = (requestAbortedEvent) => {\n if (requestAbortedEvent && QueryMode.UPDATE !== requestAbortedEvent.queryMode) {\n const repository = requestAbortedEvent.getRepository();\n const currentTrackAlias = requestAbortedEvent.getQueryTrackAlias();\n if (repository && currentTrackAlias) {\n MonitoringRestService.deleteQuery(currentTrackAlias, repository);\n }\n }\n };\n\n // =========================\n // Private function\n // =========================\n\n const initTabFromSavedQuery = (queryParams) => {\n const savedQueryName = queryParams[RouteConstants.savedQueryName];\n const savedQueryOwner = queryParams[RouteConstants.savedQueryOwner];\n const isExecuteRequested = toBoolean(queryParams.execute);\n\n SparqlRestService.getSavedQuery(savedQueryName, savedQueryOwner).then((res) => {\n const savedQuery = savedQueryResponseMapper(res);\n openNewTab(savedQuery)\n .then(clearUrlParameters)\n .then(() => autoExecuteQueryIfRequested(isExecuteRequested));\n }).catch((err) => {\n toastr.error($translate.instant('query.editor.missing.saved.query.data.error', {\n savedQueryName: savedQueryName,\n error: getError(err),\n }));\n });\n };\n\n const initTabFromSharedQuery = (queryParams) => {\n const queryName = queryParams[RouteConstants.name];\n const query = queryParams[RouteConstants.query];\n const queryOwner = queryParams[RouteConstants.owner];\n const isExecuteRequested = toBoolean(queryParams.execute);\n const sharedQueryModel = buildQueryModel(query, queryName, queryOwner, true);\n openNewTab(sharedQueryModel)\n .then(clearUrlParameters)\n .then(() => autoExecuteQueryIfRequested(isExecuteRequested));\n };\n\n /**\n * Open a new tab with query described in <code>sparqlQuery</code>.\n *\n * @param {TabQueryModel} sparqlQuery\n *\n * @return {Promise<void>}\n */\n const openNewTab = (sparqlQuery) => {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then((yasguiComponent) => yasguiComponent.openTab(sparqlQuery))\n .then((tab) => YasguiComponentDirectiveUtil.highlightTabName(tab));\n };\n\n const clearUrlParameters = () => {\n internallyReloaded = true;\n const currentParams = $location.search();\n // Keep only the repositoryId parameter (if any). This will prevent router event from being triggered again and\n // reinitializing the repositoryId param thus adding a new history entry.\n const repositoryId = currentParams[REPOSITORY_ID_PARAM];\n $location.search(repositoryId ? {repositoryId} : {});\n // Replace current URL without adding a new history entry\n $location.replace();\n };\n\n const autoExecuteQueryIfRequested = (isRequested) => {\n if (isRequested) {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then(getQueryMode)\n .then(confirmAndExecuteQuery);\n }\n return Promise.resolve();\n };\n\n const getQueryMode = (yasguiComponent) => {\n return yasguiComponent.getQueryMode()\n .then((queryMode) => {\n return {yasguiComponent, queryMode};\n });\n };\n\n const confirmAndExecuteQuery = ({yasguiComponent, queryMode}) => {\n if (queryMode !== 'update') {\n return yasguiComponent.query();\n }\n\n return new Promise((resolve) => {\n const title = $translate.instant('confirm.execute');\n const message = decodeHTML($translate.instant('query.editor.automatically.execute.update.warning'));\n ModalService.openConfirmation(title, message, () => resolve(yasguiComponent.query()), () => resolve());\n });\n };\n\n const setInferAndSameAs = (principal) => {\n $scope.inferUserSetting = principal?.appSettings.DEFAULT_INFERENCE;\n $scope.sameAsUserSetting = principal?.appSettings.DEFAULT_SAMEAS;\n };\n\n const exploreVisualGraphYasrToolbarElementBuilder = {\n createElement: (yasr) => {\n const buttonName = document.createElement('span');\n buttonName.classList.add(\"explore-visual-graph-button-name\");\n const exploreVisualButtonWrapperElement = document.createElement('button');\n exploreVisualButtonWrapperElement.classList.add(\"explore-visual-graph-button\");\n exploreVisualButtonWrapperElement.classList.add(\"icon-data\");\n exploreVisualButtonWrapperElement.onclick = function() {\n const paramsToParse = {\n query: yasr.yasqe.getValue(),\n sameAs: yasr.yasqe.getSameAs(),\n inference: yasr.yasqe.getInfer(),\n };\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n exploreVisualButtonWrapperElement.appendChild(buttonName);\n return exploreVisualButtonWrapperElement;\n },\n updateElement: (element, yasr) => {\n element.classList.add('hidden');\n if (!yasr.hasResults()) {\n return;\n }\n const queryType = yasr.yasqe.getQueryType();\n\n if (QueryType.CONSTRUCT === queryType || QueryType.DESCRIBE === queryType) {\n element.classList.remove('hidden');\n }\n element.querySelector('.explore-visual-graph-button-name').innerText = $translate.instant(\"query.editor.visual.btn\");\n },\n getOrder: () => {\n return 2;\n },\n };\n\n const createParameter = (key, value) => {\n return {key, value};\n };\n\n const getCommandParameters = (response) => {\n return [createParameter('name', response.data.name)];\n };\n\n const toNoCommandResponse = () => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS);\n };\n\n const toHasNotSupport = (response) => {\n const parameters = [\n createParameter('connectorName', response.data.connectorName),\n createParameter('pluginName', response.data.pluginName),\n ];\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.ERROR, 'query.editor.inactive.plugin.warning.msg', parameters);\n };\n\n const createConnectorProgressDialog = (actionName, iri, connectorName) => {\n const progressScope = $scope.$new(true);\n progressScope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0,\n },\n actionName,\n eta: \"-\",\n inline: false,\n iri,\n name: connectorName,\n doneCallback: function() {\n connectorProgressModal.dismiss('cancel');\n },\n };\n progressScope.getHumanReadableSeconds = $scope.getHumanReadableSeconds;\n\n const connectorProgressModal = $uibModal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: progressScope,\n });\n return connectorProgressModal;\n };\n\n const toCreateCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.creating'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'created.connector', getCommandParameters(response));\n };\n\n const toRepairCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.repairing'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'query.editor.repaired.connector', getCommandParameters(response));\n };\n\n const toDropCommandResponse = (response) => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'externalsync.delete.success.msg', getCommandParameters(response));\n };\n\n const getBeforeUpdateQueryHandler = () => (query, tabId) => {\n return ConnectorsRestService.checkConnector(query)\n .then((response) => {\n if (!response.data.command) {\n return toNoCommandResponse();\n }\n if (!response.data.hasSupport) {\n return toHasNotSupport(response);\n }\n\n if (ConnectorCommand.CREATE === response.data.command) {\n return toCreateCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.REPAIR === response.data.command) {\n return toRepairCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.DROP === response.data.command) {\n return toDropCommandResponse(response);\n }\n }).catch((error) => {\n // For some reason we couldn't check if this is a connector update, so just catch the exception,\n // to not stop the execution of query.\n logger.error('Checking connector error: ', error);\n });\n };\n\n const getExitPageConfirmMessage = (ongoingRequestsInfo) => {\n let exitPageConfirmMessage = \"view.sparql-editor.leave_page.run_queries.confirmation.\";\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1) {\n exitPageConfirmMessage += \"none_queries_\";\n } else if (ongoingRequestsInfo.queriesCount === 1) {\n exitPageConfirmMessage += \"one_query_\";\n } else {\n exitPageConfirmMessage += \"queries_\";\n }\n\n if (!ongoingRequestsInfo.updatesCount || ongoingRequestsInfo.updatesCount === 0) {\n exitPageConfirmMessage += \"non_updates\";\n } else if (ongoingRequestsInfo.updatesCount === 1) {\n exitPageConfirmMessage += \"one_update\";\n } else {\n exitPageConfirmMessage += \"updates\";\n }\n\n exitPageConfirmMessage += \".message\";\n const params = {\n queriesCount: ongoingRequestsInfo.queriesCount,\n updatesCount: ongoingRequestsInfo.updatesCount,\n };\n return $translate.instant(exitPageConfirmMessage, params);\n };\n\n // Initialization and bootstrap\n const init = (clearYasguiState) => {\n // This script check is required, because of the following scenario:\n // I am in the SPARQL view;\n // Then I go to a different view and change the language;\n // Then I return to the SPARQL view. I will see that the Google chart and Pivot table will have their\n // original scripts loaded still.\n // THE FIX: Get all the scripts (if there are none, the correct language will be loaded). If there are\n // scripts, and they don't match those, which are loaded already, the page needs to reload when opening\n // the SPARQL view, otherwise the Google chart and Pivot table configs will be in the old language.\n const googleScripts = document.querySelectorAll(`script[src*=\"https://www.gstatic.com/\"]`);\n if (googleScripts.length > 0) {\n const currentLang = $languageService.getLanguage();\n let searchTerm = 'module.js';\n if ('en' !== currentLang) {\n searchTerm = `module__${currentLang}.js`;\n }\n if (!Array.prototype.some.call(googleScripts, (script) => script.src.includes(searchTerm))) {\n location.reload();\n return;\n }\n }\n const principal = securityContextService.getAuthenticatedUser();\n $q.when($repositories.getPrefixes(activeRepository))\n .then((usedPrefixes) => {\n $scope.prefixes = usedPrefixes;\n setInferAndSameAs(principal);\n // check is there is a saved query or query url parameter and init the editor\n initViewFromUrlParams(clearYasguiState);\n });\n // TODO: we should also watch for changes in namespaces\n // scope.$watch('namespaces', function () {});\n };\n\n // =========================\n // Event handlers\n // =========================\n const subscriptions = [];\n\n const repositoryChangedHandler = (object) => {\n if (!object) {\n return;\n }\n activeRepository = $repositories.getActiveRepository();\n isOntopRepo = $repositories.isActiveRepoOntopType(object);\n if (LocalStorageAdapter.get(LSKeys.SPARQL_LAST_REPO) !== activeRepository) {\n init(true);\n persistLasstUsedRepository();\n } else {\n init(false);\n }\n };\n\n const beforeunloadHandler = (event) => {\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement) {\n return;\n }\n // If we set event.returnValue, the browser will prompt the user for confirmation to leave the page,\n // but we don't have a way to handle the user's choice.\n // Therefore, we can't take any action, so we simply proceed to abort all requests.\n ontotextYasguiElement.abortAllRequests().then(() => {});\n };\n\n window.addEventListener('beforeunload', beforeunloadHandler);\n\n const confirmIfHaveRunQuery = (ongoingRequestsInfo) => new Promise((resolve, reject) => {\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1 && ongoingRequestsInfo.updatesCount < 1) {\n resolve();\n return;\n }\n\n const title = $translate.instant('common.confirm');\n const message = decodeHTML(getExitPageConfirmMessage(ongoingRequestsInfo));\n ModalService.openSimpleModal({\n title,\n message,\n warning: true,\n }).result.then(function() {\n resolve();\n }, function() {\n reject(new CancelAbortingQuery());\n });\n });\n let queriesAreCanceled = undefined;\n const locationChangeHandler = (eventPayload) => {\n if (internallyReloaded) {\n internallyReloaded = false;\n return;\n }\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement || queriesAreCanceled) {\n return;\n }\n\n const url = new URL(eventPayload.newUrl);\n const newUrl = url.pathname + url.search + url.hash;\n eventPayload.cancelNavigation();\n // First, we check if there are any ongoing requests initiated by the user.\n // If the user has ongoing requests, we request confirmation to abort them.\n // If the user confirms or there are no ongoing requests, we call the \"abortAllRequests\" method. This method will abort all requests.\n ontotextYasguiElement\n .getOngoingRequestsInfo()\n .then((hasRunQuery) => confirmIfHaveRunQuery(hasRunQuery))\n .then(() => ontotextYasguiElement.abortAllRequests())\n .then(() => {\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n })\n .catch((error) => {\n if (!(error instanceof CancelAbortingQuery)) {\n logger.error(error);\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n }\n });\n };\n\n subscriptions.push(\n ServiceProvider.get(EventService).subscribe(EventName.NAVIGATION_START, (eventPayload) => locationChangeHandler(eventPayload)),\n );\n\n const removeAllListeners = () => {\n subscriptions.forEach((subscription) => subscription());\n window.removeEventListener('beforeunload', beforeunloadHandler);\n };\n\n const finalizeAndDestroy = () => {\n persistLasstUsedRepository();\n removeAllListeners();\n };\n\n const persistLasstUsedRepository = () => {\n // The active repository is set when the controller is initialized and when the repository is changed.\n // It holds the actual repository when the YASGUI is initialized. DON'T use runtime fetching of the actual repository here, because there is a scenario:\n // 1. Open a tab with the SPARQL view open;\n // 2. Open the SPARQL view in another tab and execute a query;\n // 3. Switch to the repositories view and change the repository;\n // 4. Switch back to the SPARQL view, and the YASR is not cleared.\n // The problem occurs because of the second tab. When the repository is changed, its ID is persisted to local storage, which triggers the \"storage\" event to be fired.\n // In the main controller, a listener has been registered to listen to that event and refresh the page outside of the Angular scope.\n // Reloading the page triggers the destruction of the component and persistence of the active repository. The reloading of the page is out of the Angular scope, so the \"activeRepository\"\n // holds the real repository when the YASGUI is created. If we use $$repositories.getActiveRepository(), the new value will be fetched, which in this case will be incorrect.\n LocalStorageAdapter.set(LSKeys.SPARQL_LAST_REPO, activeRepository);\n };\n\n subscriptions.push(\n $scope.$on('language-changed', function() {\n location.reload();\n }),\n );\n\n const onLanguageChange = () => {\n // Do nothing on language change\n };\n\n const showLanguageChangeConfirmation = () => {\n return new Promise((resolve) => {\n ModalService.openSimpleModal({\n title: $translate.instant('query.editor.language.change.warning.title'),\n message: $translate.instant('query.editor.reload.page.warning'),\n warning: true,\n }).result.then(function() {\n resolve(true);\n }, function() {\n resolve(false);\n });\n });\n };\n\n const languageContextService = ServiceProvider.get(LanguageContextService);\n const onLanguageChangeSubscription = languageContextService.onSelectedLanguageChanged(onLanguageChange, showLanguageChangeConfirmation);\n\n // Subscribe to language change and ask to reload the page\n subscriptions.push(onLanguageChangeSubscription);\n\n // Deregister the watcher when the scope/directive is destroyed\n subscriptions.push($scope.$on('$destroy', finalizeAndDestroy));\n\n // Wait until the active repository object is set, otherwise \"canWriteActiveRepo()\" may return a wrong result and the \"ontotext-yasgui\"\n // readOnly configuration may be incorrect.\n subscriptions.push($scope.$watch($scope.getActiveRepositoryObject, repositoryChangedHandler));\n}\n","import {upperFirst} from \"lodash\";\n\n/**\n * Removes brackets and serial commas from IRIs\n * when used to create ids for links and markers,\n * because elements with ids that contain such\n * are not valid XHTML and cause a host problems\n * when trying to style individual elements\n * @param {string} string The string to be processed.\n * @return {string} A string where the special characters are removed.\n */\nconst removeSpecialChars = (string) => {\n return string.replace(/[()']/g, \"\");\n};\n\nconst toBoolean = (value) => {\n if (typeof value === 'string') {\n return value === 'true';\n }\n return Boolean(value);\n};\n\nconst toTitleCase = (text) => {\n if (!text) {\n return text;\n }\n return upperFirst(text.toLowerCase());\n};\n\nexport {\n removeSpecialChars,\n toBoolean,\n toTitleCase\n};\n\n"],"names":["CancelAbortingQuery","Error","BeforeUpdateQueryResult","constructor","status","messageLabelKey","parameters","mesage","this","BeforeUpdateQueryResultStatus","ERROR","SUCCESS","ConnectorCommand","logger","LoggerProvider","SparqlEditorCtrl","$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys","securityContextService","service","SecurityContextService","repository","QUERY_EDITOR_ID","activeRepository","getActiveRepository","isOntopRepo","isActiveRepoOntopType","yasguiConfig","undefined","savedQueryConfig","prefixes","inferUserSetting","sameAsUserSetting","tabIdToConnectorProgressModalMapping","Map","internallyReloaded","updateConfig","clearYasguiState","endpoint","getEndpoint","componentId","VIEW_SPARQL_EDITOR","infer","sameAs","yasrToolbarPlugins","exploreVisualGraphYasrToolbarElementBuilder","beforeUpdateQuery","getBeforeUpdateQueryHandler","outputHandlers","EventDataType","QUERY_EXECUTED","queryExecutedHandler","REQUEST_ABORTED","requestAbortedHandler","clearState","getActiveRepositoryNoError","yasgui","yasqe","tab","getTab","getYasqe","resolveSparqlEndpoint","getQueryMode","queryExecutedRequest","connectorProgressModal","get","tabId","dismiss","delete","requestAbortedEvent","QueryMode","UPDATE","queryMode","getRepository","currentTrackAlias","getQueryTrackAlias","deleteQuery","openNewTab","sparqlQuery","YasguiComponentDirectiveUtil","getOntotextYasguiElementAsync","then","yasguiComponent","openTab","highlightTabName","clearUrlParameters","repositoryId","search","REPOSITORY_ID_PARAM","replace","autoExecuteQueryIfRequested","isRequested","confirmAndExecuteQuery","Promise","resolve","query","title","instant","message","decodeHTML","openConfirmation","createElement","yasr","buttonName","document","classList","add","exploreVisualButtonWrapperElement","onclick","paramsToParse","getValue","getSameAs","inference","getInfer","path","appendChild","updateElement","element","hasResults","queryType","getQueryType","QueryType","CONSTRUCT","DESCRIBE","remove","querySelector","innerText","getOrder","createParameter","key","value","getCommandParameters","response","data","name","createConnectorProgressDialog","actionName","iri","connectorName","progressScope","$new","beingBuiltConnector","percentDone","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","eta","inline","doneCallback","getHumanReadableSeconds","open","templateUrl","controller","size","backdrop","scope","checkConnector","command","hasSupport","CREATE","toCreateCommandResponse","set","REPAIR","toRepairCommandResponse","DROP","toDropCommandResponse","pluginName","toHasNotSupport","catch","error","init","googleScripts","querySelectorAll","length","currentLang","getLanguage","searchTerm","Array","prototype","some","call","script","src","includes","location","reload","principal","getAuthenticatedUser","when","getPrefixes","usedPrefixes","appSettings","DEFAULT_INFERENCE","DEFAULT_SAMEAS","setInferAndSameAs","initViewFromUrlParams","queryParams","hasOwnProperty","RouteConstants","savedQueryName","savedQueryOwner","isExecuteRequested","toBoolean","execute","getSavedQuery","res","savedQuery","savedQueryResponseMapper","err","getError","initTabFromSavedQuery","queryName","queryOwner","owner","sharedQueryModel","buildQueryModel","initTabFromSharedQuery","isActive","subscriptions","beforeunloadHandler","event","ontotextYasguiElement","getOntotextYasguiElement","abortAllRequests","window","addEventListener","queriesAreCanceled","push","ServiceProvider","EventService","subscribe","EventName","NAVIGATION_START","eventPayload","url","URL","newUrl","pathname","hash","cancelNavigation","getOngoingRequestsInfo","hasRunQuery","confirmIfHaveRunQuery","ongoingRequestsInfo","reject","queriesCount","updatesCount","exitPageConfirmMessage","params","getExitPageConfirmMessage","openSimpleModal","warning","result","navigateTo","locationChangeHandler","persistLasstUsedRepository","SPARQL_LAST_REPO","$on","onLanguageChangeSubscription","LanguageContextService","onSelectedLanguageChanged","onLanguageChange","showLanguageChangeConfirmation","finalizeAndDestroy","forEach","subscription","removeEventListener","$watch","getActiveRepositoryObject","object","angular","module","$inject","removeSpecialChars","string","Boolean","toTitleCase","text","upperFirst","toLowerCase"],"ignoreList":[],"sourceRoot":""}