Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
!function(){"use strict";function t(e,n,a){return(t="undefined"!=typeof Reflect&&Reflect.g..
Decoded Output download
<? !function(){"use strict";function t(e,n,a){return(t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var a=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=o(t)););return t}(t,e);if(a){var i=Object.getOwnPropertyDescriptor(a,e);return i.get?i.get.call(n):i.value}})(e,n,a||e)}function e(t,n){return(e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,n)}function n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=o(t);if(e){var c=o(this).constructor;n=Reflect.construct(i,arguments,c)}else n=i.apply(this,arguments);return a(this,n)}}function a(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function r(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),t}(self.webpackChunkmaterial_dashboard_angular=self.webpackChunkmaterial_dashboard_angular||[]).push([[95],{1581:function(t,e,n){n.d(e,{y:function(){return u}});var a=n(26215),o=n(25917),c=n(5304),l=n(68939),u=function(){function t(e){i(this,t),this.service=e,this.dataSubject=new a.X([]),this.loadingSubject=new a.X(!1),this.loading$=this.loadingSubject.asObservable(),this.metaSubject=new a.X({}),this.meta$=this.metaSubject.asObservable()}return r(t,[{key:"load",value:function(t,e,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";this.loadingSubject.next(!0),this.service.getAll(t,e,n,i,r,u,s).pipe((0,c.K)(function(){return(0,o.of)([])}),(0,l.x)(function(){return a.loadingSubject.next(!1)})).subscribe(function(t){a.dataSubject.next(t.data),a.metaSubject.next(t.meta)})}},{key:"loadNested",value:function(t,e,n,a){var i=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";this.loadingSubject.next(!0),this.service.getNested(t,e,n,a,r,u,s,d).pipe((0,c.K)(function(){return(0,o.of)([])}),(0,l.x)(function(){return i.loadingSubject.next(!1)})).subscribe(function(t){i.dataSubject.next(t.data),i.metaSubject.next(t.meta)})}},{key:"connect",value:function(t){return this.dataSubject.asObservable()}},{key:"disconnect",value:function(t){this.dataSubject.complete(),this.loadingSubject.complete()}}]),t}()},28292:function(t,e,n){n.d(e,{z:function(){return u}});var a,o=n(22238),c=n(37716),l=n(29790),u=((a=r(function t(e,n,a){i(this,t),this.data=e,this.translateService=n,this.dialogRef=a,this.title=(null==e?void 0:e.title)?null==e?void 0:e.title:this.translateService.instant("confirm_permanent_action")})).fac=function(t){return new(t||a)(c.Y36(o.WI),c.Y36(l.sK),c.Y36(o.so))},a.cmp=c.Xpm({type:a,selectors:[["robi-confirm-dialog"]],decls:10,vars:7,consts:[["mat-dialog-title",""],["align","center"],[1,"mat-raised-button","mat-primary","mr-2",3,"click"],[1,"mat-raised-button",3,"click"]],template:function(t,e){1&t&&(c.TgZ(0,"mat-dialog-content"),c.TgZ(1,"span",0),c._uU(2),c.qZA(),c.qZA(),c.TgZ(3,"mat-dialog-actions",1),c.TgZ(4,"button",2),c.NdJ("click",function(){return e.dialogRef.close(!0)}),c._uU(5),c.ALo(6,"translate"),c.qZA(),c.TgZ(7,"button",3),c.NdJ("click",function(){return e.dialogRef.close(!1)}),c._uU(8),c.ALo(9,"translate"),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Oqu(e.title),c.xp6(3),c.hij(" ",c.lcZ(6,3,"confirm"),""),c.xp6(3),c.Oqu(c.lcZ(9,5,"close")))},directives:[o.xY,o.uh,o.H8],pipes:[l.X$],encapsulation:2}),a)},48879:function(t,e,n){n.r(e),n.d(e,{TenantDocumentModule:function(){return $}});var a=n(39895),o=n(76208),c=n(99692),l=n(11494),u=n(28292),s=n(86710),d=n(4919),f=n(37716),h=n(48629),m=n(19971),p=n(29790),v=n(22238),g=n(75973),b=n(72322),Z=n(98295),y=n(49983),S=n(38583),D=n(32789),w=n(51095),x=n(76627),A=n(12178),T=["search"];function _(t,e){if(1&t){var n=f.EpF();f.TgZ(0,"button",31),f.NdJ("click",function(){return f.CHM(n),f.oxw().clearSearch()}),f.TgZ(1,"mat-icon"),f._uU(2,"close"),f.qZA(),f.qZA()}}function k(t,e){1&t&&(f.TgZ(0,"mat-header-cell",32),f._uU(1),f.ALo(2,"translate"),f.qZA()),2&t&&(f.xp6(1),f.hij("",f.lcZ(2,1,"documents.field.date")," "))}function q(t,e){if(1&t&&(f.TgZ(0,"mat-cell"),f._uU(1),f.qZA()),2&t){var n=e.$implicit;f.xp6(1),f.hij(" ",n.created_at_str," ")}}function j(t,e){1&t&&(f.TgZ(0,"mat-header-cell",32),f._uU(1),f.ALo(2,"translate"),f.qZA()),2&t&&(f.xp6(1),f.hij("",f.lcZ(2,1,"documents.field.document")," "))}function C(t,e){if(1&t){var n=f.EpF();f.TgZ(0,"mat-cell"),f.TgZ(1,"button",33),f.NdJ("click",function(){var t=f.CHM(n).$implicit;return f.oxw().downloadDocument(null==t?null:t.id)}),f.TgZ(2,"span",34),f._uU(3),f.qZA(),f.qZA(),f.qZA()}if(2&t){var a=e.$implicit;f.xp6(3),f.Oqu(a.document)}}function O(t,e){1&t&&f._UZ(0,"mat-header-cell")}function R(t,e){if(1&t){var n=f.EpF();f.TgZ(0,"button",37),f.NdJ("click",function(){f.CHM(n);var t=f.oxw().$implicit;return f.oxw().openConfirmationDialog(t)}),f.TgZ(1,"mat-icon",38),f._uU(2,"delete"),f.qZA(),f.qZA()}}function U(t,e){if(1&t&&(f.TgZ(0,"mat-cell",35),f.YNc(1,R,3,0,"button",36),f.ALo(2,"async"),f.qZA()),2&t){var n=f.oxw();f.xp6(1),f.Q6J("ngIf",f.lcZ(2,1,n.isAdmin$))}}function Y(t,e){1&t&&f._UZ(0,"mat-header-row")}function N(t,e){1&t&&f._UZ(0,"mat-row")}function I(t,e){1&t&&(f.TgZ(0,"span"),f._uU(1),f.ALo(2,"translate"),f.qZA()),2&t&&(f.xp6(1),f.Oqu(f.lcZ(2,1,"no_data")))}function J(t,e){1&t&&(f.TgZ(0,"div",39),f._UZ(1,"mat-progress-bar",40),f.qZA())}var L,H=a.Bz.forChild([{path:"",component:(L=function(){function t(e,n,a,o,c,r,l){var u=this;i(this,t),this.notification=e,this.store=n,this.tenantService=a,this.translateService=o,this.dialog=c,this.authenticationService=r,this.tenantDocumentService=l,this.displayedColumns=["created_at","document","actions"],this.pageIndex=0,this.pageSizeOptions=[5,10,25,50,100],this.loader=!1,this.documentToUpload=null,this.photoUrl="",this.isAdmin$=this.authenticationService.isAdmin(),this.store.pipe((0,s.Ys)(d.Zb)).subscribe(function(t){return u.tenantID=t})}return r(t,[{key:"ngOnInit",value:function(){var t=this;this.tenantDocumentDataSource=new o.s(this.tenantDocumentService),this.tenantDocumentDataSource.meta$.subscribe(function(e){return t.meta=e}),this.tenantDocumentDataSource.load("",0,0,"updated_at","desc","tenant_id",this.tenantID)}},{key:"loadData",value:function(){this.tenantDocumentDataSource.load(this.search.nativeElement.value,this.paginator.pageIndex+1,this.paginator.pageSize,this.sort.active,this.sort.direction,"tenant_id",this.tenantID)}},{key:"clearSearch",value:function(){this.search.nativeElement.value="",this.loadData()}},{key:"onDocumentSelect",value:function(t){var e=this;if(t.length>0){this.documentToUpload=t.item(0);var n=new FileReader;n.onload=function(t){e.photoUrl=t.target.result},n.readAsDataURL(this.documentToUpload),this.loader=!0;var a=new FormData;a.append("document",this.documentToUpload),a.append("tenant_id",this.tenantID),this.uploadDocument(a)}}},{key:"uploadDocument",value:function(t){var e=this;this.tenantDocumentService.uploadDocument(t).subscribe(function(t){e.loader=!1,e.loadData(),e.notification.success(e.translateService.instant("documents.list.create"))},function(t){e.loader=!1})}},{key:"downloadDocument",value:function(t){var e=this;console.log(t),this.loader=!0,this.tenantDocumentService.fetchDocument(t).subscribe(function(t){var n=URL.createObjectURL(t);window.open(n,"_blank"),e.loader=!1},function(t){e.loader=!1})}},{key:"openConfirmationDialog",value:function(t){var e=this;this.dialogRef=this.dialog.open(u.z,{disableClose:!0}),this.dialogRef.afterClosed().subscribe(function(n){n&&e.delete(t),e.dialogRef=null})}},{key:"delete",value:function(t){var e=this;this.loader=!0,this.tenantDocumentService.delete(t).subscribe(function(t){e.loader=!1,e.loadData(),e.notification.success(e.translateService.instant("documents.list.delete"))},function(t){e.loader=!1})}}]),t}(),L.fac=function(t){return new(t||L)(f.Y36(h.gq),f.Y36(s.yh),f.Y36(m.a),f.Y36(p.sK),f.Y36(v.uw),f.Y36(g.$),f.Y36(b.l))},L.cmp=f.Xpm({type:L,selectors:[["robi-user-profile"]],viewQuery:function(t,e){var n;1&t&&(f.Gf(T,5),f.Gf(c.NW,7),f.Gf(l.YE,7)),2&t&&(f.iGM(n=f.CRH())&&(e.search=n.first),f.iGM(n=f.CRH())&&(e.paginator=n.first),f.iGM(n=f.CRH())&&(e.sort=n.first))},decls:38,vars:21,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-12"],[1,"card"],["color","accent",1,"card-header","card-header-info"],[1,"card-title"],[1,"card-body"],[1,"row","search-form-section"],[1,"col-12",3,"hidden"],[1,"search-form-field"],["matInput","","autocomplete","off",3,"placeholder","disabled"],["search",""],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],[1,"table-responsive"],["matSort","","matSortActive","created_at","matSortDirection","desc","matSortDisableClear","",3,"dataSource"],["table",""],["matColumnDef","created_at"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","document"],["matColumnDef","actions"],[4,"matHeaderCellDef"],["class","button-row",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[4,"ngIf"],["class","d-flex justify-content-center spinner-container",4,"ngIf"],["showFirstLastButtons","",3,"length","pageIndex","pageSizeOptions"],["pagination",""],[1,"col-md-4"],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["mat-sort-header",""],["mat-flat-button","",3,"click"],[1,"link"],[1,"button-row"],["mat-raised-button","","type","button","class","btn btn-link btn-sm btn-just-icon",3,"click",4,"ngIf"],["mat-raised-button","","type","button",1,"btn","btn-link","btn-sm","btn-just-icon",3,"click"],["color","warn"],[1,"d-flex","justify-content-center","spinner-container"],["color","green","mode","query","value","50","bufferValue","75"]],template:function(t,e){if(1&t&&(f.TgZ(0,"div",0),f.TgZ(1,"div",1),f.TgZ(2,"div",2),f.TgZ(3,"div",3),f.TgZ(4,"div",4),f.TgZ(5,"div",5),f.TgZ(6,"h4",6),f._uU(7),f.ALo(8,"translate"),f.qZA(),f.qZA(),f.TgZ(9,"div",7),f.TgZ(10,"div",8),f.TgZ(11,"div",9),f.ALo(12,"async"),f.TgZ(13,"mat-form-field",10),f._UZ(14,"input",11,12),f.ALo(16,"translate"),f.YNc(17,_,3,0,"button",13),f.qZA(),f.qZA(),f.qZA(),f.TgZ(18,"div",14),f.TgZ(19,"mat-table",15,16),f.ynx(21,17),f.YNc(22,k,3,3,"mat-header-cell",18),f.YNc(23,q,2,1,"mat-cell",19),f.BQk(),f.ynx(24,20),f.YNc(25,j,3,3,"mat-header-cell",18),f.YNc(26,C,4,1,"mat-cell",19),f.BQk(),f.ynx(27,21),f.YNc(28,O,1,0,"mat-header-cell",22),f.YNc(29,U,3,3,"mat-cell",23),f.BQk(),f.YNc(30,Y,1,0,"mat-header-row",24),f.YNc(31,N,1,0,"mat-row",25),f.qZA(),f.YNc(32,I,3,3,"span",26),f.YNc(33,J,2,0,"div",27),f.ALo(34,"async"),f._UZ(35,"mat-paginator",28,29),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f._UZ(37,"div",30),f.qZA(),f.qZA(),f.qZA()),2&t){var n=f.MAs(15);f.xp6(7),f.Oqu(f.lcZ(8,13,"robi.tenant.document.title")),f.xp6(4),f.Q6J("hidden",!f.lcZ(12,15,e.isAdmin$)),f.xp6(3),f.s9C("placeholder",f.lcZ(16,17,"filter")),f.Q6J("disabled",0===(null==e.meta?null:e.meta.total)),f.xp6(3),f.Q6J("ngIf",n.value),f.xp6(2),f.Q6J("dataSource",e.tenantDocumentDataSource),f.xp6(11),f.Q6J("matHeaderRowDef",e.displayedColumns),f.xp6(1),f.Q6J("matRowDefColumns",e.displayedColumns),f.xp6(1),f.Q6J("ngIf",0===(null==e.meta?null:e.meta.total)),f.xp6(1),f.Q6J("ngIf",f.lcZ(34,19,null==e.tenantDocumentDataSource?null:e.tenantDocumentDataSource.loading$)||e.loader),f.xp6(2),f.Q6J("length",null==e.meta?null:e.meta.total)("pageIndex",e.pageIndex)("pageSizeOptions",e.pageSizeOptions)}},directives:[Z.KE,y.Nt,S.O5,D.BZ,l.YE,D.w1,D.fO,D.Dz,D.as,D.nj,c.NW,w.lW,Z.R9,x.Hw,D.ge,l.nU,D.ev,D.XQ,D.Gk,A.pW],pipes:[p.X$,S.Ov],styles:[""]}),L)}]),Q=n(83893),$=function(){var t=r(function t(){i(this,t)});return t.fac=function(e){return new(e||t)},t.mod=f.oAB({type:t}),t.inj=f.cJS({imports:[[Q.m,H]]}),t}()},19971:function(a,c,l){l.d(c,{a:function(){return p}});var u,s=l(65),d=l(26215),f=l(37716),h=l(91841),m=l(86710),p=((u=function(a){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&e(t,n)}(l,a);var c=n(l);function l(t,e){var n;return i(this,l),(n=c.call(this,t,"tenants")).store=e,n.selectedTenantSource=new d.X(null),n.selectedTenantChanges$=n.selectedTenantSource.asObservable(),n.localHttpClient=t,n}return r(l,[{key:"changeSelectedTenant",value:function(t){this.selectedTenantSource.next(t)}},{key:"search",value:function(e){var n="".concat(t(o(l.prototype),"getResourceUrl",this).call(this),"/search");return this.localHttpClient.post(n,{filter:e})}},{key:"create",value:function(e){return this.localHttpClient.post(t(o(l.prototype),"getResourceUrl",this).call(this),e)}}]),l}(s.b)).fac=function(t){return new(t||u)(f.LFG(h.eN),f.LFG(m.yh))},u.prov=f.Yz7({token:u,factory:u.fac,providedIn:"root"}),u)}}])}(); ?>
Did this file decode correctly?
Original Code
!function(){"use strict";function t(e,n,a){return(t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var a=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=o(t)););return t}(t,e);if(a){var i=Object.getOwnPropertyDescriptor(a,e);return i.get?i.get.call(n):i.value}})(e,n,a||e)}function e(t,n){return(e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,n)}function n(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=o(t);if(e){var c=o(this).constructor;n=Reflect.construct(i,arguments,c)}else n=i.apply(this,arguments);return a(this,n)}}function a(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function r(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),t}(self.webpackChunkmaterial_dashboard_angular=self.webpackChunkmaterial_dashboard_angular||[]).push([[95],{1581:function(t,e,n){n.d(e,{y:function(){return u}});var a=n(26215),o=n(25917),c=n(5304),l=n(68939),u=function(){function t(e){i(this,t),this.service=e,this.dataSubject=new a.X([]),this.loadingSubject=new a.X(!1),this.loading$=this.loadingSubject.asObservable(),this.metaSubject=new a.X({}),this.meta$=this.metaSubject.asObservable()}return r(t,[{key:"load",value:function(t,e,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";this.loadingSubject.next(!0),this.service.getAll(t,e,n,i,r,u,s).pipe((0,c.K)(function(){return(0,o.of)([])}),(0,l.x)(function(){return a.loadingSubject.next(!1)})).subscribe(function(t){a.dataSubject.next(t.data),a.metaSubject.next(t.meta)})}},{key:"loadNested",value:function(t,e,n,a){var i=this,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",d=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";this.loadingSubject.next(!0),this.service.getNested(t,e,n,a,r,u,s,d).pipe((0,c.K)(function(){return(0,o.of)([])}),(0,l.x)(function(){return i.loadingSubject.next(!1)})).subscribe(function(t){i.dataSubject.next(t.data),i.metaSubject.next(t.meta)})}},{key:"connect",value:function(t){return this.dataSubject.asObservable()}},{key:"disconnect",value:function(t){this.dataSubject.complete(),this.loadingSubject.complete()}}]),t}()},28292:function(t,e,n){n.d(e,{z:function(){return u}});var a,o=n(22238),c=n(37716),l=n(29790),u=((a=r(function t(e,n,a){i(this,t),this.data=e,this.translateService=n,this.dialogRef=a,this.title=(null==e?void 0:e.title)?null==e?void 0:e.title:this.translateService.instant("confirm_permanent_action")})).\u0275fac=function(t){return new(t||a)(c.Y36(o.WI),c.Y36(l.sK),c.Y36(o.so))},a.\u0275cmp=c.Xpm({type:a,selectors:[["robi-confirm-dialog"]],decls:10,vars:7,consts:[["mat-dialog-title",""],["align","center"],[1,"mat-raised-button","mat-primary","mr-2",3,"click"],[1,"mat-raised-button",3,"click"]],template:function(t,e){1&t&&(c.TgZ(0,"mat-dialog-content"),c.TgZ(1,"span",0),c._uU(2),c.qZA(),c.qZA(),c.TgZ(3,"mat-dialog-actions",1),c.TgZ(4,"button",2),c.NdJ("click",function(){return e.dialogRef.close(!0)}),c._uU(5),c.ALo(6,"translate"),c.qZA(),c.TgZ(7,"button",3),c.NdJ("click",function(){return e.dialogRef.close(!1)}),c._uU(8),c.ALo(9,"translate"),c.qZA(),c.qZA()),2&t&&(c.xp6(2),c.Oqu(e.title),c.xp6(3),c.hij(" ",c.lcZ(6,3,"confirm"),""),c.xp6(3),c.Oqu(c.lcZ(9,5,"close")))},directives:[o.xY,o.uh,o.H8],pipes:[l.X$],encapsulation:2}),a)},48879:function(t,e,n){n.r(e),n.d(e,{TenantDocumentModule:function(){return $}});var a=n(39895),o=n(76208),c=n(99692),l=n(11494),u=n(28292),s=n(86710),d=n(4919),f=n(37716),h=n(48629),m=n(19971),p=n(29790),v=n(22238),g=n(75973),b=n(72322),Z=n(98295),y=n(49983),S=n(38583),D=n(32789),w=n(51095),x=n(76627),A=n(12178),T=["search"];function _(t,e){if(1&t){var n=f.EpF();f.TgZ(0,"button",31),f.NdJ("click",function(){return f.CHM(n),f.oxw().clearSearch()}),f.TgZ(1,"mat-icon"),f._uU(2,"close"),f.qZA(),f.qZA()}}function k(t,e){1&t&&(f.TgZ(0,"mat-header-cell",32),f._uU(1),f.ALo(2,"translate"),f.qZA()),2&t&&(f.xp6(1),f.hij("",f.lcZ(2,1,"documents.field.date")," "))}function q(t,e){if(1&t&&(f.TgZ(0,"mat-cell"),f._uU(1),f.qZA()),2&t){var n=e.$implicit;f.xp6(1),f.hij(" ",n.created_at_str," ")}}function j(t,e){1&t&&(f.TgZ(0,"mat-header-cell",32),f._uU(1),f.ALo(2,"translate"),f.qZA()),2&t&&(f.xp6(1),f.hij("",f.lcZ(2,1,"documents.field.document")," "))}function C(t,e){if(1&t){var n=f.EpF();f.TgZ(0,"mat-cell"),f.TgZ(1,"button",33),f.NdJ("click",function(){var t=f.CHM(n).$implicit;return f.oxw().downloadDocument(null==t?null:t.id)}),f.TgZ(2,"span",34),f._uU(3),f.qZA(),f.qZA(),f.qZA()}if(2&t){var a=e.$implicit;f.xp6(3),f.Oqu(a.document)}}function O(t,e){1&t&&f._UZ(0,"mat-header-cell")}function R(t,e){if(1&t){var n=f.EpF();f.TgZ(0,"button",37),f.NdJ("click",function(){f.CHM(n);var t=f.oxw().$implicit;return f.oxw().openConfirmationDialog(t)}),f.TgZ(1,"mat-icon",38),f._uU(2,"delete"),f.qZA(),f.qZA()}}function U(t,e){if(1&t&&(f.TgZ(0,"mat-cell",35),f.YNc(1,R,3,0,"button",36),f.ALo(2,"async"),f.qZA()),2&t){var n=f.oxw();f.xp6(1),f.Q6J("ngIf",f.lcZ(2,1,n.isAdmin$))}}function Y(t,e){1&t&&f._UZ(0,"mat-header-row")}function N(t,e){1&t&&f._UZ(0,"mat-row")}function I(t,e){1&t&&(f.TgZ(0,"span"),f._uU(1),f.ALo(2,"translate"),f.qZA()),2&t&&(f.xp6(1),f.Oqu(f.lcZ(2,1,"no_data")))}function J(t,e){1&t&&(f.TgZ(0,"div",39),f._UZ(1,"mat-progress-bar",40),f.qZA())}var L,H=a.Bz.forChild([{path:"",component:(L=function(){function t(e,n,a,o,c,r,l){var u=this;i(this,t),this.notification=e,this.store=n,this.tenantService=a,this.translateService=o,this.dialog=c,this.authenticationService=r,this.tenantDocumentService=l,this.displayedColumns=["created_at","document","actions"],this.pageIndex=0,this.pageSizeOptions=[5,10,25,50,100],this.loader=!1,this.documentToUpload=null,this.photoUrl="",this.isAdmin$=this.authenticationService.isAdmin(),this.store.pipe((0,s.Ys)(d.Zb)).subscribe(function(t){return u.tenantID=t})}return r(t,[{key:"ngOnInit",value:function(){var t=this;this.tenantDocumentDataSource=new o.s(this.tenantDocumentService),this.tenantDocumentDataSource.meta$.subscribe(function(e){return t.meta=e}),this.tenantDocumentDataSource.load("",0,0,"updated_at","desc","tenant_id",this.tenantID)}},{key:"loadData",value:function(){this.tenantDocumentDataSource.load(this.search.nativeElement.value,this.paginator.pageIndex+1,this.paginator.pageSize,this.sort.active,this.sort.direction,"tenant_id",this.tenantID)}},{key:"clearSearch",value:function(){this.search.nativeElement.value="",this.loadData()}},{key:"onDocumentSelect",value:function(t){var e=this;if(t.length>0){this.documentToUpload=t.item(0);var n=new FileReader;n.onload=function(t){e.photoUrl=t.target.result},n.readAsDataURL(this.documentToUpload),this.loader=!0;var a=new FormData;a.append("document",this.documentToUpload),a.append("tenant_id",this.tenantID),this.uploadDocument(a)}}},{key:"uploadDocument",value:function(t){var e=this;this.tenantDocumentService.uploadDocument(t).subscribe(function(t){e.loader=!1,e.loadData(),e.notification.success(e.translateService.instant("documents.list.create"))},function(t){e.loader=!1})}},{key:"downloadDocument",value:function(t){var e=this;console.log(t),this.loader=!0,this.tenantDocumentService.fetchDocument(t).subscribe(function(t){var n=URL.createObjectURL(t);window.open(n,"_blank"),e.loader=!1},function(t){e.loader=!1})}},{key:"openConfirmationDialog",value:function(t){var e=this;this.dialogRef=this.dialog.open(u.z,{disableClose:!0}),this.dialogRef.afterClosed().subscribe(function(n){n&&e.delete(t),e.dialogRef=null})}},{key:"delete",value:function(t){var e=this;this.loader=!0,this.tenantDocumentService.delete(t).subscribe(function(t){e.loader=!1,e.loadData(),e.notification.success(e.translateService.instant("documents.list.delete"))},function(t){e.loader=!1})}}]),t}(),L.\u0275fac=function(t){return new(t||L)(f.Y36(h.gq),f.Y36(s.yh),f.Y36(m.a),f.Y36(p.sK),f.Y36(v.uw),f.Y36(g.$),f.Y36(b.l))},L.\u0275cmp=f.Xpm({type:L,selectors:[["robi-user-profile"]],viewQuery:function(t,e){var n;1&t&&(f.Gf(T,5),f.Gf(c.NW,7),f.Gf(l.YE,7)),2&t&&(f.iGM(n=f.CRH())&&(e.search=n.first),f.iGM(n=f.CRH())&&(e.paginator=n.first),f.iGM(n=f.CRH())&&(e.sort=n.first))},decls:38,vars:21,consts:[[1,"main-content"],[1,"container-fluid"],[1,"row"],[1,"col-md-12"],[1,"card"],["color","accent",1,"card-header","card-header-info"],[1,"card-title"],[1,"card-body"],[1,"row","search-form-section"],[1,"col-12",3,"hidden"],[1,"search-form-field"],["matInput","","autocomplete","off",3,"placeholder","disabled"],["search",""],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],[1,"table-responsive"],["matSort","","matSortActive","created_at","matSortDirection","desc","matSortDisableClear","",3,"dataSource"],["table",""],["matColumnDef","created_at"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","document"],["matColumnDef","actions"],[4,"matHeaderCellDef"],["class","button-row",4,"matCellDef"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[4,"ngIf"],["class","d-flex justify-content-center spinner-container",4,"ngIf"],["showFirstLastButtons","",3,"length","pageIndex","pageSizeOptions"],["pagination",""],[1,"col-md-4"],["mat-button","","matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["mat-sort-header",""],["mat-flat-button","",3,"click"],[1,"link"],[1,"button-row"],["mat-raised-button","","type","button","class","btn btn-link btn-sm btn-just-icon",3,"click",4,"ngIf"],["mat-raised-button","","type","button",1,"btn","btn-link","btn-sm","btn-just-icon",3,"click"],["color","warn"],[1,"d-flex","justify-content-center","spinner-container"],["color","green","mode","query","value","50","bufferValue","75"]],template:function(t,e){if(1&t&&(f.TgZ(0,"div",0),f.TgZ(1,"div",1),f.TgZ(2,"div",2),f.TgZ(3,"div",3),f.TgZ(4,"div",4),f.TgZ(5,"div",5),f.TgZ(6,"h4",6),f._uU(7),f.ALo(8,"translate"),f.qZA(),f.qZA(),f.TgZ(9,"div",7),f.TgZ(10,"div",8),f.TgZ(11,"div",9),f.ALo(12,"async"),f.TgZ(13,"mat-form-field",10),f._UZ(14,"input",11,12),f.ALo(16,"translate"),f.YNc(17,_,3,0,"button",13),f.qZA(),f.qZA(),f.qZA(),f.TgZ(18,"div",14),f.TgZ(19,"mat-table",15,16),f.ynx(21,17),f.YNc(22,k,3,3,"mat-header-cell",18),f.YNc(23,q,2,1,"mat-cell",19),f.BQk(),f.ynx(24,20),f.YNc(25,j,3,3,"mat-header-cell",18),f.YNc(26,C,4,1,"mat-cell",19),f.BQk(),f.ynx(27,21),f.YNc(28,O,1,0,"mat-header-cell",22),f.YNc(29,U,3,3,"mat-cell",23),f.BQk(),f.YNc(30,Y,1,0,"mat-header-row",24),f.YNc(31,N,1,0,"mat-row",25),f.qZA(),f.YNc(32,I,3,3,"span",26),f.YNc(33,J,2,0,"div",27),f.ALo(34,"async"),f._UZ(35,"mat-paginator",28,29),f.qZA(),f.qZA(),f.qZA(),f.qZA(),f._UZ(37,"div",30),f.qZA(),f.qZA(),f.qZA()),2&t){var n=f.MAs(15);f.xp6(7),f.Oqu(f.lcZ(8,13,"robi.tenant.document.title")),f.xp6(4),f.Q6J("hidden",!f.lcZ(12,15,e.isAdmin$)),f.xp6(3),f.s9C("placeholder",f.lcZ(16,17,"filter")),f.Q6J("disabled",0===(null==e.meta?null:e.meta.total)),f.xp6(3),f.Q6J("ngIf",n.value),f.xp6(2),f.Q6J("dataSource",e.tenantDocumentDataSource),f.xp6(11),f.Q6J("matHeaderRowDef",e.displayedColumns),f.xp6(1),f.Q6J("matRowDefColumns",e.displayedColumns),f.xp6(1),f.Q6J("ngIf",0===(null==e.meta?null:e.meta.total)),f.xp6(1),f.Q6J("ngIf",f.lcZ(34,19,null==e.tenantDocumentDataSource?null:e.tenantDocumentDataSource.loading$)||e.loader),f.xp6(2),f.Q6J("length",null==e.meta?null:e.meta.total)("pageIndex",e.pageIndex)("pageSizeOptions",e.pageSizeOptions)}},directives:[Z.KE,y.Nt,S.O5,D.BZ,l.YE,D.w1,D.fO,D.Dz,D.as,D.nj,c.NW,w.lW,Z.R9,x.Hw,D.ge,l.nU,D.ev,D.XQ,D.Gk,A.pW],pipes:[p.X$,S.Ov],styles:[""]}),L)}]),Q=n(83893),$=function(){var t=r(function t(){i(this,t)});return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=f.oAB({type:t}),t.\u0275inj=f.cJS({imports:[[Q.m,H]]}),t}()},19971:function(a,c,l){l.d(c,{a:function(){return p}});var u,s=l(65),d=l(26215),f=l(37716),h=l(91841),m=l(86710),p=((u=function(a){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&e(t,n)}(l,a);var c=n(l);function l(t,e){var n;return i(this,l),(n=c.call(this,t,"tenants")).store=e,n.selectedTenantSource=new d.X(null),n.selectedTenantChanges$=n.selectedTenantSource.asObservable(),n.localHttpClient=t,n}return r(l,[{key:"changeSelectedTenant",value:function(t){this.selectedTenantSource.next(t)}},{key:"search",value:function(e){var n="".concat(t(o(l.prototype),"getResourceUrl",this).call(this),"/search");return this.localHttpClient.post(n,{filter:e})}},{key:"create",value:function(e){return this.localHttpClient.post(t(o(l.prototype),"getResourceUrl",this).call(this),e)}}]),l}(s.b)).\u0275fac=function(t){return new(t||u)(f.LFG(h.eN),f.LFG(m.yh))},u.\u0275prov=f.Yz7({token:u,factory:u.\u0275fac,providedIn:"root"}),u)}}])}();
Function Calls
None |
Stats
MD5 | 003afdd883bd9a96d71901bb80a03e50 |
Eval Count | 0 |
Decode Time | 69 ms |