@sava-info-systems/api-maker-with-extensions 1.19.7 → 1.19.8

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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[238],{238:(Z,d,a)=>{a.r(d),a.d(d,{CodeComparatorModelM:()=>y});var c=a(7664),l=a(7017),i=a(5861),o=a(4946),p=a(6814),m=a(756),f=a(7680);const u=["editorSchemaNative"];function C(e,A){1&e&&o._UZ(0,"p-progressSpinner",7)}const g=[{path:"",component:(()=>{class e{cd;loading={form:!1};editorOptionsAnalysis={readOnly:!1,language:"typescript",contextmenu:!1};rows=[];rowsMap={};editorSchemaNative;editorAnalysis;constructor(t){this.cd=t}ngOnInit(){var t=this;return(0,i.Z)(function*(){setTimeout((0,i.Z)(function*(){yield t.compareData()}),500)})()}compareData(){var t=this;return(0,i.Z)(function*(){t.loading.form=!0,t.editorSchemaNative.initDiffEditor("","","typescript",!0,!1),t.loading.form=!1,t.cd.detectChanges()})()}static \u0275fac=function(r){return new(r||e)(o.Y36(o.sBO))};static \u0275cmp=o.Xpm({type:e,selectors:[["app-code-comparator-model"]],viewQuery:function(r,n){if(1&r&&o.Gf(u,5),2&r){let s;o.iGM(s=o.CRH())&&(n.editorSchemaNative=s.first)}},decls:9,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/comparator.svg","alt","Code Comparator",1,"fa-fw","mr-1"],[1,"full-body","p-0","overflow-hidden"],[3,"shouldReplaceValueFunction","editorOptions","editorGenerated"],["editorSchemaNative",""],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,n){1&r&&(o.TgZ(0,"div",0)(1,"div",1)(2,"span"),o._UZ(3,"img",2),o._uU(4," Code Comparator"),o.qZA()(),o.TgZ(5,"div",3)(6,"app-monaco-editor",4,5),o.NdJ("editorGenerated",function(M){return n.editorAnalysis=M}),o.qZA(),o.YNc(8,C,1,0,"p-progressSpinner",6),o.qZA()()),2&r&&(o.xp6(6),o.Q6J("shouldReplaceValueFunction",!1)("editorOptions",n.editorOptionsAnalysis),o.xp6(2),o.Q6J("ngIf",n.loading.form))},dependencies:[p.O5,m.O,f.G],encapsulation:2})}return e})(),canActivate:[a(3726).P]}];let y=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=o.oAB({type:e});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),l.u]})}return e})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4211],{241:(fe,W,o)=>{o.d(W,{$:()=>U});var b=o(5861),e=o(328),T=o(95),w=o(3157),a=o(4946),y=o(9961),B=o(3429),Q=o(7240),H=o(2915),Y=o(6814),V=o(2660),n=o(7680);function q(F,P){1&F&&(a.TgZ(0,"span"),a._UZ(1,"i",19),a._uU(2," Add Collection"),a.qZA())}function t(F,P){1&F&&(a.TgZ(0,"span"),a._UZ(1,"i",20),a._uU(2," View Collection"),a.qZA())}function L(F,P){1&F&&(a.TgZ(0,"span"),a._UZ(1,"i",21),a._uU(2," Edit Collection"),a.qZA())}function X(F,P){1&F&&(a.TgZ(0,"span"),a._uU(1,"Save Collection"),a.qZA())}function k(F,P){1&F&&(a.TgZ(0,"span"),a._uU(1,"Update Collection"),a.qZA())}function j(F,P){if(1&F){const h=a.EpF();a.TgZ(0,"button",22),a.NdJ("click",function(){a.CHM(h);const u=a.oxw();return a.KtG(u.save())}),a._UZ(1,"i",23),a.YNc(2,X,2,0,"span",4),a.YNc(3,k,2,0,"span",4),a.qZA()}if(2&F){const h=a.oxw();a.Q6J("disabled",h.form.invalid),a.xp6(2),a.Q6J("ngIf",h.data.mode===h.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",h.data.mode===h.EFormMode.EDIT)}}function z(F,P){1&F&&a._UZ(0,"p-progressSpinner",24)}let U=(()=>{class F{fb;ns;instanceS;generalS;eventCenterS;data;loading={form:!1};EFormMode=e.D;form;subscriptions=[];constructor(h,v,u,x,M){this.fb=h,this.ns=v,this.instanceS=u,this.generalS=x,this.eventCenterS=M}ngOnInit(){var h=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var v=(0,b.Z)(function*(u){u&&(h.form.enable(),u.action===w.F.OPEN_FORM_IN_EDIT_MODE?(h.form.reset(),h.form.patchValue(h.data.formData)):u.action===w.F.OPEN_FORM_IN_VIEW_MODE?(h.form.reset(),h.form.patchValue(h.data.formData),h.form.disable()):u.action===w.F.OPEN_FORM_IN_ADD_MODE&&h.form.reset())});return function(u){return v.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[T.kI.required]]})}showModal(){$("#idCollectionsForm").modal("show")}hideModal(){$("#idCollectionsForm").modal("hide")}save(){var h=this;return(0,b.Z)(function*(){const v=h.form.getRawValue();try{h.loading.form=!0;const u=h.eventCenterS.instance.selectedInstances.value[0],x=h.eventCenterS.database.selectedDatabases.value[0].db;let M;if(h.data.mode===e.D.ADD)M=yield h.instanceS.createCollection(u,x,v).toPromise();else if(h.data.mode===e.D.EDIT){const K={oldName:h.data.formData.name,newName:v.name};M=yield h.instanceS.renameCollection(u,x,K).toPromise()}h.ns.showSuccess(`Collection ${h.data.mode===e.D.ADD?"added":"renamed"} successfully.`),h.data.eventChannel.emit({action:h.data.mode===e.D.ADD?w.F.SAVED:w.F.UPDATED}),h.loading.form=!1}catch(u){console.log(u),h.loading.form=!1,h.ns.showErrorFromResponse(u.error||u,"Unable to save.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(v){return new(v||F)(a.Y36(T.qu),a.Y36(y.W),a.Y36(B.E),a.Y36(Q.b),a.Y36(H.u))};static \u0275cmp=a.Xpm({type:F,selectors:[["app-w-collections-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idCollectionsForm","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(v,u){1&v&&(a.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),a.YNc(4,q,3,0,"span",4),a.YNc(5,t,3,0,"span",4),a.YNc(6,L,3,0,"span",4),a.TgZ(7,"button",5)(8,"span",6),a._UZ(9,"i",7),a.qZA()()(),a.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),a._uU(14,"Name"),a.qZA(),a.TgZ(15,"div",12),a._UZ(16,"input",13),a.qZA()()()(),a.TgZ(17,"div",14)(18,"button",15),a._UZ(19,"i",16),a._uU(20," Close"),a.qZA(),a.YNc(21,j,4,3,"button",17),a.qZA(),a.YNc(22,z,1,0,"p-progressSpinner",18),a.qZA()()()),2&v&&(a.xp6(4),a.Q6J("ngIf",u.data.mode===u.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",u.data.mode===u.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",u.data.mode===u.EFormMode.EDIT),a.xp6(5),a.Q6J("formGroup",u.form),a.xp6(10),a.Q6J("ngIf",u.data.mode!==u.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",u.loading.form))},dependencies:[T._Y,T.Fj,T.JJ,T.JL,T.sg,T.u,Y.O5,V.y,n.G],encapsulation:2})}return F})()},6937:(fe,W,o)=>{o.d(W,{n:()=>O});var b=o(5861),e=o(4946),T=o(3157),w=o(328),a=o(6212),y=o(6990),Q=o(3620),H=o(7848),Y=o(1162),V=o(3429),n=o(7240),q=o(9961),t=o(2189),L=o(7414),X=o(2915),k=o(5219),j=o(95),z=o(6814),U=o(5431),F=o(7680),P=o(3259),h=o(8057),v=o(241);const u=["collectionsFormC"];function x(p,E){1&p&&(e.TgZ(0,"th",13),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function M(p,E){1&p&&(e.TgZ(0,"th",14),e._uU(1,"Pre"),e.qZA())}function J(p,E){1&p&&(e.TgZ(0,"th",14),e._uU(1,"Post"),e.qZA())}function K(p,E){1&p&&e._UZ(0,"th",15)}function te(p,E){1&p&&e._UZ(0,"th",15)}function ne(p,E){1&p&&e._UZ(0,"th",15)}function ae(p,E){1&p&&e._UZ(0,"th",16)}function le(p,E){1&p&&e._UZ(0,"th",16)}function re(p,E){if(1&p&&(e.TgZ(0,"tr"),e.YNc(1,x,2,0,"th",9),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA(),e.YNc(4,M,2,0,"th",10),e.YNc(5,J,2,0,"th",10),e.YNc(6,K,1,0,"th",11),e.YNc(7,te,1,0,"th",11),e.YNc(8,ne,1,0,"th",11),e.YNc(9,ae,1,0,"th",12),e.YNc(10,le,1,0,"th",12),e.qZA()),2&p){const l=e.oxw(3);e.xp6(1),e.Q6J("ngIf",l.showCheckbox),e.xp6(3),e.Q6J("ngIf",l.showHooksCount),e.xp6(1),e.Q6J("ngIf",l.showHooksCount),e.xp6(1),e.Q6J("ngIf",!l.isDependentOnGroup&&!l.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!l.isDependentOnGroup&&!l.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!l.isDependentOnGroup&&!l.isFilterLogTable&&l.isVisibleTableChange),e.xp6(1),e.Q6J("ngIf",l.isDependentOnGroup||l.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",l.isDependentOnGroup||l.isFilterLogTable)}}function ce(p,E){if(1&p&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",22),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("value",l)("pSelectableRow",l)}}function ge(p,E){if(1&p&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Oqu(l.name)}}function de(p,E){if(1&p&&(e.TgZ(0,"span",23),e._UZ(1,"i",24),e._uU(2),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(2),e.hij(" ",l.name,"")}}function ue(p,E){if(1&p&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Oqu(l.preHookCount||"")}}function _e(p,E){if(1&p&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Oqu(l.postHookCount||"")}}function he(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(5);return e.KtG(A.menuSchemaClicked())}),e.qZA()}}function pe(p,E){if(1&p&&(e.TgZ(0,"td"),e.YNc(1,he,1,0,"i",26),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",l.schemaIsGenerated)}}function me(p,E){1&p&&e._UZ(0,"i",29)}function Ce(p,E){if(1&p&&(e.TgZ(0,"td"),e.YNc(1,me,1,0,"i",28),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",l.collectionSettingIsCreated)}}function ve(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"i",31),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(5);return e.KtG(A.showComparison())}),e.qZA()}}function Se(p,E){if(1&p&&(e.TgZ(0,"td"),e.YNc(1,ve,1,0,"i",30),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",l.isChangeHappenedInTable)}}function De(p,E){if(1&p&&(e.TgZ(0,"td")(1,"span",32),e._uU(2),e.qZA()()),2&p){const l=e.oxw().$implicit;e.xp6(2),e.Oqu(l.instanceName.toString().substring(0,3).toUpperCase())}}function be(p,E){if(1&p&&(e.TgZ(0,"td")(1,"span",32),e._uU(2),e.qZA()()),2&p){const l=e.oxw().$implicit;e.xp6(2),e.Oqu(l.databaseName.toString().substring(0,3).toUpperCase())}}function xe(p,E){if(1&p&&(e.TgZ(0,"tr",17),e.YNc(1,ce,2,2,"td",18),e.TgZ(2,"td",19),e.YNc(3,ge,2,1,"span",18),e.YNc(4,de,3,1,"span",20),e.qZA(),e.YNc(5,ue,2,1,"td",21),e.YNc(6,_e,2,1,"td",21),e.YNc(7,pe,2,1,"td",18),e.YNc(8,Ce,2,1,"td",18),e.YNc(9,Se,2,1,"td",18),e.YNc(10,De,3,1,"td",18),e.YNc(11,be,3,1,"td",18),e.qZA()),2&p){const l=E.$implicit,D=e.oxw(3);e.Q6J("pSelectableRow",l),e.xp6(1),e.Q6J("ngIf",D.showCheckbox),e.xp6(2),e.Q6J("ngIf",!l.isCollectionDeleted),e.xp6(1),e.Q6J("ngIf",l.isCollectionDeleted),e.xp6(1),e.Q6J("ngIf",D.showHooksCount),e.xp6(1),e.Q6J("ngIf",D.showHooksCount),e.xp6(1),e.Q6J("ngIf",!D.isDependentOnGroup&&!D.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!D.isDependentOnGroup&&!D.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!D.isDependentOnGroup&&!D.isFilterLogTable&&D.isVisibleTableChange),e.xp6(1),e.Q6J("ngIf",D.isDependentOnGroup||D.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",D.isDependentOnGroup||D.isFilterLogTable)}}function Ie(p,E){1&p&&e._UZ(0,"p-progressSpinner",33)}function Te(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"div",4)(1,"p-table",5),e.NdJ("selectionChange",function(A){e.CHM(l);const G=e.oxw(2);return e.KtG(G.selectedRows=A)})("selectionChange",function(){e.CHM(l);const A=e.oxw(2);return e.KtG(A.collectionSelected())})("dblclick",function(){e.CHM(l);const A=e.oxw(2);return e.KtG(A.dblClickCollections())}),e.YNc(2,re,11,8,"ng-template",6),e.YNc(3,xe,12,11,"ng-template",7),e.qZA(),e.YNc(4,Ie,1,0,"p-progressSpinner",8),e.qZA()}if(2&p){const l=e.oxw(2);e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",l.metaKeySelection)("selection",l.selectedRows)("dataKey",l.gridKey)("scrollable",!0)("value",l.rows),e.xp6(3),e.Q6J("ngIf",l.loading.grid)}}function Ee(p,E){if(1&p&&e.YNc(0,Te,5,7,"div",3),2&p){const l=e.oxw();e.Q6J("ngIf",!(l.eventCenterS.group.apisRegex.allInstances||l.eventCenterS.filterInLog.apisRegex.allInstances||l.eventCenterS.group.apisRegex.allDatabases||l.eventCenterS.group.apisRegex.allCollections))}}function Ae(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",46),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.menuSchemaClicked())}),e._UZ(1,"img",47),e.qZA()}}function C(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",48),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.add())}),e._UZ(1,"i",49),e.qZA()}}function R(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",50),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.edit())}),e._UZ(1,"i",51),e.qZA()}}function c(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",52),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.removePermanentDialog())}),e._UZ(1,"i",53),e.qZA()}}function S(p,E){if(1&p&&(e.TgZ(0,"span")(1,"a",40),e._UZ(2,"img",41),e.qZA(),e.YNc(3,Ae,2,0,"span",42),e.YNc(4,C,2,0,"span",43),e.YNc(5,R,2,0,"span",44),e.YNc(6,c,2,0,"span",45),e.qZA()),2&p){const l=e.oxw(2);e.xp6(3),e.Q6J("ngIf",l.selectedRows.length),e.xp6(1),e.Q6J("ngIf",l.eventCenterS.instance.selectedInstances.value.length&&l.eventCenterS.database.selectedDatabases.value.length&&l.addCollectionFromApiMaker),e.xp6(1),e.Q6J("ngIf",l.selectedRows.length&&l.instanceType===l.EInstanceType.MONGO_DB),e.xp6(1),e.Q6J("ngIf",l.selectedRows.length&&l.instanceType===l.EInstanceType.MONGO_DB)}}function d(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",54)(1,"label",55)(2,"p-checkbox",56),e.NdJ("ngModelChange",function(A){e.CHM(l);const G=e.oxw(2);return e.KtG(G.eventCenterS.group.apisRegex.allCollections=A)}),e.qZA()()()}if(2&p){const l=e.oxw(2);e.xp6(2),e.Q6J("ngModel",l.eventCenterS.group.apisRegex.allCollections)("binary",!0)}}function I(p,E){if(1&p&&(e.TgZ(0,"div")(1,"div",57),e._uU(2),e.qZA()()),2&p){const l=e.oxw(2);e.xp6(2),e.Oqu(l.constantsS.group.allCollectionsPermitted)}}function i(p,E){1&p&&e.GkF(0)}function m(p,E){if(1&p&&(e.TgZ(0,"div",34)(1,"div",35)(2,"span"),e._UZ(3,"i",36),e._uU(4," Collections"),e.qZA(),e.YNc(5,S,7,4,"span",18),e.YNc(6,d,3,2,"span",37),e.qZA(),e.TgZ(7,"div",38),e.YNc(8,I,3,1,"div",18),e.YNc(9,i,1,0,"ng-container",39),e.qZA()()),2&p){const l=e.oxw(),D=e.MAs(1);e.xp6(5),e.Q6J("ngIf",!l.isReadOnly),e.xp6(1),e.Q6J("ngIf",l.isDependentOnGroup),e.xp6(2),e.Q6J("ngIf",l.eventCenterS.group.apisRegex.allInstances||l.eventCenterS.filterInLog.apisRegex.allInstances||l.eventCenterS.group.apisRegex.allDatabases||l.eventCenterS.group.apisRegex.allCollections),e.xp6(1),e.Q6J("ngTemplateOutlet",D)}}function g(p,E){if(1&p&&e._UZ(0,"app-w-collections-form",58,59),2&p){const l=e.oxw();e.Q6J("data",l.data)}}let O=(()=>{class p{instanceS;generalS;notificationS;navigationCS;constantsS;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;IsBulkSchemaGenerator=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};instanceType;EInstanceType=H.d;selectedRows=[];gridKey=Y.iH._id;addCollectionFromApiMaker=!1;isVisibleTableChange=!1;collectionsFormC;constructor(l,D,A,G,ee,se,oe,ie){this.instanceS=l,this.generalS=D,this.notificationS=A,this.navigationCS=G,this.constantsS=ee,this.cd=se,this.eventCenterS=oe,this.confirmationService=ie}ngOnInit(){var l=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var D=(0,b.Z)(function*(A){(A.action===T.F.SAVED||A.action===T.F.UPDATED)&&(l.collectionsFormC.hideModal(),yield l.loadGridData())});return function(A){return D.apply(this,arguments)}}())),this.eventCenterS.collection.selectedCollections.next([]),this.subscriptions.push(this.eventCenterS.database.selectedDatabases.pipe((0,Q.b)(300)).subscribe(function(){var D=(0,b.Z)(function*(A){yield l.loadGridData()});return function(A){return D.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.instance.selectedInstances.pipe((0,Q.b)(300)).subscribe(function(){var D=(0,b.Z)(function*(A){const G=A[0];l.instanceType=G?G.type:void 0,l.addCollectionFromApiMaker=!1,"MONGO_DB"===l.instanceType&&(l.addCollectionFromApiMaker=!0)});return function(A){return D.apply(this,arguments)}}()))}resetGridAndUrl(){var l=this;return(0,b.Z)(function*(){l.rows=[],l.selectedRows=[],l.rowsMap={},l.eventCenterS.collection.selectedCollections.next([])})()}loadGridData(){var l=this;return(0,b.Z)(function*(){const D=l.eventCenterS.database.selectedDatabases.value;D&&0!==D.length&&D[0]?(l.loading.grid=!0,l.isVisibleTableChange=!1,l.resetGridAndUrl(),l.subscriptions.push(l.instanceS.getCollections(D).subscribe(function(){var A=(0,b.Z)(function*(G){if(G.success){l.selectedRows=[],l.rows=y.flatten(G.data||[]),l.rowsMap=y.keyBy(l.rows,Y.iH._id),l.showHooksCount&&(yield l.instanceS.setHooksCountInCollectionArr(D[0].instanceName,D[0].db,l.rows));for(const se of l.rows)if(se.isChangeHappenedInTable){l.isVisibleTableChange=!0;break}}else l.resetGridAndUrl();const ee=l.navigationCS.getQueryParam(a.p.collection)||(l.isFilterLogTable?l.eventCenterS.filterInLog.collectionIds.value.join(","):l.eventCenterS.group.collectionNames.value.join(","));if(ee){const se=ee.split(","),oe=y.intersection(y.keys(l.rowsMap),se),ie=[];for(const Pe of oe)l.rowsMap[Pe]&&ie.push(l.rowsMap[Pe]);l.selectedRows=ie,l.eventCenterS.collection.selectedCollections.next(ie),l.isDependentOnGroup&&l.eventCenterS.group.collectionNames.next(oe),l.isFilterLogTable&&(l.eventCenterS.filterInLog.collectionIds.next(oe),l.eventCenterS.filterInLog.collectionNames.next(y.map(l.selectedRows,"name")))}l.loading.grid=!1,l.cd.detectChanges()});return function(G){return A.apply(this,arguments)}}()))):l.resetGridAndUrl()})()}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),this.collectionsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=w.D.VIEW,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_VIEW_MODE}),this.collectionsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=w.D.EDIT,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_EDIT_MODE}),this.collectionsFormC.showModal()}removePermanentDialog(){var l=this;return(0,b.Z)(function*(){var D;l.confirmationService.confirm({message:l.constantsS.collection.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(D=(0,b.Z)(function*(){yield l.removePermanent()}),function(){return D.apply(this,arguments)})})})()}removePermanent(){var l=this;return(0,b.Z)(function*(){const D=l.eventCenterS.instance.selectedInstances.value[0],A=l.eventCenterS.database.selectedDatabases.value[0].db,G=l.selectedRows[0].name;l.loading.grid=!0;try{const ee=yield l.instanceS.dropCollection(D,A,G).toPromise();l.loading.grid=!1,ee.success?(l.notificationS.showSuccess(l.constantsS.collection.removePermanent),l.selectedRows.length=0,l.loadGridData()):l.notificationS.showErrorFromResponse(ee,l.constantsS.collection.removePermanentError)}catch(ee){l.notificationS.showErrorMessageFromErrorObject(ee),l.loading.grid=!1}})()}collectionSelected(){var l=this;return(0,b.Z)(function*(){l.eventCenterS.collection.selectedCollections.next(l.selectedRows),l.IsBulkSchemaGenerator||(l.isDependentOnGroup||l.isFilterLogTable?(l.isDependentOnGroup&&l.eventCenterS.group.collectionNames.next(y.map(l.selectedRows,"_id")),l.isFilterLogTable&&(l.eventCenterS.filterInLog.collectionIds.next(y.map(l.selectedRows,"_id")),l.eventCenterS.filterInLog.collectionNames.next(y.map(l.selectedRows,"name")))):(yield l.navigationCS.setQueryParam(a.p.collection,y.map(l.selectedRows,"_id").join(",")||null),yield l.navigationCS.setQueryParam(a.p.collection_api,null)))})()}menuSchemaClicked(){setTimeout(()=>{this.eventCenterS.apiCell.eventChannelSchema.emit({action:T.F.OPEN_FORM_IN_DECIDE_MODE})},100)}showComparison(){setTimeout(()=>{this.eventCenterS.apiCell.eventChannelSchema.emit({action:T.F.OPEN_FORM_IN_DECIDE_MODE,isOpen:"compareMode"})},100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickCollections(){this.selectedRows.length&&this.eventCenterS.apiCell.eventChannelSchema.emit({action:T.F.OPEN_FORM_IN_DECIDE_MODE})}static \u0275fac=function(D){return new(D||p)(e.Y36(V.E),e.Y36(n.b),e.Y36(q.W),e.Y36(t.S),e.Y36(L.L),e.Y36(e.sBO),e.Y36(X.u),e.Y36(k.YP))};static \u0275cmp=e.Xpm({type:p,selectors:[["app-w-collections"]],viewQuery:function(D,A){if(1&D&&e.Gf(u,5),2&D){let G;e.iGM(G=e.CRH())&&(A.collectionsFormC=G.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],IsBulkSchemaGenerator:"IsBulkSchemaGenerator",isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:4,vars:2,consts:[["modalGrid",""],["class","card shadow-sm h-100",4,"ngIf"],[3,"data",4,"ngIf"],["class","h-100",4,"ngIf"],[1,"h-100"],["styleClass","p-datatable-striped collection-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 40px;",4,"ngIf"],["style","width: 42px;",4,"ngIf"],["style","width: 50px;",4,"ngIf"],[2,"width","45px"],[2,"width","40px"],[2,"width","42px"],[2,"width","50px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"word-break-all"],["tooltipPosition","left","pTooltip","Table/Collection is not prsent but schema is present.","class","text-muted italic",4,"ngIf"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],["tooltipPosition","left","pTooltip","Table/Collection is not prsent but schema is present.",1,"text-muted","italic"],[1,"fas","fa-feather-alt","fa-fw"],[1,"text-center"],["tooltipPosition","left","pTooltip","Schema is generated.","class","fas fa-receipt text-warning fa-fw cursor-pointer",3,"click",4,"ngIf"],["tooltipPosition","left","pTooltip","Schema is generated.",1,"fas","fa-receipt","text-warning","fa-fw","cursor-pointer",3,"click"],["tooltipPosition","left","pTooltip","Collection settings are there.","class","fas fa-cog text-danger fa-fw cursor-pointer",4,"ngIf"],["tooltipPosition","left","pTooltip","Collection settings are there.",1,"fas","fa-cog","text-danger","fa-fw","cursor-pointer"],["class","fas fa-retweet fa-fw align-middle text-warning cursor-pointer",3,"click",4,"ngIf"],[1,"fas","fa-retweet","fa-fw","align-middle","text-warning","cursor-pointer",3,"click"],[1,"text-monospace","small"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-border-all","text-success","fa-fw","mr-1"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Collections",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngTemplateOutlet"],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html#collections","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Add/Edit Schema",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Add New",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["tooltipPosition","left","pTooltip","Add/Edit Schema",1,"float-right","cursor-pointer","ml-3",3,"click"],["src","/assets/images/icons/bulkschema.svg",2,"width","18px","margin-left","1px","margin-bottom","3px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Collections",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[3,"data"],["collectionsFormC",""]],template:function(D,A){1&D&&(e.YNc(0,Ee,1,1,"ng-template",null,0,e.W1O),e.YNc(2,m,10,4,"div",1),e.YNc(3,g,2,1,"app-w-collections-form",2)),2&D&&(e.xp6(2),e.Q6J("ngIf",!A.IsBulkSchemaGenerator),e.xp6(1),e.Q6J("ngIf",!A.IsBulkSchemaGenerator))},dependencies:[j.JJ,j.On,z.O5,z.tP,U.iA,k.jx,U.Ei,U.UA,U.Mo,F.G,P.u,h.XZ,v.$]})}return p})()},740:(fe,W,o)=>{o.d(W,{c:()=>S});var b=o(5861),e=o(3157),T=o(328),w=o(6990),a=function(d){return d.double="double",d.string="string",d.object="object",d.array="array",d.binData="binData",d.undefined="undefined",d.objectId="objectId",d.bool="bool",d.date="date",d.null="null",d.regex="regex",d.dbPointer="dbPointer",d.javascript="javascript",d.symbol="symbol",d.javascriptWithScope="javascriptWithScope",d.int="int",d.timestamp="timestamp",d.long="long",d.decimal="decimal",d.minKey="minKey",d.maxKey="maxKey",d}(a||{}),y=o(9361),B=o(1162),Q=o(553),H=o(1601),Y=o(3531),V=o(9989),n=o(4946),q=o(95),t=o(9961),L=o(9530),X=o(3429),k=o(7240),j=o(5852),z=o(2915),U=o(6162),F=o(2304),P=o(7414),h=o(5219),v=o(6814),u=o(2660),x=o(5860),M=o(756),J=o(7680),K=o(4844),te=o(3259),ne=o(5025);const ae=["editorSchemaNative"],le=["monacoEditorModalC"],re=["insertCodeModalC"];function ce(d,I){if(1&d&&(n.TgZ(0,"span",37),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances||null==i.eventCenterS.instance.selectedInstances.value[0]?null:i.eventCenterS.instance.selectedInstances.value[0].name)}}function ge(d,I){if(1&d&&(n.TgZ(0,"span",38),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases||null==i.eventCenterS.database.selectedDatabases.value[0]?null:i.eventCenterS.database.selectedDatabases.value[0].db)}}function de(d,I){if(1&d&&(n.TgZ(0,"span",39),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections||null==i.eventCenterS.collection.selectedCollections.value[0]?null:i.eventCenterS.collection.selectedCollections.value[0].name)}}function ue(d,I){if(1&d&&(n.TgZ(0,"span"),n._UZ(1,"i",32),n.TgZ(2,"span"),n._uU(3," Add Schema "),n.qZA(),n.YNc(4,ce,2,1,"span",33),n.TgZ(5,"span",34),n._uU(6," \u25b8 "),n.qZA(),n.YNc(7,ge,2,1,"span",35),n.TgZ(8,"span",34),n._uU(9," \u25b8 "),n.qZA(),n.YNc(10,de,2,1,"span",36),n.qZA()),2&d){const i=n.oxw();n.xp6(4),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances?null:i.eventCenterS.instance.selectedInstances.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases?null:i.eventCenterS.database.selectedDatabases.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections?null:i.eventCenterS.collection.selectedCollections.value)}}function _e(d,I){1&d&&(n.TgZ(0,"span"),n._UZ(1,"i",40),n._uU(2," View Schema"),n.qZA())}function he(d,I){if(1&d&&(n.TgZ(0,"span",37),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances||null==i.eventCenterS.instance.selectedInstances.value[0]?null:i.eventCenterS.instance.selectedInstances.value[0].name)}}function pe(d,I){if(1&d&&(n.TgZ(0,"span",38),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases||null==i.eventCenterS.database.selectedDatabases.value[0]?null:i.eventCenterS.database.selectedDatabases.value[0].db)}}function me(d,I){if(1&d&&(n.TgZ(0,"span",39),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections||null==i.eventCenterS.collection.selectedCollections.value[0]?null:i.eventCenterS.collection.selectedCollections.value[0].name)}}function Ce(d,I){if(1&d&&(n.TgZ(0,"span"),n._UZ(1,"i",41),n.TgZ(2,"span"),n._uU(3," Edit Schema "),n.qZA(),n.YNc(4,he,2,1,"span",33),n.TgZ(5,"span",34),n._uU(6," \u25b8 "),n.qZA(),n.YNc(7,pe,2,1,"span",35),n.TgZ(8,"span",34),n._uU(9," \u25b8 "),n.qZA(),n.YNc(10,me,2,1,"span",36),n.qZA()),2&d){const i=n.oxw();n.xp6(4),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances?null:i.eventCenterS.instance.selectedInstances.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases?null:i.eventCenterS.database.selectedDatabases.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections?null:i.eventCenterS.collection.selectedCollections.value)}}function ve(d,I){1&d&&n._UZ(0,"p-progressSpinner",44)}function Se(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"div",15)(1,"app-monaco-editor",42,43),n.NdJ("editorGenerated",function(g){n.CHM(i);const O=n.oxw();return n.KtG(O.editorGenerated(g))}),n.qZA(),n.YNc(3,ve,1,0,"p-progressSpinner",17),n.qZA()}if(2&d){const i=n.oxw();n.xp6(1),n.Q6J("shouldReplaceValueFunction",!1)("isSchemaEditor",!0)("editorOptions",i.editorOptionsSchema),n.xp6(2),n.Q6J("ngIf",i.loading.form)}}function De(d,I){1&d&&n._UZ(0,"p-progressSpinner",44)}function be(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"i",45),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.removePermanentDialog())}),n.qZA()}}function xe(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"i",46),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.syncSchema())}),n.qZA()}}function Ie(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"i",47),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.resetSchemaSyncEditor())}),n.qZA()}}function Te(d,I){1&d&&(n.TgZ(0,"span"),n._uU(1,"Save Schema"),n.qZA())}function Ee(d,I){1&d&&(n.TgZ(0,"span"),n._uU(1,"Update & Close"),n.qZA())}function Ae(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"button",48),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.save(!0))}),n._UZ(1,"i",49),n.YNc(2,Te,2,0,"span",4),n.YNc(3,Ee,2,0,"span",4),n.qZA()}if(2&d){const i=n.oxw();n.Q6J("disabled",i.isDiffEditorEnable),n.xp6(2),n.Q6J("ngIf",i.mode===i.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",i.mode===i.EFormMode.EDIT)}}function C(d,I){1&d&&(n.TgZ(0,"span"),n._uU(1,"Update"),n.qZA())}function R(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"button",50),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.save(!1))}),n._UZ(1,"i",49),n.YNc(2,C,2,0,"span",4),n.qZA()}if(2&d){const i=n.oxw();n.Q6J("disabled",i.isDiffEditorEnable),n.xp6(2),n.Q6J("ngIf",i.mode===i.EFormMode.EDIT)}}function c(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"a",51),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.viewError())}),n._uU(1),n.qZA()}if(2&d){const i=n.oxw();n.xp6(1),n.hij("View ",i.modalTitle," ")}}let S=(()=>{class d{fb;ns;schemaS;instanceS;generalS;authCS;eventCenterS;validationS;monacoS;constantsS;cd;notificationS;confirmationService;generalCS;mode=T.D.ADD;loading={form:!1};EFormMode=T.D;subscriptions=[];analysisData={fields:[]};analysisDataDiff={fields:[]};schemaData={properties:{}};bsonTypes=[];editorOptionsAnalysis={readOnly:!0,language:"json",contextmenu:!1};editorOptionsSchema={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};editorSchemaNative;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;isFirstTimeEditorSchemaGenerated=!0;editorSchema;editorAnalysis;isDiffEditorEnable=!1;BE_HOST_PORT=Q.N.BE_HOST_PORT;codeVersions;modalTitle;constructor(i,m,g,O,p,E,l,D,A,G,ee,se,oe,ie){this.fb=i,this.ns=m,this.schemaS=g,this.instanceS=O,this.generalS=p,this.authCS=E,this.eventCenterS=l,this.validationS=D,this.monacoS=A,this.constantsS=G,this.cd=ee,this.notificationS=se,this.confirmationService=oe,this.generalCS=ie}ngOnInit(){var i=this;this.subscriptions.push(this.eventCenterS.apiCell.eventChannelSchema.subscribe(function(){var m=(0,b.Z)(function*(g){if(g)if(g.action===e.F.OPEN_FORM_IN_DECIDE_MODE){i.loading.form=!0;const O=yield i.schemaS.getCurrentSchema();i.eventCenterS.apiCell.eventChannelSchema.emit(O?{action:e.F.OPEN_FORM_IN_EDIT_MODE,data:O}:{action:e.F.OPEN_FORM_IN_ADD_MODE}),setTimeout((0,b.Z)(function*(){"compareMode"===g.isOpen&&(yield i.syncSchema())}),500),i.loading.form=!1}else g.action===e.F.OPEN_FORM_IN_EDIT_MODE?(i.mode=T.D.EDIT,i.schemaData=g.data,i.showModal(),i.patchForm(i.schemaData)):g.action===e.F.OPEN_FORM_IN_VIEW_MODE?(i.mode=T.D.VIEW,i.showModal()):g.action===e.F.OPEN_FORM_IN_ADD_MODE&&(i.mode=T.D.ADD,i.loading.form=!0,i.resetForm(),i.showModal(),i.analysisData=yield i.loadAnalysisData(),setTimeout(()=>{i.generalCS.setValueInEditor(i,"editorSchema",i.analysisData.fieldsString),i.generalCS.setValueInEditor(i,"editorAnalysis",i.generalS.stringify(i.analysisData.fields))},500),i.loading.form=!1)});return function(g){return m.apply(this,arguments)}}()));for(const m of w.keys(a))this.bsonTypes.push(m)}insertCodeModalC;showInsertCodeModel(){this.generalCS.messageReceivedFor=y.H.Schema,this.insertCodeModalC.showModal(Y.b.CreateSchemaFormC)}editorGenerated(i){var m=this;return(0,b.Z)(function*(){m.editorSchema=i,m.isFirstTimeEditorSchemaGenerated&&(yield m.monacoS.loadSchemaEditorSettings(m.BE_HOST_PORT,m.authCS.getUserId(),null)),m.isFirstTimeEditorSchemaGenerated=!1,m.monacoS.addSaveCodeKeyBinding(i,g=>{m.isDiffEditorEnable||m.save(!1)}),m.monacoS.addInsertCodeKeyBinding(i,g=>{m.generalCS.messageReceivedFor=y.H.Schema,m.insertCodeModalC.showModal(Y.b.CreateSchemaFormC)}),m.subscriptions.push(m.generalS.messageReceived.subscribe(g=>{g.type&&g.type===V.g.TEXT_COPIED&&g.componentName===Y.b.CreateSchemaFormC&&(m.monacoS.insertAtCursor(i,g.selectedText),m.insertCodeModalC.hideModal())}))})()}resetForm(){this.schemaData={properties:{}},this.editorSchema&&this.editorSchema.setValue(""),this.editorAnalysis&&this.editorAnalysis.setValue("")}patchForm(i){setTimeout(()=>{this.editorSchema&&this.editorSchema.setValue(i.propertiesCode),this.editorAnalysis&&this.editorAnalysis.setValue("")},500)}loadAnalysisData(){var i=this;return(0,b.Z)(function*(){const m=i.eventCenterS.instance.selectedInstances.value,g=i.eventCenterS.database.selectedDatabases.value,O=i.eventCenterS.collection.selectedCollections.value;try{const p=yield i.instanceS.getSchema(m[0],g[0].db,O[0].name).toPromise();for(const E of p.warnings||[])i.notificationS.showWarning(E.message);return p.data}catch{return{fields:[]}}})()}validateAndSetBeforeSave(){var i=this;return(0,b.Z)(function*(){i.schemaData.instanceName=i.eventCenterS.instance.selectedInstances.value[0].name,i.schemaData.collectionName=i.schemaData.collectionName=i.eventCenterS.collection.selectedCollections.value[0].name,i.schemaData.databaseName=i.eventCenterS.database.selectedDatabases.value[0].db,i.schemaData.propertiesCode=i.editorSchema.getValue(),i.schemaData.user=i.authCS.getUserId()})()}save(i){var m=this;return(0,b.Z)(function*(){try{if(!m.validateAndSetBeforeSave())return;let O;m.loading.form=!0,m.lastError=void 0,m.monacoS.clearEditorDecorations(m.editorSchema,m.monacoDecorations),m.mode===T.D.ADD?O=yield m.schemaS.post(m.schemaData).toPromise():m.mode===T.D.EDIT&&(O=yield m.schemaS.put(m.schemaData._id,m.schemaData,{select:B.iH._id}).toPromise()),m.ns.showSuccess(`Schema ${m.mode===T.D.ADD?"added":"updated"} successfully.`),O.warnings?.length?(m.lastError=O.warnings,m.modalTitle="Warnings"):i&&m.hideModal(),m.eventCenterS.apiCell.eventChannelSchema.emit({action:m.mode===T.D.ADD?e.F.SAVED:e.F.UPDATED}),m.eventCenterS.schemaSaved.next(!0),m.eventCenterS.database.selectedDatabases.next([...m.eventCenterS.database.selectedDatabases.value]),m.loading.form=!1}catch(g){const O=g?.error?.errors||[];O.length&&m.notificationS.showError(O[0].message),m.loading.form=!1,m.lastError=g.error,m.modalTitle="Error info",m.tab=m.tab||{},m.tab.axiosResponse={data:g.error},m.monacoS.highlightErrorInMonacoEditor(m.editorSchema,m.tab,"MainSandbox.ts",m.monacoDecorations)}})()}removePermanentDialog(){var i=this;return(0,b.Z)(function*(){var m;i.confirmationService.confirm({message:i.constantsS.schema.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(m=(0,b.Z)(function*(){yield i.removePermanent()}),function(){return m.apply(this,arguments)})})})()}removePermanent(){var i=this;return(0,b.Z)(function*(){i.loading.form=!0;const m=yield i.schemaS.permanentDelete(i.schemaData._id).toPromise();i.loading.form=!1,m.success?(i.notificationS.showSuccess(i.constantsS.schema.removePermanent),i.hideModal(),i.eventCenterS.schemaSaved.next(!0)):i.notificationS.showErrorFromResponse(m,i.constantsS.schema.removePermanentError)})()}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{this.editorSchemaNative.createEditor(),this.isDiffEditorEnable=!1,$("#idCreateSchemaForm").modal("show")},100)}hideModal(){$("#idCreateSchemaForm").modal("hide")}syncSchema(){var i=this;return(0,b.Z)(function*(){i.loading.form=!0,i.isDiffEditorEnable=!0,i.analysisDataDiff=yield i.loadAnalysisData(),yield i.editorSchemaNative.initDiffEditor(i.editorSchema.getValue(),i.analysisDataDiff.fieldsString,"typescript",!0,!0),i.loading.form=!1})()}resetSchemaSyncEditor(){var i=this;return(0,b.Z)(function*(){i.isDiffEditorEnable=!1;const m=i.editorSchemaNative.editorDiff.getModel().original.getValue();i.editorSchemaNative.createEditor(m)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),H.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(m){return new(m||d)(n.Y36(q.qu),n.Y36(t.W),n.Y36(L.$),n.Y36(X.E),n.Y36(k.b),n.Y36(j.D),n.Y36(z.u),n.Y36(U.m),n.Y36(F.b),n.Y36(P.L),n.Y36(n.sBO),n.Y36(t.W),n.Y36(h.YP),n.Y36(k.b))};static \u0275cmp=n.Xpm({type:d,selectors:[["app-create-schema-form"]],viewQuery:function(m,g){if(1&m&&(n.Gf(ae,5),n.Gf(le,5),n.Gf(re,5)),2&m){let O;n.iGM(O=n.CRH())&&(g.editorSchemaNative=O.first),n.iGM(O=n.CRH())&&(g.viewDockerfileModelC=O.first),n.iGM(O=n.CRH())&&(g.insertCodeModalC=O.first)}},decls:36,vars:19,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idCreateSchemaForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[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","text-info",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body"],[3,"header"],["class","overflow-hidden","style","height: calc(100vh - 183px);",4,"ngIf"],["header","Data Analysis"],[1,"overflow-hidden",2,"height","calc(100vh - 183px)"],[3,"editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"modal-footer"],[1,"w-100"],["class","far fa-trash-alt fa-fw text-danger cursor-pointer align-bottom",3,"click",4,"ngIf"],["class","fas fa-sync fa-fw text-info cursor-pointer align-bottom ml-2",3,"click",4,"ngIf"],["class","fas fa-redo fa-fw text-info cursor-pointer fa-flip-horizontal align-bottom ml-2",3,"click",4,"ngIf"],["class","btn btn-primary btn-sm float-right","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-primary btn-sm float-right mr-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["type","button",1,"btn","btn-sm","btn-secondary","float-right","mr-2",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["href","javascript:;","class","text-danger float-right mr-1",3,"click",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["class","text-warning pl-5","pTooltip","Instance",4,"ngIf"],[1,"ml-2"],["class","text-light ml-2","pTooltip","Database",4,"ngIf"],["class","text-success ml-2","pTooltip","Collection",4,"ngIf"],["pTooltip","Instance",1,"text-warning","pl-5"],["pTooltip","Database",1,"text-light","ml-2"],["pTooltip","Collection",1,"text-success","ml-2"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[3,"shouldReplaceValueFunction","isSchemaEditor","editorOptions","editorGenerated"],["editorSchemaNative",""],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"far","fa-trash-alt","fa-fw","text-danger","cursor-pointer","align-bottom",3,"click"],[1,"fas","fa-sync","fa-fw","text-info","cursor-pointer","align-bottom","ml-2",3,"click"],[1,"fas","fa-redo","fa-fw","text-info","cursor-pointer","fa-flip-horizontal","align-bottom","ml-2",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","mr-2",3,"disabled","click"],["href","javascript:;",1,"text-danger","float-right","mr-1",3,"click"]],template:function(m,g){1&m&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,ue,11,3,"span",4),n.YNc(5,_e,3,0,"span",4),n.YNc(6,Ce,11,3,"span",4),n.TgZ(7,"div",5)(8,"button",6),n.NdJ("click",function(){return g.hideModal()}),n.TgZ(9,"span",7),n._UZ(10,"i",8),n.qZA()(),n.TgZ(11,"span",9),n.NdJ("click",function(){return g.showInsertCodeModel()}),n._UZ(12,"i",10),n.qZA()()(),n.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),n.YNc(16,Se,4,4,"div",13),n.qZA(),n.TgZ(17,"p-tabPanel",14)(18,"div",15)(19,"app-monaco-editor",16),n.NdJ("editorGenerated",function(p){return g.editorAnalysis=p}),n.qZA(),n.YNc(20,De,1,0,"p-progressSpinner",17),n.qZA()()()(),n.TgZ(21,"div",18)(22,"div",19),n.YNc(23,be,1,0,"i",20),n.YNc(24,xe,1,0,"i",21),n.YNc(25,Ie,1,0,"i",22),n.YNc(26,Ae,4,3,"button",23),n.YNc(27,R,3,2,"button",24),n.TgZ(28,"button",25),n.NdJ("click",function(){return g.hideModal()}),n._UZ(29,"i",26),n._uU(30," Close"),n.qZA(),n.YNc(31,c,2,1,"a",27),n.qZA()()()()(),n._UZ(32,"app-monaco-editor-modal",28,29)(34,"app-insert-code-modal",30,31)),2&m&&(n.xp6(4),n.Q6J("ngIf",g.mode===g.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT),n.xp6(9),n.MGl("header","",g.mode===g.EFormMode.ADD?"Create":"Update"," Schema"),n.xp6(1),n.Q6J("ngIf",g.shouldLoadMonacoEditor),n.xp6(3),n.Q6J("editorOptions",g.editorOptionsAnalysis),n.xp6(1),n.Q6J("ngIf",g.loading.form),n.xp6(3),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT&&!g.isDiffEditorEnable),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT&&g.isDiffEditorEnable),n.xp6(1),n.Q6J("ngIf",g.mode!==g.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT),n.xp6(4),n.Q6J("ngIf",g.lastError),n.xp6(1),n.Q6J("modalId","idMonacoEditorModalInSchema")("editorOptionsMonacoEditorModal",g.editorOptionsMonacoEditorModal)("modalTitle",g.modalTitle),n.xp6(2),n.Q6J("frameId","IdInsertCodeSchema")("modalId","IdInsertCodeSchemaModal")("docsHostPort","https://docs.apimaker.dev/v1/examples/sys/schema/schema.html"))},dependencies:[v.O5,u.y,x.P,M.O,J.G,K.xf,K.x4,te.u,ne.A],encapsulation:2})}return d})()},2571:(fe,W,o)=>{o.d(W,{d:()=>P});var b=o(5861),e=o(6990),w=o(1162),a=o(4946),y=o(95),B=o(9961),Q=o(3429),H=o(5852),Y=o(7240),V=o(9530),n=o(2915),q=o(6814),t=o(2660),L=o(5431),X=o(5219),k=o(7680);function j(h,v){1&h&&(a.TgZ(0,"tr")(1,"th",18),a._UZ(2,"p-tableHeaderCheckbox"),a.qZA(),a.TgZ(3,"th"),a._uU(4,"Collection/Table name"),a.qZA()())}function z(h,v){if(1&h&&(a.TgZ(0,"tr",19)(1,"td"),a._UZ(2,"p-tableCheckbox",20),a.qZA(),a.TgZ(3,"td"),a._uU(4),a.qZA()()),2&h){const u=v.$implicit;a.Q6J("pSelectableRow",u),a.xp6(2),a.Q6J("value",u)("pSelectableRow",u),a.xp6(2),a.Oqu(u.name)}}function U(h,v){1&h&&a._UZ(0,"p-progressSpinner",21)}function F(h,v){1&h&&a._UZ(0,"p-progressSpinner",21)}let P=(()=>{class h{fb;ns;instanceS;authCS;generalS;schemaS;cd;eventCenterS;subscriptions=[];loading={grid:!1};rows=[];rowsMap={};selectedRows=[];gridKey=w.iH._id;constructor(u,x,M,J,K,te,ne,ae){this.fb=u,this.ns=x,this.instanceS=M,this.authCS=J,this.generalS=K,this.schemaS=te,this.cd=ne,this.eventCenterS=ae}ngOnInit(){}loadGridData(){var u=this;return(0,b.Z)(function*(){const x=u.eventCenterS.database.selectedDatabases.value;u.loading.grid=!0,u.subscriptions.push(u.instanceS.getCollections(x).subscribe(M=>{if(M.success){u.selectedRows=[];const J=e.filter(e.flatten(M.data||[]),{schemaIsGenerated:!1});u.rows=e.flatten(J||[]),u.rowsMap=e.keyBy(u.rows,w.iH._id)}u.loading.grid=!1,u.cd.detectChanges()}))})()}showSchemaModal(){var u=this;return(0,b.Z)(function*(){$("#idBulkSchemaCreationModal").modal("show"),yield u.loadGridData()})()}hideSchemaModal(){$("#idBulkSchemaCreationModal").modal("hide")}generateSchemas(){var u=this;return(0,b.Z)(function*(){try{const x=u.selectedRows;u.loading.grid=!0;for(const M of x)try{const J=yield u.instanceS.getSchemaByInstanceName(M.instanceName,M.databaseName,M.name).toPromise(),K={instanceName:M.instanceName,collectionName:M.name,databaseName:M.databaseName,propertiesCode:J.data.fieldsString,user:u.authCS.getUserId()};(yield u.schemaS.post(K).toPromise()).success&&u.ns.showSuccess(`'${M.name}' schema created successfully.`)}catch{u.ns.showError(`'${M.name}' schema creation failed.`)}u.eventCenterS.database.selectedDatabases.next([...u.eventCenterS.database.selectedDatabases.value]),u.hideSchemaModal(),u.loading.grid=!1}catch(x){const M=x?.error?.errors||[];M.length&&u.ns.showError(M[0].message),u.loading.grid=!1}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(x){return new(x||h)(a.Y36(y.qu),a.Y36(B.W),a.Y36(Q.E),a.Y36(H.D),a.Y36(Y.b),a.Y36(V.$),a.Y36(a.sBO),a.Y36(n.u))};static \u0275cmp=a.Xpm({type:h,selectors:[["app-w-bulk-schema-generator"]],decls:24,vars:8,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idBulkSchemaCreationModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[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"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 152px)",3,"selectionMode","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[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"],[2,"width","45px"],[3,"pSelectableRow"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(x,M){1&x&&(a.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),a._UZ(5,"i",4),a._uU(6," Bulk Schemas Create"),a.qZA(),a.TgZ(7,"button",5)(8,"span",6),a._UZ(9,"i",7),a.qZA()()(),a.TgZ(10,"div",8)(11,"p-table",9),a.NdJ("selectionChange",function(K){return M.selectedRows=K}),a.YNc(12,j,5,0,"ng-template",10),a.YNc(13,z,5,4,"ng-template",11),a.qZA(),a.YNc(14,U,1,0,"p-progressSpinner",12),a.qZA(),a.TgZ(15,"div",13)(16,"button",14),a._UZ(17,"i",15),a._uU(18," Close"),a.qZA(),a.TgZ(19,"button",16),a.NdJ("click",function(){return M.generateSchemas()}),a._UZ(20,"i",17),a.TgZ(21,"span"),a._uU(22,"Generate Schemas"),a.qZA()()(),a.YNc(23,F,1,0,"p-progressSpinner",12),a.qZA()()()),2&x&&(a.xp6(11),a.Q6J("selectionMode","multiple")("selection",M.selectedRows)("dataKey",M.gridKey)("scrollable",!0)("value",M.rows),a.xp6(3),a.Q6J("ngIf",M.loading.grid),a.xp6(5),a.Q6J("disabled",!M.selectedRows.length),a.xp6(4),a.Q6J("ngIf",M.loading.grid))},dependencies:[q.O5,t.y,L.iA,X.jx,L.Ei,L.UA,L.Mo,k.G]})}return h})()},5597:(fe,W,o)=>{o.d(W,{H:()=>F});var b=o(5861),e=o(328),T=o(95),w=o(3157),a=o(4946),y=o(9961),B=o(3429),Q=o(7240),H=o(5852),Y=o(2915),V=o(6814),n=o(2660),q=o(7680);function t(P,h){1&P&&(a.TgZ(0,"span"),a._UZ(1,"i",19),a._uU(2," Add Database"),a.qZA())}function L(P,h){1&P&&(a.TgZ(0,"span"),a._UZ(1,"i",20),a._uU(2," View Database"),a.qZA())}function X(P,h){1&P&&(a.TgZ(0,"span"),a._UZ(1,"i",21),a._uU(2," Edit Database"),a.qZA())}function k(P,h){1&P&&(a.TgZ(0,"span"),a._uU(1,"Save Database"),a.qZA())}function j(P,h){1&P&&(a.TgZ(0,"span"),a._uU(1,"Update Database"),a.qZA())}function z(P,h){if(1&P){const v=a.EpF();a.TgZ(0,"button",22),a.NdJ("click",function(){a.CHM(v);const x=a.oxw();return a.KtG(x.save())}),a._UZ(1,"i",23),a.YNc(2,k,2,0,"span",4),a.YNc(3,j,2,0,"span",4),a.qZA()}if(2&P){const v=a.oxw();a.Q6J("disabled",v.form.invalid),a.xp6(2),a.Q6J("ngIf",v.data.mode===v.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",v.data.mode===v.EFormMode.EDIT)}}function U(P,h){1&P&&a._UZ(0,"p-progressSpinner",24)}let F=(()=>{class P{fb;ns;instanceS;generalS;authCS;eventCenter;data;loading={form:!1};EFormMode=e.D;form;subscriptions=[];constructor(v,u,x,M,J,K){this.fb=v,this.ns=u,this.instanceS=x,this.generalS=M,this.authCS=J,this.eventCenter=K}ngOnInit(){var v=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var u=(0,b.Z)(function*(x){x&&(v.form.enable(),x.action===w.F.OPEN_FORM_IN_EDIT_MODE?(v.form.reset(),v.form.patchValue({name:v.data.formData.db})):x.action===w.F.OPEN_FORM_IN_VIEW_MODE?(v.form.reset(),v.form.patchValue({name:v.data.formData.db}),v.form.disable()):x.action===w.F.OPEN_FORM_IN_ADD_MODE&&v.form.reset())});return function(x){return u.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[T.kI.required]]})}showModal(){$("#idDatabasesForm").modal("show")}hideModal(){$("#idDatabasesForm").modal("hide")}save(){var v=this;return(0,b.Z)(function*(){const u=v.form.getRawValue();try{v.loading.form=!0;const x=v.eventCenter.instance.selectedInstances.value[0];let M;v.data.mode===e.D.ADD&&(M=yield v.instanceS.createDatabase(x,u).toPromise()),v.ns.showSuccess(`Database ${v.data.mode===e.D.ADD?"created":"renamed"} successfully.`),v.data.eventChannel.emit({action:v.data.mode===e.D.ADD?w.F.SAVED:w.F.UPDATED}),v.loading.form=!1}catch(x){v.loading.form=!1,v.ns.showErrorFromResponse(x.error||x,"Unable to save database.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(u){return new(u||P)(a.Y36(T.qu),a.Y36(y.W),a.Y36(B.E),a.Y36(Q.b),a.Y36(H.D),a.Y36(Y.u))};static \u0275cmp=a.Xpm({type:P,selectors:[["app-w-databases-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDatabasesForm","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"],["maxlength","50","formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide database 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(u,x){1&u&&(a.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),a.YNc(4,t,3,0,"span",4),a.YNc(5,L,3,0,"span",4),a.YNc(6,X,3,0,"span",4),a.TgZ(7,"button",5)(8,"span",6),a._UZ(9,"i",7),a.qZA()()(),a.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),a._uU(14,"Name"),a.qZA(),a.TgZ(15,"div",12),a._UZ(16,"input",13),a.qZA()()()(),a.TgZ(17,"div",14)(18,"button",15),a._UZ(19,"i",16),a._uU(20," Close"),a.qZA(),a.YNc(21,z,4,3,"button",17),a.qZA(),a.YNc(22,U,1,0,"p-progressSpinner",18),a.qZA()()()),2&u&&(a.xp6(4),a.Q6J("ngIf",x.data.mode===x.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",x.data.mode===x.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",x.data.mode===x.EFormMode.EDIT),a.xp6(5),a.Q6J("formGroup",x.form),a.xp6(10),a.Q6J("ngIf",x.data.mode!==x.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",x.loading.form))},dependencies:[T._Y,T.Fj,T.JJ,T.JL,T.nD,T.sg,T.u,V.O5,n.y,q.G],encapsulation:2})}return P})()},559:(fe,W,o)=>{o.d(W,{O:()=>Ae});var b=o(5861),e=o(4946),T=o(3157),w=o(328),a=o(6212),y=o(6990),Q=o(3620),H=o(7848),Y=o(1162),V=o(3429),n=o(7240),q=o(9961),t=o(5219),L=o(2189),X=o(7414),k=o(2915),j=o(95),z=o(6814),U=o(5431),F=o(7680),P=o(3259),h=o(8057),v=o(5597),u=o(2571);const x=["databasesFormC"],M=["bulkSchemaGeneratorC"];function J(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",15),e.NdJ("click",function(){e.CHM(c);const d=e.oxw(2);return e.KtG(d.add())}),e._UZ(1,"i",16),e.qZA()}}function K(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(c);const d=e.oxw(2);return e.KtG(d.bulkSchemaCreation())}),e._UZ(1,"img",18),e.qZA()}}function te(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(c);const d=e.oxw(2);return e.KtG(d.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function ne(C,R){if(1&C&&(e.TgZ(0,"span")(1,"a",10),e._UZ(2,"img",11),e.qZA(),e.YNc(3,J,2,0,"span",12),e.YNc(4,K,2,0,"span",13),e.YNc(5,te,2,0,"span",14),e.qZA()),2&C){const c=e.oxw();e.xp6(3),e.Q6J("ngIf",c.eventCenterS.instance.selectedInstances.value.length>0&&c.instanceType===c.EInstanceType.MONGO_DB),e.xp6(1),e.Q6J("ngIf",c.selectedRows.length),e.xp6(1),e.Q6J("ngIf",c.selectedRows.length)}}function ae(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",21)(1,"label",22)(2,"p-checkbox",23),e.NdJ("ngModelChange",function(d){e.CHM(c);const I=e.oxw();return e.KtG(I.eventCenterS.group.apisRegex.allDatabases=d)}),e.qZA()()()}if(2&C){const c=e.oxw();e.xp6(2),e.Q6J("ngModel",c.eventCenterS.group.apisRegex.allDatabases)("binary",!0)}}function le(C,R){if(1&C&&(e.TgZ(0,"div")(1,"div",24),e._uU(2),e.qZA()()),2&C){const c=e.oxw();e.xp6(2),e.Oqu(c.constantsS.group.allDatabasesPermitted)}}function re(C,R){1&C&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ce(C,R){1&C&&(e.TgZ(0,"th",35),e._uU(1,"Pre"),e.qZA())}function ge(C,R){1&C&&(e.TgZ(0,"th",35),e._uU(1,"Post"),e.qZA())}function de(C,R){1&C&&(e.TgZ(0,"th"),e._uU(1,"Size"),e.qZA())}function ue(C,R){1&C&&e._UZ(0,"th",36)}function _e(C,R){1&C&&e._UZ(0,"th",37)}function he(C,R){if(1&C&&(e.TgZ(0,"tr"),e.YNc(1,re,2,0,"th",30),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA(),e.YNc(4,ce,2,0,"th",31),e.YNc(5,ge,2,0,"th",31),e.YNc(6,de,2,0,"th",3),e.YNc(7,ue,1,0,"th",32),e.YNc(8,_e,1,0,"th",33),e.qZA()),2&C){const c=e.oxw(2);e.xp6(1),e.Q6J("ngIf",c.showCheckbox),e.xp6(3),e.Q6J("ngIf",c.showHooksCount),e.xp6(1),e.Q6J("ngIf",c.showHooksCount),e.xp6(1),e.Q6J("ngIf",!c.isDependentOnGroup&&!c.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!c.isDependentOnGroup&&!c.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",c.isDependentOnGroup||c.isFilterLogTable)}}function pe(C,R){if(1&C&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",43),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Q6J("value",c)("pSelectableRow",c)}}function me(C,R){if(1&C&&(e.TgZ(0,"span",44),e._UZ(1,"i",45),e.qZA()),2&C){const c=e.oxw().$implicit;e.Q6J("pTooltip","Original name is : "+c.originalDBNameBeforeMask)}}function Ce(C,R){if(1&C&&(e.TgZ(0,"td",46),e._uU(1),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Oqu(c.preHookCount||"")}}function ve(C,R){if(1&C&&(e.TgZ(0,"td",46),e._uU(1),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Oqu(c.postHookCount||"")}}function Se(C,R){if(1&C&&(e.TgZ(0,"td",47),e._uU(1),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Oqu(c.sizeUser)}}function De(C,R){1&C&&e._UZ(0,"i",49)}function be(C,R){if(1&C&&(e.TgZ(0,"td"),e.YNc(1,De,1,0,"i",48),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",c.databaseSettingIsCreated)}}function xe(C,R){if(1&C&&(e.TgZ(0,"td")(1,"span",50),e._uU(2),e.qZA()()),2&C){const c=e.oxw().$implicit;e.xp6(2),e.Oqu(c.instanceName.toString().substring(0,3).toUpperCase())}}function Ie(C,R){if(1&C&&(e.TgZ(0,"tr",38),e.YNc(1,pe,2,2,"td",3),e.TgZ(2,"td",39)(3,"span"),e._uU(4),e.qZA(),e.YNc(5,me,2,1,"span",40),e.qZA(),e.YNc(6,Ce,2,1,"td",41),e.YNc(7,ve,2,1,"td",41),e.YNc(8,Se,2,1,"td",42),e.YNc(9,be,2,1,"td",3),e.YNc(10,xe,3,1,"td",3),e.qZA()),2&C){const c=R.$implicit,S=e.oxw(2);e.Q6J("pSelectableRow",c),e.xp6(1),e.Q6J("ngIf",S.showCheckbox),e.xp6(3),e.Oqu(c.db),e.xp6(1),e.Q6J("ngIf",c.isMaskedName),e.xp6(1),e.Q6J("ngIf",S.showHooksCount),e.xp6(1),e.Q6J("ngIf",S.showHooksCount),e.xp6(1),e.Q6J("ngIf",!S.isDependentOnGroup&&!S.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!S.isDependentOnGroup&&!S.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",S.isDependentOnGroup||S.isFilterLogTable)}}function Te(C,R){1&C&&e._UZ(0,"p-progressSpinner",51)}function Ee(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"div",25)(1,"p-table",26),e.NdJ("selectionChange",function(d){e.CHM(c);const I=e.oxw();return e.KtG(I.selectedRows=d)})("selectionChange",function(){e.CHM(c);const d=e.oxw();return e.KtG(d.databaseSelected())}),e.YNc(2,he,9,6,"ng-template",27),e.YNc(3,Ie,11,9,"ng-template",28),e.qZA(),e.YNc(4,Te,1,0,"p-progressSpinner",29),e.qZA()}if(2&C){const c=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",c.metaKeySelection)("selection",c.selectedRows)("dataKey",c.gridKey)("scrollable",!0)("value",c.rows),e.xp6(3),e.Q6J("ngIf",c.loading.grid)}}let Ae=(()=>{class C{instanceS;generalS;notificationS;confirmationService;navigationCS;constantsS;cd;eventCenterS;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};instanceType;EInstanceType=H.d;selectedRows=[];gridKey=Y.iH._id;databasesFormC;bulkSchemaGeneratorC;constructor(c,S,d,I,i,m,g,O){this.instanceS=c,this.generalS=S,this.notificationS=d,this.confirmationService=I,this.navigationCS=i,this.constantsS=m,this.cd=g,this.eventCenterS=O}ngOnInit(){var c=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var S=(0,b.Z)(function*(d){(d.action===T.F.SAVED||d.action===T.F.UPDATED)&&(c.databasesFormC.hideModal(),yield c.loadGridData())});return function(d){return S.apply(this,arguments)}}())),this.eventCenterS.database.selectedDatabases.next([]),this.subscriptions.push(this.isFilterLogTable?this.eventCenterS.filterInLog.instanceIds.pipe((0,Q.b)(300)).subscribe(function(){var S=(0,b.Z)(function*(d){yield c.loadGridData()});return function(d){return S.apply(this,arguments)}}()):this.isDependentOnGroup?this.eventCenterS.group.instanceIds.pipe((0,Q.b)(300)).subscribe(function(){var S=(0,b.Z)(function*(d){yield c.loadGridData()});return function(d){return S.apply(this,arguments)}}()):this.eventCenterS.instance.selectedInstances.pipe((0,Q.b)(300)).subscribe(function(){var S=(0,b.Z)(function*(d){const I=d[0];c.instanceType=I?I.type:void 0,yield c.resetGridAndUrl(),yield c.loadGridData()});return function(d){return S.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.schemaSaved.subscribe(function(){var S=(0,b.Z)(function*(d){d&&(yield c.loadGridData())});return function(d){return S.apply(this,arguments)}}()))}loadGridData(){var c=this;return(0,b.Z)(function*(){let S=[];if(c.isDependentOnGroup){if(S=c.eventCenterS.group.instanceIds.value,!S.length)return void c.resetGridAndUrl()}else if(c.isFilterLogTable){if(S=c.eventCenterS.filterInLog.instanceIds.value,!S.length)return void c.resetGridAndUrl()}else if(S=c.eventCenterS.instance.selectedInstances.value,!S||0===S.length||!S[0].active)return void c.resetGridAndUrl();c.loading.grid=!0,c.subscriptions.push(c.instanceS.getDatabases(S).subscribe(function(){var d=(0,b.Z)(function*(I){if(I.success){c.selectedRows=[],c.rows=y.flatten(I.data||[]);for(const i of c.rows)i.sizeUser="number"==typeof i.storageSize?c.generalS.bytesToSize(i.storageSize):i.storageSize;c.rowsMap=y.keyBy(c.rows,Y.iH._id)}else c.resetGridAndUrl();if(c.showHooksCount&&(yield c.instanceS.setHooksCountInDatabaseArr(S[0].name,c.rows)),c.isDependentOnGroup||c.isFilterLogTable){let g;c.isDependentOnGroup?g=c.eventCenterS.group.databaseNames.value:c.isFilterLogTable&&(g=c.eventCenterS.filterInLog.databaseIds.value);const O=y.intersection(y.keys(c.rowsMap),g),p=[];for(const E of O)c.rowsMap[E]&&p.push(c.rowsMap[E]);c.selectedRows=p,c.eventCenterS.database.selectedDatabases.next(p),c.setDatabaseIds(p)}else{const i=c.navigationCS.getQueryParam(a.p.database);if(i){const m=i.split(","),g=y.intersection(y.keys(c.rowsMap),m),O=[];for(const p of g)c.rowsMap[p]&&O.push(c.rowsMap[p]);c.selectedRows=O,c.eventCenterS.database.selectedDatabases.next(O),c.setDatabaseIds(O)}}c.loading.grid=!1,c.cd.detectChanges()});return function(I){return d.apply(this,arguments)}}(),d=>{c.loading.grid=!1,c.notificationS.showErrorMessageFromErrorObject(d),c.resetGridAndUrl()}))})()}resetGridAndUrl(){var c=this;return(0,b.Z)(function*(){c.rows=[],c.selectedRows=[],c.rowsMap={},c.eventCenterS.database.selectedDatabases.next([]),c.eventCenterS.group.databaseNames.next([])})()}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),this.databasesFormC.showModal()}bulkSchemaCreation(){var c=this;return(0,b.Z)(function*(){c.data.formData=void 0,c.data.mode=w.D.ADD,c.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),yield c.bulkSchemaGeneratorC.showSchemaModal()})()}view(){this.data.formData=this.selectedRows[0],this.data.mode=w.D.VIEW,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_VIEW_MODE}),this.databasesFormC.showModal()}removePermanentDialog(){var c=this;return(0,b.Z)(function*(){let S=c.constantsS.database.removePermanentConfirm;var d;S=S.replace("'$$'",c.selectedRows[0].db),c.confirmationService.confirm({message:S,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,b.Z)(function*(){yield c.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var c=this;return(0,b.Z)(function*(){const S=c.eventCenterS.instance.selectedInstances.value[0],d=c.selectedRows[0].db;c.loading.grid=!0;try{const I=yield c.instanceS.dropDatabase(S,d).toPromise();c.loading.grid=!1,I.success?(c.notificationS.showSuccess(c.constantsS.database.removePermanent),c.selectedRows.length=0,c.loadGridData()):c.notificationS.showErrorFromResponse(I,c.constantsS.database.removePermanentError)}catch(I){c.notificationS.showErrorMessageFromErrorObject(I),c.loading.grid=!1}})()}databaseSelected(){var c=this;return(0,b.Z)(function*(){c.eventCenterS.database.selectedDatabases.next(c.selectedRows),c.isDependentOnGroup||c.isFilterLogTable?c.setDatabaseIds(c.selectedRows):(yield c.navigationCS.setQueryParam(a.p.database,y.map(c.selectedRows,"_id").join(",")||null),yield c.generalS.resetUrlParams([a.p.collection,a.p.collection_api]))})()}setDatabaseIds(c){const S=y.map(c=c||[],"_id");this.eventCenterS.group.databaseNames.next(S),this.eventCenterS.filterInLog.databaseIds.next(S),this.eventCenterS.filterInLog.databaseNames.next(y.map(c,"db"))}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(S){return new(S||C)(e.Y36(V.E),e.Y36(n.b),e.Y36(q.W),e.Y36(t.YP),e.Y36(L.S),e.Y36(X.L),e.Y36(e.sBO),e.Y36(k.u))};static \u0275cmp=e.Xpm({type:C,selectors:[["app-w-databases"]],viewQuery:function(S,d){if(1&S&&(e.Gf(x,5),e.Gf(M,5)),2&S){let I;e.iGM(I=e.CRH())&&(d.databasesFormC=I.first),e.iGM(I=e.CRH())&&(d.bulkSchemaGeneratorC=I.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:14,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-database","text-warning","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Databases",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["databasesFormC",""],["bulkSchemaGeneratorC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html#databases","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Add New Database",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Bulk Schema Creation",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Add New Database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Bulk Schema Creation",1,"float-right","cursor-pointer","ml-3",3,"click"],["src","/assets/images/icons/bulkschema.svg",2,"width","18px","margin-left","1px","margin-bottom","3px"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["pTooltip","All Databases",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped database-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["class","text-center","style","width: 40px;",4,"ngIf"],["style","width: 42px;",4,"ngIf"],["style","width: 50px;",4,"ngIf"],[2,"width","45px"],[1,"text-center",2,"width","40px"],[2,"width","42px"],[2,"width","50px"],[3,"pSelectableRow"],[1,"word-break-all"],["class","pl-2",3,"pTooltip",4,"ngIf"],["class","text-center",4,"ngIf"],["class","nowrap",4,"ngIf"],[3,"value","pSelectableRow"],[1,"pl-2",3,"pTooltip"],[1,"fas","fa-theater-masks","fa-fw","text-info"],[1,"text-center"],[1,"nowrap"],["pTooltip","Database settings are there.","class","fas fa-cog text-danger fa-fw cursor-pointer",4,"ngIf"],["pTooltip","Database settings are there.",1,"fas","fa-cog","text-danger","fa-fw","cursor-pointer"],[1,"text-monospace","small"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(S,d){1&S&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Databases"),e.qZA(),e.YNc(5,ne,6,3,"span",3),e.YNc(6,ae,3,2,"span",4),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,le,3,1,"div",3),e.YNc(9,Ee,5,7,"div",6),e.qZA()(),e._UZ(10,"app-w-databases-form",7,8)(12,"app-w-bulk-schema-generator",null,9)),2&S&&(e.xp6(5),e.Q6J("ngIf",!d.isReadOnly),e.xp6(1),e.Q6J("ngIf",d.isDependentOnGroup),e.xp6(2),e.Q6J("ngIf",d.eventCenterS.group.apisRegex.allInstances||d.eventCenterS.filterInLog.apisRegex.allInstances||d.eventCenterS.group.apisRegex.allDatabases),e.xp6(1),e.Q6J("ngIf",!(d.eventCenterS.group.apisRegex.allInstances||d.eventCenterS.filterInLog.apisRegex.allInstances||d.eventCenterS.group.apisRegex.allDatabases)),e.xp6(1),e.Q6J("data",d.data))},dependencies:[j.JJ,j.On,z.O5,U.iA,t.jx,U.Ei,U.UA,U.Mo,F.G,P.u,h.XZ,v.H,u.d]})}return C})()},4211:(fe,W,o)=>{o.r(W),o.d(W,{DbCellM:()=>lt});var b=o(7664),e=o(7017),T=o(3726),w=o(1678),a=o(9184),y=o(559),Q=(o(5597),o(6937)),Y=(o(241),o(740)),V=o(6162),n=o(2452),q=o(553),t=o(4946),L=o(2915),X=o(5860),k=o(5219),j=o(5043),z=o(3885),U=o(5861),F=o(3620),P=o(7672),h=o(9361),v=o(1162),u=o(5085),x=o(9394),M=o(1601),J=o(3531),K=o(9989),te=o(8883),ne=o(5561),ae=o(9961),le=o(3429),re=o(5852),ce=o(7414),ge=o(2304),de=o(7240),ue=o(5394),_e=o(6814),he=o(756),pe=o(7680),me=o(3259),Ce=o(5025);const ve=["monacoEditorModalC"];function Se(_,Z){1&_&&(t.TgZ(0,"a",14),t._UZ(1,"img",15),t.qZA())}function De(_,Z){1&_&&(t.TgZ(0,"a",16),t._UZ(1,"img",15),t.qZA())}function be(_,Z){1&_&&(t.TgZ(0,"a",17),t._UZ(1,"img",15),t.qZA())}function xe(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"span",18),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.save())}),t._UZ(1,"i",19),t.qZA()}}function Ie(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"span",20),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.removePermanentDialog(f.mode))}),t._UZ(1,"i",21),t.qZA()}}function Te(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"span",22),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.showInsertCodeModel())}),t._UZ(1,"i",23),t.qZA()}}function Ee(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"a",24),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.viewError())}),t._uU(1,"View error"),t.qZA()}}function Ae(_,Z){1&_&&(t.TgZ(0,"span"),t._uU(1,"Add API Settings"),t.qZA())}function C(_,Z){1&_&&(t.TgZ(0,"span"),t._uU(1,"Add Collection Settings"),t.qZA())}function R(_,Z){1&_&&(t.TgZ(0,"span"),t._uU(1,"Add Database Settings"),t.qZA())}function c(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"div",30)(1,"button",31),t.NdJ("click",function(){t.CHM(s);const f=t.oxw(2);return t.KtG(f.save())}),t._UZ(2,"i",32),t.YNc(3,Ae,2,0,"span",33),t.YNc(4,C,2,0,"span",33),t.YNc(5,R,2,0,"span",33),t.qZA()()}if(2&_){const s=t.oxw(2);t.xp6(3),t.Q6J("ngIf",s.mode===s.EInstanceApiWidgetMode.API),t.xp6(1),t.Q6J("ngIf",s.mode===s.EInstanceApiWidgetMode.Collection),t.xp6(1),t.Q6J("ngIf",s.mode===s.EInstanceApiWidgetMode.Database)}}function S(_,Z){1&_&&t._UZ(0,"p-progressSpinner",34)}function d(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"div",25),t.YNc(1,c,6,3,"div",26),t.TgZ(2,"div",27)(3,"app-monaco-editor",28),t.NdJ("editorGenerated",function(f){t.CHM(s);const N=t.oxw();return t.KtG(N.editorGenerated(f))}),t.qZA()(),t.YNc(4,S,1,0,"p-progressSpinner",29),t.qZA()}if(2&_){const s=t.oxw();t.xp6(1),t.Q6J("ngIf",!s.insApiSetting._id),t.xp6(1),t.Q6J("hidden",!s.insApiSetting._id),t.xp6(1),t.Q6J("hidden",!s.insApiSetting._id)("isSchemaEditor",!0)("editorOptions",s.editorOptionsInsApiSettingApi),t.xp6(1),t.Q6J("ngIf",s.loading.form)}}let I=(()=>{class _{groupS;navigationS;ns;instanceS;authCS;eventCenterS;constantsS;monacoS;generalCS;instanceApiSettingsS;confirmationService;cd;mode=n.a.API;insertCodeModalC;loading={form:!1};subscriptions=[];data={};EInstanceApiWidgetMode=n.a;EAPIAccessType=P.di;editorInsApiSettingApiCode;editorOptionsInsApiSettingApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insApiSetting={};BE_HOST_PORT=q.N.BE_HOST_PORT;monacoDecorations=[];tab;modalId;viewDockerfileModelC;constructor(s,r,f,N,Ze,Oe,ye,rt,ct,dt,_t,pt){this.groupS=s,this.navigationS=r,this.ns=f,this.instanceS=N,this.authCS=Ze,this.eventCenterS=Oe,this.constantsS=ye,this.monacoS=rt,this.generalCS=ct,this.instanceApiSettingsS=dt,this.confirmationService=_t,this.cd=pt}ngOnInit(){var s=this;this.mode===n.a.API?(this.subscriptions.push(this.eventCenterS.colApi.selectedApi.pipe((0,F.b)(300)).subscribe(function(){var r=(0,U.Z)(function*(f){if(!f)return s.data.selectedItem=void 0;s.data.selectedItem=f,yield s.setDataInForm(s.data.selectedItem),s.cd.detectChanges()});return function(f){return r.apply(this,arguments)}}())),this.modalId="idMonacoEditorModalInInsApiSettings"):this.mode===n.a.Collection?(this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,F.b)(300)).subscribe(function(){var r=(0,U.Z)(function*(f){if(!f||0===f.length)return s.data.selectedItem=void 0;s.data.selectedItem=f[0],s.lastError=void 0,yield s.setDataInForm(s.data.selectedItem),s.cd.detectChanges()});return function(f){return r.apply(this,arguments)}}())),this.modalId="idMonacoEditorModalInColSettings"):this.mode===n.a.Database&&(this.subscriptions.push(this.eventCenterS.database.selectedDatabases.pipe((0,F.b)(300)).subscribe(function(){var r=(0,U.Z)(function*(f){if(!f||0===f.length)return s.data.selectedItem=void 0;s.data.selectedItem=f[0],s.lastError=void 0,yield s.setDataInForm(s.data.selectedItem),s.cd.detectChanges()});return function(f){return r.apply(this,arguments)}}())),this.modalId="idMonacoEditorModalInDatabaseSettings")}setDataInForm(s){var r=this;return(0,U.Z)(function*(){r.loading.form=!0,r.lastError=void 0,r.insApiSetting=(yield r.instanceApiSettingsS.getSettings(s,r.mode))||{},(r.mode===n.a.API||r.mode===n.a.Collection||r.mode===n.a.Database)&&r.setDataInFormCommon(),r.loading.form=!1})()}setDataInFormCommon(){var s=this;return(0,U.Z)(function*(){if(s.insApiSetting._id)s.generalCS.setValueInEditor(s,"editorInsApiSettingApiCode",s.insApiSetting.instanceApiSettingCode);else if(!s.insApiSetting._id)if(s.mode===n.a.API){const r=yield s.instanceS.getDefaultContent(s.BE_HOST_PORT,u.R.INSTANCE_API_SETTINGS_JSON).toPromise();s.generalCS.setValueInEditor(s,"editorInsApiSettingApiCode",r.data)}else if(s.mode===n.a.Collection||s.mode===n.a.Database){let r;s.mode===n.a.Database?r=yield s.instanceS.getDefaultContent(s.BE_HOST_PORT,u.R.DATABASE_SETTINGS_JSON).toPromise():s.mode===n.a.Collection&&(r=yield s.instanceS.getDefaultContent(s.BE_HOST_PORT,u.R.COLLECTION_SETTINGS_JSON).toPromise()),s.generalCS.setValueInEditor(s,"editorInsApiSettingApiCode",r.data)}s.cd.detectChanges()})()}editorGenerated(s){var r=this;return(0,U.Z)(function*(){r.editorInsApiSettingApiCode=s,yield r.monacoS.loadSchemaEditorSettings(r.BE_HOST_PORT,r.authCS.getUserId(),null),r.monacoS.addSaveCodeKeyBinding(s,f=>{r.insApiSetting._id&&r.save()}),r.monacoS.addInsertCodeKeyBinding(s,f=>{r.defineEditor(),r.insertCodeModalC.showModal(J.b.InstanceApiSettingsC)}),r.subscriptions.push(r.generalCS.messageReceived.subscribe(f=>{f.type&&f.type===K.g.TEXT_COPIED&&f.componentName===J.b.InstanceApiSettingsC&&(r.generalCS.messageReceivedFor===h.H.DatabaseSettings&&r.mode===n.a.Database||r.generalCS.messageReceivedFor===h.H.CollectionSettings&&r.mode===n.a.Collection||r.generalCS.messageReceivedFor===h.H.APISettings&&r.mode===n.a.API)&&(r.monacoS.insertAtCursor(s,f.selectedText),r.insertCodeModalC.hideModal())}))})()}defineEditor(){this.mode===n.a.Database?this.generalCS.messageReceivedFor=h.H.DatabaseSettings:this.mode===n.a.Collection?this.generalCS.messageReceivedFor=h.H.CollectionSettings:this.mode===n.a.API&&(this.generalCS.messageReceivedFor=h.H.APISettings)}showInsertCodeModel(){this.defineEditor(),this.insertCodeModalC.showModal(J.b.InstanceApiSettingsC)}save(){var s=this;return(0,U.Z)(function*(){let f,r={};if(s.data.selectedItem){if(s.mode===n.a.API||s.mode===n.a.Collection?f=s.data.selectedItem.databaseName:s.mode===n.a.Database&&(f=s.data.selectedItem.db),r.instanceName=s.data.selectedItem.instanceName,r.databaseName=f,s.mode===n.a.API){const N=s.data.selectedItem;r.collectionName=N.collectionName,r.apiId=N.id,r.instanceApiSettingCode=s.editorInsApiSettingApiCode.getValue()}else s.mode===n.a.Collection?(r.collectionName=s.data.selectedItem.name,r.apiId=x.pj.__COLLECTION_SETTINGS__,r.instanceApiSettingCode=s.editorInsApiSettingApiCode.getValue()):s.mode===n.a.Database&&(r.collectionName=x.pj.__DATABASE_SETTINGS__,r.apiId=x.pj.__DATABASE_SETTINGS__,r.instanceApiSettingCode=s.editorInsApiSettingApiCode.getValue());r.user=s.authCS.getUserId(),r=Object.assign({},s.insApiSetting||{},r);try{let N;s.loading.form=!0,s.lastError=void 0,s.monacoS.clearEditorDecorations(s.editorInsApiSettingApiCode,s.monacoDecorations),s.insApiSetting._id?s.insApiSetting._id&&(N=yield s.instanceApiSettingsS.replace(s.insApiSetting._id,r,{select:v.iH._id}).toPromise()):(N=yield s.instanceApiSettingsS.post(r).toPromise(),s.insApiSetting=N.data),s.ns.showSuccess(s.constantsS.tpApiSettings.addOrUpdateSuccess);const Oe=s.eventCenterS.database.selectedDatabases.value[0],ye=s.eventCenterS.instance.selectedInstances.value[0];s.mode===n.a.API?s.eventCenterS.collection.selectedCollections.next([s.eventCenterS.collection.selectedCollections.value[0]]):s.mode===n.a.Collection?s.eventCenterS.database.selectedDatabases.next([Oe]):s.mode===n.a.Database&&s.eventCenterS.instance.selectedInstances.next([ye]),s.loading.form=!1}catch(N){s.loading.form=!1,s.ns.showErrorFromResponse(N.error||N,"Unable to save instance."),s.lastError=N.error,s.tab=s.tab||{},s.tab.axiosResponse={data:N.error},s.monacoS.highlightErrorInMonacoEditor(s.editorInsApiSettingApiCode,s.tab,"MainSandbox.ts",s.monacoDecorations)}}})()}confirmMessage="";removePermanentDialog(s){var r=this;return(0,U.Z)(function*(){s===n.a.API?(r.confirmMessage=r.constantsS.instanceApiSettings.removePermanentConfirm,r.removePermanentDialogCommonCode(s)):s===n.a.Collection?(r.confirmMessage=r.constantsS.instanceCollectionSettings.removePermanentConfirm,r.removePermanentDialogCommonCode(s)):s===n.a.Database&&(r.confirmMessage=r.constantsS.instanceDatabaseSettings.removePermanentConfirm,r.removePermanentDialogCommonCode(s))})()}removePermanentDialogCommonCode(s){var f,r=this;this.confirmationService.confirm({message:this.confirmMessage,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(f=(0,U.Z)(function*(){yield r.removePermanent(s)}),function(){return f.apply(this,arguments)})})}removePermanent(s){var r=this;return(0,U.Z)(function*(){r.loading.form=!0;const f=yield r.instanceApiSettingsS.permanentDelete(r.insApiSetting._id).toPromise();r.loading.form=!1,s===n.a.API?f?(r.ns.showSuccess(r.constantsS.instanceApiSettings.removePermanent),r.eventCenterS.collection.selectedCollections.next([r.eventCenterS.collection.selectedCollections.value[0]]),r.resetObj()):r.ns.showErrorFromResponse(f,r.constantsS.instanceApiSettings.removePermanentError):s===n.a.Collection?f?(r.ns.showSuccess(r.constantsS.instanceCollectionSettings.removePermanent),r.eventCenterS.database.selectedDatabases.next([r.eventCenterS.database.selectedDatabases.value[0]]),r.resetObj()):r.ns.showErrorFromResponse(f,r.constantsS.instanceCollectionSettings.removePermanentError):s===n.a.Database&&(f?(r.ns.showSuccess(r.constantsS.instanceDatabaseSettings.removePermanent),r.eventCenterS.instance.selectedInstances.next([r.eventCenterS.instance.selectedInstances.value[0]]),r.resetObj()):r.ns.showErrorFromResponse(f,r.constantsS.instanceDatabaseSettings.removePermanentError))})()}resetObj(){this.insApiSetting={},this.cd.detectChanges()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(r){return new(r||_)(t.Y36(te.e),t.Y36(ne.X),t.Y36(ae.W),t.Y36(le.E),t.Y36(re.D),t.Y36(L.u),t.Y36(ce.L),t.Y36(ge.b),t.Y36(de.b),t.Y36(ue.f),t.Y36(k.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:_,selectors:[["app-w-instance-api-settings"]],viewQuery:function(r,f){if(1&r&&t.Gf(ve,5),2&r){let N;t.iGM(N=t.CRH())&&(f.viewDockerfileModelC=N.first)}},inputs:{mode:"mode",insertCodeModalC:"insertCodeModalC"},decls:16,vars:12,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/apiSettings.html","target","_blank",4,"ngIf"],["href","https://docs.apimaker.dev/v1/docs/settings/collectionSettings.html","target","_blank",4,"ngIf"],["href","https://docs.apimaker.dev/v1/docs/settings/databaseSettings.html","target","_blank",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Insert Code",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["href","https://docs.apimaker.dev/v1/docs/settings/apiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["href","https://docs.apimaker.dev/v1/docs/settings/collectionSettings.html","target","_blank"],["href","https://docs.apimaker.dev/v1/docs/settings/databaseSettings.html","target","_blank"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["pTooltip","Insert Code",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(50vh - 68px)",3,"hidden"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],[4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,f){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4),t.qZA(),t.YNc(5,Se,2,0,"a",3),t.YNc(6,De,2,0,"a",4),t.YNc(7,be,2,0,"a",5),t.YNc(8,xe,2,0,"span",6),t.YNc(9,Ie,2,0,"span",7),t.YNc(10,Te,2,0,"span",8),t.YNc(11,Ee,2,0,"a",9),t.qZA(),t.TgZ(12,"div",10),t.YNc(13,d,5,6,"div",11),t.qZA()(),t._UZ(14,"app-monaco-editor-modal",12,13)),2&r&&(t.xp6(4),t.hij(" ",f.mode," Settings"),t.xp6(1),t.Q6J("ngIf",f.mode===f.EInstanceApiWidgetMode.API),t.xp6(1),t.Q6J("ngIf",f.mode===f.EInstanceApiWidgetMode.Collection),t.xp6(1),t.Q6J("ngIf",f.mode===f.EInstanceApiWidgetMode.Database),t.xp6(1),t.Q6J("ngIf",f.data.selectedItem),t.xp6(1),t.Q6J("ngIf",f.data.selectedItem&&f.insApiSetting._id),t.xp6(1),t.Q6J("ngIf",f.data.selectedItem&&f.insApiSetting._id),t.xp6(1),t.Q6J("ngIf",f.lastError&&f.data.selectedItem),t.xp6(2),t.Q6J("ngIf",f.data.selectedItem),t.xp6(1),t.Q6J("modalId",f.modalId)("editorOptionsMonacoEditorModal",f.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[_e.O5,he.O,pe.G,me.u,Ce.A]})}return _})();var i=o(328),m=o(6212),g=o(6990),O=o(921),p=o(2189),E=o(5431);function l(_,Z){if(1&_&&(t.TgZ(0,"div")(1,"div",8),t._uU(2),t.qZA()()),2&_){const s=t.oxw();t.xp6(2),t.Oqu(s.constantsS.group.allCollectionsPermitted)}}function D(_,Z){1&_&&(t.TgZ(0,"th",19),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function A(_,Z){if(1&_&&(t.TgZ(0,"tr"),t.YNc(1,D,2,0,"th",14),t.TgZ(2,"th",15),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Pre"),t.qZA(),t.TgZ(8,"th",16),t._uU(9,"Post"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Authorization"),t.qZA(),t._UZ(12,"th",17)(13,"th",18),t.qZA()),2&_){const s=t.oxw(2);t.xp6(1),t.Q6J("ngIf",s.showCheckbox)}}function G(_,Z){if(1&_&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",31),t.qZA()),2&_){const s=t.oxw().$implicit;t.xp6(1),t.Q6J("value",s)("pSelectableRow",s)}}function ee(_,Z){if(1&_&&(t.TgZ(0,"td",28),t._uU(1),t.qZA()),2&_){const s=t.oxw().$implicit;t.xp6(1),t.Oqu(s.preHookCount||"")}}function se(_,Z){if(1&_&&(t.TgZ(0,"td",28),t._uU(1),t.qZA()),2&_){const s=t.oxw().$implicit;t.xp6(1),t.Oqu(s.postHookCount||"")}}function oe(_,Z){1&_&&(t.TgZ(0,"span",32),t._uU(1,"AM-User"),t.qZA())}function ie(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"No-Access"),t.qZA())}function Pe(_,Z){1&_&&(t.TgZ(0,"span",34),t._uU(1,"Public"),t.qZA())}function Ne(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"DB-User"),t.qZA())}function Re(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"AWS"),t.qZA())}function Ye(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"Azure"),t.qZA())}function Je(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"Google"),t.qZA())}function Ge(_,Z){1&_&&t._UZ(0,"i",35)}const Qe=function(){return["/api-info/api-testing/testing"]},Le=function(_,Z,s,r,f){return{at_category:"INSTANCES",at_instance:_,at_user:Z,at_database:s,at_collection:r,at_api:f}};function Ke(_,Z){if(1&_&&(t.TgZ(0,"tr",20),t.YNc(1,G,2,2,"td",6),t.TgZ(2,"td",21),t._uU(3),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.YNc(6,ee,2,1,"td",22),t.YNc(7,se,2,1,"td",22),t.TgZ(8,"td",23),t.YNc(9,oe,2,0,"span",24),t.YNc(10,ie,2,0,"span",25),t.YNc(11,Pe,2,0,"span",26),t.YNc(12,Ne,2,0,"span",25),t.YNc(13,Re,2,0,"span",25),t.YNc(14,Ye,2,0,"span",25),t.YNc(15,Je,2,0,"span",25),t.qZA(),t.TgZ(16,"td"),t.YNc(17,Ge,1,0,"i",27),t.qZA(),t.TgZ(18,"td")(19,"div",28)(20,"a",29),t.NdJ("click",function(r){return r.stopPropagation()}),t._UZ(21,"i",30),t.qZA()()()()),2&_){const s=Z.$implicit,r=t.oxw(2);t.Q6J("pSelectableRow",s),t.xp6(1),t.Q6J("ngIf",r.showCheckbox),t.xp6(2),t.Oqu(s.category),t.xp6(2),t.Oqu(s.nameForApiListUI),t.xp6(1),t.Q6J("ngIf",r.showHooksCount),t.xp6(1),t.Q6J("ngIf",r.showHooksCount),t.xp6(2),t.Q6J("ngIf",s.hasAmAuth),t.xp6(1),t.Q6J("ngIf",s.noAccess),t.xp6(1),t.Q6J("ngIf",s.isPublic),t.xp6(1),t.Q6J("ngIf",s.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",s.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",s.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",s.hasGoogleAuth),t.xp6(2),t.Q6J("ngIf",s.instanceApiSettings),t.xp6(3),t.Q6J("routerLink",t.DdM(16,Qe))("queryParams",t.qbA(17,Le,r.eventCenterS.instance.selectedInstances.value[0]._id,r.authCS.getUserId(),r.eventCenterS.database.selectedDatabases.value[0]._id,r.eventCenterS.collection.selectedCollections.value[0]._id,s._id))}}function ke(_,Z){1&_&&t._UZ(0,"p-progressSpinner",36)}function We(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"div",9)(1,"p-table",10),t.NdJ("selectionChange",function(f){t.CHM(s);const N=t.oxw();return t.KtG(N.selectedRows=f)})("selectionChange",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.apiSelected())}),t.YNc(2,A,14,1,"ng-template",11),t.YNc(3,Ke,22,23,"ng-template",12),t.qZA(),t.YNc(4,ke,1,0,"p-progressSpinner",13),t.qZA()}if(2&_){const s=t.oxw();t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),t.xp6(3),t.Q6J("ngIf",s.loading.grid)}}let we=(()=>{class _{instanceS;generalS;navigationCS;authCS;constantsS;eventCenterS;router;showCheckbox=!0;showHooksCount=!1;loading={grid:!1};subscriptions=[];data={mode:i.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=v.iH._id;EUserType=O.d;constructor(s,r,f,N,Ze,Oe,ye){this.instanceS=s,this.generalS=r,this.navigationCS=f,this.authCS=N,this.constantsS=Ze,this.eventCenterS=Oe,this.router=ye}ngOnInit(){var s=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.subscribe(function(){var r=(0,U.Z)(function*(f){if(!f[0])return s.resetGridAndUrl();yield s.loadGridData(f[0])});return function(f){return r.apply(this,arguments)}}()))}loadGridData(s){var r=this;return(0,U.Z)(function*(){r.loading.grid=!0;try{yield r.resetGridAndUrl(),r.selectedRows=[],r.rows=(yield r.instanceS.instanceAPIList([s])).data||[],r.rowsMap=g.keyBy(r.rows,v.iH._id),r.showHooksCount&&(yield r.instanceS.setHooksCountInCollectionApisArr(s.instanceName,s.databaseName,s.name,r.rows));const f=r.navigationCS.getQueryParam(m.p.collection_api),N=r.rowsMap[f];N&&(r.selectedRows=[N],r.eventCenterS.colApi.selectedApi.next(N)),r.loading.grid=!1}catch(f){console.log(f),r.loading.grid=!1}})()}resetDependents(){var s=this;return(0,U.Z)(function*(){s.eventCenterS.colApi.selectedApi.next(void 0),yield s.navigationCS.setQueryParam(m.p.collection_api,null)})()}apiSelected(){var s=this;return(0,U.Z)(function*(){yield s.resetDependents(),yield s.fillData()})()}resetGridAndUrl(){var s=this;return(0,U.Z)(function*(){s.rows=[],s.selectedRows=[],s.rowsMap={},s.eventCenterS.colApi.selectedApi.next(void 0)})()}fillData(){var s=this;return(0,U.Z)(function*(){if(!s.selectedRows.length)return yield s.navigationCS.setQueryParam(m.p.collection_api,null),void s.eventCenterS.colApi.selectedApi.next(null);const r=s.selectedRows[0];r&&(s.eventCenterS.colApi.selectedApi.next(r),yield s.navigationCS.setQueryParam(m.p.collection_api,r._id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(r){return new(r||_)(t.Y36(le.E),t.Y36(de.b),t.Y36(p.S),t.Y36(re.D),t.Y36(ce.L),t.Y36(L.u),t.Y36(b.F0))};static \u0275cmp=t.Xpm({type:_,selectors:[["app-col-api-w"]],inputs:{showCheckbox:"showCheckbox",showHooksCount:"showHooksCount"},decls:10,vars:2,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-code","text-info","fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html#apis","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped","scrollHeight","calc(50vh - 66px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],[1,"pl-0","text-right",2,"width","85px"],[2,"width","40px"],[2,"width","42px"],[2,"width","58px"],[2,"width","45px"],[3,"pSelectableRow"],[1,"text-monospaced","small","pl-0","text-right","text-muted"],["class","text-center",4,"ngIf"],[1,"px-1"],["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"],["tooltipPosition","left","pTooltip","API Settings","class","fas fa-cog text-danger fa-fw cursor-pointer",4,"ngIf"],[1,"text-center"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],[3,"value","pSelectableRow"],[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"],["tooltipPosition","left","pTooltip","API Settings",1,"fas","fa-cog","text-danger","fa-fw","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,f){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Collection APIs"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA()(),t.TgZ(7,"div",5),t.YNc(8,l,3,1,"div",6),t.YNc(9,We,5,7,"div",7),t.qZA()()),2&r&&(t.xp6(8),t.Q6J("ngIf",f.eventCenterS.group.apisRegex.allCollections),t.xp6(1),t.Q6J("ngIf",!f.eventCenterS.group.apisRegex.allCollections))},dependencies:[b.rH,_e.O5,E.iA,k.jx,E.Ei,E.UA,E.Mo,pe.G,me.u]})}return _})();const Be=["insertCodeModalC"];function He(_,Z){1&_&&t._UZ(0,"app-w-instances",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function Ve(_,Z){1&_&&t._UZ(0,"app-w-databases",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function je(_,Z){if(1&_&&t._UZ(0,"app-w-instance-api-settings",7),2&_){const s=t.oxw(2),r=t.MAs(8);t.Q6J("insertCodeModalC",r)("mode",s.EInstanceApiWidgetMode.Database)}}const Me=function(){return[50,50]};function $e(_,Z){1&_&&(t.TgZ(0,"p-splitter",6),t.YNc(1,Ve,1,2,"ng-template",2),t.YNc(2,je,1,2,"ng-template",2),t.qZA()),2&_&&t.Q6J("panelSizes",t.DdM(2,Me))("minSizes",t.DdM(3,Me))}function qe(_,Z){1&_&&t._UZ(0,"app-w-collections",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function ze(_,Z){if(1&_&&t._UZ(0,"app-w-instance-api-settings",7),2&_){const s=t.oxw(2),r=t.MAs(8);t.Q6J("insertCodeModalC",r)("mode",s.EInstanceApiWidgetMode.Collection)}}function Xe(_,Z){1&_&&(t.TgZ(0,"p-splitter",6),t.YNc(1,qe,1,2,"ng-template",2),t.YNc(2,ze,1,2,"ng-template",2),t.qZA()),2&_&&t.Q6J("panelSizes",t.DdM(2,Me))("minSizes",t.DdM(3,Me))}function et(_,Z){1&_&&t._UZ(0,"app-col-api-w",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function tt(_,Z){if(1&_&&t._UZ(0,"app-w-instance-api-settings",8),2&_){const s=t.oxw(2),r=t.MAs(8);t.Q6J("insertCodeModalC",r)("mode",s.EInstanceApiWidgetMode.API)}}function nt(_,Z){1&_&&(t.TgZ(0,"p-splitter",6),t.YNc(1,et,1,2,"ng-template",2),t.YNc(2,tt,1,2,"ng-template",2),t.qZA()),2&_&&t.Q6J("panelSizes",t.DdM(2,Me))("minSizes",t.DdM(3,Me))}const at=function(){return{height:"calc(100vh - 62px)",width:"140rem"}},Ue=function(){return[35,50,50,65]};let Fe=(()=>{class _{eventCenterS;EInstanceApiWidgetMode=n.a;DOCS_HOST_PORT=q.N.DOCS_HOST_PORT;insertCodeModalC;constructor(s){this.eventCenterS=s}ngOnInit(){this.eventCenterS.group.apisRegex={},this.eventCenterS.instance.selectedInstances.next([]),this.eventCenterS.database.selectedDatabases.next([]),this.eventCenterS.collection.selectedCollections.next([])}static \u0275fac=function(r){return new(r||_)(t.Y36(L.u))};static \u0275cmp=t.Xpm({type:_,selectors:[["app-db-cell-layout"]],viewQuery:function(r,f){if(1&r&&t.Gf(Be,5),2&r){let N;t.iGM(N=t.CRH())&&(f.insertCodeModalC=N.first)}},decls:9,vars:10,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[3,"panelSizes","minSizes"],["pTemplate",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"w-100",3,"showHooksCount","showCheckbox"],["layout","vertical",3,"panelSizes","minSizes"],[1,"w-100",3,"insertCodeModalC","mode"],[1,"w-100",2,"width","45.8%",3,"insertCodeModalC","mode"]],template:function(r,f){1&r&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,He,1,2,"ng-template",2),t.YNc(3,$e,3,4,"ng-template",2),t.YNc(4,Xe,3,4,"ng-template",2),t.YNc(5,nt,3,4,"ng-template",2),t.qZA()(),t._UZ(6,"app-create-schema-form")(7,"app-insert-code-modal",3,4)),2&r&&(t.xp6(1),t.Akn(t.DdM(7,at)),t.Q6J("panelSizes",t.DdM(8,Ue))("minSizes",t.DdM(9,Ue)),t.xp6(6),t.Q6J("frameId","IdInsertCode")("modalId","IdInsertCodeApiList")("docsHostPort",f.DOCS_HOST_PORT))},dependencies:[X.P,k.jx,j.q,z.f,I,we,y.O,Q.n,Y.c],encapsulation:2})}return _})();o(2571);var ot=o(4950);const it=[{path:"layout",component:Fe,canActivate:[T.P]}];let lt=(()=>{class _{static \u0275fac=function(r){return new(r||_)};static \u0275mod=t.oAB({type:_});static \u0275inj=t.cJS({providers:[V.m],imports:[b.Bz.forChild(it),e.u,w.DashboardM,a.ApiInfoM,ot.A]})}return _})()},6162:(fe,W,o)=>{o.d(W,{m:()=>T});var b=o(4946),e=o(2915);let T=(()=>{class w{es;constructor(y){this.es=y}extractNameAndSetForLogTable(y,B,Q,H){const Y=[];for(const V of y)Y.push(B[V][H]);this.es.filterInLog[Q].next(Y)}static \u0275fac=function(B){return new(B||w)(b.LFG(e.u))};static \u0275prov=b.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"})}return w})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7987],{1137:(v,g,a)=>{a.d(g,{u:()=>ae});var m=a(5861),l=a(3157),_=a(328),p=a(6990),M=a(9361),u=a(1162),S=a(7672),O=a(553),C=a(5085),P=a(1601),f=a(3531),T=a(9989),e=a(4946),F=a(9961),A=a(7629),h=a(7240),b=a(3429),U=a(7414),R=a(5852),B=a(2304),y=a(2915),x=a(6814),Z=a(2660),L=a(8917),W=a(5860),K=a(756),N=a(7680),D=a(4844),H=a(3259),J=a(5025);const Q=["QuillEditorC"],V=["insertCodeModalC"],G=["monacoEditorModalC"];function w(s,c){if(1&s&&e._UZ(0,"span",31),2&s){const t=e.oxw();e.Q6J("innerHTML",t.userNoteHtml,e.oJD)}}function Y(s,c){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",32),e._uU(2," Add Custom API"),e.qZA())}function j(s,c){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",33),e._uU(2," View Custom API"),e.qZA())}function k(s,c){if(1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",34),e._uU(2," Edit Custom API "),e.TgZ(3,"span",35),e._uU(4),e.qZA()()),2&s){const t=e.oxw();e.xp6(4),e.Oqu((null==t.updateObj?null:t.updateObj.name)||"")}}function X(s,c){if(1&s){const t=e.EpF();e.TgZ(0,"div",36)(1,"app-monaco-editor",37),e.NdJ("editorGenerated",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.editorGeneratedBasicInfo(o))}),e.qZA()()}if(2&s){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsSchema)}}function z(s,c){if(1&s){const t=e.EpF();e.TgZ(0,"div",36)(1,"app-monaco-editor",37),e.NdJ("editorGenerated",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.editorGenerated(o))}),e.qZA()()}if(2&s){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsSchema)}}function q(s,c){if(1&s){const t=e.EpF();e.TgZ(0,"a",38),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function ee(s,c){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function te(s,c){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function oe(s,c){if(1&s){const t=e.EpF();e.TgZ(0,"button",39),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save())}),e._UZ(1,"i",40),e.YNc(2,ee,2,0,"span",5),e.YNc(3,te,2,0,"span",5),e.qZA()}if(2&s){const t=e.oxw();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 ne(s,c){1&s&&e._UZ(0,"p-progressSpinner",41)}let ae=(()=>{class s{ns;functionS;generalS;instanceS;constantsS;authCS;monacoS;eventCenterS;generalCS;data;loading={form:!1};EFormMode=_.D;subscriptions=[];EAPIAccessType=S.di;editorFunctions;editorFunctionsBasicInfo;editorOptionsSchema={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};updateObj;QuillEditorC;userNoteHtml='\n <span class="font-weight-bold text-success">Note:</span><br/>\n <span>Name might be used in code,<br/> so consider changing in code also.</span>\n ';BE_HOST_PORT=O.N.BE_HOST_PORT;DOCS_HOST_PORT=O.N.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;insertCodeModalC;viewDockerfileModelC;constructor(t,n,o,i,r,d,E,se,ie){this.ns=t,this.functionS=n,this.generalS=o,this.instanceS=i,this.constantsS=r,this.authCS=d,this.monacoS=E,this.eventCenterS=se,this.generalCS=ie}ngOnInit(){var t=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var n=(0,m.Z)(function*(o){if(o)if(o.action===l.F.OPEN_FORM_IN_EDIT_MODE||o.action===l.F.OPEN_FORM_IN_VIEW_MODE){const r=`${t.data.formData.guid}:${t.authCS.gUser._id}`,d=yield t.functionS.getById(r).toPromise();t.updateObj=d.data,t.generalCS.setValueInEditor(t,"editorFunctionsBasicInfo",d.data?.functionBasicInfo||""),t.generalCS.setValueInEditor(t,"editorFunctions",d.data?.functionCode||""),t.generalCS.setValueInEditor(t,"QuillEditorC",d.data?.apiDocs||"");const E={};t.updateObj.separateSandboxSettings?.enableSeparateSandboxForThis&&(E.enableSeparateSandboxForThis=t.updateObj.separateSandboxSettings.enableSeparateSandboxForThis,E.allowAllPackagesOfAdmin=t.updateObj.separateSandboxSettings?.packages?.allowAllPackagesOfAdmin??!1),yield t.monacoS.loadTypesInMonaco(t.BE_HOST_PORT,t.authCS.getUserId(),E)}else if(o.action===l.F.OPEN_FORM_IN_ADD_MODE){const i=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,C.R.CUSTOM_API_JSON).toPromise(),r=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,C.R.CUSTOM_APIS).toPromise();t.generalCS.setValueInEditor(t,"editorFunctionsBasicInfo",i.data),t.generalCS.setValueInEditor(t,"editorFunctions",r.data),setTimeout(()=>{t.QuillEditorC.quill.setContents([{insert:"### API "},{insert:"Documentation",attributes:{bold:!0}},{insert:"\n"}])},1e3),t.updateObj={}}});return function(o){return n.apply(this,arguments)}}()))}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idFunctionForm").modal("show")},100)}hideModal(){$("#idFunctionForm").modal("hide")}save(){var t=this;return(0,m.Z)(function*(){let o;o=t.data.formData&&t.data.formData._id?yield t.functionS.queryOne({find:{guid:t.data.formData.guid,user:t.authCS.gUser._id}}):{};const i=p.find(o.versions||[],{isActive:!0});i&&(i.apiCodeStr=t.editorFunctions.getValue());let r=Object.assign({},o,{});r.user=t.authCS.getUserId(),r.functionCode=t.editorFunctions.getValue(),r.functionBasicInfo=t.editorFunctionsBasicInfo.getValue(),r.apiDocs=t.QuillEditorC.getValue();for(const d of r?.versions||[])d.version=d.version.toString();r=Object.assign({},t.updateObj||{},r);try{let d;t.loading.form=!0,t.lastError=void 0,t.data.mode===_.D.ADD?d=yield t.functionS.post(r).toPromise():t.data.mode===_.D.EDIT&&(d=yield t.functionS.replace(r._id,r,{select:u.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===_.D.ADD?t.constantsS.functions.addSuccess:t.constantsS.functions.editSuccess),t.data.eventChannel.emit({action:t.data.mode===_.D.ADD?l.F.SAVED:l.F.UPDATED}),t.eventCenterS.customApiSavedAndUpdate.next(!0),t.loading.form=!1}catch(d){t.ns.showErrorMessageFromErrorObject(d),t.loading.form=!1,t.lastError=d.error}})()}selectedTabTitle;tabSelected(t){this.selectedTabTitle=(t.originalEvent.originalTarget||t.originalEvent.currentTarget).text}setMessageReceiver(){this.generalCS.messageReceivedFor=void 0===this.selectedTabTitle||"Basic Info"===this.selectedTabTitle?M.H.Settings:M.H.All}showInsertCodeModel(){this.setMessageReceiver(),this.insertCodeModalC.showModal(f.b.FunManFormC)}editorGenerated(t){var n=this;return(0,m.Z)(function*(){n.editorFunctions=t,yield n.monacoS.loadSchemaEditorSettings(n.BE_HOST_PORT,n.authCS.getUserId(),null),n.monacoS.addSaveCodeKeyBinding(t,o=>{n.data.mode!==_.D.VIEW&&n.save()}),n.monacoS.addInsertCodeKeyBinding(t,o=>{n.data.mode!==_.D.VIEW&&(n.setMessageReceiver(),n.insertCodeModalC.showModal(f.b.FunManFormC))}),n.subscriptions.push(n.generalS.messageReceived.subscribe(o=>{o.type&&o.type===T.g.TEXT_COPIED&&"Code"===n.selectedTabTitle&&o.componentName===f.b.FunManFormC&&(n.monacoS.insertAtCursor(t,o.selectedText),n.insertCodeModalC.hideModal())}))})()}editorGeneratedBasicInfo(t){var n=this;return(0,m.Z)(function*(){n.editorFunctionsBasicInfo=t,yield n.monacoS.loadSchemaEditorSettings(n.BE_HOST_PORT,n.authCS.getUserId(),null),n.monacoS.addSaveCodeKeyBinding(t,o=>{n.data.mode!==_.D.VIEW&&n.save()}),n.monacoS.addInsertCodeKeyBinding(t,o=>{n.data.mode!==_.D.VIEW&&(n.setMessageReceiver(),n.insertCodeModalC.showModal(f.b.FunManFormC))}),n.subscriptions.push(n.generalS.messageReceived.subscribe(o=>{o.type&&o.type===T.g.TEXT_COPIED&&o.componentName===f.b.FunManFormC&&(void 0===n.selectedTabTitle||"Basic Info"===n.selectedTabTitle)&&(n.monacoS.insertAtCursor(t,o.selectedText),n.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),P.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.customApiSavedAndUpdate.next(!1)}static \u0275fac=function(n){return new(n||s)(e.Y36(F.W),e.Y36(A.d),e.Y36(h.b),e.Y36(b.E),e.Y36(U.L),e.Y36(R.D),e.Y36(B.b),e.Y36(y.u),e.Y36(h.b))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-fun-man-form"]],viewQuery:function(n,o){if(1&n&&(e.Gf(Q,5),e.Gf(V,5),e.Gf(G,5)),2&n){let i;e.iGM(i=e.CRH())&&(o.QuillEditorC=i.first),e.iGM(i=e.CRH())&&(o.insertCodeModalC=i.first),e.iGM(i=e.CRH())&&(o.viewDockerfileModelC=i.first)}},inputs:{data:"data"},decls:37,vars:14,consts:[["template",""],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idFunctionForm","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/apis-all/custom-apis/user-created-custom-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[3,"onChange"],["header","Basic Info"],["class","overflow-hidden","style","height: calc(100vh - 188px);",4,"ngIf"],["header","Code"],["header","Docs"],["QuillEditorC",""],[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,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"innerHTML"],[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,"overflow-hidden",2,"height","calc(100vh - 188px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,o){1&n&&(e.YNc(0,w,1,1,"ng-template",null,0,e.W1O),e.TgZ(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4),e.YNc(6,Y,3,0,"span",5),e.YNc(7,j,3,0,"span",5),e.YNc(8,k,5,1,"span",5),e.TgZ(9,"div",6)(10,"button",7),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(11,"span",8),e._UZ(12,"i",9),e.qZA()(),e.TgZ(13,"span",10),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(14,"i",11),e.qZA(),e.TgZ(15,"a",12),e._UZ(16,"img",13),e.qZA()()(),e.TgZ(17,"div",14)(18,"p-tabView",15),e.NdJ("onChange",function(r){return o.tabSelected(r)}),e.TgZ(19,"p-tabPanel",16),e.YNc(20,X,2,2,"div",17),e.qZA(),e.TgZ(21,"p-tabPanel",18),e.YNc(22,z,2,2,"div",17),e.qZA(),e.TgZ(23,"p-tabPanel",19),e._UZ(24,"app-quill-editor",null,20),e.qZA()()(),e.TgZ(26,"div",21),e.YNc(27,q,2,0,"a",22),e.TgZ(28,"button",23),e.NdJ("click",function(){return o.hideModal()}),e._UZ(29,"i",24),e._uU(30," Close"),e.qZA(),e.YNc(31,oe,4,2,"button",25),e.qZA(),e.YNc(32,ne,1,0,"p-progressSpinner",26),e.qZA()()(),e._UZ(33,"app-insert-code-modal",27,28)(35,"app-monaco-editor-modal",29,30)),2&n&&(e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(5),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeCusApi")("modalId","idInsertCodeCusApiForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInCustomApi")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[x.O5,Z.y,L.l,W.P,K.O,N.G,D.xf,D.x4,H.u,J.A],encapsulation:2})}return s})()},7987:(v,g,a)=>{a.d(g,{X:()=>M});var m=a(7017),l=a(4950),p=(a(1137),a(4946));let M=(()=>{class u{static \u0275fac=function(C){return new(C||u)};static \u0275mod=p.oAB({type:u});static \u0275inj=p.cJS({imports:[m.u,l.A]})}return u})()}}]);