graphdb-workbench 3.3.2 → 3.3.3-RC2

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 (220) 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.d7107e7549453805e13a.bundle.js → 13231.8bbbe30c10e6c0dfdba3.bundle.js} +2 -2
  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.4becb7771236462dcc5a.bundle.js → 20694.03b5abf23347ae0bad65.bundle.js} +2 -2
  8. package/dist/{20694.4becb7771236462dcc5a.bundle.js.map → 20694.03b5abf23347ae0bad65.bundle.js.map} +1 -1
  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.95e9083c584fed8acdc1.bundle.js +2 -0
  14. package/dist/38644.95e9083c584fed8acdc1.bundle.js.map +1 -0
  15. package/dist/39518.952b269313461489181c.bundle.js +2 -0
  16. package/dist/{39518.4d72b74fffba395c6b2a.bundle.js.map → 39518.952b269313461489181c.bundle.js.map} +1 -1
  17. package/dist/{39874.710e94f211579215f997.bundle.js → 39874.17dde6245fc4cc91bb58.bundle.js} +2 -2
  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.6ba1b091a34af6c00770.bundle.js → 60560.62ed0cb0b3d07fecbf28.bundle.js} +2 -2
  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.bc281108507cb9ca2ff5.bundle.js +2 -0
  28. package/dist/67888.bc281108507cb9ca2ff5.bundle.js.map +1 -0
  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.2aec5ebbcd434f5582ff.bundle.js → 7815.89cc59b6625e84913351.bundle.js} +2 -2
  36. package/dist/7815.89cc59b6625e84913351.bundle.js.map +1 -0
  37. package/dist/{78681.9e1d4e064e9e1fb5fb21.bundle.js → 78681.6c8614aad7e5465be505.bundle.js} +2 -2
  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.ce1d6bf65b09288a2b10.bundle.js → 82926.0bc447d56f8bcff3aa6c.bundle.js} +2 -2
  42. package/dist/{82926.ce1d6bf65b09288a2b10.bundle.js.map → 82926.0bc447d56f8bcff3aa6c.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.313d3ccb611777cf8125.bundle.js +2 -0
  50. package/dist/99448.313d3ccb611777cf8125.bundle.js.map +1 -0
  51. package/dist/index.html +9 -9
  52. package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
  53. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  54. package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
  55. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  56. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  57. package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
  58. package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
  59. package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
  60. package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
  61. package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
  62. package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
  63. package/dist/js/angular/core/templates/search-resource-input.html +1 -1
  64. package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
  65. package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
  66. package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
  67. package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
  68. package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
  69. package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
  70. package/dist/js/angular/security/templates/user.html +2 -2
  71. package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
  72. package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
  73. package/dist/js/angular/ttyg/templates/chat-item-detail.html +3 -2
  74. package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
  75. package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
  76. package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
  77. package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
  78. package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
  79. package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
  80. package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
  81. package/dist/legacyWorkbench.e97c21d179749854900d.js +3 -0
  82. package/dist/{legacyWorkbench.40eba9e09196e1483221.js.map → legacyWorkbench.e97c21d179749854900d.js.map} +1 -1
  83. package/dist/main.a67c284710a8b9a98ca2.js +3 -0
  84. package/dist/main.a67c284710a8b9a98ca2.js.map +1 -0
  85. package/dist/pages/aclmanagement.html +1 -1
  86. package/dist/pages/autocomplete.html +1 -1
  87. package/dist/pages/choose-repository-type.html +1 -1
  88. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  89. package/dist/pages/create-index.html +1 -1
  90. package/dist/pages/dependencies.html +1 -1
  91. package/dist/pages/domainRangeInfo.html +2 -2
  92. package/dist/pages/edit.html +1 -1
  93. package/dist/pages/explore.html +1 -1
  94. package/dist/pages/export.html +1 -1
  95. package/dist/pages/find.html +1 -1
  96. package/dist/pages/graph-config/saveGraphConfig.html +8 -8
  97. package/dist/pages/graphs-visualizations.html +7 -7
  98. package/dist/pages/guides.html +1 -1
  99. package/dist/pages/home.html +1 -1
  100. package/dist/pages/import.html +2 -2
  101. package/dist/pages/jdbc-create.html +1 -1
  102. package/dist/pages/jdbc.html +1 -1
  103. package/dist/pages/monitor/backup-and-restore.html +1 -1
  104. package/dist/pages/monitor/queries.html +1 -1
  105. package/dist/pages/monitor/resources.html +1 -1
  106. package/dist/pages/namespaces.html +2 -2
  107. package/dist/pages/plugins.html +1 -1
  108. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  109. package/dist/pages/rdfrank.html +2 -2
  110. package/dist/pages/repositories.html +1 -1
  111. package/dist/pages/repository.html +1 -1
  112. package/dist/pages/similarity-indexes.html +1 -1
  113. package/dist/pages/sparql-editor.html +1 -1
  114. package/dist/pages/sparql-template-create.html +1 -1
  115. package/dist/pages/sparql-templates.html +1 -1
  116. package/dist/pages/ux-test1.html +2 -2
  117. package/dist/pages/webapi.html +4 -3
  118. package/dist/res/swagger5/index.html +11 -11
  119. package/dist/res/swagger5/swagger-initializer.js +1 -1
  120. package/dist/shared-components/cjs/index-CTK5NoJt.js +2 -0
  121. package/dist/shared-components/cjs/loader.cjs.js +1 -1
  122. package/dist/shared-components/cjs/onto-cookie-consent_2.cjs.entry.js +1 -1
  123. package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
  124. package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
  125. package/dist/shared-components/cjs/onto-footer_5.cjs.entry.js +1 -1
  126. package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
  127. package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
  128. package/dist/shared-components/cjs/onto-permission-banner.cjs.entry.js +1 -1
  129. package/dist/shared-components/cjs/onto-test-context.cjs.entry.js +1 -1
  130. package/dist/shared-components/cjs/onto-toastr.cjs.entry.js +1 -1
  131. package/dist/shared-components/cjs/shared-components.cjs.js +1 -1
  132. package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
  133. package/dist/shared-components/collection/collection-manifest.json +2 -2
  134. package/dist/shared-components/collection/components/dialogs/onto-dialog.js +1 -1
  135. package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
  136. package/dist/shared-components/collection/components/onto-language-selector/onto-language-selector.js +1 -1
  137. package/dist/shared-components/collection/components/onto-license-alert/onto-license-alert.js +1 -1
  138. package/dist/shared-components/collection/components/onto-loader/onto-loader.js +1 -1
  139. package/dist/shared-components/collection/components/onto-navbar/onto-navbar.js +1 -1
  140. package/dist/shared-components/collection/components/onto-operations-notification/onto-operations-notification.js +1 -1
  141. package/dist/shared-components/collection/components/onto-repository-selector/onto-repository-selector.js +1 -1
  142. package/dist/shared-components/collection/components/onto-search-resource-input/onto-search-resource-input.js +1 -1
  143. package/dist/shared-components/collection/components/onto-test-context/onto-test-context.js +1 -1
  144. package/dist/shared-components/collection/components/onto-toggle-switch/onto-toggle-switch.js +1 -1
  145. package/dist/shared-components/collection/components/onto-user-menu/onto-user-menu.js +1 -1
  146. package/dist/shared-components/collection/components/translate-label/translate-label.js +1 -1
  147. package/dist/shared-components/esm/index-EiAqSNMq.js +2 -0
  148. package/dist/shared-components/esm/loader.js +1 -1
  149. package/dist/shared-components/esm/onto-cookie-consent_2.entry.js +1 -1
  150. package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
  151. package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
  152. package/dist/shared-components/esm/onto-footer_5.entry.js +1 -1
  153. package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
  154. package/dist/shared-components/esm/onto-layout.entry.js +1 -1
  155. package/dist/shared-components/esm/onto-permission-banner.entry.js +1 -1
  156. package/dist/shared-components/esm/onto-test-context.entry.js +1 -1
  157. package/dist/shared-components/esm/onto-toastr.entry.js +1 -1
  158. package/dist/shared-components/esm/shared-components.js +1 -1
  159. package/dist/shared-components/esm/translate-label.entry.js +1 -1
  160. package/dist/shared-components/shared-components/{p-6d34b2cb.entry.js → p-1103d100.entry.js} +1 -1
  161. package/dist/shared-components/shared-components/{p-9b2c6e80.entry.js → p-2e2bb175.entry.js} +1 -1
  162. package/dist/shared-components/shared-components/{p-b754971e.entry.js → p-50735428.entry.js} +1 -1
  163. package/dist/shared-components/shared-components/{p-7e47d850.entry.js → p-59707503.entry.js} +1 -1
  164. package/dist/shared-components/shared-components/{p-598d33d7.entry.js → p-6a37f808.entry.js} +1 -1
  165. package/dist/shared-components/shared-components/{p-9214bb16.entry.js → p-6fb5eec5.entry.js} +1 -1
  166. package/dist/shared-components/shared-components/{p-c27fe716.entry.js → p-97930684.entry.js} +1 -1
  167. package/dist/shared-components/shared-components/p-EiAqSNMq.js +2 -0
  168. package/dist/shared-components/shared-components/{p-b5d4081d.entry.js → p-a5a49d87.entry.js} +1 -1
  169. package/dist/shared-components/shared-components/{p-74888633.entry.js → p-d134e207.entry.js} +1 -1
  170. package/dist/shared-components/shared-components/{p-5886e663.entry.js → p-ec2f4ea5.entry.js} +1 -1
  171. package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
  172. package/dist/shared-components/types/stencil-public-runtime.d.ts +10 -147
  173. package/package.json +1 -1
  174. package/dist/10759.b2e1d643d681ebd9c124.bundle.js.map +0 -1
  175. package/dist/13231.d7107e7549453805e13a.bundle.js.map +0 -1
  176. package/dist/18961.01ff5fcc0f4b9f99236e.bundle.js.map +0 -1
  177. package/dist/21015.ea34b563b4149ad0975e.bundle.js +0 -2
  178. package/dist/21015.ea34b563b4149ad0975e.bundle.js.map +0 -1
  179. package/dist/2975.8be1a79816fd811be223.bundle.js +0 -2
  180. package/dist/2975.8be1a79816fd811be223.bundle.js.map +0 -1
  181. package/dist/38644.0e8652c647a0f341abd7.bundle.js +0 -2
  182. package/dist/38644.0e8652c647a0f341abd7.bundle.js.map +0 -1
  183. package/dist/39518.4d72b74fffba395c6b2a.bundle.js +0 -2
  184. package/dist/39874.710e94f211579215f997.bundle.js.map +0 -1
  185. package/dist/45758.1212136a37dd4f7528f8.bundle.js.map +0 -1
  186. package/dist/60560.6ba1b091a34af6c00770.bundle.js.map +0 -1
  187. package/dist/60730.35493812d428872eddb6.bundle.js.map +0 -1
  188. package/dist/64118.b06aebc9f8d7e822244f.bundle.js.map +0 -1
  189. package/dist/67888.41803878170b6c7a5ca5.bundle.js +0 -2
  190. package/dist/67888.41803878170b6c7a5ca5.bundle.js.map +0 -1
  191. package/dist/71099.ca7720893604e9d908d6.bundle.js +0 -2
  192. package/dist/71099.ca7720893604e9d908d6.bundle.js.map +0 -1
  193. package/dist/75881.54dc716f79b6fe29232a.bundle.js +0 -2
  194. package/dist/75881.54dc716f79b6fe29232a.bundle.js.map +0 -1
  195. package/dist/78070.13538271878de6a98862.bundle.js +0 -2
  196. package/dist/78070.13538271878de6a98862.bundle.js.map +0 -1
  197. package/dist/7815.2aec5ebbcd434f5582ff.bundle.js.map +0 -1
  198. package/dist/78681.9e1d4e064e9e1fb5fb21.bundle.js.map +0 -1
  199. package/dist/82206.229877d7931849236456.bundle.js.map +0 -1
  200. package/dist/94229.47dbdba202106c61dff1.bundle.js.map +0 -1
  201. package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js +0 -2
  202. package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js.map +0 -1
  203. package/dist/98268.86ff371dde616b4e2a76.bundle.js +0 -2
  204. package/dist/98268.86ff371dde616b4e2a76.bundle.js.map +0 -1
  205. package/dist/99448.2a87f387a8062617d893.bundle.js +0 -2
  206. package/dist/99448.2a87f387a8062617d893.bundle.js.map +0 -1
  207. package/dist/legacyWorkbench.40eba9e09196e1483221.js +0 -3
  208. package/dist/main.14f083264cd64618d96a.js +0 -3
  209. package/dist/main.14f083264cd64618d96a.js.map +0 -1
  210. package/dist/shared-components/cjs/app-globals-V2Kpy_OQ.js +0 -1
  211. package/dist/shared-components/cjs/index-L_ZmIeD5.js +0 -2
  212. package/dist/shared-components/esm/app-globals-DQuL1Twl.js +0 -1
  213. package/dist/shared-components/esm/index-CGqARDX4.js +0 -2
  214. package/dist/shared-components/shared-components/p-CGqARDX4.js +0 -2
  215. package/dist/shared-components/shared-components/p-DQuL1Twl.js +0 -1
  216. /package/dist/{legacyWorkbench.40eba9e09196e1483221.js.LICENSE.txt → legacyWorkbench.e97c21d179749854900d.js.LICENSE.txt} +0 -0
  217. /package/dist/{main.14f083264cd64618d96a.js.LICENSE.txt → main.a67c284710a8b9a98ca2.js.LICENSE.txt} +0 -0
  218. /package/dist/shared-components/cjs/{index-L_ZmIeD5.js.LICENSE.txt → index-CTK5NoJt.js.LICENSE.txt} +0 -0
  219. /package/dist/shared-components/esm/{index-CGqARDX4.js.LICENSE.txt → index-EiAqSNMq.js.LICENSE.txt} +0 -0
  220. /package/dist/shared-components/shared-components/{p-CGqARDX4.js.LICENSE.txt → p-EiAqSNMq.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"45758.1212136a37dd4f7528f8.bundle.js","mappings":"2MAIA,MAEMA,EAAiB,MACnBC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBC,KAAMF,GACvBE,KAAKC,8BAAgC,KAIrCD,KAAKE,sBAAwB,EACjC,CACAC,iBAAAA,GACIH,KAAKC,8BAAgCG,EAAAA,EAAmBC,YAAYL,KAAKM,SAAUN,KAAKE,sBAAwBK,GAAoBP,KAAKO,gBAAkBA,EAC/J,CACAC,oBAAAA,GACQR,KAAKC,gCACLD,KAAKC,gCACLD,KAAKC,8BAAgC,KAE7C,CACAQ,MAAAA,GACI,OAAQC,EAAAA,EAAAA,GAAEC,EAAAA,EAAM,CAAEC,IAAK,4CAA8CZ,KAAKO,gBAC9E,GAEJX,EAAeiB,MAxBiB,uB,+DCFhC,SAASC,EAAaC,GAClB,MAAMC,EAAUC,SAASC,cAAc,YAEvC,OADAF,EAAQG,UAAYJ,EACbC,EAAQI,KACnB,CAMA,MAAMC,EAMF,iBAAWC,GACP,OAAOC,EAAAA,QAAQC,kBAXH,mBAYhB,EAMJ,MAAMC,EACF5B,WAAAA,GACIG,KAAK0B,uBAAyBC,EAAAA,gBAAgBC,IAAIC,EAAAA,wBAClD7B,KAA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O,EAAG,GAAG,IACvD,OAAoB,IAAhBS,EAAKK,OACED,EAEsB,iBAAtBA,EAEHJ,EAAKK,OAAS,EACP1D,KAAKuD,eAAeE,EAAmBJ,GAE3CI,OALX,CAQJ,CACAR,eAAAA,CAAgBH,EAAaR,GACzB,OAAIA,EACOA,EAAWqB,OAElB,CAACb,EAAac,IAAcnC,EAAkCoC,WAAWf,EAAac,GAAYd,GAE/FA,CACX,CACA,iBAAOe,CAAWf,EAAac,GAC3B,OAAOA,EAAYd,EAAYQ,MAAM,KAAKM,EAAUhD,SAASkD,KAAKF,EAAUxC,OAAS0B,CACzF,CACAiB,yBAAAA,GACIC,OAAOC,KAAKjE,KAAK8B,6BAA6BoC,QAASC,KACjCnE,KAAK8B,4BAA4BqC,IAAc,IACvDD,QAAS7B,GAAaA,EAASE,SAASvC,KAAKyC,UAAU0B,EAAW9B,EAASC,eAE7F,CACAL,uBAAAA,GACIjC,KAAKoE,2BAA6BpE,KAAK0B,uBAAuB2C,wBAAyBlB,IAC/EA,IACAnD,KAAKgD,cAAgBG,EACrBnD,KAAK+D,8BAGjB,CACAO,OAAAA,GACQtE,KAAKoE,4BACLpE,KAAKoE,4BAEb,EAEJ,MAAMhE,EAAqB,IAAIqB,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/translate-label.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-nljGIprK.js"],"sourcesContent":["import { r as registerInstance, h, a as Host } from './index-CGqARDX4.js';\nimport { T as TranslationService } from './translation.service-nljGIprK.js';\nimport '@ontotext/workbench-api';\n\nconst translateLabelCss = () => `:host{display:inline}`;\n\nconst TranslateLabel = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.unsubscribeTranslationChanged = null;\n /**\n * Represents an array of translation parameters.\n */\n this.translationParameters = [];\n }\n connectedCallback() {\n this.unsubscribeTranslationChanged = TranslationService.onTranslate(this.labelKey, this.translationParameters, (translatedLabel) => this.translatedLabel = translatedLabel);\n }\n disconnectedCallback() {\n if (this.unsubscribeTranslationChanged) {\n this.unsubscribeTranslationChanged();\n this.unsubscribeTranslationChanged = null;\n }\n }\n render() {\n return (h(Host, { key: '6f43411609ffbb55a072585c7c1bdd149422b066' }, this.translatedLabel));\n }\n};\nTranslateLabel.style = translateLabelCss();\n\nexport { TranslateLabel as translate_label };\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":["TranslateLabel","constructor","hostRef","registerInstance","this","unsubscribeTranslationChanged","translationParameters","connectedCallback","TranslationService","onTranslate","labelKey","translatedLabel","disconnectedCallback","render","h","Host","key","style","sanitizeHTML","html","element","document","createElement","innerHTML","value","LoggerProvider","logger","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","ServiceProvider","get","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","translate","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":"60560.6ba1b091a34af6c00770.bundle.js","mappings":"4PAKA,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,CAKAC,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,0BAA2BH,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,4B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AAmBJ,GAE3CI,OALX,CAQJ,CACAR,eAAAA,CAAgBH,EAAaP,GACzB,OAAIA,EACOA,EAAWoB,OAElB,CAACb,EAAac,IAAcnC,EAAkCoC,WAAWf,EAAac,GAAYd,GAE/FA,CACX,CACA,iBAAOe,CAAWf,EAAac,GAC3B,OAAOA,EAAYd,EAAYQ,MAAM,KAAKM,EAAUjH,SAASmH,KAAKF,EAAUtC,OAASwB,CACzF,CACAiB,yBAAAA,GACIC,OAAOC,KAAKnI,KAAKgG,6BAA6BoC,QAASC,KACjCrI,KAAKgG,4BAA4BqC,IAAc,IACvDD,QAAS5B,GAAaA,EAASE,SAAS1G,KAAKwD,UAAU6E,EAAW7B,EAASC,eAE7F,CACAN,uBAAAA,GACInG,KAAKsI,2BAA6BtI,KAAK4F,uBAAuB2C,wBAAyBlB,IAC/EA,IACArH,KAAKkH,cAAgBG,EACrBrH,KAAKiI,8BAGjB,CACAO,OAAAA,GACQxI,KAAKsI,4BACLtI,KAAKsI,4BAEb,EAEJ,MAAM/E,EAAqB,IAAIoC,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/onto-cookie-consent_2.entry.js","webpack://root-config/./packages/shared-components/dist/esm/function-utils-D1ZpXQQS.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 { service, SecurityContextService, SecurityService, TrackingService, DateUtil } from '@ontotext/workbench-api';\nimport { d as debounce } from './function-utils-D1ZpXQQS.js';\n\nconst ontoCookieConsentCss = () => `.cookie-consent-banner{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-banner .cookie-consent-content{display:flex;justify-content:center;align-items:center}.cookie-consent-banner .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 * Listener for the closeDialog event emitted by the cookie policy dialog.\n * Sets the showModal state to false to hide the dialog.\n */\n onDialogClose() {\n this.showModal = false;\n }\n render() {\n return (h(Host, { key: 'dba3fc373e9ad60ada7f86d11acbe1b1ed24a92d' }, h(\"div\", { key: '8f1dff5a6b271f721d2079ec44a14207eff38025', class: \"cookie-consent-banner\" }, h(\"section\", { key: '93d51c3f88e12ff6fc5a57506eab507eca5420cb', class: \"cookie-consent-content\" }, h(\"span\", { key: '72be975026e8717da4ab4d99d5560f96017d4436' }, h(\"translate-label\", { key: 'b49c8182a2e94cffb22abb03dd4f2e6c9a7c6b5e', labelKey: 'cookie.cookie_consent' }), h(\"a\", { key: '79675cf4d9c026666093ff3205818f48b845083f', id: \"cookie-policy-link\", href: \"#\", onClick: this.openModal, class: \"btn btn-link p-0\" }, h(\"translate-label\", { key: '8c83694879ff4fb7cce5aa8f3363220767b54c13', labelKey: 'cookie.cookie_policy_url_label' })), \".\"), h(\"button\", { key: 'dfa75c1bd990929564a7b3b61264e1978ea24c95', id: \"accept-cookie-policy\", class: \"onto-btn onto-btn-primary\", onClick: this.handleConsentClick }, h(\"translate-label\", { key: '7a36cad2b993c7aa29f4d64adcf8e359331bdb28', labelKey: 'common.button.ok' })))), this.showModal && h(\"onto-cookie-policy-dialog\", { key: '1daa9af32d60159763f1ea052c1c87e6f4bfdb3e' })));\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.closeDialog = createEvent(this, \"closeDialog\");\n this.logger = LoggerProvider.logger;\n this.securityContextService = service(SecurityContextService);\n this.securityService = service(SecurityService);\n this.trackingService = service(TrackingService);\n /**\n * Debounced version of the `toggleChanged` method to prevent rapid consecutive calls when the user toggles cookie\n * consent options multiple times in quick succession.\n * This is needed because the `toggleChanged` method involves adding and removing tracking scripts based on the user's\n * consent, and rapid toggling can lead to multiple unnecessary script manipulations, which can cause performance\n * issues and unintended side effects.\n */\n this.toggleChangedDebounced = debounce((event) => this.toggleChanged(event), 300);\n }\n toggleChangeHandler(event) {\n this.toggleChangedDebounced(event);\n }\n toggleChanged(event) {\n this.setUserCookieConsent(this.updateCookieConsent(event.detail));\n this.securityService.updateAuthenticatedUser(this.user.toUser())\n .then(() => this.securityContextService.updateAuthenticatedUser(this.user))\n .catch(this.logger.error)\n .finally(() => this.trackingService.applyTrackingConsent());\n }\n connectedCallback() {\n this.user = this.securityContextService.getAuthenticatedUser();\n this.cookieConsent = this.trackingService.getCookieConsent();\n }\n render() {\n var _a, _b;\n const config = {\n dialogTitle: TranslationService.translate('cookie.policy.title'),\n onClose: () => this.closePolicyDialog(),\n modalClass: 'cookie-policy-modal',\n };\n return (h(\"onto-dialog\", { key: 'bdd402a836636e6c15811b3615703ea1eebd8d7c', config: config }, h(\"div\", { key: '1f1b4d80214907ae882b7322c48190f2152e12d9', slot: 'body' }, h(\"section\", { key: '1b1a59be322de2736ca62ad373a51d18a1a06b79' }, h(\"h4\", { key: 'dede6b4f005e6a661675479f5531ddad7a0235d4' }, h(\"translate-label\", { key: 'ee1741896c0ff590ab9efbec9bf0a5025a30909f', labelKey: 'cookie.policy.purpose_heading' })), h(\"p\", { key: 'e4a5b233c2809f901dd182f8d9aec0de27fc2099' }, h(\"translate-label\", { key: '631d8eb62fb92be49d0ded38b6aa1a280948ae19', labelKey: 'cookie.policy.purpose_text' })), h(\"p\", { key: '1254f3f2632b00bb296c00454a7df7d5b383ece5' }, h(\"translate-label\", { key: '5ceda3dada67081dbd17e1afa867a24a9016a564', labelKey: 'cookie.policy.purpose_enterprise_text' }))), h(\"section\", { key: '4796f96a4798348052387f6d379fcb2057c4b660' }, h(\"h4\", { key: '2ef14f483c1ff6fd1ecb891f7b9a6ed57b628805' }, h(\"translate-label\", { key: '09481c09192b35faa19b2006bdc3b21a9589cbdc', labelKey: 'cookie.policy.privacy_commitment_heading' })), h(\"p\", { key: '2cca9fe31f8f315c9ea123240bffc22f43bdfa77' }, h(\"translate-label\", { key: '4e8a55d364dffb76ea88c395967abd1681ceeec0', labelKey: 'cookie.policy.privacy_commitment_text' })), h(\"ul\", { key: 'ceac17908898768e92263452faa0d05b654355aa' }, h(\"li\", { key: 'c72361f5d3c17e068041f66e1986ba2152153f56' }, h(\"translate-label\", { key: '66a3534fd00d05e038c566c47c27a817e0840312', labelKey: 'cookie.policy.privacy_commitment_1' })), h(\"li\", { key: 'f64a3900424c3df46fabaa81b710626445dd25b9' }, h(\"translate-label\", { key: '1e0e45ea0bba3f66f483217514006e685544f7ce', labelKey: 'cookie.policy.privacy_commitment_2' })))), h(\"section\", { key: '5046d6f2a87f421da264d8ca56e586c96806c8d2' }, h(\"h4\", { key: 'f29934a5affad89f5f29bc18aaf4e0a7431a676c' }, h(\"translate-label\", { key: '88786391aa0c7dfee08e8a69c44cdc8f2fdf86ba', labelKey: 'cookie.policy.cookies_heading' })), h(\"p\", { key: '30445e55fede20a71babaac4656b2aa04bf95029' }, h(\"translate-label\", { key: 'f0a85e21c58d6192b7173a2fdcdadb0cac500d51', labelKey: 'cookie.policy.cookies_text' }))), h(\"section\", { key: '6d63492ca8e98e66ee3dac34a9f2d4804598aae3' }, h(\"h4\", { key: '2acb72a66961b4a7669421631c567ae220c37340' }, h(\"translate-label\", { key: '150994d027db50124deb8382ff86defd4d9f73ca', labelKey: 'cookie.policy.manage_cookies_heading' })), h(\"onto-toggle-switch\", { key: 'abe22d435107f38ff392ece9b1e93436b18d8865', class: \"statistic-cookies-toggle\", checked: (_a = this.cookieConsent) === null || _a === void 0 ? void 0 : _a.statistic, labelKey: 'cookie.policy.statistic_cookies', tooltipTranslationKey: 'cookie.policy.statistic_tooltip', context: CookieType.STATISTIC }), h(\"p\", { key: 'c58bd5346cbf64fc806476af9aca4114ffdf2f19' }, h(\"translate-label\", { key: '5494f13d7c4e5e9b8ad1dd2833d61dcf8abbaadb', labelKey: 'cookie.policy.statistic_text' })), h(\"onto-toggle-switch\", { key: 'a126d4e367ac72f3afabf4cbcad60600c1674256', class: \"third-party-cookies-toggle\", checked: (_b = this.cookieConsent) === null || _b === void 0 ? void 0 : _b.thirdParty, labelKey: 'cookie.policy.third_party_cookies', tooltipTranslationKey: 'cookie.policy.third_party_tooltip', context: CookieType.THIRD_PARTY }), h(\"p\", { key: '98eaa1cd8bf32b975fbf6158151c23ecb75ae775' }, h(\"translate-label\", { key: '3e3480010862cba108e3b2a2ea132e2ec8f7d38f', labelKey: 'cookie.policy.third_party_cookies_text' }))), h(\"p\", { key: '2f229fbfb8e618771c96ff69022bdbe41ae073aa' }, h(\"span\", { key: '89601e4bda0080f30395f7ab7717ed2894003df4' }, h(\"translate-label\", { key: '7e1c004df16f9c96593bd08ed572f330980f9b1f', labelKey: 'cookie.policy.change_cookies' }), h(\"i\", { key: '0b63d510ac728e75687dbfb89baf199a7ff789ac' }, \"\\u00A0\", h(\"translate-label\", { key: '84ca2e5206973463bb76e464c0de825778b5161c', labelKey: 'menu.setup.label' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: '8cd61ed1aa3b45d15845da57adba70c0136cc465', labelKey: 'menu.my.settings.label' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: 'a540e7209ce07f18cade46ca26593c067f0e5967', labelKey: 'security.user.settings' }), \"\\u00A0>\\u00A0\", h(\"translate-label\", { key: '122e0f07061903adb8e68ac632766cdce0544140', labelKey: 'cookie.policy.change_cookies_location4' }), \"\\u00A0\"))))));\n }\n /**\n * TODO: This is comment from the previous implementation in the legacy and needs to be re-evaluated and updated if necessary.\n *\n * Closes the modal and passes a result to indicate if the page should be reloaded.\n * - The page reloads only if the user has\n * (1) toggled third-party consent multiple times (`didAbusedThirdPartyToggle`),\n * (2) left third-party consent as enabled (`hasThirdPartyConsent`), and\n * (3) previously accepted the overall policy (`hasPolicyAccepted`)\n * - This reload is necessary in cases where multiple third-party consent changes\n * lead to duplicate and redundant tracking data being loaded.\n */\n closePolicyDialog() {\n this.closeDialog.emit();\n }\n updateCookieConsent(payload) {\n // Context is either 'thirdParty' or 'statistic'\n this.cookieConsent[payload.context] = payload.checked;\n this.cookieConsent.updatedAt = DateUtil.now();\n return this.cookieConsent;\n }\n setUserCookieConsent(cookieConsent) {\n if (!this.user.appSettings) {\n this.user.setAppSettings();\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","function debounce(func, wait = 300) {\n let timer;\n return (...args) => {\n clearTimeout(timer);\n timer = setTimeout(() => func.apply(this, args), wait);\n };\n}\n\nexport { debounce as d };\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","CookieType","style","OntoCookiePolicyDialog","closeDialog","logger","LoggerProvider","securityContextService","service","SecurityContextService","securityService","SecurityService","trackingService","TrackingService","toggleChangedDebounced","debounce","toggleChanged","toggleChangeHandler","setUserCookieConsent","updateCookieConsent","detail","updateAuthenticatedUser","user","toUser","then","catch","error","finally","applyTrackingConsent","connectedCallback","getAuthenticatedUser","cookieConsent","getCookieConsent","_a","_b","config","dialogTitle","TranslationService","translate","onClose","closePolicyDialog","modalClass","slot","checked","statistic","tooltipTranslationKey","context","STATISTIC","thirdParty","THIRD_PARTY","payload","updatedAt","DateUtil","now","appSettings","setAppSettings","COOKIE_CONSENT","func","wait","timer","args","clearTimeout","setTimeout","apply","sanitizeHTML","html","element","document","createElement","innerHTML","value","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","ServiceProvider","get","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,GAG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ASrN,QAAQ2C,QAAQ6K,GAAiBE,WAA1CL,CAAsD3K,IAKlE,EAER,C,SApDA1C,QACKC,OAAO,qDAvBI,CACZ,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__=67888;export const __webpack_esm_ids__=[9717,67888,73702,82926,96248];export const __webpack_esm_modules__={9717(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},54419(e,r,o){o(96248);var t=o(28847),s=o(78618);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},67888(e,r,o){o(82493),o(5687),o(39324),o(73702),o(82926),o(83136),o(76933),o(47195),o(56669),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},73702(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},82926(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.3.2">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},83136(e,r,o){var t=o(28847),s=(o(54419),o(9717),o(18025)),i=o(57436),c=o(7796),a=o(56636),l=o(57154);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),y(),o.displayResources=o.resources.toList().filter(A).filter(E),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},y=()=>{s.R.NAME===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},f=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),h=e=>(r,o)=>{const t=l.ByteUtils.convertToBytes(r.importResource.size),s=l.ByteUtils.convertToBytes(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),A=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),E=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",u),u.$inject=["$timeout","ImportContextService"]},96248(e,r,o){var t=o(304);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}}};
2
- //# sourceMappingURL=67888.41803878170b6c7a5ca5.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"67888.41803878170b6c7a5ca5.bundle.js","mappings":"mJAQA,SAASA,EAAkCC,EAAYC,GACnD,MAAO,CACHC,SAAU,IACVC,YAAa,+DACbC,MAAO,CACHC,SAAU,KAEdC,KAAOC,IACH,MAAMC,EAAc,GAKpBD,EAAOE,gBAAkB,kCACzBF,EAAOG,eAAgB,EACvBH,EAAOI,QAAUJ,EAAOF,SAASO,eAAeD,QAChDJ,EAAOM,cAAgBN,EAAOF,SAASO,eAAeC,cACtDN,EAAOO,QAAUC,mBAAmBR,EAAOF,SAASO,eAAeI,SACnET,EAAOU,YAAcV,EAAOF,SAASO,eAAeK,YACpDV,EAAOW,WAAaX,EAAOF,SAASO,eAAeM,WACnDX,EAAOY,eAAiBZ,EA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A4BvC,QAAU,CAAC,WAAY,uB,4BC/BnDH,QACKC,OAAO,4EAA6E,IACpFW,WAAW,wCAAyCwK,GAEzDA,EAAsCjL,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMkL,EAASC,EAAAA,EAAeD,OAE9B,SAASD,EAAsC/M,EAAQkN,EAAmBC,EAAYC,EAAQxK,GAC1F5C,EAAO4C,QAAUA,EAGjB5C,EAAOgB,MAAQ,KACXkM,EAAkBG,WAGtBrN,EAAOsN,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUzN,EAAO4C,SAChC8K,KAAK,KACFN,EAAOO,QAAQR,EAAWS,QAAQ,6CAClC5N,EAAOgB,SACP6M,IACAb,EAAOc,MAAM,wBAAyBD,KAGtD,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.3.2\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\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}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"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,MAAO,CACHC,OAAQD,EAAEC,OAAOC,MACjBhB,UAAWc,EAAEd,UA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MiB,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,OAKNF,EAAS,WACLC,EAAME,QAAQC,QAAS,CAC3B,EAAG,EAEX,CAC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tB,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":""}