1import{a as y}from"./chunk-S5EBLHJA.js";import{a as K}from"./chunk-HBTIAQWU.js";import{a as J}from"./chunk-HPMOSIW5.js";import{a as H}from"./chunk-IPKLJJ3K.js";import{a as B}from"./chunk-ATXEZIPJ.js";import{a as j,b as W}from"./chunk-IXD6ECVB.js";import"./chunk-EONF3GVN.js";import{a as G}from"./chunk-QIOURN4K.js";import"./chunk-KYVCMV2E.js";import"./chunk-HWZZ5RQT.js";import"./chunk-ZNR7QNVV.js";import{a as L}from"./chunk-JS6LICOA.js";import{a as z,b as U}from"./chunk-M6YDMVQ7.js";import{a as F}from"./chunk-EB6TJ75L.js";import"./chunk-QI7CEGT6.js";import"./chunk-6ND7557V.js";import{D as q,c as O,g as $,l as R}from"./chunk-FOJCKIWO.js";import{a as D}from"./chunk-NBMUSEX4.js";import"./chunk-3AIY57KH.js";import"./chunk-AB6CKZTE.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import"./chunk-G3G5OK6Q.js";import"./chunk-AERMLNF3.js";import"./chunk-QHMYZ6SM.js";import"./chunk-PJPLTBJX.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-H4HD3LNW.js";import"./chunk-AQEWHUN5.js";import"./chunk-YQZAETCE.js";import{x as N}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{I as M,r as k,s as T}from"./chunk-ERUCNOOT.js";import{$b as b,H as V,Jb as s,L as E,Lb as w,Vb as n,Wb as i,Xb as u,da as f,db as o,f as S,fc as v,gc as p,la as x,ma as _,sa as I,sb as A,tc as a,uc as d,vc as h,wc as P,yb as g}from"./chunk-DBE7WQEG.js";import{g as C}from"./chunk-W7GRJBO5.js";function X(l,r){if(l&1){let e=b();n(0,"button",12),v("click",function(){let m=x(e).$implicit,c=p();return _(c.filtre=m.key)}),a(1),i()}if(l&2){let e=r.$implicit,t=p();w("btn-primary",t.filtre===e.key)("btn-outline-secondary",t.filtre!==e.key),o(),P(" ",e.label," (",e.n,") ")}}function Y(l,r){l&1&&u(0,"app-widget-loading")}function Z(l,r){if(l&1){let e=b();n(0,"tr")(1,"td")(2,"div",18),u(3,"app-widget-workspace-avatar",19),n(4,"div")(5,"div",20),a(6),i(),n(7,"div",9),a(8),i()()()(),n(9,"td",21),u(10,"p-tag",22),n(11,"div",23),a(12),i()(),n(13,"td",15),a(14),i(),n(15,"td",15),a(16),i(),n(17,"td",15),a(18),i(),n(19,"td",15),a(20),i(),n(21,"td",15),a(22),i(),n(23,"td",15),a(24),i(),n(25,"td",15)(26,"button",24),v("click",function(){let m=x(e).$implicit,c=p(2);return _(c.prendre(m))}),u(27,"i",25),a(28," Prendre en charge "),i()()()}if(l&2){let e=r.$implicit,t=p(2);o(3),s("workspace",e)("size",32),o(3),d(e.name),o(2),h(" @",e.slug," "),o(2),s("severity",t.signaux[e.signalName].ton)("value",t.signaux[e.signalName].libelle),o(2),h(" ",t.signaux[e.signalName].conseil," "),o(2),d(t.nombre(e.followerCount)),o(2),d(e.videos),o(2),d(e.lives),o(2),d(e.produits),o(2),d(t.euros(e.caCents)),o(2),d(t.nombre(e.coinsTotal)),o(2),s("disabled",t.enCours===e.id),o(),w("pi-spin",t.enCours===e.id)("pi-spinner",t.enCours===e.id)("pi-plus",t.enCours!==e.id)}}function ee(l,r){l&1&&(n(0,"tr")(1,"td",26),a(2," Aucun compte \xE0 prendre avec ce filtre. "),i()())}function te(l,r){if(l&1){let e=b();n(0,"p-paginator",27),v("onPageChange",function(m){x(e);let c=p(2);return _(c.onPage(m))}),i()}if(l&2){let e=p(2);s("rows",e.limit)("first",e.offset)("totalRecords",e.total)}}function ie(l,r){if(l&1&&(n(0,"div",13)(1,"table",14)(2,"thead")(3,"tr")(4,"th"),a(5,"Compte"),i(),n(6,"th"),a(7,"Pourquoi ce compte"),i(),n(8,"th",15),a(9,"Abonn\xE9s"),i(),n(10,"th",15),a(11,"Contenus"),i(),n(12,"th",15),a(13,"Lives"),i(),n(14,"th",15),a(15,"Produits"),i(),n(16,"th",15),a(17,"CA"),i(),n(18,"th",15),a(19,"Coins"),i(),u(20,"th"),i()(),n(21,"tbody"),g(22,Z,29,20,"tr",16)(23,ee,3,0,"tr",10),i()(),g(24,te,1,3,"p-paginator",17),i()),l&2){let e=p();o(22),s("ngForOf",e.visibles),o(),s("ngIf",!e.visibles.length),o(),s("ngIf",e.total>e.limit)}}var Q=class l{api=f(J);toast=f(F);confirm=f(G);destroyRef=f(I);signaux=y;nombre=H;euros=K;limit=50;items=[];total=0;offset=0;loading=!0;search="";filtre="";enCours=null;search$=new S;get filtres(){let r=[{key:"",label:"Tous",n:this.items.length}];for(let e of Object.keys(y)){let t=this.items.filter(m=>m.signalName===e).length;t&&r.push({key:e,label:y[e].libelle,n:t})}return r}get visibles(){return this.filtre?this.items.filter(r=>r.signalName===this.filtre):this.items}ngOnInit(){this.search$.pipe(V(350),E(),L(this.destroyRef)).subscribe(()=>{this.offset=0,this.charger()}),this.charger()}onSearch(r){this.search=r,this.search$.next(r)}onPage(r){this.offset=r.first??0,this.charger()}charger(){return C(this,null,function*(){this.loading=!0;try{let r=yield this.api.prospects(this.limit,this.offset,this.search);this.items=r?.items??[],this.total=r?.total??0}catch{this.toast.add({severity:"error",detail:"Impossible de charger le vivier."})}finally{this.loading=!1}})}prendre(r){return C(this,null,function*(){if(yield this.confirm.confirm({message:`Prendre \xAB ${r.name} \xBB en charge ? Votre r\xE9mun\xE9ration ne comptera que ce qui sera g\xE9n\xE9r\xE9 \xE0 partir de maintenant.`,header:"Prise en charge"})){this.enCours=r.id;try{yield this.api.claim(r.id),this.items=this.items.filter(t=>t.id!==r.id),this.total=Math.max(0,this.total-1),this.toast.add({severity:"success",detail
1:`\xAB ${r.name} \xBB est dans votre portefeuille.`})}catch(t){this.toast.add({severity:"warn",detail:t?.status===409?"Ce compte vient d\u2019\xEAtre pris par un autre account manager.":"La prise en charge a \xE9chou\xE9."}),t?.status===409&&(yield this.charger())}finally{this.enCours=null}}})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=A({type:l,selectors:[["app-view-am-vivier"]],decls:17,vars:6,consts:[[1,"p-4"],[1,"d-flex","flex-wrap","align-items-center","justify-content-between","mb-3","gap-2"],[1,"h4","mb-1"],[1,"text-muted","mb-0","small"],[1,"badge","bg-secondary"],[1,"d-flex","flex-wrap","gap-2","mb-3"],["type","search","placeholder","Rechercher un compte (nom ou identifiant)\u2026",1,"form-control",2,"max-width","320px",3,"ngModelChange","ngModel"],["role","group","aria-label","Signal",1,"btn-group","flex-wrap","mb-3"],["type","button","class","btn btn-sm",3,"btn-primary","btn-outline-secondary","click",4,"ngFor","ngForOf"],[1,"text-muted","small"],[4,"ngIf"],["class","table-responsive",4,"ngIf"],["type","button",1,"btn","btn-sm",3,"click"],[1,"table-responsive"],[1,"table","table-hover","align-middle"],[1,"text-end"],[4,"ngFor","ngForOf"],[3,"rows","first","totalRecords","onPageChange",4,"ngIf"],[1,"d-flex","align-items-center","gap-2"],[3,"workspace","size"],[1,"fw-semibold"],[2,"max-width","340px"],[3,"severity","value"],[1,"text-muted","small","mt-1"],["type","button",1,"btn","btn-sm","btn-primary",3,"click","disabled"],[1,"pi"],["colspan","9",1,"text-center","text-muted","py-4"],[3,"onPageChange","rows","first","totalRecords"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"div")(3,"h2",2),a(4,"Vivier"),i(),n(5,"p",3),a(6," Comptes que personne n\u2019accompagne. Chaque ligne dit pourquoi elle remonte : c\u2019est ce qu\u2019il y a \xE0 dire en prenant contact. "),i()(),n(7,"span",4),a(8),i()(),n(9,"div",5)(10,"input",6),v("ngModelChange",function(c){return t.onSearch(c)}),i()(),n(11,"div",7),g(12,X,2,6,"button",8),i(),n(13,"p",9),a(14),i(),g(15,Y,1,0,"app-widget-loading",10)(16,ie,25,3,"div",11),i()),e&2&&(o(8),h("",t.total," comptes \xE0 prendre"),o(2),s("ngModel",t.search),o(2),s("ngForOf",t.filtres),o(2),h(" Les effectifs ci-dessus portent sur la page affich\xE9e, pas sur les ",t.total," comptes du vivier. "),o(),s("ngIf",t.loading),o(),s("ngIf",!t.loading))},dependencies:[M,k,T,q,O,$,R,N,U,z,W,j,D,B],encapsulation:2})};export{Q as ViewAmVivierComponent};
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.