@fluxhub/fluxhub-lib 1.0.166 → 1.0.168
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.
- package/bundles/fluxhub-fluxhub-lib.umd.js +3 -3
- package/bundles/fluxhub-fluxhub-lib.umd.js.map +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js +1 -1
- package/bundles/fluxhub-fluxhub-lib.umd.min.js.map +1 -1
- package/esm2015/lib/wkf_engine/wkfapp.js +3 -3
- package/esm5/lib/wkf_engine/wkfapp.js +3 -3
- package/fesm2015/fluxhub-fluxhub-lib.js +4 -4
- package/fesm2015/fluxhub-fluxhub-lib.js.map +1 -1
- package/fesm5/fluxhub-fluxhub-lib.js +4 -4
- package/fesm5/fluxhub-fluxhub-lib.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http"),require("ngx-toastr"),require("rxjs/operators"),require("rxjs"),require("ngx-simple-crypt"),require("@angular/material"),require("@angular/forms"),require("@angular/router"),require("ng2-file-upload"),require("ng2-slim-loading-bar"),require("ag-grid-enterprise"),require("@angular/common"),require("clipboard"),require("prismjs"),require("prismjs/plugins/toolbar/prism-toolbar"),require("prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard"),require("prismjs/components/prism-css"),require("prismjs/components/prism-javascript"),require("prismjs/components/prism-java"),require("prismjs/components/prism-markup"),require("prismjs/components/prism-typescript"),require("prismjs/components/prism-sass"),require("prismjs/components/prism-scss"),require("prismjs/components/prism-sql"),require("bpmn-js/lib/NavigatedViewer"),require("ngforage"),require("ng2-dragula"),require("@angular/flex-layout"),require("ngx-markdown"),require("ng2-ckeditor"),require("ag-grid-angular"),require("mydatepicker"),require("@agm/core"),require("@angular/cdk/table"),require("@ngx-translate/core"),require("@angular/http")):"function"==typeof define&&define.amd?define("@fluxhub/fluxhub-lib",["exports","@angular/core","@angular/common/http","ngx-toastr","rxjs/operators","rxjs","ngx-simple-crypt","@angular/material","@angular/forms","@angular/router","ng2-file-upload","ng2-slim-loading-bar","ag-grid-enterprise","@angular/common","clipboard","prismjs","prismjs/plugins/toolbar/prism-toolbar","prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard","prismjs/components/prism-css","prismjs/components/prism-javascript","prismjs/components/prism-java","prismjs/components/prism-markup","prismjs/components/prism-typescript","prismjs/components/prism-sass","prismjs/components/prism-scss","prismjs/components/prism-sql","bpmn-js/lib/NavigatedViewer","ngforage","ng2-dragula","@angular/flex-layout","ngx-markdown","ng2-ckeditor","ag-grid-angular","mydatepicker","@agm/core","@angular/cdk/table","@ngx-translate/core","@angular/http"],e):e((t.fluxhub=t.fluxhub||{},t.fluxhub["fluxhub-lib"]={}),t.ng.core,t.ng.common.http,t.i3,t.rxjs.operators,t.rxjs,t.ngxSimpleCrypt,t.ng.material,t.ng.forms,t.ng.router,t.ng2FileUpload,t.ng2SlimLoadingBar,null,t.ng.common,null,null,null,null,null,null,null,null,null,null,null,null,t.NavigatedViewer,t.i1$1,t.ng2Dragula,t.ng["flex-layout"],t.ngxMarkdown,t.ng2Ckeditor,t.agGridAngular,t.mydatepicker,t.core,t.ng.cdk.table,t.core$1,t.ng.http)}(this,function(t,l,p,e,r,o,n,i,s,a,u,c,d,h,_,m,g,f,v,y,b,I,S,E,O,C,w,R,A,N,D,k,T,M,P,x,L,F){"use strict";w=w&&w.hasOwnProperty("default")?w["default"]:w;var j=function(){function t(){this.API_ENDPOINT="http://localhost:9090/api/",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.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}}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.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=l.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),U=function(){function t(){}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),V=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,i){var n=this;void 0===i&&(i=!0),this.headers=new p.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 e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),z=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,i){var n=this;void 0===i&&(i=!0),this.headers=new p.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 e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),K=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,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new p.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")});var e=JSON.stringify(t);return this.http.post(this.url,e).pipe(r.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 U}),r.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),o.Observable["throw"](e)},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),Y=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),q=function(){function t(){this.values=new Array,this.types=new Array,this.names=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),G=function(){function t(){this.command="",this.p1="",this.p2=""}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),B=function(t,e){return(B=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 H(t,e){function i(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function W(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||0<e--)&&!(n=s.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(i=s["return"])&&i.call(s)}finally{if(o)throw o.error}}return r}var X=function(){function i(t){this.app_s=t,this.simpleCrypt=new n.SimpleCrypt}return i.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()},i.prototype.gridDateStyle=function(t){return{"text-align":"center"}},i.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)})},i.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(undefined);return t.splice(i,0,t.splice(e,1)[0]),t},i.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"),0<(t||"").toString().indexOf(",")&&(t=(t||"").toString().split(".").join("").split(",").join("."));var s=W((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=0<e?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},i.prototype.number2bool=function(t){return null!=t&&1==t},i.prototype.bool2number=function(t){return null==t?0:t?1:0},i.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},i.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&&19<=t.length){i=(o=(t=t.substring(0,19)).split("T"))[0].split("-");var n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}if(3==e&&16<=t.length){var o;i=(o=(t=t.substring(0,16)).split(" "))[0].split("/"),n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),0)}if(4!=e)return null;if(!t)return null;var s=t.split("/").map(function(t){return parseInt(t)});return new Date(s[2],s[1]-1,s[0])},i.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},i.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},i.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?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},i.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},i.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()].join("")},i.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[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()," ",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},i.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=W((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},i.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},i.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i,"T",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},i.prototype.check2int=function(t){return t?1:0},i.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()}},i.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]))},i.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"Parametro SQL_SERVER_LANG non corretto"},i.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"}},i.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},i.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=3<(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)?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):"")},i.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},i.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},i.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},i.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},i.prototype.encrypt_v2=function(t){return this.simpleCrypt.encode("prologika_fluxhub_etjda",t)},i.prototype.decrypt_v2=function(t){return this.simpleCrypt.decode("prologika_fluxhub_etjda",t)},i.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},i.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles")&&(!(!e||null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin"))||-1<localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles").toUpperCase().indexOf(t.toLocaleUpperCase()))},i.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:j}]},i.ngInjectableDef=l.defineInjectable({factory:function(){return new i(l.inject(j))},token:i,providedIn:"root"}),i}(),Q=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,0<="1234567890,".indexOf(t.charPress)?(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 1e6<parseFloat(this.value.split(".").join("").split(",").join("."))},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){this.input.element.nativeElement.focus()},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(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(96<=e&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t.decorators=[{type:l.Component,args:[{selector:"numeric-cell",template:'<input #input (keydown)="onKeyDown($event)" [(ngModel)]="value" style="fontSize:40;height:30px;">'}]}],t.ctorParameters=function(){return[{type:X}]},t.propDecorators={input:[{type:l.ViewChild,args:["input",{read:l.ViewContainerRef}]}]},t}(),J=function(){function t(t){this.uti_s=t,this.label=""}return t.prototype.setDt=function(){this.date_zz=this.appdt.getValue(),this.params.api.stopEditing()},t.prototype.ngAfterViewInit=function(){this.appdt.setFocus()},t.prototype.agInit=function(t){return null==(this.params=t).value?(this.date=null,void(this.date_zz=null)):1970==new Date(t.value).getFullYear()?(this.date=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.date=null,void(this.date_zz=null)):(this.date=new Date(t.value),this.appdt.setValue(this.date),void(this.date_zz=new Date(t.value)))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz.getFullYear().toString()+"-"+this.uti_s.format2cifre(this.date_zz.getMonth()+1)+"-"+this.uti_s.format2cifre(this.date_zz.getDate())+"T00:00:00"},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container fxLayout="row" class="mood" tabindex="0" (keydown)="onKeyDown($event)">\n\n <DtPicker [(ngModel)]="date" #appdt\n [show_buttons]="false" ngDefaultControl\n\n >\n </DtPicker>\n <button mat-raised-button (click)="setDt()">CONFERMA</button>\n\n </div>\n\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.ctorParameters=function(){return[{type:X}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),Z=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.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.ngOnInit=function(){if(null!=this.m_appService.getState().appo_dialog&&null!=this.m_appService.getState().appo_dialog.val){var t=this.m_appService.getState().appo_dialog.val.split(":");return this.h=parseInt(t[0]),this.m=parseInt(t[1]),void(this.res=this.m_appService.getState().appo_dialog.val)}},t.decorators=[{type:l.Component,args:[{selector:"fhtimeslider",template:'\n\n <h2 mat-dialog-title style="min-width:300px">Seleziona Orario -> {{res}}</h2>\n\n <mat-dialog-content><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-raised-button (click)="ok()">OK</button>\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j},{type:X}]},t}(),$=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)&&3<n[0].length){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=(0<r.length?r+".":"")+s}else i=n[0];1<n.length&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t.decorators=[{type:l.Directive,args:[{selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}]}],t.ctorParameters=function(){return[{type:s.NgControl}]},t}(),tt=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,i,e){var n=this;if(void 0===i&&(i=!0),void 0===e&&(e=null),null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")){if(this.headers=new p.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==e?this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT:e,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var o=0;o<t.types.length;o++)null==t.values[o]?t.values[o]="dbnull":("boolean"==t.types[o]&&(t.values[o]?t.values[o]="1":t.values[o]="0"),"int"==t.types[o]&&(t.values[o]=""+t.values[o]),"string"==t.types[o]&&(t.values[o]=""+t.values[o]),"date"==t.types[o]&&(t.values[o]=this.uti_s.sql_date(t.values[o])),"datetime"==t.types[o]&&(t.values[o]=this.uti_s.sql_date_time(t.values[o])),"decimal"==t.types[o]&&(t.values[o]=""+t.values[o]),"string"==t.types[o]&&null==t.values[o]&&(t.values[o]="dbnull"));var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(r.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 U}),r.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.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:e.ToastrService},{type:j},{type:X}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(e.ToastrService),l.inject(j),l.inject(X))},token:t,providedIn:"root"}),t}(),et=function(){function t(){this.changed=[],this.touched=[]}return t.prototype.emitChanged=function(){var e=this.getValue();this.changed.forEach(function(t){return t(e)})},Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},set:function(e){this.getValue()!==e&&(this.setValue(e),this.changed.forEach(function(t){return t(e)}))},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}(),it=function(r){function t(t,e,i,n,o){var s=r.call(this)||this;return s._dataService=t,s.dialog=e,s.m_appService=i,s.toastr=n,s.uti_s=o,s.maxore=23,s.label="",s.enabled=!0,s.show_picker=!1,s.selchange=new l.EventEmitter,s.ngChange=new l.EventEmitter,s.h=0,s.m=0,s.res="",s}return H(t,r),t.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},t.prototype.doh=function(){0<this.h&&this.h--,this.sc()},t.prototype.upm=function(){this.m<60&&this.m++,this.sc()},t.prototype.dom=function(){0<this.m&&this.m--,this.sc()},t.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},t.prototype.onMi=function(){59<this.m&&(this.m=59),this.sc()},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.resetValue=function(){this.h=0,this.m=0},t.prototype.annulla=function(){this.show_picker=!1},t.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"})},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.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()},t.prototype.isValidVal=function(){return!0},t.prototype.setByValue=function(t){this.setByDescri(t)},t.prototype.setValue=function(t){this.setByDescri(t)},t.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getHours=function(){return this.h},t.prototype.getMinutes=function(){return this.m},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){var t=this.getValue();this.selchange.emit(),this.ngChange.emit(t),this.emitChanged()},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(t=t||window.event).which?t.keyCode:t.which},t.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},t.decorators=[{type:l.Component,args:[{selector:"FHTimePicker",template:'\n <div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b> \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 <b style="font-size:28px">:</b> \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:s.NG_VALUE_ACCESSOR,useExisting:t,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 "]}]}],t.ctorParameters=function(){return[{type:tt},{type:i.MatDialog},{type:j},{type:e.ToastrService},{type:X}]},t.propDecorators={maxore:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],selchange:[{type:l.Output}],ngChange:[{type:l.Output,args:["change"]}]},t}(et),nt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t.decorators=[{type:l.Component,args:[{selector:"currency-cell",template:"{{params.value | currency:'EUR'}}"}]}],t}(),ot=function(){function t(t,e){this.dialogRef=t,this.app_s=e,this.title="",this.msg="",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.setTitle=function(t){this.title=t},t.prototype.setMsg=function(t){this.msg=t},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <h1 mat-dialog-title>{{title}}</h1>\n <div mat-dialog-content>{{msg}}</div>\n <div mat-dialog-actions>\n <button mat-button (click)="dialogRef.close(true)" color="primary">CONFERMA</button>\n <button mat-button (click)="dialogRef.close(false)" color="warn">ANNULLA</button>\n </div>\n ',styles:["\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j}]},t}(),st=function(){function t(t,e,i,n,o,s,r,a){this._dataService=t,this.toastr=e,this.http=i,this.router=n,this.route=o,this._fileService=s,this.app_s=r,this.uti_s=a,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new p.HttpHeaders({"Content-Type":"application/json"})}return t.prototype.logout=function(){localStorage.removeItem(this.app_s.COMPANY_KEY+"user"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_idp"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_password"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_roles"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_lang"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_isadmin"),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 o=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(o=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,o,{headers:this.headers}).pipe(r.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 U}),r.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,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var e=JSON.stringify({username_info:t});return this.http.post(this.url,e,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.prototype.login_sa=function(){var n=this;if(!this.checkCredentials()){for(var t=window.location.href.split(/[\&?]+/),e=!1,i=0;i<t.length;i++)if("u="==t[i].substring(0,2)){var o=t[i].split("=")[1];this.username=this.uti_s.decrypt(decodeURI(o)),e=!0}else t[i];if(e)this.get_user_info(this.username).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;n.username="NA",0<i.length?(n.username=i[0].username,localStorage.setItem(n.app_s.COMPANY_KEY+"user_name",i[0].name),localStorage.setItem(n.app_s.COMPANY_KEY+"user_surname",i[0].surname),localStorage.setItem(n.app_s.COMPANY_KEY+"user",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_email",i[0].email),localStorage.setItem(n.app_s.COMPANY_KEY+"user_password",""),localStorage.setItem(n.app_s.COMPANY_KEY+"user_idp",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_lang","IT"),localStorage.setItem(n.app_s.COMPANY_KEY+"user_isadmin",i[0].isadmin),localStorage.setItem(n.app_s.COMPANY_KEY+"user_roles",i[0].roles),localStorage.setItem(n.app_s.COMPANY_KEY+"token","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJlZm9ybmkiLCJpc3MiOiJ3d3cuZmx1eGh1Yi5jb20iLCJyb2xlIjoib2tfbG9nZ2VkIiwiaWF0IjoxNTA3OTA3MzQ2fQ.xqXZsPTu8stomoIl8_2d9DhLkGU3gAi7MXwClYNkEzg"),e=!0):localStorage.removeItem("token")}e||console.log(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")});else{var s=encodeURI(window.location.href).replace("#","%23");-1==s.indexOf("?")&&(s+="?"),this.url="http://csaportale.ceramicasantagostino.it/homepage_new.nsf/OK?OpenForm&redirect="+s,window.location.href=this.url}}},t.prototype.passrecovery=function(t,i){var n=this;void 0===i&&(i=!0);var e=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,e,{headers:this.headers}).pipe(r.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 U}),r.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,i){var n=this;void 0===i&&(i=!0);var e=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,e,{headers:this.headers}).pipe(r.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 U}),r.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 o=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,o,{headers:this.headers}).pipe(r.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 U}),r.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.app_s.LOGIN_EXT?this.login_sa():-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.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:tt},{type:e.ToastrService},{type:p.HttpClient},{type:a.Router},{type:a.ActivatedRoute},{type:z},{type:j},{type:X}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(tt),l.inject(e.ToastrService),l.inject(p.HttpClient),l.inject(a.Router),l.inject(a.ActivatedRoute),l.inject(z),l.inject(j),l.inject(X))},token:t,providedIn:"root"}),t}(),rt=function(){function t(t,e,i,n,o){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=n,this.auth_s=o,this.enabled=!0,this.label="",this.sovrascrivi_path="",this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1}return 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["delete"]=function(i){var n=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(ot).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="DELETE_ALLEGATO",e.types=["int","string"],e.values=[i.id,n.auth_s.username],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))},function(t){})}})},t.prototype.ngOnInit=function(){this.upc.single=!1,this.b_mobile=this._appservice.getState().pageFullscreen,this.upc.init(this.App,this.K,"Descrizione Allegato"),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ngOnInit()},t.prototype.ref_allegato=function(){var o=this;if(null!=this.App&&""!=this.App){var t=new q;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){o.arr_g=t.result_data;for(var e="default",i=0;i<o.arr_g.length;i++){var n=o.arr_g[i].Filename.split(".");-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(n[n.length-1].toLocaleUpperCase())&&(e=n[n.length-1].toLocaleLowerCase()),o.arr_g[i].icon=e+".svg"}}})}},t.decorators=[{type:l.Component,args:[{selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n\n <h3>{{label}}</h3>\n\n <div fxLayout="column">\n <div [hidden]="!enabled">\n <FHUpload [single]="b_False" (change)="ref_allegato()" #upc></FHUpload>\n <br></div>\n\n <table width="98%" class="fh_table">\n <thead *ngIf="!b_mobile">\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:50%">Descrizione</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" style="font-size: 12px;">\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 (click)="download_all(app)" mat-raised-button>DOWNLOAD</button>\n </td>\n <td *ngIf="!b_mobile">{{app.Filename}}</td>\n <td *ngIf="!b_mobile" style="text-align:center">{{app.Filesize}}</td>\n <td *ngIf="!b_mobile">{{app.descrizione}}</td>\n <td *ngIf="!b_mobile" style="text-align:center">{{app.dt_ins | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td *ngIf="!b_mobile" style="text-align:center">\n <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">\n <mat-icon>save_alt</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a mat-icon-button matTooltip="Elimina File" *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n\n </tr>\n </table>\n\n </div>\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n \n\n "]}]}],t.ctorParameters=function(){return[{type:j},{type:tt},{type:e.ToastrService},{type:i.MatDialog},{type:st}]},t.propDecorators={enabled:[{type:l.Input}],label:[{type:l.Input}],sovrascrivi_path:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}]},t}(),at=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.update_progess=function(t){100==(this.progress_p=t)&&this.dialogRef.close()},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\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\n\n </mat-dialog-content>\n\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),lt=function(){function t(t,e,i,n){var o=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=n,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.change=new l.EventEmitter,this.upload_ended=new l.EventEmitter,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.progress_p=0,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.username=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(o.descrizione="",o.toastr.info("INFO",o.allegato_inserito,{timeOut:1e3,progressBar:!0}),o.ref_allegato(),o.change.emit())}}return t.prototype.ngOnInit=function(){var o=this,t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],this.uploader.setOptions(t),this.uploader.onCompleteAll=function(){o.loading=!1,o.upload_ended.emit(),null!=o.dialogRef&&null!=o.dialogRef.componentInstance&&(o.dialogRef.componentInstance.update_progess(100),o.dialogRef=null)},this.uploader.onErrorItem=function(t,e,i,n){o.toastr.error(e)},this.uploader.onAfterAddingFile=function(){o.ch()},this.uploader.onProgressItem=function(t,e){o.loading=!0,null!=o.dialogRef&&null!=o.dialogRef.componentInstance&&o.dialogRef.componentInstance.update_progess(e)},this.uploader.onWhenAddingFileFailed=function(t,e,i){switch(e.name){case"fileSize":var n=Math.round(t.size/1024/1024);o.toastr.error(o.limit_string.split("<size>").join(""+n));break;default:o.toastr.error("Errore: "+e.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(){var i=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this.inserire_descrizione):(this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",i.tipo),e.append("local_path",i.app_s.LOCAL_PATH),""!=i.programma_da_eseguire&&e.append("p1",i.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(at,{disableClose:!0}),this.dialogRef.componentInstance.label=this.label_attendere,this.dialogRef.afterClosed().subscribe(function(t){})),this.uploader.uploadAll())},t.prototype.init=function(t,e,i,n,o){void 0===n&&(n=""),void 0===o&&(o=""),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.ref_allegato()},t.prototype.ref_allegato=function(){var i=this;if(this.single&&null!=this.App&&""!=this.App){var t=new q;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;0<e.length&&(i.descrizione=e[0].descrizione,i.file_name=e[0].Filename,i.label_b="Download ("+e[0].Filename+" - "+e[0].Filesize+")",i.b_edit_loaded=!0)}},function(t){})}},t.decorators=[{type:l.Component,args:[{selector:"FHUpload",template:'\n <div *ngIf="loading" fxLayout="row">\n WAIT\n </div>\n <div *ngIf="enabled && !loading" fxLayout="row">\n <mat-form-field class="field_style">\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione"\n placeholder="{{label}} {{fixed_label}}">\n </mat-form-field>\n <input type="file" ng2FileSelect [uploader]="uploader" multiple/>\n <div>\n <button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>\n </div>\n </div>\n <div *ngIf="!enabled">\n <label>{{label}}:</label>{{descrizione}}\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:tt},{type:e.ToastrService},{type:i.MatDialog},{type:j}]},t.propDecorators={enabled:[{type:l.Input}],single:[{type:l.Input}],descri_obb:[{type:l.Input}],programma_da_eseguire:[{type:l.Input}],label_attendere:[{type:l.Input}],fixed_label:[{type:l.Input}],limit_string:[{type:l.Input}],allegato_inserito:[{type:l.Input}],inserire_descrizione:[{type:l.Input}],change:[{type:l.Output}],upload_ended:[{type:l.Output}]},t}(),pt=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,i,e){var n=this;void 0===i&&(i=!0),void 0===e&&(e=null),this.headers=new p.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==e?this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT:e;var o=JSON.stringify(t);return this.http.post(this.url,o,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),ut=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t}(),ct=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.ngOnInit=function(){},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.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}} (min {{min_chars}} - max {{max_chars}} caratteri)" type="text"\n [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button\n mat-raised-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),dt=function(){function t(){this.filter="",this.system_dest=1}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),ht=function(){function t(t,e,i,n,o,s,r){var a=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=n,this.slimLoadingBarService=o,this.m_dialog=s,this.uti_s=r,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.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=!1,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new l.EventEmitter,this.cell_edited=new l.EventEmitter,this.clicked=new l.EventEmitter,this.dclicked=new l.EventEmitter,this.columndclicked=new l.EventEmitter,this.cell_clicked=new l.EventEmitter,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new l.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new l.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(i){a.slimLoadingBarService.start(function(){});var n=new dt;if(n.table=a.tbl_name,n.table_count=a.tbl_name,""!=a.count_tbl_name&&(n.table_count=a.count_tbl_name),n.num_per_pag=i.endRow-i.startRow,n.curr_page=Math.round(i.startRow/n.num_per_pag),null==n.curr_page&&(n.curr_page=0),null==n.num_per_pag&&(n.num_per_pag=100),n.sort_field=a.sort_field,null!=i.sortModel&&0<i.sortModel.length){n.sort_field="";for(var t=0;t<i.sortModel.length;t++)""!=n.sort_field&&(n.sort_field=n.sort_field+","),"autori"==i.sortModel[t].colId?n.sort_field=n.sort_field+"case when CHARINDEX('"+localStorage.getItem(a.m_appService.COMPANY_KEY+"user")+"',autori)>0 then 1 else 0 end "+i.sortModel[t].sort:n.sort_field=n.sort_field+i.sortModel[t].colId+" "+i.sortModel[t].sort}n.system_dest=a.system_dest,n.field=a.fields,null!=a.filters&&(n.filter=a.filters),""!=a.fix_flt&&(""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+" ("+a.fix_flt+" )"),""!=a.fix_flt_temp&&(""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+" ("+a.fix_flt_temp+" )");var e=!1;if(null!=i.filterModel)for(var o in i.filterModel)if(null!=i.filterModel[o].type)null!=i.filterModel[o].filter&&(a.show_pulisci_filtri=!0,""!=n.filter&&(n.filter=n.filter+" and "),e=!0,"number"==i.filterModel[o].filterType?("greaterThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" > "+i.filterModel[o].filter),"equals"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" = "+i.filterModel[o].filter),"notEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <> "+i.filterModel[o].filter),"lessThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" < "+i.filterModel[o].filter),"lessThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <= "+i.filterModel[o].filter),"greaterThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" >= "+i.filterModel[o].filter),"inRange"==i.filterModel[o].type&&(n.filter=n.filter+" ("+o+" >= "+i.filterModel[o].filter+" and "+o+" <= "+i.filterModel[o].filterTo+")")):("contains"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") like '%"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"startsWith"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") like '"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"equals"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") = '"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"notContains"==i.filterModel[o].type&&(n.filter=n.filter+"not upper("+o+") like '%"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"notEqual"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") <> '"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"'"),"endsWith"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") like '%"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"'"))),null==i.filterModel[o].dateTo&&null==i.filterModel[o].dateFrom||(e=!0,""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+" (",null!=i.filterModel[o].dateFrom&&null!=i.filterModel[o].dateTo&&(n.filter=n.filter+o+">='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),null!=i.filterModel[o].dateTo?(null!=i.filterModel[o].dateFrom&&(n.filter=n.filter+" and "),n.filter=n.filter+o+"<='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateTo,1))+"'"):null!=i.filterModel[o].dateFrom&&("greaterThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"equals"==i.filterModel[o].type&&(n.filter=n.filter+" ("+o+" >='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"' and "+o+" <='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+" 23:59:00')"),"notEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <> '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"lessThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"lessThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"greaterThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'")),n.filter=n.filter+" )");else{for(var s="",r=0;r<i.filterModel[o].length;r++)null!=i.filterModel[o][r]&&(""!=s&&(s+=","),s=s+"'"+i.filterModel[o][r].replace("'","''")+"'");""!=s?(e=!0,""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+o+" in ("+s+")"):(e=!0,""!=n.filter&&(n.filter=n.filter+" and 1=0"))}a.show_pulisci_filtri=e,(a.str_curr_q_p="")!=n.filter&&(a.str_curr_q_p="where "+n.filter),""!=n.sort_field&&(a.str_curr_q_p=a.str_curr_q_p+" order by "+n.sort_field),a.curr_filter=n.filter,a._gridservice.doQuery(n,!0,a.end_point).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){e=!0,i.successCallback(t.result_data,t.count),a.b_init=!0,a.myData=t.result_data.slice(),a.num_r=t.count,a.slimLoadingBarService.complete(),a.fill_end.emit(),localStorage.setItem(a.grid_key+"_POS1",JSON.stringify(n)),null!=localStorage.getItem(a.grid_key+"_POS2")&&null!=a.gridOptions&&null!=a.gridOptions.api&&a.gridOptions.api.forEachNode(function(t){a.getRowNodeId(t)===localStorage.getItem(a.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(a.grid_key+"_POS2"))});null!=a.toggle_mantieni&&a.toggle_mantieni.checked,a.no_pref&&!a.b_init1&&a.autoSizeAll(),a.b_init1=!0,a.ensure_visible(),!a.show_buttons&&a.first_ref?(setTimeout(function(){a.autoSizeAll()},300),a.first_ref=!1):null==localStorage.getItem(a.grid_key+"_COLS")&&setTimeout(function(){a.autoSizeAll()},300)}e||(a.errorMsg=t.msg+" ["+t.result_msg+"]")},function(t){a.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"})}},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!0,enableServerSideFilter:!0,enableColResize:!0,rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return a.getContextMenuItems()},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.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.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"),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 s=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(ot,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[s.gf.getDescri(),s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var s=this;this.win_opt=this.m_dialog.open(ct,{disableClose:!0}),this.win_opt.componentInstance.title="Salva Configurazione",this.win_opt.componentInstance.label="Nome",this.win_opt.afterClosed().subscribe(function(t){if(t&&null!=t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[t,s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},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 i=this,t={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(t){if(t.value){if(null==t.value)return"";if("function"==typeof t.value.getMonth)return i.uti_s.pad(t.value.getDate(),2)+"/"+i.uti_s.pad(t.value.getMonth()+1,2)+"/"+t.value.getFullYear();if(24==t.value.length&&-1<t.value.indexOf(":00.000Z")){var e=new Date(t.value);return i.uti_s.pad(e.getDate(),2)+"/"+i.uti_s.pad(e.getMonth()+1,2)+"/"+e.getFullYear()+" "+i.uti_s.pad(e.getHours(),2)+":"+i.uti_s.pad(e.getMinutes(),2)}return t.value}}};this.gridOptions.api.exportDataAsExcel(t)},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.ngOnInit=function(){null==this.end_point&&(this.end_point=this.m_appService.API_ENDPOINT+this.m_appService.GRID_ENDPOINT),this.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(ut,{disableClose:!0}).afterClosed().subscribe(function(t){})},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var e=[];this.columnDefs.forEach(function(t){e.push(t.field)}),this.gridOptions.columnApi.autoSizeColumns(e,null),this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var e=0;return this.gridOptions.api.forEachNode(function(t){t.isSelected()&&e++}),e},t.prototype.getquerySelected=function(e,t){var i="";return"String"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i=i+"'"+t.data[e]+"'")}),"Number"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i+=t.data[e])}),i},t.prototype.selectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!0)})},t.prototype.deselectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!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"))try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),null)}catch(i){console.log(i)}try{this.gridOptions.api.setSortModel(null)}catch(i){console.log(i)}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(i){console.log(i)}try{this.gridOptions.api.setFilterModel(null)}catch(i){console.log(i)}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(i){console.log(i)}},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.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.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++)2<t[i].length?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(){this.no_pref||(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.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},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(){i.ckk()},10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.decorators=[{type:l.Component,args:[{selector:"FHGrid",template:'\r\n<div fxLayout="column" fxLayoutAlign="stretch" fxFlexFill>\r\n\r\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center" style="min-height: 55px" [hidden]="!show_buttons">\r\n \r\n <div>\r\n\t\t \t\t<h5>{{num_r}} {{label_elementi}}</h5>\r\n </div>\r\n \r\n\r\n\t\t\t\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">\r\n <div matTooltip="REMOVE FILTER" matTooltipPosition="above" *ngIf="show_pulisci_filtri" >\r\n \t\t\t<button mat-raised-button (click)="pulisci_filtri()" color="warn">\r\n\t\t\t\t<mat-icon>filter_none</mat-icon> \r\n\t\t\t</button>\r\n </div>\r\n <div fxHide fxShow.gt-sm matTooltip="AUTO SIZE" matTooltipPosition="above">\r\n \t\t\t<button mat-raised-button (click)="autoSizeAll()" color="accent"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>photo_size_select_small</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-raised-button (click)="fitSizeAll()" color="accent"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>aspect_ratio</mat-icon>\r\n\t\t\t</button>\r\n </div>\r\n\r\n <FHComboBox fxHide fxShow.gt-sm [hidden]=\'!show_buttons\' (selchange)="ch_config()" (fillend)="fe_cfg()" #gf init_fill="false"></FHComboBox>\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"\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\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">\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\' (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 \t<div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\r\n <button mat-raised-button (click)="help_window()" color="accent" *ngIf="show_buttons && show_help" >\r\n\t\t\t<mat-icon>help</mat-icon>\r\n </button></div>\r\n\r\n <div fxLayout="row" fxLayoutAlign="end center" fxFlex>\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\r\n\r\n</div>\r\n\r\n <div fxLayout="row" fxLayoutAlign="stretch" fxFlex="95">\r\n<ag-grid-angular ref-agGrid style="width:100%;height:100%;"\r\n\t\t\t\t\t\t\t\t (cellDoubleClicked)="onColumnEvent($event)" (cellClicked)="onCellClicked($event)"\r\n\t\t\t\t\t\t\t\t [headerHeight]="header_h" [groupHeaderHeight]="header_h"\r\n\t\t\t\t\t\t\t\t class="ag-theme-balham" [singleClickEdit]="true" [gridOptions]="gridOptions" [columnDefs]="columnDefs"\r\n\t\t\t\t\t\t\t\t [rowData]="rowData" enableColResize enableServerSideSorting enableServerSideFilter enableColResize\r\n\t\t\t\t\t\t\t\t (afterFilterChanged)="onAfterFilterChanged()" (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)" (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)" (cellValueChanged)="okr($event)"\r\n\t\t\t\t\t\t\t\t (sortChanged)="onAfterSortChanged()" [paginationPageSize]="num_per_pag" (gridReady)="onReady($event)">\r\n</ag-grid-angular>\r\n</div>\r\n</div>\r\n',styles:["\n\n\t"]}]}],t.ctorParameters=function(){return[{type:pt},{type:e.ToastrService},{type:tt},{type:j},{type:c.SlimLoadingBarService},{type:i.MatDialog},{type:X}]},t.propDecorators={end_point:[{type:l.Input}],tbl_name:[{type:l.Input}],columnDefs:[{type:l.Input}],count_tbl_name:[{type:l.Input}],num_per_pag:[{type:l.Input}],grid_key:[{type:l.Input}],sort_field:[{type:l.Input}],fields:[{type:l.Input}],filters:[{type:l.Input}],abilita_export:[{type:l.Input}],enabled_pag:[{type:l.Input}],show_help:[{type:l.Input}],show_num_elem:[{type:l.Input}],system_dest:[{type:l.Input}],header_h:[{type:l.Input}],init_fill:[{type:l.Input}],no_pref:[{type:l.Input}],label_elementi:[{type:l.Input}],trova_label:[{type:l.Input}],mantieni_impostazioni:[{type:l.Input}],show_buttons:[{type:l.Input}],fill_end:[{type:l.Output}],cell_edited:[{type:l.Output}],clicked:[{type:l.Output}],dclicked:[{type:l.Output}],columndclicked:[{type:l.Output}],cell_clicked:[{type:l.Output}],toolbar_type:[{type:l.Input}],toolbar_wkfapp:[{type:l.Input}],toolbar_custom_commands:[{type:l.Input}],command:[{type:l.Output}],gf:[{type:l.ViewChild,args:["gf"]}],toggle_mantieni:[{type:l.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:l.Output}],off_set:[{type:l.Input}],onResize:[{type:l.HostListener,args:["window:resize",["event"]]}],testom:[{type:l.ViewChild,args:["testom",{read:l.ViewContainerRef}]}],myModalNormal:[{type:l.ViewChild,args:["myModalNormal",{read:l.ViewContainerRef}]}]},t}(),_t=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,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 l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,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{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 i=this;if(-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var t=new q;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.sql+"]"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.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.update_dis(),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,void(null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore))},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",this.update_dis(),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.update_dis(),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,void(null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore))},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(){},t.prototype.ngOnInit=function(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.decorators=[{type:l.Component,args:[{selector:"FHComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden">\n <mat-select placeholder="{{label}}" #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">\n <input type="text" #el1 matInput [disabled]="true" placeholder="{{label}}" [(ngModel)]="dis_value">\n </mat-form-field>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:tt},{type:V}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],hidden:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],required:[{type:l.Input}],sel_label:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}],valDef:[{type:l.Input}],db_type:[{type:l.Input}]},t}(),mt=function(n){function t(t,e){var i=n.call(this)||this;return i._dataService=t,i._dataService_odbc=e,i.init_fill=!0,i.sql="",i.label="",i.types=new Array,i.values=new Array,i.hidden=!1,i.db_type="1",i.enabled=!0,i.required=!1,i.only_from_list=!1,i.fillend=new l.EventEmitter,i.selchange=new l.EventEmitter,i.change=new l.EventEmitter,i.initend=new l.EventEmitter,i.focusout=new l.EventEmitter,i.descri_val="",i.sItem="",i.searchItemsFiltered=new Array,i.is_loaded=!1,i.selval=null,i.errorMsg="",i.valDef="",i.table_hidden=!0,i}return H(t,n),t.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},t.prototype.fo_search=function(){this.focusout.emit()},t.prototype.onChange=function(t){if(this.searchItemsFiltered=new Array,null!=this.sItem)if(""!=this.sItem){this.searchItemsFiltered=new Array;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]),20!=this.searchItemsFiltered.length);i++);}else for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},t.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.sItem=t.option.value,this.ch(t),console.log("selectedSearchItem ",this.sItem)},t.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()},t.prototype.myListFormatter=function(t){return t.descrizione_valore},t.prototype.resetValue=function(){var t=this;setTimeout(function(){t.selval="",t.valDef="",t.sItem="",t.selval=null},100)},t.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},t.prototype.fillCombo=function(){var i=this;this.myData=new Array,this.searchItemsFiltered=new Array;var t=new q;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.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)},t.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)}},t.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)},t.prototype.setValue=function(t){this.setByValue(t)},t.prototype.getDescri=function(){return this.getData("descrizione_valore")},t.prototype.getData=function(t){for(var e in console.log(this.sItem),this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.sItem},t.prototype.getObj=function(){for(var t in console.log("this.selval ",this.selval," this.myData ",this.myData),this.myData)if(this.myData[t].descrizione_valore==this.selval||this.myData[t].valore==this.selval)return console.log("x ",t," obj ",this.myData[t]),this.myData[t];return null},t.prototype.getValue=function(){return this.getData("valore")},t.prototype.getModelValue=function(){var t=this.getData("valore");return null!==t||this.only_from_list?t:this.sItem},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.table_hidden=!1,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngOnInit=function(){if(this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.emitChanged=function(){var e=this.getModelValue();this.changed.forEach(function(t){return t(e)})},Object.defineProperty(t.prototype,"value",{get:function(){return this.getModelValue()},set:function(e){this.getModelValue()!==e&&(this.setValue(e),this.changed.forEach(function(t){return t(e)}))},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.setValue(t)},t.decorators=[{type:l.Component,args:[{selector:"FHAutoComplete",template:'\n <mat-form-field class="field_style" [hidden]="!enabled || hidden">\n <input matInput\n class="field_style" [disabled]="!enabled || hidden" [matAutocomplete]="auto" [placeholder]="label" [required]="required"\n (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search()"\n (change)="ch($event)" #searchp>\n </mat-form-field>\n <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)">\n <mat-option *ngFor="let objx of searchItemsFiltered" class="search_home" [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">\n <input type="text" #el1 matInput [disabled]="true" placeholder="{{label}}" [(ngModel)]="sItem"\n >\n </mat-form-field>\n ',providers:[{provide:s.NG_VALUE_ACCESSOR,useExisting:t,multi:!0}],styles:["\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 "]}]}],t.ctorParameters=function(){return[{type:tt},{type:V}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],label:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],hidden:[{type:l.Input}],db_type:[{type:l.Input}],enabled:[{type:l.Input}],required:[{type:l.Input}],only_from_list:[{type:l.Input}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],change:[{type:l.Output}],initend:[{type:l.Output}],focusout:[{type:l.Output}],searchp:[{type:l.ViewChild,args:["searchp"]}],auto:[{type:l.ViewChild,args:["auto"]}]},t}(et),gt=function(n){function t(t,e){var i=n.call(this)||this;return i.dateAdapter=t,i.uti_s=e,i.label="",i.required=!1,i.show_buttons=!1,i.enabled=!0,i.min_date=null,i.max_date=null,i.change=new l.EventEmitter,i.v_view=i.uti_s.date2String(new Date),i.date_sel=null,i.v_date_sel="",i.dateAdapter.setLocale("it"),i}return H(t,n),t.prototype.dt_chg=function(t){var e=t.split("/");3==e.length&&parseInt(e[2])<3e3&&0<parseInt(e[0])&&parseInt(e[0])<=31&&1<parseInt(e[1])&&parseInt(e[1])<=12&&(this.date_sel=new Date(parseInt(e[2]),parseInt(e[1])-1,parseInt(e[0])))},t.prototype.chxx=function(t){},t.prototype.ch=function(t){this.change.emit(this.getValue()),this.emitChanged()},t.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},t.prototype.dt_ch=function(){var t=this;setTimeout(function(){console.log(t.date_sel),t.ch()},50)},t.prototype.add_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,this.date_sel.getMonth(),this.date_sel.getDate()),this.v_view=this.uti_s.date2String(this.date_sel),this.ch()},t.prototype.ini_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.date_sel),this.ch()},t.prototype.fin_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.date_sel),this.ch()},t.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){this.dateAdapter.setLocale("it"),null!=t?(t instanceof Date||null!=t.value&&(t=new Date(t.value)),this.date_sel=new Date(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.date_sel)):this.date_sel=null},t.decorators=[{type:l.Component,args:[{selector:"FHDatePicker",providers:[{provide:i.MAT_DATE_LOCALE,useValue:"it-IT"},{provide:s.NG_VALUE_ACCESSOR,useExisting:t,multi:!0}],template:'\n <div [hidden]="!show_buttons||!enabled">\n <button mat-raised-button (click)="add_year()">+1 Anno</button>\n <button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n <button mat-raised-button (click)="fin_year()">Fine Anno</button>\n </div>\n\n <mat-form-field (click)="chxx($event)">\n <input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event.target.value)"\n (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" placeholder="{{label}}">\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 "]}]}],t.ctorParameters=function(){return[{type:i.DateAdapter},{type:X}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],pickerId:[{type:l.ViewChild,args:["pickerId"]}]},t}(et),ft=function(){function t(t,e,i){this._dataService=t,this.dialogRef=e,this.toastr=i,this.width="100%",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){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){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}},t.prototype.ngOnInit=function(){var e=this;if(this.all_users){var t=new q;t.sql="SELECT_ALL_USERS",t.types=[],t.values=[],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.users_list=t.result_data,e.filtra())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})}else{if(null!=this.user_sel&&0<this.user_sel.length)return;if(this.users_list_sel=new Array,null!=this.users_list)for(var i=0;i<this.users_list.length;i++)this.users_list_sel.push(this.users_list[i])}},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&this.users_list.splice(t,1),this.single_sel&&(this.user_sel=new Array),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);-1<t&&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.decorators=[{type:l.Component,args:[{selector:"FHPickUsers",template:'\n <mat-dialog-content>\n <br><br>\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="40">\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 colspan="2">UTENTI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr><td colspan="2"> <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()"\n style=\'padding:8px;margin:15px auto;width:100%;\' placeholder=\'Ricerca...\'>\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-raised-button (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-raised-button (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:auto;">\n <table style="width: 100%" class="fh_table">\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-raised-button color="primary" (click)="dialogRef.close(this.user_sel)">Ok</button> \n <button mat-raised-button (click)="dialogRef.close(false)">Annulla</button>\n </div>\n </mat-dialog-actions>\n\n ',styles:["\n \n "]}]}],t.ctorParameters=function(){return[{type:tt},{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={users_list:[{type:l.Input}],users_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],all_users:[{type:l.Input}],user_sel:[{type:l.Input}]},t}(),vt=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.ngAfterViewInit=function(){},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()},t.decorators=[{type:l.Component,args:[{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.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}]},t}(),yt=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=W((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?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=W((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=0<parseInt(s,10)&&0<e?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",t},t.decorators=[{type:l.Pipe,args:[{name:"FHCurrency"}]}],t.ctorParameters=function(){return[]},t}(),bt=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngOnInit=function(){this.el.value=this.currencyPipe.transform(this.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.decorators=[{type:l.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],t.ctorParameters=function(){return[{type:l.ElementRef},{type:yt}]},t.propDecorators={onFocus:[{type:l.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:l.HostListener,args:["blur",["$event.target.value"]]}]},t}(),It=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.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\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-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t}(),St=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()},500)},t.prototype.agInit=function(t){return null==(this.params=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()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood">\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field>\n <textarea matInput style="min-height:180px;min-width:400px" [(ngModel)]="text" #appdt\n placeholder="{{label}}"></textarea>\n </mat-form-field>\n </div>\n\n <button mat-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-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.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),Et=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.ngAfterViewInit=function(){},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new q;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.decorators=[{type:l.Component,args:[{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-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-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.ctorParameters=function(){return[{type:tt}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),Ot=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.label="",this.enabled=!0,this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.upd_f=function(t,e){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 e=this;if(this.init_fill){var t=new q;t.sql=this.sql,t.types=this.types,t.values=this.values,this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data,e.resetValue(),e.setByValue(e.valDef),"-1"==e.getValue()&&"-1"!=e.valDef&&e.setByDescri(e.valDef),e.fillend.emit())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+e.sql+"]"})}},t.prototype.setByDescri=function(t){if(null!=(this.valDef=t)&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(","),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(null!=(this.valDef=t)&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(","),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++)console.log(this.myData[e].checked);for(e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=","),t+=this.myData[e].descrizione_valore);return console.log("getDescri: "+t),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+=","),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(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){this.selchange.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHList",template:'\n\n\n <div style="width:100%;">\n \n <table class="fh_table">\n <thead>\n <tr>\n <th></th>\n <th>\n {{label}}\n\n </th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let u of myData" class="selector">\n <td style="width:20px">\n <mat-slide-toggle (change)="upd_f(u,$event)" [disabled]="!enabled"\n [(ngModel)]="u.checked"></mat-slide-toggle>\n </td>\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n \n </div>\n\n\n ',styles:["\n\n\n "]}]}],t.ctorParameters=function(){return[{type:tt}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}]},t}(),Ct=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.width=""}return t.prototype.set_selection=function(t,e){this.label=t;for(var i=0;i<e.length;i++)this.cmb_sel.add_option(e[i])},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObj()):this.toastr.error("Selezionare un valore")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title [style.width]="width">\n SELEZIONA {{label | uppercase}}\n </h2>\n <mat-dialog-content style="width:100%">\n <div [style.width]="width">\n <FHComboBox #cmb_sel [init_fill]="false"></FHComboBox>\n </div>\n </mat-dialog-content>\n\n\n <mat-dialog-actions [style.width]="width" style="text-align:center">\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),wt=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t.decorators=[{type:l.Pipe,args:[{name:"replaceLineBreaks"}]}],t}(),Rt=function(){function t(){this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new l.EventEmitter,this.myDatePickerOptions={width:"150px",dateFormat:"dd/mm/yyyy",dayLabels:{su:"Dom",mo:"Lun",tu:"Mar",we:"Mer",th:"Gio",fr:"Ven",sa:"Sab"},monthLabels:{1:"Gen",2:"Feb",3:"Mar",4:"Apr",5:"Mag",6:"Giu",7:"Lug",8:"Ago",9:"Set",10:"Ott",11:"Nov",12:"Dic"}},this.date_sel=null}return t.prototype.setFocus=function(){console.log("set focus"),this.dtc.setFocusToInputBox()},t.prototype.dt_ch=function(){var t=this;console.log("dt_ch!!"),console.log(this.dtc),setTimeout(function(){console.log(t.date_sel),t.change.emit()},50)},t.prototype.add_year=function(){this.date_sel={date:{year:this.date_sel.date.year+1,month:this.date_sel.date.month,day:this.date_sel.date.day}},this.change.emit()},t.prototype.ini_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:1,day:1}},this.change.emit()},t.prototype.fin_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:12,day:31}},this.change.emit()},t.prototype.getValue=function(){return null==this.date_sel?null:new Date(this.date_sel.date.year,this.date_sel.date.month-1,this.date_sel.date.day)},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.getCopyOfOptions=function(){return JSON.parse(JSON.stringify(this.myDatePickerOptions))},t.prototype.setLimits=function(){var t=this.getCopyOfOptions();null!=this.min_date&&(this.min_date.setDate(this.min_date.getDate()-1),t.disableUntil={year:this.min_date.getFullYear(),month:this.min_date.getMonth()+1,day:this.min_date.getDate()}),null!=this.max_date&&(this.max_date.setDate(this.max_date.getDate()+1),t.disableSince={year:this.max_date.getFullYear(),month:this.max_date.getMonth()+1,day:this.max_date.getDate()}),this.myDatePickerOptions=t},t.prototype.setToday=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:(new Date).getMonth()+1,day:(new Date).getDate()}}},t.prototype.setValue=function(t){this.date_sel=null!=t?{date:{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}}:null},t.decorators=[{type:l.Component,args:[{selector:"DtPicker",template:'\n <div [hidden]="!show_buttons||!enabled">\n <button mat-raised-button (click)="add_year()">+1 Anno</button>\n <button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n <button mat-raised-button (click)="fin_year()">Fine Anno</button>\n </div>\n\n <div class="lb_small_grigia">{{label}}</div>\n <my-date-picker (dateChanged)="dt_ch()" #appdt [options]="myDatePickerOptions" *ngIf="enabled"\n [(ngModel)]="date_sel"></my-date-picker>\n\n <div *ngIf="!enabled" class="label_dis">\n {{this.date_sel?.date.day}}/{{this.date_sel?.date.month}}/{{this.date_sel?.date.year}}\n </div>\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 "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],dtc:[{type:l.ViewChild,args:["appdt"]}]},t}(),At=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.ngOnInit=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 n=this;this.value_sel=new Array;for(var i=0;i<e.length;i++){var o=new Object;o.descrizione_valore=e[i],this.value_sel.push(o)}var s=new q;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){n.value_list_all=t.result_data;for(var e=0;e<n.value_sel.length;e++)for(var i=n.value_list_all.length-1;0<=i;i--)if(n.value_list_all[i].descrizione_valore==n.value_sel[e].descrizione_valore){n.value_list_all.splice(i,1);break}n.filtra()}},function(t){n.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list_all.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&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);-1<t&&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.decorators=[{type:l.Component,args:[{selector:"FHPickList",template:'\n \n <div fxLayout="column" fxLayoutGap="15px" fxFlex style="width:600px;height:400px">\n <div fxLayout="row" style="width:550">\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-raised-button (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-raised-button (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-raised-button color="primary" (click)="ok()">Ok</button> \n <button mat-raised-button (click)="dialogRef.close()">Annulla</button>\n </div>\n </div>\n\n ',styles:["\n \n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:tt},{type:e.ToastrService}]},t.propDecorators={value_list:[{type:l.Input}],value_list_all:[{type:l.Input}],value_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],limit_size:[{type:l.Input}],value_sel:[{type:l.Input}]},t}(),Nt=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.ngOnInit=function(){},t.prototype.show=function(){},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.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}}" type="number" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button\n mat-raised-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t}(),Dt=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){h.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t.decorators=[{type:l.Injectable}],t.ctorParameters=function(){return[{type:Object,decorators:[{type:l.Inject,args:[l.PLATFORM_ID]}]}]},t}(),kt=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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"FHMdReader",template:'\n <markdown [src]="path_md">\n\n </markdown>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Dt}]},t.propDecorators={path_md:[{type:l.Input}]},t}(),Tt=function(){function t(t){var i=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 e=new Date(t.value);return e.getFullYear()<1980?" ------ ":i.uti.pad(e.getDate(),2)+"/"+i.uti.pad(e.getMonth()+1,2)+"/"+e.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{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 "]}]}],t.ctorParameters=function(){return[{type:X}]},t.propDecorators={g_height:[{type:l.Input}],datagrid:[{type:l.ViewChild,args:["dtm"]}]},t}(),Mt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3}return t.prototype.ngOnInit=function(){},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.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="width:600px">\n <mat-form-field>\n <textarea matInput placeholder="{{label}}" type="text" [(ngModel)]="valore" style="width:600px" rows="15"\n required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button\n mat-raised-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Pt={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return xt}),multi:!0},xt=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.label_width="",this.change=new l.EventEmitter,this.innerValue=0,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.getStyle_mw=function(){return this.label_width},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout(function(){t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),t.onChange(t.value)},50)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal),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(i){console.log(i)}},t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=W((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHCurrencyField",providers:[Pt],template:'\n <mat-form-field [hidden]="!enabled || hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput\n [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event)"\n (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"\n pattern="[0-9]+">\n </mat-form-field>\n <mat-form-field [hidden]="enabled || hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el1 matInput [disabled]="true"\n placeholder="{{label}}" [(ngModel)]="formattedAmount"\n >\n </mat-form-field>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],label_width:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),Lt={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Ft}),multi:!0},Ft=function(){function t(){this.enabled=!0,this.value="",this.label="",this.height="360",this.change=new l.EventEmitter,this.focus=new l.EventEmitter,this.blur=new l.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.ngOnInit=function(){this.config={height:this.height},this.enabled?this.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"}]:(this.config.allowedContent=!0,this.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},t.decorators=[{type:l.Component,args:[{selector:"FHRichText",providers:[Lt],template:'\n <b *ngIf="label!=\'\'">{{label}}</b>\n <ckeditor #ced\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 "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={enabled:[{type:l.Input}],value:[{type:l.Input}],label:[{type:l.Input}],height:[{type:l.Input}],change:[{type:l.Output}],focus:[{type:l.Output}],blur:[{type:l.Output}],ced:[{type:l.ViewChild,args:["ced"]}]},t}(),jt=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.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_output",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="min-width:500px">\n\n <div [innerHTML]="valore" style="width:100%">\n </div>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Ut={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Vt}),multi:!0},Vt=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.change=new l.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.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=W((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHNumericField",providers:[Ut],template:'\n <mat-form-field [hidden]="hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput\n [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="chg()"\n (focus)="removeCurrencyPipeFormat($event)"\n pattern="[0-9]+">\n </mat-form-field>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:X}]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),zt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.sql=""}return t.prototype.doFill=function(){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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\n {{label | uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <FHList #cmb_sel [label]="" style="width:100%;min-height:90px" init_fill="false"></FHList>\n\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),Kt={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Yt}),multi:!0},Yt=function(){function t(t,e){this.dataservice=t,this.dialog=e,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.multi=!1,this.change=new l.EventEmitter,this.select=new l.EventEmitter,this.userName="",this.selectedUser=[],this.all_user=null,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this.required&&(this.label=this.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.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.setByUsername=function(t){var i=this;if(t){for(var e=t.split(","),n="",o=0;o<e.length;o++)""!=n&&(n+=","),n=n+"'"+e[o]+"'";var s={sql:"SELECT_USERS_INFOS_BY_USERNAME_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe(function(t){var e=t.result_data;null!=e?(i.selectedUser=e,i.writeValue("noop"),i.select.emit(i.selectedUser),console.log(i.selectedUser),i.userName=i.getUsersNc(),console.log(i.userName)):i.clear()})}},t.prototype.load_all_users=function(){var e=this;this.dataservice.doQuery({sql:"SELECT_ALL_USERS",types:[],values:[],names:[]}).subscribe(function(t){e.all_user=t.result_data,null==e.all_user&&(e.all_user=[]),e.open_pick()})},t.prototype.open_pick=function(){var e=this;if(null!=this.all_user){if(this.enabled){var t=this.dialog.open(ft,{disableClose:!0,width:"700px",height:"550px"});t.componentInstance.user_sel=this.selectedUser,t.componentInstance.users_list=this.all_user,t.componentInstance.single_sel=!this.multi,t.componentInstance.filtra(),t.afterClosed().subscribe(function(t){null!=t&&(null!=t&&(e.selectedUser=t,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)),e.change.emit(e.selectedUser),e.select.emit(e.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.decorators=[{type:l.Component,args:[{selector:"FHUserField",providers:[Kt],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field style="clickable-field" (click)="open_pick()">\n\n <input matInput\n [hidden]="hidden"\n [placeholder]="label"\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">\n <input type="text" #el1 matInput [disabled]="true" placeholder="{{label}}" [(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 "]}]}],t.ctorParameters=function(){return[{type:tt},{type:i.MatDialog}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],multi:[{type:l.Input}],change:[{type:l.Output}],select:[{type:l.Output}],userName:[{type:l.Input}]},t}(),qt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i}return t.prototype.salva_esci=function(){this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="salva_esci()">SALVA ED ESCI</button> \n <button mat-raised-button color="warn" (click)="esci_senza_salv()">ESCI SENZA SALVATAGGIO</button>\n\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t}(),Gt=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,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);this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)")}return t.prototype.ok=function(){if(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.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n </div>\n <br *ngIf="!comm_notrequired"><br *ngIf="!comm_notrequired"><br *ngIf="!comm_notrequired">\n <mat-form-field [hidden]="comm_notrequired">\n <textarea matInput placeholder="Commento {{nota_commento}}" [(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-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Bt=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,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,this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("abort")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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">\n <div *ngIf="mobile" style="font-size:10px">Assegnata a: {{utenti}}</div>\n <h3 *ngIf="!mobile">Assegnata a: {{utenti}}</h3>\n <br>\n <mat-form-field [hidden]="comm_notrequired">\n <textarea matInput placeholder="Commento {{nota_commento}}" [(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-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t}(),Ht=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.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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-select placeholder="Seleziona Ambito:" #cmb [(ngModel)]="selval" style="width:100%">\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\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">OK</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Wt=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.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar style="max-width:500px">SELEZIONA PROSSIMO STEP:\n\n </mat-toolbar>\n <mat-dialog-content style="max-width:500px"><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Prossimo Step:" #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\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">{{OK_BUTTON}}</button>\n <button mat-raised-button (click)="this.dialogRef.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 '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Xt=function(){function t(t,e,i,n,o){var s=this;this.dialogRef=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.enabled=!0,this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.title="ALLEGATI",this.b_ini=!1,this.single=!0,this.descrizione="",this.label="Descrizione Allegato",this.username="",this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT}),this.username=localStorage.getItem(this.app_s.COMPANY_KEY+"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","ALLEGATO INSERITO",{timeOut:1e3,progressBar:!0}),s.ref_allegato(),s.change.emit())}}return t.prototype.download_all=function(t){null!=t.App&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename),null!=t.APP&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.APP+"/"+t.K+"/"+t.Filename)},t.prototype["delete"]=function(i){var n=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(ot).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="DELETE_ALLEGATO",e.types=["int","string"],e.values=[i.id,localStorage.getItem(n.app_s.COMPANY_KEY+"user")],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.arr_g=t.result_data,n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))})}})},t.prototype.ch=function(){var i=this;this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",""),e.append("local_path",i.app_s.LOCAL_PATH)};var t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],this.uploader.setOptions(t),this.uploader.uploadAll()},t.prototype.ref_allegato=function(){var o=this;if(null!=this.App&&""!=this.App){var t=new q;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){o.arr_g=t.result_data;for(var e="default",i=0;i<o.arr_g.length;i++){var n=o.arr_g[i].Filename.split(".");-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(n[n.length-1].toLocaleUpperCase())&&(e=n[n.length-1].toLocaleLowerCase()),o.arr_g[i].icon=e+".svg"}}})}},t.prototype.ngOnInit=function(){this.App=this.app_s.getState().wkf_doc_info.uiid_app,this.K=this.app_s.getState().wkf_doc_info.uiid_doc,this.single=!1,this.init(this.App,this.K),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ref_allegato()},t.decorators=[{type:l.Component,args:[{selector:"wkf_win_upload",template:'\n <mat-toolbar color="primary">{{title}}\n <div style="width:100%;text-align: right;">\n </div>\n\n </mat-toolbar>\n <div mat-dialog-content style="min-width:800px">\n <br>\n <div *ngIf="enabled">\n\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}}">\n\n\n <input type="file" ng2FileSelect [uploader]="uploader" multiple (change)="ch()"/>\n \x3c!--<button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>--\x3e\n </div>\n <br>\n\n\n <br>\n\n <table style="width: 100%;" class="fh_table">\n <thead>\n <tr>\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:50%">Descrizione</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;index as i" [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>{{app.descrizione}}</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>save_alt</mat-icon>\n </button>\n </td>\n\n <td style="text-align:center"><a mat-icon-button *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n </tr>\n </table>\n\n\n </div>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'Option 1\')">CHIUDI</button>\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n \n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:tt},{type:e.ToastrService},{type:i.MatDialog},{type:j}]},t.propDecorators={enabled:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}],single:[{type:l.Input}]},t}(),Qt=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.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.user_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.annulla=function(){this.dialogRef.close(null)},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px">\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-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Jt=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,i){var n=this;void 0===i&&(i=!0);var e=!1;if(null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")?localStorage.removeItem(this.app_s.COMPANY_KEY+"dev_mode"):"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")?localStorage.removeItem(this.app_s.COMPANY_KEY+"dev_mode"):null!=localStorage.getItem(this.app_s.COMPANY_KEY+"dev_mode")&&"1"==localStorage.getItem(this.app_s.COMPANY_KEY+"dev_mode")&&(e=!0),e){var o="";o=null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")?localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori"):localStorage.getItem(this.app_s.COMPANY_KEY+"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]=o),"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]=o)}this.headers=new p.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 s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),Zt=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=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return 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 n=this,t=new q;t.sql="SELECT_COMMENTI_DOCUMENTO",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){n.commenti_list=t.result_data;for(var i=0;i<n.commenti_list.length;i++)n.commenti_list[i].v_commento="<b>"+n.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";e=!0}e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},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 n=this,t=new q;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(Qt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},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 q;c.sql="send_wkf_mail",c.values=[t,e,i,n,o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe(function(t){})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new q).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.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(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new q).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngOnInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.decorators=[{type:l.Component,args:[{template:'\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">\n\n <mat-form-field *ngIf="b_edit" >\n <textarea matInput placeholder="Commento"[(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n \n\n <div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="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 </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.v_data_creazione}}</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 </section>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n\n\n ',styles:["\n\n \n\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:i.MatDialog},{type:j},{type:e.ToastrService},{type:tt},{type:Jt}]},t}(),$t=function(){function t(t,e){this.dialogRef=t,this.m_appService=e,this.hide_richiedente=!1,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}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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>\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">\n\n <td>Uiid App:</td>\n <td><b>{{uiid_app}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>Uiid Doc:</td>\n <td><b>{{uiid_doc}}</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-raised-button color="accent" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j}]},t}(),te=function(){function t(t,e,i,n,o,s,r){this.appService=t,this.dialogRef=e,this.m_dialogRef=i,this.m_appService=n,this.toastr=o,this._dataService=s,this.m_wkf=r,this.ossv=!1,this.b_flussook=!0,this.logs=new Array,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.not_int=!0,this.subject="",this.link="",this.codice_doc=""}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.load_graph=function(){var n=this;console.log("load_graph");var t=new q;t.sql="SELECT_WKF_BY_ID",t.types=["string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){if(console.log("data.result_data[0].diagramma_flusso ",t.result_data[0].diagramma_flusso),0<t.result_data.length&&null!=t.result_data[0].diagramma_flusso&&""!=t.result_data[0].diagramma_flusso){for(var e=!1,i=0;i<n.logs.length;i++)-1==n.logs[i].id_comment&&(null!=n.logs[i].liv_ini&&(t.result_data[0].diagramma_flusso=t.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+n.logs[i].liv_ini+'"').join('bpmnElement="STEP_'+n.logs[i].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),e||null!=n.logs[i].liv_fin&&(t.result_data[0].diagramma_flusso=t.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+n.logs[i].liv_fin+'"').join('bpmnElement="STEP_'+n.logs[i].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),console.log("this.logs[i].liv_fin ",n.logs[i].liv_fin),e=!0));return n.b_flussook=!0,void n.modeler.importXML(t.result_data[0].diagramma_flusso,function(t){(console.log("err",t),t)?console.log("something went wrong:",t):(console.log("success!"),n.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0}))})}n.b_flussook=!1}})},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.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.ngOnInit=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 i=this,t=new q;t.sql="SELECT_WORKFLOW_LOG",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.logs=t.result_data,i.ossv||(i.modeler=new w({container:"#canvas",width:"97%",height:i.appService.getState().body_height2,readonly:!0})),i.load_graph(),e=i.ossv=!0),e||i.toastr.error("ERRORE",t.msg)},function(t){i.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},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 n=this,t=new q;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(Qt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){var c=this;void 0===p&&(p=!0),void 0===u&&(u="");var d=new q;d.sql="send_wkf_mail",d.values=[t,e,i,n,o,s,r,a,l,u],this.m_wkf.doQuery(d).subscribe(function(t){},function(t){c.toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new q).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.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(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new q).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.decorators=[{type:l.Component,args:[{template:'\n <mat-tab-group #zz style="min-width:950px"\n [style.height]="m_appService.getState().body_height">\n <mat-tab label="DIAGRAMMA" style="width:100%;height:100%" [hidden]="!b_flussook">\n\n <div style="width:100%;height:100%" id="canvas"></div>\n\n\n </mat-tab>\n\n <mat-tab label="LOGS">\n <mat-toolbar color="primary">{{title}}\n <div style="width:100%;text-align: right;">\n\n </div>\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>\n <section class="bs" *ngIf="b_edit">\n <br>\n <mat-form-field *ngIf="b_edit">\n <textarea matInput placeholder="Commento" [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <br><br>\n </section>\n <table *ngIf="!b_edit" class="fh_table">\n\n <thead>\n <tr>\n <th width="15%">Data</th>\n <th width="15%">Utente</th>\n <th>Operazione</th>\n\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.v_data_creazione}}</td>\n <td>{{app.nc}}</td>\n <td>{{app.operazione}}</td>\n\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 </div>\n <br>\n </mat-tab>\n </mat-tab-group>\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n ',styles:["\n\n\n "]}]}],t.ctorParameters=function(){return[{type:j},{type:i.MatDialogRef},{type:i.MatDialog},{type:j},{type:e.ToastrService},{type:tt},{type:Jt}]},t.propDecorators={zz:[{type:l.ViewChild,args:["zz"]}]},t}(),ee=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.edit=function(t){var e=this,i=new q;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.decorators=[{type:l.Component,args:[{template:'\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-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={datagrid:[{type:l.ViewChild,args:["dtm"]}]},t}(),ie=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.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n\n </mat-toolbar>\n <mat-dialog-content><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Step:" #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\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()">{{OK_BUTTON}}</button> \n <button mat-raised-button color="warn" (click)="this.dialogRef.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 '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),ne=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.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.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n </div>\n <br><br><br>\n\n <mat-form-field>\n <textarea matInput placeholder="Commento {{nota_commento}}" [hidden]="commento_hidden" [(ngModel)]="nota"\n rows="6"></textarea>\n\n </mat-form-field>\n\n \n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),oe=function(){function t(t,e,i,n){this.dataService=t,this.fileService=e,this.toastr=i,this.utility=n}return t.prototype.runCommands=function(t,a){for(var l=this,p=this.utility.newGuid(),e="",i=0;i<t.length;i++)""!=e&&(e+=";;;"),e=e+(t[i].id||p)+";;;"+t[i].op+";;;"+(t[i].v1||" ")+";;;"+(t[i].v2||" ")+";;;"+t[i].ord;var n=new q;return n.sql="INSERT_CMD_STAMPA_MULTI",n.types=["string","string","string","string","int"],n.values=[e],this.dataService.doQuery(n).pipe(r.flatMap(function(t){if(null!=t&&"OK"==t.result_msg){var e=new G;return e.command="wg_create",e.p1=p,l.fileService.doQuery(e).pipe(r.flatMap(function(t){if(null!=t&&"OK"==t.result_msg)return new o.Observable(function(i){var n=l,o=!1,s=(setTimeout(function(){o=!0},a.timeout||18e4),0);!function r(){var t=new G;t.command="wg_getlog";t.p1=p;t.p2=s.toString();n.fileService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data[0];s+=e.chunk.length,i.next(e),e.done?i.complete():o?(console.log("Timeout"),i.error("Timeout"),n.toastr.error("Timeout")):setTimeout(function(){r()},a.checkInterval||3e3)}else console.error(t),i.error(t),i.complete()})}()})}))}}))},t.prototype.send_file_to_user=function(t,e,i){var n=this;void 0===i&&(i="errore nella creazione del file");var o=new G;o.p1=t,o.command="check_file",this.fileService.doQuery(o).subscribe(function(t){null!=t&&("N"!=t.msg?window.open(e):null!=i&&""!=i&&n.toastr.error(i))})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:tt},{type:z},{type:e.ToastrService},{type:X}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(tt),l.inject(z),l.inject(e.ToastrService),l.inject(X))},token:t,providedIn:"root"}),t}(),se=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),re=function(){function t(t,e,i,n){this.ngf=t,this.cache=e,this.uti=i,this.app=n,this.ngf.name="Fluxhub_"+this.app.COMPANY_KEY,this.ngf.driver=[R.Driver.INDEXED_DB,R.Driver.LOCAL_STORAGE]}return t.prototype.read=function(t,e){var i=this;return void 0===e&&(e=!0),this.ngf.getItem(t).then(function(t){return null==t?null:e?JSON.parse(i.uti.decrypt_v2(t)):JSON.parse(""+t)})},t.prototype.list_keys=function(){this.ngf.keys().then(function(t){})},t.prototype.write=function(t,e,i){void 0===i&&(i=!0),i?this.ngf.setItem(t,this.uti.encrypt_v2(JSON.stringify(e))).then(function(t){}):this.ngf.setItem(t,JSON.stringify(e))},t.prototype["delete"]=function(t){this.ngf.removeItem(t)},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:R.NgForage},{type:R.NgForageCache},{type:X},{type:j}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(R.NgForage),l.inject(R.NgForageCache),l.inject(X),l.inject(j))},token:t,providedIn:"root"}),t}(),ae=function(){function t(t,e,i,n,o,s,r){var a=this;this.localstore=t,this.uti_s=e,this._toast=i,this._dataService=n,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=r,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=!0,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 l.EventEmitter,this.cell_edited=new l.EventEmitter,this.clicked=new l.EventEmitter,this.dclicked=new l.EventEmitter,this.columndclicked=new l.EventEmitter,this.cell_clicked=new l.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new l.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,enableColResize:!0,enableSorting:!0,rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return a.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"inMemory",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 s=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(ot,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[s.gf.getDescri(),s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo()),s.errorMsg=t.msg},function(t){s.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})}})},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var s=this;this.win_opt=this.m_dialog.open(ct,{disableClose:!0}),this.win_opt.componentInstance.title="Salva Configurazione",this.win_opt.componentInstance.label="Nome",this.win_opt.afterClosed().subscribe(function(t){if(t&&null!=t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[t,s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),e=!0,s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo()),e||(s.errorMsg=t.msg)},function(t){s.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")),console.log(e),e},t.prototype.onBtExport=function(){var i=this,t={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(t){if(t.value){if(null==t.value)return"";if("function"==typeof t.value.getMonth)return i.uti_s.pad(t.value.getDate(),2)+"/"+i.uti_s.pad(t.value.getMonth()+1,2)+"/"+t.value.getFullYear();if(24==t.value.length&&-1<t.value.indexOf(":00.000Z")){var e=new Date(t.value);return i.uti_s.pad(e.getDate(),2)+"/"+i.uti_s.pad(e.getMonth()+1,2)+"/"+e.getFullYear()+" "+i.uti_s.pad(e.getHours(),2)+":"+i.uti_s.pad(e.getMinutes(),2)}return t.value}}};this.gridOptions.api.exportDataAsExcel(t)},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.ngOnInit=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(ut,{disableClose:!0}).afterClosed().subscribe(function(t){})},t.prototype.autoSizeAll=function(){var e=[];this.columnDefs.forEach(function(t){e.push(t.field)}),this.gridOptions.columnApi.autoSizeColumns(e,null),this.save_cfg()},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var e=0;return this.gridOptions.api.forEachNode(function(t){t.isSelected()&&e++}),e},t.prototype.getquerySelected=function(e,t){var i="";return"String"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i=i+"'"+t.data[e]+"'")}),"Number"==t&&(console.log("CERCO SEL"),this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i+=t.data[e])})),i},t.prototype.selectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!0)})},t.prototype.deselectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!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"))try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),null)}catch(i){console.log(i)}try{this.gridOptions.api.setSortModel(null)}catch(i){console.log(i)}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(i){console.log(i)}try{this.gridOptions.api.setFilterModel(null)}catch(i){console.log(i)}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(i){console.log(i)}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.setRows=function(){var e=this;this.localstore.read(this.m_appService.COMPANY_KEY+this.tbl_name).then(function(t){e.rowData=t})},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){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.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++)2<t[i].length?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.decorators=[{type:l.Component,args:[{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 \n </td>\n <td style="vertical-align:\'bottom\'"> <mat-form-field>\n <input matInput [placeholder]="trova_label" (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera"\n style="width:200px">\n </mat-form-field> \n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button\n *ngIf="show_pulisci_filtri" mat-raised-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>clear</mat-icon> REMOVE FILTER\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> \n <button mat-raised-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon> AUTO SIZE\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> \n <button mat-raised-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon> 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" enableColResize enableColResize\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 "]}]}],t.ctorParameters=function(){return[{type:re},{type:X},{type:e.ToastrService},{type:tt},{type:j},{type:c.SlimLoadingBarService},{type:i.MatDialog}]},t.propDecorators={tbl_name:[{type:l.Input}],columnDefs:[{type:l.Input}],count_tbl_name:[{type:l.Input}],num_per_pag:[{type:l.Input}],grid_key:[{type:l.Input}],sort_field:[{type:l.Input}],fields:[{type:l.Input}],filters:[{type:l.Input}],auto_height:[{type:l.Input}],abilita_export:[{type:l.Input}],enabled_pag:[{type:l.Input}],show_help:[{type:l.Input}],show_num_elem:[{type:l.Input}],system_dest:[{type:l.Input}],header_h:[{type:l.Input}],g_width:[{type:l.Input}],g_height:[{type:l.Input}],init_fill:[{type:l.Input}],label_elementi:[{type:l.Input}],trova_label:[{type:l.Input}],mantieni_impostazioni:[{type:l.Input}],show_buttons:[{type:l.Input}],fill_end:[{type:l.Output}],cell_edited:[{type:l.Output}],clicked:[{type:l.Output}],dclicked:[{type:l.Output}],columndclicked:[{type:l.Output}],cell_clicked:[{type:l.Output}],gf:[{type:l.ViewChild,args:["gf"]}],toggle_mantieni:[{type:l.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:l.Output}],off_set:[{type:l.Input}],testom:[{type:l.ViewChild,args:["testom",{read:l.ViewContainerRef}]}],myModalNormal:[{type:l.ViewChild,args:["myModalNormal",{read:l.ViewContainerRef}]}]},t}(),le=function(){function t(){this.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.command=new l.EventEmitter}return 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.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"})},t.decorators=[{type:l.Component,args:[{selector:"FHGridToolBar",template:'\n <div *ngIf="type==\'WKF\'" fxLayoutGap="3px" fxLayout="row" fxFlex="100" fxLayoutAlign="end center" style="background-color: #CC0000">\n \n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px">\n\n <button mat-raised-button (click)="insert_doc()" *ngIf="toolbar_wkfapp?.is_Ins" color="primary"><mat-icon>note_add</mat-icon> {{\'INSERISCI\' | translate}}</button> \n\n <button mat-raised-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)="test_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'TEST UTENTE\' | translate}} </button>\n\n </mat-menu>\n <button mat-raised-button (click)="annulla_imp()" *ngIf="toolbar_wkfapp?.imp!=\'\'"> {{toolbar_wkfapp?.imp}} </button>\n <div *ngFor="let app of custom_commands" ><button mat-raised-button [color]="app.color" (click)="exec_command(app.command)">{{app.label | translate}}</button>\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">\n\n <button mat-raised-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon> {{\'INSERISCI\' | translate}}\n </button>\n\n <button mat-raised-button (click)="del_doc()" color="warn">\n <mat-icon>delete</mat-icon> {{\'ELIMINA\' | translate}}\n </button>\n <div *ngFor="let app of custom_commands" ><button mat-raised-button [color]="app.color" (click)="exec_command(app.command)">{{app.label | translate}}</button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'CUSTOM\'" fxLayoutGap="3px" fxLayout="row">\n \n <div *ngFor="let app of custom_commands" ><button mat-raised-button [color]="app.color" (click)="exec_command(app.command)">{{app.label | translate}}</button>\n </div>\n </div>\n \n ',styles:["\n\n "]}]}],t.propDecorators={type:[{type:l.Input}],toolbar_wkfapp:[{type:l.Input}],custom_commands:[{type:l.Input}],command:[{type:l.Output}]},t}(),pe=function(){function t(t){this.m_appService=t,this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1}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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"wkf_header_bar",template:'\n\n<div fxLayout="row" fxLayoutGap="3px" >\n<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="3px" *ngIf="!m_appService.getState().pageFullscreen || edit_button || respingi_button">\n\n<button mat-raised-button (click)="back()" *ngIf="!m_appService.getState().pageFullscreen">Indietro</button>\n <button mat-raised-button (click)="evt_salv()" *ngIf="edit_button && !m_appService.getState().pageFullscreen" color="primary" >Salva</button>\n <button mat-raised-button (click)="procedi()" *ngIf="edit_button" color="accent" >Procedi</button>\n <button mat-raised-button (click)="respingi()" *ngIf="respingi_button" color="warn" >Respingi</button>\n\x3c!-- <button mat-raised-button (click)="doEnd(900)" color="warn" >test</button> \n--\x3e\n\n</div>\n \n<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="3px" >\n\n\n<button mat-raised-button (click)="open_info()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>info_outline</mat-icon> Info Doc</button>\n<button mat-raised-button (click)="open_commenti()"> <mat-icon>insert_comment</mat-icon> Commenti {{dt_agg?.comm_c}}</button>\n<button mat-raised-button (click)="open_upload()"> <mat-icon>attach_file</mat-icon> Allegati {{dt_agg?.all_c}}</button>\n<button mat-raised-button (click)="open_wkf()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>transfer_within_a_station</mat-icon> Workflow</button>\n\n</div>\n</div>\n\n '}]}],t.ctorParameters=function(){return[{type:j}]},t.propDecorators={dt_agg:[{type:l.Input}],edit_button:[{type:l.Input}],respingi_button:[{type:l.Input}]},t}(),ue=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.dragula=i,this.change=new l.EventEmitter,this.items=[],this.edit_obj=null,this.radio_values=""}return t.prototype.add_component=function(t){console.log(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(i){var n=this,t=this._dialog.open(ot,{disableClose:!0});t.componentInstance.title="Confirm",t.componentInstance.msg="Remove Element?",t.afterClosed().subscribe(function(t){if(t)for(var e=0;e<n.items.length;e++)n.items[e].uiid==i&&(n.items.splice(e,1),n.change.emit(),n.edit_obj=null)})},t.prototype.ngOnInit=function(){var e=this;try{this.dragula.createGroup("bag-items",{revertOnSpill:!0})}catch(t){console.log(t)}this.dragula.drag.call(function(t){console.log("Dragging the "+t[1].innerText+"!"),e.change.emit(),e.edit_obj=null}),this.dragula.drop.call(function(t){console.log("Dropped the "+t[1].innerText+"!"),e.change.emit(),e.edit_obj=null})},t.decorators=[{type:l.Component,args:[{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> <span>Text Field</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(2)">\n <mat-icon>filter_1</mat-icon> <span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon> <span>Text Area</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(4)">\n <mat-icon>check_box</mat-icon> <span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon> <span>Radio</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon> <span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon> <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" >\n <input matInput [placeholder]="item.label" [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" >\n <input matInput [placeholder]="item.label" [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" >\n <mat-select [required]="item.required" [placeholder]="item.label" [(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> \n </div>\n\n </div></div>\n <div fxLayout="column" style="width:70px" fxLayoutGap="10px">\n <button mat-raised-button (click)="edit_item(item.uiid)" color="primary"><mat-icon>edit</mat-icon></button>\n <button mat-raised-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>\n <input matInput placeholder="Label" 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\'">\n <input matInput placeholder="Decimal Places" type="text" [(ngModel)]="edit_obj.decimali">\n </mat-form-field>\n <mat-form-field *ngIf="edit_obj.type==\'text_field\'">\n <input matInput placeholder="Default Value" 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\'">\n <input matInput placeholder="Values" 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\'">\n <input matInput placeholder="Default Value" type="text" [(ngModel)]="edit_obj.default_value" >\n </mat-form-field>\n\n <button mat-raised-button (click)="ok_panel()" color="primary">OK</button>\n </div></mat-card-content>\n </mat-card>\n </div>\n </div>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:X},{type:i.MatDialog},{type:A.DragulaService}]},t.propDecorators={change:[{type:l.Output}],bottoml:[{type:l.ViewChild,args:["bottoml"]}]},t}(),ce=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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{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" >\n <input matInput [placeholder]="item.label" [required]="item.required" [disabled]="!enabled" 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" >\n <input matInput [placeholder]="item.label" [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> \n <label *ngIf="item.required">{{item.label}}: *</label> \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> </mat-radio-button>\n </mat-radio-group>\n </section>\n\n <mat-form-field *ngIf="item.type==\'select\'">\n <mat-select [required]="item.required" [placeholder]="item.label" [(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> \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 "]}]}],t.ctorParameters=function(){return[{type:X},{type:i.MatDialog},{type:e.ToastrService}]},t.propDecorators={items:[{type:l.Input}],enabled:[{type:l.Input}],bottoml:[{type:l.ViewChild,args:["bottoml"]}]},t}(),de=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[j,R.NgForage,tt,K,z,V,Jt,pt,st,X,re,oe]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:l.NgModule,args:[{imports:[L.TranslateModule,x.CdkTableModule,i.MatAutocompleteModule,i.MatDialogModule,i.MatButtonModule,i.MatButtonToggleModule,i.MatCardModule,i.MatCheckboxModule,i.MatChipsModule,i.MatDatepickerModule,i.MatDialogModule,i.MatExpansionModule,i.MatFormFieldModule,i.MatGridListModule,i.MatIconModule,i.MatInputModule,i.MatListModule,i.MatMenuModule,i.MatProgressBarModule,i.MatProgressSpinnerModule,i.MatRadioModule,i.MatSelectModule,i.MatSlideToggleModule,i.MatSliderModule,i.MatSidenavModule,i.MatSnackBarModule,i.MatStepperModule,i.MatTabsModule,i.MatToolbarModule,i.MatTooltipModule,i.MatPaginatorModule,i.MatSortModule,i.MatTableModule,i.MatNativeDateModule,M.MyDatePickerModule,u.FileUploadModule,T.AgGridModule.withComponents([Q,J]),h.CommonModule,A.DragulaModule,s.FormsModule,P.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),N.FlexLayoutModule,D.MarkdownModule,k.CKEditorModule],exports:[Z,$,it,nt,rt,lt,ht,_t,ot,mt,gt,J,Q,ft,vt,bt,yt,It,ut,St,Et,Ot,Ct,wt,Rt,ct,At,Nt,kt,Tt,Mt,xt,Ft,jt,Vt,pe,zt,at,Yt,G,se,dt,U,q,Y,ae,qt,ue,ce],declarations:[le,Z,$,it,nt,rt,lt,pe,ht,_t,ot,mt,gt,J,Q,ft,vt,bt,yt,It,ut,St,Et,Ot,Ct,wt,Rt,ct,At,Nt,kt,Tt,Mt,xt,Ft,jt,Vt,zt,at,Yt,G,se,dt,U,q,Y,qt,Gt,Bt,Ht,Wt,Xt,Zt,$t,te,ee,ie,ne,Qt,ae,ue,ce],providers:[Dt,A.DragulaService],entryComponents:[qt,Gt,Bt,Ht,Wt,Xt,Zt,$t,te,ee,ie,ne,Qt,At,ot,Z,ft,vt,It,ut,St,Et,Ct,ct,Nt,Mt,jt,zt,at]}]}],t}(),he=function(){function t(t,e,i,n,o,s,r,a){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.appService=s,this.slimLoadingBarService=r,this.app_s=a,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 n=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!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")&&"1"==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||new Promise(function(i){if(null!=n.arr_accessi){for(var t=0;t<n.arr_accessi.length;t++)if("M"==n.arr_accessi[t].type&&"["+n.arr_accessi[t].url.split("/")[0]+"]"=="["+n.routingDestination.split("/")[0]+"]")return console.log(typeof o.of(!0)),console.log("OBS3 "+!0),void i(!0);return n.toast.error("ACCESS DENIED"),n.slimLoadingBarService.complete(),void i(!1)}var e=new q;e.sql="SELECT_APPS_USER_ALL",n.appService.getState().app_enabled=new Array,e.types=["string"],e.values=[localStorage.getItem(n.app_s.COMPANY_KEY+"user")],n.querys.doQuery(e).subscribe(function(t){n.arr_accessi=t.result_data;for(var e=0;e<n.arr_accessi.length;e++)if(console.log("["+n.arr_accessi[e].url.split("/")[0]+"]","-----","["+n.routingDestination.split("/")[0]+"]"),"M"==n.arr_accessi[e].type&&"["+n.arr_accessi[e].url.split("/")[0]+"]"=="["+n.routingDestination.split("/")[0]+"]")return console.log(typeof o.of(!0)),console.log("OBS3 "+!0),void i(!0);n.toast.error("ACCESS DENIED"),i(!1),n.slimLoadingBarService.complete()})})):(this.toast.error("ACCESS DENIED"),this.slimLoadingBarService.complete(),!1)))},t.decorators=[{type:l.Injectable}],t.ctorParameters=function(){return[{type:F.Http},{type:st},{type:a.Router},{type:e.ToastrService},{type:tt},{type:j},{type:c.SlimLoadingBarService},{type:j}]},t}(),_e=function fe(t,e,i){this.year=t,this.month=e,this.day=i},me=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_fservice=n,this.m_router=o,this._toastr=s,this.dialog=r,this.m_wkf=a,this.b_editing=!1,this.is_Supervisor=!1,this.is_Admin=!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.imp="",this.sort_field="",e.checkCredentials()&&(this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),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(),"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 i=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(ot,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="UPDATE_WKF_ANNULATO",e.types=["string","string","int"],e.values=[i.id_applicativo,i.get_grid().sRow.uiid,-1],i.m_dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}})):this._toastr.error("Selezionare il documento da annullare")},t.prototype.recupera_richiesta=function(){var e=this,t=this.dialog.open(ee,{disableClose:!0});t.componentInstance.init_w(this.id_applicativo),t.afterClosed().subscribe(function(t){"ok"==t&&e.get_grid().doFill("")})},t.prototype.riassegna_richiesta=function(){var s=this;if(null!=this.get_grid().sRow){var t=new q;t.sql="SELECT_WLIVELLIV2ADM",t.types=["string","string","string"],t.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato],this.m_dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){s.livs_adm=t.result_data;for(var e=new Array,i="",n=0;n<s.livs_adm.length;n++)-1==i.indexOf(String(s.livs_adm[n].livello))&&(i=i+String(s.livs_adm[n].livello)+"|",e.push(s.livs_adm[n]));var o=s.dialog.open(ie,{disableClose:!0});o.componentInstance.setStepCombo(e),o.componentInstance.title="Riassegnazione documento: "+s.get_grid().sRow.codice+" - "+s.get_grid().sRow.oggetto,o.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(console.log(t),s.os_r=t.lvl_sel,s.riassegna_richiesta_step1())})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var e=this,t=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&&t.push(this.livs_adm[i]);var n=this.dialog.open(ne,{disableClose:!0});for(i=0;i<t.length;i++)t[i].nc=t[i].nc.split(" ()").join(""),null!=t[i].idp&&null==t[i].username&&(t[i].username=t[i].idp);console.log(t),n.componentInstance.arrAutori=t,n.componentInstance.title="Riassegnazione documento: "+this.get_grid().sRow.codice+" - "+this.get_grid().sRow.oggetto,n.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(e.wax=t.arrsel,e.nota_wax=t.nota,e.riassegna_richiesta_step2())})},t.prototype.riassegna_richiesta_step2=function(){var e=this,t="";null!=this.get_grid().sRow.lettori&&(t=this.get_grid().sRow.lettori);var i,n="",o="",s="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);for(var a="",l=0;l<this.wax.length;l++)""!=a&&(a+=","),a+=this.wax[l].idp,-1==t.indexOf(this.wax[l].idp)&&(""!=t&&(t+=","),t+=this.wax[l].idp),-1==o.indexOf(this.wax[l].nc)&&(""!=o&&(o+=","),o+=this.wax[l].nc),""!=s&&(s+=","),s+=this.wax[l].nc,null!=r&&-1==r.indexOf(this.wax[l].idp)&&(""!=r&&(r+=","),r+=this.wax[l].idp),""!=n&&(n+=","),n+=this.wax[l].idp;(this.sendEMail_ex(this.user_idp,a,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),(i=new q).sql="INSERT_COMMENTO_RIASS",i.types=["string","string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+s,this.user_idp,this.os_r.descri_livello],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new q).sql="UPDATE_RIASS_DOCUMENTO",i.types=["string","string","string","string","string","string","string","string","string"],i.values=[this.os_r.livello,this.os_r.descri_livello,t,n,this.os_r.descri_livello,o,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&e.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new q).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),0<this.wax.length)&&((i=new q).sql="UPDATE_RIASSEGNA_TODO",i.types=["string","string"],i.values=[this.wax[0].idp,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).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 q;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l,p],this.m_wkf.doQuery(u).subscribe(function(t){})},t.prototype.annulla_imp=function(){localStorage.setItem(this.app_s.COMPANY_KEY+"user_name",localStorage.getItem(this.app_s.COMPANY_KEY+"user_name_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user",localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_surname",localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_email",localStorage.getItem(this.app_s.COMPANY_KEY+"user_email_ori")),this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email_ori"),this.imp="",this.get_grid().doFill("")},t.prototype.test_utente=function(){var i=this,n=new q;n.sql="SELECT_UTENTI_WORKFLOW",n.types=["string"],n.values=[this.id_applicativo],this.m_dataService.doQuery(n).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=i.dialog.open(ne,{disableClose:!0});e.componentInstance.arrAutori=t.result_data,e.componentInstance.title="Impersona Utente",e.componentInstance.commento_hidden=!0,e.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&((n=new q).sql="SELECT_USER_INFO_WKF",n.types=["string"],n.values=[t.arrsel[0].username],i.m_dataService.doQuery(n).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(localStorage.setItem(i.app_s.COMPANY_KEY+"user_name_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_name")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_surname")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_email")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_name",t.result_data[0].nome),localStorage.setItem(i.app_s.COMPANY_KEY+"user",t.result_data[0].username),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname",t.result_data[0].cognome),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email",t.result_data[0].email),i.user_idp=t.result_data[0].username,i.user_nome=t.result_data[0].nome,i.user_cognome=t.result_data[0].cognome,i.user_email=t.result_data[0].email,i.imp="ANNULLA IMP: "+t.result_data[0].cognome+" "+t.result_data[0].nome,i.get_grid().doFill(""))}))})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj=new Object,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_Admin=this.is_Admin,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_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,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.app_s.getState().topnavTitle=this.att_panelcat},t.prototype.init_Panel=function(t,n){var o=this;if(null==this.app_s.getState().wkf_obj||this.app_s.getState().wkf_obj.codice_app!=t){null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")&&(this.imp="ANNULLA IMP: "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname")+" "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"));var e=new q;e.sql="SELECT_WKF_APP_INFO",e.types=["string"];var s=!(e.values=[t]);this.m_dataService.doQuery(e).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;s=!0,o.m_id_Doc=n,o.id_applicativo=e[0].id_gruppo,o.app_root=e[0].modulo_swf,o.codice_app=e[0].codice_documento,o.att_panelcat=e[0].descrizione_breve,o.documento_pubblico=e[0].pubblico,o.titolo_email="["+e[0].descrizione_breve+"]",o.tbl_name=e[0].vista_sql,o.grid_key=o.app_s.COMPANY_KEY+e[0].vista_sql,o.user_idp=localStorage.getItem(o.app_s.COMPANY_KEY+"user"),o.user_nome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_name"),o.user_cognome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_surname"),o.user_email=localStorage.getItem(o.app_s.COMPANY_KEY+"user_email"),o.app_s.getState().topnavTitle=o.att_panelcat;var i=new q;i.sql="SELECT_UTENTE_WKF_ADMIN",i.types=["string","string"],i.values=[o.id_applicativo,localStorage.getItem(o.app_s.COMPANY_KEY+"user")],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;o.is_Supervisor=!1,o.is_Admin=!1,0<e.length&&(o.is_Supervisor=!0,"1"==e[0].tipo&&(o.is_Admin=!0)),s=!0;var i=new q;i.sql="SELECT_WLIVELLIV2",i.types=["string","string"],i.values=[o.id_applicativo,""],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(o.ok_conf_s(t.result_data),s=!0),s||console.error(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),s=!0}s||console.error(t.msg)},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this.restore_state_wkf()},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if((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){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}(),ge=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=new Object,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.oper="",this.all_c="",this.comm_c="",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,this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email")}return t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info=new Object,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},t.prototype.evt_salv=function(){this.btnprocedi=!1,this.salva()},t.prototype.salva=function(){if(""==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(console.log(this.livs[e]),this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||(console.log(this.c_canale+" "+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(console.log("this.oper "+this.clevel.livelli_jump),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 o=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(Wt,{disableClose:!0}).afterClosed().subscribe(function(t){if(null!=t){var e=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){e=o.wkf_rule(e);var i=!1;for(n=0;n<o.livs.length;n++)o.user_idp.toUpperCase()==o.livs[n].idp.toUpperCase()&&0==o.livs[n].notifica&&o.livs[n].livello==e&&(o.nlevel=o.livs[n],e=o.livs[n].livello,i=!0);if(!i)for(n=0;n<o.livs.length;n++)if(o.livs[n].livello==e&&0==o.livs[n].notifica){o.nlevel=o.livs[n],e=o.livs[n].livello;break}o.doJump()}else{for(var n=e=0;n<o.livs.length;n++)o.livs[n].livello<900&&o.livs[n].livello>e&&0==o.livs[n].notifica&&(o.clevel=o.livs[n],e=o.livs[n].livello);o.calcolanextandjump()}else o.calcolanextandjump()}else o.edit_b(!0)})},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello,console.log("liv: "+t);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);var n=!1;for(i=0;i<this.livs.length;i++)0!=this.livs[i].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo||this.livs[i].livello==t&&(this.nlevel=this.livs[i],t=this.livs[i].livello,n=!0);if(!n)for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==t&&0==this.livs[i].notifica){this.nlevel=this.livs[i],t=this.livs[i].livello;break}var o=t,s=this.nlevel;if(2==this.nlevel.salto_iniziale){for(i=0;i<this.livs.length;i++)s.idp.toUpperCase()==this.livs[i].idp.toUpperCase()&&0==this.livs[i].notifica&&s.gruppo_parallelo==this.livs[i].gruppo_parallelo&&this.livs[i].livello>o&&0!=o&&(this.nlevel=this.livs[i],t=this.livs[i].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var e=this;this.user_idp.toUpperCase();if(null!=this.nlevel){var i=new Array;if(""==this.clevel.gruppo_parallelo)for(var t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&i.push(this.livs[t]);else{var n=!1;for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&""!=this.livs[t].gruppo_parallelo&&(n=!0);console.log("canale: "+this.clevel.gruppo_parallelo);for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&(console.log("canale: "+this.clevel.gruppo_parallelo+" "+this.livs[t].gruppo_parallelo),this.clevel.gruppo_parallelo!=this.livs[t].gruppo_parallelo&&n||(i.push(this.livs[t]),this.nlevel=this.livs[t]))}if(0!=i.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title="Avanzamento";for(var o="",s=0;s<i.length;s++)""!=o&&(o+=";"),o+=i[s].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,1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.m_dialog.open(Bt,{disableClose:!0}).afterClosed().subscribe(function(t){if("abort"==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=i,e.nota=t,e.OKCOM()})}else{this.app_s.getState().wkf_doc_info.title="Assegnazione",1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.app_s.getState().wkf_doc_info.arrAutori=i.sort(function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}),this.m_dialog.open(Gt,{disableClose:!0}).afterClosed().subscribe(function(t){if(""==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=t.arrsel,e.nota=t.nota,e.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(qt,{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.msodulo_swf]))}):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.OKCOM=function(){var i=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),this.m_danotificare="";for(var t,e=this.m_autori="",n=0;n<this.arrUsersSelected.length;n++)""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[n].idp,-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[n].idp),console.log("m_lettori2 "+this.m_lettori),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[n].idp,e+=this.arrUsersSelected[n].nc),console.log("m_lettori3 "+this.m_lettori);""!=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&&this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp);for(n=0;n<this.livs.length;n++)this.livs[n].livello==this.m_liv&&1==this.livs[n].notifica&&(1==this.livs[n].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[n].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[n].idp));if(900<=this.nlevel.livello){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello),(r=new q).sql="UPDATE_DATA_CHIUSURA",r.values=[this.id_applicativo,this.id_documento],r.types=["string","string"],this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})}t=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):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);for(var o=new Array,s=0;s<t.length;s++)o.push("string");if(this.m_crea_att=1,900<=this.m_liv&&(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),(r=new q).sql="doWKF",r.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+" è passata 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(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(r=new q).sql="UPDATE_WKF_DOCUMENTOV3_NS",r.values=t,r.types=o,this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),""!=this.m_danotificare){var r,a="";if(""!=this.nota&&(a="<br>Commento: "+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),(r=new q).sql="exec_app_workflow",r.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp],this.m_wkf.doQuery(r).subscribe(function(t){},function(t){}),1==this.nlevel.approvazione_email);else{console.log("this.nlevel.ical ",this.nlevel.ical);var l=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):l={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()+a,organizer:this.user_nome+" "+this.user_cognome+" <"+this.user_email+">"}),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:"+a,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,l);else if(console.log("--------------this.clevel.oggetto_text----------------------"),console.log(this.nlevel.oggetto_email),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(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,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,l);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(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,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,l);else{var p=this.nlevel.oggetto_email;for(var u in console.log("OGGETTO CUSTOM!"),this.m_obj)null!=this.m_obj[u]&&(console.log(u+" "+Object.prototype.toString.call(this.m_obj[u])),p="[object Date]"===Object.prototype.toString.call(this.m_obj[u])?p.split("%"+u+"%").join(this.uti_s.date2String(this.m_obj[u])):-1==(""+this.m_obj[u]).indexOf("T00:00:00")?p.split("%"+u+"%").join(this.m_obj[u]):p.split("%"+u+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[u],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,p,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,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,l)}else this.goto_edit_doc()}}},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){var c=this;void 0===p&&(p=!0),void 0===u&&(u="");var d=new q;d.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),d.values=[t,e,i,n,o,s,r,a,l,u],this.m_wkf.doQuery(d).subscribe(function(t){c.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=this,s=new q;s.sql="INSERT_WKF_COMMENTO",s.values=[t,e,i,n],s.types=["string","string","string","string"],this.m_dataService.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=this,s=new q;s.sql="insert_wkf_variabile",s.values=[t,e,i,n],this.m_wkf.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.respingi=function(){if(this.oper="respingi",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.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(){var e=this,t=this.m_dialog.open(te,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_commenti=function(){var e=this,t=this.m_dialog.open(Zt,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_upload=function(){var e=this;this.m_dialog.open(Xt,{disableClose:!0}).afterClosed().subscribe(function(t){e.r_count()})},t.prototype.create_new_document=function(){var i=this,t=new q;t.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),t.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.save_agg(),e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.save_agg=function(){var i=this;this.edit_b(!1);var t=this.getfieldvalues(),e=new q;e.sql="insert_aggiuntivi",e.types=["string","string"],e.values=[this.app_info.tabella_dati,this.id_documento],e.names=["tabella","id_documento"];for(var n=0;n<t.length;n++)e.types.push(t[n].types),e.names.push(t[n].names),null!=t[n].values?("int"==t[n].types&&e.values.push(""+t[n].values),"string"==t[n].types&&e.values.push(""+t[n].values),"date"==t[n].types&&e.values.push(this.uti_s.sql_date(t[n].values)),"datetime"==t[n].types&&e.values.push(this.uti_s.sql_date_time(t[n].values)),"decimal"==t[n].types&&e.values.push(""+t[n].values)):e.values.push("dbnull"),console.log(e.names[n+2]+" "+e.values[n+2]);this.m_wkf.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_insert_aggiuntivi(),e=!0),e||(i.errorMsg=t.msg)},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(!0),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 n=this;console.log("load_document()");var t=new q;t.sql="SELECT_WKF_DOCUMENT_NOREP",t.types=["string","string","string"],t.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;0<i.length?n.ok_load_document(i[0]):n.alert("DOCUMENTO NON TROVATO",1),e=!0}e||(n.errorMsg=t.msg)},function(t){})},t.prototype.ok_load_document=function(t){var i=this;console.log(t),this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1),this.save_to_app_state();var e=new q;e.sql="SELECT_LIVELLI_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_livelli_doc(t.result_data),e=!0),e||(i.errorMsg=t.msg)},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 r=this,t=new q;t.sql="SELECT_WKF_ALLEGATI_COUNTER",t.types=["string","string"],t.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){for(var i=t.result_data,n=0,o=0,s=0;s<i.length;s++)0<i[s].n&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));r.reset_counters_int(o,n),e=!0}e||(r.errorMsg=t.msg)},function(t){})},t.prototype.reset_counters_int=function(t,e){this.all_c="",this.comm_c="",0<t&&(this.comm_c=" ("+t+")"),0<e&&(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,console.log("-------------"+this.forza_canale+"--------------------"),console.log(this.livs[e]));console.log("forza canale exec"+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 e=this,t=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<t||0==t)&&(this.clevel=this.livs[i],t=this.livs[i].livello);var n=new Array;for(i=0;i<this.livs.length;i++)this.livs[i].livello==t&&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 e<t?1:t<e?-1:0}),this.m_dialog.open(Ht,{disableClose:!0}).afterClosed().subscribe(function(t){e.c_canale=t,e.create_new_document()}))},t.prototype.open_info=function(){var t=this.m_dialog.open($t,{disableClose:!0});t.componentInstance.hide_richiedente=this.hide_richiedente,t.afterClosed().subscribe(function(t){})},t.prototype.setForceJump=function(t,e){var i,n=this;void 0===e&&(e="");for(var o,s="",r="",a="",l=0;l<this.livs.length;l++)t!=this.livs[l].livello||0!=this.livs[l].notifica||""!=e&&!this.livs[l].canale||(""!=s&&(s+=","),s+=this.livs[l].idp,""!=r&&(r+=","),r+=this.livs[l].nc,a=this.livs[l].descri_livello);if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;o=this.app_info.documento_pubblico?new Array(s,"",t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento):new Array(s,this.m_obj.partecipanti+","+s,t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento);var p=new Array;for(l=0;l<o.length;l++)p.push("string");return(i=new q).sql="doWKF",i.values=[this.app_info.descrizione_breve,this.m_obj.codice,""+t,""+t,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"La scheda numero: "+this.m_obj.codice+" è passata allo stato: "+a,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,a,"",this.id_applicativo,this.id_documento,"1","0",""+this.m_obj.stato,""+t],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.m_obj.stato+"_PLAYER",this.user_idp),this.m_wkf.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(i=new q).sql="UPDATE_WKF_DOCUMENTOV3_NS",i.values=o,i.types=p,this.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),this.goto_edit_doc(),"OK"},t.prototype.insert_doc=function(){var i=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.enabled_form(),this.app_s.getState().topnavTitle=this.app_info.descrizione_breve+" - Nuova Richiesta",this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_counters_int(0,0);var t=new q;t.sql="SELECT_WLIVELLIV2",t.types=["string","string"],t.values=[this.id_applicativo,""],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(console.log(t.result_data),i.ok_livw2(t.result_data),e=!0),e||(i.errorMsg=t.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);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(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(){console.log("return_edit");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}-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.app_s.getState().topnavTitle=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.ngOnInit=function(){var n=this;this.m_route.params.subscribe(function(t){n.onResize();var e=t.op;if(n.id_applicativo=t.idapp,n.id_documento=t.id_doc,n.b_edit="new"!=e,n.b_edit||-1<n.id_applicativo.indexOf("_")&&(n.simple_mode=!0,n.id_applicativo=n.id_applicativo.split("_").join("")),n.b_valid=!!n.id_applicativo,n.b_valid){var i=new q;i.sql="SELECT_WKF_APP_INFO_BYUID",i.types=["string"],i.values=[n.id_applicativo],n.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(0<t.result_data.length?(n.setta_info_app(t.result_data[0]),n.b_edit?n.edit_doc():n.insert_doc()):n.alert("CODICE APPLICAZIONE NON VALIDO",2),e=!0),e||n.alert(t.msg,2)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",2)})}else n.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)})},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},t.propDecorators={onResize:[{type:l.HostListener,args:["window:resize",["event"]]}]},t}();t.FluxhubLibModule=de,t.AppService=j,t.AppMakerService=K,t.FileService=z,t.OdbcService=V,t.QueryService=tt,t.WkfService=Jt,t.GridService=pt,t.AuthenticationService=st,t.UtilityService=X,t.OfficeAutomatorService=oe,t.LocalDBService=re,t.FHGuard=he,t.FHGridJSONComponent=ae,t.FHGridComponent=ht,t.ApprovaGridComponent=vt,t.CurrencyComponent=nt,t.DateComponent=J,t.DtPick=Rt,t.dt=_e,t.NumericEditorComponent=Q,t.ComboBoxEditor=Et,t.TextAreaEditor=St,t.FHAutoCompleteComponent=mt,t.FHComboboxComponent=_t,t.FHConfirmComponent=ot,t.FHCurrencyFieldComponent=xt,t.FHCurrencyFormatterDirective=bt,t.FHCurrencyPipe=yt,t.FHDatePickerComponent=gt,t.FHListComponent=Ot,t.FHLogPanelComponent=Tt,t.FHMdReader=kt,t.FHNumericFieldComponent=Vt,t.ReplaceLineBreaks=wt,t.FHRichText=Ft,t.FHTimePickerComponent=it,t.FHUploadComponent=lt,t.FHUploadPanelComponent=rt,t.FHUserFieldComponent=Yt,t.FHUserPickerComponent=ft,t.FHPickListComponent=At,t.WinAskNumberComponent=Nt,t.WinAskTextComponent=ct,t.WinAskTextBigComponent=Mt,t.FHWinComboSelect=Ct,t.FHListPick=zt,t.win_mappa=It,t.WinOutputComponent=jt,t.win_time_slider=Z,t.WinWait=at,t.win_salva_annulla=qt,t.QGParam=dt,t.QGResult=U,t.QParam=q,t.QResult=Y,t.FSInput=G,t.FSResult=se,t.FormBuilderComponent=ue,t.FormExecuterComponent=ce,t.wkf_header_bar=pe,t.wkfapp=me,t.dati_aggiuntivi=ge,t.ɵa=Pt,t.ɵi=le,t.ɵg=ut,t.ɵb=Ut,t.ɵc=Lt,t.ɵd=Kt,t.ɵe=$,t.ɵf=et,t.ɵh=Dt,t.ɵj=Gt,t.ɵo=Zt,t.ɵu=Qt,t.ɵk=Bt,t.ɵp=$t,t.ɵq=te,t.ɵr=ee,t.ɵs=ie,t.ɵt=ne,t.ɵl=Ht,t.ɵm=Wt,t.ɵn=Xt,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http"),require("ngx-toastr"),require("rxjs/operators"),require("rxjs"),require("ngx-simple-crypt"),require("@angular/material"),require("@angular/forms"),require("@angular/router"),require("ng2-file-upload"),require("ng2-slim-loading-bar"),require("ag-grid-enterprise"),require("@angular/common"),require("clipboard"),require("prismjs"),require("prismjs/plugins/toolbar/prism-toolbar"),require("prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard"),require("prismjs/components/prism-css"),require("prismjs/components/prism-javascript"),require("prismjs/components/prism-java"),require("prismjs/components/prism-markup"),require("prismjs/components/prism-typescript"),require("prismjs/components/prism-sass"),require("prismjs/components/prism-scss"),require("prismjs/components/prism-sql"),require("bpmn-js/lib/NavigatedViewer"),require("ngforage"),require("ng2-dragula"),require("@angular/flex-layout"),require("ngx-markdown"),require("ng2-ckeditor"),require("ag-grid-angular"),require("mydatepicker"),require("@agm/core"),require("@angular/cdk/table"),require("@ngx-translate/core"),require("@angular/http")):"function"==typeof define&&define.amd?define("@fluxhub/fluxhub-lib",["exports","@angular/core","@angular/common/http","ngx-toastr","rxjs/operators","rxjs","ngx-simple-crypt","@angular/material","@angular/forms","@angular/router","ng2-file-upload","ng2-slim-loading-bar","ag-grid-enterprise","@angular/common","clipboard","prismjs","prismjs/plugins/toolbar/prism-toolbar","prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard","prismjs/components/prism-css","prismjs/components/prism-javascript","prismjs/components/prism-java","prismjs/components/prism-markup","prismjs/components/prism-typescript","prismjs/components/prism-sass","prismjs/components/prism-scss","prismjs/components/prism-sql","bpmn-js/lib/NavigatedViewer","ngforage","ng2-dragula","@angular/flex-layout","ngx-markdown","ng2-ckeditor","ag-grid-angular","mydatepicker","@agm/core","@angular/cdk/table","@ngx-translate/core","@angular/http"],e):e((t.fluxhub=t.fluxhub||{},t.fluxhub["fluxhub-lib"]={}),t.ng.core,t.ng.common.http,t.i3,t.rxjs.operators,t.rxjs,t.ngxSimpleCrypt,t.ng.material,t.ng.forms,t.ng.router,t.ng2FileUpload,t.ng2SlimLoadingBar,null,t.ng.common,null,null,null,null,null,null,null,null,null,null,null,null,t.NavigatedViewer,t.i1$1,t.ng2Dragula,t.ng["flex-layout"],t.ngxMarkdown,t.ng2Ckeditor,t.agGridAngular,t.mydatepicker,t.core,t.ng.cdk.table,t.core$1,t.ng.http)}(this,function(t,l,p,e,r,o,n,i,s,a,u,c,d,h,_,m,g,f,v,y,b,I,S,E,O,C,w,R,A,N,D,k,T,M,P,x,L,F){"use strict";w=w&&w.hasOwnProperty("default")?w["default"]:w;var j=function(){function t(){this.API_ENDPOINT="http://localhost:9090/api/",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.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}}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.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ngInjectableDef=l.defineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),U=function(){function t(){}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),V=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,i){var n=this;void 0===i&&(i=!0),this.headers=new p.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 e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),z=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,i){var n=this;void 0===i&&(i=!0),this.headers=new p.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 e=JSON.stringify(t);return this.http.post(this.url,e,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),K=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,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.APPMAKER_ENDPOINT,this.headers=new p.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")});var e=JSON.stringify(t);return this.http.post(this.url,e).pipe(r.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 U}),r.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),o.Observable["throw"](e)},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),Y=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),q=function(){function t(){this.values=new Array,this.types=new Array,this.names=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),G=function(){function t(){this.command="",this.p1="",this.p2=""}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),B=function(t,e){return(B=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 H(t,e){function i(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function W(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||0<e--)&&!(n=s.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(i=s["return"])&&i.call(s)}finally{if(o)throw o.error}}return r}var X=function(){function i(t){this.app_s=t,this.simpleCrypt=new n.SimpleCrypt}return i.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()},i.prototype.gridDateStyle=function(t){return{"text-align":"center"}},i.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)})},i.prototype.array_move=function(t,e,i){if(i>=t.length)for(var n=i-t.length+1;n--;)t.push(undefined);return t.splice(i,0,t.splice(e,1)[0]),t},i.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"),0<(t||"").toString().indexOf(",")&&(t=(t||"").toString().split(".").join("").split(",").join("."));var s=W((t||"").toString().split("."),2),r=s[0],a=s[1],l=void 0===a?"":a;return l=0<e?i+(l+o).substring(0,e):"",(r=r.replace(/\B(?=(\d{3})+(?!\d))/g,n))+l},i.prototype.number2bool=function(t){return null!=t&&1==t},i.prototype.bool2number=function(t){return null==t?0:t?1:0},i.prototype.round=function(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)},i.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&&19<=t.length){i=(o=(t=t.substring(0,19)).split("T"))[0].split("-");var n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}if(3==e&&16<=t.length){var o;i=(o=(t=t.substring(0,16)).split(" "))[0].split("/"),n=o[1].split(":");return new Date(parseInt(i[0]),parseInt(i[1])-1,parseInt(i[2]),parseInt(n[0]),parseInt(n[1]),0)}if(4!=e)return null;if(!t)return null;var s=t.split("/").map(function(t){return parseInt(t)});return new Date(s[2],s[1]-1,s[0])},i.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},i.prototype.compare_date=function(t,e){return null!=t&&(null!=e&&(t.getDate()==t.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()))},i.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?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join(""):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join(""):"Parametro SQL_SERVER_LANG non corretto"},i.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},i.prototype.date2String=function(t){if(null==t)return"";var e=t.getMonth()+1,i=t.getDate();return[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()].join("")},i.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[(9<i?"":"0")+i,"/",(9<e?"":"0")+e,"/",t.getFullYear()," ",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},i.prototype.formatDecimal=function(t,e){void 0===e&&(e=2);var i=W((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))+s},i.prototype.format2cifre=function(t){return t<10?"0"+String(t):String(t)},i.prototype.datetime2GanttString=function(t){var e=t.getMonth()+1,i=t.getDate(),n=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i,"T",(9<n?"":"0")+n,":",(9<o?"":"0")+o,":",(9<s?"":"0")+s].join("")},i.prototype.check2int=function(t){return t?1:0},i.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()}},i.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]))},i.prototype.sql_date_time=function(t){var e=t.getMonth()+1,i=t.getDate();return"it"==this.app_s.SQL_SERVER_LANG?[(9<i?"":"0")+i,"-",(9<e?"":"0")+e,"-",t.getFullYear()].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"uk"==this.app_s.SQL_SERVER_LANG?[t.getFullYear(),"-",(9<e?"":"0")+e,"-",(9<i?"":"0")+i].join("")+" "+this.format2cifre(t.getHours())+":"+this.format2cifre(t.getMinutes()):"Parametro SQL_SERVER_LANG non corretto"},i.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"}},i.prototype.addDays=function(t,e){return t.setDate(t.getDate()+e),t},i.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=3<(l=(a=parseInt(t=Math.abs(t).toFixed(o))+"").length)?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):"")},i.prototype.format_euro=function(t){return this.toMoney(t,2,",",".")},i.prototype.pad=function(t,e){for(var i=t+"";i.length<e;)i="0"+i;return i},i.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},i.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},i.prototype.encrypt_v2=function(t){return this.simpleCrypt.encode("prologika_fluxhub_etjda",t)},i.prototype.decrypt_v2=function(t){return this.simpleCrypt.decode("prologika_fluxhub_etjda",t)},i.prototype.string_sqlvalue=function(t){return null==t?"":t.split("'").join("''")},i.prototype.hasRole=function(t,e){return void 0===e&&(e=!0),null!==localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles")&&(!(!e||null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin"))||-1<localStorage.getItem(this.app_s.COMPANY_KEY+"user_roles").toUpperCase().indexOf(t.toLocaleUpperCase()))},i.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:j}]},i.ngInjectableDef=l.defineInjectable({factory:function(){return new i(l.inject(j))},token:i,providedIn:"root"}),i}(),Q=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,0<="1234567890,".indexOf(t.charPress)?(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 1e6<parseFloat(this.value.split(".").join("").split(",").join("."))},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault()},t.prototype.ngAfterViewInit=function(){this.input.element.nativeElement.focus()},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(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(96<=e&&e<=109)return!0;var i=String.fromCharCode(e);return this.isCharNumeric(i)},t.decorators=[{type:l.Component,args:[{selector:"numeric-cell",template:'<input #input (keydown)="onKeyDown($event)" [(ngModel)]="value" style="fontSize:40;height:30px;">'}]}],t.ctorParameters=function(){return[{type:X}]},t.propDecorators={input:[{type:l.ViewChild,args:["input",{read:l.ViewContainerRef}]}]},t}(),J=function(){function t(t){this.uti_s=t,this.label=""}return t.prototype.setDt=function(){this.date_zz=this.appdt.getValue(),this.params.api.stopEditing()},t.prototype.ngAfterViewInit=function(){this.appdt.setFocus()},t.prototype.agInit=function(t){return null==(this.params=t).value?(this.date=null,void(this.date_zz=null)):1970==new Date(t.value).getFullYear()?(this.date=null,void(this.date_zz=null)):-1!=t.value.indexOf("--")?(this.date=null,void(this.date_zz=null)):(this.date=new Date(t.value),this.appdt.setValue(this.date),void(this.date_zz=new Date(t.value)))},t.prototype.getValue=function(){return null==this.date_zz?null:this.date_zz.getFullYear().toString()+"-"+this.uti_s.format2cifre(this.date_zz.getMonth()+1)+"-"+this.uti_s.format2cifre(this.date_zz.getDate())+"T00:00:00"},t.prototype.isPopup=function(){return!0},t.prototype.onKeyDown=function(t){var e=t.which||t.keyCode;37!=e&&39!=e||t.stopPropagation()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container fxLayout="row" class="mood" tabindex="0" (keydown)="onKeyDown($event)">\n\n <DtPicker [(ngModel)]="date" #appdt\n [show_buttons]="false" ngDefaultControl\n\n >\n </DtPicker>\n <button mat-raised-button (click)="setDt()">CONFERMA</button>\n\n </div>\n\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.ctorParameters=function(){return[{type:X}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),Z=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.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.ngOnInit=function(){if(null!=this.m_appService.getState().appo_dialog&&null!=this.m_appService.getState().appo_dialog.val){var t=this.m_appService.getState().appo_dialog.val.split(":");return this.h=parseInt(t[0]),this.m=parseInt(t[1]),void(this.res=this.m_appService.getState().appo_dialog.val)}},t.decorators=[{type:l.Component,args:[{selector:"fhtimeslider",template:'\n\n <h2 mat-dialog-title style="min-width:300px">Seleziona Orario -> {{res}}</h2>\n\n <mat-dialog-content><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-raised-button (click)="ok()">OK</button>\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j},{type:X}]},t}(),$=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)&&3<n[0].length){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=(0<r.length?r+".":"")+s}else i=n[0];1<n.length&&(i+=","+n[1].substring(0,2))}this.model.valueAccessor.writeValue(i)},t.decorators=[{type:l.Directive,args:[{selector:"[ngModel][decimal]",host:{"(ngModelChange)":"onInputChange($event)"}}]}],t.ctorParameters=function(){return[{type:s.NgControl}]},t}(),tt=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,i,e){var n=this;if(void 0===i&&(i=!0),void 0===e&&(e=null),null!=localStorage.getItem(this.app_s.COMPANY_KEY+"token")){if(this.headers=new p.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==e?this.app_s.API_ENDPOINT+this.app_s.QUERY_ENDPOINT:e,null!=t.types&&-1==t.sql.indexOf("_MULTI"))for(var o=0;o<t.types.length;o++)null==t.values[o]?t.values[o]="dbnull":("boolean"==t.types[o]&&(t.values[o]?t.values[o]="1":t.values[o]="0"),"int"==t.types[o]&&(t.values[o]=""+t.values[o]),"string"==t.types[o]&&(t.values[o]=""+t.values[o]),"date"==t.types[o]&&(t.values[o]=this.uti_s.sql_date(t.values[o])),"datetime"==t.types[o]&&(t.values[o]=this.uti_s.sql_date_time(t.values[o])),"decimal"==t.types[o]&&(t.values[o]=""+t.values[o]),"string"==t.types[o]&&null==t.values[o]&&(t.values[o]="dbnull"));var s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(r.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 U}),r.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.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:e.ToastrService},{type:j},{type:X}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(e.ToastrService),l.inject(j),l.inject(X))},token:t,providedIn:"root"}),t}(),et=function(){function t(){this.changed=[],this.touched=[]}return t.prototype.emitChanged=function(){var e=this.getValue();this.changed.forEach(function(t){return t(e)})},Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},set:function(e){this.getValue()!==e&&(this.setValue(e),this.changed.forEach(function(t){return t(e)}))},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}(),it=function(r){function t(t,e,i,n,o){var s=r.call(this)||this;return s._dataService=t,s.dialog=e,s.m_appService=i,s.toastr=n,s.uti_s=o,s.maxore=23,s.label="",s.enabled=!0,s.show_picker=!1,s.selchange=new l.EventEmitter,s.ngChange=new l.EventEmitter,s.h=0,s.m=0,s.res="",s}return H(t,r),t.prototype.uph=function(){this.h<this.maxore&&this.h++,this.sc()},t.prototype.doh=function(){0<this.h&&this.h--,this.sc()},t.prototype.upm=function(){this.m<60&&this.m++,this.sc()},t.prototype.dom=function(){0<this.m&&this.m--,this.sc()},t.prototype.onFu=function(){this.h>this.maxore&&(this.h=this.maxore),this.sc()},t.prototype.onMi=function(){59<this.m&&(this.m=59),this.sc()},t.prototype.onKeyDown=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.onKeyDown1=function(t){this.isKeyPressedNumeric(t)||t.preventDefault&&t.preventDefault(),this.sc()},t.prototype.resetValue=function(){this.h=0,this.m=0},t.prototype.annulla=function(){this.show_picker=!1},t.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"})},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.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()},t.prototype.isValidVal=function(){return!0},t.prototype.setByValue=function(t){this.setByDescri(t)},t.prototype.setValue=function(t){this.setByDescri(t)},t.prototype.getDescri=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getData=function(t){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getObj=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getValue=function(){return this.uti_s.pad(this.h,2)+":"+this.uti_s.pad(this.m,2).replace("NaN","00")},t.prototype.getHours=function(){return this.h},t.prototype.getMinutes=function(){return this.m},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){var t=this.getValue();this.selchange.emit(),this.ngChange.emit(t),this.emitChanged()},t.prototype.isCharNumeric=function(t){return!!/\d/.test(t)},t.prototype.getCharCodeFromEvent=function(t){return"undefined"==typeof(t=t||window.event).which?t.keyCode:t.which},t.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},t.decorators=[{type:l.Component,args:[{selector:"FHTimePicker",template:'\n <div fxLayout="row" fxLayoutAlign="center center"><b>{{label}}</b> \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 <b style="font-size:28px">:</b> \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:s.NG_VALUE_ACCESSOR,useExisting:t,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 "]}]}],t.ctorParameters=function(){return[{type:tt},{type:i.MatDialog},{type:j},{type:e.ToastrService},{type:X}]},t.propDecorators={maxore:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],selchange:[{type:l.Output}],ngChange:[{type:l.Output,args:["change"]}]},t}(et),nt=function(){function t(){}return t.prototype.agInit=function(t){this.params=t},t.prototype.refresh=function(){return!0},t.decorators=[{type:l.Component,args:[{selector:"currency-cell",template:"{{params.value | currency:'EUR'}}"}]}],t}(),ot=function(){function t(t,e){this.dialogRef=t,this.app_s=e,this.title="",this.msg="",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.setTitle=function(t){this.title=t},t.prototype.setMsg=function(t){this.msg=t},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <h1 mat-dialog-title>{{title}}</h1>\n <div mat-dialog-content>{{msg}}</div>\n <div mat-dialog-actions>\n <button mat-button (click)="dialogRef.close(true)" color="primary">CONFERMA</button>\n <button mat-button (click)="dialogRef.close(false)" color="warn">ANNULLA</button>\n </div>\n ',styles:["\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j}]},t}(),st=function(){function t(t,e,i,n,o,s,r,a){this._dataService=t,this.toastr=e,this.http=i,this.router=n,this.route=o,this._fileService=s,this.app_s=r,this.uti_s=a,this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT,this.goto_after="",this.username="",this.headers=new p.HttpHeaders({"Content-Type":"application/json"})}return t.prototype.logout=function(){localStorage.removeItem(this.app_s.COMPANY_KEY+"user"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_idp"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_password"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_roles"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_lang"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_isadmin"),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 o=JSON.stringify({username:t,password:e});return 1==this.app_s.LDAP_AUTH&&(o=JSON.stringify({username:t,password:e,ldap_auth:1})),this.http.post(this.url,o,{headers:this.headers}).pipe(r.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 U}),r.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,i){var n=this;void 0===i&&(i=!0),this.url=this.app_s.API_ENDPOINT+this.app_s.LOGIN_ENDPOINT;var e=JSON.stringify({username_info:t});return this.http.post(this.url,e,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.prototype.login_sa=function(){var n=this;if(!this.checkCredentials()){for(var t=window.location.href.split(/[\&?]+/),e=!1,i=0;i<t.length;i++)if("u="==t[i].substring(0,2)){var o=t[i].split("=")[1];this.username=this.uti_s.decrypt(decodeURI(o)),e=!0}else t[i];if(e)this.get_user_info(this.username).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;n.username="NA",0<i.length?(n.username=i[0].username,localStorage.setItem(n.app_s.COMPANY_KEY+"user_name",i[0].name),localStorage.setItem(n.app_s.COMPANY_KEY+"user_surname",i[0].surname),localStorage.setItem(n.app_s.COMPANY_KEY+"user",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_email",i[0].email),localStorage.setItem(n.app_s.COMPANY_KEY+"user_password",""),localStorage.setItem(n.app_s.COMPANY_KEY+"user_idp",i[0].username),localStorage.setItem(n.app_s.COMPANY_KEY+"user_lang","IT"),localStorage.setItem(n.app_s.COMPANY_KEY+"user_isadmin",i[0].isadmin),localStorage.setItem(n.app_s.COMPANY_KEY+"user_roles",i[0].roles),localStorage.setItem(n.app_s.COMPANY_KEY+"token","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJlZm9ybmkiLCJpc3MiOiJ3d3cuZmx1eGh1Yi5jb20iLCJyb2xlIjoib2tfbG9nZ2VkIiwiaWF0IjoxNTA3OTA3MzQ2fQ.xqXZsPTu8stomoIl8_2d9DhLkGU3gAi7MXwClYNkEzg"),e=!0):localStorage.removeItem("token")}e||console.log(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")});else{var s=encodeURI(window.location.href).replace("#","%23");-1==s.indexOf("?")&&(s+="?"),this.url="http://csaportale.ceramicasantagostino.it/homepage_new.nsf/OK?OpenForm&redirect="+s,window.location.href=this.url}}},t.prototype.passrecovery=function(t,i){var n=this;void 0===i&&(i=!0);var e=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,e,{headers:this.headers}).pipe(r.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 U}),r.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,i){var n=this;void 0===i&&(i=!0);var e=JSON.stringify({res_rep:t,op:"check_token"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,e,{headers:this.headers}).pipe(r.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 U}),r.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 o=JSON.stringify({token:t,password:e,op:"change_password"});return this.http.post(this.app_s.API_ENDPOINT+this.app_s.PASSRECOVERY_ENDPOINT,o,{headers:this.headers}).pipe(r.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 U}),r.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.app_s.LOGIN_EXT?this.login_sa():-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.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:tt},{type:e.ToastrService},{type:p.HttpClient},{type:a.Router},{type:a.ActivatedRoute},{type:z},{type:j},{type:X}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(tt),l.inject(e.ToastrService),l.inject(p.HttpClient),l.inject(a.Router),l.inject(a.ActivatedRoute),l.inject(z),l.inject(j),l.inject(X))},token:t,providedIn:"root"}),t}(),rt=function(){function t(t,e,i,n,o){this._appservice=t,this._dataService=e,this.toastr=i,this.dialog=n,this.auth_s=o,this.enabled=!0,this.label="",this.sovrascrivi_path="",this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.b_False=!1,this.b_mobile=!1,this.b_ini=!1}return 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["delete"]=function(i){var n=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(ot).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="DELETE_ALLEGATO",e.types=["int","string"],e.values=[i.id,n.auth_s.username],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))},function(t){})}})},t.prototype.ngOnInit=function(){this.upc.single=!1,this.b_mobile=this._appservice.getState().pageFullscreen,this.upc.init(this.App,this.K,"Descrizione Allegato"),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ngOnInit()},t.prototype.ref_allegato=function(){var o=this;if(null!=this.App&&""!=this.App){var t=new q;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){o.arr_g=t.result_data;for(var e="default",i=0;i<o.arr_g.length;i++){var n=o.arr_g[i].Filename.split(".");-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(n[n.length-1].toLocaleUpperCase())&&(e=n[n.length-1].toLocaleLowerCase()),o.arr_g[i].icon=e+".svg"}}})}},t.decorators=[{type:l.Component,args:[{selector:"FHUploadPanel",template:'\n <div fxLayout="column">\n\n <h3>{{label}}</h3>\n\n <div fxLayout="column">\n <div [hidden]="!enabled">\n <FHUpload [single]="b_False" (change)="ref_allegato()" #upc></FHUpload>\n <br></div>\n\n <table width="98%" class="fh_table">\n <thead *ngIf="!b_mobile">\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:50%">Descrizione</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" style="font-size: 12px;">\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 (click)="download_all(app)" mat-raised-button>DOWNLOAD</button>\n </td>\n <td *ngIf="!b_mobile">{{app.Filename}}</td>\n <td *ngIf="!b_mobile" style="text-align:center">{{app.Filesize}}</td>\n <td *ngIf="!b_mobile">{{app.descrizione}}</td>\n <td *ngIf="!b_mobile" style="text-align:center">{{app.dt_ins | date: \'dd/MM/yyyy HH:mm:ss\'}}</td>\n <td *ngIf="!b_mobile" style="text-align:center">\n <button mat-icon-button matTooltip="Download File" (click)="download_all(app)">\n <mat-icon>save_alt</mat-icon>\n </button>\n </td>\n\n <td *ngIf="enabled" style="text-align:center">\n <a mat-icon-button matTooltip="Elimina File" *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n\n </tr>\n </table>\n\n </div>\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n \n\n "]}]}],t.ctorParameters=function(){return[{type:j},{type:tt},{type:e.ToastrService},{type:i.MatDialog},{type:st}]},t.propDecorators={enabled:[{type:l.Input}],label:[{type:l.Input}],sovrascrivi_path:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}]},t}(),at=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.update_progess=function(t){100==(this.progress_p=t)&&this.dialogRef.close()},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\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\n\n </mat-dialog-content>\n\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),lt=function(){function t(t,e,i,n){var o=this;this._dataService=t,this.toastr=e,this.dialog=i,this.app_s=n,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.change=new l.EventEmitter,this.upload_ended=new l.EventEmitter,this.loading=!1,this.App="",this.K="",this.label_b="",this.descrizione="",this.file_name="",this.label="",this.username="",this.progress_p=0,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.username=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.uploader.onBeforeUploadItem=function(t){t.withCredentials=!1},this.uploader.onCompleteItem=function(t,e,i,n){200===i&&(o.descrizione="",o.toastr.info("INFO",o.allegato_inserito,{timeOut:1e3,progressBar:!0}),o.ref_allegato(),o.change.emit())}}return t.prototype.ngOnInit=function(){var o=this,t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],this.uploader.setOptions(t),this.uploader.onCompleteAll=function(){o.loading=!1,o.upload_ended.emit(),null!=o.dialogRef&&null!=o.dialogRef.componentInstance&&(o.dialogRef.componentInstance.update_progess(100),o.dialogRef=null)},this.uploader.onErrorItem=function(t,e,i,n){o.toastr.error(e)},this.uploader.onAfterAddingFile=function(){o.ch()},this.uploader.onProgressItem=function(t,e){o.loading=!0,null!=o.dialogRef&&null!=o.dialogRef.componentInstance&&o.dialogRef.componentInstance.update_progess(e)},this.uploader.onWhenAddingFileFailed=function(t,e,i){switch(e.name){case"fileSize":var n=Math.round(t.size/1024/1024);o.toastr.error(o.limit_string.split("<size>").join(""+n));break;default:o.toastr.error("Errore: "+e.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(){var i=this;this.descri_obb&&""==this.descrizione?this.toastr.error(this.inserire_descrizione):(this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",i.tipo),e.append("local_path",i.app_s.LOCAL_PATH),""!=i.programma_da_eseguire&&e.append("p1",i.programma_da_eseguire)},null==this.dialogRef&&(this.dialogRef=this.dialog.open(at,{disableClose:!0}),this.dialogRef.componentInstance.label=this.label_attendere,this.dialogRef.afterClosed().subscribe(function(t){})),this.uploader.uploadAll())},t.prototype.init=function(t,e,i,n,o){void 0===n&&(n=""),void 0===o&&(o=""),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.ref_allegato()},t.prototype.ref_allegato=function(){var i=this;if(this.single&&null!=this.App&&""!=this.App){var t=new q;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;0<e.length&&(i.descrizione=e[0].descrizione,i.file_name=e[0].Filename,i.label_b="Download ("+e[0].Filename+" - "+e[0].Filesize+")",i.b_edit_loaded=!0)}},function(t){})}},t.decorators=[{type:l.Component,args:[{selector:"FHUpload",template:'\n <div *ngIf="loading" fxLayout="row">\n WAIT\n </div>\n <div *ngIf="enabled && !loading" fxLayout="row">\n <mat-form-field class="field_style">\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione"\n placeholder="{{label}} {{fixed_label}}">\n </mat-form-field>\n <input type="file" ng2FileSelect [uploader]="uploader" multiple/>\n <div>\n <button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>\n </div>\n </div>\n <div *ngIf="!enabled">\n <label>{{label}}:</label>{{descrizione}}\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:tt},{type:e.ToastrService},{type:i.MatDialog},{type:j}]},t.propDecorators={enabled:[{type:l.Input}],single:[{type:l.Input}],descri_obb:[{type:l.Input}],programma_da_eseguire:[{type:l.Input}],label_attendere:[{type:l.Input}],fixed_label:[{type:l.Input}],limit_string:[{type:l.Input}],allegato_inserito:[{type:l.Input}],inserire_descrizione:[{type:l.Input}],change:[{type:l.Output}],upload_ended:[{type:l.Output}]},t}(),pt=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,i,e){var n=this;void 0===i&&(i=!0),void 0===e&&(e=null),this.headers=new p.HttpHeaders({"Content-Type":"application/json",Authorization:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}),this.url=null==e?this.app_s.API_ENDPOINT+this.app_s.GRID_ENDPOINT:e;var o=JSON.stringify(t);return this.http.post(this.url,o,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),ut=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.title=""}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t}(),ct=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.ngOnInit=function(){},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.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}} (min {{min_chars}} - max {{max_chars}} caratteri)" type="text"\n [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button\n mat-raised-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),dt=function(){function t(){this.filter="",this.system_dest=1}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),ht=function(){function t(t,e,i,n,o,s,r){var a=this;this._gridservice=t,this._toast=e,this._dataService=i,this.m_appService=n,this.slimLoadingBarService=o,this.m_dialog=s,this.uti_s=r,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.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=!1,this.label_elementi=" Elementi",this.trova_label="TROVA",this.mantieni_impostazioni="Mantieni impostazioni",this.curr_filter="",this.show_buttons=!0,this.fill_end=new l.EventEmitter,this.cell_edited=new l.EventEmitter,this.clicked=new l.EventEmitter,this.dclicked=new l.EventEmitter,this.columndclicked=new l.EventEmitter,this.cell_clicked=new l.EventEmitter,this.toolbar_type="NONE",this.toolbar_wkfapp=null,this.toolbar_custom_commands=[],this.command=new l.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new l.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.dataSource={getRows:function(i){a.slimLoadingBarService.start(function(){});var n=new dt;if(n.table=a.tbl_name,n.table_count=a.tbl_name,""!=a.count_tbl_name&&(n.table_count=a.count_tbl_name),n.num_per_pag=i.endRow-i.startRow,n.curr_page=Math.round(i.startRow/n.num_per_pag),null==n.curr_page&&(n.curr_page=0),null==n.num_per_pag&&(n.num_per_pag=100),n.sort_field=a.sort_field,null!=i.sortModel&&0<i.sortModel.length){n.sort_field="";for(var t=0;t<i.sortModel.length;t++)""!=n.sort_field&&(n.sort_field=n.sort_field+","),"autori"==i.sortModel[t].colId?n.sort_field=n.sort_field+"case when CHARINDEX('"+localStorage.getItem(a.m_appService.COMPANY_KEY+"user")+"',autori)>0 then 1 else 0 end "+i.sortModel[t].sort:n.sort_field=n.sort_field+i.sortModel[t].colId+" "+i.sortModel[t].sort}n.system_dest=a.system_dest,n.field=a.fields,null!=a.filters&&(n.filter=a.filters),""!=a.fix_flt&&(""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+" ("+a.fix_flt+" )"),""!=a.fix_flt_temp&&(""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+" ("+a.fix_flt_temp+" )");var e=!1;if(null!=i.filterModel)for(var o in i.filterModel)if(null!=i.filterModel[o].type)null!=i.filterModel[o].filter&&(a.show_pulisci_filtri=!0,""!=n.filter&&(n.filter=n.filter+" and "),e=!0,"number"==i.filterModel[o].filterType?("greaterThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" > "+i.filterModel[o].filter),"equals"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" = "+i.filterModel[o].filter),"notEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <> "+i.filterModel[o].filter),"lessThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" < "+i.filterModel[o].filter),"lessThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <= "+i.filterModel[o].filter),"greaterThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" >= "+i.filterModel[o].filter),"inRange"==i.filterModel[o].type&&(n.filter=n.filter+" ("+o+" >= "+i.filterModel[o].filter+" and "+o+" <= "+i.filterModel[o].filterTo+")")):("contains"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") like '%"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"startsWith"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") like '"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"equals"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") = '"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"notContains"==i.filterModel[o].type&&(n.filter=n.filter+"not upper("+o+") like '%"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"%'"),"notEqual"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") <> '"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"'"),"endsWith"==i.filterModel[o].type&&(n.filter=n.filter+" upper("+o+") like '%"+i.filterModel[o].filter.replace("'","''").toUpperCase()+"'"))),null==i.filterModel[o].dateTo&&null==i.filterModel[o].dateFrom||(e=!0,""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+" (",null!=i.filterModel[o].dateFrom&&null!=i.filterModel[o].dateTo&&(n.filter=n.filter+o+">='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),null!=i.filterModel[o].dateTo?(null!=i.filterModel[o].dateFrom&&(n.filter=n.filter+" and "),n.filter=n.filter+o+"<='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateTo,1))+"'"):null!=i.filterModel[o].dateFrom&&("greaterThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"equals"==i.filterModel[o].type&&(n.filter=n.filter+" ("+o+" >='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"' and "+o+" <='"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+" 23:59:00')"),"notEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <> '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"lessThan"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"lessThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" <= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'"),"greaterThanOrEqual"==i.filterModel[o].type&&(n.filter=n.filter+" "+o+" >= '"+a.uti_s.sql_date(a.uti_s.string2date(i.filterModel[o].dateFrom,1))+"'")),n.filter=n.filter+" )");else{for(var s="",r=0;r<i.filterModel[o].length;r++)null!=i.filterModel[o][r]&&(""!=s&&(s+=","),s=s+"'"+i.filterModel[o][r].replace("'","''")+"'");""!=s?(e=!0,""!=n.filter&&(n.filter=n.filter+" and "),n.filter=n.filter+o+" in ("+s+")"):(e=!0,""!=n.filter&&(n.filter=n.filter+" and 1=0"))}a.show_pulisci_filtri=e,(a.str_curr_q_p="")!=n.filter&&(a.str_curr_q_p="where "+n.filter),""!=n.sort_field&&(a.str_curr_q_p=a.str_curr_q_p+" order by "+n.sort_field),a.curr_filter=n.filter,a._gridservice.doQuery(n,!0,a.end_point).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){e=!0,i.successCallback(t.result_data,t.count),a.b_init=!0,a.myData=t.result_data.slice(),a.num_r=t.count,a.slimLoadingBarService.complete(),a.fill_end.emit(),localStorage.setItem(a.grid_key+"_POS1",JSON.stringify(n)),null!=localStorage.getItem(a.grid_key+"_POS2")&&null!=a.gridOptions&&null!=a.gridOptions.api&&a.gridOptions.api.forEachNode(function(t){a.getRowNodeId(t)===localStorage.getItem(a.grid_key+"_POS2")&&(t.setSelected(!0),localStorage.removeItem(a.grid_key+"_POS2"))});null!=a.toggle_mantieni&&a.toggle_mantieni.checked,a.no_pref&&!a.b_init1&&a.autoSizeAll(),a.b_init1=!0,a.ensure_visible(),!a.show_buttons&&a.first_ref?(setTimeout(function(){a.autoSizeAll()},300),a.first_ref=!1):null==localStorage.getItem(a.grid_key+"_COLS")&&setTimeout(function(){a.autoSizeAll()},300)}e||(a.errorMsg=t.msg+" ["+t.result_msg+"]")},function(t){a.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER. RITENTARE PIU' TARDI"})}},this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!0,enableServerSideFilter:!0,enableColResize:!0,rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return a.getContextMenuItems()},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.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.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"),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 s=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(ot,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[s.gf.getDescri(),s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var s=this;this.win_opt=this.m_dialog.open(ct,{disableClose:!0}),this.win_opt.componentInstance.title="Salva Configurazione",this.win_opt.componentInstance.label="Nome",this.win_opt.afterClosed().subscribe(function(t){if(t&&null!=t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[t,s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo())},function(t){})}})},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 i=this,t={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(t){if(t.value){if(null==t.value)return"";if("function"==typeof t.value.getMonth)return i.uti_s.pad(t.value.getDate(),2)+"/"+i.uti_s.pad(t.value.getMonth()+1,2)+"/"+t.value.getFullYear();if(24==t.value.length&&-1<t.value.indexOf(":00.000Z")){var e=new Date(t.value);return i.uti_s.pad(e.getDate(),2)+"/"+i.uti_s.pad(e.getMonth()+1,2)+"/"+e.getFullYear()+" "+i.uti_s.pad(e.getHours(),2)+":"+i.uti_s.pad(e.getMinutes(),2)}return t.value}}};this.gridOptions.api.exportDataAsExcel(t)},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.ngOnInit=function(){null==this.end_point&&(this.end_point=this.m_appService.API_ENDPOINT+this.m_appService.GRID_ENDPOINT),this.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(ut,{disableClose:!0}).afterClosed().subscribe(function(t){})},t.prototype.onResize=function(t){},t.prototype.autoSizeAll=function(){if(null!=this.gridOptions&&null!=this.gridOptions.columnApi){var e=[];this.columnDefs.forEach(function(t){e.push(t.field)}),this.gridOptions.columnApi.autoSizeColumns(e,null),this.save_cfg()}},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var e=0;return this.gridOptions.api.forEachNode(function(t){t.isSelected()&&e++}),e},t.prototype.getquerySelected=function(e,t){var i="";return"String"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i=i+"'"+t.data[e]+"'")}),"Number"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i+=t.data[e])}),i},t.prototype.selectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!0)})},t.prototype.deselectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!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"))try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),null)}catch(i){console.log(i)}try{this.gridOptions.api.setSortModel(null)}catch(i){console.log(i)}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(i){console.log(i)}try{this.gridOptions.api.setFilterModel(null)}catch(i){console.log(i)}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(i){console.log(i)}},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.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.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++)2<t[i].length?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(){this.no_pref||(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.no_pref||this.b_init&&localStorage.setItem(this.grid_key+"_FILTER",JSON.stringify(this.gridOptions.api.getFilterModel()))},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(){i.ckk()},10)},t.prototype.Refresh=function(){this.ref_dt()},t.prototype.RefreshOnlyMemory=function(){this.updateRow()},t.decorators=[{type:l.Component,args:[{selector:"FHGrid",template:'\r\n<div fxLayout="column" fxLayoutAlign="stretch" fxFlexFill>\r\n\r\n <div fxLayout="row" fxLayoutGap="3px" fxLayoutAlign="start center" style="min-height: 55px" [hidden]="!show_buttons">\r\n \r\n <div>\r\n\t\t \t\t<h5>{{num_r}} {{label_elementi}}</h5>\r\n </div>\r\n \r\n\r\n\t\t\t\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">\r\n <div matTooltip="REMOVE FILTER" matTooltipPosition="above" *ngIf="show_pulisci_filtri" >\r\n \t\t\t<button mat-raised-button (click)="pulisci_filtri()" color="warn">\r\n\t\t\t\t<mat-icon>filter_none</mat-icon> \r\n\t\t\t</button>\r\n </div>\r\n <div fxHide fxShow.gt-sm matTooltip="AUTO SIZE" matTooltipPosition="above">\r\n \t\t\t<button mat-raised-button (click)="autoSizeAll()" color="accent"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>photo_size_select_small</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-raised-button (click)="fitSizeAll()" color="accent"\r\n *ngIf="show_buttons">\r\n\t\t\t\t<mat-icon>aspect_ratio</mat-icon>\r\n\t\t\t</button>\r\n </div>\r\n\r\n <FHComboBox fxHide fxShow.gt-sm [hidden]=\'!show_buttons\' (selchange)="ch_config()" (fillend)="fe_cfg()" #gf init_fill="false"></FHComboBox>\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"\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\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">\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\' (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 \t<div fxHide fxShow.gt-sm matTooltip="HELP" matTooltipPosition="above">\r\n <button mat-raised-button (click)="help_window()" color="accent" *ngIf="show_buttons && show_help" >\r\n\t\t\t<mat-icon>help</mat-icon>\r\n </button></div>\r\n\r\n <div fxLayout="row" fxLayoutAlign="end center" fxFlex>\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\r\n\r\n</div>\r\n\r\n <div fxLayout="row" fxLayoutAlign="stretch" fxFlex="95">\r\n<ag-grid-angular ref-agGrid style="width:100%;height:100%;"\r\n\t\t\t\t\t\t\t\t (cellDoubleClicked)="onColumnEvent($event)" (cellClicked)="onCellClicked($event)"\r\n\t\t\t\t\t\t\t\t [headerHeight]="header_h" [groupHeaderHeight]="header_h"\r\n\t\t\t\t\t\t\t\t class="ag-theme-balham" [singleClickEdit]="true" [gridOptions]="gridOptions" [columnDefs]="columnDefs"\r\n\t\t\t\t\t\t\t\t [rowData]="rowData" enableColResize enableServerSideSorting enableServerSideFilter enableColResize\r\n\t\t\t\t\t\t\t\t (afterFilterChanged)="onAfterFilterChanged()" (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)" (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)" (cellValueChanged)="okr($event)"\r\n\t\t\t\t\t\t\t\t (sortChanged)="onAfterSortChanged()" [paginationPageSize]="num_per_pag" (gridReady)="onReady($event)">\r\n</ag-grid-angular>\r\n</div>\r\n</div>\r\n',styles:["\n\n\t"]}]}],t.ctorParameters=function(){return[{type:pt},{type:e.ToastrService},{type:tt},{type:j},{type:c.SlimLoadingBarService},{type:i.MatDialog},{type:X}]},t.propDecorators={end_point:[{type:l.Input}],tbl_name:[{type:l.Input}],columnDefs:[{type:l.Input}],count_tbl_name:[{type:l.Input}],num_per_pag:[{type:l.Input}],grid_key:[{type:l.Input}],sort_field:[{type:l.Input}],fields:[{type:l.Input}],filters:[{type:l.Input}],abilita_export:[{type:l.Input}],enabled_pag:[{type:l.Input}],show_help:[{type:l.Input}],show_num_elem:[{type:l.Input}],system_dest:[{type:l.Input}],header_h:[{type:l.Input}],init_fill:[{type:l.Input}],no_pref:[{type:l.Input}],label_elementi:[{type:l.Input}],trova_label:[{type:l.Input}],mantieni_impostazioni:[{type:l.Input}],show_buttons:[{type:l.Input}],fill_end:[{type:l.Output}],cell_edited:[{type:l.Output}],clicked:[{type:l.Output}],dclicked:[{type:l.Output}],columndclicked:[{type:l.Output}],cell_clicked:[{type:l.Output}],toolbar_type:[{type:l.Input}],toolbar_wkfapp:[{type:l.Input}],toolbar_custom_commands:[{type:l.Input}],command:[{type:l.Output}],gf:[{type:l.ViewChild,args:["gf"]}],toggle_mantieni:[{type:l.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:l.Output}],off_set:[{type:l.Input}],onResize:[{type:l.HostListener,args:["window:resize",["event"]]}],testom:[{type:l.ViewChild,args:["testom",{read:l.ViewContainerRef}]}],myModalNormal:[{type:l.ViewChild,args:["myModalNormal",{read:l.ViewContainerRef}]}]},t}(),_t=function(){function t(t,e){this._dataService=t,this._dataService_odbc=e,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 l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,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{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 i=this;if(-1==this.sql.indexOf("|")||-1==this.sql.indexOf("$")){var t=new q;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.sql+"]"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+i.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.update_dis(),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,void(null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore))},t.prototype.setByIndex=function(t){this.valDef="",this.selval="-1",this.update_dis(),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.update_dis(),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,void(null!=this.myData[e].descrizione_valore&&(this.descri_val=this.myData[e].descrizione_valore))},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(){},t.prototype.ngOnInit=function(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.sc=function(){this.selchange.emit({event:this.getObj(),valore:this.getValue(),descrizione_valore:this.getDescri()})},t.decorators=[{type:l.Component,args:[{selector:"FHComboBox",template:'\n <mat-form-field [hidden]="!enabled || hidden">\n <mat-select placeholder="{{label}}" #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">\n <input type="text" #el1 matInput [disabled]="true" placeholder="{{label}}" [(ngModel)]="dis_value">\n </mat-form-field>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:tt},{type:V}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],hidden:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],required:[{type:l.Input}],sel_label:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}],valDef:[{type:l.Input}],db_type:[{type:l.Input}]},t}(),mt=function(n){function t(t,e){var i=n.call(this)||this;return i._dataService=t,i._dataService_odbc=e,i.init_fill=!0,i.sql="",i.label="",i.types=new Array,i.values=new Array,i.hidden=!1,i.db_type="1",i.enabled=!0,i.required=!1,i.only_from_list=!1,i.fillend=new l.EventEmitter,i.selchange=new l.EventEmitter,i.change=new l.EventEmitter,i.initend=new l.EventEmitter,i.focusout=new l.EventEmitter,i.descri_val="",i.sItem="",i.searchItemsFiltered=new Array,i.is_loaded=!1,i.selval=null,i.errorMsg="",i.valDef="",i.table_hidden=!0,i}return H(t,n),t.prototype.fi_search=function(){null==this.sItem&&(this.sItem="",this.onChange(""))},t.prototype.fo_search=function(){this.focusout.emit()},t.prototype.onChange=function(t){if(this.searchItemsFiltered=new Array,null!=this.sItem)if(""!=this.sItem){this.searchItemsFiltered=new Array;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]),20!=this.searchItemsFiltered.length);i++);}else for(i=0;i<this.myData.length&&(this.searchItemsFiltered.push(this.myData[i]),20!=i);i++);},t.prototype.selectedSearchItem=function(t){this.setByDescri(t.option.value),this.sItem=t.option.value,this.ch(t),console.log("selectedSearchItem ",this.sItem)},t.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()},t.prototype.myListFormatter=function(t){return t.descrizione_valore},t.prototype.resetValue=function(){var t=this;setTimeout(function(){t.selval="",t.valDef="",t.sItem="",t.selval=null},100)},t.prototype.reset=function(){this.selval="",this.valDef="",this.selval=null,this.sItem="",this.myData=new Array},t.prototype.fillCombo=function(){var i=this;this.myData=new Array,this.searchItemsFiltered=new Array;var t=new q;t.sql=this.sql,t.types=this.types,t.values=this.values,"1"==this.db_type&&this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.resetD(t.result_data)},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"}),"2"==this.db_type&&this._dataService_odbc.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){for(var e=0;e<t.result_data.length;e++)null!=t.result_data[e].VALORE&&(t.result_data[e].valore=t.result_data[e].VALORE),null!=t.result_data[e].DESCRIZIONE_VALORE&&(t.result_data[e].descrizione_valore=t.result_data[e].DESCRIZIONE_VALORE);i.resetD(t.result_data)}},function(t){i.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.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)},t.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)}},t.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)},t.prototype.setValue=function(t){this.setByValue(t)},t.prototype.getDescri=function(){return this.getData("descrizione_valore")},t.prototype.getData=function(t){for(var e in console.log(this.sItem),this.myData)if(this.myData[e].descrizione_valore==this.sItem)return this.myData[e][t];return this.sItem},t.prototype.getObj=function(){for(var t in console.log("this.selval ",this.selval," this.myData ",this.myData),this.myData)if(this.myData[t].descrizione_valore==this.selval||this.myData[t].valore==this.selval)return console.log("x ",t," obj ",this.myData[t]),this.myData[t];return null},t.prototype.getValue=function(){return this.getData("valore")},t.prototype.getModelValue=function(){var t=this.getData("valore");return null!==t||this.only_from_list?t:this.sItem},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.table_hidden=!1,this.setByValue(this.valDef),""==this.getValue()&&this.setByDescri(this.valDef)},t.prototype.ngOnInit=function(){if(this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.emitChanged=function(){var e=this.getModelValue();this.changed.forEach(function(t){return t(e)})},Object.defineProperty(t.prototype,"value",{get:function(){return this.getModelValue()},set:function(e){this.getModelValue()!==e&&(this.setValue(e),this.changed.forEach(function(t){return t(e)}))},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.setValue(t)},t.decorators=[{type:l.Component,args:[{selector:"FHAutoComplete",template:'\n <mat-form-field class="field_style" [hidden]="!enabled || hidden">\n <input matInput\n class="field_style" [disabled]="!enabled || hidden" [matAutocomplete]="auto" [placeholder]="label" [required]="required"\n (keyup)="onChange($event)" [(ngModel)]="sItem" (focus)="fi_search()" (focusout)="fo_search()"\n (change)="ch($event)" #searchp>\n </mat-form-field>\n <mat-autocomplete #auto="matAutocomplete" (optionSelected)="selectedSearchItem($event)">\n <mat-option *ngFor="let objx of searchItemsFiltered" class="search_home" [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">\n <input type="text" #el1 matInput [disabled]="true" placeholder="{{label}}" [(ngModel)]="sItem"\n >\n </mat-form-field>\n ',providers:[{provide:s.NG_VALUE_ACCESSOR,useExisting:t,multi:!0}],styles:["\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 "]}]}],t.ctorParameters=function(){return[{type:tt},{type:V}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],label:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],hidden:[{type:l.Input}],db_type:[{type:l.Input}],enabled:[{type:l.Input}],required:[{type:l.Input}],only_from_list:[{type:l.Input}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],change:[{type:l.Output}],initend:[{type:l.Output}],focusout:[{type:l.Output}],searchp:[{type:l.ViewChild,args:["searchp"]}],auto:[{type:l.ViewChild,args:["auto"]}]},t}(et),gt=function(n){function t(t,e){var i=n.call(this)||this;return i.dateAdapter=t,i.uti_s=e,i.label="",i.required=!1,i.show_buttons=!1,i.enabled=!0,i.min_date=null,i.max_date=null,i.change=new l.EventEmitter,i.v_view=i.uti_s.date2String(new Date),i.date_sel=null,i.v_date_sel="",i.dateAdapter.setLocale("it"),i}return H(t,n),t.prototype.dt_chg=function(t){var e=t.split("/");3==e.length&&parseInt(e[2])<3e3&&0<parseInt(e[0])&&parseInt(e[0])<=31&&1<parseInt(e[1])&&parseInt(e[1])<=12&&(this.date_sel=new Date(parseInt(e[2]),parseInt(e[1])-1,parseInt(e[0])))},t.prototype.chxx=function(t){},t.prototype.ch=function(t){this.change.emit(this.getValue()),this.emitChanged()},t.prototype.setFocus=function(){this.pickerId.nativeElement.focus()},t.prototype.dt_ch=function(){var t=this;setTimeout(function(){console.log(t.date_sel),t.ch()},50)},t.prototype.add_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,this.date_sel.getMonth(),this.date_sel.getDate()),this.v_view=this.uti_s.date2String(this.date_sel),this.ch()},t.prototype.ini_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,1,1),this.v_view=this.uti_s.date2String(this.date_sel),this.ch()},t.prototype.fin_year=function(){this.date_sel=new Date(this.date_sel.getFullYear()+1,12,31),this.v_view=this.uti_s.date2String(this.date_sel),this.ch()},t.prototype.getValue=function(){return null==this.date_sel?null:this.date_sel},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.setLimits=function(){},t.prototype.setToday=function(){this.date_sel=new Date},t.prototype.setValue=function(t){this.dateAdapter.setLocale("it"),null!=t?(t instanceof Date||null!=t.value&&(t=new Date(t.value)),this.date_sel=new Date(t.getFullYear(),t.getMonth(),t.getDate()),this.v_view=this.uti_s.date2String(this.date_sel)):this.date_sel=null},t.decorators=[{type:l.Component,args:[{selector:"FHDatePicker",providers:[{provide:i.MAT_DATE_LOCALE,useValue:"it-IT"},{provide:s.NG_VALUE_ACCESSOR,useExisting:t,multi:!0}],template:'\n <div [hidden]="!show_buttons||!enabled">\n <button mat-raised-button (click)="add_year()">+1 Anno</button>\n <button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n <button mat-raised-button (click)="fin_year()">Fine Anno</button>\n </div>\n\n <mat-form-field (click)="chxx($event)">\n <input [disabled]="!enabled" #pickerId (dateChange)="ch( $event)" (focusout)="dt_chg($event.target.value)"\n (click)="chxx($event)" [(ngModel)]="date_sel" matInput [matDatepicker]="picker" placeholder="{{label}}">\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 "]}]}],t.ctorParameters=function(){return[{type:i.DateAdapter},{type:X}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],pickerId:[{type:l.ViewChild,args:["pickerId"]}]},t}(et),ft=function(){function t(t,e,i){this._dataService=t,this.dialogRef=e,this.toastr=i,this.width="100%",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){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){n=!0;break}n||this.users_list_sel.push(this.users_list[t])}}},t.prototype.ngOnInit=function(){var e=this;if(this.all_users){var t=new q;t.sql="SELECT_ALL_USERS",t.types=[],t.values=[],this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.users_list=t.result_data,e.filtra())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})}else{if(null!=this.user_sel&&0<this.user_sel.length)return;if(this.users_list_sel=new Array,null!=this.users_list)for(var i=0;i<this.users_list.length;i++)this.users_list_sel.push(this.users_list[i])}},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.users_list.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&this.users_list.splice(t,1),this.single_sel&&(this.user_sel=new Array),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);-1<t&&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.decorators=[{type:l.Component,args:[{selector:"FHPickUsers",template:'\n <mat-dialog-content>\n <br><br>\n <div fxLayout="row">\n <div fxLayout="column" fxFlex="40">\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 colspan="2">UTENTI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr><td colspan="2"> <input [(ngModel)]="fltr_user" (ngModelChange)="filtra()"\n style=\'padding:8px;margin:15px auto;width:100%;\' placeholder=\'Ricerca...\'>\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-raised-button (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-raised-button (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:auto;">\n <table style="width: 100%" class="fh_table">\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-raised-button color="primary" (click)="dialogRef.close(this.user_sel)">Ok</button> \n <button mat-raised-button (click)="dialogRef.close(false)">Annulla</button>\n </div>\n </mat-dialog-actions>\n\n ',styles:["\n \n "]}]}],t.ctorParameters=function(){return[{type:tt},{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={users_list:[{type:l.Input}],users_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],all_users:[{type:l.Input}],user_sel:[{type:l.Input}]},t}(),vt=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.ngAfterViewInit=function(){},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()},t.decorators=[{type:l.Component,args:[{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.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}]},t}(),yt=function(){function t(){this.DECIMAL_SEPARATOR=",",this.THOUSANDS_SEPARATOR="."}return t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=W((t||"").toString().split(this.DECIMAL_SEPARATOR),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?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=W((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=0<parseInt(s,10)&&0<e?this.DECIMAL_SEPARATOR+(s+"000000").substring(0,e):"",t},t.decorators=[{type:l.Pipe,args:[{name:"FHCurrency"}]}],t.ctorParameters=function(){return[]},t}(),bt=function(){function t(t,e){this.elementRef=t,this.currencyPipe=e,this.el=this.elementRef.nativeElement}return t.prototype.ngOnInit=function(){this.el.value=this.currencyPipe.transform(this.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.decorators=[{type:l.Directive,args:[{selector:"[FHCurrencyFormatter]"}]}],t.ctorParameters=function(){return[{type:l.ElementRef},{type:yt}]},t.propDecorators={onFocus:[{type:l.HostListener,args:["focus",["$event.target.value"]]}],onBlur:[{type:l.HostListener,args:["blur",["$event.target.value"]]}]},t}(),It=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.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n\n\n\n <mat-dialog-content style="min-width:800px;min-height:500px">\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-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n ',styles:["\n agm-map {\n height: 600px;\n width: 100%;\n }\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t}(),St=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()},500)},t.prototype.agInit=function(t){return null==(this.params=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()},t.decorators=[{type:l.Component,args:[{selector:"editor-cell",template:'\n <div #container class="mood">\n <div fxLayout="row" (keydown)="onKeyDown($event)">\n <mat-form-field>\n <textarea matInput style="min-height:180px;min-width:400px" [(ngModel)]="text" #appdt\n placeholder="{{label}}"></textarea>\n </mat-form-field>\n </div>\n\n <button mat-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-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.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),Et=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.ngAfterViewInit=function(){},t.prototype.agInit=function(t){var e=this;this.params=t;var i=new q;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.decorators=[{type:l.Component,args:[{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-raised-button (click)="this.setDt();this.params.api.stopEditing();">CONFERMA</button>\n \x3c!-- \n <button mat-raised-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.ctorParameters=function(){return[{type:tt}]},t.propDecorators={container:[{type:l.ViewChild,args:["container",{read:l.ViewContainerRef}]}],appdt:[{type:l.ViewChild,args:["appdt"]}]},t}(),Ot=function(){function t(t){this._dataService=t,this.init_fill=!0,this.sql="",this.types=[],this.values=[],this.label="",this.enabled=!0,this.fillend=new l.EventEmitter,this.selchange=new l.EventEmitter,this.initend=new l.EventEmitter,this.myData=new Array,this.selval="-1",this.errorMsg="",this.valDef="-1"}return t.prototype.upd_f=function(t,e){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 e=this;if(this.init_fill){var t=new q;t.sql=this.sql,t.types=this.types,t.values=this.values,this._dataService.doQuery(t).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(e.myData=t.result_data,e.resetValue(),e.setByValue(e.valDef),"-1"==e.getValue()&&"-1"!=e.valDef&&e.setByDescri(e.valDef),e.fillend.emit())},function(t){e.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI ["+e.sql+"]"})}},t.prototype.setByDescri=function(t){if(null!=(this.valDef=t)&&""!=t&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(","),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(null!=(this.valDef=t)&&""+t!=""&&null!=this.myData&&0!=this.myData.length&&null!=this.myData[0])for(var e=t.split(","),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++)console.log(this.myData[e].checked);for(e=0;e<this.myData.length;e++)this.myData[e].checked&&(""!=t&&(t+=","),t+=this.myData[e].descrizione_valore);return console.log("getDescri: "+t),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+=","),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(){if(1==this.init_fill){if(""==this.sql)return;this.fillCombo()}else this.errorMsg="";this.initend.emit()},t.prototype.ngOnInit=function(){},t.prototype.sc=function(){this.selchange.emit()},t.decorators=[{type:l.Component,args:[{selector:"FHList",template:'\n\n\n <div style="width:100%;">\n \n <table class="fh_table">\n <thead>\n <tr>\n <th></th>\n <th>\n {{label}}\n\n </th>\n </tr>\n </thead>\n <tbody>\n\n <tr *ngFor="let u of myData" class="selector">\n <td style="width:20px">\n <mat-slide-toggle (change)="upd_f(u,$event)" [disabled]="!enabled"\n [(ngModel)]="u.checked"></mat-slide-toggle>\n </td>\n <td>{{u.descrizione_valore}}</td>\n\n </tr>\n </tbody>\n </table>\n \n </div>\n\n\n ',styles:["\n\n\n "]}]}],t.ctorParameters=function(){return[{type:tt}]},t.propDecorators={init_fill:[{type:l.Input}],sql:[{type:l.Input}],types:[{type:l.Input}],values:[{type:l.Input}],label:[{type:l.Input}],enabled:[{type:l.Input}],smtr:[{type:l.ViewChild,args:["cmb"]}],fillend:[{type:l.Output}],selchange:[{type:l.Output}],initend:[{type:l.Output}]},t}(),Ct=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.width=""}return t.prototype.set_selection=function(t,e){this.label=t;for(var i=0;i<e.length;i++)this.cmb_sel.add_option(e[i])},t.prototype.ok=function(){"-1"!=this.cmb_sel.getValue()?this.dialogRef.close(this.cmb_sel.getObj()):this.toastr.error("Selezionare un valore")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title [style.width]="width">\n SELEZIONA {{label | uppercase}}\n </h2>\n <mat-dialog-content style="width:100%">\n <div [style.width]="width">\n <FHComboBox #cmb_sel [init_fill]="false"></FHComboBox>\n </div>\n </mat-dialog-content>\n\n\n <mat-dialog-actions [style.width]="width" style="text-align:center">\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),wt=function(){function t(){}return t.prototype.transform=function(t){return""+t.replace(/\n/g,"<br/>")},t.decorators=[{type:l.Pipe,args:[{name:"replaceLineBreaks"}]}],t}(),Rt=function(){function t(){this.label="",this.required=!1,this.show_buttons=!1,this.enabled=!0,this.min_date=null,this.max_date=null,this.change=new l.EventEmitter,this.myDatePickerOptions={width:"150px",dateFormat:"dd/mm/yyyy",dayLabels:{su:"Dom",mo:"Lun",tu:"Mar",we:"Mer",th:"Gio",fr:"Ven",sa:"Sab"},monthLabels:{1:"Gen",2:"Feb",3:"Mar",4:"Apr",5:"Mag",6:"Giu",7:"Lug",8:"Ago",9:"Set",10:"Ott",11:"Nov",12:"Dic"}},this.date_sel=null}return t.prototype.setFocus=function(){console.log("set focus"),this.dtc.setFocusToInputBox()},t.prototype.dt_ch=function(){var t=this;console.log("dt_ch!!"),console.log(this.dtc),setTimeout(function(){console.log(t.date_sel),t.change.emit()},50)},t.prototype.add_year=function(){this.date_sel={date:{year:this.date_sel.date.year+1,month:this.date_sel.date.month,day:this.date_sel.date.day}},this.change.emit()},t.prototype.ini_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:1,day:1}},this.change.emit()},t.prototype.fin_year=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:12,day:31}},this.change.emit()},t.prototype.getValue=function(){return null==this.date_sel?null:new Date(this.date_sel.date.year,this.date_sel.date.month-1,this.date_sel.date.day)},t.prototype.ngOnInit=function(){this.setLimits()},t.prototype.getCopyOfOptions=function(){return JSON.parse(JSON.stringify(this.myDatePickerOptions))},t.prototype.setLimits=function(){var t=this.getCopyOfOptions();null!=this.min_date&&(this.min_date.setDate(this.min_date.getDate()-1),t.disableUntil={year:this.min_date.getFullYear(),month:this.min_date.getMonth()+1,day:this.min_date.getDate()}),null!=this.max_date&&(this.max_date.setDate(this.max_date.getDate()+1),t.disableSince={year:this.max_date.getFullYear(),month:this.max_date.getMonth()+1,day:this.max_date.getDate()}),this.myDatePickerOptions=t},t.prototype.setToday=function(){this.date_sel={date:{year:(new Date).getFullYear(),month:(new Date).getMonth()+1,day:(new Date).getDate()}}},t.prototype.setValue=function(t){this.date_sel=null!=t?{date:{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}}:null},t.decorators=[{type:l.Component,args:[{selector:"DtPicker",template:'\n <div [hidden]="!show_buttons||!enabled">\n <button mat-raised-button (click)="add_year()">+1 Anno</button>\n <button mat-raised-button (click)="ini_year()">Inizio Anno</button>\n <button mat-raised-button (click)="fin_year()">Fine Anno</button>\n </div>\n\n <div class="lb_small_grigia">{{label}}</div>\n <my-date-picker (dateChanged)="dt_ch()" #appdt [options]="myDatePickerOptions" *ngIf="enabled"\n [(ngModel)]="date_sel"></my-date-picker>\n\n <div *ngIf="!enabled" class="label_dis">\n {{this.date_sel?.date.day}}/{{this.date_sel?.date.month}}/{{this.date_sel?.date.year}}\n </div>\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 "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],show_buttons:[{type:l.Input}],enabled:[{type:l.Input}],min_date:[{type:l.Input}],max_date:[{type:l.Input}],change:[{type:l.Output}],dtc:[{type:l.ViewChild,args:["appdt"]}]},t}(),At=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.ngOnInit=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 n=this;this.value_sel=new Array;for(var i=0;i<e.length;i++){var o=new Object;o.descrizione_valore=e[i],this.value_sel.push(o)}var s=new q;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){n.value_list_all=t.result_data;for(var e=0;e<n.value_sel.length;e++)for(var i=n.value_list_all.length-1;0<=i;i--)if(n.value_list_all[i].descrizione_valore==n.value_sel[e].descrizione_valore){n.value_list_all.splice(i,1);break}n.filtra()}},function(t){n.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})},t.prototype.do_add=function(){if(null!=this.selectedAdd){var t=this.value_list_all.indexOf(this.selectedAdd,0);this.single_sel||-1<t&&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);-1<t&&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.decorators=[{type:l.Component,args:[{selector:"FHPickList",template:'\n \n <div fxLayout="column" fxLayoutGap="15px" fxFlex style="width:600px;height:400px">\n <div fxLayout="row" style="width:550">\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-raised-button (click)="do_add()" [disabled]="!option">\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br><br>\n <button mat-raised-button (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-raised-button color="primary" (click)="ok()">Ok</button> \n <button mat-raised-button (click)="dialogRef.close()">Annulla</button>\n </div>\n </div>\n\n ',styles:["\n \n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:tt},{type:e.ToastrService}]},t.propDecorators={value_list:[{type:l.Input}],value_list_all:[{type:l.Input}],value_list_sel:[{type:l.Input}],single_sel:[{type:l.Input}],vis_buttons:[{type:l.Input}],limit_size:[{type:l.Input}],value_sel:[{type:l.Input}]},t}(),Nt=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.ngOnInit=function(){},t.prototype.show=function(){},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.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content>\n <mat-form-field>\n <input matInput placeholder="{{label}}" type="number" [(ngModel)]="valore" required>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button\n mat-raised-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t}(),Dt=function(){function t(t){this.platformId=t}return t.prototype.highlightAll=function(){h.isPlatformBrowser(this.platformId)&&Prism.highlightAll()},t.decorators=[{type:l.Injectable}],t.ctorParameters=function(){return[{type:Object,decorators:[{type:l.Inject,args:[l.PLATFORM_ID]}]}]},t}(),kt=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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"FHMdReader",template:'\n <markdown [src]="path_md">\n\n </markdown>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:Dt}]},t.propDecorators={path_md:[{type:l.Input}]},t}(),Tt=function(){function t(t){var i=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 e=new Date(t.value);return e.getFullYear()<1980?" ------ ":i.uti.pad(e.getDate(),2)+"/"+i.uti.pad(e.getMonth()+1,2)+"/"+e.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{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 "]}]}],t.ctorParameters=function(){return[{type:X}]},t.propDecorators={g_height:[{type:l.Input}],datagrid:[{type:l.ViewChild,args:["dtm"]}]},t}(),Mt=function(){function t(t,e){this.dialogRef=t,this.toastr=e,this.title="",this.label="",this.valore="",this.min_chars=3}return t.prototype.ngOnInit=function(){},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.decorators=[{type:l.Component,args:[{selector:"app-win_ask_text",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="width:600px">\n <mat-form-field>\n <textarea matInput placeholder="{{label}}" type="text" [(ngModel)]="valore" style="width:600px" rows="15"\n required></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="primary" (click)="do_check()">OK</button> <button\n mat-raised-button color="warn" (click)="chiudi()">ANNULLA\n </button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Pt={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return xt}),multi:!0},xt=function(){function t(){this.decimal=2,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.label_width="",this.change=new l.EventEmitter,this.innerValue=0,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.getStyle_mw=function(){return this.label_width},t.prototype.set_backcolor=function(t){this.m_color=t},t.prototype.chg=function(){var t=this;setTimeout(function(){t.value=parseFloat(t.formattedAmount.split(".").join("").split(",").join(".")),t.onChange(t.value)},50)},t.prototype.writeValue=function(t){null==t&&(t=0),this.innerValue=t,this.value=t,this.formattedAmount=this.transform(this.value,this.decimal),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(i){console.log(i)}},t.prototype.transform=function(t,e){void 0===e&&(e=2);var i=W((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHCurrencyField",providers:[Pt],template:'\n <mat-form-field [hidden]="!enabled || hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput\n [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="transformAmount($event)"\n (focus)="removeCurrencyPipeFormat($event)" (keyup)="chg()"\n pattern="[0-9]+">\n </mat-form-field>\n <mat-form-field [hidden]="enabled || hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el1 matInput [disabled]="true"\n placeholder="{{label}}" [(ngModel)]="formattedAmount"\n >\n </mat-form-field>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],label_width:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),Lt={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Ft}),multi:!0},Ft=function(){function t(){this.enabled=!0,this.value="",this.label="",this.height="360",this.change=new l.EventEmitter,this.focus=new l.EventEmitter,this.blur=new l.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.ngOnInit=function(){this.config={height:this.height},this.enabled?this.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"}]:(this.config.allowedContent=!0,this.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},t.decorators=[{type:l.Component,args:[{selector:"FHRichText",providers:[Lt],template:'\n <b *ngIf="label!=\'\'">{{label}}</b>\n <ckeditor #ced\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 "]}]}],t.ctorParameters=function(){return[]},t.propDecorators={enabled:[{type:l.Input}],value:[{type:l.Input}],label:[{type:l.Input}],height:[{type:l.Input}],change:[{type:l.Output}],focus:[{type:l.Output}],blur:[{type:l.Output}],ced:[{type:l.ViewChild,args:["ced"]}]},t}(),jt=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.ngOnInit=function(){},t.prototype.show=function(){},t.prototype.hide=function(){this.dialogRef.close(null)},t.prototype.chiudi=function(){this.dialogRef.close(null)},t.decorators=[{type:l.Component,args:[{selector:"app-win_output",template:'\n\n <h2 mat-dialog-title>{{title}}</h2>\n <mat-dialog-content style="min-width:500px">\n\n <div [innerHTML]="valore" style="width:100%">\n </div>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-raised-button color="warn" (click)="chiudi()">CHIUDI</button>\n </mat-dialog-actions>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService}]},t.propDecorators={title:[{type:l.Input}],label:[{type:l.Input}],valore:[{type:l.Input}]},t}(),Ut={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Vt}),multi:!0},Vt=function(){function t(t){this.uti_s=t,this.decimal=0,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.m_color="",this.change=new l.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.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=W((t||"").toString().split("."),2),n=i[0],o=i[1],s=void 0===o?"":o;return s=0<e?","+(s+"000000").substring(0,e):"",""==(n=n.replace(/\B(?=(\d{3})+(?!\d))/g,"."))&&(n="0"),n+s},t.prototype.removeCurrencyPipeFormat=function(t){try{this.formattedAmount=this.transform(this.value,this.decimal)}catch(e){console.log(e)}},t.prototype.setFocus=function(){this.el.nativeElement.focus()},t.prototype.ngOnInit=function(){this.required&&(this.el.nativeElement.required=this.required),this.el.nativeElement.disabled=!this.enabled,null==this.value&&(this.value=0),this.formattedAmount=this.transform(this.value,this.decimal)},t.decorators=[{type:l.Component,args:[{selector:"FHNumericField",providers:[Ut],template:'\n <mat-form-field [hidden]="hidden">\n <input type="text" style="text-align:right" [style.background-color]="getStyle()" #el matInput\n [disabled]="!enabled" placeholder="{{label}}" [(ngModel)]="formattedAmount"\n (blur)="chg()"\n (focus)="removeCurrencyPipeFormat($event)"\n pattern="[0-9]+">\n </mat-form-field>\n\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:X}]},t.propDecorators={el:[{type:l.ViewChild,args:["el"]}],decimal:[{type:l.Input}],label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],change:[{type:l.Output}],value:[{type:l.Input}]},t}(),zt=function(){function t(t,e,i){this.dialogRef=t,this.toastr=e,this.m_appService=i,this.label="",this.sql=""}return t.prototype.doFill=function(){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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"fhwincomboselect",template:'\n <h2 mat-dialog-title>\n {{label | uppercase}}\n </h2>\n <mat-dialog-content style="min-width:700px">\n <FHList #cmb_sel [label]="" style="width:100%;min-height:90px" init_fill="false"></FHList>\n\n </mat-dialog-content>\n\n\n <mat-dialog-actions>\n\n\n <button mat-raised-button color="primary" (click)="ok()">OK</button>\n <button mat-raised-button color="warn" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </mat-dialog-actions>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:e.ToastrService},{type:j}]},t.propDecorators={cmb_sel:[{type:l.ViewChild,args:["cmb_sel"]}]},t}(),Kt={provide:s.NG_VALUE_ACCESSOR,useExisting:l.forwardRef(function(){return Yt}),multi:!0},Yt=function(){function t(t,e){this.dataservice=t,this.dialog=e,this.label="",this.required=!1,this.enabled=!0,this.hidden=!1,this.multi=!1,this.change=new l.EventEmitter,this.select=new l.EventEmitter,this.userName="",this.selectedUser=[],this.all_user=null,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this.required&&(this.label=this.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.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.setByUsername=function(t){var i=this;if(t){for(var e=t.split(","),n="",o=0;o<e.length;o++)""!=n&&(n+=","),n=n+"'"+e[o]+"'";var s={sql:"SELECT_USERS_INFOS_BY_USERNAME_NOREP",types:["string"],values:[n],names:[]};this.dataservice.doQuery(s).subscribe(function(t){var e=t.result_data;null!=e?(i.selectedUser=e,i.writeValue("noop"),i.select.emit(i.selectedUser),console.log(i.selectedUser),i.userName=i.getUsersNc(),console.log(i.userName)):i.clear()})}},t.prototype.load_all_users=function(){var e=this;this.dataservice.doQuery({sql:"SELECT_ALL_USERS",types:[],values:[],names:[]}).subscribe(function(t){e.all_user=t.result_data,null==e.all_user&&(e.all_user=[]),e.open_pick()})},t.prototype.open_pick=function(){var e=this;if(null!=this.all_user){if(this.enabled){var t=this.dialog.open(ft,{disableClose:!0,width:"700px",height:"550px"});t.componentInstance.user_sel=this.selectedUser,t.componentInstance.users_list=this.all_user,t.componentInstance.single_sel=!this.multi,t.componentInstance.filtra(),t.afterClosed().subscribe(function(t){null!=t&&(null!=t&&(e.selectedUser=t,e.writeValue("noop"),e.select.emit(e.selectedUser),console.log(e.selectedUser),e.userName=e.getUsersNc(),console.log(e.userName)),e.change.emit(e.selectedUser),e.select.emit(e.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.decorators=[{type:l.Component,args:[{selector:"FHUserField",providers:[Kt],template:'\n <div fxLayout="row" [hidden]="!enabled || hidden">\n <mat-form-field style="clickable-field" (click)="open_pick()">\n\n <input matInput\n [hidden]="hidden"\n [placeholder]="label"\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">\n <input type="text" #el1 matInput [disabled]="true" placeholder="{{label}}" [(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 "]}]}],t.ctorParameters=function(){return[{type:tt},{type:i.MatDialog}]},t.propDecorators={label:[{type:l.Input}],required:[{type:l.Input}],enabled:[{type:l.Input}],hidden:[{type:l.Input}],multi:[{type:l.Input}],change:[{type:l.Output}],select:[{type:l.Output}],userName:[{type:l.Input}]},t}(),qt=function(){function t(t,e,i){this.dialogRef=t,this.m_appService=e,this.toastr=i}return t.prototype.salva_esci=function(){this.dialogRef.close("salva_esci")},t.prototype.esci_senza_salv=function(){this.dialogRef.close("esci_senza_salv")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="salva_esci()">SALVA ED ESCI</button> \n <button mat-raised-button color="warn" (click)="esci_senza_salv()">ESCI SENZA SALVATAGGIO</button>\n\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t}(),Gt=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,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);this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)")}return t.prototype.ok=function(){if(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.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n </div>\n <br *ngIf="!comm_notrequired"><br *ngIf="!comm_notrequired"><br *ngIf="!comm_notrequired">\n <mat-form-field [hidden]="comm_notrequired">\n <textarea matInput placeholder="Commento {{nota_commento}}" [(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-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Bt=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,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,this.comm_notrequired&&(this.nota_commento=" (COMMENTO NON OBBLIGATORIO)"),this.mobile=this.m_appService.getState().pageFullscreen}return t.prototype.ok=function(){this.comm_notrequired||""!=this.nota?this.dialogRef.close(this.nota):this.toastr.error("ERRORE","INSERIRE IL COMMENTO",{timeOut:1e3,progressBar:!0})},t.prototype.annulla=function(){this.dialogRef.close("abort")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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">\n <div *ngIf="mobile" style="font-size:10px">Assegnata a: {{utenti}}</div>\n <h3 *ngIf="!mobile">Assegnata a: {{utenti}}</h3>\n <br>\n <mat-form-field [hidden]="comm_notrequired">\n <textarea matInput placeholder="Commento {{nota_commento}}" [(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-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t}(),Ht=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.ok=function(){"-1"!=this.selval?this.dialogRef.close(this.selval):this.toastr.error("ERRORE","SELEZIONARE AMBITO",{timeOut:1e3,progressBar:!0})},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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-select placeholder="Seleziona Ambito:" #cmb [(ngModel)]="selval" style="width:100%">\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\n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">OK</button>\n </div>\n <p style="color:#CC0000;font-size:9px;" *ngIf="errorMsg != \'\'">{{errorMsg}}</p>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Wt=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.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar style="max-width:500px">SELEZIONA PROSSIMO STEP:\n\n </mat-toolbar>\n <mat-dialog-content style="max-width:500px"><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Prossimo Step:" #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\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="ok()">{{OK_BUTTON}}</button>\n <button mat-raised-button (click)="this.dialogRef.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 '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),Xt=function(){function t(t,e,i,n,o){var s=this;this.dialogRef=t,this._dataService=e,this.toastr=i,this.dialog=n,this.app_s=o,this.enabled=!0,this.change=new l.EventEmitter,this.App="",this.K="",this.b_edit_loaded=!1,this.title="ALLEGATI",this.b_ini=!1,this.single=!0,this.descrizione="",this.label="Descrizione Allegato",this.username="",this.uploader=new u.FileUploader({url:this.app_s.API_ENDPOINT+this.app_s.UPLOAD_ENDPOINT}),this.username=localStorage.getItem(this.app_s.COMPANY_KEY+"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","ALLEGATO INSERITO",{timeOut:1e3,progressBar:!0}),s.ref_allegato(),s.change.emit())}}return t.prototype.download_all=function(t){null!=t.App&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.App+"/"+t.K+"/"+t.Filename),null!=t.APP&&window.open(this.app_s.COMPANY_SITE_ROOT+"/uploads/"+t.APP+"/"+t.K+"/"+t.Filename)},t.prototype["delete"]=function(i){var n=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(ot).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="DELETE_ALLEGATO",e.types=["int","string"],e.values=[i.id,localStorage.getItem(n.app_s.COMPANY_KEY+"user")],n._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(n.arr_g=t.result_data,n.ref_allegato(),n.toastr.info("INFO","ALLEGATO ELIMINATO",{timeOut:1e3,progressBar:!0}))})}})},t.prototype.ch=function(){var i=this;this.uploader.onBuildItemForm=function(t,e){e.append("App",i.App),e.append("K",i.K),e.append("descrizione",i.descrizione),e.append("single",i.single),e.append("username",i.username),e.append("tipo",""),e.append("local_path",i.app_s.LOCAL_PATH)};var t={};t.headers=[{name:"Authorization",value:"Bearer "+localStorage.getItem(this.app_s.COMPANY_KEY+"token")}],this.uploader.setOptions(t),this.uploader.uploadAll()},t.prototype.ref_allegato=function(){var o=this;if(null!=this.App&&""!=this.App){var t=new q;t.sql="SELECT_ALLEGATO_INFO",t.types=["string","string"],t.values=[this.App,this.K],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){o.arr_g=t.result_data;for(var e="default",i=0;i<o.arr_g.length;i++){var n=o.arr_g[i].Filename.split(".");-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(n[n.length-1].toLocaleUpperCase())&&(e=n[n.length-1].toLocaleLowerCase()),o.arr_g[i].icon=e+".svg"}}})}},t.prototype.ngOnInit=function(){this.App=this.app_s.getState().wkf_doc_info.uiid_app,this.K=this.app_s.getState().wkf_doc_info.uiid_doc,this.single=!1,this.init(this.App,this.K),this.ref_allegato()},t.prototype.init=function(t,e){this.App=t,this.K=e,this.b_ini=!0,this.b_edit_loaded=!1,this.ref_allegato()},t.decorators=[{type:l.Component,args:[{selector:"wkf_win_upload",template:'\n <mat-toolbar color="primary">{{title}}\n <div style="width:100%;text-align: right;">\n </div>\n\n </mat-toolbar>\n <div mat-dialog-content style="min-width:800px">\n <br>\n <div *ngIf="enabled">\n\n <input matInput type="text" name="descrizione" [(ngModel)]="descrizione" placeholder="{{label}}">\n\n\n <input type="file" ng2FileSelect [uploader]="uploader" multiple (change)="ch()"/>\n \x3c!--<button mat-raised-button *ngIf="b_edit_loaded" (click)="download_all()">{{label_b}}</button>--\x3e\n </div>\n <br>\n\n\n <br>\n\n <table style="width: 100%;" class="fh_table">\n <thead>\n <tr>\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:50%">Descrizione</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;index as i" [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>{{app.descrizione}}</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>save_alt</mat-icon>\n </button>\n </td>\n\n <td style="text-align:center"><a mat-icon-button *ngIf="enabled" (click)="delete(app)">\n <mat-icon>delete</mat-icon>\n </a></td>\n </tr>\n </table>\n\n\n </div>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'Option 1\')">CHIUDI</button>\n </div>\n <div *ngIf="!b_ini" style="color:#ff0000"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n\n ',styles:["\n\n \n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:tt},{type:e.ToastrService},{type:i.MatDialog},{type:j}]},t.propDecorators={enabled:[{type:l.Input}],change:[{type:l.Output}],upc:[{type:l.ViewChild,args:["upc"]}],single:[{type:l.Input}]},t}(),Qt=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.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.user_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.annulla=function(){this.dialogRef.close(null)},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px">\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-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),Jt=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,i){var n=this;void 0===i&&(i=!0);var e=!1;if(null==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")?localStorage.removeItem(this.app_s.COMPANY_KEY+"dev_mode"):"1"!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")?localStorage.removeItem(this.app_s.COMPANY_KEY+"dev_mode"):null!=localStorage.getItem(this.app_s.COMPANY_KEY+"dev_mode")&&"1"==localStorage.getItem(this.app_s.COMPANY_KEY+"dev_mode")&&(e=!0),e){var o="";o=null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")?localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori"):localStorage.getItem(this.app_s.COMPANY_KEY+"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]=o),"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]=o)}this.headers=new p.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 s=JSON.stringify(t);return this.http.post(this.url,s,{headers:this.headers}).pipe(r.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 U}),r.catchError(function(t){var e=t.message?t.message:t.status?t.status+" - "+t.statusText:"Server error";throw console.error(e),t}))},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.HttpClient},{type:j},{type:e.ToastrService}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(p.HttpClient),l.inject(j),l.inject(e.ToastrService))},token:t,providedIn:"root"}),t}(),Zt=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=!1,this.edit_id=0,this.lettori="",this.subject="",this.link="",this.codice_doc="",this.refresh_list()}return 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 n=this,t=new q;t.sql="SELECT_COMMENTI_DOCUMENTO",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){n.commenti_list=t.result_data;for(var i=0;i<n.commenti_list.length;i++)n.commenti_list[i].v_commento="<b>"+n.commenti_list[i].commento.replace(/\n/g,"<br/>")+"</b>";e=!0}e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},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 n=this,t=new q;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(Qt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},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 q;c.sql="send_wkf_mail",c.values=[t,e,i,n,o,s,r,a,l,u],this.m_wkf.doQuery(c).subscribe(function(t){})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new q).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.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(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new q).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.title="COMMENTI"},t.prototype.ngOnInit=function(){},t.prototype.ins=function(){this.nota="",this.b_edit=!0,this.b_ins=!0,this.title="INSERISCI COMMENTO"},t.decorators=[{type:l.Component,args:[{template:'\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">\n\n <mat-form-field *ngIf="b_edit" >\n <textarea matInput placeholder="Commento"[(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n \n\n <div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="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 </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.v_data_creazione}}</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 </section>\n\n </div>\n <br>\n\n <div style="width:100%;text-align:center;">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n\n\n ',styles:["\n\n \n\n "]}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:i.MatDialog},{type:j},{type:e.ToastrService},{type:tt},{type:Jt}]},t}(),$t=function(){function t(t,e){this.dialogRef=t,this.m_appService=e,this.hide_richiedente=!1,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}return t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\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>\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">\n\n <td>Uiid App:</td>\n <td><b>{{uiid_app}}</b></td>\n\n </tr>\n <tr class="odd">\n\n <td>Uiid Doc:</td>\n <td><b>{{uiid_doc}}</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-raised-button color="accent" (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j}]},t}(),te=function(){function t(t,e,i,n,o,s,r){this.appService=t,this.dialogRef=e,this.m_dialogRef=i,this.m_appService=n,this.toastr=o,this._dataService=s,this.m_wkf=r,this.ossv=!1,this.b_flussook=!0,this.logs=new Array,this.title="LOG WORKFLOW E COMMENTI",this.nota="",this.b_edit=!1,this.b_ins=!1,this.edit_id=0,this.lettori="",this.not_int=!0,this.subject="",this.link="",this.codice_doc=""}return t.prototype.ric_all=function(){this.refresh_list()},t.prototype.load_graph=function(){var n=this;console.log("load_graph");var t=new q;t.sql="SELECT_WKF_BY_ID",t.types=["string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app],this._dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){if(console.log("data.result_data[0].diagramma_flusso ",t.result_data[0].diagramma_flusso),0<t.result_data.length&&null!=t.result_data[0].diagramma_flusso&&""!=t.result_data[0].diagramma_flusso){for(var e=!1,i=0;i<n.logs.length;i++)-1==n.logs[i].id_comment&&(null!=n.logs[i].liv_ini&&(t.result_data[0].diagramma_flusso=t.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+n.logs[i].liv_ini+'"').join('bpmnElement="STEP_'+n.logs[i].liv_ini+'" bioc:stroke="#43A047" bioc:fill="#C8E6C9"')),e||null!=n.logs[i].liv_fin&&(t.result_data[0].diagramma_flusso=t.result_data[0].diagramma_flusso.split('bpmnElement="STEP_'+n.logs[i].liv_fin+'"').join('bpmnElement="STEP_'+n.logs[i].liv_fin+'" bioc:stroke="#FB8C00" bioc:fill="#FFE0B2"'),console.log("this.logs[i].liv_fin ",n.logs[i].liv_fin),e=!0));return n.b_flussook=!0,void n.modeler.importXML(t.result_data[0].diagramma_flusso,function(t){(console.log("err",t),t)?console.log("something went wrong:",t):(console.log("success!"),n.modeler.get("canvas").zoom("fit-viewport",{x:0,y:0}))})}n.b_flussook=!1}})},t.prototype.annulla=function(){this.nota="",this.b_edit=!1,this.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.ngOnInit=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 i=this,t=new q;t.sql="SELECT_WORKFLOW_LOG",t.types=["string","string"],t.values=[this.m_appService.getState().wkf_doc_info.uiid_app,this.m_appService.getState().wkf_doc_info.uiid_doc],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.logs=t.result_data,i.ossv||(i.modeler=new w({container:"#canvas",width:"97%",height:i.appService.getState().body_height2,readonly:!0})),i.load_graph(),e=i.ossv=!0),e||i.toastr.error("ERRORE",t.msg)},function(t){i.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},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 n=this,t=new q;t.sql="SELECT_USERS_INFOS_BY_USERNAME_NOREP",t.types=["string"],t.values=["'"+this.lettori.split(",").join("','")+"'"],this._dataService.doQuery(t).subscribe(function(t){var e=n.m_dialogRef.open(Qt,{disableClose:!0});e.componentInstance.init_arr(t.result_data),e.afterClosed().subscribe(function(t){if(null!=t){for(var e="",i=0;i<t.arrsel.length;i++)""!=e&&(e+=","),e+=t.arrsel[i].username;n.ok_op(e)}})},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){var c=this;void 0===p&&(p=!0),void 0===u&&(u="");var d=new q;d.sql="send_wkf_mail",d.values=[t,e,i,n,o,s,r,a,l,u],this.m_wkf.doQuery(d).subscribe(function(t){},function(t){c.toastr.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.ok_op=function(i){var t,n=this;(void 0===i&&(i=""),this.b_ins)?((t=new q).sql="INSERT_WKF_COMMENTO",t.types=["string","string","string","string"],t.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(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO INSERITO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato inserito un commento"),"<br><br>Commento inserito: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})):((t=new q).sql="UPDATE_WKF_COMMENTO",t.types=["string","string","string","string"],t.values=[this.nota,this.edit_id],this._dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(n.toastr.info("INFO","COMMENTO AGGIORNATO",{timeOut:1e3,progressBar:!0}),e=!0,n.b_edit=!1,""!=i&&n.sendEMail_ex(n.m_appService.getState().wkf_doc_info.curr_user,i,n.subject.split("<OP>").join("E' stato modificato un commento"),"<br><br>Commento modificato: <br>"+n.nota.split("\n").join("<br>"),n.m_appService.getState().wkf_doc_info.uiid_app,n.m_appService.getState().wkf_doc_info.uiid_doc,n.link,n.codice_doc,""),n.refresh_list()),e||n.toastr.error("ERRORE",t.msg)},function(t){n.toastr.error("ERRORE","ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}))},t.decorators=[{type:l.Component,args:[{template:'\n <mat-tab-group #zz style="min-width:950px"\n [style.height]="m_appService.getState().body_height">\n <mat-tab label="DIAGRAMMA" style="width:100%;height:100%" [hidden]="!b_flussook">\n\n <div style="width:100%;height:100%" id="canvas"></div>\n\n\n </mat-tab>\n\n <mat-tab label="LOGS">\n <mat-toolbar color="primary">{{title}}\n <div style="width:100%;text-align: right;">\n\n </div>\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>\n <section class="bs" *ngIf="b_edit">\n <br>\n <mat-form-field *ngIf="b_edit">\n <textarea matInput placeholder="Commento" [(ngModel)]="nota" rows="12"></textarea>\n </mat-form-field>\n\n <div *ngIf="b_edit">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button> \n <mat-checkbox [(ngModel)]="not_int" [hidden]="lettori===\'\'">\n Notifica Interessati\n </mat-checkbox>\n </div>\n <br><br>\n </section>\n <table *ngIf="!b_edit" class="fh_table">\n\n <thead>\n <tr>\n <th width="15%">Data</th>\n <th width="15%">Utente</th>\n <th>Operazione</th>\n\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.v_data_creazione}}</td>\n <td>{{app.nc}}</td>\n <td>{{app.operazione}}</td>\n\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 </div>\n <br>\n </mat-tab>\n </mat-tab-group>\n <div style="width:100%;text-align:center;" *ngIf="!b_edit">\n <button mat-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n ',styles:["\n\n\n "]}]}],t.ctorParameters=function(){return[{type:j},{type:i.MatDialogRef},{type:i.MatDialog},{type:j},{type:e.ToastrService},{type:tt},{type:Jt}]},t.propDecorators={zz:[{type:l.ViewChild,args:["zz"]}]},t}(),ee=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.edit=function(t){var e=this,i=new q;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.decorators=[{type:l.Component,args:[{template:'\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-raised-button (click)="dialogRef.close(\'\')">CHIUDI</button>\n\n </div>\n\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={datagrid:[{type:l.ViewChild,args:["dtm"]}]},t}(),ie=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.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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n\n </mat-toolbar>\n <mat-dialog-content><br><br>\n <mat-select style="width:100%" placeholder="Seleziona Step:" #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\n\n <br><br><br><br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()">{{OK_BUTTON}}</button> \n <button mat-raised-button color="warn" (click)="this.dialogRef.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 '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService}]},t.propDecorators={smtr:[{type:l.ViewChild,args:["cmb"]}]},t}(),ne=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.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.annulla=function(){this.dialogRef.close("")},t.prototype.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{template:'\n <mat-toolbar>{{title}}\n </mat-toolbar>\n\n <div mat-dialog-content style="min-width:700px">\n\n <div style="height:370px;">\n <FHPickUsers #up [users_list]="arrAutori" [vis_buttons]="false"></FHPickUsers>\n </div>\n <br><br><br>\n\n <mat-form-field>\n <textarea matInput placeholder="Commento {{nota_commento}}" [hidden]="commento_hidden" [(ngModel)]="nota"\n rows="6"></textarea>\n\n </mat-form-field>\n\n \n\n </div>\n <br>\n <div style="width:100%;text-align:center;">\n <button mat-raised-button color="primary" (click)="ok()"> OK</button> \n <button mat-raised-button color="warn" (click)="annulla()">ANNULLA</button>\n </div>\n\n '}]}],t.ctorParameters=function(){return[{type:i.MatDialogRef},{type:j},{type:e.ToastrService},{type:tt}]},t.propDecorators={up:[{type:l.ViewChild,args:["up"]}]},t}(),oe=function(){function t(t,e,i,n){this.dataService=t,this.fileService=e,this.toastr=i,this.utility=n}return t.prototype.runCommands=function(t,a){for(var l=this,p=this.utility.newGuid(),e="",i=0;i<t.length;i++)""!=e&&(e+=";;;"),e=e+(t[i].id||p)+";;;"+t[i].op+";;;"+(t[i].v1||" ")+";;;"+(t[i].v2||" ")+";;;"+t[i].ord;var n=new q;return n.sql="INSERT_CMD_STAMPA_MULTI",n.types=["string","string","string","string","int"],n.values=[e],this.dataService.doQuery(n).pipe(r.flatMap(function(t){if(null!=t&&"OK"==t.result_msg){var e=new G;return e.command="wg_create",e.p1=p,l.fileService.doQuery(e).pipe(r.flatMap(function(t){if(null!=t&&"OK"==t.result_msg)return new o.Observable(function(i){var n=l,o=!1,s=(setTimeout(function(){o=!0},a.timeout||18e4),0);!function r(){var t=new G;t.command="wg_getlog";t.p1=p;t.p2=s.toString();n.fileService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data[0];s+=e.chunk.length,i.next(e),e.done?i.complete():o?(console.log("Timeout"),i.error("Timeout"),n.toastr.error("Timeout")):setTimeout(function(){r()},a.checkInterval||3e3)}else console.error(t),i.error(t),i.complete()})}()})}))}}))},t.prototype.send_file_to_user=function(t,e,i){var n=this;void 0===i&&(i="errore nella creazione del file");var o=new G;o.p1=t,o.command="check_file",this.fileService.doQuery(o).subscribe(function(t){null!=t&&("N"!=t.msg?window.open(e):null!=i&&""!=i&&n.toastr.error(i))})},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:tt},{type:z},{type:e.ToastrService},{type:X}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(tt),l.inject(z),l.inject(e.ToastrService),l.inject(X))},token:t,providedIn:"root"}),t}(),se=function(){function t(){this.result_data=new Array}return t.decorators=[{type:l.Component,args:[{template:" "}]}],t}(),re=function(){function t(t,e,i,n){this.ngf=t,this.cache=e,this.uti=i,this.app=n,this.ngf.name="Fluxhub_"+this.app.COMPANY_KEY,this.ngf.driver=[R.Driver.INDEXED_DB,R.Driver.LOCAL_STORAGE]}return t.prototype.read=function(t,e){var i=this;return void 0===e&&(e=!0),this.ngf.getItem(t).then(function(t){return null==t?null:e?JSON.parse(i.uti.decrypt_v2(t)):JSON.parse(""+t)})},t.prototype.list_keys=function(){this.ngf.keys().then(function(t){})},t.prototype.write=function(t,e,i){void 0===i&&(i=!0),i?this.ngf.setItem(t,this.uti.encrypt_v2(JSON.stringify(e))).then(function(t){}):this.ngf.setItem(t,JSON.stringify(e))},t.prototype["delete"]=function(t){this.ngf.removeItem(t)},t.decorators=[{type:l.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:R.NgForage},{type:R.NgForageCache},{type:X},{type:j}]},t.ngInjectableDef=l.defineInjectable({factory:function(){return new t(l.inject(R.NgForage),l.inject(R.NgForageCache),l.inject(X),l.inject(j))},token:t,providedIn:"root"}),t}(),ae=function(){function t(t,e,i,n,o,s,r){var a=this;this.localstore=t,this.uti_s=e,this._toast=i,this._dataService=n,this.m_appService=o,this.slimLoadingBarService=s,this.m_dialog=r,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=!0,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 l.EventEmitter,this.cell_edited=new l.EventEmitter,this.clicked=new l.EventEmitter,this.dclicked=new l.EventEmitter,this.columndclicked=new l.EventEmitter,this.cell_clicked=new l.EventEmitter,this.b_ensure=!1,this.curr_config="-1",this.init_end=new l.EventEmitter,this.off_set=0,this.first_ref=!0,this.b_restored=!1,this.str_curr_q_p="",this.gridOptions={debug:!1,headerHeight:this.header_h,floatingFilter:!0,enableRangeSelection:!0,enableServerSideSorting:!1,enableServerSideFilter:!1,enableColResize:!0,enableSorting:!0,rowSelection:"multiple",rowDeselection:!1,getContextMenuItems:function(){return a.getContextMenuItems()},allowContextMenuWithControlKey:!0,rowModelType:"inMemory",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 s=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(ot,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[s.gf.getDescri(),s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo()),s.errorMsg=t.msg},function(t){s.errorMsg="ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI"})}})},t.prototype.getGridApi=function(){return this.gridOptions.api},t.prototype.insert_config=function(){var s=this;this.win_opt=this.m_dialog.open(ct,{disableClose:!0}),this.win_opt.componentInstance.title="Salva Configurazione",this.win_opt.componentInstance.label="Nome",this.win_opt.afterClosed().subscribe(function(t){if(t&&null!=t){var e=new q;e.sql="INSERT_UPDATE_CFG_GRID";var i="",n="",o="";null!=localStorage.getItem(s.grid_key+"_COLS")&&(i=localStorage.getItem(s.grid_key+"_COLS")),null!=localStorage.getItem(s.grid_key+"_SORT")&&(n=localStorage.getItem(s.grid_key+"_SORT")),null!=localStorage.getItem(s.grid_key+"_FILTER")&&(o=localStorage.getItem(s.grid_key+"_FILTER")),e.types=["string","string","string","string","string","string"],e.values=[t,s.grid_key,i,n,o,localStorage.getItem(s.m_appService.COMPANY_KEY+"user")],s._dataService.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(s._toast.info("Configurazione salvata"),e=!0,s.gf.types=["string"],s.gf.values=[s.grid_key],s.gf.fillCombo()),e||(s.errorMsg=t.msg)},function(t){s.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")),console.log(e),e},t.prototype.onBtExport=function(){var i=this,t={skipHeader:!1,columnGroups:!1,skipFooters:!0,skipGroups:!0,skipPinnedTop:!0,skipPinnedBottom:!0,allColumns:!0,onlySelected:!1,suppressQuotes:!1,processCellCallback:function(t){if(t.value){if(null==t.value)return"";if("function"==typeof t.value.getMonth)return i.uti_s.pad(t.value.getDate(),2)+"/"+i.uti_s.pad(t.value.getMonth()+1,2)+"/"+t.value.getFullYear();if(24==t.value.length&&-1<t.value.indexOf(":00.000Z")){var e=new Date(t.value);return i.uti_s.pad(e.getDate(),2)+"/"+i.uti_s.pad(e.getMonth()+1,2)+"/"+e.getFullYear()+" "+i.uti_s.pad(e.getHours(),2)+":"+i.uti_s.pad(e.getMinutes(),2)}return t.value}}};this.gridOptions.api.exportDataAsExcel(t)},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.ngOnInit=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(ut,{disableClose:!0}).afterClosed().subscribe(function(t){})},t.prototype.autoSizeAll=function(){var e=[];this.columnDefs.forEach(function(t){e.push(t.field)}),this.gridOptions.columnApi.autoSizeColumns(e,null),this.save_cfg()},t.prototype.fitSizeAll=function(){this.gridOptions.api.sizeColumnsToFit(),this.save_cfg()},t.prototype.selectCount=function(){var e=0;return this.gridOptions.api.forEachNode(function(t){t.isSelected()&&e++}),e},t.prototype.getquerySelected=function(e,t){var i="";return"String"==t&&this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i=i+"'"+t.data[e]+"'")}),"Number"==t&&(console.log("CERCO SEL"),this.gridOptions.api.forEachNode(function(t){t.isSelected()&&null!=t.data[e]&&(""!=i&&(i+=","),i+=t.data[e])})),i},t.prototype.selectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!0)})},t.prototype.deselectAllFiltered=function(){var e=this;this.gridOptions.api.forEachNode(function(t){e.gridOptions.api.selectNode(t,!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"))try{this.gridOptions.columnApi.setColumnState(JSON.parse(localStorage.getItem(this.grid_key+"_COLS")),null)}catch(i){console.log(i)}try{this.gridOptions.api.setSortModel(null)}catch(i){console.log(i)}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(i){console.log(i)}try{this.gridOptions.api.setFilterModel(null)}catch(i){console.log(i)}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(i){console.log(i)}},t.prototype.getRows=function(){return this.gridOptions.rowData},t.prototype.setRows=function(){var e=this;this.localstore.read(this.m_appService.COMPANY_KEY+this.tbl_name).then(function(t){e.rowData=t})},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){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.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++)2<t[i].length?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.decorators=[{type:l.Component,args:[{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 \n </td>\n <td style="vertical-align:\'bottom\'"> <mat-form-field>\n <input matInput [placeholder]="trova_label" (keydown)="keyDownFunctioncl($event)" [(ngModel)]="ric_libera"\n style="width:200px">\n </mat-form-field> \n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> <button\n *ngIf="show_pulisci_filtri" mat-raised-button (click)="pulisci_filtri()" color="warn">\n <mat-icon>clear</mat-icon> REMOVE FILTER\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> \n <button mat-raised-button (click)="autoSizeAll()" color="accent">\n <mat-icon>photo_size_select_small</mat-icon> AUTO SIZE\n </button>\n </td>\n <td [hidden]=\'this.m_appService.getState().pageFullscreen\'\n *ngIf="show_buttons && !this.m_appService.getState( ).mobile"> \n <button mat-raised-button (click)="fitSizeAll()" color="accent">\n <mat-icon>aspect_ratio</mat-icon> 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" enableColResize enableColResize\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 "]}]}],t.ctorParameters=function(){return[{type:re},{type:X},{type:e.ToastrService},{type:tt},{type:j},{type:c.SlimLoadingBarService},{type:i.MatDialog}]},t.propDecorators={tbl_name:[{type:l.Input}],columnDefs:[{type:l.Input}],count_tbl_name:[{type:l.Input}],num_per_pag:[{type:l.Input}],grid_key:[{type:l.Input}],sort_field:[{type:l.Input}],fields:[{type:l.Input}],filters:[{type:l.Input}],auto_height:[{type:l.Input}],abilita_export:[{type:l.Input}],enabled_pag:[{type:l.Input}],show_help:[{type:l.Input}],show_num_elem:[{type:l.Input}],system_dest:[{type:l.Input}],header_h:[{type:l.Input}],g_width:[{type:l.Input}],g_height:[{type:l.Input}],init_fill:[{type:l.Input}],label_elementi:[{type:l.Input}],trova_label:[{type:l.Input}],mantieni_impostazioni:[{type:l.Input}],show_buttons:[{type:l.Input}],fill_end:[{type:l.Output}],cell_edited:[{type:l.Output}],clicked:[{type:l.Output}],dclicked:[{type:l.Output}],columndclicked:[{type:l.Output}],cell_clicked:[{type:l.Output}],gf:[{type:l.ViewChild,args:["gf"]}],toggle_mantieni:[{type:l.ViewChild,args:["toggle_mantieni"]}],init_end:[{type:l.Output}],off_set:[{type:l.Input}],testom:[{type:l.ViewChild,args:["testom",{read:l.ViewContainerRef}]}],myModalNormal:[{type:l.ViewChild,args:["myModalNormal",{read:l.ViewContainerRef}]}]},t}(),le=function(){function t(){this.type="NONE",this.toolbar_wkfapp=null,this.custom_commands=[],this.command=new l.EventEmitter}return 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.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"})},t.decorators=[{type:l.Component,args:[{selector:"FHGridToolBar",template:'\n <div *ngIf="type==\'WKF\'" fxLayoutGap="3px" fxLayout="row" fxFlex="100" fxLayoutAlign="end center" style="background-color: #CC0000">\n \n <mat-toolbar>\n <div fxLayout="row" fxLayoutGap="3px">\n\n <button mat-raised-button (click)="insert_doc()" *ngIf="toolbar_wkfapp?.is_Ins" color="primary"><mat-icon>note_add</mat-icon> {{\'INSERISCI\' | translate}}</button> \n\n <button mat-raised-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)="test_utente()" *ngIf="toolbar_wkfapp?.is_Admin"> {{\'TEST UTENTE\' | translate}} </button>\n\n </mat-menu>\n <button mat-raised-button (click)="annulla_imp()" *ngIf="toolbar_wkfapp?.imp!=\'\'"> {{toolbar_wkfapp?.imp}} </button>\n <div *ngFor="let app of custom_commands" ><button mat-raised-button [color]="app.color" (click)="exec_command(app.command)">{{app.label | translate}}</button>\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">\n\n <button mat-raised-button (click)="new_doc()" color="primary">\n <mat-icon>note_add</mat-icon> {{\'INSERISCI\' | translate}}\n </button>\n\n <button mat-raised-button (click)="del_doc()" color="warn">\n <mat-icon>delete</mat-icon> {{\'ELIMINA\' | translate}}\n </button>\n <div *ngFor="let app of custom_commands" ><button mat-raised-button [color]="app.color" (click)="exec_command(app.command)">{{app.label | translate}}</button>\n </div>\n </div>\n </mat-toolbar>\n </div>\n <div *ngIf="type==\'CUSTOM\'" fxLayoutGap="3px" fxLayout="row">\n \n <div *ngFor="let app of custom_commands" ><button mat-raised-button [color]="app.color" (click)="exec_command(app.command)">{{app.label | translate}}</button>\n </div>\n </div>\n \n ',styles:["\n\n "]}]}],t.propDecorators={type:[{type:l.Input}],toolbar_wkfapp:[{type:l.Input}],custom_commands:[{type:l.Input}],command:[{type:l.Output}]},t}(),pe=function(){function t(t){this.m_appService=t,this.dt_agg=null,this.edit_button=!1,this.respingi_button=!1}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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{selector:"wkf_header_bar",template:'\n\n<div fxLayout="row" fxLayoutGap="3px" >\n<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="3px" *ngIf="!m_appService.getState().pageFullscreen || edit_button || respingi_button">\n\n<button mat-raised-button (click)="back()" *ngIf="!m_appService.getState().pageFullscreen">Indietro</button>\n <button mat-raised-button (click)="evt_salv()" *ngIf="edit_button && !m_appService.getState().pageFullscreen" color="primary" >Salva</button>\n <button mat-raised-button (click)="procedi()" *ngIf="edit_button" color="accent" >Procedi</button>\n <button mat-raised-button (click)="respingi()" *ngIf="respingi_button" color="warn" >Respingi</button>\n\x3c!-- <button mat-raised-button (click)="doEnd(900)" color="warn" >test</button> \n--\x3e\n\n</div>\n \n<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="3px" >\n\n\n<button mat-raised-button (click)="open_info()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>info_outline</mat-icon> Info Doc</button>\n<button mat-raised-button (click)="open_commenti()"> <mat-icon>insert_comment</mat-icon> Commenti {{dt_agg?.comm_c}}</button>\n<button mat-raised-button (click)="open_upload()"> <mat-icon>attach_file</mat-icon> Allegati {{dt_agg?.all_c}}</button>\n<button mat-raised-button (click)="open_wkf()" *ngIf="!m_appService.getState().pageFullscreen"> <mat-icon>transfer_within_a_station</mat-icon> Workflow</button>\n\n</div>\n</div>\n\n '}]}],t.ctorParameters=function(){return[{type:j}]},t.propDecorators={dt_agg:[{type:l.Input}],edit_button:[{type:l.Input}],respingi_button:[{type:l.Input}]},t}(),ue=function(){function t(t,e,i){this.fhutility=t,this._dialog=e,this.dragula=i,this.change=new l.EventEmitter,this.items=[],this.edit_obj=null,this.radio_values=""}return t.prototype.add_component=function(t){console.log(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(i){var n=this,t=this._dialog.open(ot,{disableClose:!0});t.componentInstance.title="Confirm",t.componentInstance.msg="Remove Element?",t.afterClosed().subscribe(function(t){if(t)for(var e=0;e<n.items.length;e++)n.items[e].uiid==i&&(n.items.splice(e,1),n.change.emit(),n.edit_obj=null)})},t.prototype.ngOnInit=function(){var e=this;try{this.dragula.createGroup("bag-items",{revertOnSpill:!0})}catch(t){console.log(t)}this.dragula.drag.call(function(t){console.log("Dragging the "+t[1].innerText+"!"),e.change.emit(),e.edit_obj=null}),this.dragula.drop.call(function(t){console.log("Dropped the "+t[1].innerText+"!"),e.change.emit(),e.edit_obj=null})},t.decorators=[{type:l.Component,args:[{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> <span>Text Field</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(2)">\n <mat-icon>filter_1</mat-icon> <span>Number</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(3)">\n <mat-icon>filter_none</mat-icon> <span>Text Area</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(4)">\n <mat-icon>check_box</mat-icon> <span>Check Box</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(5)">\n <mat-icon>radio_button_checked</mat-icon> <span>Radio</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(6)">\n <mat-icon>dehaze</mat-icon> <span>Select</span>\n </mat-toolbar-row>\n <mat-toolbar-row (click)="add_component(7)">\n <mat-icon>today</mat-icon> <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" >\n <input matInput [placeholder]="item.label" [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" >\n <input matInput [placeholder]="item.label" [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" >\n <mat-select [required]="item.required" [placeholder]="item.label" [(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> \n </div>\n\n </div></div>\n <div fxLayout="column" style="width:70px" fxLayoutGap="10px">\n <button mat-raised-button (click)="edit_item(item.uiid)" color="primary"><mat-icon>edit</mat-icon></button>\n <button mat-raised-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>\n <input matInput placeholder="Label" 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\'">\n <input matInput placeholder="Decimal Places" type="text" [(ngModel)]="edit_obj.decimali">\n </mat-form-field>\n <mat-form-field *ngIf="edit_obj.type==\'text_field\'">\n <input matInput placeholder="Default Value" 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\'">\n <input matInput placeholder="Values" 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\'">\n <input matInput placeholder="Default Value" type="text" [(ngModel)]="edit_obj.default_value" >\n </mat-form-field>\n\n <button mat-raised-button (click)="ok_panel()" color="primary">OK</button>\n </div></mat-card-content>\n </mat-card>\n </div>\n </div>\n ',styles:["\n\n "]}]}],t.ctorParameters=function(){return[{type:X},{type:i.MatDialog},{type:A.DragulaService}]},t.propDecorators={change:[{type:l.Output}],bottoml:[{type:l.ViewChild,args:["bottoml"]}]},t}(),ce=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.ngOnInit=function(){},t.decorators=[{type:l.Component,args:[{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" >\n <input matInput [placeholder]="item.label" [required]="item.required" [disabled]="!enabled" 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" >\n <input matInput [placeholder]="item.label" [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> \n <label *ngIf="item.required">{{item.label}}: *</label> \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> </mat-radio-button>\n </mat-radio-group>\n </section>\n\n <mat-form-field *ngIf="item.type==\'select\'">\n <mat-select [required]="item.required" [placeholder]="item.label" [(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> \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 "]}]}],t.ctorParameters=function(){return[{type:X},{type:i.MatDialog},{type:e.ToastrService}]},t.propDecorators={items:[{type:l.Input}],enabled:[{type:l.Input}],bottoml:[{type:l.ViewChild,args:["bottoml"]}]},t}(),de=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[j,R.NgForage,tt,K,z,V,Jt,pt,st,X,re,oe]}},t.forChilds=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:l.NgModule,args:[{imports:[L.TranslateModule,x.CdkTableModule,i.MatAutocompleteModule,i.MatDialogModule,i.MatButtonModule,i.MatButtonToggleModule,i.MatCardModule,i.MatCheckboxModule,i.MatChipsModule,i.MatDatepickerModule,i.MatDialogModule,i.MatExpansionModule,i.MatFormFieldModule,i.MatGridListModule,i.MatIconModule,i.MatInputModule,i.MatListModule,i.MatMenuModule,i.MatProgressBarModule,i.MatProgressSpinnerModule,i.MatRadioModule,i.MatSelectModule,i.MatSlideToggleModule,i.MatSliderModule,i.MatSidenavModule,i.MatSnackBarModule,i.MatStepperModule,i.MatTabsModule,i.MatToolbarModule,i.MatTooltipModule,i.MatPaginatorModule,i.MatSortModule,i.MatTableModule,i.MatNativeDateModule,M.MyDatePickerModule,u.FileUploadModule,T.AgGridModule.withComponents([Q,J]),h.CommonModule,A.DragulaModule,s.FormsModule,P.AgmCoreModule.forRoot({apiKey:"AIzaSyD3-g3b_QqxUruxBY4PGJKaH2fubIVXvN4"}),N.FlexLayoutModule,D.MarkdownModule,k.CKEditorModule],exports:[Z,$,it,nt,rt,lt,ht,_t,ot,mt,gt,J,Q,ft,vt,bt,yt,It,ut,St,Et,Ot,Ct,wt,Rt,ct,At,Nt,kt,Tt,Mt,xt,Ft,jt,Vt,pe,zt,at,Yt,G,se,dt,U,q,Y,ae,qt,ue,ce],declarations:[le,Z,$,it,nt,rt,lt,pe,ht,_t,ot,mt,gt,J,Q,ft,vt,bt,yt,It,ut,St,Et,Ot,Ct,wt,Rt,ct,At,Nt,kt,Tt,Mt,xt,Ft,jt,Vt,zt,at,Yt,G,se,dt,U,q,Y,qt,Gt,Bt,Ht,Wt,Xt,Zt,$t,te,ee,ie,ne,Qt,ae,ue,ce],providers:[Dt,A.DragulaService],entryComponents:[qt,Gt,Bt,Ht,Wt,Xt,Zt,$t,te,ee,ie,ne,Qt,At,ot,Z,ft,vt,It,ut,St,Et,Ct,ct,Nt,Mt,jt,zt,at]}]}],t}(),he=function(){function t(t,e,i,n,o,s,r,a){this.http=t,this.auth=e,this.toast=n,this.querys=o,this.appService=s,this.slimLoadingBarService=r,this.app_s=a,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 n=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!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")&&"1"==localStorage.getItem(this.app_s.COMPANY_KEY+"user_isadmin")||new Promise(function(i){if(null!=n.arr_accessi){for(var t=0;t<n.arr_accessi.length;t++)if("M"==n.arr_accessi[t].type&&"["+n.arr_accessi[t].url.split("/")[0]+"]"=="["+n.routingDestination.split("/")[0]+"]")return console.log(typeof o.of(!0)),console.log("OBS3 "+!0),void i(!0);return n.toast.error("ACCESS DENIED"),n.slimLoadingBarService.complete(),void i(!1)}var e=new q;e.sql="SELECT_APPS_USER_ALL",n.appService.getState().app_enabled=new Array,e.types=["string"],e.values=[localStorage.getItem(n.app_s.COMPANY_KEY+"user")],n.querys.doQuery(e).subscribe(function(t){n.arr_accessi=t.result_data;for(var e=0;e<n.arr_accessi.length;e++)if(console.log("["+n.arr_accessi[e].url.split("/")[0]+"]","-----","["+n.routingDestination.split("/")[0]+"]"),"M"==n.arr_accessi[e].type&&"["+n.arr_accessi[e].url.split("/")[0]+"]"=="["+n.routingDestination.split("/")[0]+"]")return console.log(typeof o.of(!0)),console.log("OBS3 "+!0),void i(!0);n.toast.error("ACCESS DENIED"),i(!1),n.slimLoadingBarService.complete()})})):(this.toast.error("ACCESS DENIED"),this.slimLoadingBarService.complete(),!1)))},t.decorators=[{type:l.Injectable}],t.ctorParameters=function(){return[{type:F.Http},{type:st},{type:a.Router},{type:e.ToastrService},{type:tt},{type:j},{type:c.SlimLoadingBarService},{type:j}]},t}(),_e=function fe(t,e,i){this.year=t,this.month=e,this.day=i},me=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_fservice=n,this.m_router=o,this._toastr=s,this.dialog=r,this.m_wkf=a,this.b_editing=!1,this.is_Supervisor=!1,this.is_Admin=!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.imp="",this.sort_field="",e.checkCredentials()&&(this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),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(),"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 i=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(ot,{disableClose:!0}).afterClosed().subscribe(function(t){if(t){var e=new q;e.sql="UPDATE_WKF_ANNULATO",e.types=["string","string","int"],e.values=[i.id_applicativo,i.get_grid().sRow.uiid,-1],i.m_dataService.doQuery(e).subscribe(function(t){null!=t&&"OK"==t.result_msg&&i.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}})):this._toastr.error("Selezionare il documento da annullare")},t.prototype.recupera_richiesta=function(){var e=this,t=this.dialog.open(ee,{disableClose:!0});t.componentInstance.init_w(this.id_applicativo),t.afterClosed().subscribe(function(t){"ok"==t&&e.get_grid().doFill("")})},t.prototype.riassegna_richiesta=function(){var s=this;if(null!=this.get_grid().sRow){var t=new q;t.sql="SELECT_WLIVELLIV2ADM",t.types=["string","string","string"],t.values=[this.id_applicativo,this.get_grid().sRow.uiid,this.get_grid().sRow.stato],this.m_dataService.doQuery(t).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){s.livs_adm=t.result_data;for(var e=new Array,i="",n=0;n<s.livs_adm.length;n++)-1==i.indexOf(String(s.livs_adm[n].livello))&&(i=i+String(s.livs_adm[n].livello)+"|",e.push(s.livs_adm[n]));var o=s.dialog.open(ie,{disableClose:!0});o.componentInstance.setStepCombo(e),o.componentInstance.title="Riassegnazione documento: "+s.get_grid().sRow.codice+" - "+s.get_grid().sRow.oggetto,o.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(console.log(t),s.os_r=t.lvl_sel,s.riassegna_richiesta_step1())})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this._toastr.error("Selezionare il documento da riassegnare")},t.prototype.riassegna_richiesta_step1=function(){for(var e=this,t=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&&t.push(this.livs_adm[i]);var n=this.dialog.open(ne,{disableClose:!0});for(i=0;i<t.length;i++)t[i].nc=t[i].nc.split(" ()").join(""),null!=t[i].idp&&null==t[i].username&&(t[i].username=t[i].idp);console.log(t),n.componentInstance.arrAutori=t,n.componentInstance.title="Riassegnazione documento: "+this.get_grid().sRow.codice+" - "+this.get_grid().sRow.oggetto,n.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&(e.wax=t.arrsel,e.nota_wax=t.nota,e.riassegna_richiesta_step2())})},t.prototype.riassegna_richiesta_step2=function(){var e=this,t="";null!=this.get_grid().sRow.lettori&&(t=this.get_grid().sRow.lettori);var i,n="",o="",s="",r="";null!=this.get_grid().sRow.partecipanti&&(r=this.get_grid().sRow.partecipanti);for(var a="",l=0;l<this.wax.length;l++)""!=a&&(a+=","),a+=this.wax[l].idp,-1==t.indexOf(this.wax[l].idp)&&(""!=t&&(t+=","),t+=this.wax[l].idp),-1==o.indexOf(this.wax[l].nc)&&(""!=o&&(o+=","),o+=this.wax[l].nc),""!=s&&(s+=","),s+=this.wax[l].nc,null!=r&&-1==r.indexOf(this.wax[l].idp)&&(""!=r&&(r+=","),r+=this.wax[l].idp),""!=n&&(n+=","),n+=this.wax[l].idp;(this.sendEMail_ex(this.user_idp,a,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),(i=new q).sql="INSERT_COMMENTO_RIASS",i.types=["string","string","string","string","string","int","int"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato a "+s,this.user_idp,this.os_r.descri_livello,this.get_grid().sRow.stato,this.os_r.livello],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new q).sql="UPDATE_RIASS_DOCUMENTO",i.types=["string","string","string","string","string","string","string","string","string"],i.values=[this.os_r.livello,this.os_r.descri_livello,t,n,this.os_r.descri_livello,o,r,this.get_grid().sRow.id_applicativo,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&e.get_grid().doFill("")},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),(i=new q).sql="INSERT_WKF_COMMENTO",i.types=["string","string","string","string"],i.values=[this.id_applicativo,this.get_grid().sRow.uiid,"Documento riassegnato, commento:\n"+this.nota_wax,this.user_idp],this.m_dataService.doQuery(i).subscribe(function(t){null!=t&&t.result_msg},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),0<this.wax.length)&&((i=new q).sql="UPDATE_RIASSEGNA_TODO",i.types=["string","string"],i.values=[this.wax[0].idp,this.get_grid().sRow.uiid],this.m_dataService.doQuery(i).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 q;u.sql="send_wkf_mail",u.values=[t,e,i,n,o,s,r,a,l,p],this.m_wkf.doQuery(u).subscribe(function(t){})},t.prototype.annulla_imp=function(){localStorage.setItem(this.app_s.COMPANY_KEY+"user_name",localStorage.getItem(this.app_s.COMPANY_KEY+"user_name_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user",localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_surname",localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname_ori")),localStorage.setItem(this.app_s.COMPANY_KEY+"user_email",localStorage.getItem(this.app_s.COMPANY_KEY+"user_email_ori")),this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_name_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_surname_ori"),localStorage.removeItem(this.app_s.COMPANY_KEY+"user_email_ori"),this.imp="",this.get_grid().doFill("")},t.prototype.test_utente=function(){var i=this,n=new q;n.sql="SELECT_UTENTI_WORKFLOW",n.types=["string"],n.values=[this.id_applicativo],this.m_dataService.doQuery(n).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=i.dialog.open(ne,{disableClose:!0});e.componentInstance.arrAutori=t.result_data,e.componentInstance.title="Impersona Utente",e.componentInstance.commento_hidden=!0,e.afterClosed().subscribe(function(t){null!=t&&null!=t.result&&"ok"==t.result&&((n=new q).sql="SELECT_USER_INFO_WKF",n.types=["string"],n.values=[t.arrsel[0].username],i.m_dataService.doQuery(n).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(localStorage.setItem(i.app_s.COMPANY_KEY+"user_name_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_name")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_surname")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email_ori",localStorage.getItem(i.app_s.COMPANY_KEY+"user_email")),localStorage.setItem(i.app_s.COMPANY_KEY+"user_name",t.result_data[0].nome),localStorage.setItem(i.app_s.COMPANY_KEY+"user",t.result_data[0].username),localStorage.setItem(i.app_s.COMPANY_KEY+"user_surname",t.result_data[0].cognome),localStorage.setItem(i.app_s.COMPANY_KEY+"user_email",t.result_data[0].email),i.user_idp=t.result_data[0].username,i.user_nome=t.result_data[0].nome,i.user_cognome=t.result_data[0].cognome,i.user_email=t.result_data[0].email,i.imp="ANNULLA IMP: "+t.result_data[0].cognome+" "+t.result_data[0].nome,i.get_grid().doFill(""))}))})}},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})},t.prototype.save_state_wkf=function(){this.app_s.getState().wkf_obj=new Object,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_Admin=this.is_Admin,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_Supervisor=this.app_s.getState().wkf_obj.is_Supervisor,this.is_Admin=this.app_s.getState().wkf_obj.is_Admin,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.app_s.getState().topnavTitle=this.att_panelcat},t.prototype.init_Panel=function(t,n){var o=this;if(null==this.app_s.getState().wkf_obj||this.app_s.getState().wkf_obj.codice_app!=t){null!=localStorage.getItem(this.app_s.COMPANY_KEY+"user_ori")&&(this.imp="ANNULLA IMP: "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname")+" "+localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"));var e=new q;e.sql="SELECT_WKF_APP_INFO",e.types=["string"];var s=!(e.values=[t]);this.m_dataService.doQuery(e).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;s=!0,o.m_id_Doc=n,o.id_applicativo=e[0].id_gruppo,o.app_root=e[0].modulo_swf,o.codice_app=e[0].codice_documento,o.att_panelcat=e[0].descrizione_breve,o.documento_pubblico=e[0].pubblico,o.titolo_email="["+e[0].descrizione_breve+"]",o.tbl_name=e[0].vista_sql,o.grid_key=o.app_s.COMPANY_KEY+e[0].vista_sql,o.user_idp=localStorage.getItem(o.app_s.COMPANY_KEY+"user"),o.user_nome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_name"),o.user_cognome=localStorage.getItem(o.app_s.COMPANY_KEY+"user_surname"),o.user_email=localStorage.getItem(o.app_s.COMPANY_KEY+"user_email"),o.app_s.getState().topnavTitle=o.att_panelcat;var i=new q;i.sql="SELECT_UTENTE_WKF_ADMIN",i.types=["string","string"],i.values=[o.id_applicativo,localStorage.getItem(o.app_s.COMPANY_KEY+"user")],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){if(null!=t&&"OK"==t.result_msg){var e=t.result_data;o.is_Supervisor=!1,o.is_Admin=!1,0<e.length&&(o.is_Supervisor=!0,"1"==e[0].tipo&&(o.is_Admin=!0)),s=!0;var i=new q;i.sql="SELECT_WLIVELLIV2",i.types=["string","string"],i.values=[o.id_applicativo,""],s=!1,o.m_dataService.doQuery(i).subscribe(function(t){null!=t&&"OK"==t.result_msg&&(o.ok_conf_s(t.result_data),s=!0),s||console.error(t.msg)},function(t){console.log("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")}),s=!0}s||console.error(t.msg)},function(t){console.error("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI")})}else this.restore_state_wkf()},t.prototype.ok_conf_s=function(t){this.livs=t,this.is_Ins=!1;for(var e=0;e<this.livs.length;e++)if((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){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}(),ge=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=new Object,this.b_respingi=!1,this.limite_salto_after=-1,this.respingi_enabled=!1,this.oper="",this.all_c="",this.comm_c="",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,this.user_idp=localStorage.getItem(this.app_s.COMPANY_KEY+"user"),this.user_nome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_name"),this.user_cognome=localStorage.getItem(this.app_s.COMPANY_KEY+"user_surname"),this.user_email=localStorage.getItem(this.app_s.COMPANY_KEY+"user_email")}return t.prototype.save_to_app_state=function(){this.app_s.getState().wkf_doc_info=new Object,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},t.prototype.evt_salv=function(){this.btnprocedi=!1,this.salva()},t.prototype.salva=function(){if(""==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(console.log(this.livs[e]),this.livs[e].livello==t&&!(this.user_idp.toUpperCase()!=this.livs[e].idp.toUpperCase()&&"*ALLUSERS"!=this.livs[e].gruppo_parallelo||(console.log(this.c_canale+" "+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(console.log("this.oper "+this.clevel.livelli_jump),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 o=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(Wt,{disableClose:!0}).afterClosed().subscribe(function(t){if(null!=t){var e=t;if("Prosegui a step successivo"!=t.descri_livello)if("Prosegui a chiusura"!=t.descri_livello){e=o.wkf_rule(e);var i=!1;for(n=0;n<o.livs.length;n++)o.user_idp.toUpperCase()==o.livs[n].idp.toUpperCase()&&0==o.livs[n].notifica&&o.livs[n].livello==e&&(o.nlevel=o.livs[n],e=o.livs[n].livello,i=!0);if(!i)for(n=0;n<o.livs.length;n++)if(o.livs[n].livello==e&&0==o.livs[n].notifica){o.nlevel=o.livs[n],e=o.livs[n].livello;break}o.doJump()}else{for(var n=e=0;n<o.livs.length;n++)o.livs[n].livello<900&&o.livs[n].livello>e&&0==o.livs[n].notifica&&(o.clevel=o.livs[n],e=o.livs[n].livello);o.calcolanextandjump()}else o.calcolanextandjump()}else o.edit_b(!0)})},t.prototype.calcolanextandjump=function(){var t=0,e=1e5;t=this.clevel.livello,console.log("liv: "+t);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);var n=!1;for(i=0;i<this.livs.length;i++)0!=this.livs[i].notifica||""!=this.clevel.gruppo_parallelo&&this.clevel.gruppo_parallelo!=this.livs[i].gruppo_parallelo||this.livs[i].livello==t&&(this.nlevel=this.livs[i],t=this.livs[i].livello,n=!0);if(!n)for(i=0;i<this.livs.length;i++)if(this.livs[i].livello==t&&0==this.livs[i].notifica){this.nlevel=this.livs[i],t=this.livs[i].livello;break}var o=t,s=this.nlevel;if(2==this.nlevel.salto_iniziale){for(i=0;i<this.livs.length;i++)s.idp.toUpperCase()==this.livs[i].idp.toUpperCase()&&0==this.livs[i].notifica&&s.gruppo_parallelo==this.livs[i].gruppo_parallelo&&this.livs[i].livello>o&&0!=o&&(this.nlevel=this.livs[i],t=this.livs[i].livello);e=t}this.ck_after(t)&&this.doJump()},t.prototype.doJump=function(){var e=this;this.user_idp.toUpperCase();if(null!=this.nlevel){var i=new Array;if(""==this.clevel.gruppo_parallelo)for(var t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&i.push(this.livs[t]);else{var n=!1;for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&""!=this.livs[t].gruppo_parallelo&&(n=!0);console.log("canale: "+this.clevel.gruppo_parallelo);for(t=0;t<this.livs.length;t++)this.livs[t].livello==this.nlevel.livello&&0==this.livs[t].notifica&&(console.log("canale: "+this.clevel.gruppo_parallelo+" "+this.livs[t].gruppo_parallelo),this.clevel.gruppo_parallelo!=this.livs[t].gruppo_parallelo&&n||(i.push(this.livs[t]),this.nlevel=this.livs[t]))}if(0!=i.length)if(0==this.nlevel.assegnazione_manuale){this.app_s.getState().wkf_doc_info.title="Avanzamento";for(var o="",s=0;s<i.length;s++)""!=o&&(o+=";"),o+=i[s].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,1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.m_dialog.open(Bt,{disableClose:!0}).afterClosed().subscribe(function(t){if("abort"==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=i,e.nota=t,e.OKCOM()})}else{this.app_s.getState().wkf_doc_info.title="Assegnazione",1==this.clevel.commenti_opzionali?this.app_s.getState().wkf_doc_info.comm_notrequired=!0:this.app_s.getState().wkf_doc_info.comm_notrequired=!1,this.app_s.getState().wkf_doc_info.arrAutori=i.sort(function(t,e){return t.nc>e.nc?1:t.nc<e.nc?-1:0}),this.m_dialog.open(Gt,{disableClose:!0}).afterClosed().subscribe(function(t){if(""==t)return e.edit_b(!0),void(e.respingi_enabled&&e.resp_b(!0));e.arrUsersSelected=t.arrsel,e.nota=t.nota,e.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(qt,{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.msodulo_swf]))}):this.m_router.navigate([this.app_info.modulo_swf])},t.prototype.OKCOM=function(){var i=this;this.m_lettori=this.m_obj.lettori,null==this.m_lettori&&(this.m_lettori=this.m_obj.partecipanti),this.m_danotificare="";for(var t,e=this.m_autori="",n=0;n<this.arrUsersSelected.length;n++)""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.arrUsersSelected[n].idp,-1==this.m_lettori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.arrUsersSelected[n].idp),console.log("m_lettori2 "+this.m_lettori),-1==this.m_autori.toLowerCase().indexOf(this.arrUsersSelected[n].idp.toLowerCase())&&(""!=this.m_autori&&(this.m_autori=this.m_autori+","),""!=e&&(e+=","),this.m_autori=this.m_autori+this.arrUsersSelected[n].idp,e+=this.arrUsersSelected[n].nc),console.log("m_lettori3 "+this.m_lettori);""!=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&&this.insert_wkf_variabile(this.id_applicativo,this.id_documento,"REQUESTER",this.user_idp);for(n=0;n<this.livs.length;n++)this.livs[n].livello==this.m_liv&&1==this.livs[n].notifica&&(1==this.livs[n].email_ospiti&&(""!=this.m_danotificare&&(this.m_danotificare=this.m_danotificare+","),this.m_danotificare=this.m_danotificare+this.livs[n].idp),-1==this.m_lettori.toLowerCase().indexOf(this.livs[n].idp.toLowerCase())&&(""!=this.m_lettori&&(this.m_lettori=this.m_lettori+","),this.m_lettori=this.m_lettori+this.livs[n].idp));if(900<=this.nlevel.livello){this.getLvlInfo(this.nlevel.livello);this.doEnd(this.nlevel.livello),(r=new q).sql="UPDATE_DATA_CHIUSURA",r.values=[this.id_applicativo,this.id_documento],r.types=["string","string"],this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})}t=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):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);for(var o=new Array,s=0;s<t.length;s++)o.push("string");if(this.m_crea_att=1,900<=this.m_liv&&(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),(r=new q).sql="doWKF",r.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+" è passata 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(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(r=new q).sql="UPDATE_WKF_DOCUMENTOV3_NS",r.values=t,r.types=o,this.m_dataService.doQuery(r).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),""!=this.m_danotificare){var r,a="";if(""!=this.nota&&(a="<br>Commento: "+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),(r=new q).sql="exec_app_workflow",r.values=[this.app_info.codice_documento,this.id_documento,""+this.clevel.livello,""+this.nlevel.livello,this.user_idp],this.m_wkf.doQuery(r).subscribe(function(t){},function(t){}),1==this.nlevel.approvazione_email);else{console.log("this.nlevel.ical ",this.nlevel.ical);var l=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):l={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()+a,organizer:this.user_nome+" "+this.user_cognome+" <"+this.user_email+">"}),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:"+a,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,l);else if(console.log("--------------this.clevel.oggetto_text----------------------"),console.log(this.nlevel.oggetto_email),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(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,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,l);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(),"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,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,l);else{var p=this.nlevel.oggetto_email;for(var u in console.log("OGGETTO CUSTOM!"),this.m_obj)null!=this.m_obj[u]&&(console.log(u+" "+Object.prototype.toString.call(this.m_obj[u])),p="[object Date]"===Object.prototype.toString.call(this.m_obj[u])?p.split("%"+u+"%").join(this.uti_s.date2String(this.m_obj[u])):-1==(""+this.m_obj[u]).indexOf("T00:00:00")?p.split("%"+u+"%").join(this.m_obj[u]):p.split("%"+u+"%").join(this.uti_s.date2String(this.uti_s.string2date(this.m_obj[u],2))));this.sendEMail_ex(this.user_idp,this.m_danotificare,p,"<br>Attività:"+this.getLvlDescri(String(this.m_liv),this.m_statox)+"<br>"+this.m_statox+"<br>"+this.getDescri()+a,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,l)}else this.goto_edit_doc()}}},t.prototype.sendEMail_ex=function(t,e,i,n,o,s,r,a,l,p,u){var c=this;void 0===p&&(p=!0),void 0===u&&(u="");var d=new q;d.sql="send_wkf_mail",e=(e=e.split(t+",").join("")).split(","+t).join(""),null==u&&(u=""),""!=u&&(u=JSON.stringify(u)),d.values=[t,e,i,n,o,s,r,a,l,u],this.m_wkf.doQuery(d).subscribe(function(t){c.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=this,s=new q;s.sql="INSERT_WKF_COMMENTO",s.values=[t,e,i,n],s.types=["string","string","string","string"],this.m_dataService.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.insert_wkf_variabile=function(t,e,i,n){var o=this,s=new q;s.sql="insert_wkf_variabile",s.values=[t,e,i,n],this.m_wkf.doQuery(s).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||o.alert(t.msg,1)},function(t){o.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.respingi=function(){if(this.oper="respingi",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.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(){var e=this,t=this.m_dialog.open(te,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_commenti=function(){var e=this,t=this.m_dialog.open(Zt,{disableClose:!0});t.componentInstance.subject=this.app_info.descrizione_breve+", <OP>: "+this.m_obj.codice+" "+this.getTitle(),t.componentInstance.lettori=this.m_obj.lettori,t.componentInstance.link=this.app_s.COMPANY_SITE_ROOT+"#/"+this.app_info.modulo_swf+"/"+this.id_applicativo+"/"+this.id_documento+"/edit",t.componentInstance.codice_doc=this.m_obj.codice,t.componentInstance.not_int=this.app_info.notifica_commenti_default,t.afterClosed().subscribe(function(t){e.r_count()})},t.prototype.open_upload=function(){var e=this;this.m_dialog.open(Xt,{disableClose:!0}).afterClosed().subscribe(function(t){e.r_count()})},t.prototype.create_new_document=function(){var i=this,t=new q;t.sql="insert_new_doc",null==this.c_canale&&(this.c_canale=""),t.values=[this.id_applicativo,this.id_documento,this.c_canale,this.user_idp],this.m_wkf.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.save_agg(),e=!0),e||i.alert(t.msg,1)},function(t){i.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)})},t.prototype.save_agg=function(){var i=this;this.edit_b(!1);var t=this.getfieldvalues(),e=new q;e.sql="insert_aggiuntivi",e.types=["string","string"],e.values=[this.app_info.tabella_dati,this.id_documento],e.names=["tabella","id_documento"];for(var n=0;n<t.length;n++)e.types.push(t[n].types),e.names.push(t[n].names),null!=t[n].values?("int"==t[n].types&&e.values.push(""+t[n].values),"string"==t[n].types&&e.values.push(""+t[n].values),"date"==t[n].types&&e.values.push(this.uti_s.sql_date(t[n].values)),"datetime"==t[n].types&&e.values.push(this.uti_s.sql_date_time(t[n].values)),"decimal"==t[n].types&&e.values.push(""+t[n].values)):e.values.push("dbnull"),console.log(e.names[n+2]+" "+e.values[n+2]);this.m_wkf.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_insert_aggiuntivi(),e=!0),e||(i.errorMsg=t.msg)},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(!0),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 n=this;console.log("load_document()");var t=new q;t.sql="SELECT_WKF_DOCUMENT_NOREP",t.types=["string","string","string"],t.values=[this.app_info.vista_sql,this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){var i=t.result_data;0<i.length?n.ok_load_document(i[0]):n.alert("DOCUMENTO NON TROVATO",1),e=!0}e||(n.errorMsg=t.msg)},function(t){})},t.prototype.ok_load_document=function(t){var i=this;console.log(t),this.m_obj=JSON.parse(JSON.stringify(t)),this.edit_b(!1),this.save_to_app_state();var e=new q;e.sql="SELECT_LIVELLI_DOC",e.types=["string","string"],e.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(e).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(i.ok_livelli_doc(t.result_data),e=!0),e||(i.errorMsg=t.msg)},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 r=this,t=new q;t.sql="SELECT_WKF_ALLEGATI_COUNTER",t.types=["string","string"],t.values=[this.id_applicativo,this.id_documento],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;if(null!=t&&"OK"==t.result_msg){for(var i=t.result_data,n=0,o=0,s=0;s<i.length;s++)0<i[s].n&&("ALLEGATI"==i[s].v&&(n=i[s].n),"COMMENTI"==i[s].v&&(o=i[s].n));r.reset_counters_int(o,n),e=!0}e||(r.errorMsg=t.msg)},function(t){})},t.prototype.reset_counters_int=function(t,e){this.all_c="",this.comm_c="",0<t&&(this.comm_c=" ("+t+")"),0<e&&(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,console.log("-------------"+this.forza_canale+"--------------------"),console.log(this.livs[e]));console.log("forza canale exec"+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 e=this,t=0,i=0;i<this.livs.length;i++)(this.livs[i].livello<t||0==t)&&(this.clevel=this.livs[i],t=this.livs[i].livello);var n=new Array;for(i=0;i<this.livs.length;i++)this.livs[i].livello==t&&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 e<t?1:t<e?-1:0}),this.m_dialog.open(Ht,{disableClose:!0}).afterClosed().subscribe(function(t){e.c_canale=t,e.create_new_document()}))},t.prototype.open_info=function(){var t=this.m_dialog.open($t,{disableClose:!0});t.componentInstance.hide_richiedente=this.hide_richiedente,t.afterClosed().subscribe(function(t){})},t.prototype.setForceJump=function(t,e){var i,n=this;void 0===e&&(e="");for(var o,s="",r="",a="",l=0;l<this.livs.length;l++)t!=this.livs[l].livello||0!=this.livs[l].notifica||""!=e&&!this.livs[l].canale||(""!=s&&(s+=","),s+=this.livs[l].idp,""!=r&&(r+=","),r+=this.livs[l].nc,a=this.livs[l].descri_livello);if(""==s)return"NESSUN UTENTE CONFIGURATO STEP: "+t+" CANALE: "+e;o=this.app_info.documento_pubblico?new Array(s,"",t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento):new Array(s,this.m_obj.partecipanti+","+s,t,"Assegnata a:"+r,"","",this.getLvlDescri(String(t),"Assegnata a:"+r),this.getUsersList(r,this.m_obj.assegnati_paralleli),this.user_idp,this.getTitle(),this.getDescri(),this.id_applicativo,this.id_documento);var p=new Array;for(l=0;l<o.length;l++)p.push("string");return(i=new q).sql="doWKF",i.values=[this.app_info.descrizione_breve,this.m_obj.codice,""+t,""+t,this.m_obj.codice+" - "+this.getTitle(),this.getTitle()+"La scheda numero: "+this.m_obj.codice+" è passata allo stato: "+a,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,a,"",this.id_applicativo,this.id_documento,"1","0",""+this.m_obj.stato,""+t],this.insert_wkf_variabile(this.id_applicativo,this.id_documento,this.m_obj.stato+"_PLAYER",this.user_idp),this.m_wkf.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),(i=new q).sql="UPDATE_WKF_DOCUMENTOV3_NS",i.values=o,i.types=p,this.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(e=!0),e||n.alert(t.msg,1)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",1)}),this.goto_edit_doc(),"OK"},t.prototype.insert_doc=function(){var i=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.enabled_form(),this.app_s.getState().topnavTitle=this.app_info.descrizione_breve+" - Nuova Richiesta",this.reset_form(this.app_info.descrizione_breve+" - Nuova Richiesta"),this.reset_counters_int(0,0);var t=new q;t.sql="SELECT_WLIVELLIV2",t.types=["string","string"],t.values=[this.id_applicativo,""],this.m_dataService.doQuery(t).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(console.log(t.result_data),i.ok_livw2(t.result_data),e=!0),e||(i.errorMsg=t.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);for(i=0;i<this.livs.length;i++)if(e==this.livs[i].livello&&(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(){console.log("return_edit");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}-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.app_s.getState().topnavTitle=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.ngOnInit=function(){var n=this;this.m_route.params.subscribe(function(t){n.onResize();var e=t.op;if(n.id_applicativo=t.idapp,n.id_documento=t.id_doc,n.b_edit="new"!=e,n.b_edit||-1<n.id_applicativo.indexOf("_")&&(n.simple_mode=!0,n.id_applicativo=n.id_applicativo.split("_").join("")),n.b_valid=!!n.id_applicativo,n.b_valid){var i=new q;i.sql="SELECT_WKF_APP_INFO_BYUID",i.types=["string"],i.values=[n.id_applicativo],n.m_dataService.doQuery(i).subscribe(function(t){var e=!1;null!=t&&"OK"==t.result_msg&&(0<t.result_data.length?(n.setta_info_app(t.result_data[0]),n.b_edit?n.edit_doc():n.insert_doc()):n.alert("CODICE APPLICAZIONE NON VALIDO",2),e=!0),e||n.alert(t.msg,2)},function(t){n.alert("ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI",2)})}else n.alert("PARAMETRO APPLICAZIONE NON VALIDO",2)})},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},t.propDecorators={onResize:[{type:l.HostListener,args:["window:resize",["event"]]}]},t}();t.FluxhubLibModule=de,t.AppService=j,t.AppMakerService=K,t.FileService=z,t.OdbcService=V,t.QueryService=tt,t.WkfService=Jt,t.GridService=pt,t.AuthenticationService=st,t.UtilityService=X,t.OfficeAutomatorService=oe,t.LocalDBService=re,t.FHGuard=he,t.FHGridJSONComponent=ae,t.FHGridComponent=ht,t.ApprovaGridComponent=vt,t.CurrencyComponent=nt,t.DateComponent=J,t.DtPick=Rt,t.dt=_e,t.NumericEditorComponent=Q,t.ComboBoxEditor=Et,t.TextAreaEditor=St,t.FHAutoCompleteComponent=mt,t.FHComboboxComponent=_t,t.FHConfirmComponent=ot,t.FHCurrencyFieldComponent=xt,t.FHCurrencyFormatterDirective=bt,t.FHCurrencyPipe=yt,t.FHDatePickerComponent=gt,t.FHListComponent=Ot,t.FHLogPanelComponent=Tt,t.FHMdReader=kt,t.FHNumericFieldComponent=Vt,t.ReplaceLineBreaks=wt,t.FHRichText=Ft,t.FHTimePickerComponent=it,t.FHUploadComponent=lt,t.FHUploadPanelComponent=rt,t.FHUserFieldComponent=Yt,t.FHUserPickerComponent=ft,t.FHPickListComponent=At,t.WinAskNumberComponent=Nt,t.WinAskTextComponent=ct,t.WinAskTextBigComponent=Mt,t.FHWinComboSelect=Ct,t.FHListPick=zt,t.win_mappa=It,t.WinOutputComponent=jt,t.win_time_slider=Z,t.WinWait=at,t.win_salva_annulla=qt,t.QGParam=dt,t.QGResult=U,t.QParam=q,t.QResult=Y,t.FSInput=G,t.FSResult=se,t.FormBuilderComponent=ue,t.FormExecuterComponent=ce,t.wkf_header_bar=pe,t.wkfapp=me,t.dati_aggiuntivi=ge,t.ɵa=Pt,t.ɵi=le,t.ɵg=ut,t.ɵb=Ut,t.ɵc=Lt,t.ɵd=Kt,t.ɵe=$,t.ɵf=et,t.ɵh=Dt,t.ɵj=Gt,t.ɵo=Zt,t.ɵu=Qt,t.ɵk=Bt,t.ɵp=$t,t.ɵq=te,t.ɵr=ee,t.ɵs=ie,t.ɵt=ne,t.ɵl=Ht,t.ɵm=Wt,t.ɵn=Xt,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=fluxhub-fluxhub-lib.umd.min.js.map
|