dealpos 25.32.0 → 25.32.1
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/browser/{chunk-U4E4GFA3.js → chunk-3BKJB4EB.js} +1 -1
- package/browser/{chunk-NVZO3MOZ.js → chunk-3HGB2KX7.js} +1 -1
- package/browser/{chunk-AU5NSB5E.js → chunk-3IE46WQL.js} +2 -2
- package/browser/{chunk-ZTCHNGR5.js → chunk-42NI5Y2B.js} +1 -1
- package/browser/{chunk-7ZF6XZWY.js → chunk-4D6P6ZN5.js} +1 -1
- package/browser/{chunk-X7I2U4GR.js → chunk-4O6KU55Y.js} +2 -2
- package/browser/{chunk-DBK7DX7N.js → chunk-5MDQYEMB.js} +1 -1
- package/browser/{chunk-X6OU5HV5.js → chunk-6S6Q7SED.js} +1 -1
- package/browser/{chunk-H73MVYHX.js → chunk-6VQ2WO2R.js} +1 -1
- package/browser/{chunk-RIGRHB27.js → chunk-6ZHV4H72.js} +2 -2
- package/browser/{chunk-UWM724IJ.js → chunk-A7WBJIJP.js} +1 -1
- package/browser/{chunk-2SAQDBKA.js → chunk-APVQGR37.js} +1 -1
- package/browser/{chunk-75MGYBWY.js → chunk-B7VLDW2D.js} +1 -1
- package/browser/{chunk-P23T2EVP.js → chunk-BAW2PCX4.js} +1 -1
- package/browser/{chunk-X7J7XCND.js → chunk-BL367NTS.js} +1 -1
- package/browser/{chunk-EANKU65K.js → chunk-CZ7F77ZP.js} +1 -1
- package/browser/{chunk-QYVR6FKS.js → chunk-DDVWUPV6.js} +1 -1
- package/browser/{chunk-BR7ZRI7I.js → chunk-DJA3CX47.js} +1 -1
- package/browser/{chunk-HWY3QH6A.js → chunk-DWBSJPMC.js} +1 -1
- package/browser/{chunk-KO5IVQZS.js → chunk-DZG3LGZ3.js} +1 -1
- package/browser/{chunk-OVRODHEF.js → chunk-EAPNMYHA.js} +1 -1
- package/browser/{chunk-D6K7GLV2.js → chunk-ERJFDQFX.js} +1 -1
- package/browser/{chunk-UUN5OBN5.js → chunk-F6ZI74HP.js} +1 -1
- package/browser/{chunk-WMDD6KTG.js → chunk-GFYZWIV4.js} +1 -1
- package/browser/{chunk-Q45IFUGA.js → chunk-GGEENO4M.js} +1 -1
- package/browser/{chunk-CNMEDN2J.js → chunk-GLZMFXE6.js} +2 -2
- package/browser/{chunk-GIBMYPUI.js → chunk-GPYDY4KE.js} +1 -1
- package/browser/{chunk-KTYLKTKA.js → chunk-HT7MBQYU.js} +1 -1
- package/browser/{chunk-U6AHQ7OA.js → chunk-I33SFWJL.js} +1 -1
- package/browser/{chunk-26RWIMQI.js → chunk-IHY7TFGQ.js} +5 -5
- package/browser/{chunk-S6XWBUA5.js → chunk-JCJZ6B6B.js} +1 -1
- package/browser/{chunk-VUVNZP6V.js → chunk-JDMYDBXN.js} +1 -1
- package/browser/{chunk-35BXZ4TH.js → chunk-JY4TU5LB.js} +1 -1
- package/browser/{chunk-7JLLV4R2.js → chunk-K25WE32L.js} +1 -1
- package/browser/{chunk-YQM3WRXG.js → chunk-KBE7CFXH.js} +1 -1
- package/browser/{chunk-DZPKIRUW.js → chunk-KFV3U2MG.js} +1 -1
- package/browser/{chunk-TLVGFFQE.js → chunk-KU2S24JO.js} +1 -1
- package/browser/{chunk-IXN5A6FJ.js → chunk-LB5S2KZX.js} +1 -1
- package/browser/{chunk-5W2FAFPB.js → chunk-LQKZB5PG.js} +1 -1
- package/browser/{chunk-VWM4STKR.js → chunk-LWWP5RGP.js} +1 -1
- package/browser/{chunk-CIEKEDPX.js → chunk-MA64N42O.js} +1 -1
- package/browser/{chunk-KJGIGEWE.js → chunk-MBSLDPJK.js} +1 -1
- package/browser/{chunk-N6VH67NA.js → chunk-MW5P4LM5.js} +1 -1
- package/browser/{chunk-CSPZYSGN.js → chunk-N66KZGXZ.js} +1 -1
- package/browser/{chunk-35MHVXKF.js → chunk-OM6SJITM.js} +1 -1
- package/browser/{chunk-4746NLIA.js → chunk-PFK4WL2H.js} +1 -1
- package/browser/{chunk-DS5ZUU74.js → chunk-PGQ4D2W6.js} +1 -1
- package/browser/{chunk-YF5Z2Q2D.js → chunk-PKRNN3GZ.js} +1 -1
- package/browser/{chunk-UP2OTHWF.js → chunk-QUWHJ3A2.js} +3 -3
- package/browser/{chunk-TTBALV7Z.js → chunk-RAKPTR5Z.js} +1 -1
- package/browser/{chunk-WULI4TL4.js → chunk-RDARJWEZ.js} +1 -1
- package/browser/{chunk-JBDCESLL.js → chunk-RJVF37GS.js} +1 -1
- package/browser/{chunk-5VBPLGVM.js → chunk-RSSYP5IL.js} +1 -1
- package/browser/{chunk-ALON6KSY.js → chunk-RTJEAKQW.js} +1 -1
- package/browser/{chunk-ZB4GWUQV.js → chunk-RVN4YQAX.js} +1 -1
- package/browser/{chunk-7PVGAJ73.js → chunk-SG2RKHTW.js} +1 -1
- package/browser/{chunk-5FA5XUCV.js → chunk-SL4VOAHY.js} +2 -2
- package/browser/{chunk-ZYLRH43R.js → chunk-TUL555Y3.js} +1 -1
- package/browser/chunk-UFHFKY4U.js +2 -0
- package/browser/{chunk-2TWP52P7.js → chunk-UZGPU4VW.js} +1 -1
- package/browser/{chunk-EL2PFWZR.js → chunk-VVYAL6Y7.js} +1 -1
- package/browser/{chunk-YH6FQJMF.js → chunk-WFX2XCFO.js} +1 -1
- package/browser/{chunk-P3YO27X5.js → chunk-WMOWM6XW.js} +1 -1
- package/browser/{chunk-5H4KL2KJ.js → chunk-WP4PM74K.js} +1 -1
- package/browser/{chunk-KTMKLUKP.js → chunk-WYO3ICL4.js} +1 -1
- package/browser/{chunk-FWKNIZZ3.js → chunk-XDPWF5CB.js} +1 -1
- package/browser/{chunk-WYYDJSSS.js → chunk-ZNWP7UK2.js} +1 -1
- package/browser/{chunk-U765C72H.js → chunk-ZSBJ4BDP.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-ZYWB664N.js → main-Q6EK5PKL.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-TTISSB2D.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ki,b as Ui}from"./chunk-Y46SSCQW.js";import{a as Ei}from"./chunk-BDDIDG5F.js";import{b as Fi}from"./chunk-UWUMG2GM.js";import{a as Be}from"./chunk-WORW36BL.js";import"./chunk-HOF45FIG.js";import{a as Me}from"./chunk-U6AHQ7OA.js";import{a as Te,b as Mi}from"./chunk-IC6A5ZGJ.js";import{b as Ti}from"./chunk-X3ZDNOUY.js";import"./chunk-2MKL5ANY.js";import{a as ee,b as ci}from"./chunk-GBLD5TDU.js";import{a as ei}from"./chunk-SH6FFPNP.js";import"./chunk-4I5BIZRN.js";import{a as fi}from"./chunk-VJO7M5YW.js";import{e as Ii}from"./chunk-UAWD35O3.js";import"./chunk-7OMZTXCR.js";import"./chunk-5KITFB7J.js";import{b as li}from"./chunk-4OMN7S35.js";import"./chunk-3RK6DDJD.js";import"./chunk-CPVATKT5.js";import{p as ii,q as ai}from"./chunk-MC6ZRPRO.js";import{e as si}from"./chunk-N67NWGYA.js";import"./chunk-5S6WJQZF.js";import"./chunk-GQZZBFFT.js";import"./chunk-YWYXEZ6N.js";import{a as Ci,b as Si}from"./chunk-VFMAQOEX.js";import{b as Di}from"./chunk-34NAGBZT.js";import{b as gi}from"./chunk-NMEH2GFA.js";import{a as Zt,b as Jt,c as $t}from"./chunk-CLOYYYH3.js";import{a as te}from"./chunk-WMDD6KTG.js";import"./chunk-H73MVYHX.js";import{c as ri,d as Ie,e as xi}from"./chunk-S5Y743CH.js";import{c as mi}from"./chunk-UDN6DKAR.js";import"./chunk-YBH7C53G.js";import"./chunk-I6HQHZRF.js";import"./chunk-PEI67MDS.js";import"./chunk-GX4UHBDK.js";import"./chunk-AGW24DIE.js";import{a as ni}from"./chunk-TX5UVUTO.js";import"./chunk-2PXEEOUO.js";import{a as ui,b as De}from"./chunk-C7X4JG6F.js";import{h as k,i as wi}from"./chunk-Q45IFUGA.js";import"./chunk-X6OU5HV5.js";import{a as We,b as E}from"./chunk-2SAQDBKA.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import{B as di,E as _i,N as bi,O as yi,a as Qt,e as ti,t as oi,w as pi}from"./chunk-KMVWE6IR.js";import{fa as mt,ga as Y,ha as Yt,l as zt,n as Xt,y as Kt}from"./chunk-4IJDCXOA.js";import{O as vi,o as hi}from"./chunk-QMH4FATM.js";import"./chunk-3X3O55NN.js";import"./chunk-GIKR6Y2K.js";import{d as H}from"./chunk-P67FCS5T.js";import"./chunk-SRELAFRM.js";import"./chunk-HLZJPEJB.js";import"./chunk-O4T67QQ3.js";import{a as P}from"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{D as Ht,E as qt,a as Nt,b as Ce,c as me,d as At,h as G,i as Gt,k as Ot,o as O,p as Wt,r as Oe,y as Se,z as Bt}from"./chunk-J577JGRK.js";import{c as jt}from"./chunk-WULI4TL4.js";import"./chunk-VUVNZP6V.js";import{a as de,d as W}from"./chunk-EQ6536VC.js";import"./chunk-5W2FAFPB.js";import{$a as l,$b as kt,Ca as yt,Db as $,Dc as se,Fa as lt,Ib as n,Ic as Vt,Jb as o,K as ge,Ka as wt,Kb as b,Kc as pe,Lb as ve,Lc as Pt,Mb as be,Md as R,Ob as w,Od as K,Pb as Dt,Pd as V,Qa as xt,Qb as y,Rb as m,Rd as ct,Sb as It,Tb as Tt,Td as N,Ub as ye,Uc as X,V as rt,Va as Ct,Vb as Ue,Wc as F,Wd as M,Xc as T,Y as gt,Zb as Mt,_b as Et,ad as xe,cd as ce,db as v,dc as j,ec as c,ed as Lt,fa as Ne,fc as x,gc as B,hc as Fe,hd as st,ia as ft,jc as g,ka as fe,kb as D,kc as f,la as ht,lb as he,lc as h,na as L,nc as Ut,o as ut,ob as U,oc as I,pc as C,qb as _,qc as Ft,t as at,u as _t,ua as vt,ub as Ae,ud as Rt,va as d,vb as s,wa as u,wb as St,xa as bt,xb as ke,xc as A,yc as Z,zb as Ge,zc as we}from"./chunk-ONCTFURX.js";import{a as nt,b as ot}from"./chunk-7DCB7DB2.js";function Wi(i,p){if(i&1){let e=w();n(0,"div",12)(1,"h6"),c(2,"User"),o(),n(3,"ng-select",13),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.ID,t)||(r.pageData.Filter.ID=t),u(t)}),o(),n(4,"h6"),c(5,"Type"),o(),n(6,"ng-select",14),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.LoginTypeID,t)||(r.pageData.Filter.LoginTypeID=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.ID),s("items",e.pageData.Options.User),l(3),g("ngModel",e.pageData.Filter.LoginTypeID),s("items",e.pageData.Options.LoginTypes)}}function Bi(i,p){if(i&1&&(n(0,"tr",15)(1,"td"),c(2),o(),n(3,"td"),c(4),o(),n(5,"td"),c(6),o(),n(7,"td"),c(8),o(),n(9,"td"),c(10),A(11,"date"),o()()),i&2){let e=p.$implicit;l(2),x(e._source.log.LoginID),l(2),x(e._source.log.typeID),l(2),x(e._source.log.AppID?e._source.log.AppID:"-"),l(2),x(e._source.log.IP),l(2),x(we(11,5,e._source["@timestamp"],"dd MMM yyyy HH:mm:ss"))}}function Hi(i,p){if(i&1){let e=w();n(0,"mat-paginator",16),y("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function qi(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),y("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,Wi,7,4,"ng-template",null,0,se),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th",7),c(11,"Login ID"),o(),n(12,"th",8),c(13,"Type"),o(),n(14,"th",8),c(15,"App ID"),o(),n(16,"th",8),c(17,"IP Address"),o(),n(18,"th",9),c(19,"Log In Time"),o()()(),n(20,"tbody"),_(21,Bi,12,8,"tr",10),o()(),n(22,"div"),_(23,Hi,1,3,"mat-paginator",11),o()()()()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(21),s("ngForOf",e.data.hits),l(2),s("ngIf",e.pagination.listTotal>0)}}var He=class i extends te{constructor(p,e){super(p,e,"user/user/LoginHistoryList","user/UserLoader/LoginHistoryList")}postInit(p){this.data.ListTotal=p.total.value}static \u0275fac=function(e){return new(e||i)(v(E),v(M))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","250px"],[2,"width","170px"],[2,"width","110px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an User...",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose a Type...",3,"ngModelChange","ngModel","items"],[1,"border-bottom"],[3,"page","length","pageSize","pageIndex"]],template:function(e,a){e&1&&_(0,qi,24,6,"mainpanel-cmp",1),e&2&&s("ngIf",a.data)},dependencies:[F,T,k,G,O,ee,H,ce],encapsulation:2})};var ji=()=>["/menu/Users/User/Users/Form"],zi=i=>({ID:i});function Xi(i,p){if(i&1){let e=w();n(0,"div",10)(1,"h6"),c(2,"User"),o(),n(3,"autocompleteV2",11),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.UserID,t)||(r.pageData.Filter.UserID=t),u(t)}),o(),n(4,"h6"),c(5,"Row Count"),o(),n(6,"input",12),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.UserID),l(3),g("ngModel",e.pageData.Filter.RowCount),s("max",1e4)}}function Ki(i,p){i&1&&(n(0,"th"),c(1,"User"),o())}function Yi(i,p){if(i&1&&(n(0,"a",16),c(1),o()),i&2){let e=m(2).$implicit;s("routerLink",I(3,ji))("queryParams",C(4,zi,e._source.log.parentId)),l(),x(e._source.log.username)}}function Qi(i,p){if(i&1&&(n(0,"span"),c(1),o()),i&2){let e=m(2).$implicit;l(),x(e._source.log.username)}}function Zi(i,p){if(i&1&&(n(0,"td"),_(1,Yi,2,6,"a",15)(2,Qi,2,1,"span",7),o()),i&2){let e=m(3);l(),s("ngIf",e.role.users.Edit),l(),s("ngIf",!e.role.users.Edit)}}function Ji(i,p){if(i&1&&(n(0,"tr",13),_(1,Zi,3,2,"td",7),n(2,"td"),c(3),A(4,"date"),o(),n(5,"td"),c(6),o(),b(7,"td",14),A(8,"newlines"),o()),i&2){let e=p.$implicit,a=m(2);l(),s("ngIf",a.data.showColumnUser),l(2),x(we(4,4,e._source["@timestamp"],"dd MMM yyyy HH:mm")),l(3),x(e._source.log.creator),l(),s("innerHtml",Z(8,7,e._source.log.note),Ct)}}function $i(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Note,t)||(r.pageData.Filter.Note=t),u(t)}),y("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,Xi,7,3,"ng-template",null,0,se),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr"),_(10,Ki,2,0,"th",7),n(11,"th"),c(12,"Modified"),o(),n(13,"th"),c(14,"Modify By"),o(),n(15,"th"),c(16,"Note"),o()()(),n(17,"tbody"),_(18,Ji,9,9,"tr",8),o()(),n(19,"div")(20,"mat-paginator",9),y("page",function(t){d(e);let r=m();return u(r.onPaginationChange(t))}),o()()()()()()}if(i&2){let e=m();s("pageData",e.menuData),g("text",e.pageData.Filter.Note),s("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(10),s("ngIf",e.data.showColumnUser),l(8),s("ngForOf",e.data.Data.hits),l(2),s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}var Pe=class i extends te{constructor(e,a,t,r){super(e,a,"user/user/UpdateList","user/UserLoader/HistoryLoader",null,t);this.httpService=a;this.role=r}static \u0275fac=function(a){return new(a||i)(v(E),v(M),v(R),v(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["pageFilterTemplate",""],["searchBoxPlaceholder","Search Note...",3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],["searchBoxPlaceholder","Search Note...",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[1,"dialog-filter"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[1,"border-bottom"],[3,"innerHtml"],[3,"routerLink","queryParams",4,"ngIf"],[3,"routerLink","queryParams"]],template:function(a,t){a&1&&_(0,$i,21,9,"mainpanel-cmp",1),a&2&&s("ngIf",t.data)},dependencies:[F,T,V,k,me,G,O,ee,De,bi,ce,hi],encapsulation:2})};var en=()=>["/menu/Users/User/Groups"],tn=i=>({selected:i}),nn=i=>({"border-top-0":i}),on=(i,p)=>({"bg-gradient-warning":i,"border-top-0":p});function an(i,p){i&1&&(n(0,"span",50),c(1," Name required."),o())}function rn(i,p){if(i&1){let e=w();ve(0),n(1,"div",59)(2,"div",60)(3,"div",61)(4,"input",62),y("click",function(){let t=d(e).$implicit,r=m(4);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",63),c(6),o()()(),be()}if(i&2){let e=p.$implicit,a=p.index,t=m().$implicit,r=m(3);l(2),s("matTooltip",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole?"":e.Description),l(),s("ngClass",C(8,nn,a/4>=1)),l(),ye("id",t.Name+a),s("disabled",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole)("checked",r.formData.Roles.indexOf(e.ID)>-1),l(),ye("for",t.Name+a),s("ngClass",Ft(10,on,e.Type==1,a/4>=1)),l(),x(e.Model)}}function ln(i,p){if(i&1){let e=w();ve(0),n(1,"div",68)(2,"div",69)(3,"div",70)(4,"input",71),y("click",function(){let t=d(e).$implicit,r=m(6);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",72),c(6),o()()(),be()}if(i&2){let e=p.$implicit,a=m().index,t=m(5);l(4),ye("id",e.Name+"more"+a),s("checked",t.formData.Roles.indexOf(e.ID)>-1),l(),ye("for",e.Name+"more"+a),ye("matTooltip",e.Description),l(),x(e.Model)}}function sn(i,p){if(i&1&&(ve(0),n(1,"div",67),_(2,ln,7,5,"ng-container",36),o(),be()),i&2){let e=p.$implicit;l(2),s("ngForOf",e)}}function cn(i,p){if(i&1&&(n(0,"div",64)(1,"a",65),c(2,"More Permission"),o(),n(3,"div",66)(4,"div",57),_(5,sn,3,1,"ng-container",36),o()()()),i&2){let e=m().index,a=m(3);l(5),s("ngForOf",a.listMorePermission[e])}}function mn(i,p){if(i&1){let e=w();n(0,"div",51)(1,"div",52)(2,"div",53)(3,"p",54),c(4),o(),n(5,"input",55),y("change",function(t){let r=d(e).$implicit,S=m(3);return u(S.selectGroupRole(t.target.checked,r.ID))}),o()()(),n(6,"div",56)(7,"div",57),_(8,rn,7,13,"ng-container",36),o(),_(9,cn,6,1,"div",58),o()()}if(i&2){let e=p.$implicit,a=m(3);s("matTooltip",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole?"You cannot edit this section because this Group is the last group with User Access":""),l(4),B(" ",e.Name," "),l(),s("disabled",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole),l(3),s("ngForOf",e.ListRole),l(),s("ngIf",(e.ListMorePermission==null?null:e.ListMorePermission.length)>0)}}function pn(i,p){if(i&1){let e=w();n(0,"tr")(1,"td"),c(2),o(),n(3,"td",73)(4,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(5,"td",73)(6,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(7,"td",73)(8,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(9,"td",73)(10,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()()()}if(i&2){let e=p.$implicit,a=p.index;l(2),x(e.Name),l(2),Ue("name","noaccess",a,""),g("ngModel",e.AccessTypeID),s("value",0),l(2),Ue("name","peek",a,""),g("ngModel",e.AccessTypeID),s("value",1),l(2),Ue("name","read",a,""),g("ngModel",e.AccessTypeID),s("value",2),l(2),Ue("name","write",a,""),g("ngModel",e.AccessTypeID),s("value",3)}}function dn(i,p){if(i&1){let e=w();n(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"input",10,0),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Name,t)||(r.formData.Group.Name=t),u(t)}),o(),n(6,"label",11),c(7,"Group Name"),o(),_(8,an,2,0,"span",12),o(),n(9,"ul",13)(10,"li",14)(11,"button",15),c(12," Permission "),o()(),n(13,"li",14)(14,"button",16),c(15," Outlet "),o()(),n(16,"li",14)(17,"button",17),c(18," Description "),o()(),n(19,"li",14)(20,"button",18),c(21," Restriction "),o()()(),n(22,"div",19)(23,"div",20),_(24,mn,10,5,"div",21),o(),n(25,"div",22)(26,"div",23)(27,"table",24)(28,"thead",25)(29,"tr")(30,"th",26),c(31,"Name"),o(),n(32,"th",27)(33,"span",28),c(34,"No Access"),o(),n(35,"input",29),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(36,"th",30)(37,"span",28),c(38,"Peek"),o(),n(39,"input",31),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(40,"th",32)(41,"span",28),c(42,"Read"),o(),n(43,"input",33),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(44,"th",34)(45,"span",28),c(46,"Write"),o(),n(47,"input",35),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()()()(),n(48,"tbody"),_(49,pn,11,17,"tr",36),o()()()(),n(50,"div",37)(51,"div",7)(52,"div",38)(53,"div",9)(54,"textarea",39),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Description,t)||(r.formData.Group.Description=t),u(t)}),c(55," "),o(),n(56,"label",40),c(57,"Description"),o()()()()(),n(58,"div",41)(59,"div",7)(60,"div",42)(61,"div",9)(62,"input",43),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.DataDaysRange,t)||(r.formData.Group.DataDaysRange=t),u(t)}),o(),n(63,"label",44),c(64,"Data Days Range"),o()()(),n(65,"div",42)(66,"div",45)(67,"label"),c(68,"Live Chat Enabled"),o(),n(69,"radio-options",46),h("modelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.LiveChatEnabled,t)||(r.formData.Group.LiveChatEnabled=t),u(t)}),o()()()(),n(70,"div",7)(71,"div",42)(72,"div",47)(73,"ng-select",48),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.BrandID,t)||(r.formData.Group.BrandID=t),u(t)}),o(),n(74,"label",49),c(75,"Brand"),o()()()()()()()()()}if(i&2){let e=j(5),a=m(2);l(4),g("ngModel",a.formData.Group.Name),l(4),s("ngIf",e.invalid&&(e.dirty||e.touched)),l(16),s("ngForOf",a.options),l(11),g("ngModel",a.checkAll),s("value",0),l(4),g("ngModel",a.checkAll),s("value",1),l(4),g("ngModel",a.checkAll),s("value",2),l(4),g("ngModel",a.checkAll),s("value",3),l(2),s("ngForOf",a.formData.Outlets),l(5),g("ngModel",a.formData.Group.Description),l(8),g("ngModel",a.formData.Group.DataDaysRange),l(7),g("model",a.formData.Group.LiveChatEnabled),l(3),s("ngClass",C(18,tn,a.formData.Group.BrandID)),l(),g("ngModel",a.formData.Group.BrandID),s("items",a.Brands)}}function un(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2)(1,"actions")(2,"a",3),c(3,"Cancel"),o(),n(4,"button",4),y("click",function(){d(e);let t=m();return u(t.onSubmitForm())}),c(5," Submit "),o()(),n(6,"content"),_(7,dn,76,20,"div",5),o()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("routerLink",I(5,en)),l(5),s("ngIf",e.formData.Group)}}var je=class i extends Me{constructor(e,a,t,r,S,J,q,Q){super(e,a,"User/GroupLoader/Form",t);this.toaster=r;this.router=S;this.actRoute=J;this.dataDaysRangeService=q;this.authService=Q}checkAll=-1;listMorePermission=[];Brands=[];userGroupName="Users";onSelectRole(e){var a=this.formData.Roles.indexOf(e);a>-1?this.formData.Roles.splice(a,1):this.formData.Roles.push(e)}selectGroupRole(e,a){let t=this.options.find(r=>r.ID==a);if(t){let r=t.ListRole.map(q=>q.ID),S=t.ListMorePermission.map(q=>q.ID),J=[...r,...S];e?(this.formData.Roles=[...this.formData.Roles,...J],this.formData.Roles=this.formData.Roles.filter((q,Q,_e)=>_e.indexOf(q)==Q)):this.formData.Roles=this.formData.Roles.filter(q=>J.findIndex(Q=>Q==q)==-1)}}postBindForm(e){e.Form.Group.Name&&(this.menuData.H=`Edit Group - ${e.Form.Group.Name}`),this.Brands=e.Brands,this.setListMorePermission()}onSubmitForm(){if(de.IsEmpty(this.formData.Group.Name)){this.toaster.error("Group name is required",P.Error);return}this.onSubmit("user/group/Submit")}onSubmitSuccess(e){this.refreshToken(),this.saveDataDaysRange(e.DataDaysRange),this.dataDaysRangeService.bindDataDaysRange();let a=this.actRoute.snapshot.queryParams;de.IsEmpty(a.ID)?this.toaster.success("Success add group",P.Success):this.toaster.info(`
|
|
1
|
+
import{a as ki,b as Ui}from"./chunk-Y46SSCQW.js";import{a as Ei}from"./chunk-BDDIDG5F.js";import{b as Fi}from"./chunk-UWUMG2GM.js";import{a as Be}from"./chunk-WORW36BL.js";import"./chunk-HOF45FIG.js";import{a as Me}from"./chunk-I33SFWJL.js";import{a as Te,b as Mi}from"./chunk-IC6A5ZGJ.js";import{b as Ti}from"./chunk-X3ZDNOUY.js";import"./chunk-2MKL5ANY.js";import{a as ee,b as ci}from"./chunk-GBLD5TDU.js";import{a as ei}from"./chunk-SH6FFPNP.js";import"./chunk-4I5BIZRN.js";import{a as fi}from"./chunk-VJO7M5YW.js";import{e as Ii}from"./chunk-UAWD35O3.js";import"./chunk-7OMZTXCR.js";import"./chunk-5KITFB7J.js";import{b as li}from"./chunk-4OMN7S35.js";import"./chunk-3RK6DDJD.js";import"./chunk-CPVATKT5.js";import{p as ii,q as ai}from"./chunk-MC6ZRPRO.js";import{e as si}from"./chunk-N67NWGYA.js";import"./chunk-5S6WJQZF.js";import"./chunk-GQZZBFFT.js";import"./chunk-YWYXEZ6N.js";import{a as Ci,b as Si}from"./chunk-VFMAQOEX.js";import{b as Di}from"./chunk-34NAGBZT.js";import{b as gi}from"./chunk-NMEH2GFA.js";import{a as Zt,b as Jt,c as $t}from"./chunk-CLOYYYH3.js";import{a as te}from"./chunk-GFYZWIV4.js";import"./chunk-6VQ2WO2R.js";import{c as ri,d as Ie,e as xi}from"./chunk-S5Y743CH.js";import{c as mi}from"./chunk-UDN6DKAR.js";import"./chunk-YBH7C53G.js";import"./chunk-I6HQHZRF.js";import"./chunk-PEI67MDS.js";import"./chunk-GX4UHBDK.js";import"./chunk-AGW24DIE.js";import{a as ni}from"./chunk-TX5UVUTO.js";import"./chunk-2PXEEOUO.js";import{a as ui,b as De}from"./chunk-C7X4JG6F.js";import{h as k,i as wi}from"./chunk-GGEENO4M.js";import"./chunk-6S6Q7SED.js";import{a as We,b as E}from"./chunk-APVQGR37.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import{B as di,E as _i,N as bi,O as yi,a as Qt,e as ti,t as oi,w as pi}from"./chunk-KMVWE6IR.js";import{fa as mt,ga as Y,ha as Yt,l as zt,n as Xt,y as Kt}from"./chunk-4IJDCXOA.js";import{O as vi,o as hi}from"./chunk-QMH4FATM.js";import"./chunk-3X3O55NN.js";import"./chunk-GIKR6Y2K.js";import{d as H}from"./chunk-P67FCS5T.js";import"./chunk-SRELAFRM.js";import"./chunk-HLZJPEJB.js";import"./chunk-O4T67QQ3.js";import{a as P}from"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{D as Ht,E as qt,a as Nt,b as Ce,c as me,d as At,h as G,i as Gt,k as Ot,o as O,p as Wt,r as Oe,y as Se,z as Bt}from"./chunk-J577JGRK.js";import{c as jt}from"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import{a as de,d as W}from"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$a as l,$b as kt,Ca as yt,Db as $,Dc as se,Fa as lt,Ib as n,Ic as Vt,Jb as o,K as ge,Ka as wt,Kb as b,Kc as pe,Lb as ve,Lc as Pt,Mb as be,Md as R,Ob as w,Od as K,Pb as Dt,Pd as V,Qa as xt,Qb as y,Rb as m,Rd as ct,Sb as It,Tb as Tt,Td as N,Ub as ye,Uc as X,V as rt,Va as Ct,Vb as Ue,Wc as F,Wd as M,Xc as T,Y as gt,Zb as Mt,_b as Et,ad as xe,cd as ce,db as v,dc as j,ec as c,ed as Lt,fa as Ne,fc as x,gc as B,hc as Fe,hd as st,ia as ft,jc as g,ka as fe,kb as D,kc as f,la as ht,lb as he,lc as h,na as L,nc as Ut,o as ut,ob as U,oc as I,pc as C,qb as _,qc as Ft,t as at,u as _t,ua as vt,ub as Ae,ud as Rt,va as d,vb as s,wa as u,wb as St,xa as bt,xb as ke,xc as A,yc as Z,zb as Ge,zc as we}from"./chunk-ONCTFURX.js";import{a as nt,b as ot}from"./chunk-7DCB7DB2.js";function Wi(i,p){if(i&1){let e=w();n(0,"div",12)(1,"h6"),c(2,"User"),o(),n(3,"ng-select",13),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.ID,t)||(r.pageData.Filter.ID=t),u(t)}),o(),n(4,"h6"),c(5,"Type"),o(),n(6,"ng-select",14),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.LoginTypeID,t)||(r.pageData.Filter.LoginTypeID=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.ID),s("items",e.pageData.Options.User),l(3),g("ngModel",e.pageData.Filter.LoginTypeID),s("items",e.pageData.Options.LoginTypes)}}function Bi(i,p){if(i&1&&(n(0,"tr",15)(1,"td"),c(2),o(),n(3,"td"),c(4),o(),n(5,"td"),c(6),o(),n(7,"td"),c(8),o(),n(9,"td"),c(10),A(11,"date"),o()()),i&2){let e=p.$implicit;l(2),x(e._source.log.LoginID),l(2),x(e._source.log.typeID),l(2),x(e._source.log.AppID?e._source.log.AppID:"-"),l(2),x(e._source.log.IP),l(2),x(we(11,5,e._source["@timestamp"],"dd MMM yyyy HH:mm:ss"))}}function Hi(i,p){if(i&1){let e=w();n(0,"mat-paginator",16),y("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function qi(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),y("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,Wi,7,4,"ng-template",null,0,se),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th",7),c(11,"Login ID"),o(),n(12,"th",8),c(13,"Type"),o(),n(14,"th",8),c(15,"App ID"),o(),n(16,"th",8),c(17,"IP Address"),o(),n(18,"th",9),c(19,"Log In Time"),o()()(),n(20,"tbody"),_(21,Bi,12,8,"tr",10),o()(),n(22,"div"),_(23,Hi,1,3,"mat-paginator",11),o()()()()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(21),s("ngForOf",e.data.hits),l(2),s("ngIf",e.pagination.listTotal>0)}}var He=class i extends te{constructor(p,e){super(p,e,"user/user/LoginHistoryList","user/UserLoader/LoginHistoryList")}postInit(p){this.data.ListTotal=p.total.value}static \u0275fac=function(e){return new(e||i)(v(E),v(M))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","250px"],[2,"width","170px"],[2,"width","110px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an User...",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose a Type...",3,"ngModelChange","ngModel","items"],[1,"border-bottom"],[3,"page","length","pageSize","pageIndex"]],template:function(e,a){e&1&&_(0,qi,24,6,"mainpanel-cmp",1),e&2&&s("ngIf",a.data)},dependencies:[F,T,k,G,O,ee,H,ce],encapsulation:2})};var ji=()=>["/menu/Users/User/Users/Form"],zi=i=>({ID:i});function Xi(i,p){if(i&1){let e=w();n(0,"div",10)(1,"h6"),c(2,"User"),o(),n(3,"autocompleteV2",11),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.UserID,t)||(r.pageData.Filter.UserID=t),u(t)}),o(),n(4,"h6"),c(5,"Row Count"),o(),n(6,"input",12),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.UserID),l(3),g("ngModel",e.pageData.Filter.RowCount),s("max",1e4)}}function Ki(i,p){i&1&&(n(0,"th"),c(1,"User"),o())}function Yi(i,p){if(i&1&&(n(0,"a",16),c(1),o()),i&2){let e=m(2).$implicit;s("routerLink",I(3,ji))("queryParams",C(4,zi,e._source.log.parentId)),l(),x(e._source.log.username)}}function Qi(i,p){if(i&1&&(n(0,"span"),c(1),o()),i&2){let e=m(2).$implicit;l(),x(e._source.log.username)}}function Zi(i,p){if(i&1&&(n(0,"td"),_(1,Yi,2,6,"a",15)(2,Qi,2,1,"span",7),o()),i&2){let e=m(3);l(),s("ngIf",e.role.users.Edit),l(),s("ngIf",!e.role.users.Edit)}}function Ji(i,p){if(i&1&&(n(0,"tr",13),_(1,Zi,3,2,"td",7),n(2,"td"),c(3),A(4,"date"),o(),n(5,"td"),c(6),o(),b(7,"td",14),A(8,"newlines"),o()),i&2){let e=p.$implicit,a=m(2);l(),s("ngIf",a.data.showColumnUser),l(2),x(we(4,4,e._source["@timestamp"],"dd MMM yyyy HH:mm")),l(3),x(e._source.log.creator),l(),s("innerHtml",Z(8,7,e._source.log.note),Ct)}}function $i(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Note,t)||(r.pageData.Filter.Note=t),u(t)}),y("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,Xi,7,3,"ng-template",null,0,se),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr"),_(10,Ki,2,0,"th",7),n(11,"th"),c(12,"Modified"),o(),n(13,"th"),c(14,"Modify By"),o(),n(15,"th"),c(16,"Note"),o()()(),n(17,"tbody"),_(18,Ji,9,9,"tr",8),o()(),n(19,"div")(20,"mat-paginator",9),y("page",function(t){d(e);let r=m();return u(r.onPaginationChange(t))}),o()()()()()()}if(i&2){let e=m();s("pageData",e.menuData),g("text",e.pageData.Filter.Note),s("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(10),s("ngIf",e.data.showColumnUser),l(8),s("ngForOf",e.data.Data.hits),l(2),s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}var Pe=class i extends te{constructor(e,a,t,r){super(e,a,"user/user/UpdateList","user/UserLoader/HistoryLoader",null,t);this.httpService=a;this.role=r}static \u0275fac=function(a){return new(a||i)(v(E),v(M),v(R),v(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["pageFilterTemplate",""],["searchBoxPlaceholder","Search Note...",3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],["searchBoxPlaceholder","Search Note...",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[1,"dialog-filter"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[1,"border-bottom"],[3,"innerHtml"],[3,"routerLink","queryParams",4,"ngIf"],[3,"routerLink","queryParams"]],template:function(a,t){a&1&&_(0,$i,21,9,"mainpanel-cmp",1),a&2&&s("ngIf",t.data)},dependencies:[F,T,V,k,me,G,O,ee,De,bi,ce,hi],encapsulation:2})};var en=()=>["/menu/Users/User/Groups"],tn=i=>({selected:i}),nn=i=>({"border-top-0":i}),on=(i,p)=>({"bg-gradient-warning":i,"border-top-0":p});function an(i,p){i&1&&(n(0,"span",50),c(1," Name required."),o())}function rn(i,p){if(i&1){let e=w();ve(0),n(1,"div",59)(2,"div",60)(3,"div",61)(4,"input",62),y("click",function(){let t=d(e).$implicit,r=m(4);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",63),c(6),o()()(),be()}if(i&2){let e=p.$implicit,a=p.index,t=m().$implicit,r=m(3);l(2),s("matTooltip",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole?"":e.Description),l(),s("ngClass",C(8,nn,a/4>=1)),l(),ye("id",t.Name+a),s("disabled",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole)("checked",r.formData.Roles.indexOf(e.ID)>-1),l(),ye("for",t.Name+a),s("ngClass",Ft(10,on,e.Type==1,a/4>=1)),l(),x(e.Model)}}function ln(i,p){if(i&1){let e=w();ve(0),n(1,"div",68)(2,"div",69)(3,"div",70)(4,"input",71),y("click",function(){let t=d(e).$implicit,r=m(6);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",72),c(6),o()()(),be()}if(i&2){let e=p.$implicit,a=m().index,t=m(5);l(4),ye("id",e.Name+"more"+a),s("checked",t.formData.Roles.indexOf(e.ID)>-1),l(),ye("for",e.Name+"more"+a),ye("matTooltip",e.Description),l(),x(e.Model)}}function sn(i,p){if(i&1&&(ve(0),n(1,"div",67),_(2,ln,7,5,"ng-container",36),o(),be()),i&2){let e=p.$implicit;l(2),s("ngForOf",e)}}function cn(i,p){if(i&1&&(n(0,"div",64)(1,"a",65),c(2,"More Permission"),o(),n(3,"div",66)(4,"div",57),_(5,sn,3,1,"ng-container",36),o()()()),i&2){let e=m().index,a=m(3);l(5),s("ngForOf",a.listMorePermission[e])}}function mn(i,p){if(i&1){let e=w();n(0,"div",51)(1,"div",52)(2,"div",53)(3,"p",54),c(4),o(),n(5,"input",55),y("change",function(t){let r=d(e).$implicit,S=m(3);return u(S.selectGroupRole(t.target.checked,r.ID))}),o()()(),n(6,"div",56)(7,"div",57),_(8,rn,7,13,"ng-container",36),o(),_(9,cn,6,1,"div",58),o()()}if(i&2){let e=p.$implicit,a=m(3);s("matTooltip",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole?"You cannot edit this section because this Group is the last group with User Access":""),l(4),B(" ",e.Name," "),l(),s("disabled",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole),l(3),s("ngForOf",e.ListRole),l(),s("ngIf",(e.ListMorePermission==null?null:e.ListMorePermission.length)>0)}}function pn(i,p){if(i&1){let e=w();n(0,"tr")(1,"td"),c(2),o(),n(3,"td",73)(4,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(5,"td",73)(6,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(7,"td",73)(8,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(9,"td",73)(10,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()()()}if(i&2){let e=p.$implicit,a=p.index;l(2),x(e.Name),l(2),Ue("name","noaccess",a,""),g("ngModel",e.AccessTypeID),s("value",0),l(2),Ue("name","peek",a,""),g("ngModel",e.AccessTypeID),s("value",1),l(2),Ue("name","read",a,""),g("ngModel",e.AccessTypeID),s("value",2),l(2),Ue("name","write",a,""),g("ngModel",e.AccessTypeID),s("value",3)}}function dn(i,p){if(i&1){let e=w();n(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"input",10,0),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Name,t)||(r.formData.Group.Name=t),u(t)}),o(),n(6,"label",11),c(7,"Group Name"),o(),_(8,an,2,0,"span",12),o(),n(9,"ul",13)(10,"li",14)(11,"button",15),c(12," Permission "),o()(),n(13,"li",14)(14,"button",16),c(15," Outlet "),o()(),n(16,"li",14)(17,"button",17),c(18," Description "),o()(),n(19,"li",14)(20,"button",18),c(21," Restriction "),o()()(),n(22,"div",19)(23,"div",20),_(24,mn,10,5,"div",21),o(),n(25,"div",22)(26,"div",23)(27,"table",24)(28,"thead",25)(29,"tr")(30,"th",26),c(31,"Name"),o(),n(32,"th",27)(33,"span",28),c(34,"No Access"),o(),n(35,"input",29),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(36,"th",30)(37,"span",28),c(38,"Peek"),o(),n(39,"input",31),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(40,"th",32)(41,"span",28),c(42,"Read"),o(),n(43,"input",33),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(44,"th",34)(45,"span",28),c(46,"Write"),o(),n(47,"input",35),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),y("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()()()(),n(48,"tbody"),_(49,pn,11,17,"tr",36),o()()()(),n(50,"div",37)(51,"div",7)(52,"div",38)(53,"div",9)(54,"textarea",39),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Description,t)||(r.formData.Group.Description=t),u(t)}),c(55," "),o(),n(56,"label",40),c(57,"Description"),o()()()()(),n(58,"div",41)(59,"div",7)(60,"div",42)(61,"div",9)(62,"input",43),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.DataDaysRange,t)||(r.formData.Group.DataDaysRange=t),u(t)}),o(),n(63,"label",44),c(64,"Data Days Range"),o()()(),n(65,"div",42)(66,"div",45)(67,"label"),c(68,"Live Chat Enabled"),o(),n(69,"radio-options",46),h("modelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.LiveChatEnabled,t)||(r.formData.Group.LiveChatEnabled=t),u(t)}),o()()()(),n(70,"div",7)(71,"div",42)(72,"div",47)(73,"ng-select",48),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.BrandID,t)||(r.formData.Group.BrandID=t),u(t)}),o(),n(74,"label",49),c(75,"Brand"),o()()()()()()()()()}if(i&2){let e=j(5),a=m(2);l(4),g("ngModel",a.formData.Group.Name),l(4),s("ngIf",e.invalid&&(e.dirty||e.touched)),l(16),s("ngForOf",a.options),l(11),g("ngModel",a.checkAll),s("value",0),l(4),g("ngModel",a.checkAll),s("value",1),l(4),g("ngModel",a.checkAll),s("value",2),l(4),g("ngModel",a.checkAll),s("value",3),l(2),s("ngForOf",a.formData.Outlets),l(5),g("ngModel",a.formData.Group.Description),l(8),g("ngModel",a.formData.Group.DataDaysRange),l(7),g("model",a.formData.Group.LiveChatEnabled),l(3),s("ngClass",C(18,tn,a.formData.Group.BrandID)),l(),g("ngModel",a.formData.Group.BrandID),s("items",a.Brands)}}function un(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2)(1,"actions")(2,"a",3),c(3,"Cancel"),o(),n(4,"button",4),y("click",function(){d(e);let t=m();return u(t.onSubmitForm())}),c(5," Submit "),o()(),n(6,"content"),_(7,dn,76,20,"div",5),o()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("routerLink",I(5,en)),l(5),s("ngIf",e.formData.Group)}}var je=class i extends Me{constructor(e,a,t,r,S,J,q,Q){super(e,a,"User/GroupLoader/Form",t);this.toaster=r;this.router=S;this.actRoute=J;this.dataDaysRangeService=q;this.authService=Q}checkAll=-1;listMorePermission=[];Brands=[];userGroupName="Users";onSelectRole(e){var a=this.formData.Roles.indexOf(e);a>-1?this.formData.Roles.splice(a,1):this.formData.Roles.push(e)}selectGroupRole(e,a){let t=this.options.find(r=>r.ID==a);if(t){let r=t.ListRole.map(q=>q.ID),S=t.ListMorePermission.map(q=>q.ID),J=[...r,...S];e?(this.formData.Roles=[...this.formData.Roles,...J],this.formData.Roles=this.formData.Roles.filter((q,Q,_e)=>_e.indexOf(q)==Q)):this.formData.Roles=this.formData.Roles.filter(q=>J.findIndex(Q=>Q==q)==-1)}}postBindForm(e){e.Form.Group.Name&&(this.menuData.H=`Edit Group - ${e.Form.Group.Name}`),this.Brands=e.Brands,this.setListMorePermission()}onSubmitForm(){if(de.IsEmpty(this.formData.Group.Name)){this.toaster.error("Group name is required",P.Error);return}this.onSubmit("user/group/Submit")}onSubmitSuccess(e){this.refreshToken(),this.saveDataDaysRange(e.DataDaysRange),this.dataDaysRangeService.bindDataDaysRange();let a=this.actRoute.snapshot.queryParams;de.IsEmpty(a.ID)?this.toaster.success("Success add group",P.Success):this.toaster.info(`
|
|
2
2
|
The user group has been updated.<br/>
|
|
3
3
|
Please reload to apply the changes.
|
|
4
4
|
`,P.Info,{enableHtml:!0}),this.router.navigate(["/menu/Users/User/Groups"])}saveDataDaysRange(e){localStorage.setItem("DataDaysRange",JSON.stringify(e))}setListMorePermission(){this.data.Options.forEach((a,t)=>{this.listMorePermission[t]=this.generateListPermission(a.ListMorePermission)})}generateListPermission(e){let a=[];return e.forEach(t=>{a.length==0?a[a.length]=[t]:a[a.length-1].length<=7?a[a.length-1].push(t):a[a.length]=[t]}),a}refreshToken(){this.data?.IsSameGroup&&this.authService.refreshToken()}SelectAll(e,a){a.forEach(function(t){t.AccessTypeID=e})}static \u0275fac=function(a){return new(a||i)(v(E),v(M),v(R),v(N),v(K),v(R),v(Ei),v(jt))};static \u0275cmp=D({type:i,selectors:[["CustomerDisplay-groups-form"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["roleName","ngModel"],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click"],["class","container-fluid p-10",4,"ngIf"],[1,"container-fluid","p-10"],[1,"row"],[1,"col"],[1,"form-floating-outline"],["type","text","id","groupName","name","grpName","placeholder","Group Name","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","groupName"],["class","control-label text-danger border-0",4,"ngIf"],["id","myTabs","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","permission-tab","data-bs-toggle","tab","data-bs-target","#permission","role","tab","aria-selected","true",1,"nav-link","active"],["id","outlet-tab","data-bs-toggle","tab","data-bs-target","#outlet","role","tab","aria-selected","false",1,"nav-link"],["id","description-tab","data-bs-toggle","tab","data-bs-target","#description","role","tab","aria-selected","false",1,"nav-link"],["id","description-tab","data-bs-toggle","tab","data-bs-target","#restriction","role","tab","aria-selected","false",1,"nav-link"],["id","myTabContecnt",1,"tab-content"],["id","permission","role","tabpanel",1,"tab-pane","fade","show","active","mt-0","p-5"],["class","row my-5","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],["id","outlet","role","tabpanel",1,"tab-pane","fade","show","mt-0","p-7"],[1,"row","border-top-0"],[1,"table","table-bordered"],[1,"thead-light","w-250px"],[1,"border-end"],[1,"border-end","text-center",2,"width","90px"],[1,"d-block","border-bottom","pb-3","mb-3"],["type","radio","name","noaccess",3,"ngModelChange","change","ngModel","value"],["matTooltipPosition","above","matTooltip","User can check Inventory at outlet",1,"border-end","text-center",2,"width","90px"],["type","radio","name","peek",3,"ngModelChange","change","ngModel","value"],["matTooltipPosition","above","matTooltip","User can check Inventory + Orders at outlet",1,"border-end","text-center",2,"width","90px"],["type","radio","name","read",3,"ngModelChange","change","ngModel","value"],["matTooltipPosition","above","matTooltip","User can create new orders at outlet",1,"text-center",2,"width","90px"],["type","radio","name","write",3,"ngModelChange","change","ngModel","value"],[4,"ngFor","ngForOf"],["id","description","role","tabpanel",1,"tab-pane","face","show","mt-5","p-5"],[1,"col-sm-12"],["id","desc",1,"form-control",2,"width","100%",3,"ngModelChange","ngModel"],["for","desc"],["id","restriction","role","tabpanel",1,"tab-pane","fade","show","mt-5","p-5"],[1,"col-sm-6"],["type","text","autoNum","","id","days","placeholder","Data Days Range",1,"form-control",3,"ngModelChange","ngModel"],["for","days"],[1,"form-floating-outline","radio","border","rounded"],[3,"modelChange","model"],[1,"form-floating-outline",3,"ngClass"],["id","brand","bindLabel","Value","bindValue","Key",1,"productform","w-100",3,"ngModelChange","ngModel","items"],["for","brand",1,"ng-select"],[1,"control-label","text-danger","border-0"],["matTooltipPosition","above",1,"row","my-5",3,"matTooltip"],[1,"col-sm-2","border",2,"background-color","#f6f6f6","font-weight","bold","padding","5px","text-align","center"],[1,"d-flex","align-items-center"],[1,"mb-0",2,"flex","1","text-align","center"],["type","checkbox",2,"margin-left","auto",3,"change","disabled"],[1,"col-sm-10","g-0"],[1,"row","g-0"],["class","col-md-3 border border-top-0 ps-5 border-start-0 d-flex align-items-center","style","min-height: 32px",4,"ngIf"],[1,"col-3","px-0"],["matTooltipPosition","above",1,"input-group",3,"matTooltip"],[1,"input-group-text","border","border-start-0",3,"ngClass"],["type","checkbox",3,"click","id","disabled","checked"],[1,"form-control","border",3,"ngClass","for"],[1,"col-md-3","border","border-top-0","ps-5","border-start-0","d-flex","align-items-center",2,"min-height","32px"],["href","#","data-bs-toggle","dropdown","matTooltipPosition","above","matTooltip","More Permission",1,"simple-text","text-start"],[1,"dropdown-menu",2,"max-height","400px","overflow","auto","width","230px"],[1,"col-12","px-0"],[1,"dropdown-item","h6","py-0","px-3"],[1,"input-group"],[1,"input-group-text","border"],["type","checkbox",3,"click","id","checked"],["matTooltipPosition","above",1,"form-control","border",3,"for","matTooltip"],[2,"text-align","center"],["type","radio",3,"ngModelChange","ngModel","name","value"]],template:function(a,t){a&1&&_(0,un,8,6,"mainpanel-cmp",1),a&2&&s("ngIf",t.data&&t.formData)},dependencies:[X,F,T,V,k,me,Oe,G,Se,O,H,De,Ie,Y],styles:[".w-250px[_ngcontent-%COMP%]{width:250px}"]})};var _n=()=>["/menu/Users/User/Groups/Form"],gn=i=>({"bg-gradient-warning":i}),fn=()=>["/menu/Users/User/Groups/Info"],hn=i=>({ID:i}),vn=()=>["/menu/Users/User/Users"],bn=i=>({GroupID:i});function yn(i,p){if(i&1){let e=w();n(0,"a",15),y("click",function(){d(e);let t=m(2);return u(t.httpDeleteListID("user/group"))}),b(1,"i",16),c(2," Delete "),o()}}function wn(i,p){i&1&&(n(0,"a",17),c(1,"Add "),o()),i&2&&s("routerLink",I(1,_n))}function xn(i,p){if(i&1){let e=w();n(0,"th",18)(1,"input",19),y("change",function(t){d(e);let r=m(2);return r.onSelectAllData(t.target.checked),u(r.uncheckSystemGroup())}),o()()}}function Cn(i,p){i&1&&b(0,"th")}function Sn(i,p){if(i&1){let e=w();n(0,"td")(1,"input",24),h("ngModelChange",function(t){d(e);let r=m().$implicit;return f(r.selected,t)||(r.selected=t),u(t)}),o()()}if(i&2){let e=m().$implicit;l(),g("ngModel",e.selected)}}function Dn(i,p){if(i&1){let e=w();n(0,"td",25)(1,"button",26),y("click",function(){d(e);let t=m().$implicit,r=m(2);return u(r.onDuplicateGroup(t.ID))}),b(2,"i",27),o()()}}function In(i,p){if(i&1&&(n(0,"tr",20),_(1,Sn,2,1,"td",12),n(2,"td")(3,"a",21),c(4),o()(),n(5,"td")(6,"a",22),c(7),A(8,"number"),o()(),n(9,"td"),c(10),o(),_(11,Dn,3,0,"td",23),o()),i&2){let e=p.$implicit,a=m(2);s("ngClass",C(12,gn,e.Type==1)),l(),s("ngIf",a.roleService.users.Delete),l(2),s("routerLink",I(14,fn))("queryParams",C(15,hn,e.ID)),l(),x(e.Name),l(2),s("routerLink",I(17,vn))("queryParams",C(18,bn,e.ID)),l(),B(" ",Z(8,10,e.TotalUsers)," "),l(3),x(e.Description),l(),s("ngIf",a.roleService.users.Create)}}function Tn(i,p){if(i&1){let e=w();n(0,"mat-paginator",28),y("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function Mn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",1),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Text,t)||(r.pageData.Filter.Text=t),u(t)}),y("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),n(1,"actions"),_(2,yn,3,0,"a",2)(3,wn,2,2,"a",3),o(),n(4,"content")(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr",8),_(10,xn,2,0,"th",9),n(11,"th",10),c(12,"NAME"),o(),n(13,"th",11),c(14," USERS "),o(),n(15,"th"),c(16,"DESCRIPTION"),o(),_(17,Cn,1,0,"th",12),o()(),n(18,"tbody"),_(19,In,12,20,"tr",13),o()()(),n(20,"div"),_(21,Tn,1,3,"mat-paginator",14),o()()()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchDropdown",!0),g("text",e.pageData.Filter.Text),l(2),s("ngIf",e.getSelectedData().length>0),l(),s("ngIf",e.roleService.users.Create),l(7),s("ngIf",e.roleService.users.Delete),l(7),s("ngIf",e.roleService.users.Create),l(2),s("ngForOf",e.data.Data),l(2),s("ngIf",e.pagination.listTotal>0)}}var ze=class i extends te{constructor(e,a,t,r){super(e,a,"user/group/List","user/GroupLoader/List",t);this.roleService=r}onDuplicateGroup(e){if(confirm("Are you sure you want to copy this group?")==!1)return;let t={GroupID:e};this.httpService.put("/api/user/group/CopyGroup",t).subscribe(r=>{this.toastrService.success(r.Message,P.Success),this.getListData()})}uncheckSystemGroup(){this.data.Data=this.data.Data.map(e=>(e.GetISRoleSystem&&(e.selected=!1),e))}static \u0275fac=function(a){return new(a||i)(v(E),v(M),v(N),v(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","text","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","hideSearchDropdown","text"],["role","button","class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","class","btn btn-success ms-2",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","250px"],["matTooltip","Number of users associated with the group",2,"width","80px"],[4,"ngIf"],["class","border-bottom",3,"ngClass",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-success","ms-2",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom",3,"ngClass"],[3,"routerLink","queryParams"],["target","_blank",3,"routerLink","queryParams"],["class","d-flex justify-content-end",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["title","Copy Group",1,"btn","btn-success","btn-sm","fs-6",3,"click"],[1,"fa-solid","fa-copy"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&_(0,Mn,22,9,"mainpanel-cmp",0),a&2&&s("ngIf",t.data)},dependencies:[X,F,T,V,k,Ce,G,O,ee,Y,Lt],encapsulation:2})};var En=()=>["/menu/Users/User/Roles"],kn=i=>({selected:i});function Un(i,p){i&1&&(n(0,"span",28),c(1," Name required. "),o())}function Fn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",3)(1,"actions")(2,"a",4),c(3,"Cancel"),o(),n(4,"button",5),y("click",function(){d(e);let t=m();return u(t.onSubmit("user/role/Submit"))}),c(5,"Submit "),o()(),n(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h3",11),c(13,"General"),o(),n(14,"div",12)(15,"input",13,0),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Name,t)||(r.formData.Name=t),u(t)}),o(),n(17,"label",14),c(18,"Name"),o(),_(19,Un,2,0,"span",15),o(),n(20,"div",12)(21,"input",16),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Model,t)||(r.formData.Model=t),u(t)}),o(),n(22,"label",17),c(23,"Model"),o()(),n(24,"div",12)(25,"textarea",18),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Description,t)||(r.formData.Description=t),u(t)}),o(),n(26,"label",19),c(27,"Description"),o()()()()(),n(28,"div",20)(29,"div",9)(30,"div",10)(31,"h3",11),c(32,"Properties"),o(),n(33,"div",21)(34,"ng-select",22,1),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.GroupID,t)||(r.formData.GroupID=t),u(t)}),o(),n(36,"label",23),c(37,"Type"),o()(),n(38,"div",24)(39,"label"),c(40,"More Permission"),o(),n(41,"radio-options",25),h("modelChange",function(t){d(e);let r=m();return f(r.formData.Advanced,t)||(r.formData.Advanced=t),u(t)}),o()(),n(42,"div",12)(43,"input",26),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Index,t)||(r.formData.Index=t),u(t)}),o(),n(44,"label",27),c(45,"Index"),o()()()()()()()()()}if(i&2){let e=j(16),a=j(35),t=m();s("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("routerLink",I(15,En)),l(13),g("ngModel",t.formData.Name),l(4),s("ngIf",e.invalid&&(e.dirty||e.touched)),l(2),g("ngModel",t.formData.Model),l(4),g("ngModel",t.formData.Description),l(8),s("ngClass",C(16,kn,t.formData.GroupID)),l(),g("ngModel",t.formData.GroupID),s("items",t.groupTypes),l(2),St("z-index",a.isOpen?"9999":"0"),l(5),g("model",t.formData.Advanced),l(2),g("ngModel",t.formData.Index)}}var Xe=class i extends Me{constructor(e,a,t,r,S,J){super(e,a,"user/RoleLoader/Form",t);this.toaster=r;this.router=S;this.actRoute=J}groupTypes;postBindForm(e){this.groupTypes=e.GroupTypes}onSubmitSuccess(){let e=this.actRoute.snapshot.queryParams;de.IsEmpty(e.ID)?this.toaster.success("Success add roles",P.Success):this.toaster.success("Success update roles",P.Success),this.router.navigate(["/menu/Users/User/Roles"])}static \u0275fac=function(a){return new(a||i)(v(E),v(M),v(R),v(N),v(K),v(R))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["roleName","ngModel"],["typeSelect",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","bg-light-gray","pt-10"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-body"],[1,"card-title","mb-10"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","name","roleName","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],["type","text","id","inputMode","placeholder","Model","name","model",1,"form-control",3,"ngModelChange","ngModel"],["for","inputModel"],["id","inputDescription","placeholder","Description",1,"form-control",3,"ngModelChange","ngModel"],["for","inputDescription"],[1,"col-md-4"],[1,"form-floating-outline",3,"ngClass"],["id","inputType","bindLabel","Name","bindValue","ID",1,"productform","w-100",3,"ngModelChange","ngModel","items"],["for","inputType"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","20px"],[3,"modelChange","model"],["type","text","id","inputIndex","placeholder","Index","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","inputIndex"],[1,"control-label","text-danger"]],template:function(a,t){a&1&&_(0,Fn,46,18,"mainpanel-cmp",2),a&2&&s("ngIf",t.data&&t.formData)},dependencies:[X,T,V,k,me,G,Se,O,H,De,Ie],encapsulation:2})};var Vn=()=>["/menu/Users/User/Roles/Form"],Pn=i=>({ID:i});function Ln(i,p){if(i&1){let e=w();n(0,"a",21),y("click",function(){d(e);let t=m(2).ngIf,r=m();return u(r.deleteRole(t.Role.ID))}),b(1,"i",22),c(2," Delete "),o()}}function Rn(i,p){if(i&1&&(n(0,"a",23),b(1,"i",24),c(2," Edit "),o()),i&2){let e=m(2).ngIf;s("routerLink",I(2,Vn))("queryParams",C(3,Pn,e.Role.ID))}}function Nn(i,p){if(i&1&&(n(0,"actions"),_(1,Ln,3,0,"a",19)(2,Rn,3,5,"a",20),o()),i&2){let e=m(2);l(),s("ngIf",e.roleService.users.Delete),l(),s("ngIf",e.roleService.users.Edit)}}function An(i,p){if(i&1&&(n(0,"div",25),b(1,"span",26),n(2,"span",27),c(3),o()()),i&2){let e=p.$implicit;l(3),x(e.Name)}}function Gn(i,p){if(i&1&&(n(0,"mainpanel-cmp",1),A(1,"async"),_(2,Nn,3,2,"actions",2),n(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h3",8),c(10,"General"),o(),n(11,"div",9),b(12,"POS-info-page-input",10),o(),n(13,"div",9),b(14,"POS-info-page-input",11),o(),n(15,"div",9),b(16,"POS-info-page-input",12),o()()()(),n(17,"div",13)(18,"div",6)(19,"div",7)(20,"h3",8),c(21,"Properties"),o(),n(22,"div",9),b(23,"POS-info-page-input",14),o(),n(24,"div",9),b(25,"POS-info-page-input",15),o(),n(26,"div",9),b(27,"POS-info-page-input",16),o()()()()(),n(28,"div",4)(29,"div",17)(30,"div",6)(31,"div",7)(32,"h3",8),c(33,"User Group"),o(),n(34,"div",4),_(35,An,4,1,"div",18),o()()()()()()()()),i&2){let e=p.ngIf,a=m();s("pageData",Z(1,11,a.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("ngIf",a.roleService.isSystemUser),l(10),s("inputValue",e.Role.Name),l(2),s("inputValue",e.Role.Model),l(2),s("inputValue",e.Role.Description),l(7),s("inputValue",e.Role.GroupName),l(2),s("inputValue",e.Role.Advanced?"Yes":"No"),l(2),s("inputValue",e.Role.Index),l(8),s("ngForOf",e.UserGroupRole)}}var Ke=class i{constructor(p,e,a,t,r,S){this.http=p;this.route=a;this.toastr=t;this.roleService=r;S.setMenu$(),this.menu$=S.menu$;let J=ut(e.snapshot.queryParams).pipe(ge(Q=>p.get(this.endpoint+Q.ID))),q=_t(this.menu$,J).pipe(at(([Q,_e])=>({menu:ot(nt({},Q),{H:`${_e.Role.Name} Role`}),info:_e})),gt());this.info$=q.pipe(rt("info"),at(Q=>ot(nt({},Q),{UserGroupRole:Q.UserGroupRole.filter(_e=>_e.HasRole)}))),this.menu$=q.pipe(rt("menu"))}endpoint="/API/user/role/";menu$;info$;deleteRole(p){this.http.delete("/API/User/Role",{body:[p]}).subscribe({next:()=>{this.route.navigate(["/menu/Users/User/Roles"]),this.toastr.success("Success delete role.",P.Success)}})}static \u0275fac=function(e){return new(e||i)(v(M),v(R),v(K),v(N),v(W),v(E))};static \u0275cmp=D({type:i,selectors:[["POS-roles-info"]],standalone:!1,decls:2,vars:3,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[4,"ngIf"],[1,"container-fluid","pt-10"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-body"],[1,"card-title","mb-10"],[1,"form-floating-outline"],["labelValue","Name",3,"inputValue"],["labelValue","Model",3,"inputValue"],["labelValue","Description","inputType","textarea",3,"inputValue"],[1,"col-md-4"],["labelValue","Type",3,"inputValue"],["labelValue","More Permission",3,"inputValue"],["labelValue","Index",3,"inputValue"],[1,"col-8"],["class","col-3 d-flex align-items-center",4,"ngFor","ngForOf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary ms-5",3,"routerLink","queryParams",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-outline-secondary","ms-5",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square"],[1,"col-3","d-flex","align-items-center"],[1,"me-5",2,"width","5px","height","5px","background","black","border-radius","100%"],[2,"font-size","14px"]],template:function(e,a){e&1&&(_(0,Gn,36,13,"mainpanel-cmp",0),A(1,"async")),e&2&&s("ngIf",Z(1,1,a.info$))},dependencies:[F,T,V,k,Te,xe],encapsulation:2})};var On=()=>["/menu/Users/User/Roles/Form"],Wn=i=>({"bg-gradient-warning":i}),Bn=()=>["Info"],Hn=i=>({ID:i});function qn(i,p){if(i&1){let e=w();n(0,"a",14),y("click",function(){d(e);let t=m(2);return u(t.httpDeleteListID("user/role"))}),b(1,"i",15),c(2," Delete "),o()}}function jn(i,p){i&1&&(n(0,"a",16),c(1,"Add "),o()),i&2&&s("routerLink",I(1,On))}function zn(i,p){if(i&1){let e=w();n(0,"div",17)(1,"h6"),c(2,"Group Name"),o(),n(3,"ng-select",18),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.GroupID),s("items",e.pageData.Options)}}function Xn(i,p){if(i&1){let e=w();n(0,"th",19)(1,"input",20),y("change",function(t){d(e);let r=m(2);return u(r.onSelectAllData(t.target.checked))}),o()()}}function Kn(i,p){if(i&1){let e=w();n(0,"td")(1,"input",24),h("ngModelChange",function(t){d(e);let r=m().$implicit;return f(r.selected,t)||(r.selected=t),u(t)}),o()()}if(i&2){let e=m().$implicit;l(),g("ngModel",e.selected)}}function Yn(i,p){if(i&1&&(n(0,"tr",21),_(1,Kn,2,1,"td",22),n(2,"td")(3,"a",23),c(4),o()(),n(5,"td"),c(6),o(),n(7,"td"),c(8),o(),n(9,"td"),c(10),o()()),i&2){let e=p.$implicit,a=m(2);s("ngClass",C(8,Wn,e.Type==1)),l(),s("ngIf",a.data.IsSystem),l(2),s("routerLink",I(10,Bn))("queryParams",C(11,Hn,e.ID)),l(),x(e.RolesName),l(2),x(e.GroupName),l(2),x(e.Model),l(2),x(e.Description)}}function Qn(i,p){if(i&1){let e=w();n(0,"mat-paginator",25),y("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function Zn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Text,t)||(r.pageData.Filter.Text=t),u(t)}),y("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"actions"),_(2,qn,3,0,"a",3)(3,jn,2,2,"a",4),o(),n(4,"filters"),_(5,zn,4,2,"ng-template",null,0,se),o(),n(7,"content")(8,"div",5)(9,"div",6)(10,"table",7)(11,"thead",8)(12,"tr",9),_(13,Xn,2,0,"th",10),n(14,"th",11),c(15,"NAME"),o(),n(16,"th"),c(17,"GROUP NAME"),o(),n(18,"th"),c(19,"MODEL"),o(),n(20,"th"),c(21,"DESCRIPTION"),o()()(),n(22,"tbody"),_(23,Yn,11,13,"tr",12),o()()(),n(24,"div"),_(25,Qn,1,3,"mat-paginator",13),o()()()()}if(i&2){let e=m();s("pageData",e.menuData),g("text",e.pageData.Filter.Text),s("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(2),s("ngIf",e.getSelectedData().length>0),l(),s("ngIf",e.roleService.isSystemUser),l(10),s("ngIf",e.data.IsSystem),l(10),s("ngForOf",e.data.Data),l(2),s("ngIf",e.pagination.listTotal>0)}}var Ye=class i extends te{constructor(e,a,t,r){super(e,a,"user/role/List","user/RoleLoader/List",t);this.httpService=a;this.roleService=r}static \u0275fac=function(a){return new(a||i)(v(E),v(M),v(N),v(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[U],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["role","button","class","btn btn-success ms-3",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","250px"],["class","border-bottom",3,"ngClass",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-success","ms-3",3,"routerLink"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose a Group...",3,"ngModelChange","ngModel","items"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom",3,"ngClass"],[4,"ngIf"],[3,"routerLink","queryParams"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&_(0,Zn,26,9,"mainpanel-cmp",1),a&2&&s("ngIf",t.data)},dependencies:[X,F,T,V,k,Ce,G,O,ee,H],encapsulation:2})};var Jn=["switch"],$n=["*"];function eo(i,p){i&1&&(n(0,"span",10),bt(),n(1,"svg",12),b(2,"path",13),o(),n(3,"svg",14),b(4,"path",15),o()())}var to=new ht("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),io={provide:Nt,useExisting:ft(()=>Ze),multi:!0},Qe=class{source;checked;constructor(p,e){this.source=p,this.checked=e}},Ze=(()=>{class i{_elementRef=L(wt);_focusMonitor=L(zt);_changeDetectorRef=L(Vt);defaults=L(to);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new Qe(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new lt;toggleChange=new lt;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){L(Xt).load(Qt);let e=L(new yt("tabindex"),{optional:!0}),a=this.defaults,t=L(xt,{optional:!0});this.tabIndex=e==null?0:parseInt(e)||0,this.color=a.color||"accent",this._noopAnimations=t==="NoopAnimations",this.id=this._uniqueId=L(Kt).getId("mat-mdc-slide-toggle-"),this.hideIcon=a.hideIcon??!1,this.disabledInteractive=a.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new Qe(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=D({type:i,selectors:[["mat-slide-toggle"]],viewQuery:function(a,t){if(a&1&&Mt(Jn,5),a&2){let r;Et(r=kt())&&(t._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(a,t){a&2&&(Dt("id",t.id),Ae("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Ge(t.color?"mat-"+t.color:""),ke("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",pe],color:"color",disabled:[2,"disabled","disabled",pe],disableRipple:[2,"disableRipple","disableRipple",pe],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Pt(e)],checked:[2,"checked","checked",pe],hideIcon:[2,"hideIcon","hideIcon",pe],disabledInteractive:[2,"disabledInteractive","disabledInteractive",pe]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Ut([io,{provide:At,useExisting:i,multi:!0}]),vt],ngContentSelectors:$n,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(a,t){if(a&1){let r=w();It(),n(0,"div",1)(1,"button",2,0),y("click",function(){return d(r),u(t._handleClick())}),b(3,"span",3),n(4,"span",4)(5,"span",5)(6,"span",6),b(7,"span",7),o(),n(8,"span",8),b(9,"span",9),o(),_(10,eo,5,0,"span",10),o()()(),n(11,"label",11),y("click",function(J){return d(r),u(J.stopPropagation())}),Tt(12),o()()}if(a&2){let r=j(2);s("labelPosition",t.labelPosition),l(),ke("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),s("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),Ae("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),l(8),s("matRippleTrigger",r)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",!0),l(),$(t.hideIcon?-1:10),l(),s("for",t.buttonId),Ae("id",t._labelId)}},dependencies:[ti,ni],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ji}from"./chunk-BIFUIO7T.js";import{a as Li,c as Qi}from"./chunk-ZPZGDWV2.js";import{a as Kt}from"./chunk-MKFUTZAB.js";import{a as ki,b as Vi,c as Ri,d as $i,e as Bi,f as Be}from"./chunk-V7WABXQO.js";import{a as Fi}from"./chunk-R6GAAB3Z.js";import{a as qt}from"./chunk-Y6IBDGTZ.js";import{a as In}from"./chunk-M55SSU2Z.js";import{c as Mi,d as Pi}from"./chunk-Y2E4CRUL.js";import{a as Ei}from"./chunk-YYZQJJ5E.js";import{a as Ni}from"./chunk-D65B2CE6.js";import"./chunk-ZQ36MGN4.js";import"./chunk-SE7OFLAL.js";import{a as Ht,b as Si,c as Ii}from"./chunk-JBHXY6BO.js";import"./chunk-SDFVKBAE.js";import{a as Pt}from"./chunk-XA77ZHST.js";import{a as Ai}from"./chunk-H2CBVQ37.js";import{a as oi}from"./chunk-FTFXCI5W.js";import{b as Oi,c as Ti,d as wi}from"./chunk-KTUSLTKU.js";import{b as Di}from"./chunk-UD3ICZLV.js";import"./chunk-EQETYYV4.js";import"./chunk-M5TUQ4TJ.js";import"./chunk-ISRITPHN.js";import"./chunk-WLRXTHLM.js";import"./chunk-R5NT3ETF.js";import"./chunk-AUEGBPEP.js";import"./chunk-NZE6DNJW.js";import{a as Jt,b as Gt}from"./chunk-36E4B5DX.js";import{a as xi}from"./chunk-2PI2ZGEL.js";import"./chunk-BYXBJQAS.js";import{a as Wt}from"./chunk-5IOF4NYT.js";import{a as hi}from"./chunk-VCQRRIXP.js";import"./chunk-BYXBJQAS.js";import{b as _i}from"./chunk-X3ZDNOUY.js";import"./chunk-2MKL5ANY.js";import{d as vi,e as Ut}from"./chunk-UAWD35O3.js";import"./chunk-7OMZTXCR.js";import"./chunk-5KITFB7J.js";import"./chunk-4OMN7S35.js";import"./chunk-3RK6DDJD.js";import"./chunk-CPVATKT5.js";import"./chunk-MC6ZRPRO.js";import{e as vt}from"./chunk-N67NWGYA.js";import"./chunk-5S6WJQZF.js";import"./chunk-GQZZBFFT.js";import"./chunk-YWYXEZ6N.js";import"./chunk-NEAT432X.js";import{a as ri,b as li,c as si}from"./chunk-UDN6DKAR.js";import"./chunk-YBH7C53G.js";import"./chunk-I6HQHZRF.js";import"./chunk-PEI67MDS.js";import"./chunk-GX4UHBDK.js";import"./chunk-AGW24DIE.js";import{a as Qt}from"./chunk-R4BDRGWL.js";import"./chunk-TX5UVUTO.js";import{a as ci,d as pi,f as mi,h as di}from"./chunk-2PXEEOUO.js";import{a as ot,b as at}from"./chunk-C7X4JG6F.js";import{a as ui,b as fi}from"./chunk-2SAQDBKA.js";import"./chunk-GDLTEIKV.js";import{a as ii}from"./chunk-PNVRIGOW.js";import{B as Lt,C as we,D as Ee,E as Ne,F as gi,H as yi,I as bi,O as Ci,q as ai,u as Te,v as Re,w as ne}from"./chunk-KMVWE6IR.js";import{ga as bt,ha as Ct}from"./chunk-4IJDCXOA.js";import{P as $e}from"./chunk-QMH4FATM.js";import{a as zn,b as Yn,c as Xn}from"./chunk-GIKR6Y2K.js";import{d as _t}from"./chunk-P67FCS5T.js";import{a as ee}from"./chunk-SRELAFRM.js";import"./chunk-HLZJPEJB.js";import"./chunk-O4T67QQ3.js";import{a as xe}from"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{C as ti,D as Oe,E as Ke,a as Ge,b as Zn,c as he,h as le,l as me,o as Pe,r as ei,s as qe}from"./chunk-J577JGRK.js";import{a as ni}from"./chunk-VUVNZP6V.js";import{a as P,d as De}from"./chunk-EQ6536VC.js";import"./chunk-5W2FAFPB.js";import{$ as ct,$a as l,$b as At,D as tt,Db as mt,Dc as be,E as V,H as An,I as _e,Ib as a,Jb as r,Ka as Dn,Kb as I,Lb as Q,M as kn,Ma as pt,Mb as U,Md as qn,N as hn,Ob as B,Oc as Hn,Od as Kn,Pd as Bt,Q as Vn,Qb as _,Rb as d,Rd as jt,T as Rn,Td as Je,Ub as xn,Uc as it,Va as Bn,W as Mt,Wa as nt,Wc as He,Wd as se,Xc as pe,Y as te,Zb as Nt,_a as jn,_b as Ft,aa as Z,ad as Ve,bc as kt,ca as $n,cb as Ln,cc as Vt,cd as Jn,d as ve,db as f,dc as ue,e as Xe,ec as m,ed as Me,f as En,fa as E,fb as Qn,fc as X,ga as de,gb as Et,gc as j,hc as We,hd as F,ja as oe,jc as H,k as Ae,kb as N,kc as L,lc as J,ma as W,n as Nn,na as ce,nc as ke,o as Ze,ob as Un,oc as Rt,p as Fn,pc as ae,qb as D,qc as $t,qd as Gn,t as u,u as Ie,v as _n,va as x,vb as c,wa as S,xb as yt,xc as g,y as st,yc as y,zb as Wn,zc as Sn}from"./chunk-ONCTFURX.js";import{a as T,b as R,d as wn,j as gt}from"./chunk-7DCB7DB2.js";var q=class i{constructor(t,e){this.http=e;this.buyForm=t.group({NewOrderID:[""],Order:t.group({Att:[""],SupplierID:[""],Number:[""],Date:[new Date],ID:[P.GuidEmpty]}),Invoice:t.group({ID:[P.GuidEmpty],Due:[new Date],Tax:[0]}),Payment:t.group({ID:[P.GuidEmpty],Amount:[0],MethodID:[0],Code:[""],Note:[""],ImageUrl:[""]})})}outlet=new me({ID:"",Name:"Choose an Outlet"});dueDays=new me(0);deliveryEntityID=new me(P.GuidEmpty);noteForm=new me({Note:"",TagID:"",Currency:{ID:"",ExchangeRate:0,Symbol:""},InvoiceNumber:""});discountAndTaxForm=new me({Discount:{Amount:0,Percentage:0},Tax:{ID:"",CalculationTypeName:"",Rate:0,Label:"",Discontinue:!1}});buyForm;setPONumber(t){let e="";if(t.Seed){let n=t.Seed+"";for(;n.length<t.Digit;)n="0"+n;e=P.StringFormat(t.Prefix,n)}this.buyForm.controls.Order.controls.Number.setValue(e)}setDueDateBasedOnDaysDue(t){console.log(t);let e=this.invoiceDate,n=new Date(P.cloneObject(e));n.setDate(n.getDate()+t),this.buyForm.controls.Invoice.controls.Due.setValue(n)}get dueDate(){return this.buyForm.controls.Invoice.controls.Due.value}get invoiceDate(){return this.buyForm.controls.Order.controls.Date.value}setAmount(t){this.buyForm.controls.Payment.controls.Amount.setValue(t)}setPaymentMethodID(t){this.buyForm.controls.Payment.controls.MethodID.setValue(t)}setTaxAmount(t){this.buyForm.controls.Invoice.controls.Tax.setValue(t)}setNewOrderID(t){this.buyForm.controls.NewOrderID.setValue(t)}setTax(t){let e=T({},this.discountAndTaxForm.value.Discount);this.discountAndTaxForm.setValue({Discount:e,Tax:t})}setCurrency(t){let e=this.noteForm.value;this.noteForm.setValue(R(T({},e),{Currency:t}))}setDeliveryEntityID(t){this.deliveryEntityID.setValue(t)}setdueDays(t){this.dueDays.setValue(t)}setBulkOrderForm(t){this.buyForm.controls.Order.setValue(t)}setBulkNoteForm(t){this.noteForm.setValue(t)}setBulkDiscountAndTaxForm(t){this.discountAndTaxForm.setValue(t)}setOutletForm(t){this.outlet.setValue(t)}setBulkInvoice(t){this.buyForm.controls.Invoice.setValue(T(T({},this.buyForm.controls.Invoice.value),t))}setBulkPayment(t){this.buyForm.controls.Payment.setValue(t)}resetOutletForm(){this.outlet.setValue({ID:"",Name:"Choose an Outlet"})}resetDueDaysForm(){this.dueDays.setValue(0)}resetDeliveryEntityID(){this.deliveryEntityID.setValue(P.GuidEmpty)}resetNoteForm(){this.noteForm.setValue(R(T({},this.noteForm.value),{Note:"",TagID:"",InvoiceNumber:""}))}resetDiscountAndTaxForm(){let t=this.discountAndTaxForm.value;this.discountAndTaxForm.setValue(R(T({},t),{Discount:{Amount:0,Percentage:0}}))}resetBuyForm(){this.buyForm.reset(),this.buyForm.controls.Invoice.controls.ID.setValue(P.GuidEmpty),this.buyForm.controls.Invoice.controls.Due.setValue(new Date),this.buyForm.controls.Order.controls.Date.setValue(new Date),this.buyForm.controls.Order.controls.ID.setValue(P.GuidEmpty),this.generateNumberOnNewTransaction()}generateNumberOnNewTransaction(){this.http.post("/API/Buy/GenerateNumber",{ID:this.outlet.value.ID}).subscribe(t=>{this.setNewOrderID(P.Guid_NewGuid()),this.buyForm.controls.Order.controls.Number.setValue(t.Number)})}static \u0275fac=function(e){return new(e||i)(W(ti),W(se))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ge=class i{entities$;appConfigJSON$;taxes$;currencies$;supplierPOTypes$;predefinedNotes$;denomination$;defaultDueDays$;constructor(t,e){let n=t.get("/API/Buy2/Load").pipe(E(o=>e.setCurrency(o.Currencies.find(s=>s.ID==o.AppConfigJSON.CoreDefaults.CurrencyID))),te(1));this.denomination$=n.pipe(u(o=>o.Denomination)),this.entities$=n.pipe(u(o=>o.Entities)),this.appConfigJSON$=n.pipe(u(o=>o.AppConfigJSON)),this.taxes$=n.pipe(u(o=>o.Taxes),te(1)),this.currencies$=n.pipe(u(o=>o.Currencies),te(1)),this.supplierPOTypes$=n.pipe(u(o=>o.SupplierPOTypes)),this.predefinedNotes$=n.pipe(u(o=>o.PredefinedNotes)),this.defaultDueDays$=n.pipe(u(o=>o.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultDueDays),E(o=>e.setdueDays(o)),E(o=>e.setDueDateBasedOnDaysDue(o)))}updateDueDays(){this.defaultDueDays$.subscribe()}static \u0275fac=function(e){return new(e||i)(W(se),W(q))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var rt=class i{returnInvoiceNumber=new me("");invoiceInfo$;constructor(t,e,n){let o=e.outlet.valueChanges.pipe(u(p=>p.ID),ee());this.invoiceInfo$=this.returnInvoiceNumber.valueChanges.pipe(V(p=>!!p),de(o),Z(([p,M])=>t.post("/API/Buy/GetSupplierInvoiceRetur2",{EntityID:M,Number:p}).pipe(_e(()=>Ae))),te(1),ee());let s=this.invoiceInfo$.pipe(u(p=>T({},p.Order)),E(p=>{let M={Att:p.Att,SupplierID:{Key:p.SupplierID,Value:p.SupplierName,OnSet:!0},Date:new Date,Number:e.buyForm.controls.Order.controls.Number.value,ID:P.GuidEmpty};e.setBulkOrderForm(M)}),ee()),O=this.invoiceInfo$.pipe(u(p=>p.Order),E(p=>{let M={Note:`Return #${p.Number}`,TagID:p.TypeID,Currency:{ID:p.CurrencyID,ExchangeRate:p.CurrencyRate,Symbol:p.CurrencySymbol??"$"},InvoiceNumber:p.Number};e.setBulkNoteForm(M)}),ee()),v=this.invoiceInfo$.pipe(u(p=>p.Order),de(n.taxes$),u(([p,M])=>R(T({},p),{Tax:M.find(G=>G.ID===p.TaxTypeID)})),E(p=>{let M={Discount:{Amount:p.DiscountAmount,Percentage:p.Discount},Tax:{ID:p.TaxTypeID,Rate:p.Tax?.Rate,CalculationTypeName:p.Tax?.CalculationTypeName,Label:p.Tax?.Label,Discontinue:!p.Tax?.Label}};e.setBulkDiscountAndTaxForm(M)}),ee()),$=this.invoiceInfo$.pipe(u(p=>p.DeliveryEntityID),E(p=>e.setDeliveryEntityID(p)),ee()),K=this.invoiceInfo$.pipe(u(p=>p.Invoice),E(p=>{let M={ID:p.ID,Tax:p.Tax};e.setBulkInvoice(M)}),ee()),h=this.invoiceInfo$.pipe(u(p=>p.Payment),E(p=>{let M={ID:P.GuidEmpty,Amount:p.Amount,MethodID:p.MethodID,Note:p.Note,Code:p.Code,ImageUrl:p.ImageUrl};e.setBulkPayment(M)}),ee());Ie(s,O,v,$,K,h).pipe(ee()).subscribe()}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(ge))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ie=class i{constructor(t,e,n,o){this.matDialog=o;let s=e.outlet.valueChanges.pipe(u(p=>p.ID));this.addVariantThroughSerial$=this._addVariantThroughSerial.asObservable().pipe(de(s),Z(([p,M])=>t.get($e.GetVariantBySerial,[{key:"Serial",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice,VariantID:p.ID})),u(p=>({action:"addAsSerial",variant:p})));let O=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="Code"),u(p=>p.str),de(s),Z(([p,M])=>t.get($e.GetVariantByCode,[{key:"Code",value:p},{key:"EntityID",value:M},{key:"Promotion",value:!0}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.PriceDiscount)/100),Discount:p.PriceDiscount,VariantID:p.ID}))),v=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="ID"),u(p=>p.str)),$=this.variantQuickKey.valueChanges,K=tt(v,$).pipe(de(s),Z(([p,M])=>t.get($e.GetVariantByID,[{key:"ID",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.OrderPriceDiscount)/100),Discount:p.OrderPriceDiscount,VariantID:p.ID}))),h=tt(K,O).pipe(E(p=>{p.CategoryTypeID===1&&this.toastr.info(`${p.Name} is sellable only.`,xe.Info)}),V(p=>p.CategoryTypeID!==1),u(p=>({action:"add",variant:p})),E(()=>{this.cartDisplayRef&&setTimeout(()=>{let p=this.cartDisplayRef.nativeElement.scrollHeight;this.cartDisplayRef.nativeElement.scrollTop=p},1)})),A=n.invoiceInfo$.pipe(u(p=>({action:"returnInvoice",variants:p.Items.map(M=>R(T({},M.Variant),{Quantity:M.Quantity,Total:M.Total,UnitPrice:M.UnitPrice,Discount:M.Discount,Serial:M.Serial,ID:M.ID,DiscountAmount:M.DiscountAmount,VariantID:M.VariantID,UnitQuantity:M.UnitQuantity}))})));this.cart$=tt(h,A,this.deleteVariant$,this.dragDropCart$,this.returnCart$,this.updateVariant$,this.returnVariant$,this.purchaseVariant$,this.clearCart$,this.onEditForm$,this.addVariantThroughSerial$,this.addVariant$,this.onUploadCart$,this.listenRFID$).pipe(Mt((p,M)=>{let G=[...p],Y=[],b=M.action;if(b=="add"){let C=M.variant;Y=!!G.find(k=>k.VariantID==C.ID)?G.map(k=>k.VariantID==C.ID?R(T({},k),{Quantity:k.Quantity+1,Total:k.Total+k.UnitPrice}):k):[...G,C]}else if(b=="returnInvoice"||b=="onEditForm")Y=M.variants;else if(b=="delete"){let C=M.index;Y=G.filter((w,k)=>k!=C)}else if(b=="sort"){let C=M.ev;Y=G,ci(Y,C.previousIndex,C.currentIndex)}else if(b=="returnCart")Y=G.map(C=>R(T({},C),{Quantity:-Math.abs(C.Quantity),Total:-Math.abs(C.Total)}));else if(b=="update"){let C=M.index;Y=G.map((w,k)=>k==C?M.variant:w)}else if(b=="returnVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:-Math.abs(w.Quantity),Total:-Math.abs(w.Total)}):w)}else if(b=="purchaseVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:Math.abs(w.Quantity),Total:Math.abs(w.Total)}):w)}else if(b=="clearCart")Y=[];else if(b=="addAsSerial"){let C=R(T({},M.variant),{Serial:[{Number:M.variant.Serial.Number,Quantity:1,ExpiryDate:M.variant.Serial.ExpiryDate}]});if(!!G.find(k=>k.ID==C.ID)){let k=C.Serial[0],Ce=G.find(fe=>fe.ID==C.ID),wt=!!Ce.Serial.find(fe=>fe.Number==k.Number)?[...Ce.Serial].map(fe=>fe.Number==k.Number?R(T({},fe),{Quantity:fe.Quantity+1}):fe):[...Ce.Serial,k];Y=G.map(fe=>fe.ID==C.ID?R(T({},fe),{Quantity:fe.Quantity+1,Total:fe.Total+fe.UnitPrice,Serial:wt}):fe)}else Y=[...G,R(T({},C),{Quantity:1,Total:C.UnitPrice})]}else if(b=="uploadCart")Y=[...G,...M.variants];else if(b=="addNewRow"){let C=M.variant;Y=[...G,C]}else if(b=="rfid"){let C=M.variants;Object.keys(C).forEach(w=>{if(C.hasOwnProperty(w)){let k=C[w];if(k&&Object.keys(k.variant).length>0){let Ce=G.findIndex(ft=>ft.Code.toLowerCase()===w.toLowerCase());if(Ce!==-1){let ft=Number(k.count);G[Ce].Quantity+=ft,G[Ce].Total=+G[Ce].UnitPrice*+G[Ce].Quantity,delete C[w],Y=[...G]}else{let ft=k.variant,wt=Number(k.count),fe=this.setUnitPrice(ft),Ki=this.formatItemObject(R(T({},fe),{Quantity:wt,Total:+fe.UnitPrice*+wt}));delete C[w],Y=[...G,Ki]}}}})}return Y},[]),ct([]),te(1)),this.totalVariantOrdered$=this.cart$.pipe(u(p=>p.map(M=>M.Quantity)),u(p=>p.reduce((M,G)=>M+G,0)),ct(0))}toastr=ce(Je);cartDisplayRef;variantAutocomplete=new me;variantQuickKey=new me;_listenRFID=new ve;listenRFID$=this._listenRFID.asObservable().pipe(u(t=>({action:"rfid",variants:t})));_deleteVariant=new ve;deleteVariant$=this._deleteVariant.asObservable().pipe(u(t=>({action:"delete",index:t})));_dragDropCart=new ve;dragDropCart$=this._dragDropCart.asObservable().pipe(u(t=>({action:"sort",ev:t})));_returnCart=new ve;returnCart$=this._returnCart.asObservable().pipe(u(()=>({action:"returnCart"})));_onEditForm=new Xe(null);onEditForm$=this._onEditForm.asObservable().pipe(V(t=>!!t),u(t=>({action:"onEditForm",variants:t})));_clearCart=new ve;clearCart$=this._clearCart.asObservable().pipe(u(()=>({action:"clearCart"})));_updateVariant=new ve;updateVariant$=this._updateVariant.asObservable().pipe(u(t=>({action:"update",variant:t.variant,index:t.index})));_returnVariant=new ve;returnVariant$=this._returnVariant.asObservable().pipe(u(t=>({action:"returnVariant",index:t})));_purchaseVariant=new ve;purchaseVariant$=this._purchaseVariant.asObservable().pipe(u(t=>({action:"purchaseVariant",index:t})));_addVariant=new ve;addVariant$=this._addVariant.asObservable().pipe(u(t=>({action:"addNewRow",variant:t})));_onUploadCart=new ve;onUploadCart$=this._onUploadCart.asObservable().pipe(u(t=>({action:"uploadCart",variants:t})));cart$;totalVariantOrdered$;_addVariantThroughSerial=new ve;addVariantThroughSerial$;deleteVariant(t){this._deleteVariant.next(t)}dragDropCart(t){this._dragDropCart.next(t)}returnCart(){this._returnCart.next()}updateVariant(t,e){this._updateVariant.next({variant:t,index:e})}returnVariant(t){this._returnVariant.next(t)}purchaseVariant(t){this._purchaseVariant.next(t)}clearCart(){this._clearCart.next()}editForm(t){this._onEditForm.next(t)}addVariant(t){this._addVariant.next(t)}addVariantThroughSerial(t){this._addVariantThroughSerial.next(t)}uploadCart(t){this._onUploadCart.next(t)}setUnitPrice(t){let e=T({},t);return P.IsNotEmpty(t.OrderPrice)?e.UnitPrice=t.OrderPrice:e.UnitPrice=t.UnitCost,e}formatItemObject=t=>{let o=t,{ID:e}=o,n=wn(o,["ID"]);return R(T({},n),{Quantity:n.Quantity??1,Total:n.Total??n.UnitPrice,VariantID:e})};addCartRFID(t){this._listenRFID.next(t)}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(rt),W(ne))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var je=class i{_isEdit=new ve;isEdit$;id$;isUnpaid$;dialog=ce(ne);constructor(t,e,n,o,s){let O=Ze(t.snapshot.queryParams);this.isEdit$=tt(O.pipe(u(b=>!!b.ID)),this._isEdit.asObservable()).pipe(te(1)),this.id$=O.pipe(V(b=>b.ID),u(b=>b.ID));let v=this.id$.pipe(Z(b=>e.post("/api/Buy2/GetDataByID2",{ID:b})),te(1)),$=st(()=>o.entities$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),E(([b,C])=>{let w={Att:b.Att,SupplierID:{Key:b.SupplierID,Value:b.SupplierName,OnSet:!0},Date:b.Date,Number:b.Number,ID:b.ID};n.setBulkOrderForm(w)}),E(([b,C])=>{let w=C.find(k=>k.ID==b.EntityID);n.setOutletForm(w)})),K=v.pipe(u(b=>b.Items),u(b=>b.map(C=>R(T({},C.Variant),{Quantity:C.Quantity,Total:C.Total,Note:C.Note,UnitPrice:C.UnitPrice,Discount:C.Discount,Serial:C.Serial,ID:C.ID,VariantID:C.VariantID,UnitQuantity:C.UnitQuantity,QtyRequested:C.QtyRequested,DiscountAmount:C.DiscountAmount}))),E(b=>s.editForm(b))),h=st(()=>o.currencies$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b,C.Invoice]))),u(([b,C,w])=>R(T({},b),{Number:b.Number!=w.Number?w.Number:b.Number,Currency:C.find(k=>k.ID===b.CurrencyID)})),E(b=>{let C={Note:b.Note,TagID:b.TypeID,Currency:T({},b.Currency),InvoiceNumber:b.Number};n.setBulkNoteForm(C)})),A=v.pipe(u(b=>b.DeliveryEntityID),E(b=>n.setDeliveryEntityID(b))),p=st(()=>o.taxes$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),u(([b,C])=>R(T({},b),{Taxes:C})),E(b=>{let C=b.Taxes.find(k=>k.ID===b.TaxTypeID);C?.Bin&&this.dialog.open(Ht,{id:"ModalInfo",data:{title:"Default Tax Discontinued",message:`
|
|
1
|
+
import{a as ji}from"./chunk-BIFUIO7T.js";import{a as Li,c as Qi}from"./chunk-ZPZGDWV2.js";import{a as Kt}from"./chunk-MKFUTZAB.js";import{a as ki,b as Vi,c as Ri,d as $i,e as Bi,f as Be}from"./chunk-V7WABXQO.js";import{a as Fi}from"./chunk-R6GAAB3Z.js";import{a as qt}from"./chunk-Y6IBDGTZ.js";import{a as In}from"./chunk-M55SSU2Z.js";import{c as Mi,d as Pi}from"./chunk-Y2E4CRUL.js";import{a as Ei}from"./chunk-YYZQJJ5E.js";import{a as Ni}from"./chunk-D65B2CE6.js";import"./chunk-ZQ36MGN4.js";import"./chunk-SE7OFLAL.js";import{a as Ht,b as Si,c as Ii}from"./chunk-JBHXY6BO.js";import"./chunk-SDFVKBAE.js";import{a as Pt}from"./chunk-XA77ZHST.js";import{a as Ai}from"./chunk-H2CBVQ37.js";import{a as oi}from"./chunk-FTFXCI5W.js";import{b as Oi,c as Ti,d as wi}from"./chunk-KTUSLTKU.js";import{b as Di}from"./chunk-UD3ICZLV.js";import"./chunk-EQETYYV4.js";import"./chunk-M5TUQ4TJ.js";import"./chunk-ISRITPHN.js";import"./chunk-WLRXTHLM.js";import"./chunk-R5NT3ETF.js";import"./chunk-AUEGBPEP.js";import"./chunk-NZE6DNJW.js";import{a as Jt,b as Gt}from"./chunk-36E4B5DX.js";import{a as xi}from"./chunk-2PI2ZGEL.js";import"./chunk-BYXBJQAS.js";import{a as Wt}from"./chunk-5IOF4NYT.js";import{a as hi}from"./chunk-VCQRRIXP.js";import"./chunk-BYXBJQAS.js";import{b as _i}from"./chunk-X3ZDNOUY.js";import"./chunk-2MKL5ANY.js";import{d as vi,e as Ut}from"./chunk-UAWD35O3.js";import"./chunk-7OMZTXCR.js";import"./chunk-5KITFB7J.js";import"./chunk-4OMN7S35.js";import"./chunk-3RK6DDJD.js";import"./chunk-CPVATKT5.js";import"./chunk-MC6ZRPRO.js";import{e as vt}from"./chunk-N67NWGYA.js";import"./chunk-5S6WJQZF.js";import"./chunk-GQZZBFFT.js";import"./chunk-YWYXEZ6N.js";import"./chunk-NEAT432X.js";import{a as ri,b as li,c as si}from"./chunk-UDN6DKAR.js";import"./chunk-YBH7C53G.js";import"./chunk-I6HQHZRF.js";import"./chunk-PEI67MDS.js";import"./chunk-GX4UHBDK.js";import"./chunk-AGW24DIE.js";import{a as Qt}from"./chunk-R4BDRGWL.js";import"./chunk-TX5UVUTO.js";import{a as ci,d as pi,f as mi,h as di}from"./chunk-2PXEEOUO.js";import{a as ot,b as at}from"./chunk-C7X4JG6F.js";import{a as ui,b as fi}from"./chunk-APVQGR37.js";import"./chunk-GDLTEIKV.js";import{a as ii}from"./chunk-PNVRIGOW.js";import{B as Lt,C as we,D as Ee,E as Ne,F as gi,H as yi,I as bi,O as Ci,q as ai,u as Te,v as Re,w as ne}from"./chunk-KMVWE6IR.js";import{ga as bt,ha as Ct}from"./chunk-4IJDCXOA.js";import{P as $e}from"./chunk-QMH4FATM.js";import{a as zn,b as Yn,c as Xn}from"./chunk-GIKR6Y2K.js";import{d as _t}from"./chunk-P67FCS5T.js";import{a as ee}from"./chunk-SRELAFRM.js";import"./chunk-HLZJPEJB.js";import"./chunk-O4T67QQ3.js";import{a as xe}from"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{C as ti,D as Oe,E as Ke,a as Ge,b as Zn,c as he,h as le,l as me,o as Pe,r as ei,s as qe}from"./chunk-J577JGRK.js";import{a as ni}from"./chunk-JDMYDBXN.js";import{a as P,d as De}from"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$ as ct,$a as l,$b as At,D as tt,Db as mt,Dc as be,E as V,H as An,I as _e,Ib as a,Jb as r,Ka as Dn,Kb as I,Lb as Q,M as kn,Ma as pt,Mb as U,Md as qn,N as hn,Ob as B,Oc as Hn,Od as Kn,Pd as Bt,Q as Vn,Qb as _,Rb as d,Rd as jt,T as Rn,Td as Je,Ub as xn,Uc as it,Va as Bn,W as Mt,Wa as nt,Wc as He,Wd as se,Xc as pe,Y as te,Zb as Nt,_a as jn,_b as Ft,aa as Z,ad as Ve,bc as kt,ca as $n,cb as Ln,cc as Vt,cd as Jn,d as ve,db as f,dc as ue,e as Xe,ec as m,ed as Me,f as En,fa as E,fb as Qn,fc as X,ga as de,gb as Et,gc as j,hc as We,hd as F,ja as oe,jc as H,k as Ae,kb as N,kc as L,lc as J,ma as W,n as Nn,na as ce,nc as ke,o as Ze,ob as Un,oc as Rt,p as Fn,pc as ae,qb as D,qc as $t,qd as Gn,t as u,u as Ie,v as _n,va as x,vb as c,wa as S,xb as yt,xc as g,y as st,yc as y,zb as Wn,zc as Sn}from"./chunk-ONCTFURX.js";import{a as T,b as R,d as wn,j as gt}from"./chunk-7DCB7DB2.js";var q=class i{constructor(t,e){this.http=e;this.buyForm=t.group({NewOrderID:[""],Order:t.group({Att:[""],SupplierID:[""],Number:[""],Date:[new Date],ID:[P.GuidEmpty]}),Invoice:t.group({ID:[P.GuidEmpty],Due:[new Date],Tax:[0]}),Payment:t.group({ID:[P.GuidEmpty],Amount:[0],MethodID:[0],Code:[""],Note:[""],ImageUrl:[""]})})}outlet=new me({ID:"",Name:"Choose an Outlet"});dueDays=new me(0);deliveryEntityID=new me(P.GuidEmpty);noteForm=new me({Note:"",TagID:"",Currency:{ID:"",ExchangeRate:0,Symbol:""},InvoiceNumber:""});discountAndTaxForm=new me({Discount:{Amount:0,Percentage:0},Tax:{ID:"",CalculationTypeName:"",Rate:0,Label:"",Discontinue:!1}});buyForm;setPONumber(t){let e="";if(t.Seed){let n=t.Seed+"";for(;n.length<t.Digit;)n="0"+n;e=P.StringFormat(t.Prefix,n)}this.buyForm.controls.Order.controls.Number.setValue(e)}setDueDateBasedOnDaysDue(t){console.log(t);let e=this.invoiceDate,n=new Date(P.cloneObject(e));n.setDate(n.getDate()+t),this.buyForm.controls.Invoice.controls.Due.setValue(n)}get dueDate(){return this.buyForm.controls.Invoice.controls.Due.value}get invoiceDate(){return this.buyForm.controls.Order.controls.Date.value}setAmount(t){this.buyForm.controls.Payment.controls.Amount.setValue(t)}setPaymentMethodID(t){this.buyForm.controls.Payment.controls.MethodID.setValue(t)}setTaxAmount(t){this.buyForm.controls.Invoice.controls.Tax.setValue(t)}setNewOrderID(t){this.buyForm.controls.NewOrderID.setValue(t)}setTax(t){let e=T({},this.discountAndTaxForm.value.Discount);this.discountAndTaxForm.setValue({Discount:e,Tax:t})}setCurrency(t){let e=this.noteForm.value;this.noteForm.setValue(R(T({},e),{Currency:t}))}setDeliveryEntityID(t){this.deliveryEntityID.setValue(t)}setdueDays(t){this.dueDays.setValue(t)}setBulkOrderForm(t){this.buyForm.controls.Order.setValue(t)}setBulkNoteForm(t){this.noteForm.setValue(t)}setBulkDiscountAndTaxForm(t){this.discountAndTaxForm.setValue(t)}setOutletForm(t){this.outlet.setValue(t)}setBulkInvoice(t){this.buyForm.controls.Invoice.setValue(T(T({},this.buyForm.controls.Invoice.value),t))}setBulkPayment(t){this.buyForm.controls.Payment.setValue(t)}resetOutletForm(){this.outlet.setValue({ID:"",Name:"Choose an Outlet"})}resetDueDaysForm(){this.dueDays.setValue(0)}resetDeliveryEntityID(){this.deliveryEntityID.setValue(P.GuidEmpty)}resetNoteForm(){this.noteForm.setValue(R(T({},this.noteForm.value),{Note:"",TagID:"",InvoiceNumber:""}))}resetDiscountAndTaxForm(){let t=this.discountAndTaxForm.value;this.discountAndTaxForm.setValue(R(T({},t),{Discount:{Amount:0,Percentage:0}}))}resetBuyForm(){this.buyForm.reset(),this.buyForm.controls.Invoice.controls.ID.setValue(P.GuidEmpty),this.buyForm.controls.Invoice.controls.Due.setValue(new Date),this.buyForm.controls.Order.controls.Date.setValue(new Date),this.buyForm.controls.Order.controls.ID.setValue(P.GuidEmpty),this.generateNumberOnNewTransaction()}generateNumberOnNewTransaction(){this.http.post("/API/Buy/GenerateNumber",{ID:this.outlet.value.ID}).subscribe(t=>{this.setNewOrderID(P.Guid_NewGuid()),this.buyForm.controls.Order.controls.Number.setValue(t.Number)})}static \u0275fac=function(e){return new(e||i)(W(ti),W(se))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ge=class i{entities$;appConfigJSON$;taxes$;currencies$;supplierPOTypes$;predefinedNotes$;denomination$;defaultDueDays$;constructor(t,e){let n=t.get("/API/Buy2/Load").pipe(E(o=>e.setCurrency(o.Currencies.find(s=>s.ID==o.AppConfigJSON.CoreDefaults.CurrencyID))),te(1));this.denomination$=n.pipe(u(o=>o.Denomination)),this.entities$=n.pipe(u(o=>o.Entities)),this.appConfigJSON$=n.pipe(u(o=>o.AppConfigJSON)),this.taxes$=n.pipe(u(o=>o.Taxes),te(1)),this.currencies$=n.pipe(u(o=>o.Currencies),te(1)),this.supplierPOTypes$=n.pipe(u(o=>o.SupplierPOTypes)),this.predefinedNotes$=n.pipe(u(o=>o.PredefinedNotes)),this.defaultDueDays$=n.pipe(u(o=>o.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultDueDays),E(o=>e.setdueDays(o)),E(o=>e.setDueDateBasedOnDaysDue(o)))}updateDueDays(){this.defaultDueDays$.subscribe()}static \u0275fac=function(e){return new(e||i)(W(se),W(q))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var rt=class i{returnInvoiceNumber=new me("");invoiceInfo$;constructor(t,e,n){let o=e.outlet.valueChanges.pipe(u(p=>p.ID),ee());this.invoiceInfo$=this.returnInvoiceNumber.valueChanges.pipe(V(p=>!!p),de(o),Z(([p,M])=>t.post("/API/Buy/GetSupplierInvoiceRetur2",{EntityID:M,Number:p}).pipe(_e(()=>Ae))),te(1),ee());let s=this.invoiceInfo$.pipe(u(p=>T({},p.Order)),E(p=>{let M={Att:p.Att,SupplierID:{Key:p.SupplierID,Value:p.SupplierName,OnSet:!0},Date:new Date,Number:e.buyForm.controls.Order.controls.Number.value,ID:P.GuidEmpty};e.setBulkOrderForm(M)}),ee()),O=this.invoiceInfo$.pipe(u(p=>p.Order),E(p=>{let M={Note:`Return #${p.Number}`,TagID:p.TypeID,Currency:{ID:p.CurrencyID,ExchangeRate:p.CurrencyRate,Symbol:p.CurrencySymbol??"$"},InvoiceNumber:p.Number};e.setBulkNoteForm(M)}),ee()),v=this.invoiceInfo$.pipe(u(p=>p.Order),de(n.taxes$),u(([p,M])=>R(T({},p),{Tax:M.find(G=>G.ID===p.TaxTypeID)})),E(p=>{let M={Discount:{Amount:p.DiscountAmount,Percentage:p.Discount},Tax:{ID:p.TaxTypeID,Rate:p.Tax?.Rate,CalculationTypeName:p.Tax?.CalculationTypeName,Label:p.Tax?.Label,Discontinue:!p.Tax?.Label}};e.setBulkDiscountAndTaxForm(M)}),ee()),$=this.invoiceInfo$.pipe(u(p=>p.DeliveryEntityID),E(p=>e.setDeliveryEntityID(p)),ee()),K=this.invoiceInfo$.pipe(u(p=>p.Invoice),E(p=>{let M={ID:p.ID,Tax:p.Tax};e.setBulkInvoice(M)}),ee()),h=this.invoiceInfo$.pipe(u(p=>p.Payment),E(p=>{let M={ID:P.GuidEmpty,Amount:p.Amount,MethodID:p.MethodID,Note:p.Note,Code:p.Code,ImageUrl:p.ImageUrl};e.setBulkPayment(M)}),ee());Ie(s,O,v,$,K,h).pipe(ee()).subscribe()}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(ge))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ie=class i{constructor(t,e,n,o){this.matDialog=o;let s=e.outlet.valueChanges.pipe(u(p=>p.ID));this.addVariantThroughSerial$=this._addVariantThroughSerial.asObservable().pipe(de(s),Z(([p,M])=>t.get($e.GetVariantBySerial,[{key:"Serial",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice,VariantID:p.ID})),u(p=>({action:"addAsSerial",variant:p})));let O=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="Code"),u(p=>p.str),de(s),Z(([p,M])=>t.get($e.GetVariantByCode,[{key:"Code",value:p},{key:"EntityID",value:M},{key:"Promotion",value:!0}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.PriceDiscount)/100),Discount:p.PriceDiscount,VariantID:p.ID}))),v=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="ID"),u(p=>p.str)),$=this.variantQuickKey.valueChanges,K=tt(v,$).pipe(de(s),Z(([p,M])=>t.get($e.GetVariantByID,[{key:"ID",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.OrderPriceDiscount)/100),Discount:p.OrderPriceDiscount,VariantID:p.ID}))),h=tt(K,O).pipe(E(p=>{p.CategoryTypeID===1&&this.toastr.info(`${p.Name} is sellable only.`,xe.Info)}),V(p=>p.CategoryTypeID!==1),u(p=>({action:"add",variant:p})),E(()=>{this.cartDisplayRef&&setTimeout(()=>{let p=this.cartDisplayRef.nativeElement.scrollHeight;this.cartDisplayRef.nativeElement.scrollTop=p},1)})),A=n.invoiceInfo$.pipe(u(p=>({action:"returnInvoice",variants:p.Items.map(M=>R(T({},M.Variant),{Quantity:M.Quantity,Total:M.Total,UnitPrice:M.UnitPrice,Discount:M.Discount,Serial:M.Serial,ID:M.ID,DiscountAmount:M.DiscountAmount,VariantID:M.VariantID,UnitQuantity:M.UnitQuantity}))})));this.cart$=tt(h,A,this.deleteVariant$,this.dragDropCart$,this.returnCart$,this.updateVariant$,this.returnVariant$,this.purchaseVariant$,this.clearCart$,this.onEditForm$,this.addVariantThroughSerial$,this.addVariant$,this.onUploadCart$,this.listenRFID$).pipe(Mt((p,M)=>{let G=[...p],Y=[],b=M.action;if(b=="add"){let C=M.variant;Y=!!G.find(k=>k.VariantID==C.ID)?G.map(k=>k.VariantID==C.ID?R(T({},k),{Quantity:k.Quantity+1,Total:k.Total+k.UnitPrice}):k):[...G,C]}else if(b=="returnInvoice"||b=="onEditForm")Y=M.variants;else if(b=="delete"){let C=M.index;Y=G.filter((w,k)=>k!=C)}else if(b=="sort"){let C=M.ev;Y=G,ci(Y,C.previousIndex,C.currentIndex)}else if(b=="returnCart")Y=G.map(C=>R(T({},C),{Quantity:-Math.abs(C.Quantity),Total:-Math.abs(C.Total)}));else if(b=="update"){let C=M.index;Y=G.map((w,k)=>k==C?M.variant:w)}else if(b=="returnVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:-Math.abs(w.Quantity),Total:-Math.abs(w.Total)}):w)}else if(b=="purchaseVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:Math.abs(w.Quantity),Total:Math.abs(w.Total)}):w)}else if(b=="clearCart")Y=[];else if(b=="addAsSerial"){let C=R(T({},M.variant),{Serial:[{Number:M.variant.Serial.Number,Quantity:1,ExpiryDate:M.variant.Serial.ExpiryDate}]});if(!!G.find(k=>k.ID==C.ID)){let k=C.Serial[0],Ce=G.find(fe=>fe.ID==C.ID),wt=!!Ce.Serial.find(fe=>fe.Number==k.Number)?[...Ce.Serial].map(fe=>fe.Number==k.Number?R(T({},fe),{Quantity:fe.Quantity+1}):fe):[...Ce.Serial,k];Y=G.map(fe=>fe.ID==C.ID?R(T({},fe),{Quantity:fe.Quantity+1,Total:fe.Total+fe.UnitPrice,Serial:wt}):fe)}else Y=[...G,R(T({},C),{Quantity:1,Total:C.UnitPrice})]}else if(b=="uploadCart")Y=[...G,...M.variants];else if(b=="addNewRow"){let C=M.variant;Y=[...G,C]}else if(b=="rfid"){let C=M.variants;Object.keys(C).forEach(w=>{if(C.hasOwnProperty(w)){let k=C[w];if(k&&Object.keys(k.variant).length>0){let Ce=G.findIndex(ft=>ft.Code.toLowerCase()===w.toLowerCase());if(Ce!==-1){let ft=Number(k.count);G[Ce].Quantity+=ft,G[Ce].Total=+G[Ce].UnitPrice*+G[Ce].Quantity,delete C[w],Y=[...G]}else{let ft=k.variant,wt=Number(k.count),fe=this.setUnitPrice(ft),Ki=this.formatItemObject(R(T({},fe),{Quantity:wt,Total:+fe.UnitPrice*+wt}));delete C[w],Y=[...G,Ki]}}}})}return Y},[]),ct([]),te(1)),this.totalVariantOrdered$=this.cart$.pipe(u(p=>p.map(M=>M.Quantity)),u(p=>p.reduce((M,G)=>M+G,0)),ct(0))}toastr=ce(Je);cartDisplayRef;variantAutocomplete=new me;variantQuickKey=new me;_listenRFID=new ve;listenRFID$=this._listenRFID.asObservable().pipe(u(t=>({action:"rfid",variants:t})));_deleteVariant=new ve;deleteVariant$=this._deleteVariant.asObservable().pipe(u(t=>({action:"delete",index:t})));_dragDropCart=new ve;dragDropCart$=this._dragDropCart.asObservable().pipe(u(t=>({action:"sort",ev:t})));_returnCart=new ve;returnCart$=this._returnCart.asObservable().pipe(u(()=>({action:"returnCart"})));_onEditForm=new Xe(null);onEditForm$=this._onEditForm.asObservable().pipe(V(t=>!!t),u(t=>({action:"onEditForm",variants:t})));_clearCart=new ve;clearCart$=this._clearCart.asObservable().pipe(u(()=>({action:"clearCart"})));_updateVariant=new ve;updateVariant$=this._updateVariant.asObservable().pipe(u(t=>({action:"update",variant:t.variant,index:t.index})));_returnVariant=new ve;returnVariant$=this._returnVariant.asObservable().pipe(u(t=>({action:"returnVariant",index:t})));_purchaseVariant=new ve;purchaseVariant$=this._purchaseVariant.asObservable().pipe(u(t=>({action:"purchaseVariant",index:t})));_addVariant=new ve;addVariant$=this._addVariant.asObservable().pipe(u(t=>({action:"addNewRow",variant:t})));_onUploadCart=new ve;onUploadCart$=this._onUploadCart.asObservable().pipe(u(t=>({action:"uploadCart",variants:t})));cart$;totalVariantOrdered$;_addVariantThroughSerial=new ve;addVariantThroughSerial$;deleteVariant(t){this._deleteVariant.next(t)}dragDropCart(t){this._dragDropCart.next(t)}returnCart(){this._returnCart.next()}updateVariant(t,e){this._updateVariant.next({variant:t,index:e})}returnVariant(t){this._returnVariant.next(t)}purchaseVariant(t){this._purchaseVariant.next(t)}clearCart(){this._clearCart.next()}editForm(t){this._onEditForm.next(t)}addVariant(t){this._addVariant.next(t)}addVariantThroughSerial(t){this._addVariantThroughSerial.next(t)}uploadCart(t){this._onUploadCart.next(t)}setUnitPrice(t){let e=T({},t);return P.IsNotEmpty(t.OrderPrice)?e.UnitPrice=t.OrderPrice:e.UnitPrice=t.UnitCost,e}formatItemObject=t=>{let o=t,{ID:e}=o,n=wn(o,["ID"]);return R(T({},n),{Quantity:n.Quantity??1,Total:n.Total??n.UnitPrice,VariantID:e})};addCartRFID(t){this._listenRFID.next(t)}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(rt),W(ne))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var je=class i{_isEdit=new ve;isEdit$;id$;isUnpaid$;dialog=ce(ne);constructor(t,e,n,o,s){let O=Ze(t.snapshot.queryParams);this.isEdit$=tt(O.pipe(u(b=>!!b.ID)),this._isEdit.asObservable()).pipe(te(1)),this.id$=O.pipe(V(b=>b.ID),u(b=>b.ID));let v=this.id$.pipe(Z(b=>e.post("/api/Buy2/GetDataByID2",{ID:b})),te(1)),$=st(()=>o.entities$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),E(([b,C])=>{let w={Att:b.Att,SupplierID:{Key:b.SupplierID,Value:b.SupplierName,OnSet:!0},Date:b.Date,Number:b.Number,ID:b.ID};n.setBulkOrderForm(w)}),E(([b,C])=>{let w=C.find(k=>k.ID==b.EntityID);n.setOutletForm(w)})),K=v.pipe(u(b=>b.Items),u(b=>b.map(C=>R(T({},C.Variant),{Quantity:C.Quantity,Total:C.Total,Note:C.Note,UnitPrice:C.UnitPrice,Discount:C.Discount,Serial:C.Serial,ID:C.ID,VariantID:C.VariantID,UnitQuantity:C.UnitQuantity,QtyRequested:C.QtyRequested,DiscountAmount:C.DiscountAmount}))),E(b=>s.editForm(b))),h=st(()=>o.currencies$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b,C.Invoice]))),u(([b,C,w])=>R(T({},b),{Number:b.Number!=w.Number?w.Number:b.Number,Currency:C.find(k=>k.ID===b.CurrencyID)})),E(b=>{let C={Note:b.Note,TagID:b.TypeID,Currency:T({},b.Currency),InvoiceNumber:b.Number};n.setBulkNoteForm(C)})),A=v.pipe(u(b=>b.DeliveryEntityID),E(b=>n.setDeliveryEntityID(b))),p=st(()=>o.taxes$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),u(([b,C])=>R(T({},b),{Taxes:C})),E(b=>{let C=b.Taxes.find(k=>k.ID===b.TaxTypeID);C?.Bin&&this.dialog.open(Ht,{id:"ModalInfo",data:{title:"Default Tax Discontinued",message:`
|
|
2
2
|
<div class="d-flex justify-content-center my-4">
|
|
3
3
|
<img class="img-2x" src="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg"
|
|
4
4
|
alt="Empty Sales Order Tag" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-
|
|
1
|
+
import{a as G}from"./chunk-GFYZWIV4.js";import"./chunk-6VQ2WO2R.js";import"./chunk-2PXEEOUO.js";import{a as J}from"./chunk-74Y7C2MG.js";import{h as q,i as z}from"./chunk-GGEENO4M.js";import"./chunk-6S6Q7SED.js";import{b as A}from"./chunk-APVQGR37.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import"./chunk-KMVWE6IR.js";import{ga as j,ha as k}from"./chunk-4IJDCXOA.js";import"./chunk-QMH4FATM.js";import"./chunk-3X3O55NN.js";import"./chunk-GIKR6Y2K.js";import"./chunk-P67FCS5T.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{D as W,h as B,o as H}from"./chunk-J577JGRK.js";import"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$a as l,Dc as E,Eb as x,Gb as M,Hb as w,Ib as i,Jb as n,Ob as v,Qb as N,Rb as S,Td as V,Wd as R,cd as P,db as c,ec as o,ed as L,fc as u,hd as O,jc as _,kb as D,kc as b,lc as h,ob as y,qb as I,va as p,vb as d,wa as s,xc as C,yc as F,zc as T}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";function U(r,g){if(r&1){let e=v();i(0,"div")(1,"div",9)(2,"h6"),o(3,"Outlet"),n(),i(4,"outlet-selector",10),h("ngModelChange",function(t){p(e);let m=S();return b(m.pageData.Filter.ListIDs,t)||(m.pageData.Filter.ListIDs=t),s(t)}),n()()()}if(r&2){let e=S();l(4),d("accessType",2),_("ngModel",e.pageData.Filter.ListIDs),d("multiple",!0)}}function X(r,g){if(r&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td"),o(4),C(5,"number"),n(),i(6,"td"),o(7),C(8,"date"),n()()),r&2){let e=g.$implicit;l(2),u(e==null?null:e.EntityName),l(2),u(F(5,3,e==null?null:e.Number)),l(3),u(T(8,5,e==null?null:e.Modified,"dd MMM yyyy HH:mm"))}}var K=class r extends G{constructor(e,a,t){super(e,a,"Setup/Data/TransactionInvoiceNumber",null,t);this.httpService=a}preGetList(){let e=this.pageData.Filter?.ListIDs?this.pageData.Filter?.ListIDs:[];this.pageData.Filter={ListIDs:e}}static \u0275fac=function(a){return new(a||r)(c(A),c(R),c(V))};static \u0275cmp=D({type:r,selectors:[["app-invoice-numbering"]],features:[y],decls:19,vars:4,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","isFilterOnDropdown","hideSearchBox","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["matTooltip","Next invoice number index to be generated",2,"width","200px"],[2,"width","200px"],[1,"dialog-filter"],["placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple"]],template:function(a,t){if(a&1){let m=v();i(0,"mainpanel-cmp",1),N("onSubmit",function(){return p(m),s(t.searchFromPageOne())}),h("filterChange",function(f){return p(m),b(t.pageData.Filter,f)||(t.pageData.Filter=f),s(f)}),i(1,"filters"),I(2,U,5,3,"ng-template",null,0,E),n(),i(4,"content")(5,"div",2)(6,"div",3)(7,"table",4)(8,"thead",5)(9,"tr",6)(10,"th"),o(11,"Outlet"),n(),i(12,"th",7),o(13," Next Number "),n(),i(14,"th",8),o(15,"Modified"),n()()(),i(16,"tbody"),M(17,X,9,8,"tr",null,x),n()()()()()()}a&2&&(d("pageData",t.menuData)("isFilterOnDropdown",!1)("hideSearchBox",!0),_("filter",t.pageData.Filter),l(17),w(t.data==null?null:t.data.Data))},dependencies:[O,L,P,z,q,J,W,B,H,k,j],encapsulation:2})};export{K as InvoiceNumberingComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-DJA3CX47.js";import{a as t}from"./chunk-7DCB7DB2.js";var i=class extends e{constructor(r,a,o,l,s,p,F){super(r,a,o,l,s,p,F)}preInitLoader(){this.loaderPayload=t({ListIDs:this.reportFilterService.initOutletFilter([])},this.loaderPayload)}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N}from"./chunk-
|
|
1
|
+
import{c as N}from"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import{a as D}from"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$ as _,$a as l,Ga as P,Ib as o,Jb as e,Kb as u,N as b,Ob as S,Od as G,Qb as I,Rb as f,Wd as j,Xc as A,Y as m,aa as s,ad as E,c as p,db as d,ec as a,fa as y,fc as x,hd as R,kb as w,n as v,qb as g,va as C,vb as c,wa as O,xc as L,yb as M,yc as k}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";function T(r,n){r&1&&(o(0,"div",21)(1,"span",22),a(2,"Latitude and Longitude is empty, please allow your browser location permission!"),e(),o(3,"a",23),a(4,"Click here to learn how to manually activate the location permission"),e()())}function z(r,n){if(r&1){let t=S();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),a(4,"Geo Fencing"),e(),o(5,"p",5),a(6,"You are about to sign-in from this location"),e(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"span",9),a(11,"LAT"),e(),o(12,"span",10),a(13),e()(),o(14,"div",8)(15,"span",11),a(16,"LONG"),e(),o(17,"span",12),a(18),e()()(),o(19,"button",13),I("click",function(){C(t);let h=f();return O(h.proceed())}),a(20,"Proceed"),e()(),g(21,T,5,0,"div",14),e(),o(22,"div",15),u(23,"img",16),e()(),o(24,"div",17)(25,"div",18)(26,"div")(27,"span"),a(28,"powered by :"),e(),u(29,"a",19)(30,"img",20),e()()()()}if(r&2){let t=n.ngIf,i=f();l(2),M(t.latitude&&t.longitude?i.centerGeoPanelStyle:""),l(11),x(t.latitude),l(5),x(t.longitude),l(),c("disabled",!(t.latitude&&t.longitude)),l(2),c("ngIf",!(t.latitude&&t.longitude))}}var Z=class r{constructor(n,t,i,h){this.ngZone=n;this.auth=t;this.http=i;this.router=h}centerGeoPanelStyle="display: flex; flex-direction: column; justify-content: center;";latLong$;ngOnInit(){this.checkOnRefreshPage(),document.body.classList.add("login-body");let n=v(navigator.permissions.query({name:"geolocation"})).pipe(s(t=>new p(i=>{i.next(t.state),t.onchange=()=>this.ngZone.run(()=>i.next(t.state))})),m(1));this.latLong$=n.pipe(s(()=>new p(t=>{navigator.geolocation.getCurrentPosition(i=>this.ngZone.run(()=>{t.next({latitude:i.coords.latitude.toString(),longitude:i.coords.longitude.toString()}),t.complete()}),()=>this.ngZone.run(()=>{t.next({latitude:"",longitude:""}),t.complete()}),{enableHighAccuracy:!0,maximumAge:0,timeout:8e3})})),_({latitude:"",longitude:""}),m(1))}ngOnDestroy(){document.body.classList.remove("login-body")}checkOnRefreshPage(){D.IsEmpty(this.auth.loginResponse)&&this.router.navigate(["/"])}proceed(){this.latLong$.pipe(s(n=>this.http.post("/api/Authentication/LoginGeoRestriction",{UserID:this.auth.loginResponse.UserID,Latitude:n.latitude,Longitude:n.longitude})),y(n=>this.auth.saveLoginConfigToStorage(n)),s(()=>this.router.navigate([this.auth.getRedirectUrl()])),b(1)).subscribe()}static \u0275fac=function(t){return new(t||r)(d(P),d(N),d(j),d(G))};static \u0275cmp=w({type:r,selectors:[["POS-auth-geolocation"]],decls:2,vars:3,consts:[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[1,"row","bg-white","mx-auto","totp-pane"],[1,"col-md-7","order-md-first","order-last","form-pane"],[1,"text-start"],[1,"text-start","mb-7"],[1,"d-flex","flex-column","flex-md-row",2,"column-gap","10px"],[1,"latlong-container","d-flex","flex-grow-1"],[1,"flex-grow-1","text-start","d-flex"],[1,"lat-label","fw-bold"],[1,"ps-5","lat-value","flex-grow-1","d-flex","align-items-center"],[1,"long-label","fw-bold"],[1,"ps-5","long-value","flex-grow-1","d-flex","align-items-center"],[1,"btn","btn-success","mt-5","mx-auto","mx-md-0","mt-md-0","w-25","w-md-100",3,"click","disabled"],["class","text-start mt-7",4,"ngIf"],[1,"col-md-5","order-md-last","order-first","border-start","border-secondary","d-flex","align-items-center","justify-content-center","img-pane","py-6"],["src","https://res.cloudinary.com/pos/image/upload/v1685343992/POS/Images/geolocation-map.png",1,"border-0","w-100"],[1,"fixed-bottom"],[1,"d-flex","justify-content-start","mb-11","mx-11","footer-mobile"],["target","_blank","href","http://www.dealpos.com"],["src","//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png",1,"ms-3","border-0"],[1,"text-start","mt-7"],[1,"text-danger"],["href","https://support.dealpos.com/en/articles/7963864-enable-location-services-for-several-browser","target","_blank",1,"d-block"]],template:function(t,i){t&1&&(g(0,z,31,6,"div",0),L(1,"async")),t&2&&c("ngIf",k(1,1,i.latLong$))},dependencies:[R,A,E],styles:["input[type=submit][_ngcontent-%COMP%]{font-size:1.125rem;width:11.25rem;font-family:Roboto Slab,serif}.totp-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:140px}@media (max-width: 768px){.totp-pane[_ngcontent-%COMP%]{margin-top:0}}.form-pane[_ngcontent-%COMP%]{padding:2rem}@media (max-width: 768px){.form-pane[_ngcontent-%COMP%]{padding:50px 24px 30px}}@media (max-width: 768px){.img-pane[_ngcontent-%COMP%]{border:0px!important}}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;width:325px;font-family:monospace;background:transparent;z-index:1;position:relative}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none!important}.otp-container[_ngcontent-%COMP%] .stripe[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;font-family:monospace;position:absolute;padding-top:6px;z-index:0;bottom:0;left:14px}.latlong-container[_ngcontent-%COMP%]{background:#fff;border:1px solid #000000;border-radius:5px}.latlong-container[_ngcontent-%COMP%] .lat-label[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{display:inline-block;padding:12px;border-right:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{border-left:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .lat-value[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-value[_ngcontent-%COMP%]{background:#d9d9d94d}"]})};export{Z as AuthGeolocationComponent};
|
package/browser/index.html
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</script>
|
|
47
47
|
<link href="https://cdn.jsdelivr.net/npm/dealpos-font@1.9.14/font-awesome/css/all.min.css" rel="stylesheet"/>
|
|
48
48
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css"/>
|
|
49
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.
|
|
49
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/styles-ANY6A3DA.css"></head>
|
|
50
50
|
|
|
51
51
|
<body>
|
|
52
52
|
<app-root>
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
</app-root>
|
|
55
55
|
<script async="" src="https://cdn.jsdelivr.net/npm/dealpos-tm@7.1.0/tinymce.min.js"></script>
|
|
56
56
|
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-element-bundle.min.js"></script>
|
|
57
|
-
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.
|
|
57
|
+
<link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-YF53S2OS.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-M4TPGDOJ.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-3X3O55NN.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-GIKR6Y2K.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-P67FCS5T.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-SRELAFRM.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-WUSKRV4R.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-J577JGRK.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-RDARJWEZ.js"><link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/chunk-JDMYDBXN.js"><script src="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/polyfills-22A7LMHG.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/scripts-3E2G6IZ4.js" defer></script><script src="https://cdn.jsdelivr.net/npm/dealpos@25.32.1/browser/main-Q6EK5PKL.js" type="module"></script></body>
|
|
58
58
|
</html>
|