1import{a as k}from"./chunk-YOFQ7M2F.js";import{n as V}from"./chunk-KXEFF4W6.js";import{a as U}from"./chunk-WRZ5VFZU.js";import"./chunk-ESMOWZPE.js";import"./chunk-PDEVKTHE.js";import"./chunk-NJUEY6XU.js";import"./chunk-VHIZSG6I.js";import"./chunk-CMPPNMYX.js";import"./chunk-DP74X7OO.js";import"./chunk-Y7NNW5AU.js";import"./chunk-3CXVCA2Q.js";import{a as W}from"./chunk-OIY3VLHH.js";import"./chunk-DUJ6LX5L.js";import{a as x}from"./chunk-MJSUTGXN.js";import"./chunk-BS4RL4AZ.js";import{a as y}from"./chunk-RYFPATC7.js";import"./chunk-6RTEWMFL.js";import{E as N,F as T,G as z,c as E,e as l,g as I,h as F,m as j,t as A,u as D}from"./chunk-FFMW3BKU.js";import"./chunk-C7EWNIGX.js";import"./chunk-2QGEOGPL.js";import"./chunk-PIHC2EQF.js";import"./chunk-6YMKS5V7.js";import"./chunk-MKWGOYT5.js";import{h as b,t as P}from"./chunk-NJIS2QIU.js";import{a as M}from"./chunk-NLPBTNQX.js";import{o as v,s as O}from"./chunk-HGQ4L3R6.js";import{Bc as c,Fd as w,Ob as g,Qb as h,Qc as _,Rd as S,Vb as m,Wb as n,Xb as a,Yb as s,gb as d,lc as C,qb as o,wb as f}from"./chunk-U2RKNGKP.js";import"./chunk-5KTCK5IS.js";var H=r=>({disabled:r});function $(r,J){r&1&&(n(0,"span",6),s(1,"i",9),c(2," can't be blank "),a())}var ct=(()=>{class r{constructor(e,i,t,u,q,G,B,R){this.adminService=e,this.utility=i,this._spinner=t,this.router=u,this.toastr=q,this.mentoringEvents=B,this.currentUserStateService=R,this.submitted=!1,this.mentoringEvents.setSelectedMenu("moderation_requests"),this.utility.setItem("moderation-tab","isStopWords"),this.form=G.group({stopWord:["",l.compose([l.required,U.validate])]}),this.adminSub=this.currentUserStateService.isSuperAdminState$.subscribe(p=>{p&&p.hasOwnProperty("isSuperAdmin")&&(p.isSuperAdmin||this.router.navigate([""]))})}disableSubmit(){return!(this.form.valid&&!this.submitted)}ngAfterViewInit(){window.scrollTo(0,0),this._spinner.hide()}ngOnDestroy(){this.adminSub&&this.adminSub.unsubscribe()}createStopWord(e){if(e.stopWord){this.submitted=!0;let i={data:{attributes:{created_by:this.utility.getItem("userId"),word:e.stopWord.trim()},type:"stop_words"}};this._spinner.show(),this.adminService.createStopWord(i).subscribe(t=>this.createStopWordSuccess(t),t=>this.createStopWordFail(t))}}createStopWordSuccess(e){e&&e.data&&(this.toastr.success("Stop word created successfully"),this.router.navigate(["stop_words"]))}createStopWordFail(e){e.errors[0].source.pointer=="/data/attributes/unique"&&this.toastr.error("Already triggered by another stop word"),this.submitted=!1,this._spinner.hide()}static{this.\u0275fac=function(i){return new(i||r)(o(y),o(P),o(b),o(v),o(W),o(N),o(M),o(x))}}static{this.\u0275cmp=f({type:r,selectors:[["create-stop-word"]],decls:13,vars:6,consts:[[1,"create-stop-word"],[1,"create-stop-word-container"],[3,"ngSubmit","formGroup"],[1,"create-stop-main"],[1,"required"],["type","text","placeholder","Word","formControlName","stopWord",1,"stopWordInput"],[1,"error"],[1,"create-stop-word-action"],["type","submit","value","Create stop word",1,"create-action",3,"disabled","ngClass"],[1,"fa","fa-info-circle"]],template:function(i,t){i&1&&(s(0,"moderation"),n(1,"div",0)(2,"div",1)(3,"form",2),C("ngSubmit",function(){return t.createStopWord(t.form.value)}),n(4,"div",3)(5,"span"),c(6,"Word\xA0"),n(7,"label",4),c(8,"*"),a()(),s(9,"input",5),g(10,$,3,0,"span",6),a(),n(11,"div",7),s(12,"input",8),a()()()()),i&2&&(d(3),m("formGroup",t.form),d(7),h(!t.form.get("stopWord").valid&&t.form.get("stopWord").touched?10:-1),d(2),m("disabled",t.disableSubmit())("ngClass",_(4,H,t.disableSubmit())))},dependencies:[k,T,j,E,I,F,z,D,A,w,S,V,O],styles:[".create-stop-word[_ngcontent-%COMP%]{font-size:15px;width:100%;overflow-y:hidden;background:#fff;border-left:1px solid #E2E7ED;border-right:1px solid #E2E7ED;padding:0 30px 30px;min-height:calc(100vh - 62px)}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%]{border:1px solid #E2E7ED;border-top:0;padding:20px;width:100%;float:left}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-main[_ngcontent-%COMP%]{width:100%;float:left}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-main[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:100%;float:left;font-size:16px;padding:10px 0}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-main[_ngcontent-%COMP%] .stopWordInput[_ngcontent-%COMP%]{width:100%;float:left;padding:10px;border:1px solid gainsboro;border-radius:2px;color:inherit;font-size:16px}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-main[_ngcontent-%COMP%] span.error[_ngcontent-%COMP%]{padding:10px;font-size:14px}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-word-action[_ngcontent-%COMP%]{width:100%;float:left;text-align:right}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-word-action[_ngcontent-%COMP%] .create-action[_ngcontent-%COMP%]{width:auto;padding:10px;font-size:16px;cursor:pointer;color:#0078af;border-radius:2px;border:1px solid #0078af;float:right;margin:20px 0;background:#fff}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-word-action[_ngcontent-%COMP%] .create-action[_ngcontent-%COMP%]:hover{opacity:.7}.create-stop-word[_ngcontent-%COMP%] .create-stop-word-container[_ngcontent-%COMP%] .create-stop-word-action[_ngcontent-%COMP%] .disabled[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.7}"]})}}return r})();export{ct as CreateStopWord};
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.