PageSourceSearch

https://sociallab.sa/chunk-CsfooGk_.js

js sociallab.sa collected 2026-09-24 13:30:49 UTC 7,410 bytes, 1 lines download raw bytes

1import {D as D$1}from'./chunk-DLATORRc.js';import {S}from'./chunk-AvbB3w2y.js';import {R as Ri}from'./chunk-CLFEoJNz.js';import {g,b as gr,h as c$1,c8 as Xr,E,D,H,bQ as P,bO as Gt,O,aE as lt,K as Kb,P as Pg,bt as Is,bu as Tg,bV as $s,bS as Dc,bT as zc,T as Tt,k as Kv,V as Vg,l as b0,L as L0,Y as Yx,m as dn,b2 as da,bz as yr,n as Vw,bA as Pw,o as nk,t as td,p as tC,q as bC,s as sv,N as NC,X as XC,_ as _D,aO as oD,aP as lD,b0 as mD,aX as sD,r as il,u as XD,v as rM,F as Fb,w as t1,y as A1,z as gS,B as Vs,C as zs,J as NS,Z as ZS,M as EI,Q as us,R as ms,S as HI,U as ZI,$ as Dn,a0 as kE,a1 as Jv,a2 as go,a3 as qd,av as on,a4 as YE,a5 as OT,a6 as lA,a7 as mt,aa as Xs,ac as V_,ae as fS,ad as hd,a9 as qT,bZ as Vy,b_ as G_,bB as lb,ab as my,ag as _C,ak as Dd,al as hS,ah as ZT,aj as ky,b$ as By,bE as fb,ai as ay,af as KT,aV as QT,am as XT,bC as tS,aT as l_,a8 as cy,aR as o_,aS as Pp,aU as Lp}from'./main-CTPND76J.js';var Ke=()=>[0,1,2,3,4,5];function Qe(i,c){i&1&&(Xs(0,"div",11),cy(1,"app-skeleton-loader",12)(2,"app-skeleton-loader",13),hd()),i&2&&(_C(2),ay("rounded",true));}function Xe(i,c){i&1&&(Xs(0,"div",1),KT(1,Qe,3,1,"div",11,QT),hd()),i&2&&(_C(),XT(tS(0,Ke)));}function Ze(i,c){i&1&&(Xs(0,"mat-hint",8),V_(1),fS(2,"translate"),hd()),i&2&&(_C(),Dd(" ",hS(2,1,"You have reached the maximum number of characters")," "));}function $e(i,c){if(i&1){let t=o_();Xs(0,"div",2)(1,"div",14)(2,"mat-form-field",15)(3,"input",16),Vy("ngModelChange",function(e){let s=Pp(t).$implicit;return G_(s.command,e)||(s.command=e),Lp(e)}),hd(),lb(),Xs(4,"mat-hint",6),V_(5),hd(),qT(6,Ze,3,3,"mat-hint",8),hd()(),Xs(7,"div",17)(8,"button",18),fS(9,"translate"),my("click",function(){let e=Pp(t).$implicit,s=l_(2);return Lp(s.deleteClientAICommand(e.id))}),V_(10),fS(11,"translate"),Xs(12,"mat-icon",19),V_(13,"delete"),hd()(),Xs(14,"button",20),fS(15,"translate"),my("click",function(){let e=Pp(t).$implicit,s=l_(2);return Lp(s.updateClientAICommand(e.id,e.command))}),V_(16),fS(17,"translate"),Xs(18,"mat-icon",19),V_(19,"task_alt"),hd()()(),cy(20,"hr"),hd();}if(i&2){let t=c.$implicit;_C(3),By("ngModel",t.command),fb(),_C(2),Dd(" ",t.command.length||0,"/50 "),_C(),ZT(t.command.length===50?6:-1),_C(2),ay("matTooltip",hS(9,7,"Delete")),_C(2),Dd(" ",hS(11,9,"Delete")," "),_C(4),ay("matTooltip",hS(15,11,"Update")),_C(2),Dd(" ",hS(17,13,"Update")," ");}}function et(i,c){if(i&1&&KT(0,$e,21,15,"div",2,QT),i&2){let t=l_();XT(t.clientAICommands);}}function tt(i,c){i&1&&(Xs(0,"mat-hint",7),V_(1),fS(2,"translate"),hd()),i&2&&(_C(),Dd(" ",hS(2,1,"Maximum number of characters is")," 50 "));}function it(i,c){i&1&&(Xs(0,"mat-hint",8),V_(1),fS(2,"translate"),hd()),i&2&&(_C(),Dd(" ",hS(2,1,"You have reached the maximum number of characters")," "));}var oi=(()=>{class i{constructor(t,r,e,s,f){this.loadingService=t,this.errorService=r,this.translate=e,this.toastr=s,this.aiAgentService=f,this.newClientAICommandText="",this.dialog=g(gr),this.dialogConfig=g(c$1),this.pageTitle="Client AI Commands",this.isLoading=false,this.clientAICommands=[];}ngOnInit(){this.getClientAICommands();}getClientAICommands(){this.isLoading=true,this.loadingService.beginSuppress(),this.sub=this.aiAgentService.getClientAICommands().pipe(Xr(()=>{this.isLoading=false,this.loadingService.endSuppress();})).subscribe({next:t=>{this.clientAICommands=t.data;},error:t=>this.errorService.setError(t,"Error while getting the data")});}addClientAICommand(){this.newClientAICommandText?.trim()&&(this.loadingService.loadingOn(),this.sub=this.aiAgentService.addAICommand(this.newClientAICommandText.trim()).subscribe({next:t=>{this.loadingService.loadingOff(),t.succeeded?(this.getClientAICommands(),this.toastr.success("Added Successfully"),this.newClientAICommandText=""):this.errorService.setError(t,"Error while sending");},error:t=>{this.errorService.setError(t,"Failed to Add");}}));}confirmDeleteClientAICommand(t){this.loadingService.loadingOn(),this.sub=this.aiAgentService.deleteAICommand(t).subscribe({next:r=>{this.loadingService.loadingOff(),r?(this.getClientAICommands(),this.toastr.success("Deleted Successfully")):this.errorService.setError(r,"Fail to delete!");},error:r=>{this.errorService.setError(r,"Fail to delete!");}});}deleteClientAICommand(t){this.dialog.open(Ri,E(D({},this.dialogConfig.getDefaultDialogConfig()),{data:{confirmed:true}})).afterClosed().subscribe(e=>{(e===true||e?.confirmed===true)&&this.confirmDeleteClientAICommand(t);});}updateClientAICommand(t,r){this.loadingService.loadingOn(),this.sub=this.aiAgentService.updateAICommand(t,r).subscribe({next:e=>{this.loadingService.loadingOff(),e?.succeeded?(this.getClientAICommands(),this.toastr.success("Updated Successfully")):this.errorService.setError(e,"Failed to Update");},error:e=>{this.loadingService.loadingOff(),this.errorService.setError(e,"Failed to Update");}});}static{this.\u0275fac=function(r){return new(r||i)(H(P),H(Gt),H(O),H(lt),H(D$1))};}static{this.\u0275cmp=Kb({type:i,selectors:[["app-settings-ai-agent"]],decls:23,vars:16,consts:[[1,"b-t-1","p-t-8"],[1,"skeleton-list"],[1,"row","align-items-center"],[1,"col-9"],["color","primary",1,"w-100","m-l-16"],["type","text","matInput","","rows","5","name","newClientAICommandText","required","","maxlength","50","oninput","this.style.height = ''; this.style.height = this.scrollHeight + 'px'",3,"ngModelChange","ngModel"],["align","end"],["align","start"],["align","start","color","warn"],[1,"col-3"],["type","button","mat-flat-button","","color","primary",1,"m-l-16",3,"click","disabled"],[1,"d-flex","align-items-center","gap-2","p-y-8"],["type","text","width","70%"],["type","custom","width","80px","height","2rem",3,"rounded"],[1,"col-lg-9"],["color","primary",1,"w-100","m-r-16"],["type","text","matInput","","rows","3","maxlength","50","oninput","this.style.height = ''; this.style.height = this.scrollHeight + 'px'",3,"ngModelChange","ngModel"],[1,"d-flex"],["mat-flat-button","","color","warn",1,"m-l-16",3,"click","matTooltip"],[1,"icon-18"],["mat-flat-button","","color","primary",1,"m-l-16",3,"click","matTooltip"]],template:function(r,e){r&1&&
1(Xs(0,"mat-card")(1,"mat-card-header")(2,"mat-card-title"),V_(3),fS(4,"translate"),hd()(),Xs(5,"mat-card-content",0),qT(6,Xe,3,1,"div",1),qT(7,et,2,0),Xs(8,"h3"),V_(9),fS(10,"translate"),hd(),Xs(11,"div",2)(12,"div",3)(13,"mat-form-field",4)(14,"input",5),Vy("ngModelChange",function(f){return G_(e.newClientAICommandText,f)||(e.newClientAICommandText=f),f}),hd(),lb(),Xs(15,"mat-hint",6),V_(16),hd(),qT(17,tt,3,3,"mat-hint",7),qT(18,it,3,3,"mat-hint",8),hd()(),Xs(19,"div",9)(20,"button",10),my("click",function(){return e.addClientAICommand()}),V_(21),fS(22,"translate"),hd()()()()()),r&2&&(_C(3),Dd(" ",hS(4,10,"Manage AI Commands")," "),_C(3),ZT(e.isLoading?6:-1),_C(),ZT(e.isLoading?-1:7),_C(2),ky(hS(10,12,"Add new AI command")),_C(5),By("ngModel",e.newClientAICommandText),fb(),_C(2),Dd(" ",e.newClientAICommandText.length||0,"/50 "),_C(),ZT(e.newClientAICommandText.length!==50?17:-1),_C(),ZT(e.newClientAICommandText.length===50?18:-1),_C(2),ay("disabled",e.newClientAICommandText.length===0),_C(),Dd(" ",hS(22,14,"Add")));},dependencies:[Pg,Is,Tg,$s,Dc,zc,Tt,S,Kv,Vg,b0,L0,Yx,dn,da,yr,Vw,Pw,nk,td,tC,bC,sv,NC,XC,_D,oD,lD,mD,sD,il,XD,rM,Fb,t1,A1,gS,Vs,zs,NS,ZS,EI,us,ms,HI,ZI,Dn,kE,Jv,go,qd,on,YE,OT,lA,mt],styles:["a[_ngcontent-%COMP%]:hover{cursor:pointer}"],changeDetection:1});}}return i})();export{oi as ManageAiAgentComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.