marketplacepos 3.13.4 → 3.13.5
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/Marketplace/{chunk-6BYODQW7.js → chunk-44JSD7TR.js} +1 -1
- package/Marketplace/{chunk-R7NUZJ6Z.js → chunk-4A2BQXM5.js} +1 -1
- package/Marketplace/{chunk-HH5OTDOQ.js → chunk-4XJJVBCX.js} +1 -1
- package/Marketplace/{chunk-3IYAATQI.js → chunk-BGN73QQI.js} +1 -1
- package/Marketplace/{chunk-EEAB43LH.js → chunk-BTKJJ5MP.js} +1 -1
- package/Marketplace/{chunk-O44GD7BQ.js → chunk-D4HBNVTL.js} +1 -1
- package/Marketplace/{chunk-NZ5YWVLF.js → chunk-E3E6TUYP.js} +1 -1
- package/Marketplace/{chunk-74C3CXV4.js → chunk-GEQYSMX6.js} +1 -1
- package/Marketplace/chunk-GVS44OWQ.js +1 -0
- package/Marketplace/{chunk-NSKF7OXH.js → chunk-HFUGRK45.js} +1 -1
- package/Marketplace/{chunk-DUHXHNDB.js → chunk-IYN33JGO.js} +1 -1
- package/Marketplace/{chunk-E2QD6KYS.js → chunk-KQ5DOU4A.js} +1 -1
- package/Marketplace/chunk-L34D7YAZ.js +1 -0
- package/Marketplace/{chunk-JCWZSFSB.js → chunk-LJDPILCP.js} +1 -1
- package/Marketplace/{chunk-YJSTLOLP.js → chunk-N3VBGSQH.js} +1 -1
- package/Marketplace/chunk-O5GGWOBM.js +1 -0
- package/Marketplace/chunk-OAKENGDC.js +1 -0
- package/Marketplace/{chunk-A2TGQ4MU.js → chunk-Q64RKYUS.js} +1 -1
- package/Marketplace/{chunk-ON2NN4QX.js → chunk-RPO7IHUU.js} +1 -1
- package/Marketplace/{chunk-56OKLP66.js → chunk-T6XF6UXO.js} +1 -1
- package/Marketplace/{chunk-2V6KLDRW.js → chunk-UYN5TJJ7.js} +1 -1
- package/Marketplace/{chunk-QW3M4EZ2.js → chunk-V2UYOAT2.js} +1 -1
- package/Marketplace/{chunk-MIZ2DGVO.js → chunk-XLSYUMRS.js} +1 -1
- package/Marketplace/{chunk-TSN4V54G.js → chunk-YDGPF5OU.js} +1 -1
- package/Marketplace/{chunk-U3LBIFGI.js → chunk-YUYOQ6ZT.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-CKEU3YNI.js → main-TYOAJ6YV.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-3E32TXFL.js +0 -1
- package/Marketplace/chunk-7V7R7T2V.js +0 -1
- package/Marketplace/chunk-KEW3SGQJ.js +0 -1
- package/Marketplace/chunk-LYF2MCUF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-2YXHLXID.js";import{a as Ee}from"./chunk-V6L3NRY3.js";import{a as xe,b as fe,d as Se,e as Pe}from"./chunk-S5GA4AVB.js";import{a as M}from"./chunk-BSBYMQ7J.js";import{a as Me,b as U,c as Ne}from"./chunk-L34D7YAZ.js";import{a as ge}from"./chunk-662E5VTA.js";import{a as be,c as De}from"./chunk-5WXM6HSA.js";import{a as Ve,b as Te}from"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Fe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as ue}from"./chunk-XLSYUMRS.js";import{b as oe,e as re}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Ie,k as ye,l as we,m as ve}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as le,c as ce,h as se,k as _e,m as pe,u as me}from"./chunk-B3LBEB32.js";import{c as de,e as he,f as Ce}from"./chunk-QPRFFPO5.js";import{$a as _,$b as Y,B as A,Bc as E,Cc as ae,Ha as V,Hb as J,Ia as l,Ib as d,Ja as f,Jb as B,Kb as T,Lb as Z,Mb as I,Nb as y,Ob as w,Pb as Q,Q as $,Qb as X,Sb as b,X as j,Za as h,Zb as v,_b as F,ac as ee,da as z,ga as G,gb as S,hb as k,jb as R,kb as L,lb as o,mb as c,nb as P,oa as p,ob as K,pa as m,pb as q,rb as x,sc as te,ub as u,vc as ne,wb as r,yc as ie,zb as H}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),_("src",t==null?null:t.Img,V),l(),T(" ",t.Name," ")}}function We(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){p(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),o(3,"button",14),u("click",function(){p(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),_("ngIf",e.productService.hasSelectionVariant(t))}}function $e(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){p(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function je(i,s){if(i&1){let t=x();o(0,"input",51),w("ngModelChange",function(n){p(t);let a=r(4).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){p(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let t=r(6);_("ngxPermissionsOnly",b(1,O,t.rolePriceEdit))}}function Ge(i,s){if(i&1){let t=x();K(0),o(1,"img",52),u("click",function(n){p(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),q()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,V)}}function Ke(i,s){i&1&&P(0,"img",53)}function qe(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),T("(",t.Category,")")}}function He(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),o(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,Ke,1,0,"ng-template",null,0,ee),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,qe,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;_("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),_("ngClass",b(8,Ue,(e.Variants==null?null:e.Variants.length)<=1)),l(),_("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),_("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Je(i,s){if(i&1){let t=x();o(0,"input",56),w("ngModelChange",function(n){p(t);let a=r(2).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Ze(i,s){if(i&1&&(o(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),T(" ",F(2,1,t.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),_("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function et(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){p(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),T(" ",F(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,He,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=p(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),_("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",b(12,Le,t.Discontinued)),l(),T(" ",t.Code," "),l(),_("ngxPermissionsOnly",b(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),_("ngClass",b(16,Be,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),_("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function nt(i,s){if(i&1&&R(0,tt,22,18,"tr",33,k),i&2){let t=s.$implicit;L(t.Variants)}}function it(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),w("ngModelChange",function(n){p(t);let a=r(2);return y(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){p(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){p(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),R(26,nt,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),_("ngxPermissionsOnly",b(17,O,e.rolePriceEdit)),l(4),_("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),_("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),l(2),Z(" ",Y(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),L(t),l(2),_("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",F(29,15,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function at(i,s){if(i&1){let t=x();o(0,"mainpanel",2),w("textChange",function(n){p(t);let a=r();return y(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){p(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Oe,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,19,"content",9),v(18,"async"),c()}if(i&2){let t=r();_("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),_("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),_("ngIf",F(16,9,t.data$)),l(2),_("ngIf",F(18,11,t.data$))}}var Wt=(()=>{let s=class s{constructor(e,n,a,g,C,D,W,ke,Re){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=D,this.authService=W,this.mainPanelService=ke,this.decimalPipe=Re,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ge.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Me,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(D=>de.IsNotEmpty(D))).subscribe(D=>{this.updateItemAfterDialog(D,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${a.Price?this.decimalPipe.transform(a.Price):a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(re),f(oe),f(Ie),f(be),f(Fe),f(N),f(ue),f(ye),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Q([U,N,E]),X],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,at,19,13,"mainpanel",1),v(1,"async")),n&2&&_("ngIf",F(1,1,a.loader$))},dependencies:[ae,te,ne,ie,E,ve,we,Pe,Se,xe,fe,me,ce,pe,le,se,_e,De,Ne,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{Wt as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as c}from"./chunk-
|
|
1
|
+
import{g as c}from"./chunk-XLSYUMRS.js";import{b as a}from"./chunk-DSF55IXM.js";import{$ as s,ca as o}from"./chunk-C3YE27TZ.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ke}from"./chunk-MLGEX4PW.js";import{a as Ue}from"./chunk-6U6JR5K6.js";import{a as Ve,b as Ne}from"./chunk-2LGY3VGP.js";import{a as Fe}from"./chunk-MSVZKMTY.js";import{a as De,d as we,e as Pe}from"./chunk-S5GA4AVB.js";import{f as Le}from"./chunk-KWFES5F7.js";import{f as xe}from"./chunk-MIZ2DGVO.js";import{b as Te,e as ve}from"./chunk-DSF55IXM.js";import{b as D,c as w,i as P,j as E}from"./chunk-4R22UO7N.js";import{t as j}from"./chunk-MVPTQRFO.js";import{X as Ee}from"./chunk-EKCNJX26.js";import{b as Me,h as $,k as W,u as Oe}from"./chunk-B3LBEB32.js";import{b as p,c as v}from"./chunk-QPRFFPO5.js";import{$ as ce,$a as d,B as le,Bc as Se,Cb as he,Cc as be,Db as fe,Eb as ge,H as re,Ha as M,Hb as Y,Ia as s,Ib as c,Ja as g,Jb as S,K as se,Kb as O,Mb as k,Nb as V,Ob as N,Q as de,Qb as ue,Sb as Ce,T as q,V as H,Za as f,Zb as A,_a as Z,_b as B,ab as me,ac as J,c as z,ca as X,da as pe,ga as T,gb as ee,gd as Ie,lb as l,mb as r,n as ae,nb as b,oa as _,ob as F,pa as y,pb as U,q as K,rb as I,sc as _e,ub as u,uc as x,vc as R,wb as h,yc as ye,za as Q}from"./chunk-C3YE27TZ.js";function je(a,i){if(a&1&&(l(0,"mat-option",10)(1,"div",11),b(2,"img",12),l(3,"span"),c(4),r()()()),a&2){let n=i.$implicit;d("value",n.ID)("disabled",n.disabled),s(),d("matTooltip",n.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",n.Img,M),s(2),S(n.Name)}}function ze(a,i){if(a&1){let n=I();l(0,"div",13)(1,"label",14),c(2,"Scan Type"),r(),l(3,"mat-radio-group",15),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.ScanFull,e)||(o.filter.ScanFull=e),y(e)}),l(4,"mat-radio-button",16),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",17),c(7," Active "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Ge(a,i){a&1&&(l(0,"span"),c(1,"Never"),r())}function Ke(a,i){if(a&1&&(l(0,"span"),c(1),A(2,"async"),r()),a&2){let n=h(2);s(),S(B(2,1,n.lastSync$))}}function He(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3)(2,"span",18),c(3,"Last Scan:"),r(),f(4,Ge,2,0,"span"),A(5,"async"),f(6,Ke,3,3,"span"),r(),l(7,"mat-radio-group",19),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),y(e)}),l(8,"mat-radio-button",20),c(9," Scan All Products "),r(),l(10,"mat-radio-button",21),c(11),r()()()}if(a&2){let n=h();s(4),ee(B(5,6,n.lastSync$)==null?4:6),s(3),k("ngModel",n.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),O(" ",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Qe(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",22),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.Async,e)||(o.filter.Async=e),y(e)}),l(4,"mat-radio-button",23),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",24),c(7," Synchronous (Wait until Complete) "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var Mt=(()=>{let i=class i{constructor(t,e,o){this.dialogRef=t,this.data=e,this.router=o,this.channelService=pe(ke),this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:v.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=v.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=v.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(K(e=>v.IsNotEmpty(e.LastSync)?v.convertToReadableDate(e.LastSync):null),de(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&v.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return v.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};i.\u0275fac=function(e){return new(e||i)(g(D),g(w),g(Ie))},i.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(o.filter.ChannelID,C)||(o.filter.ChannelID=C),C}),u("ngModelChange",function(C){return o.onSelectChannel(C)}),f(7,je,5,5,"mat-option",6),r()(),f(8,ze,8,3,"div",7)(9,He,12,8,"div",8)(10,Qe,8,3,"div",9),r()()()),e&2&&(d("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),s(6),d("disabled",o.disabledChannelOption),k("ngModel",o.filter.ChannelID),s(),d("ngForOf",o.channelOptions),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),s(),ee(o.hasScanUpdate&&o.selectedChannel?9:-1),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[x,R,$,W,Ve,Ne,Le,Fe,Ee,j,E,ye],encapsulation:2});let a=i;return a})();var L=function(a){return a.Tokopedia="https://seller.tokopedia.com",a.Shoope="https://seller.shopee.co.id",a.Tiktok="https://seller-id.tiktok.com",a.WooCommerce="https://woocommerce.dealpos.app",a.Lazada="https://sellercenter.lazada.co.id",a}(L||{});var Ye=a=>({"is-disabled":a});function Je(a,i){if(a&1&&(F(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),U()),a&2){let n=h().$implicit;s(3),O(" ",n==null?null:n.Model,""),s(2),O(" ",n==null?null:n.Code,"")}}function qe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Model,"")}}function Xe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Code,"")}}function Ze(a,i){if(a&1&&(l(0,"tr"),f(1,qe,2,2,"td",14)(2,Xe,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),b(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),A(11,"number"),r(),l(12,"td",19),c(13),A(14,"number"),r(),l(15,"td",19)(16,"a",20),b(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),a&2){let n=i.$implicit,t=i.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",n.Url,M)("title",n.Title),s(),d("src",e.getChannelLogo(n.TypeID),M),s(),d("matTooltip",(n==null||n.Name==null?null:n.Name.length)>55?n==null?null:n.Name:""),s(),O(" ",n.Name," "),s(2),S(B(11,12,n.Price)),s(3),S(B(14,14,n.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(n),M)("ngClass",Ce(16,Ye,n.TypeID==e.channelType.KalCare))("matTooltip",n.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function et(a,i){if(a&1&&f(0,Ze,20,18,"tr",9),a&2){let n=h().$implicit;d("ngForOf",n==null?null:n.Channel)}}function tt(a,i){if(a&1&&(F(0),f(1,Je,9,2,"ng-container",10)(2,et,1,1,"ng-template",null,0,J),U()),a&2){let n=i.$implicit,t=Y(3);s(),d("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",t)}}var Vt=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return v.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),b(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),b(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),b(19,"th",5),r()(),l(20,"tbody"),f(21,tt,4,2,"ng-container",9),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[_e,x,R,j,E,Se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let a=i;return a})();var nt=["selectId"];function it(a,i){if(a&1&&(l(0,"span",3),c(1),r()),a&2){let n=i.item,t=h();d("title",n[t.bindLabel]),s(),S(n[t.bindLabel])}}var Re=(()=>{let i=class i{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new oe,this.selectedChange=new Q,this.selectedLabel=new Q,this.onOpen=new Q}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=T({type:i,selectors:[["ng-select-infinite"]],viewQuery:function(e,o){if(e&1&&he(nt,7),e&2){let m;fe(m=ge())&&(o.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[ue],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(e,o){if(e&1){let m=I();l(0,"ng-select",1,0),u("clear",function(){return _(m),y(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return _(m),y(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return _(m),y(o.onOpenSelect())})("change",function(We){return _(m),y(o.onSelectChange(We))}),f(2,it,2,2,"ng-template",2),r()}e&2&&(me("width",o.width),d("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[be,Pe,we,De,Oe,$,W]});let a=i;return a})(),oe=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new z,this._destroy$=new z,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(re(200),se(),K(i=>(i&&(i=i.toLowerCase()),this.filterData(i))),le(i=>i!==void 0),H(this._destroy$)).subscribe(i=>{this._dataBuffer=i.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(i){let n=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),n=t.indexOf(i),n!==-1||i==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(i){this._data=i||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(i,n){if(Ue.IsNotEmpty(i)){let t=this._data.filter(e=>e[n].toString().toLowerCase().indexOf(i)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(i){this._bufferSize=i}onScrollToEnd(){this.fetchMore()}fetchMore(){let i=this._dataBuffer.length,n=this._data.slice(i,this._bufferSize+i);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(n)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var $e=(()=>{let i=class i{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(q(o=>o!=null?ae(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(q(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};i.\u0275fac=function(e){return new(e||i)(X(xe),X(ve))},i.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();function lt(a,i){if(a&1){let n=I();F(0),l(1,"ng-select-infinite",16),u("selectedChange",function(e){_(n);let o=h().index,m=h();return y(m.onSelectCategory(e,o))}),r(),U()}if(a&2){let n=h().$implicit;s(),d("items",n.Categories)("clearable",!1)}}function rt(a,i){if(a&1&&(l(0,"div",17),b(1,"input",18),r()),a&2){let n=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==n.TypeID||t.channelType.Shopify==n.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(n.TypeID))}}function st(a,i){if(a&1){let n=I();F(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let o=_(n).$implicit;return V(o.Selected,e)||(o.Selected=e),y(e)}),u("ngModelChange",function(){_(n);let e=h();return y(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),b(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),f(10,lt,2,2,"ng-container",15)(11,rt,2,2,"ng-template",null,0,J),r()(),U()}if(a&2){let n=i.$implicit,t=Y(12);s(3),k("ngModel",n.Selected),s(3),d("src",n==null?null:n.Img,M)("alt",n.Name),s(2),S(n.Name),s(2),d("ngIf",n.Categories.length>0)("ngIfElse",t)}}var tn=(()=>{let i=class i{constructor(t,e,o,m){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new z,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,m)=>m.findIndex(C=>e.channelType==C.channelType)==o).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};i.\u0275fac=function(e){return new(e||i)(g(w),g($e),g(D),g(Te))},i.\u0275cmp=T({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),u("change",function(C){return o.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),f(14,st,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[x,R,Me,$,W,j,E,Re],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
|
|
1
|
+
import{a as ke}from"./chunk-MLGEX4PW.js";import{a as Ue}from"./chunk-6U6JR5K6.js";import{a as Ve,b as Ne}from"./chunk-2LGY3VGP.js";import{a as Fe}from"./chunk-MSVZKMTY.js";import{a as De,d as we,e as Pe}from"./chunk-S5GA4AVB.js";import{f as Le}from"./chunk-KWFES5F7.js";import{f as xe}from"./chunk-XLSYUMRS.js";import{b as Te,e as ve}from"./chunk-DSF55IXM.js";import{b as D,c as w,i as P,j as E}from"./chunk-4R22UO7N.js";import{t as j}from"./chunk-MVPTQRFO.js";import{X as Ee}from"./chunk-EKCNJX26.js";import{b as Me,h as $,k as W,u as Oe}from"./chunk-B3LBEB32.js";import{b as p,c as v}from"./chunk-QPRFFPO5.js";import{$ as ce,$a as d,B as le,Bc as Se,Cb as he,Cc as be,Db as fe,Eb as ge,H as re,Ha as M,Hb as Y,Ia as s,Ib as c,Ja as g,Jb as S,K as se,Kb as O,Mb as k,Nb as V,Ob as N,Q as de,Qb as ue,Sb as Ce,T as q,V as H,Za as f,Zb as A,_a as Z,_b as B,ab as me,ac as J,c as z,ca as X,da as pe,ga as T,gb as ee,gd as Ie,lb as l,mb as r,n as ae,nb as b,oa as _,ob as F,pa as y,pb as U,q as K,rb as I,sc as _e,ub as u,uc as x,vc as R,wb as h,yc as ye,za as Q}from"./chunk-C3YE27TZ.js";function je(a,i){if(a&1&&(l(0,"mat-option",10)(1,"div",11),b(2,"img",12),l(3,"span"),c(4),r()()()),a&2){let n=i.$implicit;d("value",n.ID)("disabled",n.disabled),s(),d("matTooltip",n.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",n.Img,M),s(2),S(n.Name)}}function ze(a,i){if(a&1){let n=I();l(0,"div",13)(1,"label",14),c(2,"Scan Type"),r(),l(3,"mat-radio-group",15),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.ScanFull,e)||(o.filter.ScanFull=e),y(e)}),l(4,"mat-radio-button",16),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",17),c(7," Active "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Ge(a,i){a&1&&(l(0,"span"),c(1,"Never"),r())}function Ke(a,i){if(a&1&&(l(0,"span"),c(1),A(2,"async"),r()),a&2){let n=h(2);s(),S(B(2,1,n.lastSync$))}}function He(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3)(2,"span",18),c(3,"Last Scan:"),r(),f(4,Ge,2,0,"span"),A(5,"async"),f(6,Ke,3,3,"span"),r(),l(7,"mat-radio-group",19),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),y(e)}),l(8,"mat-radio-button",20),c(9," Scan All Products "),r(),l(10,"mat-radio-button",21),c(11),r()()()}if(a&2){let n=h();s(4),ee(B(5,6,n.lastSync$)==null?4:6),s(3),k("ngModel",n.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),O(" ",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Qe(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",22),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.Async,e)||(o.filter.Async=e),y(e)}),l(4,"mat-radio-button",23),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",24),c(7," Synchronous (Wait until Complete) "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var Mt=(()=>{let i=class i{constructor(t,e,o){this.dialogRef=t,this.data=e,this.router=o,this.channelService=pe(ke),this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:v.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=v.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=v.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(K(e=>v.IsNotEmpty(e.LastSync)?v.convertToReadableDate(e.LastSync):null),de(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&v.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return v.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};i.\u0275fac=function(e){return new(e||i)(g(D),g(w),g(Ie))},i.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(o.filter.ChannelID,C)||(o.filter.ChannelID=C),C}),u("ngModelChange",function(C){return o.onSelectChannel(C)}),f(7,je,5,5,"mat-option",6),r()(),f(8,ze,8,3,"div",7)(9,He,12,8,"div",8)(10,Qe,8,3,"div",9),r()()()),e&2&&(d("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),s(6),d("disabled",o.disabledChannelOption),k("ngModel",o.filter.ChannelID),s(),d("ngForOf",o.channelOptions),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),s(),ee(o.hasScanUpdate&&o.selectedChannel?9:-1),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[x,R,$,W,Ve,Ne,Le,Fe,Ee,j,E,ye],encapsulation:2});let a=i;return a})();var L=function(a){return a.Tokopedia="https://seller.tokopedia.com",a.Shoope="https://seller.shopee.co.id",a.Tiktok="https://seller-id.tiktok.com",a.WooCommerce="https://woocommerce.dealpos.app",a.Lazada="https://sellercenter.lazada.co.id",a}(L||{});var Ye=a=>({"is-disabled":a});function Je(a,i){if(a&1&&(F(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),U()),a&2){let n=h().$implicit;s(3),O(" ",n==null?null:n.Model,""),s(2),O(" ",n==null?null:n.Code,"")}}function qe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Model,"")}}function Xe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Code,"")}}function Ze(a,i){if(a&1&&(l(0,"tr"),f(1,qe,2,2,"td",14)(2,Xe,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),b(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),A(11,"number"),r(),l(12,"td",19),c(13),A(14,"number"),r(),l(15,"td",19)(16,"a",20),b(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),a&2){let n=i.$implicit,t=i.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",n.Url,M)("title",n.Title),s(),d("src",e.getChannelLogo(n.TypeID),M),s(),d("matTooltip",(n==null||n.Name==null?null:n.Name.length)>55?n==null?null:n.Name:""),s(),O(" ",n.Name," "),s(2),S(B(11,12,n.Price)),s(3),S(B(14,14,n.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(n),M)("ngClass",Ce(16,Ye,n.TypeID==e.channelType.KalCare))("matTooltip",n.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function et(a,i){if(a&1&&f(0,Ze,20,18,"tr",9),a&2){let n=h().$implicit;d("ngForOf",n==null?null:n.Channel)}}function tt(a,i){if(a&1&&(F(0),f(1,Je,9,2,"ng-container",10)(2,et,1,1,"ng-template",null,0,J),U()),a&2){let n=i.$implicit,t=Y(3);s(),d("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",t)}}var Vt=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return v.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),b(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),b(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),b(19,"th",5),r()(),l(20,"tbody"),f(21,tt,4,2,"ng-container",9),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[_e,x,R,j,E,Se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let a=i;return a})();var nt=["selectId"];function it(a,i){if(a&1&&(l(0,"span",3),c(1),r()),a&2){let n=i.item,t=h();d("title",n[t.bindLabel]),s(),S(n[t.bindLabel])}}var Re=(()=>{let i=class i{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new oe,this.selectedChange=new Q,this.selectedLabel=new Q,this.onOpen=new Q}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=T({type:i,selectors:[["ng-select-infinite"]],viewQuery:function(e,o){if(e&1&&he(nt,7),e&2){let m;fe(m=ge())&&(o.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[ue],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(e,o){if(e&1){let m=I();l(0,"ng-select",1,0),u("clear",function(){return _(m),y(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return _(m),y(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return _(m),y(o.onOpenSelect())})("change",function(We){return _(m),y(o.onSelectChange(We))}),f(2,it,2,2,"ng-template",2),r()}e&2&&(me("width",o.width),d("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[be,Pe,we,De,Oe,$,W]});let a=i;return a})(),oe=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new z,this._destroy$=new z,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(re(200),se(),K(i=>(i&&(i=i.toLowerCase()),this.filterData(i))),le(i=>i!==void 0),H(this._destroy$)).subscribe(i=>{this._dataBuffer=i.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(i){let n=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),n=t.indexOf(i),n!==-1||i==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(i){this._data=i||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(i,n){if(Ue.IsNotEmpty(i)){let t=this._data.filter(e=>e[n].toString().toLowerCase().indexOf(i)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(i){this._bufferSize=i}onScrollToEnd(){this.fetchMore()}fetchMore(){let i=this._dataBuffer.length,n=this._data.slice(i,this._bufferSize+i);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(n)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var $e=(()=>{let i=class i{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(q(o=>o!=null?ae(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(q(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};i.\u0275fac=function(e){return new(e||i)(X(xe),X(ve))},i.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();function lt(a,i){if(a&1){let n=I();F(0),l(1,"ng-select-infinite",16),u("selectedChange",function(e){_(n);let o=h().index,m=h();return y(m.onSelectCategory(e,o))}),r(),U()}if(a&2){let n=h().$implicit;s(),d("items",n.Categories)("clearable",!1)}}function rt(a,i){if(a&1&&(l(0,"div",17),b(1,"input",18),r()),a&2){let n=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==n.TypeID||t.channelType.Shopify==n.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(n.TypeID))}}function st(a,i){if(a&1){let n=I();F(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let o=_(n).$implicit;return V(o.Selected,e)||(o.Selected=e),y(e)}),u("ngModelChange",function(){_(n);let e=h();return y(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),b(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),f(10,lt,2,2,"ng-container",15)(11,rt,2,2,"ng-template",null,0,J),r()(),U()}if(a&2){let n=i.$implicit,t=Y(12);s(3),k("ngModel",n.Selected),s(3),d("src",n==null?null:n.Img,M)("alt",n.Name),s(2),S(n.Name),s(2),d("ngIf",n.Categories.length>0)("ngIfElse",t)}}var tn=(()=>{let i=class i{constructor(t,e,o,m){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new z,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,m)=>m.findIndex(C=>e.channelType==C.channelType)==o).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};i.\u0275fac=function(e){return new(e||i)(g(w),g($e),g(D),g(Te))},i.\u0275cmp=T({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),u("change",function(C){return o.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),f(14,st,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[x,R,Me,$,W,j,E,Re],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
|
|
2
2
|
`],encapsulation:2});let a=i;return a})();function dt(a,i){if(a&1&&(l(0,"tr")(1,"td"),c(2),r(),l(3,"td"),c(4),r()()),a&2){let n=i.$implicit;s(2),S(n==null?null:n.Name),s(2),S(n==null?null:n.ChannelVariationSKU)}}var ln=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],[4,"ngFor","ngForOf"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6,"Variant"),r(),l(7,"th",4),c(8,"SKU"),r()()(),l(9,"tbody"),f(10,dt,5,2,"tr",5),r()()()()),e&2&&(d("config",o.modalConfig),s(10),d("ngForOf",o.data.variants))},dependencies:[x,E],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let a=i;return a})();export{Mt as a,Vt as b,Re as c,tn as d,ln as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J}from"./chunk-K7EHVRIN.js";import{a as U}from"./chunk-FZ7LVL4C.js";import"./chunk-R7MYFLXJ.js";import"./chunk-6U6JR5K6.js";import{a as Ye,b as Je}from"./chunk-PIIJRFHM.js";import{a as Y,b as Ke}from"./chunk-QZKWUCMY.js";import"./chunk-MSVZKMTY.js";import"./chunk-RZ7FKABW.js";import{a as ae,b as le,d as de,e as qe}from"./chunk-S5GA4AVB.js";import{a as k}from"./chunk-NSKF7OXH.js";import"./chunk-IPYNDMGQ.js";import"./chunk-KWFES5F7.js";import{g as oe}from"./chunk-MIZ2DGVO.js";import{e as M}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{l as L,m as Ue}from"./chunk-4R22UO7N.js";import{t as ze,u as Ge}from"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{c as te,h as ie,k as ne,m as re,p as Fe,q as Ae,u as je,v as He}from"./chunk-B3LBEB32.js";import{c as Se}from"./chunk-QPRFFPO5.js";import{$ as me,$a as s,$b as T,Ac as ce,Bc as ke,Cc as _e,Ha as W,Hb as z,Ia as d,Ib as l,Ja as f,Jb as g,Kb as x,Mb as y,Nb as S,Ob as C,Pa as Ne,Q as De,Rb as ee,Sb as q,X as he,Za as _,Zb as b,_b as B,aa as pe,ac as G,ba as Me,ca as fe,db as Re,ed as A,fd as Be,ga as E,ha as se,hd as V,ia as Le,jd as ye,lb as e,mb as t,nb as I,oa as u,ob as j,pa as h,pb as H,q as ue,qc as Ve,rb as R,sc as We,ub as P,uc as F,vc as N,wb as w,yc as ve,za as Pe,zb as Oe,zc as D}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var Ze=(()=>{let n=class n{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Sync Inventory",Url:"/menu/log/inventory"},{Title:"Async Inventory ",Url:"/menu/log/inventory-async"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Download Order ",Url:"/menu/log/order-log"}]}ngOnInit(){}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=E({type:n,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(a,i){a&1&&(e(0,"nav",0)(1,"div",1)(2,"div"),I(3,"nav-tab",2),t()()(),I(4,"router-outlet")),a&2&&(d(3),s("Tabs",i.ObjectlogTabs))},dependencies:[Be,Ye]});let r=n;return r})();var Z=(()=>{let n=class n{constructor(){}get Data(){return this._Data}set Data(m){this._Data=m}Fill(m){return this._Data.find(a=>a._id==m)}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=me({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})();var ct=()=>["/menu/log/order/detail"],gt=r=>({ID:r}),ut=r=>({"bg-warning":r});function ht(r,n){if(r&1&&(e(0,"span",22),I(1,"img",23),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function ft(r,n){r&1&&(e(0,"th",27)(1,"span",33),l(2," Response Body Warning "),t()())}function vt(r,n){r&1&&(e(0,"th")(1,"span",33),l(2," Number Override "),t()())}function _t(r,n){if(r&1&&(e(0,"td",27)(1,"span",36),l(2),t()()),r&2){let o=w().$implicit;d(),s("ngClass",q(2,ut,o.responseBodyWarning!=null)),d(),g(o.responseBodyWarning)}}function yt(r,n){if(r&1&&(e(0,"td"),l(1),t()),r&2){let o=w().$implicit;d(),x(" ",o.ResponseBodyWarningReference," ")}}function St(r,n){if(r&1&&(e(0,"tr")(1,"td")(2,"a",34),l(3),b(4,"date"),t()(),e(5,"td"),l(6),t(),e(7,"td"),l(8),t(),e(9,"td"),l(10),t(),e(11,"td",27)(12,"span",35),l(13),t()(),_(14,_t,3,4,"td",29)(15,yt,2,1,"td",30),t()),r&2){let o=n.$implicit,m=w(2);d(2),s("routerLink",ee(14,ct))("queryParams",q(15,gt,o.ID)),d(),x(" ",T(4,11,o.Created,"dd MMM yyyy HH:mm:ss")," "),d(3),g(o.MarketTypeString),d(2),g(o.POSActionTypeString),d(2),g(o.Number),d(2),Re(o.ResponseCode===200||o.ResponseCode===202?"bg-success":"bg-warning"),d(),x(" ",o.ResponseCode," "),d(),s("ngIf",m.responseBodyWarningVisible),d(),s("ngIf",m.responseBodyWarningVisible)}}function Ct(r,n){if(r&1){let o=R();j(0),e(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),l(6,"Date"),t(),e(7,"th"),l(8,"Channel"),t(),e(9,"th"),l(10,"Actions"),t(),e(11,"th"),l(12,"Number"),t(),e(13,"th",27)(14,"span",28),l(15," Response Code "),t()(),_(16,ft,3,0,"th",29)(17,vt,3,0,"th",30),t()(),e(18,"tbody"),_(19,St,16,17,"tr",31),t()(),e(20,"mat-paginator",32),P("page",function(a){u(o);let i=w();return h(i.changePage(a))}),t()(),H()}if(r&2){let o=w();d(16),s("ngIf",o.responseBodyWarningVisible),d(),s("ngIf",o.responseBodyWarningVisible),d(2),s("ngForOf",o.Result),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function bt(r,n){r&1&&(e(0,"div",37),I(1,"app-empty-state"),t())}var Qe=(()=>{let n=class n{constructor(m,a,i,c){this.http=m,this._RawLogService=a,this.route=i,this.authService=c,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(m=>{this.responseCode=m.responseCode,this.responseCode!=null?this.Load(m):this.Load()})}Load(m={}){this.http.post("/api/OrdersLoader/Get",m).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(m){this.filter.Number=m,this.http.post("/api/Orders/Get",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let i of a.hits){i._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let c={ID:i._id,Created:i._source["@timestamp_received"],shopId:i._source.shopId,MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode,responseBodyWarning:i._source.log.responseBodyWarning,ResponseBodyWarningReference:i._source.log.ResponseBodyWarningReference};this.Result.push(c)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(m){this.filter.PageNumber=m.pageIndex+1,this.Get()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(Z),f(A),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-order"]],decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),C("textChange",function(p){return u(c),S(i.Number,p)||(i.Number=p),h(p)}),P("onSubmit",function(p){return u(c),h(i.Get(p))}),e(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),t(),e(5,"ng-select",3),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(6,ht,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",2),l(9,"Action"),t(),e(10,"ng-select",6),C("ngModelChange",function(p){return u(c),S(i.filter.ActionType,p)||(i.filter.ActionType=p),h(p)}),t()(),e(11,"div",5)(12,"label",7),l(13,"From/To"),t(),e(14,"div",8)(15,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(16,"div")(17,"datepicker",10),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(18,"div",5)(19,"label",11),l(20,"Response Code"),t(),e(21,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.StatusCode,p)||(i.filter.StatusCode=p),h(p)}),t()(),e(22,"div",5)(23,"label",11),l(24,"Response Body Warning"),t(),e(25,"input",13),C("ngModelChange",function(p){return u(c),S(i.filter.responseBodyWarning,p)||(i.filter.responseBodyWarning=p),h(p)}),t(),e(26,"datalist",14),I(27,"option",15),t()(),e(28,"div",5)(29,"label",11),l(30,"Page Number"),t(),e(31,"input",16),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(32,"div",5)(33,"label",11),l(34,"Page Size"),t(),e(35,"input",17),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()(),e(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),_(40,Ct,21,6,"ng-container",21)(41,bt,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(42);y("text",i.Number),d(5),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(5),s("clearable",!0)("items",i.ActionTypeList),y("ngModel",i.filter.ActionType),d(5),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.StatusCode),d(4),y("ngModel",i.filter.responseBodyWarning),d(6),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.Result==null?null:i.Result.length)>0)("ngIfElse",c)}},dependencies:[We,F,N,Fe,Ae,te,re,ie,ne,V,L,Y,de,ae,le,J,U,ze,D]});let r=n;return r})();var wt=()=>["/menu/log/inventory/detail"],xt=r=>({ID:r});function It(r,n){if(r&1&&(e(0,"span",18),I(1,"img",19),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function Et(r,n){if(r&1&&(e(0,"tr")(1,"td")(2,"a",25),l(3),b(4,"date"),t()(),e(5,"td"),l(6),t(),e(7,"td"),l(8),t(),e(9,"td"),l(10),t(),e(11,"td"),l(12),t()()),r&2){let o=n.$implicit;d(2),s("routerLink",ee(10,wt))("queryParams",q(11,xt,o.ID)),d(),x(" ",T(4,7,o.Created,"dd MMM yyyy HH:mm")," "),d(3),g(o.channelName),d(2),g(o.Sku),d(2),g(o.Stock),d(2),g(o.ResponseCode)}}function Tt(r,n){if(r&1){let o=R();j(0),e(1,"div",20)(2,"table",21)(3,"thead")(4,"tr",22)(5,"th"),l(6,"Created"),t(),e(7,"th"),l(8,"Channel"),t(),e(9,"th"),l(10,"SKU"),t(),e(11,"th"),l(12,"Stock"),t(),e(13,"th"),l(14,"Response code"),t()()(),e(15,"tbody"),_(16,Et,13,13,"tr",23),t()(),e(17,"mat-paginator",24),P("page",function(a){u(o);let i=w();return h(i.changePage(a))}),t()(),H()}if(r&2){let o=w();d(16),s("ngForOf",o.Result),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function Dt(r,n){r&1&&(e(0,"div",26),I(1,"app-empty-state"),t())}var Xe=(()=>{let n=class n{constructor(m,a,i){this.http=m,this._RawLogService=a,this.authService=i,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(m=>{this.filter=m.Filter,this.ActionTypeList=m.Options.ActionTypeList,this.Get()})}Get(m){m!=null&&(this.filter.Sku=m),this.http.post("api/Inventory/GetLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let i of a.hits){let c={ID:i._source.log.id,Created:i._source["@timestamp_received"],channelName:i._source.log.channelName,Sku:i._source.log.sku,Stock:i._source.log.stock,ResponseCode:i._source.log.responseCode};this.Result.push(c)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(m){this.filter.PageNumber=m.pageIndex+1,this.Get()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(Z),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-inventory-log"]],decls:30,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Inventory Log","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),C("textChange",function(p){return u(c),S(i.filter.Sku,p)||(i.filter.Sku=p),h(p)}),P("onSubmit",function(p){return u(c),h(i.Get(p))}),e(1,"filters")(2,"div",2)(3,"div")(4,"label",3),l(5,"Channel"),t(),e(6,"ng-select",4),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(7,It,3,3,"ng-template",5),t()(),e(8,"div",6)(9,"label",7),l(10,"From/To"),t(),e(11,"div",8)(12,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(13,"div")(14,"datepicker",10),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(15,"div",6)(16,"label",11),l(17,"Page Number"),t(),e(18,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(19,"div",6)(20,"label",11),l(21,"Page Size"),t(),e(22,"input",13),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()()(),e(23,"content")(24,"div",14)(25,"div",15)(26,"div",16),_(27,Tt,18,4,"ng-container",17)(28,Dt,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(29);y("text",i.filter.Sku),d(6),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(6),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.Result==null?null:i.Result.length)>0)("ngIfElse",c)}},dependencies:[F,N,te,re,ie,ne,V,L,Y,de,ae,le,J,U,D]});let r=n;return r})();var Mt=()=>["/menu/log/order/detail"],Lt=r=>({ID:r});function Pt(r,n){if(r&1&&(e(0,"span",17),I(1,"img",18),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function Nt(r,n){if(r&1&&(e(0,"tr")(1,"td")(2,"a",25),l(3),b(4,"date"),t()(),e(5,"td"),l(6),t(),e(7,"td"),l(8),t(),e(9,"td"),l(10),t()()),r&2){let o=n.$implicit;d(2),s("routerLink",ee(9,Mt))("queryParams",q(10,Lt,o.id)),d(),x(" ",T(4,6,o.Created,"dd MMM yyyy HH:mm:ss")," "),d(3),g(o.type),d(2),g(o.number),d(2),g(o.message)}}function Rt(r,n){if(r&1){let o=R();j(0),e(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),l(6,"Date"),t(),e(7,"th"),l(8,"Type"),t(),e(9,"th"),l(10,"Number"),t(),e(11,"th"),l(12,"Message"),t()()(),e(13,"tbody"),_(14,Nt,11,12,"tr",23),t()(),e(15,"mat-paginator",24),P("page",function(a){u(o);let i=w();return h(i.changePage(a))}),t()(),H()}if(r&2){let o=w();d(14),s("ngForOf",o.Result),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function Ot(r,n){r&1&&(e(0,"div",26),I(1,"app-empty-state"),t())}var $e=(()=>{let n=class n{constructor(m,a,i){this.http=m,this._RawLogService=a,this.authService=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(m={}){this.http.post("/api/OrdersLoader/Get",m).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(m){this.filter.Number=m,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let i of a.hits){let c={id:i._id,message:i._source.message,responseCode:i._source.log.responseCode,processTypeString:i._source.log.processType,type:i._source.log.type,number:i._source.log.number,Created:i._source["@timestamp_received"]};this.Result.push(c)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(m){this.filter.PageNumber=m.pageIndex+1,this.Get()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(Z),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-raw-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),C("textChange",function(p){return u(c),S(i.filter.Number,p)||(i.filter.Number=p),h(p)}),P("onSubmit",function(p){return u(c),h(i.Get(p))}),e(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),t(),e(5,"ng-select",3),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(6,Pt,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",6),l(9,"From/To"),t(),e(10,"div",7)(11,"datepicker",8),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(12,"div")(13,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(14,"div",5)(15,"label",10),l(16,"Page Number"),t(),e(17,"input",11),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(18,"div",5)(19,"label",10),l(20,"Page Size"),t(),e(21,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()(),e(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),_(26,Rt,16,4,"ng-container",16)(27,Ot,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(28);y("text",i.filter.Number),d(5),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(6),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.Result==null?null:i.Result.length)>0)("ngIfElse",c)}},dependencies:[F,N,te,re,ie,ne,V,L,Y,de,ae,le,J,U,D]});let r=n;return r})();var Te=class{constructor(n,o){this._document=o;let m=this._textarea=this._document.createElement("textarea"),a=m.style;a.position="fixed",a.top=a.opacity="0",a.left="-999em",m.setAttribute("aria-hidden","true"),m.value=n,m.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(m)}copy(){let n=this._textarea,o=!1;try{if(n){let m=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),o=this._document.execCommand("copy"),m&&m.focus()}}catch{}return o}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},Vt=(()=>{let n=class n{constructor(m){this._document=m}copy(m){let a=this.beginCopy(m),i=a.copy();return a.destroy(),i}beginCopy(m){return new Te(m,this._document)}};n.\u0275fac=function(a){return new(a||n)(fe(Ve))},n.\u0275prov=me({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})(),Wt=new Me("CDK_COPY_TO_CLIPBOARD_CONFIG"),et=(()=>{let n=class n{constructor(m,a,i){this._clipboard=m,this._ngZone=a,this.text="",this.attempts=1,this.copied=new Pe,this._pending=new Set,i&&i.attempts!=null&&(this.attempts=i.attempts)}copy(m=this.attempts){if(m>1){let a=m,i=this._clipboard.beginCopy(this.text);this._pending.add(i);let c=()=>{let v=i.copy();!v&&--a&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(v))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(m=>m.destroy()),this._pending.clear(),this._destroyed=!0}};n.\u0275fac=function(a){return new(a||n)(f(Vt),f(Ne),f(Wt,8))},n.\u0275dir=Le({type:n,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(a,i){a&1&&P("click",function(){return i.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},standalone:!0});let r=n;return r})(),tt=(()=>{let n=class n{};n.\u0275fac=function(a){return new(a||n)},n.\u0275mod=se({type:n}),n.\u0275inj=pe({});let r=n;return r})();function Bt(r,n){r&1&&I(0,"img",21)}function Ft(r,n){r&1&&I(0,"img",22)}function At(r,n){if(r&1&&(e(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),l(4,"General"),t()(),e(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),l(10,"Date"),t(),e(11,"div")(12,"span"),l(13),b(14,"date"),t()()()(),e(15,"div",10)(16,"div",9)(17,"label"),l(18,"Market Place Type"),t(),_(19,Bt,1,0,"img",11)(20,Ft,1,0,"img",12),e(21,"a",13)(22,"span",14),l(23),t(),I(24,"br"),e(25,"small",15),l(26),t()()()(),e(27,"div",10)(28,"div",9)(29,"label"),l(30,"Number"),t(),e(31,"div")(32,"span"),l(33),t()()()(),e(34,"div",8)(35,"div",9)(36,"label"),l(37,"Process Type"),t(),e(38,"div")(39,"span"),l(40),t()()()(),e(41,"div",4)(42,"div",9)(43,"label"),l(44,"Authorization Header"),t(),e(45,"div")(46,"span"),l(47),t()()()(),e(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),l(53,"Request"),t()(),e(54,"div",19)(55,"button",20),l(56,"Copy to clipboard"),t()()(),e(57,"div",7),l(58),t()()()()()()()),r&2){let o=w();d(13),g(T(14,11,o.data.Created,"dd MMM yyyy HH:mm:ss")),d(6),s("ngIf",o.data.TypeID==1),d(),s("ngIf",o.data.TypeID==0),d(),Oe("href",o.data.ShopLink,W),d(2),g(o.data.ShopName),d(3),g(o.data.ShopLink),d(7),g(o.data._source.log.number),d(7),g(o.data._source.log.processType),d(7),g(o.data._source.log.authorizationHeader),d(8),s("cdkCopyToClipboard",o.data._source.log.request),d(3),x(" ",o.data._source.log.request," ")}}var it=(()=>{let n=class n{constructor(m,a,i){this.route=m,this.http=a,this._RawLogService=i,this.route.queryParams.subscribe(c=>{let v=JSON.parse(localStorage.getItem("channel"));if(this.ID=c.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],v.length>0){let p=v.find(st=>st.ShopID==this.data._source.shopId);p?(this.data.TypeID=p.TypeID,this.data.ShopName=p.Name,this.data.ShopLink=p.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M),f(Z))},n.\u0275cmp=E({type:n,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),_(4,At,59,14,"div",3),t()()()()),a&2&&(s("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),d(4),s("ngIf",i.data))},dependencies:[N,L,et,D]});let r=n;return r})();function jt(r,n){if(r&1&&(e(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),l(4,"General"),t()(),e(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),l(10,"Date"),t(),e(11,"div")(12,"span"),l(13),b(14,"date"),t()()()(),e(15,"div",6)(16,"div",12)(17,"label"),l(18,"SKU"),t(),e(19,"div")(20,"span"),l(21),t()()()(),e(22,"div",6)(23,"div",12)(24,"label"),l(25,"Channel"),t(),e(26,"div")(27,"span"),l(28),t()()()(),e(29,"div",6)(30,"div",12)(31,"label"),l(32,"Response Code"),t(),e(33,"div")(34,"span"),l(35),t()()()()()()()()),r&2){let o=w();d(13),g(T(14,4,o.data.Created,"dd MMM yyyy")),d(8),g(o.data.Sku),d(7),g(o.data.ChannelName),d(7),g(o.data.ResponseCode)}}var nt=(()=>{let n=class n{constructor(m,a,i){this.route=m,this.http=a,this._RawLogService=i,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(c=>{this.ID=c.ID,this.Load()})}ngOnInit(){}Load(){var m={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",m).subscribe(a=>{this.data.Created=a.hits[0]._source["@timestamp_received"],this.data.Sku=a.hits[0]._source.log.sku,this.data.ChannelName=a.hits[0]._source.log.channelName,this.data.ResponseCode=a.hits[0]._source.log.responseCode,this.request=JSON.parse(a.hits[0]._source.log.request),this.response=a.hits[0]._source.log.response})}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M),f(Z))},n.\u0275cmp=E({type:n,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),t()(),e(4,"content")(5,"div",2)(6,"div",3),_(7,jt,36,7,"div",4),t(),e(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),l(13,"Request"),t()(),e(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),l(18),b(19,"json"),t()()()()()(),e(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),l(24,"Response"),t()(),e(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),l(29),t()()()()()()()()()()),a&2&&(s("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),d(7),s("ngIf",i.data),d(11),g(B(19,7,i.request)),d(11),g(i.response))},dependencies:[N,V,L,ce,D]});let r=n;return r})();function Ht(r,n){if(r&1&&(e(0,"div",9)(1,"div",10)(2,"label"),l(3,"Process Code"),t(),e(4,"div")(5,"span"),l(6),t()()()()),r&2){let o=w();d(6),g(o.ProcessedCode)}}function qt(r,n){if(r&1){let o=R();e(0,"a",16),P("click",function(){u(o);let a=w();return h(a.Retry())}),l(1,"Retry"),t()}}var rt=(()=>{let n=class n{constructor(m,a){this.route=m,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Retry(){var m={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",m).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var m={ID:this.ID};this.http.post("/api/Orders/GetDetail",m).subscribe(a=>{for(let i of a.hits)this.Number=i._source.log.number,this.MarketTypeString=i._source.log.type,this.ResponseCode=i._source.log.responseCode,this.POSActionTypeString=i._source.message,this.ProcessDuration=0,this.Created=i._source["@timestamp_received"],this.request=JSON.parse(i._source.log.request),this.response=JSON.parse(i._source.log.response),this.shopId=i._source.shopId,this.ProcessedCode=i._source.log.processedCode})}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M))},n.\u0275cmp=E({type:n,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),t()(),e(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),l(11,"General"),t()(),e(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),l(17,"Date"),t(),e(18,"div")(19,"span"),l(20),b(21,"date"),t()()()(),e(22,"div",9)(23,"div",10)(24,"label"),l(25,"Number"),t(),e(26,"div")(27,"span"),l(28),t()()()(),e(29,"div",9)(30,"div",10)(31,"label"),l(32,"Type"),t(),e(33,"div")(34,"span"),l(35),t()()()(),e(36,"div",9)(37,"div",10)(38,"label"),l(39,"Response Code"),t(),e(40,"div")(41,"span"),l(42),t()()()(),e(43,"div",9)(44,"div",10)(45,"label"),l(46,"ShopID"),t(),e(47,"div")(48,"span"),l(49),t()()()(),_(50,Ht,7,1,"div",11),e(51,"div",9)(52,"div",10)(53,"label"),l(54,"Action"),t(),e(55,"div")(56,"span"),l(57),t()()()()()()()()(),e(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),l(63,"Request"),t()(),e(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),l(68),b(69,"json"),t()()(),e(70,"actions",14),_(71,qt,2,0,"a",15),t()()()(),e(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),l(76,"Response"),t()(),e(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),l(81),b(82,"json"),t()()()()()()()()()()),a&2&&(s("headerTitle","Order #"+i.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),g(T(21,14,i.Created,"dd MMM yyyy HH:mm:ss")),d(8),g(i.Number),d(7),g(i.MarketTypeString),d(7),g(i.ResponseCode),d(7),g(i.shopId),d(),s("ngIf",i.ProcessedCode!=null),d(7),g(i.POSActionTypeString),d(11),g(B(69,17,i.request)),d(3),s("ngIf",i.ResponseCode!="200"&&i.ResponseCode!="201"),d(10),g(B(82,19,i.response)))},dependencies:[N,V,L,ce,D]});let r=n;return r})();var zt=()=>["/menu/log/exception/detail"],Gt=r=>({ID:r});function Ut(r,n){if(r&1&&(e(0,"tr")(1,"td",12),I(2,"img",13),t(),e(3,"td"),l(4),b(5,"date"),t(),e(6,"td")(7,"a",14),l(8),t()(),e(9,"td")(10,"div",15),l(11),t(),e(12,"div"),l(13),t()()()),r&2){let o=n.$implicit;d(2),s("src",o.logo,W),d(2),g(T(5,7,o.date,"dd-MM-yyyy hh:mm:ss")),d(3),s("routerLink",ee(10,zt))("queryParams",q(11,Gt,o.id)),d(),x(" ",o.number," "),d(3),g(o.message),d(2),g(o.stackTrace)}}function Yt(r,n){if(r&1){let o=R();j(0),e(1,"mat-paginator",16),P("page",function(a){u(o);let i=w(2);return h(i.onPaginationChange(a))}),t(),H()}if(r&2){let o=w(2);d(),s("length",o.pageTotal)("pageSize",o.pageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function Jt(r,n){if(r&1&&(j(0),e(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),l(6,"Channel"),t(),e(7,"th",9),l(8,"Date"),t(),e(9,"th"),l(10,"Number"),t(),e(11,"th"),l(12,"Exception"),t()()(),e(13,"tbody"),_(14,Ut,14,13,"tr",10),t()(),_(15,Yt,2,3,"ng-container",11),t(),H()),r&2){let o=w();d(14),s("ngForOf",o.exceptions),d(),s("ngIf",(o.exceptions==null?null:o.exceptions.length)>0)}}function Kt(r,n){r&1&&(e(0,"div",17),I(1,"app-empty-state"),t())}var ot=(()=>{let n=class n{constructor(m){this.http=m,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(m=>{this.exceptions=m.hits.map(a=>({id:a._id,logo:Se.getChannelLogoByName(a._source.error?.Type),number:a._source.error.number,date:a._source["@timestamp_received"],stackTrace:a._source.error.stackTrace,message:a._source.message,requestJSON:a._source?.error?.requestJSON})),this.pageTotal=m.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(m){this.filter.PageNumber=m.pageIndex+1,this.getData()}};n.\u0275fac=function(a){return new(a||n)(f(M))},n.\u0275cmp=E({type:n,selectors:[["app-exception-log"]],decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1&&(e(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),_(5,Jt,16,2,"ng-container",5)(6,Kt,2,0,"ng-template",null,0,G),t()()()()()),a&2){let c=z(7);d(5),s("ngIf",i.exceptions.length>0)("ngIfElse",c)}},dependencies:[F,N,V,L,Y,U,D]});let r=n;return r})();var Zt=r=>({ID:r});function Qt(r,n){if(r&1&&(e(0,"span",17),I(1,"img",18),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function Xt(r,n){if(r&1&&(e(0,"tr")(1,"td"),l(2),t(),e(3,"td"),I(4,"img",28),t(),e(5,"td"),l(6),t(),e(7,"td",29)(8,"a",30),l(9),b(10,"number"),t()(),e(11,"td"),l(12),t(),e(13,"td"),l(14),b(15,"date"),t()()),r&2){let o=n.$implicit;d(2),g(o._source.ChannelName),d(2),s("src",o.logo,W),d(2),g(o._source.DateRange),d(2),s("queryParams",q(12,Zt,o._source.ID)),d(),x(" ",B(10,7,o._source.CountOrder)," "),d(3),g(o._source.UserLogin),d(2),x(" ",T(15,9,o._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function $t(r,n){if(r&1){let o=R();j(0),e(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),t(),e(7,"th",23),l(8,"Type"),t(),e(9,"th",24),l(10,"Download Date Range"),t(),e(11,"th",25),l(12,"Count"),t(),e(13,"th"),l(14,"User Login"),t(),e(15,"th"),l(16,"Created"),t()()(),e(17,"tbody"),_(18,Xt,16,14,"tr",26),t()(),e(19,"mat-paginator",27),P("page",function(a){u(o);let i=w();return h(i.onPaginationChange(a))}),t()(),H()}if(r&2){let o=w();d(18),s("ngForOf",o.downloadOrders),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function ei(r,n){r&1&&(e(0,"div",31),I(1,"app-empty-state"),t())}var at=(()=>{let n=class n{constructor(m,a){this.http=m,this.authService=a,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(m=>{this.filter=m.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(m=>{this.downloadOrders=m.hits,this.setChannelLogo(),this.paginationTotal=m.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(m=>(m.logo=Se.getChannelLogoByTypeId(m._source.TypeID),m))}onPaginationChange(m){this.filter.PageNumber=m.pageIndex+1,this.getDownloadOrders()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-manual-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/log/order-log/order-log-detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),P("onSubmit",function(){return u(c),h(i.getDownloadOrders())}),e(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),t(),e(5,"ng-select",3),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(6,Qt,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",6),l(9,"From/To"),t(),e(10,"div",7)(11,"datepicker",8),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(12,"div")(13,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(14,"div",5)(15,"label",10),l(16,"Page Number"),t(),e(17,"input",11),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(18,"div",5)(19,"label",10),l(20,"Page Size"),t(),e(21,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()(),e(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),_(26,$t,20,4,"ng-container",16)(27,ei,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(28);s("hideSearchBox",!0),d(5),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(6),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",c)}},dependencies:[F,N,te,re,ie,ne,V,L,Y,de,ae,le,J,U,ke,D]});let r=n;return r})();var lt=(()=>{let n=class n{constructor(m){this.httpService=m}getExceptionDetail(m){return this.httpService.post("/api/Orders/GetDetailException",{ID:m}).pipe(ue(i=>i?.hits[0]?._source))}};n.\u0275fac=function(a){return new(a||n)(fe(M))},n.\u0275prov=me({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})();function ii(r,n){if(r&1&&(e(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),l(6,"General"),t()(),e(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),l(12,"Date"),t(),e(13,"div")(14,"span"),l(15),b(16,"date"),t()()()(),e(17,"div",9)(18,"div",10)(19,"label"),l(20,"Number"),t(),e(21,"div")(22,"span"),l(23),t()()()(),e(24,"div",9)(25,"div",10)(26,"label"),l(27,"Type"),t(),e(28,"div")(29,"span"),l(30),t()()()(),e(31,"div",9)(32,"div",10)(33,"label"),l(34,"ShopID"),t(),e(35,"div")(36,"span"),l(37),t()()()()()()()()(),e(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),l(43,"Request"),t()(),e(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),l(48),b(49,"json"),t()()()()()(),e(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),l(54,"Exception"),t()(),e(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),l(59),t(),e(60,"pre"),l(61),t()()()()()()()()),r&2){let o=n.ngIf;d(15),g(T(16,7,o["@timestamp"],"dd MMM yyyy HH:mm:ss")),d(8),g(o==null||o.error==null?null:o.error.number),d(7),g(o==null||o.error==null?null:o.error.Type),d(7),g(o==null?null:o.shopId),d(11),g(B(49,10,o==null||o.error==null?null:o.error.requestJSON)),d(11),g(o==null?null:o.message),d(2),g(o==null||o.error==null?null:o.error.stackTrace)}}var dt=(()=>{let n=class n{constructor(m,a){this.activatedRoute=m,this.exceptionService=a,this.invoiceNumber=""}ngOnInit(){let m=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(m?.ID)}getExceptionDetail(m){this.exceptionDetail$=this.exceptionService.getExceptionDetail(m).pipe(he(a=>{this.invoiceNumber=a?.error?.number}),De(1))}};n.\u0275fac=function(a){return new(a||n)(f(A),f(lt))},n.\u0275cmp=E({type:n,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"content"),_(2,ii,62,12,"div",1),b(3,"async"),t()()),a&2&&(s("headerTitle","Order #"+i.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),d(2),s("ngIf",B(3,4,i.exceptionDetail$)))},dependencies:[N,L,ve,ce,D]});let r=n;return r})();function ni(r,n){if(r&1&&(e(0,"tr")(1,"td"),l(2),t(),e(3,"td"),l(4),t(),e(5,"td"),l(6),b(7,"date"),t(),e(8,"td"),l(9),b(10,"date"),t(),e(11,"td"),l(12),t()()),r&2){let o=n.$implicit;d(2),x(" ",o.Number," "),d(2),x(" ",o.Status," "),d(2),x(" ",T(7,5,o.Start,"HH:mm:ss:SSS")," "),d(3),x(" ",T(10,8,o.End,"HH:mm:ss:SSS")," "),d(3),x(" ",o.Exception," ")}}var mt=(()=>{let n=class n{constructor(m,a){this.route=m,this.httpService=a}ngOnInit(){this.initOrderDetails()}initOrderDetails(){let m=this.route.snapshot.queryParams;this.orderDetails$=this.httpService.post("/api/Orders/DownloadOrderLogsDetail",{ID:m.ID}).pipe(he(a=>{let i=a?.hits[0]?._source;this.headerTitle=`${i?.ChannelName} (${i?.DateRange})`}),ue(a=>a?.hits[0]._source?.Detail))}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M))},n.\u0275cmp=E({type:n,selectors:[["app-download-order-detail"]],decls:22,vars:7,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","200px"],[2,"width","150px"],[2,"width","100px"],[4,"ngFor","ngForOf"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"table",5)(7,"thead")(8,"tr",6)(9,"th",7),l(10,"Number"),t(),e(11,"th",8),l(12,"Status"),t(),e(13,"th",9),l(14,"Start Time"),t(),e(15,"th",9),l(16,"End Time"),t(),e(17,"th"),l(18,"Exception"),t()()(),e(19,"tbody"),_(20,ni,13,11,"tr",10),b(21,"async"),t()()()()()()()()),a&2&&(s("headerTitle",i.headerTitle)("description",i.headerTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),s("ngForOf",B(21,5,i.orderDetails$)))},dependencies:[F,L,ve,D]});let r=n;return r})();var ri=[{path:"",component:Ze,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Qe,canActivate:[k],data:{title:"Order Log"}},{path:"inventory",component:Xe,canActivate:[k],data:{title:"Inventory Log"}},{path:"rawlog",component:$e,canActivate:[k],data:{title:"Raw Log"}},{path:"rawlog/detail",component:it,canActivate:[k],data:{title:"Raw Log Detail"}},{path:"inventory/detail",component:nt,canActivate:[k],data:{title:"Inventory Details"}},{path:"order/detail",component:rt,canActivate:[k],data:{title:"Order Details"}},{path:"exception",component:ot,canActivate:[k],data:{title:"Exception Log"}},{path:"exception/detail",component:dt,canActivate:[k],data:{title:"Exception Log Detail"}},{path:"order-log",component:at,canActivate:[k],data:{title:"order Log"}},{path:"order-log/order-log-detail",component:mt,canActivate:[k],data:{title:"Order Log Detail"}},{path:"inventory-async",loadComponent:()=>import("./chunk-G6HY2OKZ.js").then(r=>r.InventoryAsyncLogComponent),canActivate:[k],data:{title:"Sync Inventory Async"}},{path:"inventory-async/detail",loadComponent:()=>import("./chunk-KCFS3M2K.js").then(r=>r.InventoryAsyncDetailComponent),canActivate:[k],data:{title:"Sync Inventory Async Detail"}}]}],pt=(()=>{let n=class n{};n.\u0275fac=function(a){return new(a||n)},n.\u0275mod=se({type:n}),n.\u0275inj=pe({imports:[_e,ye.forChild(ri)]});let r=n;return r})();var Mn=(()=>{let n=class n{};n.\u0275fac=function(a){return new(a||n)},n.\u0275mod=se({type:n}),n.\u0275inj=pe({imports:[_e,je,He,pt,ye,Ue,tt,Ke,qe,Je,J,Ge]});let r=n;return r})();export{Mn as LogsModule};
|
|
1
|
+
import{a as J}from"./chunk-K7EHVRIN.js";import{a as U}from"./chunk-FZ7LVL4C.js";import"./chunk-R7MYFLXJ.js";import"./chunk-6U6JR5K6.js";import{a as Ye,b as Je}from"./chunk-PIIJRFHM.js";import{a as Y,b as Ke}from"./chunk-QZKWUCMY.js";import"./chunk-MSVZKMTY.js";import"./chunk-RZ7FKABW.js";import{a as ae,b as le,d as de,e as qe}from"./chunk-S5GA4AVB.js";import{a as k}from"./chunk-HFUGRK45.js";import"./chunk-IPYNDMGQ.js";import"./chunk-KWFES5F7.js";import{g as oe}from"./chunk-XLSYUMRS.js";import{e as M}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{l as L,m as Ue}from"./chunk-4R22UO7N.js";import{t as ze,u as Ge}from"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{c as te,h as ie,k as ne,m as re,p as Fe,q as Ae,u as je,v as He}from"./chunk-B3LBEB32.js";import{c as Se}from"./chunk-QPRFFPO5.js";import{$ as me,$a as s,$b as T,Ac as ce,Bc as ke,Cc as _e,Ha as W,Hb as z,Ia as d,Ib as l,Ja as f,Jb as g,Kb as x,Mb as y,Nb as S,Ob as C,Pa as Ne,Q as De,Rb as ee,Sb as q,X as he,Za as _,Zb as b,_b as B,aa as pe,ac as G,ba as Me,ca as fe,db as Re,ed as A,fd as Be,ga as E,ha as se,hd as V,ia as Le,jd as ye,lb as e,mb as t,nb as I,oa as u,ob as j,pa as h,pb as H,q as ue,qc as Ve,rb as R,sc as We,ub as P,uc as F,vc as N,wb as w,yc as ve,za as Pe,zb as Oe,zc as D}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var Ze=(()=>{let n=class n{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Sync Inventory",Url:"/menu/log/inventory"},{Title:"Async Inventory ",Url:"/menu/log/inventory-async"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Download Order ",Url:"/menu/log/order-log"}]}ngOnInit(){}};n.\u0275fac=function(a){return new(a||n)},n.\u0275cmp=E({type:n,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(a,i){a&1&&(e(0,"nav",0)(1,"div",1)(2,"div"),I(3,"nav-tab",2),t()()(),I(4,"router-outlet")),a&2&&(d(3),s("Tabs",i.ObjectlogTabs))},dependencies:[Be,Ye]});let r=n;return r})();var Z=(()=>{let n=class n{constructor(){}get Data(){return this._Data}set Data(m){this._Data=m}Fill(m){return this._Data.find(a=>a._id==m)}};n.\u0275fac=function(a){return new(a||n)},n.\u0275prov=me({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})();var ct=()=>["/menu/log/order/detail"],gt=r=>({ID:r}),ut=r=>({"bg-warning":r});function ht(r,n){if(r&1&&(e(0,"span",22),I(1,"img",23),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function ft(r,n){r&1&&(e(0,"th",27)(1,"span",33),l(2," Response Body Warning "),t()())}function vt(r,n){r&1&&(e(0,"th")(1,"span",33),l(2," Number Override "),t()())}function _t(r,n){if(r&1&&(e(0,"td",27)(1,"span",36),l(2),t()()),r&2){let o=w().$implicit;d(),s("ngClass",q(2,ut,o.responseBodyWarning!=null)),d(),g(o.responseBodyWarning)}}function yt(r,n){if(r&1&&(e(0,"td"),l(1),t()),r&2){let o=w().$implicit;d(),x(" ",o.ResponseBodyWarningReference," ")}}function St(r,n){if(r&1&&(e(0,"tr")(1,"td")(2,"a",34),l(3),b(4,"date"),t()(),e(5,"td"),l(6),t(),e(7,"td"),l(8),t(),e(9,"td"),l(10),t(),e(11,"td",27)(12,"span",35),l(13),t()(),_(14,_t,3,4,"td",29)(15,yt,2,1,"td",30),t()),r&2){let o=n.$implicit,m=w(2);d(2),s("routerLink",ee(14,ct))("queryParams",q(15,gt,o.ID)),d(),x(" ",T(4,11,o.Created,"dd MMM yyyy HH:mm:ss")," "),d(3),g(o.MarketTypeString),d(2),g(o.POSActionTypeString),d(2),g(o.Number),d(2),Re(o.ResponseCode===200||o.ResponseCode===202?"bg-success":"bg-warning"),d(),x(" ",o.ResponseCode," "),d(),s("ngIf",m.responseBodyWarningVisible),d(),s("ngIf",m.responseBodyWarningVisible)}}function Ct(r,n){if(r&1){let o=R();j(0),e(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),l(6,"Date"),t(),e(7,"th"),l(8,"Channel"),t(),e(9,"th"),l(10,"Actions"),t(),e(11,"th"),l(12,"Number"),t(),e(13,"th",27)(14,"span",28),l(15," Response Code "),t()(),_(16,ft,3,0,"th",29)(17,vt,3,0,"th",30),t()(),e(18,"tbody"),_(19,St,16,17,"tr",31),t()(),e(20,"mat-paginator",32),P("page",function(a){u(o);let i=w();return h(i.changePage(a))}),t()(),H()}if(r&2){let o=w();d(16),s("ngIf",o.responseBodyWarningVisible),d(),s("ngIf",o.responseBodyWarningVisible),d(2),s("ngForOf",o.Result),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function bt(r,n){r&1&&(e(0,"div",37),I(1,"app-empty-state"),t())}var Qe=(()=>{let n=class n{constructor(m,a,i,c){this.http=m,this._RawLogService=a,this.route=i,this.authService=c,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(m=>{this.responseCode=m.responseCode,this.responseCode!=null?this.Load(m):this.Load()})}Load(m={}){this.http.post("/api/OrdersLoader/Get",m).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(m){this.filter.Number=m,this.http.post("/api/Orders/Get",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let i of a.hits){i._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let c={ID:i._id,Created:i._source["@timestamp_received"],shopId:i._source.shopId,MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode,responseBodyWarning:i._source.log.responseBodyWarning,ResponseBodyWarningReference:i._source.log.ResponseBodyWarningReference};this.Result.push(c)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(m){this.filter.PageNumber=m.pageIndex+1,this.Get()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(Z),f(A),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-order"]],decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),C("textChange",function(p){return u(c),S(i.Number,p)||(i.Number=p),h(p)}),P("onSubmit",function(p){return u(c),h(i.Get(p))}),e(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),t(),e(5,"ng-select",3),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(6,ht,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",2),l(9,"Action"),t(),e(10,"ng-select",6),C("ngModelChange",function(p){return u(c),S(i.filter.ActionType,p)||(i.filter.ActionType=p),h(p)}),t()(),e(11,"div",5)(12,"label",7),l(13,"From/To"),t(),e(14,"div",8)(15,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(16,"div")(17,"datepicker",10),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(18,"div",5)(19,"label",11),l(20,"Response Code"),t(),e(21,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.StatusCode,p)||(i.filter.StatusCode=p),h(p)}),t()(),e(22,"div",5)(23,"label",11),l(24,"Response Body Warning"),t(),e(25,"input",13),C("ngModelChange",function(p){return u(c),S(i.filter.responseBodyWarning,p)||(i.filter.responseBodyWarning=p),h(p)}),t(),e(26,"datalist",14),I(27,"option",15),t()(),e(28,"div",5)(29,"label",11),l(30,"Page Number"),t(),e(31,"input",16),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(32,"div",5)(33,"label",11),l(34,"Page Size"),t(),e(35,"input",17),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()(),e(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),_(40,Ct,21,6,"ng-container",21)(41,bt,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(42);y("text",i.Number),d(5),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(5),s("clearable",!0)("items",i.ActionTypeList),y("ngModel",i.filter.ActionType),d(5),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.StatusCode),d(4),y("ngModel",i.filter.responseBodyWarning),d(6),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.Result==null?null:i.Result.length)>0)("ngIfElse",c)}},dependencies:[We,F,N,Fe,Ae,te,re,ie,ne,V,L,Y,de,ae,le,J,U,ze,D]});let r=n;return r})();var wt=()=>["/menu/log/inventory/detail"],xt=r=>({ID:r});function It(r,n){if(r&1&&(e(0,"span",18),I(1,"img",19),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function Et(r,n){if(r&1&&(e(0,"tr")(1,"td")(2,"a",25),l(3),b(4,"date"),t()(),e(5,"td"),l(6),t(),e(7,"td"),l(8),t(),e(9,"td"),l(10),t(),e(11,"td"),l(12),t()()),r&2){let o=n.$implicit;d(2),s("routerLink",ee(10,wt))("queryParams",q(11,xt,o.ID)),d(),x(" ",T(4,7,o.Created,"dd MMM yyyy HH:mm")," "),d(3),g(o.channelName),d(2),g(o.Sku),d(2),g(o.Stock),d(2),g(o.ResponseCode)}}function Tt(r,n){if(r&1){let o=R();j(0),e(1,"div",20)(2,"table",21)(3,"thead")(4,"tr",22)(5,"th"),l(6,"Created"),t(),e(7,"th"),l(8,"Channel"),t(),e(9,"th"),l(10,"SKU"),t(),e(11,"th"),l(12,"Stock"),t(),e(13,"th"),l(14,"Response code"),t()()(),e(15,"tbody"),_(16,Et,13,13,"tr",23),t()(),e(17,"mat-paginator",24),P("page",function(a){u(o);let i=w();return h(i.changePage(a))}),t()(),H()}if(r&2){let o=w();d(16),s("ngForOf",o.Result),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function Dt(r,n){r&1&&(e(0,"div",26),I(1,"app-empty-state"),t())}var Xe=(()=>{let n=class n{constructor(m,a,i){this.http=m,this._RawLogService=a,this.authService=i,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(m=>{this.filter=m.Filter,this.ActionTypeList=m.Options.ActionTypeList,this.Get()})}Get(m){m!=null&&(this.filter.Sku=m),this.http.post("api/Inventory/GetLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let i of a.hits){let c={ID:i._source.log.id,Created:i._source["@timestamp_received"],channelName:i._source.log.channelName,Sku:i._source.log.sku,Stock:i._source.log.stock,ResponseCode:i._source.log.responseCode};this.Result.push(c)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(m){this.filter.PageNumber=m.pageIndex+1,this.Get()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(Z),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-inventory-log"]],decls:30,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Inventory Log","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),C("textChange",function(p){return u(c),S(i.filter.Sku,p)||(i.filter.Sku=p),h(p)}),P("onSubmit",function(p){return u(c),h(i.Get(p))}),e(1,"filters")(2,"div",2)(3,"div")(4,"label",3),l(5,"Channel"),t(),e(6,"ng-select",4),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(7,It,3,3,"ng-template",5),t()(),e(8,"div",6)(9,"label",7),l(10,"From/To"),t(),e(11,"div",8)(12,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(13,"div")(14,"datepicker",10),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(15,"div",6)(16,"label",11),l(17,"Page Number"),t(),e(18,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(19,"div",6)(20,"label",11),l(21,"Page Size"),t(),e(22,"input",13),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()()(),e(23,"content")(24,"div",14)(25,"div",15)(26,"div",16),_(27,Tt,18,4,"ng-container",17)(28,Dt,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(29);y("text",i.filter.Sku),d(6),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(6),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.Result==null?null:i.Result.length)>0)("ngIfElse",c)}},dependencies:[F,N,te,re,ie,ne,V,L,Y,de,ae,le,J,U,D]});let r=n;return r})();var Mt=()=>["/menu/log/order/detail"],Lt=r=>({ID:r});function Pt(r,n){if(r&1&&(e(0,"span",17),I(1,"img",18),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function Nt(r,n){if(r&1&&(e(0,"tr")(1,"td")(2,"a",25),l(3),b(4,"date"),t()(),e(5,"td"),l(6),t(),e(7,"td"),l(8),t(),e(9,"td"),l(10),t()()),r&2){let o=n.$implicit;d(2),s("routerLink",ee(9,Mt))("queryParams",q(10,Lt,o.id)),d(),x(" ",T(4,6,o.Created,"dd MMM yyyy HH:mm:ss")," "),d(3),g(o.type),d(2),g(o.number),d(2),g(o.message)}}function Rt(r,n){if(r&1){let o=R();j(0),e(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),l(6,"Date"),t(),e(7,"th"),l(8,"Type"),t(),e(9,"th"),l(10,"Number"),t(),e(11,"th"),l(12,"Message"),t()()(),e(13,"tbody"),_(14,Nt,11,12,"tr",23),t()(),e(15,"mat-paginator",24),P("page",function(a){u(o);let i=w();return h(i.changePage(a))}),t()(),H()}if(r&2){let o=w();d(14),s("ngForOf",o.Result),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function Ot(r,n){r&1&&(e(0,"div",26),I(1,"app-empty-state"),t())}var $e=(()=>{let n=class n{constructor(m,a,i){this.http=m,this._RawLogService=a,this.authService=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(m={}){this.http.post("/api/OrdersLoader/Get",m).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(m){this.filter.Number=m,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let i of a.hits){let c={id:i._id,message:i._source.message,responseCode:i._source.log.responseCode,processTypeString:i._source.log.processType,type:i._source.log.type,number:i._source.log.number,Created:i._source["@timestamp_received"]};this.Result.push(c)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(m){this.filter.PageNumber=m.pageIndex+1,this.Get()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(Z),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-raw-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),C("textChange",function(p){return u(c),S(i.filter.Number,p)||(i.filter.Number=p),h(p)}),P("onSubmit",function(p){return u(c),h(i.Get(p))}),e(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),t(),e(5,"ng-select",3),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(6,Pt,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",6),l(9,"From/To"),t(),e(10,"div",7)(11,"datepicker",8),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(12,"div")(13,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(14,"div",5)(15,"label",10),l(16,"Page Number"),t(),e(17,"input",11),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(18,"div",5)(19,"label",10),l(20,"Page Size"),t(),e(21,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()(),e(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),_(26,Rt,16,4,"ng-container",16)(27,Ot,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(28);y("text",i.filter.Number),d(5),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(6),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.Result==null?null:i.Result.length)>0)("ngIfElse",c)}},dependencies:[F,N,te,re,ie,ne,V,L,Y,de,ae,le,J,U,D]});let r=n;return r})();var Te=class{constructor(n,o){this._document=o;let m=this._textarea=this._document.createElement("textarea"),a=m.style;a.position="fixed",a.top=a.opacity="0",a.left="-999em",m.setAttribute("aria-hidden","true"),m.value=n,m.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(m)}copy(){let n=this._textarea,o=!1;try{if(n){let m=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),o=this._document.execCommand("copy"),m&&m.focus()}}catch{}return o}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},Vt=(()=>{let n=class n{constructor(m){this._document=m}copy(m){let a=this.beginCopy(m),i=a.copy();return a.destroy(),i}beginCopy(m){return new Te(m,this._document)}};n.\u0275fac=function(a){return new(a||n)(fe(Ve))},n.\u0275prov=me({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})(),Wt=new Me("CDK_COPY_TO_CLIPBOARD_CONFIG"),et=(()=>{let n=class n{constructor(m,a,i){this._clipboard=m,this._ngZone=a,this.text="",this.attempts=1,this.copied=new Pe,this._pending=new Set,i&&i.attempts!=null&&(this.attempts=i.attempts)}copy(m=this.attempts){if(m>1){let a=m,i=this._clipboard.beginCopy(this.text);this._pending.add(i);let c=()=>{let v=i.copy();!v&&--a&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(i),i.destroy(),this.copied.emit(v))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(m=>m.destroy()),this._pending.clear(),this._destroyed=!0}};n.\u0275fac=function(a){return new(a||n)(f(Vt),f(Ne),f(Wt,8))},n.\u0275dir=Le({type:n,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(a,i){a&1&&P("click",function(){return i.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},standalone:!0});let r=n;return r})(),tt=(()=>{let n=class n{};n.\u0275fac=function(a){return new(a||n)},n.\u0275mod=se({type:n}),n.\u0275inj=pe({});let r=n;return r})();function Bt(r,n){r&1&&I(0,"img",21)}function Ft(r,n){r&1&&I(0,"img",22)}function At(r,n){if(r&1&&(e(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),l(4,"General"),t()(),e(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),l(10,"Date"),t(),e(11,"div")(12,"span"),l(13),b(14,"date"),t()()()(),e(15,"div",10)(16,"div",9)(17,"label"),l(18,"Market Place Type"),t(),_(19,Bt,1,0,"img",11)(20,Ft,1,0,"img",12),e(21,"a",13)(22,"span",14),l(23),t(),I(24,"br"),e(25,"small",15),l(26),t()()()(),e(27,"div",10)(28,"div",9)(29,"label"),l(30,"Number"),t(),e(31,"div")(32,"span"),l(33),t()()()(),e(34,"div",8)(35,"div",9)(36,"label"),l(37,"Process Type"),t(),e(38,"div")(39,"span"),l(40),t()()()(),e(41,"div",4)(42,"div",9)(43,"label"),l(44,"Authorization Header"),t(),e(45,"div")(46,"span"),l(47),t()()()(),e(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),l(53,"Request"),t()(),e(54,"div",19)(55,"button",20),l(56,"Copy to clipboard"),t()()(),e(57,"div",7),l(58),t()()()()()()()),r&2){let o=w();d(13),g(T(14,11,o.data.Created,"dd MMM yyyy HH:mm:ss")),d(6),s("ngIf",o.data.TypeID==1),d(),s("ngIf",o.data.TypeID==0),d(),Oe("href",o.data.ShopLink,W),d(2),g(o.data.ShopName),d(3),g(o.data.ShopLink),d(7),g(o.data._source.log.number),d(7),g(o.data._source.log.processType),d(7),g(o.data._source.log.authorizationHeader),d(8),s("cdkCopyToClipboard",o.data._source.log.request),d(3),x(" ",o.data._source.log.request," ")}}var it=(()=>{let n=class n{constructor(m,a,i){this.route=m,this.http=a,this._RawLogService=i,this.route.queryParams.subscribe(c=>{let v=JSON.parse(localStorage.getItem("channel"));if(this.ID=c.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],v.length>0){let p=v.find(st=>st.ShopID==this.data._source.shopId);p?(this.data.TypeID=p.TypeID,this.data.ShopName=p.Name,this.data.ShopLink=p.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M),f(Z))},n.\u0275cmp=E({type:n,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),_(4,At,59,14,"div",3),t()()()()),a&2&&(s("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),d(4),s("ngIf",i.data))},dependencies:[N,L,et,D]});let r=n;return r})();function jt(r,n){if(r&1&&(e(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),l(4,"General"),t()(),e(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),l(10,"Date"),t(),e(11,"div")(12,"span"),l(13),b(14,"date"),t()()()(),e(15,"div",6)(16,"div",12)(17,"label"),l(18,"SKU"),t(),e(19,"div")(20,"span"),l(21),t()()()(),e(22,"div",6)(23,"div",12)(24,"label"),l(25,"Channel"),t(),e(26,"div")(27,"span"),l(28),t()()()(),e(29,"div",6)(30,"div",12)(31,"label"),l(32,"Response Code"),t(),e(33,"div")(34,"span"),l(35),t()()()()()()()()),r&2){let o=w();d(13),g(T(14,4,o.data.Created,"dd MMM yyyy")),d(8),g(o.data.Sku),d(7),g(o.data.ChannelName),d(7),g(o.data.ResponseCode)}}var nt=(()=>{let n=class n{constructor(m,a,i){this.route=m,this.http=a,this._RawLogService=i,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(c=>{this.ID=c.ID,this.Load()})}ngOnInit(){}Load(){var m={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",m).subscribe(a=>{this.data.Created=a.hits[0]._source["@timestamp_received"],this.data.Sku=a.hits[0]._source.log.sku,this.data.ChannelName=a.hits[0]._source.log.channelName,this.data.ResponseCode=a.hits[0]._source.log.responseCode,this.request=JSON.parse(a.hits[0]._source.log.request),this.response=a.hits[0]._source.log.response})}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M),f(Z))},n.\u0275cmp=E({type:n,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),t()(),e(4,"content")(5,"div",2)(6,"div",3),_(7,jt,36,7,"div",4),t(),e(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),l(13,"Request"),t()(),e(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),l(18),b(19,"json"),t()()()()()(),e(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),l(24,"Response"),t()(),e(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),l(29),t()()()()()()()()()()),a&2&&(s("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),d(7),s("ngIf",i.data),d(11),g(B(19,7,i.request)),d(11),g(i.response))},dependencies:[N,V,L,ce,D]});let r=n;return r})();function Ht(r,n){if(r&1&&(e(0,"div",9)(1,"div",10)(2,"label"),l(3,"Process Code"),t(),e(4,"div")(5,"span"),l(6),t()()()()),r&2){let o=w();d(6),g(o.ProcessedCode)}}function qt(r,n){if(r&1){let o=R();e(0,"a",16),P("click",function(){u(o);let a=w();return h(a.Retry())}),l(1,"Retry"),t()}}var rt=(()=>{let n=class n{constructor(m,a){this.route=m,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Retry(){var m={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",m).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var m={ID:this.ID};this.http.post("/api/Orders/GetDetail",m).subscribe(a=>{for(let i of a.hits)this.Number=i._source.log.number,this.MarketTypeString=i._source.log.type,this.ResponseCode=i._source.log.responseCode,this.POSActionTypeString=i._source.message,this.ProcessDuration=0,this.Created=i._source["@timestamp_received"],this.request=JSON.parse(i._source.log.request),this.response=JSON.parse(i._source.log.response),this.shopId=i._source.shopId,this.ProcessedCode=i._source.log.processedCode})}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M))},n.\u0275cmp=E({type:n,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),t()(),e(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),l(11,"General"),t()(),e(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),l(17,"Date"),t(),e(18,"div")(19,"span"),l(20),b(21,"date"),t()()()(),e(22,"div",9)(23,"div",10)(24,"label"),l(25,"Number"),t(),e(26,"div")(27,"span"),l(28),t()()()(),e(29,"div",9)(30,"div",10)(31,"label"),l(32,"Type"),t(),e(33,"div")(34,"span"),l(35),t()()()(),e(36,"div",9)(37,"div",10)(38,"label"),l(39,"Response Code"),t(),e(40,"div")(41,"span"),l(42),t()()()(),e(43,"div",9)(44,"div",10)(45,"label"),l(46,"ShopID"),t(),e(47,"div")(48,"span"),l(49),t()()()(),_(50,Ht,7,1,"div",11),e(51,"div",9)(52,"div",10)(53,"label"),l(54,"Action"),t(),e(55,"div")(56,"span"),l(57),t()()()()()()()()(),e(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),l(63,"Request"),t()(),e(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),l(68),b(69,"json"),t()()(),e(70,"actions",14),_(71,qt,2,0,"a",15),t()()()(),e(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),l(76,"Response"),t()(),e(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),l(81),b(82,"json"),t()()()()()()()()()()),a&2&&(s("headerTitle","Order #"+i.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),g(T(21,14,i.Created,"dd MMM yyyy HH:mm:ss")),d(8),g(i.Number),d(7),g(i.MarketTypeString),d(7),g(i.ResponseCode),d(7),g(i.shopId),d(),s("ngIf",i.ProcessedCode!=null),d(7),g(i.POSActionTypeString),d(11),g(B(69,17,i.request)),d(3),s("ngIf",i.ResponseCode!="200"&&i.ResponseCode!="201"),d(10),g(B(82,19,i.response)))},dependencies:[N,V,L,ce,D]});let r=n;return r})();var zt=()=>["/menu/log/exception/detail"],Gt=r=>({ID:r});function Ut(r,n){if(r&1&&(e(0,"tr")(1,"td",12),I(2,"img",13),t(),e(3,"td"),l(4),b(5,"date"),t(),e(6,"td")(7,"a",14),l(8),t()(),e(9,"td")(10,"div",15),l(11),t(),e(12,"div"),l(13),t()()()),r&2){let o=n.$implicit;d(2),s("src",o.logo,W),d(2),g(T(5,7,o.date,"dd-MM-yyyy hh:mm:ss")),d(3),s("routerLink",ee(10,zt))("queryParams",q(11,Gt,o.id)),d(),x(" ",o.number," "),d(3),g(o.message),d(2),g(o.stackTrace)}}function Yt(r,n){if(r&1){let o=R();j(0),e(1,"mat-paginator",16),P("page",function(a){u(o);let i=w(2);return h(i.onPaginationChange(a))}),t(),H()}if(r&2){let o=w(2);d(),s("length",o.pageTotal)("pageSize",o.pageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function Jt(r,n){if(r&1&&(j(0),e(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),l(6,"Channel"),t(),e(7,"th",9),l(8,"Date"),t(),e(9,"th"),l(10,"Number"),t(),e(11,"th"),l(12,"Exception"),t()()(),e(13,"tbody"),_(14,Ut,14,13,"tr",10),t()(),_(15,Yt,2,3,"ng-container",11),t(),H()),r&2){let o=w();d(14),s("ngForOf",o.exceptions),d(),s("ngIf",(o.exceptions==null?null:o.exceptions.length)>0)}}function Kt(r,n){r&1&&(e(0,"div",17),I(1,"app-empty-state"),t())}var ot=(()=>{let n=class n{constructor(m){this.http=m,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(m=>{this.exceptions=m.hits.map(a=>({id:a._id,logo:Se.getChannelLogoByName(a._source.error?.Type),number:a._source.error.number,date:a._source["@timestamp_received"],stackTrace:a._source.error.stackTrace,message:a._source.message,requestJSON:a._source?.error?.requestJSON})),this.pageTotal=m.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(m){this.filter.PageNumber=m.pageIndex+1,this.getData()}};n.\u0275fac=function(a){return new(a||n)(f(M))},n.\u0275cmp=E({type:n,selectors:[["app-exception-log"]],decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1&&(e(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),_(5,Jt,16,2,"ng-container",5)(6,Kt,2,0,"ng-template",null,0,G),t()()()()()),a&2){let c=z(7);d(5),s("ngIf",i.exceptions.length>0)("ngIfElse",c)}},dependencies:[F,N,V,L,Y,U,D]});let r=n;return r})();var Zt=r=>({ID:r});function Qt(r,n){if(r&1&&(e(0,"span",17),I(1,"img",18),t(),l(2)),r&2){let o=n.item;d(),s("src",o.Img,W)("alt",o.Name),d(),x(" ",o.Name," ")}}function Xt(r,n){if(r&1&&(e(0,"tr")(1,"td"),l(2),t(),e(3,"td"),I(4,"img",28),t(),e(5,"td"),l(6),t(),e(7,"td",29)(8,"a",30),l(9),b(10,"number"),t()(),e(11,"td"),l(12),t(),e(13,"td"),l(14),b(15,"date"),t()()),r&2){let o=n.$implicit;d(2),g(o._source.ChannelName),d(2),s("src",o.logo,W),d(2),g(o._source.DateRange),d(2),s("queryParams",q(12,Zt,o._source.ID)),d(),x(" ",B(10,7,o._source.CountOrder)," "),d(3),g(o._source.UserLogin),d(2),x(" ",T(15,9,o._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function $t(r,n){if(r&1){let o=R();j(0),e(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),t(),e(7,"th",23),l(8,"Type"),t(),e(9,"th",24),l(10,"Download Date Range"),t(),e(11,"th",25),l(12,"Count"),t(),e(13,"th"),l(14,"User Login"),t(),e(15,"th"),l(16,"Created"),t()()(),e(17,"tbody"),_(18,Xt,16,14,"tr",26),t()(),e(19,"mat-paginator",27),P("page",function(a){u(o);let i=w();return h(i.onPaginationChange(a))}),t()(),H()}if(r&2){let o=w();d(18),s("ngForOf",o.downloadOrders),d(),s("length",o.paginationTotal)("pageSize",o.paginationPageSize)("pageIndex",(o.filter==null?null:o.filter.PageNumber)==0?0:(o.filter==null?null:o.filter.PageNumber)-1)}}function ei(r,n){r&1&&(e(0,"div",31),I(1,"app-empty-state"),t())}var at=(()=>{let n=class n{constructor(m,a){this.http=m,this.authService=a,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(m=>{this.filter=m.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(m=>{this.downloadOrders=m.hits,this.setChannelLogo(),this.paginationTotal=m.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(m=>(m.logo=Se.getChannelLogoByTypeId(m._source.TypeID),m))}onPaginationChange(m){this.filter.PageNumber=m.pageIndex+1,this.getDownloadOrders()}};n.\u0275fac=function(a){return new(a||n)(f(M),f(oe))},n.\u0275cmp=E({type:n,selectors:[["app-manual-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/log/order-log/order-log-detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,i){if(a&1){let c=R();e(0,"mainpanel",1),P("onSubmit",function(){return u(c),h(i.getDownloadOrders())}),e(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),t(),e(5,"ng-select",3),C("ngModelChange",function(p){return u(c),S(i.filter.ChannelID,p)||(i.filter.ChannelID=p),h(p)}),_(6,Qt,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",6),l(9,"From/To"),t(),e(10,"div",7)(11,"datepicker",8),C("dateChange",function(p){return u(c),S(i.filter.From,p)||(i.filter.From=p),h(p)}),t()(),e(12,"div")(13,"datepicker",9),C("dateChange",function(p){return u(c),S(i.filter.To,p)||(i.filter.To=p),h(p)}),t()()(),e(14,"div",5)(15,"label",10),l(16,"Page Number"),t(),e(17,"input",11),C("ngModelChange",function(p){return u(c),S(i.filter.PageNumber,p)||(i.filter.PageNumber=p),h(p)}),t()(),e(18,"div",5)(19,"label",10),l(20,"Page Size"),t(),e(21,"input",12),C("ngModelChange",function(p){return u(c),S(i.filter.RowCount,p)||(i.filter.RowCount=p),h(p)}),t()()(),e(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),_(26,$t,20,4,"ng-container",16)(27,ei,2,0,"ng-template",null,0,G),t()()()()()}if(a&2){let c=z(28);s("hideSearchBox",!0),d(5),s("clearable",!0)("items",i.channelOptions),y("ngModel",i.filter.ChannelID),d(6),y("date",i.filter.From),d(2),y("date",i.filter.To),d(4),y("ngModel",i.filter.PageNumber),d(4),y("ngModel",i.filter.RowCount),d(5),s("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",c)}},dependencies:[F,N,te,re,ie,ne,V,L,Y,de,ae,le,J,U,ke,D]});let r=n;return r})();var lt=(()=>{let n=class n{constructor(m){this.httpService=m}getExceptionDetail(m){return this.httpService.post("/api/Orders/GetDetailException",{ID:m}).pipe(ue(i=>i?.hits[0]?._source))}};n.\u0275fac=function(a){return new(a||n)(fe(M))},n.\u0275prov=me({token:n,factory:n.\u0275fac,providedIn:"root"});let r=n;return r})();function ii(r,n){if(r&1&&(e(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),l(6,"General"),t()(),e(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),l(12,"Date"),t(),e(13,"div")(14,"span"),l(15),b(16,"date"),t()()()(),e(17,"div",9)(18,"div",10)(19,"label"),l(20,"Number"),t(),e(21,"div")(22,"span"),l(23),t()()()(),e(24,"div",9)(25,"div",10)(26,"label"),l(27,"Type"),t(),e(28,"div")(29,"span"),l(30),t()()()(),e(31,"div",9)(32,"div",10)(33,"label"),l(34,"ShopID"),t(),e(35,"div")(36,"span"),l(37),t()()()()()()()()(),e(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),l(43,"Request"),t()(),e(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),l(48),b(49,"json"),t()()()()()(),e(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),l(54,"Exception"),t()(),e(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),l(59),t(),e(60,"pre"),l(61),t()()()()()()()()),r&2){let o=n.ngIf;d(15),g(T(16,7,o["@timestamp"],"dd MMM yyyy HH:mm:ss")),d(8),g(o==null||o.error==null?null:o.error.number),d(7),g(o==null||o.error==null?null:o.error.Type),d(7),g(o==null?null:o.shopId),d(11),g(B(49,10,o==null||o.error==null?null:o.error.requestJSON)),d(11),g(o==null?null:o.message),d(2),g(o==null||o.error==null?null:o.error.stackTrace)}}var dt=(()=>{let n=class n{constructor(m,a){this.activatedRoute=m,this.exceptionService=a,this.invoiceNumber=""}ngOnInit(){let m=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(m?.ID)}getExceptionDetail(m){this.exceptionDetail$=this.exceptionService.getExceptionDetail(m).pipe(he(a=>{this.invoiceNumber=a?.error?.number}),De(1))}};n.\u0275fac=function(a){return new(a||n)(f(A),f(lt))},n.\u0275cmp=E({type:n,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"content"),_(2,ii,62,12,"div",1),b(3,"async"),t()()),a&2&&(s("headerTitle","Order #"+i.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),d(2),s("ngIf",B(3,4,i.exceptionDetail$)))},dependencies:[N,L,ve,ce,D]});let r=n;return r})();function ni(r,n){if(r&1&&(e(0,"tr")(1,"td"),l(2),t(),e(3,"td"),l(4),t(),e(5,"td"),l(6),b(7,"date"),t(),e(8,"td"),l(9),b(10,"date"),t(),e(11,"td"),l(12),t()()),r&2){let o=n.$implicit;d(2),x(" ",o.Number," "),d(2),x(" ",o.Status," "),d(2),x(" ",T(7,5,o.Start,"HH:mm:ss:SSS")," "),d(3),x(" ",T(10,8,o.End,"HH:mm:ss:SSS")," "),d(3),x(" ",o.Exception," ")}}var mt=(()=>{let n=class n{constructor(m,a){this.route=m,this.httpService=a}ngOnInit(){this.initOrderDetails()}initOrderDetails(){let m=this.route.snapshot.queryParams;this.orderDetails$=this.httpService.post("/api/Orders/DownloadOrderLogsDetail",{ID:m.ID}).pipe(he(a=>{let i=a?.hits[0]?._source;this.headerTitle=`${i?.ChannelName} (${i?.DateRange})`}),ue(a=>a?.hits[0]._source?.Detail))}};n.\u0275fac=function(a){return new(a||n)(f(A),f(M))},n.\u0275cmp=E({type:n,selectors:[["app-download-order-detail"]],decls:22,vars:7,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","200px"],[2,"width","150px"],[2,"width","100px"],[4,"ngFor","ngForOf"]],template:function(a,i){a&1&&(e(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"table",5)(7,"thead")(8,"tr",6)(9,"th",7),l(10,"Number"),t(),e(11,"th",8),l(12,"Status"),t(),e(13,"th",9),l(14,"Start Time"),t(),e(15,"th",9),l(16,"End Time"),t(),e(17,"th"),l(18,"Exception"),t()()(),e(19,"tbody"),_(20,ni,13,11,"tr",10),b(21,"async"),t()()()()()()()()),a&2&&(s("headerTitle",i.headerTitle)("description",i.headerTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),s("ngForOf",B(21,5,i.orderDetails$)))},dependencies:[F,L,ve,D]});let r=n;return r})();var ri=[{path:"",component:Ze,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Qe,canActivate:[k],data:{title:"Order Log"}},{path:"inventory",component:Xe,canActivate:[k],data:{title:"Inventory Log"}},{path:"rawlog",component:$e,canActivate:[k],data:{title:"Raw Log"}},{path:"rawlog/detail",component:it,canActivate:[k],data:{title:"Raw Log Detail"}},{path:"inventory/detail",component:nt,canActivate:[k],data:{title:"Inventory Details"}},{path:"order/detail",component:rt,canActivate:[k],data:{title:"Order Details"}},{path:"exception",component:ot,canActivate:[k],data:{title:"Exception Log"}},{path:"exception/detail",component:dt,canActivate:[k],data:{title:"Exception Log Detail"}},{path:"order-log",component:at,canActivate:[k],data:{title:"order Log"}},{path:"order-log/order-log-detail",component:mt,canActivate:[k],data:{title:"Order Log Detail"}},{path:"inventory-async",loadComponent:()=>import("./chunk-G6HY2OKZ.js").then(r=>r.InventoryAsyncLogComponent),canActivate:[k],data:{title:"Sync Inventory Async"}},{path:"inventory-async/detail",loadComponent:()=>import("./chunk-KCFS3M2K.js").then(r=>r.InventoryAsyncDetailComponent),canActivate:[k],data:{title:"Sync Inventory Async Detail"}}]}],pt=(()=>{let n=class n{};n.\u0275fac=function(a){return new(a||n)},n.\u0275mod=se({type:n}),n.\u0275inj=pe({imports:[_e,ye.forChild(ri)]});let r=n;return r})();var Mn=(()=>{let n=class n{};n.\u0275fac=function(a){return new(a||n)},n.\u0275mod=se({type:n}),n.\u0275inj=pe({imports:[_e,je,He,pt,ye,Ue,tt,Ke,qe,Je,J,Ge]});let r=n;return r})();export{Mn as LogsModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as mt}from"./chunk-662E5VTA.js";import{b as Pt}from"./chunk-5WXM6HSA.js";import{c as bt}from"./chunk-IPYNDMGQ.js";import{g as xt}from"./chunk-KWFES5F7.js";import{e as it}from"./chunk-DSF55IXM.js";import{b as gt,c as ht,g as ft,i as _t,j as Ct}from"./chunk-4R22UO7N.js";import{t as dt,u as ut}from"./chunk-MVPTQRFO.js";import{c as nt,h as ot,k as at,u as rt}from"./chunk-B3LBEB32.js";import{b as lt,c as st,d as ct,f as pt}from"./chunk-QPRFFPO5.js";import{$ as q,$a as h,B as U,Bc as O,Cc as B,F as z,Hb as V,Ia as r,Ib as p,Ja as S,Jb as N,Kb as F,Mb as X,Nb as Z,O as J,Ob as tt,Q as W,Qb as L,Ua as C,V as Y,X as k,Y as H,Za as g,Zb as I,_b as y,ac as j,c as A,ca as K,d as G,ga as E,gb as v,lb as l,lc as D,mb as m,nb as $,oa as d,ob as T,pa as u,pb as w,q as P,qb as Q,rb as _,ub as x,vc as R,wb as c,xa as f,xc as et,za as M}from"./chunk-C3YE27TZ.js";function wt(i,n){i&1&&Q(0)}function Nt(i,n){if(i&1&&(T(0),g(1,wt,1,0,"ng-container",5),w()),i&2){c(2);let a=V(4);r(),h("ngTemplateOutlet",a)}}function It(i,n){if(i&1&&(l(0,"div",6)(1,"label"),p(2,"Editing Data"),m(),l(3,"div")(4,"span"),p(5),I(6,"number"),m()()()),i&2){let a=c(2);r(5),N(y(6,1,a.value))}}function yt(i,n){if(i&1&&(T(0),g(1,Nt,2,1,"ng-container",4)(2,It,7,3,"ng-template",null,1,j),w()),i&2){let a=V(3),t=c();r(),h("ngIf",t.hasPriceEdit)("ngIfElse",a)}}function Dt(i,n){if(i&1){let a=_();l(0,"div",7)(1,"input",8),tt("ngModelChange",function(e){d(a);let o=c();return Z(o.value,e)||(o.value=e),u(e)}),m(),l(2,"label",9),p(3),m()()}if(i&2){let a=c();r(),X("ngModel",a.value),h("max",a.maxEditInventory),r(2),N(a.item.Table)}}var Kt=(()=>{let n=class n{constructor(t,e,o){this.dialogRef=t,this.item=e,this.permissionService=o,this.maxEditInventory=1e5,this.permissionService.hasPermission(mt.price).then(s=>this.hasPriceEdit=s)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(t=>t.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,this.item.Table=="inventory"?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==lt.Tokopedia?1e5:null):this.item.Table=="price"&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){let t=this.item.Table=="inventory"?"Update Inventory":"Update Price";this.modalConfig=new _t,this.modalConfig.title=`${t} ${this.item?.Name} in ${this.selectedChannel?.Title}`}onSubmit(){this.item.Table=="inventory"?this.selectedChannel.Inventory=this.value:this.item.Table=="price"&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(e){return new(e||n)(S(gt),S(ht),S(ct))},n.\u0275cmp=E({type:n,selectors:[["app-table-dialog"]],standalone:!0,features:[L],decls:5,vars:4,consts:[["INVENTORY",""],["DISABLED",""],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"],["for","edit",1,"text-capitalize"]],template:function(e,o){if(e&1){let s=_();l(0,"modal-material",2),x("onClose",function(){return d(s),u(o.onClose())})("onCancel",function(){return d(s),u(o.onClose())})("onOk",function(){return d(s),u(o.onSubmit())}),l(1,"div",3),g(2,yt,4,2,"ng-container",4)(3,Dt,4,3,"ng-template",null,0,j),m()()}if(e&2){let s=V(4);h("dynamicValidated",o.value)("config",o.modalConfig),r(2),h("ngIf",o.item.Table=="price")("ngIfElse",s)}},dependencies:[B,R,et,O,ft,xt,bt,Pt,Ct,rt,nt,ot,at,pt,ut,dt],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]});let i=n;return i})();var ne=(()=>{let n=class n{constructor(t){this.http=t,this.pagination$=new G(null),this._pageNumber=C(1),this.pageNumber=D(()=>this._pageNumber()),this._hideCount=C(!0),this.hideCount=D(()=>this._hideCount()),this._disableNextButton=C(!0),this.disableNextButton=D(()=>this._disableNextButton()),this._goToLastPage=C(!1),this.isLastPage=D(()=>this._goToLastPage()),this.totalData=C(0),this.destroy$=new A,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this._pageNumber.set(t.PageNumber)}setPaginationButtonState(t,e){e==0?this._disableNextButton.set(!0):this._disableNextButton.set(!(e<t.RowCount*t.PageNumber))}reloadPagination(t){st.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this._hideCount.set(!0),this._goToLastPage.set(!1)}onLastPage(t={}){let e=JSON.parse(JSON.stringify(t));this.totalRowCount$=this.http.post(`/api/${this.fethRowCountEndpoint}`,e).pipe(P(o=>o.Total),k(o=>{this._hideCount.set(!1),e.RowCount=o,e.PageNumber=1,this.pagination$.next(e),this._goToLastPage.set(!0)}))}paginationFunction(){return this.pagination$.pipe(Y(this.destroy$),U(t=>t!=null),z(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(P(e=>e.Data?e.Data:[]))),H(this.pagination$),J((t,e)=>{let[o,s]=t,[b]=e;return s.PageNumber==1?[b,s]:[o.concat(b),s]}),k(([t,e])=>{this.setPageNumberFooter(e);let o=this.calculateProductLength(t);this.totalData.set(o),this.setPaginationButtonState(e,o)}),P(([t])=>t),W())}getRowCount(t){this._hideCount.set(!1),this.totalRowCount$=this.http.post(`/API/${this.fethRowCountEndpoint}`,t).pipe(P(e=>e.Total))}calculateProductLength(t=[]){return t.reduce((o,s)=>o+(s.Variants?.length?s.Variants?.length:0),0)}};n.\u0275fac=function(e){return new(e||n)(K(it))},n.\u0275prov=q({token:n,factory:n.\u0275fac});let i=n;return i})();function Et(i,n){if(i&1){let a=_();l(0,"span",6),x("click",function(){d(a);let e=c();return u(e.onGetRowCount())}),l(1,"i",7),p(2,"?"),m()()}}function Mt(i,n){if(i&1&&(T(0),l(1,"span"),p(2),I(3,"number"),m(),w()),i&2){let a=c();r(2),N(y(3,1,a.rowCount()))}}function St(i,n){if(i&1){let a=_();l(0,"a",10),x("click",function(){d(a);let e=c(2);return u(e.onNextPage())}),$(1,"i",11),p(2," Next"),m()}}function Vt(i,n){if(i&1){let a=_();l(0,"a",12),x("click",function(){d(a);let e=c(2);return u(e.onLastPage())}),$(1,"i",13),p(2," Last"),m()}}function Lt(i,n){if(i&1&&(l(0,"div",5),g(1,St,3,0,"a",8)(2,Vt,3,0,"a",9),m()),i&2){let a=c();r(),v(a.disableNextButton()&&!a.goToLastPage()?1:-1),r(),v(a.disableNextButton()&&!a.goToLastPage()?2:-1)}}var me=(()=>{let n=class n{constructor(){this.totalData=f(0),this.rowCount=f(),this.pageNumber=f(),this.disableNextButton=f(),this.goToLastPage=f(),this.hideCount=f(),this.nextPage=new M,this.lastPage=new M,this.getRowCount=new M}onNextPage(){this.nextPage.emit()}onLastPage(){this.lastPage.emit()}onGetRowCount(){this.getRowCount.emit()}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=E({type:n,selectors:[["infinite-paginator"]],inputs:{totalData:[1,"totalData"],rowCount:[1,"rowCount"],pageNumber:[1,"pageNumber"],disableNextButton:[1,"disableNextButton"],goToLastPage:[1,"goToLastPage"],hideCount:[1,"hideCount"]},outputs:{nextPage:"onNextPage",lastPage:"onLastPage",getRowCount:"onGetRowCount"},standalone:!0,features:[L],decls:9,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[4,"ngIf"],[1,"btn-group"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(e,o){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),p(3),I(4,"number"),g(5,Et,3,0,"span",3)(6,Mt,4,3,"ng-container",4),p(7),m()(),g(8,Lt,3,2,"div",5),m()),e&2&&(r(3),F(" Showing 1 - ",y(4,5,o.totalData())," of "),r(2),v(o.hideCount()?5:-1),r(),h("ngIf",!o.hideCount()&&o.rowCount()),r(),F(" records ~ ",o.pageNumber()," Page "),r(),v(o.totalData()>0?8:-1))},dependencies:[B,R,O]});let i=n;return i})();export{Kt as a,ne as b,me as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,b as y}from"./chunk-PIIJRFHM.js";import{a as i}from"./chunk-
|
|
1
|
+
import{a as C,b as y}from"./chunk-PIIJRFHM.js";import{a as i}from"./chunk-HFUGRK45.js";import"./chunk-XLSYUMRS.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import"./chunk-QPRFFPO5.js";import{$a as d,Cc as o,Ia as c,Qb as h,aa as p,fd as v,ga as l,ha as s,jd as r,lb as u,mb as f,nb as a}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var b=(()=>{let t=class t{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=l({type:t,selectors:[["app-inventory"]],standalone:!0,features:[h],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,M){n&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),f()()(),a(4,"router-outlet")),n&2&&(c(3),d("Tabs",M.inventoryTabs))},dependencies:[o,y,C,r,v],encapsulation:2});let e=t;return e})();var g=[{path:"",component:b,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-GEQYSMX6.js").then(e=>e.MultiChannelComparison)},canActivate:[i],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-E3E6TUYP.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[i],data:{title:"Inventory Comparison"}}]}],E=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=s({type:t}),t.\u0275inj=p({imports:[o,r.forChild(g)]});let e=t;return e})();export{E as InventoryRoutingModule};
|