1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5b60da85-2b50-5ee5-8701-d377a9b1d2fa")}catch(e){}}(); 3import{a as at}from"./chunk-C3YPSG4J.js";import{a as Xe,b as et}from"./chunk-7YHDB6BP.js";import{b as oe}from"./chunk-NGNO6FAR.js";import{s as Je}from"./chunk-XFNJQLLA.js";import"./chunk-GHUQD4JW.js";import"./chunk-U2426UBQ.js";import"./chunk-ILZEXWLJ.js";import"./chunk-ZDOJUVOO.js";import{A as Qe,Ba as ne,Ca as Ye,O as qe,R as q,S as K,T as Z,U as Y,V as W,W as J,X,Y as ee,Z as te,_ as ie,aa as R,ca as Ke,da as Ze,k as $e,pb as We,q as ze,s as Ge,v as He}from"./chunk-5AEXZD3S.js";import"./chunk-FYQLJIGP.js";import{I as E,g as rt}from"./chunk-PHV575IR.js";import{a as Q}from"./chunk-VZNYVXL5.js";import{Ma as Le,Mb as Ue,Oa as je,Qb as U,Xb as G,c as Ie,d as ce,dc as H,f as pe,g as de,h as ue,ha as z,tb as F,vc as fe}from"./chunk-3LVKRIDY.js";import{Ab as b,Ce as C,Ee as Fe,Gb as g,Ib as p,Ie as De,Je as Oe,Le as Be,Mb as N,Na as s,Nb as L,Ob as j,Qe as Ve,Re as Ae,Vd as Re,Ve as Ne,Xb as m,Xd as $,Ya as V,Yb as k,Yc as Ee,Za as A,Zb as y,Zc as Se,_ as ye,_d as _e,a as be,ae as Pe,cb as u,ga as we,ha as B,ka as v,nc as x,oa as f,oc as O,pa as h,pb as c,qb as l,rb as r,re as ke,sb as _,te as ge,uc as M,vc as T,wb as S,we as Me,xb as I,xe as Te,ze as w}from"./chunk-JLCF3INP.js";import"./chunk-QQHUSC2D.js";import{h as xe,n as ve}from"./chunk-3EAH7Z56.js";function ut(i,o){if(i&1){let n=b();l(0,"th",16)(1,"mat-checkbox",17),g("change",function(t){f(n);let a=p();return h(t?a.masterToggle():null)}),r()()}if(i&2){let n=p();s(),c("checked",n.selection.hasValue()&&n.isAllSelected())("indeterminate",n.selection.hasValue()&&!n.isAllSelected())}}function _t(i,o){if(i&1){let n=b();l(0,"td",18)(1,"mat-checkbox",19),g("click",function(t){return f(n),h(t.stopPropagation())})("change",function(t){let a=f(n).$implicit,d=p();return h(t?d.selection.toggle(a):null)}),r()()}if(i&2){let n=o.$implicit,e=p();s(),c("checked",e.selection.isSelected(n))}}function gt(i,o){i&1&&(l(0,"th",20),m(1,"Nom"),r())}function ft(i,o){if(i&1){let n=b();l(0,"td",18)(1,"a",21),g("click",function(){let t=f(n).$implicit,a=p();return h(a.selectedRegion(t))}),m(2),M(3,"translate"),r()()}if(i&2){let n=o.$implicit;s(2),k(T(3,1,n.name))}}function ht(i,o){i&1&&(l(0,"th",20),m(1,"Type"),r())}function Ct(i,o){if(i&1&&(l(0,"td",18),m(1),M(2,"translate"),r()),i&2){let n=o.$implicit;s(),y(" ",T(2,1,"RUCHE_CONFIGURATION_"+n.type.toString().toUpperCase())," ")}}function xt(i,o){i&1&&_(0,"tr",22)}function vt(i,o){i&1&&_(0,"tr",23)}var tt=(()=>{let o=class o{constructor(){this.adminService=v(oe),this.router=v($),this.selection=new fe(!0,[])}ngOnInit(){this.selection=new fe(!0,[]),this.adminService.getRegions().then(e=>{this.initialDataSource=e.items,this.dataSource=new R(this.initialDataSource),this.dataSource.sort=this.sort}),this.displayedColumns=["select","name","type"]}applyFilter(e){this.dataSource.filter=e.trim().toLowerCase()}isAllSelected(){let e=this.selection.selected.length,t=this.dataSource.data.length;return e===t}masterToggle(){this.isAllSelected()?this.selection.clear():this.dataSource.data.forEach(e=>this.selection.select(e))}edit(){this.router.navigate([`/admin/settings/ruche-configuration/edit/${this.selection.selected[0].id}`])}selectedRegion(e){this.router.navigate([`/admin/settings/ruche-configuration/edit/${e.id}`])}};o.\u0275fac=function(t){return new(t||o)}
3,o.\u0275cmp=V({type:o,selectors:[["app-ruche-configuration"]],viewQuery:function(t,a){if(t&1&&N(ne,7),t&2){let d;L(d=j())&&(a.sort=d.first)}},standalone:!1,decls:23,vars:5,consts:[[1,"titleContainer"],[1,"title"],[1,"width",2,"margin-bottom","20px"],[1,"filter"],["matInput","",3,"keyup"],[1,"right"],["mat-raised-button","",3,"click","disabled"],["mat-table","","matSort","",1,"mat-elevation-z0",3,"dataSource"],["matColumnDef","select"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","type"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],[3,"change","checked","indeterminate"],["mat-cell",""],[3,"click","change","checked"],["mat-header-cell","","mat-sort-header",""],[1,"subject",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){t&1&&(l(0,"div",0)(1,"p",1),m(2),r()(),l(3,"div",2)(4,"mat-form-field",3)(5,"mat-label"),m(6,"Rechercher"),r(),l(7,"input",4),g("keyup",function(P){return a.applyFilter(P.target.value)}),r()(),l(8,"div",5)(9,"button",6),g("click",function(){return a.edit()}),m(10," Modifier "),r()()(),l(11,"table",7),S(12,8),u(13,ut,2,2,"th",9)(14,_t,2,1,"td",10),I(),S(15,11),u(16,gt,2,0,"th",12)(17,ft,4,3,"td",10),I(),S(18,13),u(19,ht,2,0,"th",12)(20,Ct,3,3,"td",10),I(),u(21,xt,1,0,"tr",14)(22,vt,1,0,"tr",15),r()),t&2&&(s(2),y(" ","Gestion des Ruches"," "),s(7),c("disabled",a.selection.selected.length!==1),s(2),c("dataSource",a.dataSource),s(10),c("matHeaderRowDef",a.displayedColumns),s(),c("matRowDefColumns",a.displayedColumns))},dependencies:[q,Z,X,Y,K,ee,W,J,te,ie,G,U,H,z,Q,ne,Ye,F],styles:[`table[_ngcontent-%COMP%]{width:90%}.titleContainer[_ngcontent-%COMP%]{margin-top:30px;margin-bottom:-10px}.title[_ngcontent-%COMP%]{font-size:24px;color:#636363}.width[_ngcontent-%COMP%]{width:90%;display:flex;justify-content:space-between}.filter[_ngcontent-%COMP%]{float:left;font-size:16px;margin-top:5px;width:300px}.right[_ngcontent-%COMP%]{float:right;padding-top:20px}.add-button[_ngcontent-%COMP%]{background:#f4bd18}.subject[_ngcontent-%COMP%]{text-decoration:underline}.subject[_ngcontent-%COMP%]:hover{color:#6ca7a9} 4/*# sourceMappingURL=ruche-configuration.component-4CYFE6VS.css.map */`]});let i=o;return i})();var D=xe(at());var it=xe(rt());var bt=["selectDropdown"],yt=()=>["fas","chevron-right"],re=()=>({width:300,height:300}),ae=()=>({width:320,height:320}),le=()=>({width:450,height:450}),se=i=>[i];function wt(i,o){i&1&&(l(0,"mat-form-field",19)(1,"mat-label"),m(2,"Ruche d'appartenance"),r(),_(3,"input",46),r())}function Et(i,o){if(i&1&&(l(0,"div"),u(1,wt,4,0,"mat-form-field",22),l(2,"mat-form-field",42)(3,"mat-label"),m(4,"Description fran\xE7aise"),r(),_(5,"textarea",43),r(),l(6,"p",44),m(7),r(),l(8,"mat-form-field",42)(9,"mat-label"),m(10,"Description anglaise"),r(),_(11,"textarea",45),r(),l(12,"p",44),m(13),r()()),i&2){let n=p(2);s(),c("ngIf",n.displayParent),s(6),y("",n.descriptionLength," caract\xE8res restants"),s(6),y("",n.descriptionEnglishLength," caract\xE8res restants")}}function St(i,o){i&1&&(l(0,"mat-form-field",19)(1,"mat-label"),m(2,"Ruche sp\xE9cialis\xE9e"),r(),_(3,"input",47),r())}function It(i,o){i&1&&(l(0,"span"),m(1,"Propager ce message dans toutes les r\xE9gions"),r())}function Rt(i,o){i&1&&(l(0,"span"),m(1,"Utiliser ce message en priorit\xE9 pour cette r\xE9gion"),r())}function Pt(i,o){if(i&1&&(l(0,"span"),m(1),r()),i&2){let n=o.$implicit;s(),k(n)}}function kt(i,o){if(i&1){let n=b();l(0,"div",48)(1,"h4"),m(2,"Message francais"),r(),_(3,"app-inline-editor",49),l(4,"h4"),m(5,"Message anglais"),r(),_(6,"app-inline-editor",49),l(7,"mat-checkbox",50),g("change",function(t){f(n);let a=p(2);return h(a.updatePriorityMessagesList(t))}),u(8,It,2,0,"span",21)(9,Rt,2,0,"span",21),r(),l(10,"p",51),u(11,Pt,2,1,"span",52),r()()}if(i&2){let n=p(2);s(3),c("formToEdit",n.regionForm.get("message.fr"))("enableBold",!0)("enableVideo",!1)("enableImage",!1)("placeholder","Message en fran\xE7ais"),s(3),c("formToEdit",n.regionForm.get("message.en"))("enableBold",!0)("enableVideo",!1)("enableImage",!1)("placeholder","Message en anglais"),s(2),c("ngIf",n.region.type==="main"),s(),c("ngIf",n.region.type!=="main"),s(2),c("ngForOf",n.priorityMessagesList)}}function Mt(i,o){if(i&1&&(l(0,"mat-option",65),m(1),r()),i&2){let n=o.$implicit;c("value",n),s(),y(" ",n.name," ")}}function Tt(i,o){if(i&1){let n=b();l(0,"mat-form-field")(1,"mat-label"),m(2,"Ajouter un partenaire"),r(),l(3,"mat-select",63,0),g("valueChange",function(t){f(n);let a=p().$implicit,d=p(3);return h(d.addPartner(t,a))}),u(5,Mt,2,2,"mat-option",64),r()()}if(i&2){let n=p().$implicit,e=p(3);s(3),c("disabled",e.dropDownIsEmpty(n)),s(2),c("ngForOf",e.dropDownAddPartners[n.lookupId])}}function Ft(i,o){i&1&&_(0,"div",66)}function Dt(i,o){i&1&&_(0,"app-empty-table",67),i&2&&c("message","Aucun partenaire")}function Ot(i,o){i&1&&(l(0,"th",77),m(1,"Nom"),r())}function Bt(i,o){if(i&1&&(l(0,"td",78),m(1),M(2,"translate"),r()),i&2){let n=o.$implicit;s(),y(" ",T(2,1,n.name)," ")}}function Vt(i,o){i&1&&(l(0,"th",79),m(1,"Actions"),r())}function At(i,o){if(i&1){let n=b();
4l(0,"mat-icon",81),g("click",function(){f(n);let t=p().$implicit,a=p(2).$implicit,d=p(3);return h(d.moveUp(t,a))}),m(1,"arrow_upward "),r()}}function Nt(i,o){i&1&&_(0,"mat-icon")}function Lt(i,o){if(i&1){let n=b();l(0,"mat-icon",81),g("click",function(){f(n);let t=p().$implicit,a=p(2).$implicit,d=p(3);return h(d.moveDown(t,a))}),m(1,"arrow_downward "),r()}}function jt(i,o){i&1&&_(0,"mat-icon")}function $t(i,o){if(i&1&&(l(0,"td",78),u(1,At,2,0,"mat-icon",80)(2,Nt,1,0,"mat-icon",21)(3,Lt,2,0,"mat-icon",80)(4,jt,1,0,"mat-icon",21),r()),i&2){let n=o.$implicit,e=p(2).$implicit,t=p(3);s(),c("ngIf",t.findIndex(n,e)!==0),s(),c("ngIf",t.findIndex(n,e)===0),s(),c("ngIf",t.findIndex(n,e)!==t.findDataSourceByPartnerTypeId[e.lookupId].data.length-1),s(),c("ngIf",t.findIndex(n,e)===t.findDataSourceByPartnerTypeId[e.lookupId].data.length-1)}}function zt(i,o){i&1&&_(0,"th",79)}function Ut(i,o){if(i&1){let n=b();l(0,"mat-icon",81),g("click",function(){f(n);let t=p().$implicit,a=p(2).$implicit,d=p(3);return h(d.removePartner(t,a))}),m(1,"close "),r()}}function Gt(i,o){if(i&1&&(l(0,"td",78),u(1,Ut,2,0,"mat-icon",80),r()),i&2){let n=p(2).$implicit;s(),c("ngIf",!n.fr.includes("Bas de page"))}}function Ht(i,o){i&1&&_(0,"tr",82)}function Qt(i,o){if(i&1&&_(0,"tr",83),i&2){let n=o.$implicit,e=p(5);c("@fadeInOut",e.animate(n))}}function qt(i,o){if(i&1&&(l(0,"table",68),S(1,69),u(2,Ot,2,0,"th",70)(3,Bt,3,3,"td",71),I(),S(4,72),u(5,Vt,2,0,"th",73)(6,$t,5,4,"td",71),I(),S(7,74),u(8,zt,1,0,"th",73)(9,Gt,2,1,"td",71),I(),u(10,Ht,1,0,"tr",75)(11,Qt,1,1,"tr",76),r()),i&2){let n=p().$implicit,e=p(3);c("dataSource",e.findDataSourceByPartnerTypeId[n.lookupId]),s(10),c("matHeaderRowDef",e.displayedColumns),s(),c("matRowDefColumns",e.displayedColumns)}}function Kt(i,o){if(i&1&&(l(0,"div")(1,"div",54)(2,"div",55)(3,"span",56),m(4),r(),l(5,"div",57),u(6,Tt,6,2,"mat-form-field",21)(7,Ft,1,0,"div",58),r()()(),l(8,"div",59)(9,"div",60),u(10,Dt,1,1,"app-empty-table",61),r()(),u(11,qt,12,3,"table",62),r()),i&2){let n=o.$implicit,e=p(3);s(4),k(n.fr),s(2),c("ngIf",!n.fr.includes("Bas de page")),s(),c("ngIf",n.fr.includes("Bas de page")),s(3),c("ngIf",e.isEmpty(n)),s(),c("ngIf",!e.isEmpty(n))}}function Zt(i,o){if(i&1&&(l(0,"mat-tab",53),u(1,Kt,12,5,"div",52),r()),i&2){let n=p(2);s(),c("ngForOf",n.lookupPartnersType)}}function Yt(i,o){if(i&1){let n=b();l(0,"div",2)(1,"span",3)(2,"span",4),g("click",function(){f(n);let t=p();return h(t.back())}),m(3,"Liste des Ruches"),r(),_(4,"fa-icon",5),l(5,"span",6),m(6),r()(),l(7,"div",7)(8,"p",8),m(9,"Modifier une Ruche"),r(),l(10,"div",9)(11,"button",10),g("click",function(){f(n);let t=p();return h(t.back(!0))}),m(12,"Annuler"),r(),l(13,"button",11),g("click",function(){f(n);let t=p();return h(t.onSubmit())}),m(14),M(15,"translate"),r()()(),l(16,"mat-card",12)(17,"form",13)(18,"mat-tab-group",14),g("selectedIndexChange",function(t){f(n);let a=p();return h(a.onTabIndexChange(t))}),l(19,"mat-tab",15)(20,"div",16)(21,"div")(22,"mat-form-field",17)(23,"mat-label"),m(24,"Nom"),r(),l(25,"input",18),g("change",function(){f(n);let t=p();return h(t.modified())}),r()()(),l(26,"mat-form-field",19)(27,"mat-label"),m(28,"Type"),r(),_(29,"input",20),r(),u(30,Et,14,3,"div",21)(31,St,4,0,"mat-form-field",22),l(32,"mat-checkbox",23),m(33,"Masquer dans Lancer un projet"),r(),l(34,"mat-checkbox",24),m(35,"Recevoir des re\xE7us de charit\xE9"),r(),l(36,"mat-checkbox",25),m(37,"Actif"),r()()(),l(38,"mat-tab",26),u(39,kt,12,13,"div",27),r(),l(40,"mat-tab",28)(41,"div",29)(42,"div",30)(43,"div",31)(44,"h4"),m(45,"Publicit\xE9 A (Fran\xE7ais)"),r(),l(46,"app-image-uploader",32),g("logoOutput",function(t){f(n);let a=p();return h(a.uploadImageToCloud(t))}),r(),l(47,"mat-form-field",33)(48,"mat-label"),m(49,"Lien publicit\xE9 A (Francais)"),r(),_(50,"input",34),r()(),l(51,"div",31)(52,"h4"),m(53,"Publicit\xE9 A (Anglais)"),r(),l(54,"app-image-uploader",35),g("logoOutput",function(t){f(n);let a=p();return h(a.uploadImageToCloud(t))}),r(),l(55,"mat-form-field",36)(56,"mat-label"),m(57,"Lien publicit\xE9 A (Anglais)"),r(),_(58,"input",34),r()(),l(59,"p",37),m(60,' Ex: /fr/projet/exemple-de-projet pour un projet ou bien une URL compl\xE8te pour un site externe (commen\xE7ant par "http"). '),r()(),_(61,"hr"),l(62,"div",38)(63,"div",31)(64,"h4"),m(65,"Publicit\xE9 B (Fran\xE7ais)"),r(),l(66,"app-image-uploader",39),g("logoOutput",function(t){f(n);let a=p();return h(a.uploadImageToCloud(t))}),r(),l(67,"mat-form-field",33)(68,"mat-label"),m(69,"Lien publicit\xE9 B (Fran\xE7ais)"),r(),_(70,"input",34),r()(),l(71,"div",31)(72,"h4"),m(73,"Publicit\xE9 B (Anglais)"),r(),l(74,"app-image-uploader",40),g("logoOutput",function(t){f(n);let a=p();return h(a.uploadImageToCloud(t))}),r(),l(75,"mat-form-field",36)(76,"mat-label"),m(77,"Lien publicit\xE9 B (Anglais)"),r(),_(78,"input",34),r()(),l(79,"p",37),m(80,' Ex: /fr/projet/exemple-de-projet pour un projet ou bien une URL compl\xE8te pour un site externe (commen\xE7ant par "http"). '),r()()()(),u(81,Zt,2,1,"mat-tab",41),r()()()()}if(i&2){let n=p();s(4),c("icon",x(22,yt)),s(2),k(n.region.name),s(8),y(" ",T(15,20,"ADMIN_SAVE_BUTTON")," "),s(3),c("formGroup",n.regionForm),s(13),c("ngIf",n.region.type==="specialized"),s(),c("ngIf",n.displaySubRegions),s(8),c("ngIf",n.currentTabIndex===1),s(7),c("viewport",x(23,re))("boundary",x(24,ae))("customSizes",O(26,se,x(25,le))),s(8),c("viewport",x(28,re))("boundary",x(29,ae))("customSizes",O(31,se,x(30,le))),s(12),c("viewport",x(33,re))("boundary",x(34,ae))("customSizes",O(36,se,x(35,le))),s(8),c("viewport",x(38,re))("boundary",x(39,ae))("customSizes",O(41,se,x(40,le))),s(7),c("ngIf",n.region.type!=="specialized")}}var nt=(()=>{let o=class o{constructor(){this.router=v($),this.route=v(Re),this.adminService=v(oe),this.formBuilder=v(Ne),this.translate=v(F),this.snackbar=v(je),this.uploadService=v(et),this.subscriptions=new be,this.regions=[],this.unsavedModifications=!1,this.saved=!1,this.dropDownAddPartners=[],this.displaySubRegions=!1,this.displayParent=!1,this.findDataSourceByPartnerTypeId=[],this.findRegionsById=[],this.movedRow=[],this.isOpen=!0,this.priorityMessagesList=[],this.currentTabIndex=0}ngOnInit(){this.getParams(),this.createForm(),this.getRegionsAndSetDefaultValues(),this.displayedColumns=["partners","actions","delete"]}getParams(){this.pathId=this.route.paramMap.pipe(ye(e=>this.pathId=e.getAll("regionId"))),this.subscriptions.add(this.pathId.subscribe(e=>{this.value=e}))}createForm(){this.regionForm=this.formBuilder.group({name:["",ge.required],type:[{value:"",disabled:!0},ge.required]})}uploadImageToCloud(e){return ve(this,null,function*(){if(e.upload){let t=this.uploadService.generateFilename(e);yield this.uploadService.imageUpload(e,t,(0,it.default)(this.region.name,{strict:!0}),Xe.REGIONS),this.regionForm.patchValue(this.generatePatchValueObject(e.logoForm,t))}else this.regionForm.patchValue(this.generatePatchValueObject(e.logoForm,null))})}toggle(){this.isOpen=!this.isOpen}getRegionsAndSetDefaultValues(){this.adminService.getRegions().then(e=>{this.getRegion(e),this.initialiseRucheForm(),this.setDefaultSubRegions(),this.initialiseParent(),this.initialiseDefaultValuesForAllies(),this.getPartnersAndSetSubRegions(),this.setPriorityMessagesList(e.items)})}getRegion(e){for(let t of e.items)this.findRegionsById[t.id]=t;this.region=this.findRegionsById[this.value],this.region.message||(this.region.message={}),this.region.corporateBlock||(this.region.corporateBlock={})}initialiseParent(){this.region.type===D.RegionType.SPECIALIZED&&this.region.parent&&(this.displayParent=!0,this.regionForm.addControl("parent",new C({value:this.findRegionsById[this.region.parent].name,disabled:!0})))}initialiseRucheForm(){this.region.type===D.RegionType.SPECIALIZED&&(this.regionForm.addControl("descriptionFr",new C(this.region.description.fr)),this.regionForm.addControl("descriptionEn",new C(this.region.description.en)),this.wordCounter());let e=this.region.corporateBlock||null;this.regionForm.addControl("corporateBlock",new w({pubA:new w({fr:new w({image:new C(E(e,"pubA.fr.image",null)),link:new C(E(e,"pubA.fr.link",null))}),en:new w({image:new C(E(e,"pubA.en.image",null)),link:new C(E(e,"pubA.en.link",null))})}),pubB:new w({fr:new w({image:new C(E(e,"pubB.fr.image",null)),link:new C(E(e,"pubB.fr.link",null))}),en:new w({image:new C(E(e,"pubB.en.image",null)),link:new C(E(e,"pubB.en.link",null))})})})),this.regionForm.addControl("hiddenForNewProject",new C(this.region.hiddenForNewProject)),this.regionForm.addControl("active",new C(!this.region.inactive)),this.regionForm.addControl("supportReceipt",new C(this.region.supportReceipt)),this.regionForm.addControl("message",new w({fr:new C(this.region.message.fr),en:new C(this.region.message.en),hasPriority:new C(this.region.message.hasPriority)})),this.regionForm.patchValue({name:this.region.name,type:this.translate.transform("RUCHE_CONFIGURATION_"+this.region.type.toString().toUpperCase())})}setPriorityMessagesList(e){for(let t of e)t.message&&t.message.hasPriority&&(this.priorityMessagesList[t.id]=this.computeMessage(t))}onTabIndexChange(e){this.currentTabIndex=e}updatePriorityMessagesList(e){this.priorityMessagesList[this.region.id]=e.checked?this.computeMessage(this.region):null}wordCounter(){this.regionForm.controls.descriptionFr.valueChanges.subscribe(e=>{this.descriptionLength=1500-e.length}),this.regionForm.controls.descriptionEn.valueChanges.subscribe(e=>{this.descriptionEnglishLength=1500-e.length})}setDefaultSubRegions(){if(this.region.subRegions){for(let e of this.region.subRegions)this.regions.push(this.findRegionsById[e]);this.initialiseSubRegions()}}initialiseSubRegions(){if(this.regions.length!==0){let e="";for(let t of this.regions)e=this.regions.indexOf(t)===this.regions.length-1?e.concat(t.name):e.concat(t.name+", ");this.displaySubRegions=!0,this.regionForm.addControl("subRegions",new C({value:e,disabled:!0}))}}initialiseDefaultValuesForAllies(){this.adminService.getLookupByType("PARTNERS_TYPE").then(e=>{this.lookupPartnersType=e.items,this.region.type===D.RegionType.MAIN&&this.lookupPartnersType.pu
4sh({lookupId:"footer",fr:"Bas de page"});for(let t of this.lookupPartnersType){let a=this.region.partners?this.findRegionPartners(t):[];this.findDataSourceByPartnerTypeId[t.lookupId]=new R(a)}})}findRegionPartners(e){let t=[];for(let a of this.region.partners)a.type===e.lookupId&&t.push(a);return this.sortByKey(t,"order"),t}getPartnersAndSetSubRegions(){this.adminService.getPartners().then(e=>{this.lookupPartners=e.items;for(let t of this.lookupPartners){let a=this.findDataSourceByPartnerTypeId[t.type],d=a?a.data.find(P=>P.partnerId===t.partnerId):null;this.dropDownAddPartners[t.type]||(this.dropDownAddPartners[t.type]=[]),!d&&t.active&&this.dropDownAddPartners[t.type].push({partnerId:t.partnerId,name:t.name}),this.sortByKey(this.dropDownAddPartners[t.type],"name")}})}addPartner(e,t){let a=this.findDataSourceByPartnerTypeId[t.lookupId].data;a.push(e),this.findDataSourceByPartnerTypeId[t.lookupId]=new R(a),this.removeSelectedFromValuesDropDown(t,e),this.selectDropdown.forEach(d=>{d.value=[],d.close()}),this.modified()}removeSelectedFromValuesDropDown(e,t){let a=this.dropDownAddPartners[e.lookupId];for(let d in a)a[d].partnerId===t.partnerId&&a.splice(d,1)}removePartner(e,t){this.dropDownAddPartners[t.lookupId].push(e),this.sortByKey(this.dropDownAddPartners[t.lookupId],"name");let a=this.findDataSourceByPartnerTypeId[t.lookupId].data;a.splice(a.indexOf(e),1),this.findDataSourceByPartnerTypeId[t.lookupId]=new R(a),this.modified()}moveUp(e,t){this.movedRow=[e],this.toggle(),setTimeout(()=>{this.toggle()},100);let a=this.findDataSourceByPartnerTypeId[t.lookupId].data,d=a.indexOf(e);a.splice(d,1),a.splice(d-1,0,e),this.findDataSourceByPartnerTypeId[t.lookupId]=new R(a),this.modified()}moveDown(e,t){this.movedRow=[e],this.toggle(),setTimeout(()=>{this.toggle()},100);let a=this.findDataSourceByPartnerTypeId[t.lookupId].data,d=a.indexOf(e);a.splice(d,1),a.splice(d+1,0,e),this.findDataSourceByPartnerTypeId[t.lookupId]=new R(a),this.modified()}findIndex(e,t){return this.findDataSourceByPartnerTypeId[t.lookupId].data.indexOf(e)}onSubmit(){let e={};e.id=Number(this.value),e.name=this.regionForm.get("name").value,e.supportReceipt=this.regionForm.get("supportReceipt").value,e.hiddenForNewProject=this.regionForm.get("hiddenForNewProject").value,e.message={fr:this.regionForm.get("message.fr").value,en:this.regionForm.get("message.en").value,hasPriority:this.regionForm.get("message.hasPriority").value},e.partners=this.parsePartners(),this.region.type===D.RegionType.SPECIALIZED&&(e.description={fr:this.regionForm.get("descriptionFr").value,en:this.regionForm.get("descriptionEn").value}),e.corporateBlock={pubA:{fr:{image:this.regionForm.get("corporateBlock.pubA.fr.image").value?this.regionForm.get("corporateBlock.pubA.fr.image").value.split("/").pop():null,link:this.regionForm.get("corporateBlock.pubA.fr.link").value},en:{image:this.regionForm.get("corporateBlock.pubA.en.image").value?this.regionForm.get("corporateBlock.pubA.en.image").value.split("/").pop():null,link:this.regionForm.get("corporateBlock.pubA.en.link").value}},pubB:{fr:{image:this.regionForm.get("corporateBlock.pubB.fr.image").value?this.regionForm.get("corporateBlock.pubB.fr.image").value.split("/").pop():null,link:this.regionForm.get("corporateBlock.pubB.fr.link").value},en:{image:this.regionForm.get("corporateBlock.pubB.en.image").value?this.regionForm.get("corporateBlock.pubB.en.image").value.split("/").pop():null,link:this.regionForm.get("corporateBlock.pubB.en.link").value}}},this.regionForm.get("active").value||(e.inactive=!this.regionForm.get("active").value),this.adminService.postRegions(e).then(()=>{this.snackbar.showMessage(this.translate.transform("ADMIN_SAVE_CONFIRMATION")),this.unsavedModifications=!1,this.saved=!0,this.back()}).catch(t=>{this.snackbar.showError(t)})}parsePartners(){let e=[];for(let t in this.findDataSourceByPartnerTypeId){let a=0;for(let d of this.findDataSourceByPartnerTypeId[t].data)e.push({partnerId:d.partnerId,order:a,type:d.type}),a++}return e}isEmpty(e){return this.findDataSourceByPartnerTypeId[e.lookupId]&&this.findDataSourceByPartnerTypeId[e.lookupId].data.length===0}sortByKey(e,t){return e.sort((a,d)=>{let P=a[t],Ce=d[t];return P<Ce?-1:P>Ce?1:0})}animate(e){for(let t of this.movedRow)if(e.partnerId===t.partnerId)return this.isOpen?"in":"out";return null}back(e){e&&(this.unsavedModifications=!1),this.router.navigate(["/admin/settings/ruche-configuration"])}modified(){this.saved=!1,this.unsavedModifications=!0}dropDownIsEmpty(e){return this.dropDownAddPartners[e.lookupId]?this.dropDownAddPartners[e.lookupId].length===0:!0}computeMessage(e){return e.type===D.RegionType.MAIN?"Le message de La Ruche Principale est actuellement propag\xE9 sur toutes les r\xE9gions":`Le message de La Ruche ${e.name} est actuellement prioritaire sur celui de La Ruche Principale`}generatePatchValueObject(e,t){return e.split(".").reduceRight((a,d)=>({[d]:a}),t)}};o.\u0275fac=function(t){return new(t||o)}
4,o.\u0275cmp=V({type:o,selectors:[["app-edit-ruche-configuration"]],viewQuery:function(t,a){if(t&1&&N(bt,5),t&2){let d;L(d=j())&&(a.selectDropdown=d)}},standalone:!1,decls:1,vars:1,consts:[["selectDropdown",""],["class","top-margin top-width",4,"ngIf"],[1,"top-margin","top-width"],[2,"font-size","16px"],[1,"back",3,"click"],[1,"chevron",3,"icon"],[1,"grey-back"],[1,"flex-left-right","top-width"],[1,"title"],[1,"button-center"],["mat-raised-button","",2,"margin-right","10px",3,"click"],["mat-raised-button","",1,"mat-yellow-button",3,"click"],[1,"width","top-card"],[3,"formGroup"],[3,"selectedIndexChange"],["label","Ruche"],[2,"overflow","hidden"],[2,"margin-right","10px","margin-top","20px"],["matInput","","maxlength","200","formControlName","name","required","",3,"change"],[1,"formSpacing"],["matInput","","maxlength","200","formControlName","type"],[4,"ngIf"],["class","formSpacing",4,"ngIf"],["formControlName","hiddenForNewProject"],["formControlName","supportReceipt",2,"margin-left","20px"],["formControlName","active",2,"margin-left","20px"],["label","Message de la r\xE9gion"],["class","messages-container","formGroupName","message",4,"ngIf"],["label","Images publicitaires"],["formGroupName","corporateBlock",1,"ads-container"],["formGroupName","pubA",1,"ad-container"],[1,"ad-details"],["logoInput","corporateBlock.pubA.fr.image",3,"logoOutput","viewport","boundary","customSizes"],["formGroupName","fr"],["type","text","matInput","","formControlName","link"],["logoInput","corporateBlock.pubA.en.image",3,"logoOutput","viewport","boundary","customSizes"],["formGroupName","en"],[1,"text-tips"],["formGroupName","pubB",1,"ad-container"],["logoInput","corporateBlock.pubB.fr.image",3,"logoOutput","viewport","boundary","customSizes"],["logoInput","corporateBlock.pubB.en.image",3,"logoOutput","viewport","boundary","customSizes"],["label","Partenaires",4,"ngIf"],[1,"description"],["matInput","","maxlength","1500","formControlName","descriptionFr",2,"min-height","70px"],[1,"descriptionWordCount"],["matInput","","maxlength","1500","formControlName","descriptionEn",2,"min-height","70px"],["matInput","","maxlength","200","formControlName","parent"],["matInput","","maxlength","200","formControlName","subRegions"],["formGroupName","message",1,"messages-container"],[3,"formToEdit","enableBold","enableVideo","enableImage","placeholder"],["formControlName","hasPriority",3,"change"],[1,"info-text"],[4,"ngFor","ngForOf"],["label","Partenaires"],[1,"titleContainer"],[1,"flexSpaceBetween"],[1,"title","flexAlignVertically"],[2,"width","40%"],["style","margin-bottom: 70px",4,"ngIf"],[2,"display","flex","justify-content","center"],[2,"width","99%","margin-bottom","5px"],[3,"message",4,"ngIf"],["mat-table","",3,"dataSource",4,"ngIf"],[3,"valueChange","disabled"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[2,"margin-bottom","70px"],[3,"message"],["mat-table","",3,"dataSource"],["matColumnDef","partners"],["mat-header-cell","","style","width: 80%",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","delete"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","",2,"width","80%"],["mat-cell",""],["mat-header-cell",""],["class","icon",3,"click",4,"ngIf"],[1,"icon",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){t&1&&u(0,Yt,82,43,"div",1),t&2&&c("ngIf",a.region)},dependencies:[Ee,Se,Le,Qe,Fe,ke,Me,Te,Ve,Ae,De,Be,Oe,ze,He,q,Z,X,Y,K,ee,W,J,te,ie,Ke,Ze,G,U,Ge,Ue,H,z,Q,qe,$e,F],styles:[`.top-margin[_ngcontent-%COMP%]{margin-top:30px}.top-card[_ngcontent-%COMP%]{margin-top:10px}.top-width[_ngcontent-%COMP%]{width:calc(87% + 32px)}.flex-left-right[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.title[_ngcontent-%COMP%]{font-size:24px}.button-center[_ngcontent-%COMP%]{display:flex;align-items:center}.width[_ngcontent-%COMP%]{width:87%}.ads-container[_ngcontent-%COMP%] .ad-container[_ngcontent-%COMP%]{display:flex;justify-content:space-evenly;flex-wrap:wrap}.ads-container[_ngcontent-%COMP%] .ad-container[_ngcontent-%COMP%] .ad-details[_ngcontent-%COMP%]{width:50%;padding:20px;box-sizing:border-box}.ads-container[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border-color:#0000001f;margin:60px 0}.ads-container[_ngcontent-%COMP%] .text-tips[_ngcontent-%COMP%]{margin:0;font-size:13px}.info-text[_ngcontent-%COMP%]{font-style:italic;font-size:14px;color:#00000080}.info-text[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;line-height:25px}mat-form-field[_ngcontent-%COMP%]{width:100%;min-width:100px;font-weight:lighter!important;font-size:large}.descriptionWordCount[_ngcontent-%COMP%]{margin-top:-10px;font-size:13px;font-weight:400;color:#0000008a}.description[_ngcontent-%COMP%]{width:100%;font-size:15px}table[_ngcontent-%COMP%]{width:100%}.titleContainer[_ngcontent-%COMP%]{margin-top:40px;margin-bottom:-10px}.filter[_ngcontent-%COMP%]{float:left;font-size:16px;margin-top:5px;width:300px}.right[_ngcontent-%COMP%]{float:right;padding-top:20px}.add-button[_ngcontent-%COMP%]{background:#f4bd18}.flexSpaceBetween[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.flexAlignVertically[_ngcontent-%COMP%]{display:flex;align-items:center}.mat-yellow-button[_ngcontent-%COMP%]{background:#f4be18!important}.backToSelection[_ngcontent-%COMP%]{color:gray;cursor:pointer}.spacing[_ngcontent-%COMP%]{margin-top:10px}.formSpacing[_ngcontent-%COMP%]{margin-right:10px;margin-top:10px}.back[_ngcontent-%COMP%]{color:#6ca7a9}.back[_ngcontent-%COMP%]:hover{cursor:pointer}.grey-back[_ngcontent-%COMP%]{color:gray}.chevron[_ngcontent-%COMP%]{font-size:14px;color:#000;padding-left:5px;padding-right:5px}.icon[_ngcontent-%COMP%]{cursor:pointer}.icon[_ngcontent-%COMP%]:hover{color:#6ca7a9} 5/*# sourceMappingURL=edit-ruche-configuration.component-NCRL2ZF2.css.map */`],data:{animation:[Ie("fadeInOut",[de("in",pe({backgroundColor:"white"})),de("out",pe({backgroundColor:"grey"})),ue("in => out",[ce("0.3s")]),ue("out => in",[ce("0.3s")])])]}});let i=o;return i})(),me=(()=>{let o=class o{constructor(){}canDeactivate(e){return e.unsavedModifications&&!e.saved?confirm("You have unsaved changes! If you leave, your changes will be lost."):!0}};o.\u0275fac=function(t){return new(t||o)}
5,o.\u0275prov=we({token:o,factory:o.\u0275fac});let i=o;return i})();var Wt=[{path:"",component:tt,data:{access:"adminRuches"}},{path:"edit/:regionId",component:nt,data:{access:"adminRuches"},canDeactivate:Pe([me])}],ot=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=A({type:o}),o.\u0275inj=B({imports:[_e.forChild(Wt),_e]});let i=o;return i})();var qi=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=A({type:o}),o.\u0275inj=B({providers:[me],imports:[We,Je,ot]});let i=o;return i})();export{qi as RucheConfigurationModule}; 6//# sourceMappingURL=chunk-6T7XKUEK.js.map 7 8//# debugId=5b60da85-2b50-5ee5-8701-d377a9b1d2fa
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.