@fluxhub/fluxhub-lib 9.0.13 → 9.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,5 +13,5 @@
13
13
  See the Apache Version 2.0 License for specific language governing permissions
14
14
  and limitations under the License.
15
15
  ***************************************************************************** */
16
- var gt=function(t,e){return(gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ft(t,e){function i(){this.constructor=t}gt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var vt=function(){return(vt=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function yt(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}function bt(t,e){return function(i,n){e(i,n,t)}}function St(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function wt(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)r.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return r}for(var It=function(){function t(){this.API_ENDPOINT="",this.API2_ENDPOINT="",this.TEST_ENDPOINT="",this.PORTAL_TITLE="FLUXHUB INTRANET PORTAL",this.COMPANY_KEY="PROLOGIKA_",this.COMPANY_SITE_ROOT="http://localhost:4200/",this.SQL_SERVER_LANG="uk",this.LOCAL_PATH="",this.LOGIN_EXT=0,this.LDAP_AUTH=0,this.CHANGE_PASSWORD=1,this.COLOR_SEARCH="#FFFFFF",this.LOGOUT_URL_EXT="",this.GRID_ENDPOINT="dogrid",this.UPLOAD_ENDPOINT="doupload",this.LOGIN_ENDPOINT="login",this.APPMAKER_ENDPOINT="do_app_maker",this.FILE_ENDPOINT="dofile",this.ODBC_ENDPOINT="doquery_odbc",this.QUERY_ENDPOINT="doquery",this.WKF_ENDPOINT="dowkf",this.PASSRECOVERY_ENDPOINT="passrecovery",this.user_name=null,this.user=null,this.user_surname=null,this.user_email=null,this.user_name_ori=null,this.user_ori=null,this.user_surname_ori=null,this.user_email_ori=null,this.user_roles=null,this.user_isadmin=null,this.user_idp=null,this.user_lang=null,this.token=null,this.dev_mode=null,this.ambiente_forzato="",this.state={appName:"FLUXHUB V2",darkMode:!1,defaultLang:"en",topnavTitle:"Fluxhub",sidenavOpen:!1,sidenavMode:"side",sidenavCollapse:!0,pageFullscreen:!1,pageFooter:!1,initial:!1,wkf_obj:null,wkf_doc_info:null,grid_obj:null,appo_dialog:null,m_notif:null,style_search_home:this.COLOR_SEARCH,mobile:!1,body_height:"0px",body_height1:"0px",body_height2:"0px",body_width:"0px",mobile_menu:!1,body_h:0}}return t.prototype.cloneState=function(){return JSON.parse(JSON.stringify(this.state))},t.prototype.reloadState=function(t){this.state=t},t.prototype.getState=function(t){var e=this.state;return e.hasOwnProperty(t)?e[t]:e},t.prototype.setState=function(t,e){return this.state[t]=e},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"})],t)}(),Et=function(){function t(){}return t=yt([e.Component({template:" "})],t)}(),Ot=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0),this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT;var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),Ct=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0),this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT;var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(o.map((function(t){var i,o=t;if(t?"KO"===o.result_msg&&(i=new Error(o.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),xt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")});var s=JSON.stringify(t);return this.http.post(this.url,s).pipe(o.map((function(t){var i,o=t;if(t?"KO"===o.result_msg&&(i=new Error(o.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return o||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),s.Observable.throw(e)},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),kt=function(){function t(){this.result_data=new Array}return t=yt([e.Component({template:" "})],t)}(),Dt=function(){function t(){this.values=new Array,this.types=new Array,this.names=new Array}return t=yt([e.Component({template:" "})],t)}(),At=function(){function t(){this.command="",this.p1="",this.p2=""}return t=yt([e.Component({template:" "})],t)}(),Tt=function(){function t(t){this.app_s=t,this.simpleCrypt=new r.SimpleCrypt}var i;return i=t,t.prototype.set_home_title=function(t){var e=this;setTimeout((function(){console.log("set_title->",t),e.app_s.getState().topnavTitle=t}),100)},t.prototype.check_value_combo=function(t,e){return null!=e&&"-1"!=e?e:null!=t?t:e},t.prototype.gridDateRenderer=function(t){if(null==t.value)return" ------ ";if("null"==t.value)return" ------ ";var e=i.prototype.string2date(t.value,2);return null==e?" ------ ":1970==e.getFullYear()?" ------ ":i.prototype.pad(e.getDate(),2)+"/"+i.prototype.pad(e.getMonth()+1,2)+"/"+e.getFullYear()},t.prototype.gridDateStyle=function(t){return{"text-align":"center"}},t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),(t||"").toString().indexOf(",")>0&&(t=(t||"").toString().split(".").join("").split(",").join(".")),""==t&&(t="0");var s=wt((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=e>0?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e){if(10!=t.length)return null;var i=t.split("-");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]))}if(2==e)return new Date(t);if(3==e&&t.length>=16){var n=(t=t.substring(0,16)).split(" "),o=(i=n[0].split("/"),n[1].split(":"));return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(o[0]),parseInt(o[1]),0)}if(4==e){if(!t)return null;var s=t.split("/").map((function(t){return parseInt(t)}));return new Date(s[2],s[1]-1,s[0])}return null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.sql_date_grid=function(t,e){if(void 0===e&&(e=""),null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var i=t.getMonth()+1,n=t.getDate();return"CONVERT(DATETIME,'"+[t.getFullYear(),"-",(i>9?"":"0")+i,"-",(n>9?"":"0")+n].join("")+e+"',127)"},t.prototype.DateAdd=function(t,e,i){var n,o=i.valueOf();switch(t){case"ms":n=new Date(o+1*e);break;case"s":n=new Date(o+1e3*e);break;case"mi":n=new Date(o+6e4*e);break;case"h":n=new Date(o+36e5*e);break;case"d":n=new Date(o+864e5*e);break;case"y":n=new Date(o+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()," ",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=wt((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i,"T",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes())+":"+this.format2cifre(t.getSeconds()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes())+":"+this.format2cifre(t.getSeconds()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,r,a,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",r=void 0===n?",":n,(t<0?"-":"")+((l=(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)>3?l%3:0)?a.substr(0,l)+r:"")+a.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+r)+(o?s+Math.abs(t-a).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v3=function(t){return a.AES.encrypt(t,"}?fhg7SP&^N4").toString()},t.prototype.decrypt_v3=function(t){return a.AES.decrypt(t,"}?fhg7SP&^N4").toString(a.enc.Utf8)},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v2=function(t){return this.simpleCrypt.encode("prologika_fluxhub_etjda",t)},t.prototype.decrypt_v2=function(t){return this.simpleCrypt.decode("prologika_fluxhub_etjda",t)},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==this.app_s.user_roles&&(!(!e||null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin)||this.app_s.user_roles.toUpperCase().indexOf(t.toLocaleUpperCase())>-1)},t.ctorParameters=function(){return[{type:It}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](It))},token:t,providedIn:"root"}),t=i=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[It])],t)}(),Rt=function(){function t(t){this.uti_s=t,this.cancelBeforeStart=!1}return t.prototype.agInit=function(t){var e=this;this.params=t,this.value=this.params.value,"1234567890,".indexOf(t.charPress)>=0?(this.value=t.charPress,setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,1,String(e.value).length)}),100)):setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,0,String(e.value).length)}),100),this.cancelBeforeStart=t.charPress&&"1234567890,".indexOf(t.charPress)<0},t.prototype.getValue=function(){return""==String(this.value)?0:(this.value,null!=this.value?parseFloat(this.value.split(".").join("").split(",").join(".")):0)},t.prototype.isCancelBeforeStart=function(){return this.cancelBeforeStart},t.prototype.isCancelAfterEnd=function(){return parseFloat(this.value.split(".").join("").split(",").join("."))>1e6},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.input.element.nativeElement.focus()}))},t.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.isKeyPressedNumeric=function(t){var e=this.getCharCodeFromEvent(t);if(8==e)return!0;if(188==e)return!0;if(e>=96&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t.ctorParameters=function(){return[{type:Tt}]},yt([e.ViewChild("input",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"input",void 0),t=yt([e.Component({selector:"numeric-cell",template:'<input #input (keydown)="onKeyDown($event)" [(ngModel)]="value" style="fontSize:40;height:30px;">'}),St("design:paramtypes",[Tt])],t)}(),Lt=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.uti_s=n,this.res="",this.h=0,this.m=0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.ok=function(){5==this.res.length?this.dialogRef.close(this.res):this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(null!=t.m_appService.getState().appo_dialog&&null!=t.m_appService.getState().appo_dialog.val){var e=t.m_appService.getState().appo_dialog.val.split(":");return t.h=parseInt(e[0]),t.m=parseInt(e[1]),void(t.res=t.m_appService.getState().appo_dialog.val)}}))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It},{type:Tt}]},t=yt([e.Component({selector:"fhtimeslider",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title style="min-width:300px">Seleziona Orario -> {{res}}</h2>\n\n <mat-dialog-content style="font-size: 12px;"><br><br>\n <table>\n <tr>\n <td>Ore:</td>\n <td>\n <mat-slider\n [max]="23" (change)="change()"\n [min]="0"\n [step]="1"\n thumbLabel\n [(ngModel)]="h">\n </mat-slider>\n </td>\n </tr>\n <tr>\n <td>Minuti:</td>\n <td>\n <mat-slider\n [max]="45"\n [min]="0" (change)="change()"\n [step]="15"\n thumbLabel\n [(ngModel)]="m">\n </mat-slider>\n </td>\n </tr>\n </table>\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n\n\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It,Tt])],t)}(),Nt=function(){function t(t){this.model=t}return t.prototype.onInputChange=function(t,e){for(var i,n=t.toString().split(","),o=0;o<n.length;++o)n[o]=n[o].replace(/\D/g,"");if(0===n.length)i="";else{if(null!==n[0].match(/[0-9]{3}/gim)&&n[0].length>3){var s=Array.from(Array.from(n[0]).reverse().join("").match(/[0-9]{3}/gim).join()).reverse().join(""),r=n[0].replace(s.replace(/\D/g,""),"");i=(r.length>0?r+".":"")+s}else i=n[0];n.length>1&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t.ctorParameters=function(){return[{type:p.NgControl}]},t=yt([e.Directive({selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}),St("design:paramtypes",[p.NgControl])],t)}(),Mt=function(){function t(t,e,i,n){this.http=t,this.toastr=e,this.app_s=i,this.uti_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT}return t.prototype.doQuery=function(t,e,n){var s=this;if(void 0===e&&(e=!0),void 0===n&&(n=null),null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")){if(this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==n?this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT:n,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var r=0;r<t.types.length;r++)null==t.values[r]?t.values[r]="dbnull":("boolean"==t.types[r]&&(t.values[r]?t.values[r]="1":t.values[r]="0"),"int"==t.types[r]&&(t.values[r]+""==""?t.values[r]="dbnull":isNaN(t.values[r])?t.values[r]="0":t.values[r]=""+t.values[r]),"string"==t.types[r]&&(t.values[r]=""+t.values[r]),"date"==t.types[r]&&(t.values[r]=this.uti_s.sql_date(t.values[r])),"datetime"==t.types[r]&&(t.values[r]=this.uti_s.sql_date_time(t.values[r])),"decimal"==t.types[r]&&(t.values[r]+""==""?t.values[r]="dbnull":isNaN(t.values[r])?t.values[r]="0":t.values[r]=""+t.values[r]),"string"==t.types[r]&&null==t.values[r]&&(t.values[r]="dbnull"));var a=JSON.stringify(t);return this.http.post(this.url,a,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&s.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))}console.log("token non online")},t.ctorParameters=function(){return[{type:i.HttpClient},{type:n.ToastrService},{type:It},{type:Tt}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](n.ToastrService),e["ɵɵinject"](It),e["ɵɵinject"](Tt))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,n.ToastrService,It,Tt])],t)}(),Ft=function(){function t(){this.changed=[],this.touched=[]}return t.prototype.emitChanged=function(){var t=this.getValue();this.changed.forEach((function(e){return e(t)}))},Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},set:function(t){this.getValue()!==t&&(this.setValue(t),this.changed.forEach((function(e){return e(t)})))},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.setValue(t)},t.prototype.touch=function(){this.touched.forEach((function(t){return t()}))},t.prototype.registerOnChange=function(t){this.changed.push(t)},t.prototype.registerOnTouched=function(t){this.touched.push(t)},t}(),Pt=function(t){function i(i,n,o,s,r){var a=t.call(this)||this;return a._dataService=i,a.dialog=n,a.m_appService=o,a.toastr=s,a.uti_s=r,a.maxore=23,a.label="",a.enabled=!0,a.show_picker=!1,a.selchange=new e.EventEmitter,a.ngChange=new e.EventEmitter,a.h=0,a.m=0,a.res="",a}var o;return ft(i,t),o=i,i.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},i.prototype.doh=function(){this.h>0&&this.h--,this.sc()},i.prototype.upm=function(){this.m<60&&this.m++,this.sc()},i.prototype.dom=function(){this.m>0&&this.m--,this.sc()},i.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},i.prototype.onMi=function(){this.m>59&&(this.m=59),this.sc()},i.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},i.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},i.prototype.resetValue=function(){this.h=0,this.m=0},i.prototype.annulla=function(){this.show_picker=!1},i.prototype.ok=function(){0!=this.h||0!=this.m?this.sc():this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},i.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.setByDescri=function(t){null==t&&(t="00:00"),""==t&&(t="00:00"),-1==t.indexOf(":")&&(t="00:00");var e=t.split(":");this.h=parseInt(e[0]),this.m=parseInt(e[1]),5!=t.length&&this.emitChanged()},i.prototype.isValidVal=function(){return!0},i.prototype.setByValue=function(t){this.setByDescri(t)},i.prototype.setValue=function(t){this.setByDescri(t)},i.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getHours=function(){return this.h},i.prototype.getMinutes=function(){return this.m},i.prototype.ngAfterViewInit=function(){},i.prototype.sc=function(){var t=this.getValue();this.selchange.emit(),this.ngChange.emit(t),this.emitChanged()},i.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},i.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},i.prototype.isKeyPressedNumeric=function(t){return-1!=="0123456789".indexOf(t.key)||"ArrowRight"==t.key||"ArrowLeft"==t.key||"ArrowDown"==t.key||"ArrowUp"==t.key||"Backspace"==t.key},i.ctorParameters=function(){return[{type:Mt},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Tt}]},yt([e.Input(),St("design:type",Number)],i.prototype,"maxore",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"enabled",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"selchange",void 0),yt([e.Output("change"),St("design:type",e.EventEmitter)],i.prototype,"ngChange",void 0),i=o=yt([e.Component({selector:"FHTimePicker",template:'\n <div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b>&nbsp;&nbsp;\n <div fxLayout="column" fxLayoutAlign="center center">\n <div *ngIf="enabled" class="yourClass">\n <mat-icon (click)="uph()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;" (keydown)="onKeyDown($event)" (focusout)="onFu()" [disabled]="!enabled"\n [(ngModel)]="h">\n <div class="yourClass" *ngIf="enabled">\n <mat-icon class="yourClass" (click)="doh()">keyboard_arrow_down</mat-icon>\n </div>\n </div>\n\n &nbsp;&nbsp;<b style="font-size:28px">:</b>&nbsp;&nbsp;\n\n <div fxLayout="column" fxLayoutAlign="center center">\n <div class="yourClass" *ngIf="enabled">\n <mat-icon class="yourClass" (click)="upm()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;" (keydown)="onKeyDown1($event)" (focusout)="onMi()" [disabled]="!enabled"\n [(ngModel)]="m">\n <div class="yourClass" *ngIf="enabled">\n <mat-icon class="yourClass" (click)="dom()">keyboard_arrow_down</mat-icon>\n </div>\n </div>\n </div>\n ',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:o,multi:!0}],styles:["\n .hhh {\n height: 63px;\n width: 100px;\n background-color: rgba(255, 0, 0, .1);\n }\n\n .yourClass {\n cursor: pointer;\n user-select: none;\n }\n "]}),St("design:paramtypes",[Mt,l.MatDialog,It,n.ToastrService,Tt])],i)}(Ft),jt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t=yt([e.Component({selector:"currency-cell",template:"{{params.value | currency:'EUR'}}"})],t)}(),zt=function(){function t(t,e){this.dialogRef=t,this.app_s=e,this.title="",this.msg="",this.confirm_mgs="CONFERMA",this.annulla_mgs="ANNULLA",this.title=localStorage.getItem(this.app_s.COMPANY_KEY+"title_dialog"),this.msg=localStorage.getItem(this.app_s.COMPANY_KEY+"msg_dialog")}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.setTitle=function(t){this.title=t},t.prototype.setMsg=function(t){this.msg=t},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It}]},t=yt([e.Component({template:'\n\n <h1 mat-dialog-title>{{title}}</h1>\n <div mat-dialog-content style="font-size:12px">{{msg}}</div>\n <div mat-dialog-actions>\n <button mat-button (click)="dialogRef.close(true)" color="primary">{{confirm_mgs}}</button>\n <button mat-button (click)="dialogRef.close(false)" color="warn">{{annulla_mgs}}</button>\n </div>\n ',styles:["\n "]}),St("design:paramtypes",[l.MatDialogRef,It])],t)}(),Ut=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.label="",this.enabled=!0,this.single_sel=!1,this.separator=",",this.fillend=new e.EventEmitter,this.selchange=new e.EventEmitter,this.initend=new e.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.change_v=function(t,e){t.checked=!t.checked,this.upd_f(t,e)},t.prototype.upd_f=function(t,e){this.single_sel&&(t.checked=!0);var i=new Object;i.u=t,i.b=e,this.selchange.emit(i)},t.prototype.resetValue=function(){for(var t=0;t<this.myData.length;t++)this.myData[t].checked=!1},t.prototype.reset=function(){this.myData=new Array,this.resetValue()},t.prototype.fillCombo=function(){var t=this;if(this.init_fill){var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values,this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.myData=e.result_data,t.resetValue(),t.setByValue(t.valDef),""==t.getValue()&&"-1"!=t.valDef&&t.setByDescri(t.valDef),t.fillend.emit())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}},t.prototype.setByDescri=function(t){if(this.valDef=t,null!=t&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(this.separator),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].descrizione_valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.setByValue=function(t){if(this.valDef=t,null!=t&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(this.separator),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.getDescri=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].descrizione_valore);return t},t.prototype.getObjects=function(){for(var t=new Array,e=0;e<this.myData.length;e++)this.myData[e].checked&&t.push(this.myData[e]);return t},t.prototype.getValue=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].valore);return t},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],n.checked=!1,this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit()},t.ctorParameters=function(){return[{type:Mt}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"separator",void 0),yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"initend",void 0),t=yt([e.Component({selector:"FHList",template:'\n\n\n <table class="fh_table" style="width:100%;">\n <thead>\n <tr>\n <th *ngIf="!single_sel"></th>\n <th>\n {{label}}\n\n </th>\n <th *ngIf="single_sel"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let u of myData;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }">\n <td style="width:20px;" valign="middle" *ngIf="!single_sel">\n <mat-slide-toggle (change)="upd_f(u,$event)" [disabled]="!enabled"\n [(ngModel)]="u.checked"></mat-slide-toggle>\n </td>\n <td (click)="change_v(u,$event)" valign="middle">{{u.descrizione_valore}}</td>\n <td valign="middle" style="width:20px;text-align: center" *ngIf="single_sel" >\n\n <button mat-flat-button color="primary" (click)="upd_f(u,$event)" [disabled]="!enabled" ><mat-icon>send</mat-icon></button>&nbsp;&nbsp;&nbsp;\n\n\n </td>\n </tr>\n </tbody>\n </table>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt])],t)}(),Vt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.progress_p=0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.update_progess=function(t){this.progress_p=t,100==t&&this.dialogRef.close()},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},yt([e.ViewChild("cmb_sel"),St("design:type",Ut)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"fhwinwait",template:'\n\n <h2 mat-dialog-title>\n {{label | uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <mat-progress-bar style="height:50px" color="accent" mode="determinate" value="{{progress_p}}"></mat-progress-bar>\n </mat-dialog-content>\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),qt=function(){function t(t,i){this._dataService=t,this._dataService_odbc=i,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.fillend=new e.EventEmitter,this.selchange=new e.EventEmitter,this.initend=new e.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.descri_val=""}return t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this.descri_val);null==this.valDef?this.dis_value="":this.dis_value=this.valDef.split("-1").join("")}catch(t){console.log("errore split -> this.valDef ",this.valDef)}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){console.log("reset"),this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}else this.set_options(this.sql)},t.prototype.add_option=function(t){this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval?"-1":""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.ctorParameters=function(){return[{type:Mt},{type:Ot}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sel_label",void 0),yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"initend",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valDef",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"db_type",void 0),t=yt([e.Component({selector:"FHComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (selectionChange)="sc()" [required]="required">\n <mat-option value="-1">{{sel_label}}</mat-option>\n <mat-option value="{{app.valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="dis_value">\n </mat-form-field>\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,Ot])],t)}(),Bt=function(){function t(t,i,n,o){var s=this;this._dataService=t,this.toastr=i,this.dialog=n,this.app_s=o,this.show_descri=!0,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 500MB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.lista_allegati=[],this.change=new e.EventEmitter,this.upload_ended=new e.EventEmitter,this.call_upload=new e.EventEmitter,this.multi_list=!1,this.allow_delete=!1,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:524288e3}),this.id=null,this.username=this.app_s.user,this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(s.descrizione="",s.toastr.info("INFO",s.allegato_inserito,{timeOut:1e3,progressBar:!0}),s.ref_allegato(),s.change.emit({item:t,response:e,status:i,header:n}))}}return t.prototype.call_up=function(){this.call_upload.emit({App:this.App,K:this.K,descrizione:this.descrizione,single:!1,username:this.app_s.user,tipo:this.tipo,local_path:this.app_s.LOCAL_PATH,p1:this.programma_da_eseguire})},t.prototype.del_doc=function(){var t=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(zt).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="DELETE_ALLEGATO",i.types=["int","string"],i.values=[t.id,t.app_s.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.ref_allegato(),t.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.load_types=function(){var t=this;null!=this.cmb_tipo&&""!=this.tipo?(console.log("this.cmb_tipo.sql ",this.cmb_tipo.sql),this.cmb_tipo.sql=this.tipo,this.cmb_tipo.fillCombo()):setTimeout((function(){t.load_types()}),200)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e={};e.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(t.app_s.COMPANY_KEY+"token")}],t.uploader.setOptions(e),t.uploader.onCompleteAll=function(){t.loading=!1,t.upload_ended.emit(),null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&(t.dialogRef.componentInstance.update_progess(100),t.dialogRef=null)},t.uploader.onErrorItem=function(e,i,n,o){t.toastr.error(i)},t.uploader.onAfterAddingFile=function(e){t.ch(e)},t.uploader.onProgressItem=function(e,i){t.loading=!0,null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&t.dialogRef.componentInstance.update_progess(i)},t.uploader.onWhenAddingFileFailed=function(e,i,n){switch(i.name){case"fileSize":var o=Math.round(e.size/1024/1024);t.toastr.error(t.limit_string.split("<size>").join(""+o));break;default:t.toastr.error("Errore: "+i.name)}}}))},t.prototype.download_all=function(){window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(t){var e=this;if(this.descri_obb&&""==this.descrizione)this.toastr.error(this.inserire_descrizione);else{for(var i=0;i<this.lista_allegati.length;i++)if(this.lista_allegati[i].Filename.toLowerCase()==t.file.name.toLowerCase())return void this.toastr.error("File già presente (cancellarlo per aggiornarlo)");this.uploader.onBuildItemForm=function(t,i){i.append("App",e.App),i.append("K",e.K),i.append("descrizione",e.descrizione),i.append("single",e.single),i.append("username",e.username),e.multi_list?i.append("tipo",e.cmb_tipo.getDescri().split("-1").join("")):i.append("tipo",e.tipo),i.append("local_path",e.app_s.LOCAL_PATH),""!=e.programma_da_eseguire&&i.append("p1",e.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(Vt,{disableClose:!0}),setTimeout((function(){e.dialogRef.componentInstance.label=e.label_attendere})),this.dialogRef.afterClosed().subscribe((function(t){}))),this.uploader.uploadAll()}},t.prototype.init=function(t,e,i,n,o,s){void 0===n&&(n=""),void 0===o&&(o=""),void 0===s&&(s=!1),this.App=t,this.K=e,this.label=i,this.tipo=n,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=o,this.allow_delete=s,this.ref_allegato(),this.tipo.indexOf("SELECT_")>-1&&(this.multi_list=!0,this.load_types())},t.prototype.ref_allegato=function(){var t=this;if(this.id=null,this.descrizione="",this.file_name="",this.label_b="",this.cmb_tipo.resetValue(),this.single&&null!=this.App&&""!=this.App){var e=new Dt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0&&(t.id=i[0].id,t.descrizione=i[0].descrizione,t.file_name=i[0].Filename,t.label_b=i[0].Filename+" - "+i[0].Filesize,t.b_edit_loaded=!0)}}))}},t.ctorParameters=function(){return[{type:Mt},{type:n.ToastrService},{type:l.MatDialog},{type:It}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_descri",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"descri_obb",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"programma_da_eseguire",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_attendere",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"fixed_label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"limit_string",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"allegato_inserito",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"inserire_descrizione",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"lista_allegati",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"upload_ended",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"call_upload",void 0),yt([e.ViewChild("cmb_tipo"),St("design:type",qt)],t.prototype,"cmb_tipo",void 0),t=yt([e.Component({selector:"FHUpload",template:'\n\n <div *ngIf="loading" fxLayout="row">\n WAIT\n </div>\n <div [hidden]="!(enabled && !loading)" fxLayout="row" fxLayoutAlign="start center">\n <div [hidden]="!multi_list" style="width:380px" fxLayoutAlign="start center">\n <FHComboBox [sql]="tipo" #cmb_tipo [init_fill]="false" label="Tipologia"></FHComboBox>&nbsp;&nbsp;\n </div>\n <mat-form-field [hidden]="!show_descri" style="width: 100%" appearance="outline" floatLabel="always"><mat-label>{{label}} {{fixed_label}}</mat-label>\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione"\n >\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div style="width:140px" fxLayout="row" fxLayoutAlign="start start" (click)="call_up()">\n <input type="file" multiple ng2FileSelect [uploader]="uploader" name="file-fh{{App}}" id="file-fh{{App}}" class="inputfile inputfile-fh" />\n <label for="file-fh{{App}}" style="width:210px"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg><span style="font-size: 12px">&nbsp;&nbsp;&nbsp;Upload</span></label>\n </div>\n <div fxLayout="row" fxLayoutAlign="start start">\n <button mat-flat-button *ngIf="b_edit_loaded" (click)="download_all()" style="font-size: 12px">{{label_b}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button *ngIf="id!=null && allow_delete" (click)="del_doc()" color="warn">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf="!enabled" fxLayout="row">\n <label>{{label}}:</label>{{descrizione}}\n <button mat-flat-button *ngIf="b_edit_loaded" (click)="download_all()" style="font-size: 12px;background-color: #F5F5F5">{{label_b}}</button>\n\n </div>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,n.ToastrService,l.MatDialog,It])],t)}(),Ht=function(){function t(t,e,n,o,s,r,a,l){this._dataService=t,this.toastr=e,this.http=n,this.router=o,this.route=s,this._fileService=r,this.app_s=a,this.uti_s=l,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new i.HttpHeaders({"Content-Type":"application/json"})}return t.prototype.logout=function(){this.app_s.user=null,this.app_s.user_name=null,this.app_s.user_surname=null,this.app_s.user_idp=null,this.app_s.user_email=null,this.app_s.user_roles=null,this.app_s.user_lang=null,this.app_s.user_isadmin=null,this.app_s.token=null,localStorage.removeItem(this.app_s.COMPANY_KEY+"token"),1!=this.app_s.LOGIN_EXT?this.router.navigate(["login"]):window.location.href=this.app_s.LOGOUT_URL_EXT},t.prototype.login=function(t,e,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var s=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(s=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,s,{headers:this.headers}).pipe(o.map((function(t){var e;if(t?"KO"===t.result_msg?e=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(n.app_s.COMPANY_KEY+"token",t.result_data[0].token):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.get_user_info=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var n=JSON.stringify({username_info:t});return this.http.post(this.url,n,{headers:this.headers}).pipe(o.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.passrecovery=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({email:t,websiteroot:this.app_s.COMPANY_SITE_ROOT,op:"send_email"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(o.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checktoken=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(o.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.change_password=function(t,e,i){var n=this;void 0===i&&(i=!0);var s=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,s,{headers:this.headers}).pipe(o.map((function(t){var e;if(t?"KO"===t.result_msg&&(e=new Error(t.msg)):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checkCredentials_toLogin=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")||(-1==this.router.url.indexOf("/rp/")&&this.router.navigate(["login"]),!1)},t.prototype.checkCredentials=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")},t.ctorParameters=function(){return[{type:Mt},{type:n.ToastrService},{type:i.HttpClient},{type:c.Router},{type:c.ActivatedRoute},{type:Ct},{type:It},{type:Tt}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](Mt),e["ɵɵinject"](n.ToastrService),e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](c.Router),e["ɵɵinject"](c.ActivatedRoute),e["ɵɵinject"](Ct),e["ɵɵinject"](It),e["ɵɵinject"](Tt))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[Mt,n.ToastrService,i.HttpClient,c.Router,c.ActivatedRoute,Ct,It,Tt])],t)}(),Kt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.readonly=!1,this.show_annulla=!0,this.show_ok=!0,this.min_chars=3}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars?this.toastr.error("Il valore deve contenere almeno "+this.min_chars+" caratteri"):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valore",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"readonly",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_annulla",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_ok",void 0),t=yt([e.Component({selector:"app-win_ask_text",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="width:630px;font-size: 12px;">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <textarea matInput [readonly]="readonly" [(ngModel)]="valore" style="min-width:600px" rows="15"\n required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button *ngIf="show_ok" mat-flat-button color="primary" (click)="do_check()">OK</button>&nbsp;&nbsp;&nbsp;\n <button *ngIf="show_annulla" mat-flat-button color="warn" (click)="chiudi()">ANNULLA</button>\n </div>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Gt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.label="",this.width="100%",this.nota=!1,this.nota_val=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.set_selection=function(t,e,i){void 0===i&&(i=!1),this.nota=i,this.label=t;for(var n=0;n<e.length;n++)this.cmb_sel.add_option(e[n])},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?(this.cmb_sel.getObj().nota=this.nota_val,this.dialogRef.close(this.cmb_sel.getObj())):this.toastr.error("Selezionare un valore")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.ViewChild("cmb_sel"),St("design:type",qt)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"fhwincomboselect",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div fxLayout="column">\n <mat-dialog-content style="font-size: 12px;" >\n\n <div fxLayout="column">\n <h3>\n {{label | uppercase}}\n </h3>\n <FHComboBox #cmb_sel [init_fill]="false"></FHComboBox>\n <mat-form-field *ngIf="nota" appearance="outline" floatLabel="always"><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]="nota_val" rows="12"></textarea>\n </mat-form-field>\n </div>\n </mat-dialog-content>\n\n\n <mat-dialog-actions fxFlex="100" fxLayout="row" fxLayoutAlign="center center">\n <button mat-flat-button color="primary" (click)="ok()">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </mat-dialog-actions>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Yt=function(){function t(t,i,n,o,s,r){this._appservice=t,this._dataService=i,this.toastr=n,this.dialog=o,this.auth_s=s,this.uti=r,this.enabled=!0,this.label="",this.sovrascrivi_path="",this.ruolo_supervisore="[ZZZ_DIS_CC]",this.access_control=!1,this.show_images=!0,this.b_initt=!1,this.change=new e.EventEmitter,this.call_upload=new e.EventEmitter,this.App="",this.K="",this.image_type=!1,this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1,this.m_p_tipo="",this.multi_list=!1,this.m_programma_da_eseguire=""}return t.prototype.call_up=function(t){this.call_upload.emit({App:this.App,K:this.K,descrizione:t.descrizione,single:!1,username:this._appservice.user,tipo:this.m_p_tipo,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire})},t.prototype.download_all=function(t){null!=t.APP&&(t.App=t.APP),""==this.sovrascrivi_path?window.open(this._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename):window.open(this.sovrascrivi_path+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename)},t.prototype.edit_tipo=function(t){var e=this,i=new Dt;i.sql=this.m_p_tipo,i.types=[],i.values=[],this._dataService.doQuery(i).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){var n=e.dialog.open(Gt);setTimeout((function(){n.componentInstance.set_selection("Tipologia Allegato",i.result_data)})),n.afterClosed().subscribe((function(i){if(null!=i){var n=new Dt;n.sql="UPDATE_ALLEGATI_TIPO",n.types=["int","string"],n.values=[t.id,i.descrizione_valore],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))}}))},t.prototype.edit_descri=function(t){var e=this,i=this.dialog.open(Kt);setTimeout((function(){i.componentInstance.label="Descrizione Allegato",i.componentInstance.valore=t.descrizione,i.componentInstance.min_chars=0})),i.afterClosed().subscribe((function(i){if(null!=i){var n=new Dt;n.sql="UPDATE_ALLEGATI_DESCRIZIONE",n.types=["int","string"],n.values=[t.id,i],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))},t.prototype.delete=function(t){var e=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(zt).afterClosed().subscribe((function(i){if(i){var n=new Dt;n.sql="DELETE_ALLEGATO",n.types=["int","string"],n.values=[t.id,e.auth_s.username];e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.ref_allegato(),e.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){setTimeout((function(){t.b_initt=!0}),700),t.upc.single=!1,t.b_mobile=t._appservice.getState().pageFullscreen,console.log("this.m_p_tipo ",t.m_p_tipo),t.upc.init(t.App,t.K,"Descrizione Allegato",t.m_p_tipo,t.m_programma_da_eseguire),t.m_p_tipo.indexOf("SELECT_")>-1&&(t.multi_list=!0),t.ref_allegato()}))},t.prototype.init=function(t,e,i,n){void 0===i&&(i=""),void 0===n&&(n=""),this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.m_p_tipo=i,this.m_programma_da_eseguire=n,this.ngAfterViewInit()},t.prototype.ref_allegato=function(){var t=this;if(null!=this.App&&""!=this.App){var e=new Dt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.arr_g=e.result_data;for(var i="webinfo",n=0;n<t.arr_g.length;n++){null!=t.arr_g[n].APP&&(t.arr_g[n].App=t.arr_g[n].APP),null!=t.arr_g[n].descrizione?t.arr_g[n].descrizione_vis=t.arr_g[n].descrizione.split("\n").join("<br>"):t.arr_g[n].descrizione_vis="";var o=t.arr_g[n].Filename.split(".");if(""==t.sovrascrivi_path?(t.arr_g[n].url=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename):(t.arr_g[n].url=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename),-1!="3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(o[o.length-1].toLocaleUpperCase())&&(i=o[o.length-1].toLocaleLowerCase()),t.arr_g[n].icon=i+".svg",t.arr_g[n].can_delete=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),-1==t.arr_g[n].Filename.indexOf(".jpg")&&-1==t.arr_g[n].Filename.indexOf(".gif")&&-1==t.arr_g[n].Filename.indexOf(".png")||!t.show_images)t.arr_g[n].type="O";else{if(t.arr_g[n].type="IMG",t.arr_g[n].image_original=[t.arr_g[n].url],null!=t.arr_g[n].preview&&1==t.arr_g[n].preview){var s=t.arr_g[n].url.split("."),r=s.pop();t.arr_g[n].url=s.join(".")+"_preview."+r}t.image_type=!0,t.arr_g[n].image_thumbnail=[t.arr_g[n].url]}}}}))}},t.ctorParameters=function(){return[{type:It},{type:Mt},{type:n.ToastrService},{type:l.MatDialog},{type:Ht},{type:Tt}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sovrascrivi_path",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"ruolo_supervisore",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"access_control",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_images",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"call_upload",void 0),yt([e.ViewChild("upc"),St("design:type",Bt)],t.prototype,"upc",void 0),t=yt([e.Component({selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n <h3 *ngIf="label!=\'\'">{{label}}</h3>\n <div fxLayout="column">\n <div [hidden]="!enabled">\n <FHUpload [single]="b_False" [lista_allegati]="arr_g" (change)="ref_allegato()" (call_upload)="call_up($event)" #upc></FHUpload>\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">Nome</th>\n <th style="width:60px;text-align:center">Dim.</th>\n <th style="width:40%">Descrizione</th>\n <th *ngIf="multi_list" style="width:20%">Tipo</th>\n\n <th style="width:40px" class="actions"></th>\n <th style="width:30%" >Utente</th>\n <th style="width:240px;text-align:center">Data</th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let app of arr_g;let odd=odd; let even=even;" style="font-size: 12px;" [ngClass]="{ odd: odd, even: even }">\n <td style="text-align:center;vertical-align: middle;width:36px;height:36px;">\n <div style="text-align:center;vertical-align: middle;width:28px;height:28px;">\n <img src="assets/icons/square-o/{{app.icon}}" style="width:28px;height:28px;"></div> </td>\n <td>{{app.Filename}}</td>\n <td style="text-align:center">{{app.Filesize}}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a mat-icon-button matTooltip="Modifica Descrizione" *ngIf="app.can_delete" (click)="edit_descri(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Descrizione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div [innerHTML]="app.descrizione_vis" style="width:100%">\n </div>\n </div></td>\n\n\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a mat-icon-button matTooltip="Modifica Tipo" *ngIf="app.can_delete" (click)="edit_tipo(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Tipologia consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%">\n </div>\n </div></td>\n\n <td style="min-width:400px;min-height: 400px" *ngIf="app.type==\'IMG\'">\n <fh-image-viewer [u]="app"></fh-image-viewer>\n\n </td>\n <td *ngIf="app.type!=\'IMG\'">\n\n </td>\n <td>{{app.nc}}</td>\n <td style="text-align:center">{{app.dt_ins | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td style="text-align:center">\n <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a mat-icon-button matTooltip="Elimina File" *ngIf="app.can_delete" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Cancellazione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">Nome</th>\n <th style="width:60px;text-align:center">Dim.</th>\n\n <th style="width:20%">Descrizione</th>\n <th *ngIf="multi_list" style="width:10%">Tipo</th>\n <th style="width:40%" ></th>\n\n\n <th style="width:10%" >Utente</th>\n <th style="width:240px;text-align:center">Data</th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of arr_g;let odd=odd; let even=even;" style="font-size: 12px;" [ngClass]="{ odd: odd, even: even }">\n <td style="text-align:center;vertical-align: middle;width:36px;height:36px;">\n <div style="text-align:center;vertical-align: middle;width:28px;height:28px;">\n <img src="assets/icons/square-o/{{app.icon}}" style="width:28px;height:28px;"></div> </td>\n\n <td>{{app.Filename}}</td>\n <td style="text-align:center">{{app.Filesize}}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a mat-icon-button matTooltip="Modifica Descrizione" *ngIf="app.can_delete" (click)="edit_descri(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Descrizione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div [innerHTML]="app.descrizione_vis" style="width:100%">\n </div>\n </div></td>\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a mat-icon-button matTooltip="Modifica Tipo" *ngIf="app.can_delete" (click)="edit_tipo(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Tipologia consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%">\n </div>\n </div></td>\n\n <td style="min-width:400px;min-height: 400px" *ngIf="app.type==\'IMG\'">\n <fh-image-viewer [u]="app"></fh-image-viewer>\n\n </td>\n <td *ngIf="app.type!=\'IMG\'">\n\n </td>\n <td>{{app.nc}}</td>\n <td style="text-align:center">{{app.dt_ins | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td style="text-align:center">\n <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a mat-icon-button matTooltip="Elimina File" *ngIf="app.can_delete" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Cancellazione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="b_mobile">\n <tbody>\n\n <tr *ngFor="let app of arr_g;let odd=odd; let even=even;" style="font-size: 12px;" [ngClass]="{ odd: odd, even: even }">\n <td style="text-align:center;vertical-align: middle;width:36px;height:36px;">\n <div style="text-align:center;vertical-align: middle;width:28px;height:28px;">\n <img src="assets/icons/square-o/{{app.icon}}" style="width:28px;height:28px;"></div> </td>\n <td *ngIf="b_mobile" style="text-align:center">{{app.Filename}}<br><br>\n <button style="background-color: #F5F5F5" (click)="download_all(app)" mat-flat-button>DOWNLOAD</button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf="!b_ini && b_initt" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n\n\n "]}),St("design:paramtypes",[It,Mt,n.ToastrService,l.MatDialog,Ht,Tt])],t)}(),Qt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT}return t.prototype.doQuery=function(t,e,n){var s=this;void 0===e&&(e=!0),void 0===n&&(n=null),this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==n?this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT:n;var r=JSON.stringify(t);return this.http.post(this.url,r,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&s.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),Wt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n <mat-tab-group>\n <mat-tab label="FILTRI">\n\n\n <img src="assets/helps/fhgrid/filtri.png"/>\n </mat-tab>\n <mat-tab label="ORDINAMENTI">\n <img src="assets/helps/fhgrid/ordinamenti.png"/>\n </mat-tab>\n <mat-tab label="LAYOUT COLONNE">\n <img src="assets/helps/fhgrid/layout_colonne.png"/>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),Xt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars||this.valore.length>this.max_chars?this.toastr.error("Il valore deve avere un numero di caratteri compreso tra "+this.min_chars+" - "+this.max_chars):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valore",void 0),t=yt([e.Component({selector:"app-win_ask_text",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="font-size: 12px;">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}} (min {{min_chars}} - max {{max_chars}} caratteri)</mat-label>\n <input matInput type="text"\n [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button>&nbsp;&nbsp;&nbsp;<button\n mat-flat-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),$t=function(){function t(){this.filter="",this.system_dest=1}return t=yt([e.Component({template:" "})],t)}(),Jt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.edit=function(t){var e=this,i=new Dt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info("Documento "+e.datagrid.sRow.codice+" Recuperato"),e.dialogRef.close("ok"))}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:"Codice",field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Oggetto",field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Stato",field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Richiedente",field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("dtm"),St("design:type",le)],t.prototype,"datagrid",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n <div style="width:100%;height:400px">\n <div style="width:100%;height:100%">\n <FHGrid [filters]="flt_grid" init_fill="false" show_buttons="false" vis #dtm (dclicked)="edit($event)"\n g_width="100%" g_height="100%" tbl_name="wkf_documents" grid_key="r_wkf_documents"\n sort_field="codice desc" off_set="50" fields="*"></FHGrid>\n\n </div>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),Zt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].livello+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})}else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},yt([e.ViewChild("cmb"),St("design:type",_.MatSelect)],t.prototype,"smtr",void 0),t=yt([e.Component({template:'\n\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar>{{title}}\n\n </mat-toolbar>\n <mat-dialog-content><br><br>\n <mat-form-field style="width:100%" appearance="outline" floatLabel="always"><mat-label>Seleziona Step:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">{{OK_BUTTON}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button>\n </div>\n <br><br>\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),te=function(){function t(t,e,i){this._dataService=t,this.dialogRef=e,this.toastr=i,this.width="100%",this.label="Ricerca...",this.selectedAdd=null,this.selectedRemove=null,this.errorMsg="",this.fltr_user="",this.single_sel=!1,this.vis_buttons=!0,this.all_users=!1,this.user_sel=new Array}return t.prototype.filtra=function(){this.users_list_sel=new Array;for(var t=0;t<this.users_list.length;t++)if(null!=this.users_list[t].nc){for(var e=!1,i=0;i<this.users_list_sel.length;i++)if(this.users_list_sel[i].username==this.users_list[t].username&&this.users_list_sel[i].canale==this.users_list[t].canale){e=!0;break}if(!e&&(-1!=this.users_list[t].nc.toUpperCase().indexOf(this.fltr_user.toUpperCase())||""==this.fltr_user))if(null==this.user_sel)this.users_list_sel.push(this.users_list[t]);else{for(var n=!1,o=0;o<this.user_sel.length;o++)if(this.user_sel[o].username==this.users_list[t].username&&this.user_sel[o].canale==this.users_list[t].canale){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.all_users){var e=new Dt;e.sql="SELECT_ALL_USERS",e.types=[],e.values=[],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users_list=e.result_data,t.filtra())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}else{if(null!=t.user_sel&&t.user_sel.length>0)return;if(t.users_list_sel=new Array,null!=t.users_list)for(var i=0;i<t.users_list.length;i++)t.users_list_sel.push(t.users_list[i])}}))},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.users_list.splice(t,1),this.single_sel&&(this.user_sel=new Array),null==this.user_sel&&(this.user_sel=[]),this.user_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.user_sel.indexOf(this.selectedRemove,0);t>-1&&this.user_sel.splice(t,1),this.users_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelArr=function(){return this.user_sel},t.ctorParameters=function(){return[{type:Mt},{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",Array)],t.prototype,"users_list",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"users_list_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"vis_buttons",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"all_users",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"user_sel",void 0),t=yt([e.Component({selector:"FHPickUsers",template:'\n\n <mat-dialog-content style="font-size:12px">\n <br><br>\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;height:420px;overflow-y:scroll;">\n\n <table style="width: 100%" class="fh_table" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">UTENTI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr><td colspan="2">\n\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()"\n matInput >\n </mat-form-field>\n </td></tr>\n <tr *ngFor="let u of users_list_sel;let odd=odd; let even=even;" (mouseover)="selectedAdd=u"\n [ngClass]="{ odd: odd, even: even }" (click)="addTo(u)" (dblclick)="do_add()" class="selector"\n [ngClass]="{ \'active\': selectedAdd == u }">\n <td style="width: 80%">{{u.nc}}</td>\n <td style="width: 20%">{{u.canale}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n </div>\n <div fxLayout="column" fxFlex="20"\n style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-flat-button color="primary" (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-flat-button color="primary" (click)="do_rem()" [disabled]="option">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;height:420px;overflow-y:scroll;">\n <table style="width: 100%" class="fh_table" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">UTENTI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of user_sel;let odd=odd; let even=even;" (mouseover)="selectedRemove=u" [ngClass]="{ odd: odd, even: even }" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector"\n [ngClass]="{ \'active\': selectedRemove == u }">\n <td style="width: 80%">{{u.nc}}</td>\n <td style="width: 20%">{{u.canale}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n\n <div style="width:100%" *ngIf="vis_buttons" fxLayout="row" fxLayoutAlign="center center">\n <button mat-flat-button color="primary" (click)="dialogRef.close(this.user_sel)">Ok</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close()">Annulla</button>\n </div>\n </mat-dialog-actions>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,l.MatDialogRef,n.ToastrService])],t)}(),ee=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",te)],t.prototype,"up",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h4 mat-dialog-title>{{title}}\n </h4>\n <div mat-dialog-content fxLayout="column" style="font-size:12px">\n <div style="width:100%;height:420px">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n\n </div>\n\n <mat-form-field [hidden]="commento_hidden" appearance="outline" floatLabel="always"><mat-label>Commento {{nota_commento}}</mat-label>\n <textarea matInput [(ngModel)]="nota"\n rows="2"></textarea>\n </mat-form-field>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div><button mat-flat-button color="primary" (click)="ok()"> OK</button></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div> <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button></div>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),ie={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return ne})),multi:!0},ne=function(){function t(t,i){this.dataservice=t,this.dialog=i,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.multi=!1,this.change=new e.EventEmitter,this.select=new e.EventEmitter,this.userName="",this.selectedUser=[],this.all_user=null,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.label=t.label+" *")}))},t.prototype.getUsersNc=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+(this.selectedUser[e].cognome+" ")+this.selectedUser[e].nome;return t},t.prototype.getUsersEmail=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].email;return t},t.prototype.getUsersUsername=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].username;return t},t.prototype.writeValue=function(t){if(null!=t){if(""!=t)return"noop"==t?(this.userName=this.getUsersNc(),void this.onChange(this.getUsersUsername())):null==this.selectedUser?(this.setByUsername(t),void(this.userName=this.getUsersNc())):void(this.getUsersUsername()!=t&&(this.setByUsername(t),this.userName=this.getUsersNc()));this.clear()}else this.clear()},t.prototype.setByEmail=function(t){var e=this;if(console.log("emails ",t),null!=t&&""!=t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";if(console.log("s_nc ",n),""!=n){var s={sql:"SELECT_USERS_INFOS_BY_EMAIL_NOREP",types:["string"],values:[n],names:[]};console.log(s),this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):e.clear()}))}}},t.prototype.setByUsername=function(t){var e=this;if(t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";var s={sql:"SELECT_USERS_INFOS_BY_USERNAME_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):e.clear()}))}},t.prototype.load_all_users=function(){var t=this;this.dataservice.doQuery({sql:"SELECT_ALL_USERS",types:[],values:[],names:[]}).subscribe((function(e){t.all_user=e.result_data,null==t.all_user&&(t.all_user=[]),t.open_pick()}))},t.prototype.open_pick=function(){var t=this;if(null!=this.all_user){if(this.enabled){var e=this.dialog.open(te,{disableClose:!0,width:"700px",height:"550px"});setTimeout((function(){e.componentInstance.user_sel=t.selectedUser,e.componentInstance.users_list=Object.assign([],t.all_user),e.componentInstance.single_sel=!t.multi,e.componentInstance.filtra()})),e.afterClosed().subscribe((function(e){null!=e&&(null!=e&&(t.selectedUser=e,t.writeValue("noop"),t.select.emit(t.selectedUser),t.userName=t.getUsersNc()),t.change.emit(t.selectedUser),t.select.emit(t.selectedUser))}))}}else this.load_all_users()},t.prototype.clear=function(){this.selectedUser=[],this.onChange([]),this.userName=""},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.ctorParameters=function(){return[{type:Mt},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"multi",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"select",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"userName",void 0),t=yt([e.Component({selector:"FHUserField",providers:[ie],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field style="clickable-field" (click)="open_pick()" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n\n <input matInput\n [hidden]="hidden"\n\n type="text"\n [ngModel]="userName"\n [disabled]="false" readonly>\n\n </mat-form-field>\n <button mat-icon-button matSuffix\n [hidden]="selectedUser.length==0"\n (click)="clear()">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="userName"\n >\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}),St("design:paramtypes",[Mt,l.MatDialog])],t)}(),oe=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.nota="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(console.log(this.up.getUsersUsername(),this.up1.getUsersUsername()),null!=this.up.getUsersUsername())if("-1"!=this.up.getUsersUsername())if(""!=this.up.getUsersUsername())if(null!=this.up1.getUsersUsername())if("-1"!=this.up1.getUsersUsername())if(""!=this.up1.getUsersUsername()){var t=new Object;t.u1=this.up.getUsersUsername(),t.u2=this.up1.getUsersUsername(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",ne)],t.prototype,"up",void 0),yt([e.ViewChild("up1"),St("design:type",ne)],t.prototype,"up1",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h4 mat-dialog-title>{{title}}\n </h4>\n <div mat-dialog-content fxLayoutGap="5px" fxLayout="column" style="font-size:12px">\n <div style="width:100%">\n <FHUserField label="Utente da sostituire" #up ></FHUserField>\n </div>\n <div style="width:100%">\n <FHUserField label="Utente sostituto" #up1 ></FHUserField>\n </div>\n\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div><button mat-flat-button color="primary" (click)="ok()"> OK</button></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div> <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button></div>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),se=function(){function t(t,e,i,n,o,s,r,a,l){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_fservice=n,this.m_router=o,this._toastr=s,this.dialog=r,this.m_wkf=a,this.m_uti=l,this.b_editing=!1,this.is_Supervisor=!1,this.is_Visor=!1,this.is_Admin=!1,this.is_PowerUser=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.is_init=!1,this.imp="",this.m_cod_documento="",this.sort_field="",e.checkCredentials()&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc")}return t.prototype.goto_edit_doc=function(t,e){this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.cmd_wkf=function(t){"annulla_richiesta"==t.cmd&&this.annulla_richiesta(),"recupera_richiesta"==t.cmd&&this.recupera_richiesta(),"riassegna_richiesta"==t.cmd&&this.riassegna_richiesta(),"sostituisci_utente"==t.cmd&&this.sostituisci_utente(),"annulla_imp"==t.cmd&&this.annulla_imp(),"test_utente"==t.cmd&&this.test_utente(),"insert_doc"==t.cmd&&this.insert_doc()},t.prototype.annulla_richiesta=function(){var t=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi di voler annullare il documento numero: "+this.get_grid().sRow.codice+"?"),this.dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,-1],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}))}}))):this._toastr.error("Selezionare il documento da annullare")},t.prototype.recupera_richiesta=function(){var t=this,e=this.dialog.open(Jt,{disableClose:!0});setTimeout((function(){e.componentInstance.init_w(t.id_applicativo)})),e.afterClosed().subscribe((function(e){"ok"==e&&t.get_grid().doFill("")}))},t.prototype.sostituisci_utente=function(){var t=this;if(null!=this.get_grid().sRow){var e=new Dt;e.sql="SELECT_USERS_BY_WKF_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(oe,{disableClose:!0,width:"450px"});setTimeout((function(){i.componentInstance.up.all_user=e.result_data,i.componentInstance.title="Sostituzione utente: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new Dt;i.sql="UPDATE_USER_WORKFLOW",i.types=["string","string","string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,e.u1,e.u2],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t._toastr.info("Workflow Aggiornato")}))}}))}}))}else this._toastr.error("Selezionare il documento")},t.prototype.riassegna_richiesta=function(){var t=this;if(null!=this.get_grid().sRow){var e=new Dt;e.sql="SELECT_WLIVELLIV2ADM",e.types=["string","string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.livs_adm=e.result_data;for(var i=new Array,n="",o=0;o<t.livs_adm.length;o++)-1==n.indexOf(String(t.livs_adm[o].livello))&&(n=n+String(t.livs_adm[o].livello)+"|",i.push(t.livs_adm[o]));var s=t.dialog.open(Zt,{disableClose:!0});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title="Riassegnazione documento: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),s.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.os_r=e.lvl_sel,t.riassegna_richiesta_step1())}))}}))}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var t=this,e=new Array,i=0;i<this.livs_adm.length;i++)this.livs_adm[i].livello==this.os_r.livello&&0==this.livs_adm[i].notifica&&e.push(this.livs_adm[i]);var n=this.dialog.open(ee,{disableClose:!0,width:"850px"});for(i=0;i<e.length;i++)e[i].nc=e[i].nc.split(" ()").join(""),null!=e[i].idp&&null==e[i].username&&(e[i].username=e[i].idp);setTimeout((function(){n.componentInstance.arrAutori=e,n.componentInstance.title="Riassegnazione documento: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),n.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.wax=e.arrsel,t.nota_wax=e.nota,t.riassegna_richiesta_step2())}))},t.prototype.riassegna_richiesta_step2=function(){var t=this,e="";null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var i="",n="",o="",s="";null!=this.get_grid().sRow.partecipanti&&(s=this.get_grid().sRow.partecipanti);for(var r="",a="XCXXX",l=0;l<this.wax.length;l++){if("XCXXX"!=a&&a!=this.wax[l].gruppo_parallelo)return void this._toastr.error("impossibile assegnare a utenti di gruppi distiniti");a=this.wax[l].gruppo_parallelo,""!=r&&(r+=","),r+=this.wax[l].idp,-1==e.indexOf(this.wax[l].idp)&&(""!=e&&(e+=","),e+=this.wax[l].idp),-1==n.indexOf(this.wax[l].nc)&&(""!=n&&(n+=","),n+=this.wax[l].nc),""!=o&&(o+=","),o+=this.wax[l].nc,null!=s&&-1==s.indexOf(this.wax[l].idp)&&(""!=s&&(s+=","),s+=this.wax[l].idp),""!=i&&(i+=","),i+=this.wax[l].idp}this.sendEMail_ex(this.user_idp,r,this.titolo_email+"L'utente "+this.user_cognome+" "+this.user_nome+" ti ha riassegnato il documento: "+this.get_grid().sRow.codice,"Commento:\n\n"+this.nota_wax,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax);var p=new Dt;p.sql="INSERT_COMMENTO_RIASS",p.types=["string","string","string","string","string","int","int"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+o,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello];this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}));var u="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(u=this.wax[0].gruppo_parallelo),console.log("riassegnazione canale: ",u),(p=new Dt).sql="UPDATE_RIASS_DOCUMENTO",p.types=["string","string","string","string","string","string","string","string","string","string",u],p.values=[this.os_r.livello,this.os_r.descri_livello,e,i,this.os_r.descri_livello,n,s,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(p).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),(p=new Dt).sql="INSERT_WKF_COMMENTO",p.types=["string","string","string","string","string"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp,""],this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),this.wax.length>0&&((p=new Dt).sql="UPDATE_RIASSEGNA_TODO",p.types=["string","string"],p.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){void 0===p&&(p="");var u=new Dt;u.sql="send_wkf_mail",u.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,p],this.m_wkf.doQuery(u).subscribe((function(t){}))},t.prototype.annulla_imp=function(){this.app_s.user_name=this.app_s.user_name_ori,this.app_s.user=this.app_s.user_ori,this.app_s.user_surname=this.app_s.user_surname_ori,this.app_s.user_email=this.app_s.user_email_ori,this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_email,this.app_s.user_name_ori=null,this.app_s.user_ori=null,this.app_s.user_surname_ori=null,this.app_s.user_email_ori=null,this.imp="",this.get_grid().doFill("")},t.prototype.test_utente=function(){var t=this,e=new Dt;e.sql="SELECT_UTENTI_WORKFLOW",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(ee,{disableClose:!0,width:"850px"});setTimeout((function(){i.componentInstance.arrAutori=e.result_data,i.componentInstance.title="Impersona Utente",i.componentInstance.commento_hidden=!0})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new Dt;i.sql="SELECT_USER_INFO_WKF",i.types=["string"],i.values=[e.arrsel[0].username],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name_ori=t.app_s.user_name,t.app_s.user_ori=t.app_s.user,t.app_s.user_surname_ori=t.app_s.user_surname,t.app_s.user_email_ori=t.app_s.user_email,t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email,t.imp="ANN. IMP: "+e.result_data[0].cognome+" "+e.result_data[0].nome,t.get_grid().doFill(""),console.log(" this.user_idp ",t.user_idp))}))}}))}}))},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj={},this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Visor=this.is_Visor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_PowerUser=this.is_PowerUser,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Visor=this.app_s.getState().wkf_obj.is_Visor,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_PowerUser=this.app_s.getState().wkf_obj.is_PowerUser,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.app_s.getState().wkf_obj.title,this.m_uti.set_home_title(this.att_panelcat)},t.prototype.init_Panel=function(t,e){this.m_id_Doc=e,this.m_cod_documento=t,this.do_init()},t.prototype.run_grid=function(){var t=this;null!=this.get_grid()&&this.get_grid().ready?this.init_grid():setTimeout((function(){t.run_grid()}),500)},t.prototype.self_ok=function(){var t=this;null==this.get_grid()?setTimeout((function(){t.self_ok()}),500):this.get_grid().refresh_access(this)},t.prototype.do_init=function(){var t=this;if(null!=this.app_s.user_ori&&(this.imp="ANN. IMP: "+this.app_s.user_name+" "+this.app_s.user_surname),this.user_idp=this.app_s.user,null!=this.user_idp){this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc";var e=new Dt;e.sql="SELECT_WKF_APP_INFO",e.types=["string"],e.values=[this.m_cod_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.id_applicativo=i[0].id_gruppo,t.app_root=i[0].modulo_swf,t.codice_app=i[0].codice_documento,t.att_panelcat=i[0].descrizione_breve,t.documento_pubblico=i[0].pubblico,t.titolo_email="["+i[0].descrizione_breve+"]",t.tbl_name=i[0].vista_sql,t.grid_key=t.app_s.COMPANY_KEY+i[0].vista_sql,t.user_idp=t.app_s.user,t.user_nome=t.app_s.user_name,t.user_cognome=t.app_s.user_surname,t.user_email=t.app_s.user_email,t.m_uti.set_home_title(t.att_panelcat);var n=new Dt;n.sql="SELECT_UTENTE_WKF_ADMIN",n.types=["string","string"],n.values=[t.id_applicativo,t.app_s.user],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.is_Supervisor=!1,t.is_Admin=!1,t.is_PowerUser=!1,i.length>0&&("0"==i[0].tipo&&(t.is_Supervisor=!0),"1"==i[0].tipo&&(t.is_Admin=!0,t.is_Supervisor=!0),"2"==i[0].tipo&&(t.is_PowerUser=!0));var n=new Dt;n.sql="SELECT_WLIVELLIV2",n.types=["string","string"],n.values=[t.id_applicativo,""],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.ok_conf_s(e.result_data);var i=new Dt;i.sql="SELECT_ROLES_VISORI",i.types=["string"],i.values=[t.id_applicativo],t.m_dataService.doQuery(i).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.is_Visor=!1;for(var i=0;i<e.result_data.length;i++)if(t.m_uti.hasRole(e.result_data[i].name,!1)){t.is_Visor=!0;break}t.run_grid(),t.self_ok()}}))}}))}}))}}))}else setTimeout((function(){t.do_init()}),500)},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if(null!=this.livs[e].idp&&null!=this.user_idp&&(this.livs[e].idp.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].gruppo_parallelo)&&this.livs[e].livello<=10&&0==this.livs[e].notifica){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.goto_models=function(){this.m_router.navigate([this.app_root,"models"])},t.prototype.insert_doc=function(){this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t}(),re=function(){},ae=function(){function t(t,e,i){this.dataService=t,this.fileService=e,this.toastr=i,this.eprog=0}return t.prototype.operation=function(t,e,i,n){var o=new re;return o.op=t,o.v1=e,o.v2=i,o.ord=n,o},t.prototype.progress_update=function(t){var e=this;void 0===t&&(t=null),null!=t&&null!=t.componentInstance&&(this.eprog+=10,this.eprog>=100&&(this.eprog=95),setTimeout((function(){t.componentInstance.update_progess(e.eprog)})),setTimeout((function(){e.progress_update(t)}),2e3))},t.prototype.runCommands=function(t,e,i){var n=this;void 0===i&&(i=null),this.eprog=0;var r=new Dt;return r.sql="INSERT_OFFICE_OPERATION",r.types=["string","string"],e.sort((function(t,e){return t.ord<e.ord?-1:t.ord>e.ord?1:void 0})),r.values=[t,JSON.stringify(e)],this.dataService.doQuery(r).pipe(o.flatMap((function(e){if(null!=e&&"OK"==e.result_msg){var r=new At;return r.command="exec_app",r.p1="print_manager",r.p2=t,null!=i&&setTimeout((function(){n.progress_update(i)}),2e3),n.fileService.doQuery(r).pipe(o.flatMap((function(e){if(null!=e&&"OK"==e.result_msg)return new s.Observable((function(e){var i=n,o=!1;setTimeout((function(){o=!0}),18e4);!function t(n){var s=new Dt;s.sql="SELECT_OFFICE_OPERATION_FINISCHED",s.types=["string"],s.values=[n],i.dataService.doQuery(s).subscribe((function(s){if(null!=s&&"OK"==s.result_msg){var r=s.result_data;1==r.length?(e.next({message:r[0].result_message,result:r[0].result}),e.complete()):o?(e.error("Timeout"),i.toastr.error("Timeout")):setTimeout((function(){t(n)}),3e3)}else o||setTimeout((function(){t(n)}),3e3)}))}(t)}))})))}})))},t.ctorParameters=function(){return[{type:Mt},{type:Ct},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](Mt),e["ɵɵinject"](Ct),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[Mt,Ct,n.ToastrService])],t)}(),le=function(){function t(t,i,n,o,s,r,a,l,p){var u=this;this._gridservice=t,this._toast=i,this._dataService=n,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=r,this.uti_s=a,this.officeService=l,this._fileService=p,this.end_point=null,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.enabled=!0,this.auto_load=!0,this.auto_height=!1,this.abilita_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.init_fill=!0,this.no_pref=!0,this.autosize_at_ini=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni Imp.",this.curr_filter="",this.show_buttons=!0,this.fill_end=new e.EventEmitter,this.cell_edited=new e.EventEmitter,this.clicked=new e.EventEmitter,this.dclicked=new e.EventEmitter,this.columndclicked=new e.EventEmitter,this.cell_clicked=new e.EventEmitter,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new e.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new e.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(t){u.slimLoadingBarService.start((function(){}));var e=new $t;if(e.table=u.tbl_name,e.table_count=u.tbl_name,""!=u.count_tbl_name&&(e.table_count=u.count_tbl_name),e.num_per_pag=t.endRow-t.startRow,e.curr_page=Math.round(t.startRow/e.num_per_pag),null==e.curr_page&&(e.curr_page=0),null==e.num_per_pag&&(e.num_per_pag=100),e.sort_field=u.sort_field,null!=t.sortModel&&t.sortModel.length>0){e.sort_field="";for(var i=0;i<t.sortModel.length;i++)""!=e.sort_field&&(e.sort_field=e.sort_field+","),"autori"==t.sortModel[i].colId?e.sort_field=e.sort_field+"case when CHARINDEX('"+u.m_appService.user+"',autori)>0 then 1 else 0 end "+t.sortModel[i].sort:e.sort_field=e.sort_field+t.sortModel[i].colId+" "+t.sortModel[i].sort}if(e.system_dest=u.system_dest,e.field=u.fields,null!=u.filters&&(e.filter=u.filters),""!=u.fix_flt&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+u.fix_flt+" )"),""!=u.fix_flt_temp&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+u.fix_flt_temp+" )"),null!=t.filterModel)for(var n in t.filterModel){var o=t.filterModel[n];null==o.operator?""==e.filter?e.filter+=u.calcola_filtro(t.filterModel[n],"",n,!1):e.filter+=u.calcola_filtro(t.filterModel[n],"",n,!0):(""!=e.filter&&(e.filter+=" and "),e.filter+=" (",e.filter+=u.calcola_filtro(t.filterModel[n].condition1,"",n,!1),e.filter+=" "+o.operator+" ",e.filter+=u.calcola_filtro(t.filterModel[n].condition2,"",n,!1),e.filter+=")")}u.str_curr_q_p="",""!=e.filter&&(u.str_curr_q_p="where "+e.filter),""!=e.sort_field&&(u.str_curr_q_p=u.str_curr_q_p+" order by "+e.sort_field),u.curr_filter=e.filter,u._gridservice.doQuery(e,!0,u.end_point).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),u.b_init=!0,u.myData=i.result_data.slice(),u.num_r=i.count,u.slimLoadingBarService.complete(),u.fill_end.emit(),localStorage.setItem(u.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(u.grid_key+"_POS2")&&null!=u.gridOptions&&null!=u.gridOptions.api&&u.gridOptions.api.forEachNode((function(t){u.getRowNodeId(t)===localStorage.getItem(u.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(u.grid_key+"_POS2"))}));null!=u.toggle_mantieni&&u.toggle_mantieni.checked,u.no_pref&&!u.b_init1&&u.autoSizeAll(),u.b_init1=!0,u.ensure_visible(),null==localStorage.getItem(u.grid_key+"_COLS")&&u.autosize_at_ini&&setTimeout((function(){u.autoSizeAll()}),300)}n||(u.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){u.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}},this.getContextMenuItems_n_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste"]},this.getContextMenuItems_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste",{name:"Esporta",action:function(){u.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0},rowSelection:"multiple",rowDeselection:!1,allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore",greaterThan:"Maggiore",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.notesid?t.notesid:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.uiid_stampa="",this.xxopx=0,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj={})}return t.prototype.docmd=function(t){this.command.emit(t)},t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.no_pref||(this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),localStorage.removeItem(this.grid_key+"_FILTER_UP"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0)))},t.prototype.elimina_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler cancellare la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="DELETE_CFG_GRID",i.types=["string","string"],i.values=[t.gf.getDescri(),t.grid_key];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione eliminata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.edit_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}),(function(t){}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(Xt,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo())}),(function(t){}))}}))},t.prototype.calcola_filtro=function(t,e,i,n){void 0===n&&(n=!0);var o=!1;if(null!=t.type)null!=t.filter&&(this.show_pulisci_filtri=!0,n&&(e+=" and "),o=!0,"number"==t.filterType?("greaterThan"==t.type&&(e=e+" "+i+" > "+t.filter),"equals"==t.type&&(e=e+" "+i+" = "+t.filter),"notEqual"==t.type&&(e=e+" "+i+" <> "+t.filter),"lessThan"==t.type&&(e=e+" "+i+" < "+t.filter),"lessThanOrEqual"==t.type&&(e=e+" "+i+" <= "+t.filter),"greaterThanOrEqual"==t.type&&(e=e+" "+i+" >= "+t.filter),"inRange"==t.type&&(e=e+" ("+i+" >= "+t.filter+" and "+i+" <= "+t.filterTo+")")):("contains"==t.type&&(e=e+" upper("+i+") like '%"+t.filter.replace("'","''").toUpperCase()+"%'"),"startsWith"==t.type&&(e=e+" upper("+i+") like '"+t.filter.replace("'","''").toUpperCase()+"%'"),"equals"==t.type&&(e=e+" upper("+i+") = '"+t.filter.replace("'","''").toUpperCase()+"%'"),"notContains"==t.type&&(e=e+"not upper("+i+") like '%"+t.filter.replace("'","''").toUpperCase()+"%'"),"notEqual"==t.type&&(e=e+" upper("+i+") <> '"+t.filter.replace("'","''").toUpperCase()+"'"),"endsWith"==t.type&&(e=e+" upper("+i+") like '%"+t.filter.replace("'","''").toUpperCase()+"'"))),null==t.dateTo&&null==t.dateFrom||(o=!0,n&&(e+=" and "),e+=" (",null!=t.dateFrom&&null!=t.dateTo&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))&&(e=e+i+">="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),null!=t.dateTo&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateTo,1))?(null!=t.dateFrom&&(e+=" and "),e=e+i+"<="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateTo,1))):null!=t.dateFrom&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))&&("greaterThan"==t.type&&(e=e+" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"equals"==t.type&&(e=e+" ("+i+" >="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))+" and "+i+" <="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1),"T23:59:00")+")"),"notEqual"==t.type&&(e=e+" "+i+" <> "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"lessThan"==t.type&&(e=e+" "+i+" <= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"lessThanOrEqual"==t.type&&(e=e+" "+i+" <= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"greaterThanOrEqual"==t.type&&(e=e+" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1)))),e+=" )");else{var s="";if(null!=t.values)for(var r=0;r<t.values.length;r++)null!=t.values[r]&&(""!=s&&(s+=","),s=s+"'"+t.values[r].replace("'","''")+"'");""!=s?(o=!0,n&&(e+=" and "),e=e+i+" in ("+s+")"):(o=!0,""!=e&&(e+=" and 1=0"))}return this.show_pulisci_filtri=o,null!=this.ric_libera&&""!=this.ric_libera&&(this.show_pulisci_filtri=!0),e},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t?this.uti_s.newGuid():null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){null==t.end_point&&(t.end_point=t.m_appService.API_ENDPOINT+t.m_appService.GRID_ENDPOINT),null!=localStorage.getItem(t.grid_key+"_FILTER_UP")&&(t.ric_libera=localStorage.getItem(t.grid_key+"_FILTER_UP")),t.onResize()}))},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(Wt,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var t=[];this.columnDefs.forEach((function(e){t.push(e.field)})),this.gridOptions.columnApi.autoSizeColumns(t),this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(""!=this.ric_libera&&this.doFill("",!0,!1),this.ric_libera="",localStorage.removeItem(this.grid_key+"_FILTER_UP")),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.export_excel=function(t){var e=this;if(void 0===t&&(t="xlsx"),this.num_r>15e3)this._toast.error("Massimo 15000 elementi esportabili");else{t="."+t,this.uiid_stampa=this.uti_s.newGuid(),this.xxopx=0;this.dialogRef_W=this.m_dialog.open(Vt,{disableClose:!0}),setTimeout((function(){e.dialogRef_W.componentInstance.label="EXPORT IN CORSO"}));for(var i=[],n="",o=this.gridOptions.columnApi.getAllDisplayedColumns(),s=0;s<o.length;s++)""!=n&&(n+=","),n+="["+o[s].getColDef().field+"] ["+o[s].getColDef().headerName+"]";-1!=this.fields.indexOf("DISTINCT")&&(n="DISTINCT "+n),i.push(this.officeService.operation("GB_XLS_APRI","tpl_report.xlsx",this.uiid_stampa+".xlsx",this.xxopx++)),i.push(this.officeService.operation("GB_CREA_TABELLA_FROM_DB","select "+n+" from "+this.tbl_name+" "+this.str_curr_q_p,"3",this.xxopx++)),i.push(this.officeService.operation("GB_XLS_SAVE",this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,"",this.xxopx++)),this.officeService.runCommands(this.uiid_stampa,i,this.dialogRef_W).subscribe((function(i){setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)}));var n=new At;n.p1=e.m_appService.LOCAL_PATH+"grid_reports\\"+e.uiid_stampa+"_"+e.m_appService.user+t,n.command="check_file",e._fileService.doQuery(n).subscribe((function(i){if(null!=i)if("N"==i.msg){var n=new Dt;n.sql="SELECT_OFFICE_OPERATION_FINISCHED",n.types=["string"],n.values=[e.uiid_stampa],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&t.result_data.length>0?e._toast.error(t.result_data[0].result_msg):e._toast.error("ERRORE DI STAMPA")}))}else window.open(e.m_appService.COMPANY_SITE_ROOT+"/grid_reports/"+e.uiid_stampa+"_"+e.m_appService.user+t)}))}))}},t.prototype.print=function(){this.export_excel("pdf")},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;if(this.auto_load)if(null!=this.columnDefs)if(0!=this.columnDefs.length){if(!this.ckk_ed){if(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),null!=localStorage.getItem(this.grid_key+"_FILTER_UP")&&""!=localStorage.getItem(this.grid_key+"_FILTER_UP")){this.ric_libera=localStorage.getItem(this.grid_key+"_FILTER_UP");for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)e[n].length>2?i.push(e[n]):this._toast.error("ignorato termine: "+e[n]+" troppo corto");if(0==i.length)return;for(var o="",s=0;s<this.columnDefs.length;s++)if(null!=this.columnDefs[s]&&null==this.columnDefs[s].no_filter&&null!=this.columnDefs[s].field&&""!=this.columnDefs[s].field&&"agDateColumnFilter"!=this.columnDefs[s].filter)for(n=0;n<i.length;n++)""!=o&&(o+=" or "),o=o+this.columnDefs[s].field+" LIKE '%"+this.uti_s.string_sqlvalue(i[n])+"%'";this.fix_flt_temp=o,this.show_pulisci_filtri=!0}this.init_fill&&setTimeout((function(){t.ref_dt()}),100)}}else setTimeout((function(){t.ckk()}),500);else setTimeout((function(){t.ckk()}),500)},t.prototype.res_columns=function(t){var e=this;if(void 0===t&&(t=!1),null!=this.columnDefs)if(0!=this.columnDefs.length){var i=!1;if(null!=this.toggle_mantieni&&(i=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&""!=localStorage.getItem(this.grid_key+"_COLS")){if(null!=localStorage.getItem(this.grid_key+"_COLS")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{for(var n=JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),o=!0,s=0;s<n.length;s++)n[s].hide||(o=!1);o?localStorage.getItem(this.grid_key+"_COLS"):this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}try{this.gridOptions.api.setSortModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(t){console.log(t)}try{this.gridOptions.api.setFilterModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}}else this.gridOptions.api.sizeColumnsToFit()}else setTimeout((function(){e.res_columns(t)}),200);else setTimeout((function(){e.res_columns(t)}),200)},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions?setTimeout((function(){t.ref_dt()}),500):null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){this.gridApi=t.api,this.setHeaderHeight(this.header_h),null!=this.gf&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.auto_load&&this.onready_go()},t.prototype.init_grid=function(){this.auto_load=!0,this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",this.doFill("",!0,!1),void localStorage.removeItem(this.grid_key+"_FILTER_UP");localStorage.setItem(this.grid_key+"_FILTER_UP",this.ric_libera);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)t[i].length>2?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.show_pulisci_filtri=!0,this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onFilterModified=function(){var t=this;this.no_pref||setTimeout((function(){console.log("onFilterModified"),t.b_init&&(console.log("salvo f: "+JSON.stringify(t.gridOptions.api.getFilterModel())),localStorage.setItem(t.grid_key+"_FILTER",JSON.stringify(t.gridOptions.api.getFilterModel())))}),200)},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){console.log("qui55555"),i.Refresh()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.ctorParameters=function(){return[{type:Qt},{type:n.ToastrService},{type:Mt},{type:It},{type:d.SlimLoadingBarService},{type:l.MatDialog},{type:Tt},{type:ae},{type:Ct}]},yt([e.Input(),St("design:type",String)],t.prototype,"end_point",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"tbl_name",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"columnDefs",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"count_tbl_name",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"num_per_pag",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"grid_key",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sort_field",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"fields",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"filters",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"auto_load",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"auto_height",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"abilita_export",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled_pag",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_help",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_num_elem",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"system_dest",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"header_h",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"no_pref",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"autosize_at_ini",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_elementi",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"trova_label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"mantieni_impostazioni",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_buttons",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fill_end",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_edited",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"clicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"dclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"columndclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_clicked",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"toolbar_type",void 0),yt([e.Input(),St("design:type",se)],t.prototype,"toolbar_wkfapp",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"toolbar_custom_commands",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"command",void 0),yt([e.ViewChild("gf"),St("design:type",qt)],t.prototype,"gf",void 0),yt([e.ViewChild("toggle_mantieni"),St("design:type",m.MatSlideToggle)],t.prototype,"toggle_mantieni",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"init_end",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"off_set",void 0),yt([e.HostListener("window:resize",["event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onResize",null),yt([e.ViewChild("testom",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"testom",void 0),yt([e.ViewChild("myModalNormal",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"myModalNormal",void 0),t=yt([e.Component({selector:"FHGrid",template:'\r\n<div fxLayout="column" fxFlexFill>\r\n\r\n <div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center start" fxLayoutGap="3px" style="min-height: 55px" [hidden]="!show_buttons">\r\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center" >\r\n <div>\r\n\t\t \t\t<h5>{{num_r}}&nbsp;{{label_elementi}}</h5>\r\n </div>\r\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n\r\n\t\t\t<div fxLayout="row" fxLayoutAlign="start center">\t<input matInput [placeholder]="trova_label" (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera"\r\n\t\t\t\t\t\t\t style="min-width:100px;max-width:180px;border:1px solid;min-height:30px"></div>\r\n <div matTooltip="REMOVE FILTER" matTooltipPosition="above" *ngIf="show_pulisci_filtri" >\r\n \t\t\t<button mat-flat-button (click)="pulisci_filtri()" color="warn">\r\n\t\t\t\t<mat-icon>filter_none</mat-icon>&nbsp;\r\n\t\t\t</button>\r\n </div>\r\n <div matTooltip="AUTO SIZE" matTooltipPosition="above">\r\n \t\t\t<button mat-flat-button (click)="autoSizeAll()" color="primary"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>compare_arrows</mat-icon>\r\n\t\t\t</button>\r\n </div>\r\n <div fxHide fxShow.gt-sm matTooltip="FIT SIZE" matTooltipPosition="above">\r\n\t \t\t<button mat-flat-button (click)="fitSizeAll()" color="primary"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>keyboard_tab</mat-icon>\r\n\t\t\t</button>\r\n </div>\r\n <div fxHide fxShow.gt-sm matTooltip="Refresh" matTooltipPosition="above">\r\n <button mat-flat-button (click)="Refresh()" color="primary"\r\n *ngIf="show_buttons">\r\n <mat-icon>autorenew</mat-icon>\r\n </button>\r\n </div>\r\n <FHFilterComboBox fxHide fxShow.gt-sm [hidden]=\'!show_buttons || no_pref\' (selchange)="ch_config()" (fillend)="fe_cfg()" #gf init_fill="false"></FHFilterComboBox>\r\n\t\t\t\t<div matTooltip="Modifica Preferenza" matTooltipPosition="above" *ngIf="curr_config!=\'-1\'">\r\n\t\t\t\t\t<button mat-icon-button *ngIf="show_buttons && !no_pref"\r\n\t\t\t\t\t\t\t\t\tstyle="color:rgb(248, 105, 10)">\r\n\t\t\t\t\t\t<mat-icon (click)="edit_config()">save</mat-icon>\r\n </button>\r\n\t\t\t\t</div>\r\n <div matTooltip="Elimina Preferenza" matTooltipPosition="above" *ngIf="curr_config!=\'-1\'">\r\n <button mat-icon-button *ngIf="show_buttons && !no_pref"\r\n style="color:rgb(248, 105, 10)">\r\n <mat-icon (click)="elimina_config()">delete</mat-icon>\r\n </button>\r\n\r\n </div>\r\n\t\t\t\t<div fxHide fxShow.gt-sm matTooltip="Crea Nuova Preferenza" matTooltipPosition="above">\r\n\t\t\t\t\t<button mat-icon-button style="color:rgb(16, 98, 16)" *ngIf="show_buttons && !no_pref">\r\n\t\t\t\t\t\t<mat-icon (click)="insert_config()">library_add</mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\r\n <mat-slide-toggle fxHide fxShow.gt-sm [hidden]=\'!show_buttons || no_pref\' (click)="ck_flag()" #toggle_mantieni>\r\n\t\t\t\t\t{{mantieni_impostazioni}}\r\n\t\t\t\t</mat-slide-toggle>\r\n\r\n\r\n \t&nbsp;\t<div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\r\n <button mat-flat-button (click)="help_window()" color="primary" *ngIf="show_buttons && show_help" >\r\n\t\t\t<mat-icon>help</mat-icon>\r\n </button></div>&nbsp;&nbsp;&nbsp;&nbsp;\r\n\r\n <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="0" *ngIf="abilita_export" matTooltip="EXPORT PDF" matTooltipPosition="above">\r\n <img src="assets/icons/square-o/pdf.svg" style="width:24px;height: 24px;cursor:pointer;" (click)="print()" alt="Export Excel">\r\n </div>\r\n <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="0" *ngIf="abilita_export" matTooltip="EXPORT EXCEL" matTooltipPosition="above">\r\n <img src="assets/icons/square-o/xlsx.svg" style="width:24px;height: 24px;cursor:pointer;" (click)="export_excel()" alt="Export Excel">\r\n </div>\r\n\r\n </div>\r\n <div fxLayout="row" fxLayoutAlign="end center" style="width: 100%;" *ngIf="enabled">\r\n <FHGridToolBar (command)="docmd($event)" [type]="toolbar_type"\r\n\r\n [custom_commands]="toolbar_custom_commands"\r\n [toolbar_wkfapp]="toolbar_wkfapp"\r\n\r\n ></FHGridToolBar>\r\n\t\t</div>\r\n </div>\r\n\r\n <div fxLayout="row" style="width:100%" [fxFlex]="show_buttons ? 100:95">\r\n<ag-grid-angular\r\n ref-agGrid\r\n style="width: 100%; height: 100%;"\r\n id="myGrid"\r\n\t\t\t\t\t\t\t\t (cellDoubleClicked)="onColumnEvent($event)"\r\n (cellClicked)="onCellClicked($event)"\r\n\t\t\t\t\t\t\t\t [headerHeight]="header_h"\r\n [groupHeaderHeight]="header_h"\r\n\r\n\t\t\t\t\t\t\t\t class="ag-theme-balham"\r\n [singleClickEdit]="true"\r\n [gridOptions]="gridOptions"\r\n [columnDefs]="columnDefs"\r\n\t\t\t\t\t\t\t\t [rowData]="rowData"\r\n [getContextMenuItems]="abilita_export ? getContextMenuItems_e:getContextMenuItems_n_e"\r\n\r\n (filterModified)="onFilterModified()"\r\n\t\t\t\t\t\t\t\t (rowDoubleClicked)="onRowDClicked($event)"\r\n\t\t\t\t\t\t\t\t (rowClicked)="onRowClicked($event)"\r\n (columnVisible)="oncolumnEverythingChanged($event)"\r\n\t\t\t\t\t\t\t\t (columnResized)="oncolumnEverythingChanged($event)"\r\n\t\t\t\t\t\t\t\t (columnMoved)="oncolumnEverythingChanged($event)"\r\n (cellValueChanged)="okr($event)"\r\n\t\t\t\t\t\t\t\t (sortChanged)="onAfterSortChanged()"\r\n [paginationPageSize]="num_per_pag"\r\n (gridReady)="onReady($event)">\r\n</ag-grid-angular>\r\n</div>\r\n</div>\r\n',styles:["\n\n "]}),St("design:paramtypes",[Qt,n.ToastrService,Mt,It,d.SlimLoadingBarService,l.MatDialog,Tt,ae,Ct])],t)}(),pe=function(t){function i(i,n){var o=t.call(this)||this;return o._dataService=i,o._dataService_odbc=n,o.init_fill=!0,o.sql="",o.label="",o.types=[],o.values=[],o.hidden=!1,o.db_type="1",o.enabled=!0,o.required=!1,o.only_from_list=!1,o.fillend=new e.EventEmitter,o.selchange=new e.EventEmitter,o.change=new e.EventEmitter,o.initend=new e.EventEmitter,o.focusout=new e.EventEmitter,o.descri_val="",o.sItem="",o.searchItemsFiltered=[],o.is_loaded=!1,o.selval=null,o.errorMsg="",o.valDef="",o.table_hidden=!0,o}var n;return ft(i,t),n=i,i.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},i.prototype.fo_search=function(t){this.focusout.emit()},i.prototype.onChange=function(t){if(this.searchItemsFiltered=[],null!=this.sItem)if(""!=this.sItem){this.searchItemsFiltered=[];for(var e=this.sItem.toLowerCase(),i=0;i<this.myData.length&&(null!=this.myData[i].descrizione_valore&&-1!=this.myData[i].descrizione_valore.toLowerCase().indexOf(e)&&this.searchItemsFiltered.push(this.myData[i]),!(e.length<4&&20==this.searchItemsFiltered.length));i++);}else for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},i.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.sItem=t.option.value,this.ch(t)},i.prototype.ch=function(t){var e=this.getValue();this.selchange.emit({event:t,valore:this.getValue(),descrizione_valore:this.sItem}),this.change.emit(e),this.emitChanged()},i.prototype.myListFormatter=function(t){return t.descrizione_valore},i.prototype.resetValue=function(){var t=this;setTimeout((function(){t.selval="",t.valDef="",t.sItem="",t.selval=null}),100)},i.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},i.prototype.fillCombo=function(){var t=this;this.myData=new Array,this.searchItemsFiltered=new Array;var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))},i.prototype.resetD=function(t){this.myData=t,this.selval="",this.fillend.emit(),this.table_hidden=!1,this.errorMsg="",this.setByValue(this.valDef),this.is_loaded=!0,null!=this.getValue()&&""!=this.getValue()||""==this.valDef||this.setByDescri(this.valDef)},i.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.sItem=t,this.selval=this.myData[e].valore,void(null!=this.sItem&&(this.descri_val=this.sItem));this.only_from_list||(this.sItem=t)}},i.prototype.setByValue=function(t){if(this.valDef=t,this.selval=t,null!=this.myData)for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.sItem=this.myData[e].descrizione_valore,void(null!=this.sItem&&(this.descri_val=this.sItem));this.only_from_list||(this.sItem=this.selval)},i.prototype.setValue=function(t){this.setByValue(t)},i.prototype.getDescri=function(){return this.getData("descrizione_valore")},i.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.sItem},i.prototype.getObj=function(){for(var t in this.myData)if(this.myData[t].descrizione_valore==this.selval||this.myData[t].valore==this.selval)return this.myData[t];return null},i.prototype.getValue=function(){return this.getData("valore")},i.prototype.getModelValue=function(){var t=this.getData("valore");return null!==t||this.only_from_list?t:this.sItem},i.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.table_hidden=!1,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},i.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},i.prototype.emitChanged=function(){var t=this.getModelValue();this.changed.forEach((function(e){return e(t)}))},Object.defineProperty(i.prototype,"value",{get:function(){return this.getModelValue()},set:function(t){this.getModelValue()!==t&&(this.setValue(t),this.changed.forEach((function(e){return e(t)})))},enumerable:!0,configurable:!0}),i.prototype.writeValue=function(t){this.setValue(t)},i.ctorParameters=function(){return[{type:Mt},{type:Ot}]},yt([e.Input(),St("design:type",Boolean)],i.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"sql",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"label",void 0),yt([e.Input(),St("design:type",Array)],i.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],i.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"db_type",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"only_from_list",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"initend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"focusout",void 0),yt([e.ViewChild("searchp"),St("design:type",e.ElementRef)],i.prototype,"searchp",void 0),yt([e.ViewChild("auto"),St("design:type",g.MatAutocomplete)],i.prototype,"auto",void 0),i=n=yt([e.Component({selector:"FHAutoComplete",template:'\n <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input matInput\n [disabled]="!enabled || hidden" [matAutocomplete]="auto" [required]="required"\n (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search($event)"\n #searchp>\n </mat-form-field>\n <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)" autoActiveFirstOption >\n <mat-option *ngFor="let objx of searchItemsFiltered" [value]="objx.descrizione_valore">\n {{ objx.descrizione_valore }}\n </mat-option>\n </mat-autocomplete>\n\n\n <div class="ui negative message" *ngIf="errorMsg != \'\'">\n <i class="close icon"></i>\n <div class="header">\n {{errorMsg}}\n </div>\n </div>\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="sItem"\n >\n </mat-form-field>\n ',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:n,multi:!0}],styles:["\n\n "]}),St("design:paramtypes",[Mt,Ot])],i)}(Ft),ue=f,ce={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMMM Y",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM Y"}},de=[],he=1;he<=31;he++)de.push(String(he));var _e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.localeData=ue.localeData(),e}return ft(e,t),e.prototype.getYear=function(t){return t.year()},e.prototype.getMonth=function(t){return t.month()},e.prototype.getDate=function(t){return t.date()},e.prototype.getDayOfWeek=function(t){return t.day()},e.prototype.getMonthNames=function(t){switch(t){case"long":return this.localeData.months();case"short":return this.localeData.monthsShort();case"narrow":return this.localeData.monthsShort().map((function(t){return t[0]}))}},e.prototype.getDateNames=function(){return de},e.prototype.getDayOfWeekNames=function(t){switch(t){case"long":return this.localeData.weekdays();case"short":case"narrow":return this.localeData.weekdaysShort()}},e.prototype.getYearName=function(t){return String(t.year())},e.prototype.getFirstDayOfWeek=function(){return this.localeData.firstDayOfWeek()},e.prototype.getNumDaysInMonth=function(t){return t.daysInMonth()},e.prototype.clone=function(t){return t.clone()},e.prototype.createDate=function(t,e,i){return ue([t,e,i])},e.prototype.today=function(){return ue()},e.prototype.parse=function(t,e){if(console.log("prima value ",t,"parseFormat ",e),null!=t){var i,n=t.split("/");if(console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i;if(n=t.split("-"),console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i}console.log("fine value ",t,"parseFormat ",e);var o=ue(t,e,!0);return o.isValid()||(o=ue(t)),o.isValid()?o:null},e.prototype.format=function(t,e){return t?t.format(e):""},e.prototype.addCalendarYears=function(t,e){return t.clone().add(e,"y")},e.prototype.addCalendarMonths=function(t,e){return t.clone().add(e,"M")},e.prototype.addCalendarDays=function(t,e){return t.clone().add(e,"d")},e.prototype.setLocale=function(t){this.localeData=ue.localeData(t)},e.prototype.compareDate=function(t,e){return t.diff(e,"seconds",!0)},e.prototype.sameDate=function(e,i){return null==e?null==i:f.isMoment(e)?e.isSame(i):t.prototype.sameDate.call(this,e,i)},e.prototype.clampDate=function(t,e,i){return e&&t.isBefore(e)?e:i&&t.isAfter(i)?i:t},e.prototype.isValid=function(t){return t.isValid()},e.prototype.isDateInstance=function(t){return ue.isMoment(t)},e.prototype.toIso8601=function(t){return t.format()},e.prototype.fromIso8601=function(t){return ue(t)},e.prototype.invalid=function(){},e}(v.DateAdapter),me=ce,ge=function(t){function i(i,n){var o=t.call(this)||this;return o.dateAdapter=i,o.uti_s=n,o.label="",o.required=!1,o.show_buttons=!1,o.enabled=!0,o.min_date=null,o.max_date=null,o.change=new e.EventEmitter,o.v_view=o.uti_s.date2String(new Date),o.date_sel=null,o.v_date_sel="",o.dateAdapter.setLocale("it-IT"),o}var n;return ft(i,t),n=i,i.prototype.checkInput=function(t){},i.prototype.dt_chg=function(t){var e=t.target.value.split("-").join("/").split("/");if(3==e.length)if(1==e[1].length&&(e[1]="0"+e[1]),1==e[0].length&&(e[0]="0"+e[0]),parseInt(e[2])<3e3&&parseInt(e[0])>0&&parseInt(e[0])<=31&&parseInt(e[1])>0&&parseInt(e[1])<=12){var i=new _e,n=parseInt(e[2]);n<100&&(n+=2e3),this.date_sel=i.createDate(n,parseInt(e[1])-1,parseInt(e[0]))}else console.log("data non valida! ",e)},i.prototype.chxx=function(t){},i.prototype.ch=function(t){this.change.emit(this.getValue()),this.emitChanged()},i.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},i.prototype.dt_ch=function(){var t=this;setTimeout((function(){t.ch()}),50)},i.prototype.add_year=function(){var t=new _e;this.date_sel=t.createDate(this.getValue().getFullYear()+1,this.getValue().getMonth(),this.getValue().getDate()),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},i.prototype.ini_year=function(){var t=new _e;this.date_sel=t.createDate(this.getValue().getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},i.prototype.fin_year=function(){var t=new _e;this.date_sel=t.createDate(this.getValue().getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},i.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel.toDate()},i.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.setLimits()}))},i.prototype.setLimits=function(){},i.prototype.setToday=function(){this.date_sel=new Date},i.prototype.setValue=function(t){if(this.dateAdapter.setLocale("it-IT"),null!=t){t instanceof Date||null!=t.value&&(t=new Date(t.value));var e=new _e;this.date_sel=e.createDate(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.getValue())}else this.date_sel=null},i.ctorParameters=function(){return[{type:v.DateAdapter},{type:Tt}]},yt([e.Input(),St("design:type",String)],i.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"show_buttons",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Date)],i.prototype,"min_date",void 0),yt([e.Input(),St("design:type",Date)],i.prototype,"max_date",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"change",void 0),yt([e.ViewChild("pickerId"),St("design:type",e.ElementRef)],i.prototype,"pickerId",void 0),i=n=yt([e.Component({selector:"FHDatePicker",providers:[{provide:v.MAT_DATE_FORMATS,useValue:me},{provide:v.DateAdapter,useClass:_e},{provide:p.NG_VALUE_ACCESSOR,useExisting:n,multi:!0},{provide:v.MAT_DATE_LOCALE,useValue:"it-IT"}],template:'\n <div [hidden]="!show_buttons||!enabled">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="add_year()">+1 Anno</button>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="ini_year()">Inizio Anno</button>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="fin_year()">Fine Anno</button>\n </div>\n\n <mat-form-field (click)="chxx($event)" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event)" (keyup)="checkInput($event)"\n (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" >\n <mat-datepicker-toggle matSuffix [for]="picker" (click)="chxx($event)"></mat-datepicker-toggle>\n <mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>\n </mat-form-field>\n\n ',styles:["\n .lb_small_grigia {\n font-size: 12px;\n color: #B8B8B8;\n }\n\n .label_dis {\n font-size: 14px;\n font-weight: bold;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-input-element,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-label {\n color: #f44336;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-underline,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-ripple {\n background-color: #f44336;\n }\n "]}),St("design:paramtypes",[v.DateAdapter,Tt])],i)}(Ft),fe=function(){function t(){this.val_app=-1}return t.prototype.ok=function(){this.val_app=1,this.params.api.stopEditing()},t.prototype.ko=function(){this.val_app=0,this.params.api.stopEditing()},t.prototype.nd=function(){this.val_app=-1,this.params.api.stopEditing()},t.prototype.agInit=function(t){this.params=t},t.prototype.getValue=function(){return this.val_app},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},yt([e.ViewChild("container",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"container",void 0),t=yt([e.Component({selector:"approva-cell",template:'\n <div #container class="mood">\n\n <div class="example-mat-buttons">\n\n <button mat-icon-button style="color:green" (click)="ok()">\n <mat-icon>thumb_up</mat-icon>\n </button>\n <button mat-icon-button style="color:red" (click)="ko()">\n <mat-icon>thumb_down</mat-icon>\n </button>\n <button mat-icon-button style="color:gray" (click)="nd()">\n <mat-icon>crop_din</mat-icon>\n </button>\n </div>\n\n\n </div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none\n }\n\n\n "]})],t)}(),ve=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=wt((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.THOUSANDS_SEPARATOR))+s},t.prototype.parse=function(t,e){void 0===e&&(e=2);var i=wt((t||"").split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return n=n.replace(new RegExp(this.THOUSANDS_SEPARATOR,"g"),""),s=parseInt(s,10)>0&&e>0?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",t},t=yt([e.Pipe({name:"FHCurrency"}),St("design:paramtypes",[])],t)}(),ye=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.el.value=t.currencyPipe.transform(t.el.value)}))},t.prototype.onFocus=function(t){this.el.value=this.currencyPipe.parse(t)},t.prototype.onBlur=function(t){this.el.value=this.currencyPipe.transform(t)},t.ctorParameters=function(){return[{type:e.ElementRef},{type:ve}]},yt([e.HostListener("focus",["$event.target.value"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onFocus",null),yt([e.HostListener("blur",["$event.target.value"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onBlur",null),t=yt([e.Directive({selector:"[FHCurrencyFormatter]"}),St("design:paramtypes",[e.ElementRef,ve])],t)}(),be=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title="",this.sql_dett="",this.descri="",this.lat=51.673858,this.long=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],null!=this.m_appService.getState().appo_dialog&&(null!=this.m_appService.getState().appo_dialog.zoom&&(this.zoom=this.m_appService.getState().appo_dialog.zoom),null!=this.m_appService.getState().appo_dialog.title&&(this.title=this.m_appService.getState().appo_dialog.title),null!=this.m_appService.getState().appo_dialog.lat&&(this.lat=this.m_appService.getState().appo_dialog.lat),null!=this.m_appService.getState().appo_dialog.long&&(this.long=this.m_appService.getState().appo_dialog.long),null!=this.m_appService.getState().appo_dialog.descri&&(this.descri=this.m_appService.getState().appo_dialog.descri),null!=this.m_appService.getState().appo_dialog.markers&&(this.markers=this.m_appService.getState().appo_dialog.markers))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.apri_Scheda=function(t){window.open(t)},t.prototype.clickedMarker=function(t,e,i){this.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},t=yt([e.Component({template:'\n\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px;font-size: 12px;">\n\n <agm-map [zoom]="zoom" width="100%" height="100%" [latitude]="lat" [longitude]="long">\n <agm-marker\n *ngFor="let m of markers; let i = index"\n (markerClick)="clickedMarker(m.labelx, infoWindow, i)"\n [latitude]="m.lat"\n [longitude]="m.lng"\n [label]="m.label"\n >\n <agm-info-window #infoWindow>\n\n <strong>{{m.labelx}}</strong><br>\n <button *ngIf="m.url_scheda!=null" (click)="apri_Scheda(m.url_scheda)">APRI SCHEDA</button>\n </agm-info-window>\n </agm-marker>\n </agm-map>\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n\n\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),Se=function(){function t(){this.text="",this.date_zz="",this.date_v="",this.label=""}return t.prototype.setDt=function(){this.date_zz=this.text},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){return t.appdt.nativeElement.focus()}))},t.prototype.agInit=function(t){return this.params=t,null==t.value?(this.text=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.text=null,void(this.date_zz=null)):(this.text=t.value,void(this.date_zz=t.value))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&13!=e&&39!=e||t.stopPropagation()},yt([e.ViewChild("container",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"container",void 0),yt([e.ViewChild("appdt"),St("design:type",Object)],t.prototype,"appdt",void 0),t=yt([e.Component({selector:"editor-cell",template:'\n <div #container class="mood">\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <textarea matInput style="min-height:180px;min-width:400px" [(ngModel)]="text" #appdt\n ></textarea>\n </mat-form-field>\n </div>\n\n <button mat-flat-button color="primary" (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]})],t)}(),we=function(){function t(t){this._dataService=t,this.selval="",this.date_zz="",this.date_v="",this.sql="",this.label="",this.myData=new Array}return t.prototype.setDt=function(){this.date_zz=this.selval},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new Dt;i.sql=t.sql,i.types=t.types,i.values=t.values;this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data)}),(function(t){})),null!=t.value&&-1==t.value.indexOf("--")&&(this.selval=t.value,this.date_zz=t.value)},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){t.which||t.keyCode},t.ctorParameters=function(){return[{type:Mt}]},yt([e.ViewChild("container",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"container",void 0),yt([e.ViewChild("appdt"),St("design:type",Object)],t.prototype,"appdt",void 0),t=yt([e.Component({selector:"editor-cell",template:'\n <div #container class="mood">\n <div style="min-width:350px;min-height:60px;text-align:center">\n\n <select [(ngModel)]="selval" #appdt style="min-height:40px;width:90%">\n <option value="{{app.descrizione_valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</option>\n </select>\n </div>\n <br><br><br>\n <button mat-flat-button color="primary" (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}),St("design:paramtypes",[Mt])],t)}(),Ie=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t=yt([e.Pipe({name:"replaceLineBreaks"})],t)}(),Ee=function(){function t(t,e,i){this.dialogRef=t,this._dataService=e,this.toastr=i,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.value_list=new Array,this.value_list_all=new Array,this.value_list_sel=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.types=[],this.values=[],this.value_sel=new Array}return t.prototype.ngAfterViewInit=function(){},t.prototype.filtra=function(){if(this.value_list_sel=new Array,""==this.fltr_user){for(var t=0;t<this.value_list_all.length;t++)if(this.value_list_sel.push(this.value_list_all[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_list_all.length;t++)if(-1!=this.value_list_all[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())){for(var e=!1,i=0;i<this.value_list_sel.length;i++)if(this.value_list_sel[i].descrizione_valore==this.value_list_all[t].descrizione_valore){e=!0;break}if(e||this.value_list_sel.push(this.value_list_all[t]),50==this.value_list_sel.length&&this.limit_size)return}},t.prototype.fill_list=function(t,e){var i=this;this.value_sel=new Array;for(var n=0;n<e.length;n++){var o=new Object;o.descrizione_valore=e[n],this.value_sel.push(o)}var s=new Dt;s.sql=t,s.types=this.types,s.values=this.values,this._dataService.doQuery(s).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){i.value_list_all=t.result_data;for(var e=0;e<i.value_sel.length;e++)for(var n=i.value_list_all.length-1;n>=0;n--)if(i.value_list_all[n].descrizione_valore==i.value_sel[e].descrizione_valore){i.value_list_all.splice(n,1);break}i.filtra(),!0}}),(function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))},t.prototype.fill_list_arr=function(t,e){this.value_sel=new Array;for(var i=0;i<e.length;i++){var n=new Object;n.descrizione_valore=e[i],this.value_sel.push(n)}this.value_list_all=t;for(var o=0;o<this.value_sel.length;o++)for(var s=this.value_list_all.length-1;s>=0;s--)if(this.value_list_all[s].descrizione_valore==this.value_sel[o].descrizione_valore){this.value_list_all.splice(s,1);break}this.filtra()},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list_all.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.value_list_all.splice(t,1),this.single_sel&&(this.value_sel=new Array),this.value_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra(),this.single_sel&&this.ok()}else this.toastr.error("ERRORE","Selezionare il valore da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.value_sel.indexOf(this.selectedRemove,0);t>-1&&this.value_sel.splice(t,1),this.value_list_all.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare il valore da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:Mt},{type:n.ToastrService}]},yt([e.Input(),St("design:type",Array)],t.prototype,"value_list",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"value_list_all",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"value_list_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"vis_buttons",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"limit_size",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"value_sel",void 0),t=yt([e.Component({selector:"FHPickList",template:'\n\n <div fxLayout="column" fxLayoutGap="15px" fxFlex >\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="41%">\n\n\n <div style="width:100%;height:420px;overflow:auto;">\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr><td> <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()" style=\'padding:8px;margin:15px auto;width:100%;\'\n placeholder=\'Ricerca...\'>\n </td></tr>\n <tr *ngFor="let u of value_list_sel;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }" (click)="addTo(u)" (dblclick)="do_add()" class="selector"\n [ngClass]="{ \'active\': selectedAdd == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div fxLayout="column" fxFlex="18%"\n style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-flat-button color="primary" (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-flat-button color="primary" (click)="do_rem()" [disabled]="option">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n\n\n <div style="width:100%;height:420px;overflow:auto;">\n\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of value_sel;let odd=odd; let even=even;" (mouseover)="selectedRemove=u" [ngClass]="{ odd: odd, even: even }" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector"\n [ngClass]="{ \'active\': selectedRemove == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br><br>\n <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-flat-button color="primary" (click)="ok()">Ok</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close()">Annulla</button>\n </div>\n </div>\n\n ',styles:["\n .selector{\n cursor:hand\n }\n "]}),St("design:paramtypes",[l.MatDialogRef,Mt,n.ToastrService])],t)}(),Oe=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.valore_min=1,this.valore_max=1e6}return t.prototype.ngAfterViewInit=function(){},t.prototype.show=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){Number(this.valore)<this.valore_min||Number(this.valore)>this.valore_max?this.toastr.error("Il valore deve avere essere compreso tra "+this.valore_min+" - "+this.valore_max):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},t=yt([e.Component({selector:"app-win_ask_text",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="font-size: 12px;">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input matInput type="number" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button>&nbsp;&nbsp;&nbsp;<button\n mat-flat-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Ce=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){y.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t.ctorParameters=function(){return[{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t=yt([e.Injectable(),bt(0,e.Inject(e.PLATFORM_ID)),St("design:paramtypes",[Object])],t)}(),xe=function(){function t(t){this.highlightService=t,this.highlighted=!1,this.path_md=""}return t.prototype.ngAfterViewChecked=function(){this.highlighted||null!=!this.path_md||(this.highlightService.highlightAll(),this.highlighted=!0)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:Ce}]},yt([e.Input(),St("design:type",String)],t.prototype,"path_md",void 0),t=yt([e.Component({selector:"FHMdReader",template:'\n <markdown [src]="path_md">\n\n </markdown>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Ce])],t)}(),ke=function(){function t(t){var e=this;this.uti=t,this.g_height="300px",this.columnDefs=[{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Descrizione",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",filterParams:{newRowsAction:"keep"},cellRenderer:function(t){if(null==t.value)return" ------ ";var i=new Date(t.value);return i.getFullYear()<1980?" ------ ":e.uti.pad(i.getDate(),2)+"/"+e.uti.pad(i.getMonth()+1,2)+"/"+i.getFullYear()}}],this.m_app="",this.m_k=""}return t.prototype.init=function(t,e){var i=this;this.m_app=t,this.m_k=e,setTimeout((function(){i.reload()}),500)},t.prototype.reload=function(){this.datagrid.doFill("[applicativo]='"+this.m_app+"' and [iddocumento]='"+this.m_k+"'")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:Tt}]},yt([e.Input(),St("design:type",String)],t.prototype,"g_height",void 0),yt([e.ViewChild("dtm"),St("design:type",le)],t.prototype,"datagrid",void 0),t=yt([e.Component({selector:"FHLogPanel",template:'\n\n\n <div style="width:100%;">\n <section class="bs">\n <div style="width:100%;height:450px">\n <div style="width:100%;height:100%">\n\n <FHGrid [init_fill]="false" #dtm [show_buttons]="false" [columnDefs]="columnDefs" tbl_name="logs"\n grid_key="logs" sort_field="data desc"></FHGrid>\n\n\n </div>\n </div>\n </section>\n </div>\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Tt])],t)}(),De={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Ae})),multi:!0},Ae=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.color="",this.m_color="",this.label_width="",this.change=new e.EventEmitter,this.enter_pressed=new e.EventEmitter,this.innerValue=0,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.kd=function(t){"Enter"==t.code&&this.enter_pressed.emit()},t.prototype.getStyle_color=function(){return this.m_color},t.prototype.getStyle_mw=function(){return this.label_width},t.prototype.set_color=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout((function(){console.log(" chg() -> ",t.formattedAmount),t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),console.log("fine chg value -> ",t.value),t.onChange(t.value)}),50)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,console.log(" writeValue() -> ",this.value),this.formattedAmount=this.transform(this.value,this.decimal),console.log("fine writeValue -> ",this.formattedAmount),this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transformAmount=function(t){var e=this;try{setTimeout((function(){e.value=parseFloat(e.formattedAmount.split(".").join("").split(",").join(".")),e.formattedAmount=e.transform(e.value,e.decimal)}),50)}catch(t){console.log(t)}},t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=wt((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),e>0?n+s:n},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.el.nativeElement.required=t.required),t.el.nativeElement.disabled=!t.enabled,null==t.value&&(t.value=0),t.formattedAmount=t.transform(t.value,t.decimal)}))},yt([e.ViewChild("el"),St("design:type",e.ElementRef)],t.prototype,"el",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"decimal",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"color",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_width",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"enter_pressed",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"value",void 0),t=yt([e.Component({selector:"FHCurrencyField",providers:[De],template:'\n <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" style="text-align:right" #el matInput\n [disabled]="!enabled" [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event)" [style.color]="getStyle_color()" (keydown)="kd($event)"\n (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"\n pattern="[-+]?[0-9]*[.,]?[0-9]+">\n </mat-form-field>\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" style="text-align:right" [style.color]="getStyle_color()" #el1 matInput [disabled]="true"\n [(ngModel)]="formattedAmount"\n >\n </mat-form-field>\n ',styles:["\n\n "]}),St("design:paramtypes",[])],t)}(),Te={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Re})),multi:!0},Re=function(){function t(){this.enabled=!0,this.value="",this.label="",this.height="360",this.change=new e.EventEmitter,this.focus=new e.EventEmitter,this.blur=new e.EventEmitter,this.config=new Object,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onFocus=function(t){this.focus.emit(t)},t.prototype.onBlur=function(t){this.blur.emit(t)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.config={height:t.height},t.enabled?t.config.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}]:(t.config.allowedContent=!0,t.config.toolbarGroups=[])}))},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"value",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"height",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"focus",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"blur",void 0),t=yt([e.Component({selector:"FHRichText",providers:[Te],template:'\n <b *ngIf="label!=\'\'">{{label}}</b>\n <ckeditor\n [(ngModel)]="value"\n [config]="config"\n [readonly]="!enabled"\n (change)="writeValue($event)"\n (focus)="onFocus($event)"\n (blur)="onBlur($event)" ngDefaultControl\n debounce="500">\n </ckeditor>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[])],t)}(),Le=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valore",void 0),t=yt([e.Component({selector:"app-win_output",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="min-width:500px;font-size: 12px;">\n\n <div [innerHTML]="valore" style="width:100%">\n </div>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Ne={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Me})),multi:!0},Me=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.th_character=".",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.pattern="[-+]?[0-9]*[.,]?[0-9]+",this.change=new e.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){""!=this.formattedAmount?(this.value=this.uti_s.round(parseFloat(this.formattedAmount.split(".").join("").split(",").join(".")),this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)):(this.value=this.uti_s.round(0,this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)),this.chgf=!0,this.onChange(this.value)},t.prototype.writeValue=function(t){this.chgf?this.chgf=!1:(null==t&&(t=0),t!==this.innerValue&&(this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal)))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transform=function(t,e){void 0===e&&(e=0);var i=wt((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",""!=this.th_character&&(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.th_character)),""==n&&(n="0"),0==this.decimal?n:n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t.prototype.click_select_allf=function(t){var e=this;setTimeout((function(){e.el.nativeElement.select()}),200)},t.prototype.select_allf=function(t){this.el.nativeElement.select()},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.el.nativeElement.required=t.required),t.el.nativeElement.disabled=!t.enabled,null==t.value&&(t.value=0),t.formattedAmount=t.transform(t.value,t.decimal)}))},t.ctorParameters=function(){return[{type:Tt}]},yt([e.ViewChild("el"),St("design:type",e.ElementRef)],t.prototype,"el",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"decimal",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"th_character",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"value",void 0),t=yt([e.Component({selector:"FHNumericField",providers:[Ne],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput\n [disabled]="!enabled" [(ngModel)]="formattedAmount"\n (blur)="chg()" (click)="click_select_allf($event);"\n (focus)="removeCurrencyPipeFormat($event);select_allf($event);"\n [pattern]="pattern">\n </mat-form-field>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Tt])],t)}(),Fe=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.separator=",",this.title="",this.sql="",this.single_sel=!1,this.sel_values=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.doFill=function(){this.single_sel||this.cmb_sel.setByDescri(this.sel_values),this.cmb_sel.sql=this.sql,this.cmb_sel.types=this.types,this.cmb_sel.values=this.values,this.cmb_sel.fillCombo()},t.prototype.ok=function(){""!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObjects()):this.toastr.error("Selezionare un valore")},t.prototype.ok_single=function(){this.single_sel&&this.dialogRef.close(this.cmb_sel.getObjects())},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},yt([e.ViewChild("cmb_sel"),St("design:type",Ut)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"fhlistpick",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="min-width:700px;min-height:500px;font-size: 12px">\n <FHList #cmb_sel [label]="label" [single_sel]="single_sel" [separator]="separator" style="width:100%;height:100%" init_fill="false" (selchange)="ok_single()"></FHList>\n\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n<div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button mat-flat-button color="primary" *ngIf="!single_sel" (click)="ok()">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">ANNULLA</button>\n</div>\n </mat-dialog-actions>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),Pe=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.salva_esci=function(){this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="salva_esci()">SALVA ED ESCI</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="esci_senza_salv()">ESCI SENZA SALVATAGGIO</button>\n\n </div>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),je=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.lbl="",this.nota="",this.nota_commento="",this.title="ASSEGNA DOCUMENTO",this.comm_notrequired=0,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,console.log(" this.comm_notrequired ",this.comm_notrequired),this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.arrAutori=this.m_appService.getState().wkf_doc_info.arrAutori;for(var o=0;o<this.arrAutori.length;o++)null==this.arrAutori[o].username&&(this.arrAutori[o].username=this.arrAutori[o].idp);2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)")}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(0!=this.comm_notrequired||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",te)],t.prototype,"up",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h4 mat-dialog-title>{{title}}\n </h4>\n <div mat-dialog-content fxLayout="column" style="font-size:12px;min-width: 750px">\n <div style="width:100%;height:450px">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n </div>\n <div *ngIf="comm_notrequired!=1">\n <br>\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Commento {{nota_commento}}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n </div>\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),ze=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.utenti="",this.lbl="",this.nota="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=0,this.mobile=!1,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,console.log(" this.comm_notrequired ",this.comm_notrequired),this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.utenti=this.m_appService.getState().wkf_doc_info.utenti,2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){0!=this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.close=function(){this.dialogRef.close("abort")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar>\n <div style="font-size:10px" *ngIf="mobile">{{lbl}}</div>\n <div *ngIf="!mobile">{{lbl}}</div>\n\n\n </mat-toolbar>\n <br>\n <div mat-dialog-content style="min-width:800px;font-size: 12px;">\n <div *ngIf="mobile && utenti?.toLocaleLowerCase().indexOf(\'system\')==-1" style="font-size:10px">Assegnata a: {{utenti}}</div>\n <h3 *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\')==-1">Assegnata a: {{utenti}}</h3>\n <br>\n <mat-form-field [hidden]="comm_notrequired==1" appearance="outline" floatLabel="always"><mat-label>Commento {{nota_commento}}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),Ue=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar>SELEZIONA AMBITO\n <div style="width:100%;text-align: right;">\n\n\n </div>\n\n </mat-toolbar>\n <div mat-dialog-content><br><br>\n <mat-form-field style="width:100%" appearance="outline" floatLabel="always"><mat-label>Seleziona Ambito:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" >\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app}}" *ngFor="let app of myData">{{app}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),Ve=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",this.setStepCombo(this.m_appService.getState().wkf_doc_info.livs,this.m_appService.getState().wkf_doc_info.st,this.m_appService.getState().wkf_doc_info.cl)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t,e,i){for(var n=e.split("|"),o=new Array,s=0;s<n.length;s++)for(var r=0;r<t.length;r++){if("*N"==n[s].toString().toUpperCase()){(a={descri_livello:"Prosegui a step successivo"}).g=0==s?1:0,a.livello="*N",o.push(a);break}if("*C"==n[s].toString().toUpperCase()){var a;(a={descri_livello:"Prosegui a chiusura"}).g=0==s?1:0,a.livello="*C",o.push(a);break}if(n[s]==t[r].livello&&n[s]!=i.livello){t[r].g=0==s?1:0,o.push(t[r]);break}}1==o.length&&this.dialogRef.close(o[0].livello),this.myData=o},t.prototype.ok=function(){null!=this.selval&&"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE LO STEP SUCCESSIVO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},yt([e.ViewChild("cmb"),St("design:type",_.MatSelect)],t.prototype,"smtr",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar style="max-width:500px">SELEZIONA PROSSIMO STEP:\n\n </mat-toolbar>\n <mat-dialog-content style="max-width:500px;font-size:12px"><br><br>\n <mat-form-field appearance="outline" floatLabel="always" style="width:100%"><mat-label>Seleziona Prossimo Step:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">{{OK_BUTTON}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </div>\n <br><br>\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),qe=function(){function t(t,e,i,n,o){this.dialogRef=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.enabled=!0,this.access_control=!0,this.App="",this.K="",this.title="ALLEGATI",this.sovrascrivi_path=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.App=t.app_s.getState().wkf_doc_info.uiid_app,t.K=t.app_s.getState().wkf_doc_info.uiid_doc,t.init(t.App,t.K)}))},t.prototype.init=function(t,e){this.App=t,this.K=e,this.upc.init(this.App,this.K)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:Mt},{type:n.ToastrService},{type:l.MatDialog},{type:It}]},yt([e.ViewChild("upc"),St("design:type",Yt)],t.prototype,"upc",void 0),t=yt([e.Component({selector:"wkf_win_upload",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n <mat-toolbar color="primary" style="width:90%;"><div fxFlex="20">{{title}}</div>\n <div fxLayout="row" fxLayoutAlign="center end" fxFlex="90" >\n\n\n </div>\n </mat-toolbar>\n <mat-dialog-content style="font-size:12px">\n<FHUploadPanel [enabled]="enabled" #upc [access_control]="access_control" [sovrascrivi_path]="sovrascrivi_path"></FHUploadPanel>\n </mat-dialog-content>\n <br><br>\n <div style="width:100%;text-align:center;" >\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">CHIUDI</button>\n\n </div>\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,Mt,n.ToastrService,l.MatDialog,It])],t)}(),Be=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",te)],t.prototype,"up",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px;font-size: 12px;">\n\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false"></FHPickUsers>\n </div>\n <br>\n\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),He=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0);var s=!1;if(null==this.app_s.user_isadmin?this.app_s.dev_mode=null:"1"!=this.app_s.user_isadmin?this.app_s.dev_mode=null:null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(s=!0),s){var r=this.app_s.user;"send_wkf_mail"==t.sql&&(null==t.values[9]&&(t.values[9]=""),this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[1]),t.values[3]=t.values[3]+"\n\n DEST. ORIGINALI:"+t.values[1],t.values[1]=r),"send_mail"==t.sql&&(this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[3]),t.values[2]=t.values[2]+"\n\n DEST. ORIGINALI:"+t.values[3],t.values[1]=r)}this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT;var a=JSON.stringify(t);return this.http.post(this.url,a,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),Ke=function(){function t(t,e,i,n,o,s,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=r,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.not_comm=!1,this.not_comm_disabled=!1,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.commento,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var t=this,e=new Dt;e.sql="SELECT_COMMENTI_DOCUMENTO",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.commenti_list=e.result_data;for(var i=0;i<t.commenti_list.length;i++)t.commenti_list[i].v_commento="<b>"+t.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";t.title="COMMENTI"}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");2!=this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(Fe,{disableClose:!0});setTimeout((function(){e.componentInstance.title="Selezione almeno un gruppo da notificare",e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new Dt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.select_destinatari=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Be,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){void 0===p&&(p=!0),void 0===u&&(u="");var c=new Dt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))},t.prototype.ok_op=function(t){var e=this;if(void 0===t&&(t=""),this.b_ins){(i=new Dt).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0});var o=new At;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}))}else{var i;(i=new Dt).sql="UPDATE_WKF_COMMENTO",i.types=["string","string","string"],i.values=[this.nota,this.edit_id,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0});var o=new At;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc+"|"+e.edit_id,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}),(function(t){}))}},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(zt).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="COMMENTI")}))},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Mt},{type:He},{type:Ct}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n <button color="primary" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n INSERISCI\n </button>\n\n </mat-toolbar>\n <br>\n <div mat-dialog-content style="min-width:800px;font-size: 12px;" >\n\n <mat-form-field *ngIf="b_edit" appearance="outline" floatLabel="always"><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [disabled]="not_comm_disabled" [(ngModel)]="not_comm" [hidden]="notifica_commenti==0 || (notifica_commenti==1 && lettori==\'\')">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table style="min-width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>Commento</th>\n <th width="15%">Autore</th>\n <th width="15%">Data</th>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of commenti_list;let odd=odd; let even=even;index as i" [ngClass]="{ odd: odd, even: even }" >\n\n <td [innerHTML]="app.v_commento"></td>\n <td>{{app.COGNOME + \' \' + app.NOME}}</td>\n <td>{{app.data_creazione | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td><mat-icon [matTooltip]="app.dest_notif" *ngIf="app.dest_notif!=null && app.dest_notif!=\'\'">mail</mat-icon></td>\n <td>\n <mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user"\n (click)="edit_comm(app)">edit\n </mat-icon>\n </td>\n\n </tr>\n </tbody>\n </table>\n </section>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">CHIUDI</button>\n\n </div>\n\n\n ',styles:["\n\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,l.MatDialog,It,n.ToastrService,Mt,He,Ct])],t)}(),Ge=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toast=i,this.hide_richiedente=!1,this.load_info()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(){var t=this;null!=this.m_appService.getState().wkf_doc_info&&null!=this.m_appService.getState().wkf_doc_info.codice?(this.codice=this.m_appService.getState().wkf_doc_info.codice,this.data_richiesta=this.m_appService.getState().wkf_doc_info.data_richiesta,this.richiedente=this.m_appService.getState().wkf_doc_info.richiedente,this.stato=this.m_appService.getState().wkf_doc_info.stato,this.in_carico_a=this.m_appService.getState().wkf_doc_info.in_carico_a,this.uiid_app=this.m_appService.getState().wkf_doc_info.uiid_app,this.uiid_doc=this.m_appService.getState().wkf_doc_info.uiid_doc,this.canale=this.m_appService.getState().wkf_doc_info.canale):setTimeout((function(){t.load_info()}),500)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar color="primary">INFO DOCUMENTO\n <div style="width:100%;text-align: right;">\n </div>\n </mat-toolbar>\n <div mat-dialog-content style="font-size: 12px;">\n\n <table class="fh_table">\n\n <tbody>\n <tr class="odd">\n\n <td>Codice:</td>\n <td><b>{{codice}}</b></td>\n </tr>\n <tr class="even">\n\n <td>Data:</td>\n <td><b>{{data_richiesta | date: \'dd/MM/yyyy hh:mm:ss\'}}</b></td>\n </tr>\n <tr *ngIf="!hide_richiedente" class="odd">\n\n <td>Richiedente:</td>\n <td><b>{{richiedente}}</b></td>\n\n </tr>\n <tr class="even">\n\n <td>Stato:</td>\n <td><b>{{stato}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>In Carico a:</td>\n <td><b>{{in_carico_a}}</b></td>\n\n </tr>\n\n <tr class="even" *ngIf="m_appService.dev_mode">\n\n <td>Uiid App:</td>\n <td><b>{{uiid_app}}</b></td>\n\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n\n <td>Uiid Doc:</td>\n <td><b>{{uiid_doc}}</b></td>\n\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n\n <td>Grp:</td>\n <td><b>{{canale}}</b></td>\n\n </tr>\n </tbody>\n </table>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),Ye=function(){function t(t,e,i,n,o,s,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=r,this.ossv=!1,this.not_comm=!1,this.not_comm_disabled=!1,this.b_flussook=!0,this.logs=new Array,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.commenti_insert=!1,this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.load_graph=function(){var t=this,e=new Dt;e.sql="SELECT_WKF_BY_ID",e.types=["string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(e.result_data.length>0&&null!=e.result_data[0].diagramma_flusso&&""!=e.result_data[0].diagramma_flusso){for(var i=!1,n=0;n<t.logs.length;n++)-1==t.logs[n].id_comment&&(null!=t.logs[n].liv_ini&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_ini+'"').join('bpmnElement="STEP_'+t.logs[n].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),i||null!=t.logs[n].liv_fin&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_fin+'"').join('bpmnElement="STEP_'+t.logs[n].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),i=!0));return void t.modeler.importXML(e.result_data[0].diagramma_flusso,(function(e){e?t.b_flussook=!1:t.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0})}))}t.b_flussook=!1}}))},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(zt).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="LOG WORKFLOW E COMMENTI")}))},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ric_all()}),200)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var t=this,e=new Dt;e.sql="SELECT_WORKFLOW_LOG",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc];this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.logs=e.result_data;for(var i=0;i<t.logs.length;i++)t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new R({container:"#canvas",width:"97%",height:"100%",readonly:!0})),t.load_graph(),t.ossv=!0,!0}}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");1==this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Be,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}))},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(Fe,{disableClose:!0});setTimeout((function(){e.componentInstance.title="Selezione almeno un gruppo da notificare",e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new Dt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){void 0===p&&(p=!0),void 0===u&&(u="");var c=new Dt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))},t.prototype.ok_op=function(t){var e,i=this;(void 0===t&&(t=""),this.b_ins)?((e=new Dt).sql="INSERT_WKF_COMMENTO",e.types=["string","string","string","string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new At;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}}))):((e=new Dt).sql="UPDATE_WKF_COMMENTO",e.types=["string","string","string","string"],e.values=[this.nota,this.edit_id],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new At;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}})))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Mt},{type:He},{type:Ct}]},yt([e.ViewChild("zz"),St("design:type",L.MatTabGroup)],t.prototype,"zz",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div style="font-size: 12px" [style.height]="(m_appService.getState().body_h-130)+\'px\'">\n <mat-tab-group #zz style="width:100%" [style.height]="(m_appService.getState().body_h-140)+\'px\'" >\n <mat-tab label="WORKFLOW" *ngIf="b_flussook">\n\n <div [style.height]="(m_appService.getState().body_h-160)+\'px\'" >\n <div style="width:100%;height:100%" id="canvas"></div>\n </div>\n\n </mat-tab>\n\n <mat-tab label="LOGS">\n\n <div fxLayout="row" fxLayoutAlign="center end" fxFlex="90" *ngIf="!b_edit && commenti_insert">\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n INSERISCI\n </button>&nbsp;&nbsp;&nbsp;&nbsp;\n </div>\n\n\n <div fxLayout="column" *ngIf="b_edit">\n <br>\n <mat-form-field *ngIf="b_edit" appearance="outline" floatLabel="always"><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="annulla()">ANNULLA</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [disabled]="not_comm_disabled" [(ngModel)]="not_comm" [hidden]="notifica_commenti==0 || (notifica_commenti==1 && lettori==\'\')">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <br><br>\n </div>\n <table *ngIf="!b_edit" class="fh_table" style="width:90%">\n <thead>\n <tr>\n <th width="15%">Data</th>\n <th width="15%">Utente</th>\n <th>Operazione</th>\n <td></td>\n <td></td>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let app of logs;let odd=odd; let even=even;index as i" [ngClass]="{ odd: odd, even: even }">\n\n <td>{{app.data_creazione | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td>{{app.nc}}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td><mat-icon [matTooltip]="app.dest_notif" *ngIf="app.dest_notif!=null && app.dest_notif!=\'\'">mail</mat-icon></td>\n <td>\n <mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user"\n (click)="edit_comm(app)">edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n\n </mat-tab>\n\n </mat-tab-group>\n </div>\n ',styles:["\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,l.MatDialog,It,n.ToastrService,Mt,He,Ct])],t)}(),Qe=function(){function t(){this.result_data=new Array}return t=yt([e.Component({template:" "})],t)}(),We=function(){function t(t,e){this.uti=t,this.app=e}return t.prototype.read=function(t,e,i){var n=this;return void 0===e&&(e=!0),void 0===i&&(i=!0),new Promise((function(o){if(null!=localStorage.getItem(t))return e?i?void o(JSON.parse(n.uti.decrypt_v2(localStorage.getItem(t)))):void o(n.uti.decrypt_v2(localStorage.getItem(t))):i?void o(JSON.parse(""+localStorage.getItem(t))):void o(localStorage.getItem(t));o(null)}))},t.prototype.write=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0),i?n?localStorage.setItem(t,this.uti.encrypt_v2(JSON.stringify(e))):localStorage.setItem(t,this.uti.encrypt_v2(e)):n?localStorage.setItem(t,JSON.stringify(e)):localStorage.setItem(t,e)},t.prototype.delete=function(t){localStorage.removeItem(t)},t.ctorParameters=function(){return[{type:Tt},{type:It}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](Tt),e["ɵɵinject"](It))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[Tt,It])],t)}(),Xe=function(){function t(t,i,n,o,s,r,a){var l=this;this.localstore=t,this.uti_s=i,this._toast=n,this._dataService=o,this.m_appService=s,this.slimLoadingBarService=r,this.m_dialog=a,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=5e3,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.auto_height=!1,this.abilita_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.g_width="100%",this.g_height="100%",this.init_fill=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new e.EventEmitter,this.cell_edited=new e.EventEmitter,this.clicked=new e.EventEmitter,this.dclicked=new e.EventEmitter,this.columndclicked=new e.EventEmitter,this.cell_clicked=new e.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new e.EventEmitter,this.off_set=0,this.b_restored=!1,this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,defaultColDef:{resizable:!0,sortable:!0},rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return l.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"clientSide",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore",greaterThan:"Maggiore",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj=new Object)}return t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0))},t.prototype.edit_config=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),t.errorMsg=e.msg}),(function(t){}))}}))},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(Xt,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),i=!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),i||(t.errorMsg=e.msg)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}}))},t.prototype.getContextMenuItems=function(){var t=this,e=["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel",{name:"Esporta",action:function(){t.onBtExport()}}];return this.abilita_export||(e=new Array("autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel")),e},t.prototype.onBtExport=function(){var t=this,e={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(e){if(e.value){if(null==e.value)return"";if("function"==typeof e.value.getMonth)return t.uti_s.pad(e.value.getDate(),2)+"/"+t.uti_s.pad(e.value.getMonth()+1,2)+"/"+e.value.getFullYear();if(24==e.value.length&&e.value.indexOf(":00.000Z")>-1){var i=new Date(e.value);return t.uti_s.pad(i.getDate(),2)+"/"+t.uti_s.pad(i.getMonth()+1,2)+"/"+i.getFullYear()+" "+t.uti_s.pad(i.getHours(),2)+":"+t.uti_s.pad(i.getMinutes(),2)}return e.value}}};this.gridOptions.api.exportDataAsExcel(e)},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t?this.uti_s.newGuid():null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(Wt,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.autoSizeAll=function(){var t=[];this.columnDefs.forEach((function(e){t.push(e.field)})),this.gridOptions.columnApi.autoSizeColumns(t),this.save_cfg()},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&(console.log("CERCO SEL"),this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])}))),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(this.ric_libera=""),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;null!=this.columnDefs&&0!=this.columnDefs.length?this.ckk_ed||(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),this.init_fill&&setTimeout((function(){t.ref_dt()}),100)):setTimeout((function(){t.ckk()}),500)},t.prototype.res_columns=function(t){void 0===t&&(t=!1);var e=!1;if(null!=this.toggle_mantieni&&(e=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}try{this.gridOptions.api.setSortModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(t){console.log(t)}try{this.gridOptions.api.setFilterModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.setRows=function(){var t=this;console.log("m_appService ",this.m_appService),console.log("localstore ",this.localstore),console.log(this.m_appService.COMPANY_KEY+this.tbl_name),this.localstore.read(this.m_appService.COMPANY_KEY+this.tbl_name).then((function(e){t.rowData=e}))},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions?setTimeout((function(){t.ref_dt()}),500):null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.setRows()},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){if(this.setHeaderHeight(this.header_h),null==this.gf||(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")||null==localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))){var e=/iPad|iPhone|iPod/.test(navigator.userAgent);this.gridOptions.api.setGridAutoHeight(!e),this.onready_go()}},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",void this.doFill("",!0,!1);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)t[i].length>2?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onAfterFilterChanged=function(){localStorage.removeItem(this.grid_key+"_POS"),this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onFilterModified=function(){this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.ckk()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.ctorParameters=function(){return[{type:We},{type:Tt},{type:n.ToastrService},{type:Mt},{type:It},{type:d.SlimLoadingBarService},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"tbl_name",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"columnDefs",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"count_tbl_name",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"num_per_pag",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"grid_key",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sort_field",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"fields",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"filters",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"auto_height",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"abilita_export",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled_pag",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_help",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_num_elem",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"system_dest",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"header_h",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"g_width",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"g_height",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_elementi",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"trova_label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"mantieni_impostazioni",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_buttons",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fill_end",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_edited",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"clicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"dclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"columndclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_clicked",void 0),yt([e.ViewChild("gf"),St("design:type",qt)],t.prototype,"gf",void 0),yt([e.ViewChild("toggle_mantieni"),St("design:type",m.MatSlideToggle)],t.prototype,"toggle_mantieni",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"init_end",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"off_set",void 0),yt([e.ViewChild("testom",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"testom",void 0),yt([e.ViewChild("myModalNormal",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"myModalNormal",void 0),t=yt([e.Component({selector:"FHGridJSON",template:'\n <table [hidden]=\'!show_buttons\' style="height: 15%;">\n <tr>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'><h5>{{num_r + label_elementi}}</h5>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n <td style="vertical-align:\'bottom\'">&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{trova_label}}</mat-label>\n <input matInput (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera"\n style="width:200px">\n </mat-form-field>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile">&nbsp;&nbsp;&nbsp;<button\n *ngIf="show_pulisci_filtri" mat-flat-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>clear</mat-icon>&nbsp;&nbsp;REMOVE FILTER\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon>&nbsp;&nbsp;AUTO SIZE\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon>&nbsp;&nbsp;FIT SIZE\n </button>\n\n </td>\n\n </tr>\n </table>\n <div [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="!show_buttons && !this.m_appService.getState( ).mobile && show_num_elem"><h5>\n {{num_r + \' Elementi\'}}</h5></div>\n\n <ag-grid-angular ref-agGrid style="width:100%;height:85%;" (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)" [headerHeight]="header_h" [groupHeaderHeight]="header_h"\n class="ag-theme-balham" [singleClickEdit]="true" [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)" (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)" (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()" [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)">\n </ag-grid-angular>\n\n\n ',styles:["\n\n "]}),St("design:paramtypes",[We,Tt,n.ToastrService,Mt,It,d.SlimLoadingBarService,l.MatDialog])],t)}(),$e=function(){function t(){this.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.command=new e.EventEmitter}return t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.insert_doc=function(){this.command.emit({cmd:"insert_doc"})},t.prototype.annulla_imp=function(){this.command.emit({cmd:"annulla_imp"})},t.prototype.recupera_richiesta=function(){this.command.emit({cmd:"recupera_richiesta"})},t.prototype.riassegna_richiesta=function(){this.command.emit({cmd:"riassegna_richiesta"})},t.prototype.sostituisci_utente=function(){this.command.emit({cmd:"sostituisci_utente"})},t.prototype.test_utente=function(){this.command.emit({cmd:"test_utente"})},t.prototype.annulla_richiesta=function(){this.command.emit({cmd:"annulla_richiesta"})},t.prototype.new_doc=function(){this.command.emit({cmd:"new_doc"})},t.prototype.del_doc=function(){this.command.emit({cmd:"del_doc"})},yt([e.Input(),St("design:type",String)],t.prototype,"type",void 0),yt([e.Input(),St("design:type",se)],t.prototype,"toolbar_wkfapp",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"custom_commands",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"command",void 0),t=yt([e.Component({selector:"FHGridToolBar",template:'\n <div *ngIf="type==\'WKF_NO_EDIT\'" fxLayoutGap="3px" fxLayout="row" fxFlex="100" fxLayoutAlign="end center" style="background-color: #CC0000">\n\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n\n\n <button mat-flat-button color="warn" mat-button fxHide fxShow.gt-sm [matMenuTriggerFor]="gest_menu" *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin || toolbar_wkfapp?.is_PowerUser"><mat-icon>label_important</mat-icon>&nbsp;&nbsp;&nbsp;{{\'Gestione\' | translate}}</button>\n <mat-menu #gest_menu="matMenu" >\n <button mat-menu-item style="background-color: #F5F5F5" (click)="annulla_richiesta()"> {{\'ANNULLA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item style="background-color: #F5F5F5" (click)="recupera_richiesta()"> {{\'RECUPERA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item style="background-color: #F5F5F5" (click)="riassegna_richiesta()" *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"> {{\'RIASSEGNA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item style="background-color: #F5F5F5" (click)="sostituisci_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'SOSTITUISCI UTENTE\' | translate}} </button>\n\n <button mat-menu-item style="background-color: #F5F5F5" (click)="test_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'TEST UTENTE\' | translate}} </button>\n\n </mat-menu>\n <button mat-flat-button (click)="annulla_imp()" *ngIf="toolbar_wkfapp?.imp!=\'\'"> {{toolbar_wkfapp?.imp}} </button>\n <div *ngFor="let app of custom_commands" > &nbsp;&nbsp;<button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>&nbsp;{{app.label | translate}}</button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'WKF\'" fxLayoutGap="3px" fxLayout="row" fxLayoutAlign="end center" style="width: 100%;background-color: maroon">\n\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n\n <button mat-flat-button (click)="insert_doc()" *ngIf="toolbar_wkfapp?.is_Ins" color="accent"><mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\'INSERISCI\' | translate}}</button>&nbsp;&nbsp;&nbsp;\n\n <button mat-flat-button color="warn" mat-button fxHide fxShow.gt-sm [matMenuTriggerFor]="gest_menu" *ngIf="toolbar_wkfapp?.is_Supervisor">{{\'Gestione\' | translate}}</button>\n <mat-menu #gest_menu="matMenu" >\n <button mat-menu-item (click)="annulla_richiesta()"> {{\'ANNULLA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item (click)="recupera_richiesta()"> {{\'RECUPERA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item (click)="riassegna_richiesta()"> {{\'RIASSEGNA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item (click)="sostituisci_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'SOSTITUISCI UTENTE\' | translate}} </button>\n\n <button mat-menu-item (click)="test_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'TEST UTENTE\' | translate}} </button>\n\n </mat-menu>\n <button mat-flat-button (click)="annulla_imp()" *ngIf="toolbar_wkfapp?.imp!=null && toolbar_wkfapp?.imp!=\'\'"> {{toolbar_wkfapp?.imp}} </button>\n <div *ngFor="let app of custom_commands" >\n &nbsp;&nbsp;<button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>&nbsp;{{app.label | translate}}</button>\n\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'INSERT_DELETE\'" fxLayoutGap="3px" fxLayout="row">\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\'INSERISCI\' | translate}}\n </button>\n\n <button mat-flat-button (click)="del_doc()" color="warn">\n <mat-icon>delete</mat-icon>&nbsp;&nbsp;&nbsp;{{\'ELIMINA\' | translate}}\n </button>\n <div *ngFor="let app of custom_commands" ><button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>{{app.label | translate}}</button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'CUSTOM\'" fxLayoutGap="3px" fxLayout="row" fxLayoutAlign="end center">\n\n <div *ngFor="let app of custom_commands" ><button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>{{app.label | translate}}</button>\n </div>\n </div>\n\n ',styles:["\n\n "]})],t)}(),Je=function(){function t(t,e,i,n,o,s,r,a){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this.m_dialog=o,this.m_route=s,this.m_wkf=r,this.uti_s=a,this.m_obj={},this.save_alreadypressed=!1,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.oper="",this.b_edit_before=!1,this.all_c=0,this.comm_c=0,this.forza_canale="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1}return t.prototype.init_user_i=function(){this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_email},t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info={},this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento,this.app_s.getState().wkf_doc_info.canale=this.m_obj.canale},t.prototype.evt_salv=function(){this.btnprocedi=!1,this.salva()},t.prototype.salva=function(){var t=this;if(!this.save_alreadypressed)if(this.save_alreadypressed=!0,setTimeout((function(){t.save_alreadypressed=!1}),1e3),""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].livello);else{if(t=this.m_obj.stato,null!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo){this.clevel=this.livs[e];break}if(null==this.clevel)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||0!=this.livs[e].notifica||""!=this.c_canale&&""!=this.livs[e].gruppo_parallelo&&this.c_canale!=this.livs[e].gruppo_parallelo&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo)){this.clevel=this.livs[e];break}}if(this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].livello>t&&0!=t&&this.livs[e].livello!=i&&(-1==this.limite_salto_after||this.livs[e].livello<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].livello);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].gruppo_parallelo||this.c_canale==this.livs[o].gruppo_parallelo)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}if("procedi"==this.oper){if(this.clevel=this.check_n_levels(this.clevel),null==this.clevel.livelli_jump&&(this.clevel.livelli_jump=""),""!=this.clevel.livelli_jump)return console.log("selectLevel "+this.clevel.livelli_jump),void this.selectLevel(this.clevel.livelli_jump);this.calcolanextandjump()}if("respingi"==this.oper){if(null==this.clevel.livelli_down&&(this.clevel.livelli_down=""),""!=this.clevel.livelli_down)return void this.selectLevel(this.clevel.livelli_down);this.alert("Errore di configurazione pratica contattare ufficio IT [0x004]",1)}}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.selectLevel=function(t){var e=this;this.app_s.getState().wkf_doc_info.livs=this.livs,this.app_s.getState().wkf_doc_info.st=t,this.app_s.getState().wkf_doc_info.cl=this.clevel,this.m_dialog.open(Ve,{disableClose:!0}).afterClosed().subscribe((function(t){if(null!=t){var i=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){i=e.wkf_rule(i);var n=!1;for(o=0;o<e.livs.length;o++)e.user_idp.toUpperCase()==e.livs[o].idp.toUpperCase()&&0==e.livs[o].notifica&&e.livs[o].livello==i&&(e.nlevel=e.livs[o],i=e.livs[o].livello,n=!0);if(!n)for(o=0;o<e.livs.length;o++)if(e.livs[o].livello==i&&0==e.livs[o].notifica){e.nlevel=e.livs[o],i=e.livs[o].livello;break}e.doJump()}else{i=0;for(var o=0;o<e.livs.length;o++)e.livs[o].livello<900&&e.livs[o].livello>i&&0==e.livs[o].notifica&&(e.clevel=e.livs[o],i=e.livs[o].livello);e.calcolanextandjump()}else e.calcolanextandjump()}else e.edit_b(!0)}))},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello;for(var i=0;i<this.livs.length;i++)(0==t||t<this.livs[i].livello&&e>this.livs[i].livello)&&(this.nlevel=this.livs[i],e=this.livs[i].livello);t=this.wkf_rule(e);for(var n=!1,o=0;o<this.livs.length;o++)0!=this.livs[o].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[o].gruppo_parallelo||this.livs[o].livello==t&&(this.nlevel=this.livs[o],t=this.livs[o].livello,n=!0);if(!n)for(var s=0;s<this.livs.length;s++)if(this.livs[s].livello==t&&0==this.livs[s].notifica){this.nlevel=this.livs[s],t=this.livs[s].livello;break}var r=t,a=this.nlevel;if(2==this.nlevel.salto_iniziale){for(var l=0;l<this.livs.length;l++)a.idp.toUpperCase()==this.livs[l].idp.toUpperCase()&&0==this.livs[l].notifica&&a.gruppo_parallelo==this.livs[l].gruppo_parallelo&&this.livs[l].livello>r&&0!=r&&(this.nlevel=this.livs[l],t=this.livs[l].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var t=this;this.user_idp.toUpperCase();if(null!=this.nlevel){new Array;var e=new Array;if(""==this.clevel.gruppo_parallelo){console.log("senza gp ",this.clevel.gruppo_parallelo+" "+this.nlevel.livello);for(var i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&e.push(this.livs[i]);console.log("arrAutori ",e)}else{var n=!1;console.log("con gp ",this.clevel.gruppo_parallelo);for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&""!=this.livs[i].gruppo_parallelo&&(n=!0);console.log("canale: "+this.clevel.gruppo_parallelo);for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&(console.log("canale: "+this.clevel.gruppo_parallelo+" "+this.livs[i].gruppo_parallelo),this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo&&n||(e.push(this.livs[i]),this.nlevel=this.livs[i]))}if(0!=e.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title="Avanzamento";var o="";for(i=0;i<e.length;i++)null!=e[i].nc&&-1==o.indexOf(e[i].nc)&&(""!=o&&(o+=";"),o+=e[i].nc);this.app_s.getState().wkf_doc_info.utenti="",this.nlevel.livello<900?this.app_s.getState().wkf_doc_info.lbl="Il documento verrà inviato a "+this.nlevel.descri_livello:this.app_s.getState().wkf_doc_info.lbl="La richiesta verrà chiusa con stato: "+this.nlevel.descri_livello,this.app_s.getState().wkf_doc_info.utenti=o,this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali,this.m_dialog.open(ze,{disableClose:!0}).afterClosed().subscribe((function(i){if("abort"==i)return t.edit_b(!0),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e,t.nota=i,t.OKCOM()}))}else{this.app_s.getState().wkf_doc_info.title="Assegnazione",this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali,this.app_s.getState().wkf_doc_info.arrAutori=e.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}));var s=this.m_dialog.open(je,{disableClose:!0});setTimeout((function(){s.componentInstance.comm_notrequired=t.nlevel.commenti_opzionali})),s.afterClosed().subscribe((function(e){if(""==e||null==e)return t.edit_b(!0),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e.arrsel,t.nota=e.nota,t.OKCOM()}))}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)}else this.alert("problema di configurazione passaggio avanti dal livello "+this.clevel.descri_livello+" non attivato comunicare al CED",1)},t.prototype.back=function(t){var e=this;t?this.m_dialog.open(Pe,{disableClose:!0}).afterClosed().subscribe((function(t){"esci_senza_salv"==t&&e.m_router.navigate([e.app_info.modulo_swf]),"salva_esci"==t&&(e.evt_salv(),e.m_router.navigate([e.app_info.modulo_swf]))})):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.OKCOM=function(){var t=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),this.m_danotificare="",this.m_autori="";for(var e="",i=0;i<this.arrUsersSelected.length;i++)1==this.nlevel.email_partecipanti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[i].idp),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[i].idp,e+=this.arrUsersSelected[i].nc);""!=this.nota&&this.insert_commento(this.id_applicativo,this.id_documento,this.nota,this.user_idp),this.m_liv=this.nlevel.livello,this.m_statox="Assegnata a:"+e,this.m_autori_paralleli="",this.m_obj.assegnati_paralleli="",this.chstato(this.m_liv),this.m_obj.stato<=10&&(null==this.m_obj.creatore||""==this.m_obj.creatore?this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp):this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.m_obj.creatore));for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.m_liv&&1==this.livs[i].notifica&&(1==this.livs[i].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[i].idp));if(this.nlevel.livello>=900){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello);var n=new Dt;n.sql="UPDATE_DATA_CHIUSURA",n.values=[this.id_applicativo,this.id_documento],n.types=["string","string"],this.m_dataService.doQuery(n).subscribe((function(t){null!=t&&t.result_msg}))}var o,s="$$";for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==this.clevel.livello&&this.livs[i].idp==this.app_s.user){if("$$"!=s){s="$$";break}s=this.livs[i].gruppo_parallelo}o=this.app_info.documento_pubblico?new Array(this.m_autori,"",this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,s):new Array(this.m_autori,this.m_lettori,this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,s);var r=new Array;for(i=0;i<o.length;i++)r.push("string");this.m_crea_att=1,this.m_liv>=900&&(this.m_crea_att=0),this.b_respingi&&(this.m_oper="Respinta"),null!=this.clevel&&null!=this.clevel.descri_livello&&(this.m_oper=this.m_oper+" - "+this.clevel.descri_livello),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(this.m_oper=this.m_oper+" -> "+this.nlevel.descri_livello);var a=new Dt;a.sql="doWKF",a.values=[this.app_info.descrizione_breve,this.m_obj.codice,this.m_autori,this.m_danotificare,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"Il documento: "+this.m_obj.codice+" è passato allo stato: "+this.m_statox,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,this.m_statox,this.m_oper,this.id_applicativo,this.id_documento,""+this.m_crea_att,""+this.m_send_email,""+this.clevel.livello,""+this.nlevel.livello],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.clevel.livello+"_PLAYER",this.user_idp),this.m_wkf.doQuery(a).subscribe((function(t){null!=t&&t.result_msg})),(a=new Dt).sql="UPDATE_WKF_DOCUMENTOV3_NS",a.values=o,a.types=r,this.m_dataService.doQuery(a).subscribe((function(t){null!=t&&t.result_msg})),(a=new Dt).sql="exec_app_workflow",a.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp];if(this.m_wkf.doQuery(a).subscribe((function(t){})),""!=this.m_danotificare){var l="";if(""!=this.nota&&(l="<br>Commento: <br>"+this.nota),1==this.clevel.ccn_mittente&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.user_idp),1==this.nlevel.approvazione_email);else{var p=null;if(1==this.nlevel.ical&&(null==this.m_obj.ical_dt_ini?this.alert("Attenzione ical non configurato ical_dt_ini",1):null==this.m_obj.ical_dt_fin?this.alert("Attenzione ical non configurato ical_dt_fin",1):p={start:this.m_obj.ical_dt_ini,end:this.m_obj.ical_dt_fin,summary:this.app_info.descrizione_breve+" "+this.getTitle(),description:this.getDescri()+l+"<br>"+this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",organizer:this.user_nome+" "+this.user_cognome+" <"+this.user_email+">",url:this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit"}),1==this.nlevel.email_partecipanti||1==this.nlevel.email_ospiti)if(this.b_respingi)this.sendEMail_ex(this.user_idp,this.m_danotificare,"Respinta "+this.getTitle()+"-["+this.m_obj.codice+"]","<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+"<br>Commenti:"+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p);else if(null==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle()+" - "+this.getLvlDescri(String(this.m_liv),this.m_statox),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p);else if(""==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle()+" - "+this.getLvlDescri(String(this.m_liv),this.m_statox),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p);else{var u=this.nlevel.oggetto_email;for(var c in null!=this.nlevel&&null!=this.nlevel.descri_livello&&(u=u.split("%new_step%").join(this.nlevel.descri_livello)),null!=this.clevel&&null!=this.clevel.descri_livello&&(u=u.split("%old_step%").join(this.clevel.descri_livello)),u=(u=u.split("%new_step%").join("")).split("%old_step%").join(""),this.m_obj)null!=this.m_obj[c]&&(console.log(c+" "+Object.prototype.toString.call(this.m_obj[c])),u="[object Date]"===Object.prototype.toString.call(this.m_obj[c])?u.split("%"+c+"%").join(this.uti_s.date2String(this.m_obj[c])):-1==(""+this.m_obj[c]).indexOf("T00:00:00")?u.split("%"+c+"%").join(this.m_obj[c]):u.split("%"+c+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[c],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,u,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p)}else this.goto_edit_doc();if(0!=this.nlevel.tipo_notifica_aggiuntiva){if(1==this.nlevel.tipo_notifica_aggiuntiva&&this.sendEMail_ex(this.user_idp,this.m_obj.creatore,this.app_info.descrizione_breve+", Il documento numero: "+this.m_obj.codice+" è passato allo STEP: "+this.nlevel.descri_livello+" "+this.getTitle(),this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p,!1),2==this.nlevel.tipo_notifica_aggiuntiva){var d=new Dt;d.sql="SELECT_PARTECIPANTI_DOC",d.values=[this.id_applicativo,this.id_documento],d.types=["string","string"],this.m_dataService.doQuery(d).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(console.log("username:",e.result_data[n].username),i+=",",i+=e.result_data[n].username);console.log("lista_p ",i),t.sendEMail_ex(t.user_idp,i,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,p,!1)}}))}if(3==this.nlevel.tipo_notifica_aggiuntiva){var h=new Dt;h.sql="SELECT_ALL_USERS_DOC",h.values=[this.id_applicativo,this.id_documento],h.types=["string","string"],this.m_dataService.doQuery(h).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(console.log("username:",e.result_data[n].username),i+=",",i+=e.result_data[n].username);t.sendEMail_ex(t.user_idp,i,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,p,!1)}}))}}}}else this.goto_edit_doc()},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u,c){var d=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0);var h=new Dt;h.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),h.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(h).subscribe((function(t){c&&d.goto_edit_doc(p)}))},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].livello)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=new Dt;o.sql="INSERT_WKF_COMMENTO",o.values=[t,e,i,n,""],o.types=["string","string","string","string","string"],this.m_dataService.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=new Dt;o.sql="insert_wkf_variabile",o.values=[t,e,i,n],this.m_wkf.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.respingi=function(){this.oper="respingi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(t){var e=this;void 0===t&&(t=!1);var i=this.app_s.getState().body_h-40+"px",n=this.m_dialog.open(Ye,{disableClose:!0,width:"95%",height:i});setTimeout((function(){n.componentInstance.subject=e.app_info.descrizione_breve+", <OP>: "+e.m_obj.codice+" "+e.getTitle(),null!=e.m_obj.lettori?n.componentInstance.lettori=e.m_obj.lettori:n.componentInstance.lettori="",n.componentInstance.link=e.app_s.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+e.id_documento+"/edit",n.componentInstance.codice_doc=e.m_obj.codice,n.componentInstance.notifica_commenti=e.app_info.notifica_commenti,n.componentInstance.notifica_commenti_obbl=e.app_info.notifica_commenti_obbl,n.componentInstance.commenti_insert=t,n.componentInstance.init_v()})),n.afterClosed().subscribe((function(t){e.r_count()}))},t.prototype.open_commenti=function(){var t=this,e=this.m_dialog.open(Ke,{disableClose:!0,width:"90%"});setTimeout((function(){e.componentInstance.subject=t.app_info.descrizione_breve+", <OP>: "+t.m_obj.codice+" "+t.getTitle(),null!=t.m_obj.lettori?e.componentInstance.lettori=t.m_obj.lettori:e.componentInstance.lettori="",e.componentInstance.link=t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",e.componentInstance.codice_doc=t.m_obj.codice,e.componentInstance.notifica_commenti=t.app_info.notifica_commenti,e.componentInstance.notifica_commenti_obbl=t.app_info.notifica_commenti_obbl,e.componentInstance.init_v()})),e.afterClosed().subscribe((function(e){t.r_count()}))},t.prototype.open_upload=function(t){var e=this;void 0===t&&(t="");var i=this.m_dialog.open(qe,{disableClose:!0,width:"90%"});setTimeout((function(){i.componentInstance.sovrascrivi_path=t})),i.afterClosed().subscribe((function(t){e.r_count()}))},t.prototype.create_new_document=function(){var t=this,e=new Dt;e.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),e.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.save_agg()}))},t.prototype.save_agg=function(){var t=this;this.b_edit_before=this.b_edit,this.edit_b(!1);var e=this.getfieldvalues(),i=new Dt;i.sql="insert_aggiuntivi",i.types=["string","string"],i.values=[this.app_info.tabella_dati,this.id_documento],i.names=["tabella","id_documento"];for(var n=0;n<e.length;n++)i.types.push(e[n].types),i.names.push(e[n].names),null!=e[n].values?("boolean"==e[n].types&&(e[n].values?i.values.push("1"):i.values.push("0")),"int"==e[n].types&&(isNaN(e[n].values)?i.values.push("0"):i.values.push(""+e[n].values)),"string"==e[n].types&&i.values.push(""+e[n].values),"date"==e[n].types&&i.values.push(this.uti_s.sql_date(e[n].values)),"datetime"==e[n].types&&i.values.push(this.uti_s.sql_date_time(e[n].values)),"decimal"==e[n].types&&(isNaN(e[n].values)?i.values.push("0"):i.values.push(""+e[n].values))):i.values.push("dbnull");this.m_wkf.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_insert_aggiuntivi()}),(function(t){}))},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.edit_b(this.b_edit_before),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var t=this;console.log("load_document()");var e=new Dt;e.sql="SELECT_WKF_DOCUMENT_NOREP",e.types=["string","string","string"],e.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0?t.ok_load_document(i[0]):t.alert("DOCUMENTO NON TROVATO",1)}}),(function(t){}))},t.prototype.ok_load_document=function(t){var e=this;this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1),this.save_to_app_state();var i=new Dt;i.sql="SELECT_LIVELLI_DOC",i.types=["string","string"],i.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ok_livelli_doc(t.result_data)}),(function(t){}))},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.over_canale_iniz(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].idp.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||10==this.livs[e].livello&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var t=this,e=new Dt;e.sql="SELECT_WKF_ALLEGATI_COUNTER",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,n=0,o=0,s=0;s<i.length;s++)i[s].n>0&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));t.reset_counters_int(o,n)}}),(function(t){}))},t.prototype.reset_counters_int=function(t,e){t>0&&(this.comm_c=t),e>0&&(this.all_c=e)},t.prototype.set_canale_iniziale=function(t){this.forza_canale=t},t.prototype.over_canale_iniz=function(){if(""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale);this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale),this.c_canale=this.forza_canale}},t.prototype.ck_canale_multiplo=function(){for(var t=this,e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&0==this.livs[i].notifica&&(this.clevel=this.livs[i],e=this.livs[i].livello);var n=[];for(i=0;i<this.livs.length;i++)this.livs[i].livello==e&&0==this.livs[i].notifica&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].idp.toUpperCase()&&(null!=this.livs[i].gruppo_parallelo?n.push(this.livs[i].gruppo_parallelo):n.push(""));n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort((function(t,e){return t>e?1:t<e?-1:0})),this.m_dialog.open(Ue,{disableClose:!0}).afterClosed().subscribe((function(e){t.c_canale=e,t.create_new_document()})))},t.prototype.open_info=function(){var t=this,e=this.m_dialog.open(Ge,{disableClose:!0});setTimeout((function(){e.componentInstance.hide_richiedente=t.hide_richiedente})),e.afterClosed().subscribe((function(t){}))},t.prototype.setForceJump=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=!0);for(var o,s="",r="",a="",l="",p="",u=0;u<this.livs.length;u++)t!=this.livs[u].livello||""!=e&&!this.livs[u].canale||(1==this.livs[u].email_ospiti&&1==this.livs[u].notifica||1==this.livs[u].email_partecipanti&&0==this.livs[u].notifica)&&(""!=r&&(r+=","),r+=this.livs[u].idp),t!=this.livs[u].livello||0!=this.livs[u].notifica||""!=e&&!this.livs[u].canale||(""!=s&&(s+=","),s+=this.livs[u].idp,""!=l&&(l+=","),l+=this.livs[u].nc,p=this.livs[u].descri_livello,null!=this.livs[u].oggetto_email&&""!=this.livs[u].oggetto_email&&(a=this.livs[u].oggetto_email));if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;o=this.app_info.documento_pubblico?[s,"",t,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"Assegnata a:"+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e]:[s,this.m_obj.partecipanti+","+s,t,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"Assegnata a:"+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e];var c=[];for(u=0;u<o.length;u++)c.push("string");var d=new Dt;return d.sql="exec_app_workflow",d.values=[this.app_info.codice_documento,this.id_documento,""+this.m_obj.stato,""+t,this.user_idp],this.m_wkf.doQuery(d).subscribe((function(t){})),(d=new Dt).sql="UPDATE_WKF_DOCUMENTOV3_NS",d.values=o,d.types=c,this.m_dataService.doQuery(d).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var o=new Dt;o.sql="doWKF",o.values=[n.app_info.descrizione_breve,n.m_obj.codice,""+t,""+t,n.m_obj.codice+" - "+n.getTitle(),n.getTitle()+"La scheda numero: "+n.m_obj.codice+" è passata allo stato: "+p,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit","In approvazione",n.getDescri(),n.user_idp,p,"",n.id_applicativo,n.id_documento,"1","0",""+n.m_obj.stato,""+t],n.insert_wkf_variabile(n.id_applicativo,n.id_documento,n.m_obj.stato+"_PLAYER",n.user_idp);n.m_wkf.doQuery(o).subscribe((function(t){if(null!=t&&"OK"==t.result_msg)if(i&&""!=r){var e=a;for(var o in n.m_obj)null!=n.m_obj[o]&&(console.log(o+" "+Object.prototype.toString.call(n.m_obj[o])),e="[object Date]"===Object.prototype.toString.call(n.m_obj[o])?e.split("%"+o+"%").join(n.uti_s.date2String(n.m_obj[o])):-1==(""+n.m_obj[o]).indexOf("T00:00:00")?e.split("%"+o+"%").join(n.m_obj[o]):e.split("%"+o+"%").join(n.uti_s.date2String(n.uti_s.string2date(n.m_obj[o],2))));""==e?n.sendEMail_ex(n.user_idp,r,n.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+n.m_obj.codice+" "+n.getTitle()+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,""):n.sendEMail_ex(n.user_idp,r,e+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,"")}else n.goto_edit_doc()})),!0}n.alert(e.msg,1)}),(function(t){})),"OK"},t.prototype.insert_doc=function(){var t=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.uti_s.set_home_title(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_counters_int(0,0);var e=new Dt;e.sql="SELECT_WLIVELLIV2",e.types=["string","string"],e.values=[this.id_applicativo,""];this.m_dataService.doQuery(e).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(console.log(e.result_data),t.ok_livw2(e.result_data),i=!0),i||(t.errorMsg=e.msg)}),(function(t){})),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&(e=this.livs[i].livello);console.log("min_liv ",e);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(console.log("this.user_idp.toUpperCase() ",this.user_idp.toUpperCase()),console.log("this.livs[i].idp.toUpperCase() ",this.livs[i].idp.toUpperCase()),this.user_idp.toUpperCase()==this.livs[i].idp.toUpperCase()||"*ALLUSERS"==this.livs[i].gruppo_parallelo)){1==this.livs[i].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1,this.edit_b(!0);break}},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){for(var t=0;t<this.livs.length;t++)if(this.livs[t].livello==this.m_obj.stato){1==this.livs[t].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}null==this.m_obj.autori&&(this.m_obj.autori=""),console.log("return_edit-> ",","+this.m_obj.autori.toLowerCase()+",",","+this.user_idp.toLowerCase()+",",(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")),-1!=(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")&&(this.edit_b(!0),this.respingi_enabled&&this.resp_b(!0)),this.r_count();var e=this.m_obj.autori.split(",");for(t=0;t<e.length;t++)for(var i=0;i<this.livs.length;i++)if(this.livs[i].idp==e[t]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[i].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.uti_s.set_home_title(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato),this.reset_form(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato)},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.user_idp?this.m_route.params.subscribe((function(e){t.onResize();var i=e.op;if(t.id_applicativo=e.idapp,t.id_documento=e.id_doc,t.b_edit="new"!=i,t.b_edit||t.id_applicativo.indexOf("_")>-1&&(t.simple_mode=!0,t.id_applicativo=t.id_applicativo.split("_").join("")),t.b_valid=!!t.id_applicativo,t.b_valid){var n=new Dt;n.sql="SELECT_WKF_APP_INFO_BYUID",n.types=["string"],n.values=[t.id_applicativo];t.m_dataService.doQuery(n).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(e.result_data.length>0?(t.setta_info_app(e.result_data[0]),t.b_edit?t.edit_doc():t.insert_doc()):t.alert("CODICE APPLICAZIONE NON VALIDO",2),i=!0),i||t.alert(e.msg,2)}),(function(t){}))}else t.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)})):setTimeout((function(){t.init_user_i(),t.init_engine()}),100)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init_engine()}))},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].livello)return""!=this.livs[i].livello?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].idp.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},yt([e.HostListener("window:resize",["event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onResize",null),t}(),Ze=function(){function t(t){this.m_appService=t,this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1,this.procedi_button=!0}return t.prototype.back=function(){null!=this.dt_agg&&this.dt_agg.back(this.edit_button)},t.prototype.evt_salv=function(){null!=this.dt_agg&&this.dt_agg.evt_salv()},t.prototype.respingi=function(){null!=this.dt_agg&&this.dt_agg.respingi()},t.prototype.procedi=function(){null!=this.dt_agg&&this.dt_agg.procedi()},t.prototype.open_info=function(){null!=this.dt_agg&&this.dt_agg.open_info()},t.prototype.open_commenti=function(){null!=this.dt_agg&&this.dt_agg.open_commenti()},t.prototype.open_upload=function(){null!=this.dt_agg&&this.dt_agg.open_upload()},t.prototype.open_wkf=function(){null!=this.dt_agg&&this.dt_agg.open_wkf()},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:It}]},yt([e.Input(),St("design:type",Je)],t.prototype,"dt_agg",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"edit_button",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"respingi_button",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"procedi_button",void 0),t=yt([e.Component({selector:"wkf_header_bar",template:'\n\n <div fxLayout="row" fxLayout.lt-md="column">\n<div fxLayout="row" fxLayoutGap="3px" *ngIf="!m_appService.getState().pageFullscreen || edit_button || respingi_button">\n<button mat-flat-button (click)="back()" *ngIf="!m_appService.getState().pageFullscreen">Indietro</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="evt_salv()" *ngIf="edit_button && !m_appService.getState().pageFullscreen" color="primary" >Salva</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="procedi()" *ngIf="edit_button && procedi_button" color="accent" >Procedi</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="respingi()" *ngIf="respingi_button" color="warn" >Respingi</button>\n\x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button>&nbsp;&nbsp;\n--\x3e\n</div>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="16px" fxLayoutGap.xs="3px">\n <div fxLayout="row" >\n<button mat-flat-button (click)="open_info()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>info_outline</mat-icon>&nbsp;&nbsp;Info Doc</button>&nbsp;&nbsp;\n<button mat-flat-button [color]="(dt_agg?.comm_c?dt_agg?.comm_c:0>0)?\'accent\':\'\'" [matBadge]="dt_agg?.comm_c?dt_agg?.comm_c:0" matBadgePosition="before" matBadgeColor="primary" (click)="open_commenti()"> <mat-icon>insert_comment</mat-icon>Commenti</button>&nbsp;&nbsp;</div> <div fxLayout="row">\n<button mat-flat-button [color]="(dt_agg?.all_c?dt_agg?.all_c:0>0)?\'accent\':\'\'" [matBadge]="dt_agg?.all_c?dt_agg?.all_c:0" matBadgePosition="before" matBadgeColor="primary" (click)="open_upload()"> <mat-icon>attach_file</mat-icon>Allegati</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="open_wkf()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>transfer_within_a_station</mat-icon>Workflow</button></div>\n</div>\n </div>\n '}),St("design:paramtypes",[It])],t)}(),ti=function(){function t(t,i,n){this.fhutility=t,this._dialog=i,this.dragula=n,this.change=new e.EventEmitter,this.items=[],this.edit_obj=null,this.radio_values=""}return t.prototype.add_component=function(t){1==t&&this.items.push({type:"text_field",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),2==t&&this.items.push({type:"numeric_field",label:"Label",default_value:0,decimali:2,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),3==t&&this.items.push({type:"textarea",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),4==t&&this.items.push({type:"checkbox",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),5==t&&this.items.push({type:"radiobutton",label:"Label",default_value:"",opts:["Option1","Option2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),6==t&&this.items.push({type:"select",label:"Label",default_value:"",opts:["","Value1","Value2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),7==t&&this.items.push({type:"date_field",label:"Label",default_value:null,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),this.change.emit(),this.edit_obj=null},t.prototype.setStyles=function(t){return null!=this.edit_obj&&this.edit_obj.uiid==t?{width:"90%",padding:"15px",margin:"15px",border:"3px solid #3db3cd","background-color":"#C2CACB"}:{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ok_panel=function(){this.change.emit(),this.edit_obj=null},t.prototype.edit_item=function(t){for(var e=0;e<this.items.length;e++)this.items[e].uiid==t&&(this.edit_obj=this.items[e],"radiobutton"!=this.edit_obj.type&&"select"!=this.edit_obj.type||null!=this.edit_obj.opts&&(this.radio_values=this.edit_obj.opts.join(",")))},t.prototype.del_item=function(t){var e=this,i=this._dialog.open(zt,{disableClose:!0});setTimeout((function(){i.componentInstance.title="Confirm",i.componentInstance.msg="Remove Element?"})),i.afterClosed().subscribe((function(i){if(i)for(var n=0;n<e.items.length;n++)e.items[n].uiid==t&&(e.items.splice(n,1),e.change.emit(),e.edit_obj=null)}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){try{t.dragula.createGroup("bag-items",{revertOnSpill:!0})}catch(t){console.log(t)}t.dragula.drag.call((function(e){t.change.emit(),t.edit_obj=null})),t.dragula.drop.call((function(e){t.change.emit(),t.edit_obj=null}))}))},t.ctorParameters=function(){return[{type:Tt},{type:l.MatDialog},{type:q.DragulaService}]},yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.ViewChild("bottoml"),St("design:type",e.ElementRef)],t.prototype,"bottoml",void 0),t=yt([e.Component({selector:"FHFormBuilder",template:'\n <div fxLayout="row" style="width: 100%;height:100%">\n <mat-toolbar color="primary" style="max-width: 200px;height:100%;" >\n <mat-toolbar-row (click)="add_component(1)">\n <mat-icon>text_fields</mat-icon>&nbsp;&nbsp;&nbsp;<span>Text Field</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(2)">\n <mat-icon>filter_1</mat-icon>&nbsp;&nbsp;&nbsp;<span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon>&nbsp;&nbsp;&nbsp;<span>Text Area</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(4)">\n <mat-icon>check_box</mat-icon>&nbsp;&nbsp;&nbsp;<span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon>&nbsp;&nbsp;&nbsp;<span>Radio</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon>&nbsp;&nbsp;&nbsp;<span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon>&nbsp;&nbsp;&nbsp;<span>Date</span>\n </mat-toolbar-row>\n\n </mat-toolbar>\n <div fxLayout="column" fxFlex="100" style="width:100%;border:1px solid #004040;height:100%;overflow:auto;background-color: #a6aec4">\n <div fxLayout="row" style="width:90%;width:100%;height:5000px;">\n\n <ul [dragula]=\'"bag-items"\' [(dragulaModel)]=\'items\' style="width:100%;">\n <li fxLayout="row" *ngFor="let item of items" [ngStyle]="setStyles(item.uiid)" fxLayoutAlign="start center">\n <div style="width:100%">\n\n <div style="width: 90%">\n <mat-form-field *ngIf="item.type==\'text_field\'" style="max-width: 350px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" type="text" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n <mat-form-field *ngIf="item.type==\'numeric_field\'" style="max-width: 220px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" type="number" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n <FHRichText *ngIf="item.type==\'textarea\'" [label]="item.label" [required]="item.required" [(ngModel)]="item.default_value" height="15\'" enabled="false"></FHRichText>\n\n <mat-checkbox *ngIf="item.type==\'checkbox\'" [required]="item.required" [(ngModel)]="item.default_value"><b>{{item.label}}</b></mat-checkbox>\n\n\n <section class="custom-section" *ngIf="item.type==\'radiobutton\'" >\n <label class="custom-margin">{{item.label}}:</label>\n <mat-radio-group [(ngModel)]="item.default_value" [required]="item.required" >\n <mat-radio-button *ngFor="let opt of item.opts" class="custom-margin" value="{{opt}}"><b>{{opt}}</b></mat-radio-button>\n </mat-radio-group>\n </section>\n\n <mat-form-field *ngIf="item.type==\'select\'" style="max-width: 400px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <mat-select [required]="item.required" [(ngModel)]="item.default_value">\n <mat-option *ngFor="let opt of item.opts" value="{{opt}}">{{opt}}</mat-option>\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type==\'date_field\'">\n <FHDatePicker [required]="item.required" [(ngModel)]="item.default_value" [label]="item.label" ></FHDatePicker>&nbsp;&nbsp;\n </div>\n\n </div></div>\n <div fxLayout="column" style="width:70px" fxLayoutGap="10px">\n <button mat-flat-button (click)="edit_item(item.uiid)" color="primary"><mat-icon>edit</mat-icon></button>\n <button mat-flat-button (click)="del_item(item.uiid)" color="warn"><mat-icon>delete</mat-icon></button>\n </div>\n </li>\n </ul>\n\n\n </div>\n <mat-form-field [hidden]="true">\n <input matInput #bottoml>\n </mat-form-field>\n </div>\n\n <div style="width:400px;height:100%;background-color: #3F51B5" fxLayoutAlign="start center" fxLayout="column" *ngIf="edit_obj!=null">\n <br><br>\n <mat-card style="width: 96%">\n <mat-card-title>Properties</mat-card-title>\n <mat-card-content>\n <div fxLayout="column">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Label</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.label">\n </mat-form-field>\n <mat-checkbox [(ngModel)]="edit_obj.required">Required</mat-checkbox>\n\n <mat-form-field *ngIf="edit_obj.type==\'numeric_field_tobe\'" appearance="outline" floatLabel="always"><mat-label>Decimal Places</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.decimali">\n </mat-form-field>\n <mat-form-field *ngIf="edit_obj.type==\'text_field\'" appearance="outline" floatLabel="always"><mat-label>Default Value</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.default_value" >\n </mat-form-field>\n\n\n <mat-checkbox *ngIf="edit_obj.type==\'checkbox\'" [(ngModel)]="edit_obj.default_value">Default Value</mat-checkbox>\n\n <mat-form-field *ngIf="edit_obj.type==\'radiobutton\' || edit_obj.type==\'select\'" appearance="outline" floatLabel="always"><mat-label>Values</mat-label>\n <input matInput type="text" [(ngModel)]="radio_values" (ngModelChange)="edit_obj.opts=$event.split(\',\');" >\n </mat-form-field>\n <mat-form-field *ngIf="edit_obj.type==\'radiobutton\' || edit_obj.type==\'select\'" appearance="outline" floatLabel="always"><mat-label>Default Value</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.default_value" >\n </mat-form-field>\n\n <button mat-flat-button (click)="ok_panel()" color="primary">OK</button>\n </div></mat-card-content>\n </mat-card>\n </div>\n </div>\n ',styles:["\n\n "]}),St("design:paramtypes",[Tt,l.MatDialog,q.DragulaService])],t)}(),ei=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.toastr=i,this.items=null,this.enabled=!0}return t.prototype.ck_field_custom=function(){for(var t=0;t<this.items.length;t++)if(this.items[t].required&&(null==this.items[t].default_value&&(this.items[t].default_value=""),""==(""+this.items[t].default_value).trim()))return this.toastr.error("Compilare il campo: "+this.items[t].label),!1;return!0},t.prototype.add_component=function(t){this.items.push(t)},t.prototype.setStyles=function(t){return{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:Tt},{type:l.MatDialog},{type:n.ToastrService}]},yt([e.Input(),St("design:type",Array)],t.prototype,"items",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.ViewChild("bottoml"),St("design:type",e.ElementRef)],t.prototype,"bottoml",void 0),t=yt([e.Component({selector:"FHFormExecuter",template:'\n\n <div fxLayout="column" fxFlex="100" style="width:100%;border:1px solid #004040;height:100%" *ngIf="items!=null">\n\n\n <div fxLayout="row" *ngFor="let item of items" [ngStyle]="setStyles(item.uiid)" fxLayoutAlign="start center">\n\n <div style="width: 90%">\n <mat-form-field *ngIf="item.type==\'text_field\'" style="max-width: 350px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" [disabled]="!enabled" type="text" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n\n <mat-form-field *ngIf="item.type==\'numeric_field\'" style="max-width: 220px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" [disabled]="!enabled" type="number" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n <FHRichText *ngIf="item.type==\'textarea\'" [label]="item.label" [required]="item.required" [(ngModel)]="item.default_value" height="15\'" enabled="false"></FHRichText>\n\n <mat-checkbox *ngIf="item.type==\'checkbox\'" [required]="item.required" [disabled]="!enabled" [(ngModel)]="item.default_value"><b>{{item.label}}</b></mat-checkbox>\n\n\n <section *ngIf="item.type==\'radiobutton\'" >\n <label *ngIf="!item.required">{{item.label}}: </label>&nbsp;\n <label *ngIf="item.required">{{item.label}}: *</label>&nbsp;\n <mat-radio-group [(ngModel)]="item.default_value" [required]="item.required" >\n <mat-radio-button *ngFor="let opt of item.opts" [disabled]="!enabled" class="custom-margin" value="{{opt}}"><b>{{opt}}</b>&nbsp;&nbsp;&nbsp;&nbsp;</mat-radio-button>\n </mat-radio-group>\n </section>\n\n <mat-form-field *ngIf="item.type==\'select\'" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <mat-select [required]="item.required" [(ngModel)]="item.default_value">\n <mat-option *ngFor="let opt of item.opts" [disabled]="!enabled" value="{{opt}}">{{opt}}</mat-option>\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type==\'date_field\'">\n <FHDatePicker [required]="item.required" [disabled]="!enabled" [(ngModel)]="item.default_value" [label]="item.label" ></FHDatePicker>&nbsp;&nbsp;\n </div>\n\n </div>\n\n </div>\n\n\n <mat-form-field [hidden]="true">\n <input matInput #bottoml>\n </mat-form-field>\n </div>\n\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Tt,l.MatDialog,n.ToastrService])],t)}(),ii=function(){function t(t){this.dialogRef=t,this.title="",this.button_config=[]}return t.prototype.ngAfterViewInit=function(){},t.prototype.open=function(t){this.dialogRef.close(t)},t.prototype.close=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"button_config",void 0),t=yt([e.Component({selector:"app-win_ask_buttons",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="font-size: 12px;">\n <div fxLayout="row" fxLayoutAlign="center center">\n <button mat-flat-button style="font-size: 18px;color:#FFFFFF;" *ngFor="let app of button_config" (click)="open(app)" [style.background-color]="app.color">{{app.label}}\n </button>&nbsp;&nbsp;&nbsp;\n </div>\n </mat-dialog-content>\n <br><br>\n <div style="width:100%;text-align:center;">\n\n <button mat-flat-button color="accent" (click)="close()">CHIUDI</button>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef])],t)}(),ni=function(){function t(t){this.dialogRef=t,this.imageIndex=0,this.images=[]}return t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef}]},t=yt([e.Component({template:'\n\n\n \x3c!-- <ngx-image-viewer [src]="images" [(index)]="imageIndex"></ngx-image-viewer>--\x3e\n\n <mat-dialog-actions>\n <button mat-flat-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n </mat-dialog-actions>\n ',styles:["\n\n "]}),St("design:paramtypes",[l.MatDialogRef])],t)}(),oi=function(t,e){this.name=t,this.imageIndex=e},si={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!1,allowFullscreen:!0,allowKeyboardNavigation:!0,btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0},btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"}},ri=function(){function t(t,i){this.moduleConfig=t,this.sanitizer=i,this.index=0,this.preview=!1,this.indexChange=new e.EventEmitter,this.configChange=new e.EventEmitter,this.customEvent=new e.EventEmitter,this.style={transform:"",msTransform:"",oTransform:"",webkitTransform:""},this.fullscreen=!1,this.loading=!0,this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.hovered=!1,this.notfullScreenEvent=new e.EventEmitter,this.fullScreenEvent=new e.EventEmitter}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e=t.mergeConfig(si,t.moduleConfig);t.config=t.mergeConfig(e,t.config),t.triggerConfigBinding()}))},t.prototype.nextImage=function(t){console.log("this.src.length ",this.src.length),this.index<this.src.length-1&&(this.loading=!0,this.index++,this.triggerIndexBinding(),this.reset())},t.prototype.prevImage=function(t){this.index>0&&(this.loading=!0,this.index--,this.triggerIndexBinding(),this.reset())},t.prototype.zoomIn=function(){this.scale*=1+this.config.zoomFactor,this.updateStyle()},t.prototype.zoomOut=function(){this.scale>this.config.zoomFactor&&(this.scale/=1+this.config.zoomFactor),this.updateStyle()},t.prototype.scrollZoom=function(t){if(this.config.wheelZoom)return t.deltaY>0?this.zoomOut():this.zoomIn(),!1},t.prototype.rotateClockwise=function(){this.rotation+=90,this.updateStyle()},t.prototype.rotateCounterClockwise=function(){this.rotation-=90,this.updateStyle()},t.prototype.onLoad=function(){this.loading=!1},t.prototype.onLoadStart=function(){this.loading=!0},t.prototype.onDragOver=function(t){this.translateX+=t.clientX-this.prevX,this.translateY+=t.clientY-this.prevY,this.prevX=t.clientX,this.prevY=t.clientY,this.updateStyle()},t.prototype.onDragStart=function(t){t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(t.target.nextElementSibling,0,0),this.prevX=t.clientX,this.prevY=t.clientY},t.prototype.toggleFullscreen=function(){this.fullscreen=!this.fullscreen,this.fullscreen?this.fullScreenEvent.emit():this.notfullScreenEvent.emit(),this.fullscreen||this.reset()},t.prototype.triggerIndexBinding=function(){this.indexChange.emit(this.index)},t.prototype.triggerConfigBinding=function(){this.configChange.next(this.config)},t.prototype.fireCustomEvent=function(t,e){this.customEvent.emit(new oi(t,e))},t.prototype.reset=function(){this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.updateStyle()},t.prototype.canNavigate=function(t){return null==t||this.config.allowKeyboardNavigation&&this.hovered},t.prototype.updateStyle=function(){this.style.transform="translate("+this.translateX+"px, "+this.translateY+"px) rotate("+this.rotation+"deg) scale("+this.scale+")",this.style.msTransform=this.style.transform,this.style.webkitTransform=this.style.transform,this.style.oTransform=this.style.transform},t.prototype.mergeConfig=function(t,e){var i=vt({},t);return e&&(i=vt(vt({},t),e),e.btnIcons&&(i.btnIcons=vt(vt({},t.btnIcons),e.btnIcons))),i},t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:["config"]}]},{type:B.DomSanitizer}]},yt([e.Input(),St("design:type",Array)],t.prototype,"src",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"index",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"preview",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"config",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"indexChange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"configChange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"customEvent",void 0),yt([e.ViewChild("imgx"),St("design:type",e.ElementRef)],t.prototype,"imgx",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"notfullScreenEvent",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fullScreenEvent",void 0),yt([e.HostListener("window:keyup.ArrowRight",["$event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"nextImage",null),yt([e.HostListener("window:keyup.ArrowLeft",["$event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"prevImage",null),t=yt([e.Component({selector:"image-viewer",template:'<div #imgx class="img-container" [style.backgroundColor]="config.containerBackgroundColor"\n (wheel)="scrollZoom($event)" (dragover)="onDragOver($event)" *ngIf="src!=null">\n <img [src]="src[index]" [style.transform]="style.transform | safe:\'style\'" [style.msTransform]="style.transform| safe:\'style\'" style="min-height: 280px" [style.webkitTransform]="style.transform| safe:\'style\'" [style.oTransform]="style.transform| safe:\'style\'" alt="Image not found..." (dragstart)="onDragStart($event)" (load)="onLoad()" (loadstart)="onLoadStart()"/>\n \x3c!-- Div below will be used to hide the \'ghost\' image when dragging --\x3e\n <div></div>\n <div class="spinner-container" *ngIf="loading">\n <div class="spinner"></div>\n </div>\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.rotateCounterClockwise && !preview" (click)="rotateCounterClockwise()">\n <span [class]="config.btnIcons.rotateCounterClockwise"></span>\n </button>\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.rotateClockwise && !preview" (click)="rotateClockwise()">\n <span [class]="config.btnIcons.rotateClockwise"></span>\n </button>\n\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.zoomOut && !preview" (click)="zoomOut()">\n <span [class]="config.btnIcons.zoomOut"></span>\n </button>\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.zoomIn && !preview" (click)="zoomIn()">\n <span [class]="config.btnIcons.zoomIn"></span>\n </button>\n\n\n <button type="button" id="ngx-fs-btn" [class]="config.btnClass" (click)="toggleFullscreen()" *ngIf="config.allowFullscreen">\n <span [class]="config.btnIcons.fullscreen"></span>\n </button>\n\n <div class="nav-button-container" *ngIf="src?.length > 1">\n <button type="button" [class]="config.btnClass" (click)="prevImage($event)" [disabled]="index === 0">\n <span [class]="config.btnIcons.prev"></span>\n </button>\n <button type="button" [class]="config.btnClass" (click)="nextImage($event)" [disabled]="index === src?.length - 1">\n <span [class]="config.btnIcons.next"></span>\n </button>\n </div>\n</div>\n',styles:[".img-container{height:100%;width:100%;overflow:hidden;position:relative}.img-container img{z-index:2;margin:0 auto;display:block;max-width:100%;max-height:100%}.img-container button{z-index:99;position:absolute;right:15px}.img-container button:not(:disabled){cursor:pointer}.img-container>button:nth-of-type(1):not(#ngx-fs-btn){bottom:15px}.img-container>button:nth-of-type(2):not(#ngx-fs-btn){bottom:65px}.img-container>button:nth-of-type(3):not(#ngx-fs-btn){bottom:115px}.img-container>button:nth-of-type(4):not(#ngx-fs-btn){bottom:165px}.img-container>button:nth-of-type(5):not(#ngx-fs-btn){bottom:215px}.img-container>button:nth-of-type(6):not(#ngx-fs-btn){bottom:265px}.img-container>button:nth-of-type(7):not(#ngx-fs-btn){bottom:315px}#ngx-fs-btn{top:15px}button.default{height:40px;width:40px;border:1px solid #555;border-radius:50%;background-color:#fff;opacity:.7;-webkit-transition:opacity .2s;transition:opacity .2s}button.default:hover{opacity:1}button.default:disabled{opacity:.25}.nav-button-container>button{position:relative;right:0;margin:0 10px}.nav-button-container{text-align:center;position:absolute;z-index:98;bottom:10px;left:0;right:0}.spinner-container{position:absolute;left:0;right:0;top:0;bottom:0;width:60px;height:60px;margin:auto;padding:10px;background-color:rgba(0,0,0,.4);border-radius:25%}.spinner{border-width:7px;border-style:solid;border-color:#ccc #ccc #222;border-radius:50%;height:100%;width:100%;box-sizing:border-box;-webkit-animation:2s linear infinite rotation;animation:2s linear infinite rotation}@keyframes rotation{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(359deg)}}@-webkit-keyframes rotation{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(359deg)}}"]}),bt(0,e.Optional()),bt(0,e.Inject("config")),St("design:paramtypes",[Object,B.DomSanitizer])],t)}(),ai=function(){function t(){this._preview=!1,this._preview_c=!1,this.m_preview=!1,this.m_init=!1,this.config={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!1,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!1,zoomOut:!1,rotateClockwise:!1,rotateCounterClockwise:!1,next:!1,prev:!1}},this.notfullScreenEvent=new e.EventEmitter,this.fullScreenEvent=new e.EventEmitter,this._u=null,this.already_open=!1,this.config_photo_big={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!0,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0}}}return t.prototype.toggle_up=function(){this.m_preview=!1,this.photo_c.src=[],this.photo_c.src.push(this._u.image_original[0]),this.config=this.config_photo_big,this.already_open=!0},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init()}))},t.prototype.openFullscreen=function(){console.log("cc",this.photo_c.imgx),this.elem=this.photo_c.imgx.nativeElement,console.log("openFullscreen ",this.elem),this.elem.requestFullscreen?(console.log("requestFullscreen"),this.elem.requestFullscreen()):this.elem.mozRequestFullScreen?(console.log("mozRequestFullScreen"),this.elem.mozRequestFullScreen()):this.elem.webkitRequestFullscreen?(console.log("webkitRequestFullscreen"),this.elem.webkitRequestFullscreen()):this.elem.msRequestFullscreen?(console.log("msRequestFullscreen"),this.elem.msRequestFullscreen()):console.log("no full!")},t.prototype.closeFullscreen=function(){try{this.elem="undefined"!=typeof window&&void 0!==window.document?window.document:{},console.log("closeFullscreen ",this.elem),this.elem.exitFullscreen?(console.log("exitFullscreen"),this.elem.exitFullscreen()):this.elem.mozCancelFullScreen?(console.log("mozCancelFullScreen"),this.elem.mozCancelFullScreen()):this.elem.webkitExitFullscreen?(console.log("webkitExitFullscreen"),this.elem.webkitExitFullscreen()):this.elem.webkitCancelFullScreen?(console.log("webkitExitFullscreen"),this.elem.webkitCancelFullScreen()):this.elem.msExitFullscreen?(console.log("msExitFullscreen"),this.elem.msExitFullscreen()):console.log("no exit!")}catch(t){this.openFullscreen()}},t.prototype.raise_fullScreenEvent=function(){this.fullScreenEvent.emit(),this.openFullscreen(),null!=this._u&&null!=this._u.image_thumbnail&&this._u.image_thumbnail.length>0&&this.m_preview&&this.toggle_up()},t.prototype.handleEvent=function(t){},Object.defineProperty(t.prototype,"preview",{get:function(){return this._preview},set:function(t){this._preview=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this._u},set:function(t){this._u=t,this.init()},enumerable:!0,configurable:!0}),t.prototype.init=function(){this._preview_c=!1,null!=this._u&&null!=this._u.image_thumbnail&&(null==this._u.image_original&&(this._u.image_original=this._u.image_thumbnail),this._u.image_thumbnail.length>0&&(this._u.image_thumbnail[0]!=this._u.image_original[0]&&(this._preview_c=!0),this.m_init=!0,this.m_preview=this._preview_c))},yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"notfullScreenEvent",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fullScreenEvent",void 0),yt([e.ViewChild("photo_c"),St("design:type",ri)],t.prototype,"photo_c",void 0),yt([e.Input(),St("design:type",Boolean),St("design:paramtypes",[Boolean])],t.prototype,"preview",null),yt([e.Input(),St("design:type",Object),St("design:paramtypes",[Object])],t.prototype,"u",null),t=yt([e.Component({selector:"fh-image-viewer",template:'\n\n <image-viewer [hidden]="!m_init" (init)="init()" [preview]="m_preview" (notfullScreenEvent)="closeFullscreen()" (fullScreenEvent)="raise_fullScreenEvent()" [config]="config_photo_big" #photo_c [src]="_u?.image_thumbnail" index="0"></image-viewer>\n\n',styles:["\n\n "]})],t)}(),li=function(){function t(t){this.sanitizer=t}return t.prototype.transform=function(t,e){switch(e){case"html":return this.sanitizer.bypassSecurityTrustHtml(t);case"style":return this.sanitizer.bypassSecurityTrustStyle(t);case"script":return this.sanitizer.bypassSecurityTrustScript(t);case"url":return this.sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error("Invalid safe type specified: "+e)}},t.ctorParameters=function(){return[{type:B.DomSanitizer}]},t=yt([e.Pipe({name:"safe"}),St("design:paramtypes",[B.DomSanitizer])],t)}(),pi={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return ui})),multi:!0},ui=function(){function t(t){this.m_dialog=t,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.only_in_list=!0,this.single_sel=!1,this.label="",this.enabled=!0,this.required=!1,this.db_type="1",this.separator=",",this.value="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.resetValue=function(){this.value="",this.writeValue(this.value)},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.focus=function(){},t.prototype.open_pick_list=function(){var t=this,e=this.m_dialog.open(Fe,{disableClose:!0});setTimeout((function(){e.componentInstance.single_sel=t.single_sel,e.componentInstance.sel_values=t.value,e.componentInstance.separator=t.separator,e.componentInstance.label=t.label,e.componentInstance.sql=t.sql,e.componentInstance.types=t.types,e.componentInstance.values=t.values,e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null==e||""==e);else{t.value="";for(var i=0;i<e.length;i++)""!=t.value&&(t.value+=t.separator),t.value+=e[i].descrizione_valore,t.writeValue(t.value)}}))},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"only_in_list",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"db_type",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"separator",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"value",void 0),t=yt([e.Component({providers:[pi],selector:"FHFieldPickList",template:'\n<div fxLayout="row" style="width: 100%" fxLayoutAlign="start center" [hidden]="hidden"><div style="width: 100%">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [readonly]="!enabled || only_in_list" [(ngModel)]="value">\n </mat-form-field></div>&nbsp;&nbsp;\n <div style="min-width: 160px"> <button mat-flat-button color="primary" (click)="open_pick_list()" [disabled]="!enabled">SELEZIONA</button></div>\n</div>\n ',styles:["\n\n "]}),St("design:paramtypes",[l.MatDialog])],t)}(),ci=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this._dataService=n,this.label="",this.sql="",this.single_sel=!1,this.sel_values="",this.id_tipo=-1}return t.prototype.delete_uassoc=function(t){var e=this,i=new Dt;i.sql="DELETE_VALORI",i.types=["int"],i.values=[t.id_valore],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_user_list()}))},t.prototype.update_tassoc_ins=function(t){var e=this,i=new Dt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,"","0","",""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","VALORE INSERITO"),t.descrizione="",e.ref_user_list())}))},t.prototype.update_tassoc=function(t){var e=this,i=new Dt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,t.v1,t.v2,t.v3,t.lingua],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.toastr.info("INFO","VALORE AGGIORNATO")}))},t.prototype.ref_user_list=function(){var t=this,e=new Dt;e.sql="SELECT_VALORI_BY_ID",e.types=["int"],e.values=[this.id_tipo],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.valoris=e.result_data,t.nValori.valore=t.valoris.length+1)}))},t.prototype.ok=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.nValori=new Object,t.nValori.descrizione="",t.nValori.v1=null,t.nValori.v2=null,t.nValori.id_valore=-1,t.nValori.v3=null,t.nValori.lingua=null,t.ref_user_list()}))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It},{type:Mt}]},t=yt([e.Component({selector:"win_manage_values",template:'\n\n\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Descrizione</mat-label>\n <input matInput [(ngModel)]="nValori.descrizione" style="min-width:500px">\n </mat-form-field>\n <div>\n <button mat-flat-button color="primary" (click)="update_tassoc_ins(nValori)">Inserisci</button>\n </div>\n </div>\n <div fxLayout="column" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\n <table style="width: 90%" class="fh_table">\n <thead>\n <tr>\n <th style="width:70%;">Descrizione</th>\n <th style="width:5%;">V1</th>\n <th style="width:5%;">V2</th>\n <th style="width:5%;">V3</th>\n <th style="width:10%;">Lingua</th>\n <th style="width:5%;"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of valoris;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }">\n <td style="width:70%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput [(ngModel)]="u.descrizione" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.v1" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.v2" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.v3" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:10%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.lingua" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n </div>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It,Mt])],t)}(),di=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(ci,{width:"90%",height:"550px"});setTimeout((function(){e.componentInstance.id_tipo=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_TABLE_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t.ctorParameters=function(){return[{type:Mt},{type:It},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"application",void 0),yt([e.ViewChild("cmb_sel"),St("design:type",qt)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"FHTableManager",template:'\n <div [hidden]="!b_init" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="6px">\n &nbsp;<FHComboBox #cmb_sel sql="SELECT_TABLE_MANAGEMENT" label="Gestisci Tabella:"\n init_fill="false"></FHComboBox>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n\n\n </div>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt,It,l.MatDialog])],t)}(),hi=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this._dataService=n,this.label="",this.sql="",this.single_sel=!1,this.sel_values="",this.role_id=-1,this.users=[],this.m_appService=i}return t.prototype.ok=function(){},t.prototype.add_assoc=function(){var t=this;if(console.log(this.autoc.getValue()),""!=this.autoc.getValue()){var e=new Dt;e.sql="INSERT_UPDATE_ASSOC_ROLE_USER",e.types=["string","int"],e.values=[this.autoc.getValue(),this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ref_user_list()}))}},t.prototype.delete_uassoc=function(t){var e=this,i=new Dt;i.sql="DELETE_ASSOC_ROLE_USER",i.types=["string","int"],i.values=[t.username,this.role_id];this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(!0,e.ref_user_list())}),(function(t){}))},t.prototype.ref_user_list=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_BY_IDROLE",e.types=["int"],e.values=[this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users=e.result_data,t.autoc.types=["int"],t.autoc.values=[t.role_id],t.autoc.fillCombo(),t.autoc.resetValue())}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ref_user_list()}))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It},{type:Mt}]},yt([e.ViewChild("autoc"),St("design:type",pe)],t.prototype,"autoc",void 0),t=yt([e.Component({selector:"win_manage_roles",template:'\n\n\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\n <div style="width:100%" fxLayout="row" fxAlign="start center"><b>Seleziona&nbsp;per&nbsp;associare&nbsp;utente:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div style="width:100%">\n <FHAutoComplete sql="SELECT_NOT_USERS_BY_IDROLE" #autoc [init_fill]="false" (selchange)="add_assoc()"\n label="Add user"></FHAutoComplete>\n </div>\n </div>\n </div>\n <div fxLayout="column" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\n <table style="min-width:60%">\n <tr>\n <td>\n\n <div style="overflow-y: auto;" fxLayout="row" fxLayoutAlign="center start" [style.height]="m_appService.getState().body_height3">\n\n <br>\n <section class="bs">\n <table style="min-width: 600px" class="fh_table">\n <thead>\n <tr >\n <th>Utente</th>\n\n\n <th style="width: 60px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of users;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }">\n <td>{{u.cognome}} {{u.nome}}</td>\n\n <td style="text-align: center;">\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n </td>\n </tr>\n </table>\n </div>\n </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button mat-flat-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n </div>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It,Mt])],t)}(),_i=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(hi,{width:"90%",height:"550px"});setTimeout((function(){e.componentInstance.role_id=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_APP_USER_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t.ctorParameters=function(){return[{type:Mt},{type:It},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"application",void 0),yt([e.ViewChild("cmb_sel"),St("design:type",qt)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"FHRoleManager",template:'\n <div [hidden]="!b_init" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="6px">\n &nbsp;&nbsp;&nbsp;&nbsp;<FHComboBox #cmb_sel sql="SELECT_APP_USER_MANAGEMENT" label="Gestisci Ruoli:"\n init_fill="false"></FHComboBox>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n\n </div>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt,It,l.MatDialog])],t)}(),mi=function(){function t(t,i){this._dataService=t,this._dataService_odbc=i,this.init_fill=!0,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.fillend=new e.EventEmitter,this.selchange=new e.EventEmitter,this.initend=new e.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.descri_val=""}return t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this.descri_val);null==this.valDef?this.dis_value="":this.dis_value=this.valDef.split("-1").join("")}catch(t){console.log("errore split -> this.valDef ",this.valDef)}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}else this.set_options(this.sql)},t.prototype.add_option=function(t){this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval?"-1":""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.ctorParameters=function(){return[{type:Mt},{type:Ot}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sel_label",void 0),yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"initend",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valDef",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"db_type",void 0),t=yt([e.Component({selector:"FHFilterComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden">\n <mat-select #cmb [(ngModel)]="selval" (selectionChange)="sc()" [required]="required" [placeholder]="label">\n <mat-option value="-1">{{sel_label}}</mat-option>\n <mat-option value="{{app.valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="dis_value">\n </mat-form-field>\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,Ot])],t)}(),gi=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!0,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Be,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){void 0===p&&(p=!0),void 0===u&&(u="");var c=new Dt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))},t.prototype.ok_op=function(t){var e=this;void 0===t&&(t="");var i=new Dt;i.sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""))}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Mt},{type:He}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="min-width:800px;font-size: 12px;" >\n\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n\n <div>\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n </div>\n\n ',styles:["\n\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,l.MatDialog,It,n.ToastrService,Mt,He])],t)}(),fi=function(){function t(t,e,i){this.dialogRef=t,this.appService=e,this._dataService=i,this.user="",this.user_name="",this.user_surname="",this.user_email="",this.user_roles="",this.user_lang="",this.isadmin="",this.foto_ut="",this.dev_mode=!1,this.b_filef=!1,this.user=this.appService.user,this.user_name=this.appService.user_name,this.user_surname=this.appService.user_surname,this.user_email=this.appService.user_email,null!=this.appService.user_roles&&(this.user_roles=this.appService.user_roles.split(",").join(" ")),this.user_lang=this.appService.user_lang,this.isadmin=this.appService.user_isadmin}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){"1"==t.isadmin&&null!=t.appService.dev_mode&&"1"==t.appService.dev_mode&&(t.dev_mode=!0);var e=new Dt;e.sql="SELECT_ALLEGATI_DOCUMENTO",e.types=["string","string"],e.values=["FOTO_UTENTI",t.appService.user],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&e.result_data.length>0&&(t.b_filef=!0,t.foto_ut=t.appService.COMPANY_SITE_ROOT+"/uploads/"+e.result_data[0].App+"/"+e.result_data[0].K+"/"+e.result_data[0].Filename)}))}))},t.prototype.upd_dev=function(t){t?(this.appService.dev_mode="1",localStorage.setItem(this.appService.COMPANY_KEY+"dev_mode",this.appService.dev_mode)):(this.appService.dev_mode="0",localStorage.removeItem(this.appService.COMPANY_KEY+"dev_mode"))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:Mt}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title style="min-width:300px">Info Utente</h2>\n <mat-dialog-content style="font-size:12px">\n\n <table class="fh_table">\n\n <tbody>\n <tr class="odd">\n\n <td>Nome</td>\n <td><b>{{user_name}}</b></td>\n </tr>\n <tr class="even">\n\n <td>Cognome</td>\n <td><b>{{user_surname}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>Username</td>\n <td><b>{{user}}</b></td>\n\n </tr>\n <tr class="even">\n\n <td>Email</td>\n <td><b>{{user_email}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>Ruoli</td>\n <td><b>{{user_roles}}</b></td>\n\n </tr>\n <tr class="even">\n\n <td>Lingua</td>\n <td><b>{{user_lang}}</b></td>\n\n </tr>\n <tr *ngIf="isadmin == \'1\'" class="odd">\n\n <td>DEV MODE</td>\n <td><b><mat-checkbox [(ngModel)]="dev_mode" (ngModelChange)="upd_dev(dev_mode)"></mat-checkbox></b></td>\n\n </tr>\n </tbody>\n </table>\n <img style="vertical-align:middle;max-height:300px" *ngIf="b_filef" aria-hidden src="{{foto_ut}}" />\n\n\n <div fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="dialogRef.close()">CHIUDI</button>\n </div>\n </mat-dialog-content>\n '}),St("design:paramtypes",[l.MatDialogRef,It,Mt])],t)}(),vi=function(){function t(t,e){this._dataService=t,this._toast=e,this.color="#FFFFFF",this.bk_color="#000000",this.hidden=!1,this.key=""}return t.prototype.open_help=function(){var t=this;if(""!=this.key){var e=new Dt;e.sql="SELECT_HELP_TEXT",e.types=["string"],e.values=[this.key],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg)if(e.result_data.length>0){if(null==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);if(""==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);"L"==e.result_data[0].t&&window.open(e.result_data[0].url),"I"==e.result_data[0].t&&t._toast.info(e.result_data[0].url,"HELP",{timeOut:5e3,positionClass:"toast-center-center"})}else{t._toast.error("help non disponibile: "+t.key);var i=new Dt;i.sql="INSERT_HELP_TEXT",i.types=["string"],i.values=[t.key],t._dataService.doQuery(i).subscribe()}}))}},t.ctorParameters=function(){return[{type:Mt},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"color",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"bk_color",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"key",void 0),t=yt([e.Component({selector:"FHHelpButton",template:'\n\n\n\n <div style="cursor:pointer" ><mat-icon [style.color]="color" [style.background-color]="bk_color" [hidden]="hidden" (click)="open_help()">info</mat-icon></div>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt,n.ToastrService])],t)}(),yi=function(){function t(){}var i;return i=t,t.forRoot=function(){return{ngModule:i,providers:[It,U.NgForage,Mt,xt,Ct,Ot,He,Qt,Ht,Tt,We,ae]}},t.forChilds=function(){return{ngModule:i,providers:[]}},t=i=yt([e.NgModule({imports:[V.TranslateModule,z.CdkTableModule,mt.MatBadgeModule,g.MatAutocompleteModule,l.MatDialogModule,K.MatButtonModule,Y.MatButtonToggleModule,H.MatCardModule,G.MatCheckboxModule,Q.MatChipsModule,W.MatDatepickerModule,X.MatExpansionModule,$.MatFormFieldModule,J.MatGridListModule,Z.MatIconModule,tt.MatInputModule,et.MatListModule,it.MatMenuModule,nt.MatProgressBarModule,ot.MatProgressSpinnerModule,st.MatRadioModule,_.MatSelectModule,m.MatSlideToggleModule,rt.MatSliderModule,at.MatSidenavModule,lt.MatSnackBarModule,pt.MatStepperModule,L.MatTabsModule,ut.MatToolbarModule,ct.MatTooltipModule,dt.MatPaginatorModule,ht.MatSortModule,_t.MatTableModule,v.MatNativeDateModule,u.FileUploadModule,P.AgGridModule.withComponents([Rt]),y.CommonModule,q.DragulaModule,p.FormsModule,j.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),N.FlexLayoutModule,M.MarkdownModule,F.CKEditorModule],exports:[vi,fi,gi,_i,ui,li,ai,ni,ii,Lt,Nt,Pt,jt,Yt,Bt,le,qt,zt,pe,ge,Rt,te,fe,ye,ve,be,Wt,Se,we,Ut,Gt,Ie,Xt,Ee,Oe,xe,ke,Kt,Ae,Re,Le,Me,Ze,Fe,Vt,ne,At,Qe,$t,Et,Dt,kt,Xe,Pe,ti,ei,di],declarations:[vi,fi,gi,_i,ui,li,ri,ai,ni,ii,$e,Lt,Nt,Pt,jt,Yt,Bt,Ze,le,qt,zt,pe,ge,Rt,te,fe,ye,ve,be,Wt,Se,we,Ut,Gt,Ie,Xt,Ee,Oe,xe,ke,Kt,Ae,Re,Le,Me,Fe,Vt,ne,At,Qe,$t,Et,Dt,kt,Pe,je,ze,Ue,Ve,qe,Ke,Ge,Ye,Jt,Zt,ee,oe,Be,Xe,ti,ei,di,ci,hi,mi],providers:[Ce,q.DragulaService],entryComponents:[fi,gi,hi,ci,ni,ii,Pe,je,ze,Ue,Ve,qe,Ke,Ge,Ye,Jt,Zt,oe,ee,Be,Ee,zt,Lt,te,fe,be,Wt,Se,we,Gt,Xt,Oe,Kt,Le,Fe,Vt]})],t)}(),bi=function(){function t(t,e,i,n,o,s,r){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.slimLoadingBarService=s,this.app_s=r,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.routingDestination="",this.arr_accessi=null}return t.prototype.canActivate=function(t,e){var i=this;return this.routingDestination=t.url[0].path,""==this.routingDestination||("login"==this.routingDestination||"rp"==this.routingDestination||"pr"==this.routingDestination||"/"==this.routingDestination||(this.auth.checkCredentials()?"home"==this.routingDestination||(null!=this.app_s.user_isadmin&&"1"==this.app_s.user_isadmin||new Promise((function(t){if(null!=i.arr_accessi){for(var e=0;e<i.arr_accessi.length;e++)if("M"==i.arr_accessi[e].type&&"["+i.arr_accessi[e].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);return i.toast.error("ACCESS DENIED [0X0003]"),i.slimLoadingBarService.complete(),void t(!1)}var n=new Dt;if(n.sql="SELECT_USER_ACCESS_AUTH",n.values=[],n.types=[],null==i.app_s.user||null==i.app_s.user_isadmin)i.querys.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(!(e.result_data.length>0))return i.toast.error("ACCESS DENIED [0X0002]"),i.slimLoadingBarService.complete(),t(!1),!1;if(i.app_s.user_roles=e.result_data[0].roles,null!=i.app_s.user_roles&&i.app_s.user_roles.length>0&&(i.app_s.user_roles=i.app_s.user_roles.substr(1)),null==i.app_s.user_roles&&(i.app_s.user_roles="[NO_RUOLI_CONFIGURATI]"),i.app_s.user_isadmin=e.result_data[0].isadmin,i.app_s.user=e.result_data[0].username,null!=i.app_s.user_isadmin&&"1"==i.app_s.user_isadmin)return void t(!0);var n=new Dt;n.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],n.types=["string"],n.values=[i.app_s.user],i.querys.doQuery(n).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);i.toast.error("ACCESS DENIED [0X0001]"),t(!1),i.slimLoadingBarService.complete()}))}}));else{console.log("this.app_s ",i.app_s);var o=new Dt;if(console.log("this.app_s.user_isadmin ",i.app_s.user_isadmin),console.log("this.app_s.user_isadminsss ",i.app_s.user_isadmin+""),null!=i.app_s.user_isadmin&&i.app_s.user_isadmin+""=="1")return console.log("resolve true"),void t(!0);o.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],o.types=["string"],o.values=[i.app_s.user],i.querys.doQuery(o).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);console.log(i.arr_accessi," ",i.routingDestination),i.toast.error("ACCESS DENIED [0X0005]"),t(!1),i.slimLoadingBarService.complete()}))}}))):(this.toast.error("ACCESS DENIED [0X0004]"),this.slimLoadingBarService.complete(),!1)))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:Ht},{type:c.Router},{type:n.ToastrService},{type:Mt},{type:d.SlimLoadingBarService},{type:It}]},t=yt([e.Injectable(),St("design:paramtypes",[i.HttpClient,Ht,c.Router,n.ToastrService,Mt,d.SlimLoadingBarService,It])],t)}();t.AppMakerService=xt,t.AppService=It,t.ApprovaGridComponent=fe,t.AuthenticationService=Ht,t.ComboBoxEditor=we,t.CurrencyComponent=jt,t.FHAutoCompleteComponent=pe,t.FHComboboxComponent=qt,t.FHConfirmComponent=zt,t.FHCurrencyFieldComponent=Ae,t.FHCurrencyFormatterDirective=ye,t.FHCurrencyPipe=ve,t.FHDatePickerComponent=ge,t.FHFieldPickListComponent=ui,t.FHGridComponent=le,t.FHGridJSONComponent=Xe,t.FHGuard=bi,t.FHListComponent=Ut,t.FHListPick=Fe,t.FHLogPanelComponent=ke,t.FHMdReader=xe,t.FHNumericFieldComponent=Me,t.FHPickListComponent=Ee,t.FHRichText=Re,t.FHRoleManager=_i,t.FHTableManager=di,t.FHTimePickerComponent=Pt,t.FHUploadComponent=Bt,t.FHUploadPanelComponent=Yt,t.FHUserFieldComponent=ne,t.FHUserPickerComponent=te,t.FHWinComboSelect=Gt,t.FSInput=At,t.FSResult=Qe,t.FileService=Ct,t.FluxhubLibModule=yi,t.FormBuilderComponent=ti,t.FormExecuterComponent=ei,t.GridService=Qt,t.LocalDBService=We,t.NumericEditorComponent=Rt,t.OdbcService=Ot,t.OfficeAutomatorService=ae,t.QGParam=$t,t.QGResult=Et,t.QParam=Dt,t.QResult=kt,t.QueryService=Mt,t.ReplaceLineBreaks=Ie,t.TextAreaEditor=Se,t.UtilityService=Tt,t.WinAskButtonsComponent=ii,t.WinAskNumberComponent=Oe,t.WinAskTextBigComponent=Kt,t.WinAskTextComponent=Xt,t.WinOutputComponent=Le,t.WinWait=Vt,t.WkfService=He,t.dati_aggiuntivi=Je,t.fhimagepreview=ai,t.win_insert_commento=gi,t.win_mappa=be,t.win_salva_annulla=Pe,t.win_show_image=ni,t.win_time_slider=Lt,t.win_user_info=fi,t.wkf_header_bar=Ze,t.wkfapp=se,t.ɵa=pi,t.ɵb=De,t.ɵba=ee,t.ɵbb=oe,t.ɵbc=Be,t.ɵbd=ci,t.ɵbe=hi,t.ɵbf=mi,t.ɵc=Ne,t.ɵd=Te,t.ɵe=ie,t.ɵf=vi,t.ɵg=li,t.ɵh=Nt,t.ɵi=Ft,t.ɵj=ce,t.ɵk=_e,t.ɵl=Wt,t.ɵm=Ce,t.ɵn=ri,t.ɵp=$e,t.ɵq=je,t.ɵr=ze,t.ɵs=Ue,t.ɵt=Ve,t.ɵu=qe,t.ɵv=Ke,t.ɵw=Ge,t.ɵx=Ye,t.ɵy=Jt,t.ɵz=Zt,Object.defineProperty(t,"__esModule",{value:!0})}));
16
+ var gt=function(t,e){return(gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ft(t,e){function i(){this.constructor=t}gt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var vt=function(){return(vt=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function yt(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}function bt(t,e){return function(i,n){e(i,n,t)}}function St(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function wt(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)r.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return r}for(var It=function(){function t(){this.API_ENDPOINT="",this.API2_ENDPOINT="",this.TEST_ENDPOINT="",this.PORTAL_TITLE="FLUXHUB INTRANET PORTAL",this.COMPANY_KEY="PROLOGIKA_",this.COMPANY_SITE_ROOT="http://localhost:4200/",this.SQL_SERVER_LANG="uk",this.LOCAL_PATH="",this.LOGIN_EXT=0,this.LDAP_AUTH=0,this.CHANGE_PASSWORD=1,this.COLOR_SEARCH="#FFFFFF",this.LOGOUT_URL_EXT="",this.GRID_ENDPOINT="dogrid",this.UPLOAD_ENDPOINT="doupload",this.LOGIN_ENDPOINT="login",this.APPMAKER_ENDPOINT="do_app_maker",this.FILE_ENDPOINT="dofile",this.ODBC_ENDPOINT="doquery_odbc",this.QUERY_ENDPOINT="doquery",this.WKF_ENDPOINT="dowkf",this.PASSRECOVERY_ENDPOINT="passrecovery",this.user_name=null,this.user=null,this.user_surname=null,this.user_email=null,this.user_name_ori=null,this.user_ori=null,this.user_surname_ori=null,this.user_email_ori=null,this.user_roles=null,this.user_isadmin=null,this.user_idp=null,this.user_lang=null,this.token=null,this.dev_mode=null,this.ambiente_forzato="",this.state={appName:"FLUXHUB V2",darkMode:!1,defaultLang:"en",topnavTitle:"Fluxhub",sidenavOpen:!1,sidenavMode:"side",sidenavCollapse:!0,pageFullscreen:!1,pageFooter:!1,initial:!1,wkf_obj:null,wkf_doc_info:null,grid_obj:null,appo_dialog:null,m_notif:null,style_search_home:this.COLOR_SEARCH,mobile:!1,body_height:"0px",body_height1:"0px",body_height2:"0px",body_width:"0px",mobile_menu:!1,body_h:0}}return t.prototype.cloneState=function(){return JSON.parse(JSON.stringify(this.state))},t.prototype.reloadState=function(t){this.state=t},t.prototype.getState=function(t){var e=this.state;return e.hasOwnProperty(t)?e[t]:e},t.prototype.setState=function(t,e){return this.state[t]=e},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"})],t)}(),Et=function(){function t(){}return t=yt([e.Component({template:" "})],t)}(),Ot=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0),this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.ODBC_ENDPOINT;var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),Ct=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0),this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.FILE_ENDPOINT;var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(o.map((function(t){var i,o=t;if(t?"KO"===o.result_msg&&(i=new Error(o.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),xt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")});var s=JSON.stringify(t);return this.http.post(this.url,s).pipe(o.map((function(t){var i,o=t;if(t?"KO"===o.result_msg&&(i=new Error(o.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return o||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.extractData=function(t){return t.json()||{}},t.prototype.handleError=function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";return console.error(e),s.Observable.throw(e)},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),kt=function(){function t(){this.result_data=new Array}return t=yt([e.Component({template:" "})],t)}(),Dt=function(){function t(){this.values=new Array,this.types=new Array,this.names=new Array}return t=yt([e.Component({template:" "})],t)}(),At=function(){function t(){this.command="",this.p1="",this.p2=""}return t=yt([e.Component({template:" "})],t)}(),Tt=function(){function t(t){this.app_s=t,this.simpleCrypt=new r.SimpleCrypt}var i;return i=t,t.prototype.set_home_title=function(t){var e=this;setTimeout((function(){console.log("set_title->",t),e.app_s.getState().topnavTitle=t}),100)},t.prototype.check_value_combo=function(t,e){return null!=e&&"-1"!=e?e:null!=t?t:e},t.prototype.gridDateRenderer=function(t){if(null==t.value)return" ------ ";if("null"==t.value)return" ------ ";var e=i.prototype.string2date(t.value,2);return null==e?" ------ ":1970==e.getFullYear()?" ------ ":i.prototype.pad(e.getDate(),2)+"/"+i.prototype.pad(e.getMonth()+1,2)+"/"+e.getFullYear()},t.prototype.gridDateStyle=function(t){return{"text-align":"center"}},t.prototype.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t},t.prototype.format_currency=function(t,e,i,n,o){void 0===e&&(e=2),void 0===i&&(i=","),void 0===n&&(n="."),void 0===o&&(o="000000"),(t||"").toString().indexOf(",")>0&&(t=(t||"").toString().split(".").join("").split(",").join(".")),""==t&&(t="0");var s=wt((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=e>0?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},t.prototype.number2bool=function(t){return null!=t&&1==t},t.prototype.bool2number=function(t){return null==t?0:t?1:0},t.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},t.prototype.string2date=function(t,e){if(null==t)return null;if(""==t)return null;if(1==e){if(10!=t.length)return null;var i=t.split("-");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]))}if(2==e)return new Date(t);if(3==e&&t.length>=16){var n=(t=t.substring(0,16)).split(" "),o=(i=n[0].split("/"),n[1].split(":"));return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(o[0]),parseInt(o[1]),0)}if(4==e){if(!t)return null;var s=t.split("/").map((function(t){return parseInt(t)}));return new Date(s[2],s[1]-1,s[0])}return null},t.prototype.sql_number=function(t){return null==t?"0":"it"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):"uk"==this.app_s.SQL_SERVER_LANG?String(t).replace(".",","):void 0},t.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},t.prototype.sql_date=function(t){if(null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.sql_date_grid=function(t,e){if(void 0===e&&(e=""),null==t)return"dbnull";if(void 0===t)return"dbnull";if("string"==typeof t)return"dbnull";if(1970==t.getFullYear())return"dbnull";var i=t.getMonth()+1,n=t.getDate();return"CONVERT(DATETIME,'"+[t.getFullYear(),"-",(i>9?"":"0")+i,"-",(n>9?"":"0")+n].join("")+e+"',127)"},t.prototype.DateAdd=function(t,e,i){var n,o=i.valueOf();switch(t){case"ms":n=new Date(o+1*e);break;case"s":n=new Date(o+1e3*e);break;case"mi":n=new Date(o+6e4*e);break;case"h":n=new Date(o+36e5*e);break;case"d":n=new Date(o+864e5*e);break;case"y":n=new Date(o+31536e6*e)}return n},t.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()].join("")},t.prototype.datetime2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[(i>9?"":"0")+i,"/",(e>9?"":"0")+e,"/",t.getFullYear()," ",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=wt((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},t.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},t.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i,"T",(n>9?"":"0")+n,":",(o>9?"":"0")+o,":",(s>9?"":"0")+s].join("")},t.prototype.check2int=function(t){return t?1:0},t.prototype.setSelectionRange=function(t,e,i){if(t.setSelectionRange)t.focus(),t.setSelectionRange(e,i);else if(t.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",e),n.select()}},t.prototype.print_param=function(t){console.log("Tipologie -> "+String(t.types.length)),console.log("Valori -> "+String(t.values.length));for(var e=0;e<t.types.length;e++)console.log(t.types[e]+" "+String(t.values[e]))},t.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(i>9?"":"0")+i,"-",(e>9?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes())+":"+this.format2cifre(t.getSeconds()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(e>9?"":"0")+e,"-",(i>9?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes())+":"+this.format2cifre(t.getSeconds()):"Parametro SQL_SERVER_LANG non corretto"},t.prototype.descriMese=function(t){switch(t.getMonth()){case 0:return"Gennaio";case 1:return"Febbraio";case 2:return"Marzo";case 3:return"Aprile";case 4:return"Maggio";case 5:return"Giugno";case 6:return"Luglio";case 7:return"Agosto";case 8:return"Settembre";case 9:return"Ottobre";case 10:return"Novembre";case 11:return"Dicembre"}},t.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},t.prototype.toMoney=function(t,e,i,n){var o,s,r,a,l;return o=isNaN(e)?2:Math.abs(e),s=i||".",r=void 0===n?",":n,(t<0?"-":"")+((l=(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)>3?l%3:0)?a.substr(0,l)+r:"")+a.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+r)+(o?s+Math.abs(t-a).toFixed(o).slice(2):"")},t.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},t.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},t.prototype.encrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v3=function(t){return a.AES.encrypt(t,"}?fhg7SP&^N4").toString()},t.prototype.decrypt_v3=function(t){return a.AES.decrypt(t,"}?fhg7SP&^N4").toString(a.enc.Utf8)},t.prototype.decrypt=function(t){for(var e="",i=0;i<t.length;i++){var n=1^t.charCodeAt(i);e+=String.fromCharCode(n)}return e},t.prototype.encrypt_v2=function(t){return this.simpleCrypt.encode("prologika_fluxhub_etjda",t)},t.prototype.decrypt_v2=function(t){return this.simpleCrypt.decode("prologika_fluxhub_etjda",t)},t.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},t.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==this.app_s.user_roles&&(!(!e||null==this.app_s.user_isadmin||"1"!=this.app_s.user_isadmin)||this.app_s.user_roles.toUpperCase().indexOf(t.toLocaleUpperCase())>-1)},t.ctorParameters=function(){return[{type:It}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](It))},token:t,providedIn:"root"}),t=i=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[It])],t)}(),Rt=function(){function t(t){this.uti_s=t,this.cancelBeforeStart=!1}return t.prototype.agInit=function(t){var e=this;this.params=t,this.value=this.params.value,"1234567890,".indexOf(t.charPress)>=0?(this.value=t.charPress,setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,1,String(e.value).length)}),100)):setTimeout((function(){e.uti_s.setSelectionRange(e.input.element.nativeElement,0,String(e.value).length)}),100),this.cancelBeforeStart=t.charPress&&"1234567890,".indexOf(t.charPress)<0},t.prototype.getValue=function(){return""==String(this.value)?0:(this.value,null!=this.value?parseFloat(this.value.split(".").join("").split(",").join(".")):0)},t.prototype.isCancelBeforeStart=function(){return this.cancelBeforeStart},t.prototype.isCancelAfterEnd=function(){return parseFloat(this.value.split(".").join("").split(",").join("."))>1e6},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.input.element.nativeElement.focus()}))},t.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.isKeyPressedNumeric=function(t){var e=this.getCharCodeFromEvent(t);if(8==e)return!0;if(188==e)return!0;if(e>=96&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t.ctorParameters=function(){return[{type:Tt}]},yt([e.ViewChild("input",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"input",void 0),t=yt([e.Component({selector:"numeric-cell",template:'<input #input (keydown)="onKeyDown($event)" [(ngModel)]="value" style="fontSize:40;height:30px;">'}),St("design:paramtypes",[Tt])],t)}(),Lt=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.uti_s=n,this.res="",this.h=0,this.m=0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.ok=function(){5==this.res.length?this.dialogRef.close(this.res):this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(null!=t.m_appService.getState().appo_dialog&&null!=t.m_appService.getState().appo_dialog.val){var e=t.m_appService.getState().appo_dialog.val.split(":");return t.h=parseInt(e[0]),t.m=parseInt(e[1]),void(t.res=t.m_appService.getState().appo_dialog.val)}}))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It},{type:Tt}]},t=yt([e.Component({selector:"fhtimeslider",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title style="min-width:300px">Seleziona Orario -> {{res}}</h2>\n\n <mat-dialog-content style="font-size: 12px;"><br><br>\n <table>\n <tr>\n <td>Ore:</td>\n <td>\n <mat-slider\n [max]="23" (change)="change()"\n [min]="0"\n [step]="1"\n thumbLabel\n [(ngModel)]="h">\n </mat-slider>\n </td>\n </tr>\n <tr>\n <td>Minuti:</td>\n <td>\n <mat-slider\n [max]="45"\n [min]="0" (change)="change()"\n [step]="15"\n thumbLabel\n [(ngModel)]="m">\n </mat-slider>\n </td>\n </tr>\n </table>\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n\n\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It,Tt])],t)}(),Nt=function(){function t(t){this.model=t}return t.prototype.onInputChange=function(t,e){for(var i,n=t.toString().split(","),o=0;o<n.length;++o)n[o]=n[o].replace(/\D/g,"");if(0===n.length)i="";else{if(null!==n[0].match(/[0-9]{3}/gim)&&n[0].length>3){var s=Array.from(Array.from(n[0]).reverse().join("").match(/[0-9]{3}/gim).join()).reverse().join(""),r=n[0].replace(s.replace(/\D/g,""),"");i=(r.length>0?r+".":"")+s}else i=n[0];n.length>1&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t.ctorParameters=function(){return[{type:p.NgControl}]},t=yt([e.Directive({selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}),St("design:paramtypes",[p.NgControl])],t)}(),Mt=function(){function t(t,e,i,n){this.http=t,this.toastr=e,this.app_s=i,this.uti_s=n,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT}return t.prototype.doQuery=function(t,e,n){var s=this;if(void 0===e&&(e=!0),void 0===n&&(n=null),null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")){if(this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==n?this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT:n,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var r=0;r<t.types.length;r++)null==t.values[r]?t.values[r]="dbnull":("boolean"==t.types[r]&&(t.values[r]?t.values[r]="1":t.values[r]="0"),"int"==t.types[r]&&(t.values[r]+""==""?t.values[r]="dbnull":isNaN(t.values[r])?t.values[r]="0":t.values[r]=""+t.values[r]),"string"==t.types[r]&&(t.values[r]=""+t.values[r]),"date"==t.types[r]&&(t.values[r]=this.uti_s.sql_date(t.values[r])),"datetime"==t.types[r]&&(t.values[r]=this.uti_s.sql_date_time(t.values[r])),"decimal"==t.types[r]&&(t.values[r]+""==""?t.values[r]="dbnull":isNaN(t.values[r])?t.values[r]="0":t.values[r]=""+t.values[r]),"string"==t.types[r]&&null==t.values[r]&&(t.values[r]="dbnull"));var a=JSON.stringify(t);return this.http.post(this.url,a,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&s.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))}console.log("token non online")},t.ctorParameters=function(){return[{type:i.HttpClient},{type:n.ToastrService},{type:It},{type:Tt}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](n.ToastrService),e["ɵɵinject"](It),e["ɵɵinject"](Tt))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,n.ToastrService,It,Tt])],t)}(),Ft=function(){function t(){this.changed=[],this.touched=[]}return t.prototype.emitChanged=function(){var t=this.getValue();this.changed.forEach((function(e){return e(t)}))},Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},set:function(t){this.getValue()!==t&&(this.setValue(t),this.changed.forEach((function(e){return e(t)})))},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.setValue(t)},t.prototype.touch=function(){this.touched.forEach((function(t){return t()}))},t.prototype.registerOnChange=function(t){this.changed.push(t)},t.prototype.registerOnTouched=function(t){this.touched.push(t)},t}(),Pt=function(t){function i(i,n,o,s,r){var a=t.call(this)||this;return a._dataService=i,a.dialog=n,a.m_appService=o,a.toastr=s,a.uti_s=r,a.maxore=23,a.label="",a.enabled=!0,a.show_picker=!1,a.selchange=new e.EventEmitter,a.ngChange=new e.EventEmitter,a.h=0,a.m=0,a.res="",a}var o;return ft(i,t),o=i,i.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},i.prototype.doh=function(){this.h>0&&this.h--,this.sc()},i.prototype.upm=function(){this.m<60&&this.m++,this.sc()},i.prototype.dom=function(){this.m>0&&this.m--,this.sc()},i.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},i.prototype.onMi=function(){this.m>59&&(this.m=59),this.sc()},i.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},i.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},i.prototype.resetValue=function(){this.h=0,this.m=0},i.prototype.annulla=function(){this.show_picker=!1},i.prototype.ok=function(){0!=this.h||0!=this.m?this.sc():this.toastr.error("ERRORE","SELEZIONARE L'ORARIO",{timeOut:1e3,progressBar:!0,positionClass:"toast-bottom-right"})},i.prototype.change=function(){this.res=this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.setByDescri=function(t){null==t&&(t="00:00"),""==t&&(t="00:00"),-1==t.indexOf(":")&&(t="00:00");var e=t.split(":");this.h=parseInt(e[0]),this.m=parseInt(e[1]),5!=t.length&&this.emitChanged()},i.prototype.isValidVal=function(){return!0},i.prototype.setByValue=function(t){this.setByDescri(t)},i.prototype.setValue=function(t){this.setByDescri(t)},i.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},i.prototype.getHours=function(){return this.h},i.prototype.getMinutes=function(){return this.m},i.prototype.ngAfterViewInit=function(){},i.prototype.sc=function(){var t=this.getValue();this.selchange.emit(),this.ngChange.emit(t),this.emitChanged()},i.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},i.prototype.getCharCodeFromEvent=function(t){return void 0===(t=t||window.event).which?t.keyCode:t.which},i.prototype.isKeyPressedNumeric=function(t){return-1!=="0123456789".indexOf(t.key)||"ArrowRight"==t.key||"ArrowLeft"==t.key||"ArrowDown"==t.key||"ArrowUp"==t.key||"Backspace"==t.key},i.ctorParameters=function(){return[{type:Mt},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Tt}]},yt([e.Input(),St("design:type",Number)],i.prototype,"maxore",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"enabled",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"selchange",void 0),yt([e.Output("change"),St("design:type",e.EventEmitter)],i.prototype,"ngChange",void 0),i=o=yt([e.Component({selector:"FHTimePicker",template:'\n <div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b>&nbsp;&nbsp;\n <div fxLayout="column" fxLayoutAlign="center center">\n <div *ngIf="enabled" class="yourClass">\n <mat-icon (click)="uph()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;" (keydown)="onKeyDown($event)" (focusout)="onFu()" [disabled]="!enabled"\n [(ngModel)]="h">\n <div class="yourClass" *ngIf="enabled">\n <mat-icon class="yourClass" (click)="doh()">keyboard_arrow_down</mat-icon>\n </div>\n </div>\n\n &nbsp;&nbsp;<b style="font-size:28px">:</b>&nbsp;&nbsp;\n\n <div fxLayout="column" fxLayoutAlign="center center">\n <div class="yourClass" *ngIf="enabled">\n <mat-icon class="yourClass" (click)="upm()">keyboard_arrow_up</mat-icon>\n </div>\n\n <input\n style="width:40px;text-align:center;" (keydown)="onKeyDown1($event)" (focusout)="onMi()" [disabled]="!enabled"\n [(ngModel)]="m">\n <div class="yourClass" *ngIf="enabled">\n <mat-icon class="yourClass" (click)="dom()">keyboard_arrow_down</mat-icon>\n </div>\n </div>\n </div>\n ',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:o,multi:!0}],styles:["\n .hhh {\n height: 63px;\n width: 100px;\n background-color: rgba(255, 0, 0, .1);\n }\n\n .yourClass {\n cursor: pointer;\n user-select: none;\n }\n "]}),St("design:paramtypes",[Mt,l.MatDialog,It,n.ToastrService,Tt])],i)}(Ft),jt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t=yt([e.Component({selector:"currency-cell",template:"{{params.value | currency:'EUR'}}"})],t)}(),zt=function(){function t(t,e){this.dialogRef=t,this.app_s=e,this.title="",this.msg="",this.confirm_mgs="CONFERMA",this.annulla_mgs="ANNULLA",this.title=localStorage.getItem(this.app_s.COMPANY_KEY+"title_dialog"),this.msg=localStorage.getItem(this.app_s.COMPANY_KEY+"msg_dialog")}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.setTitle=function(t){this.title=t},t.prototype.setMsg=function(t){this.msg=t},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It}]},t=yt([e.Component({template:'\n\n <h1 mat-dialog-title>{{title}}</h1>\n <div mat-dialog-content style="font-size:12px">{{msg}}</div>\n <div mat-dialog-actions>\n <button mat-button (click)="dialogRef.close(true)" color="primary">{{confirm_mgs}}</button>\n <button mat-button (click)="dialogRef.close(false)" color="warn">{{annulla_mgs}}</button>\n </div>\n ',styles:["\n "]}),St("design:paramtypes",[l.MatDialogRef,It])],t)}(),Ut=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.label="",this.enabled=!0,this.single_sel=!1,this.separator=",",this.fillend=new e.EventEmitter,this.selchange=new e.EventEmitter,this.initend=new e.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.change_v=function(t,e){t.checked=!t.checked,this.upd_f(t,e)},t.prototype.upd_f=function(t,e){this.single_sel&&(t.checked=!0);var i=new Object;i.u=t,i.b=e,this.selchange.emit(i)},t.prototype.resetValue=function(){for(var t=0;t<this.myData.length;t++)this.myData[t].checked=!1},t.prototype.reset=function(){this.myData=new Array,this.resetValue()},t.prototype.fillCombo=function(){var t=this;if(this.init_fill){var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values,this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.myData=e.result_data,t.resetValue(),t.setByValue(t.valDef),""==t.getValue()&&"-1"!=t.valDef&&t.setByDescri(t.valDef),t.fillend.emit())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}},t.prototype.setByDescri=function(t){if(this.valDef=t,null!=t&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(this.separator),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].descrizione_valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.setByValue=function(t){if(this.valDef=t,null!=t&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(this.separator),i=0;i<this.myData.length;i++)for(var n=0;n<e.length;n++)this.myData[i].valore==e[n]&&(this.myData[i].checked=!0)},t.prototype.getDescri=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].descrizione_valore);return t},t.prototype.getObjects=function(){for(var t=new Array,e=0;e<this.myData.length;e++)this.myData[e].checked&&t.push(this.myData[e]);return t},t.prototype.getValue=function(){for(var t="",e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=this.separator),t+=this.myData[e].valore);return t},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.add_option=function(t){t.valore=t.valore.toString(),this.myData.push(t)},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],n.checked=!1,this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit()},t.ctorParameters=function(){return[{type:Mt}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"separator",void 0),yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"initend",void 0),t=yt([e.Component({selector:"FHList",template:'\n\n\n <table class="fh_table" style="width:100%;">\n <thead>\n <tr>\n <th *ngIf="!single_sel"></th>\n <th>\n {{label}}\n\n </th>\n <th *ngIf="single_sel"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let u of myData;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }">\n <td style="width:20px;" valign="middle" *ngIf="!single_sel">\n <mat-slide-toggle (change)="upd_f(u,$event)" [disabled]="!enabled"\n [(ngModel)]="u.checked"></mat-slide-toggle>\n </td>\n <td (click)="change_v(u,$event)" valign="middle">{{u.descrizione_valore}}</td>\n <td valign="middle" style="width:20px;text-align: center" *ngIf="single_sel" >\n\n <button mat-flat-button color="primary" (click)="upd_f(u,$event)" [disabled]="!enabled" ><mat-icon>send</mat-icon></button>&nbsp;&nbsp;&nbsp;\n\n\n </td>\n </tr>\n </tbody>\n </table>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt])],t)}(),Vt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.progress_p=0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.update_progess=function(t){this.progress_p=t,100==t&&this.dialogRef.close()},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},yt([e.ViewChild("cmb_sel"),St("design:type",Ut)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"fhwinwait",template:'\n\n <h2 mat-dialog-title>\n {{label | uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <mat-progress-bar style="height:50px" color="accent" mode="determinate" value="{{progress_p}}"></mat-progress-bar>\n </mat-dialog-content>\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),qt=function(){function t(t,i){this._dataService=t,this._dataService_odbc=i,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.fillend=new e.EventEmitter,this.selchange=new e.EventEmitter,this.initend=new e.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.descri_val=""}return t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this.descri_val);null==this.valDef?this.dis_value="":this.dis_value=this.valDef.split("-1").join("")}catch(t){console.log("errore split -> this.valDef ",this.valDef)}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){console.log("reset"),this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}else this.set_options(this.sql)},t.prototype.add_option=function(t){this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval?"-1":""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.ctorParameters=function(){return[{type:Mt},{type:Ot}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sel_label",void 0),yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"initend",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valDef",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"db_type",void 0),t=yt([e.Component({selector:"FHComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (selectionChange)="sc()" [required]="required">\n <mat-option value="-1">{{sel_label}}</mat-option>\n <mat-option value="{{app.valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="dis_value">\n </mat-form-field>\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,Ot])],t)}(),Bt=function(){function t(t,i,n,o){var s=this;this._dataService=t,this.toastr=i,this.dialog=n,this.app_s=o,this.show_descri=!0,this.enabled=!0,this.single=!0,this.descri_obb=!1,this.programma_da_eseguire="",this.label_attendere="ATTENDERE UPLOAD IN CORSO",this.fixed_label=" (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)",this.limit_string="Il file di <size>MB supera il limite di 500MB",this.allegato_inserito="ALLEGATO INSERITO",this.inserire_descrizione="Descrizione Obbligatoria",this.lista_allegati=[],this.change=new e.EventEmitter,this.upload_ended=new e.EventEmitter,this.call_upload=new e.EventEmitter,this.multi_list=!1,this.allow_delete=!1,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.b_edit_loaded=!1,this.tipo="",this.b_ini=!1,this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT,maxFileSize:524288e3}),this.id=null,this.username=this.app_s.user,this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(s.descrizione="",s.toastr.info("INFO",s.allegato_inserito,{timeOut:1e3,progressBar:!0}),s.ref_allegato(),s.change.emit({item:t,response:e,status:i,header:n}))}}return t.prototype.call_up=function(){this.call_upload.emit({App:this.App,K:this.K,descrizione:this.descrizione,single:!1,username:this.app_s.user,tipo:this.tipo,local_path:this.app_s.LOCAL_PATH,p1:this.programma_da_eseguire})},t.prototype.del_doc=function(){var t=this;localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(zt).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="DELETE_ALLEGATO",i.types=["int","string"],i.values=[t.id,t.app_s.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.ref_allegato(),t.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.load_types=function(){var t=this;null!=this.cmb_tipo&&""!=this.tipo?(console.log("this.cmb_tipo.sql ",this.cmb_tipo.sql),this.cmb_tipo.sql=this.tipo,this.cmb_tipo.fillCombo()):setTimeout((function(){t.load_types()}),200)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e={};e.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(t.app_s.COMPANY_KEY+"token")}],t.uploader.setOptions(e),t.uploader.onCompleteAll=function(){t.loading=!1,t.upload_ended.emit(),null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&(t.dialogRef.componentInstance.update_progess(100),t.dialogRef=null)},t.uploader.onErrorItem=function(e,i,n,o){t.toastr.error(i)},t.uploader.onAfterAddingFile=function(e){t.ch(e)},t.uploader.onProgressItem=function(e,i){t.loading=!0,null!=t.dialogRef&&null!=t.dialogRef.componentInstance&&t.dialogRef.componentInstance.update_progess(i)},t.uploader.onWhenAddingFileFailed=function(e,i,n){switch(i.name){case"fileSize":var o=Math.round(e.size/1024/1024);t.toastr.error(t.limit_string.split("<size>").join(""+o));break;default:t.toastr.error("Errore: "+i.name)}}}))},t.prototype.download_all=function(){window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+this.App+"/"+this.K+"/"+this.file_name)},t.prototype.ch=function(t){var e=this;if(this.descri_obb&&""==this.descrizione)this.toastr.error(this.inserire_descrizione);else{for(var i=0;i<this.lista_allegati.length;i++)if(this.lista_allegati[i].Filename.toLowerCase()==t.file.name.toLowerCase())return void this.toastr.error("File già presente (cancellarlo per aggiornarlo)");this.uploader.onBuildItemForm=function(t,i){i.append("App",e.App),i.append("K",e.K),i.append("descrizione",e.descrizione),i.append("single",e.single),i.append("username",e.username),e.multi_list?i.append("tipo",e.cmb_tipo.getDescri().split("-1").join("")):i.append("tipo",e.tipo),i.append("local_path",e.app_s.LOCAL_PATH),""!=e.programma_da_eseguire&&i.append("p1",e.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(Vt,{disableClose:!0}),setTimeout((function(){e.dialogRef.componentInstance.label=e.label_attendere})),this.dialogRef.afterClosed().subscribe((function(t){}))),this.uploader.uploadAll()}},t.prototype.init=function(t,e,i,n,o,s){void 0===n&&(n=""),void 0===o&&(o=""),void 0===s&&(s=!1),this.App=t,this.K=e,this.label=i,this.tipo=n,this.b_ini=!0,this.b_edit_loaded=!1,this.descrizione="",this.programma_da_eseguire=o,this.allow_delete=s,this.ref_allegato(),this.tipo.indexOf("SELECT_")>-1&&(this.multi_list=!0,this.load_types())},t.prototype.ref_allegato=function(){var t=this;if(this.id=null,this.descrizione="",this.file_name="",this.label_b="",this.cmb_tipo.resetValue(),this.single&&null!=this.App&&""!=this.App){var e=new Dt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0&&(t.id=i[0].id,t.descrizione=i[0].descrizione,t.file_name=i[0].Filename,t.label_b=i[0].Filename+" - "+i[0].Filesize,t.b_edit_loaded=!0)}}))}},t.ctorParameters=function(){return[{type:Mt},{type:n.ToastrService},{type:l.MatDialog},{type:It}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_descri",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"descri_obb",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"programma_da_eseguire",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_attendere",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"fixed_label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"limit_string",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"allegato_inserito",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"inserire_descrizione",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"lista_allegati",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"upload_ended",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"call_upload",void 0),yt([e.ViewChild("cmb_tipo"),St("design:type",qt)],t.prototype,"cmb_tipo",void 0),t=yt([e.Component({selector:"FHUpload",template:'\n\n <div *ngIf="loading" fxLayout="row">\n WAIT\n </div>\n <div [hidden]="!(enabled && !loading)" fxLayout="row" fxLayoutAlign="start center">\n <div [hidden]="!multi_list" style="width:380px" fxLayoutAlign="start center">\n <FHComboBox [sql]="tipo" #cmb_tipo [init_fill]="false" label="Tipologia"></FHComboBox>&nbsp;&nbsp;\n </div>\n <mat-form-field [hidden]="!show_descri" style="width: 100%" appearance="outline" floatLabel="always"><mat-label>{{label}} {{fixed_label}}</mat-label>\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione"\n >\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div style="width:140px" fxLayout="row" fxLayoutAlign="start start" (click)="call_up()">\n <input type="file" multiple ng2FileSelect [uploader]="uploader" name="file-fh{{App}}" id="file-fh{{App}}" class="inputfile inputfile-fh" />\n <label for="file-fh{{App}}" style="width:210px"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg><span style="font-size: 12px">&nbsp;&nbsp;&nbsp;Upload</span></label>\n </div>\n <div fxLayout="row" fxLayoutAlign="start start">\n <button mat-flat-button *ngIf="b_edit_loaded" (click)="download_all()" style="font-size: 12px">{{label_b}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button *ngIf="id!=null && allow_delete" (click)="del_doc()" color="warn">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf="!enabled" fxLayout="row">\n <label>{{label}}:</label>{{descrizione}}\n <button mat-flat-button *ngIf="b_edit_loaded" (click)="download_all()" style="font-size: 12px;background-color: #F5F5F5">{{label_b}}</button>\n\n </div>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,n.ToastrService,l.MatDialog,It])],t)}(),Ht=function(){function t(t,e,n,o,s,r,a,l){this._dataService=t,this.toastr=e,this.http=n,this.router=o,this.route=s,this._fileService=r,this.app_s=a,this.uti_s=l,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new i.HttpHeaders({"Content-Type":"application/json"})}return t.prototype.logout=function(){this.app_s.user=null,this.app_s.user_name=null,this.app_s.user_surname=null,this.app_s.user_idp=null,this.app_s.user_email=null,this.app_s.user_roles=null,this.app_s.user_lang=null,this.app_s.user_isadmin=null,this.app_s.token=null,localStorage.removeItem(this.app_s.COMPANY_KEY+"token"),1!=this.app_s.LOGIN_EXT?this.router.navigate(["login"]):window.location.href=this.app_s.LOGOUT_URL_EXT},t.prototype.login=function(t,e,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var s=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(s=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,s,{headers:this.headers}).pipe(o.map((function(t){var e;if(t?"KO"===t.result_msg?e=new Error(t.msg):t.result_data.length>0&&localStorage.setItem(n.app_s.COMPANY_KEY+"token",t.result_data[0].token):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.get_user_info=function(t,e){var i=this;void 0===e&&(e=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var n=JSON.stringify({username_info:t});return this.http.post(this.url,n,{headers:this.headers}).pipe(o.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.passrecovery=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({email:t,websiteroot:this.app_s.COMPANY_SITE_ROOT,op:"send_email"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(o.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checktoken=function(t,e){var i=this;void 0===e&&(e=!0);var n=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,n,{headers:this.headers}).pipe(o.map((function(t){var n;if(t?"KO"===t.result_msg&&(n=new Error(t.msg)):n=new Error("Empty server response"),n)throw console.error(n),e&&i.toastr.error(n.message),new Error(n);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.change_password=function(t,e,i){var n=this;void 0===i&&(i=!0);var s=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,s,{headers:this.headers}).pipe(o.map((function(t){var e;if(t?"KO"===t.result_msg&&(e=new Error(t.msg)):e=new Error("Empty server response"),e)throw console.error(e),i&&n.toastr.error(e.message),new Error(e);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.prototype.checkCredentials_toLogin=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")||(-1==this.router.url.indexOf("/rp/")&&this.router.navigate(["login"]),!1)},t.prototype.checkCredentials=function(){return"/login"!=this.router.url&&-1==this.router.url.indexOf("/rp/")&&(this.goto_after=window.location.toString()),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"token")},t.ctorParameters=function(){return[{type:Mt},{type:n.ToastrService},{type:i.HttpClient},{type:c.Router},{type:c.ActivatedRoute},{type:Ct},{type:It},{type:Tt}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](Mt),e["ɵɵinject"](n.ToastrService),e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](c.Router),e["ɵɵinject"](c.ActivatedRoute),e["ɵɵinject"](Ct),e["ɵɵinject"](It),e["ɵɵinject"](Tt))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[Mt,n.ToastrService,i.HttpClient,c.Router,c.ActivatedRoute,Ct,It,Tt])],t)}(),Kt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.readonly=!1,this.show_annulla=!0,this.show_ok=!0,this.min_chars=3}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars?this.toastr.error("Il valore deve contenere almeno "+this.min_chars+" caratteri"):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valore",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"readonly",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_annulla",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_ok",void 0),t=yt([e.Component({selector:"app-win_ask_text",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="width:630px;font-size: 12px;">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <textarea matInput [readonly]="readonly" [(ngModel)]="valore" style="min-width:600px" rows="15"\n required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button *ngIf="show_ok" mat-flat-button color="primary" (click)="do_check()">OK</button>&nbsp;&nbsp;&nbsp;\n <button *ngIf="show_annulla" mat-flat-button color="warn" (click)="chiudi()">ANNULLA</button>\n </div>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Gt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.label="",this.width="100%",this.nota=!1,this.nota_val=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.set_selection=function(t,e,i){void 0===i&&(i=!1),this.nota=i,this.label=t;for(var n=0;n<e.length;n++)this.cmb_sel.add_option(e[n])},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?(this.cmb_sel.getObj().nota=this.nota_val,this.dialogRef.close(this.cmb_sel.getObj())):this.toastr.error("Selezionare un valore")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.ViewChild("cmb_sel"),St("design:type",qt)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"fhwincomboselect",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div fxLayout="column">\n <mat-dialog-content style="font-size: 12px;" >\n\n <div fxLayout="column">\n <h3>\n {{label | uppercase}}\n </h3>\n <FHComboBox #cmb_sel [init_fill]="false"></FHComboBox>\n <mat-form-field *ngIf="nota" appearance="outline" floatLabel="always"><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]="nota_val" rows="12"></textarea>\n </mat-form-field>\n </div>\n </mat-dialog-content>\n\n\n <mat-dialog-actions fxFlex="100" fxLayout="row" fxLayoutAlign="center center">\n <button mat-flat-button color="primary" (click)="ok()">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </mat-dialog-actions>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Yt=function(){function t(t,i,n,o,s,r){this._appservice=t,this._dataService=i,this.toastr=n,this.dialog=o,this.auth_s=s,this.uti=r,this.enabled=!0,this.label="",this.sovrascrivi_path="",this.ruolo_supervisore="[ZZZ_DIS_CC]",this.access_control=!1,this.show_images=!0,this.b_initt=!1,this.change=new e.EventEmitter,this.call_upload=new e.EventEmitter,this.App="",this.K="",this.image_type=!1,this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1,this.m_p_tipo="",this.multi_list=!1,this.m_programma_da_eseguire=""}return t.prototype.call_up=function(t){this.call_upload.emit({App:this.App,K:this.K,descrizione:t.descrizione,single:!1,username:this._appservice.user,tipo:this.m_p_tipo,local_path:this._appservice.LOCAL_PATH,p1:this.m_programma_da_eseguire})},t.prototype.download_all=function(t){null!=t.APP&&(t.App=t.APP),""==this.sovrascrivi_path?window.open(this._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename):window.open(this.sovrascrivi_path+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename)},t.prototype.edit_tipo=function(t){var e=this,i=new Dt;i.sql=this.m_p_tipo,i.types=[],i.values=[],this._dataService.doQuery(i).subscribe((function(i){if(null!=i&&"OK"==i.result_msg){var n=e.dialog.open(Gt);setTimeout((function(){n.componentInstance.set_selection("Tipologia Allegato",i.result_data)})),n.afterClosed().subscribe((function(i){if(null!=i){var n=new Dt;n.sql="UPDATE_ALLEGATI_TIPO",n.types=["int","string"],n.values=[t.id,i.descrizione_valore],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))}}))},t.prototype.edit_descri=function(t){var e=this,i=this.dialog.open(Kt);setTimeout((function(){i.componentInstance.label="Descrizione Allegato",i.componentInstance.valore=t.descrizione,i.componentInstance.min_chars=0})),i.afterClosed().subscribe((function(i){if(null!=i){var n=new Dt;n.sql="UPDATE_ALLEGATI_DESCRIZIONE",n.types=["int","string"],n.values=[t.id,i],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_allegato()}))}}))},t.prototype.delete=function(t){var e=this;localStorage.setItem(this._appservice.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this._appservice.COMPANY_KEY+"msg_dialog","Confermi l'eliminazione dell'elemento?"),this.dialog.open(zt).afterClosed().subscribe((function(i){if(i){var n=new Dt;n.sql="DELETE_ALLEGATO",n.types=["int","string"],n.values=[t.id,e.auth_s.username];e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.ref_allegato(),e.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))}),(function(t){}))}}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){setTimeout((function(){t.b_initt=!0}),700),t.upc.single=!1,t.b_mobile=t._appservice.getState().pageFullscreen,console.log("this.m_p_tipo ",t.m_p_tipo),t.upc.init(t.App,t.K,"Descrizione Allegato",t.m_p_tipo,t.m_programma_da_eseguire),t.m_p_tipo.indexOf("SELECT_")>-1&&(t.multi_list=!0),t.ref_allegato()}))},t.prototype.init=function(t,e,i,n){void 0===i&&(i=""),void 0===n&&(n=""),this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.m_p_tipo=i,this.m_programma_da_eseguire=n,this.ngAfterViewInit()},t.prototype.ref_allegato=function(){var t=this;if(null!=this.App&&""!=this.App){var e=new Dt;e.sql="SELECT_ALLEGATO_INFO",e.types=["string","string"],e.values=[this.App,this.K],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.arr_g=e.result_data;for(var i="webinfo",n=0;n<t.arr_g.length;n++){null!=t.arr_g[n].APP&&(t.arr_g[n].App=t.arr_g[n].APP),null!=t.arr_g[n].descrizione?t.arr_g[n].descrizione_vis=t.arr_g[n].descrizione.split("\n").join("<br>"):t.arr_g[n].descrizione_vis="";var o=t.arr_g[n].Filename.split(".");if(""==t.sovrascrivi_path?(t.arr_g[n].url=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t._appservice.COMPANY_SITE_ROOT+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename):(t.arr_g[n].url=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename,t.arr_g[n].url_orig=t.sovrascrivi_path+"/uploads/"+t.arr_g[n].App+"/"+t.arr_g[n].K+"/"+t.arr_g[n].Filename),-1!="3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(o[o.length-1].toLocaleUpperCase())&&(i=o[o.length-1].toLocaleLowerCase()),t.arr_g[n].icon=i+".svg",t.arr_g[n].can_delete=!t.access_control||t.arr_g[n].idp==t._appservice.user||t.uti.hasRole(t.ruolo_supervisore),-1==t.arr_g[n].Filename.indexOf(".jpg")&&-1==t.arr_g[n].Filename.indexOf(".gif")&&-1==t.arr_g[n].Filename.indexOf(".png")||!t.show_images)t.arr_g[n].type="O";else{if(t.arr_g[n].type="IMG",t.arr_g[n].image_original=[t.arr_g[n].url],null!=t.arr_g[n].preview&&1==t.arr_g[n].preview){var s=t.arr_g[n].url.split("."),r=s.pop();t.arr_g[n].url=s.join(".")+"_preview."+r}t.image_type=!0,t.arr_g[n].image_thumbnail=[t.arr_g[n].url]}}}}))}},t.ctorParameters=function(){return[{type:It},{type:Mt},{type:n.ToastrService},{type:l.MatDialog},{type:Ht},{type:Tt}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sovrascrivi_path",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"ruolo_supervisore",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"access_control",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_images",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"call_upload",void 0),yt([e.ViewChild("upc"),St("design:type",Bt)],t.prototype,"upc",void 0),t=yt([e.Component({selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n <h3 *ngIf="label!=\'\'">{{label}}</h3>\n <div fxLayout="column">\n <div [hidden]="!enabled">\n <FHUpload [single]="b_False" [lista_allegati]="arr_g" (change)="ref_allegato()" (call_upload)="call_up($event)" #upc></FHUpload>\n </div>\n <table width="98%" class="fh_table" *ngIf="!image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">Nome</th>\n <th style="width:60px;text-align:center">Dim.</th>\n <th style="width:40%">Descrizione</th>\n <th *ngIf="multi_list" style="width:20%">Tipo</th>\n\n <th style="width:40px" class="actions"></th>\n <th style="width:30%" >Utente</th>\n <th style="width:240px;text-align:center">Data</th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let app of arr_g;let odd=odd; let even=even;" style="font-size: 12px;" [ngClass]="{ odd: odd, even: even }">\n <td style="text-align:center;vertical-align: middle;width:36px;height:36px;">\n <div style="text-align:center;vertical-align: middle;width:28px;height:28px;">\n <img src="assets/icons/square-o/{{app.icon}}" style="width:28px;height:28px;"></div> </td>\n <td>{{app.Filename}}</td>\n <td style="text-align:center">{{app.Filesize}}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a mat-icon-button matTooltip="Modifica Descrizione" *ngIf="app.can_delete" (click)="edit_descri(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Descrizione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div [innerHTML]="app.descrizione_vis" style="width:100%">\n </div>\n </div></td>\n\n\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a mat-icon-button matTooltip="Modifica Tipo" *ngIf="app.can_delete" (click)="edit_tipo(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Tipologia consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%">\n </div>\n </div></td>\n\n <td style="min-width:400px;min-height: 400px" *ngIf="app.type==\'IMG\'">\n <fh-image-viewer [u]="app"></fh-image-viewer>\n\n </td>\n <td *ngIf="app.type!=\'IMG\'">\n\n </td>\n <td>{{app.nc}}</td>\n <td style="text-align:center">{{app.dt_ins | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td style="text-align:center">\n <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a mat-icon-button matTooltip="Elimina File" *ngIf="app.can_delete" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Cancellazione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="image_type && !b_mobile">\n <thead>\n <tr class="header">\n <th style="width:40px"></th>\n <th style="width:50%">Nome</th>\n <th style="width:60px;text-align:center">Dim.</th>\n\n <th style="width:20%">Descrizione</th>\n <th *ngIf="multi_list" style="width:10%">Tipo</th>\n <th style="width:40%" ></th>\n\n\n <th style="width:10%" >Utente</th>\n <th style="width:240px;text-align:center">Data</th>\n <th style="width:40px" class="actions"></th>\n <th *ngIf="enabled" style="width:40px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of arr_g;let odd=odd; let even=even;" style="font-size: 12px;" [ngClass]="{ odd: odd, even: even }">\n <td style="text-align:center;vertical-align: middle;width:36px;height:36px;">\n <div style="text-align:center;vertical-align: middle;width:28px;height:28px;">\n <img src="assets/icons/square-o/{{app.icon}}" style="width:28px;height:28px;"></div> </td>\n\n <td>{{app.Filename}}</td>\n <td style="text-align:center">{{app.Filesize}}</td>\n <td>\n <div fxLayout="row">\n <div *ngIf="enabled">\n <a mat-icon-button matTooltip="Modifica Descrizione" *ngIf="app.can_delete" (click)="edit_descri(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Descrizione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div [innerHTML]="app.descrizione_vis" style="width:100%">\n </div>\n </div></td>\n <td *ngIf="multi_list">\n <div fxLayout="row">\n <a mat-icon-button matTooltip="Modifica Tipo" *ngIf="app.can_delete" (click)="edit_tipo(app)">\n <mat-icon>edit</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Modifica Tipologia consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>edit</mat-icon>\n </a>\n\n <div [innerHTML]="app.tipo" style="width:100%">\n </div>\n </div></td>\n\n <td style="min-width:400px;min-height: 400px" *ngIf="app.type==\'IMG\'">\n <fh-image-viewer [u]="app"></fh-image-viewer>\n\n </td>\n <td *ngIf="app.type!=\'IMG\'">\n\n </td>\n <td>{{app.nc}}</td>\n <td style="text-align:center">{{app.dt_ins | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td style="text-align:center">\n <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a mat-icon-button matTooltip="Elimina File" *ngIf="app.can_delete" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a>\n\n <a mat-icon-button [matTooltip]="\'Cancellazione consentita solo a: \'+app.nc" *ngIf="!app.can_delete" [disabled]="true" >\n <mat-icon>delete</mat-icon>\n </a>\n\n </td>\n\n </tr>\n </tbody>\n </table>\n <table width="98%" class="fh_table" *ngIf="b_mobile">\n <tbody>\n\n <tr *ngFor="let app of arr_g;let odd=odd; let even=even;" style="font-size: 12px;" [ngClass]="{ odd: odd, even: even }">\n <td style="text-align:center;vertical-align: middle;width:36px;height:36px;">\n <div style="text-align:center;vertical-align: middle;width:28px;height:28px;">\n <img src="assets/icons/square-o/{{app.icon}}" style="width:28px;height:28px;"></div> </td>\n <td *ngIf="b_mobile" style="text-align:center">{{app.Filename}}<br><br>\n <button style="background-color: #F5F5F5" (click)="download_all(app)" mat-flat-button>DOWNLOAD</button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf="!b_ini && b_initt" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n\n\n "]}),St("design:paramtypes",[It,Mt,n.ToastrService,l.MatDialog,Ht,Tt])],t)}(),Qt=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT}return t.prototype.doQuery=function(t,e,n){var s=this;void 0===e&&(e=!0),void 0===n&&(n=null),this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==n?this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT:n;var r=JSON.stringify(t);return this.http.post(this.url,r,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&s.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),Wt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\n <mat-tab-group>\n <mat-tab label="FILTRI">\n\n\n <img src="assets/helps/fhgrid/filtri.png"/>\n </mat-tab>\n <mat-tab label="ORDINAMENTI">\n <img src="assets/helps/fhgrid/ordinamenti.png"/>\n </mat-tab>\n <mat-tab label="LAYOUT COLONNE">\n <img src="assets/helps/fhgrid/layout_colonne.png"/>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),Xt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){this.valore.length<this.min_chars||this.valore.length>this.max_chars?this.toastr.error("Il valore deve avere un numero di caratteri compreso tra "+this.min_chars+" - "+this.max_chars):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valore",void 0),t=yt([e.Component({selector:"app-win_ask_text",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="font-size: 12px;">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}} (min {{min_chars}} - max {{max_chars}} caratteri)</mat-label>\n <input matInput type="text"\n [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button>&nbsp;&nbsp;&nbsp;<button\n mat-flat-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),$t=function(){function t(){this.filter="",this.system_dest=1}return t=yt([e.Component({template:" "})],t)}(),Jt=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.flt_grid="1=1",this.title="RECUPERA DOCUMENTO"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.edit=function(t){var e=this,i=new Dt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[this.datagrid.sRow.id_applicativo,this.datagrid.sRow.uiid,0],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.toastr.info("Documento "+e.datagrid.sRow.codice+" Recuperato"),e.dialogRef.close("ok"))}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.init_w=function(t){this.datagrid.columnDefs=[{headerName:"Codice",field:"codice",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Oggetto",field:"oggetto",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Stato",field:"stat_stato",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Richiedente",field:"nc",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}}],this.datagrid.doFill("annullato=-1 and id_applicativo='"+t+"'")},t.prototype.edit_comm=function(t){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("dtm"),St("design:type",le)],t.prototype,"datagrid",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n\n </mat-toolbar>\n <br>\n <div style="width:100%;height:400px">\n <div style="width:100%;height:100%">\n <FHGrid [filters]="flt_grid" init_fill="false" show_buttons="false" vis #dtm (dclicked)="edit($event)"\n g_width="100%" g_height="100%" tbl_name="wkf_documents" grid_key="r_wkf_documents"\n sort_field="codice desc" off_set="50" fields="*"></FHGrid>\n\n </div>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),Zt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.title="",this.errorMsg="",this.OK_BUTTON="OK"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t){this.myData=t},t.prototype.ok=function(){if(null!=this.selval)if("-1"!=this.selval){for(var t=null,e=0;e<this.myData.length;e++){if(Number(this.selval).valueOf()+0==this.myData[e].livello+0){t=this.myData[e];break}}null!=t?this.dialogRef.close({lvl_sel:t,result:"ok"}):this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})}else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","SELEZIONARE LO STEP",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},yt([e.ViewChild("cmb"),St("design:type",_.MatSelect)],t.prototype,"smtr",void 0),t=yt([e.Component({template:'\n\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar>{{title}}\n\n </mat-toolbar>\n <mat-dialog-content><br><br>\n <mat-form-field style="width:100%" appearance="outline" floatLabel="always"><mat-label>Seleziona Step:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">{{OK_BUTTON}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button>\n </div>\n <br><br>\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),te=function(){function t(t,e,i){this._dataService=t,this.dialogRef=e,this.toastr=i,this.width="100%",this.label="Ricerca...",this.selectedAdd=null,this.selectedRemove=null,this.errorMsg="",this.fltr_user="",this.single_sel=!1,this.vis_buttons=!0,this.all_users=!1,this.user_sel=new Array}return t.prototype.filtra=function(){this.users_list_sel=new Array;for(var t=0;t<this.users_list.length;t++)if(null!=this.users_list[t].nc){for(var e=!1,i=0;i<this.users_list_sel.length;i++)if(this.users_list_sel[i].username==this.users_list[t].username&&this.users_list_sel[i].canale==this.users_list[t].canale){e=!0;break}if(!e&&(-1!=this.users_list[t].nc.toUpperCase().indexOf(this.fltr_user.toUpperCase())||""==this.fltr_user))if(null==this.user_sel)this.users_list_sel.push(this.users_list[t]);else{for(var n=!1,o=0;o<this.user_sel.length;o++)if(this.user_sel[o].username==this.users_list[t].username&&this.user_sel[o].canale==this.users_list[t].canale){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.all_users){var e=new Dt;e.sql="SELECT_ALL_USERS",e.types=[],e.values=[],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users_list=e.result_data,t.filtra())}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}else{if(null!=t.user_sel&&t.user_sel.length>0)return;if(t.users_list_sel=new Array,null!=t.users_list)for(var i=0;i<t.users_list.length;i++)t.users_list_sel.push(t.users_list[i])}}))},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.users_list.splice(t,1),this.single_sel&&(this.user_sel=new Array),null==this.user_sel&&(this.user_sel=[]),this.user_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.user_sel.indexOf(this.selectedRemove,0);t>-1&&this.user_sel.splice(t,1),this.users_list.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare l'utente da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelArr=function(){return this.user_sel},t.ctorParameters=function(){return[{type:Mt},{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",Array)],t.prototype,"users_list",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"users_list_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"vis_buttons",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"all_users",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"user_sel",void 0),t=yt([e.Component({selector:"FHPickUsers",template:'\n\n <mat-dialog-content style="font-size:12px">\n <br><br>\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;height:420px;overflow-y:scroll;">\n\n <table style="width: 100%" class="fh_table" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">UTENTI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr><td colspan="2">\n\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()"\n matInput >\n </mat-form-field>\n </td></tr>\n <tr *ngFor="let u of users_list_sel;let odd=odd; let even=even;" (mouseover)="selectedAdd=u"\n [ngClass]="{ odd: odd, even: even }" (click)="addTo(u)" (dblclick)="do_add()" class="selector"\n [ngClass]="{ \'active\': selectedAdd == u }">\n <td style="width: 80%">{{u.nc}}</td>\n <td style="width: 20%">{{u.canale}}</td>\n </tr>\n </tbody>\n </table>\n\n </div>\n </div>\n <div fxLayout="column" fxFlex="20"\n style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-flat-button color="primary" (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-flat-button color="primary" (click)="do_rem()" [disabled]="option">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="40">\n <div style="width:100%;height:420px;overflow-y:scroll;">\n <table style="width: 100%" class="fh_table" cellpadding="7">\n <thead>\n <tr>\n <th colspan="2">UTENTI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of user_sel;let odd=odd; let even=even;" (mouseover)="selectedRemove=u" [ngClass]="{ odd: odd, even: even }" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector"\n [ngClass]="{ \'active\': selectedRemove == u }">\n <td style="width: 80%">{{u.nc}}</td>\n <td style="width: 20%">{{u.canale}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n\n <div style="width:100%" *ngIf="vis_buttons" fxLayout="row" fxLayoutAlign="center center">\n <button mat-flat-button color="primary" (click)="dialogRef.close(this.user_sel)">Ok</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close()">Annulla</button>\n </div>\n </mat-dialog-actions>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,l.MatDialogRef,n.ToastrService])],t)}(),ee=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.commento_hidden=!1,this.nota="",this.nota_commento="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.commento_hidden||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",te)],t.prototype,"up",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h4 mat-dialog-title>{{title}}\n </h4>\n <div mat-dialog-content fxLayout="column" style="font-size:12px">\n <div style="width:100%;height:420px">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n\n </div>\n\n <mat-form-field [hidden]="commento_hidden" appearance="outline" floatLabel="always"><mat-label>Commento {{nota_commento}}</mat-label>\n <textarea matInput [(ngModel)]="nota"\n rows="2"></textarea>\n </mat-form-field>\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div><button mat-flat-button color="primary" (click)="ok()"> OK</button></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div> <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button></div>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),ie={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return ne})),multi:!0},ne=function(){function t(t,i){this.dataservice=t,this.dialog=i,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.multi=!1,this.change=new e.EventEmitter,this.select=new e.EventEmitter,this.userName="",this.selectedUser=[],this.all_user=null,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.label=t.label+" *")}))},t.prototype.getUsersNc=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+(this.selectedUser[e].cognome+" ")+this.selectedUser[e].nome;return t},t.prototype.getUsersEmail=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].email;return t},t.prototype.getUsersUsername=function(){for(var t="",e=0;e<this.selectedUser.length;e++)""!=t&&(t+=","),t=t+""+this.selectedUser[e].username;return t},t.prototype.writeValue=function(t){if(null!=t){if(""!=t)return"noop"==t?(this.userName=this.getUsersNc(),void this.onChange(this.getUsersUsername())):null==this.selectedUser?(this.setByUsername(t),void(this.userName=this.getUsersNc())):void(this.getUsersUsername()!=t&&(this.setByUsername(t),this.userName=this.getUsersNc()));this.clear()}else this.clear()},t.prototype.setByEmail=function(t){var e=this;if(console.log("emails ",t),null!=t&&""!=t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";if(console.log("s_nc ",n),""!=n){var s={sql:"SELECT_USERS_INFOS_BY_EMAIL_NOREP",types:["string"],values:[n],names:[]};console.log(s),this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):e.clear()}))}}},t.prototype.setByUsername=function(t){var e=this;if(t){for(var i=t.split(","),n="",o=0;o<i.length;o++)""!=n&&(n+=","),n=n+"'"+i[o]+"'";var s={sql:"SELECT_USERS_INFOS_BY_USERNAME_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe((function(t){var i=t.result_data;null!=i?(e.selectedUser=i,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)):e.clear()}))}},t.prototype.load_all_users=function(){var t=this;this.dataservice.doQuery({sql:"SELECT_ALL_USERS",types:[],values:[],names:[]}).subscribe((function(e){t.all_user=e.result_data,null==t.all_user&&(t.all_user=[]),t.open_pick()}))},t.prototype.open_pick=function(){var t=this;if(null!=this.all_user){if(this.enabled){var e=this.dialog.open(te,{disableClose:!0,width:"700px",height:"550px"});setTimeout((function(){e.componentInstance.user_sel=t.selectedUser,e.componentInstance.users_list=Object.assign([],t.all_user),e.componentInstance.single_sel=!t.multi,e.componentInstance.filtra()})),e.afterClosed().subscribe((function(e){null!=e&&(null!=e&&(t.selectedUser=e,t.writeValue("noop"),t.select.emit(t.selectedUser),t.userName=t.getUsersNc()),t.change.emit(t.selectedUser),t.select.emit(t.selectedUser))}))}}else this.load_all_users()},t.prototype.clear=function(){this.selectedUser=[],this.onChange([]),this.userName=""},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.ctorParameters=function(){return[{type:Mt},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"multi",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"select",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"userName",void 0),t=yt([e.Component({selector:"FHUserField",providers:[ie],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field style="clickable-field" (click)="open_pick()" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n\n <input matInput\n [hidden]="hidden"\n\n type="text"\n [ngModel]="userName"\n [disabled]="false" readonly>\n\n </mat-form-field>\n <button mat-icon-button matSuffix\n [hidden]="selectedUser.length==0"\n (click)="clear()">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="userName"\n >\n </mat-form-field>\n ',styles:["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]}),St("design:paramtypes",[Mt,l.MatDialog])],t)}(),oe=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.nota="",this.title="",this.comm_notrequired=!0,this.comm_notrequired=!0}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(console.log(this.up.getUsersUsername(),this.up1.getUsersUsername()),null!=this.up.getUsersUsername())if("-1"!=this.up.getUsersUsername())if(""!=this.up.getUsersUsername())if(null!=this.up1.getUsersUsername())if("-1"!=this.up1.getUsersUsername())if(""!=this.up1.getUsersUsername()){var t=new Object;t.u1=this.up.getUsersUsername(),t.u2=this.up1.getUsersUsername(),t.result="ok",this.dialogRef.close(t)}else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente destinazione");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine");else this.toastr.error("selezionare utente origine")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",ne)],t.prototype,"up",void 0),yt([e.ViewChild("up1"),St("design:type",ne)],t.prototype,"up1",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h4 mat-dialog-title>{{title}}\n </h4>\n <div mat-dialog-content fxLayoutGap="5px" fxLayout="column" style="font-size:12px">\n <div style="width:100%">\n <FHUserField label="Utente da sostituire" #up ></FHUserField>\n </div>\n <div style="width:100%">\n <FHUserField label="Utente sostituto" #up1 ></FHUserField>\n </div>\n\n </div>\n <div mat-dialog-actions fxLayout="row" fxLayoutAlign="center center">\n <div><button mat-flat-button color="primary" (click)="ok()"> OK</button></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div> <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button></div>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),se=function(){function t(t,e,i,n,o,s,r,a,l){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_fservice=n,this.m_router=o,this._toastr=s,this.dialog=r,this.m_wkf=a,this.m_uti=l,this.b_editing=!1,this.is_Supervisor=!1,this.is_Visor=!1,this.is_Admin=!1,this.is_PowerUser=!1,this.is_Ins=!1,this.id_applicativo="",this.codice_app="",this.att_panelcat="",this.documento_pubblico=!1,this.titolo_email="",this.tbl_name="",this.app_root="",this.grid_key="",this.m_id_Doc="",this.title="",this.user_nome="",this.user_cognome="",this.user_email="",this.b_initd=!1,this.nota_wax="",this.is_init=!1,this.imp="",this.m_cod_documento="",this.sort_field="",e.checkCredentials()&&(this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc")}return t.prototype.goto_edit_doc=function(t,e){this.m_router.navigate([this.app_root,t,e,"edit"])},t.prototype.cmd_wkf=function(t){"annulla_richiesta"==t.cmd&&this.annulla_richiesta(),"recupera_richiesta"==t.cmd&&this.recupera_richiesta(),"riassegna_richiesta"==t.cmd&&this.riassegna_richiesta(),"sostituisci_utente"==t.cmd&&this.sostituisci_utente(),"annulla_imp"==t.cmd&&this.annulla_imp(),"test_utente"==t.cmd&&this.test_utente(),"insert_doc"==t.cmd&&this.insert_doc()},t.prototype.annulla_richiesta=function(){var t=this;null!=this.get_grid().sRow?(localStorage.setItem(this.app_s.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.app_s.COMPANY_KEY+"msg_dialog","Confermi di voler annullare il documento numero: "+this.get_grid().sRow.codice+"?"),this.dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="UPDATE_WKF_ANNULATO",i.types=["string","string","int"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,-1],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}))}}))):this._toastr.error("Selezionare il documento da annullare")},t.prototype.recupera_richiesta=function(){var t=this,e=this.dialog.open(Jt,{disableClose:!0});setTimeout((function(){e.componentInstance.init_w(t.id_applicativo)})),e.afterClosed().subscribe((function(e){"ok"==e&&t.get_grid().doFill("")}))},t.prototype.sostituisci_utente=function(){var t=this;if(null!=this.get_grid().sRow){var e=new Dt;e.sql="SELECT_USERS_BY_WKF_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(oe,{disableClose:!0,width:"450px"});setTimeout((function(){i.componentInstance.up.all_user=e.result_data,i.componentInstance.title="Sostituzione utente: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new Dt;i.sql="UPDATE_USER_WORKFLOW",i.types=["string","string","string","string"],i.values=[t.id_applicativo,t.get_grid().sRow.uiid,e.u1,e.u2],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t._toastr.info("Workflow Aggiornato")}))}}))}}))}else this._toastr.error("Selezionare il documento")},t.prototype.riassegna_richiesta=function(){var t=this;if(null!=this.get_grid().sRow){var e=new Dt;e.sql="SELECT_WLIVELLIV2ADM",e.types=["string","string","string"],e.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato];this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.livs_adm=e.result_data;for(var i=new Array,n="",o=0;o<t.livs_adm.length;o++)-1==n.indexOf(String(t.livs_adm[o].livello))&&(n=n+String(t.livs_adm[o].livello)+"|",i.push(t.livs_adm[o]));var s=t.dialog.open(Zt,{disableClose:!0});setTimeout((function(){s.componentInstance.setStepCombo(i),s.componentInstance.title="Riassegnazione documento: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),s.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.os_r=e.lvl_sel,t.riassegna_richiesta_step1())}))}}))}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var t=this,e=new Array,i=0;i<this.livs_adm.length;i++)this.livs_adm[i].livello==this.os_r.livello&&0==this.livs_adm[i].notifica&&e.push(this.livs_adm[i]);var n=this.dialog.open(ee,{disableClose:!0,width:"850px"});for(i=0;i<e.length;i++)e[i].nc=e[i].nc.split(" ()").join(""),null!=e[i].idp&&null==e[i].username&&(e[i].username=e[i].idp);setTimeout((function(){n.componentInstance.arrAutori=e,n.componentInstance.title="Riassegnazione documento: "+t.get_grid().sRow.codice+" - "+t.get_grid().sRow.oggetto})),n.afterClosed().subscribe((function(e){null!=e&&null!=e.result&&"ok"==e.result&&(t.wax=e.arrsel,t.nota_wax=e.nota,t.riassegna_richiesta_step2())}))},t.prototype.riassegna_richiesta_step2=function(){var t=this,e="";null!=this.get_grid().sRow.lettori&&(e=this.get_grid().sRow.lettori);var i="",n="",o="",s="";null!=this.get_grid().sRow.partecipanti&&(s=this.get_grid().sRow.partecipanti);for(var r="",a="XCXXX",l=0;l<this.wax.length;l++){if("XCXXX"!=a&&a!=this.wax[l].gruppo_parallelo)return void this._toastr.error("impossibile assegnare a utenti di gruppi distiniti");a=this.wax[l].gruppo_parallelo,""!=r&&(r+=","),r+=this.wax[l].idp,-1==e.indexOf(this.wax[l].idp)&&(""!=e&&(e+=","),e+=this.wax[l].idp),-1==n.indexOf(this.wax[l].nc)&&(""!=n&&(n+=","),n+=this.wax[l].nc),""!=o&&(o+=","),o+=this.wax[l].nc,null!=s&&-1==s.indexOf(this.wax[l].idp)&&(""!=s&&(s+=","),s+=this.wax[l].idp),""!=i&&(i+=","),i+=this.wax[l].idp}this.sendEMail_ex(this.user_idp,r,this.titolo_email+"L'utente "+this.user_cognome+" "+this.user_nome+" ti ha riassegnato il documento: "+this.get_grid().sRow.codice,"Commento:\n\n"+this.nota_wax,this.id_applicativo,this.get_grid().sRow.uiid,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_root+"/"+this.id_applicativo+"/"+this.get_grid().sRow.uiid+"/edit",this.get_grid().sRow.uiid,this.nota_wax);var p=new Dt;p.sql="INSERT_COMMENTO_RIASS",p.types=["string","string","string","string","string","int","int"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+o,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello];this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}));var u="$$";this.wax.length>0&&null!=this.wax[0].gruppo_parallelo&&""!=this.wax[0].gruppo_parallelo&&(u=this.wax[0].gruppo_parallelo),console.log("riassegnazione canale: ",u),(p=new Dt).sql="UPDATE_RIASS_DOCUMENTO",p.types=["string","string","string","string","string","string","string","string","string","string",u],p.values=[this.os_r.livello,this.os_r.descri_livello,e,i,this.os_r.descri_livello,n,s,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(p).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.get_grid().doFill("")}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),(p=new Dt).sql="INSERT_WKF_COMMENTO",p.types=["string","string","string","string","string"],p.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp,""],this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})),this.wax.length>0&&((p=new Dt).sql="UPDATE_RIASSEGNA_TODO",p.types=["string","string"],p.values=[this.wax[0].idp,this.get_grid().sRow.uiid],!1,this.m_dataService.doQuery(p).subscribe((function(t){null!=t&&t.result_msg}),(function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p){void 0===p&&(p="");var u=new Dt;u.sql="send_wkf_mail",u.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,p],this.m_wkf.doQuery(u).subscribe((function(t){}))},t.prototype.annulla_imp=function(){this.app_s.user_name=this.app_s.user_name_ori,this.app_s.user=this.app_s.user_ori,this.app_s.user_surname=this.app_s.user_surname_ori,this.app_s.user_email=this.app_s.user_email_ori,this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_email,this.app_s.user_name_ori=null,this.app_s.user_ori=null,this.app_s.user_surname_ori=null,this.app_s.user_email_ori=null,this.imp="",this.get_grid().doFill("")},t.prototype.test_utente=function(){var t=this,e=new Dt;e.sql="SELECT_UTENTI_WORKFLOW",e.types=["string"],e.values=[this.id_applicativo],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=t.dialog.open(ee,{disableClose:!0,width:"850px"});setTimeout((function(){i.componentInstance.arrAutori=e.result_data,i.componentInstance.title="Impersona Utente",i.componentInstance.commento_hidden=!0})),i.afterClosed().subscribe((function(e){if(null!=e&&null!=e.result&&"ok"==e.result){var i=new Dt;i.sql="SELECT_USER_INFO_WKF",i.types=["string"],i.values=[e.arrsel[0].username],t.m_dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.app_s.user_name_ori=t.app_s.user_name,t.app_s.user_ori=t.app_s.user,t.app_s.user_surname_ori=t.app_s.user_surname,t.app_s.user_email_ori=t.app_s.user_email,t.app_s.user_name=e.result_data[0].nome,t.app_s.user=e.result_data[0].username,t.app_s.user_surname=e.result_data[0].cognome,t.app_s.user_email=e.result_data[0].email,t.user_idp=e.result_data[0].username,t.user_nome=e.result_data[0].nome,t.user_cognome=e.result_data[0].cognome,t.user_email=e.result_data[0].email,t.imp="ANN. IMP: "+e.result_data[0].cognome+" "+e.result_data[0].nome,t.get_grid().doFill(""),console.log(" this.user_idp ",t.user_idp))}))}}))}}))},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj={},this.app_s.getState().wkf_obj.b_editing=this.b_editing,this.app_s.getState().wkf_obj.is_Supervisor=this.is_Supervisor,this.app_s.getState().wkf_obj.is_Visor=this.is_Visor,this.app_s.getState().wkf_obj.is_Admin=this.is_Admin,this.app_s.getState().wkf_obj.is_PowerUser=this.is_PowerUser,this.app_s.getState().wkf_obj.is_Ins=this.is_Ins,this.app_s.getState().wkf_obj.id_applicativo=this.id_applicativo,this.app_s.getState().wkf_obj.codice_app=this.codice_app,this.app_s.getState().wkf_obj.att_panelcat=this.att_panelcat,this.app_s.getState().wkf_obj.documento_pubblico=this.documento_pubblico,this.app_s.getState().wkf_obj.titolo_email=this.titolo_email,this.app_s.getState().wkf_obj.tbl_name=this.tbl_name,this.app_s.getState().wkf_obj.grid_key=this.grid_key,this.app_s.getState().wkf_obj.m_id_Doc=this.m_id_Doc,this.app_s.getState().wkf_obj.livs=this.livs,this.app_s.getState().wkf_obj.user_idp=this.user_idp,this.app_s.getState().wkf_obj.app_root=this.app_root,this.app_s.getState().wkf_obj.title=this.title},t.prototype.restore_state_wkf=function(){this.b_editing=this.app_s.getState().wkf_obj.b_editing,this.is_Visor=this.app_s.getState().wkf_obj.is_Visor,this.is_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,this.is_PowerUser=this.app_s.getState().wkf_obj.is_PowerUser,this.is_Ins=this.app_s.getState().wkf_obj.is_Ins,this.id_applicativo=this.app_s.getState().wkf_obj.id_applicativo,this.codice_app=this.app_s.getState().wkf_obj.codice_app,this.att_panelcat=this.app_s.getState().wkf_obj.att_panelcat,this.documento_pubblico=this.app_s.getState().wkf_obj.documento_pubblico,this.titolo_email=this.app_s.getState().wkf_obj.titolo_email,this.tbl_name=this.app_s.getState().wkf_obj.tbl_name,this.grid_key=this.app_s.getState().wkf_obj.grid_key,this.m_id_Doc=this.app_s.getState().wkf_obj.m_id_Doc,this.livs=this.app_s.getState().wkf_obj.livs,this.user_idp=this.app_s.getState().wkf_obj.user_idp,this.app_root=this.app_s.getState().wkf_obj.app_root,this.title=this.app_s.getState().wkf_obj.title,this.m_uti.set_home_title(this.att_panelcat)},t.prototype.init_Panel=function(t,e){this.m_id_Doc=e,this.m_cod_documento=t,this.do_init()},t.prototype.run_grid=function(){var t=this;null!=this.get_grid()&&this.get_grid().ready?this.init_grid():setTimeout((function(){t.run_grid()}),500)},t.prototype.self_ok=function(){var t=this;null==this.get_grid()?setTimeout((function(){t.self_ok()}),500):this.get_grid().refresh_access(this)},t.prototype.do_init=function(){var t=this;if(null!=this.app_s.user_ori&&(this.imp="ANN. IMP: "+this.app_s.user_name+" "+this.app_s.user_surname),this.user_idp=this.app_s.user,null!=this.user_idp){this.sort_field="case when CHARINDEX('"+this.user_idp+"',autori)>0 then 1 else 0 end desc,codice desc";var e=new Dt;e.sql="SELECT_WKF_APP_INFO",e.types=["string"],e.values=[this.m_cod_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.id_applicativo=i[0].id_gruppo,t.app_root=i[0].modulo_swf,t.codice_app=i[0].codice_documento,t.att_panelcat=i[0].descrizione_breve,t.documento_pubblico=i[0].pubblico,t.titolo_email="["+i[0].descrizione_breve+"]",t.tbl_name=i[0].vista_sql,t.grid_key=t.app_s.COMPANY_KEY+i[0].vista_sql,t.user_idp=t.app_s.user,t.user_nome=t.app_s.user_name,t.user_cognome=t.app_s.user_surname,t.user_email=t.app_s.user_email,t.m_uti.set_home_title(t.att_panelcat);var n=new Dt;n.sql="SELECT_UTENTE_WKF_ADMIN",n.types=["string","string"],n.values=[t.id_applicativo,t.app_s.user],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;t.is_Supervisor=!1,t.is_Admin=!1,t.is_PowerUser=!1,i.length>0&&("0"==i[0].tipo&&(t.is_Supervisor=!0),"1"==i[0].tipo&&(t.is_Admin=!0,t.is_Supervisor=!0),"2"==i[0].tipo&&(t.is_PowerUser=!0));var n=new Dt;n.sql="SELECT_WLIVELLIV2",n.types=["string","string"],n.values=[t.id_applicativo,""],t.m_dataService.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.ok_conf_s(e.result_data);var i=new Dt;i.sql="SELECT_ROLES_VISORI",i.types=["string"],i.values=[t.id_applicativo],t.m_dataService.doQuery(i).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.is_Visor=!1;for(var i=0;i<e.result_data.length;i++)if(t.m_uti.hasRole(e.result_data[i].name,!1)){t.is_Visor=!0;break}t.run_grid(),t.self_ok()}}))}}))}}))}}))}else setTimeout((function(){t.do_init()}),500)},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if(null!=this.livs[e].idp&&null!=this.user_idp&&(this.livs[e].idp.toUpperCase()==this.user_idp.toUpperCase()||"*ALLUSERS"==this.livs[e].gruppo_parallelo)&&this.livs[e].livello<=10&&0==this.livs[e].notifica){this.is_Ins=!0,"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);break}this.save_state_wkf(),this.parse_url(),this.b_editing&&(this.returnedit(),this.b_editing=!1)},t.prototype.returnedit=function(){},t.prototype.parse_url=function(){for(var t=this.m_router.routerState.snapshot.url.split(/[\&?]+/),e=0;e<t.length;e++)if(t[e]=="/"+this.app_root+"/new")return void this.insert_doc()},t.prototype.goto_models=function(){this.m_router.navigate([this.app_root,"models"])},t.prototype.insert_doc=function(){this.m_router.navigate([this.app_root,this.id_applicativo,"new"])},t}(),re=function(){},ae=function(){function t(t,e,i){this.dataService=t,this.fileService=e,this.toastr=i,this.eprog=0}return t.prototype.operation=function(t,e,i,n){var o=new re;return o.op=t,o.v1=e,o.v2=i,o.ord=n,o},t.prototype.progress_update=function(t){var e=this;void 0===t&&(t=null),null!=t&&null!=t.componentInstance&&(this.eprog+=10,this.eprog>=100&&(this.eprog=95),setTimeout((function(){t.componentInstance.update_progess(e.eprog)})),setTimeout((function(){e.progress_update(t)}),2e3))},t.prototype.runCommands=function(t,e,i){var n=this;void 0===i&&(i=null),this.eprog=0;var r=new Dt;return r.sql="INSERT_OFFICE_OPERATION",r.types=["string","string"],e.sort((function(t,e){return t.ord<e.ord?-1:t.ord>e.ord?1:void 0})),r.values=[t,JSON.stringify(e)],this.dataService.doQuery(r).pipe(o.flatMap((function(e){if(null!=e&&"OK"==e.result_msg){var r=new At;return r.command="exec_app",r.p1="print_manager",r.p2=t,null!=i&&setTimeout((function(){n.progress_update(i)}),2e3),n.fileService.doQuery(r).pipe(o.flatMap((function(e){if(null!=e&&"OK"==e.result_msg)return new s.Observable((function(e){var i=n,o=!1;setTimeout((function(){o=!0}),18e4);!function t(n){var s=new Dt;s.sql="SELECT_OFFICE_OPERATION_FINISCHED",s.types=["string"],s.values=[n],i.dataService.doQuery(s).subscribe((function(s){if(null!=s&&"OK"==s.result_msg){var r=s.result_data;1==r.length?(e.next({message:r[0].result_message,result:r[0].result}),e.complete()):o?(e.error("Timeout"),i.toastr.error("Timeout")):setTimeout((function(){t(n)}),3e3)}else o||setTimeout((function(){t(n)}),3e3)}))}(t)}))})))}})))},t.ctorParameters=function(){return[{type:Mt},{type:Ct},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](Mt),e["ɵɵinject"](Ct),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[Mt,Ct,n.ToastrService])],t)}(),le=function(){function t(t,i,n,o,s,r,a,l,p){var u=this;this._gridservice=t,this._toast=i,this._dataService=n,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=r,this.uti_s=a,this.officeService=l,this._fileService=p,this.end_point=null,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=35,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.enabled=!0,this.auto_load=!0,this.auto_height=!1,this.abilita_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.init_fill=!0,this.no_pref=!0,this.autosize_at_ini=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni Imp.",this.curr_filter="",this.show_buttons=!0,this.fill_end=new e.EventEmitter,this.cell_edited=new e.EventEmitter,this.clicked=new e.EventEmitter,this.dclicked=new e.EventEmitter,this.columndclicked=new e.EventEmitter,this.cell_clicked=new e.EventEmitter,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new e.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new e.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(t){u.slimLoadingBarService.start((function(){}));var e=new $t;if(e.table=u.tbl_name,e.table_count=u.tbl_name,""!=u.count_tbl_name&&(e.table_count=u.count_tbl_name),e.num_per_pag=t.endRow-t.startRow,e.curr_page=Math.round(t.startRow/e.num_per_pag),null==e.curr_page&&(e.curr_page=0),null==e.num_per_pag&&(e.num_per_pag=100),e.sort_field=u.sort_field,null!=t.sortModel&&t.sortModel.length>0){e.sort_field="";for(var i=0;i<t.sortModel.length;i++)""!=e.sort_field&&(e.sort_field=e.sort_field+","),"autori"==t.sortModel[i].colId?e.sort_field=e.sort_field+"case when CHARINDEX('"+u.m_appService.user+"',autori)>0 then 1 else 0 end "+t.sortModel[i].sort:e.sort_field=e.sort_field+t.sortModel[i].colId+" "+t.sortModel[i].sort}if(e.system_dest=u.system_dest,e.field=u.fields,null!=u.filters&&(e.filter=u.filters),""!=u.fix_flt&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+u.fix_flt+" )"),""!=u.fix_flt_temp&&(""!=e.filter&&(e.filter=e.filter+" and "),e.filter=e.filter+" ("+u.fix_flt_temp+" )"),null!=t.filterModel)for(var n in t.filterModel){var o=t.filterModel[n];null==o.operator?""==e.filter?e.filter+=u.calcola_filtro(t.filterModel[n],"",n,!1):e.filter+=u.calcola_filtro(t.filterModel[n],"",n,!0):(""!=e.filter&&(e.filter+=" and "),e.filter+=" (",e.filter+=u.calcola_filtro(t.filterModel[n].condition1,"",n,!1),e.filter+=" "+o.operator+" ",e.filter+=u.calcola_filtro(t.filterModel[n].condition2,"",n,!1),e.filter+=")")}u.str_curr_q_p="",""!=e.filter&&(u.str_curr_q_p="where "+e.filter),""!=e.sort_field&&(u.str_curr_q_p=u.str_curr_q_p+" order by "+e.sort_field),u.curr_filter=e.filter,u._gridservice.doQuery(e,!0,u.end_point).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){n=!0,t.successCallback(i.result_data,i.count),u.b_init=!0,u.myData=i.result_data.slice(),u.num_r=i.count,u.slimLoadingBarService.complete(),u.fill_end.emit(),localStorage.setItem(u.grid_key+"_POS1",JSON.stringify(e)),null!=localStorage.getItem(u.grid_key+"_POS2")&&null!=u.gridOptions&&null!=u.gridOptions.api&&u.gridOptions.api.forEachNode((function(t){u.getRowNodeId(t)===localStorage.getItem(u.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(u.grid_key+"_POS2"))}));null!=u.toggle_mantieni&&u.toggle_mantieni.checked,u.no_pref&&!u.b_init1&&u.autoSizeAll(),u.b_init1=!0,u.ensure_visible(),null==localStorage.getItem(u.grid_key+"_COLS")&&u.autosize_at_ini&&setTimeout((function(){u.autoSizeAll()}),300)}n||(u.errorMsg=i.msg+" ["+i.result_msg+"]")}),(function(t){u.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"}))}},this.getContextMenuItems_n_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste"]},this.getContextMenuItems_e=function(){return["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste",{name:"Esporta",action:function(){u.export_excel()},icon:'<img src="assets/icons/square-o/xlsx.svg"/>'}]},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,defaultColDef:{resizable:!0,sortable:!0},rowSelection:"multiple",rowDeselection:!1,allowContextMenuWithControlKey:!0,rowModelType:"infinite",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore",greaterThan:"Maggiore",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.notesid?t.notesid:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.uiid_stampa="",this.xxopx=0,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj={})}return t.prototype.docmd=function(t){this.command.emit(t)},t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.no_pref||(this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),localStorage.removeItem(this.grid_key+"_FILTER_UP"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0)))},t.prototype.elimina_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler cancellare la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="DELETE_CFG_GRID",i.types=["string","string"],i.values=[t.gf.getDescri(),t.grid_key];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione eliminata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.edit_config=function(){var t=this;null==this.gf.getObj().username||this.m_appService.user==this.gf.getObj().username?(localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo(),t.curr_config="-1")}),(function(t){}))}}))):this._toast.error("Configurazione gestibile da: "+this.gf.getObj().username)},t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(Xt,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo())}),(function(t){}))}}))},t.prototype.calcola_filtro=function(t,e,i,n){void 0===n&&(n=!0);var o=!1;if(null!=t.type)null!=t.filter&&(this.show_pulisci_filtri=!0,n&&(e+=" and "),o=!0,"number"==t.filterType?("greaterThan"==t.type&&(e=e+" "+i+" > "+t.filter),"equals"==t.type&&(e=e+" "+i+" = "+t.filter),"notEqual"==t.type&&(e=e+" "+i+" <> "+t.filter),"lessThan"==t.type&&(e=e+" "+i+" < "+t.filter),"lessThanOrEqual"==t.type&&(e=e+" "+i+" <= "+t.filter),"greaterThanOrEqual"==t.type&&(e=e+" "+i+" >= "+t.filter),"inRange"==t.type&&(e=e+" ("+i+" >= "+t.filter+" and "+i+" <= "+t.filterTo+")")):("contains"==t.type&&(e=e+" upper("+i+") like '%"+t.filter.replace("'","''").toUpperCase()+"%'"),"startsWith"==t.type&&(e=e+" upper("+i+") like '"+t.filter.replace("'","''").toUpperCase()+"%'"),"equals"==t.type&&(e=e+" upper("+i+") = '"+t.filter.replace("'","''").toUpperCase()+"%'"),"notContains"==t.type&&(e=e+"not upper("+i+") like '%"+t.filter.replace("'","''").toUpperCase()+"%'"),"notEqual"==t.type&&(e=e+" upper("+i+") <> '"+t.filter.replace("'","''").toUpperCase()+"'"),"endsWith"==t.type&&(e=e+" upper("+i+") like '%"+t.filter.replace("'","''").toUpperCase()+"'"))),null==t.dateTo&&null==t.dateFrom||(o=!0,n&&(e+=" and "),e+=" (",null!=t.dateFrom&&null!=t.dateTo&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))&&(e=e+i+">="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),null!=t.dateTo&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateTo,1))?(null!=t.dateFrom&&(e+=" and "),e=e+i+"<="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateTo,1))):null!=t.dateFrom&&"dbnull"!=this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))&&("greaterThan"==t.type&&(e=e+" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"equals"==t.type&&(e=e+" ("+i+" >="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))+" and "+i+" <="+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1),"T23:59:00")+")"),"notEqual"==t.type&&(e=e+" "+i+" <> "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"lessThan"==t.type&&(e=e+" "+i+" <= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"lessThanOrEqual"==t.type&&(e=e+" "+i+" <= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1))),"greaterThanOrEqual"==t.type&&(e=e+" "+i+" >= "+this.uti_s.sql_date_grid(this.uti_s.string2date(t.dateFrom,1)))),e+=" )");else{var s="";if(null!=t.values)for(var r=0;r<t.values.length;r++)null!=t.values[r]&&(""!=s&&(s+=","),s=s+"'"+t.values[r].replace("'","''")+"'");""!=s?(o=!0,n&&(e+=" and "),e=e+i+" in ("+s+")"):(o=!0,""!=e&&(e+=" and 1=0"))}return this.show_pulisci_filtri=o,null!=this.ric_libera&&""!=this.ric_libera&&(this.show_pulisci_filtri=!0),e},t.prototype.onBtExport=function(){this.export_excel()},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t?this.uti_s.newGuid():null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){null==t.end_point&&(t.end_point=t.m_appService.API_ENDPOINT+t.m_appService.GRID_ENDPOINT),null!=localStorage.getItem(t.grid_key+"_FILTER_UP")&&(t.ric_libera=localStorage.getItem(t.grid_key+"_FILTER_UP")),t.onResize()}))},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(Wt,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var t=[];this.columnDefs.forEach((function(e){t.push(e.field)})),this.gridOptions.columnApi.autoSizeColumns(t),this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])})),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(""!=this.ric_libera&&this.doFill("",!0,!1),this.ric_libera="",localStorage.removeItem(this.grid_key+"_FILTER_UP")),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.export_excel=function(t){var e=this;if(void 0===t&&(t="xlsx"),this.num_r>15e3)this._toast.error("Massimo 15000 elementi esportabili");else{t="."+t,this.uiid_stampa=this.uti_s.newGuid(),this.xxopx=0;this.dialogRef_W=this.m_dialog.open(Vt,{disableClose:!0}),setTimeout((function(){e.dialogRef_W.componentInstance.label="EXPORT IN CORSO"}));for(var i=[],n="",o=this.gridOptions.columnApi.getAllDisplayedColumns(),s=0;s<o.length;s++)""!=n&&(n+=","),n+="["+o[s].getColDef().field+"] ["+o[s].getColDef().headerName+"]";-1!=this.fields.indexOf("DISTINCT")&&(n="DISTINCT "+n),i.push(this.officeService.operation("GB_XLS_APRI","tpl_report.xlsx",this.uiid_stampa+".xlsx",this.xxopx++)),i.push(this.officeService.operation("GB_CREA_TABELLA_FROM_DB","select "+n+" from "+this.tbl_name+" "+this.str_curr_q_p,"3",this.xxopx++)),i.push(this.officeService.operation("GB_XLS_SAVE",this.m_appService.LOCAL_PATH+"grid_reports\\"+this.uiid_stampa+"_"+this.m_appService.user+t,"",this.xxopx++)),this.officeService.runCommands(this.uiid_stampa,i,this.dialogRef_W).subscribe((function(i){setTimeout((function(){e.dialogRef_W.componentInstance.update_progess(100)}));var n=new At;n.p1=e.m_appService.LOCAL_PATH+"grid_reports\\"+e.uiid_stampa+"_"+e.m_appService.user+t,n.command="check_file",e._fileService.doQuery(n).subscribe((function(i){if(null!=i)if("N"==i.msg){var n=new Dt;n.sql="SELECT_OFFICE_OPERATION_FINISCHED",n.types=["string"],n.values=[e.uiid_stampa],e._dataService.doQuery(n).subscribe((function(t){null!=t&&"OK"==t.result_msg&&t.result_data.length>0?e._toast.error(t.result_data[0].result_msg):e._toast.error("ERRORE DI STAMPA")}))}else window.open(e.m_appService.COMPANY_SITE_ROOT+"/grid_reports/"+e.uiid_stampa+"_"+e.m_appService.user+t)}))}))}},t.prototype.print=function(){this.export_excel("pdf")},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;if(this.auto_load)if(null!=this.columnDefs)if(0!=this.columnDefs.length){if(!this.ckk_ed){if(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),null!=localStorage.getItem(this.grid_key+"_FILTER_UP")&&""!=localStorage.getItem(this.grid_key+"_FILTER_UP")){this.ric_libera=localStorage.getItem(this.grid_key+"_FILTER_UP");for(var e=this.ric_libera.split(" "),i=new Array,n=0;n<e.length;n++)e[n].length>2?i.push(e[n]):this._toast.error("ignorato termine: "+e[n]+" troppo corto");if(0==i.length)return;for(var o="",s=0;s<this.columnDefs.length;s++)if(null!=this.columnDefs[s]&&null==this.columnDefs[s].no_filter&&null!=this.columnDefs[s].field&&""!=this.columnDefs[s].field&&"agDateColumnFilter"!=this.columnDefs[s].filter)for(n=0;n<i.length;n++)""!=o&&(o+=" or "),o=o+this.columnDefs[s].field+" LIKE '%"+this.uti_s.string_sqlvalue(i[n])+"%'";this.fix_flt_temp=o,this.show_pulisci_filtri=!0}this.init_fill&&setTimeout((function(){t.ref_dt()}),100)}}else setTimeout((function(){t.ckk()}),500);else setTimeout((function(){t.ckk()}),500)},t.prototype.res_columns=function(t){var e=this;if(void 0===t&&(t=!1),null!=this.columnDefs)if(0!=this.columnDefs.length){var i=!1;if(null!=this.toggle_mantieni&&(i=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&""!=localStorage.getItem(this.grid_key+"_COLS")){if(null!=localStorage.getItem(this.grid_key+"_COLS")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{for(var n=JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),o=!0,s=0;s<n.length;s++)n[s].hide||(o=!1);o?localStorage.getItem(this.grid_key+"_COLS"):this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}try{this.gridOptions.api.setSortModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(t){console.log(t)}try{this.gridOptions.api.setFilterModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(i||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}}else this.gridOptions.api.sizeColumnsToFit()}else setTimeout((function(){e.res_columns(t)}),200);else setTimeout((function(){e.res_columns(t)}),200)},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions?setTimeout((function(){t.ref_dt()}),500):null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.gridOptions.api.setDatasource(this.dataSource)},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){this.gridApi=t.api,this.setHeaderHeight(this.header_h),null!=this.gf&&(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&null!=localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))||this.auto_load&&this.onready_go()},t.prototype.init_grid=function(){this.auto_load=!0,this.onready_go()},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",this.doFill("",!0,!1),void localStorage.removeItem(this.grid_key+"_FILTER_UP");localStorage.setItem(this.grid_key+"_FILTER_UP",this.ric_libera);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)t[i].length>2?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.show_pulisci_filtri=!0,this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onFilterModified=function(){var t=this;this.no_pref||setTimeout((function(){console.log("onFilterModified"),t.b_init&&(console.log("salvo f: "+JSON.stringify(t.gridOptions.api.getFilterModel())),localStorage.setItem(t.grid_key+"_FILTER",JSON.stringify(t.gridOptions.api.getFilterModel())))}),200)},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){console.log("qui55555"),i.Refresh()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.ctorParameters=function(){return[{type:Qt},{type:n.ToastrService},{type:Mt},{type:It},{type:d.SlimLoadingBarService},{type:l.MatDialog},{type:Tt},{type:ae},{type:Ct}]},yt([e.Input(),St("design:type",String)],t.prototype,"end_point",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"tbl_name",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"columnDefs",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"count_tbl_name",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"num_per_pag",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"grid_key",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sort_field",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"fields",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"filters",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"auto_load",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"auto_height",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"abilita_export",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled_pag",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_help",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_num_elem",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"system_dest",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"header_h",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"no_pref",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"autosize_at_ini",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_elementi",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"trova_label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"mantieni_impostazioni",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_buttons",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fill_end",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_edited",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"clicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"dclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"columndclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_clicked",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"toolbar_type",void 0),yt([e.Input(),St("design:type",se)],t.prototype,"toolbar_wkfapp",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"toolbar_custom_commands",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"command",void 0),yt([e.ViewChild("gf"),St("design:type",qt)],t.prototype,"gf",void 0),yt([e.ViewChild("toggle_mantieni"),St("design:type",m.MatSlideToggle)],t.prototype,"toggle_mantieni",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"init_end",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"off_set",void 0),yt([e.HostListener("window:resize",["event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onResize",null),yt([e.ViewChild("testom",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"testom",void 0),yt([e.ViewChild("myModalNormal",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"myModalNormal",void 0),t=yt([e.Component({selector:"FHGrid",template:'\r\n<div fxLayout="column" fxFlexFill>\r\n\r\n <div fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center start" fxLayoutGap="3px" style="min-height: 55px" [hidden]="!show_buttons">\r\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center" >\r\n <div>\r\n\t\t \t\t<h5>{{num_r}}&nbsp;{{label_elementi}}</h5>\r\n </div>\r\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n\r\n\t\t\t<div fxLayout="row" fxLayoutAlign="start center">\t<input matInput [placeholder]="trova_label" (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera"\r\n\t\t\t\t\t\t\t style="min-width:100px;max-width:180px;border:1px solid;min-height:30px"></div>\r\n <div matTooltip="REMOVE FILTER" matTooltipPosition="above" *ngIf="show_pulisci_filtri" >\r\n \t\t\t<button mat-flat-button (click)="pulisci_filtri()" color="warn">\r\n\t\t\t\t<mat-icon>filter_none</mat-icon>&nbsp;\r\n\t\t\t</button>\r\n </div>\r\n <div matTooltip="AUTO SIZE" matTooltipPosition="above">\r\n \t\t\t<button mat-flat-button (click)="autoSizeAll()" color="primary"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>compare_arrows</mat-icon>\r\n\t\t\t</button>\r\n </div>\r\n <div fxHide fxShow.gt-sm matTooltip="FIT SIZE" matTooltipPosition="above">\r\n\t \t\t<button mat-flat-button (click)="fitSizeAll()" color="primary"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>keyboard_tab</mat-icon>\r\n\t\t\t</button>\r\n </div>\r\n <div fxHide fxShow.gt-sm matTooltip="Refresh" matTooltipPosition="above">\r\n <button mat-flat-button (click)="Refresh()" color="primary"\r\n *ngIf="show_buttons">\r\n <mat-icon>autorenew</mat-icon>\r\n </button>\r\n </div>\r\n <FHFilterComboBox fxHide fxShow.gt-sm [hidden]=\'!show_buttons || no_pref\' (selchange)="ch_config()" (fillend)="fe_cfg()" #gf init_fill="false"></FHFilterComboBox>\r\n\t\t\t\t<div matTooltip="Modifica Preferenza" matTooltipPosition="above" *ngIf="curr_config!=\'-1\'">\r\n\t\t\t\t\t<button mat-icon-button *ngIf="show_buttons && !no_pref"\r\n\t\t\t\t\t\t\t\t\tstyle="color:rgb(248, 105, 10)">\r\n\t\t\t\t\t\t<mat-icon (click)="edit_config()">save</mat-icon>\r\n </button>\r\n\t\t\t\t</div>\r\n <div matTooltip="Elimina Preferenza" matTooltipPosition="above" *ngIf="curr_config!=\'-1\'">\r\n <button mat-icon-button *ngIf="show_buttons && !no_pref"\r\n style="color:rgb(248, 105, 10)">\r\n <mat-icon (click)="elimina_config()">delete</mat-icon>\r\n </button>\r\n\r\n </div>\r\n\t\t\t\t<div fxHide fxShow.gt-sm matTooltip="Crea Nuova Preferenza" matTooltipPosition="above">\r\n\t\t\t\t\t<button mat-icon-button style="color:rgb(16, 98, 16)" *ngIf="show_buttons && !no_pref">\r\n\t\t\t\t\t\t<mat-icon (click)="insert_config()">library_add</mat-icon>\r\n\t\t\t\t\t</button>\r\n\t\t\t\t</div>\r\n\r\n <mat-slide-toggle fxHide fxShow.gt-sm [hidden]=\'!show_buttons || no_pref\' (click)="ck_flag()" #toggle_mantieni>\r\n\t\t\t\t\t{{mantieni_impostazioni}}\r\n\t\t\t\t</mat-slide-toggle>\r\n\r\n\r\n \t&nbsp;\t<div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\r\n <button mat-flat-button (click)="help_window()" color="primary" *ngIf="show_buttons && show_help" >\r\n\t\t\t<mat-icon>help</mat-icon>\r\n </button></div>&nbsp;&nbsp;&nbsp;&nbsp;\r\n\r\n <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="0" *ngIf="abilita_export" matTooltip="EXPORT PDF" matTooltipPosition="above">\r\n <img src="assets/icons/square-o/pdf.svg" style="width:24px;height: 24px;cursor:pointer;" (click)="print()" alt="Export Excel">\r\n </div>\r\n <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="0" *ngIf="abilita_export" matTooltip="EXPORT EXCEL" matTooltipPosition="above">\r\n <img src="assets/icons/square-o/xlsx.svg" style="width:24px;height: 24px;cursor:pointer;" (click)="export_excel()" alt="Export Excel">\r\n </div>\r\n\r\n </div>\r\n <div fxLayout="row" fxLayoutAlign="end center" style="width: 100%;" *ngIf="enabled">\r\n <FHGridToolBar (command)="docmd($event)" [type]="toolbar_type"\r\n\r\n [custom_commands]="toolbar_custom_commands"\r\n [toolbar_wkfapp]="toolbar_wkfapp"\r\n\r\n ></FHGridToolBar>\r\n\t\t</div>\r\n </div>\r\n\r\n <div fxLayout="row" style="width:100%" [fxFlex]="show_buttons ? 100:95">\r\n<ag-grid-angular\r\n ref-agGrid\r\n style="width: 100%; height: 100%;"\r\n id="myGrid"\r\n\t\t\t\t\t\t\t\t (cellDoubleClicked)="onColumnEvent($event)"\r\n (cellClicked)="onCellClicked($event)"\r\n\t\t\t\t\t\t\t\t [headerHeight]="header_h"\r\n [groupHeaderHeight]="header_h"\r\n\r\n\t\t\t\t\t\t\t\t class="ag-theme-balham"\r\n [singleClickEdit]="true"\r\n [gridOptions]="gridOptions"\r\n [columnDefs]="columnDefs"\r\n\t\t\t\t\t\t\t\t [rowData]="rowData"\r\n [getContextMenuItems]="abilita_export ? getContextMenuItems_e:getContextMenuItems_n_e"\r\n\r\n (filterModified)="onFilterModified()"\r\n\t\t\t\t\t\t\t\t (rowDoubleClicked)="onRowDClicked($event)"\r\n\t\t\t\t\t\t\t\t (rowClicked)="onRowClicked($event)"\r\n (columnVisible)="oncolumnEverythingChanged($event)"\r\n\t\t\t\t\t\t\t\t (columnResized)="oncolumnEverythingChanged($event)"\r\n\t\t\t\t\t\t\t\t (columnMoved)="oncolumnEverythingChanged($event)"\r\n (cellValueChanged)="okr($event)"\r\n\t\t\t\t\t\t\t\t (sortChanged)="onAfterSortChanged()"\r\n [paginationPageSize]="num_per_pag"\r\n (gridReady)="onReady($event)">\r\n</ag-grid-angular>\r\n</div>\r\n</div>\r\n',styles:["\n\n "]}),St("design:paramtypes",[Qt,n.ToastrService,Mt,It,d.SlimLoadingBarService,l.MatDialog,Tt,ae,Ct])],t)}(),pe=function(t){function i(i,n){var o=t.call(this)||this;return o._dataService=i,o._dataService_odbc=n,o.init_fill=!0,o.sql="",o.label="",o.types=[],o.values=[],o.hidden=!1,o.db_type="1",o.enabled=!0,o.required=!1,o.only_from_list=!1,o.fillend=new e.EventEmitter,o.selchange=new e.EventEmitter,o.change=new e.EventEmitter,o.initend=new e.EventEmitter,o.focusout=new e.EventEmitter,o.descri_val="",o.sItem="",o.searchItemsFiltered=[],o.is_loaded=!1,o.selval=null,o.errorMsg="",o.valDef="",o.table_hidden=!0,o}var n;return ft(i,t),n=i,i.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},i.prototype.fo_search=function(t){this.focusout.emit()},i.prototype.onChange=function(t){if(this.searchItemsFiltered=[],null!=this.sItem)if(""!=this.sItem){this.searchItemsFiltered=[];for(var e=this.sItem.toLowerCase(),i=0;i<this.myData.length&&(null!=this.myData[i].descrizione_valore&&-1!=this.myData[i].descrizione_valore.toLowerCase().indexOf(e)&&this.searchItemsFiltered.push(this.myData[i]),!(e.length<4&&20==this.searchItemsFiltered.length));i++);}else for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},i.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.sItem=t.option.value,this.ch(t)},i.prototype.ch=function(t){var e=this.getValue();this.selchange.emit({event:t,valore:this.getValue(),descrizione_valore:this.sItem}),this.change.emit(e),this.emitChanged()},i.prototype.myListFormatter=function(t){return t.descrizione_valore},i.prototype.resetValue=function(){var t=this;setTimeout((function(){t.selval="",t.valDef="",t.sItem="",t.selval=null}),100)},i.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},i.prototype.fillCombo=function(){var t=this;this.myData=new Array,this.searchItemsFiltered=new Array;var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))},i.prototype.resetD=function(t){this.myData=t,this.selval="",this.fillend.emit(),this.table_hidden=!1,this.errorMsg="",this.setByValue(this.valDef),this.is_loaded=!0,null!=this.getValue()&&""!=this.getValue()||""==this.valDef||this.setByDescri(this.valDef)},i.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.sItem=t,this.selval=this.myData[e].valore,void(null!=this.sItem&&(this.descri_val=this.sItem));this.only_from_list||(this.sItem=t)}},i.prototype.setByValue=function(t){if(this.valDef=t,this.selval=t,null!=this.myData)for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.sItem=this.myData[e].descrizione_valore,void(null!=this.sItem&&(this.descri_val=this.sItem));this.only_from_list||(this.sItem=this.selval)},i.prototype.setValue=function(t){this.setByValue(t)},i.prototype.getDescri=function(){return this.getData("descrizione_valore")},i.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.sItem},i.prototype.getObj=function(){for(var t in this.myData)if(this.myData[t].descrizione_valore==this.selval||this.myData[t].valore==this.selval)return this.myData[t];return null},i.prototype.getValue=function(){return this.getData("valore")},i.prototype.getModelValue=function(){var t=this.getData("valore");return null!==t||this.only_from_list?t:this.sItem},i.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.table_hidden=!1,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},i.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},i.prototype.emitChanged=function(){var t=this.getModelValue();this.changed.forEach((function(e){return e(t)}))},Object.defineProperty(i.prototype,"value",{get:function(){return this.getModelValue()},set:function(t){this.getModelValue()!==t&&(this.setValue(t),this.changed.forEach((function(e){return e(t)})))},enumerable:!0,configurable:!0}),i.prototype.writeValue=function(t){this.setValue(t)},i.ctorParameters=function(){return[{type:Mt},{type:Ot}]},yt([e.Input(),St("design:type",Boolean)],i.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"sql",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"label",void 0),yt([e.Input(),St("design:type",Array)],i.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],i.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],i.prototype,"db_type",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"only_from_list",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"initend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"focusout",void 0),yt([e.ViewChild("searchp"),St("design:type",e.ElementRef)],i.prototype,"searchp",void 0),yt([e.ViewChild("auto"),St("design:type",g.MatAutocomplete)],i.prototype,"auto",void 0),i=n=yt([e.Component({selector:"FHAutoComplete",template:'\n <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input matInput\n [disabled]="!enabled || hidden" [matAutocomplete]="auto" [required]="required"\n (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search($event)"\n #searchp>\n </mat-form-field>\n <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)" autoActiveFirstOption >\n <mat-option *ngFor="let objx of searchItemsFiltered" [value]="objx.descrizione_valore">\n {{ objx.descrizione_valore }}\n </mat-option>\n </mat-autocomplete>\n\n\n <div class="ui negative message" *ngIf="errorMsg != \'\'">\n <i class="close icon"></i>\n <div class="header">\n {{errorMsg}}\n </div>\n </div>\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="sItem"\n >\n </mat-form-field>\n ',providers:[{provide:p.NG_VALUE_ACCESSOR,useExisting:n,multi:!0}],styles:["\n\n "]}),St("design:paramtypes",[Mt,Ot])],i)}(Ft),ue=f,ce={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMMM Y",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM Y"}},de=[],he=1;he<=31;he++)de.push(String(he));var _e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.localeData=ue.localeData(),e}return ft(e,t),e.prototype.getYear=function(t){return t.year()},e.prototype.getMonth=function(t){return t.month()},e.prototype.getDate=function(t){return t.date()},e.prototype.getDayOfWeek=function(t){return t.day()},e.prototype.getMonthNames=function(t){switch(t){case"long":return this.localeData.months();case"short":return this.localeData.monthsShort();case"narrow":return this.localeData.monthsShort().map((function(t){return t[0]}))}},e.prototype.getDateNames=function(){return de},e.prototype.getDayOfWeekNames=function(t){switch(t){case"long":return this.localeData.weekdays();case"short":case"narrow":return this.localeData.weekdaysShort()}},e.prototype.getYearName=function(t){return String(t.year())},e.prototype.getFirstDayOfWeek=function(){return this.localeData.firstDayOfWeek()},e.prototype.getNumDaysInMonth=function(t){return t.daysInMonth()},e.prototype.clone=function(t){return t.clone()},e.prototype.createDate=function(t,e,i){return ue([t,e,i])},e.prototype.today=function(){return ue()},e.prototype.parse=function(t,e){if(console.log("prima value ",t,"parseFormat ",e),null!=t){var i,n=t.split("/");if(console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i;if(n=t.split("-"),console.log("arr ",n),3==n.length)(i=parseInt(n[2]))<100&&(i+=2e3),1==n[1].length&&(n[1]="0"+n[1]),1==n[0].length&&(n[0]="0"+n[0]),t=n[0]+"/"+n[1]+"/"+i}console.log("fine value ",t,"parseFormat ",e);var o=ue(t,e,!0);return o.isValid()||(o=ue(t)),o.isValid()?o:null},e.prototype.format=function(t,e){return t?t.format(e):""},e.prototype.addCalendarYears=function(t,e){return t.clone().add(e,"y")},e.prototype.addCalendarMonths=function(t,e){return t.clone().add(e,"M")},e.prototype.addCalendarDays=function(t,e){return t.clone().add(e,"d")},e.prototype.setLocale=function(t){this.localeData=ue.localeData(t)},e.prototype.compareDate=function(t,e){return t.diff(e,"seconds",!0)},e.prototype.sameDate=function(e,i){return null==e?null==i:f.isMoment(e)?e.isSame(i):t.prototype.sameDate.call(this,e,i)},e.prototype.clampDate=function(t,e,i){return e&&t.isBefore(e)?e:i&&t.isAfter(i)?i:t},e.prototype.isValid=function(t){return t.isValid()},e.prototype.isDateInstance=function(t){return ue.isMoment(t)},e.prototype.toIso8601=function(t){return t.format()},e.prototype.fromIso8601=function(t){return ue(t)},e.prototype.invalid=function(){},e}(v.DateAdapter),me=ce,ge=function(t){function i(i,n){var o=t.call(this)||this;return o.dateAdapter=i,o.uti_s=n,o.label="",o.required=!1,o.show_buttons=!1,o.enabled=!0,o.min_date=null,o.max_date=null,o.change=new e.EventEmitter,o.v_view=o.uti_s.date2String(new Date),o.date_sel=null,o.v_date_sel="",o.dateAdapter.setLocale("it-IT"),o}var n;return ft(i,t),n=i,i.prototype.checkInput=function(t){},i.prototype.dt_chg=function(t){var e=t.target.value.split("-").join("/").split("/");if(3==e.length)if(1==e[1].length&&(e[1]="0"+e[1]),1==e[0].length&&(e[0]="0"+e[0]),parseInt(e[2])<3e3&&parseInt(e[0])>0&&parseInt(e[0])<=31&&parseInt(e[1])>0&&parseInt(e[1])<=12){var i=new _e,n=parseInt(e[2]);n<100&&(n+=2e3),this.date_sel=i.createDate(n,parseInt(e[1])-1,parseInt(e[0]))}else console.log("data non valida! ",e)},i.prototype.chxx=function(t){},i.prototype.ch=function(t){this.change.emit(this.getValue()),this.emitChanged()},i.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},i.prototype.dt_ch=function(){var t=this;setTimeout((function(){t.ch()}),50)},i.prototype.add_year=function(){var t=new _e;this.date_sel=t.createDate(this.getValue().getFullYear()+1,this.getValue().getMonth(),this.getValue().getDate()),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},i.prototype.ini_year=function(){var t=new _e;this.date_sel=t.createDate(this.getValue().getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},i.prototype.fin_year=function(){var t=new _e;this.date_sel=t.createDate(this.getValue().getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.getValue()),this.ch()},i.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel.toDate()},i.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.setLimits()}))},i.prototype.setLimits=function(){},i.prototype.setToday=function(){this.date_sel=new Date},i.prototype.setValue=function(t){if(this.dateAdapter.setLocale("it-IT"),null!=t){t instanceof Date||null!=t.value&&(t=new Date(t.value));var e=new _e;this.date_sel=e.createDate(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.getValue())}else this.date_sel=null},i.ctorParameters=function(){return[{type:v.DateAdapter},{type:Tt}]},yt([e.Input(),St("design:type",String)],i.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"show_buttons",void 0),yt([e.Input(),St("design:type",Boolean)],i.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Date)],i.prototype,"min_date",void 0),yt([e.Input(),St("design:type",Date)],i.prototype,"max_date",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],i.prototype,"change",void 0),yt([e.ViewChild("pickerId"),St("design:type",e.ElementRef)],i.prototype,"pickerId",void 0),i=n=yt([e.Component({selector:"FHDatePicker",providers:[{provide:v.MAT_DATE_FORMATS,useValue:me},{provide:v.DateAdapter,useClass:_e},{provide:p.NG_VALUE_ACCESSOR,useExisting:n,multi:!0},{provide:v.MAT_DATE_LOCALE,useValue:"it-IT"}],template:'\n <div [hidden]="!show_buttons||!enabled">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="add_year()">+1 Anno</button>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="ini_year()">Inizio Anno</button>\n <button mat-flat-button style="background-color: #F5F5F5" (click)="fin_year()">Fine Anno</button>\n </div>\n\n <mat-form-field (click)="chxx($event)" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event)" (keyup)="checkInput($event)"\n (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" >\n <mat-datepicker-toggle matSuffix [for]="picker" (click)="chxx($event)"></mat-datepicker-toggle>\n <mat-datepicker (click)="chxx($event)" #picker></mat-datepicker>\n </mat-form-field>\n\n ',styles:["\n .lb_small_grigia {\n font-size: 12px;\n color: #B8B8B8;\n }\n\n .label_dis {\n font-size: 14px;\n font-weight: bold;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-input-element,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-label {\n color: #f44336;\n }\n\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-underline,\n :host.ng-invalid > .ng-touched ::ng-deep .mat-form-field-ripple {\n background-color: #f44336;\n }\n "]}),St("design:paramtypes",[v.DateAdapter,Tt])],i)}(Ft),fe=function(){function t(){this.val_app=-1}return t.prototype.ok=function(){this.val_app=1,this.params.api.stopEditing()},t.prototype.ko=function(){this.val_app=0,this.params.api.stopEditing()},t.prototype.nd=function(){this.val_app=-1,this.params.api.stopEditing()},t.prototype.agInit=function(t){this.params=t},t.prototype.getValue=function(){return this.val_app},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},yt([e.ViewChild("container",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"container",void 0),t=yt([e.Component({selector:"approva-cell",template:'\n <div #container class="mood">\n\n <div class="example-mat-buttons">\n\n <button mat-icon-button style="color:green" (click)="ok()">\n <mat-icon>thumb_up</mat-icon>\n </button>\n <button mat-icon-button style="color:red" (click)="ko()">\n <mat-icon>thumb_down</mat-icon>\n </button>\n <button mat-icon-button style="color:gray" (click)="nd()">\n <mat-icon>crop_din</mat-icon>\n </button>\n </div>\n\n\n </div>\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none\n }\n\n\n "]})],t)}(),ve=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=wt((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.THOUSANDS_SEPARATOR))+s},t.prototype.parse=function(t,e){void 0===e&&(e=2);var i=wt((t||"").split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return n=n.replace(new RegExp(this.THOUSANDS_SEPARATOR,"g"),""),s=parseInt(s,10)>0&&e>0?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",t},t=yt([e.Pipe({name:"FHCurrency"}),St("design:paramtypes",[])],t)}(),ye=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.el.value=t.currencyPipe.transform(t.el.value)}))},t.prototype.onFocus=function(t){this.el.value=this.currencyPipe.parse(t)},t.prototype.onBlur=function(t){this.el.value=this.currencyPipe.transform(t)},t.ctorParameters=function(){return[{type:e.ElementRef},{type:ve}]},yt([e.HostListener("focus",["$event.target.value"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onFocus",null),yt([e.HostListener("blur",["$event.target.value"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onBlur",null),t=yt([e.Directive({selector:"[FHCurrencyFormatter]"}),St("design:paramtypes",[e.ElementRef,ve])],t)}(),be=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title="",this.sql_dett="",this.descri="",this.lat=51.673858,this.long=7.815982,this.zoom=7,this.infoWindowOpened=null,this.markers=[],null!=this.m_appService.getState().appo_dialog&&(null!=this.m_appService.getState().appo_dialog.zoom&&(this.zoom=this.m_appService.getState().appo_dialog.zoom),null!=this.m_appService.getState().appo_dialog.title&&(this.title=this.m_appService.getState().appo_dialog.title),null!=this.m_appService.getState().appo_dialog.lat&&(this.lat=this.m_appService.getState().appo_dialog.lat),null!=this.m_appService.getState().appo_dialog.long&&(this.long=this.m_appService.getState().appo_dialog.long),null!=this.m_appService.getState().appo_dialog.descri&&(this.descri=this.m_appService.getState().appo_dialog.descri),null!=this.m_appService.getState().appo_dialog.markers&&(this.markers=this.m_appService.getState().appo_dialog.markers))}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.apri_Scheda=function(t){window.open(t)},t.prototype.clickedMarker=function(t,e,i){this.infoWindowOpened!==e&&(null!==this.infoWindowOpened&&this.infoWindowOpened.close(),this.infoWindowOpened=e)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},t=yt([e.Component({template:'\n\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px;font-size: 12px;">\n\n <agm-map [zoom]="zoom" width="100%" height="100%" [latitude]="lat" [longitude]="long">\n <agm-marker\n *ngFor="let m of markers; let i = index"\n (markerClick)="clickedMarker(m.labelx, infoWindow, i)"\n [latitude]="m.lat"\n [longitude]="m.lng"\n [label]="m.label"\n >\n <agm-info-window #infoWindow>\n\n <strong>{{m.labelx}}</strong><br>\n <button *ngIf="m.url_scheda!=null" (click)="apri_Scheda(m.url_scheda)">APRI SCHEDA</button>\n </agm-info-window>\n </agm-marker>\n </agm-map>\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n\n\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),Se=function(){function t(){this.text="",this.date_zz="",this.date_v="",this.label=""}return t.prototype.setDt=function(){this.date_zz=this.text},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){return t.appdt.nativeElement.focus()}))},t.prototype.agInit=function(t){return this.params=t,null==t.value?(this.text=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.text=null,void(this.date_zz=null)):(this.text=t.value,void(this.date_zz=t.value))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&13!=e&&39!=e||t.stopPropagation()},yt([e.ViewChild("container",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"container",void 0),yt([e.ViewChild("appdt"),St("design:type",Object)],t.prototype,"appdt",void 0),t=yt([e.Component({selector:"editor-cell",template:'\n <div #container class="mood">\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <textarea matInput style="min-height:180px;min-width:400px" [(ngModel)]="text" #appdt\n ></textarea>\n </mat-form-field>\n </div>\n\n <button mat-flat-button color="primary" (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]})],t)}(),we=function(){function t(t){this._dataService=t,this.selval="",this.date_zz="",this.date_v="",this.sql="",this.label="",this.myData=new Array}return t.prototype.setDt=function(){this.date_zz=this.selval},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new Dt;i.sql=t.sql,i.types=t.types,i.values=t.values;this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data)}),(function(t){})),null!=t.value&&-1==t.value.indexOf("--")&&(this.selval=t.value,this.date_zz=t.value)},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){t.which||t.keyCode},t.ctorParameters=function(){return[{type:Mt}]},yt([e.ViewChild("container",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"container",void 0),yt([e.ViewChild("appdt"),St("design:type",Object)],t.prototype,"appdt",void 0),t=yt([e.Component({selector:"editor-cell",template:'\n <div #container class="mood">\n <div style="min-width:350px;min-height:60px;text-align:center">\n\n <select [(ngModel)]="selval" #appdt style="min-height:40px;width:90%">\n <option value="{{app.descrizione_valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</option>\n </select>\n </div>\n <br><br><br>\n <button mat-flat-button color="primary" (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="this.params.api.stopEditing();">ANNULLA</button>\n--\x3e\n </div>\n\n ',styles:["\n .mood {\n border-radius: 15px;\n border: 1px solid grey;\n background: #e6e6e6;\n padding: 15px;\n text-align: center;\n display: inline-block;\n outline: none\n }\n\n .default {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid transparent;\n padding: 4px;\n }\n\n .selected {\n padding-left: 10px;\n padding-right: 10px;\n border: 1px solid lightgreen;\n padding: 4px;\n }\n "]}),St("design:paramtypes",[Mt])],t)}(),Ie=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t=yt([e.Pipe({name:"replaceLineBreaks"})],t)}(),Ee=function(){function t(t,e,i){this.dialogRef=t,this._dataService=e,this.toastr=i,this.width="100%",this.selectedAdd=null,this.selectedRemove=null,this.selval="-1",this.errorMsg="",this.valDef="-1",this.fltr_user="",this.value_list=new Array,this.value_list_all=new Array,this.value_list_sel=new Array,this.single_sel=!1,this.vis_buttons=!0,this.limit_size=!1,this.types=[],this.values=[],this.value_sel=new Array}return t.prototype.ngAfterViewInit=function(){},t.prototype.filtra=function(){if(this.value_list_sel=new Array,""==this.fltr_user){for(var t=0;t<this.value_list_all.length;t++)if(this.value_list_sel.push(this.value_list_all[t]),50==t&&this.limit_size)return}else for(t=0;t<this.value_list_all.length;t++)if(-1!=this.value_list_all[t].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())){for(var e=!1,i=0;i<this.value_list_sel.length;i++)if(this.value_list_sel[i].descrizione_valore==this.value_list_all[t].descrizione_valore){e=!0;break}if(e||this.value_list_sel.push(this.value_list_all[t]),50==this.value_list_sel.length&&this.limit_size)return}},t.prototype.fill_list=function(t,e){var i=this;this.value_sel=new Array;for(var n=0;n<e.length;n++){var o=new Object;o.descrizione_valore=e[n],this.value_sel.push(o)}var s=new Dt;s.sql=t,s.types=this.types,s.values=this.values,this._dataService.doQuery(s).subscribe((function(t){if(null!=t&&"OK"==t.result_msg){i.value_list_all=t.result_data;for(var e=0;e<i.value_sel.length;e++)for(var n=i.value_list_all.length-1;n>=0;n--)if(i.value_list_all[n].descrizione_valore==i.value_sel[e].descrizione_valore){i.value_list_all.splice(n,1);break}i.filtra(),!0}}),(function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))},t.prototype.fill_list_arr=function(t,e){this.value_sel=new Array;for(var i=0;i<e.length;i++){var n=new Object;n.descrizione_valore=e[i],this.value_sel.push(n)}this.value_list_all=t;for(var o=0;o<this.value_sel.length;o++)for(var s=this.value_list_all.length-1;s>=0;s--)if(this.value_list_all[s].descrizione_valore==this.value_sel[o].descrizione_valore){this.value_list_all.splice(s,1);break}this.filtra()},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list_all.indexOf(this.selectedAdd,0);this.single_sel||t>-1&&this.value_list_all.splice(t,1),this.single_sel&&(this.value_sel=new Array),this.value_sel.push(this.selectedAdd),this.selectedAdd=null,this.filtra(),this.single_sel&&this.ok()}else this.toastr.error("ERRORE","Selezionare il valore da aggiungere",{timeOut:1e3,progressBar:!0})},t.prototype.do_rem=function(){if(null!=this.selectedRemove){var t=this.value_sel.indexOf(this.selectedRemove,0);t>-1&&this.value_sel.splice(t,1),this.value_list_all.push(this.selectedRemove),this.selectedRemove=null,this.filtra()}else this.toastr.error("ERRORE","Selezionare il valore da rimuovere",{timeOut:1e3,progressBar:!0})},t.prototype.addTo=function(t){this.option=!0,this.selectedAdd=t,this.selectedRemove=null},t.prototype.removeTo=function(t){this.option=!1,this.selectedAdd=null,this.selectedRemove=t},t.prototype.getSelStr=function(){for(var t="",e=0;e<this.value_sel.length;e++)""!=t&&(t+=","),t+=this.value_sel[e].descrizione_valore;return t},t.prototype.getSelArr=function(){return this.value_sel},t.prototype.ok=function(){this.dialogRef.close(this.getSelArr())},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:Mt},{type:n.ToastrService}]},yt([e.Input(),St("design:type",Array)],t.prototype,"value_list",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"value_list_all",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"value_list_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"vis_buttons",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"limit_size",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"value_sel",void 0),t=yt([e.Component({selector:"FHPickList",template:'\n\n <div fxLayout="column" fxLayoutGap="15px" fxFlex >\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="41%">\n\n\n <div style="width:100%;height:420px;overflow:auto;">\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr><td> <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()" style=\'padding:8px;margin:15px auto;width:100%;\'\n placeholder=\'Ricerca...\'>\n </td></tr>\n <tr *ngFor="let u of value_list_sel;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }" (click)="addTo(u)" (dblclick)="do_add()" class="selector"\n [ngClass]="{ \'active\': selectedAdd == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div fxLayout="column" fxFlex="18%"\n style="height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);">\n <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">\n <button mat-flat-button color="primary" (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-flat-button color="primary" (click)="do_rem()" [disabled]="option">\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout="column" fxFlex="41%">\n\n\n <div style="width:100%;height:420px;overflow:auto;">\n\n <table style="width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>VALORI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of value_sel;let odd=odd; let even=even;" (mouseover)="selectedRemove=u" [ngClass]="{ odd: odd, even: even }" (click)="removeTo(u)" (dblclick)="do_rem()" class="selector"\n [ngClass]="{ \'active\': selectedRemove == u }">\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br><br>\n <div fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="5px">\n <button mat-flat-button color="primary" (click)="ok()">Ok</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close()">Annulla</button>\n </div>\n </div>\n\n ',styles:["\n .selector{\n cursor:hand\n }\n "]}),St("design:paramtypes",[l.MatDialogRef,Mt,n.ToastrService])],t)}(),Oe=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.valore_min=1,this.valore_max=1e6}return t.prototype.ngAfterViewInit=function(){},t.prototype.show=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.do_check=function(){Number(this.valore)<this.valore_min||Number(this.valore)>this.valore_max?this.toastr.error("Il valore deve avere essere compreso tra "+this.valore_min+" - "+this.valore_max):this.dialogRef.close(this.valore)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},t=yt([e.Component({selector:"app-win_ask_text",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="font-size: 12px;">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input matInput type="number" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="primary" (click)="do_check()">OK</button>&nbsp;&nbsp;&nbsp;<button\n mat-flat-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Ce=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){y.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t.ctorParameters=function(){return[{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t=yt([e.Injectable(),bt(0,e.Inject(e.PLATFORM_ID)),St("design:paramtypes",[Object])],t)}(),xe=function(){function t(t){this.highlightService=t,this.highlighted=!1,this.path_md=""}return t.prototype.ngAfterViewChecked=function(){this.highlighted||null!=!this.path_md||(this.highlightService.highlightAll(),this.highlighted=!0)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:Ce}]},yt([e.Input(),St("design:type",String)],t.prototype,"path_md",void 0),t=yt([e.Component({selector:"FHMdReader",template:'\n <markdown [src]="path_md">\n\n </markdown>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Ce])],t)}(),ke=function(){function t(t){var e=this;this.uti=t,this.g_height="300px",this.columnDefs=[{headerName:"Utente",field:"utente",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Descrizione",field:"descrizione",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Tipo",field:"tipo",filter:"agTextColumnFilter",filterParams:{newRowsAction:"keep"}},{headerName:"Data",field:"data",filter:"agDateColumnFilter",filterParams:{newRowsAction:"keep"},cellRenderer:function(t){if(null==t.value)return" ------ ";var i=new Date(t.value);return i.getFullYear()<1980?" ------ ":e.uti.pad(i.getDate(),2)+"/"+e.uti.pad(i.getMonth()+1,2)+"/"+i.getFullYear()}}],this.m_app="",this.m_k=""}return t.prototype.init=function(t,e){var i=this;this.m_app=t,this.m_k=e,setTimeout((function(){i.reload()}),500)},t.prototype.reload=function(){this.datagrid.doFill("[applicativo]='"+this.m_app+"' and [iddocumento]='"+this.m_k+"'")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:Tt}]},yt([e.Input(),St("design:type",String)],t.prototype,"g_height",void 0),yt([e.ViewChild("dtm"),St("design:type",le)],t.prototype,"datagrid",void 0),t=yt([e.Component({selector:"FHLogPanel",template:'\n\n\n <div style="width:100%;">\n <section class="bs">\n <div style="width:100%;height:450px">\n <div style="width:100%;height:100%">\n\n <FHGrid [init_fill]="false" #dtm [show_buttons]="false" [columnDefs]="columnDefs" tbl_name="logs"\n grid_key="logs" sort_field="data desc"></FHGrid>\n\n\n </div>\n </div>\n </section>\n </div>\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Tt])],t)}(),De={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Ae})),multi:!0},Ae=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.color="",this.m_color="",this.label_width="",this.change=new e.EventEmitter,this.enter_pressed=new e.EventEmitter,this.innerValue=0,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.kd=function(t){"Enter"==t.code&&this.enter_pressed.emit()},t.prototype.getStyle_color=function(){return this.m_color},t.prototype.getStyle_mw=function(){return this.label_width},t.prototype.set_color=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout((function(){console.log(" chg() -> ",t.formattedAmount),t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),console.log("fine chg value -> ",t.value),t.onChange(t.value)}),50)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,console.log(" writeValue() -> ",this.value),this.formattedAmount=this.transform(this.value,this.decimal),console.log("fine writeValue -> ",this.formattedAmount),this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transformAmount=function(t){var e=this;try{setTimeout((function(){e.value=parseFloat(e.formattedAmount.split(".").join("").split(",").join(".")),e.formattedAmount=e.transform(e.value,e.decimal)}),50)}catch(t){console.log(t)}},t.prototype.transform=function(t,e){void 0===e&&(e=2),console.log("ini trasform() -> ",t,e);var i=wt((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),console.log("fine transform() -> ",t,e),e>0?n+s:n},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.el.nativeElement.required=t.required),t.el.nativeElement.disabled=!t.enabled,null==t.value&&(t.value=0),t.formattedAmount=t.transform(t.value,t.decimal)}))},yt([e.ViewChild("el"),St("design:type",e.ElementRef)],t.prototype,"el",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"decimal",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"color",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_width",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"enter_pressed",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"value",void 0),t=yt([e.Component({selector:"FHCurrencyField",providers:[De],template:'\n <mat-form-field [hidden]="!enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" style="text-align:right" #el matInput\n [disabled]="!enabled" [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event)" [style.color]="getStyle_color()" (keydown)="kd($event)"\n (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"\n pattern="[-+]?[0-9]*[.,]?[0-9]+">\n </mat-form-field>\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" style="text-align:right" [style.color]="getStyle_color()" #el1 matInput [disabled]="true"\n [(ngModel)]="formattedAmount"\n >\n </mat-form-field>\n ',styles:["\n\n "]}),St("design:paramtypes",[])],t)}(),Te={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Re})),multi:!0},Re=function(){function t(){this.enabled=!0,this.value="",this.label="",this.height="360",this.change=new e.EventEmitter,this.focus=new e.EventEmitter,this.blur=new e.EventEmitter,this.config=new Object,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.onFocus=function(t){this.focus.emit(t)},t.prototype.onBlur=function(t){this.blur.emit(t)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.config={height:t.height},t.enabled?t.config.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}]:(t.config.allowedContent=!0,t.config.toolbarGroups=[])}))},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"value",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"height",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"focus",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"blur",void 0),t=yt([e.Component({selector:"FHRichText",providers:[Te],template:'\n <b *ngIf="label!=\'\'">{{label}}</b>\n <ckeditor\n [(ngModel)]="value"\n [config]="config"\n [readonly]="!enabled"\n (change)="writeValue($event)"\n (focus)="onFocus($event)"\n (blur)="onBlur($event)" ngDefaultControl\n debounce="500">\n </ckeditor>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[])],t)}(),Le=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3,this.max_chars=50}return t.prototype.ngAfterViewInit=function(){},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valore",void 0),t=yt([e.Component({selector:"app-win_output",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="min-width:500px;font-size: 12px;">\n\n <div [innerHTML]="valore" style="width:100%">\n </div>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-flat-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n\n\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService])],t)}(),Ne={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Me})),multi:!0},Me=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.th_character=".",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.pattern="[-+]?[0-9]*[.,]?[0-9]+",this.change=new e.EventEmitter,this.innerValue=0,this.chgf=!1,this.onChange=function(t){},this.onTouched=function(){},this.formattedAmount="0,00",this.value=0}return t.prototype.getStyle=function(){return this.m_color},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){""!=this.formattedAmount?(this.value=this.uti_s.round(parseFloat(this.formattedAmount.split(".").join("").split(",").join(".")),this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)):(this.value=this.uti_s.round(0,this.decimal),this.formattedAmount=this.transform(this.value,this.decimal)),this.chgf=!0,this.onChange(this.value)},t.prototype.writeValue=function(t){this.chgf?this.chgf=!1:(null==t&&(t=0),t!==this.innerValue&&(this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal)))},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.transform=function(t,e){void 0===e&&(e=0);var i=wt((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=e>0?","+(s+"000000").substring(0,e):"",""!=this.th_character&&(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,this.th_character)),""==n&&(n="0"),0==this.decimal?n:n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(t){console.log(t)}},t.prototype.click_select_allf=function(t){var e=this;setTimeout((function(){e.el.nativeElement.select()}),200)},t.prototype.select_allf=function(t){this.el.nativeElement.select()},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.required&&(t.el.nativeElement.required=t.required),t.el.nativeElement.disabled=!t.enabled,null==t.value&&(t.value=0),t.formattedAmount=t.transform(t.value,t.decimal)}))},t.ctorParameters=function(){return[{type:Tt}]},yt([e.ViewChild("el"),St("design:type",e.ElementRef)],t.prototype,"el",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"decimal",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"th_character",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"value",void 0),t=yt([e.Component({selector:"FHNumericField",providers:[Ne],template:'\n <mat-form-field [hidden]="hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput\n [disabled]="!enabled" [(ngModel)]="formattedAmount"\n (blur)="chg()" (click)="click_select_allf($event);"\n (focus)="removeCurrencyPipeFormat($event);select_allf($event);"\n [pattern]="pattern">\n </mat-form-field>\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Tt])],t)}(),Fe=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.separator=",",this.title="",this.sql="",this.single_sel=!1,this.sel_values=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.doFill=function(){this.single_sel||this.cmb_sel.setByDescri(this.sel_values),this.cmb_sel.sql=this.sql,this.cmb_sel.types=this.types,this.cmb_sel.values=this.values,this.cmb_sel.fillCombo()},t.prototype.ok=function(){""!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObjects()):this.toastr.error("Selezionare un valore")},t.prototype.ok_single=function(){this.single_sel&&this.dialogRef.close(this.cmb_sel.getObjects())},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It}]},yt([e.ViewChild("cmb_sel"),St("design:type",Ut)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"fhlistpick",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="min-width:700px;min-height:500px;font-size: 12px">\n <FHList #cmb_sel [label]="label" [single_sel]="single_sel" [separator]="separator" style="width:100%;height:100%" init_fill="false" (selchange)="ok_single()"></FHList>\n\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n<div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button mat-flat-button color="primary" *ngIf="!single_sel" (click)="ok()">OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">ANNULLA</button>\n</div>\n </mat-dialog-actions>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It])],t)}(),Pe=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.salva_esci=function(){this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="salva_esci()">SALVA ED ESCI</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="esci_senza_salv()">ESCI SENZA SALVATAGGIO</button>\n\n </div>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),je=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.lbl="",this.nota="",this.nota_commento="",this.title="ASSEGNA DOCUMENTO",this.comm_notrequired=0,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,console.log(" this.comm_notrequired ",this.comm_notrequired),this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.arrAutori=this.m_appService.getState().wkf_doc_info.arrAutori;for(var o=0;o<this.arrAutori.length;o++)null==this.arrAutori[o].username&&(this.arrAutori[o].username=this.arrAutori[o].idp);2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)")}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(0!=this.comm_notrequired||""!=this.nota)if(0!=this.up.getSelArr().length){var t=new Object;t.nota=this.nota,t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0});else this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",te)],t.prototype,"up",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h4 mat-dialog-title>{{title}}\n </h4>\n <div mat-dialog-content fxLayout="column" style="font-size:12px;min-width: 750px">\n <div style="width:100%;height:450px">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n </div>\n <div *ngIf="comm_notrequired!=1">\n <br>\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Commento {{nota_commento}}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n </div>\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),ze=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.utenti="",this.lbl="",this.nota="",this.nota_commento="",this.title="COMMENTI",this.comm_notrequired=0,this.mobile=!1,this.comm_notrequired=this.m_appService.getState().wkf_doc_info.comm_notrequired,console.log(" this.comm_notrequired ",this.comm_notrequired),this.title=this.m_appService.getState().wkf_doc_info.title,this.lbl=this.m_appService.getState().wkf_doc_info.lbl,this.utenti=this.m_appService.getState().wkf_doc_info.utenti,2==this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){0!=this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.close=function(){this.dialogRef.close("abort")},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar>\n <div style="font-size:10px" *ngIf="mobile">{{lbl}}</div>\n <div *ngIf="!mobile">{{lbl}}</div>\n\n\n </mat-toolbar>\n <br>\n <div mat-dialog-content style="min-width:800px;font-size: 12px;">\n <div *ngIf="mobile && utenti?.toLocaleLowerCase().indexOf(\'system\')==-1" style="font-size:10px">Assegnata a: {{utenti}}</div>\n <h3 *ngIf="!mobile && utenti?.toLocaleLowerCase().indexOf(\'system\')==-1">Assegnata a: {{utenti}}</h3>\n <br>\n <mat-form-field [hidden]="comm_notrequired==1" appearance="outline" floatLabel="always"><mat-label>Commento {{nota_commento}}</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="6"></textarea>\n </mat-form-field>\n\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">ANNULLA</button>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),Ue=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.myData=this.m_appService.getState().wkf_doc_info.canali_arr,this.selval="-1"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar>SELEZIONA AMBITO\n <div style="width:100%;text-align: right;">\n\n\n </div>\n\n </mat-toolbar>\n <div mat-dialog-content><br><br>\n <mat-form-field style="width:100%" appearance="outline" floatLabel="always"><mat-label>Seleziona Ambito:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" >\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app}}" *ngFor="let app of myData">{{app}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">OK</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),Ve=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i,this.selval="-1",this.errorMsg="",this.OK_BUTTON="OK",this.setStepCombo(this.m_appService.getState().wkf_doc_info.livs,this.m_appService.getState().wkf_doc_info.st,this.m_appService.getState().wkf_doc_info.cl)}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.sc=function(){if(this.OK_BUTTON="OK","-1"!=this.selval)for(var t=0;t<this.myData.length;t++){if(Number(this.selval).valueOf()+0==this.myData[t].livello+0){this.OK_BUTTON="OK ("+this.myData[t].descri_livello+")";break}}},t.prototype.setStepCombo=function(t,e,i){for(var n=e.split("|"),o=new Array,s=0;s<n.length;s++)for(var r=0;r<t.length;r++){if("*N"==n[s].toString().toUpperCase()){(a={descri_livello:"Prosegui a step successivo"}).g=0==s?1:0,a.livello="*N",o.push(a);break}if("*C"==n[s].toString().toUpperCase()){var a;(a={descri_livello:"Prosegui a chiusura"}).g=0==s?1:0,a.livello="*C",o.push(a);break}if(n[s]==t[r].livello&&n[s]!=i.livello){t[r].g=0==s?1:0,o.push(t[r]);break}}1==o.length&&this.dialogRef.close(o[0].livello),this.myData=o},t.prototype.ok=function(){null!=this.selval&&"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE LO STEP SUCCESSIVO",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},yt([e.ViewChild("cmb"),St("design:type",_.MatSelect)],t.prototype,"smtr",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="font-size: 12px;">\n <mat-toolbar style="max-width:500px">SELEZIONA PROSSIMO STEP:\n\n </mat-toolbar>\n <mat-dialog-content style="max-width:500px;font-size:12px"><br><br>\n <mat-form-field appearance="outline" floatLabel="always" style="width:100%"><mat-label>Seleziona Prossimo Step:</mat-label>\n <mat-select #cmb [(ngModel)]="selval" (change)="sc()">\n <mat-option value="-1">Seleziona</mat-option>\n <mat-option value="{{app.livello}}" *ngFor="let app of myData">{{app.descri_livello}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()">{{OK_BUTTON}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </div>\n <br><br>\n </mat-dialog-content>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),qe=function(){function t(t,e,i,n,o){this.dialogRef=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.enabled=!0,this.access_control=!0,this.App="",this.K="",this.title="ALLEGATI",this.sovrascrivi_path=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.App=t.app_s.getState().wkf_doc_info.uiid_app,t.K=t.app_s.getState().wkf_doc_info.uiid_doc,t.init(t.App,t.K)}))},t.prototype.init=function(t,e){this.App=t,this.K=e,this.upc.init(this.App,this.K)},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:Mt},{type:n.ToastrService},{type:l.MatDialog},{type:It}]},yt([e.ViewChild("upc"),St("design:type",Yt)],t.prototype,"upc",void 0),t=yt([e.Component({selector:"wkf_win_upload",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n <mat-toolbar color="primary" style="width:90%;"><div fxFlex="20">{{title}}</div>\n <div fxLayout="row" fxLayoutAlign="center end" fxFlex="90" >\n\n\n </div>\n </mat-toolbar>\n <mat-dialog-content style="font-size:12px">\n<FHUploadPanel [enabled]="enabled" #upc [access_control]="access_control" [sovrascrivi_path]="sovrascrivi_path"></FHUploadPanel>\n </mat-dialog-content>\n <br><br>\n <div style="width:100%;text-align:center;" >\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">CHIUDI</button>\n\n </div>\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,Mt,n.ToastrService,l.MatDialog,It])],t)}(),Be=function(){function t(t,e,i,n){this.dialogRef=t,this.m_appService=e,this.toastr=i,this._dataService=n,this.title="SELEZIONA CHI NOTIFICARE"}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_arr=function(t){this.up.user_sel=new Array,this.up.users_list_sel=new Array,this.up.users_list=new Array;for(var e=0;e<t.length;e++)null==t[e].username&&(t[e].username=t[e].idp),this.up.users_list_sel.push(t[e]),this.up.users_list.push(t[e]);this.up.filtra()},t.prototype.ok=function(){if(0!=this.up.getSelArr().length){var t=new Object;t.arrsel=this.up.getSelArr(),this.dialogRef.close(t)}else this.toastr.error("ERRORE","SELEZIONARE ALMENO UN UTENTE",{timeOut:1e3,progressBar:!0})},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService},{type:Mt}]},yt([e.ViewChild("up"),St("design:type",te)],t.prototype,"up",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px;font-size: 12px;">\n\n <div style="height:370px;">\n <FHPickUsers #up [vis_buttons]="false"></FHPickUsers>\n </div>\n <br>\n\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="close()">ANNULLA</button>\n </div>\n\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService,Mt])],t)}(),He=function(){function t(t,e,i){this.http=t,this.app_s=e,this.toastr=i,this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT}return t.prototype.doQuery=function(t,e){var n=this;void 0===e&&(e=!0);var s=!1;if(null==this.app_s.user_isadmin?this.app_s.dev_mode=null:"1"!=this.app_s.user_isadmin?this.app_s.dev_mode=null:null!=this.app_s.dev_mode&&"1"==this.app_s.dev_mode&&(s=!0),s){var r=this.app_s.user;"send_wkf_mail"==t.sql&&(null==t.values[9]&&(t.values[9]=""),this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[1]),t.values[3]=t.values[3]+"\n\n DEST. ORIGINALI:"+t.values[1],t.values[1]=r),"send_mail"==t.sql&&(this.toastr.info("DEBUG - MESSAGGIO NON INVIATO DESTINARI ORIGINALI: "+t.values[3]),t.values[2]=t.values[2]+"\n\n DEST. ORIGINALI:"+t.values[3],t.values[1]=r)}this.headers=new i.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=this.app_s.API_ENDPOINT+this.app_s.WKF_ENDPOINT;var a=JSON.stringify(t);return this.http.post(this.url,a,{headers:this.headers}).pipe(o.map((function(t){var i;if(t?"KO"===t.result_msg&&(i=new Error(t.msg)):i=new Error("Empty server response"),i)throw console.error(i),e&&n.toastr.error(i.message),new Error(i);return t||new Et})),o.catchError((function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t})))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:It},{type:n.ToastrService}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](i.HttpClient),e["ɵɵinject"](It),e["ɵɵinject"](n.ToastrService))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[i.HttpClient,It,n.ToastrService])],t)}(),Ke=function(){function t(t,e,i,n,o,s,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=r,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.not_comm=!1,this.not_comm_disabled=!1,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.commento,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var t=this,e=new Dt;e.sql="SELECT_COMMENTI_DOCUMENTO",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.commenti_list=e.result_data;for(var i=0;i<t.commenti_list.length;i++)t.commenti_list[i].v_commento="<b>"+t.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";t.title="COMMENTI"}}),(function(t){}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");2!=this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(Fe,{disableClose:!0});setTimeout((function(){e.componentInstance.title="Selezione almeno un gruppo da notificare",e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new Dt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.select_destinatari=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Be,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){void 0===p&&(p=!0),void 0===u&&(u="");var c=new Dt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))},t.prototype.ok_op=function(t){var e=this;if(void 0===t&&(t=""),this.b_ins){(i=new Dt).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0});var o=new At;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}))}else{var i;(i=new Dt).sql="UPDATE_WKF_COMMENTO",i.types=["string","string","string"],i.values=[this.nota,this.edit_id,t];this._dataService.doQuery(i).subscribe((function(i){var n=!1;if(null!=i&&"OK"==i.result_msg){e.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0});var o=new At;o.command="exec_app",o.p1="insert_update_comment",o.p2=e.m_appService.getState().wkf_doc_info.uiid_app+"|"+e.m_appService.getState().wkf_doc_info.uiid_doc+"|"+e.edit_id,e.m_file.doQuery(o,!1).subscribe(),n=!0,e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""),e.refresh_list()}n||e.toastr.error("ERRORE",i.msg)}),(function(t){}))}},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(zt).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="COMMENTI")}))},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Mt},{type:He},{type:Ct}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar color="primary">{{title}}\n <span class="fill-remaining-space"></span>\n <button color="primary" (click)="ins()" *ngIf="!b_edit">\n <mat-icon>note_add</mat-icon>\n INSERISCI\n </button>\n\n </mat-toolbar>\n <br>\n <div mat-dialog-content style="min-width:800px;font-size: 12px;" >\n\n <mat-form-field *ngIf="b_edit" appearance="outline" floatLabel="always"><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [disabled]="not_comm_disabled" [(ngModel)]="not_comm" [hidden]="notifica_commenti==0 || (notifica_commenti==1 && lettori==\'\')">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <section class="bs" *ngIf="!b_edit">\n <table style="min-width: 100%" class="fh_table">\n <thead>\n <tr>\n <th>Commento</th>\n <th width="15%">Autore</th>\n <th width="15%">Data</th>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let app of commenti_list;let odd=odd; let even=even;index as i" [ngClass]="{ odd: odd, even: even }" >\n\n <td [innerHTML]="app.v_commento"></td>\n <td>{{app.COGNOME + \' \' + app.NOME}}</td>\n <td>{{app.data_creazione | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td><mat-icon [matTooltip]="app.dest_notif" *ngIf="app.dest_notif!=null && app.dest_notif!=\'\'">mail</mat-icon></td>\n <td>\n <mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user"\n (click)="edit_comm(app)">edit\n </mat-icon>\n </td>\n\n </tr>\n </tbody>\n </table>\n </section>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="close()">CHIUDI</button>\n\n </div>\n\n\n ',styles:["\n\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,l.MatDialog,It,n.ToastrService,Mt,He,Ct])],t)}(),Ge=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toast=i,this.hide_richiedente=!1,this.load_info()}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.load_info=function(){var t=this;null!=this.m_appService.getState().wkf_doc_info&&null!=this.m_appService.getState().wkf_doc_info.codice?(this.codice=this.m_appService.getState().wkf_doc_info.codice,this.data_richiesta=this.m_appService.getState().wkf_doc_info.data_richiesta,this.richiedente=this.m_appService.getState().wkf_doc_info.richiedente,this.stato=this.m_appService.getState().wkf_doc_info.stato,this.in_carico_a=this.m_appService.getState().wkf_doc_info.in_carico_a,this.uiid_app=this.m_appService.getState().wkf_doc_info.uiid_app,this.uiid_doc=this.m_appService.getState().wkf_doc_info.uiid_doc,this.canale=this.m_appService.getState().wkf_doc_info.canale):setTimeout((function(){t.load_info()}),500)},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:n.ToastrService}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <mat-toolbar color="primary">INFO DOCUMENTO\n <div style="width:100%;text-align: right;">\n </div>\n </mat-toolbar>\n <div mat-dialog-content style="font-size: 12px;">\n\n <table class="fh_table">\n\n <tbody>\n <tr class="odd">\n\n <td>Codice:</td>\n <td><b>{{codice}}</b></td>\n </tr>\n <tr class="even">\n\n <td>Data:</td>\n <td><b>{{data_richiesta | date: \'dd/MM/yyyy hh:mm:ss\'}}</b></td>\n </tr>\n <tr *ngIf="!hide_richiedente" class="odd">\n\n <td>Richiedente:</td>\n <td><b>{{richiedente}}</b></td>\n\n </tr>\n <tr class="even">\n\n <td>Stato:</td>\n <td><b>{{stato}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>In Carico a:</td>\n <td><b>{{in_carico_a}}</b></td>\n\n </tr>\n\n <tr class="even" *ngIf="m_appService.dev_mode">\n\n <td>Uiid App:</td>\n <td><b>{{uiid_app}}</b></td>\n\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n\n <td>Uiid Doc:</td>\n <td><b>{{uiid_doc}}</b></td>\n\n </tr>\n <tr class="odd" *ngIf="m_appService.dev_mode">\n\n <td>Grp:</td>\n <td><b>{{canale}}</b></td>\n\n </tr>\n </tbody>\n </table>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;">\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,It,n.ToastrService])],t)}(),Ye=function(){function t(t,e,i,n,o,s,r){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.m_file=r,this.ossv=!1,this.not_comm=!1,this.not_comm_disabled=!1,this.b_flussook=!0,this.logs=new Array,this.notifica_commenti=1,this.notifica_commenti_obbl=0,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.commenti_insert=!1,this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.init_v=function(){this.notifica_commenti>0&&1==this.notifica_commenti_obbl&&(this.not_comm=!0,this.not_comm_disabled=!0)},t.prototype.load_graph=function(){var t=this,e=new Dt;e.sql="SELECT_WKF_BY_ID",e.types=["string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(e.result_data.length>0&&null!=e.result_data[0].diagramma_flusso&&""!=e.result_data[0].diagramma_flusso){for(var i=!1,n=0;n<t.logs.length;n++)-1==t.logs[n].id_comment&&(null!=t.logs[n].liv_ini&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_ini+'"').join('bpmnElement="STEP_'+t.logs[n].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),i||null!=t.logs[n].liv_fin&&(e.result_data[0].diagramma_flusso=e.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+t.logs[n].liv_fin+'"').join('bpmnElement="STEP_'+t.logs[n].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),i=!0));return void t.modeler.importXML(e.result_data[0].diagramma_flusso,(function(e){e?t.b_flussook=!1:t.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0})}))}t.b_flussook=!1}}))},t.prototype.annulla=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler annullare l'inserimento del commento?"),this.m_dialogRef.open(zt).afterClosed().subscribe((function(e){e&&(t.nota="",t.b_edit=!1,t.title="LOG WORKFLOW E COMMENTI")}))},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ric_all()}),200)},t.prototype.edit_comm=function(t){this.b_edit=!0,this.b_ins=!1,this.nota=t.stato_attuale,this.edit_id=t.id_comment,this.title="MODIFICA COMMENTO"},t.prototype.refresh_list=function(){var t=this,e=new Dt;e.sql="SELECT_WORKFLOW_LOG",e.types=["string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc];this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){t.logs=e.result_data;for(var i=0;i<t.logs.length;i++)t.logs[i].v_commento="<b>"+t.logs[i].operazione.replace(/\n/g,"<br/>")+"</b>";t.ossv||(t.modeler=new R({container:"#canvas",width:"97%",height:"100%",readonly:!0})),t.load_graph(),t.ossv=!0,!0}}))},t.prototype.ok=function(){if(this.not_comm){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");1==this.notifica_commenti?this.select_destinatari():this.select_destinatari_grp()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Be,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}))},t.prototype.select_destinatari_grp=function(){var t=this,e=this.m_dialogRef.open(Fe,{disableClose:!0});setTimeout((function(){e.componentInstance.title="Selezione almeno un gruppo da notificare",e.componentInstance.types=["string"],e.componentInstance.values=[t.m_appService.getState().wkf_doc_info.uiid_app],e.componentInstance.sql="SELECT_GRP_APP_USERS",e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null!=e){if(""==e)return;for(var i="",n=0;n<e.length;n++)""!=i&&(i+=","),i=i+""+e[n].valore;var o=new Dt;o.sql="SELECT_USERS_BY_IDROLES_NOREP",o.types=["string"],o.values=[i],t._dataService.doQuery(o).subscribe((function(e){i="";for(var n=0;n<e.result_data.length;n++)""!=i&&(i+=","),i=i+""+e.result_data[n].username;t.ok_op(i)}))}}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){void 0===p&&(p=!0),void 0===u&&(u="");var c=new Dt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))},t.prototype.ok_op=function(t){var e,i=this;(void 0===t&&(t=""),this.b_ins)?((e=new Dt).sql="INSERT_WKF_COMMENTO",e.types=["string","string","string","string","string"],e.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,t],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new At;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}}))):((e=new Dt).sql="UPDATE_WKF_COMMENTO",e.types=["string","string","string","string"],e.values=[this.nota,this.edit_id],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){i.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),console.log("insert_update_comment !!!!");var n=new At;n.command="exec_app",n.p1="insert_update_comment",n.p2=i.m_appService.getState().wkf_doc_info.uiid_app+"|"+i.m_appService.getState().wkf_doc_info.uiid_doc,i.m_file.doQuery(n).subscribe(),i.b_edit=!1,""!=t&&i.sendEMail_ex(i.m_appService.getState().wkf_doc_info.curr_user,t,i.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+i.nota.split("\n").join("<br>"),i.m_appService.getState().wkf_doc_info.uiid_app,i.m_appService.getState().wkf_doc_info.uiid_doc,i.link,i.codice_doc,""),i.refresh_list()}})))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Mt},{type:He},{type:Ct}]},yt([e.ViewChild("zz"),St("design:type",L.MatTabGroup)],t.prototype,"zz",void 0),t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div style="font-size: 12px" [style.height]="(m_appService.getState().body_h-130)+\'px\'">\n <mat-tab-group #zz style="width:100%" [style.height]="(m_appService.getState().body_h-140)+\'px\'" >\n <mat-tab label="WORKFLOW" *ngIf="b_flussook">\n\n <div [style.height]="(m_appService.getState().body_h-160)+\'px\'" >\n <div style="width:100%;height:100%" id="canvas"></div>\n </div>\n\n </mat-tab>\n\n <mat-tab label="LOGS">\n\n <div fxLayout="row" fxLayoutAlign="center end" fxFlex="90" *ngIf="!b_edit && commenti_insert">\n <button mat-flat-button color="accent" (click)="ins()">\n <mat-icon>note_add</mat-icon>\n INSERISCI\n </button>&nbsp;&nbsp;&nbsp;&nbsp;\n </div>\n\n\n <div fxLayout="column" *ngIf="b_edit">\n <br>\n <mat-form-field *ngIf="b_edit" appearance="outline" floatLabel="always"><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit" fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button style="background-color: #F5F5F5" (click)="annulla()">ANNULLA</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [disabled]="not_comm_disabled" [(ngModel)]="not_comm" [hidden]="notifica_commenti==0 || (notifica_commenti==1 && lettori==\'\')">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <br><br>\n </div>\n <table *ngIf="!b_edit" class="fh_table" style="width:90%">\n <thead>\n <tr>\n <th width="15%">Data</th>\n <th width="15%">Utente</th>\n <th>Operazione</th>\n <td></td>\n <td></td>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let app of logs;let odd=odd; let even=even;index as i" [ngClass]="{ odd: odd, even: even }">\n\n <td>{{app.data_creazione | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td>{{app.nc}}</td>\n <td [innerHTML]="app.v_commento"></td>\n <td><mat-icon [matTooltip]="app.dest_notif" *ngIf="app.dest_notif!=null && app.dest_notif!=\'\'">mail</mat-icon></td>\n <td>\n <mat-icon *ngIf="i==0 && app.creatore==m_appService.getState().wkf_doc_info.curr_user"\n (click)="edit_comm(app)">edit\n </mat-icon>\n </td>\n </tr>\n </tbody>\n </table>\n\n </mat-tab>\n\n </mat-tab-group>\n </div>\n ',styles:["\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,l.MatDialog,It,n.ToastrService,Mt,He,Ct])],t)}(),Qe=function(){function t(){this.result_data=new Array}return t=yt([e.Component({template:" "})],t)}(),We=function(){function t(t,e){this.uti=t,this.app=e}return t.prototype.read=function(t,e,i){var n=this;return void 0===e&&(e=!0),void 0===i&&(i=!0),new Promise((function(o){if(null!=localStorage.getItem(t))return e?i?void o(JSON.parse(n.uti.decrypt_v2(localStorage.getItem(t)))):void o(n.uti.decrypt_v2(localStorage.getItem(t))):i?void o(JSON.parse(""+localStorage.getItem(t))):void o(localStorage.getItem(t));o(null)}))},t.prototype.write=function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0),i?n?localStorage.setItem(t,this.uti.encrypt_v2(JSON.stringify(e))):localStorage.setItem(t,this.uti.encrypt_v2(e)):n?localStorage.setItem(t,JSON.stringify(e)):localStorage.setItem(t,e)},t.prototype.delete=function(t){localStorage.removeItem(t)},t.ctorParameters=function(){return[{type:Tt},{type:It}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](Tt),e["ɵɵinject"](It))},token:t,providedIn:"root"}),t=yt([e.Injectable({providedIn:"root"}),St("design:paramtypes",[Tt,It])],t)}(),Xe=function(){function t(t,i,n,o,s,r,a){var l=this;this.localstore=t,this.uti_s=i,this._toast=n,this._dataService=o,this.m_appService=s,this.slimLoadingBarService=r,this.m_dialog=a,this.tbl_name="",this.count_tbl_name="",this.num_per_pag=5e3,this.grid_key="PRO_H",this.sort_field="",this.fields="*",this.filters="1=1",this.auto_height=!1,this.abilita_export=!0,this.enabled_pag=!0,this.show_help=!0,this.show_num_elem=!0,this.system_dest=1,this.header_h=35,this.g_width="100%",this.g_height="100%",this.init_fill=!0,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new e.EventEmitter,this.cell_edited=new e.EventEmitter,this.clicked=new e.EventEmitter,this.dclicked=new e.EventEmitter,this.columndclicked=new e.EventEmitter,this.cell_clicked=new e.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new e.EventEmitter,this.off_set=0,this.b_restored=!1,this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,defaultColDef:{resizable:!0,sortable:!0},rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return l.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"clientSide",localeText:{page:"pagina",more:"altre",to:"a",of:"di",next:"prossima",last:"ultima",first:"prima",previous:"precedente",loadingOoo:"Caricamento...",selectAll:"Seleziona Tutto",searchOoo:"Trova...",blanks:"Vuoto",filterOoo:"Filtro...",applyFilter:"Applica Filtro...",equals:"Uguale",notEqual:"Diverso",lessThan:"Minore",greaterThan:"Maggiore",notContains:"Non Contiene",contains:"Contiene",startsWith:"Inizia Con",endsWith:"Finisce Con",group:"Gruppo",columns:"Colonne",rowGroupColumns:"Colonne Pivot",rowGroupColumnsEmptyMessage:"trascina le colonne per raggrupparle",valueColumns:"Colonne Valore",pivotMode:"Modalità Pivot",groups:"Gruppi",values:"Valori",pivots:"Pivots",valueColumnsEmptyMessage:"trascina le colonne per aggreare",pivotColumnsEmptyMessage:"trascina le colonne per pivot",noRowsToShow:"nessun dato",pinColumn:"Sposta Colonna",valueAggregation:"Aggregazione",autosizeThiscolumn:"Autosize colonna",autosizeAllColumns:"Autosize tutte le colonne",groupBy:"Raggruppa per",ungroupBy:"Spacca per",resetColumns:"Resetta queste colonna",expandAll:"Espandi",collapseAll:"Chiudi",toolPanel:"Impostazioni",pinLeft:"Sposta <<",pinRight:"Sposta >>",noPin:"Sposta <>",sum:"Somma",min:"Minimo",max:"Massimo",none:"Nessuno",count:"Numero",average:"Media",copy:"Copia",ctrlC:"ctrl n C",paste:"Incolla",ctrlV:"ctrl n C"},getRowNodeId:function(t){return null!=t.ID?String(t.ID):null!=t.id?String(t.id):null!=t.uiid?t.uiid:null!=t.codice?t.codice:null!=t.id_doc?t.id_doc:null!=t.ord?t.ord:void 0}},this.b_init=!1,this.b_init1=!1,this.errorMsg="",this.innerWidth=750,this.show_pulisci_filtri=!1,this.num_r=0,this.ready=!1,this.ckk_ed=!1,this.myData=new Array,this.b_iniended=!1,this.ric_libera="",this.fix_flt="",this.fix_flt_temp="",null==this.m_appService.getState().grid_obj&&(this.m_appService.getState().grid_obj=new Object)}return t.prototype.ensure_visible=function(){if(!this.b_ensure){this.b_ensure=!0;try{null!=localStorage.getItem(this.grid_key+"_POS")&&(this.gridOptions.api.ensureIndexVisible(parseInt(localStorage.getItem(this.grid_key+"_POS"))),localStorage.removeItem(this.grid_key+"_POS"))}catch(t){console.log(t)}}},t.prototype.ck_flag=function(){this.toggle_mantieni.checked?localStorage.setItem(this.grid_key+"_MANTIENI","NO"):localStorage.setItem(this.grid_key+"_MANTIENI","SI")},t.prototype.refresh_all_rows=function(){this.gridOptions.api.refreshCells({force:!0})},t.prototype.ch_config=function(){this.curr_config=this.gf.getValue(),"-1"!=this.curr_config&&(localStorage.removeItem(this.grid_key+"_COLS"),localStorage.removeItem(this.grid_key+"_SORT"),localStorage.removeItem(this.grid_key+"_FILTER"),localStorage.removeItem(this.grid_key+"_CFG_DEFAULT"),null!=this.gf.getObj().COL&&""!=this.gf.getObj().COL&&localStorage.setItem(this.grid_key+"_COLS",this.gf.getObj().COL),null!=this.gf.getObj().SORT&&""!=this.gf.getObj().SORT&&localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),null!=this.gf.getObj().FILTER&&""!=this.gf.getObj().FILTER&&localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),null!=this.gf.getDescri()&&"-1"!=this.gf.getDescri()&&localStorage.setItem(this.grid_key+"_CFG_DEFAULT",this.gf.getDescri()),this.curr_config=this.gf.getValue(),this.res_columns(!0))},t.prototype.edit_config=function(){var t=this;localStorage.setItem(this.m_appService.COMPANY_KEY+"title_dialog","Conferma Operazione"),localStorage.setItem(this.m_appService.COMPANY_KEY+"msg_dialog","Confermi di voler sovrascrivere la configurazione "+this.gf.getDescri()+"?"),this.m_dialog.open(zt,{disableClose:!0}).afterClosed().subscribe((function(e){if(e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[t.gf.getDescri(),t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),t.errorMsg=e.msg}),(function(t){}))}}))},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var t=this;this.win_opt=this.m_dialog.open(Xt,{disableClose:!0}),setTimeout((function(){t.win_opt.componentInstance.title="Salva Configurazione",t.win_opt.componentInstance.label="Nome"})),this.win_opt.afterClosed().subscribe((function(e){if(e&&null!=e){var i=new Dt;i.sql="INSERT_UPDATE_CFG_GRID";var n="",o="",s="";null!=localStorage.getItem(t.grid_key+"_COLS")&&(n=localStorage.getItem(t.grid_key+"_COLS")),null!=localStorage.getItem(t.grid_key+"_SORT")&&(o=localStorage.getItem(t.grid_key+"_SORT")),null!=localStorage.getItem(t.grid_key+"_FILTER")&&(s=localStorage.getItem(t.grid_key+"_FILTER")),i.types=["string","string","string","string","string","string"],i.values=[e,t.grid_key,n,o,s,t.m_appService.user];t._dataService.doQuery(i).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(t._toast.info("Configurazione salvata"),i=!0,t.gf.types=["string"],t.gf.values=[t.grid_key],t.gf.fillCombo()),i||(t.errorMsg=e.msg)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}))}}))},t.prototype.getContextMenuItems=function(){var t=this,e=["autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel",{name:"Esporta",action:function(){t.onBtExport()}}];return this.abilita_export||(e=new Array("autoSizeAll","expandAll","contractAll","copy","copyWithHeaders","paste","toolPanel")),e},t.prototype.onBtExport=function(){var t=this,e={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(e){if(e.value){if(null==e.value)return"";if("function"==typeof e.value.getMonth)return t.uti_s.pad(e.value.getDate(),2)+"/"+t.uti_s.pad(e.value.getMonth()+1,2)+"/"+e.value.getFullYear();if(24==e.value.length&&e.value.indexOf(":00.000Z")>-1){var i=new Date(e.value);return t.uti_s.pad(i.getDate(),2)+"/"+t.uti_s.pad(i.getMonth()+1,2)+"/"+i.getFullYear()+" "+t.uti_s.pad(i.getHours(),2)+":"+t.uti_s.pad(i.getMinutes(),2)}return e.value}}};this.gridOptions.api.exportDataAsExcel(e)},t.prototype.setHeaderHeight=function(t){this.header_h=t,this.gridOptions.api.setHeaderHeight(this.header_h)},t.prototype.getRowNodeId=function(t){return null==t?this.uti_s.newGuid():null==t.data?this.uti_s.newGuid():null!=t.data.id?String(t.data.id):null!=t.data.uiid?t.data.uiid:null!=t.data.codice?t.data.codice:"NA"},t.prototype.ngAfterViewInit=function(){},t.prototype.okr=function(t){t.data.nome_colonna=t.column.colDef.field,this.cell_edited.emit(t.data)},t.prototype.help_window=function(){this.m_dialog.open(Wt,{disableClose:!0}).afterClosed().subscribe((function(t){}))},t.prototype.autoSizeAll=function(){var t=[];this.columnDefs.forEach((function(e){t.push(e.field)})),this.gridOptions.columnApi.autoSizeColumns(t),this.save_cfg()},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var t=0;return this.gridOptions.api.forEachNode((function(e){e.isSelected()&&t++})),t},t.prototype.getquerySelected=function(t,e){var i="";return"String"==e&&this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i=i+"'"+e.data[t]+"'")})),"Number"==e&&(console.log("CERCO SEL"),this.gridOptions.api.forEachNode((function(e){e.isSelected()&&null!=e.data[t]&&(""!=i&&(i+=","),i+=e.data[t])}))),i},t.prototype.selectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!0)}))},t.prototype.deselectAllFiltered=function(){var t=this;this.gridOptions.api.forEachNode((function(e){t.gridOptions.api.selectNode(e,!1)}))},t.prototype.pulisci_filtri=function(t){void 0===t&&(t=!0),localStorage.removeItem(this.grid_key+"_FILTER"),t&&(this.ric_libera=""),this.fix_flt_temp="",this.gridOptions.api.setFilterModel(null),this.show_pulisci_filtri=!1},t.prototype.init_conf=function(){},t.prototype.createColumnDefs=function(t){},t.prototype.ckk=function(){var t=this;null!=this.columnDefs&&0!=this.columnDefs.length?this.ckk_ed||(this.ckk_ed=!0,null!=this.toggle_mantieni&&(this.toggle_mantieni.checked=!0,null!=localStorage.getItem(this.grid_key+"_MANTIENI")&&"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.toggle_mantieni.checked=!1)),this.res_columns(),null!=localStorage.getItem(this.grid_key+"_POS")&&(this.b_restored=!0),this.init_fill&&setTimeout((function(){t.ref_dt()}),100)):setTimeout((function(){t.ckk()}),500)},t.prototype.res_columns=function(t){void 0===t&&(t=!1);var e=!1;if(null!=this.toggle_mantieni&&(e=this.toggle_mantieni.checked),null!=localStorage.getItem(this.grid_key+"_COLS")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_COLS")){!0;try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")))}catch(t){console.log(t)}}try{this.gridOptions.api.setSortModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_SORT")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_SORT"))try{this.gridOptions.api.setSortModel(JSON.parse(localStorage.getItem(this.grid_key+"_SORT")))}catch(t){console.log(t)}try{this.gridOptions.api.setFilterModel(null)}catch(t){console.log(t)}if(null!=localStorage.getItem(this.grid_key+"_FILTER")&&(e||t)&&""!=localStorage.getItem(this.grid_key+"_FILTER"))try{this.gridOptions.api.setFilterModel(JSON.parse(localStorage.getItem(this.grid_key+"_FILTER")))}catch(t){console.log(t)}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.setRows=function(){var t=this;console.log("m_appService ",this.m_appService),console.log("localstore ",this.localstore),console.log(this.m_appService.COMPANY_KEY+this.tbl_name),this.localstore.read(this.m_appService.COMPANY_KEY+this.tbl_name).then((function(e){t.rowData=e}))},t.prototype.sortAndFilter=function(t,e){},t.prototype.ref_dt=function(){var t=this;null==this.gridOptions?setTimeout((function(){t.ref_dt()}),500):null==this.gridOptions.api?setTimeout((function(){t.ref_dt()}),500):this.setRows()},t.prototype.updateRow=function(){this.refresh_all_rows()},t.prototype.onModelUpdated=function(){},t.prototype.onReady=function(t){if(this.setHeaderHeight(this.header_h),null==this.gf||(this.gf.sql="SELECT_CFG_GRID",this.gf.types=["string"],this.gf.values=[this.grid_key],this.gf.fillCombo(),"NO"==localStorage.getItem(this.grid_key+"_MANTIENI")||null==localStorage.getItem(this.grid_key+"_CFG_DEFAULT"))){var e=/iPad|iPhone|iPod/.test(navigator.userAgent);this.gridOptions.api.setGridAutoHeight(!e),this.onready_go()}},t.prototype.save_cfg=function(){localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.fe_cfg=function(){null!=this.gf&&null!=this.gf.getObj()&&"NO"!=localStorage.getItem(this.grid_key+"_MANTIENI")&&(this.gf.setByDescri(localStorage.getItem(this.grid_key+"_CFG_DEFAULT")),localStorage.setItem(this.grid_key+"_COL",this.gf.getObj().COLS),localStorage.setItem(this.grid_key+"_SORT",this.gf.getObj().SORT),localStorage.setItem(this.grid_key+"_FILTER",this.gf.getObj().FILTER),this.curr_config=this.gf.getValue()),this.onready_go()},t.prototype.onready_go=function(){var t=this;this.ready=!0,setTimeout((function(){t.ckk()}),10),this.b_iniended||(this.b_iniended=!0,this.init_end.emit())},t.prototype.init_filters=function(){},t.prototype.keyDownFunctioncl=function(t){13==t.keyCode&&this.free_search()},t.prototype.free_search=function(){if(""==this.ric_libera)return this.pulisci_filtri(),this.fix_flt_temp="",void this.doFill("",!0,!1);for(var t=this.ric_libera.split(" "),e=new Array,i=0;i<t.length;i++)t[i].length>2?e.push(t[i]):this._toast.error("ignorato termine: "+t[i]+" troppo corto");if(0!=e.length){for(var n="",o=0;o<this.columnDefs.length;o++)if(null!=this.columnDefs[o]&&null==this.columnDefs[o].no_filter&&null!=this.columnDefs[o].field&&""!=this.columnDefs[o].field&&"agDateColumnFilter"!=this.columnDefs[o].filter)for(i=0;i<e.length;i++)""!=n&&(n+=" or "),n=n+this.columnDefs[o].field+" LIKE '%"+this.uti_s.string_sqlvalue(e[i])+"%'";this.pulisci_filtri(!1),this.doFill_Temp(n,!0)}},t.prototype.onCellClicked=function(t){this.cell_clicked.emit(t)},t.prototype.onCellValueChanged=function(t){},t.prototype.onCellDoubleClicked=function(t){},t.prototype.onCellFocused=function(t){},t.prototype.onSelectionChanged=function(){},t.prototype.onBeforeFilterChanged=function(){},t.prototype.oncolumnEverythingChanged=function(t){this.b_init&&localStorage.setItem(this.grid_key+"_COLS",JSON.stringify(this.gridOptions.columnApi.getColumnState()))},t.prototype.onAfterFilterChanged=function(){localStorage.removeItem(this.grid_key+"_POS"),this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onFilterModified=function(){this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},t.prototype.onBeforeSortChanged=function(){},t.prototype.onAfterSortChanged=function(){this.b_init&&localStorage.setItem(this.grid_key+"_SORT",JSON.stringify(this.gridOptions.api.getSortModel()))},t.prototype.onVirtualRowRemoved=function(t){},t.prototype.onRowClicked=function(t){var e=this.gridOptions.api.getSelectedNodes();null!=e&&null!=e[0]&&(localStorage.setItem(this.grid_key+"_POS",String(e[0].rowIndex)),localStorage.setItem(this.grid_key+"_POS_BAR",JSON.stringify(this.gridOptions.api.getVerticalPixelRange())),localStorage.setItem(this.grid_key+"_POS2",this.getRowNodeId(e[0]))),this.sRow=t.data,this.clicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&(this.columndclicked.emit(t),this.dclicked.emit(t.data))},t.prototype.onRowDClicked=function(t){this.dclicked.emit(t.data),/iPad|iPhone|iPod/.test(navigator.userAgent)&&this.columndclicked.emit(t)},t.prototype.onQuickFilterChanged=function(t){this.gridOptions.api.setQuickFilter(t.target.value)},t.prototype.onColumnEvent=function(t){this.columndclicked.emit(t)},t.prototype.doFill=function(t,e,i){var n=this;void 0===e&&(e=!0),void 0===i&&(i=!0),e&&(this.filters=""),i&&(this.fix_flt=t),this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){n.ckk()}),10)},t.prototype.doFill_Temp=function(t,e){var i=this;void 0===e&&(e=!0),e&&(this.filters=""),this.fix_flt_temp=t,this.ckk_ed=!1,this.b_init=!0,this.init_fill=!0,setTimeout((function(){i.ckk()}),10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.ctorParameters=function(){return[{type:We},{type:Tt},{type:n.ToastrService},{type:Mt},{type:It},{type:d.SlimLoadingBarService},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"tbl_name",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"columnDefs",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"count_tbl_name",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"num_per_pag",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"grid_key",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sort_field",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"fields",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"filters",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"auto_height",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"abilita_export",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled_pag",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_help",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_num_elem",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"system_dest",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"header_h",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"g_width",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"g_height",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label_elementi",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"trova_label",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"mantieni_impostazioni",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"show_buttons",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fill_end",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_edited",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"clicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"dclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"columndclicked",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"cell_clicked",void 0),yt([e.ViewChild("gf"),St("design:type",qt)],t.prototype,"gf",void 0),yt([e.ViewChild("toggle_mantieni"),St("design:type",m.MatSlideToggle)],t.prototype,"toggle_mantieni",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"init_end",void 0),yt([e.Input(),St("design:type",Number)],t.prototype,"off_set",void 0),yt([e.ViewChild("testom",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"testom",void 0),yt([e.ViewChild("myModalNormal",{read:e.ViewContainerRef}),St("design:type",Object)],t.prototype,"myModalNormal",void 0),t=yt([e.Component({selector:"FHGridJSON",template:'\n <table [hidden]=\'!show_buttons\' style="height: 15%;">\n <tr>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'><h5>{{num_r + label_elementi}}</h5>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n </td>\n <td style="vertical-align:\'bottom\'">&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{trova_label}}</mat-label>\n <input matInput (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera"\n style="width:200px">\n </mat-form-field>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile">&nbsp;&nbsp;&nbsp;<button\n *ngIf="show_pulisci_filtri" mat-flat-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>clear</mat-icon>&nbsp;&nbsp;REMOVE FILTER\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon>&nbsp;&nbsp;AUTO SIZE\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> &nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon>&nbsp;&nbsp;FIT SIZE\n </button>\n\n </td>\n\n </tr>\n </table>\n <div [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="!show_buttons && !this.m_appService.getState( ).mobile && show_num_elem"><h5>\n {{num_r + \' Elementi\'}}</h5></div>\n\n <ag-grid-angular ref-agGrid style="width:100%;height:85%;" (cellDoubleClicked)="onColumnEvent($event)"\n (cellClicked)="onCellClicked($event)" [headerHeight]="header_h" [groupHeaderHeight]="header_h"\n class="ag-theme-balham" [singleClickEdit]="true" [gridOptions]="gridOptions"\n [columnDefs]="columnDefs"\n [rowData]="rowData"\n (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()"\n (rowDoubleClicked)="onRowDClicked($event)"\n (rowClicked)="onRowClicked($event)" (columnVisible)="oncolumnEverythingChanged($event)"\n (columnResized)="oncolumnEverythingChanged($event)"\n (columnMoved)="oncolumnEverythingChanged($event)" (cellValueChanged)="okr($event)"\n (sortChanged)="onAfterSortChanged()" [paginationPageSize]="num_per_pag"\n (gridReady)="onReady($event)">\n </ag-grid-angular>\n\n\n ',styles:["\n\n "]}),St("design:paramtypes",[We,Tt,n.ToastrService,Mt,It,d.SlimLoadingBarService,l.MatDialog])],t)}(),$e=function(){function t(){this.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.command=new e.EventEmitter}return t.prototype.refresh_access=function(t){this.toolbar_wkfapp=t},t.prototype.exec_command=function(t){this.command.emit({cmd:t})},t.prototype.insert_doc=function(){this.command.emit({cmd:"insert_doc"})},t.prototype.annulla_imp=function(){this.command.emit({cmd:"annulla_imp"})},t.prototype.recupera_richiesta=function(){this.command.emit({cmd:"recupera_richiesta"})},t.prototype.riassegna_richiesta=function(){this.command.emit({cmd:"riassegna_richiesta"})},t.prototype.sostituisci_utente=function(){this.command.emit({cmd:"sostituisci_utente"})},t.prototype.test_utente=function(){this.command.emit({cmd:"test_utente"})},t.prototype.annulla_richiesta=function(){this.command.emit({cmd:"annulla_richiesta"})},t.prototype.new_doc=function(){this.command.emit({cmd:"new_doc"})},t.prototype.del_doc=function(){this.command.emit({cmd:"del_doc"})},yt([e.Input(),St("design:type",String)],t.prototype,"type",void 0),yt([e.Input(),St("design:type",se)],t.prototype,"toolbar_wkfapp",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"custom_commands",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"command",void 0),t=yt([e.Component({selector:"FHGridToolBar",template:'\n <div *ngIf="type==\'WKF_NO_EDIT\'" fxLayoutGap="3px" fxLayout="row" fxFlex="100" fxLayoutAlign="end center" style="background-color: #CC0000">\n\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n\n\n <button mat-flat-button color="warn" mat-button fxHide fxShow.gt-sm [matMenuTriggerFor]="gest_menu" *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin || toolbar_wkfapp?.is_PowerUser"><mat-icon>label_important</mat-icon>&nbsp;&nbsp;&nbsp;{{\'Gestione\' | translate}}</button>\n <mat-menu #gest_menu="matMenu" >\n <button mat-menu-item style="background-color: #F5F5F5" (click)="annulla_richiesta()"> {{\'ANNULLA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item style="background-color: #F5F5F5" (click)="recupera_richiesta()"> {{\'RECUPERA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item style="background-color: #F5F5F5" (click)="riassegna_richiesta()" *ngIf="toolbar_wkfapp?.is_Supervisor || toolbar_wkfapp?.is_Admin"> {{\'RIASSEGNA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item style="background-color: #F5F5F5" (click)="sostituisci_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'SOSTITUISCI UTENTE\' | translate}} </button>\n\n <button mat-menu-item style="background-color: #F5F5F5" (click)="test_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'TEST UTENTE\' | translate}} </button>\n\n </mat-menu>\n <button mat-flat-button (click)="annulla_imp()" *ngIf="toolbar_wkfapp?.imp!=\'\'"> {{toolbar_wkfapp?.imp}} </button>\n <div *ngFor="let app of custom_commands" > &nbsp;&nbsp;<button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>&nbsp;{{app.label | translate}}</button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'WKF\'" fxLayoutGap="3px" fxLayout="row" fxLayoutAlign="end center" style="width: 100%;background-color: maroon">\n\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n\n <button mat-flat-button (click)="insert_doc()" *ngIf="toolbar_wkfapp?.is_Ins" color="accent"><mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\'INSERISCI\' | translate}}</button>&nbsp;&nbsp;&nbsp;\n\n <button mat-flat-button color="warn" mat-button fxHide fxShow.gt-sm [matMenuTriggerFor]="gest_menu" *ngIf="toolbar_wkfapp?.is_Supervisor">{{\'Gestione\' | translate}}</button>\n <mat-menu #gest_menu="matMenu" >\n <button mat-menu-item (click)="annulla_richiesta()"> {{\'ANNULLA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item (click)="recupera_richiesta()"> {{\'RECUPERA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item (click)="riassegna_richiesta()"> {{\'RIASSEGNA DOCUMENTO\' | translate}} </button>\n <button mat-menu-item (click)="sostituisci_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'SOSTITUISCI UTENTE\' | translate}} </button>\n\n <button mat-menu-item (click)="test_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'TEST UTENTE\' | translate}} </button>\n\n </mat-menu>\n <button mat-flat-button (click)="annulla_imp()" *ngIf="toolbar_wkfapp?.imp!=null && toolbar_wkfapp?.imp!=\'\'"> {{toolbar_wkfapp?.imp}} </button>\n <div *ngFor="let app of custom_commands" >\n &nbsp;&nbsp;<button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>&nbsp;{{app.label | translate}}</button>\n\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'INSERT_DELETE\'" fxLayoutGap="3px" fxLayout="row">\n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="end center">\n <button mat-flat-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon>&nbsp;&nbsp;&nbsp;{{\'INSERISCI\' | translate}}\n </button>\n\n <button mat-flat-button (click)="del_doc()" color="warn">\n <mat-icon>delete</mat-icon>&nbsp;&nbsp;&nbsp;{{\'ELIMINA\' | translate}}\n </button>\n <div *ngFor="let app of custom_commands" ><button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>{{app.label | translate}}</button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'CUSTOM\'" fxLayoutGap="3px" fxLayout="row" fxLayoutAlign="end center">\n\n <div *ngFor="let app of custom_commands" ><button mat-flat-button [color]="app.color" (click)="exec_command(app.command)"><mat-icon *ngIf="app.icon!=null">{{app.icon}}</mat-icon>{{app.label | translate}}</button>\n </div>\n </div>\n\n ',styles:["\n\n "]})],t)}(),Je=function(){function t(t,e,i,n,o,s,r,a){this.app_s=t,this.m_service=e,this.m_dataService=i,this.m_router=n,this.m_dialog=o,this.m_route=s,this.m_wkf=r,this.uti_s=a,this.m_obj={},this.save_alreadypressed=!1,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.oper="",this.b_edit_before=!1,this.all_c=0,this.comm_c=0,this.forza_canale="",this.c_canale="",this.user_nome="",this.user_cognome="",this.user_email="",this.bEdit=!1,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.hide_richiedente=!1,this.bEdit_Agg=!1,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.id_documento="",this.m_autori="",this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.errorMsg="",this.id_applicativo="",this.rich="",this.cod="",this.simple_mode=!1,this.oggetto_editable=!1,this.descrizione_editable=!1,this.btnSalva_visible=!1,this.b_PrendiInCarico=!1,this.stat_stato_text="",this.creatore_text="",this.pers_int_text="",this.rich_enabled=!1,this.oggetto_text="",this.descrizione_text="",this.btnprocedi=!1,this.b_edit=!1,this.b_valid=!0,this.s_uto="",this.b_apprf=!1}return t.prototype.init_user_i=function(){this.user_idp=this.app_s.user,this.user_nome=this.app_s.user_name,this.user_cognome=this.app_s.user_surname,this.user_email=this.app_s.user_email},t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info={},this.app_s.getState().wkf_doc_info.curr_user=this.user_idp,this.app_s.getState().wkf_doc_info.codice=this.m_obj.codice,this.app_s.getState().wkf_doc_info.data_richiesta=this.m_obj.data_richiesta,this.app_s.getState().wkf_doc_info.richiedente=this.m_obj.nc+" ("+this.m_obj.richiesta_da+")",this.app_s.getState().wkf_doc_info.in_carico_a=this.m_obj.in_carico_a,this.app_s.getState().wkf_doc_info.stato=this.m_obj.stat_stato,this.app_s.getState().wkf_doc_info.uiid_app=this.id_applicativo,this.app_s.getState().wkf_doc_info.uiid_doc=this.m_obj.id_documento,this.app_s.getState().wkf_doc_info.canale=this.m_obj.canale},t.prototype.evt_salv=function(){this.btnprocedi=!1,this.salva()},t.prototype.salva=function(){var t=this;if(!this.save_alreadypressed)if(this.save_alreadypressed=!0,setTimeout((function(){t.save_alreadypressed=!1}),1e3),""==this.m_obj.codice){if("respingi"==this.oper)return void this.alert("Errore di configurazione pratica contattare ufficio IT [0x001]",1);this.ck_canale_multiplo()}else this.save_agg()},t.prototype.doApprova=function(){this.b_respingi=!1,this.over_canale_iniz();var t=0;if(this.nlevel=null,0==this.m_obj.stato)for(var e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(this.clevel=this.livs[e],t=this.livs[e].livello);else{if(t=this.m_obj.stato,null!=this.m_obj.canale)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.m_obj.canale==this.livs[e].gruppo_parallelo){this.clevel=this.livs[e];break}if(null==this.clevel)for(e=0;e<this.livs.length;e++)if(this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||0!=this.livs[e].notifica||""!=this.c_canale&&""!=this.livs[e].gruppo_parallelo&&this.c_canale!=this.livs[e].gruppo_parallelo&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo)){this.clevel=this.livs[e];break}}if(this.clevel=this.check_n_levels(this.clevel),null!=this.clevel&&""!=this.clevel){var i=t;if("procedi"==this.oper&&1==this.clevel.salto_iniziale){t=this.clevel.livello;for(e=0;e<this.livs.length;e++)this.user_idp.toUpperCase()==this.livs[e].idp.toUpperCase()&&0==this.livs[e].notifica&&this.livs[e].livello>t&&0!=t&&this.livs[e].livello!=i&&(-1==this.limite_salto_after||this.livs[e].livello<this.limite_salto_after)&&(this.clevel=this.livs[e],t=this.livs[e].livello);for(var n=this.wkf_rule(t),o=0;o<this.livs.length;o++)if(this.livs[o].livello==n&&this.user_idp.toUpperCase()==this.livs[o].idp.toUpperCase()&&(""==this.c_canale||""==this.livs[o].gruppo_parallelo||this.c_canale==this.livs[o].gruppo_parallelo)){this.clevel=this.livs[o],t=this.livs[o].livello;break}}if("procedi"==this.oper){if(this.clevel=this.check_n_levels(this.clevel),null==this.clevel.livelli_jump&&(this.clevel.livelli_jump=""),""!=this.clevel.livelli_jump)return console.log("selectLevel "+this.clevel.livelli_jump),void this.selectLevel(this.clevel.livelli_jump);this.calcolanextandjump()}if("respingi"==this.oper){if(null==this.clevel.livelli_down&&(this.clevel.livelli_down=""),""!=this.clevel.livelli_down)return void this.selectLevel(this.clevel.livelli_down);this.alert("Errore di configurazione pratica contattare ufficio IT [0x004]",1)}}else this.alert("Errore di configurazione pratica contattare ufficio IT [0x002]",1)},t.prototype.selectLevel=function(t){var e=this;this.app_s.getState().wkf_doc_info.livs=this.livs,this.app_s.getState().wkf_doc_info.st=t,this.app_s.getState().wkf_doc_info.cl=this.clevel,this.m_dialog.open(Ve,{disableClose:!0}).afterClosed().subscribe((function(t){if(null!=t){var i=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){i=e.wkf_rule(i);var n=!1;for(o=0;o<e.livs.length;o++)e.user_idp.toUpperCase()==e.livs[o].idp.toUpperCase()&&0==e.livs[o].notifica&&e.livs[o].livello==i&&(e.nlevel=e.livs[o],i=e.livs[o].livello,n=!0);if(!n)for(o=0;o<e.livs.length;o++)if(e.livs[o].livello==i&&0==e.livs[o].notifica){e.nlevel=e.livs[o],i=e.livs[o].livello;break}e.doJump()}else{i=0;for(var o=0;o<e.livs.length;o++)e.livs[o].livello<900&&e.livs[o].livello>i&&0==e.livs[o].notifica&&(e.clevel=e.livs[o],i=e.livs[o].livello);e.calcolanextandjump()}else e.calcolanextandjump()}else e.edit_b(!0)}))},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello;for(var i=0;i<this.livs.length;i++)(0==t||t<this.livs[i].livello&&e>this.livs[i].livello)&&(this.nlevel=this.livs[i],e=this.livs[i].livello);t=this.wkf_rule(e);for(var n=!1,o=0;o<this.livs.length;o++)0!=this.livs[o].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[o].gruppo_parallelo||this.livs[o].livello==t&&(this.nlevel=this.livs[o],t=this.livs[o].livello,n=!0);if(!n)for(var s=0;s<this.livs.length;s++)if(this.livs[s].livello==t&&0==this.livs[s].notifica){this.nlevel=this.livs[s],t=this.livs[s].livello;break}var r=t,a=this.nlevel;if(2==this.nlevel.salto_iniziale){for(var l=0;l<this.livs.length;l++)a.idp.toUpperCase()==this.livs[l].idp.toUpperCase()&&0==this.livs[l].notifica&&a.gruppo_parallelo==this.livs[l].gruppo_parallelo&&this.livs[l].livello>r&&0!=r&&(this.nlevel=this.livs[l],t=this.livs[l].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var t=this;this.user_idp.toUpperCase();if(null!=this.nlevel){new Array;var e=new Array;if(""==this.clevel.gruppo_parallelo){console.log("senza gp ",this.clevel.gruppo_parallelo+" "+this.nlevel.livello);for(var i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&e.push(this.livs[i]);console.log("arrAutori ",e)}else{var n=!1;console.log("con gp ",this.clevel.gruppo_parallelo);for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&""!=this.livs[i].gruppo_parallelo&&(n=!0);console.log("canale: "+this.clevel.gruppo_parallelo);for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.nlevel.livello&&0==this.livs[i].notifica&&(console.log("canale: "+this.clevel.gruppo_parallelo+" "+this.livs[i].gruppo_parallelo),this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo&&n||(e.push(this.livs[i]),this.nlevel=this.livs[i]))}if(0!=e.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title="Avanzamento";var o="";for(i=0;i<e.length;i++)null!=e[i].nc&&-1==o.indexOf(e[i].nc)&&(""!=o&&(o+=";"),o+=e[i].nc);this.app_s.getState().wkf_doc_info.utenti="",this.nlevel.livello<900?this.app_s.getState().wkf_doc_info.lbl="Il documento verrà inviato a "+this.nlevel.descri_livello:this.app_s.getState().wkf_doc_info.lbl="La richiesta verrà chiusa con stato: "+this.nlevel.descri_livello,this.app_s.getState().wkf_doc_info.utenti=o,this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali,this.m_dialog.open(ze,{disableClose:!0}).afterClosed().subscribe((function(i){if("abort"==i)return t.edit_b(!0),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e,t.nota=i,t.OKCOM()}))}else{this.app_s.getState().wkf_doc_info.title="Assegnazione",this.app_s.getState().wkf_doc_info.comm_notrequired=this.nlevel.commenti_opzionali,this.app_s.getState().wkf_doc_info.arrAutori=e.sort((function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}));var s=this.m_dialog.open(je,{disableClose:!0});setTimeout((function(){s.componentInstance.comm_notrequired=t.nlevel.commenti_opzionali})),s.afterClosed().subscribe((function(e){if(""==e||null==e)return t.edit_b(!0),void(t.respingi_enabled&&t.resp_b(!0));t.arrUsersSelected=e.arrsel,t.nota=e.nota,t.OKCOM()}))}else this.alert("problema di configurazione il livello "+this.nlevel.descri_livello+" non presenta utenti partecipanti validi",1)}else this.alert("problema di configurazione passaggio avanti dal livello "+this.clevel.descri_livello+" non attivato comunicare al CED",1)},t.prototype.back=function(t){var e=this;t?this.m_dialog.open(Pe,{disableClose:!0}).afterClosed().subscribe((function(t){"esci_senza_salv"==t&&e.m_router.navigate([e.app_info.modulo_swf]),"salva_esci"==t&&(e.evt_salv(),e.m_router.navigate([e.app_info.modulo_swf]))})):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.OKCOM=function(){var t=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),this.m_danotificare="",this.m_autori="";for(var e="",i=0;i<this.arrUsersSelected.length;i++)1==this.nlevel.email_partecipanti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[i].idp),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[i].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[i].idp,e+=this.arrUsersSelected[i].nc);""!=this.nota&&this.insert_commento(this.id_applicativo,this.id_documento,this.nota,this.user_idp),this.m_liv=this.nlevel.livello,this.m_statox="Assegnata a:"+e,this.m_autori_paralleli="",this.m_obj.assegnati_paralleli="",this.chstato(this.m_liv),this.m_obj.stato<=10&&(null==this.m_obj.creatore||""==this.m_obj.creatore?this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp):this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.m_obj.creatore));for(i=0;i<this.livs.length;i++)this.livs[i].livello==this.m_liv&&1==this.livs[i].notifica&&(1==this.livs[i].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[i].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[i].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[i].idp));if(this.nlevel.livello>=900){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello);var n=new Dt;n.sql="UPDATE_DATA_CHIUSURA",n.values=[this.id_applicativo,this.id_documento],n.types=["string","string"],this.m_dataService.doQuery(n).subscribe((function(t){null!=t&&t.result_msg}))}var o,s="$$";for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==this.clevel.livello&&this.livs[i].idp==this.app_s.user){if("$$"!=s){s="$$";break}s=this.livs[i].gruppo_parallelo}o=this.app_info.documento_pubblico?new Array(this.m_autori,"",this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,s):new Array(this.m_autori,this.m_lettori,this.m_liv,this.m_statox,this.m_autori_paralleli,this.m_obj.assegnati_paralleli,this.getLvlDescri(String(this.m_liv),this.m_statox),this.getUsersList(this.m_autori,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,s);var r=new Array;for(i=0;i<o.length;i++)r.push("string");this.m_crea_att=1,this.m_liv>=900&&(this.m_crea_att=0),this.b_respingi&&(this.m_oper="Respinta"),null!=this.clevel&&null!=this.clevel.descri_livello&&(this.m_oper=this.m_oper+" - "+this.clevel.descri_livello),null!=this.nlevel&&null!=this.nlevel.descri_livello&&(this.m_oper=this.m_oper+" -> "+this.nlevel.descri_livello);var a=new Dt;a.sql="doWKF",a.values=[this.app_info.descrizione_breve,this.m_obj.codice,this.m_autori,this.m_danotificare,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"Il documento: "+this.m_obj.codice+" è passato allo stato: "+this.m_statox,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit","In approvazione",this.getDescri(),this.user_idp,this.m_statox,this.m_oper,this.id_applicativo,this.id_documento,""+this.m_crea_att,""+this.m_send_email,""+this.clevel.livello,""+this.nlevel.livello],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.clevel.livello+"_PLAYER",this.user_idp),this.m_wkf.doQuery(a).subscribe((function(t){null!=t&&t.result_msg})),(a=new Dt).sql="UPDATE_WKF_DOCUMENTOV3_NS",a.values=o,a.types=r,this.m_dataService.doQuery(a).subscribe((function(t){null!=t&&t.result_msg})),(a=new Dt).sql="exec_app_workflow",a.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp];if(this.m_wkf.doQuery(a).subscribe((function(t){})),""!=this.m_danotificare){var l="";if(""!=this.nota&&(l="<br>Commento: <br>"+this.nota),1==this.clevel.ccn_mittente&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.user_idp),1==this.nlevel.approvazione_email);else{var p=null;if(1==this.nlevel.ical&&(null==this.m_obj.ical_dt_ini?this.alert("Attenzione ical non configurato ical_dt_ini",1):null==this.m_obj.ical_dt_fin?this.alert("Attenzione ical non configurato ical_dt_fin",1):p={start:this.m_obj.ical_dt_ini,end:this.m_obj.ical_dt_fin,summary:this.app_info.descrizione_breve+" "+this.getTitle(),description:this.getDescri()+l+"<br>"+this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",organizer:this.user_nome+" "+this.user_cognome+" <"+this.user_email+">",url:this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit"}),1==this.nlevel.email_partecipanti||1==this.nlevel.email_ospiti)if(this.b_respingi)this.sendEMail_ex(this.user_idp,this.m_danotificare,"Respinta "+this.getTitle()+"-["+this.m_obj.codice+"]","<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+"<br>Commenti:"+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p);else if(null==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle()+" - "+this.getLvlDescri(String(this.m_liv),this.m_statox),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p);else if(""==this.nlevel.oggetto_email)this.sendEMail_ex(this.user_idp,this.m_danotificare,this.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+this.m_obj.codice+" "+this.getTitle()+" - "+this.getLvlDescri(String(this.m_liv),this.m_statox),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p);else{var u=this.nlevel.oggetto_email;for(var c in null!=this.nlevel&&null!=this.nlevel.descri_livello&&(u=u.split("%new_step%").join(this.nlevel.descri_livello)),null!=this.clevel&&null!=this.clevel.descri_livello&&(u=u.split("%old_step%").join(this.clevel.descri_livello)),u=(u=u.split("%new_step%").join("")).split("%old_step%").join(""),this.m_obj)null!=this.m_obj[c]&&(console.log(c+" "+Object.prototype.toString.call(this.m_obj[c])),u="[object Date]"===Object.prototype.toString.call(this.m_obj[c])?u.split("%"+c+"%").join(this.uti_s.date2String(this.m_obj[c])):-1==(""+this.m_obj[c]).indexOf("T00:00:00")?u.split("%"+c+"%").join(this.m_obj[c]):u.split("%"+c+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[c],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,u,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p)}else this.goto_edit_doc();if(0!=this.nlevel.tipo_notifica_aggiuntiva){if(1==this.nlevel.tipo_notifica_aggiuntiva&&this.sendEMail_ex(this.user_idp,this.m_obj.creatore,this.app_info.descrizione_breve+", Il documento numero: "+this.m_obj.codice+" è passato allo STEP: "+this.nlevel.descri_livello+" "+this.getTitle(),this.m_statox+"<br>"+this.getDescri()+l,this.id_applicativo,this.id_documento,this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",this.m_obj.codice,this.nota,!0,p,!1),2==this.nlevel.tipo_notifica_aggiuntiva){var d=new Dt;d.sql="SELECT_PARTECIPANTI_DOC",d.values=[this.id_applicativo,this.id_documento],d.types=["string","string"],this.m_dataService.doQuery(d).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(console.log("username:",e.result_data[n].username),i+=",",i+=e.result_data[n].username);console.log("lista_p ",i),t.sendEMail_ex(t.user_idp,i,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,p,!1)}}))}if(3==this.nlevel.tipo_notifica_aggiuntiva){var h=new Dt;h.sql="SELECT_ALL_USERS_DOC",h.values=[this.id_applicativo,this.id_documento],h.types=["string","string"],this.m_dataService.doQuery(h).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=t.user_idp,n=0;n<e.result_data.length;n++)-1==i.indexOf(e.result_data[n].username)&&(console.log("username:",e.result_data[n].username),i+=",",i+=e.result_data[n].username);t.sendEMail_ex(t.user_idp,i,t.app_info.descrizione_breve+", Il documento numero: "+t.m_obj.codice+" è passato allo STEP: "+t.nlevel.descri_livello+" "+t.getTitle(),t.m_statox+"<br>"+t.getDescri()+l,t.id_applicativo,t.id_documento,t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",t.m_obj.codice,t.nota,!0,p,!1)}}))}}}}else this.goto_edit_doc()},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u,c){var d=this;void 0===p&&(p=!0),void 0===u&&(u=""),void 0===c&&(c=!0);var h=new Dt;h.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),h.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(h).subscribe((function(t){c&&d.goto_edit_doc(p)}))},t.prototype.goto_edit_doc=function(t){void 0===t&&(t=!0),this.m_router.navigate([this.app_info.modulo_swf]),t&&this.alert("Avanzamento effettuato",0)},t.prototype.getLvlInfo=function(t){for(var e=0;e<this.livs.length;e++)if(t==this.livs[e].livello)return this.livs[e];return null},t.prototype.insert_commento=function(t,e,i,n){var o=new Dt;o.sql="INSERT_WKF_COMMENTO",o.values=[t,e,i,n,""],o.types=["string","string","string","string","string"],this.m_dataService.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=new Dt;o.sql="insert_wkf_variabile",o.values=[t,e,i,n],this.m_wkf.doQuery(o).subscribe((function(t){null!=t&&t.result_msg}))},t.prototype.respingi=function(){this.oper="respingi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),this.salva()},t.prototype.procedi=function(){if(this.oper="procedi",this.btnprocedi=!0,this.edit_b(!1),this.resp_b(!1),!this.ck_field())return this.edit_b(!0),void(this.respingi_enabled&&this.resp_b(!0));this.salva()},t.prototype.open_wkf=function(t){var e=this;void 0===t&&(t=!1);var i=this.app_s.getState().body_h-40+"px",n=this.m_dialog.open(Ye,{disableClose:!0,width:"95%",height:i});setTimeout((function(){n.componentInstance.subject=e.app_info.descrizione_breve+", <OP>: "+e.m_obj.codice+" "+e.getTitle(),null!=e.m_obj.lettori?n.componentInstance.lettori=e.m_obj.lettori:n.componentInstance.lettori="",n.componentInstance.link=e.app_s.COMPANY_SITE_ROOT+"#/"+e.app_info.modulo_swf+"/"+e.id_applicativo+"/"+e.id_documento+"/edit",n.componentInstance.codice_doc=e.m_obj.codice,n.componentInstance.notifica_commenti=e.app_info.notifica_commenti,n.componentInstance.notifica_commenti_obbl=e.app_info.notifica_commenti_obbl,n.componentInstance.commenti_insert=t,n.componentInstance.init_v()})),n.afterClosed().subscribe((function(t){e.r_count()}))},t.prototype.open_commenti=function(){var t=this,e=this.m_dialog.open(Ke,{disableClose:!0,width:"90%"});setTimeout((function(){e.componentInstance.subject=t.app_info.descrizione_breve+", <OP>: "+t.m_obj.codice+" "+t.getTitle(),null!=t.m_obj.lettori?e.componentInstance.lettori=t.m_obj.lettori:e.componentInstance.lettori="",e.componentInstance.link=t.app_s.COMPANY_SITE_ROOT+"#/"+t.app_info.modulo_swf+"/"+t.id_applicativo+"/"+t.id_documento+"/edit",e.componentInstance.codice_doc=t.m_obj.codice,e.componentInstance.notifica_commenti=t.app_info.notifica_commenti,e.componentInstance.notifica_commenti_obbl=t.app_info.notifica_commenti_obbl,e.componentInstance.init_v()})),e.afterClosed().subscribe((function(e){t.r_count()}))},t.prototype.open_upload=function(t){var e=this;void 0===t&&(t="");var i=this.m_dialog.open(qe,{disableClose:!0,width:"90%"});setTimeout((function(){i.componentInstance.sovrascrivi_path=t})),i.afterClosed().subscribe((function(t){e.r_count()}))},t.prototype.create_new_document=function(){var t=this,e=new Dt;e.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),e.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.save_agg()}))},t.prototype.save_agg=function(){var t=this;this.b_edit_before=this.b_edit,this.edit_b(!1);var e=this.getfieldvalues(),i=new Dt;i.sql="insert_aggiuntivi",i.types=["string","string"],i.values=[this.app_info.tabella_dati,this.id_documento],i.names=["tabella","id_documento"];for(var n=0;n<e.length;n++)i.types.push(e[n].types),i.names.push(e[n].names),null!=e[n].values?("boolean"==e[n].types&&(e[n].values?i.values.push("1"):i.values.push("0")),"int"==e[n].types&&(isNaN(e[n].values)?i.values.push("0"):i.values.push(""+e[n].values)),"string"==e[n].types&&i.values.push(""+e[n].values),"date"==e[n].types&&i.values.push(this.uti_s.sql_date(e[n].values)),"datetime"==e[n].types&&i.values.push(this.uti_s.sql_date_time(e[n].values)),"decimal"==e[n].types&&(isNaN(e[n].values)?i.values.push("0"):i.values.push(""+e[n].values))):i.values.push("dbnull");this.m_wkf.doQuery(i).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ok_insert_aggiuntivi()}),(function(t){}))},t.prototype.ok_insert_aggiuntivi=function(){this.btnprocedi?this.b_edit||this.btnprocedi?this.load_document():this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]):(this.alert("DOCUMENTO SALVATO",0),this.edit_b(this.b_edit_before),this.b_edit||this.btnprocedi||this.m_router.navigate([this.app_info.modulo_swf,this.id_applicativo,this.id_documento,"edit"]))},t.prototype.load_document=function(){var t=this;console.log("load_document()");var e=new Dt;e.sql="SELECT_WKF_DOCUMENT_NOREP",e.types=["string","string","string"],e.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var i=e.result_data;i.length>0?t.ok_load_document(i[0]):t.alert("DOCUMENTO NON TROVATO",1)}}),(function(t){}))},t.prototype.ok_load_document=function(t){var e=this;this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1),this.save_to_app_state();var i=new Dt;i.sql="SELECT_LIVELLI_DOC",i.types=["string","string"],i.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ok_livelli_doc(t.result_data)}),(function(t){}))},t.prototype.ok_livelli_doc=function(t){if(this.livs=t,this.over_canale_iniz(),this.m_obj.stato<=10)for(var e=0;e<this.livs.length;e++)this.livs[e].idp.toUpperCase()!=this.user_idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||10==this.livs[e].livello&&0==this.livs[e].notifica&&"*ALLUSERS"==this.livs[e].gruppo_parallelo&&(this.livs[e].gruppo_parallelo="",this.livs[e].idp=this.user_idp);!this.b_edit||this.btnprocedi?this.btnprocedi&&this.doApprova():this.return_edit()},t.prototype.r_count=function(){var t=this,e=new Dt;e.sql="SELECT_WKF_ALLEGATI_COUNTER",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=e.result_data,n=0,o=0,s=0;s<i.length;s++)i[s].n>0&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));t.reset_counters_int(o,n)}}),(function(t){}))},t.prototype.reset_counters_int=function(t,e){t>0&&(this.comm_c=t),e>0&&(this.all_c=e)},t.prototype.set_canale_iniziale=function(t){this.forza_canale=t},t.prototype.over_canale_iniz=function(){if(""!=this.forza_canale){for(var t=0,e=0;e<this.livs.length;e++)(this.livs[e].livello<t||0==t)&&(t=this.livs[e].livello);for(e=0;e<this.livs.length;e++)this.livs[e].livello==t&&(this.livs[e].gruppo_parallelo=this.forza_canale);this.m_obj.stato<20&&(this.m_obj.canale=this.forza_canale),this.c_canale=this.forza_canale}},t.prototype.ck_canale_multiplo=function(){for(var t=this,e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&0==this.livs[i].notifica&&(this.clevel=this.livs[i],e=this.livs[i].livello);var n=[];for(i=0;i<this.livs.length;i++)this.livs[i].livello==e&&0==this.livs[i].notifica&&this.app_s.getState().wkf_doc_info.curr_user.toUpperCase()==this.livs[i].idp.toUpperCase()&&(null!=this.livs[i].gruppo_parallelo?n.push(this.livs[i].gruppo_parallelo):n.push(""));n.length<=1?(this.c_canale=n[0],this.create_new_document()):(this.app_s.getState().wkf_doc_info.canali_arr=n.sort((function(t,e){return t>e?1:t<e?-1:0})),this.m_dialog.open(Ue,{disableClose:!0}).afterClosed().subscribe((function(e){t.c_canale=e,t.create_new_document()})))},t.prototype.open_info=function(){var t=this,e=this.m_dialog.open(Ge,{disableClose:!0});setTimeout((function(){e.componentInstance.hide_richiedente=t.hide_richiedente})),e.afterClosed().subscribe((function(t){}))},t.prototype.setForceJump=function(t,e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=!0);for(var o,s="",r="",a="",l="",p="",u=0;u<this.livs.length;u++)t!=this.livs[u].livello||""!=e&&!this.livs[u].canale||(1==this.livs[u].email_ospiti&&1==this.livs[u].notifica||1==this.livs[u].email_partecipanti&&0==this.livs[u].notifica)&&(""!=r&&(r+=","),r+=this.livs[u].idp),t!=this.livs[u].livello||0!=this.livs[u].notifica||""!=e&&!this.livs[u].canale||(""!=s&&(s+=","),s+=this.livs[u].idp,""!=l&&(l+=","),l+=this.livs[u].nc,p=this.livs[u].descri_livello,null!=this.livs[u].oggetto_email&&""!=this.livs[u].oggetto_email&&(a=this.livs[u].oggetto_email));if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;o=this.app_info.documento_pubblico?[s,"",t,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"Assegnata a:"+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e]:[s,this.m_obj.partecipanti+","+s,t,"Assegnata a:"+l,"","",this.getLvlDescri(String(t),"Assegnata a:"+l),this.getUsersList(l,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento,e];var c=[];for(u=0;u<o.length;u++)c.push("string");var d=new Dt;return d.sql="exec_app_workflow",d.values=[this.app_info.codice_documento,this.id_documento,""+this.m_obj.stato,""+t,this.user_idp],this.m_wkf.doQuery(d).subscribe((function(t){})),(d=new Dt).sql="UPDATE_WKF_DOCUMENTOV3_NS",d.values=o,d.types=c,this.m_dataService.doQuery(d).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){var o=new Dt;o.sql="doWKF",o.values=[n.app_info.descrizione_breve,n.m_obj.codice,""+t,""+t,n.m_obj.codice+" - "+n.getTitle(),n.getTitle()+"La scheda numero: "+n.m_obj.codice+" è passata allo stato: "+p,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit","In approvazione",n.getDescri(),n.user_idp,p,"",n.id_applicativo,n.id_documento,"1","0",""+n.m_obj.stato,""+t],n.insert_wkf_variabile(n.id_applicativo,n.id_documento,n.m_obj.stato+"_PLAYER",n.user_idp);n.m_wkf.doQuery(o).subscribe((function(t){if(null!=t&&"OK"==t.result_msg)if(i&&""!=r){var e=a;for(var o in n.m_obj)null!=n.m_obj[o]&&(console.log(o+" "+Object.prototype.toString.call(n.m_obj[o])),e="[object Date]"===Object.prototype.toString.call(n.m_obj[o])?e.split("%"+o+"%").join(n.uti_s.date2String(n.m_obj[o])):-1==(""+n.m_obj[o]).indexOf("T00:00:00")?e.split("%"+o+"%").join(n.m_obj[o]):e.split("%"+o+"%").join(n.uti_s.date2String(n.uti_s.string2date(n.m_obj[o],2))));""==e?n.sendEMail_ex(n.user_idp,r,n.app_info.descrizione_breve+", Ti è stato assegnato il documento numero: "+n.m_obj.codice+" "+n.getTitle()+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,""):n.sendEMail_ex(n.user_idp,r,e+" - "+n.getLvlDescri(String(n.m_liv),n.m_statox),"<br>Attività:"+n.getLvlDescri(String(n.m_liv),n.m_statox)+"<br>"+n.m_statox+"<br>"+n.getDescri(),n.id_applicativo,n.id_documento,n.app_s.COMPANY_SITE_ROOT+"#/"+n.app_info.modulo_swf+"/"+n.id_applicativo+"/"+n.id_documento+"/edit",n.m_obj.codice,"",!0,"")}else n.goto_edit_doc()})),!0}n.alert(e.msg,1)}),(function(t){})),"OK"},t.prototype.insert_doc=function(){var t=this;this.m_autori=this.user_idp,this.m_lettori="",this.m_liv=0,this.m_statox="",this.m_danotificare="",this.m_oper="",this.m_autori_paralleli="",this.m_crea_att=0,this.m_send_email=0,this.clevel=null,this.nlevel=null,this.m_obj=new Object,this.id_documento=this.uti_s.newGuid(),this.m_obj.id_documento=this.id_documento,this.m_obj.codice="",this.m_obj.data_richiesta=new Date,this.m_obj.richiedente=this.user_idp,this.m_obj.autori=this.user_idp,this.m_obj.stato=0,this.m_obj.stat_stato="In Creazione",this.m_obj.richiesta_da=this.user_idp,this.m_obj.in_carico_a="",this.m_obj.nc=this.user_cognome+" "+this.user_nome,this.c_canale="",this.dtr=new Date,this.rich=this.user_idp,this.cod="",this.dt_scad=null,this.m_statox="",this.oggetto_editable=!0,this.descrizione_editable=!0,this.btnSalva_visible=!0,this.b_PrendiInCarico=!1,this.stat_stato_text="Bozza",this.creatore_text=this.user_cognome+" "+this.user_nome,this.pers_int_text=this.user_cognome+" "+this.user_nome,this.rich_enabled=!0,this.oggetto_text="",this.descrizione_text="",this.m_obj.stato_txt="",this.m_obj.stato=0,this.bEdit=!0,this.bEdit_wkf=!1,this.bEditOp_wkf=!1,this.bEditAp_wkf=!1,this.bEditAss_wkf=!1,this.bEditBozza_wkf=!1,this.bEdit_bozza=!1,this.bNuovaRev_Agg=!1,this.bEdit_Agg=this.bEdit_wkf,this.btnSalva_label="SALVA",this.btnTerminaOp_label="Termina Attività",this.btnApprova_label="APPROVA",this.btnAssegna_label="Assegna",this.btnRespingi_label="RESPINGI",this.uti_s.set_home_title(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_counters_int(0,0);var e=new Dt;e.sql="SELECT_WLIVELLIV2",e.types=["string","string"],e.values=[this.id_applicativo,""];this.m_dataService.doQuery(e).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(console.log(e.result_data),t.ok_livw2(e.result_data),i=!0),i||(t.errorMsg=e.msg)}),(function(t){})),this.save_to_app_state()},t.prototype.ok_livw2=function(t){this.livs=t;for(var e=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<e||0==e)&&(e=this.livs[i].livello);console.log("min_liv ",e);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(console.log("this.user_idp.toUpperCase() ",this.user_idp.toUpperCase()),console.log("this.livs[i].idp.toUpperCase() ",this.livs[i].idp.toUpperCase()),this.user_idp.toUpperCase()==this.livs[i].idp.toUpperCase()||"*ALLUSERS"==this.livs[i].gruppo_parallelo)){1==this.livs[i].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1,this.edit_b(!0);break}},t.prototype.edit_doc=function(){this.load_document()},t.prototype.return_edit=function(){for(var t=0;t<this.livs.length;t++)if(this.livs[t].livello==this.m_obj.stato){1==this.livs[t].abilita_indietro?this.respingi_enabled=!0:this.respingi_enabled=!1;break}null==this.m_obj.autori&&(this.m_obj.autori=""),console.log("return_edit-> ",","+this.m_obj.autori.toLowerCase()+",",","+this.user_idp.toLowerCase()+",",(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")),-1!=(","+this.m_obj.autori.toLowerCase()+",").indexOf(","+this.user_idp.toLowerCase()+",")&&(this.edit_b(!0),this.respingi_enabled&&this.resp_b(!0)),this.r_count();var e=this.m_obj.autori.split(",");for(t=0;t<e.length;t++)for(var i=0;i<this.livs.length;i++)if(this.livs[i].idp==e[t]){""!=this.s_uto&&(this.s_uto=this.s_uto+","),this.s_uto=this.s_uto+this.livs[i].nc;break}this.app_s.getState().wkf_doc_info.in_carico_a=this.s_uto,this.uti_s.set_home_title(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato),this.reset_form(this.app_info.descrizione_breve+" "+this.m_obj.codice+" - "+this.m_obj.stat_stato)},t.prototype.onResize=function(t){},t.prototype.init_engine=function(){var t=this;null!=this.user_idp?this.m_route.params.subscribe((function(e){t.onResize();var i=e.op;if(t.id_applicativo=e.idapp,t.id_documento=e.id_doc,t.b_edit="new"!=i,t.b_edit||t.id_applicativo.indexOf("_")>-1&&(t.simple_mode=!0,t.id_applicativo=t.id_applicativo.split("_").join("")),t.b_valid=!!t.id_applicativo,t.b_valid){var n=new Dt;n.sql="SELECT_WKF_APP_INFO_BYUID",n.types=["string"],n.values=[t.id_applicativo];t.m_dataService.doQuery(n).subscribe((function(e){var i=!1;null!=e&&"OK"==e.result_msg&&(e.result_data.length>0?(t.setta_info_app(e.result_data[0]),t.b_edit?t.edit_doc():t.insert_doc()):t.alert("CODICE APPLICAZIONE NON VALIDO",2),i=!0),i||t.alert(e.msg,2)}),(function(t){}))}else t.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)})):setTimeout((function(){t.init_user_i(),t.init_engine()}),100)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init_engine()}))},t.prototype.setta_info_app=function(t){this.app_info=t},t.prototype.getLvlDescri=function(t,e){for(var i=0;i<this.livs.length;i++)if(t==this.livs[i].livello)return""!=this.livs[i].livello?this.livs[i].descri_livello:e;return e},t.prototype.getUsersList=function(t,e){var i="";return""!=t&&(i=t),""!=e&&(""!=i&&(i+=","),i+=e),""==i?"":this.getNames(i)},t.prototype.getNames=function(t){for(var e="",i=t.split(","),n=0;n<i.length;n++)for(var o=0;o<this.livs.length;o++)if(i[n].toUpperCase()==this.livs[o].idp.toUpperCase()){""!=e&&(e+=","),e+=this.livs[o].nc;break}return e},yt([e.HostListener("window:resize",["event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"onResize",null),t}(),Ze=function(){function t(t){this.m_appService=t,this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1,this.procedi_button=!0}return t.prototype.back=function(){null!=this.dt_agg&&this.dt_agg.back(this.edit_button)},t.prototype.evt_salv=function(){null!=this.dt_agg&&this.dt_agg.evt_salv()},t.prototype.respingi=function(){null!=this.dt_agg&&this.dt_agg.respingi()},t.prototype.procedi=function(){null!=this.dt_agg&&this.dt_agg.procedi()},t.prototype.open_info=function(){null!=this.dt_agg&&this.dt_agg.open_info()},t.prototype.open_commenti=function(){null!=this.dt_agg&&this.dt_agg.open_commenti()},t.prototype.open_upload=function(){null!=this.dt_agg&&this.dt_agg.open_upload()},t.prototype.open_wkf=function(){null!=this.dt_agg&&this.dt_agg.open_wkf()},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:It}]},yt([e.Input(),St("design:type",Je)],t.prototype,"dt_agg",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"edit_button",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"respingi_button",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"procedi_button",void 0),t=yt([e.Component({selector:"wkf_header_bar",template:'\n\n <div fxLayout="row" fxLayout.lt-md="column">\n<div fxLayout="row" fxLayoutGap="3px" *ngIf="!m_appService.getState().pageFullscreen || edit_button || respingi_button">\n<button mat-flat-button (click)="back()" *ngIf="!m_appService.getState().pageFullscreen">Indietro</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="evt_salv()" *ngIf="edit_button && !m_appService.getState().pageFullscreen" color="primary" >Salva</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="procedi()" *ngIf="edit_button && procedi_button" color="accent" >Procedi</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="respingi()" *ngIf="respingi_button" color="warn" >Respingi</button>\n\x3c!-- <button mat-flat-button (click)="doEnd(900)" color="warn" >test</button>&nbsp;&nbsp;\n--\x3e\n</div>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="16px" fxLayoutGap.xs="3px">\n <div fxLayout="row" >\n<button mat-flat-button (click)="open_info()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>info_outline</mat-icon>&nbsp;&nbsp;Info Doc</button>&nbsp;&nbsp;\n<button mat-flat-button [color]="(dt_agg?.comm_c?dt_agg?.comm_c:0>0)?\'accent\':\'\'" [matBadge]="dt_agg?.comm_c?dt_agg?.comm_c:0" matBadgePosition="before" matBadgeColor="primary" (click)="open_commenti()"> <mat-icon>insert_comment</mat-icon>Commenti</button>&nbsp;&nbsp;</div> <div fxLayout="row">\n<button mat-flat-button [color]="(dt_agg?.all_c?dt_agg?.all_c:0>0)?\'accent\':\'\'" [matBadge]="dt_agg?.all_c?dt_agg?.all_c:0" matBadgePosition="before" matBadgeColor="primary" (click)="open_upload()"> <mat-icon>attach_file</mat-icon>Allegati</button>&nbsp;&nbsp;\n <button mat-flat-button (click)="open_wkf()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>transfer_within_a_station</mat-icon>Workflow</button></div>\n</div>\n </div>\n '}),St("design:paramtypes",[It])],t)}(),ti=function(){function t(t,i,n){this.fhutility=t,this._dialog=i,this.dragula=n,this.change=new e.EventEmitter,this.items=[],this.edit_obj=null,this.radio_values=""}return t.prototype.add_component=function(t){1==t&&this.items.push({type:"text_field",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),2==t&&this.items.push({type:"numeric_field",label:"Label",default_value:0,decimali:2,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),3==t&&this.items.push({type:"textarea",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),4==t&&this.items.push({type:"checkbox",label:"Label",default_value:"",uiid:this.fhutility.newGuid(),selected:!1,required:!1}),5==t&&this.items.push({type:"radiobutton",label:"Label",default_value:"",opts:["Option1","Option2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),6==t&&this.items.push({type:"select",label:"Label",default_value:"",opts:["","Value1","Value2"],uiid:this.fhutility.newGuid(),selected:!1,required:!1}),7==t&&this.items.push({type:"date_field",label:"Label",default_value:null,uiid:this.fhutility.newGuid(),selected:!1,required:!1}),this.change.emit(),this.edit_obj=null},t.prototype.setStyles=function(t){return null!=this.edit_obj&&this.edit_obj.uiid==t?{width:"90%",padding:"15px",margin:"15px",border:"3px solid #3db3cd","background-color":"#C2CACB"}:{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ok_panel=function(){this.change.emit(),this.edit_obj=null},t.prototype.edit_item=function(t){for(var e=0;e<this.items.length;e++)this.items[e].uiid==t&&(this.edit_obj=this.items[e],"radiobutton"!=this.edit_obj.type&&"select"!=this.edit_obj.type||null!=this.edit_obj.opts&&(this.radio_values=this.edit_obj.opts.join(",")))},t.prototype.del_item=function(t){var e=this,i=this._dialog.open(zt,{disableClose:!0});setTimeout((function(){i.componentInstance.title="Confirm",i.componentInstance.msg="Remove Element?"})),i.afterClosed().subscribe((function(i){if(i)for(var n=0;n<e.items.length;n++)e.items[n].uiid==t&&(e.items.splice(n,1),e.change.emit(),e.edit_obj=null)}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){try{t.dragula.createGroup("bag-items",{revertOnSpill:!0})}catch(t){console.log(t)}t.dragula.drag.call((function(e){t.change.emit(),t.edit_obj=null})),t.dragula.drop.call((function(e){t.change.emit(),t.edit_obj=null}))}))},t.ctorParameters=function(){return[{type:Tt},{type:l.MatDialog},{type:q.DragulaService}]},yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"change",void 0),yt([e.ViewChild("bottoml"),St("design:type",e.ElementRef)],t.prototype,"bottoml",void 0),t=yt([e.Component({selector:"FHFormBuilder",template:'\n <div fxLayout="row" style="width: 100%;height:100%">\n <mat-toolbar color="primary" style="max-width: 200px;height:100%;" >\n <mat-toolbar-row (click)="add_component(1)">\n <mat-icon>text_fields</mat-icon>&nbsp;&nbsp;&nbsp;<span>Text Field</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(2)">\n <mat-icon>filter_1</mat-icon>&nbsp;&nbsp;&nbsp;<span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon>&nbsp;&nbsp;&nbsp;<span>Text Area</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(4)">\n <mat-icon>check_box</mat-icon>&nbsp;&nbsp;&nbsp;<span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon>&nbsp;&nbsp;&nbsp;<span>Radio</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon>&nbsp;&nbsp;&nbsp;<span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon>&nbsp;&nbsp;&nbsp;<span>Date</span>\n </mat-toolbar-row>\n\n </mat-toolbar>\n <div fxLayout="column" fxFlex="100" style="width:100%;border:1px solid #004040;height:100%;overflow:auto;background-color: #a6aec4">\n <div fxLayout="row" style="width:90%;width:100%;height:5000px;">\n\n <ul [dragula]=\'"bag-items"\' [(dragulaModel)]=\'items\' style="width:100%;">\n <li fxLayout="row" *ngFor="let item of items" [ngStyle]="setStyles(item.uiid)" fxLayoutAlign="start center">\n <div style="width:100%">\n\n <div style="width: 90%">\n <mat-form-field *ngIf="item.type==\'text_field\'" style="max-width: 350px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" type="text" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n <mat-form-field *ngIf="item.type==\'numeric_field\'" style="max-width: 220px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" type="number" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n <FHRichText *ngIf="item.type==\'textarea\'" [label]="item.label" [required]="item.required" [(ngModel)]="item.default_value" height="15\'" enabled="false"></FHRichText>\n\n <mat-checkbox *ngIf="item.type==\'checkbox\'" [required]="item.required" [(ngModel)]="item.default_value"><b>{{item.label}}</b></mat-checkbox>\n\n\n <section class="custom-section" *ngIf="item.type==\'radiobutton\'" >\n <label class="custom-margin">{{item.label}}:</label>\n <mat-radio-group [(ngModel)]="item.default_value" [required]="item.required" >\n <mat-radio-button *ngFor="let opt of item.opts" class="custom-margin" value="{{opt}}"><b>{{opt}}</b></mat-radio-button>\n </mat-radio-group>\n </section>\n\n <mat-form-field *ngIf="item.type==\'select\'" style="max-width: 400px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <mat-select [required]="item.required" [(ngModel)]="item.default_value">\n <mat-option *ngFor="let opt of item.opts" value="{{opt}}">{{opt}}</mat-option>\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type==\'date_field\'">\n <FHDatePicker [required]="item.required" [(ngModel)]="item.default_value" [label]="item.label" ></FHDatePicker>&nbsp;&nbsp;\n </div>\n\n </div></div>\n <div fxLayout="column" style="width:70px" fxLayoutGap="10px">\n <button mat-flat-button (click)="edit_item(item.uiid)" color="primary"><mat-icon>edit</mat-icon></button>\n <button mat-flat-button (click)="del_item(item.uiid)" color="warn"><mat-icon>delete</mat-icon></button>\n </div>\n </li>\n </ul>\n\n\n </div>\n <mat-form-field [hidden]="true">\n <input matInput #bottoml>\n </mat-form-field>\n </div>\n\n <div style="width:400px;height:100%;background-color: #3F51B5" fxLayoutAlign="start center" fxLayout="column" *ngIf="edit_obj!=null">\n <br><br>\n <mat-card style="width: 96%">\n <mat-card-title>Properties</mat-card-title>\n <mat-card-content>\n <div fxLayout="column">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Label</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.label">\n </mat-form-field>\n <mat-checkbox [(ngModel)]="edit_obj.required">Required</mat-checkbox>\n\n <mat-form-field *ngIf="edit_obj.type==\'numeric_field_tobe\'" appearance="outline" floatLabel="always"><mat-label>Decimal Places</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.decimali">\n </mat-form-field>\n <mat-form-field *ngIf="edit_obj.type==\'text_field\'" appearance="outline" floatLabel="always"><mat-label>Default Value</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.default_value" >\n </mat-form-field>\n\n\n <mat-checkbox *ngIf="edit_obj.type==\'checkbox\'" [(ngModel)]="edit_obj.default_value">Default Value</mat-checkbox>\n\n <mat-form-field *ngIf="edit_obj.type==\'radiobutton\' || edit_obj.type==\'select\'" appearance="outline" floatLabel="always"><mat-label>Values</mat-label>\n <input matInput type="text" [(ngModel)]="radio_values" (ngModelChange)="edit_obj.opts=$event.split(\',\');" >\n </mat-form-field>\n <mat-form-field *ngIf="edit_obj.type==\'radiobutton\' || edit_obj.type==\'select\'" appearance="outline" floatLabel="always"><mat-label>Default Value</mat-label>\n <input matInput type="text" [(ngModel)]="edit_obj.default_value" >\n </mat-form-field>\n\n <button mat-flat-button (click)="ok_panel()" color="primary">OK</button>\n </div></mat-card-content>\n </mat-card>\n </div>\n </div>\n ',styles:["\n\n "]}),St("design:paramtypes",[Tt,l.MatDialog,q.DragulaService])],t)}(),ei=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.toastr=i,this.items=null,this.enabled=!0}return t.prototype.ck_field_custom=function(){for(var t=0;t<this.items.length;t++)if(this.items[t].required&&(null==this.items[t].default_value&&(this.items[t].default_value=""),""==(""+this.items[t].default_value).trim()))return this.toastr.error("Compilare il campo: "+this.items[t].label),!1;return!0},t.prototype.add_component=function(t){this.items.push(t)},t.prototype.setStyles=function(t){return{width:"90%",padding:"15px",margin:"15px",border:"1px solid #3db3cd","background-color":"#ECF0F1"}},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:Tt},{type:l.MatDialog},{type:n.ToastrService}]},yt([e.Input(),St("design:type",Array)],t.prototype,"items",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.ViewChild("bottoml"),St("design:type",e.ElementRef)],t.prototype,"bottoml",void 0),t=yt([e.Component({selector:"FHFormExecuter",template:'\n\n <div fxLayout="column" fxFlex="100" style="width:100%;border:1px solid #004040;height:100%" *ngIf="items!=null">\n\n\n <div fxLayout="row" *ngFor="let item of items" [ngStyle]="setStyles(item.uiid)" fxLayoutAlign="start center">\n\n <div style="width: 90%">\n <mat-form-field *ngIf="item.type==\'text_field\'" style="max-width: 350px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" [disabled]="!enabled" type="text" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n\n <mat-form-field *ngIf="item.type==\'numeric_field\'" style="max-width: 220px" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <input matInput [required]="item.required" [disabled]="!enabled" type="number" [(ngModel)]="item.default_value">\n </mat-form-field>\n\n\n <FHRichText *ngIf="item.type==\'textarea\'" [label]="item.label" [required]="item.required" [(ngModel)]="item.default_value" height="15\'" enabled="false"></FHRichText>\n\n <mat-checkbox *ngIf="item.type==\'checkbox\'" [required]="item.required" [disabled]="!enabled" [(ngModel)]="item.default_value"><b>{{item.label}}</b></mat-checkbox>\n\n\n <section *ngIf="item.type==\'radiobutton\'" >\n <label *ngIf="!item.required">{{item.label}}: </label>&nbsp;\n <label *ngIf="item.required">{{item.label}}: *</label>&nbsp;\n <mat-radio-group [(ngModel)]="item.default_value" [required]="item.required" >\n <mat-radio-button *ngFor="let opt of item.opts" [disabled]="!enabled" class="custom-margin" value="{{opt}}"><b>{{opt}}</b>&nbsp;&nbsp;&nbsp;&nbsp;</mat-radio-button>\n </mat-radio-group>\n </section>\n\n <mat-form-field *ngIf="item.type==\'select\'" appearance="outline" floatLabel="always"><mat-label>{{item.label}}</mat-label>\n <mat-select [required]="item.required" [(ngModel)]="item.default_value">\n <mat-option *ngFor="let opt of item.opts" [disabled]="!enabled" value="{{opt}}">{{opt}}</mat-option>\n </mat-select>\n </mat-form-field>\n <div style="width: 220px" *ngIf="item.type==\'date_field\'">\n <FHDatePicker [required]="item.required" [disabled]="!enabled" [(ngModel)]="item.default_value" [label]="item.label" ></FHDatePicker>&nbsp;&nbsp;\n </div>\n\n </div>\n\n </div>\n\n\n <mat-form-field [hidden]="true">\n <input matInput #bottoml>\n </mat-form-field>\n </div>\n\n\n ',styles:["\n\n "]}),St("design:paramtypes",[Tt,l.MatDialog,n.ToastrService])],t)}(),ii=function(){function t(t){this.dialogRef=t,this.title="",this.button_config=[]}return t.prototype.ngAfterViewInit=function(){},t.prototype.open=function(t){this.dialogRef.close(t)},t.prototype.close=function(){this.dialogRef.close(null)},t.ctorParameters=function(){return[{type:l.MatDialogRef}]},yt([e.Input(),St("design:type",String)],t.prototype,"title",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"button_config",void 0),t=yt([e.Component({selector:"app-win_ask_buttons",template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="font-size: 12px;">\n <div fxLayout="row" fxLayoutAlign="center center">\n <button mat-flat-button style="font-size: 18px;color:#FFFFFF;" *ngFor="let app of button_config" (click)="open(app)" [style.background-color]="app.color">{{app.label}}\n </button>&nbsp;&nbsp;&nbsp;\n </div>\n </mat-dialog-content>\n <br><br>\n <div style="width:100%;text-align:center;">\n\n <button mat-flat-button color="accent" (click)="close()">CHIUDI</button>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef])],t)}(),ni=function(){function t(t){this.dialogRef=t,this.imageIndex=0,this.images=[]}return t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialogRef}]},t=yt([e.Component({template:'\n\n\n \x3c!-- <ngx-image-viewer [src]="images" [(index)]="imageIndex"></ngx-image-viewer>--\x3e\n\n <mat-dialog-actions>\n <button mat-flat-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n </mat-dialog-actions>\n ',styles:["\n\n "]}),St("design:paramtypes",[l.MatDialogRef])],t)}(),oi=function(t,e){this.name=t,this.imageIndex=e},si={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!1,allowFullscreen:!0,allowKeyboardNavigation:!0,btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0},btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"}},ri=function(){function t(t,i){this.moduleConfig=t,this.sanitizer=i,this.index=0,this.preview=!1,this.indexChange=new e.EventEmitter,this.configChange=new e.EventEmitter,this.customEvent=new e.EventEmitter,this.style={transform:"",msTransform:"",oTransform:"",webkitTransform:""},this.fullscreen=!1,this.loading=!0,this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.hovered=!1,this.notfullScreenEvent=new e.EventEmitter,this.fullScreenEvent=new e.EventEmitter}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e=t.mergeConfig(si,t.moduleConfig);t.config=t.mergeConfig(e,t.config),t.triggerConfigBinding()}))},t.prototype.nextImage=function(t){console.log("this.src.length ",this.src.length),this.index<this.src.length-1&&(this.loading=!0,this.index++,this.triggerIndexBinding(),this.reset())},t.prototype.prevImage=function(t){this.index>0&&(this.loading=!0,this.index--,this.triggerIndexBinding(),this.reset())},t.prototype.zoomIn=function(){this.scale*=1+this.config.zoomFactor,this.updateStyle()},t.prototype.zoomOut=function(){this.scale>this.config.zoomFactor&&(this.scale/=1+this.config.zoomFactor),this.updateStyle()},t.prototype.scrollZoom=function(t){if(this.config.wheelZoom)return t.deltaY>0?this.zoomOut():this.zoomIn(),!1},t.prototype.rotateClockwise=function(){this.rotation+=90,this.updateStyle()},t.prototype.rotateCounterClockwise=function(){this.rotation-=90,this.updateStyle()},t.prototype.onLoad=function(){this.loading=!1},t.prototype.onLoadStart=function(){this.loading=!0},t.prototype.onDragOver=function(t){this.translateX+=t.clientX-this.prevX,this.translateY+=t.clientY-this.prevY,this.prevX=t.clientX,this.prevY=t.clientY,this.updateStyle()},t.prototype.onDragStart=function(t){t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(t.target.nextElementSibling,0,0),this.prevX=t.clientX,this.prevY=t.clientY},t.prototype.toggleFullscreen=function(){this.fullscreen=!this.fullscreen,this.fullscreen?this.fullScreenEvent.emit():this.notfullScreenEvent.emit(),this.fullscreen||this.reset()},t.prototype.triggerIndexBinding=function(){this.indexChange.emit(this.index)},t.prototype.triggerConfigBinding=function(){this.configChange.next(this.config)},t.prototype.fireCustomEvent=function(t,e){this.customEvent.emit(new oi(t,e))},t.prototype.reset=function(){this.scale=1,this.rotation=0,this.translateX=0,this.translateY=0,this.updateStyle()},t.prototype.canNavigate=function(t){return null==t||this.config.allowKeyboardNavigation&&this.hovered},t.prototype.updateStyle=function(){this.style.transform="translate("+this.translateX+"px, "+this.translateY+"px) rotate("+this.rotation+"deg) scale("+this.scale+")",this.style.msTransform=this.style.transform,this.style.webkitTransform=this.style.transform,this.style.oTransform=this.style.transform},t.prototype.mergeConfig=function(t,e){var i=vt({},t);return e&&(i=vt(vt({},t),e),e.btnIcons&&(i.btnIcons=vt(vt({},t.btnIcons),e.btnIcons))),i},t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:["config"]}]},{type:B.DomSanitizer}]},yt([e.Input(),St("design:type",Array)],t.prototype,"src",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"index",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"preview",void 0),yt([e.Input(),St("design:type",Object)],t.prototype,"config",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"indexChange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"configChange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"customEvent",void 0),yt([e.ViewChild("imgx"),St("design:type",e.ElementRef)],t.prototype,"imgx",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"notfullScreenEvent",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fullScreenEvent",void 0),yt([e.HostListener("window:keyup.ArrowRight",["$event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"nextImage",null),yt([e.HostListener("window:keyup.ArrowLeft",["$event"]),St("design:type",Function),St("design:paramtypes",[Object]),St("design:returntype",void 0)],t.prototype,"prevImage",null),t=yt([e.Component({selector:"image-viewer",template:'<div #imgx class="img-container" [style.backgroundColor]="config.containerBackgroundColor"\n (wheel)="scrollZoom($event)" (dragover)="onDragOver($event)" *ngIf="src!=null">\n <img [src]="src[index]" [style.transform]="style.transform | safe:\'style\'" [style.msTransform]="style.transform| safe:\'style\'" style="min-height: 280px" [style.webkitTransform]="style.transform| safe:\'style\'" [style.oTransform]="style.transform| safe:\'style\'" alt="Image not found..." (dragstart)="onDragStart($event)" (load)="onLoad()" (loadstart)="onLoadStart()"/>\n \x3c!-- Div below will be used to hide the \'ghost\' image when dragging --\x3e\n <div></div>\n <div class="spinner-container" *ngIf="loading">\n <div class="spinner"></div>\n </div>\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.rotateCounterClockwise && !preview" (click)="rotateCounterClockwise()">\n <span [class]="config.btnIcons.rotateCounterClockwise"></span>\n </button>\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.rotateClockwise && !preview" (click)="rotateClockwise()">\n <span [class]="config.btnIcons.rotateClockwise"></span>\n </button>\n\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.zoomOut && !preview" (click)="zoomOut()">\n <span [class]="config.btnIcons.zoomOut"></span>\n </button>\n <button type="button" [class]="config.btnClass" *ngIf="config.btnShow.zoomIn && !preview" (click)="zoomIn()">\n <span [class]="config.btnIcons.zoomIn"></span>\n </button>\n\n\n <button type="button" id="ngx-fs-btn" [class]="config.btnClass" (click)="toggleFullscreen()" *ngIf="config.allowFullscreen">\n <span [class]="config.btnIcons.fullscreen"></span>\n </button>\n\n <div class="nav-button-container" *ngIf="src?.length > 1">\n <button type="button" [class]="config.btnClass" (click)="prevImage($event)" [disabled]="index === 0">\n <span [class]="config.btnIcons.prev"></span>\n </button>\n <button type="button" [class]="config.btnClass" (click)="nextImage($event)" [disabled]="index === src?.length - 1">\n <span [class]="config.btnIcons.next"></span>\n </button>\n </div>\n</div>\n',styles:[".img-container{height:100%;width:100%;overflow:hidden;position:relative}.img-container img{z-index:2;margin:0 auto;display:block;max-width:100%;max-height:100%}.img-container button{z-index:99;position:absolute;right:15px}.img-container button:not(:disabled){cursor:pointer}.img-container>button:nth-of-type(1):not(#ngx-fs-btn){bottom:15px}.img-container>button:nth-of-type(2):not(#ngx-fs-btn){bottom:65px}.img-container>button:nth-of-type(3):not(#ngx-fs-btn){bottom:115px}.img-container>button:nth-of-type(4):not(#ngx-fs-btn){bottom:165px}.img-container>button:nth-of-type(5):not(#ngx-fs-btn){bottom:215px}.img-container>button:nth-of-type(6):not(#ngx-fs-btn){bottom:265px}.img-container>button:nth-of-type(7):not(#ngx-fs-btn){bottom:315px}#ngx-fs-btn{top:15px}button.default{height:40px;width:40px;border:1px solid #555;border-radius:50%;background-color:#fff;opacity:.7;-webkit-transition:opacity .2s;transition:opacity .2s}button.default:hover{opacity:1}button.default:disabled{opacity:.25}.nav-button-container>button{position:relative;right:0;margin:0 10px}.nav-button-container{text-align:center;position:absolute;z-index:98;bottom:10px;left:0;right:0}.spinner-container{position:absolute;left:0;right:0;top:0;bottom:0;width:60px;height:60px;margin:auto;padding:10px;background-color:rgba(0,0,0,.4);border-radius:25%}.spinner{border-width:7px;border-style:solid;border-color:#ccc #ccc #222;border-radius:50%;height:100%;width:100%;box-sizing:border-box;-webkit-animation:2s linear infinite rotation;animation:2s linear infinite rotation}@keyframes rotation{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(359deg)}}@-webkit-keyframes rotation{from{-webkit-transform:rotate(0)}to{-webkit-transform:rotate(359deg)}}"]}),bt(0,e.Optional()),bt(0,e.Inject("config")),St("design:paramtypes",[Object,B.DomSanitizer])],t)}(),ai=function(){function t(){this._preview=!1,this._preview_c=!1,this.m_preview=!1,this.m_init=!1,this.config={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!1,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!1,zoomOut:!1,rotateClockwise:!1,rotateCounterClockwise:!1,next:!1,prev:!1}},this.notfullScreenEvent=new e.EventEmitter,this.fullScreenEvent=new e.EventEmitter,this._u=null,this.already_open=!1,this.config_photo_big={btnClass:"default",zoomFactor:.1,containerBackgroundColor:"#ccc",wheelZoom:!0,allowFullscreen:!0,allowKeyboardNavigation:!0,btnIcons:{zoomIn:"fa fa-plus",zoomOut:"fa fa-minus",rotateClockwise:"fa fa-repeat",rotateCounterClockwise:"fa fa-undo",next:"fa fa-arrow-right",prev:"fa fa-arrow-left",fullscreen:"fa fa-arrows-alt"},btnShow:{zoomIn:!0,zoomOut:!0,rotateClockwise:!0,rotateCounterClockwise:!0,next:!0,prev:!0}}}return t.prototype.toggle_up=function(){this.m_preview=!1,this.photo_c.src=[],this.photo_c.src.push(this._u.image_original[0]),this.config=this.config_photo_big,this.already_open=!0},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.init()}))},t.prototype.openFullscreen=function(){console.log("cc",this.photo_c.imgx),this.elem=this.photo_c.imgx.nativeElement,console.log("openFullscreen ",this.elem),this.elem.requestFullscreen?(console.log("requestFullscreen"),this.elem.requestFullscreen()):this.elem.mozRequestFullScreen?(console.log("mozRequestFullScreen"),this.elem.mozRequestFullScreen()):this.elem.webkitRequestFullscreen?(console.log("webkitRequestFullscreen"),this.elem.webkitRequestFullscreen()):this.elem.msRequestFullscreen?(console.log("msRequestFullscreen"),this.elem.msRequestFullscreen()):console.log("no full!")},t.prototype.closeFullscreen=function(){try{this.elem="undefined"!=typeof window&&void 0!==window.document?window.document:{},console.log("closeFullscreen ",this.elem),this.elem.exitFullscreen?(console.log("exitFullscreen"),this.elem.exitFullscreen()):this.elem.mozCancelFullScreen?(console.log("mozCancelFullScreen"),this.elem.mozCancelFullScreen()):this.elem.webkitExitFullscreen?(console.log("webkitExitFullscreen"),this.elem.webkitExitFullscreen()):this.elem.webkitCancelFullScreen?(console.log("webkitExitFullscreen"),this.elem.webkitCancelFullScreen()):this.elem.msExitFullscreen?(console.log("msExitFullscreen"),this.elem.msExitFullscreen()):console.log("no exit!")}catch(t){this.openFullscreen()}},t.prototype.raise_fullScreenEvent=function(){this.fullScreenEvent.emit(),this.openFullscreen(),null!=this._u&&null!=this._u.image_thumbnail&&this._u.image_thumbnail.length>0&&this.m_preview&&this.toggle_up()},t.prototype.handleEvent=function(t){},Object.defineProperty(t.prototype,"preview",{get:function(){return this._preview},set:function(t){this._preview=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"u",{get:function(){return this._u},set:function(t){this._u=t,this.init()},enumerable:!0,configurable:!0}),t.prototype.init=function(){this._preview_c=!1,null!=this._u&&null!=this._u.image_thumbnail&&(null==this._u.image_original&&(this._u.image_original=this._u.image_thumbnail),this._u.image_thumbnail.length>0&&(this._u.image_thumbnail[0]!=this._u.image_original[0]&&(this._preview_c=!0),this.m_init=!0,this.m_preview=this._preview_c))},yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"notfullScreenEvent",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fullScreenEvent",void 0),yt([e.ViewChild("photo_c"),St("design:type",ri)],t.prototype,"photo_c",void 0),yt([e.Input(),St("design:type",Boolean),St("design:paramtypes",[Boolean])],t.prototype,"preview",null),yt([e.Input(),St("design:type",Object),St("design:paramtypes",[Object])],t.prototype,"u",null),t=yt([e.Component({selector:"fh-image-viewer",template:'\n\n <image-viewer [hidden]="!m_init" (init)="init()" [preview]="m_preview" (notfullScreenEvent)="closeFullscreen()" (fullScreenEvent)="raise_fullScreenEvent()" [config]="config_photo_big" #photo_c [src]="_u?.image_thumbnail" index="0"></image-viewer>\n\n',styles:["\n\n "]})],t)}(),li=function(){function t(t){this.sanitizer=t}return t.prototype.transform=function(t,e){switch(e){case"html":return this.sanitizer.bypassSecurityTrustHtml(t);case"style":return this.sanitizer.bypassSecurityTrustStyle(t);case"script":return this.sanitizer.bypassSecurityTrustScript(t);case"url":return this.sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error("Invalid safe type specified: "+e)}},t.ctorParameters=function(){return[{type:B.DomSanitizer}]},t=yt([e.Pipe({name:"safe"}),St("design:paramtypes",[B.DomSanitizer])],t)}(),pi={provide:p.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return ui})),multi:!0},ui=function(){function t(t){this.m_dialog=t,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.only_in_list=!0,this.single_sel=!1,this.label="",this.enabled=!0,this.required=!1,this.db_type="1",this.separator=",",this.value="",this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.resetValue=function(){this.value="",this.writeValue(this.value)},t.prototype.writeValue=function(t){this.value=t,this.onChange(this.value)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.focus=function(){},t.prototype.open_pick_list=function(){var t=this,e=this.m_dialog.open(Fe,{disableClose:!0});setTimeout((function(){e.componentInstance.single_sel=t.single_sel,e.componentInstance.sel_values=t.value,e.componentInstance.separator=t.separator,e.componentInstance.label=t.label,e.componentInstance.sql=t.sql,e.componentInstance.types=t.types,e.componentInstance.values=t.values,e.componentInstance.doFill()})),e.afterClosed().subscribe((function(e){if(null==e||""==e);else{t.value="";for(var i=0;i<e.length;i++)""!=t.value&&(t.value+=t.separator),t.value+=e[i].descrizione_valore,t.writeValue(t.value)}}))},t.prototype.ngAfterViewInit=function(){},t.ctorParameters=function(){return[{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"only_in_list",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"single_sel",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"db_type",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"separator",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"value",void 0),t=yt([e.Component({providers:[pi],selector:"FHFieldPickList",template:'\n<div fxLayout="row" style="width: 100%" fxLayoutAlign="start center" [hidden]="hidden"><div style="width: 100%">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [readonly]="!enabled || only_in_list" [(ngModel)]="value">\n </mat-form-field></div>&nbsp;&nbsp;\n <div style="min-width: 160px"> <button mat-flat-button color="primary" (click)="open_pick_list()" [disabled]="!enabled">SELEZIONA</button></div>\n</div>\n ',styles:["\n\n "]}),St("design:paramtypes",[l.MatDialog])],t)}(),ci=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this.m_appService=i,this._dataService=n,this.label="",this.sql="",this.single_sel=!1,this.sel_values="",this.id_tipo=-1}return t.prototype.delete_uassoc=function(t){var e=this,i=new Dt;i.sql="DELETE_VALORI",i.types=["int"],i.values=[t.id_valore],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.ref_user_list()}))},t.prototype.update_tassoc_ins=function(t){var e=this,i=new Dt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,"","0","",""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","VALORE INSERITO"),t.descrizione="",e.ref_user_list())}))},t.prototype.update_tassoc=function(t){var e=this,i=new Dt;i.sql="INSERT_UPDATE_VALORI",i.types=["int","int","string","int","string","int","string","string"],i.values=[t.id_valore,t.valore,t.descrizione,this.id_tipo,t.v1,t.v2,t.v3,t.lingua],this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&e.toastr.info("INFO","VALORE AGGIORNATO")}))},t.prototype.ref_user_list=function(){var t=this,e=new Dt;e.sql="SELECT_VALORI_BY_ID",e.types=["int"],e.values=[this.id_tipo],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.valoris=e.result_data,t.nValori.valore=t.valoris.length+1)}))},t.prototype.ok=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.nValori=new Object,t.nValori.descrizione="",t.nValori.v1=null,t.nValori.v2=null,t.nValori.id_valore=-1,t.nValori.v3=null,t.nValori.lingua=null,t.ref_user_list()}))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It},{type:Mt}]},t=yt([e.Component({selector:"win_manage_values",template:'\n\n\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Descrizione</mat-label>\n <input matInput [(ngModel)]="nValori.descrizione" style="min-width:500px">\n </mat-form-field>\n <div>\n <button mat-flat-button color="primary" (click)="update_tassoc_ins(nValori)">Inserisci</button>\n </div>\n </div>\n <div fxLayout="column" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\n <table style="width: 90%" class="fh_table">\n <thead>\n <tr>\n <th style="width:70%;">Descrizione</th>\n <th style="width:5%;">V1</th>\n <th style="width:5%;">V2</th>\n <th style="width:5%;">V3</th>\n <th style="width:10%;">Lingua</th>\n <th style="width:5%;"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of valoris;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }">\n <td style="width:70%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput [(ngModel)]="u.descrizione" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.v1" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.v2" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.v3" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:10%;">\n <mat-form-field appearance="outline" floatLabel="always">\n <input matInput type="text" [(ngModel)]="u.lingua" (focusout)="update_tassoc(u)">\n </mat-form-field>\n </td>\n <td style="width:5%;">\n\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button mat-flat-button style="background-color: #F5F5F5" (click)="dialogRef.close(\'\')">CHIUDI</button>\n </div>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It,Mt])],t)}(),di=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(ci,{width:"90%",height:"550px"});setTimeout((function(){e.componentInstance.id_tipo=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_TABLE_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t.ctorParameters=function(){return[{type:Mt},{type:It},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"application",void 0),yt([e.ViewChild("cmb_sel"),St("design:type",qt)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"FHTableManager",template:'\n <div [hidden]="!b_init" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="6px">\n &nbsp;<FHComboBox #cmb_sel sql="SELECT_TABLE_MANAGEMENT" label="Gestisci Tabella:"\n init_fill="false"></FHComboBox>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n\n\n </div>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt,It,l.MatDialog])],t)}(),hi=function(){function t(t,e,i,n){this.dialogRef=t,this.toastr=e,this._dataService=n,this.label="",this.sql="",this.single_sel=!1,this.sel_values="",this.role_id=-1,this.users=[],this.m_appService=i}return t.prototype.ok=function(){},t.prototype.add_assoc=function(){var t=this;if(console.log(this.autoc.getValue()),""!=this.autoc.getValue()){var e=new Dt;e.sql="INSERT_UPDATE_ASSOC_ROLE_USER",e.types=["string","int"],e.values=[this.autoc.getValue(),this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.ref_user_list()}))}},t.prototype.delete_uassoc=function(t){var e=this,i=new Dt;i.sql="DELETE_ASSOC_ROLE_USER",i.types=["string","int"],i.values=[t.username,this.role_id];this._dataService.doQuery(i).subscribe((function(t){null!=t&&"OK"==t.result_msg&&(!0,e.ref_user_list())}),(function(t){}))},t.prototype.ref_user_list=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_BY_IDROLE",e.types=["int"],e.values=[this.role_id],this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&(t.users=e.result_data,t.autoc.types=["int"],t.autoc.values=[t.role_id],t.autoc.fillCombo(),t.autoc.resetValue())}))},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){t.ref_user_list()}))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:n.ToastrService},{type:It},{type:Mt}]},yt([e.ViewChild("autoc"),St("design:type",pe)],t.prototype,"autoc",void 0),t=yt([e.Component({selector:"win_manage_roles",template:'\n\n\n <div fxLayout="column" style="height: 520px">\n <div fxLayout="row" style="width: 90%">\n <div style="width:100%" fxLayout="row" fxAlign="start center"><b>Seleziona&nbsp;per&nbsp;associare&nbsp;utente:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <div style="width:100%">\n <FHAutoComplete sql="SELECT_NOT_USERS_BY_IDROLE" #autoc [init_fill]="false" (selchange)="add_assoc()"\n label="Add user"></FHAutoComplete>\n </div>\n </div>\n </div>\n <div fxLayout="column" style="overflow-y: scroll;height:100%;">\n <div fxLayout="column" style="overflow-y: scroll;height:420px;">\n <table style="min-width:60%">\n <tr>\n <td>\n\n <div style="overflow-y: auto;" fxLayout="row" fxLayoutAlign="center start" [style.height]="m_appService.getState().body_height3">\n\n <br>\n <section class="bs">\n <table style="min-width: 600px" class="fh_table">\n <thead>\n <tr >\n <th>Utente</th>\n\n\n <th style="width: 60px" class="actions"></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor="let u of users;let odd=odd; let even=even;" [ngClass]="{ odd: odd, even: even }">\n <td>{{u.cognome}} {{u.nome}}</td>\n\n <td style="text-align: center;">\n <a mat-icon-button (click)="delete_uassoc(u)">\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n </td>\n </tr>\n </table>\n </div>\n </div>\n <div fxLayout="row" fxLayoutAlign="center center" style="width: 100%">\n\n <button mat-flat-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n </div>\n\n </div>\n '}),St("design:paramtypes",[l.MatDialogRef,n.ToastrService,It,Mt])],t)}(),_i=function(){function t(t,e,i){this._dataService=t,this.app=e,this._dialog=i,this.application="",this.b_init=!1}return t.prototype.edit_values=function(){var t=this;if("-1"!=this.cmb_sel.getValue()){var e=this._dialog.open(hi,{width:"90%",height:"550px"});setTimeout((function(){e.componentInstance.role_id=Number(t.cmb_sel.getValue())})),e.afterClosed().subscribe((function(t){}))}},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){""!=t.application&&(t.cmb_sel.sql="SELECT_APP_USER_MANAGEMENT",t.cmb_sel.types=["string"],t.cmb_sel.values=[t.application],t.cmb_sel.fillCombo(),t.b_init=!0)}))},t.ctorParameters=function(){return[{type:Mt},{type:It},{type:l.MatDialog}]},yt([e.Input(),St("design:type",String)],t.prototype,"application",void 0),yt([e.ViewChild("cmb_sel"),St("design:type",qt)],t.prototype,"cmb_sel",void 0),t=yt([e.Component({selector:"FHRoleManager",template:'\n <div [hidden]="!b_init" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="6px">\n &nbsp;&nbsp;&nbsp;&nbsp;<FHComboBox #cmb_sel sql="SELECT_APP_USER_MANAGEMENT" label="Gestisci Ruoli:"\n init_fill="false"></FHComboBox>&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button (click)="edit_values()" color="primary">\n Modifica\n </button>\n\n </div>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt,It,l.MatDialog])],t)}(),mi=function(){function t(t,i){this._dataService=t,this._dataService_odbc=i,this.init_fill=!0,this.sql="",this.types=new Array,this.values=new Array,this.hidden=!1,this.label="",this.enabled=!0,this.required=!1,this.sel_label="",this.fillend=new e.EventEmitter,this.selchange=new e.EventEmitter,this.initend=new e.EventEmitter,this.myData=[],this.valDef="-1",this.selval="-1",this.errorMsg="",this.db_type="1",this.dis_value="",this.descri_val=""}return t.prototype.update_dis=function(){this.dis_value="";try{if(null!=this.descri_val&&""!=this.descri_val)return void(this.dis_value=this.descri_val);null==this.valDef?this.dis_value="":this.dis_value=this.valDef.split("-1").join("")}catch(t){console.log("errore split -> this.valDef ",this.valDef)}},t.prototype.resetValue=function(){this.selval="-1",this.valDef="-1",this.update_dis()},t.prototype.focus=function(){this.smtr.nativeElement.focus()},t.prototype.reset=function(){this.selval="-1",this.valDef="-1",this.myData=new Array,this.update_dis()},t.prototype.fillCombo=function(){var t=this;if(null==this.sql&&(this.sql=""),-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var e=new Dt;e.sql=this.sql,e.types=this.types,e.values=this.values;"1"==this.db_type&&this._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&t.resetD(e.result_data)}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"})),"2"==this.db_type&&this._dataService_odbc.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){for(var i=0;i<e.result_data.length;i++)null!=e.result_data[i].VALORE&&(e.result_data[i].valore=e.result_data[i].VALORE),null!=e.result_data[i].DESCRIZIONE_VALORE&&(e.result_data[i].descrizione_valore=e.result_data[i].DESCRIZIONE_VALORE);t.resetD(e.result_data),!0}}),(function(e){t.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+t.sql+"]"}))}else this.set_options(this.sql)},t.prototype.add_option=function(t){this.myData.push(t)},t.prototype.resetD=function(t){this.myData=t,this.selval="-1",this.setByValue(this.valDef),"-1"==this.getValue()&&"-1"!=this.valDef&&this.setByDescri(this.valDef),this.fillend.emit()},t.prototype.setByDescri=function(t){if(this.valDef=t,this.selval="-1",""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].descrizione_valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]&&this.myData.length>t&&this.setByDescri(this.myData[t].descrizione_valore)},t.prototype.getObj=function(){if(null==this.selval)return null;if("-1"==this.selval)return null;for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t]},t.prototype.setByValue=function(t){if(this.valDef=t,this.selval="-1",""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0]){for(var e=0;e<this.myData.length;e++)if(this.myData[e].valore==t)return this.selval=""+this.myData[e].valore,null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore),void this.update_dis();this.update_dis()}},t.prototype.getDescri=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}if(null==this.selval)return"-1";if("-1"==this.selval)return"-1";for(var t=0;t<this.myData.length;t++)if(this.myData[t].valore==this.selval)return this.myData[t].descrizione_valore},t.prototype.getValue=function(){if(!this.enabled){if(null==this.selval)return this.valDef;if("-1"==this.selval)return this.valDef}return null==this.selval?"-1":""==this.selval?"-1":this.selval},t.prototype.getData=function(t){for(var e in this.myData)if(this.myData[e].valore==this.selval)return this.myData[e][t]},t.prototype.set_options=function(t){this.myData=new Array;for(var e=t.split("$"),i=0;i<e.length;i++){var n=new Object,o=e[i].split("|");n.valore=o[1],n.descrizione_valore=o[0],this.myData.push(n)}this.setByValue(this.valDef),"-1"==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){if(1==t.init_fill){if(""==t.sql)return;t.fillCombo()}else t.errorMsg="";t.initend.emit()}))},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.ctorParameters=function(){return[{type:Mt},{type:Ot}]},yt([e.Input(),St("design:type",Boolean)],t.prototype,"init_fill",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sql",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"types",void 0),yt([e.Input(),St("design:type",Array)],t.prototype,"values",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"label",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"enabled",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"required",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"sel_label",void 0),yt([e.ViewChild("cmb"),St("design:type",e.ElementRef)],t.prototype,"smtr",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"fillend",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"selchange",void 0),yt([e.Output(),St("design:type",e.EventEmitter)],t.prototype,"initend",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"valDef",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"db_type",void 0),t=yt([e.Component({selector:"FHFilterComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden">\n <mat-select #cmb [(ngModel)]="selval" (selectionChange)="sc()" [required]="required" [placeholder]="label">\n <mat-option value="-1">{{sel_label}}</mat-option>\n <mat-option value="{{app.valore}}" *ngFor="let app of myData">{{app.descrizione_valore}}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field [hidden]="enabled || hidden" appearance="outline" floatLabel="always"><mat-label>{{label}}</mat-label>\n <input type="text" #el1 matInput [disabled]="true" [(ngModel)]="dis_value">\n </mat-form-field>\n ',styles:["\n\n "]}),St("design:paramtypes",[Mt,Ot])],t)}(),gi=function(){function t(t,e,i,n,o,s){this.dialogRef=t,this.m_dialogRef=e,this.m_appService=i,this.toastr=n,this._dataService=o,this.m_wkf=s,this.not_int=!0,this.nota="",this.title="COMMENTI",this.b_edit=!1,this.b_ins=!0,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc=""}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ok=function(){if(this.not_int){if(""==this.nota)return void this.toastr.error("INSERIRE UN COMMENTO");this.select_destinatari()}else this.ok_op()},t.prototype.select_destinatari=function(){var t=this,e=new Dt;e.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",e.types=["string"],e.values=["'"+this.lettori.split(",").join("','")+"'"];this._dataService.doQuery(e).subscribe((function(e){var i=t.m_dialogRef.open(Be,{disableClose:!0});setTimeout((function(){i.componentInstance.init_arr(e.result_data)})),i.afterClosed().subscribe((function(e){if(null!=e){for(var i="",n=0;n<e.arrsel.length;n++)""!=i&&(i+=","),i+=e.arrsel[n].username;t.ok_op(i)}}))}),(function(t){}))},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){void 0===p&&(p=!0),void 0===u&&(u="");var c=new Dt;c.sql="send_wkf_mail",c.values=[t,e,i,n.split("\n").join("<br>"),o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe((function(t){}))},t.prototype.ok_op=function(t){var e=this;void 0===t&&(t="");var i=new Dt;i.sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string","string"],i.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc,this.nota,this.m_appService.getState().wkf_doc_info.curr_user,""],this._dataService.doQuery(i).subscribe((function(i){null!=i&&"OK"==i.result_msg&&(e.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e.b_edit=!1,""!=t&&e.sendEMail_ex(e.m_appService.getState().wkf_doc_info.curr_user,t,e.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+e.nota.split("\n").join("<br>"),e.m_appService.getState().wkf_doc_info.uiid_app,e.m_appService.getState().wkf_doc_info.uiid_doc,e.link,e.codice_doc,""))}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngAfterViewInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:l.MatDialog},{type:It},{type:n.ToastrService},{type:Mt},{type:He}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <div mat-dialog-content style="min-width:800px;font-size: 12px;" >\n\n <mat-form-field appearance="outline" floatLabel="always"><mat-label>Commento</mat-label>\n <textarea matInput [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n\n <div>\n <button mat-flat-button color="primary" (click)="ok()"> OK</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color="warn" (click)="annulla()">ANNULLA</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n </div>\n\n ',styles:["\n\n\n\n "]}),St("design:paramtypes",[l.MatDialogRef,l.MatDialog,It,n.ToastrService,Mt,He])],t)}(),fi=function(){function t(t,e,i){this.dialogRef=t,this.appService=e,this._dataService=i,this.user="",this.user_name="",this.user_surname="",this.user_email="",this.user_roles="",this.user_lang="",this.isadmin="",this.foto_ut="",this.dev_mode=!1,this.b_filef=!1,this.user=this.appService.user,this.user_name=this.appService.user_name,this.user_surname=this.appService.user_surname,this.user_email=this.appService.user_email,null!=this.appService.user_roles&&(this.user_roles=this.appService.user_roles.split(",").join(" ")),this.user_lang=this.appService.user_lang,this.isadmin=this.appService.user_isadmin}return t.prototype.close=function(){this.dialogRef.close(null)},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){"1"==t.isadmin&&null!=t.appService.dev_mode&&"1"==t.appService.dev_mode&&(t.dev_mode=!0);var e=new Dt;e.sql="SELECT_ALLEGATI_DOCUMENTO",e.types=["string","string"],e.values=["FOTO_UTENTI",t.appService.user],t._dataService.doQuery(e).subscribe((function(e){null!=e&&"OK"==e.result_msg&&e.result_data.length>0&&(t.b_filef=!0,t.foto_ut=t.appService.COMPANY_SITE_ROOT+"/uploads/"+e.result_data[0].App+"/"+e.result_data[0].K+"/"+e.result_data[0].Filename)}))}))},t.prototype.upd_dev=function(t){t?(this.appService.dev_mode="1",localStorage.setItem(this.appService.COMPANY_KEY+"dev_mode",this.appService.dev_mode)):(this.appService.dev_mode="0",localStorage.removeItem(this.appService.COMPANY_KEY+"dev_mode"))},t.ctorParameters=function(){return[{type:l.MatDialogRef},{type:It},{type:Mt}]},t=yt([e.Component({template:'\n <div style="width:100%" fxLayout="row" fxLayoutAlign="end start"><img src="assets/icons/x.png" style="cursor: pointer;" (click)="close()" /> </div>\n <hr width="100%" size="0.5" color="#DDDDDD">\n\n <h2 mat-dialog-title style="min-width:300px">Info Utente</h2>\n <mat-dialog-content style="font-size:12px">\n\n <table class="fh_table">\n\n <tbody>\n <tr class="odd">\n\n <td>Nome</td>\n <td><b>{{user_name}}</b></td>\n </tr>\n <tr class="even">\n\n <td>Cognome</td>\n <td><b>{{user_surname}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>Username</td>\n <td><b>{{user}}</b></td>\n\n </tr>\n <tr class="even">\n\n <td>Email</td>\n <td><b>{{user_email}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>Ruoli</td>\n <td><b>{{user_roles}}</b></td>\n\n </tr>\n <tr class="even">\n\n <td>Lingua</td>\n <td><b>{{user_lang}}</b></td>\n\n </tr>\n <tr *ngIf="isadmin == \'1\'" class="odd">\n\n <td>DEV MODE</td>\n <td><b><mat-checkbox [(ngModel)]="dev_mode" (ngModelChange)="upd_dev(dev_mode)"></mat-checkbox></b></td>\n\n </tr>\n </tbody>\n </table>\n <img style="vertical-align:middle;max-height:300px" *ngIf="b_filef" aria-hidden src="{{foto_ut}}" />\n\n\n <div fxLayoutAlign="center center" fxLayout="row">\n <button mat-flat-button color="primary" (click)="dialogRef.close()">CHIUDI</button>\n </div>\n </mat-dialog-content>\n '}),St("design:paramtypes",[l.MatDialogRef,It,Mt])],t)}(),vi=function(){function t(t,e){this._dataService=t,this._toast=e,this.color="#FFFFFF",this.bk_color="#000000",this.hidden=!1,this.key=""}return t.prototype.open_help=function(){var t=this;if(""!=this.key){var e=new Dt;e.sql="SELECT_HELP_TEXT",e.types=["string"],e.values=[this.key],this._dataService.doQuery(e).subscribe((function(e){if(null!=e&&"OK"==e.result_msg)if(e.result_data.length>0){if(null==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);if(""==e.result_data[0].url)return void t._toast.error("help non disponibile: "+t.key);"L"==e.result_data[0].t&&window.open(e.result_data[0].url),"I"==e.result_data[0].t&&t._toast.info(e.result_data[0].url,"HELP",{timeOut:5e3,positionClass:"toast-center-center"})}else{t._toast.error("help non disponibile: "+t.key);var i=new Dt;i.sql="INSERT_HELP_TEXT",i.types=["string"],i.values=[t.key],t._dataService.doQuery(i).subscribe()}}))}},t.ctorParameters=function(){return[{type:Mt},{type:n.ToastrService}]},yt([e.Input(),St("design:type",String)],t.prototype,"color",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"bk_color",void 0),yt([e.Input(),St("design:type",Boolean)],t.prototype,"hidden",void 0),yt([e.Input(),St("design:type",String)],t.prototype,"key",void 0),t=yt([e.Component({selector:"FHHelpButton",template:'\n\n\n\n <div style="cursor:pointer" ><mat-icon [style.color]="color" [style.background-color]="bk_color" [hidden]="hidden" (click)="open_help()">info</mat-icon></div>\n\n\n\n ',styles:["\n\n\n "]}),St("design:paramtypes",[Mt,n.ToastrService])],t)}(),yi=function(){function t(){}var i;return i=t,t.forRoot=function(){return{ngModule:i,providers:[It,U.NgForage,Mt,xt,Ct,Ot,He,Qt,Ht,Tt,We,ae]}},t.forChilds=function(){return{ngModule:i,providers:[]}},t=i=yt([e.NgModule({imports:[V.TranslateModule,z.CdkTableModule,mt.MatBadgeModule,g.MatAutocompleteModule,l.MatDialogModule,K.MatButtonModule,Y.MatButtonToggleModule,H.MatCardModule,G.MatCheckboxModule,Q.MatChipsModule,W.MatDatepickerModule,X.MatExpansionModule,$.MatFormFieldModule,J.MatGridListModule,Z.MatIconModule,tt.MatInputModule,et.MatListModule,it.MatMenuModule,nt.MatProgressBarModule,ot.MatProgressSpinnerModule,st.MatRadioModule,_.MatSelectModule,m.MatSlideToggleModule,rt.MatSliderModule,at.MatSidenavModule,lt.MatSnackBarModule,pt.MatStepperModule,L.MatTabsModule,ut.MatToolbarModule,ct.MatTooltipModule,dt.MatPaginatorModule,ht.MatSortModule,_t.MatTableModule,v.MatNativeDateModule,u.FileUploadModule,P.AgGridModule.withComponents([Rt]),y.CommonModule,q.DragulaModule,p.FormsModule,j.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),N.FlexLayoutModule,M.MarkdownModule,F.CKEditorModule],exports:[vi,fi,gi,_i,ui,li,ai,ni,ii,Lt,Nt,Pt,jt,Yt,Bt,le,qt,zt,pe,ge,Rt,te,fe,ye,ve,be,Wt,Se,we,Ut,Gt,Ie,Xt,Ee,Oe,xe,ke,Kt,Ae,Re,Le,Me,Ze,Fe,Vt,ne,At,Qe,$t,Et,Dt,kt,Xe,Pe,ti,ei,di],declarations:[vi,fi,gi,_i,ui,li,ri,ai,ni,ii,$e,Lt,Nt,Pt,jt,Yt,Bt,Ze,le,qt,zt,pe,ge,Rt,te,fe,ye,ve,be,Wt,Se,we,Ut,Gt,Ie,Xt,Ee,Oe,xe,ke,Kt,Ae,Re,Le,Me,Fe,Vt,ne,At,Qe,$t,Et,Dt,kt,Pe,je,ze,Ue,Ve,qe,Ke,Ge,Ye,Jt,Zt,ee,oe,Be,Xe,ti,ei,di,ci,hi,mi],providers:[Ce,q.DragulaService],entryComponents:[fi,gi,hi,ci,ni,ii,Pe,je,ze,Ue,Ve,qe,Ke,Ge,Ye,Jt,Zt,oe,ee,Be,Ee,zt,Lt,te,fe,be,Wt,Se,we,Gt,Xt,Oe,Kt,Le,Fe,Vt]})],t)}(),bi=function(){function t(t,e,i,n,o,s,r){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.slimLoadingBarService=s,this.app_s=r,this.url=this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT,this.routingDestination="",this.arr_accessi=null}return t.prototype.canActivate=function(t,e){var i=this;return this.routingDestination=t.url[0].path,""==this.routingDestination||("login"==this.routingDestination||"rp"==this.routingDestination||"pr"==this.routingDestination||"/"==this.routingDestination||(this.auth.checkCredentials()?"home"==this.routingDestination||(null!=this.app_s.user_isadmin&&"1"==this.app_s.user_isadmin||new Promise((function(t){if(null!=i.arr_accessi){for(var e=0;e<i.arr_accessi.length;e++)if("M"==i.arr_accessi[e].type&&"["+i.arr_accessi[e].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);return i.toast.error("ACCESS DENIED [0X0003]"),i.slimLoadingBarService.complete(),void t(!1)}var n=new Dt;if(n.sql="SELECT_USER_ACCESS_AUTH",n.values=[],n.types=[],null==i.app_s.user||null==i.app_s.user_isadmin)i.querys.doQuery(n).subscribe((function(e){if(null!=e&&"OK"==e.result_msg){if(!(e.result_data.length>0))return i.toast.error("ACCESS DENIED [0X0002]"),i.slimLoadingBarService.complete(),t(!1),!1;if(i.app_s.user_roles=e.result_data[0].roles,null!=i.app_s.user_roles&&i.app_s.user_roles.length>0&&(i.app_s.user_roles=i.app_s.user_roles.substr(1)),null==i.app_s.user_roles&&(i.app_s.user_roles="[NO_RUOLI_CONFIGURATI]"),i.app_s.user_isadmin=e.result_data[0].isadmin,i.app_s.user=e.result_data[0].username,null!=i.app_s.user_isadmin&&"1"==i.app_s.user_isadmin)return void t(!0);var n=new Dt;n.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],n.types=["string"],n.values=[i.app_s.user],i.querys.doQuery(n).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);i.toast.error("ACCESS DENIED [0X0001]"),t(!1),i.slimLoadingBarService.complete()}))}}));else{console.log("this.app_s ",i.app_s);var o=new Dt;if(console.log("this.app_s.user_isadmin ",i.app_s.user_isadmin),console.log("this.app_s.user_isadminsss ",i.app_s.user_isadmin+""),null!=i.app_s.user_isadmin&&i.app_s.user_isadmin+""=="1")return console.log("resolve true"),void t(!0);o.sql="SELECT_APPS_USER_ALL",i.app_s.getState().app_enabled=[],o.types=["string"],o.values=[i.app_s.user],i.querys.doQuery(o).subscribe((function(e){i.arr_accessi=e.result_data;for(var n=0;n<i.arr_accessi.length;n++)if("M"==i.arr_accessi[n].type&&"["+i.arr_accessi[n].url.split("/")[0]+"]"=="["+i.routingDestination.split("/")[0]+"]")return void t(!0);console.log(i.arr_accessi," ",i.routingDestination),i.toast.error("ACCESS DENIED [0X0005]"),t(!1),i.slimLoadingBarService.complete()}))}}))):(this.toast.error("ACCESS DENIED [0X0004]"),this.slimLoadingBarService.complete(),!1)))},t.ctorParameters=function(){return[{type:i.HttpClient},{type:Ht},{type:c.Router},{type:n.ToastrService},{type:Mt},{type:d.SlimLoadingBarService},{type:It}]},t=yt([e.Injectable(),St("design:paramtypes",[i.HttpClient,Ht,c.Router,n.ToastrService,Mt,d.SlimLoadingBarService,It])],t)}();t.AppMakerService=xt,t.AppService=It,t.ApprovaGridComponent=fe,t.AuthenticationService=Ht,t.ComboBoxEditor=we,t.CurrencyComponent=jt,t.FHAutoCompleteComponent=pe,t.FHComboboxComponent=qt,t.FHConfirmComponent=zt,t.FHCurrencyFieldComponent=Ae,t.FHCurrencyFormatterDirective=ye,t.FHCurrencyPipe=ve,t.FHDatePickerComponent=ge,t.FHFieldPickListComponent=ui,t.FHGridComponent=le,t.FHGridJSONComponent=Xe,t.FHGuard=bi,t.FHListComponent=Ut,t.FHListPick=Fe,t.FHLogPanelComponent=ke,t.FHMdReader=xe,t.FHNumericFieldComponent=Me,t.FHPickListComponent=Ee,t.FHRichText=Re,t.FHRoleManager=_i,t.FHTableManager=di,t.FHTimePickerComponent=Pt,t.FHUploadComponent=Bt,t.FHUploadPanelComponent=Yt,t.FHUserFieldComponent=ne,t.FHUserPickerComponent=te,t.FHWinComboSelect=Gt,t.FSInput=At,t.FSResult=Qe,t.FileService=Ct,t.FluxhubLibModule=yi,t.FormBuilderComponent=ti,t.FormExecuterComponent=ei,t.GridService=Qt,t.LocalDBService=We,t.NumericEditorComponent=Rt,t.OdbcService=Ot,t.OfficeAutomatorService=ae,t.QGParam=$t,t.QGResult=Et,t.QParam=Dt,t.QResult=kt,t.QueryService=Mt,t.ReplaceLineBreaks=Ie,t.TextAreaEditor=Se,t.UtilityService=Tt,t.WinAskButtonsComponent=ii,t.WinAskNumberComponent=Oe,t.WinAskTextBigComponent=Kt,t.WinAskTextComponent=Xt,t.WinOutputComponent=Le,t.WinWait=Vt,t.WkfService=He,t.dati_aggiuntivi=Je,t.fhimagepreview=ai,t.win_insert_commento=gi,t.win_mappa=be,t.win_salva_annulla=Pe,t.win_show_image=ni,t.win_time_slider=Lt,t.win_user_info=fi,t.wkf_header_bar=Ze,t.wkfapp=se,t.ɵa=pi,t.ɵb=De,t.ɵba=ee,t.ɵbb=oe,t.ɵbc=Be,t.ɵbd=ci,t.ɵbe=hi,t.ɵbf=mi,t.ɵc=Ne,t.ɵd=Te,t.ɵe=ie,t.ɵf=vi,t.ɵg=li,t.ɵh=Nt,t.ɵi=Ft,t.ɵj=ce,t.ɵk=_e,t.ɵl=Wt,t.ɵm=Ce,t.ɵn=ri,t.ɵp=$e,t.ɵq=je,t.ɵr=ze,t.ɵs=Ue,t.ɵt=Ve,t.ɵu=qe,t.ɵv=Ke,t.ɵw=Ge,t.ɵx=Ye,t.ɵy=Jt,t.ɵz=Zt,Object.defineProperty(t,"__esModule",{value:!0})}));
17
17
  //# sourceMappingURL=fluxhub-fluxhub-lib.umd.min.js.map