1"use strict";(self.webpackChunknivano_web=self.webpackChunknivano_web||[]).push([[4872],{94872:(vt,v,a)=>{a.d(v,{q:()=>gt});var l=a(79988),t=a(17705),g=a(6947),R=a(78742),j=a(45312),u=a(94751),E=a(21626);let x=(()=>{class i{constructor(e){this.http=e,this.endpoint=`${j.c.urlcommune}file-restrictions`}update(e){return this.http.put(`${this.endpoint}/${e.id}`,e,u.YM.HttpOptions)}deleteContact(e,n){return this.http.delete(`${this.endpoint}/${e.id}/users/${n.id}`,u.YM.HttpOptions)}addContact(e,n){return this.http.post(`${this.endpoint}/${e.id}/users`,n.id,u.YM.HttpOptions)}deleteProfil(e,n){return this.http.delete(`${this.endpoint}/${e.id}/profils/${n.id}`,u.YM.HttpOptions)}addProfil(e,n){return this.http.post(`${this.endpoint}/${e.id}/profils`,n.id,u.YM.HttpOptions)}static{this.\u0275fac=function(n){return new(n||i)(t.KVO(E.Qq))}}static{this.\u0275prov=t.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var h=a(10181),F=a(63285),c=a(60177),b=a(89417),C=a(476),D=a(44613),T=a(224),I=a(83269),m=a(34006),y=a(85956),G=a(66737),$=a(88588),_=a(96850),P=a(18017),N=a(67245),S=a(89881),A=a(48221),Y=a(19275),k=a(37655);function U(i,r){1&i&&(t.nrm(0,"i",21),t.EFF(1,"Informations sur le fichier"))}function V(i,r){1&i&&(t.nrm(0,"i",22),t.EFF(1,"Profils autoris\xe9s"))}function X(i,r){1&i&&(t.qex(0),t.j41(1,"strong",24),t.EFF(2," Le fichier accessible par tous les profils "),t.k0s(),t.bVm())}function M(i,r){}const z=function(i){return{profil:i}},d=function(i){return{$implicit:i}};function O(i,r){if(1&i&&t.DNE(0,M,0,0,"ng-template",31),2&i){const e=r.$implicit;t.XpG(3);const n=t.sdS(35);t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(4,d,t.eq3(2,z,e)))}}function B(i,r){if(1&i&&(t.j41(0,"mat-option",36),t.nI1(1,"inArray"),t.EFF(2),t.nI1(3,"titlecase"),t.k0s()),2&i){const e=r.$implicit,n=t.XpG(4);t.Y8G("value",e)("disabled",t.brH(1,3,e,n.authorizedProfils,"id")),t.R7$(2),t.SpI(" ",t.bMT(3,7,e.nom)," ")}}function L(i,r){if(1&i){const e=t.RV6();t.j41(0,"tfoot")(1,"tr")(2,"td",26)(3,"span",32)(4,"mat-form-field",33)(5,"mat-select",34),t.bIt("ngModelChange",function(o){t.eBV(e);const s=t.XpG(3);return t.Njj(s.newProfil=o)})("ngModelChange",function(){t.eBV(e);const o=t.XpG(3);return t.Njj(o.ajouterProfil(o.newProfil))}),t.DNE(6,B,4,9,"mat-option",35),t.k0s()()()()()()}if(2&i){const e=t.XpG(3);t.R7$(5),t.Y8G("ngModel",e.newProfil)("compareWith",e.compareProfils),t.R7$(1),t.Y8G("ngForOf",e.profils)}}function w(i,r){1&i&&(t.qex(0),t.nrm(1,"i",38),t.EFF(2,"Ajouter "),t.bVm())}function H(i,r){1&i&&(t.qex(0),t.EFF(1," Annuler "),t.bVm())}function W(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",37),t.bIt("click",function(){t.eBV(e);const o=t.XpG(3);return t.Njj(o.isAjoutProfilEnCours=!o.isAjoutProfilEnCours)}),t.DNE(1,w,3,0,"ng-container",23),t.DNE(2,H,2,0,"ng-container",23),t.k0s()}if(2&i){const e=t.XpG(3);t.R7$(1),t.Y8G("ngIf",!e.isAjoutProfilEnCours),t.R7$(1),t.Y8G("ngIf",e.isAjoutProfilEnCours)}}function K(i,r){if(1&i&&(t.qex(0),t.j41(1,"table",25)(2,"tbody")(3,"tr")(4,"td",26)(5,"div",27),t.EFF(6," Aucun profil s\xe9lectionn\xe9 "),t.k0s()()(),t.DNE(7,O,1,6,null,28),t.k0s(),t.DNE(8,L,7,3,"tfoot",23),t.k0s(),t.j41(9,"div",29),t.DNE(10,W,3,2,"button",30),t.k0s(),t.bVm()),2&i){const e=t.XpG(2);t.R7$(7),t.Y8G("ngForOf",e.authorizedProfils),t.R7$(1),t.Y8G("ngIf",e.isAjoutProfilEnCours),t.R7$(2),t.Y8G("ngIf",e.authorizedProfils.length!==e.profils.length)}}function Q(i,r){if(1&i&&(t.DNE(0,X,3,0,"ng-container",23),t.DNE(1,K,11,3,"ng-container",23)),2&i){const e=t.XpG();t.Y8G("ngIf",e.data.fileInfo.fileRestrictions.accesCollaborateurs),t.R7$(1),t.Y8G("ngIf",!e.data.fileInfo.fileRestrictions.accesCollaborateurs)}}function J(i,r){1&i&&(t.nrm(0,"i",39),t.EFF(1,"Utilisateurs autoris\xe9s"))}function Z(i,r){1&i&&(t.qex(0),t.j41(1,"strong",24),t.EFF(2," Le fichier accessible par tous les utilisateurs "),t.k0s(),t.bVm())}function q(i,r){}function tt(i,r){}const et=function(i){return{user:i,proprietaire:!1}};function it(i,r){if(1&i&&t.DNE(0,tt,0,0,"ng-template",31),2&i){const e=r.$implicit;t.XpG(3);const n=t.sdS(33);t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(4,d,t.eq3(2,et,e)))}}function nt(i,r){if(1&i){const e=t.RV6();t.j41(0,"tfoot")(1,"tr")(2,"td",26)(3,"span",40)(4,"select-collaborateur",41),t.bIt("collaborateurChange",function(o){t.eBV(e);const s=t.XpG(3);return t.Njj(s.newCollaborateur=o)})("collaborateurChange",function(){t.eBV(e);const o=t.XpG(3);return t.Njj(o.ajouterContact(o.newCollaborateur))}),t.k0s()()()()()}if(2&i){const e=t.XpG(3);t.R7$(4),t.Y8G("collaborateur",e.newCollaborateur)("disabledCollaborateurs",e.disabledCollaborateurs)}}function ot(i,r){1&i&&(t.qex(0),t.nrm(1,"i",38),t.EFF(2,"Ajouter "),t.bVm())}function rt(i,r){1&i&&(t.qex(0),t.EFF(1," Annuler "),t.bVm())}const at=function(i){return{user:i,proprietaire:!0}};function st(i,r){if(1&i){const e=t.RV6();t.qex(0),t.j41(1,"table",25)(2,"tbody"),t.DNE(3,q,0,0,"ng-template",31),t.DNE(4,
1it,1,6,null,28),t.k0s(),t.DNE(5,nt,5,2,"tfoot",23),t.k0s(),t.j41(6,"div",29)(7,"button",37),t.bIt("click",function(){t.eBV(e);const o=t.XpG(2);return t.Njj(o.isAjoutCollaborateurEnCours=!o.isAjoutCollaborateurEnCours)}),t.DNE(8,ot,3,0,"ng-container",23),t.DNE(9,rt,2,0,"ng-container",23),t.k0s()(),t.bVm()}if(2&i){const e=t.XpG(2),n=t.sdS(33);t.R7$(3),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(8,d,t.eq3(6,at,e.proprietaire))),t.R7$(1),t.Y8G("ngForOf",e.authorizedUsers),t.R7$(1),t.Y8G("ngIf",e.isAjoutCollaborateurEnCours),t.R7$(3),t.Y8G("ngIf",!e.isAjoutCollaborateurEnCours),t.R7$(1),t.Y8G("ngIf",e.isAjoutCollaborateurEnCours)}}function lt(i,r){if(1&i&&(t.DNE(0,Z,3,0,"ng-container",23),t.DNE(1,st,10,10,"ng-container",23)),2&i){const e=t.XpG();t.Y8G("ngIf",e.data.fileInfo.fileRestrictions.accesCollaborateurs),t.R7$(1),t.Y8G("ngIf",!e.data.fileInfo.fileRestrictions.accesCollaborateurs)}}function ct(i,r){1&i&&(t.j41(0,"button",46),t.nrm(1,"i",47),t.k0s())}function pt(i,r){if(1&i){const e=t.RV6();t.j41(0,"button",48),t.bIt("click",function(){t.eBV(e);const o=t.XpG().$implicit,s=t.XpG();return t.Njj(s.supprimerContact(o.user))}),t.nrm(1,"i",49),t.k0s()}}const ut=function(i){return{"background-image":i}};function ft(i,r){if(1&i&&(t.j41(0,"tr")(1,"td",26)(2,"span",32)(3,"span",42),t.nrm(4,"div",43),t.nI1(5,"contactDisplayName"),t.nI1(6,"imageUrl"),t.EFF(7),t.nI1(8,"contactDisplayName"),t.k0s(),t.j41(9,"span"),t.DNE(10,ct,2,0,"button",44),t.DNE(11,pt,2,0,"button",45),t.k0s()()()()),2&i){const e=r.$implicit;t.R7$(4),t.Y8G("matTooltip",t.bMT(5,5,e.user))("ngStyle",t.eq3(11,ut,t.bMT(6,7,e.user))),t.R7$(3),t.SpI(" ",t.bMT(8,9,e.user)," "),t.R7$(3),t.Y8G("ngIf",e.proprietaire),t.R7$(1),t.Y8G("ngIf",!e.proprietaire)}}function mt(i,r){if(1&i){const e=t.RV6();t.j41(0,"tr")(1,"td",26)(2,"span",32)(3,"span",50),t.EFF(4),t.nI1(5,"titlecase"),t.k0s(),t.j41(6,"span")(7,"button",48),t.bIt("click",function(){const s=t.eBV(e).$implicit,f=t.XpG();return t.Njj(f.supprimerProfil(s.profil))}),t.nrm(8,"i",49),t.k0s()()()()()}if(2&i){const e=r.$implicit;t.R7$(3),t.Y8G("matTooltip",e.profil.description),t.R7$(1),t.SpI(" ",t.bMT(5,2,e.profil.nom)," ")}}let _t=(()=>{class i{constructor(e,n,o,s,f,ht,bt){this.dialogRef=e,this.data=n,this.fileService=o,this.collaborateurService=s,this.fileRestrictionsService=f,this.jarvysService=ht,this.profilsService=bt,this.authorizedUsers=[],this.disabledCollaborateurs=[],this.isAjoutCollaborateurEnCours=!1,this.profils=[],this.authorizedProfils=[],this.isAjoutProfilEnCours=!1,this.onError=p=>this.jarvysService.erreur(p),this.onComplete=()=>this.jarvysService.hideLoading(),this.previewUrl=o.getFileUrl(n.fileInfo,!0,!0),n.fileInfo.fileRestrictions?.createur&&this.collaborateurService.getById(n.fileInfo.fileRestrictions.createur.id).subscribe(p=>{this.proprietaire=p,this.authorizedUsers=n.fileInfo.fileRestrictions.authorizedUsers.map(Ct=>Ct.contact),this.setDisabledCollaborateurs()}),this.authorizedProfils=n.fileInfo.fileRestrictions?.authorizedProfils?.map(p=>p.profil)??[],this.profilsService.retrieveAllProfils().subscribe(p=>this.profils=p,this.onError)}ngOnInit(){}updateFileRestrictions(){this.jarvysService.showLoading(),this.fileRestrictionsService.update(this.data.fileInfo.fileRestrictions).subscribe(e=>this.jarvysService.message("Restrictions d'acc\xe8s mises \xe0 jour."),this.onError,this.onComplete)}ajouterContact(e){e&&(this.jarvysService.showLoading(),this.fileRestrictionsService.addContact(this.data.fileInfo.fileRestrictions,e).subscribe(n=>{this.authorizedUsers.push(e),this.jarvysService.message("Utilisateur ajout\xe9."),this.isAjoutCollaborateurEnCours=!1,this.newCollaborateur=null,this.setDisabledCollaborateurs()},this.onError,this.onComplete))}supprimerContact(e){this.jarvysService.showLoading(),this.fileRestrictionsService.deleteContact(this.data.fileInfo.fileRestrictions,e).subscribe(n=>{this.authorizedUsers=this.authorizedUsers.filter(o=>o.id!==e.id),this.jarvysService.message("Utilisateur supprim\xe9."),this.setDisabledCollaborateurs()},this.onError,this.onComplete)}ajouterProfil(e){this.jarvysService.showLoading(),this.fileRestrictionsService.addProfil(this.data.fileInfo.fileRestrictions,e).subscribe(n=>{this.authorizedProfils=[...this.authorizedProfils,e],this.jarvysService.message("Profil ajout\xe9."),this.isAjoutProfilEnCours=!1,this.newProfil=null},this.onError,this.onComplete)}supprimerProfil(e){this.jarvysService.showLoading(),this.fileRestrictionsService.deleteProfil(this.data.fileInfo.fileRestrictions,e).subscribe(n=>{this.authorizedProfils=this.authorizedProfils.filter(o=>o.id!==e.id),this.jarvysService.message("Profil supprim\xe9.")},this.onError,this.onComplete)}compareProfils(e,n){return e&&n?e.id===n.id:e===n}setDisabledCollaborateurs(){this.disabledCollaborateurs=[...this.authorizedUsers,this.proprietaire]}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(l.RN),t.rXU(l.xh,8),t.rXU(g.E2),t.rXU(R._),t.rXU(x),t.rXU(h.L),t.rXU(F.h))}}
1static{this.\u0275cmp=t.VBU({type:i,selectors:[["file-restrictions-dialog"]],decls:36,vars:12,consts:[["mat-dialog-title","",1,"nivano-dialog-header"],["aria-label","Fermer",1,"nivano-dialog-close",3,"mat-dialog-close"],["width","16","height","16","viewBox","0 0 16 16","fill","none","aria-hidden","true"],["d","M3 3l10 10M13 3L3 13","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"],["ignoreParams",""],["matTabLabel",""],[1,"py-3"],[1,"nv-mat-field","w-100","mb-2"],["matInput","","placeholder","Propri\xe9taire","disabled","",3,"value"],[1,"d-flex","flex-column","flex-xl-row"],[1,"nv-mat-field","flex-grow-1","me-xl-4","p-0","mb-2"],["matInput","","placeholder","Date de cr\xe9ation du fichier","disabled","",3,"value"],[1,"nv-mat-field","flex-grow-1","p-0","mb-2"],["matInput","","placeholder","Taille du fichier","disabled","",3,"value"],[1,"mb-3","mt-1"],[3,"ngModel","ngModelChange"],["matTabContent",""],[1,"nivano-dialog-footer"],[1,"nivano-btn","nivano-btn-ghost",3,"mat-dialog-close"],["authorizedUserTemplate",""],["authorizedProfilTemplate",""],[1,"fas","fa-circle-info","me-2"],[1,"fas","fa-shield","me-2"],[4,"ngIf"],[1,"my-4","d-flex","justify-content-center"],[1,"my-4","table","table-bordered"],[1,"p-1"],[1,"w-100","py-2","d-flex","align-items-center","justify-content-center"],[4,"ngFor","ngForOf"],[1,"w-100","d-flex","justify-content-center"],["mat-flat-button","",3,"click",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"w-100","d-flex","align-items-center","justify-content-between"],[1,"nv-mat-field","w-100"],["name","profils","placeholder","Profils",3,"ngModel","compareWith","ngModelChange"],[3,"value","disabled",4,"ngFor","ngForOf"],[3,"value","disabled"],["mat-flat-button","",3,"click"],[1,"fas","fa-plus","me-2"],[1,"fas","fa-users","me-2"],[1,"mx-4","d-flex","align-items-center","justify-content-between"],[1,"w-100",3,"collaborateur","disabledCollaborateurs","collaborateurChange"],[1,"d-flex","align-items-center"],[1,"contact-image-small","me-2",3,"matTooltip","ngStyle"],["mat-icon-button","","disabled","","matTooltip","Propri\xe9taire du fichier",4,"ngIf"],["mat-icon-button","",3,"click",4,"ngIf"],["mat-icon-button","","disabled","","matTooltip","Propri\xe9taire du fichier"],[1,"fa-solid","fa-user-tie"],["mat-icon-button","",3,"click"],[1,"fa-solid","fa-ban"],[1,"d-flex","align-items-center",3,"matTooltip"]],template:function(n,o){1&n&&(t.j41(0,"div",0)(1,"h2"),t.EFF(2),t.k0s(),t.j41(3,"button",1),t.qSk(),t.j41(4,"svg",2),t.nrm(5,"path",3),t.k0s()()(),t.joV(),t.j41(6,"mat-dialog-content")(7,"moorea-tab-group",4)(8,"mat-tab"),t.DNE(9,U,2,0,"ng-template",5),t.j41(10,"div",6)(11,"mat-form-field",7),t.nrm(12,"input",8),t.nI1(13,"contactDisplayName"),t.k0s(),t.j41(14,"div",9)(15,"mat-form-field",10),t.nrm(16,"input",11),t.nI1(17,"date"),t.k0s(),t.j41(18,"mat-form-field",12),t.nrm(19,"input",13),t.k0s()(),t.j41(20,"div",14)(21,"mat-slide-toggle",15),t.bIt("ngModelChange",function(f){return o.data.fileInfo.fileRestrictions.accesCollaborateurs=f})("ngModelChange",function(){return o.updateFileRestrictions()}),t.EFF(22," Fichier accessible par tous les collaborateurs "),t.k0s()()()(),t.j41(23,"mat-tab"),t.DNE(24,V,2,0,"ng-template",5),t.DNE(25,Q,2,2,"ng-template",16),t.k0s(),t.j41(26,"mat-tab"),t.DNE(27,J,2,0,"ng-template",5),t.DNE(28,lt,2,2,"ng-template",16),t.k0s()()(),t.j41(29,"mat-dialog-actions",17)(30,"button",18),t.EFF(31,"Fermer"),t.k0s()(),t.DNE(32,ft,12,13,"ng-template",null,19,t.C5r),t.DNE(34,mt,9,4,"ng-template",null,20,t.C5r)),2&n&&(t.R7$(2),t.JRh(o.data.fileInfo.fileName),t.R7$(1),t.Y8G("mat-dialog-close",!1),t.R7$(9),t.Y8G("value",t.bMT(13,7,o.proprietaire)),t.R7$(4),t.Y8G("value",t.i5U(17,9,o.data.fileInfo.fileCreated,"dd/MM/yyyy HH:mm:ss")),t.R7$(3),t.Y8G("value",o.data.fileInfo.formattedSize),t.R7$(2),t.Y8G("ngModel",o.data.fileInfo.fileRestrictions.accesCollaborateurs),t.R7$(9),t.Y8G("mat-dialog-close",!1))},dependencies:[c.Sq,c.bT,c.T3,c.B3,b.BC,b.vS,C.rb,C.df,D.Ky,T.aL,I.d1,l.kQ,l.KI,l.PQ,l.$t,m.tx,m.BI,m.Yi,m.E7,y.iV,G.PD,$.cu,_.$L,_.ES,_.mq,P.P2,N.L,S.r,c.PV,c.vh,A.e,Y.H,k.p]})}}return i})();function dt(i,r){if(1&i){const e=t.RV6();t.qex(0),t.j41(1,"upload",1),t.bIt("uploadStart",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.jarvysService.showLoading())})("uploadEnd",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.jarvysService.hideLoading())})("gestionCustom",function(o){t.eBV(e);const s=t.XpG();return t.Njj(s.gestionDroitsCustom(o))}),t.k0s(),t.bVm()}if(2&i){const e=t.XpG();t.R7$(1),t.Y8G("type",e._type)("identifier",e._identifier)("disabled",e.disabled)("externalAccesActive",e.partageActive)("hasAccesExterne",e.hasAccesExterne)("token",e.token)}}let gt=(()=>
1{class i{set type(e){this._type=e}set identifier(e){this._identifier=e}constructor(e,n){this.jarvysService=e,this.dialog=n,this.disabled=!1,this.partageActive=!1,this.hasAccesExterne=!0}ngOnInit(){this.disabled=this.disabled||""===this.disabled,this.partageActive=this.partageActive||""===this.partageActive,this.hasAccesExterne=this.hasAccesExterne||""===this.hasAccesExterne}gestionDroitsCustom(e){this.dialog.open(_t,{minWidth:"50vw",data:{fileInfo:e}})}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(h.L),t.rXU(l.ef))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["upload-wrapper"]],inputs:{type:"type",identifier:"identifier",disabled:"disabled",partageActive:"partageActive",hasAccesExterne:"hasAccesExterne",token:"token"},decls:1,vars:1,consts:[[4,"ngIf"],[1,"d-block","w-100",3,"type","identifier","disabled","externalAccesActive","hasAccesExterne","token","uploadStart","uploadEnd","gestionCustom"]],template:function(n,o){1&n&&t.DNE(0,dt,2,6,"ng-container",0),2&n&&t.Y8G("ngIf",0!==o._identifier)},dependencies:[c.bT,g.v6]})}}return i})()}}]);
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.