@sava-info-systems/api-maker-with-extensions 2.3.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/.dockerignore +5 -1
  2. package/Dockerfile +1 -35
  3. package/Dockerfile.base +22 -0
  4. package/Dockerfile.extended-base +44 -0
  5. package/dist/1025.5c34b11ab88519fd.js +1 -0
  6. package/dist/1097.3c5b2b4587cefa6e.js +1 -0
  7. package/dist/115.8d10b2b963e7d632.js +1 -0
  8. package/dist/148.f8f560a5f818328e.js +1 -0
  9. package/dist/1558.576af7585833e289.js +1 -0
  10. package/dist/1678.14f917ee37080d63.js +1 -0
  11. package/dist/1754.fc6d6e9f6c1e96d5.js +1 -0
  12. package/dist/1928.9c9375dd036b025a.js +1 -0
  13. package/dist/1957.b718aa368330b524.js +1 -0
  14. package/dist/2140.bb097d69bcb6a1e5.js +1 -0
  15. package/dist/2295.aa3514c8d1238cb2.js +1 -0
  16. package/dist/238.553f30dbe5124419.js +1 -0
  17. package/dist/2473.260a6b26a70eaa8d.js +1 -0
  18. package/dist/2579.b02fe6a8ba3a2e71.js +1 -0
  19. package/dist/2714.b41d14f7378785df.js +1 -0
  20. package/dist/2735.4046cae4c68ac75f.js +1 -0
  21. package/dist/292.bb85e0ea91dcc118.js +1 -0
  22. package/dist/3139.5dd9289cc24b4100.js +1 -0
  23. package/dist/3450.588aafa515b19133.js +1 -0
  24. package/dist/3664.ed1232e3c70195fc.js +1 -0
  25. package/dist/3752.d4e0a280a37c1426.js +1 -0
  26. package/dist/3rdpartylicenses.txt +1 -1
  27. package/dist/4110.b9ebfd9a7382c450.js +1 -0
  28. package/dist/4186.2fd0537d5bc6d882.js +1 -0
  29. package/dist/4211.b6b9f495b100e985.js +1 -0
  30. package/dist/4575.1fee055d10b57afc.js +1 -0
  31. package/dist/4842.ccf765ed3e9753a7.js +1 -0
  32. package/dist/485.7870367c9475fed8.js +1 -0
  33. package/dist/{4895.a54759704d1994b1.js → 4895.fa7b24d66157c531.js} +1 -1
  34. package/dist/5334.e0a2450fc295f659.js +1 -0
  35. package/dist/5421.2c2c0fbf926792db.js +1 -0
  36. package/dist/5434.0997994b319a866a.js +1 -0
  37. package/dist/5679.e362a3e10cb1b953.js +1 -0
  38. package/dist/5761.6c20b09245ac31ef.js +1 -0
  39. package/dist/5765.8d761aef1708e8a1.js +1 -0
  40. package/dist/6236.969b45cad747277c.js +1 -0
  41. package/dist/6393.1b7b097f17d75290.js +1 -0
  42. package/dist/6401.f18e3c98d6deaa22.js +1 -0
  43. package/dist/6650.05ea40acd68697c3.js +1 -0
  44. package/dist/7368.85d940d08fdca6e2.js +1 -0
  45. package/dist/7436.4a62f7ef13cffb21.js +1 -0
  46. package/dist/7470.d24359dc7a3ef75a.js +1 -0
  47. package/dist/7649.8e5ff8a951b474e0.js +1 -0
  48. package/dist/7975.d3d7064d527ac017.js +1 -0
  49. package/dist/7977.85b17bdb465e9a90.js +1 -0
  50. package/dist/7987.c1637bec96a9cc03.js +1 -0
  51. package/dist/8125.8390bc1b477ec6b9.js +1 -0
  52. package/dist/8266.0bf85311cf40ddff.js +1 -0
  53. package/dist/8296.fe54c3787977fad3.js +1 -0
  54. package/dist/885.7e1ec0f82adbdd6f.js +1 -0
  55. package/dist/891.fee03277c7f1c29d.js +1 -0
  56. package/dist/{913.4580b4ce4307a40f.js → 913.e49eb351997bc25c.js} +1 -1
  57. package/dist/9243.eaa2c312b42fc4b3.js +1 -0
  58. package/dist/9575.8404e98d640fd9f9.js +1 -0
  59. package/dist/9939.537c5e355804804b.js +1 -0
  60. package/dist/assets/images/icons/api-group-light.svg +11 -0
  61. package/dist/assets/images/icons/api-group.svg +5 -5
  62. package/dist/assets/images/icons/api-maker-deployment-light.svg +5 -0
  63. package/dist/assets/images/icons/api-maker-deployment.svg +3 -3
  64. package/dist/assets/images/icons/api-user-light.svg +12 -0
  65. package/dist/assets/images/icons/api-user.svg +2 -2
  66. package/dist/assets/images/icons/comparator-light.svg +61 -0
  67. package/dist/assets/images/icons/comparator.svg +2 -2
  68. package/dist/assets/images/icons/custom-light.svg +6 -0
  69. package/dist/assets/images/icons/custom.svg +5 -5
  70. package/dist/assets/images/icons/database-light.svg +29 -0
  71. package/dist/assets/images/icons/database.svg +6 -6
  72. package/dist/assets/images/icons/db-m-light.svg +10 -0
  73. package/dist/assets/images/icons/db-m.svg +4 -4
  74. package/dist/assets/images/icons/db-token-generator-light.svg +4 -0
  75. package/dist/assets/images/icons/db-token-generator.svg +4 -0
  76. package/dist/assets/images/icons/dev-light.svg +13 -0
  77. package/dist/assets/images/icons/dev.svg +4 -4
  78. package/dist/assets/images/icons/diagram-light.svg +28 -0
  79. package/dist/assets/images/icons/diagram.svg +9 -9
  80. package/dist/assets/images/icons/event-light.svg +16 -0
  81. package/dist/assets/images/icons/event.svg +4 -4
  82. package/dist/assets/images/icons/film-movies-icon.svg +3 -3
  83. package/dist/assets/images/icons/finder-light.svg +14 -0
  84. package/dist/assets/images/icons/finder.svg +3 -3
  85. package/dist/assets/images/icons/i18n-light.svg +11 -0
  86. package/dist/assets/images/icons/i18n.svg +6 -6
  87. package/dist/assets/images/icons/increment-light.svg +5 -0
  88. package/dist/assets/images/icons/increment.svg +2 -2
  89. package/dist/assets/images/icons/license-light.svg +6 -0
  90. package/dist/assets/images/icons/license.svg +4 -4
  91. package/dist/assets/images/icons/log-light.svg +17 -0
  92. package/dist/assets/images/icons/log-profile-light.svg +23 -0
  93. package/dist/assets/images/icons/log-profile.svg +7 -7
  94. package/dist/assets/images/icons/log.svg +6 -6
  95. package/dist/assets/images/icons/masters.svg +3 -3
  96. package/dist/assets/images/icons/native-process-logs-light.svg +13 -0
  97. package/dist/assets/images/icons/native-process-logs.svg +6 -6
  98. package/dist/assets/images/icons/nodes-light.svg +5 -0
  99. package/dist/assets/images/icons/nodes.svg +2 -2
  100. package/dist/assets/images/icons/notes-light.svg +16 -0
  101. package/dist/assets/images/icons/notes.svg +2 -2
  102. package/dist/assets/images/icons/process_initializers-light.svg +20 -0
  103. package/dist/assets/images/icons/process_initializers.svg +7 -7
  104. package/dist/assets/images/icons/rsa_encryption-light.svg +6 -0
  105. package/dist/assets/images/icons/rsa_encryption.svg +2 -2
  106. package/dist/assets/images/icons/sandbox-light.svg +11 -0
  107. package/dist/assets/images/icons/sandbox.svg +2 -2
  108. package/dist/assets/images/icons/scanning-period-light.svg +13 -0
  109. package/dist/assets/images/icons/scanning-period.svg +4 -4
  110. package/dist/assets/images/icons/schedulers-light.svg +8 -0
  111. package/dist/assets/images/icons/schedulers.svg +5 -5
  112. package/dist/assets/images/icons/secret-light.svg +15 -0
  113. package/dist/assets/images/icons/secret.svg +2 -2
  114. package/dist/assets/images/icons/swagger-logo-light.svg +9 -0
  115. package/dist/assets/images/icons/swagger-logo.svg +2 -2
  116. package/dist/assets/images/icons/systems-light.svg +8 -0
  117. package/dist/assets/images/icons/systems.svg +3 -3
  118. package/dist/assets/images/icons/testing-light.svg +12 -0
  119. package/dist/assets/images/icons/testing.svg +6 -6
  120. package/dist/assets/images/icons/third-party-light.svg +19 -0
  121. package/dist/assets/images/icons/third-party.svg +4 -4
  122. package/dist/assets/images/icons/typescript-light.svg +12 -0
  123. package/dist/assets/images/icons/typescript.svg +2 -2
  124. package/dist/assets/images/icons/ui-maker-light.svg +23 -0
  125. package/dist/assets/images/icons/ui-maker.svg +10 -10
  126. package/dist/assets/images/icons/utility-light.svg +19 -0
  127. package/dist/assets/images/icons/utility.svg +2 -2
  128. package/dist/assets/images/icons/vulnerability-light.svg +20 -0
  129. package/dist/assets/images/icons/vulnerability.svg +5 -5
  130. package/dist/assets/images/icons/web-light.svg +16 -0
  131. package/dist/assets/images/icons/web.svg +3 -3
  132. package/dist/assets/images/logo/api_maker_logo_dark.svg +29 -0
  133. package/dist/assets/images/logo/api_maker_logo_full_white.svg +29 -0
  134. package/dist/assets/images/logo/api_maker_logo_light.svg +22 -0
  135. package/dist/assets/images/logo/apple-touch-icon.png +0 -0
  136. package/dist/assets/images/logo/favicon-192x192.png +0 -0
  137. package/dist/assets/images/logo/favicon-32x32.png +0 -0
  138. package/dist/assets/images/logo/favicon-512x512.png +0 -0
  139. package/dist/assets/images/logo/logo_docs-light.svg +15 -0
  140. package/dist/assets/images/logo/logo_docs.svg +3 -3
  141. package/dist/assets/images/logo/logo_store-light.svg +17 -0
  142. package/dist/assets/images/logo/logo_store.svg +3 -3
  143. package/dist/assets/images/logo/store_logo-dark.svg +11 -0
  144. package/dist/assets/images/logo/store_logo-light.svg +11 -0
  145. package/dist/assets/images/logo/store_logo.svg +2 -2
  146. package/dist/assets/primeng-theme/primeng-theme-overrides.scss +1426 -31
  147. package/dist/assets/public/diagram-viewer/index.html +59 -20
  148. package/dist/assets/public/diagram-viewer/index.js +1 -1
  149. package/dist/assets/public/monaco-editor/index.html +105 -9
  150. package/dist/assets/public/monaco-editor/index.js +1 -1
  151. package/dist/assets/public/table-viewer/index.html +124 -38
  152. package/dist/assets/schema-types/InterfaceProps.ts +71 -13
  153. package/dist/assets/schema-types/store-types.ts +2 -0
  154. package/dist/assets/schema-types/types.ts +65 -17
  155. package/dist/assets/styles/bootstrap-overrides.scss +170 -7
  156. package/dist/assets/styles/colors-dark.scss +320 -33
  157. package/dist/assets/styles/colors-light.scss +453 -9
  158. package/dist/assets/styles/out/styles.css.map +1 -1
  159. package/dist/assets/styles/styles.scss +213 -24
  160. package/dist/assets/styles/variables.scss +2 -2
  161. package/dist/bootstrap-overrides.css +1 -0
  162. package/dist/colors-dark.css +1 -0
  163. package/dist/colors-light.css +1 -0
  164. package/dist/{common.912ad7a22e5de63a.js → common.86c514055f788290.js} +1 -1
  165. package/dist/index.html +111 -27
  166. package/dist/main.0ac98a72f1b9c1dd.js +1 -0
  167. package/dist/runtime.0e9fc303007ced09.js +1 -0
  168. package/dist/styles-global.css +1 -0
  169. package/dist/{styles.242217e145c3f7ab.css → styles.c1032bc4f4d7829b.css} +1 -1
  170. package/main.js +1 -1
  171. package/package-sandbox.json +1 -1
  172. package/package.json +9 -9
  173. package/pnpm-workspace.yaml +15 -0
  174. package/sandbox.js +1 -1
  175. package/src/assets/schema-types/store-types.ts +2 -0
  176. package/src/assets/schema-types/types.ts +65 -17
  177. package/src/schema-types/store-types.js +2 -0
  178. package/src/schema-types/types.js +1 -0
  179. package/src/tools/.github/copilot-instructions.md +17 -9
  180. package/src/tools/local-client.js +1 -1
  181. package/dist/1025.a0db9347453600d0.js +0 -1
  182. package/dist/1097.d0d6fd13031aa1f0.js +0 -1
  183. package/dist/148.1dc7d9e0cfe45510.js +0 -1
  184. package/dist/1558.0aae3e5c538d3815.js +0 -1
  185. package/dist/1678.ed1e4a269e0f42bc.js +0 -1
  186. package/dist/1754.691f142aa1eabe28.js +0 -1
  187. package/dist/1928.2b376f7cf66ed038.js +0 -1
  188. package/dist/1957.ab7fda21d9978597.js +0 -1
  189. package/dist/2140.1ce150285aebe3cc.js +0 -1
  190. package/dist/2295.4fa1d4b5ff482f3a.js +0 -1
  191. package/dist/238.891233aa670bdd2b.js +0 -1
  192. package/dist/2473.4b2bb1ad5b1cc99d.js +0 -1
  193. package/dist/2579.6558b67b2d98f116.js +0 -1
  194. package/dist/2714.0d6939336a02dd0a.js +0 -1
  195. package/dist/2735.86437a8639a0c1bb.js +0 -1
  196. package/dist/292.f6482cd1a572ba4b.js +0 -1
  197. package/dist/3139.0921102d181c220d.js +0 -1
  198. package/dist/3450.9b5cfc83039b02b5.js +0 -1
  199. package/dist/3664.4a1dd7f16f8b57fb.js +0 -1
  200. package/dist/4110.d108e786ecbdfd1b.js +0 -1
  201. package/dist/4186.ac3e8af0efeeac14.js +0 -1
  202. package/dist/4211.1bfe72ce0b7b2f76.js +0 -1
  203. package/dist/443.7e3946651373e09a.js +0 -1
  204. package/dist/4575.169008cbbbae66bb.js +0 -1
  205. package/dist/4842.e7649d81606ad80d.js +0 -1
  206. package/dist/485.b546656b466cb8a4.js +0 -1
  207. package/dist/5334.72c1c6d89fdf136e.js +0 -1
  208. package/dist/5421.2067001c10533303.js +0 -1
  209. package/dist/5679.4e22239895c7f520.js +0 -1
  210. package/dist/5761.331ca41ab64cca92.js +0 -1
  211. package/dist/5765.2b640be5d177d794.js +0 -1
  212. package/dist/6236.6c0fc469f0c96549.js +0 -1
  213. package/dist/6393.173ecdfc3b022973.js +0 -1
  214. package/dist/6401.374823002788afe7.js +0 -1
  215. package/dist/6650.1d18ee25901d68be.js +0 -1
  216. package/dist/7368.9ebf62d518f8ad7a.js +0 -1
  217. package/dist/7436.640bf5fe48814cbe.js +0 -1
  218. package/dist/7470.b1ce7eedb9cedb2d.js +0 -1
  219. package/dist/7649.ab4744cfe713eec0.js +0 -1
  220. package/dist/7975.578a00ebd1160a1e.js +0 -1
  221. package/dist/7977.afeded970bac8b66.js +0 -1
  222. package/dist/7987.5958ad5b81873058.js +0 -1
  223. package/dist/8125.b2f908096882ed45.js +0 -1
  224. package/dist/8266.aca59a0a04590ab1.js +0 -1
  225. package/dist/8296.a387c28f5702c5e8.js +0 -1
  226. package/dist/885.be44d92efca1aaf6.js +0 -1
  227. package/dist/891.5e08c81e5200413e.js +0 -1
  228. package/dist/9243.08630ad94e1fddba.js +0 -1
  229. package/dist/9575.30ac91b65602c0ca.js +0 -1
  230. package/dist/9939.a3389cc6764e3cbc.js +0 -1
  231. package/dist/assets/images/logo/API Maker Logo 2021 black.svg +0 -47
  232. package/dist/assets/images/logo/API Maker Logo 2021.svg +0 -49
  233. package/dist/assets/images/logo/logo.svg +0 -41
  234. package/dist/assets/styles/out/bootstrap-overrides.css +0 -2
  235. package/dist/assets/styles/out/colors-dark.css +0 -2
  236. package/dist/assets/styles/out/colors-light.css +0 -2
  237. package/dist/assets/styles/out/monaco-editor-overrides.css +0 -2
  238. package/dist/assets/styles/out/styles.css +0 -2
  239. package/dist/assets/styles/out/variables.css +0 -2
  240. package/dist/favicon.ico +0 -0
  241. package/dist/main.2046fb4b0dd1b8e0.js +0 -1
  242. package/dist/runtime.a86d5cd27767506e.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1097],{51097:(pa,re,l)=>{l.r(re),l.d(re,{DbMastersM:()=>ca});var Q=l(77664),q=l(17017),H=l(63726),d=l(15861),u=l(60095),g=l(6990),le=l(78645),de=l(83620),m=l(33157),p=l(90328),x=l(59361),C=l(51162),Z=l(20553),E=l(45085),L=l(91601),b=l(3531),B=l(39989),G=l(31495),e=l(94946),w=l(99961),U=l(77240),k=l(27414),ce=l(99729),A=l(95852),V=l(45809),ue=l(84795),N=l(53429),O=l(32915),K=l(56097),j=l(32094),W=l(25405),P=l(96814),z=l(32660),X=l(5860),ee=l(756),F=l(85219),me=l(91396),J=l(97680),R=l(14844),Y=l(33259),De=l(53965),te=l(25025),Ue=l(54323);const ke=["insertCodeModalC"],Ze=["monacoEditorModalC"];function we(i,s){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",45),e._uU(2," Add UI Page"),e.qZA())}function Ie(i,s){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",46),e._uU(2," View UI Page"),e.qZA())}function xe(i,s){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e._uU(2," Edit UI Page "),e.TgZ(3,"span",48),e._uU(4),e.qZA(),e.TgZ(5,"span",48),e._uU(6),e.qZA(),e.TgZ(7,"span",48),e._uU(8),e.qZA(),e.TgZ(9,"span",48),e._uU(10),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(null==t.form.get("instanceName").value?null:t.form.get("instanceName").value.name),e.xp6(2),e.hij("| \xa0",null==t.form.get("databaseName").value?null:t.form.get("databaseName").value.db,""),e.xp6(2),e.hij("| \xa0",null==t.form.get("collectionName").value?null:t.form.get("collectionName").value.name,""),e.xp6(2),e.hij("| \xa0",t.form.get("name").value,"")}}function Ee(i,s){if(1&i&&(e._UZ(0,"span",49),e.ALo(1,"safeHtml")),2&i){const t=s.$implicit;e.Q6J("innerHTML",e.lcZ(1,1,t.labelHTML||t.label),e.oJD)}}function Fe(i,s){if(1&i&&(e._UZ(0,"span",49),e.ALo(1,"safeHtml")),2&i){const t=s.$implicit;e.Q6J("innerHTML",e.lcZ(1,1,t.labelHTML||t.label),e.oJD)}}function Ae(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"div",50)(1,"app-monaco-editor",51),e.NdJ("onDidChangeModelContent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.editorConfigValueChanged())})("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!1)("editorOptions",t.editorOptionsDBMasters)}}function Ne(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"div",50)(1,"app-monaco-editor",51),e.NdJ("onDidChangeModelContent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.editorConfigJSValueChanged())})("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGeneratedJSUtil(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptionsDBMastersJS)}}function Oe(i,s){if(1&i&&(e.TgZ(0,"span",52),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.AsE(" You are allowed to use ",null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI," UI pages, and you are using ",t.totalCreatedMasters," UI Pages. ")}}function Pe(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"a",53),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Je(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Re(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",55),e.YNc(2,Je,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Ye(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Le(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Qe(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",55),e.YNc(2,Ye,2,0,"span",4),e.YNc(3,Le,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid||t.totalCreatedMasters>(null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI)),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function qe(i,s){1&i&&e._UZ(0,"p-progressSpinner",56)}let pe=(()=>{class i{fb;ns;generalS;constantsS;dbMastersS;authCS;monacoS;authS;instanceS;eventCenterS;localClientSyncUtilsS;webSocketClientCS;eventCenterCS;generalCS;zone;cd;data;totalCreatedMasters;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=m.F;id;activeIndex=0;BE_HOST_PORT=Z.N.BE_HOST_PORT;DOCS_HOST_PORT=Z.N.DOCS_HOST_PORT;instances=[];editorDBMaster;editorDBMasterJS;editorOptionsDBMasters={readOnly:!1,language:"typescript",contextmenu:!0};editorOptionsDBMastersJS={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab={};dbIdMap={};colIdMap={};formDataTemp=null;selectedConfigOutlineNode;outlineData=[];selectedConfigOutlineNodeFunctions;outlineDataFunctions=[];constructor(t,a,o,n,r,c,f,h,_,S,T,v,y,D,ua,ma){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.dbMastersS=r,this.authCS=c,this.monacoS=f,this.authS=h,this.instanceS=_,this.eventCenterS=S,this.localClientSyncUtilsS=T,this.webSocketClientCS=v,this.eventCenterCS=y,this.generalCS=D,this.zone=ua,this.cd=ma}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===m.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===m.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.form.disable(),t.cd.detectChanges();else if(o.action===m.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.resetDependentObjects("INSTANCE"),yield t.loadInstances();const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,E.R.DB_MASTERS_JSON).toPromise();t.editorOptionsDBMasters={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMaster",n.data);const r=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,E.R.DB_MASTERS_JS_UTILS).toPromise();t.editorOptionsDBMastersJS={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMasterJS",r.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.editorConfigValueChangedSubject.pipe((0,de.b)(500)).subscribe((0,d.Z)(function*(){const a=t.editorDBMaster.getValue();a&&(yield t.getOutlineDBMaster({tsCode:a,mode:"config"}))}))),t.subscriptions.push(t.editorConfigJSValueChangedSubject.pipe((0,de.b)(500)).subscribe((0,d.Z)(function*(){const a=t.editorDBMasterJS.getValue();a&&(yield t.getOutlineDBMasterJS({tsCode:a,mode:"utility_functions"}))}))),t.subscriptions.push(t.eventCenterCS.dataChangedInDatabase.subscribe(function(){var a=(0,d.Z)(function*(o){if(o){if(!t.data.formData)return;for(const n in o){const r=t.webSocketClientCS.getCategoryOfPath(n),f=t.generalCS.getUtf8FromBase64String(o[n].content);r===G.c.DB_MASTERS&&t.localClientSyncUtilsS.dataChangedInUIMakerPages(n,f,t.data.formData,t.editorDBMaster,t.editorDBMasterJS)}}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.dbMastersS.getById(t.data.formData._id).toPromise();t.form.reset(),t.resetDependentObjects("INSTANCE"),t.form.patchValue(a.data),t.formDataTemp=a.data,t.generalCS.setValueInEditor(t,"editorDBMaster",a.data?.dbMasterConfigCode||""),t.generalCS.setValueInEditor(t,"editorDBMasterJS",a.data?.pageUtilsCode||""),yield t.loadInstances(),t.editorConfigValueChanged(),t.editorConfigJSValueChanged(),t.formDataTemp=null})()}createForm(){this.form=this.fb.group({name:[null,[u.kI.required,u.kI.minLength(3),u.kI.maxLength(50),u.kI.pattern("[a-zA-Z0-9_-]*$")]],instanceName:[null,[u.kI.required]],databaseName:[null,[u.kI.required]],collectionName:[null,[u.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,this.activeIndex=0,setTimeout(()=>{$("#idDBMastersForm").modal("show")},100)}hideModal(){$("#idDBMastersForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let f;o.instanceName=o.instanceName.name,o.databaseName=o.databaseName.db,o.collectionName=o.collectionName.name,f=a.data.formData&&a.data.formData._id?(yield a.dbMastersS.getById(a.data.formData._id).toPromise()).data:{};const h=Object.assign({},f,o);h.user=a.authCS.getUserId(),h.dbMasterConfigCode=a.editorDBMaster.getValue(),h.pageUtilsCode=a.editorDBMasterJS.getValue();try{let _;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDBMaster,a.monacoDecorations),a.monacoS.clearEditorDecorations(a.editorDBMasterJS,a.monacoDecorations),a.data.mode===p.D.ADD?_=yield a.dbMastersS.post(h).toPromise():a.data.mode===p.D.EDIT&&(_=yield a.dbMastersS.put(h._id,h,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.dbMaster.addSuccess:a.constantsS.dbMaster.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?m.F.SAVED:m.F.UPDATED,data:_}),a.loading.form=!1}catch(_){a.loading.form=!1,a.ns.showErrorFromResponse(_.error||_,"Unable to save database master."),a.lastError=_.error,a.tab=a.tab||{},a.tab.axiosResponse={data:_.error},a.monacoS.highlightErrorInMonacoEditor(a.editorDBMaster,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=x.H.All,this.insertCodeModalC.showModal(b.b.CodeFinderResultC)}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorDBMaster=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=x.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(b.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===B.g.TEXT_COPIED&&o.componentName===b.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorGeneratedJSUtil(t){var a=this;return(0,d.Z)(function*(){a.editorDBMasterJS=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=x.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(b.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===B.g.TEXT_COPIED&&o.componentName===b.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorConfigValueChangedSubject=new le.x;editorConfigValueChanged(){this.editorConfigValueChangedSubject.next()}editorConfigJSValueChangedSubject=new le.x;editorConfigJSValueChanged(){this.editorConfigJSValueChangedSubject.next()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),L.d.json)}loadInstances(){var t=this;return(0,d.Z)(function*(){t.resetDependentObjects("INSTANCE"),t.loading.form=!0;try{const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(a).toPromise()).data||[]}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allInstances=[]}if(t.formDataTemp){const a=t.form.controls.instanceName;t.tab.instance=g.find(t.tab.allInstances,{name:t.formDataTemp.instanceName}),t.tab.instance&&a.setValue(t.tab.instance)}else t.tab.instance=t.tab.allInstances[0];yield t.loadDatabases(),t.loading.form=!1,t.cd.detectChanges()})()}getOutlineDBMaster(t){var a=this;return(0,d.Z)(function*(){try{const o=new Map;a.processNodesForBackupAndRestore(a.outlineData,o,"backup"),a.outlineData=[];const n=a.selectedConfigOutlineNode,r=yield a.instanceS.getOutlineDBMasterConfig(t);a.outlineData=r.data,a.processNodesForBackupAndRestore(a.outlineData,o,"restore"),a.selectedConfigOutlineNode=a.findNodeOfKey(a.outlineData,n?.key),setTimeout(()=>{a.zone.run(()=>{a.outlineData=[...a.outlineData],a.cd.markForCheck()})},10)}catch(o){a.ns.showErrorFromResponse(o.error||o,"Unable to get outline data.")}})()}getOutlineDBMasterJS(t){var a=this;return(0,d.Z)(function*(){try{const o=new Map;a.processNodesForBackupAndRestore(a.outlineDataFunctions,o,"backup"),a.outlineDataFunctions=[];const n=a.selectedConfigOutlineNodeFunctions,r=yield a.instanceS.getOutlineDBMasterConfig(t);a.outlineDataFunctions=r.data,a.processNodesForBackupAndRestore(a.outlineDataFunctions,o,"restore"),a.selectedConfigOutlineNodeFunctions=a.findNodeOfKey(a.outlineDataFunctions,n?.key),setTimeout(()=>{a.zone.run(()=>{a.outlineDataFunctions=[...a.outlineDataFunctions],a.cd.markForCheck()})},10)}catch(o){a.ns.showErrorFromResponse(o.error||o,"Unable to get outline data.")}})()}processNodesForBackupAndRestore(t,a,o){if(Array.isArray(t))for(const n of t)this.processNodesForBackupAndRestore(n,a,o);else"backup"===o?a.set(t.key,t.expanded):"restore"===o&&(t.expanded=a.get(t.key)),t?.children?.length&&this.processNodesForBackupAndRestore(t.children,a,o)}findNodeOfKey(t,a){if(a)if(Array.isArray(t))for(const o of t){const n=this.findNodeOfKey(o,a);if(n)return n}else{if(t.key===a)return t;if(t?.children?.length)return this.findNodeOfKey(t.children,a)}}loadDatabases(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("DATABASE"),!t.tab.instance)return t.tab.allDatabases=[],void(t.tab.allCollections=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance],null).toPromise()).data||[])[0]||[],t.dbIdMap=g.keyBy(t.tab.allDatabases,C.N7.db)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allDatabases=[]}if(t.formDataTemp){const a=t.form.get("databaseName");t.tab.database=g.find(t.tab.allDatabases,{db:t.formDataTemp.databaseName}),t.tab.database&&a.patchValue(t.tab.database)}else t.tab.database=t.tab.allDatabases[0];yield t.loadCollections(),t.loading.form=!1})()}loadCollections(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("COLLECTION"),t.tab.instance&&t.tab.database){try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database],null).toPromise()).data||[])[0]||[],t.colIdMap=g.keyBy(t.tab.allCollections,C.GR.name)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allCollections=[]}if(t.formDataTemp){const a=t.form.get("collectionName");t.tab.collection=g.find(t.tab.allCollections,{name:t.formDataTemp.collectionName}),t.tab.collection&&a.patchValue(t.tab.collection)}else t.tab.collection=t.tab.allCollections[0];t.loading.form=!1,t.cd.detectChanges()}else t.tab.allCollections=[]})()}resetDependentObjects(t){"INSTANCE"===t?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===t?(this.tab.allDatabases=this.tab.allCollections=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===t&&(this.tab.allCollections=[],this.tab.collection=this.tab.api=void 0)}outlineNodeSelected(t,a){const o=t.data,n=a.getValue(),r=this.generalCS.getLineNumberFromIndex(n,o.end);a.setPosition(r),a.revealPositionInCenter(r),a.focus()}generateUIMakerCodeForCollection(){var t=this;return(0,d.Z)(function*(){const o=(yield t.instanceS.getSampleUIMCodeForSchema({instanceName:t.tab.instance.name,databaseName:t.tab.database.db,collectionName:t.tab.collection.name})).data;t.editorDBMaster.setValue(o.configCode),t.editorDBMasterJS.setValue(o.functionsCode)})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(e.Y36(u.qu),e.Y36(w.W),e.Y36(U.b),e.Y36(k.L),e.Y36(ce.z),e.Y36(A.D),e.Y36(V.b),e.Y36(ue.e),e.Y36(N.E),e.Y36(O.u),e.Y36(K._),e.Y36(j.P),e.Y36(W.M),e.Y36(U.b),e.Y36(e.R0b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(ke,5),e.Gf(Ze,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data",totalCreatedMasters:"totalCreatedMasters"},decls:66,vars:32,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDBMastersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["tooltipPosition","left","pTooltip","Generate code for this schema",1,"fas","fa-seedling","fa-fw","text-warning","mr-3","cursor-pointer",2,"font-size","21px",3,"click"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["optionLabel","name","filterBy","name","appendTo","body","formControlName","instanceName","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","databaseName","optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","collectionName","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["header","Code"],[1,"row","m-0"],[1,"col-3","pl-0","pr-2","pt-2","overflow-auto",2,"height","calc(100vh - 186px)"],["selectionMode","single","styleClass","tree-width","scrollHeight","flex",1,"id_ptree_db_master_config_outline",3,"value","hidden","selection","filter","selectionChange"],["pTemplate","default"],[1,"col-9","pl-0","pr-0"],[3,"activeIndex","activeIndexChange"],["header","Config"],["class","overflow-hidden","style","height: calc(100vh - 212px);",4,"ngIf"],["header","userUtils.Main"],[1,"modal-footer"],["class","mr-3 small text-danger",4,"ngIf"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[2,"white-space","nowrap","padding-right","10px",3,"innerHTML"],[1,"overflow-hidden",2,"height","calc(100vh - 212px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","onDidChangeModelContent","editorGenerated"],[1,"mr-3","small","text-danger"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,we,3,0,"span",4),e.YNc(5,Ie,3,0,"span",4),e.YNc(6,xe,11,4,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"i",9),e.NdJ("click",function(){return o.generateUIMakerCodeForCollection()}),e.qZA(),e.TgZ(12,"span",10),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(13,"i",11),e.qZA(),e.TgZ(14,"a",12),e._UZ(15,"img",13),e.qZA()()(),e.TgZ(16,"div",14)(17,"p-tabView")(18,"p-tabPanel",15)(19,"form",16)(20,"div",17)(21,"label",18),e._uU(22,"Name"),e.qZA(),e.TgZ(23,"div",19),e._UZ(24,"input",20),e.qZA()(),e.TgZ(25,"div",17)(26,"label",18),e._uU(27,"Instance"),e.qZA(),e.TgZ(28,"div",19)(29,"p-dropdown",21),e.NdJ("onChange",function(r){return o.tab.instance=r.value,o.loadDatabases()}),e.qZA()()(),e.TgZ(30,"div",17)(31,"label",18),e._uU(32,"Database"),e.qZA(),e.TgZ(33,"div",19)(34,"p-dropdown",22),e.NdJ("onChange",function(r){return o.tab.database=r.value,o.loadCollections()}),e.qZA()()(),e.TgZ(35,"div",17)(36,"label",18),e._uU(37,"Collection"),e.qZA(),e.TgZ(38,"div",19)(39,"p-dropdown",23),e.NdJ("onChange",function(r){return o.tab.collection=r.value}),e.qZA()()()()(),e.TgZ(40,"p-tabPanel",24)(41,"div",25)(42,"div",26)(43,"p-tree",27),e.NdJ("selectionChange",function(r){return o.selectedConfigOutlineNode=r})("selectionChange",function(r){return o.outlineNodeSelected(r,o.editorDBMaster)}),e.YNc(44,Ee,2,3,"ng-template",28),e.qZA(),e.TgZ(45,"p-tree",27),e.NdJ("selectionChange",function(r){return o.selectedConfigOutlineNodeFunctions=r})("selectionChange",function(r){return o.outlineNodeSelected(r,o.editorDBMasterJS)}),e.YNc(46,Fe,2,3,"ng-template",28),e.qZA()(),e.TgZ(47,"div",29)(48,"p-tabView",30),e.NdJ("activeIndexChange",function(r){return o.activeIndex=r}),e.TgZ(49,"p-tabPanel",31),e.YNc(50,Ae,2,3,"div",32),e.qZA(),e.TgZ(51,"p-tabPanel",33),e.YNc(52,Ne,2,3,"div",32),e.qZA()()()()()()(),e.TgZ(53,"div",34),e.YNc(54,Oe,2,2,"span",35),e.YNc(55,Pe,2,0,"a",36),e.TgZ(56,"button",37),e.NdJ("click",function(){return o.hideModal()}),e._UZ(57,"i",38),e._uU(58," Close"),e.qZA(),e.YNc(59,Re,3,2,"button",39),e.YNc(60,Qe,4,3,"button",39),e.qZA(),e.YNc(61,qe,1,0,"p-progressSpinner",40),e.qZA()()(),e._UZ(62,"app-insert-code-modal",41,42)(64,"app-monaco-editor-modal",43,44)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(13),e.Q6J("formGroup",o.form),e.xp6(10),e.Q6J("options",o.tab.allInstances)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allDatabases)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allCollections)("filter",!0),e.xp6(4),e.Q6J("value",o.outlineData)("hidden",0!==o.activeIndex)("selection",o.selectedConfigOutlineNode)("filter",!0),e.xp6(2),e.Q6J("value",o.outlineDataFunctions)("hidden",1!==o.activeIndex)("selection",o.selectedConfigOutlineNodeFunctions)("filter",!0),e.xp6(3),e.Q6J("activeIndex",o.activeIndex),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.totalCreatedMasters>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)),e.xp6(1),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalDBMaster")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,P.O5,z.y,X.P,ee.O,F.jx,me.mp,J.G,R.xf,R.x4,Y.u,De.Lt,te.A,Ue.z],encapsulation:2,changeDetection:0})}return i})();var ae=l(44950);let Be=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[q.u,ae.A]})}return i})();var oe=l(96925),He=l(19394),ie=l(92466),ne=l(60921),se=l(92189),Ge=l(15561),Ve=l(87797),M=l(95431);const Ke=["DBMastersFormC"],je=["cloneApiModalC"];function We(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.toggleExpand())}),e._UZ(1,"i",25),e.qZA()}}function $e(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return o.mode="table",o.selectedRows.length=0,e.KtG(o.selectedRowsTree.length=0)}),e._UZ(1,"i",26),e.qZA()}}function ze(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return o.mode="tree",o.selectedRows.length=0,e.KtG(o.selectedRowsTree.length=0)}),e._UZ(1,"i",27),e.qZA()}}function Xe(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",29),e.qZA()}}function et(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",31),e.qZA()}}function tt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",32),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",33),e.qZA()}}function at(i,s){1&i&&(e.TgZ(0,"th",38),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ot(i,s){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,at,2,0,"th",37),e.TgZ(2,"th",38),e._uU(3,"*"),e.qZA(),e.TgZ(4,"th",39),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Instance \u2192 Database \u2192 Collection"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Required Auth Headers"),e.qZA(),e._UZ(10,"th",40),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function it(i,s){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",46),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function nt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"tr",41),e.YNc(1,it,2,2,"td",42),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",43)(12,"button",44),e.NdJ("click",function(){const n=e.CHM(t).$implicit,r=e.oxw(2);return e.KtG(r.openMasterPageInNewTab(n))}),e._UZ(13,"i",45),e.qZA()()()()}if(2&i){const t=s.$implicit,a=s.rowIndex,o=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",o.showCheckbox),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.lnq("",t.instanceName," \u2192 ",t.databaseName," \u2192 ",t.collectionName,""),e.xp6(2),e.Oqu(t.authHeadersGrid)}}function st(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"p-table",34),e.NdJ("selectionChange",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.selectedRows=o)})("dblclick",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.dblClick())}),e.YNc(1,ot,11,1,"ng-template",35),e.YNc(2,nt,14,8,"ng-template",36),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function rt(i,s){if(1&i&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.label)}}function lt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"div")(2,"table",50)(3,"tr")(4,"td",51),e._uU(5),e.qZA(),e.TgZ(6,"td",51),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",52)(12,"button",44),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,n=e.oxw(2);return e.KtG(n.openMasterPageInNewTab(o.data))}),e._UZ(13,"i",45),e.qZA()()()()()()()}if(2&i){const t=e.oxw().$implicit;e.xp6(5),e.Oqu(t.data.name),e.xp6(2),e.lnq("",t.data.instanceName," \u2192 ",t.data.databaseName," \u2192 ",t.data.collectionName,""),e.xp6(2),e.Oqu(t.data.authHeadersGrid)}}function dt(i,s){if(1&i&&(e.TgZ(0,"div",49),e.YNc(1,rt,2,1,"div",42),e.YNc(2,lt,14,5,"div",42),e.qZA()),2&i){const t=s.$implicit;e.xp6(1),e.Q6J("ngIf",null==t.children?null:t.children.length),e.xp6(1),e.Q6J("ngIf",!(null!=t.children&&t.children.length))}}function ct(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"p-tree",47),e.NdJ("selectionChange",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.selectedRowsTree=o)})("dblclick",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.dblClick())}),e.YNc(1,dt,3,2,"ng-template",48),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("value",t.treeNodes)("selection",t.selectedRowsTree)}}function ut(i,s){1&i&&e._UZ(0,"p-progressSpinner",53)}let fe=(()=>{class i{dbMastersS;generalS;navigationCS;navigationS;authCS;authS;constantsS;eventCenterS;router;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};EUserType=ne.d;gridKey=C.iH._id;EAPICategory=E.R;ENavigationMenu=ie.E;BE_HOST_PORT=Z.N.BE_HOST_PORT;treeNodes=[];allTreeItemsMap={};selectedRows=[];selectedRowsTree=[];mode="tree";dbMastersFormC;cloneApiModalC;constructor(t,a,o,n,r,c,f,h,_,S,T,v,y,D){this.dbMastersS=t,this.generalS=a,this.navigationCS=o,this.navigationS=n,this.authCS=r,this.authS=c,this.constantsS=f,this.eventCenterS=h,this.router=_,this.instanceS=S,this.ns=T,this.cs=v,this.confirmationService=y,this.cd=D}ngOnInit(){var t=this;return(0,d.Z)(function*(){if(!t.authS.backendSettings.extensions)return t.navigationS.gotoDashboard();yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===m.F.SAVED||o.action===m.F.UPDATED)&&(t.dbMastersFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("UI Maker")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a=yield t.dbMastersS.getDBMastersGrid({}).toPromise();if(a){t.selectedRows=[],t.selectedRowsTree=[],t.rows=a.data,t.rowsMap=g.keyBy(t.rows,C.iH._id);for(const o of t.rows){const n=[];for(const r of o.authHeaders||[])n.push(r.name);o.authHeadersGrid=n.join(", ")}}t.setTreeNodes(),t.loading.grid=!1,t.cd.detectChanges()})()}setTreeNodes(){if(this.rows?.length){const t=JSON.parse(JSON.stringify(this.rows));for(const n of t){const r=`/${n.instanceName}/${n.databaseName}/${n.collectionName}/${n.name}`;n.text=r,n.idc=r,n.value=n}const a=this.generalS.convertFlatToTree("/",t,"idc");for(const n of a)this.generalS.convertKTreeItemToPrimeNGTreeItem(n);const o={};this.generalS.getMapOfAllItems(o,a);for(const n of Object.keys(o)){const r=this.allTreeItemsMap[n];r&&(o[n].expanded=r.expanded)}this.treeNodes=a,this.allTreeItemsMap=o}}add(){this.data.formData={order:(g.max(g.map(this.rows,"order"))||0)+1},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.dbMastersFormC.showModal()}edit(){"table"===this.mode?this.data.formData=this.rowsMap[g.map(this.selectedRows,"_id")[0]]:"tree"===this.mode&&(this.data.formData=this.selectedRowsTree[0].data),this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),this.dbMastersFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){yield t.cloneApiModalC.showModal(t.getSelectedRowId(),[u.kI.pattern("[a-zA-Z0-9_-]*$")],function(){var a=(0,d.Z)(function*(o){o&&(yield t.loadGridData()),t.cd.detectChanges()});return function(o){return a.apply(this,arguments)}}())})()}getSelectedRowId(){return"table"===this.mode?this.selectedRows[0]?._id:"tree"===this.mode?this.selectedRowsTree[0]?.data?._id:void 0}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.dbMaster.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){let o=!1;if("table"===t.mode)for(const n of t.selectedRows)yield t.hardDelete(n._id),o=!0;else if("tree"===t.mode){t.data.formData=t.selectedRowsTree[0].data;for(const n of t.selectedRowsTree)yield t.hardDelete(n.data._id),o=!0}o&&(t.ns.showSuccess(t.cs.dbMaster.removePermanent),yield t.loadGridData())}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.dbMastersS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.selectedRowsTree.length=0}dblClick(){"table"===this.mode?this.selectedRows.length&&this.edit():"tree"===this.mode&&this.selectedRowsTree.length&&this.edit()}openMasterPageInNewTab(t){const a=this.authCS.getUserPath();let o=[Z.N.BE_HOST_PORT,"/dist-db-masters/browser/",`?${oe.ZF.ADMIN_PATH}=${a}&`].join("");const n=[`${oe.ZF.DB_MASTER_NAME}=${t.name}`];for(const r of t.authHeaders)n.push(`${r.name}=____actual_header_value____`);o+=n.join("&"),window.open(o,"_blank")}toggleExpand(){let t=null;for(const a in this.allTreeItemsMap){const o=this.allTreeItemsMap[a];null===t&&(t=!o.expanded),o.expanded=t}}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=He.k4;ERequestMethod=oe.Yp;static \u0275fac=function(a){return new(a||i)(e.Y36(ce.z),e.Y36(U.b),e.Y36(se.S),e.Y36(Ge.X),e.Y36(A.D),e.Y36(ue.e),e.Y36(k.L),e.Y36(O.u),e.Y36(Q.F0),e.Y36(N.E),e.Y36(w.W),e.Y36(k.L),e.Y36(F.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-list"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Ke,5),e.Gf(je,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.dbMastersFormC=n.first),e.iGM(n=e.CRH())&&(o.cloneApiModalC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:33,vars:19,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/ui-maker.svg","alt","Database master image",1,"fa-fw","mr-1"],[1,"small","ml-3"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["tooltipPosition","left","pTooltip","Styles For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-css3","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Common Utilities For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-uniregistry","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick",4,"ngIf"],["class","w-full","scrollHeight","calc(100vh - 82px)","selectionMode","multiple",3,"value","selection","selectionChange","dblclick",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"totalCreatedMasters","data"],["DBMastersFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Toggle Expand All",1,"fas","fa-expand-arrows-alt","fa-fw"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["pTooltip","Tree View",1,"fas","fa-sitemap","text-yellow","fa-fw"],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[2,"width","25%"],[2,"width","70px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],["tooltipPosition","left","pTooltip","Open master page",1,"btn","btn-xsm-custom",3,"click"],[1,"fas","fa-external-link-alt","text-info","fa-fw"],[3,"value","pSelectableRow"],["scrollHeight","calc(100vh - 82px)","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],[1,"w-100","prevent-text-selection","cursor-pointer"],[1,"w-100"],[2,"width","30%"],[1,"text-right"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span")(3,"span"),e._UZ(4,"img",2),e._uU(5," UI Pages"),e.qZA(),e.TgZ(6,"span",3),e._uU(7,"Using "),e.TgZ(8,"span"),e._uU(9),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"a",4),e._UZ(12,"img",5),e.qZA(),e.YNc(13,We,2,0,"span",6),e.YNc(14,$e,2,0,"span",6),e.YNc(15,ze,2,0,"span",6),e.TgZ(16,"span",7),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"styles"])}),e._UZ(17,"i",8),e.qZA(),e.TgZ(18,"span",9),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"utils"])}),e._UZ(19,"i",10),e.qZA(),e.TgZ(20,"span",11),e.NdJ("click",function(){return o.add()}),e._UZ(21,"i",12),e.qZA(),e.YNc(22,Xe,2,0,"span",13),e.YNc(23,et,2,0,"span",14),e.YNc(24,tt,2,0,"span",15),e.qZA(),e.TgZ(25,"div",16),e.YNc(26,st,3,6,"p-table",17),e.YNc(27,ct,2,2,"p-tree",18),e.YNc(28,ut,1,0,"p-progressSpinner",19),e.qZA()(),e._UZ(29,"app-db-masters-form",20,21)(31,"app-clone-api-modal",22,23)),2&a&&(e.xp6(8),e.Tol((null==o.rows?null:o.rows.length)>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)?"text-danger":""),e.xp6(1),e.hij(" ",o.rows.length,""),e.xp6(1),e.hij("/",o.authS.backendSettings.dbMastersCountForUI," "),e.xp6(3),e.Q6J("ngIf","tree"===o.mode),e.xp6(1),e.Q6J("ngIf","tree"===o.mode),e.xp6(1),e.Q6J("ngIf","table"===o.mode),e.xp6(7),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2||o.selectedRowsTree.length&&o.selectedRowsTree.length<2),e.xp6(1),e.Q6J("ngIf",1===o.selectedRows.length||1===o.selectedRowsTree.length),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length||o.selectedRowsTree.length),e.xp6(2),e.Q6J("ngIf","table"===o.mode),e.xp6(1),e.Q6J("ngIf","tree"===o.mode),e.xp6(1),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("totalCreatedMasters",null==o.rows?null:o.rows.length)("data",o.data),e.xp6(2),e.Q6J("modalId","idCloneDBMasters")("hostAndPort",o.BE_HOST_PORT)("modelApiPaths",o.EModelApiPaths.DB_MASTERS))},dependencies:[P.O5,Ve.s,M.iA,F.jx,M.Ei,M.UA,M.Mo,me.mp,J.G,Y.u,pe],encapsulation:2,changeDetection:0})}return i})(),_e=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-db-masters-list"),e.qZA())},dependencies:[fe],encapsulation:2})}return i})();var ge=l(29836),mt=l(38057);const pt=["insertCodeModalC"],ft=["monacoEditorModalC"];function _t(i,s){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Styles"),e.qZA())}function gt(i,s){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Styles"),e.qZA())}function ht(i,s){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Styles "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function Ct(i,s){1&i&&(e.TgZ(0,"div",30)(1,"label",31),e._uU(2,"Order No"),e.qZA(),e.TgZ(3,"div",32),e._UZ(4,"input",37),e.qZA()())}function Mt(i,s){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()(),e.TgZ(7,"div",30),e._UZ(8,"label",31),e.TgZ(9,"div",32)(10,"label",34),e._UZ(11,"p-checkbox",35),e.qZA()()(),e.YNc(12,Ct,5,0,"div",36),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form),e.xp6(10),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",t.form.getRawValue().loadInAllPages)}}function bt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"div",38)(1,"app-monaco-editor",39),e.NdJ("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!1)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function St(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Tt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function vt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",42),e.YNc(2,Tt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function yt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Dt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Ut(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",42),e.YNc(2,yt,2,0,"span",4),e.YNc(3,Dt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function kt(i,s){1&i&&e._UZ(0,"p-progressSpinner",43)}let he=(()=>{class i{fb;ns;generalS;constantsS;uiMakerStylesS;authCS;monacoS;instanceS;eventCenterS;localClientSyncUtilsS;webSocketClientCS;eventCenterCS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=m.F;id;BE_HOST_PORT=Z.N.BE_HOST_PORT;DOCS_HOST_PORT=Z.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:L.d.css,contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"typescript",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,n,r,c,f,h,_,S,T,v,y,D){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerStylesS=r,this.authCS=c,this.monacoS=f,this.instanceS=h,this.eventCenterS=_,this.localClientSyncUtilsS=S,this.webSocketClientCS=T,this.eventCenterCS=v,this.generalCS=y,this.cd=D}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===m.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===m.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===m.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,E.R.UI_MAKER_STYLES).toPromise();t.editorOptions={...t.editorOptions,readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",n.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.eventCenterCS.dataChangedInDatabase.subscribe(function(){var a=(0,d.Z)(function*(o){if(o){if(!t.data.formData)return;for(const n in o){const r=t.webSocketClientCS.getCategoryOfPath(n),f=t.generalCS.getUtf8FromBase64String(o[n].content);r===G.c.UI_MAKER_STYLES&&t.localClientSyncUtilsS.dataChangedInUIMakerStyles(n,f,t.data.formData,t.editorPI)}}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerStylesS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.styleCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],loadInAllPages:[!1,[]],orderNumber:[!1,[u.kI.min(1)]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerStylesForm").modal("show")},100)}hideModal(){$("#idUIMakerStylesForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerStylesS.getById(a.data.formData._id).toPromise()).data:{};const r=Object.assign({},n,o);r.user=a.authCS.getUserId(),r.styleCode=a.editorPI.getValue();try{let c;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?c=yield a.uiMakerStylesS.post(r).toPromise():a.data.mode===p.D.EDIT&&(c=yield a.uiMakerStylesS.put(r._id,r,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerStyle.addSuccess:a.constantsS.uiMakerStyle.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?m.F.SAVED:m.F.UPDATED,data:c}),a.eventCenterS.uiMakerStylesSavedAndUpdate.next(!0),a.loading.form=!1}catch(c){a.loading.form=!1,a.ns.showErrorFromResponse(c.error||c,"Unable to save styles."),a.lastError=c.error,a.tab=a.tab||{},a.tab.axiosResponse={data:c.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=x.H.All,this.insertCodeModalC.showModal(b.b.UiMakerStylesFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,a.monacoS.setLanguage(t,L.d.css),yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=x.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(b.b.UiMakerStylesFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===B.g.TEXT_COPIED&&o.componentName===b.b.UiMakerStylesFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),L.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerStylesSavedAndUpdate.next(!1)}ISchedulerProps=C.qH;static \u0275fac=function(a){return new(a||i)(e.Y36(u.qu),e.Y36(w.W),e.Y36(U.b),e.Y36(k.L),e.Y36(ge.q),e.Y36(A.D),e.Y36(V.b),e.Y36(N.E),e.Y36(O.u),e.Y36(K._),e.Y36(j.P),e.Y36(W.M),e.Y36(U.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(pt,5),e.Gf(ft,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerStylesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","loadInAllPages","pTooltip","If true, these styles will be applied to all UI Pages.","label","Load Styles In All Pages",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","orderNumber","name","orderNumber","spellcheck","false","type","number","placeholder","Order number in which these styles will be loaded in page",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,_t,3,0,"span",4),e.YNc(5,gt,3,0,"span",4),e.YNc(6,ht,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,Mt,13,3,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,bt,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,St,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,vt,3,2,"button",19),e.YNc(25,Ut,4,3,"button",19),e.qZA(),e.YNc(26,kt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerStyles")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[u._Y,u.Fj,u.wV,u.JJ,u.JL,u.sg,u.u,P.O5,z.y,X.P,ee.O,J.G,R.xf,R.x4,Y.u,mt.XZ,te.A],encapsulation:2,changeDetection:0})}return i})(),Zt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[q.u,ae.A]})}return i})();var I=l(56212),Ce=l(33835);const wt=["uiMakerStylesFormC"];function It(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function xt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function Et(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Ft(i,s){1&i&&(e.TgZ(0,"th",26),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function At(i,s){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Ft,2,0,"th",23),e.TgZ(2,"th",24),e._uU(3,"Order"),e.qZA(),e.TgZ(4,"th",25),e._uU(5,"Load in all pages"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function Nt(i,s){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",30),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Ot(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Yes"),e.qZA())}function Pt(i,s){if(1&i&&(e.TgZ(0,"tr",27),e.YNc(1,Nt,2,2,"td",28),e.TgZ(2,"td",29),e._uU(3),e.qZA(),e.TgZ(4,"td",29),e.YNc(5,Ot,2,0,"span",28),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA()()),2&i){const t=s.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.orderNumber||""),e.xp6(2),e.Q6J("ngIf",t.loadInAllPages),e.xp6(2),e.Oqu(t.name)}}function Jt(i,s){1&i&&e._UZ(0,"p-progressSpinner",31)}let Me=(()=>{class i{uiMakerStylesS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=ne.d;gridKey=C.iH._id;EAPICategory=E.R;selectedRows=[];uiMakerStylesFormC;constructor(t,a,o,n,r,c,f,h,_,S,T,v,y,D){this.uiMakerStylesS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=r,this.constantsS=c,this.eventCenterS=f,this.router=h,this.userS=_,this.instanceS=S,this.ns=T,this.cs=v,this.confirmationService=y,this.cd=D}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===m.F.SAVED||o.action===m.F.UPDATED)&&(t.uiMakerStylesFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Styles")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,loadInAllPages:1,orderNumber:1,user:1},sort:{orderNumber:1,name:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerStylesS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=g.keyBy(t.rows,C.iH._id));let n=t.navigationCS.getQueryParam(I.p.am_ui_maker_style);n&&!t.rowsMap[n]&&t.rows.length&&(n=t.rows[0]._id),t.rowsMap[n]?(t.selectedRows=[t.rowsMap[n]],yield t.fillData()):t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerStylesFormC.showModal()}edit(){this.data.formData=this.rowsMap[g.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerStylesFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[g.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[g.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerStylesS.getById(a).toPromise()).data;delete o._id,delete o.guid,o.name=`${o.name}-clone`,(yield t.uiMakerStylesS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerStyle.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerStyle.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerStyle.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerStylesS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerStyles.selectedStyle.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.navigationCS.setQueryParam(I.p.am_ui_maker_style,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(I.p.am_ui_maker_style,""),void t.eventCenterS.uiMakerStyles.selectedStyle.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(I.p.am_ui_maker_style,a._id),t.eventCenterS.uiMakerStyles.selectedStyle.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ie.E;static \u0275fac=function(a){return new(a||i)(e.Y36(ge.q),e.Y36(U.b),e.Y36(w.W),e.Y36(se.S),e.Y36(A.D),e.Y36(k.L),e.Y36(O.u),e.Y36(Q.F0),e.Y36(Ce.K),e.Y36(N.E),e.Y36(w.W),e.Y36(k.L),e.Y36(F.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(wt,5),2&a){let n;e.iGM(n=e.CRH())&&(o.uiMakerStylesFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-css3","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerStylesFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[1,"text-center",2,"width","40px"],[1,"text-center",2,"width","150px"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Styles For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,It,2,0,"span",7),e.YNc(10,xt,2,0,"span",8),e.YNc(11,Et,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(r){return o.selectedRows=r})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,At,8,1,"ng-template",12),e.YNc(15,Pt,8,5,"ng-template",13),e.qZA(),e.YNc(16,Jt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-styles-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[P.O5,M.iA,F.jx,M.Ei,M.UA,M.Mo,J.G,Y.u,he],encapsulation:2,changeDetection:0})}return i})(),be=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-styles-list"),e.qZA())},dependencies:[Me],encapsulation:2})}return i})();var Se=l(26125);const Rt=["insertCodeModalC"],Yt=["monacoEditorModalC"];function Lt(i,s){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Utility"),e.qZA())}function Qt(i,s){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Utility"),e.qZA())}function qt(i,s){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Utility "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function Bt(i,s){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()()()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form)}}function Ht(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function Gt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Vt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Kt(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",38),e.YNc(2,Vt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function jt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Wt(i,s){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function $t(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",38),e.YNc(2,jt,2,0,"span",4),e.YNc(3,Wt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function zt(i,s){1&i&&e._UZ(0,"p-progressSpinner",39)}let Te=(()=>{class i{fb;ns;generalS;constantsS;uiMakerUtilsS;authCS;monacoS;instanceS;eventCenterS;localClientSyncUtilsS;webSocketClientCS;eventCenterCS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=m.F;id;BE_HOST_PORT=Z.N.BE_HOST_PORT;DOCS_HOST_PORT=Z.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,n,r,c,f,h,_,S,T,v,y,D){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerUtilsS=r,this.authCS=c,this.monacoS=f,this.instanceS=h,this.eventCenterS=_,this.localClientSyncUtilsS=S,this.webSocketClientCS=T,this.eventCenterCS=v,this.generalCS=y,this.cd=D}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===m.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===m.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===m.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,E.R.UI_MAKER_UTILITY_CLASS).toPromise();t.editorOptions={...t.editorOptions,readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",n.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.eventCenterCS.dataChangedInDatabase.subscribe(function(){var a=(0,d.Z)(function*(o){if(o){if(!t.data.formData)return;for(const n in o){const r=t.webSocketClientCS.getCategoryOfPath(n),f=t.generalCS.getUtf8FromBase64String(o[n].content);r===G.c.UI_MAKER_UTILITY_CLASS&&t.localClientSyncUtilsS.dataChangedInUIMakerUtils(n,f,t.data.formData,t.editorPI)}}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerUtilsS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.utilsCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerUtilForm").modal("show")},100)}hideModal(){$("#idUIMakerUtilForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerUtilsS.getById(a.data.formData._id).toPromise()).data:{};const r=Object.assign({},n,o);r.user=a.authCS.getUserId(),r.utilsCode=a.editorPI.getValue();try{let c;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?c=yield a.uiMakerUtilsS.post(r).toPromise():a.data.mode===p.D.EDIT&&(c=yield a.uiMakerUtilsS.put(r._id,r,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerUtil.addSuccess:a.constantsS.uiMakerUtil.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?m.F.SAVED:m.F.UPDATED,data:c}),a.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!0),a.loading.form=!1}catch(c){a.loading.form=!1,a.ns.showErrorFromResponse(c.error||c,"Unable to save utility."),a.lastError=c.error,a.tab=a.tab||{},a.tab.axiosResponse={data:c.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=x.H.All,this.insertCodeModalC.showModal(b.b.UiMakerUtilsFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=x.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(b.b.UiMakerUtilsFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===B.g.TEXT_COPIED&&o.componentName===b.b.UiMakerUtilsFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),L.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!1)}trim=g.trim;static \u0275fac=function(a){return new(a||i)(e.Y36(u.qu),e.Y36(w.W),e.Y36(U.b),e.Y36(k.L),e.Y36(Se.L),e.Y36(A.D),e.Y36(V.b),e.Y36(N.E),e.Y36(O.u),e.Y36(K._),e.Y36(j.P),e.Y36(W.M),e.Y36(U.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Rt,5),e.Gf(Yt,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerUtilForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[3,"header"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Lt,3,0,"span",4),e.YNc(5,Qt,3,0,"span",4),e.YNc(6,qt,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,Bt,7,1,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,Ht,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,Gt,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,Kt,3,2,"button",19),e.YNc(25,$t,4,3,"button",19),e.qZA(),e.YNc(26,zt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(1),e.Q6J("header",(o.form.get("name").getRawValue()||"").trim()?"userUtils."+o.form.get("name").getRawValue().trim():"Code"),e.xp6(1),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerUtility")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,P.O5,z.y,X.P,ee.O,J.G,R.xf,R.x4,Y.u,te.A],encapsulation:2,changeDetection:0})}return i})(),Xt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[q.u,ae.A]})}return i})();const ea=["uiMakerUtilsFormC"];function ta(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function aa(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function oa(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function ia(i,s){1&i&&(e.TgZ(0,"th",24),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function na(i,s){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,ia,2,0,"th",23),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function sa(i,s){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",27),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ra(i,s){if(1&i&&(e.TgZ(0,"tr",25),e.YNc(1,sa,2,2,"td",26),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&i){const t=s.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function la(i,s){1&i&&e._UZ(0,"p-progressSpinner",28)}let ve=(()=>{class i{uiMakerUtilsS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=ne.d;gridKey=C.iH._id;EAPICategory=E.R;selectedRows=[];uiMakerUtilsFormC;constructor(t,a,o,n,r,c,f,h,_,S,T,v,y,D){this.uiMakerUtilsS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=r,this.constantsS=c,this.eventCenterS=f,this.router=h,this.userS=_,this.instanceS=S,this.ns=T,this.cs=v,this.confirmationService=y,this.cd=D}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===m.F.SAVED||o.action===m.F.UPDATED)&&(t.uiMakerUtilsFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Utility")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{order:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerUtilsS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=g.keyBy(t.rows,C.iH._id));let n=t.navigationCS.getQueryParam(I.p.am_ui_maker_util);n&&!t.rowsMap[n]&&t.rows.length&&(n=t.rows[0]._id),t.rowsMap[n]?(t.selectedRows=[t.rowsMap[n]],yield t.fillData()):t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerUtilsFormC.showModal()}edit(){this.data.formData=this.rowsMap[g.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerUtilsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[g.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[g.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerUtilsS.getById(a).toPromise()).data;delete o._id,delete o.guid,o.name=`${o.name}-clone`,(yield t.uiMakerUtilsS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerUtil.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerUtil.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerUtil.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerUtilsS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerUtils.selectedUtil.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.navigationCS.setQueryParam(I.p.am_ui_maker_util,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(I.p.am_ui_maker_util,""),void t.eventCenterS.uiMakerUtils.selectedUtil.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(I.p.am_ui_maker_util,a._id),t.eventCenterS.uiMakerUtils.selectedUtil.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ie.E;static \u0275fac=function(a){return new(a||i)(e.Y36(Se.L),e.Y36(U.b),e.Y36(w.W),e.Y36(se.S),e.Y36(A.D),e.Y36(k.L),e.Y36(O.u),e.Y36(Q.F0),e.Y36(Ce.K),e.Y36(N.E),e.Y36(w.W),e.Y36(k.L),e.Y36(F.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(ea,5),2&a){let n;e.iGM(n=e.CRH())&&(o.uiMakerUtilsFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-uniregistry","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerUtilsFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Common Utils For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,ta,2,0,"span",7),e.YNc(10,aa,2,0,"span",8),e.YNc(11,oa,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(r){return o.selectedRows=r})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,na,4,1,"ng-template",12),e.YNc(15,ra,4,3,"ng-template",13),e.qZA(),e.YNc(16,la,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-utils-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[P.O5,M.iA,F.jx,M.Ei,M.UA,M.Mo,J.G,Y.u,Te],encapsulation:2,changeDetection:0})}return i})();const da=[{path:"main",component:_e,canActivate:[H.P]},{path:"utils",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-utils-list"),e.qZA())},dependencies:[ve],encapsulation:2})}return i})(),canActivate:[H.P]},{path:"styles",component:be,canActivate:[H.P]}];let ca=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[Q.Bz.forChild(da),q.u,Be,Xt,Zt]})}return i})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{40148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(77664),b=a(17017),O=a(63726),F=a(81025),p=a(15861),v=a(45085),R=a(82452),e=a(94946),x=a(32915),Z=a(53429),C=a(27414),S=a(96814),h=a(85219),y=a(97680),U=a(55043),G=a(63885),Y=a(559),J=a(86937),Q=a(40356),k=a(79329),q=a(37595),K=a(53824),W=a(58651),V=a(86607),B=a(5305),H=a(72726),c=a(33157),g=a(90328),f=a(56212),m=a(6990),d=a(51162),j=a(96925),D=a(67031),w=a(77240),T=a(99961),X=a(92189),L=a(95852),z=a(13065),ee=a(67629),te=a(31042),ne=a(67145),oe=a(12559),se=a(10262),_=a(95431),ae=a(33259),u=a(60095),re=a(32660),ie=a(38057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.guid,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(84186),Me=a(95765),be=a(57705),Oe=a(1678),Fe=a(64211),Re=a(21434),Ue=a(31558),Ge=a(38125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{31558:(A,M,a)=>{a.r(M),a.d(M,{SchedulerManM:()=>E});var c=a(77664),e=a(17017),o=a(94946),h=a(86607);let f=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(u,P){1&u&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=a(63726),I=a(10885);const g=[{path:"scheduler-layout",component:f,canActivate:[d.P]}];let E=(()=>{class _{static \u0275fac=function(u){return new(u||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,I.R]})}return _})()},86607:(A,M,a)=>{a.d(M,{V:()=>pe});var c=a(15861),e=a(94946),o=a(33157),h=a(90328),f=a(56212),d=a(6990),g=a(51162),D=a(45085),E=a(60921),_=a(31042),R=a(77240),S=a(99961),u=a(85219),P=a(92189),y=a(95852),Z=a(27414),L=a(32915),w=a(77664),O=a(60095),W=a(96814),C=a(95431),U=a(97680),N=a(33259),K=a(38057),b=a(98479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.clone())}),e._UZ(1,"i",20),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,Q,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"p-checkbox",24),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=i)}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"p-checkbox",24),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=i)}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",25),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function V(n,r){1&n&&(e.TgZ(0,"th",33),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function j(n,r){1&n&&e._UZ(0,"th",35)}function $(n,r){1&n&&e._UZ(0,"th")}function q(n,r){1&n&&e._UZ(0,"th",36)}function X(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,V,2,0,"th",31),e.YNc(2,j,1,0,"th",32),e._UZ(3,"th",33),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,$,1,0,"th",6),e.YNc(7,q,1,0,"th",34),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable),e.xp6(4),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable)}}function z(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",42),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ee(n,r){if(1&n&&(e.TgZ(0,"td",43)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw().rowIndex;e.xp6(2),e.Oqu(t+1)}}function te(n,r){1&n&&e._UZ(0,"i",44)}function ne(n,r){1&n&&e._UZ(0,"i",45)}function se(n,r){1&n&&e._UZ(0,"i",46)}function ie(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",47)(2,"p-checkbox",48),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=i)})("click",function(i){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(i))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ae(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,ie,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const re=function(){return["/api-info/api-testing/testing"]},le=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function oe(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",43)(2,"a",49),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",50),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,re))("queryParams",e.WLB(3,le,s.authCS.getUserId(),t._id))}}function ce(n,r){if(1&n&&(e.TgZ(0,"tr",37),e.YNc(1,z,2,2,"td",6),e.YNc(2,ee,3,1,"td",38),e.TgZ(3,"td"),e.YNc(4,te,1,0,"i",39),e.YNc(5,ne,1,0,"i",40),e.qZA(),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e.YNc(9,se,1,0,"i",41),e.qZA(),e.YNc(10,ae,2,1,"td",6),e.YNc(11,oe,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",s.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(3),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",t.runOnNativeProcess),e.xp6(1),e.Q6J("ngIf",s.isLPM),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function _e(n,r){1&n&&e._UZ(0,"p-progressSpinner",51)}function de(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",26)(1,"p-table",27),e.NdJ("selectionChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=i)})("selectionChange",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.selectionChange())})("dblclick",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.dblClickSchedulerList())}),e.YNc(2,X,8,4,"ng-template",28),e.YNc(3,ce,12,9,"ng-template",29),e.qZA(),e.YNc(4,_e,1,0,"p-progressSpinner",30),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let pe=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=E.d;schedulerManFormC;constructor(t,s,i,l,x,m,p,v,T,ue){this.schedulerS=t,this.generalS=s,this.notificationS=i,this.confirmationService=l,this.navigationCS=x,this.authCS=m,this.constantsS=p,this.eventCenterS=v,this.cd=T,this.router=ue}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(i){i.length&&t.loadGridData()});return function(i){return s.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1,runOnNativeProcess:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var i=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(f.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const m=x.split(","),p=d.intersection(d.keys(t.rowsMap),m),v=[];for(const T of p)t.rowsMap[T]&&v.push(t.rowsMap[T]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(p),t.eventCenterS.filterInLog.schedulersIds.next(p)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const m=t.eventCenterS.group.selectedGroups.value[0];for(const p of m?.queryParams?.schedulerNames)t.rowsMapName[p]&&(t.rowsMapName[p].saveResponseInLog=m.schedulersLog?.[p]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return i.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,delete s.guid,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(f.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,D.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(f.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(R.b),e.Y36(S.W),e.Y36(u.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,i){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(i.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Schedulers",1,"float-right","cursor-pointer"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped schedulers-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 40px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],["pTooltip","Running on native process","class","fas fa-radiation ml-2 text-danger",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],["pTooltip","Running on native process",1,"fas","fa-radiation","ml-2","text-danger"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,i){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,B,6,3,"span",6),e.YNc(9,Y,2,2,"span",7),e.YNc(10,k,2,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,de,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!i.isReadOnly),e.xp6(1),e.Q6J("ngIf",i.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",i.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",i.eventCenterS.group.apisRegex.allSchedulers||i.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(i.eventCenterS.group.apisRegex.allSchedulers||i.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",i.data))},dependencies:[w.rH,O.JJ,O.On,W.O5,C.iA,u.jx,C.Ei,C.UA,C.Mo,U.G,N.u,K.XZ,b.o],encapsulation:2})}return n})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1678],{57747:(te,D,a)=>{a.d(D,{o:()=>q});var d=a(15861),e=a(60095),m=a(33157),g=a(90328),v=a(6990),S=a(87848),h=a(51162),n=a(94946),x=a(99961),y=a(53429),Z=a(77240),P=a(95852),w=a(81429),U=a(32915),R=a(60115),b=a(27414),F=a(96814),O=a(32660),A=a(97680),L=a(53965),M=a(38057);function N(_,I){1&_&&(n.TgZ(0,"span"),n._UZ(1,"i",32),n._uU(2," Add Instance"),n.qZA())}function K(_,I){1&_&&(n.TgZ(0,"span"),n._UZ(1,"i",33),n._uU(2," View Instance"),n.qZA())}function B(_,I){1&_&&(n.TgZ(0,"span"),n._UZ(1,"i",34),n._uU(2," Edit Instance"),n.qZA())}function J(_,I){if(1&_&&(n.TgZ(0,"div")(1,"div",10)(2,"label",11),n._uU(3,"Username"),n.qZA(),n.TgZ(4,"div",12),n._UZ(5,"p-dropdown",35),n.qZA()(),n.TgZ(6,"div",10)(7,"label",11),n._uU(8,"Password"),n.qZA(),n.TgZ(9,"div",12),n._UZ(10,"p-dropdown",36),n.qZA()(),n.TgZ(11,"div",10)(12,"label",11),n._uU(13,"Privilege"),n.qZA(),n.TgZ(14,"div",12),n._UZ(15,"p-dropdown",37),n.qZA()()()),2&_){const s=n.oxw();n.xp6(5),n.Q6J("options",s.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",s.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",s.privileges)("filter",!0)}}function W(_,I){if(1&_){const s=n.EpF();n.TgZ(0,"a",38),n.NdJ("click",function(){n.CHM(s);const c=n.oxw();return n.KtG(c.openSecret())}),n._UZ(1,"i",39),n._uU(2," Open Secret "),n.qZA()}}function Q(_,I){if(1&_&&(n.TgZ(0,"div",10)(1,"label",11),n._uU(2,"Connection String Multi Tenant"),n.qZA(),n.TgZ(3,"div",12),n._UZ(4,"p-dropdown",40),n.qZA()()),2&_){const s=n.oxw();n.xp6(4),n.Q6J("options",s.connectionStringSecretsMultiTenant)("showClear",!0)("autoDisplayFirst",!1)("filter",!0)}}function Y(_,I){1&_&&n._UZ(0,"i",41)}function G(_,I){1&_&&n._UZ(0,"i",42)}function k(_,I){1&_&&(n.TgZ(0,"span"),n._uU(1,"Save Instance"),n.qZA())}function V(_,I){1&_&&(n.TgZ(0,"span"),n._uU(1,"Update Instance"),n.qZA())}function H(_,I){if(1&_){const s=n.EpF();n.TgZ(0,"button",43),n.NdJ("click",function(){n.CHM(s);const c=n.oxw();return n.KtG(c.save())}),n._UZ(1,"i",44),n.YNc(2,k,2,0,"span",4),n.YNc(3,V,2,0,"span",4),n.qZA()}if(2&_){const s=n.oxw();n.Q6J("disabled",s.form.invalid||s.loading.form),n.xp6(2),n.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT)}}function j(_,I){1&_&&n._UZ(0,"p-progressSpinner",45)}let q=(()=>{class _{fb;ns;instanceS;generalS;authCS;dataProviderS;eventCenterS;secretS;constantsS;data;loading={form:!1};EFormMode=g.D;EInstanceType=S.d;IInstanceProps=h.Il;form;subscriptions=[];instanceTypes=[];privileges=[];connectionStringSecrets=[];connectionStringSecretsMultiTenant=[];instanceTested;isFromMarkTested;constructor(s,l,c,f,C,E,X,z,ee){this.fb=s,this.ns=l,this.instanceS=c,this.generalS=f,this.authCS=C,this.dataProviderS=E,this.eventCenterS=X,this.secretS=z,this.constantsS=ee}ngOnInit(){var s=this;return(0,d.Z)(function*(){s.instanceTypes=s.dataProviderS.getInstanceTypes(),s.privileges=s.dataProviderS.getListOfOraclePrivilege(),s.createForm(),s.subscriptions.push(s.data.eventChannel.subscribe(function(){var l=(0,d.Z)(function*(c){if(c)if(s.form.enable(),yield s.loadConnectionStringFromSecret(),c.action===m.F.OPEN_FORM_IN_EDIT_MODE){const f=yield s.instanceS.getById(s.data.formData._id).toPromise();s.form.reset(),s.form.patchValue(f.data),s.instanceTested=!1,s.isFromMarkTested=!1}else if(c.action===m.F.OPEN_FORM_IN_VIEW_MODE){const f=yield s.instanceS.getById(s.data.formData._id).toPromise();s.form.reset(),s.form.patchValue(f.data),s.form.disable(),s.instanceTested=!1,s.isFromMarkTested=!1}else c.action===m.F.OPEN_FORM_IN_ADD_MODE&&(s.form.reset(),s.setDefaultValuesInForm(),s.instanceTested=!1,s.isFromMarkTested=!1)});return function(c){return l.apply(this,arguments)}}())),s.subscriptions.push(s.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var l=(0,d.Z)(function*(c){c&&c.action===m.F.UPDATED&&(s.eventCenterS.headerC.secManFormC.hideModal(),yield s.loadConnectionStringFromSecret())});return function(c){return l.apply(this,arguments)}}()))})()}showModal(){$("#idInstancesForm").modal("show")}hideModal(){$("#idInstancesForm").modal("hide")}createForm(){this.form=this.fb.group({type:[null,[e.kI.required]],name:[null,[e.kI.required]],connectionString:[null,[e.kI.required]],isMultiTenantStructureInstance:[!1,[]],connectionStringMultiTenant:[null,[]],username:[null,[]],password:[null,[]],privilege:[null,[]],maxPoolConnections:[null,[e.kI.required]]}),this.manageValidations()}manageValidations(){this.form.valueChanges.subscribe(()=>{this.instanceTested=!1,this.isFromMarkTested=!1});const s=this.form.get(h.Il.type),l=this.form.get(h.Il.username),c=this.form.get(h.Il.password),f=this.form.get(h.Il.privilege);s.valueChanges.subscribe(function(){var C=(0,d.Z)(function*(E){E&&(E===S.d.ORACLE_DB?(l.setValidators([e.kI.required]),c.setValidators([e.kI.required]),f.setValidators([e.kI.required])):(l.setValidators([]),c.setValidators([]),f.setValidators([])),l.updateValueAndValidity(),c.updateValueAndValidity(),f.updateValueAndValidity())});return function(E){return C.apply(this,arguments)}}())}setDefaultValuesInForm(){this.loading.form=!1,this.form.get(h.Il.type).setValue(this.instanceTypes[0].value),this.form.get(h.Il.maxPoolConnections).setValue(1e4),this.form.get(h.Il.connectionString).setValue(this.connectionStringSecrets[0])}testInstance(s){var l=this;return(0,d.Z)(function*(){l.loading.form=!0;const c=f=>{l.instanceTested=!1,l.isFromMarkTested=!1,l.ns.showError(v.get(f,"errors[0].message","Unable to connect to the instance.")),l.loading.form=!1};try{const f=l.form.value;f.user=l.authCS.gUser._id,f.isFromSaveInstance=s,l.data.mode===g.D.EDIT&&(f._id=l.data.formData._id);const C=yield l.instanceS.testInstance(f).toPromise();C.success&&C.data?l.instanceTested=!0:c(C),l.loading.form=!1}catch(f){c(f.error)}})()}markInstanceTested(){this.instanceTested=!0,this.isFromMarkTested=!0}save(){var s=this;return(0,d.Z)(function*(){if(!s.isFromMarkTested&&(yield s.testInstance(!0),!s.instanceTested))return;const l=s.form.getRawValue();l.user=s.authCS.getUserId(),l.type===S.d.MONGO_DB&&(l.maxPoolConnections=1e4);try{let c;if(s.loading.form=!0,s.data.mode===g.D.ADD)c=yield s.instanceS.post(l).toPromise();else if(s.data.mode===g.D.EDIT){const f=v.merge({},s.data.formData,l);c=yield s.instanceS.put(s.data.formData._id,f,{select:h.iH._id}).toPromise()}s.ns.showSuccess(`Instance ${s.data.mode===g.D.ADD?"added":"edited"} successfully.`),s.data.eventChannel.emit({action:s.data.mode===g.D.ADD?m.F.SAVED:m.F.UPDATED}),s.loading.form=!1}catch(c){s.loading.form=!1,s.ns.showErrorFromResponse(c.error||c,"Unable to save instance.")}})()}loadConnectionStringFromSecret(){var s=this;return(0,d.Z)(function*(){try{s.connectionStringSecrets=(yield s.instanceS.getConnectionStringSecret().toPromise())?.data,s.connectionStringSecretsMultiTenant=(yield s.instanceS.getConnectionStringSecretForMultiTenant().toPromise())?.data}catch(l){s.ns.showErrorFromResponse(l.error||l,"Unable to load connection string.")}})()}openSecret(){var s=this;return(0,d.Z)(function*(){s.eventCenterS.headerC.dataSecretForm.formData=yield s.getDefaultSecret(),s.eventCenterS.headerC.dataSecretForm.mode=g.D.EDIT,s.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),s.eventCenterS.headerC.secManFormC.showModal()})()}getDefaultSecret(){var s=this;return(0,d.Z)(function*(){const l={find:{user:s.authCS.getUserId(),active:!0,isDefault:!0}};return(yield s.secretS.query(l).toPromise()).data?.[0]})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||_)(n.Y36(e.qu),n.Y36(x.W),n.Y36(y.E),n.Y36(Z.b),n.Y36(P.D),n.Y36(w.B),n.Y36(U.u),n.Y36(R.e),n.Y36(b.L))};static \u0275cmp=n.Xpm({type:_,selectors:[["app-w-instances-form"]],inputs:{data:"data"},decls:55,vars:19,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idInstancesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",2,"z-index","1049"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],[1,"card","flex","justify-content-center"],["formControlName","type","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide instance name",1,"form-control","form-control-sm"],["formControlName","connectionString","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],[1,"form-group","row",3,"hidden"],["formControlName","maxPoolConnections","min","1","name","maxPoolConnections","spellcheck","false","type","number",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","isMultiTenantStructureInstance",3,"binary"],["class","form-group row",4,"ngIf"],[1,"modal-footer","d-block"],["type","button",1,"btn","btn-sm","btn-secondary","float-left",3,"disabled","click"],["class","fas fa-check fa-fw text-success",4,"ngIf"],["class","fas fa-question fa-fw text-warning",4,"ngIf"],["class","btn btn-primary btn-sm float-right ml-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary","float-right",3,"disabled"],[1,"fas","fa-times","text-danger","fa-fw"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","username","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","password","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","privilege","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],["formControlName","connectionStringMultiTenant","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","showClear","autoDisplayFirst","filter"],[1,"fas","fa-check","fa-fw","text-success"],[1,"fas","fa-question","fa-fw","text-warning"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","ml-2",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,c){1&l&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,N,3,0,"span",4),n.YNc(5,K,3,0,"span",4),n.YNc(6,B,3,0,"span",4),n.TgZ(7,"button",5)(8,"span",6),n._UZ(9,"i",7),n.qZA()()(),n.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),n._uU(14,"Database Type"),n.qZA(),n.TgZ(15,"div",12)(16,"div",13),n._UZ(17,"p-dropdown",14),n.qZA()()(),n.TgZ(18,"div",10)(19,"label",11),n._uU(20,"Instance Name"),n.qZA(),n.TgZ(21,"div",12),n._UZ(22,"input",15),n.qZA()(),n.YNc(23,J,16,6,"div",4),n.TgZ(24,"div")(25,"div",10)(26,"label",11),n._uU(27,"Connection String"),n.qZA(),n.TgZ(28,"div",12),n._UZ(29,"p-dropdown",16),n.qZA(),n.TgZ(30,"div",17),n.YNc(31,W,3,0,"a",18),n.qZA()()(),n.TgZ(32,"div",19)(33,"label",11),n._uU(34,"Max Pool Connections"),n.qZA(),n.TgZ(35,"div",12),n._UZ(36,"input",20),n.qZA()(),n.TgZ(37,"div",10)(38,"label",11),n._uU(39,"Is Multi Tenant Structure Instance"),n.qZA(),n.TgZ(40,"div",12)(41,"label",21),n._UZ(42,"p-checkbox",22),n.qZA()()(),n.YNc(43,Q,5,4,"div",23),n.qZA()(),n.TgZ(44,"div",24)(45,"div")(46,"button",25),n.NdJ("click",function(){return c.testInstance()}),n.YNc(47,Y,1,0,"i",26),n.YNc(48,G,1,0,"i",27),n._uU(49," Test Instance "),n.qZA(),n.YNc(50,H,4,3,"button",28),n.TgZ(51,"button",29),n._UZ(52,"i",30),n._uU(53," Close"),n.qZA()()(),n.YNc(54,j,1,0,"p-progressSpinner",31),n.qZA()()()),2&l&&(n.xp6(4),n.Q6J("ngIf",c.data.mode===c.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",c.data.mode===c.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",c.data.mode===c.EFormMode.EDIT),n.xp6(5),n.Q6J("formGroup",c.form),n.xp6(6),n.Q6J("options",c.instanceTypes)("filter",!0),n.xp6(6),n.Q6J("ngIf",c.form.get("type").value===c.EInstanceType.ORACLE_DB),n.xp6(6),n.Q6J("options",c.connectionStringSecrets)("filter",!0),n.xp6(2),n.Q6J("ngIf",c.data.mode!==c.EFormMode.VIEW),n.xp6(1),n.Q6J("hidden",c.form.get("type").value===c.EInstanceType.MONGO_DB),n.xp6(10),n.Q6J("binary",!0),n.xp6(1),n.Q6J("ngIf",c.form.get("isMultiTenantStructureInstance").value),n.xp6(3),n.Q6J("disabled",c.form.invalid||c.loading.form),n.xp6(1),n.Q6J("ngIf",c.instanceTested),n.xp6(1),n.Q6J("ngIf",!c.instanceTested),n.xp6(2),n.Q6J("ngIf",c.data.mode!==c.EFormMode.VIEW),n.xp6(1),n.Q6J("disabled",c.loading.form),n.xp6(3),n.Q6J("ngIf",c.loading.form))},dependencies:[e._Y,e.Fj,e.wV,e.JJ,e.JL,e.qQ,e.sg,e.u,F.O5,O.y,A.G,L.Lt,M.XZ],encapsulation:2})}return _})()},63885:(te,D,a)=>{a.d(D,{f:()=>ce});var d=a(15861),e=a(94946),m=a(33157),g=a(90328),v=a(56212),T=a(6990),h=a(51162),n=a(96925),x=a(87848),y=a(53429),Z=a(77240),P=a(99961),w=a(92189),U=a(95852),R=a(27414),b=a(77664),F=a(32915),O=a(85219),A=a(60095),L=a(96814),M=a(95431),N=a(97680),K=a(33259),B=a(45609),J=a(38057),W=a(57747);const Q=["instancesFormC"];function Y(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const r=e.oxw(2);return e.KtG(r.edit())}),e._UZ(1,"i",21),e.qZA()}}function G(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const r=e.oxw(2);return e.KtG(r.clone())}),e._UZ(1,"i",23),e.qZA()}}function k(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const r=e.oxw(2);return e.KtG(r.active())}),e._UZ(1,"i",25),e.qZA()}}function V(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",26),e.NdJ("click",function(){e.CHM(t);const r=e.oxw(2);return e.KtG(r.inactiveDialog())}),e._UZ(1,"i",27),e.qZA()}}function H(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const r=e.oxw(2);return e.KtG(r.removePermanentDialog())}),e._UZ(1,"i",29),e.qZA()}}function j(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span")(1,"a",9),e._UZ(2,"img",10),e.qZA(),e.TgZ(3,"span",11)(4,"p-inputSwitch",12),e.NdJ("ngModelChange",function(r){e.CHM(t);const u=e.oxw();return e.KtG(u.showAll=r)})("onChange",function(){e.CHM(t);const r=e.oxw();return e.KtG(r.showAllChanges())}),e.qZA()(),e.TgZ(5,"span",13),e.NdJ("click",function(){e.CHM(t);const r=e.oxw();return e.KtG(r.add())}),e._UZ(6,"i",14),e.qZA(),e.YNc(7,Y,2,0,"span",15),e.YNc(8,G,2,0,"span",16),e.YNc(9,k,2,0,"span",17),e.YNc(10,V,2,0,"span",18),e.YNc(11,H,2,0,"span",19),e.qZA()}if(2&o){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.showAll),e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length&&!1===t.selectedRows[0].active),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length&&!0===t.selectedRows[0].active),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length&&!1===t.selectedRows[0].active)}}function q(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",30)(1,"p-checkbox",31),e.NdJ("ngModelChange",function(r){e.CHM(t);const u=e.oxw();return e.KtG(u.eventCenterS.group.apisRegex.allInstances=r)}),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allInstances)("binary",!0)}}function _(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"span",30)(1,"p-checkbox",31),e.NdJ("ngModelChange",function(r){e.CHM(t);const u=e.oxw();return e.KtG(u.eventCenterS.filterInLog.apisRegex.allInstances=r)}),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allInstances)("binary",!0)}}function I(o,p){if(1&o&&(e.TgZ(0,"div")(1,"div",32),e._uU(2),e.qZA()()),2&o){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allInstancesPermitted)}}function s(o,p){1&o&&(e.TgZ(0,"th",42),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function l(o,p){1&o&&e._UZ(0,"th",40)}function c(o,p){1&o&&(e.TgZ(0,"th",43),e._uU(1,"Pre"),e.qZA())}function f(o,p){1&o&&(e.TgZ(0,"th",43),e._uU(1,"Post"),e.qZA())}function C(o,p){if(1&o&&(e.TgZ(0,"tr"),e.YNc(1,s,2,0,"th",38),e.YNc(2,l,1,0,"th",39),e._UZ(3,"th",40),e.TgZ(4,"th"),e._uU(5,"Instance Name"),e.qZA(),e.YNc(6,c,2,0,"th",41),e.YNc(7,f,2,0,"th",41),e.qZA()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showCheckbox),e.xp6(1),e.Q6J("ngIf",t.showAll),e.xp6(4),e.Q6J("ngIf",t.showHooksCount),e.xp6(1),e.Q6J("ngIf",t.showHooksCount)}}function E(o,p){if(1&o&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",50),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function X(o,p){1&o&&e._UZ(0,"i",53)}function z(o,p){1&o&&e._UZ(0,"i",54)}function ee(o,p){if(1&o&&(e.TgZ(0,"td"),e.YNc(1,X,1,0,"i",51),e.YNc(2,z,1,0,"i",52),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active)}}function ne(o,p){1&o&&e._UZ(0,"i",55)}function se(o,p){if(1&o&&(e.TgZ(0,"td",45),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.preHookCount||"")}}function ae(o,p){if(1&o&&(e.TgZ(0,"td",45),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.postHookCount||"")}}function oe(o,p){if(1&o&&(e.TgZ(0,"tr",44),e.YNc(1,E,2,2,"td",3),e.YNc(2,ee,3,2,"td",3),e.TgZ(3,"td",45),e._UZ(4,"img",46),e.qZA(),e.TgZ(5,"td",47),e.YNc(6,ne,1,0,"i",48),e.TgZ(7,"span"),e._uU(8),e.qZA()(),e.YNc(9,se,2,1,"td",49),e.YNc(10,ae,2,1,"td",49),e.qZA()),2&o){const t=p.$implicit,i=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",i.showCheckbox),e.xp6(1),e.Q6J("ngIf",i.showAll),e.xp6(2),e.Akn("MONGO_DB"==t.type?"width:0.5rem":"width:1rem"),e.s9C("src",i.getInstanceIconUrl(t.type),e.LSH),e.s9C("alt",t.type),e.xp6(2),e.Q6J("ngIf",t.isMultiTenantStructureInstance),e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",i.showHooksCount),e.xp6(1),e.Q6J("ngIf",i.showHooksCount)}}function ie(o,p){1&o&&e._UZ(0,"p-progressSpinner",56)}function re(o,p){if(1&o){const t=e.EpF();e.TgZ(0,"div",33)(1,"p-table",34),e.NdJ("selectionChange",function(r){e.CHM(t);const u=e.oxw();return e.KtG(u.selectedRows=r)})("selectionChange",function(){e.CHM(t);const r=e.oxw();return e.KtG(r.instanceSelected())})("dblclick",function(){e.CHM(t);const r=e.oxw();return e.KtG(r.dblClickInstance())}),e.YNc(2,C,8,4,"ng-template",35),e.YNc(3,oe,11,11,"ng-template",36),e.qZA(),e.YNc(4,ie,1,0,"p-progressSpinner",37),e.qZA()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let ce=(()=>{class o{instanceS;generalS;notificationS;navigationCS;authCS;constantsS;router;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;instancesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;gridKey=h.iH._id;selectedRows=[];instanceIdsSkipSubscription=!1;EInstanceType=x.d;constructor(t,i,r,u,le,_e,de,pe,fe,me){this.instanceS=t,this.generalS=i,this.notificationS=r,this.navigationCS=u,this.authCS=le,this.constantsS=_e,this.router=de,this.cd=pe,this.eventCenterS=fe,this.confirmationService=me}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.instance.selectedInstances.next([]),!t.isDependentOnGroup&&!t.isFilterLogTable&&(yield t.loadGridData()),t.isDependentOnGroup&&t.subscriptions.push(t.eventCenterS.group.selectedGroups.subscribe(function(){var i=(0,d.Z)(function*(r){r.length&&(yield t.loadGridData())});return function(r){return i.apply(this,arguments)}}())),t.isFilterLogTable&&t.subscriptions.push(t.eventCenterS.filterInLog.refreshGrid.subscribe((0,d.Z)(function*(){t.instanceIdsSkipSubscription||t.loadGridData()}))),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var i=(0,d.Z)(function*(r){(r.action===m.F.SAVED||r.action===m.F.UPDATED)&&(t.instancesFormC.hideModal(),t.loadGridData())});return function(r){return i.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - Instances")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){if(t.resetGridAndUrl(),t.isDependentOnGroup&&(!t.eventCenterS.group.selectedGroups.value||!t.eventCenterS.group.selectedGroups.value.length))return;t.loading.grid=!0;const i={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,label:1,active:1,type:1,isMultiTenantStructureInstance:1},sort:{name:1}};t.showAll&&delete i.find.active;try{const r=yield t.instanceS.query(i).toPromise();r.success?(t.selectedRows=[],t.rows=r.data,t.rowsMap=T.keyBy(t.rows,h.iH._id)):t.resetGridAndUrl(),t.showHooksCount&&(yield t.instanceS.setHooksCountInInstanceArr(t.rows));const u=t.navigationCS.getQueryParam(v.p.instance);u&&(t.selectedRows=t.getObjectsFromIdArray(u.split(",")),t.eventCenterS.instance.selectedInstances.next(t.selectedRows)),t.isDependentOnGroup&&(t.selectedRows=t.getObjectsFromIdArray(t.eventCenterS.group.instanceIds.value)),t.isFilterLogTable&&(t.selectedRows=t.getObjectsFromIdArray(t.eventCenterS.filterInLog.instanceIds.value))}catch(r){console.log(r)}t.loading.grid=!1,t.cd.detectChanges()})()}getObjectsFromIdArray(t){const i=[];for(const r of t)this.rowsMap[r]&&i.push(this.rowsMap[r]);return i}resetGridAndUrl(){var t=this;return(0,d.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows=[],t.eventCenterS.instance.selectedInstances.next([])})()}showAllChanges(){var t=this;return(0,d.Z)(function*(){yield t.resetSelectedRows(),yield t.loadGridData()})()}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE}),this.instancesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_VIEW_MODE}),this.instancesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),this.instancesFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0])return;const i=(yield t.instanceS.getById(t.selectedRows[0]._id).toPromise()).data;delete i._id,delete i.guid,i.name=`${i.name}-clone`,(yield t.instanceS.post(i).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.instance.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.instance.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.instance.cloneError)}})()}inactiveDialog(){var t=this;return(0,d.Z)(function*(){var i;t.confirmationService.confirm({message:t.constantsS.instance.inactiveConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,d.Z)(function*(){yield t.inactive()}),function(){return i.apply(this,arguments)})})})()}removePermanentDialog(){var t=this;return(0,d.Z)(function*(){var i;t.confirmationService.confirm({message:t.constantsS.instance.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,d.Z)(function*(){yield t.removePermanent()}),function(){return i.apply(this,arguments)})})})()}active(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const i=yield t.instanceS.makeActive(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,i.success?(t.notificationS.showSuccess(t.constantsS.instance.active),t.loadGridData()):t.notificationS.showErrorFromResponse(i,t.constantsS.instance.activeError)})()}inactive(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;try{yield t.instanceS.softDelete(t.selectedRows[0]._id).toPromise(),t.notificationS.showSuccess(t.constantsS.instance.inactive),yield t.resetSelectedRows(),t.loadGridData()}catch(i){const r=i?.error?.errors?.[0]?.message;t.notificationS.showError(r||t.constantsS.instance.inactiveError)}t.loading.grid=!1})()}removePermanent(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const i=yield t.instanceS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,i.success?(t.notificationS.showSuccess(t.constantsS.instance.removePermanent),yield t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(i,t.constantsS.instance.removePermanentError)})()}resetSelectedRows(){var t=this;return(0,d.Z)(function*(){t.selectedRows.length=0,t.eventCenterS.instance.selectedInstances.next([]),yield t.navigationCS.setQueryParam(v.p.instance,null)})()}instanceSelected(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.instance.selectedInstances.next(t.selectedRows),t.isDependentOnGroup||t.isFilterLogTable?t.setInstanceIds():(yield t.navigationCS.setQueryParam(v.p.instance,T.map(t.selectedRows,"_id").join(",")||null),yield t.generalS.resetUrlParams([v.p.database,v.p.collection,v.p.collection_api]))})()}dblClickInstance(){this.selectedRows.length&&!this.isDependentOnGroup&&!this.isFilterLogTable&&this.edit()}setInstanceIds(){this.instanceIdsSkipSubscription=!0,this.eventCenterS.filterInLog.instanceIds.next(T.map(this.selectedRows,"_id")),this.eventCenterS.group.instanceIds.next(T.map(this.selectedRows,"_id")),this.instanceIdsSkipSubscription=!1}getInstanceIconUrl(t){return t===x.d.SQL_SERVER_DB?"./assets/images/svg/Microsoft_SQL_Server_DB_No_Logo.svg":t===x.d.ORACLE_DB?"./assets/images/svg/Oracle_DB_No_Logo.svg":`./assets/images/svg/${t}.svg`}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=n.Yp;static \u0275fac=function(i){return new(i||o)(e.Y36(y.E),e.Y36(Z.b),e.Y36(P.W),e.Y36(w.S),e.Y36(U.D),e.Y36(R.L),e.Y36(b.F0),e.Y36(e.sBO),e.Y36(F.u),e.Y36(O.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-instances"]],viewQuery:function(i,r){if(1&i&&e.Gf(Q,5),2&i){let u;e.iGM(u=e.CRH())&&(r.instancesFormC=u.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:13,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Instances",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["instancesFormC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"float-right","position-relative"],["styleClass","ml-3 mt-2px","tooltipPosition","right","pTooltip","Show All",3,"ngModel","ngModelChange","onChange"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Active",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Inactive",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Make Active",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-check","text-success","fa-fw"],["pTooltip","Make Inactive",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","align-middle","text-danger"],["pTooltip","All Instances",1,"float-right","cursor-pointer"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped instance-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 40px;",4,"ngIf"],[2,"width","40px"],["class","text-center","style","width: 40px;",4,"ngIf"],[2,"width","45px"],[1,"text-center",2,"width","40px"],[3,"pSelectableRow"],[1,"text-center"],[3,"src","alt"],[1,"word-break-all"],["pTooltip","Multi tenant instance","class","fas fa-user-friends text-yellow fa-fw mr-2",4,"ngIf"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],["pTooltip","Multi tenant instance",1,"fas","fa-user-friends","text-yellow","fa-fw","mr-2"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,r){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Instances"),e.qZA(),e.YNc(5,j,12,6,"span",3),e.YNc(6,q,2,2,"span",4),e.YNc(7,_,2,2,"span",4),e.qZA(),e.TgZ(8,"div",5),e.YNc(9,I,3,1,"div",3),e.YNc(10,re,5,7,"div",6),e.qZA()(),e._UZ(11,"app-w-instances-form",7,8)),2&i&&(e.xp6(5),e.Q6J("ngIf",!r.isReadOnly),e.xp6(1),e.Q6J("ngIf",r.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",r.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",r.eventCenterS.group.apisRegex.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances),e.xp6(1),e.Q6J("ngIf",!(r.eventCenterS.group.apisRegex.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances)),e.xp6(1),e.Q6J("data",r.data))},dependencies:[A.JJ,A.On,L.O5,M.iA,O.jx,M.Ei,M.UA,M.Mo,N.G,K.u,B.Ql,J.XZ,W.o]})}return o})()},1678:(te,D,a)=>{a.r(D),a.d(D,{DashboardM:()=>h});var d=a(77664),e=a(17017),v=(a(63885),a(57747),a(94946));const T=[{path:"root",loadChildren:()=>a.e(891).then(a.bind(a,80891)).then(n=>n.DashRootM)},{path:"redis-dashboard",loadChildren:()=>a.e(4110).then(a.bind(a,4110)).then(n=>n.RedisDashboardM)},{path:"summary-dashboard",loadChildren:()=>Promise.all([a.e(9575),a.e(7977)]).then(a.bind(a,77977)).then(n=>n.DashSummaryM)},{path:"developer",loadChildren:()=>a.e(3450).then(a.bind(a,73450)).then(n=>n.DashDevM)},{path:"welcome",loadChildren:()=>a.e(5334).then(a.bind(a,35334)).then(n=>n.AmWelcomeM)},{path:"ext-licenses",loadChildren:()=>a.e(7436).then(a.bind(a,17436)).then(n=>n.ExtLicensesM)}];let h=(()=>{class n{static \u0275fac=function(Z){return new(Z||n)};static \u0275mod=v.oAB({type:n});static \u0275inj=v.cJS({imports:[d.Bz.forChild(T),e.u]})}return n})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1754],{91754:(ft,g,a)=>{a.r(g),a.d(g,{VulnerabilityM:()=>lt});var m=a(77664),f=a(44480),C=a(17017),A=a(63726),t=a(94946),r=a(15861),U=a(6990),Z=a(33157),w=a(90328),d=a(56212),v=a(51162),q=a(45085),S=a(60921),V=a(77240),h=a(99961),I=a(92189),O=a(95852),T=a(27414),L=a(32915),J=a(33835),Y=a(53429),y=a(85219),D=a(81429),b=a(60095),c=a(96814),u=a(95431),P=a(97680),Q=a(40707),N=a(33259),R=a(53965);function E(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",11),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.compress())}),t._UZ(1,"i",12),t.qZA()}}function F(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",11),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.expand())}),t._UZ(1,"i",13),t.qZA()}}function M(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",11),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.print())}),t._UZ(1,"i",14),t.qZA()}}const K=function(i){return{"text-danger font-weight-bold":i}},G=function(i){return{"text-warning font-weight-bold":i}};function H(i,s){if(1&i&&(t.TgZ(0,"div",15)(1,"div",16)(2,"div",17)(3,"table",18)(4,"tr")(5,"th",19),t._uU(6,"Vulnerability Summary"),t.qZA()(),t.TgZ(7,"tr")(8,"td",20),t._uU(9,"Critical"),t.qZA(),t.TgZ(10,"td",21),t._uU(11),t.qZA()(),t.TgZ(12,"tr")(13,"td",22),t._uU(14,"High"),t.qZA(),t.TgZ(15,"td",21),t._uU(16),t.qZA()(),t.TgZ(17,"tr")(18,"td",22),t._uU(19,"Moderate"),t.qZA(),t.TgZ(20,"td"),t._uU(21),t.qZA()(),t.TgZ(22,"tr")(23,"td",22),t._uU(24,"Info"),t.qZA(),t.TgZ(25,"td"),t._uU(26),t.qZA()(),t.TgZ(27,"tr")(28,"td",22),t._uU(29,"Low"),t.qZA(),t.TgZ(30,"td"),t._uU(31),t.qZA()(),t.TgZ(32,"tr")(33,"td",22),t._uU(34,"Total"),t.qZA(),t.TgZ(35,"td"),t._uU(36),t.qZA()()()(),t.TgZ(37,"div",17)(38,"table",18)(39,"tr")(40,"th",19),t._uU(41,"Dependency Summary"),t.qZA()(),t.TgZ(42,"tr")(43,"td",20),t._uU(44,"Prod"),t.qZA(),t.TgZ(45,"td"),t._uU(46),t.qZA()(),t.TgZ(47,"tr")(48,"td",22),t._uU(49,"Dev"),t.qZA(),t.TgZ(50,"td"),t._uU(51),t.qZA()(),t.TgZ(52,"tr")(53,"td",22),t._uU(54,"Optional"),t.qZA(),t.TgZ(55,"td"),t._uU(56),t.qZA()(),t.TgZ(57,"tr")(58,"td",22),t._uU(59,"Peer"),t.qZA(),t.TgZ(60,"td"),t._uU(61),t.qZA()(),t.TgZ(62,"tr")(63,"td",22),t._uU(64,"Peer Optional"),t.qZA(),t.TgZ(65,"td"),t._uU(66),t.qZA()(),t.TgZ(67,"tr")(68,"td",22),t._uU(69,"Total"),t.qZA(),t.TgZ(70,"td"),t._uU(71),t.qZA()()()()()()),2&i){const e=t.oxw();t.xp6(10),t.Q6J("ngClass",t.VKq(14,K,e.metadata.vulnerabilities.critical)),t.xp6(1),t.hij(" ",e.metadata.vulnerabilities.critical||""," "),t.xp6(4),t.Q6J("ngClass",t.VKq(16,G,e.metadata.vulnerabilities.high)),t.xp6(1),t.hij(" ",e.metadata.vulnerabilities.high||""," "),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.moderate||""),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.info||""),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.low||""),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.total||""),t.xp6(10),t.Oqu(e.metadata.dependencies.prod||""),t.xp6(5),t.Oqu(e.metadata.dependencies.dev||""),t.xp6(5),t.Oqu(e.metadata.dependencies.optional||""),t.xp6(5),t.Oqu(e.metadata.dependencies.peer||""),t.xp6(5),t.Oqu(e.metadata.dependencies.peerOptional||""),t.xp6(5),t.Oqu(e.metadata.dependencies.total||"")}}function B(i,s){1&i&&(t.TgZ(0,"tr"),t._UZ(1,"th",23)(2,"th",24),t.TgZ(3,"th",25),t._uU(4,"Direct"),t.qZA(),t.TgZ(5,"th",26),t._uU(6,"Severity"),t.qZA(),t.TgZ(7,"th",27),t._uU(8,"Version"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"Package Name"),t.qZA(),t.TgZ(11,"th",27),t._uU(12,"Fix"),t.qZA()())}function $(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"button",33),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().$implicit;return t.KtG(n.expanded=!n.expanded)}),t.qZA()}if(2&i){const e=t.oxw().$implicit;t.Q6J("pRowToggler",e)("icon",e.expanded?"pi pi-chevron-down":"pi pi-chevron-right")}}function j(i,s){1&i&&t._UZ(0,"i",34)}function W(i,s){if(1&i&&(t.TgZ(0,"span")(1,"span",35),t._uU(2),t.qZA(),t.TgZ(3,"span"),t._uU(4," \u2192 "),t.qZA()()),2&i){const e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("pTooltip",e.currentVersion+" = Current version"),t.xp6(1),t.Oqu(e.currentVersion)}}function X(i,s){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,W,5,2,"span",32),t.TgZ(2,"span",35),t._uU(3),t.qZA()()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.currentVersion),t.xp6(1),t.Q6J("pTooltip",e.fixAvailable.version+" = Update to version"),t.xp6(1),t.Oqu(e.fixAvailable.version)}}function k(i,s){if(1&i&&(t.TgZ(0,"a",47),t._UZ(1,"i",48),t.qZA()),2&i){const e=t.oxw().$implicit;t.Q6J("href",e.url,t.LSH)}}const z=function(){return[]};function tt(i,s){if(1&i&&(t.TgZ(0,"tr")(1,"th",45),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td",30),t.YNc(12,k,2,1,"a",46),t.qZA()()),2&i){const e=s.$implicit,l=s.index;t.xp6(2),t.Oqu(l+1),t.xp6(2),t.Oqu(e.severity),t.xp6(2),t.Oqu(e.range),t.xp6(2),t.Oqu((e.cwe||t.DdM(6,z)).join(",")),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.url)}}function et(i,s){if(1&i&&(t.TgZ(0,"tr")(1,"td",36)(2,"table",37)(3,"thead")(4,"tr",38)(5,"th",39),t._uU(6,"#"),t.qZA(),t.TgZ(7,"th",40),t._uU(8,"Severity"),t.qZA(),t.TgZ(9,"th",41),t._uU(10,"Range"),t.qZA(),t.TgZ(11,"th",41),t._uU(12,"CWE"),t.qZA(),t.TgZ(13,"th",42),t._uU(14,"Title"),t.qZA(),t._UZ(15,"th",43),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,tt,13,7,"tr",44),t.qZA()()()()),2&i){const e=t.oxw().$implicit;t.xp6(17),t.Q6J("ngForOf",e.via)}}function it(i,s){if(1&i&&(t.TgZ(0,"tr",28)(1,"td"),t.YNc(2,$,1,2,"button",29),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",30),t.YNc(6,j,1,0,"i",31),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td"),t.YNc(14,X,4,3,"span",32),t.qZA()(),t.YNc(15,et,18,1,"tr",32)),2&i){const e=s.$implicit,l=s.rowIndex;t.Q6J("pSelectableRow",e),t.xp6(2),t.Q6J("ngIf",null==e.via?null:e.via.length),t.xp6(2),t.Oqu(l+1),t.xp6(2),t.Q6J("ngIf",e.isDirect),t.xp6(2),t.Oqu(e.severity),t.xp6(2),t.Oqu(e.range),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Q6J("ngIf",e.fixAvailable),t.xp6(1),t.Q6J("ngIf",e.expanded)}}function nt(i,s){1&i&&t._UZ(0,"p-progressSpinner",49)}let x=(()=>{class i{generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;dataProviderService;cd;showCheckbox=!1;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];metadata;rowsMap={};showAll=!1;EUserType=S.d;gridKey=v.iH._id;EAPICategory=q.R;selectedRows=[];vulnerabilityCategories;model={vulnerabilitiesType:null};constructor(e,l,n,o,p,st,rt,ot,pt,dt,ct,ut,gt,mt){this.generalS=e,this.notificationS=l,this.navigationCS=n,this.authCS=o,this.constantsS=p,this.eventCenterS=st,this.router=rt,this.userS=ot,this.instanceS=pt,this.ns=dt,this.cs=ct,this.confirmationService=ut,this.dataProviderService=gt,this.cd=mt}ngOnInit(){var e=this;return(0,r.Z)(function*(){e.vulnerabilityCategories=e.dataProviderService.getVulnerabilityCategories(),e.model.vulnerabilitiesType=e.vulnerabilityCategories[0],e.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0),yield e.loadGridData(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var l=(0,r.Z)(function*(n){(n.action===Z.F.SAVED||n.action===Z.F.UPDATED)&&(yield e.loadGridData())});return function(n){return l.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Vulnerabilities Report")})()}typeChanged(){var e=this;return(0,r.Z)(function*(){yield e.loadGridData()})()}loadGridData(){var e=this;return(0,r.Z)(function*(){e.loading.grid=!0;try{const l=yield e.instanceS.getVulnerabilities({type:e.model.vulnerabilitiesType.name});if(l){e.selectedRows=[];const n=l.data;e.rows=n.list||[];for(const o of e.rows)o._id=e.generalS.getRandomString(8);e.metadata=n.metadata,e.rowsMap=U.keyBy(e.rows,v.iH._id)}}catch(l){e.ns.showErrorFromResponse(l.error||l,"Unable to load vulnerabilities.")}e.loading.grid=!1,e.cd.detectChanges()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0)}resetThisUrl(){var e=this;return(0,r.Z)(function*(){e.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0),yield e.navigationCS.setQueryParam(d.p.am_vulnerability,null)})()}itemSelected(){var e=this;return(0,r.Z)(function*(){yield e.resetThisUrl(),setTimeout(e.fillData.bind(e))})()}fillData(){var e=this;return(0,r.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(d.p.am_vulnerability,""),void e.eventCenterS.vulnerabilities.selectedVulnerability.next(null);const l=e.selectedRows[0];l?(yield e.navigationCS.setQueryParam(d.p.am_vulnerability,l._id),e.eventCenterS.vulnerabilities.selectedVulnerability.next(l)):yield e.resetThisUrl()})()}print(){window.print()}expand(){for(const e of this.rows)e.via?.length&&(e.expanded=!0)}compress(){for(const e of this.rows)e.via?.length&&(e.expanded=!1)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||i)(t.Y36(V.b),t.Y36(h.W),t.Y36(I.S),t.Y36(O.D),t.Y36(T.L),t.Y36(L.u),t.Y36(m.F0),t.Y36(J.K),t.Y36(Y.E),t.Y36(h.W),t.Y36(T.L),t.Y36(y.YP),t.Y36(D.B),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-vulnerability-list"]],inputs:{showCheckbox:"showCheckbox"},decls:16,vars:14,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/vulnerability.svg","alt","Vulnerabilities",1,"fa-fw","mr-1"],["optionLabel","name","filterBy","name","appendTo","body","styleClass","p-input-filled width-300 p-input-small-dropdown ml-4",3,"options","ngModel","filter","onChange"],["class","float-right cursor-pointer ml-3 d-print-none",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","p-2",4,"ngIf"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 336px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"float-right","cursor-pointer","ml-3","d-print-none",3,"click"],["pTooltip","Collapse all rows","tooltipPosition","left",1,"fas","fa-compress-alt","fa-fw"],["pTooltip","Expand all rows","tooltipPosition","left",1,"fas","fa-expand-alt","fa-fw"],["pTooltip","Print report","tooltipPosition","left",1,"fas","fa-print","fa-fw"],[1,"p-2"],[1,"row"],[1,"col-6"],[1,"table","table-bordered","table-sm","mb-0"],["colspan","2",1,"text-center","bg-dark"],[1,"text-right",2,"width","50%"],[3,"ngClass"],[1,"text-right"],[2,"width","45px"],[2,"width","55px"],[2,"width","70px"],[2,"width","90px"],[2,"width","170px"],[3,"pSelectableRow"],["type","button","pButton","","pRipple","","class","p-button-text p-button-rounded p-button-plain mr-2",3,"pRowToggler","icon","click",4,"ngIf"],[1,"text-center"],["pTooltip","Direct dependency","class","far fa-solid fa-dot-circle fa-fw align-middle text-success text-v-small pr-1",4,"ngIf"],[4,"ngIf"],["type","button","pButton","","pRipple","",1,"p-button-text","p-button-rounded","p-button-plain","mr-2",3,"pRowToggler","icon","click"],["pTooltip","Direct dependency",1,"far","fa-solid","fa-dot-circle","fa-fw","align-middle","text-success","text-v-small","pr-1"],["tooltipPosition","left",3,"pTooltip"],["colspan","7",1,"pl-5"],[1,"table","table-bordered","table-hover","table-sm"],[1,"bg-dark"],["scope","col",1,"text-center",2,"width","50px"],["scope","col",2,"width","90px"],["scope","col",2,"width","170px"],["scope","col"],["scope","col",2,"width","70px"],[4,"ngFor","ngForOf"],["scope","row",1,"text-center","px-0"],["class","btn btn-xsm-custom d-print-none","target","_blank","pTooltip","View details","tooltipPosition","left",3,"href",4,"ngIf"],["target","_blank","pTooltip","View details","tooltipPosition","left",1,"btn","btn-xsm-custom","d-print-none",3,"href"],[1,"fas","fa-external-link-alt","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,n){1&l&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Vulnerabilities"),t.qZA(),t.TgZ(5,"span")(6,"p-dropdown",3),t.NdJ("onChange",function(p){return n.model.vulnerabilitiesType=p.value,n.typeChanged()}),t.qZA()(),t.YNc(7,E,2,0,"span",4),t.YNc(8,F,2,0,"span",4),t.YNc(9,M,2,0,"span",4),t.qZA(),t.TgZ(10,"div",5),t.YNc(11,H,72,18,"div",6),t.TgZ(12,"p-table",7),t.NdJ("selectionChange",function(p){return n.selectedRows=p})("selectionChange",function(){return n.itemSelected()}),t.YNc(13,B,13,0,"ng-template",8),t.YNc(14,it,16,9,"ng-template",9),t.qZA(),t.YNc(15,nt,1,0,"p-progressSpinner",10),t.qZA()()),2&l&&(t.xp6(6),t.Q6J("options",n.vulnerabilityCategories)("ngModel",n.model.vulnerabilitiesType)("filter",!0),t.xp6(1),t.Q6J("ngIf",n.rows.length),t.xp6(1),t.Q6J("ngIf",n.rows.length),t.xp6(1),t.Q6J("ngIf",n.rows.length),t.xp6(2),t.Q6J("ngIf",null==n.metadata||null==n.metadata.vulnerabilities?null:n.metadata.vulnerabilities.total),t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.xp6(3),t.Q6J("ngIf",n.loading.grid))},dependencies:[b.JJ,b.On,c.mk,c.sg,c.O5,u.iA,y.jx,u.Ei,u.jB,P.G,Q.Hq,N.u,R.Lt,f.H],encapsulation:2,changeDetection:0})}return i})();const at=[{path:"layout",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=t.Xpm({type:i,selectors:[["app-vulnerability-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(l,n){1&l&&(t.TgZ(0,"div",0),t._UZ(1,"app-vulnerability-list"),t.qZA())},dependencies:[x],encapsulation:2})}return i})(),canActivate:[A.P]}];let lt=(()=>{class i{static \u0275fac=function(l){return new(l||i)};static \u0275mod=t.oAB({type:i});static \u0275inj=t.cJS({imports:[m.Bz.forChild(at),C.u,f.T]})}return i})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1928],{71928:(gt,d,o)=>{o.r(d),o.d(d,{TpApiM:()=>it});var h=o(77664),T=o(17017),A=o(63726),t=o(94946),c=o(85219),I=o(55043),C=o(58651),r=o(15861),x=o(27672),l=o(51162),E=o(20553),m=o(45085),_=o(19394),y=o(91601),P=o(78883),O=o(15561),g=o(99961),M=o(95852),Z=o(32915),N=o(45809),F=o(53429),G=o(27414),D=o(77240),B=o(61252),Y=o(12559),J=o(96814),H=o(756),U=o(97680),f=o(14844),b=o(33259),R=o(25025);const L=["monacoEditorModalC"];function V(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",12),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",13),t.qZA()}}function Q(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",14),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",15),t.qZA()}}function w(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"a",16),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw(2);return t.KtG(s.editorGeneratedBasicInfo(n))}),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(2),t.Q6J("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function j(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",28)(1,"button",29),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.save())}),t._UZ(2,"i",30),t._uU(3," Add Third Party API Settings "),t.qZA()()}}function z(a,p){1&a&&t._UZ(0,"p-progressSpinner",31)}function W(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.NdJ("activeIndexChange",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.activeIndex=n)})("activeIndexChange",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.tabSelected())}),t.TgZ(3,"p-tabPanel",20),t.YNc(4,K,3,2,"div",21),t.qZA(),t.TgZ(5,"p-tabPanel",22),t.YNc(6,j,4,0,"div",23),t.TgZ(7,"div",24)(8,"app-monaco-editor",25),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.editorGenerated(n))}),t.qZA()()()()(),t.YNc(9,z,1,0,"p-progressSpinner",26),t.qZA()}if(2&a){const e=t.oxw();t.xp6(2),t.Q6J("activeIndex",e.activeIndex),t.xp6(2),t.Q6J("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.xp6(2),t.Q6J("ngIf",!e.tpApiSetting._id),t.xp6(2),t.Q6J("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.xp6(1),t.Q6J("ngIf",e.loading.form)}}let S=(()=>{class a{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=x.di;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=E.N.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,ot,at,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=ot,this.instanceS=at,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.Z)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();if(i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName){i.treeItemApiId=e._id;const s=`${e.guid}:${i.authCS.gUser._id}`;i.tpInstallApi=(yield i.tpInstalledApisS.getById(s).toPromise()).data,i.cd.detectChanges()}i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.Z)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.Z)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.iH._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||_.pj.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.iH._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab=e.tab||{},e.tab.axiosResponse={data:s.error},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.Z)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.Z)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(t.Y36(P.e),t.Y36(O.X),t.Y36(g.W),t.Y36(M.D),t.Y36(Z.u),t.Y36(N.b),t.Y36(F.E),t.Y36(G.L),t.Y36(D.b),t.Y36(B.G),t.Y36(Y.d),t.Y36(g.W),t.Y36(c.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.Gf(L,5),2&i){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Third Party API Settings"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,V,2,0,"span",5),t.YNc(8,Q,2,0,"span",6),t.YNc(9,w,2,0,"a",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,W,10,7,"div",9),t.qZA()(),t._UZ(12,"app-monaco-editor-modal",10,11)),2&i&&(t.xp6(7),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.xp6(1),t.Q6J("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.xp6(1),t.Q6J("ngIf",n.lastError),t.xp6(2),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[J.O5,H.O,U.G,f.xf,f.x4,b.u,R.A],encapsulation:2})}return a})();function X(a,p){1&a&&t._UZ(0,"app-w-supported-tp-api",3),2&a&&t.Q6J("IsDependentOnGroup",!1)("isLPM",!1)}function $(a,p){1&a&&t._UZ(0,"app-w-tp-api-form",4)}const u=function(){return[40,60]};let v=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,X,1,2,"ng-template",2),t.YNc(3,$,1,0,"ng-template",2),t.qZA()()),2&i&&(t.xp6(1),t.Q6J("panelSizes",t.DdM(2,u))("minSizes",t.DdM(3,u)))},dependencies:[c.jx,I.q,C.A,S],encapsulation:2})}return a})();var k=o(36401),q=o(57705),tt=o(44950);const et=[{path:"tp-layout",component:v,canActivate:[A.P]}];let it=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[h.Bz.forChild(et),T.u,k.GroupM,q.L,tt.A]})}return a})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1957],{41957:(y,i,e)=>{e.r(i),e.d(i,{NotesM:()=>m});var d=e(77664),p=e(17017),l=e(63726),t=e(94946),h=e(20553),C=e(25405),v=e(56750),f=e(70621);const u=["notesGridId"];const g=[{path:"main",component:(()=>{class n{eventCenterCS;detectChanges=new t.vpe;notesListC;loading={form:!1,response:!1};BE_HOST_PORT=h.N.BE_HOST_PORT;constructor(a){this.eventCenterCS=a}ngOnInit(){this.eventCenterCS.hideShowNotesIcon=!0}ngOnDestroy(){this.eventCenterCS.hideShowNotesIcon=!1}static \u0275fac=function(o){return new(o||n)(t.Y36(C.M))};static \u0275cmp=t.Xpm({type:n,selectors:[["app-notes-layout"]],viewQuery:function(o,s){if(1&o&&t.Gf(u,7),2&o){let r;t.iGM(r=t.CRH())&&(s.notesListC=r.first)}},inputs:{detectChanges:"detectChanges"},decls:7,vars:10,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[1,"row","m-0",2,"height","calc(100vh - 52px)"],[1,"col-3","p-0"],[1,"w-100",3,"projectType","hostAndPort"],["notesGridId",""],[1,"col-9","p-0"],[1,"w-100",3,"data","loading","projectType","hostAndPort","isPageHeight","detectChanges"]],template:function(o,s){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"app-notes-list",3,4),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"app-notes-form",6),t.qZA()()()),2&o&&(t.xp6(3),t.Q6J("projectType","AM")("hostAndPort",s.BE_HOST_PORT),t.xp6(2),t.Udp("display",s.eventCenterCS.addEditNotes?"block":"none"),t.xp6(1),t.Q6J("data",s.notesListC.data)("loading",s.loading)("projectType","AM")("hostAndPort",s.BE_HOST_PORT)("isPageHeight",!0)("detectChanges",s.detectChanges))},dependencies:[v.o,f.X],encapsulation:2})}return n})(),canActivate:[l.P]}];let m=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=t.oAB({type:n});static \u0275inj=t.cJS({imports:[d.Bz.forChild(g),p.u]})}return n})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2140],{2140:(l,i,n)=>{n.r(i),n.d(i,{MonitoringM:()=>m});var r=n(77664),s=n(17017),e=n(63726),o=n(94946);const u=[{path:"main",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-monitoring-c"]],decls:2,vars:0,template:function(a,f){1&a&&(o.TgZ(0,"h1"),o._uU(1,"Monitoring"),o.qZA())},encapsulation:2})}return t})(),canActivate:[e.P]}];let m=(()=>{class t{static \u0275fac=function(a){return new(a||t)};static \u0275mod=o.oAB({type:t});static \u0275inj=o.cJS({imports:[r.Bz.forChild(u),s.u]})}return t})()}}]);