@sava-info-systems/api-maker-with-extensions 1.19.8 → 1.20.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 (146) hide show
  1. package/dist/1025.95948d3d2668bb14.js +1 -0
  2. package/dist/1097.51fa3413ab19b10c.js +1 -0
  3. package/dist/148.1dc7d9e0cfe45510.js +1 -0
  4. package/dist/1558.0aae3e5c538d3815.js +1 -0
  5. package/dist/1617.ae52a2c64a228ace.js +1 -0
  6. package/dist/1678.d009ae459b731b2d.js +1 -0
  7. package/dist/1754.691f142aa1eabe28.js +1 -0
  8. package/dist/1928.5c81326985ca5f64.js +1 -0
  9. package/dist/1957.ab7fda21d9978597.js +1 -0
  10. package/dist/2140.1ce150285aebe3cc.js +1 -0
  11. package/dist/2295.4fa1d4b5ff482f3a.js +1 -0
  12. package/dist/238.891233aa670bdd2b.js +1 -0
  13. package/dist/2473.4b2bb1ad5b1cc99d.js +1 -0
  14. package/dist/2714.9880836f6b8b78a7.js +1 -0
  15. package/dist/2735.a66ecf607b9654e0.js +1 -0
  16. package/dist/2908.c26d49c83d4cbc85.js +1 -0
  17. package/dist/3081.cd465078d391b50b.js +1 -0
  18. package/dist/3139.8a9b45f6545e48f4.js +1 -0
  19. package/dist/3450.9b5cfc83039b02b5.js +1 -0
  20. package/dist/3664.79889ff090d64b8d.js +1 -0
  21. package/dist/3rdpartylicenses.txt +829 -0
  22. package/dist/4110.c8b37cab34b21d0d.js +1 -0
  23. package/dist/4186.3bd4de588fe7617d.js +1 -0
  24. package/dist/4211.0399a499eefacb52.js +1 -0
  25. package/dist/4575.f2056aa18e4cc778.js +1 -0
  26. package/dist/4842.e7649d81606ad80d.js +1 -0
  27. package/dist/485.ec283c2f8b792308.js +1 -0
  28. package/dist/4895.a54759704d1994b1.js +1 -0
  29. package/dist/5249.eb35e8578584cad0.js +1 -0
  30. package/dist/5334.b4ed1b45db24d12f.js +1 -0
  31. package/dist/5421.2067001c10533303.js +1 -0
  32. package/dist/5679.4e22239895c7f520.js +1 -0
  33. package/dist/5761.331ca41ab64cca92.js +1 -0
  34. package/dist/5765.1994a5bd001c1c55.js +1 -0
  35. package/dist/6236.5b62431db131ce4d.js +1 -0
  36. package/dist/6393.958d3e53cb6f8226.js +1 -0
  37. package/dist/6401.374823002788afe7.js +1 -0
  38. package/dist/6925.e2366878306cf7f7.js +1 -0
  39. package/dist/7368.7d91d2ce7677e72a.js +1 -0
  40. package/dist/7436.640bf5fe48814cbe.js +1 -0
  41. package/dist/7470.1bdcf8e01acb62bd.js +1 -0
  42. package/dist/7649.ab4744cfe713eec0.js +1 -0
  43. package/dist/7975.6f386123f5c64f78.js +1 -0
  44. package/dist/7977.afeded970bac8b66.js +1 -0
  45. package/dist/7987.d15aacc264588b12.js +1 -0
  46. package/dist/8125.35fe2368910566d5.js +1 -0
  47. package/dist/8266.aca59a0a04590ab1.js +1 -0
  48. package/dist/8296.b204438fa5439b1e.js +1 -0
  49. package/dist/8374.e72fc8226673c9d9.js +1 -0
  50. package/dist/8682.07ee1b8ac649ed4c.js +1 -0
  51. package/dist/8841.f7eb5568831c2981.js +1 -0
  52. package/dist/885.c5fd870ec02f004d.js +1 -0
  53. package/dist/891.5e08c81e5200413e.js +1 -0
  54. package/dist/913.4580b4ce4307a40f.js +1 -0
  55. package/dist/9243.08630ad94e1fddba.js +1 -0
  56. package/dist/9575.50120082195b31cc.js +1 -0
  57. package/dist/9939.4b0d758462bcc042.js +1 -0
  58. package/dist/assets/images/icons/scanning-period.svg +13 -0
  59. package/dist/assets/schema-types/InterfaceProps.ts +38 -0
  60. package/dist/assets/schema-types/store-types.ts +4 -0
  61. package/dist/assets/schema-types/types.ts +82 -0
  62. package/dist/assets/styles/colors-dark.scss +4 -0
  63. package/dist/assets/styles/out/bootstrap-overrides.css.map +1 -0
  64. package/dist/assets/styles/out/colors-dark.css +1 -1
  65. package/dist/assets/styles/out/colors-dark.css.map +1 -0
  66. package/dist/assets/styles/out/colors-light.css.map +1 -0
  67. package/dist/assets/styles/out/monaco-editor-overrides.css.map +1 -0
  68. package/dist/assets/styles/out/styles.css +1 -1
  69. package/dist/assets/styles/out/styles.css.map +1 -0
  70. package/dist/assets/styles/out/variables.css.map +1 -0
  71. package/dist/assets/styles/styles.scss +42 -1
  72. package/dist/common.c4550210be4e415f.js +1 -0
  73. package/dist/index.html +5 -1
  74. package/dist/main.d1a56ffd3d6266b9.js +1 -0
  75. package/dist/polyfills.47193e1d7d4041b5.js +1 -0
  76. package/dist/runtime.bb2a9060f1f8cb8e.js +1 -0
  77. package/main.js +1 -1
  78. package/package.json +15 -15
  79. package/sandbox/Dockerfile +2 -2
  80. package/sandbox/assets/schema-types/store-types.js +53 -49
  81. package/sandbox/assets/schema-types/types.js +285 -265
  82. package/sandbox/sandbox.js +1 -1
  83. package/src/assets/schema-types/store-types.ts +4 -0
  84. package/src/assets/schema-types/types.ts +82 -0
  85. package/src/public/dist-db-masters/browser/index.html +1 -1
  86. package/src/public/dist-db-masters/browser/main-HGRBZVEX.js +139 -0
  87. package/src/tools/local-client.js +1 -1
  88. package/dist/1025.ad3d7fe2972421a7.js +0 -1
  89. package/dist/1097.f7edc9a254293cbe.js +0 -1
  90. package/dist/148.3d1172921fc38628.js +0 -1
  91. package/dist/1558.d77067ef3989dc57.js +0 -1
  92. package/dist/1617.cd35a3a268fd8f90.js +0 -1
  93. package/dist/1678.2c6fe869dc9df280.js +0 -1
  94. package/dist/1754.616b92791d39dab1.js +0 -1
  95. package/dist/1928.a299b3986d670379.js +0 -1
  96. package/dist/1957.cafa315c70f23efe.js +0 -1
  97. package/dist/2140.82e389d21656cd83.js +0 -1
  98. package/dist/2295.b066a00a7c4c4d9c.js +0 -1
  99. package/dist/238.ec990f26e1e29a5e.js +0 -1
  100. package/dist/2473.6a522dcf87dfb922.js +0 -1
  101. package/dist/2714.1ed8bfd73f5693eb.js +0 -1
  102. package/dist/2735.880b4c038ef3207e.js +0 -1
  103. package/dist/2908.c7cbde300e1840a4.js +0 -1
  104. package/dist/3081.dd32ee0f5db41577.js +0 -1
  105. package/dist/3139.7a6ebcaa6a5f38f6.js +0 -1
  106. package/dist/3450.68d8d179c9496764.js +0 -1
  107. package/dist/4110.1747a68dfaacbbd8.js +0 -1
  108. package/dist/4186.601304798e909236.js +0 -1
  109. package/dist/4211.ad181f08e1073d52.js +0 -1
  110. package/dist/4575.987834c6e73af961.js +0 -1
  111. package/dist/4842.f89ded9e1e9f1110.js +0 -1
  112. package/dist/485.b333cf63f954b75c.js +0 -1
  113. package/dist/4895.95e42b567a89ce84.js +0 -1
  114. package/dist/5249.73e35de880a7af92.js +0 -1
  115. package/dist/5334.8ed5b236a6948681.js +0 -1
  116. package/dist/5421.e729ed3585afa9af.js +0 -1
  117. package/dist/5679.53292305f1448567.js +0 -1
  118. package/dist/5761.c363fe26244e8787.js +0 -1
  119. package/dist/5765.2b385a8405d8e7b2.js +0 -1
  120. package/dist/6236.b81e95926f7fcd60.js +0 -1
  121. package/dist/6393.1323e8b7d2cdae70.js +0 -1
  122. package/dist/6401.02e5b3cb94d0322a.js +0 -1
  123. package/dist/6925.d59cabb0e343d24c.js +0 -1
  124. package/dist/7368.4c04430d3efc5947.js +0 -1
  125. package/dist/7436.7e4876b9e90efde6.js +0 -1
  126. package/dist/7470.9195bddaee5202e0.js +0 -1
  127. package/dist/7649.870e05f3aa978078.js +0 -1
  128. package/dist/7975.dbe6e674c50ab553.js +0 -1
  129. package/dist/7977.35ebfb6f4c9503b4.js +0 -1
  130. package/dist/7987.5202964524a17ffa.js +0 -1
  131. package/dist/8125.58e1a7a385797896.js +0 -1
  132. package/dist/8266.d665463de8b8d75a.js +0 -1
  133. package/dist/8296.32f107844a1381b6.js +0 -1
  134. package/dist/8374.11d430ef2432bfba.js +0 -1
  135. package/dist/8682.5bde1163690a18dc.js +0 -1
  136. package/dist/8841.6cb824dd9d5ad8f8.js +0 -1
  137. package/dist/885.e3d53b62c51f8311.js +0 -1
  138. package/dist/891.333c6913b8246e3c.js +0 -1
  139. package/dist/913.e60cadd27b99097f.js +0 -1
  140. package/dist/9243.c223cdbc4cd84cb8.js +0 -1
  141. package/dist/9575.0a35a4da70f9e6e5.js +0 -1
  142. package/dist/9939.218315684234eb18.js +0 -1
  143. package/dist/common.442040891fd4ef29.js +0 -1
  144. package/dist/main.ca1eb95b67ff9761.js +0 -1
  145. package/dist/polyfills.93062920aa87d580.js +0 -1
  146. package/dist/runtime.66bf12954a778fb7.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[5761],{5761:(E,m,o)=>{o.r(m),o.d(m,{AutoIncrementM:()=>M});var f=o(77664),h=o(17017),v=o(63726),i=o(15861),Z=o(51162),A=o(6990),e=o(94946),T=o(99961),u=o(85219),I=o(27414),b=o(53429),y=o(77240),l=o(60095),C=o(96814),U=o(32660),p=o(95431),_=o(97680),w=o(33259);function S(a,r){if(1&a){const t=e.EpF();e.TgZ(0,"span",36),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",37),e.qZA()}}function x(a,r){if(1&a){const t=e.EpF();e.TgZ(0,"span",38),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",39),e.qZA()}}function P(a,r){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Instance"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Database"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Collection"),e.qZA(),e.TgZ(7,"th"),e._uU(8,"Field Path"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Last Generated Value"),e.qZA()())}function D(a,r){if(1&a&&(e.TgZ(0,"tr",40)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA()()),2&a){const t=r.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.instance),e.xp6(2),e.Oqu(t.database),e.xp6(2),e.Oqu(t.collection),e.xp6(2),e.Oqu(t.field),e.xp6(2),e.Oqu(t.value)}}function q(a,r){1&a&&e._UZ(0,"p-progressSpinner",41)}function L(a,r){1&a&&e._UZ(0,"p-progressSpinner",41)}const J=[{path:"main",component:(()=>{class a{ns;confirmationService;constantsS;instanceS;cd;generalS;loading={grid:!1,form:!1};rows=[];rowsMap={};gridKey=Z.GR.id;idCounter=0;val;selectedRows=[];constructor(t,s,n,c,d,R){this.ns=t,this.confirmationService=s,this.constantsS=n,this.instanceS=c,this.cd=d,this.generalS=R}ngOnInit(){this.loadGridData(),this.generalS.setNewTitle("API Maker - Auto Increments")}loadGridData(){var t=this;return(0,i.Z)(function*(){t.loading.grid=!0,t.selectedRows=[];const s=yield t.instanceS.getAllAutoIncrement().toPromise();t.rows=s.data,t.idCounter=0;for(const n of t.rows)n.id=t.idCounter++;t.rowsMap=A.keyBy(t.rows,t.gridKey),t.loading.grid=!1,t.cd.detectChanges()})()}edit(){var t=this;return(0,i.Z)(function*(){t.selectedRows.length&&($("#idEditIncrement").modal("show"),t.val=t.selectedRows[0].value)})()}removePermanentDialog(){var t=this;return(0,i.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.autoIncrement.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,i.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,i.Z)(function*(){t.loading.grid=!0;const s=t.selectedRows[0],n=yield t.instanceS.deleteAutoIncrement(s).toPromise();t.loading.grid=!1,n.success?(t.ns.showSuccess(t.constantsS.autoIncrement.removePermanent),yield t.loadGridData()):t.ns.showErrorFromResponse(n,t.constantsS.autoIncrement.removePermanentError)})()}update(){var t=this;return(0,i.Z)(function*(){if(!t.val)return t.ns.showWarning("Please Provide Value");if(t.val<1)return t.ns.showWarning("Please Provide Positive Value");const s=t.selectedRows[0];s.value=t.val;try{t.loading.grid=!0,(yield t.instanceS.updateAutoIncrementKey(s).toPromise())&&(t.ns.showSuccess(t.constantsS.autoIncrement.editSuccess),yield t.loadGridData(),$("#idEditIncrement").modal("hide"),t.val=null),t.loading.grid=!1}catch(n){t.loading.grid=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to update.")}t.cd.detectChanges()})()}static \u0275fac=function(s){return new(s||a)(e.Y36(T.W),e.Y36(u.YP),e.Y36(I.L),e.Y36(b.E),e.Y36(e.sBO),e.Y36(y.b))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-auto-increment-list"]],decls:59,vars:13,consts:[[1,"pt-1","pl-1","pr-1"],[1,"card","shadow-sm",2,"height","calc(100vh - 50px)"],[1,"card-header"],["src","/assets/images/icons/increment.svg","alt","Auto Increments",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/features/auto-increment.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","Edit",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","scrollHeight","calc(100vh - 94px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idEditIncrement","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body"],[1,"form-group","row","pt-4"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["min","1","name","val","spellcheck","false","type","number","placeholder","Value",1,"form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"mt-2",2,"line-height","1"],[1,"text-info","small","font-monospaced"],[1,"text-warning","small","font-monospaced"],[1,"small","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["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"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","align-middle"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"span"),e._UZ(4,"img",3),e._uU(5," Auto Increments"),e.qZA(),e.TgZ(6,"a",4),e._UZ(7,"img",5),e.qZA(),e.YNc(8,S,2,0,"span",6),e.YNc(9,x,2,0,"span",7),e.qZA(),e.TgZ(10,"div",8)(11,"p-table",9),e.NdJ("selectionChange",function(d){return n.selectedRows=d})("dblclick",function(){return n.edit()}),e.YNc(12,P,11,0,"ng-template",10),e.YNc(13,D,11,6,"ng-template",11),e.qZA(),e.YNc(14,q,1,0,"p-progressSpinner",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"div",14)(17,"div",15)(18,"div",16)(19,"span"),e._UZ(20,"i",17),e._uU(21," Edit Auto Increment"),e.qZA(),e.TgZ(22,"div",18)(23,"button",19)(24,"span",20),e._UZ(25,"i",21),e.qZA()(),e.TgZ(26,"a",4),e._UZ(27,"img",5),e.qZA()()(),e.TgZ(28,"div",22)(29,"div",23)(30,"label",24),e._uU(31,"Value"),e.qZA(),e.TgZ(32,"div",25)(33,"input",26),e.NdJ("ngModelChange",function(d){return n.val=d}),e.qZA(),e.TgZ(34,"div",27)(35,"span",28),e._uU(36,"Next value will be maximum from below"),e.qZA(),e._UZ(37,"br"),e.TgZ(38,"span",29),e._uU(39),e.qZA(),e._UZ(40,"br"),e.TgZ(41,"span",30),e._uU(42,"or"),e.qZA(),e._UZ(43,"br"),e.TgZ(44,"span",29),e._uU(45,"\u{1f449} Max DB value + (step from schema || 1)"),e.qZA(),e._UZ(46,"br"),e.TgZ(47,"span",30),e._uU(48,"System will get max db value, when there is no entry available in this table."),e.qZA(),e._UZ(49,"br"),e.qZA()()()(),e.TgZ(50,"div",31)(51,"button",32),e._UZ(52,"i",33),e._uU(53," Close"),e.qZA(),e.TgZ(54,"button",34),e.NdJ("click",function(){return n.update()}),e._UZ(55,"i",35),e.TgZ(56,"span"),e._uU(57,"Update"),e.qZA()()(),e.YNc(58,L,1,0,"p-progressSpinner",12),e.qZA()()()),2&s&&(e.xp6(8),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(19),e.Q6J("ngModel",n.val),e.xp6(6),e.hij("\u{1f449} ",n.val," + (step from schema || 1)"),e.xp6(15),e.Q6J("disabled",!n.val),e.xp6(4),e.Q6J("ngIf",n.loading.form))},dependencies:[l.Fj,l.wV,l.JJ,l.qQ,l.On,C.O5,U.y,p.iA,u.jx,p.Ei,_.G,w.u],encapsulation:2,changeDetection:0})}return a})(),canActivate:[v.P]}];let M=(()=>{class a{static \u0275fac=function(s){return new(s||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[f.Bz.forChild(J),h.u]})}return a})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[5765],{37595:(Et,P,l)=>{l.d(P,{G:()=>c});var d=l(15861),t=l(94946),n=l(33157),f=l(90328),C=l(56212),h=l(6990),I=l(45085),S=l(51162),St=l(96925),Zt=l(20553),F=l(19394),Z=l(60921),L=l(67629),y=l(77240),u=l(99961),E=l(92189),M=l(95852),T=l(27414),w=l(32915),D=l(77664),Q=l(69862),O=l(85219),R=l(60095),G=l(96814),J=l(87797),v=l(95431),Y=l(97680),q=l(33259),k=l(38057),K=l(21137);const B=["funManFormC"],W=["cloneApiModalC"];function H(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",20),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.edit())}),t._UZ(1,"i",21),t.qZA()}}function j(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",22),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.clone())}),t._UZ(1,"i",23),t.qZA()}}function $(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",24),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.removePermanentDialog())}),t._UZ(1,"i",25),t.qZA()}}function z(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span")(1,"span",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.navigateToTreeView())}),t._UZ(2,"i",14),t.qZA(),t.TgZ(3,"span",15),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.add())}),t._UZ(4,"i",16),t.qZA(),t.YNc(5,H,2,0,"span",17),t.YNc(6,j,2,0,"span",18),t.YNc(7,$,2,0,"span",19),t.qZA()}if(2&i){const e=t.oxw();t.xp6(5),t.Q6J("ngIf",1===e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",1===e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",1===e.selectedRows.length)}}function V(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",26)(1,"p-checkbox",27),t.NdJ("ngModelChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.eventCenterS.group.apisRegex.allCustomApis=r)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allCustomApis)("binary",!0)}}function X(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",26)(1,"p-checkbox",27),t.NdJ("ngModelChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.eventCenterS.filterInLog.apisRegex.allCustomApis=r)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allCustomApis)("binary",!0)}}function tt(i,s){if(1&i&&(t.TgZ(0,"div")(1,"div",28),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allCustomApisPermitted)}}function et(i,s){1&i&&(t.TgZ(0,"th",38),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function nt(i,s){1&i&&t._UZ(0,"th",36)}function it(i,s){1&i&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function ot(i,s){1&i&&t._UZ(0,"th")}function st(i,s){1&i&&t._UZ(0,"th",39)}function at(i,s){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,et,2,0,"th",34),t.YNc(2,nt,1,0,"th",35),t._UZ(3,"th",36),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Path"),t.qZA(),t.YNc(8,it,2,0,"th",5),t.YNc(9,ot,1,0,"th",5),t.YNc(10,st,1,0,"th",37),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(6),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",e.isLPM),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable)}}function rt(i,s){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",47),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function lt(i,s){if(1&i&&(t.TgZ(0,"td",48)(1,"span"),t._uU(2),t.qZA()()),2&i){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function ct(i,s){1&i&&(t.TgZ(0,"span",49),t._uU(1,"Native"),t.qZA())}function pt(i,s){1&i&&(t.TgZ(0,"span",50),t._uU(1,"Caching"),t.qZA())}function dt(i,s){1&i&&(t.TgZ(0,"span",51),t._uU(1,"B. Schema"),t.qZA())}function _t(i,s){1&i&&(t.TgZ(0,"span",52),t._uU(1,"Q. Schema"),t.qZA())}function ut(i,s){1&i&&(t.TgZ(0,"span",56),t._uU(1,"AM-User"),t.qZA())}function mt(i,s){1&i&&(t.TgZ(0,"span",57),t._uU(1,"No-Access"),t.qZA())}function ft(i,s){1&i&&(t.TgZ(0,"span",58),t._uU(1,"Public"),t.qZA())}function gt(i,s){1&i&&(t.TgZ(0,"span",57),t._uU(1,"DB-User"),t.qZA())}function ht(i,s){1&i&&(t.TgZ(0,"span",57),t._uU(1,"AWS"),t.qZA())}function Ct(i,s){1&i&&(t.TgZ(0,"span",57),t._uU(1,"Azure"),t.qZA())}function Tt(i,s){1&i&&(t.TgZ(0,"span",57),t._uU(1,"Google"),t.qZA())}function vt(i,s){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,ut,2,0,"span",53),t.YNc(2,mt,2,0,"span",54),t.YNc(3,ft,2,0,"span",55),t.YNc(4,gt,2,0,"span",54),t.YNc(5,ht,2,0,"span",54),t.YNc(6,Ct,2,0,"span",54),t.YNc(7,Tt,2,0,"span",54),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.hasAmAuth),t.xp6(1),t.Q6J("ngIf",e.noAccess),t.xp6(1),t.Q6J("ngIf",e.isPublic),t.xp6(1),t.Q6J("ngIf",e.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",e.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",e.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",e.hasGoogleAuth)}}function At(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"label",59)(2,"p-checkbox",60),t.NdJ("ngModelChange",function(r){t.CHM(e);const p=t.oxw(2).$implicit;return t.KtG(p.saveResponseInLog=r)})("ngModelChange",function(){t.CHM(e);const r=t.oxw(4);return t.KtG(r.saveResponseInLogCheckData())})("click",function(r){t.CHM(e);const p=t.oxw(4);return t.KtG(p.generalS.stopPropagation(r))}),t.qZA()()()}if(2&i){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function U(i,s){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,At,3,2,"div",5),t.qZA()),2&i){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(null==o.selectedRows?null:o.selectedRows.indexOf(e))>=0)}}const xt=function(){return["/api-info/api-testing/testing"]},b=function(i,s,e){return{at_category:i,at_user:s,at_api:e}};function N(i,s){if(1&i&&(t.TgZ(0,"td")(1,"div",48)(2,"a",61),t.NdJ("click",function(o){return o.stopPropagation()}),t._UZ(3,"i",62),t.qZA()()()),2&i){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(2,xt))("queryParams",t.kEZ(3,b,o.EAPICategory.CUSTOM_APIS,o.authCS.getUserId(),e._id))}}const Mt=function(i,s,e,o){return{get:i,put:s,post:e,delete:o}};function yt(i,s){if(1&i&&(t.TgZ(0,"tr",40),t.YNc(1,rt,2,2,"td",5),t.YNc(2,lt,3,1,"td",41),t.TgZ(3,"td")(4,"span",42),t._uU(5),t.qZA()(),t.TgZ(6,"td")(7,"span"),t._uU(8),t.qZA(),t.YNc(9,ct,2,0,"span",43),t.YNc(10,pt,2,0,"span",44),t.YNc(11,dt,2,0,"span",45),t.YNc(12,_t,2,0,"span",46),t.qZA(),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.YNc(15,vt,8,7,"td",5),t.YNc(16,U,2,1,"td",5),t.YNc(17,N,4,7,"td",5),t.qZA()),2&i){const e=s.$implicit,o=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",o.showCheckbox),t.xp6(1),t.Q6J("ngIf",!o.isDependentOnGroup&&!o.isLPM&&!o.isFilterLogTable),t.xp6(2),t.Q6J("ngClass",t.l5B(14,Mt,e.requestMethod===o.ERequestMethod.GET,e.requestMethod===o.ERequestMethod.PUT,e.requestMethod===o.ERequestMethod.POST,e.requestMethod===o.ERequestMethod.DELETE)),t.xp6(1),t.Oqu(e.requestMethod),t.xp6(3),t.Oqu(e.name),t.xp6(1),t.Q6J("ngIf",e.runOnNativeProcess),t.xp6(1),t.Q6J("ngIf",e.enableCaching),t.xp6(1),t.Q6J("ngIf",e.hasReqBodySchema),t.xp6(1),t.Q6J("ngIf",e.hasReqQueryParametersSchema),t.xp6(2),t.Oqu(e.path),t.xp6(1),t.Q6J("ngIf",!o.isDependentOnGroup&&!o.isLPM&&!o.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",o.isLPM),t.xp6(1),t.Q6J("ngIf",!o.isDependentOnGroup&&!o.isLPM&&!o.isFilterLogTable)}}function Pt(i,s){1&i&&t._UZ(0,"p-progressSpinner",63)}function a(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",29)(1,"p-table",30),t.NdJ("selectionChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.selectedRows=r)})("selectionChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.functionSelected(r))})("dblclick",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.dblClickCustomAPIsGrid(r))}),t.YNc(2,at,11,5,"ng-template",31),t.YNc(3,yt,18,19,"ng-template",32),t.qZA(),t.YNc(4,Pt,1,0,"p-progressSpinner",33),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",e.metaKeySelection)("selection",e.selectedRows)("dataKey",e.gridKey)("scrollable",!0)("value",e.rows),t.xp6(3),t.Q6J("ngIf",e.loading.grid)}}let c=(()=>{class i{functionS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;cd;router;http;confirmationService;showCheckbox=!0;isReadOnly=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:f.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=S.iH._id;EUserType=Z.d;BE_HOST_PORT=Zt.N.BE_HOST_PORT;EAPICategory=I.R;ERequestMethod=St.Yp;FunManFormC;cloneApiModalC;constructor(e,o,r,p,_,m,A,x,g,wt,Dt){this.functionS=e,this.generalS=o,this.notificationS=r,this.navigationCS=p,this.authCS=_,this.constantsS=m,this.eventCenterS=A,this.cd=x,this.router=g,this.http=wt,this.confirmationService=Dt}ngOnInit(){var e=this;this.eventCenterS.functions.selectedFunctions.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(o=>{this.FunManFormC.hideModal(),this.loadGridData()})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var o=(0,d.Z)(function*(r){r.length&&(yield e.loadGridData())});return function(r){return o.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(o=>{o&&this.loadGridData()})),this.isLPM&&this.subscriptions.push(this.eventCenterS.filterInLog.functionIds.subscribe((0,d.Z)(function*(){e.loadGridData()}))),this.generalS.setNewTitle("API Maker - Custom APIs")}navigateToTreeView(){var e=this;return(0,d.Z)(function*(){yield e.router.navigate(["api-info","custom-api","functions-tree"])})()}loadGridData(){var e=this;this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length?this.resetGridAndUrl():(this.loading.grid=!0,this.subscriptions.push(this.functionS.getFunctionsAsAPI().subscribe(function(){var o=(0,d.Z)(function*(r){r.success?(e.selectedRows=[],e.rows=r.data||[],e.rowsMap=h.keyBy(e.rows,S.iH._id),e.rowsMapName=h.keyBy(e.rows,S.eb.name)):e.resetGridAndUrl();const p=e.navigationCS.getQueryParam(C.p.custom_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.functionIds.value.join(","):e.eventCenterS.group.customApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0].queryParams.customApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.customApiNames.join(","):"");if(p){const _=p.split(","),m=h.intersection(h.keys(e.rowsMap),_),A=[];for(const g of m)e.rowsMap[g]&&A.push(e.rowsMap[g]);const x=[];for(const g of m)e.rowsMap[g]&&x.push(e.rowsMap[g]);e.selectedRows=x,e.eventCenterS.functions.selectedFunctions.next(A)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.customApiNames?.length){const _=e.eventCenterS.group.selectedGroups.value[0];for(const m of _?.queryParams?.customApiNames)e.rowsMapName[m]&&(e.rowsMapName[m].saveResponseInLog=_.functionsLog?.[m]?.saveResponseInLog||!1);e.setResDataInEventCenter()}if(e.isDependentOnGroup){e.selectedRows=[];for(const _ of e.eventCenterS.group.customApiIds.value)e.rowsMap[_]&&e.selectedRows.push(e.rowsMap[_])}if(e.isFilterLogTable){e.selectedRows=[];for(const _ of e.eventCenterS.filterInLog.functionIds.value)e.rowsMap[_]&&e.selectedRows.push(e.rowsMap[_])}e.loading.grid=!1,e.cd.detectChanges()});return function(r){return o.apply(this,arguments)}}())))}add(){this.data.formData=void 0,this.data.mode=f.D.ADD,this.data.eventChannel.emit({action:n.F.OPEN_FORM_IN_ADD_MODE}),this.FunManFormC.showModal()}view(){this.data.formData=this.rowsMap[this.getSelectedRowId()],this.data.mode=f.D.VIEW,this.data.eventChannel.emit({action:n.F.OPEN_FORM_IN_VIEW_MODE}),this.FunManFormC.showModal()}edit(){this.data.formData=this.rowsMap[this.getSelectedRowId()],this.data.mode=f.D.EDIT,this.data.eventChannel.emit({action:n.F.OPEN_FORM_IN_EDIT_MODE}),this.FunManFormC.showModal()}removePermanentDialog(){var o,e=this;this.confirmationService.confirm({message:this.constantsS.functions.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,d.Z)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})}removePermanent(){var e=this;return(0,d.Z)(function*(){if(e.getSelectedRowId()){e.loading.grid=!0;try{const o=`${e.getSelectedRowGuid()}:${e.authCS.gUser._id}`,r=yield e.functionS.permanentDelete(o).toPromise();r.success?(e.notificationS.showSuccess(e.constantsS.functions.removePermanent),e.resetGridAndUrl(),e.loadGridData()):e.notificationS.showErrorFromResponse(r,e.constantsS.functions.removePermanentError)}catch{e.notificationS.showError(e.constantsS.functions.removePermanentError)}e.loading.grid=!1}})()}resetDependents(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.functions.selectedFunctions.next([]),yield e.navigationCS.setQueryParam(C.p.custom_api,null)})()}functionSelected(e){var o=this;return(0,d.Z)(function*(){o.selectedRows=e,o.resetDependents().then();for(const r of o.rows)-1===o.selectedRows.indexOf(r)&&(r.saveResponseInLog=!1);o.fillData().then(),o.getSelectedRowId()?o.generalS.setNewTitle(o.rowsMap[o.getSelectedRowId()].name,I.R.CUSTOM_APIS):o.generalS.setNewTitle("API Maker - Custom APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.eventCenterS.functions.selectedFunctions.next([])}fillData(){var e=this;return(0,d.Z)(function*(){if(!e.selectedRows||Array.isArray(e.selectedRows)&&!e.selectedRows.length)return yield e.navigationCS.setQueryParam(C.p.custom_api,""),e.eventCenterS.group.customApis.next([]),e.eventCenterS.functions.selectedFunctions.next([]),e.eventCenterS.group.customApiIds.next([]),void e.eventCenterS.group.customApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable){const o=h.map(e.selectedRows,"_id");e.eventCenterS.group.customApiIds.next(o),e.eventCenterS.group.customApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.functionIds.next(o),e.eventCenterS.filterInLog.functions.next(e.selectedRows))}else{const o=e.getSelectedRowId(),r=(yield e.functionS.getById(o).toPromise()).data;r._id?(yield e.navigationCS.setQueryParam(C.p.custom_api,r._id),e.eventCenterS.functions.selectedFunctions.next([r])):e.resetDependents().then()}})()}getSelectedRowId(){return this.selectedRows[0]?._id}getSelectedRowGuid(){return this.selectedRows[0]?.guid}dblClickCustomAPIsGrid(e){setTimeout(()=>{this.edit()},10)}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.customApis.next(this.selectedRows),this.eventCenterS.group.selectedFunctions.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.functions.next(this.selectedRows)}saveResponseInLogCheckData(){this.setResDataInEventCenter()}clone(){var e=this;return(0,d.Z)(function*(){yield e.cloneApiModalC.showModal(e.getSelectedRowId(),null,function(){var o=(0,d.Z)(function*(r){r&&(yield e.loadGridData()),e.cd.detectChanges()});return function(r){return o.apply(this,arguments)}}())})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=F.k4;static \u0275fac=function(o){return new(o||i)(t.Y36(L.d),t.Y36(y.b),t.Y36(u.W),t.Y36(E.S),t.Y36(M.D),t.Y36(T.L),t.Y36(w.u),t.Y36(t.sBO),t.Y36(D.F0),t.Y36(Q.eN),t.Y36(O.YP))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-custom-api-grid"]],viewQuery:function(o,r){if(1&o&&(t.Gf(B,5),t.Gf(W,5)),2&o){let p;t.iGM(p=t.CRH())&&(r.FunManFormC=p.first),t.iGM(p=t.CRH())&&(r.cloneApiModalC=p.first)}},inputs:{showCheckbox:"showCheckbox",isReadOnly:["IsReadOnly","isReadOnly"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:17,vars:9,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/custom.svg","alt","Custom API",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Custom APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["funManFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],[1,"float-right","cursor-pointer","ml-3",3,"click"],["tooltipPosition","left","pTooltip","Tree View","tooltipPosition","left",1,"fas","fa-sitemap","text-yellow","fa-fw","fa-rotate-270"],["tooltipPosition","left","pTooltip","Add New","tooltipPosition","left",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"],["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"],["tooltipPosition","left","pTooltip","All Custom APIs",1,"float-right","cursor-pointer"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped custom-api-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: 80px;",4,"ngIf"],[2,"width","80px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["tooltipPosition","left","pTooltip","Running on native process","class","ml-2 grid-pill-custom-api text-danger border",4,"ngIf"],["tooltipPosition","left","pTooltip","Caching enabled","class","ml-2 grid-pill-custom-api text-warning border",4,"ngIf"],["tooltipPosition","left","pTooltip","It has request body schema","class","ml-2 grid-pill-custom-api text-muted border",4,"ngIf"],["tooltipPosition","left","pTooltip","It has request query parameters schema","class","ml-2 grid-pill-custom-api text-muted border",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["tooltipPosition","left","pTooltip","Running on native process",1,"ml-2","grid-pill-custom-api","text-danger","border"],["tooltipPosition","left","pTooltip","Caching enabled",1,"ml-2","grid-pill-custom-api","text-warning","border"],["tooltipPosition","left","pTooltip","It has request body schema",1,"ml-2","grid-pill-custom-api","text-muted","border"],["tooltipPosition","left","pTooltip","It has request query parameters schema",1,"ml-2","grid-pill-custom-api","text-muted","border"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:",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(o,r){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Custom APIs"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,z,8,3,"span",5),t.YNc(8,V,2,2,"span",6),t.YNc(9,X,2,2,"span",6),t.qZA(),t.TgZ(10,"div",7),t.YNc(11,tt,3,1,"div",5),t.YNc(12,a,5,7,"div",8),t.qZA()(),t._UZ(13,"app-w-fun-man-form",9,10)(15,"app-clone-api-modal",11,12)),2&o&&(t.xp6(7),t.Q6J("ngIf",!r.isReadOnly),t.xp6(1),t.Q6J("ngIf",r.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",r.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",r.eventCenterS.group.apisRegex.allCustomApis||r.eventCenterS.filterInLog.apisRegex.allCustomApis),t.xp6(1),t.Q6J("ngIf",!(r.eventCenterS.group.apisRegex.allCustomApis||r.eventCenterS.filterInLog.apisRegex.allCustomApis)),t.xp6(1),t.Q6J("data",r.data),t.xp6(2),t.Q6J("modalId","idCloneCustomAPIGrid")("hostAndPort",r.BE_HOST_PORT)("modelApiPaths",r.EModelApiPaths.CUSTOM_APIS))},dependencies:[D.rH,R.JJ,R.On,G.mk,G.O5,J.s,v.iA,O.jx,v.Ei,v.UA,v.Mo,Y.G,q.u,k.XZ,K.u],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return i})()},95765:(Et,P,l)=>{l.r(P),l.d(P,{FunctionManM:()=>Pt});var d=l(77664),t=l(96814),n=l(94946),f=l(85219);let F=(()=>{class a{static \u0275fac=function(s){return new(s||a)};static \u0275mod=n.oAB({type:a});static \u0275inj=n.cJS({imports:[t.ez,f.m8,f.m8]})}return a})();var Z=l(63726),L=l(17017),y=l(37595),u=l(15861),E=l(33157),M=l(90328),T=l(56212),w=l(45085),D=l(51162),Q=l(96925),O=l(20553),R=l(19394),G=l(60921),J=l(67629),v=l(77240),Y=l(99961),q=l(92189),k=l(95852),K=l(27414),B=l(32915),W=l(69862),H=l(87797),j=l(91396),$=l(97680),z=l(33259),V=l(21137);const X=["funManFormC"],tt=["cloneApiModalC"];function et(a,c){if(1&a){const i=n.EpF();n.TgZ(0,"span",21),n.NdJ("click",function(){n.CHM(i);const e=n.oxw();return n.KtG(e.edit())}),n._UZ(1,"i",22),n.qZA()}}function nt(a,c){if(1&a){const i=n.EpF();n.TgZ(0,"span",23),n.NdJ("click",function(){n.CHM(i);const e=n.oxw();return n.KtG(e.clone())}),n._UZ(1,"i",24),n.qZA()}}function it(a,c){if(1&a){const i=n.EpF();n.TgZ(0,"span",25),n.NdJ("click",function(){n.CHM(i);const e=n.oxw();return n.KtG(e.removePermanentDialog())}),n._UZ(1,"i",26),n.qZA()}}function ot(a,c){if(1&a&&(n.TgZ(0,"div"),n._uU(1),n.qZA()),2&a){const i=n.oxw().$implicit;n.xp6(1),n.Oqu(i.label)}}function st(a,c){1&a&&(n.TgZ(0,"span",42),n._uU(1,"Native"),n.qZA())}function at(a,c){1&a&&(n.TgZ(0,"span",43),n._uU(1,"Caching"),n.qZA())}function rt(a,c){1&a&&(n.TgZ(0,"span",44),n._uU(1,"B. Schema"),n.qZA())}function lt(a,c){1&a&&(n.TgZ(0,"span",45),n._uU(1,"Q. Schema"),n.qZA())}function ct(a,c){1&a&&(n.TgZ(0,"span",46),n._uU(1,"AM-User"),n.qZA())}function pt(a,c){1&a&&(n.TgZ(0,"span",47),n._uU(1,"No-Access"),n.qZA())}function dt(a,c){1&a&&(n.TgZ(0,"span",48),n._uU(1,"Public"),n.qZA())}function _t(a,c){1&a&&(n.TgZ(0,"span",47),n._uU(1,"DB-User"),n.qZA())}function ut(a,c){1&a&&(n.TgZ(0,"span",47),n._uU(1,"AWS"),n.qZA())}function mt(a,c){1&a&&(n.TgZ(0,"span",47),n._uU(1,"Azure"),n.qZA())}function ft(a,c){1&a&&(n.TgZ(0,"span",47),n._uU(1,"Google"),n.qZA())}const gt=function(a,c,i,s){return{get:a,put:c,post:i,delete:s}},ht=function(){return["/api-info/api-testing/testing"]},Ct=function(a,c,i){return{at_category:a,at_user:c,at_api:i}};function Tt(a,c){if(1&a&&(n.TgZ(0,"div")(1,"div")(2,"table",29)(3,"tr")(4,"td",30)(5,"span",31),n._uU(6),n.qZA(),n.TgZ(7,"span")(8,"span"),n._uU(9),n.qZA(),n.YNc(10,st,2,0,"span",32),n.YNc(11,at,2,0,"span",33),n.YNc(12,rt,2,0,"span",34),n.YNc(13,lt,2,0,"span",35),n.qZA()(),n.TgZ(14,"td",30),n._uU(15),n.qZA(),n.TgZ(16,"td"),n.YNc(17,ct,2,0,"span",36),n.YNc(18,pt,2,0,"span",37),n.YNc(19,dt,2,0,"span",38),n.YNc(20,_t,2,0,"span",37),n.YNc(21,ut,2,0,"span",37),n.YNc(22,mt,2,0,"span",37),n.YNc(23,ft,2,0,"span",37),n.qZA(),n.TgZ(24,"td",39)(25,"a",40),n.NdJ("click",function(s){return s.stopPropagation()}),n._UZ(26,"i",41),n.qZA()()()()()()),2&a){const i=n.oxw().$implicit,s=n.oxw();n.xp6(5),n.Q6J("ngClass",n.l5B(17,gt,i.data.requestMethod===s.ERequestMethod.GET,i.data.requestMethod===s.ERequestMethod.PUT,i.data.requestMethod===s.ERequestMethod.POST,i.data.requestMethod===s.ERequestMethod.DELETE)),n.xp6(1),n.Oqu(i.data.requestMethod),n.xp6(3),n.Oqu(i.data.name),n.xp6(1),n.Q6J("ngIf",i.data.runOnNativeProcess),n.xp6(1),n.Q6J("ngIf",i.data.enableCaching),n.xp6(1),n.Q6J("ngIf",i.data.hasReqBodySchema),n.xp6(1),n.Q6J("ngIf",i.data.hasReqQueryParametersSchema),n.xp6(2),n.Oqu(i.data.path),n.xp6(2),n.Q6J("ngIf",i.data.hasAmAuth),n.xp6(1),n.Q6J("ngIf",i.data.noAccess),n.xp6(1),n.Q6J("ngIf",i.data.isPublic),n.xp6(1),n.Q6J("ngIf",i.data.hasAmDBAuth),n.xp6(1),n.Q6J("ngIf",i.data.hasAwsAuth),n.xp6(1),n.Q6J("ngIf",i.data.hasAzureAuth),n.xp6(1),n.Q6J("ngIf",i.data.hasGoogleAuth),n.xp6(2),n.Q6J("routerLink",n.DdM(22,ht))("queryParams",n.kEZ(23,Ct,s.EAPICategory.CUSTOM_APIS,s.authCS.getUserId(),i.data._id))}}function vt(a,c){if(1&a&&(n.TgZ(0,"div",27),n.YNc(1,ot,2,1,"div",28),n.YNc(2,Tt,27,27,"div",28),n.qZA()),2&a){const i=c.$implicit;n.xp6(1),n.Q6J("ngIf",null==i.children?null:i.children.length),n.xp6(1),n.Q6J("ngIf",!(null!=i.children&&i.children.length))}}function At(a,c){1&a&&n._UZ(0,"p-progressSpinner",49)}let U=(()=>{class a{functionS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;cd;router;http;confirmationService;loading={grid:!1};subscriptions=[];data={mode:M.D.ADD,eventChannel:new n.vpe,formData:void 0};gridKey=D.iH._id;EUserType=G.d;BE_HOST_PORT=O.N.BE_HOST_PORT;EAPICategory=w.R;EQueryParam=T.p;leafSelected=!1;selectedRows=void 0;treeNodes=[];allTreeItemsMap={};FunManFormC;cloneApiModalC;constructor(i,s,e,o,r,p,_,m,A,x,g){this.functionS=i,this.generalS=s,this.notificationS=e,this.navigationCS=o,this.authCS=r,this.constantsS=p,this.eventCenterS=_,this.cd=m,this.router=A,this.http=x,this.confirmationService=g}ngOnInit(){this.loadTreeData(),this.subscriptions.push(this.data.eventChannel.subscribe(i=>{this.FunManFormC.hideModal(),this.loadTreeData()})),this.generalS.setNewTitle("API Maker - Custom APIs")}navigateToGridView(){var i=this;return(0,u.Z)(function*(){yield i.router.navigate(["api-info","custom-api","functions"])})()}loadTreeData(){var i=this;return(0,u.Z)(function*(){const s=(yield i.functionS.getCustomAPITree().toPromise()).data;for(const o of s)i.generalS.convertKTreeItemToPrimeNGTreeItem(o);const e={};i.generalS.getMapOfAllItems(e,s);for(const o of Object.keys(e)){const r=i.allTreeItemsMap[o];r&&(e[o].expanded=r.expanded)}i.treeNodes=s,i.allTreeItemsMap=e,i.loading.grid=!1,i.cd.detectChanges()})()}add(){this.data.formData=void 0,this.data.mode=M.D.ADD,this.data.eventChannel.emit({action:E.F.OPEN_FORM_IN_ADD_MODE}),this.FunManFormC.showModal()}edit(){this.leafSelected&&(this.data.formData=this.selectedRows[0].data,this.data.mode=M.D.EDIT,this.data.eventChannel.emit({action:E.F.OPEN_FORM_IN_EDIT_MODE}),this.FunManFormC.showModal())}removePermanentDialog(){var s,i=this;this.leafSelected&&this.confirmationService.confirm({message:this.constantsS.functions.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,u.Z)(function*(){yield i.removePermanent()}),function(){return s.apply(this,arguments)})})}removePermanent(){var i=this;return(0,u.Z)(function*(){if(i.getSelectedRowId()){i.loading.grid=!0;try{const s=`${i.getSelectedRowGuid()}:${i.authCS.gUser._id}`,e=yield i.functionS.permanentDelete(s).toPromise();e.success?(i.notificationS.showSuccess(i.constantsS.functions.removePermanent),i.resetGridAndUrl(),yield i.loadTreeData(),i.leafSelected=!1):i.notificationS.showErrorFromResponse(e,i.constantsS.functions.removePermanentError)}catch{i.notificationS.showError(i.constantsS.functions.removePermanentError)}i.loading.grid=!1}})()}resetDependents(){var i=this;return(0,u.Z)(function*(){yield i.navigationCS.setQueryParam(T.p.custom_api,null)})()}functionSelected(){var i=this;return(0,u.Z)(function*(){i.resetDependents(),i.fillData(),i.getSelectedRowId()?i.generalS.setNewTitle(i.selectedRows[0].data.name,w.R.CUSTOM_APIS):i.generalS.setNewTitle("API Maker - Custom APIs"),i.leafSelected=!(!i.getSelectedRowId()||i.selectedRows[0].children?.length)})()}resetGridAndUrl(){this.selectedRows=void 0}fillData(){var i=this;return(0,u.Z)(function*(){if(!i.selectedRows)return void(yield i.navigationCS.setQueryParam(T.p.custom_api,""));const s=i.getSelectedRowId();s?yield i.navigationCS.setQueryParam(T.p.custom_api,s):i.resetDependents()})()}getSelectedRowId(){return this.selectedRows?.[0]?.data?._id}getSelectedRowGuid(){return this.selectedRows?.[0]?.data?.guid}dblClickCustomAPIsGrid(){setTimeout(()=>{this.edit()},10)}clone(){var i=this;return(0,u.Z)(function*(){yield i.cloneApiModalC.showModal(i.getSelectedRowId(),null,function(){var s=(0,u.Z)(function*(e){e&&(yield i.loadTreeData()),i.cd.detectChanges()});return function(e){return s.apply(this,arguments)}}())})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=Q.Yp;EModelApiPaths=R.k4;static \u0275fac=function(s){return new(s||a)(n.Y36(J.d),n.Y36(v.b),n.Y36(Y.W),n.Y36(q.S),n.Y36(k.D),n.Y36(K.L),n.Y36(B.u),n.Y36(n.sBO),n.Y36(d.F0),n.Y36(W.eN),n.Y36(f.YP))};static \u0275cmp=n.Xpm({type:a,selectors:[["app-custom-api-tree"]],viewQuery:function(s,e){if(1&s&&(n.Gf(X,5),n.Gf(tt,5)),2&s){let o;n.iGM(o=n.CRH())&&(e.FunManFormC=o.first),n.iGM(o=n.CRH())&&(e.cloneApiModalC=o.first)}},decls:24,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/custom.svg","alt","Custom API",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["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"],[1,"h-100"],["scrollHeight","calc(100vh - 82px)","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["funManFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],["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-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[1,"w-100","prevent-text-selection","cursor-pointer"],[4,"ngIf"],[1,"w-100"],[2,"width","40%"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["tooltipPosition","left","pTooltip","Running on native process","class","ml-2 grid-pill-custom-api text-danger border",4,"ngIf"],["tooltipPosition","left","pTooltip","Caching enabled","class","ml-2 grid-pill-custom-api text-warning border",4,"ngIf"],["tooltipPosition","left","pTooltip","It has request body schema","class","ml-2 grid-pill-custom-api text-muted border",4,"ngIf"],["tooltipPosition","left","pTooltip","It has request query parameters schema","class","ml-2 grid-pill-custom-api text-muted border",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[2,"text-align","right"],["href","javascript:",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["tooltipPosition","left","pTooltip","Running on native process",1,"ml-2","grid-pill-custom-api","text-danger","border"],["tooltipPosition","left","pTooltip","Caching enabled",1,"ml-2","grid-pill-custom-api","text-warning","border"],["tooltipPosition","left","pTooltip","It has request body schema",1,"ml-2","grid-pill-custom-api","text-muted","border"],["tooltipPosition","left","pTooltip","It has request query parameters schema",1,"ml-2","grid-pill-custom-api","text-muted","border"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,e){1&s&&(n.TgZ(0,"div",0)(1,"div",1)(2,"span"),n._UZ(3,"img",2),n._uU(4," Custom APIs"),n.qZA(),n.TgZ(5,"a",3),n._UZ(6,"img",4),n.qZA(),n.TgZ(7,"span")(8,"span",5),n.NdJ("click",function(){return e.navigateToGridView()}),n._UZ(9,"i",6),n.qZA(),n.TgZ(10,"span",7),n.NdJ("click",function(){return e.add()}),n._UZ(11,"i",8),n.qZA(),n.YNc(12,et,2,0,"span",9),n.YNc(13,nt,2,0,"span",10),n.YNc(14,it,2,0,"span",11),n.qZA()(),n.TgZ(15,"div",12)(16,"div",13)(17,"p-tree",14),n.NdJ("selectionChange",function(r){return e.selectedRows=r})("dblclick",function(){return e.dblClickCustomAPIsGrid()})("selectionChange",function(){return e.functionSelected()}),n.YNc(18,vt,3,2,"ng-template",15),n.qZA(),n.YNc(19,At,1,0,"p-progressSpinner",16),n.qZA()()(),n._UZ(20,"app-w-fun-man-form",17,18)(22,"app-clone-api-modal",19,20)),2&s&&(n.xp6(12),n.Q6J("ngIf",e.leafSelected),n.xp6(1),n.Q6J("ngIf",e.leafSelected),n.xp6(1),n.Q6J("ngIf",e.leafSelected),n.xp6(3),n.Q6J("value",e.treeNodes)("selection",e.selectedRows),n.xp6(2),n.Q6J("ngIf",e.loading.grid),n.xp6(1),n.Q6J("data",e.data),n.xp6(2),n.Q6J("modalId","idCloneCustomAPITree")("hostAndPort",e.BE_HOST_PORT)("modelApiPaths",e.EModelApiPaths.CUSTOM_APIS))},dependencies:[d.rH,t.mk,t.O5,H.s,f.jx,j.mp,$.G,z.u,V.u],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return a})();var xt=l(67987);const Mt=[{path:"",redirectTo:"functions-tree",pathMatch:"full"},{path:"functions-tree",component:(()=>{class a{route;constructor(i){this.route=i}ngOnInit(){}static \u0275fac=function(s){return new(s||a)(n.Y36(d.gz))};static \u0275cmp=n.Xpm({type:a,selectors:[["app-fun-man-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(s,e){1&s&&(n.TgZ(0,"div",0),n._UZ(1,"app-custom-api-tree"),n.qZA())},dependencies:[U],encapsulation:2})}return a})(),canActivate:[Z.P]},{path:"functions",component:(()=>{class a{route;mode="tree";constructor(i){this.route=i}ngOnInit(){this.route.queryParams.subscribe(i=>{i.mode&&(this.mode=i.mode)})}static \u0275fac=function(s){return new(s||a)(n.Y36(d.gz))};static \u0275cmp=n.Xpm({type:a,selectors:[["app-fun-man-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(s,e){1&s&&(n.TgZ(0,"div",0),n._UZ(1,"app-custom-api-grid",1),n.qZA()),2&s&&(n.xp6(1),n.Q6J("showCheckbox",!1))},dependencies:[y.G],encapsulation:2})}return a})(),canActivate:[Z.P]}];let Pt=(()=>{class a{static \u0275fac=function(s){return new(s||a)};static \u0275mod=n.oAB({type:a});static \u0275inj=n.cJS({imports:[d.Bz.forChild(Mt),L.u,xt.X,F]})}return a})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6236],{34491:(C,u,s)=>{s.d(u,{g:()=>q});var m=s(15861),r=s(60095),c=s(33157),l=s(90328),E=s(59361),I=s(51162),p=s(20553),D=s(45085),g=s(91601),f=s(3531),h=s(39989),e=s(94946),v=s(99961),M=s(77240),O=s(27414),T=s(62694),A=s(95852),S=s(62304),U=s(53429),Z=s(32915),F=s(33835),z=s(96814),b=s(32660),R=s(5860),y=s(756),x=s(97680),P=s(14844),L=s(33259),B=s(25025);const W=["insertCodeModalC"],K=["monacoEditorModalC"];function N(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Process Initializer"),e.qZA())}function J(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Process Initializer"),e.qZA())}function Y(i,_){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Process Initializer "),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function w(i,_){1&i&&(e.TgZ(0,"span",39),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function V(i,_){if(1&i&&(e.TgZ(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",34),e._UZ(6,"input",35),e.YNc(7,w,2,0,"span",36),e.qZA()(),e.TgZ(8,"div",32)(9,"label",33),e._uU(10,"Order"),e.qZA(),e.TgZ(11,"div",34),e._UZ(12,"input",37),e.qZA()(),e.TgZ(13,"div",32)(14,"label",33),e._uU(15,"Timeout in minutes"),e.qZA(),e.TgZ(16,"div",34),e._UZ(17,"input",38),e.qZA()()()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.form),e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD)}}function Q(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"div",40)(1,"app-monaco-editor",41),e.NdJ("editorGenerated",function(t){e.CHM(o);const n=e.oxw();return e.KtG(n.editorGenerated(t))}),e.qZA()()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function G(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"a",42),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function k(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function j(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",44),e.YNc(2,H,2,0,"span",4),e.YNc(3,k,2,0,"span",4),e.qZA()}if(2&i){const o=e.oxw();e.Q6J("disabled",o.form.invalid),e.xp6(2),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT)}}function X(i,_){1&i&&e._UZ(0,"p-progressSpinner",45)}let q=(()=>{class i{fb;ns;generalS;constantsS;processInitializersS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=l.D;form;subscriptions=[];formData;IEventData=c.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptionsProcessInitializer={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(o,a,t,n,d,ee,oe,te,se,ae,ie,ne){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=n,this.processInitializersS=d,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=ne}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.Z)(function*(t){if(t)if(o.form.enable(),t.action===c.F.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const n=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,D.R.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",n.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.Z)(function*(){const a=yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}});o.form.reset(),o.form.patchValue(a),o.generalCS.setValueInEditor(o,"editorPI",a?.processInitializerCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[r.kI.required]],order:[null,[r.kI.required]],processInitializerTimeoutInMinutes:[null,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idProcessInitializerForm").modal("show")},100)}hideModal(){$("#idProcessInitializerForm").modal("hide")}save(){var o=this;return(0,m.Z)(function*(){const a=o.form.getRawValue();let t;t=o.data.formData&&o.data.formData._id?yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}}):{};const n=Object.assign({},t,a);n.user=o.authCS.getUserId(),n.processInitializerCode=o.editorPI.getValue();try{let d;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===l.D.ADD?d=yield o.processInitializersS.post(n).toPromise():o.data.mode===l.D.EDIT&&(d=yield o.processInitializersS.put(n._id,n,{select:I.iH._id}).toPromise()),o.ns.showSuccess(o.data.mode===l.D.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===l.D.ADD?c.F.SAVED:c.F.UPDATED,data:d}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(d){o.loading.form=!1,o.ns.showErrorFromResponse(d.error||d,"Unable to save process initializer."),o.lastError=d.error,o.tab=o.tab||{},o.tab.axiosResponse={data:d.error},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=E.H.All,this.insertCodeModalC.showModal(f.b.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.Z)(function*(){a.editorPI=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,t=>{a.form.valid&&a.save()}),a.monacoS.addInsertCodeKeyBinding(o,t=>{a.generalCS.messageReceivedFor=E.H.All,a.data.mode!==l.D.VIEW&&a.insertCodeModalC.showModal(f.b.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===h.g.TEXT_COPIED&&t.componentName===f.b.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),g.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(r.qu),e.Y36(v.W),e.Y36(M.b),e.Y36(O.L),e.Y36(T.e),e.Y36(A.D),e.Y36(S.b),e.Y36(U.E),e.Y36(Z.u),e.Y36(M.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.Gf(W,5),e.Gf(K,5)),2&a){let n;e.iGM(n=e.CRH())&&(t.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(t.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idProcessInitializerForm","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"],["href","https://docs.apimaker.dev/v1/docs/features/process-initializers.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"],["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"],["class","mt-1px small",4,"ngIf"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","processInitializerTimeoutInMinutes","name","processInitializerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","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,t){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,N,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,V,18,2,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,Q,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,G,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,j,4,3,"button",21),e.qZA(),e.YNc(27,X,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.sg,r.u,z.O5,b.y,R.P,y.O,x.G,P.xf,P.x4,L.u,B.A],encapsulation:2,changeDetection:0})}return i})()},56236:(C,u,s)=>{s.d(u,{e:()=>I});var m=s(17017),c=(s(34491),s(44950)),l=s(94946);let I=(()=>{class p{static \u0275fac=function(f){return new(f||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[m.u,c.A]})}return p})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6393],{66393:(ae,v,r)=>{r.r(v),r.d(v,{AdminUserM:()=>te});var b=r(77664),E=r(17017),e=r(94946),m=r(15861),c=r(33157),p=r(90328),f=r(56212),M=r(6990),u=r(60921),h=r(51162),U=r(33835),C=r(77240),A=r(99961),Z=r(85219),x=r(92189),y=r(90204),P=r(32915),S=r(96814),_=r(95431),D=r(97680),N=r(33259),o=r(60095),T=r(20553),O=r(95852),R=r(32660);function Y(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",22),e._uU(2," Add User"),e.qZA())}function k(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," View User"),e.qZA())}function J(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Edit User"),e.qZA())}function Q(n,l){1&n&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",25),e.qZA()())}function V(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function q(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function G(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",27),e.YNc(2,V,2,0,"span",4),e.YNc(3,q,2,0,"span",4),e.qZA()}if(2&n){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 W(n,l){1&n&&e._UZ(0,"p-progressSpinner",28)}let w=(()=>{class n{fb;ns;userS;generalS;constantsCS;authCS;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];constructor(t,s,a,i,d,g){this.fb=t,this.ns=s,this.userS=a,this.generalS=i,this.constantsCS=d,this.authCS=g}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,m.Z)(function*(a){if(a)if(t.form.enable(),a.action===c.F.OPEN_FORM_IN_EDIT_MODE){const i=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(i.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(a.action===c.F.OPEN_FORM_IN_VIEW_MODE){const i=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(i.data),t.form.disable()}else a.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([o.kI.required,o.kI.minLength(4),o.kI.maxLength(40)]),t.form.get("password").updateValueAndValidity())});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[o.kI.required]],email:[null,[o.kI.required,o.kI.email]],apiPath:[null,[o.kI.required,o.kI.minLength(3),o.kI.maxLength(25),o.kI.pattern("[a-z0-9]*")]],password:[null,[]]})}showModal(){$("#idAMUsersForm").modal("show")}hideModal(){$("#idAMUsersForm").modal("hide")}save(){var t=this;return(0,m.Z)(function*(){const s=t.form.getRawValue();s.user=t.authCS.getUserId(),s.userType=u.d.ADMIN;try{let a;t.loading.form=!0,t.data.mode===p.D.ADD?(s.password=t.generalS.getEncryptedString(s.password,T.N.crypto.passCommunication),a=yield t.userS.post(s).toPromise(),t.ns.showSuccess(t.constantsCS.user.addSuccess)):t.data.mode===p.D.EDIT&&(t.data.formData._id&&(s.userType=t.data.formData.userType,t.form.get("password").value?s.password=t.generalS.getEncryptedString(s.password,T.N.crypto.passCommunication):delete s.password),a=yield t.userS.put(t.data.formData._id,s,{select:h.iH._id}).toPromise(),t.ns.showSuccess(t.constantsCS.user.editSuccess)),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save user info.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(o.qu),e.Y36(A.W),e.Y36(U.K),e.Y36(C.b),e.Y36(y.s),e.Y36(O.D))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-w-admin-user-form"]],inputs:{data:"data"},decls:34,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[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"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","email","name","email","spellcheck","false","type","text","placeholder","Please provide email",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide api path",1,"form-control","text-lowercase","form-control-sm"],[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"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["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(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Y,3,0,"span",4),e.YNc(5,k,3,0,"span",4),e.YNc(6,J,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,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Email"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,Q,5,0,"div",15),e.TgZ(23,"div",10)(24,"label",11),e._uU(25,"API Path"),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",16),e.qZA()()()(),e.TgZ(28,"div",17)(29,"button",18),e._UZ(30,"i",19),e._uU(31," Close"),e.qZA(),e.YNc(32,G,4,3,"button",20),e.qZA(),e.YNc(33,W,1,0,"p-progressSpinner",21),e.qZA()()()),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",a.form),e.xp6(11),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(10),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form))},dependencies:[o._Y,o.Fj,o.JJ,o.JL,o.sg,o.u,S.O5,R.y,D.G],encapsulation:2})}return n})();const K=["adminUserFormC"];function H(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"span",14),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.edit())}),e._UZ(1,"i",15),e.qZA()}}function L(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"span",16),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",17),e.qZA()}}function B(n,l){1&n&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Email"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"API Path"),e.qZA()())}function j(n,l){if(1&n&&(e.TgZ(0,"tr",18)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA()()),2&n){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.email),e.xp6(2),e.Oqu(t.apiPath)}}function X(n,l){1&n&&e._UZ(0,"p-progressSpinner",19)}let I=(()=>{class n{userS;generalS;notificationS;confirmationService;navigationCS;constantsCS;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=h.iH._id;adminUserFormC;constructor(t,s,a,i,d,g,se){this.userS=t,this.generalS=s,this.notificationS=a,this.confirmationService=i,this.navigationCS=d,this.constantsCS=g,this.eventCenterS=se}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.adminUserFormC.hideModal(),this.loadGridData())}))}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{active:!0,userType:{$in:[u.d.ROOT,u.d.ADMIN]}},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.userS.query(s).subscribe(function(){var a=(0,m.Z)(function*(i){i.success&&(t.selectedRows=[],t.rows=i.data,t.rowsMap=M.keyBy(t.rows,h.iH._id));const d=t.navigationCS.getQueryParam(f.p.user);t.rowsMap[d]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[d]]),t.selectedRows=[t.rowsMap[d]],yield t.fillData()),t.loading.grid=!1});return function(i){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.adminUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=p.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.adminUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.adminUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,m.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,m.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,m.Z)(function*(){t.loading.grid=!0;const s=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,m.Z)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(f.p.user,null)})()}adminUserSelected(t){var s=this;return(0,m.Z)(function*(){s.selectedRows=t,s.resetDependents(),s.fillData()})()}fillData(){var t=this;return(0,m.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.user,""),void t.eventCenterS.user.selectedUsers.next([]);const s=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?(yield t.navigationCS.setQueryParam(f.p.user,s._id),t.eventCenterS.user.selectedUsers.next([s])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(U.K),e.Y36(C.b),e.Y36(A.W),e.Y36(Z.YP),e.Y36(x.S),e.Y36(y.s),e.Y36(P.u))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-w-admin-users"]],viewQuery:function(s,a){if(1&s&&e.Gf(K,5),2&s){let i;e.iGM(i=e.CRH())&&(a.adminUserFormC=i.first)}},decls:16,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-users","text-info","fa-fw","mr-1"],["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","Make Inactive",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 94px)",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"],["adminUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Make Inactive",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Users"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return a.add()}),e._UZ(6,"i",4),e.qZA(),e.YNc(7,H,2,0,"span",5),e.YNc(8,L,2,0,"span",6),e.qZA(),e.TgZ(9,"div",7)(10,"p-table",8),e.NdJ("selectionChange",function(d){return a.selectedRows=d})("dblclick",function(){return a.dblClickUsers()})("selectionChange",function(d){return a.adminUserSelected(d)}),e.YNc(11,B,7,0,"ng-template",9),e.YNc(12,j,7,4,"ng-template",10),e.qZA(),e.YNc(13,X,1,0,"p-progressSpinner",11),e.qZA()(),e._UZ(14,"app-w-admin-user-form",12,13)),2&s&&(e.xp6(7),e.Q6J("ngIf",a.selectedRows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.xp6(3),e.Q6J("ngIf",a.loading.grid),e.xp6(1),e.Q6J("data",a.data))},dependencies:[S.O5,_.iA,Z.jx,_.Ei,D.G,N.u,w],encapsulation:2})}return n})();const ee=[{path:"",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=e.Xpm({type:n,selectors:[["app-admin-user-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"],[1,"w-100"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0),e._UZ(1,"app-w-admin-users",1),e.qZA())},dependencies:[I],encapsulation:2})}return n})(),canActivate:[r(81490).g]}];let te=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[b.Bz.forChild(ee),E.u]})}return n})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6401],{36401:($e,F,i)=>{i.r(F),i.d(F,{GroupM:()=>Ve});var q=i(77664),B=i(17017),K=i(63726),L=i(81025),Z=i(45085),e=i(94946),I=i(32915),w=i(85219),H=i(55043),V=i(63885),j=i(559),z=i(86937),X=i(80740),ee=i(37595),te=i(79329),ne=i(40356),se=i(53824),ae=i(58651),oe=i(72726),d=i(15861),C=i(33157),y=i(90328),g=i(56212),c=i(6990),m=i(51162),R=i(78883),D=i(53429),ie=i(67629),re=i(12559),le=i(10262),A=i(77240),E=i(99961),O=i(92189),N=i(95852),P=i(27414),pe=i(13065),M=i(96814),U=i(95431),T=i(97680),J=i(33259),h=i(60095),ce=i(32660);function de(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",19),e._uU(2," Add Group"),e.qZA())}function ue(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",20),e._uU(2," View Group"),e.qZA())}function ge(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e._uU(2," Edit Group"),e.qZA())}function me(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save Group"),e.qZA())}function he(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update Group"),e.qZA())}function fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",23),e.YNc(2,me,2,0,"span",4),e.YNc(3,he,2,0,"span",4),e.qZA()}if(2&o){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 ve(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}let k=(()=>{class o{fb;ns;groupS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=y.D;form;subscriptions=[];constructor(t,s,n,a,r,u){this.fb=t,this.ns=s,this.groupS=n,this.generalS=a,this.authCS=r,this.constantsS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,d.Z)(function*(n){if(n)if(t.form.enable(),n.action===C.F.OPEN_FORM_IN_EDIT_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data)}else if(n.action===C.F.OPEN_FORM_IN_VIEW_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.form.disable()}else n.action===C.F.OPEN_FORM_IN_ADD_MODE&&t.form.reset()});return function(n){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[h.kI.required]]})}showModal(){$("#idGroupsForm").modal("show")}hideModal(){$("#idGroupsForm").modal("hide")}save(){var t=this;return(0,d.Z)(function*(){const s=t.form.getRawValue();let n;n=t.data.formData&&t.data.formData._id?(yield t.groupS.getById(t.data.formData._id).toPromise()).data:{};const a=Object.assign({},n,s);a.user=t.authCS.getUserId();try{let r;t.loading.form=!0,t.data.mode===y.D.ADD?r=yield t.groupS.post(a).toPromise():t.data.mode===y.D.EDIT&&(r=yield t.groupS.put(t.data.formData._id,a,{select:m.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===y.D.ADD?t.constantsS.group.addSuccess:t.constantsS.group.editSuccess),t.data.eventChannel.emit({action:t.data.mode===y.D.ADD?C.F.SAVED:C.F.UPDATED}),t.loading.form=!1}catch(r){t.loading.form=!1,t.ns.showErrorFromResponse(r.error||r,"Unable to save group.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.Y36(h.qu),e.Y36(E.W),e.Y36(R.e),e.Y36(A.b),e.Y36(N.D),e.Y36(P.L))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idGroupsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[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"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[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(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,de,3,0,"span",4),e.YNc(5,ue,3,0,"span",4),e.YNc(6,ge,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,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()()()(),e.TgZ(17,"div",14)(18,"button",15),e._UZ(19,"i",16),e._uU(20," Close"),e.qZA(),e.YNc(21,fe,4,3,"button",17),e.qZA(),e.YNc(22,ve,1,0,"p-progressSpinner",18),e.qZA()()()),2&s&&(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(10),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[h._Y,h.Fj,h.JJ,h.JL,h.sg,h.u,M.O5,ce.y,T.G],encapsulation:2})}return o})();const Ce=["groupsFormC"];function Se(o,l){if(1&o){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 ye(o,l){if(1&o){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 _e(o,l){if(1&o){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 be(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24),e.qZA())}function Ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.saveGroupPermissions(n,a))}),e.qZA()}}function we(o,l){if(1&o&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ie,1,0,"i",26),e.qZA()()),2&o){const t=l.$implicit,s=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",s.selectedRows.indexOf(t)>-1)}}function Ae(o,l){1&o&&e._UZ(0,"p-progressSpinner",28)}let Y=(()=>{class o{groupS;instanceS;functionS;tpInstalledApisS;webSocketEventsS;generalS;notificationS;navigationCS;authCS;constantsS;apiS;eventCenterS;confirmationService;loading={grid:!1};subscriptions=[];data={mode:y.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=m.iH._id;groupsFormC;constructor(t,s,n,a,r,u,_,p,f,S,v,b,x){this.groupS=t,this.instanceS=s,this.functionS=n,this.tpInstalledApisS=a,this.webSocketEventsS=r,this.generalS=u,this.notificationS=_,this.navigationCS=p,this.authCS=f,this.constantsS=S,this.apiS=v,this.eventCenterS=b,this.confirmationService=x}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.groupsFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Groups")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.groupS.query(s).subscribe(function(){var n=(0,d.Z)(function*(a){a.success&&(t.selectedRows=[],t.rows=a.data,t.rowsMap=c.keyBy(t.rows,m.iH._id));const r=t.navigationCS.getQueryParam(g.p.group);t.rowsMap[r]&&(t.selectedRows.length=0,t.selectedRows.push(t.rowsMap[r]),yield t.fillData()),t.generalS.setNewTitle("API Maker - Groups"),t.loading.grid=!1});return function(a){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=y.D.ADD,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_ADD_MODE}),this.groupsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.VIEW,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_VIEW_MODE}),this.groupsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.EDIT,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_EDIT_MODE}),this.groupsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0])return;const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,delete s.guid,delete s.queryParamsMap,s.name=`${s.name}-clone`,(yield t.groupS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.group.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.group.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.group.cloneError)}})()}removePermanentDialog(){var t=this;return(0,d.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.group.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,d.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const s=yield t.groupS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.group.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.group.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([g.p.group,g.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.fields.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.systemApiIds.next([]),t.eventCenterS.group.webSocketIds.next([]),t.eventCenterS.group.apisRegex={}})()}groupSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return void(yield t.resetDependents());const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;s&&s.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(s.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(s.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(s.queryParams.supportedApiNames||[]),t.eventCenterS.group.fields.next(s.queryParams.fields||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(s.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.thirdPartyApiNames,t.tpInstalledApisS,Z.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(s.queryParams.webSocketEventNames))),s&&(t.eventCenterS.group.selectedGroups.next([s]),t.eventCenterS.group.apisRegex=s.apisRegex,yield t.navigationCS.setQueryParam(g.p.group,t.selectedRows[0]._id)),s?.queryParams||t.resetDependents()})()}saveGroupPermissions(t,s){var n=this;return(0,d.Z)(function*(){t.stopImmediatePropagation();const a=JSON.parse(JSON.stringify(s));a.fields=n.getPermissionMap(n.eventCenterS.group.schemaFields.value,["path","allowRead","allowWrite"]),a.apisRegex=n.eventCenterS.group.apisRegex,a.queryParams={},a.user=n.authCS.getUserId(),a.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),a.queryParams.databaseNames=c.uniq(n.eventCenterS.group.databaseNames.value),a.queryParams.collectionNames=c.uniq(n.eventCenterS.group.collectionNames.value),a.queryParams.supportedApiNames=c.uniq(n.eventCenterS.group.supportedApiIds.value),a.queryParams.fields=c.uniq(n.eventCenterS.group.fields.value),a.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),a.queryParams.systemApiNames=c.uniq(n.eventCenterS.group.systemApiIds.value),a.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,Z.R.THIRD_PARTY_APIS),a.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);const r=yield n.groupS.put(a._id,a,{select:m.iH._id}).toPromise();r&&r.success&&n.notificationS.showSuccess(n.constantsS.group.editSuccess)})()}getPermissionMap(t,s){const n=s.slice(1),a=c.groupBy(t,m.W$.instanceName);for(const r in a){const u=a[r]=c.groupBy(a[r],m.W$.databaseName);for(const _ in u){const p=u[_]=c.groupBy(u[_],m.W$.collectionName);for(const f in p)if(1===s.length){const S={};for(const v of p[f])S[v[s[0]]]=!0;p[f]=S}else{const S={};for(const v of p[f])S[v[s[0]]]=c.pick(v,n);p[f]=S}}}return a}getPermissionMapThirdPartyAPIs(t){const s=c.groupBy(t,m.W$.apiBundleName);for(const n in s){if("undefined"===n){delete s[n];continue}const a=s[n]=c.groupBy(s[n],m.W$.apiVersionName);for(const r in a){if("undefined"===r){delete a[r];continue}const u=a[r]=c.groupBy(a[r],m.W$.apiName);for(const _ in u)"undefined"!==_?u[_]=!0:delete u[_]}}return s}getPermissionMapFunctionsAndWSEventAndSysApis(t){const s={};for(const n of t||[])s[n._id]=!0;return s}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickGroups(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||o)(e.Y36(R.e),e.Y36(D.E),e.Y36(ie.d),e.Y36(re.d),e.Y36(le.a),e.Y36(A.b),e.Y36(E.W),e.Y36(O.S),e.Y36(N.D),e.Y36(P.L),e.Y36(pe.k),e.Y36(I.u),e.Y36(w.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups"]],viewQuery:function(s,n){if(1&s&&e.Gf(Ce,5),2&s){let a;e.iGM(a=e.CRH())&&(n.groupsFormC=a.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.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"],["groupsFormC",""],["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-save text-success fa-fw cursor-pointer","pTooltip","Save group settings",3,"click",4,"ngIf"],["pTooltip","Save group settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),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,Se,2,0,"span",8),e.YNc(11,ye,2,0,"span",9),e.YNc(12,_e,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(r){return n.selectedRows=r})("selectionChange",function(){return n.groupSelected()})("dblclick",function(){return n.dblClickGroups()}),e.YNc(15,be,4,0,"ng-template",13),e.YNc(16,we,5,3,"ng-template",14),e.qZA(),e.YNc(17,Ae,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-groups-form",16,17)),2&s&&(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:[M.O5,U.iA,w.jx,U.Ei,T.G,J.u,k]})}return o})();var Me=i(83620),Te=i(91396),Ze=i(38057);function De(o,l){if(1&o&&(e.TgZ(0,"div")(1,"div",9),e._uU(2),e.qZA()()),2&o){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allFieldsPermitted)}}function Ne(o,l){if(1&o&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" [",t.instanceName.substr(0,3).toUpperCase(),"] [",t.databaseName.substr(0,3).toUpperCase(),"] ")}}function Pe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18)(1,"label",19)(2,"p-checkbox",20),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowRead=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()(),e.TgZ(3,"label",21)(4,"p-checkbox",22),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowWrite=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.Q6J("ngModel",t.allowRead)("binary",!0),e.xp6(2),e.Q6J("ngModel",t.allowWrite)("binary",!0)}}function xe(o,l){if(1&o&&(e.TgZ(0,"div",14),e._uU(1),e.YNc(2,Ne,2,2,"span",15),e.YNc(3,Pe,5,4,"span",16),e.qZA()),2&o){const t=l.$implicit,s=e.oxw(2);e.xp6(1),e.hij(" ",t.label||t.name," "),e.xp6(1),e.Q6J("ngIf",t.level1),e.xp6(1),e.Q6J("ngIf",!t.level1&&(!t.children||0===t.children.length)&&s.selectedRows.indexOf(t)>=0)}}function Ge(o,l){1&o&&e._UZ(0,"p-progressSpinner",23)}function Fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",10)(1,"p-tree",11),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRows=n)})("selectionChange",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.checkedChange())})("onNodeSelect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeSelected(n))})("onNodeUnselect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeUnSelected(n))}),e.YNc(2,xe,4,3,"ng-template",12),e.qZA(),e.YNc(3,Ge,1,0,"p-progressSpinner",13),e.qZA()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("value",t.propertiesListData)("selection",t.selectedRows)("metaKeySelection",!1),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}let Q=(()=>{class o{instanceS;eventCenterS;constantsS;generalS;loading={grid:!1};subscriptions=[];propertiesListData=[];allTreeItemsMap={};selectedRows=[];checkedKeysMap={};key="_id";constructor(t,s,n,a){this.instanceS=t,this.eventCenterS=s,this.constantsS=n,this.generalS=a}ngOnInit(){var t=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,Me.b)(300)).subscribe(function(){var s=(0,d.Z)(function*(n){yield t.loadSchemas()});return function(n){return s.apply(this,arguments)}}()))}loadSchemas(){var t=this;return(0,d.Z)(function*(){const s=t.eventCenterS.collection.selectedCollections.value;if(!s.length)return void(yield t.resetGridAndUrl());t.loading.grid=!0;const n=t.eventCenterS.group.selectedGroups.value[0];yield t.resetGridAndUrl(),t.allTreeItemsMap={};const a=(yield t.instanceS.getSchemas(s).toPromise()).data,r=[],u=[];for(const p of a){const f=[];if(p.propertyItems){const b=[];for(const x of p.propertyItems){const G=t.generalS.convertKTreeItemToPrimeNGTreeItem(x);t.setReadWriteRecursively(n,G),b.push(G),f.push(G)}u.push(b)}const S=p.instanceName+":"+p.databaseName+":"+p.collectionName,v={label:`${p.collectionName}`,children:f,_id:S,level1:!0,instanceName:p.instanceName,databaseName:p.databaseName,collectionName:p.collectionName};r.push(v),t.allTreeItemsMap[S]=v;for(const b of v?.children||[])b.parent=v}t.propertiesListData=r;for(const p of u)t.generateIdMap(p,t.allTreeItemsMap);if(t.eventCenterS.group.fields.value.join(",")){const p=c.intersection(c.keys(t.allTreeItemsMap),t.eventCenterS.group.fields.value);t.selectedRows=[];for(const f of p)t.allTreeItemsMap[f]&&t.selectedRows.push(t.allTreeItemsMap[f]);t.generalS.setDataInSelectedRowsFromIdArr(p,t.selectedRows,t.allTreeItemsMap),t.setDataInEventCenter()}t.loading.grid=!1})()}setReadWriteRecursively(t,s){const n=t?.fields?.[s.instanceName]?.[s.databaseName]?.[s.collectionName];if(!n)return;const a=n[s.path];if(a?(s.allowRead=a.allowRead,s.allowWrite=a.allowWrite):s.allowRead=s.allowWrite=!1,s.children&&s.children.length)for(const r of s.children)this.setReadWriteRecursively(t,r)}resetGridAndUrl(){var t=this;return(0,d.Z)(function*(){t.propertiesListData=[],t.allTreeItemsMap={},t.selectedRows=[],t.checkedKeysMap={},t.eventCenterS.group.schemaFields.next([])})()}checkedChange(){this.setDataInEventCenter()}nodeSelected(t){t.node.allowRead=!0}nodeUnSelected(t){const s=t.node;s.allowRead=!1,s.allowWrite=!1}removeDataItemFromSelectedRows(t){if(!t.allowRead&&!t.allowWrite){const s=this.selectedRows.indexOf(t);s>=0&&this.selectedRows.splice(s,1)}}calculateCheckedKeysMap(){this.checkedKeysMap={};for(const t of this.selectedRows)this.checkedKeysMap[t._id]=t}setDataInEventCenter(){this.calculateCheckedKeysMap(),this.eventCenterS.group.fields.next(c.map(this.selectedRows,"_id"));const t=[];for(const s of this.selectedRows)this.allTreeItemsMap[s._id]&&t.push(s);this.eventCenterS.group.schemaFields.next(t)}generateIdMap(t,s){if(Array.isArray(t))for(const n of t)this.generateIdMap(n,s);else s[t._id]=t,t.children&&this.generateIdMap(t.children,s)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.Y36(D.E),e.Y36(I.u),e.Y36(P.L),e.Y36(A.b))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-schema-fields"]],decls:11,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-indent","text-success","fa-fw","mr-1"],["pTooltip","All Fields",1,"float-right","cursor-pointer"],[3,"ngModel","binary","ngModelChange"],[1,"card-body","p-0","h-100","overflow-hidden"],[1,"position-relative","border-top","h-100"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["scrollHeight","flex","selectionMode","checkbox",1,"w-full",3,"value","selection","metaKeySelection","selectionChange","onNodeSelect","onNodeUnselect"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"w-100","prevent-text-selection","cursor-pointer"],["class","text-monospace font-weight-bold font-italic float-right mr-1","style","font-size: xx-small;",4,"ngIf"],["class","float-right small mr-2",4,"ngIf"],[1,"text-monospace","font-weight-bold","font-italic","float-right","mr-1",2,"font-size","xx-small"],[1,"float-right","small","mr-2"],[1,"align-middle","mb-0","mr-2"],["label","R",3,"ngModel","binary","ngModelChange","click"],[1,"align-middle","mb-0"],["label","W",3,"ngModel","binary","ngModelChange","click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Schema Fields"),e.qZA(),e.TgZ(5,"span",3)(6,"p-checkbox",4),e.NdJ("ngModelChange",function(r){return n.eventCenterS.group.apisRegex.allFields=r}),e.qZA()()(),e.TgZ(7,"div",5)(8,"div",6),e.YNc(9,De,3,1,"div",7),e.YNc(10,Fe,4,4,"div",8),e.qZA()()()),2&s&&(e.xp6(6),e.Q6J("ngModel",n.eventCenterS.group.apisRegex.allFields)("binary",!0),e.xp6(3),e.Q6J("ngIf",n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields),e.xp6(1),e.Q6J("ngIf",!(n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields)))},dependencies:[h.JJ,h.On,M.O5,w.jx,Te.mp,T.G,J.u,Ze.XZ],encapsulation:2})}return o})();function Re(o,l){1&o&&(e.TgZ(0,"div",21),e._UZ(1,"app-w-instances",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function Ee(o,l){1&o&&(e.TgZ(0,"div",22),e._UZ(1,"app-w-databases",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const Oe=function(){return[50,50]};let W=(()=>{class o{eventCenterS;EAPICategory=Z.R;constructor(t){this.eventCenterS=t}ngOnInit(){}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}static \u0275fac=function(s){return new(s||o)(e.Y36(I.u))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-group-layout"]],decls:34,vars:42,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-groups"],[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-schema-fields"],[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-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e._UZ(4,"app-w-groups"),e.qZA()(),e.TgZ(5,"div",4)(6,"div",3),e._UZ(7,"app-w-api-categories",5),e.qZA()(),e.TgZ(8,"div",6)(9,"p-splitter",7),e.YNc(10,Re,2,3,"ng-template",8),e.YNc(11,Ee,2,3,"ng-template",8),e.qZA()(),e.TgZ(12,"div",9)(13,"div",3),e._UZ(14,"app-w-collections",10),e.qZA()(),e.TgZ(15,"div",11)(16,"div",3),e._UZ(17,"app-w-supported-api",12),e.qZA()(),e.TgZ(18,"div",13)(19,"div",3),e._UZ(20,"app-w-schema-fields"),e.qZA()(),e.TgZ(21,"div",14)(22,"div",3),e._UZ(23,"app-w-supported-tp-api",15),e.qZA()(),e.TgZ(24,"div",16)(25,"div",3),e._UZ(26,"app-custom-api-grid",17),e.qZA()(),e.TgZ(27,"div",18)(28,"div",3),e._UZ(29,"app-system-api-w",17),e.qZA()(),e.TgZ(30,"div",19)(31,"div",3),e._UZ(32,"app-web-socket-events-grid",20),e.qZA()()()(),e._UZ(33,"app-create-schema-form")),2&s&&(e.xp6(5),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","GROUP"),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(41,Oe)),e.xp6(3),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!1)("isDependentOnGroup",!0)("treeViewId","treeViewFromGroupLayout"),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.xp6(3),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!1))},dependencies:[w.jx,H.q,V.f,j.O,z.n,X.c,ee.G,te.X,ne.T,se.d,ae.A,oe.x,Y,Q],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-groups[_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%], .w-schema-fields[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return o})();i(53965);var Ye=i(1678),Qe=i(95765),We=i(64211),qe=i(84186),Be=i(2777),Ke=i(57705),Le=i(21434);const He=[{path:"group-layout",component:W,canActivate:[K.P]}];let Ve=(()=>{class o{static \u0275fac=function(s){return new(s||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[q.Bz.forChild(He),B.u,Ye.DashboardM,We.DbCellM,Qe.FunctionManM,qe.SystemApiM,Le.B,Be.u,Ke.L,L.WebSocketEventsM]})}return o})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6925,8374,8682,1617],{96925:(l,o,c)=>{c.d(o,{Eg:()=>_,Yp:()=>a,ZF:()=>i,vT:()=>t});var t=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(t||{}),a=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(a||{}),_=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_CODE_EXEC_ID="x-am-code-exec-id",n.AM_STORE_TOKEN="x-am-store-token",n.AM_WS_Client_ID="x-am-ws-client-id",n.RUN_IN_DEBUGGER="x-am-run-in-debugger",n.TENANT_USERNAME="x-am-tenant-username",n.TENANT_SECRET_PATH="x-am-tenant-secret-path",n}(_||{}),i=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(i||{})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7368],{67368:(xe,S,s)=>{s.r(S),s.d(S,{SandboxSettingsM:()=>fe});var O=s(77664),D=s(63726),y=s(17017),M=s(75249),r=s(15861),e=s(94946),u=s(6990),v=s(33157),c=s(90328),k=s(51162),h=s(20553),I=s(54371),x=s(95852),b=s(33835),w=s(25405),Z=s(99961),p=s(85219),T=s(27414),U=s(62304),N=s(24977),P=s(53429),E=s(81344),J=s(77240),g=s(60095),_=s(96814),R=s(38147),G=s(91861),q=s(756),f=s(95431),K=s(97680),C=s(14844),A=s(33259),Y=s(32660);function F(a,l){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th",28),e._uU(4,"Action"),e.qZA()())}function H(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",31)(1,"button",32),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw();return e.KtG(d.editAllowedOrigin(n,o))}),e._UZ(2,"i",33),e.qZA(),e.TgZ(3,"button",34),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw();return e.KtG(d.removeAllowedOrigin(n,o))}),e._UZ(4,"i",35),e.qZA()()}}function L(a,l){if(1&a&&(e.TgZ(0,"tr",29)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,H,5,0,"div",30),e.qZA()()),2&a){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function Q(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",37),e.TgZ(2,"span"),e._uU(3,"Save"),e.qZA()()}}let V=(()=>{class a{authCS;userS;eventCenterCS;notificationS;cs;confirmationService;modalId="idAllowedOriginModal";subscriptions=[];allowedOriginsGridData=[];saveSettings=new e.vpe;gridKeyAllowedOrigins="name";allowedOriginModel={domainName:"",domainNameBak:""};exampleOrigin=location.origin;allowedOriginData={mode:c.D.ADD};EFormMode=c.D;selectedRowsUI=[];constructor(t,i,n,o,d,m){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=o,this.cs=d,this.confirmationService=m}ngOnInit(){}save(){var t=this;return(0,r.Z)(function*(){if(t.allowedOriginData.mode===c.D.ADD)t.allowedOriginsGridData.push({name:t.allowedOriginModel.domainName});else{const i=t.allowedOriginsGridData.findIndex(n=>n.name===t.allowedOriginModel.domainNameBak);t.allowedOriginsGridData[i].name=t.allowedOriginModel.domainName}t.allowedOriginsGridData=u.uniqBy(t.allowedOriginsGridData,"name"),t.saveSettings.emit(),t.hideAllowedOriginModal()})()}showAllowedOriginModal(){$("#idAllowedOriginModal").modal("show")}hideAllowedOriginModal(){$("#idAllowedOriginModal").modal("hide")}addAllowedOrigin(){var t=this;return(0,r.Z)(function*(){t.allowedOriginModel.domainNameBak=t.allowedOriginModel.domainName="",t.allowedOriginData.mode=c.D.ADD,t.showAllowedOriginModal()})()}editAllowedOrigin(t,i){var n=this;return(0,r.Z)(function*(){n.allowedOriginModel.domainNameBak=n.allowedOriginModel.domainName=i.name,n.allowedOriginData.mode=c.D.EDIT,n.showAllowedOriginModal()})()}doubleClick(){this.editAllowedOrigin(null,this.selectedRowsUI[0]).then()}removeAllowedOrigin(t,i){var n=this;return(0,r.Z)(function*(){var o;n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentAllowedOriginConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.Z)(function*(){yield n.removeAO(t,i)}),function(){return o.apply(this,arguments)})})})()}removeAO(t,i){var n=this;return(0,r.Z)(function*(){const o=n.allowedOriginsGridData.findIndex(d=>d.name===i.name);n.allowedOriginsGridData.splice(o,1),n.saveSettings.emit()})()}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||a)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(T.L),e.Y36(p.YP))};static \u0275cmp=e.Xpm({type:a,selectors:[["allowed-origin-c"]],inputs:{allowedOriginsGridData:["allowedOrigins","allowedOriginsGridData"]},outputs:{saveSettings:"saveSettings"},decls:37,vars:10,consts:[[1,"card","shadow-sm","mt-2","mr-1","mb-5",2,"height","384px"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],["pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-0","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","350px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["aria-hidden","true","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",3,"id"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body"],[1,"form-group","row","mt-3","mb-0"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","name","spellcheck","false","type","text","placeholder","Please provide domain name",1,"form-control","form-control-sm",3,"ngModel","blur","ngModelChange"],[1,"form-group","row"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[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,"click",4,"ngIf"],[2,"width","100px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[1,"text-center"],["pTooltip","Edit","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Allowed Origins"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return n.addAllowedOrigin()}),e._UZ(6,"i",4),e.qZA()(),e.TgZ(7,"div",5)(8,"p-table",6),e.NdJ("selectionChange",function(d){return n.selectedRowsUI=d})("dblclick",function(){return n.doubleClick()}),e.YNc(9,F,5,0,"ng-template",7),e.YNc(10,L,5,3,"ng-template",8),e.qZA()()(),e.TgZ(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"span"),e._UZ(16,"i",13),e._uU(17," Allowed Origins"),e.qZA(),e.TgZ(18,"button",14)(19,"span",15),e._UZ(20,"i",16),e.qZA()()(),e.TgZ(21,"div",17)(22,"div",18)(23,"label",19),e._uU(24,"Domain name"),e.qZA(),e.TgZ(25,"div",20)(26,"input",21),e.NdJ("blur",function(){return n.allowedOriginModel.domainName=n.allowedOriginModel.domainName.toLowerCase()})("ngModelChange",function(d){return n.allowedOriginModel.domainName=d}),e.qZA()()(),e.TgZ(27,"div",22),e._UZ(28,"label",19),e.TgZ(29,"div",20)(30,"label",23),e._uU(31),e.qZA()()()(),e.TgZ(32,"div",24)(33,"button",25),e._UZ(34,"i",26),e._uU(35," Close"),e.qZA(),e.YNc(36,Q,4,0,"button",27),e.qZA()()()()),2&i&&(e.xp6(8),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRowsUI)("dataKey",n.gridKeyAllowedOrigins)("scrollable",!0)("value",n.allowedOriginsGridData),e.xp6(3),e.s9C("id",n.modalId),e.xp6(15),e.Q6J("ngModel",n.allowedOriginModel.domainName),e.xp6(5),e.hij("(Ex: ",n.exampleOrigin,")"),e.xp6(5),e.Q6J("ngIf",n.allowedOriginData.mode!==n.EFormMode.VIEW))},dependencies:[g.Fj,g.JJ,g.On,_.O5,Y.y,f.iA,p.jx,f.Ei,A.u],encapsulation:2})}return a})();const B=["addNpmLibC"],j=["allowedOriginC"],W=["SandboxSettingsPkgVersionsModalC"];function z(a,l){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",49)(2,"th",50),e.TgZ(3,"th",51),e._uU(4,"Version"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",52),e._uU(8,"Sub Dependencies"),e.qZA(),e.TgZ(9,"th",53),e._uU(10,"Third Party API"),e.qZA(),e.TgZ(11,"th",54),e._uU(12,"Default"),e.qZA(),e.TgZ(13,"th",55),e._uU(14,"Action"),e.qZA()())}function X(a,l){1&a&&e._UZ(0,"i",64)}function ee(a,l){1&a&&e._UZ(0,"i",65)}function te(a,l){if(1&a&&(e.TgZ(0,"div",67),e._uU(1),e.qZA()),2&a){const t=l.$implicit;e.xp6(1),e.AsE("",t.name," @",t.version,"")}}function ne(a,l){if(1&a&&(e.TgZ(0,"div"),e.YNc(1,te,2,2,"div",66),e.qZA()),2&a){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.dependencies)}}function ie(a,l){1&a&&e._UZ(0,"i",68)}function ae(a,l){1&a&&e._UZ(0,"i",68)}function oe(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",61)(1,"button",69),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.editData(n,o))}),e._UZ(2,"i",70),e.qZA(),e.TgZ(3,"button",71),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.removePermanentDialog(n,o))}),e._UZ(4,"i",72),e.qZA()()}}function se(a,l){if(1&a&&(e.TgZ(0,"tr",56)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,X,1,0,"i",57),e.YNc(5,ee,1,0,"i",58),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",59),e.YNc(12,ne,2,1,"div",60),e.qZA()(),e.TgZ(13,"td",61),e.YNc(14,ie,1,0,"i",62),e.qZA(),e.TgZ(15,"td",61),e.YNc(16,ae,1,0,"i",62),e.qZA(),e.TgZ(17,"td"),e.YNc(18,oe,5,0,"div",63),e.qZA()()),2&a){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(3),e.Q6J("ngForOf",t.subDependencies),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function le(a,l){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",49),e.TgZ(2,"th",51),e._uU(3,"Version"),e.qZA(),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",73),e._uU(7,"Third Party API"),e.qZA(),e.TgZ(8,"th",51),e._uU(9,"Default"),e.qZA()())}function de(a,l){1&a&&e._UZ(0,"i",68)}function re(a,l){1&a&&e._UZ(0,"i",68)}function ce(a,l){if(1&a&&(e.TgZ(0,"tr",56)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e.YNc(8,de,1,0,"i",62),e.qZA(),e.TgZ(9,"td"),e.YNc(10,re,1,0,"i",62),e.qZA()()),2&a){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault)}}function ge(a,l){1&a&&e._UZ(0,"p-progressSpinner",74)}function me(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",5)(1,"div",6)(2,"button",7),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.loadGridData())}),e._UZ(3,"i",8),e._uU(4," Refresh "),e.qZA(),e.TgZ(5,"button",9),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e._UZ(6,"i",10),e._uU(7," Save "),e.qZA()(),e.TgZ(8,"div",11)(9,"div",12)(10,"span"),e._UZ(11,"i",13),e._uU(12," Settings"),e.qZA()(),e.TgZ(13,"div",14)(14,"div",15)(15,"div",16)(16,"label",17),e._uU(17,"Sandbox Count"),e.qZA(),e.TgZ(18,"input",18),e.NdJ("ngModelChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.settings.sandbox.sandboxCountOverrideAdmin=n)}),e.qZA(),e.TgZ(19,"div",19)(20,"span",20)(21,"span"),e._uU(22,"1 CPU core will have one process and one process will have these many sandbox."),e.qZA(),e._UZ(23,"br"),e.TgZ(24,"span"),e._uU(25,"Ideally it should be 1-2."),e.qZA()()()(),e.TgZ(26,"div",21)(27,"label",17),e._uU(28,"Automatic Sandbox Restart In Seconds"),e.qZA(),e.TgZ(29,"input",22),e.NdJ("ngModelChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.settings.sandbox.automaticSandboxRestartInSeconds=n)}),e.qZA(),e.TgZ(30,"div",19)(31,"span",20)(32,"span",23),e._uU(33,"All sandbox will be restarted automatically after these many seconds across all servers, without failing any request."),e.qZA(),e._UZ(34,"br"),e.qZA()()()()()(),e.TgZ(35,"div",11)(36,"div",12)(37,"span"),e._UZ(38,"i",24),e._uU(39," Sandbox Dependencies"),e.qZA(),e.TgZ(40,"div",25)(41,"a",26),e._UZ(42,"img",27),e.qZA()(),e.TgZ(43,"span",28),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showLibraryModel())}),e._UZ(44,"i",29),e.qZA()(),e.TgZ(45,"div",30)(46,"p-tabView",31)(47,"p-tabPanel",32)(48,"p-table",33),e.NdJ("selectionChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRowsUI=n)})("dblclick",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.summaryTableDoubleClick())}),e.YNc(49,z,15,0,"ng-template",34),e.YNc(50,se,19,10,"ng-template",35),e.qZA()(),e.TgZ(51,"p-tabPanel",36)(52,"p-table",37),e.NdJ("selectionChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRowsPackageJson=n)}),e.YNc(53,le,10,0,"ng-template",34),e.YNc(54,ce,11,6,"ng-template",35),e.qZA()()(),e.YNc(55,ge,1,0,"p-progressSpinner",38),e.qZA()(),e.TgZ(56,"div",11)(57,"div",12)(58,"span"),e._UZ(59,"i",39),e._uU(60," Docker File"),e.qZA(),e.TgZ(61,"span",40),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.resetDockerfileToDefault())}),e._UZ(62,"i",41),e.qZA(),e.TgZ(63,"span",42),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showDockerImageBuildLogs())}),e._UZ(64,"i",43),e.qZA()(),e.TgZ(65,"div",44)(66,"app-monaco-editor",45),e.NdJ("editorGenerated",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.editorGenerated(n))}),e.qZA()()(),e.TgZ(67,"allowed-origin-c",46,47),e.NdJ("saveSettings",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e.qZA(),e.TgZ(69,"div",48),e._uU(70,"\xa0"),e.qZA()()}if(2&a){const t=e.oxw();e.xp6(18),e.Q6J("ngModel",t.settings.sandbox.sandboxCountOverrideAdmin),e.xp6(11),e.Q6J("ngModel",t.settings.sandbox.automaticSandboxRestartInSeconds),e.xp6(19),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsUI)("dataKey",t.gridKey)("scrollable",!0)("value",t.packageSummary),e.xp6(4),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsPackageJson)("dataKey",t.gridKey)("scrollable",!0)("value",t.finalPackageJson),e.xp6(3),e.Q6J("ngIf",t.loading.form),e.xp6(11),e.Q6J("editorOptions",t.editorOptionsDocker),e.xp6(1),e.Q6J("allowedOrigins",t.settings.allowedOrigins)}}const pe=[{path:"main",component:(()=>{class a{authCS;userS;eventCenterCS;notificationS;confirmationService;cs;monacoS;tpStoreApiVersionS;instanceS;feStoreCS;generalCS;STORE_BE_HOST_PORT=h.N.STORE_BE_HOST_PORT;BE_HOST_PORT=h.N.BE_HOST_PORT;subscriptions=[];data={mode:c.D.ADD,eventChannel:new e.vpe,formData:void 0};packageSummary=[];selectedRowsUI=[];gridKey="rowId";counter;EFormMode=c.D;finalPackageJson=[];selectedRowsPackageJson=[];showAll=!1;loading={form:!1};settings;tpNpmPackageAndVersion={};tpApiVersionIdMap;tpApiBundleIdMap;editorDocker;editorOptionsDocker={readOnly:!1,language:"dockerfile",contextmenu:!0};addNpmLibC;allowedOriginC;SandboxSettingsPkgVersionsModalC;constructor(t,i,n,o,d,m,ue,_e,Se,ve,he){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=o,this.confirmationService=d,this.cs=m,this.monacoS=ue,this.tpStoreApiVersionS=_e,this.instanceS=Se,this.feStoreCS=ve,this.generalCS=he}ngOnInit(){var t=this;return(0,r.Z)(function*(){t.subscriptions.push(t.eventCenterCS.sandboxDep.subscribe(i=>{if(t.data.mode===c.D.ADD){for(const n of t.packageSummary)if(n.name===i.name&&n.isDefault)return void t.notificationS.showError("You can not override default package.");t.packageSummary.unshift(i),t.rowIdSet(),t.notificationS.showSuccess(t.cs.amUserSandboxDepSetting.addSuccess),t.addNpmLibC.hideModal()}})),yield t.loadGridData(),t.generalCS.setNewTitle("API Maker - Sandbox Settings")})()}loadGridData(){var t=this;return(0,r.Z)(function*(){const i=yield t.userS.getAdminSettings(t.authCS.getUserId()).toPromise();t.settings=i.data||{},t.packageSummary=t.settings.sandbox.dependenciesUI.nodeJS,t.finalPackageJson=t.settings.sandbox.dependencies.nodeJS;const n=t.settings.allowedOrigins||[];t.settings.sandbox&&(t.settings.sandbox.automaticSandboxRestartInSeconds=t.settings.sandbox.automaticSandboxRestartInSeconds||null),n.sort(),t.settings.allowedOrigins=u.map(n,o=>({name:o})),t.rowIdSet();for(const o of t.finalPackageJson)o.rowId=(t.counter++).toString();t.generalCS.setValueInEditor(t,"editorDocker",t.settings.dockerFile||"")})()}editorGenerated(t){var i=this;return(0,r.Z)(function*(){i.editorDocker=t,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(t,n=>{i.saveSettings()})})()}rowIdSet(){this.counter=1;for(const t of this.packageSummary)t.rowId=(this.counter++).toString()}showLibraryModel(){this.data.formData=void 0,this.data.mode=c.D.ADD,this.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_ADD_MODE}),this.addNpmLibC.showModal()}saveSettings(t){var i=this;return(0,r.Z)(function*(){try{const n=i.authCS.getUserId();if(i?.settings?.sandbox?.sandboxCountOverrideAdmin>5)return void i.notificationS.showError("More than 5 sandbox are not allowed.");const o={settings:{sandbox:{sandboxCountOverrideAdmin:i.settings.sandbox.sandboxCountOverrideAdmin,automaticSandboxRestartInSeconds:i.settings.sandbox.automaticSandboxRestartInSeconds||null,dependencies:{nodeJS:i.packageSummary.filter(m=>!m.isReadOnly&&!m.isThirdPartyApi&&!m.isDefault)}},dockerFile:i.editorDocker.getValue(),allowedOrigins:u.map(i.allowedOriginC.allowedOriginsGridData,"name").sort()}};(yield i.userS.put(n,o,{select:k.iH._id}).toPromise())&&(t===c.D.EDIT?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.editSuccess):"DELETE"===t?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.removePermanent):t||i.notificationS.showSuccess("Success")),i.loadGridData().then()}catch(n){i.loading.form=!1,i.notificationS.showErrorFromResponse(n.error||n,"Unable to save settings.")}})()}removePermanentDialog(t,i){var n=this;return(0,r.Z)(function*(){var o;t.stopPropagation(),t.preventDefault(),n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.Z)(function*(){yield n.removePermanent(i)}),function(){return o.apply(this,arguments)})})})()}removePermanent(t){var i=this;return(0,r.Z)(function*(){i.packageSummary.splice(i.packageSummary.indexOf(t),1),i.saveSettings("DELETE").then()})()}loadDependenciesAndSchemas(){var t=this;return(0,r.Z)(function*(){const{tpNpmPackageAndVersion:i,tpApiBundleIdMap:n,tpApiVersionIdMap:o}=(yield t.instanceS.getInstalledPackagesAndSchemas().toPromise()).data;t.tpNpmPackageAndVersion=i,t.tpApiBundleIdMap=n,t.tpApiVersionIdMap=o})()}commonPackageAddRemoveTasks(){var t=this;return(0,r.Z)(function*(){yield t.loadDependenciesAndSchemas()})()}editData(t,i){var n=this;return(0,r.Z)(function*(){t?.stopPropagation(),t?.preventDefault(),n.data.formData=i,n.data.mode=c.D.EDIT,n.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_EDIT_MODE}),yield n.SandboxSettingsPkgVersionsModalC.showPkgVersions(i.name)})()}hideNpmLibModel(){this.addNpmLibC.hideModal()}resetDockerfileToDefault(){var t=this;return(0,r.Z)(function*(){try{const i=yield t.feStoreCS.geDefaultDockerfile(t.BE_HOST_PORT);t.editorDocker.setValue(i.data)}catch(i){t.notificationS.showErrorFromResponse(i.error||i,"Unable to reset docker file.")}})()}showDockerImageBuildLogs(){var t=this;return(0,r.Z)(function*(){const i=t.eventCenterCS.headerC,n=i.systemLogsModelC.systemLogsListC.filterOptions.find(o=>o.value===I.g.DOCKER_IMAGE_BUILD_LOGS);i.showSystemLogsModal(n)})()}summaryTableDoubleClick(){var t=this;setTimeout((0,r.Z)(function*(){if(t.selectedRowsUI[0]){let i;for(const n of t.packageSummary)n[t.gridKey]===t.selectedRowsUI[0].rowId&&(i=n);i&&!i.isReadOnly&&(yield t.editData(null,i))}}),100)}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||a)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(p.YP),e.Y36(T.L),e.Y36(U.b),e.Y36(N.f),e.Y36(P.E),e.Y36(E.e),e.Y36(J.b))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-sandbox-settings-c"]],viewQuery:function(i,n){if(1&i&&(e.Gf(B,5),e.Gf(j,5),e.Gf(W,5)),2&i){let o;e.iGM(o=e.CRH())&&(n.addNpmLibC=o.first),e.iGM(o=e.CRH())&&(n.allowedOriginC=o.first),e.iGM(o=e.CRH())&&(n.SandboxSettingsPkgVersionsModalC=o.first)}},decls:6,vars:9,consts:[["class","pt-1 pl-5 pr-5 full-body overflow-auto",4,"ngIf"],[3,"data","pkgVersionModal","modalId","hostAndPort"],["addNpmLibC",""],[3,"modalId","hostAndPort","data","dependencies","saveUpdateSandboxDep","hideLibraryModelEventEmitter","installed"],["pkgVersionsModalC","","SandboxSettingsPkgVersionsModalC",""],[1,"pt-1","pl-5","pr-5","full-body","overflow-auto"],[1,"cursor-pointer","text-right","mr-1"],[1,"btn","btn-primary","btn-sm","mt-1","mr-1",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw","cursor-pointer"],[1,"btn","btn-success","btn-sm","mt-1",3,"click"],[1,"fas","fa-save","fa-fw","cursor-pointer"],[1,"card","shadow-sm","mt-2","mr-1"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"card-body","p-3","overflow-hidden"],[1,"container"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["name","Setting","type","number","placeholder","Please provide value",1,"col-2","form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"col-6","pr-0"],[1,"small","text-info"],[1,"row","mt-3"],["name","automaticSandboxRestartInSeconds","type","number","placeholder","Automatic sandbox restart in seconds",1,"col-2","form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"mt-2","d-inline-block"],[1,"fas","fa-box","text-warning","fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/settings/sandboxSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-2","overflow-hidden"],[1,"w-100"],["header","Summary"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["header","Final package.json"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fab","fa-docker","fa-fw","mr-1","text-info"],["tooltipPosition","left","pTooltip","Reset dockerfile to default",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-undo","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","View logs of docker image build",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-water","text-info","fa-fw"],[1,"card-body","p-1","overflow-hidden",2,"height","400px"],[3,"editorOptions","editorGenerated"],[3,"allowedOrigins","saveSettings"],["allowedOriginC",""],[1,"mb-5"],[2,"width","55px"],[2,"width","40px"],[2,"width","100px"],[2,"width","200px"],[1,"text-center",2,"width","150px"],[1,"text-center",2,"width","100px"],[1,"text-center",2,"width","130px"],[3,"pSelectableRow"],["class","fas fa-circle fa-fw text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw text-muted text-v-small",4,"ngIf"],[1,"small"],[4,"ngFor","ngForOf"],[1,"text-center"],["class","fas fa-check fa-fw text-success pt-1",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"fas","fa-circle","fa-fw","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","text-muted","text-v-small"],["class","pl-3",4,"ngFor","ngForOf"],[1,"pl-3"],[1,"fas","fa-check","fa-fw","text-success","pt-1"],["pTooltip","Edit","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],[2,"width","150px"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){if(1&i&&(e.YNc(0,me,71,17,"div",0),e._UZ(1,"find-npm-package",1,2),e.TgZ(3,"app-sandbox-settings-pkg-versions-modal",3,4),e.NdJ("saveUpdateSandboxDep",function(d){return n.saveSettings(d)})("hideLibraryModelEventEmitter",function(){return n.hideNpmLibModel()})("installed",function(){return n.commonPackageAddRemoveTasks()}),e.qZA()),2&i){const o=e.MAs(4);e.Q6J("ngIf",n.settings),e.xp6(1),e.Q6J("data",n.data)("pkgVersionModal",o)("modalId","idAddNpmSandboxSettings")("hostAndPort",n.STORE_BE_HOST_PORT),e.xp6(2),e.Q6J("modalId","idAddNpmSandboxSettingsEdit")("hostAndPort",n.STORE_BE_HOST_PORT)("data",n.data)("dependencies",n.tpNpmPackageAndVersion)}},dependencies:[g.Fj,g.wV,g.JJ,g.On,_.sg,_.O5,R.K,G.S,q.O,f.iA,p.jx,f.Ei,K.G,C.xf,C.x4,A.u,V],encapsulation:2})}return a})(),canActivate:[D.P]}];let fe=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[O.Bz.forChild(pe),y.u,M.ApiTestingM]})}return a})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7436],{17436:(ne,f,o)=>{o.r(f),o.d(f,{ExtLicensesM:()=>z});var v=o(77664),C=o(27213),Z=o(17017),y=o(63726),r=o(15861),p=o(60921),u=o(51162),U=o(45085),e=o(94946),E=o(95852),S=o(84795),I=o(77240),A=o(53429),T=o(99961),L=o(15561),m=o(85219),P=o(27414),w=o(32915),l=o(60095),g=o(96814),b=o(32660),h=o(95431),K=o(97680),M=o(33259);function N(i,c){1&i&&(e.TgZ(0,"span",5),e._UZ(1,"i",31),e.qZA())}function k(i,c){1&i&&(e.TgZ(0,"tr")(1,"th",32),e._uU(2,"#"),e.qZA(),e.TgZ(3,"th",32),e._uU(4,"\xa0"),e.qZA(),e.TgZ(5,"th",33),e._uU(6,"License Key"),e.qZA(),e.TgZ(7,"th",34),e._uU(8,"Server Info"),e.qZA(),e.TgZ(9,"th",35),e._uU(10,"Action Required"),e.qZA(),e.TgZ(11,"th",36),e._uU(12,"Actions"),e.qZA()())}function D(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e.qZA())}function F(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",48),e.qZA())}function q(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",49),e.qZA())}function J(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"a",50),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.hideLicenseKey(n))}),e._UZ(4,"i",51),e.qZA()()}if(2&i){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.licenseKey)}}function Y(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.qZA(),e.TgZ(3,"a",50),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.showLicenseKey(n))}),e._UZ(4,"i",52),e.qZA()()}}function O(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",53),e._uU(2," All good"),e.qZA())}function R(i,c){if(1&i&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&i){const t=c.$implicit;e.xp6(2),e.hij("\u274c ",t.message,"")}}function G(i,c){if(1&i&&(e.TgZ(0,"div"),e.YNc(1,R,3,1,"div",54),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.licenseError)}}function B(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",55),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.resetMacAddress(n))}),e._UZ(1,"i",56),e.qZA()}}function Q(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",57),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.showDialogToGetNewLicenseKey(n))}),e._UZ(1,"i",58),e.qZA()}}function H(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",59),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.reduceUsage__click(n,"REDUCE_CPU_USAGE"))}),e._UZ(1,"i",60),e.qZA()}}function V(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",61),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.reduceUsage__click(n,"REDUCE_UI_PAGES_USAGE"))}),e._UZ(1,"i",62),e.qZA()}}function j(i,c){if(1&i&&(e.TgZ(0,"tr",37)(1,"td",38),e._uU(2),e.qZA(),e.TgZ(3,"td",38),e.YNc(4,D,2,0,"span",39),e.YNc(5,F,2,0,"span",39),e.YNc(6,q,2,0,"span",39),e.qZA(),e.TgZ(7,"td",40),e.YNc(8,J,5,1,"div",39),e.YNc(9,Y,5,0,"div",39),e.qZA(),e.TgZ(10,"td")(11,"span"),e._uU(12),e.qZA(),e._UZ(13,"br"),e.TgZ(14,"a",41),e._uU(15),e.qZA()(),e.TgZ(16,"td",42),e.YNc(17,O,3,0,"span",39),e.YNc(18,G,2,1,"div",39),e.qZA(),e.TgZ(19,"td",38),e.YNc(20,B,2,0,"a",43),e.YNc(21,Q,2,0,"a",44),e.YNc(22,H,2,0,"a",45),e.YNc(23,V,2,0,"a",46),e.qZA()()),2&i){const t=c.$implicit,s=c.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(s+1),e.xp6(2),e.Q6J("ngIf","PENDING"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","VALID"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","INVALID"===t.licenseCheckStatus),e.xp6(2),e.Q6J("ngIf",t.showLicenseKey),e.xp6(1),e.Q6J("ngIf",!t.showLicenseKey),e.xp6(3),e.Oqu(t.hostName),e.xp6(2),e.s9C("href",t.beHostPort,e.LSH),e.xp6(1),e.Oqu(t.beHostPort),e.xp6(2),e.Q6J("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.xp6(1),e.Q6J("ngIf",t.licenseError.length),e.xp6(2),e.Q6J("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_UI_PAGES_USAGE")>=0)}}function W(i,c){1&i&&e._UZ(0,"p-progressSpinner",63)}const X=[{path:"",component:(()=>{class i{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=p.d;EAPICategory=U.R;gridKey=u.iH._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,n,a,d,x,ee,te,se){this.authCS=t,this.authS=s,this.generalCS=n,this.instanceS=a,this.ns=d,this.navigationS=x,this.confirmationService=ee,this.constantsS=te,this.eventCenterS=se}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==p.d.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,r.Z)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,n=_.groupBy(s,u.GR.hostName);for(const a in n)t.serverList.push(n[a][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,r.Z)(function*(){var n;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,r.Z)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(a){console.log(a),s.ns.showErrorFromResponse(a.error||a,"Unable to reset MAC address of license.")}}),function(){return n.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,r.Z)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to reset MAC address of license.")}})()}reduceUsage__click(t,s){var n=this;let a="";var d;"REDUCE_CPU_USAGE"===s?a=this.constantsS.license.setCPUCoreConfirm:"REDUCE_UI_PAGES_USAGE"===s&&(a=this.constantsS.license.setUIPageCountConfirm),this.confirmationService.confirm({message:a,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,r.Z)(function*(){"REDUCE_CPU_USAGE"===s?yield n.hitReduceAPICallForCPU(t):"REDUCE_UI_PAGES_USAGE"===s&&(yield n.hitReduceAPICallForDBMasters(t))}),function(){return d.apply(this,arguments)})})}hitReduceAPICallForCPU(t){var s=this;return(0,r.Z)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsCPU)?.licensePermitsCPU;if(!n)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set CPU core of license.")}})()}hitReduceAPICallForDBMasters(t){var s=this;return(0,r.Z)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsDBMasterCount)?.licensePermitsDBMasterCount;if(!n)return void s.ns.showError("Unable to find UI Pages count issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"UI_PAGES_COUNT",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,dbMasterCount:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("UI Pages count set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set UI Pages count of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,r.Z)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||i)(e.Y36(E.D),e.Y36(S.e),e.Y36(I.b),e.Y36(A.E),e.Y36(T.W),e.Y36(L.X),e.Y36(m.YP),e.Y36(P.L),e.Y36(w.u))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.svg","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["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"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fab","fa-html5","text-success","fa-fw","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),e._UZ(5,"img",4),e._uU(6," Server List "),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,N,2,0,"span",6),e.qZA()(),e.TgZ(9,"div",7)(10,"p-table",8),e.YNc(11,k,13,0,"ng-template",9),e.YNc(12,j,24,16,"ng-template",10),e.qZA(),e.YNc(13,W,1,0,"p-progressSpinner",11),e.qZA()()()(),e.TgZ(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e._UZ(19,"i",16),e._uU(20," Set License Key"),e.qZA(),e.TgZ(21,"button",17)(22,"span",18),e._UZ(23,"i",19),e.qZA()()(),e.TgZ(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e._uU(28,"Name"),e.qZA(),e.TgZ(29,"div",24)(30,"input",25),e.NdJ("ngModelChange",function(d){return n.newLicenseKey=d}),e.qZA()()()()(),e.TgZ(31,"div",26)(32,"button",27),e._UZ(33,"i",28),e._uU(34," Close "),e.qZA(),e.TgZ(35,"button",29),e.NdJ("click",function(){return n.setLicenseKeyAPICall(n.setLicenseKeyForObj)}),e._UZ(36,"i",30),e.TgZ(37,"span"),e._uU(38,"Set Key"),e.qZA()()()()()()),2&s&&(e.xp6(8),e.Q6J("ngIf",n.showValidationInProgress),e.xp6(2),e.Q6J("selectionMode","multiple")("dataKey",n.gridKey)("scrollable",!0)("value",n.serverList),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(17),e.Q6J("ngModel",n.newLicenseKey))},dependencies:[l._Y,l.Fj,l.JJ,l.JL,l.On,l.F,g.sg,g.O5,b.y,h.iA,m.jx,h.Ei,K.G,M.u],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return i})(),canActivate:[y.P]}];let z=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[v.Bz.forChild(X),Z.u,C.S]})}return i})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7470],{92883:(R,A,a)=>{a.d(A,{c:()=>O});var c=a(94946),p=a(53300);let O=(()=>{class n{hideCodeFinderModel=new c.vpe;loading={form:!1,response:!1};constructor(){}ngOnInit(){}showModal(){$("#idCodeFinder").modal("show")}hideModal(){$("#idCodeFinder").modal("hide")}hideModalEvent(){this.hideCodeFinderModel.emit(!0)}ngOnDestroy(){}static \u0275fac=function(d){return new(d||n)};static \u0275cmp=c.Xpm({type:n,selectors:[["app-code-finder-modal"]],outputs:{hideCodeFinderModel:"hideCodeFinderModel"},decls:8,vars:1,consts:[["id","idCodeFinder","role","dialog","data-backdrop","static","data-keyboard","false",1,"pt-1","pl-1","pr-1","overflow-auto","modal","parent-notes-modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content","border-0"],["aria-label","Close","type","button",1,"close","position-absolute",2,"top","0.25rem","right","0.5rem","z-index","1",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close","m-1"],[1,"modal-body","p-0"],[3,"modalId"]],template:function(d,y){1&d&&(c.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),c.NdJ("click",function(){return y.hideModalEvent()}),c.TgZ(4,"span",4),c._UZ(5,"i",5),c.qZA()(),c.TgZ(6,"div",6),c._UZ(7,"app-code-finder-w",7),c.qZA()()()()),2&d&&(c.xp6(7),c.Q6J("modalId","idCodeFinder"))},dependencies:[p.k],encapsulation:2,changeDetection:0})}return n})()},365:(R,A,a)=>{a.d(A,{n:()=>xe});var c=a(15861),p=a(6990),n=a(11440),u=a(51162),f=a(20553),d=a(45085),y=a(91601),P=a(3531),b=a(39989),e=a(94946),j=a(77240),S=a(27414),T=a(62304),U=a(95852),E=a(67629),I=a(31042),Z=a(90602),l=a(10262),m=a(62694),r=a(12559),h=a(25394),_=a(79448),g=a(3366),x=a(93645),N=a(45800),F=a(56457),H=a(67145),B=a(99961),L=a(32915),J=a(81344),K=a(56233),k=a(60115),Y=a(61252),W=a(39530),w=a(99729),Q=a(26125),q=a(90204),D=a(96814),V=a(32660),G=a(5860),z=a(756),X=a(33259),ee=a(25025);const oe=["insertCodeModalC"],te=["monacoEditorModalC"];function se(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA(),e.TgZ(11,"span",16),e._uU(12),e.qZA(),e.TgZ(13,"span",17),e._uU(14),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ie(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ae(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",16),e._uU(8),e.qZA(),e.TgZ(9,"span",17),e._uU(10),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ne(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",16),e._uU(10),e.qZA(),e.TgZ(11,"span",17),e._uU(12),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function de(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function re(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",15),e._uU(4),e.qZA(),e.TgZ(5,"span",16),e._uU(6),e.qZA(),e.TgZ(7,"span",17),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.apiId," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.hookType)}}function ce(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function _e(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function pe(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function le(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",19),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Ce(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",21),e._uU(4),e.qZA(),e.TgZ(5,"span",22),e._uU(6),e.qZA(),e.TgZ(7,"span",20),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.eventName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.eventListenersName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Oe(i,C){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function ue(i,C){if(1&i&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function ge(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",23),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA(),e.YNc(7,Oe,2,1,"span",24),e.YNc(8,ue,2,1,"span",25),e.qZA()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.customApiName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function he(i,C){if(1&i&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.hij(" \u2192 ",o.codeObj.name,"")}}function me(i,C){if(1&i&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.xp6(1),e.Oqu(o.codeObj.hookType)}}function Se(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA(),e.TgZ(9,"span",20),e._uU(10),e.qZA(),e.YNc(11,he,2,1,"span",24),e.YNc(12,me,2,1,"span",25),e.qZA()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.apiVersion),e.xp6(2),e.hij("",o.codeObj.apiName," \u2192 "),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":""),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType),e.xp6(1),e.Q6J("ngIf",o.codeObj.hookType)}}function Te(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",29),e._uU(4),e.qZA(),e.TgZ(5,"span",20),e._uU(6),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.utilityClassName),e.xp6(2),e.Oqu(o.codeObj.versionUI?"("+o.codeObj.versionUI+")":"")}}function Ee(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",18),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function fe(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ie(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",31),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ae(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA(),e.TgZ(9,"span",15),e._uU(10),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiId," ")}}function ye(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",26),e._uU(4),e.qZA(),e.TgZ(5,"span",27),e._uU(6),e.qZA(),e.TgZ(7,"span",28),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.bundleName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.apiVersion," \u2192 "),e.xp6(2),e.hij("",o.codeObj.name," ")}}function Pe(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function be(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function je(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",12),e._uU(4),e.qZA(),e.TgZ(5,"span",13),e._uU(6),e.qZA(),e.TgZ(7,"span",14),e._uU(8),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.hij("",o.codeObj.instanceName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.databaseName," \u2192 "),e.xp6(2),e.hij("",o.codeObj.collectionName," ")}}function Me(i,C){if(1&i&&(e.TgZ(0,"span")(1,"span",11),e._uU(2),e.qZA(),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("pTooltip",o.codeObj.tooltip),e.xp6(1),e.hij("",o.codeObj.prefix," : "),e.xp6(2),e.Oqu(o.codeObj.name)}}function Ue(i,C){1&i&&(e.TgZ(0,"span",41),e._UZ(1,"i",42),e.qZA())}function ve(i,C){if(1&i&&(e.TgZ(0,"span",43),e._uU(1),e.qZA()),2&i){const o=e.oxw(2);e.Q6J("pTooltip",o.matchFound+" match found in this file."),e.xp6(1),e.Oqu(o.matchFound)}}function Re(i,C){if(1&i){const o=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(o);const s=e.oxw(2);return e.KtG(s.viewError())}),e._uU(1,"View error"),e.qZA()}}const Ze=function(){return{"margin-right":"30px"}};function De(i,C){if(1&i){const o=e.EpF();e.TgZ(0,"span")(1,"span",32),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.saveData())}),e._UZ(2,"i",33),e._uU(3,"Save "),e.qZA(),e.TgZ(4,"span",34),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.toggleResponseTab())}),e._UZ(5,"i",35),e.qZA(),e.TgZ(6,"span",36),e.NdJ("click",function(){e.CHM(o);const s=e.oxw();return e.KtG(s.reloadTypes())}),e._UZ(7,"i",37),e.qZA(),e.YNc(8,Ue,2,0,"span",38),e.YNc(9,ve,2,2,"span",39),e.YNc(10,Re,2,0,"a",40),e.qZA()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("ngStyle",o.modalId?e.DdM(4,Ze):""),e.xp6(7),e.Q6J("ngIf",o.showLoadingTypes),e.xp6(1),e.Q6J("ngIf",o.matchFound),e.xp6(1),e.Q6J("ngIf",o.lastError)}}let xe=(()=>{class i{generalCS;constantsS;monacoS;authCS;functionS;schedulerS;dbMigrationS;webSocketEventsS;processInitializersS;tpInstalledApisS;instanceApiSettingsS;instanceApiHooksS;instanceHooksS;databaseHooksS;collectionHooksS;systemApiSettingsS;amEventS;ns;eventCenterS;feStoreCS;i18nS;secretS;tpApiSettingsS;schemaS;dbMastersS;uiMakerUtilsS;constantsCS;cd;modalId;DOCS_HOST_PORT=f.N.DOCS_HOST_PORT;loading={grid:!1};subscriptions=[];editorCodeFinder;editorOptionsEditorCodeFinder={readOnly:!1,language:y.d.typescript,contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};gridKey=u.iH._id;BE_HOST_PORT=f.N.BE_HOST_PORT;EAPICategory=d.R;codeObj={};monacoDecorations=[];tab;insertCodeModalC;viewDockerfileModelC;lastCodeFinderObject={};matchFound=0;constructor(o,t,s,M,v,Ne,Fe,He,Be,Le,Je,Ke,ke,Ye,We,we,Qe,qe,Ve,Ge,$e,ze,Xe,eo,oo,to,so,io){this.generalCS=o,this.constantsS=t,this.monacoS=s,this.authCS=M,this.functionS=v,this.schedulerS=Ne,this.dbMigrationS=Fe,this.webSocketEventsS=He,this.processInitializersS=Be,this.tpInstalledApisS=Le,this.instanceApiSettingsS=Je,this.instanceApiHooksS=Ke,this.instanceHooksS=ke,this.databaseHooksS=Ye,this.collectionHooksS=We,this.systemApiSettingsS=we,this.amEventS=Qe,this.ns=qe,this.eventCenterS=Ve,this.feStoreCS=Ge,this.i18nS=$e,this.secretS=ze,this.tpApiSettingsS=Xe,this.schemaS=eo,this.dbMastersS=oo,this.uiMakerUtilsS=to,this.constantsCS=so,this.cd=io}ngOnInit(){this.subscriptions.push(this.eventCenterS.codeFinderResult.subscribe(o=>{if(o.length){this.codeObj=o[0],p.isEmpty(this.lastCodeFinderObject)||this.getBackupOfMonacoEditor(this.lastCodeFinderObject),this.lastCodeFinderObject=this.codeObj,this.generalCS.setValueInEditor(this,"editorCodeFinder",this.codeObj?.apiCodeStr),this.restoreBackupOfMonacoEditor(this.lastCodeFinderObject);const t=this.editorCodeFinder.getModel().findMatches(o[0].searchKeyWord,!0,!1,!1,null,!0);this.lastCodeFinderObject.cursorPosition={lineNumber:t[0]?.range?.startLineNumber,column:t[0]?.range?.startColumn},this?.lastCodeFinderObject?.cursorPosition?.lineNumber&&this.editorCodeFinder.setPosition(this?.lastCodeFinderObject?.cursorPosition),t[0]?.range?.startLineNumber&&this.editorCodeFinder.revealLineInCenter(t[0]?.range?.startLineNumber),t[0]?.range&&this.editorCodeFinder.revealRange(t[0].range,1),this.editorCodeFinder.deltaDecorations(this.monacoDecorations,[]),this.monacoDecorations=[];for(const s of t){const M=[{range:new monaco.Range(s?.range?.startLineNumber,s?.range?.startColumn,s?.range?.endLineNumber,s?.range?.endColumn),options:{inlineClassName:"highlightMatchedWord"}}];if(this.editorCodeFinder){const v=this.editorCodeFinder.deltaDecorations([],M);this.monacoDecorations.push(...v)}}this.matchFound=this.monacoDecorations.length,this.editorCodeFinder.focus()}else this.resetCodeObj();this.lastError=void 0,this.cd.detectChanges()}))}getBackupOfMonacoEditor(o){o.viewState=this.editorCodeFinder.saveViewState()}restoreBackupOfMonacoEditor(o){o.viewState&&this.editorCodeFinder.restoreViewState(o.viewState),o.cursorPosition?.lineNumber?this.editorCodeFinder.setPosition(o.cursorPosition):(o.cursorPosition={lineNumber:1,column:1},this.editorCodeFinder.setPosition(o.cursorPosition),this.editorCodeFinder.setScrollTop(0),this.editorCodeFinder.setScrollLeft(0)),this.editorCodeFinder.focus()}editorGenerated(o){var t=this;return(0,c.Z)(function*(){t.editorCodeFinder=o,yield t.monacoS.loadSchemaEditorSettings(t.BE_HOST_PORT,t.authCS.getUserId(),null),t.monacoS.addSaveCodeKeyBinding(o,s=>{t.codeObj&&t.saveData()}),t.editorCodeFinder.onDidChangeCursorPosition(s=>{t.lastCodeFinderObject&&1!==s.position.lineNumber&&1!==s.position.column&&(t.lastCodeFinderObject.cursorPosition=s.position)}),t.monacoS.addInsertCodeKeyBinding(o,s=>{(t.codeObj.apiCategory===d.R.INSTANCES||t.codeObj.apiCategory===d.R.THIRD_PARTY_APIS||t.codeObj.apiCategory===d.R.CUSTOM_APIS||t.codeObj.apiCategory===d.R.SYSTEM_APIS||t.codeObj.apiCategory===d.R.EVENTS||t.codeObj.apiCategory===d.R.SCHEDULERS||t.codeObj.apiCategory===d.R.UTILITY_CLASS||t.codeObj.apiCategory===d.R.MIGRATION_SCRIPT||t.codeObj.apiCategory===d.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE||t.codeObj.apiCategory===d.R.PROCESS_INITIALIZER||t.codeObj.apiCategory===d.R.INSTANCE_API_HOOKS_JSON||t.codeObj.apiCategory!==d.R.I18N_JSON&&t.codeObj.apiCategory!==d.R.SECRET_JSON&&t.codeObj.apiCategory!==d.R.INSTANCE_API_SETTINGS_JSON&&t.codeObj.apiCategory!==d.R.THIRD_PARTY_API_SETTINGS_JSON&&t.codeObj.apiCategory!==d.R.SCHEMA_JSON&&t.codeObj.apiCategory!==d.R.SYSTEM_API_SETTINGS_JSON)&&t.insertCodeModalC.showModal(P.b.CodeFinderResultC)}),t.subscriptions.push(t.generalCS.messageReceived.subscribe(s=>{s.type&&s.type===b.g.TEXT_COPIED&&s.componentName===P.b.CodeFinderResultC&&(t.monacoS.insertAtCursor(o,s.selectedText),t.insertCodeModalC.hideModal())})),t.monacoS.addToggleCodeKeyBinding(o,s=>{t.toggleResponseTab(),t.layout.cd.detectChanges(),t.cd.detectChanges()})})()}layout;saveData(){var o=this;return(0,c.Z)(function*(){o.monacoS.clearEditorDecorations(o.editorCodeFinder,o.monacoDecorations),yield o.customApisUpdateData(),yield o.schedulerApisUpdateData(),yield o.dbMigrationUpdateData(),yield o.webSocketNotificationUpdateData(),yield o.processInitializerUpdateData(),yield o.amEventsUpdateData(),yield o.tpApisUpdateData(),yield o.instanceApisSettingUpdateData(),yield o.instanceApisHooksUpdateData(),yield o.instanceHooksUpdateData(),yield o.databaseHooksUpdateData(),yield o.collectionHooksUpdateData(),yield o.sysApisSettingUpdateData(),yield o.utilityClassesUpdateData(),yield o.i18nUpdateData(),yield o.secretsUpdateData(),yield o.tpApiSettingUpdateData(),yield o.schemaUpdateData(),yield o.dbMasterUpdateData(),yield o.dbMasterUpdateJSUtilsData(),yield o.uiMakerUtilityUpdateData(),o.cd.detectChanges()})()}customApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.CUSTOM_APIS)try{const t=(yield o.functionS.getById(o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.functionS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.functions.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}if(o.codeObj.apiCategory===d.R.CUSTOM_API_JSON)try{const t=(yield o.functionS.getById(o.codeObj._id).toPromise()).data,s={_id:t._id,functionBasicInfo:o.editorCodeFinder.getValue()};yield o.functionS.put(t._id,s,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.functions.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}schedulerApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SCHEDULERS)try{const t=(yield o.schedulerS.getById(o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.schedulerS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.schedulers.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}dbMigrationUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.MIGRATION_SCRIPT)try{const t=(yield o.dbMigrationS.getById(o.codeObj._id).toPromise()).data;t.dbMigrationScriptCode=o.editorCodeFinder.getValue(),yield o.dbMigrationS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.dbMigration.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}webSocketNotificationUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE)try{const t=(yield o.webSocketEventsS.getById(o.codeObj._id).toPromise()).data;o.getVersionObject(t.versions,o.codeObj.version).apiCodeStr=o.editorCodeFinder.getValue(),yield o.webSocketEventsS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.webSocketEvents.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}processInitializerUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.PROCESS_INITIALIZER)try{const t=(yield o.processInitializersS.getById(o.codeObj._id).toPromise()).data;t.processInitializerCode=o.editorCodeFinder.getValue(),yield o.processInitializersS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.processInitializer.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}amEventsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.EVENTS)try{const t=(yield o.amEventS.getById(o.codeObj._id).toPromise()).data;for(const s of t.eventListeners)s._id===o.codeObj.eventListenersId&&s.name===o.codeObj.eventListenersName&&o.setEditorValueInCodeOrHook(s.versions);yield o.amEventS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.amEventListeners.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}tpApisUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.THIRD_PARTY_APIS)try{const t=(yield o.tpInstalledApisS.getById(o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.tpInstalledApisS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}instanceApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.INSTANCE_API_SETTINGS_JSON)try{const t=(yield o.instanceApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.INSTANCE_API_SETTINGS_JSON&&(t.instanceApiSettingCode=o.editorCodeFinder.getValue()),yield o.instanceApiSettingsS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceApisHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.INSTANCE_API_HOOKS_JSON)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.INSTANCE_API_HOOKS_JSON&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceApiHooksS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}instanceHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.INSTANCE_HOOKS)try{const t=(yield o.instanceApiHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.INSTANCE_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.instanceHooksS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}databaseHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.DATABASE_HOOKS)try{const t=(yield o.databaseHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.DATABASE_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.databaseHooksS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}collectionHooksUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.COLLECTION_HOOKS)try{const t=(yield o.collectionHooksS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.COLLECTION_HOOKS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.collectionHooksS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}sysApisSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SYSTEM_APIS||o.codeObj.apiCategory===d.R.SYSTEM_API_SETTINGS_JSON)try{const t=(yield o.systemApiSettingsS.getById(o.codeObj._id).toPromise()).data;o.codeObj.apiCategory===d.R.SYSTEM_API_SETTINGS_JSON&&(t.sysApiSettingCode=o.editorCodeFinder.getValue()),o.codeObj.apiCategory===d.R.SYSTEM_APIS&&o.codeObj.hookType&&o.prePostHooksCodeCommon(t),yield o.systemApiSettingsS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Changes saved.")}catch(t){o.catchErrorCommon(t)}})()}utilityClassesUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.UTILITY_CLASS)try{const t=(yield o.feStoreCS.getByIdUtilityClasses(o.BE_HOST_PORT,o.codeObj._id).toPromise()).data;o.setEditorValueInCodeOrHook(t.versions),yield o.feStoreCS.putUtilityClasses(o.BE_HOST_PORT,t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.utilityClassesS.editSuccess)}catch(t){o.ns.showErrorMessageFromErrorObject(t),o.lastError=t.error}})()}i18nUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.I18N_JSON)try{const t=(yield o.i18nS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),yield o.i18nS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.i18n.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}secretsUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SECRET_JSON)try{const t=(yield o.secretS.getById(o.codeObj._id).toPromise()).data;t.keysCode=o.editorCodeFinder.getValue(),t.keysCode=o.generalCS.getEncryptedString(t.keysCode,f.N.crypto.passCommunication),yield o.secretS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsCS.secret.editSuccess)}catch(t){o.catchErrorCommon(t)}})()}tpApiSettingUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.THIRD_PARTY_API_SETTINGS_JSON)try{const t=(yield o.tpApiSettingsS.getById(o.codeObj._id).toPromise()).data;t.thirdPartyApiSettingsCode=o.editorCodeFinder.getValue(),yield o.tpApiSettingsS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess(o.constantsS.tpApiSettings.addOrUpdateSuccess)}catch(t){o.catchErrorCommon(t)}})()}schemaUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.SCHEMA_JSON)try{const t=(yield o.schemaS.getById(o.codeObj._id).toPromise()).data;t.propertiesCode=o.editorCodeFinder.getValue(),yield o.schemaS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("Schema updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.DB_MASTERS_JSON)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.dbMasterConfigCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.dbMasterConfigCode]=t.dbMasterConfigCode,yield o.dbMastersS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("DB Master updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}dbMasterUpdateJSUtilsData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.DB_MASTERS_JS_UTILS)try{const t=(yield o.dbMastersS.getById(o.codeObj._id).toPromise()).data;t.pageUtilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.nA.pageUtilsCode]=t.pageUtilsCode,yield o.dbMastersS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("DB Master utils updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}uiMakerUtilityUpdateData(){var o=this;return(0,c.Z)(function*(){if(o.codeObj.apiCategory===d.R.UI_MAKER_UTILITY_CLASS)try{const t=(yield o.uiMakerUtilsS.getById(o.codeObj._id).toPromise()).data;t.utilsCode=o.editorCodeFinder.getValue(),o.codeObj[n.Kr.utilsCode]=t.utilsCode,yield o.uiMakerUtilsS.put(t._id,t,{select:u.iH._id}).toPromise(),o.ns.showSuccess("UI Maker utility updated successfully.")}catch(t){o.catchErrorCommon(t)}})()}setEditorValueInCodeOrHook(o){const t=this.getVersionObject(o,this.codeObj.version);this.codeObj.hookType?(this.codeObj.apiCategory===d.R.CUSTOM_APIS||this.codeObj.apiCategory===d.R.THIRD_PARTY_APIS||this.codeObj.apiCategory===d.R.SCHEDULERS||this.codeObj.apiCategory===d.R.UTILITY_CLASS||this.codeObj.apiCategory===d.R.EVENTS)&&this.prePostHooksCodeCommon(t):t.apiCodeStr=this.editorCodeFinder.getValue()}getVersionObject(o,t){for(const s of o)if(s.version===t)return s}prePostHooksCodeCommon(o){for(const t of o.preHooks)t.name===this.codeObj.name&&t._id===this.codeObj.preHookId&&"Pre Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue());for(const t of o.postHooks)t.name===this.codeObj.name&&t._id===this.codeObj.postHookId&&"Post Hook"===this.codeObj.hookType&&(t.hookCode=this.editorCodeFinder.getValue())}resetCodeObj(){this.codeObj={},this.editorCodeFinder.setValue("")}catchErrorCommon(o){this.ns.showErrorMessageFromErrorObject(o),this.lastError=o.error,this.tab=this.tab||{},this.tab.axiosResponse={data:o.error},this.monacoS.highlightErrorInMonacoEditor(this.editorCodeFinder,this.tab,"MainSandbox.ts",this.monacoDecorations)}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}isResponseCollapsed=!1;showLoadingTypes;toggleResponseTab(){this.isResponseCollapsed=!this.isResponseCollapsed,this.layout.isResponseCollapsed=!this.layout.isResponseCollapsed}reloadTypes(){var o=this;return(0,c.Z)(function*(){yield o.removeExistingAndLoadFreshTypesInMonacoEditor()})()}removeExistingAndLoadFreshTypesInMonacoEditor(){var o=this;return(0,c.Z)(function*(){try{o.showLoadingTypes=!0,yield o.monacoS.loadTypesInMonaco(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.showLoadingTypes=!1}catch{}o.cd.detectChanges()})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||i)(e.Y36(j.b),e.Y36(S.L),e.Y36(T.b),e.Y36(U.D),e.Y36(E.d),e.Y36(I.Z),e.Y36(Z.j),e.Y36(l.a),e.Y36(m.e),e.Y36(r.d),e.Y36(h.f),e.Y36(_.S),e.Y36(g.Q),e.Y36(x.y),e.Y36(N.l),e.Y36(F.J),e.Y36(H.l),e.Y36(B.W),e.Y36(L.u),e.Y36(J.e),e.Y36(K.q),e.Y36(k.e),e.Y36(Y.G),e.Y36(W.$),e.Y36(w.z),e.Y36(Q.L),e.Y36(q.s),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-code-finder-result"]],viewQuery:function(t,s){if(1&t&&(e.Gf(oe,5),e.Gf(te,5)),2&t){let M;e.iGM(M=e.CRH())&&(s.insertCodeModalC=M.first),e.iGM(M=e.CRH())&&(s.viewDockerfileModelC=M.first)}},inputs:{modalId:"modalId"},decls:34,vars:32,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],[2,"font-size","small"],[1,"fas","fa-list-alt","text-yellow","fa-fw","mr-1"],[4,"ngIf"],[1,"overflow-hidden","h-100"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["tooltipPosition","top",3,"pTooltip"],["pTooltip","Instances","tooltipPosition","top",1,"pl-1"],["pTooltip","Databases","tooltipPosition","top",1,"pl-1"],["pTooltip","Collections","tooltipPosition","top",1,"pl-1"],["pTooltip","API","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Hook Type","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Schedulers Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Version","tooltipPosition","top",1,"pl-1","small","text-secondary"],["pTooltip","Event Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Listener Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Custom API Name","tooltipPosition","top",1,"pl-1"],["class","pl-1","pTooltip","Hook Name","tooltipPosition","top",4,"ngIf"],["class","pl-1 small text-secondary","pTooltip","Hook Type","tooltipPosition","top",4,"ngIf"],["pTooltip","Library","tooltipPosition","top",1,"pl-1"],["pTooltip","API Versions","tooltipPosition","top",1,"pl-1"],["pTooltip","API Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Utility Class Name","tooltipPosition","top",1,"pl-1"],["pTooltip","Secret Name","tooltipPosition","top",1,"pl-1"],["pTooltip","System Api Name","tooltipPosition","top",1,"pl-1"],[1,"float-right","cursor-pointer","mr-2",3,"ngStyle","click"],[1,"fas","fa-save","text-success","fa-fw"],["pTooltip","Toggle response panel","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-window-maximize","text-warning","fa-fw","fa-rotate-90"],["sava-no-dbl-click","","pTooltip","Reload types","tooltipPosition","left",1,"float-right","cursor-pointer","mr-2",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","d-inline-block text-danger float-right mr-2",4,"ngIf"],["class","mr-2 font-weight-bold float-right matchCircle",3,"pTooltip",4,"ngIf"],["href","javascript:;","class","text-danger float-right mr-2",3,"click",4,"ngIf"],[1,"d-inline-block","text-danger","float-right","mr-2"],["pTooltip","Loading types...","tooltipPosition","left",1,"fas","fa-spinner","fa-fw","fa-spin","fa-lg"],[1,"mr-2","font-weight-bold","float-right","matchCircle",3,"pTooltip"],["href","javascript:;",1,"text-danger","float-right","mr-2",3,"click"]],template:function(t,s){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span",2),e._UZ(3,"i",3),e.YNc(4,se,15,8,"span",4),e.YNc(5,ie,9,5,"span",4),e.YNc(6,ae,11,6,"span",4),e.YNc(7,ne,13,7,"span",4),e.YNc(8,de,9,5,"span",4),e.YNc(9,re,9,5,"span",4),e.YNc(10,ce,5,3,"span",4),e.YNc(11,_e,5,3,"span",4),e.YNc(12,pe,5,3,"span",4),e.YNc(13,le,7,4,"span",4),e.YNc(14,Ce,9,5,"span",4),e.YNc(15,ge,9,6,"span",4),e.YNc(16,Se,13,8,"span",4),e.YNc(17,Te,7,4,"span",4),e.YNc(18,Ee,5,3,"span",4),e.YNc(19,fe,5,3,"span",4),e.YNc(20,Ie,5,3,"span",4),e.YNc(21,Ae,11,6,"span",4),e.YNc(22,ye,9,5,"span",4),e.YNc(23,Pe,9,5,"span",4),e.YNc(24,be,9,5,"span",4),e.YNc(25,je,9,5,"span",4),e.YNc(26,Me,5,3,"span",4),e.qZA(),e.YNc(27,De,11,5,"span",4),e.qZA(),e.TgZ(28,"div",5)(29,"app-monaco-editor",6),e.NdJ("editorGenerated",function(v){return s.editorGenerated(v)}),e.qZA()()(),e._UZ(30,"app-insert-code-modal",7,8)(32,"app-monaco-editor-modal",9,10)),2&t&&(e.xp6(4),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DATABASE_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.COLLECTION_HOOKS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_API_HOOKS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.MIGRATION_SCRIPT),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.PROCESS_INITIALIZER),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SCHEDULERS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.EVENTS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.I18N_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SECRET_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SYSTEM_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.INSTANCE_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.THIRD_PARTY_API_SETTINGS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.SCHEMA_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DB_MASTERS_JSON),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.DB_MASTERS_JS_UTILS),e.xp6(1),e.Q6J("ngIf",s.codeObj&&s.codeObj.apiCategory===s.EAPICategory.UI_MAKER_UTILITY_CLASS),e.xp6(1),e.Q6J("ngIf",s.codeObj.apiCategory),e.xp6(2),e.Q6J("isSchemaEditor",!0)("editorOptions",s.editorOptionsEditorCodeFinder),e.xp6(1),e.Q6J("frameId","idInsertCodeFinder")("modalId","idInsertCodeFinderForm")("docsHostPort",s.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInCodeFinder")("editorOptionsMonacoEditorModal",s.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[D.O5,D.PC,V.y,G.P,z.O,X.u,ee.A],styles:[".from-modal[_ngcontent-%COMP%]{height:calc(100vh - 117px)}.from-page[_ngcontent-%COMP%]{height:calc(100vh - 87px)}.matchCircle[_ngcontent-%COMP%]{background-color:#ff0;border-radius:10px;padding:0 6px;color:#000}"],changeDetection:0})}return i})()},17566:(R,A,a)=>{a.d(A,{Q:()=>E});var c=a(15861),p=a(51162),O=a(45085),n=a(94946),u=a(53429),f=a(95852),d=a(99961),y=a(32915),P=a(77240),b=a(60095),e=a(96814),j=a(97680),S=a(33259);function T(I,Z){if(1&I&&(n.TgZ(0,"span",23),n._uU(1),n.qZA()),2&I){const l=n.oxw();n.xp6(1),n.hij("Total Items: ",l.searchArrays.length,"")}}function U(I,Z){1&I&&n._UZ(0,"p-progressSpinner",24)}let E=(()=>{class I{instanceS;authCS;ns;eventCenterS;cd;generalS;loading={grid:!1};subscriptions=[];searchArrays=[];gridKey=p.iH._id;searchText="";isCaseSensitive=!1;constructor(l,m,r,h,_,g){this.instanceS=l,this.authCS=m,this.ns=r,this.eventCenterS=h,this.cd=_,this.generalS=g}ngOnInit(){this.generalS.setNewTitle("API Maker - Code Finder")}codeSearch(){var l=this;return(0,c.Z)(function*(){try{l.loading.grid=!0;const m={text:l.searchText.trim(),user:l.authCS.getUserId(),isCaseSensitive:l.isCaseSensitive};if(m.text){const r=yield l.instanceS.codeFinderData(m);if(r.success)if(l.searchArrays=r.data,l.searchArrays.length)l.showDataInUI();else{const h=[];h.push('<div class="bold text-warning cursor-pointer pt-3 text-center">\n <span class="pl-2">No match found</span>\n </div>'),$("[name='codeBlock']").html(h.join("")),l.eventCenterS.codeFinderResult.next([])}}l.loading.grid=!1,l.cd.detectChanges()}catch(m){l.ns.showErrorFromResponse(m.error||m,"Unable to code search.")}})()}showDataInUI(){const l=[],m=[];for(const r of this.searchArrays){const h=this.searchArrays.indexOf(r);let _="",g="";r.apiCategory===O.R.SCHEDULERS?(_="SCH",g="Scheduler"):r.apiCategory===O.R.MIGRATION_SCRIPT?(_="DB-MS",g="Database Migration Script"):r.apiCategory===O.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE?(_="WSN",g="WebSocket User Can Connect"):r.apiCategory===O.R.PROCESS_INITIALIZER?(_="PI",g="Process Initializer"):r.apiCategory===O.R.EVENTS?(_="EV",g="Event"):r.apiCategory===O.R.CUSTOM_APIS?(_="CA",g="Custom APIs"):r.apiCategory===O.R.THIRD_PARTY_APIS?(_="TP",g="Third Party APIs"):r.apiCategory===O.R.THIRD_PARTY_API_SETTINGS_JSON?(_="TP-S",g="Third Party API Settings"):r.apiCategory===O.R.INSTANCE_API_SETTINGS_JSON?(_="INS-J",g="Instance APIs Settings"):r.apiCategory===O.R.INSTANCE_API_HOOKS_JSON?(_="INS-API-Hook",g="Instance APIs Hooks"):r.apiCategory===O.R.INSTANCE_HOOKS?(_="INS-Hook",g="Instance Hooks"):r.apiCategory===O.R.DATABASE_HOOKS?(_="DB-Hook",g="Database Hooks"):r.apiCategory===O.R.COLLECTION_HOOKS?(_="COL-Hook",g="Collection Hooks"):r.apiCategory===O.R.SYSTEM_API_SETTINGS_JSON?(_="SYS-J",g="System API Settings"):r.apiCategory===O.R.SYSTEM_API_HOOKS_JSON?(_="SYS-Hook",g="System API Hooks"):r.apiCategory===O.R.UTILITY_CLASS?(_="UTIL",g="Utility Classes"):r.apiCategory===O.R.I18N_JSON?(_="I18N",g="Internationalization Settings"):r.apiCategory===O.R.SECRET_JSON?(_="SEC",g="Secret"):r.apiCategory===O.R.SCHEMA_JSON?(_="SC",g="Schema"):r.apiCategory===O.R.DB_MASTERS_JSON?(_="DMC",g="DB Master Config"):r.apiCategory===O.R.DB_MASTERS_JS_UTILS?(_="DMU",g="DB Master Utils"):r.apiCategory===O.R.UI_MAKER_UTILITY_CLASS?(_="UMU",g="UI Maker Utils"):(_=r.categoryName,g=r.categoryName),r.prefix=_,r.tooltip=g,r.versionUI="-1"===r?.version?"Original":r?.version?r.version:"",l.push('<div class="bold cursor-pointer pt-1">'),l.push('<i class="fas fa-times fa-fw text-danger float-right pt-1 nameRemoveSearchResultBlock"></i>'),l.push(`<span class="pl-2 font-weight-bold" title="${g}">${_} :</span>`),r.name&&l.push(`<span class="pl-2">${r.name}</span>`),r.versionUI&&l.push(`<span class="pl-2 small text-secondary">${"("+r.versionUI+")"}</span>`),r.hookType&&l.push(`<span class="pl-2 small">${"["+r.hookType+"]"}</span>`),l.push(`<pre class="h-100 language-javascript m-1 cursor-pointer"><code name="namePrismCss" id="idCodeFinder_${h}" class="language-javascript"></code></pre>`),l.push("</div>"),m.push({i:h,code:r.apiCode})}$("[name='codeBlock']").html(l.join(""));for(const r of m)$(`#idCodeFinder_${r.i}`).text(r.code),Prism.highlightElement(document.getElementById(`idCodeFinder_${r.i}`));this.cd.detectChanges(),$("pre.language-javascript").on("click",r=>{$("pre.bg-primary").removeClass("bg-primary"),$(r.currentTarget.className+=" bg-primary");const h=$(r.currentTarget.childNodes).attr("id").split("_")[1];this.searchArrays[h].searchKeyWord=this.searchText.trim(),this.eventCenterS.codeFinderResult.next([this.searchArrays[h]])}),$("i.nameRemoveSearchResultBlock").on("click",r=>{const h=Number($(r.currentTarget).parent().find("code[name=namePrismCss]").attr("id").split("_")[1]);this.searchArrays.splice(h,1),this.showDataInUI()})}clear(){this.searchText="",this.eventCenterS.codeFinderResult.next([]),$("[name='codeBlock']").empty(),this.searchArrays=[]}static \u0275fac=function(m){return new(m||I)(n.Y36(u.E),n.Y36(f.D),n.Y36(d.W),n.Y36(y.u),n.Y36(n.sBO),n.Y36(P.b))};static \u0275cmp=n.Xpm({type:I,selectors:[["app-code-finder-search"]],decls:26,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header","font-weight-normal"],["src","/assets/images/icons/finder.svg","alt","Code Finder",1,"fa-fw","mr-1"],["class","pl-3 text-info",4,"ngIf"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/features/code-finder.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"pt-1","pl-1","pr-1"],[1,"input-group","input-group-sm","mb-1"],["name","searchText","id","code_search","placeholder","Enter To Search",1,"form-control","form-control-sm",3,"ngModel","ngModelChange","keyup.enter"],[1,"input-group-append"],["type","button","pTooltip","Clear","tooltipPosition","bottom",1,"btn","btn-outline-warning",3,"click"],[1,"fas","fa-ban","fa-fw"],["type","button","data-toggle","dropdown","pTooltip","Case Sensitive","aria-haspopup","true","aria-expanded","false",1,"btn","btn-outline-info"],[1,"fas","fa-ellipsis-v"],[1,"dropdown-menu","pl-4"],["type","checkbox","name","idIsCaseSensitive","id","idIsCaseSensitive",1,"p-checkbox",2,"vertical-align","middle!important",3,"ngModel","ngModelChange"],["for","idIsCaseSensitive",1,"pt-1","pl-2"],[1,"card-body","p-0","h-100","overflow-auto"],[1,"position-relative","h-100"],[1,"overflow-auto"],["name","codeBlock"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"pl-3","text-info"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(m,r){1&m&&(n.TgZ(0,"div",0)(1,"div",1)(2,"span"),n._UZ(3,"img",2),n._uU(4," Search"),n.qZA(),n.YNc(5,T,2,1,"span",3),n.TgZ(6,"div",4)(7,"a",5),n._UZ(8,"img",6),n.qZA()()(),n.TgZ(9,"div",7)(10,"div",8)(11,"input",9),n.NdJ("ngModelChange",function(_){return r.searchText=_})("keyup.enter",function(){return r.codeSearch()}),n.qZA(),n.TgZ(12,"div",10)(13,"button",11),n.NdJ("click",function(){return r.clear()}),n._UZ(14,"i",12),n.qZA(),n.TgZ(15,"button",13),n._UZ(16,"i",14),n.qZA(),n.TgZ(17,"div",15)(18,"input",16),n.NdJ("ngModelChange",function(_){return r.isCaseSensitive=_}),n.qZA(),n.TgZ(19,"label",17),n._uU(20,"Case Sensitive"),n.qZA()()()()(),n.TgZ(21,"div",18)(22,"div",19)(23,"div",20),n._UZ(24,"div",21),n.YNc(25,U,1,0,"p-progressSpinner",22),n.qZA()()()()),2&m&&(n.xp6(5),n.Q6J("ngIf",r.searchArrays.length),n.xp6(6),n.Q6J("ngModel",r.searchText),n.xp6(7),n.Q6J("ngModel",r.isCaseSensitive),n.xp6(7),n.Q6J("ngIf",r.loading.grid))},dependencies:[b.Fj,b.Wl,b.JJ,b.On,e.O5,j.G,S.u],encapsulation:2,changeDetection:0})}return I})()},53300:(R,A,a)=>{a.d(A,{k:()=>b});var c=a(51162),p=a(94946),O=a(77240),n=a(96814),u=a(17566),f=a(365);const d=["codeFinderResult"],y=function(e,j){return{"col-4":e,"d-none":j}},P=function(e,j){return{"col-8":e,"col-12":j}};let b=(()=>{class e{cd;generalS;modalId="idDefaultCodeFinderId";loading={grid:!1};subscriptions=[];gridKey=c.iH._id;codeFinderResult;constructor(S,T){this.cd=S,this.generalS=T}ngOnInit(){setTimeout(()=>{this.codeFinderResult.layout=this},1e3)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(T){return new(T||e)(p.Y36(p.sBO),p.Y36(O.b))};static \u0275cmp=p.Xpm({type:e,selectors:[["app-code-finder-w"]],viewQuery:function(T,U){if(1&T&&p.Gf(d,5),2&T){let E;p.iGM(E=p.CRH())&&(U.codeFinderResult=E.first)}},inputs:{modalId:"modalId"},decls:7,vars:9,consts:[[1,"pt-1","pl-1","pr-1"],[1,"row","m-0","overflow-hidden","code-finder-height"],[1,"p-0","h-100",3,"ngClass"],[1,"w-100"],[1,"w-100",3,"modalId"],["codeFinderResult",""]],template:function(T,U){if(1&T&&(p.TgZ(0,"div",0)(1,"div",1)(2,"div",2),p._UZ(3,"app-code-finder-search",3),p.qZA(),p.TgZ(4,"div",2),p._UZ(5,"app-code-finder-result",4,5),p.qZA()()()),2&T){const E=p.MAs(6);p.xp6(2),p.Q6J("ngClass",p.WLB(3,y,!E.isResponseCollapsed,E.isResponseCollapsed)),p.xp6(2),p.Q6J("ngClass",p.WLB(6,P,!E.isResponseCollapsed,E.isResponseCollapsed)),p.xp6(1),p.Q6J("modalId",U.modalId)}},dependencies:[n.mk,u.Q,f.n],encapsulation:2,changeDetection:0})}return e})()},27470:(R,A,a)=>{a.r(A),a.d(A,{CodeFinderM:()=>j});var c=a(77664),p=a(17017),O=a(63726),n=a(53300),y=(a(92883),a(17566),a(365),a(44950)),P=a(94946);const b=[{path:"finder",component:n.k,canActivate:[O.P]}];let j=(()=>{class S{static \u0275fac=function(E){return new(E||S)};static \u0275mod=P.oAB({type:S});static \u0275inj=P.cJS({imports:[c.Bz.forChild(b),p.u,y.A]})}return S})()}}]);