1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[38068],{34073:(D,m,e)=>{e.d(m,{K:()=>X});var c=e(10467),l=e(89417),u=e(6961),p=e(66770),f=e(61688),g=e(25615),h=e(84412),t=e(73664),s=e(2615),v=e(94474),C=e(19735),E=e(69415),M=e(80954),d=e(89902),x=e(15449),P=e(85340),b=e(89792),y=e(72200),T=e(68018);const O=["uploader"],A=(i,_,o)=>({required:i,placeholder:"global.common.name",inputType:"text",error:_,errorText:o}),B=(i,_,o)=>({required:i,placeholder:"global.common.description",error:_,errorText:o}),R=(i,_,o)=>({required:i,placeholder:"global.common.description",inputType:"text",error:_,errorText:o}),V=i=>[i,""];function I(i,_){if(1&i&&(t.j41(0,"div",3),t.nrm(1,"app-input",5),t.k0s()),2&i){const o=t.XpG(3);t.R7$(),t.Y8G("options",o.visibilityOptions)}}function L(i,_){1&i&&t.nrm(0,"app-clupik-state-bar",6),2&i&&t.Y8G("isCustom",!1)}function U(i,_){if(1&i){const o=t.RV6();t.j41(0,"app-list-item",14),t.bIt("listAction",function(){s.eBV(o);const a=t.XpG(5);return s.Njj(a.changeView("visibility"))}),t.k0s()}if(2&i){const o=t.XpG(5);t.Y8G("subtitle",o.getVisibility)("hasHover",o.globalVars.desktop)("iconLeft",o.visbilityIcon)}}function G(i,_){if(1&i&&t.nrm(0,"app-input",12),2&i){const o=t.XpG(5);t.Y8G("inputSize","default")("input",t.sMw(2,B,o.isrequired("description"),o.maxlengthDescriptionError.error,o.maxlengthDescriptionError.text))}}function j(i,_){if(1&i&&t.nrm(0,"app-input",13),2&i){const o=t.XpG(5);t.Y8G("inputSize","default")("input",t.sMw(2,R,o.isrequired("description"),o.maxlengthDescriptionError.error,o.maxlengthDescriptionError.text))}}function K(i,_){if(1&i&&(t.nVh(0,U,1,3,"app-list-item",9),t.j41(1,"app-form-row",10),t.nrm(2,"app-input",11),t.k0s(),t.j41(3,"app-form-row",10),t.nVh(4,G,1,6,"app-input",12)(5,j,1,6,"app-input",13),t.k0s()),2&i){const o=t.XpG(4);t.vxM(o.isFromProtector?0:-1),t.R7$(),t.Y8G("items",1)("destacado",!1),t.R7$(),t.Y8G("inputSize","default")("input",t.sMw(8,A,o.isrequired("name"),o.maxlengthError.error,o.maxlengthError.text)),t.R7$(),t.Y8G("items",1)("destacado",!1),t.R7$(),t.vxM(o.isFromProtector?4:5)}}function W(i,_){if(1&i){const o=t.RV6();t.j41(0,"app-empty-space",15),t.nI1(1,"translate"),t.bIt("buttonAction",function(){s.eBV(o);const a=t.XpG(4);return s.Njj(a.uploadFile())}),t.k0s()}2&i&&t.Y8G("size","sm")("textArray",t.eq3(7,V,t.bMT(1,5,"global.button.upload_file")+" *"))("noButton",!1)("buttonText","global.button.upload_file")("icon","fa-solid fa-cloud-arrow-up")}function F(i,_){if(1&i){const o=t.RV6();t.j41(0,"div",8)(1,"app-list-item",16)(2,"app-clupik-button",17),t.bIt("click",function(){s.eBV(o);const a=t.XpG(4);return s.Njj(a.uploadFile())}),t.k0s()()()}if(2&i){const o=t.XpG(4);t.R7$(),t.Y8G("mainTitle",o.currentFile)("hasBorder",!0)("hasHover",o.globalVars.desktop)("iconLeft","fa-regular fa-file-lines")("isCustom",!0),t.R7$(),t.Y8G("iconLeft",!0)("iconRight",!1)}}function k(i,_){if(1&i&&(t.j41(0,"div",4),t.nVh(1,L,1,1,"app-clupik-state-bar",6),t.nVh(2,K,6,12),t.nVh(3,W,2,9,"app-empty-space",7)(4,F,3,7,"div",8),t.k0s()),2&i){const o=t.XpG(3);t.R7$(),t.vxM(!o.hasFile&&o.submitted?1:-1),t.R7$(),t.vxM(o.onlyFile?-1:2),t.R7$(),t.vxM(o.hasFile?4:3)}}function w(i,_){if(1&i&&(t.j41(0,"form",2),t.nVh(1,I,2,1,"div",3),t.nVh(2,k,5,3,"div",4),t.k0s()),2&i){const o=t.XpG(),n=t.XpG();t.Y8G("formGroup",n.form),t.R7$(),t.vxM("visibility"===o?1:-1),t.R7$(),t.vxM("main"===o?2:-1)}}function S(i,_){if(1&i){const o=t.RV6();t.j41(0,"app-clupik-modal",1),t.bIt("mainAction",function(){const a=s.eBV(o),r=t.XpG();return s.Njj("visibility"===a?r.changeView("main"):r.save())})("secondaryAction",function(){s.eBV(o);const a=t.XpG();return s.Njj(a.cancel())}),t.nVh(1,w,3,3,"form",2),t.k0s()}if(2&i){const o=_,n=t.XpG();t.Y8G("modalTitle","visibility"===o?"global.common.visibility":"global.button.upload_document")("mainButtonValue","global.button.save")("mainButtonDisabled","visibility"!==o&&(n.saving||!n.hasFile))("hasSecondaryButton","visibility"===o)("secondaryButtonValue","global.common.cancel"),t.R7$(),t.vxM(n.form?1:-1)}}let X=(()=>{class i{globalVars;_modalService;_translationService;activeView$=new h.t("main");saving=!1;form=null;data;onlyFile=!1;file=null;hasImageChanged=!1;isEdit=!1;docUrl;docType;submitted=!1;maxLength={short:"",long:""};get isFromProtector(){return this.data?.isFromProtector||!1}get visbilityIcon(){return this.form.get("visibility").value?"fa-light fa-eye":"fa-light fa-eye-slash"}get getVisibility(){return this.form.get("visibility").value?"global.button.show":"global.common.hide"}visibilityOptions=[{id:!0,value:!0,name:"global.button.show",icon:"fa-light fa-eye",description:"",allowed:!0},{id:!1,value:!1,name:"global.common.hide",icon:"fa-light fa-eye-slash",description:"",allowed:!0}];fileInput;aceptedFiles=[".jpg",".png",".jpeg",".xls",".xlsx",".pdf",".csv",".doc",".docx"];get isButtonDisabled(){return!this.form.valid}get maxlengthError(){return this.form.get("name").touched&&this.form.get("name").hasError("required")?{error:!0,text:"global.validator.required"}:this.form.get("name").touched&&this.form.get("name").hasError("maxlength")?{error:!0,text:this.maxLength.short}:{error:!1,text:""}}
1get maxlengthDescriptionError(){return this.form.get("description").touched&&this.form.get("description").hasError("maxlength")?{error:!0,text:this.maxLength.long}:{error:!1,text:""}}constructor(o,n,a){this.globalVars=o,this._modalService=n,this._translationService=a,this.getTranslations()}getTranslations(){var o=this;return(0,c.A)(function*(){o.maxLength.short=yield o._translationService.getTranslation("global.validator.max_length",{length:200}),o.maxLength.long=yield o._translationService.getTranslation("global.validator.max_length",{length:500})})()}ngOnInit(){this.buildForm()}buildForm(){this.isEdit=null!==this.data?.document,this.form=new l.gE({id:new l.MJ(this.data?.document?.id),keep:new l.MJ(this.data?.document?.keep),name:new l.MJ(this.data?.document?.name||"",[l.k0.required,l.k0.maxLength(200)]),description:new l.MJ(this.data?.document?.description||"",[l.k0.maxLength(500)]),file:new l.MJ(this.data?.document?.file||null),url:new l.MJ(this.data?.document?.url||this.data?.document?.info?.url[0]||""),type:new l.MJ(this.data?.document?.type||""),visibility:new l.MJ(this.data?.document?.visibility||!1)}),this.docUrl=this.data?.document?.url||this.data?.document?.info?.url[0]||"",this.docType=this.data?.document?.type,this.isEdit||this.form.get("file").setValidators(l.k0.required),this.isFromProtector||this.form.get("visibility").disable()}isrequired(o){return f.T.isRequired(this.form,o)}imageFormats=["png","jpeg","jpg","pneg","gif","webp"];get isImage(){return this.imageFormats.includes(this.docType)}save(){this.saving=!0,this.submitted=!0;let o=this.form.value;if(o.id?delete o.file:(delete o.id,delete o.keep),this.form.valid)this.globalVars.closeModal(o);else{this.saving=!1;for(let n in this.form.controls)this.form.controls[n].markAsTouched()}}uploadFile(){var o=this;return(0,c.A)(function*(){let n=yield o._modalService.openModal({component:p.y,modalSize:"sm",data:{data:{fileTypes:["jpg","png","jpeg","xls","xlsx","pdf","csv","doc","docx"],maxSize:5242880,title:"module.shared.files_import.select_image_or_document"}},options:{}});if(n.data){o.isEdit&&(o.form.get("id").setValue(null),o.form.get("keep").setValue(!1));let a=n.data;o.docUrl=a.base64,o.docType=a.extension,o.file=a.base64.split(",")[1],o.form.get("file").setValue(o.file),o.form.get("url").setValue(o.docUrl),o.form.get("type").setValue(o.docType),!o.form.get("name").value&&o.form.get("name").setValue(a.name.split("."+a.extension)[0])}})()}get hasFile(){return this.form.get("id").value||this.form.get("file").value}get currentFile(){return this.form.get("name").value}cancel(){this.form.get("visibility").setValue(null===this.data?.document?.visibility||this.data?.document?.visibility),this.changeView("main")}changeView(o){this.activeView$.next(o)}static \u0275fac=function(n){return new(n||i)(t.rXU(g.Y),t.rXU(v.M),t.rXU(u.T))};static \u0275cmp=t.VBU({type:i,selectors:[["app-protocol-add-document"]],viewQuery:function(n,a){if(1&n&&t.GBs(O,5),2&n){let r;t.mGM(r=t.lsd())&&(a.fileInput=r.first)}},inputs:{data:"data",onlyFile:"onlyFile"},standalone:!1,decls:2,vars:3,consts:[[3,"modalTitle","mainButtonValue","mainButtonDisabled","hasSecondaryButton","secondaryButtonValue"],[3,"mainAction","secondaryAction","modalTitle","mainButtonValue","mainButtonDisabled","hasSecondaryButton","secondaryButtonValue"],[3,"formGroup"],[1,"view_visibility"],[1,"view_main"],["type","radiobutton","formControlName","visibility",3,"options"],["state","danger","mainTitle","module.entity.docs_admin.no_file_in_document","subtitle","module.entity.docs_admin.no_file_in_document_desc",3,"isCustom"],["svgImage","upload","buttonType","button","buttonConfig","outlined",3,"size","textArray","noButton","buttonText","icon"],[1,"file"],["mainTitle","global.common.visibility","iconRight","fa-light fa-chevron-right",3,"subtitle","hasHover","iconLeft"],[3,"items","destacado"],["type","normal","formControlName","name",3,"inputSize","input"],["type","textarea","formControlName","description",3,"inputSize","input"],["type","normal","formControlName","description",3,"inputSize","input"],["mainTitle","global.common.visibility","iconRight","fa-light fa-chevron-right",3,"listAction","subtitle","hasHover","iconLeft"],["svgImage","upload","buttonType","button","buttonConfig","outlined",3,"buttonAction","size","textArray","noButton","buttonText","icon"],[3,"mainTitle","hasBorder","hasHover","iconLeft","isCustom"],["label","global.button.replace","type","button","config","outlined","size","sm","icon","fa-solid fa-arrow-up-from-line",3,"click","iconLeft","iconRight"]],template:function(n,a){if(1&n&&(t.nVh(0,S,2,6,"app-clupik-modal",0),t.nI1(1,"async")),2&n){let r;t.vxM((r=t.bMT(1,1,a.activeView$))?0:-1,r)}},dependencies:[l.qT,l.BC,l.cb,l.j4,l.JD,C.$,E.p,M.Y,d.S,x.P,P.U,b.a,y.Jj,T.D9],styles:["figure.selected-image[_ngcontent-%COMP%]{width:fit-content;margin-left:auto;margin-right:auto;position:relative;margin-top:12px;margin-bottom:var(--module)}figure.selected-image[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:100%;max-height:300px;object-fit:contain;object-position:center}figure.selected-image[_ngcontent-%COMP%] .corner-button[_ngcontent-%COMP%]{cursor:pointer;z-index:10;position:absolute;top:calc(var(--module) / 4);right:calc(var(--module) / 4)}
1.file[_ngcontent-%COMP%]{margin-top:12px}"]})}return i})()},45260:(D,m,e)=>{e.d(m,{Z:()=>M});var c=e(72200),l=e(49189),u=e(62470),p=e(7030),f=e(48749),g=e(19348),h=e(97184),t=e(66124),s=e(21867),v=e(35375),C=e(73664),E=e(2615);let M=(()=>{class d{static \u0275fac=function(b){return new(b||d)};static \u0275mod=C.$C({type:d});static \u0275inj=E.G2t({imports:[c.MD,l.G,u.k,p.g,f.P,g.x,h.l,t.M,s.v,v.J]})}return d})()}}]);
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.