marketplacepos 3.21.7 → 3.21.9

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.
Files changed (40) hide show
  1. package/Marketplace/{chunk-CVUFX2MD.js → chunk-24FVOJS7.js} +1 -1
  2. package/Marketplace/{chunk-3FVRTCP4.js → chunk-3EMUS2RN.js} +1 -1
  3. package/Marketplace/{chunk-6IJU7QJQ.js → chunk-3O7YORKA.js} +1 -1
  4. package/Marketplace/{chunk-453JGQWX.js → chunk-4GY3F3I7.js} +1 -1
  5. package/Marketplace/{chunk-XV5TKKA6.js → chunk-4U7L3O3Q.js} +1 -1
  6. package/Marketplace/{chunk-W777IDSZ.js → chunk-5GSLW2ZN.js} +1 -1
  7. package/Marketplace/{chunk-CPTEKJRI.js → chunk-7ZG4RVRM.js} +1 -1
  8. package/Marketplace/{chunk-NRTIXRPS.js → chunk-C63OTBVZ.js} +2 -2
  9. package/Marketplace/{chunk-AMHU5PGV.js → chunk-CSFYYRBU.js} +1 -1
  10. package/Marketplace/{chunk-QV7OFEYK.js → chunk-CVGNMUAQ.js} +1 -1
  11. package/Marketplace/{chunk-HPVO2UWJ.js → chunk-E2AY3D7Q.js} +1 -1
  12. package/Marketplace/chunk-EE7O2AZI.js +1 -0
  13. package/Marketplace/chunk-EJSGWKV7.js +1 -0
  14. package/Marketplace/{chunk-WA7EG6SD.js → chunk-FNXK23FG.js} +1 -1
  15. package/Marketplace/{chunk-WJYVGE2C.js → chunk-HXTSK3VJ.js} +1 -1
  16. package/Marketplace/{chunk-Q6WJB65B.js → chunk-IUOWC7K6.js} +1 -1
  17. package/Marketplace/{chunk-H3L45Q3O.js → chunk-IV6WG6V5.js} +1 -1
  18. package/Marketplace/{chunk-6CS4JNMF.js → chunk-IVBW553S.js} +1 -1
  19. package/Marketplace/{chunk-V7EAVWKA.js → chunk-LU6STS2D.js} +1 -1
  20. package/Marketplace/{chunk-GW3TJHI4.js → chunk-MRR4IS2Z.js} +1 -1
  21. package/Marketplace/{chunk-ZVRIQR7B.js → chunk-NAG2KOVB.js} +1 -1
  22. package/Marketplace/chunk-NBSXPQ4I.js +1 -0
  23. package/Marketplace/{chunk-VP4O27WW.js → chunk-NHC5X7YC.js} +1 -1
  24. package/Marketplace/{chunk-2EBKTQQL.js → chunk-NML6IXRV.js} +1 -1
  25. package/Marketplace/{chunk-RDDLXBK4.js → chunk-PSO5MHAY.js} +1 -1
  26. package/Marketplace/{chunk-7PXW7LQN.js → chunk-PTSL3BJU.js} +1 -1
  27. package/Marketplace/{chunk-AVI3AQG5.js → chunk-QFQILAPS.js} +1 -1
  28. package/Marketplace/{chunk-OJK63AJL.js → chunk-QGPGOIU5.js} +1 -1
  29. package/Marketplace/{chunk-7FVSM7DJ.js → chunk-RFP6MKT2.js} +1 -1
  30. package/Marketplace/{chunk-CXQQTYSQ.js → chunk-RWETAVSK.js} +1 -1
  31. package/Marketplace/{chunk-E4F2U4QZ.js → chunk-SCORX7XW.js} +1 -1
  32. package/Marketplace/{chunk-LYKGYHSU.js → chunk-SMIKWRSP.js} +1 -1
  33. package/Marketplace/{chunk-UW6LKD23.js → chunk-UJAJ6BDH.js} +1 -1
  34. package/Marketplace/{chunk-52GVDLE3.js → chunk-WWZHEKFE.js} +1 -1
  35. package/Marketplace/index.html +2 -2
  36. package/Marketplace/{main-567ENZMH.js → main-ZF2MQYMR.js} +1 -1
  37. package/package.json +1 -1
  38. package/Marketplace/chunk-6ROL3HRT.js +0 -1
  39. package/Marketplace/chunk-OVGQQRBL.js +0 -1
  40. package/Marketplace/chunk-VMV4M5HA.js +0 -1
@@ -1 +1 @@
1
- import{a as Ge}from"./chunk-52GVDLE3.js";import{a as Z}from"./chunk-LQWFYVLD.js";import"./chunk-6U6JR5K6.js";import{a as Y}from"./chunk-EYZIWEGE.js";import{a as qe,b as He}from"./chunk-UAXJ7MHW.js";import"./chunk-ZRW4OZGG.js";import"./chunk-4NXO2JYR.js";import"./chunk-PCKZD4LZ.js";import"./chunk-YUBBVFFI.js";import{a as K,b as ze}from"./chunk-2LJXM62F.js";import"./chunk-ENIJ4MFV.js";import{a as W}from"./chunk-AMHU5PGV.js";import"./chunk-UOT5GPQI.js";import"./chunk-C2SGQUOH.js";import{a as pe,b as ce,d as ue,e as Be}from"./chunk-7IIB5DLC.js";import{i as de}from"./chunk-Q6WJB65B.js";import{e as M}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{m as R,n as je}from"./chunk-OI3SQ5ZO.js";import{t as Ae,u as Fe}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as ae,h as le,m as se,o as me,t as Oe,u as ke,y as We,z as Ve}from"./chunk-JCKUKK6T.js";import{c as X}from"./chunk-KZ2VDCDO.js";import{$ as ie,$c as ve,Ab as Me,Bc as Pe,Cc as D,Dc as re,Fc as fe,Ha as V,Ib as H,Ja as m,Jb as l,Ka as f,Kb as u,Lb as P,Nb as _,Ob as C,Pb as S,Q as be,Qa as Te,Sb as z,Tb as q,Wc as B,X as xe,Xc as Le,Zc as k,_a as y,aa as ne,ab as p,ac as x,ba as we,bc as G,ca as he,cc as E,dc as U,eb as De,ga as I,ha as oe,ia as Ie,mb as t,nb as i,oa as g,ob as w,pa as h,pb as F,q as Se,qb as j,sb as L,tc as Re,vb as N,vc as Ne,xb as b,xc as J,yc as T,za as Ee}from"./chunk-QNL3BTRG.js";import"./chunk-GNOSNGXM.js";var Ue=(()=>{let n=class n{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"}]}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),w(3,"nav-tab",2),i()()(),w(4,"router-outlet")),r&2&&(m(3),p("Tabs",e.ObjectlogTabs))},dependencies:[Le,qe]});let o=n;return o})();var A=(()=>{let n=class n{constructor(){}get Data(){return this._Data}set Data(s){this._Data=s}Fill(s){return this._Data.find(r=>r._id==s)}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var dt=()=>["/menu/log/order/detail"],pt=o=>({ID:o}),ct=o=>({"bg-warning":o});function ut(o,n){if(o&1&&(t(0,"span",22),w(1,"img",23),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function gt(o,n){o&1&&(t(0,"th",27)(1,"span",33),l(2," Response Body Warning "),i()())}function ht(o,n){o&1&&(t(0,"th")(1,"span",33),l(2," Number Override "),i()())}function ft(o,n){if(o&1&&(t(0,"td",27)(1,"span",36),l(2),i()()),o&2){let a=b().$implicit;m(),p("ngClass",q(2,ct,a.responseBodyWarning!=null)),m(),u(a.responseBodyWarning)}}function vt(o,n){if(o&1&&(t(0,"td"),l(1),i()),o&2){let a=b().$implicit;m(),P(" ",a.ResponseBodyWarningReference," ")}}function yt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",34),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td",27)(12,"span",35),l(13),i()(),y(14,ft,3,4,"td",29)(15,vt,2,1,"td",30),i()),o&2){let a=n.$implicit,s=b(2);m(2),p("routerLink",z(14,dt))("queryParams",q(15,pt,a.ID)),m(),P(" ",E(4,11,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.MarketTypeString),m(2),u(a.POSActionTypeString),m(2),u(a.Number),m(2),De(a.ResponseCode===200||a.ResponseCode===202?"bg-success":"bg-warning"),m(),P(" ",a.ResponseCode," "),m(),p("ngIf",s.responseBodyWarningVisible),m(),p("ngIf",s.responseBodyWarningVisible)}}function _t(o,n){if(o&1){let a=L();F(0),t(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),l(6,"Date"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"Actions"),i(),t(11,"th"),l(12,"Number"),i(),t(13,"th",27)(14,"span",28),l(15," Response Code "),i()(),y(16,gt,3,0,"th",29)(17,ht,3,0,"th",30),i()(),t(18,"tbody"),y(19,yt,16,17,"tr",31),i()(),t(20,"mat-paginator",32),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngIf",a.responseBodyWarningVisible),m(),p("ngIf",a.responseBodyWarningVisible),m(2),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ct(o,n){o&1&&(t(0,"div",37),w(1,"app-empty-state"),i())}var Qe=(()=>{let n=class n{constructor(s,r,e,c){this.http=s,this._RawLogService=r,this.route=e,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(s=>{this.responseCode=s.responseCode,this.responseCode!=null?this.Load(s):this.Load()})}Load(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("/api/Orders/Get",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){e._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let c={ID:e._id,Created:e._source["@timestamp_received"],shopId:e._source.shopId,MarketTypeString:e._source.log.type,POSActionTypeString:e._source.message,Number:e._source.log.number,ResponseCode:e._source.log.responseCode,responseBodyWarning:e._source.log.responseBodyWarning,ResponseBodyWarningReference:e._source.log.ResponseBodyWarningReference};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(B),f(de))},n.\u0275cmp=I({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(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.Number,d)||(e.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,ut,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",2),l(9,"Action"),i(),t(10,"ng-select",6),S("ngModelChange",function(d){return g(c),C(e.filter.ActionType,d)||(e.filter.ActionType=d),h(d)}),i()(),t(11,"div",5)(12,"label",7),l(13,"From/To"),i(),t(14,"div",8)(15,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",5)(19,"label",11),l(20,"Response Code"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.StatusCode,d)||(e.filter.StatusCode=d),h(d)}),i()(),t(22,"div",5)(23,"label",11),l(24,"Response Body Warning"),i(),t(25,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.responseBodyWarning,d)||(e.filter.responseBodyWarning=d),h(d)}),i(),t(26,"datalist",14),w(27,"option",15),i()(),t(28,"div",5)(29,"label",11),l(30,"Page Number"),i(),t(31,"input",16),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(32,"div",5)(33,"label",11),l(34,"Page Size"),i(),t(35,"input",17),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),y(40,_t,21,6,"ng-container",21)(41,Ct,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(42);_("text",e.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(5),p("clearable",!0)("items",e.ActionTypeList),_("ngModel",e.filter.ActionType),m(5),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.StatusCode),m(4),_("ngModel",e.filter.responseBodyWarning),m(6),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[Ne,J,T,Oe,ke,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,Ae,D]});let o=n;return o})();var St=()=>["/menu/log/inventory/sync-inventory/detail"],bt=o=>({ID:o});function xt(o,n){if(o&1&&(t(0,"span",19),w(1,"img",20),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function wt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",26),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td"),l(12),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(10,St))("queryParams",q(11,bt,a.ID)),m(),P(" ",E(4,7,a.Created,"dd MMM yyyy HH:mm")," "),m(3),u(a.channelName),m(2),u(a.Sku),m(2),u(a.Stock),m(2),u(a.ResponseCode)}}function It(o,n){if(o&1){let a=L();F(0),t(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),l(6,"Created"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"SKU"),i(),t(11,"th"),l(12,"Stock"),i(),t(13,"th"),l(14,"Response code"),i()()(),t(15,"tbody"),y(16,wt,13,13,"tr",24),i()(),t(17,"mat-paginator",25),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Et(o,n){o&1&&(t(0,"div",27),w(1,"app-empty-state"),i())}var Xe=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,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(s=>{this.filter=s.Filter,this.ActionTypeList=s.Options.ActionTypeList,this.Get()})}Get(s){s!=null&&(this.filter.Sku=s),this.http.post("api/Inventory/GetLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={ID:e._source.log.id,Created:e._source["@timestamp_received"],channelName:e._source.log.channelName,Sku:e._source.log.sku,Stock:e._source.log.stock,ResponseCode:e._source.log.responseCode};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-log"]],decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Product Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["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(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Sku,d)||(e.filter.Sku=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"actions")(2,"a",2),l(3," Async Inventory "),i()(),t(4,"filters")(5,"div",3)(6,"div")(7,"label",4),l(8,"Channel"),i(),t(9,"ng-select",5),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(10,xt,3,3,"ng-template",6),i()(),t(11,"div",7)(12,"label",8),l(13,"From/To"),i(),t(14,"div",9)(15,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",11),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",7)(19,"label",12),l(20,"Page Number"),i(),t(21,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(22,"div",7)(23,"label",12),l(24,"Page Size"),i(),t(25,"input",14),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()()(),t(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),y(30,It,18,4,"ng-container",18)(31,Et,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(32);_("text",e.filter.Sku),m(9),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Tt=()=>["/menu/log/order/detail"],Dt=o=>({ID:o});function Mt(o,n){if(o&1&&(t(0,"span",17),w(1,"img",18),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function Rt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",25),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(9,Tt))("queryParams",q(10,Dt,a.id)),m(),P(" ",E(4,6,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.type),m(2),u(a.number),m(2),u(a.message)}}function Nt(o,n){if(o&1){let a=L();F(0),t(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),l(6,"Date"),i(),t(7,"th"),l(8,"Type"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Message"),i()()(),t(13,"tbody"),y(14,Rt,11,12,"tr",23),i()(),t(15,"mat-paginator",24),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(14),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Pt(o,n){o&1&&(t(0,"div",26),w(1,"app-empty-state"),i())}var $e=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,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(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={id:e._id,message:e._source.message,responseCode:e._source.log.responseCode,processTypeString:e._source.log.processType,type:e._source.log.type,number:e._source.log.number,Created:e._source["@timestamp_received"]};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({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(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Number,d)||(e.filter.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,Mt,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),i(),t(10,"div",7)(11,"datepicker",8),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(12,"div")(13,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),i(),t(17,"input",11),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),y(26,Nt,16,4,"ng-container",16)(27,Pt,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(28);_("text",e.filter.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Ce=class{constructor(n,a){this._document=a;let s=this._textarea=this._document.createElement("textarea"),r=s.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",s.setAttribute("aria-hidden","true"),s.value=n,s.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(s)}copy(){let n=this._textarea,a=!1;try{if(n){let s=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),a=this._document.execCommand("copy"),s&&s.focus()}}catch{}return a}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},Lt=(()=>{let n=class n{constructor(s){this._document=s}copy(s){let r=this.beginCopy(s),e=r.copy();return r.destroy(),e}beginCopy(s){return new Ce(s,this._document)}};n.\u0275fac=function(r){return new(r||n)(he(Re))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})(),Ot=new we("CDK_COPY_TO_CLIPBOARD_CONFIG"),et=(()=>{let n=class n{constructor(s,r,e){this._clipboard=s,this._ngZone=r,this.text="",this.attempts=1,this.copied=new Ee,this._pending=new Set,e&&e.attempts!=null&&(this.attempts=e.attempts)}copy(s=this.attempts){if(s>1){let r=s,e=this._clipboard.beginCopy(this.text);this._pending.add(e);let c=()=>{let v=e.copy();!v&&--r&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(e),e.destroy(),this.copied.emit(v))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(s=>s.destroy()),this._pending.clear(),this._destroyed=!0}};n.\u0275fac=function(r){return new(r||n)(f(Lt),f(Te),f(Ot,8))},n.\u0275dir=Ie({type:n,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(r,e){r&1&&N("click",function(){return e.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},standalone:!0});let o=n;return o})(),tt=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({});let o=n;return o})();function Wt(o,n){o&1&&w(0,"img",21)}function Vt(o,n){o&1&&w(0,"img",22)}function Bt(o,n){if(o&1&&(t(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),l(4,"General"),i()(),t(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",10)(16,"div",9)(17,"label"),l(18,"Market Place Type"),i(),y(19,Wt,1,0,"img",11)(20,Vt,1,0,"img",12),t(21,"a",13)(22,"span",14),l(23),i(),w(24,"br"),t(25,"small",15),l(26),i()()()(),t(27,"div",10)(28,"div",9)(29,"label"),l(30,"Number"),i(),t(31,"div")(32,"span"),l(33),i()()()(),t(34,"div",8)(35,"div",9)(36,"label"),l(37,"Process Type"),i(),t(38,"div")(39,"span"),l(40),i()()()(),t(41,"div",4)(42,"div",9)(43,"label"),l(44,"Authorization Header"),i(),t(45,"div")(46,"span"),l(47),i()()()(),t(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),l(53,"Request"),i()(),t(54,"div",19)(55,"button",20),l(56,"Copy to clipboard"),i()()(),t(57,"div",7),l(58),i()()()()()()()),o&2){let a=b();m(13),u(E(14,11,a.data.Created,"dd MMM yyyy HH:mm:ss")),m(6),p("ngIf",a.data.TypeID==1),m(),p("ngIf",a.data.TypeID==0),m(),Me("href",a.data.ShopLink,V),m(2),u(a.data.ShopName),m(3),u(a.data.ShopLink),m(7),u(a.data._source.log.number),m(7),u(a.data._source.log.processType),m(7),u(a.data._source.log.authorizationHeader),m(8),p("cdkCopyToClipboard",a.data._source.log.request),m(3),P(" ",a.data._source.log.request," ")}}var it=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,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 d=v.find(mt=>mt.ShopID==this.data._source.shopId);d?(this.data.TypeID=d.TypeID,this.data.ShopName=d.Name,this.data.ShopLink=d.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),y(4,Bt,59,14,"div",3),i()()()()),r&2&&(p("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),m(4),p("ngIf",e.data))},dependencies:[T,R,et,D]});let o=n;return o})();function At(o,n){if(o&1&&(t(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),l(4,"General"),i()(),t(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",6)(16,"div",12)(17,"label"),l(18,"SKU"),i(),t(19,"div")(20,"span"),l(21),i()()()(),t(22,"div",6)(23,"div",12)(24,"label"),l(25,"Channel"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",6)(30,"div",12)(31,"label"),l(32,"Response Code"),i(),t(33,"div")(34,"span"),l(35),i()()()()()()()()),o&2){let a=b();m(13),u(E(14,4,a.data.Created,"dd MMM yyyy")),m(8),u(a.data.Sku),m(7),u(a.data.ChannelName),m(7),u(a.data.ResponseCode)}}var nt=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(c=>{this.ID=c.ID,this.Load()})}ngOnInit(){}Load(){var s={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",s).subscribe(r=>{this.data.Created=r.hits[0]._source["@timestamp_received"],this.data.Sku=r.hits[0]._source.log.sku,this.data.ChannelName=r.hits[0]._source.log.channelName,this.data.ResponseCode=r.hits[0]._source.log.responseCode,this.request=X.IsNotEmpty(r.hits[0]?._source.log?.request)?JSON.parse(r.hits[0]?._source?.log?.request):"",this.response=r.hits[0]._source.log.response})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-detail"]],decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[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(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3),y(7,At,36,7,"div",4),i(),t(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),l(13,"Request"),i()(),t(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),l(18),x(19,"json"),i()()()()()(),t(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),l(24,"Response"),i()(),t(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),l(29),i()()()()()()()()()()),r&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),m(7),p("ngIf",e.data),m(11),u(G(19,5,e.request)),m(11),u(e.response))},dependencies:[T,k,R,re,D]});let o=n;return o})();function Ft(o,n){if(o&1&&(t(0,"div",9)(1,"div",10)(2,"label"),l(3,"Process Code"),i(),t(4,"div")(5,"span"),l(6),i()()()()),o&2){let a=b();m(6),u(a.ProcessedCode)}}function jt(o,n){if(o&1){let a=L();t(0,"a",16),N("click",function(){g(a);let r=b();return h(r.Retry())}),l(1,"Retry"),i()}}var ot=(()=>{let n=class n{constructor(s,r){this.route=s,this.http=r,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(e=>{this.ID=e.ID,this.Load()})}Retry(){var s={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",s).subscribe(r=>{alert(JSON.stringify(r))})}Load(){var s={ID:this.ID};this.http.post("/api/Orders/GetDetail",s).subscribe(r=>{for(let e of r.hits)this.Number=e._source.log.number,this.MarketTypeString=e._source.log.type,this.ResponseCode=e._source.log.responseCode,this.POSActionTypeString=e._source.message,this.ProcessDuration=0,this.Created=e._source["@timestamp_received"],this.request=X.IsNotEmpty(e._source?.log?.request)?JSON.parse(e._source.log?.request):"",this.response=X.IsNotEmpty(e._source?.log?.response)?JSON.parse(e._source.log?.response):"",this.shopId=e._source.shopId,this.ProcessedCode=e._source.log.processedCode})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M))},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),l(11,"General"),i()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),l(17,"Date"),i(),t(18,"div")(19,"span"),l(20),x(21,"date"),i()()()(),t(22,"div",9)(23,"div",10)(24,"label"),l(25,"Number"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",9)(30,"div",10)(31,"label"),l(32,"Type"),i(),t(33,"div")(34,"span"),l(35),i()()()(),t(36,"div",9)(37,"div",10)(38,"label"),l(39,"Response Code"),i(),t(40,"div")(41,"span"),l(42),i()()()(),t(43,"div",9)(44,"div",10)(45,"label"),l(46,"ShopID"),i(),t(47,"div")(48,"span"),l(49),i()()()(),y(50,Ft,7,1,"div",11),t(51,"div",9)(52,"div",10)(53,"label"),l(54,"Action"),i(),t(55,"div")(56,"span"),l(57),i()()()()()()()()(),t(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),l(63,"Request"),i()(),t(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),l(68),x(69,"json"),i()()(),t(70,"actions",14),y(71,jt,2,0,"a",15),i()()()(),t(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),l(76,"Response"),i()(),t(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),l(81),x(82,"json"),i()()()()()()()()()()),r&2&&(p("headerTitle","Order #"+e.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),u(E(21,14,e.Created,"dd MMM yyyy HH:mm:ss")),m(8),u(e.Number),m(7),u(e.MarketTypeString),m(7),u(e.ResponseCode),m(7),u(e.shopId),m(),p("ngIf",e.ProcessedCode!=null),m(7),u(e.POSActionTypeString),m(11),u(G(69,17,e.request)),m(3),p("ngIf",e.ResponseCode!="200"&&e.ResponseCode!="201"),m(10),u(G(82,19,e.response)))},dependencies:[T,k,R,re,D]});let o=n;return o})();var qt=()=>["/menu/log/exception/detail"],Ht=o=>({ID:o});function zt(o,n){if(o&1&&(t(0,"tr")(1,"td",12),w(2,"img",13),i(),t(3,"td"),l(4),x(5,"date"),i(),t(6,"td")(7,"a",14),l(8),i()(),t(9,"td")(10,"div",15),l(11),i(),t(12,"div"),l(13),i()()()),o&2){let a=n.$implicit;m(2),p("src",a.logo,V),m(2),u(E(5,7,a.date,"dd-MM-yyyy hh:mm:ss")),m(3),p("routerLink",z(10,qt))("queryParams",q(11,Ht,a.id)),m(),P(" ",a.number," "),m(3),u(a.message),m(2),u(a.stackTrace)}}function Gt(o,n){if(o&1){let a=L();F(0),t(1,"mat-paginator",16),N("page",function(r){g(a);let e=b(2);return h(e.onPaginationChange(r))}),i(),j()}if(o&2){let a=b(2);m(),p("length",a.pageTotal)("pageSize",a.pageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ut(o,n){if(o&1&&(F(0),t(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),l(6,"Channel"),i(),t(7,"th",9),l(8,"Date"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Exception"),i()()(),t(13,"tbody"),y(14,zt,14,13,"tr",10),i()(),y(15,Gt,2,3,"ng-container",11),i(),j()),o&2){let a=b();m(14),p("ngForOf",a.exceptions),m(),p("ngIf",(a.exceptions==null?null:a.exceptions.length)>0)}}function Jt(o,n){o&1&&(t(0,"div",17),w(1,"app-empty-state"),i())}var rt=(()=>{let n=class n{constructor(s){this.http=s,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(s=>{this.exceptions=s.hits.map(r=>({id:r._id,logo:X.getChannelLogoByName(r._source.error?.Type),number:r._source.error.number,date:r._source["@timestamp_received"],stackTrace:r._source.error.stackTrace,message:r._source.message,requestJSON:r._source?.error?.requestJSON})),this.pageTotal=s.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(s){this.filter.PageNumber=s.pageIndex+1,this.getData()}};n.\u0275fac=function(r){return new(r||n)(f(M))},n.\u0275cmp=I({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(r,e){if(r&1&&(t(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),y(5,Ut,16,2,"ng-container",5)(6,Jt,2,0,"ng-template",null,0,U),i()()()()()),r&2){let c=H(7);m(5),p("ngIf",e.exceptions.length>0)("ngIfElse",c)}},dependencies:[J,T,k,R,K,Y,D]});let o=n;return o})();var at=(()=>{let n=class n{constructor(s){this.httpService=s}getExceptionDetail(s){return this.httpService.post("/api/Orders/GetDetailException",{ID:s}).pipe(Se(e=>e?.hits[0]?._source))}};n.\u0275fac=function(r){return new(r||n)(he(M))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function Kt(o,n){if(o&1&&(t(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),l(6,"General"),i()(),t(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),l(12,"Date"),i(),t(13,"div")(14,"span"),l(15),x(16,"date"),i()()()(),t(17,"div",9)(18,"div",10)(19,"label"),l(20,"Number"),i(),t(21,"div")(22,"span"),l(23),i()()()(),t(24,"div",9)(25,"div",10)(26,"label"),l(27,"Type"),i(),t(28,"div")(29,"span"),l(30),i()()()(),t(31,"div",9)(32,"div",10)(33,"label"),l(34,"ShopID"),i(),t(35,"div")(36,"span"),l(37),i()()()()()()()()(),t(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),l(43,"Request"),i()(),t(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),l(48),x(49,"json"),i()()()()()(),t(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),l(54,"Exception"),i()(),t(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),l(59),i(),t(60,"pre"),l(61),i()()()()()()()()),o&2){let a=n.ngIf;m(15),u(E(16,7,a["@timestamp"],"dd MMM yyyy HH:mm:ss")),m(8),u(a==null||a.error==null?null:a.error.number),m(7),u(a==null||a.error==null?null:a.error.Type),m(7),u(a==null?null:a.shopId),m(11),u(G(49,10,a==null||a.error==null?null:a.error.requestJSON)),m(11),u(a==null?null:a.message),m(2),u(a==null||a.error==null?null:a.error.stackTrace)}}var lt=(()=>{let n=class n{constructor(s,r){this.activatedRoute=s,this.exceptionService=r,this.invoiceNumber=""}ngOnInit(){let s=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(s?.ID)}getExceptionDetail(s){this.exceptionDetail$=this.exceptionService.getExceptionDetail(s).pipe(xe(r=>{this.invoiceNumber=r?.error?.number}),be(1))}};n.\u0275fac=function(r){return new(r||n)(f(B),f(at))},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"mainpanel",0)(1,"content"),y(2,Kt,62,12,"div",1),x(3,"async"),i()()),r&2&&(p("headerTitle","Order #"+e.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("ngIf",G(3,4,e.exceptionDetail$)))},dependencies:[T,R,Pe,re,D]});let o=n;return o})();var Zt=[{path:"",component:Ue,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Qe,canActivate:[W],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Xe,canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:$e,canActivate:[W],data:{title:"Raw Log"}},{path:"rawlog/detail",component:it,canActivate:[W],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:nt,canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:ot,canActivate:[W],data:{title:"Order Details"}},{path:"exception",component:rt,canActivate:[W],data:{title:"Exception Log"}},{path:"exception/detail",component:lt,canActivate:[W],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-OVGQQRBL.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-6ROL3HRT.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-AVI3AQG5.js").then(o=>o.ChannelLogComponent)},canActivate:[W],data:{title:"Authorization Log"}}]}],st=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,ve.forChild(Zt)]});let o=n;return o})();var gn=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,We,Ve,st,ve,je,tt,ze,Be,He,Z,Fe,Ge]});let o=n;return o})();export{gn as LogsModule};
1
+ import{a as Ge}from"./chunk-WWZHEKFE.js";import{a as Z}from"./chunk-LQWFYVLD.js";import"./chunk-6U6JR5K6.js";import{a as Y}from"./chunk-EYZIWEGE.js";import{a as qe,b as He}from"./chunk-UAXJ7MHW.js";import"./chunk-ZRW4OZGG.js";import"./chunk-4NXO2JYR.js";import"./chunk-PCKZD4LZ.js";import"./chunk-YUBBVFFI.js";import{a as K,b as ze}from"./chunk-2LJXM62F.js";import"./chunk-ENIJ4MFV.js";import{a as W}from"./chunk-CSFYYRBU.js";import"./chunk-UOT5GPQI.js";import"./chunk-C2SGQUOH.js";import{a as pe,b as ce,d as ue,e as Be}from"./chunk-7IIB5DLC.js";import{i as de}from"./chunk-IUOWC7K6.js";import{e as M}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{m as R,n as je}from"./chunk-OI3SQ5ZO.js";import{t as Ae,u as Fe}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as ae,h as le,m as se,o as me,t as Oe,u as ke,y as We,z as Ve}from"./chunk-JCKUKK6T.js";import{c as X}from"./chunk-KZ2VDCDO.js";import{$ as ie,$c as ve,Ab as Me,Bc as Pe,Cc as D,Dc as re,Fc as fe,Ha as V,Ib as H,Ja as m,Jb as l,Ka as f,Kb as u,Lb as P,Nb as _,Ob as C,Pb as S,Q as be,Qa as Te,Sb as z,Tb as q,Wc as B,X as xe,Xc as Le,Zc as k,_a as y,aa as ne,ab as p,ac as x,ba as we,bc as G,ca as he,cc as E,dc as U,eb as De,ga as I,ha as oe,ia as Ie,mb as t,nb as i,oa as g,ob as w,pa as h,pb as F,q as Se,qb as j,sb as L,tc as Re,vb as N,vc as Ne,xb as b,xc as J,yc as T,za as Ee}from"./chunk-QNL3BTRG.js";import"./chunk-GNOSNGXM.js";var Ue=(()=>{let n=class n{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"}]}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),w(3,"nav-tab",2),i()()(),w(4,"router-outlet")),r&2&&(m(3),p("Tabs",e.ObjectlogTabs))},dependencies:[Le,qe]});let o=n;return o})();var A=(()=>{let n=class n{constructor(){}get Data(){return this._Data}set Data(s){this._Data=s}Fill(s){return this._Data.find(r=>r._id==s)}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var dt=()=>["/menu/log/order/detail"],pt=o=>({ID:o}),ct=o=>({"bg-warning":o});function ut(o,n){if(o&1&&(t(0,"span",22),w(1,"img",23),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function gt(o,n){o&1&&(t(0,"th",27)(1,"span",33),l(2," Response Body Warning "),i()())}function ht(o,n){o&1&&(t(0,"th")(1,"span",33),l(2," Number Override "),i()())}function ft(o,n){if(o&1&&(t(0,"td",27)(1,"span",36),l(2),i()()),o&2){let a=b().$implicit;m(),p("ngClass",q(2,ct,a.responseBodyWarning!=null)),m(),u(a.responseBodyWarning)}}function vt(o,n){if(o&1&&(t(0,"td"),l(1),i()),o&2){let a=b().$implicit;m(),P(" ",a.ResponseBodyWarningReference," ")}}function yt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",34),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td",27)(12,"span",35),l(13),i()(),y(14,ft,3,4,"td",29)(15,vt,2,1,"td",30),i()),o&2){let a=n.$implicit,s=b(2);m(2),p("routerLink",z(14,dt))("queryParams",q(15,pt,a.ID)),m(),P(" ",E(4,11,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.MarketTypeString),m(2),u(a.POSActionTypeString),m(2),u(a.Number),m(2),De(a.ResponseCode===200||a.ResponseCode===202?"bg-success":"bg-warning"),m(),P(" ",a.ResponseCode," "),m(),p("ngIf",s.responseBodyWarningVisible),m(),p("ngIf",s.responseBodyWarningVisible)}}function _t(o,n){if(o&1){let a=L();F(0),t(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),l(6,"Date"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"Actions"),i(),t(11,"th"),l(12,"Number"),i(),t(13,"th",27)(14,"span",28),l(15," Response Code "),i()(),y(16,gt,3,0,"th",29)(17,ht,3,0,"th",30),i()(),t(18,"tbody"),y(19,yt,16,17,"tr",31),i()(),t(20,"mat-paginator",32),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngIf",a.responseBodyWarningVisible),m(),p("ngIf",a.responseBodyWarningVisible),m(2),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ct(o,n){o&1&&(t(0,"div",37),w(1,"app-empty-state"),i())}var Qe=(()=>{let n=class n{constructor(s,r,e,c){this.http=s,this._RawLogService=r,this.route=e,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(s=>{this.responseCode=s.responseCode,this.responseCode!=null?this.Load(s):this.Load()})}Load(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("/api/Orders/Get",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){e._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let c={ID:e._id,Created:e._source["@timestamp_received"],shopId:e._source.shopId,MarketTypeString:e._source.log.type,POSActionTypeString:e._source.message,Number:e._source.log.number,ResponseCode:e._source.log.responseCode,responseBodyWarning:e._source.log.responseBodyWarning,ResponseBodyWarningReference:e._source.log.ResponseBodyWarningReference};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(B),f(de))},n.\u0275cmp=I({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(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.Number,d)||(e.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,ut,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",2),l(9,"Action"),i(),t(10,"ng-select",6),S("ngModelChange",function(d){return g(c),C(e.filter.ActionType,d)||(e.filter.ActionType=d),h(d)}),i()(),t(11,"div",5)(12,"label",7),l(13,"From/To"),i(),t(14,"div",8)(15,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",5)(19,"label",11),l(20,"Response Code"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.StatusCode,d)||(e.filter.StatusCode=d),h(d)}),i()(),t(22,"div",5)(23,"label",11),l(24,"Response Body Warning"),i(),t(25,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.responseBodyWarning,d)||(e.filter.responseBodyWarning=d),h(d)}),i(),t(26,"datalist",14),w(27,"option",15),i()(),t(28,"div",5)(29,"label",11),l(30,"Page Number"),i(),t(31,"input",16),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(32,"div",5)(33,"label",11),l(34,"Page Size"),i(),t(35,"input",17),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),y(40,_t,21,6,"ng-container",21)(41,Ct,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(42);_("text",e.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(5),p("clearable",!0)("items",e.ActionTypeList),_("ngModel",e.filter.ActionType),m(5),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.StatusCode),m(4),_("ngModel",e.filter.responseBodyWarning),m(6),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[Ne,J,T,Oe,ke,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,Ae,D]});let o=n;return o})();var St=()=>["/menu/log/inventory/sync-inventory/detail"],bt=o=>({ID:o});function xt(o,n){if(o&1&&(t(0,"span",19),w(1,"img",20),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function wt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",26),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td"),l(12),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(10,St))("queryParams",q(11,bt,a.ID)),m(),P(" ",E(4,7,a.Created,"dd MMM yyyy HH:mm")," "),m(3),u(a.channelName),m(2),u(a.Sku),m(2),u(a.Stock),m(2),u(a.ResponseCode)}}function It(o,n){if(o&1){let a=L();F(0),t(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),l(6,"Created"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"SKU"),i(),t(11,"th"),l(12,"Stock"),i(),t(13,"th"),l(14,"Response code"),i()()(),t(15,"tbody"),y(16,wt,13,13,"tr",24),i()(),t(17,"mat-paginator",25),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Et(o,n){o&1&&(t(0,"div",27),w(1,"app-empty-state"),i())}var Xe=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,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(s=>{this.filter=s.Filter,this.ActionTypeList=s.Options.ActionTypeList,this.Get()})}Get(s){s!=null&&(this.filter.Sku=s),this.http.post("api/Inventory/GetLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={ID:e._source.log.id,Created:e._source["@timestamp_received"],channelName:e._source.log.channelName,Sku:e._source.log.sku,Stock:e._source.log.stock,ResponseCode:e._source.log.responseCode};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-log"]],decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Product Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["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(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Sku,d)||(e.filter.Sku=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"actions")(2,"a",2),l(3," Async Inventory "),i()(),t(4,"filters")(5,"div",3)(6,"div")(7,"label",4),l(8,"Channel"),i(),t(9,"ng-select",5),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(10,xt,3,3,"ng-template",6),i()(),t(11,"div",7)(12,"label",8),l(13,"From/To"),i(),t(14,"div",9)(15,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",11),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",7)(19,"label",12),l(20,"Page Number"),i(),t(21,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(22,"div",7)(23,"label",12),l(24,"Page Size"),i(),t(25,"input",14),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()()(),t(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),y(30,It,18,4,"ng-container",18)(31,Et,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(32);_("text",e.filter.Sku),m(9),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Tt=()=>["/menu/log/order/detail"],Dt=o=>({ID:o});function Mt(o,n){if(o&1&&(t(0,"span",17),w(1,"img",18),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function Rt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",25),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(9,Tt))("queryParams",q(10,Dt,a.id)),m(),P(" ",E(4,6,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.type),m(2),u(a.number),m(2),u(a.message)}}function Nt(o,n){if(o&1){let a=L();F(0),t(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),l(6,"Date"),i(),t(7,"th"),l(8,"Type"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Message"),i()()(),t(13,"tbody"),y(14,Rt,11,12,"tr",23),i()(),t(15,"mat-paginator",24),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(14),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Pt(o,n){o&1&&(t(0,"div",26),w(1,"app-empty-state"),i())}var $e=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,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(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={id:e._id,message:e._source.message,responseCode:e._source.log.responseCode,processTypeString:e._source.log.processType,type:e._source.log.type,number:e._source.log.number,Created:e._source["@timestamp_received"]};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({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(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Number,d)||(e.filter.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,Mt,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),i(),t(10,"div",7)(11,"datepicker",8),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(12,"div")(13,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),i(),t(17,"input",11),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),y(26,Nt,16,4,"ng-container",16)(27,Pt,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(28);_("text",e.filter.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Ce=class{constructor(n,a){this._document=a;let s=this._textarea=this._document.createElement("textarea"),r=s.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",s.setAttribute("aria-hidden","true"),s.value=n,s.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(s)}copy(){let n=this._textarea,a=!1;try{if(n){let s=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),a=this._document.execCommand("copy"),s&&s.focus()}}catch{}return a}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},Lt=(()=>{let n=class n{constructor(s){this._document=s}copy(s){let r=this.beginCopy(s),e=r.copy();return r.destroy(),e}beginCopy(s){return new Ce(s,this._document)}};n.\u0275fac=function(r){return new(r||n)(he(Re))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})(),Ot=new we("CDK_COPY_TO_CLIPBOARD_CONFIG"),et=(()=>{let n=class n{constructor(s,r,e){this._clipboard=s,this._ngZone=r,this.text="",this.attempts=1,this.copied=new Ee,this._pending=new Set,e&&e.attempts!=null&&(this.attempts=e.attempts)}copy(s=this.attempts){if(s>1){let r=s,e=this._clipboard.beginCopy(this.text);this._pending.add(e);let c=()=>{let v=e.copy();!v&&--r&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(e),e.destroy(),this.copied.emit(v))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(s=>s.destroy()),this._pending.clear(),this._destroyed=!0}};n.\u0275fac=function(r){return new(r||n)(f(Lt),f(Te),f(Ot,8))},n.\u0275dir=Ie({type:n,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(r,e){r&1&&N("click",function(){return e.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},standalone:!0});let o=n;return o})(),tt=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({});let o=n;return o})();function Wt(o,n){o&1&&w(0,"img",21)}function Vt(o,n){o&1&&w(0,"img",22)}function Bt(o,n){if(o&1&&(t(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),l(4,"General"),i()(),t(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",10)(16,"div",9)(17,"label"),l(18,"Market Place Type"),i(),y(19,Wt,1,0,"img",11)(20,Vt,1,0,"img",12),t(21,"a",13)(22,"span",14),l(23),i(),w(24,"br"),t(25,"small",15),l(26),i()()()(),t(27,"div",10)(28,"div",9)(29,"label"),l(30,"Number"),i(),t(31,"div")(32,"span"),l(33),i()()()(),t(34,"div",8)(35,"div",9)(36,"label"),l(37,"Process Type"),i(),t(38,"div")(39,"span"),l(40),i()()()(),t(41,"div",4)(42,"div",9)(43,"label"),l(44,"Authorization Header"),i(),t(45,"div")(46,"span"),l(47),i()()()(),t(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),l(53,"Request"),i()(),t(54,"div",19)(55,"button",20),l(56,"Copy to clipboard"),i()()(),t(57,"div",7),l(58),i()()()()()()()),o&2){let a=b();m(13),u(E(14,11,a.data.Created,"dd MMM yyyy HH:mm:ss")),m(6),p("ngIf",a.data.TypeID==1),m(),p("ngIf",a.data.TypeID==0),m(),Me("href",a.data.ShopLink,V),m(2),u(a.data.ShopName),m(3),u(a.data.ShopLink),m(7),u(a.data._source.log.number),m(7),u(a.data._source.log.processType),m(7),u(a.data._source.log.authorizationHeader),m(8),p("cdkCopyToClipboard",a.data._source.log.request),m(3),P(" ",a.data._source.log.request," ")}}var it=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,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 d=v.find(mt=>mt.ShopID==this.data._source.shopId);d?(this.data.TypeID=d.TypeID,this.data.ShopName=d.Name,this.data.ShopLink=d.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),y(4,Bt,59,14,"div",3),i()()()()),r&2&&(p("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),m(4),p("ngIf",e.data))},dependencies:[T,R,et,D]});let o=n;return o})();function At(o,n){if(o&1&&(t(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),l(4,"General"),i()(),t(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",6)(16,"div",12)(17,"label"),l(18,"SKU"),i(),t(19,"div")(20,"span"),l(21),i()()()(),t(22,"div",6)(23,"div",12)(24,"label"),l(25,"Channel"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",6)(30,"div",12)(31,"label"),l(32,"Response Code"),i(),t(33,"div")(34,"span"),l(35),i()()()()()()()()),o&2){let a=b();m(13),u(E(14,4,a.data.Created,"dd MMM yyyy")),m(8),u(a.data.Sku),m(7),u(a.data.ChannelName),m(7),u(a.data.ResponseCode)}}var nt=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(c=>{this.ID=c.ID,this.Load()})}ngOnInit(){}Load(){var s={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",s).subscribe(r=>{this.data.Created=r.hits[0]._source["@timestamp_received"],this.data.Sku=r.hits[0]._source.log.sku,this.data.ChannelName=r.hits[0]._source.log.channelName,this.data.ResponseCode=r.hits[0]._source.log.responseCode,this.request=X.IsNotEmpty(r.hits[0]?._source.log?.request)?JSON.parse(r.hits[0]?._source?.log?.request):"",this.response=r.hits[0]._source.log.response})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-detail"]],decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[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(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3),y(7,At,36,7,"div",4),i(),t(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),l(13,"Request"),i()(),t(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),l(18),x(19,"json"),i()()()()()(),t(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),l(24,"Response"),i()(),t(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),l(29),i()()()()()()()()()()),r&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),m(7),p("ngIf",e.data),m(11),u(G(19,5,e.request)),m(11),u(e.response))},dependencies:[T,k,R,re,D]});let o=n;return o})();function Ft(o,n){if(o&1&&(t(0,"div",9)(1,"div",10)(2,"label"),l(3,"Process Code"),i(),t(4,"div")(5,"span"),l(6),i()()()()),o&2){let a=b();m(6),u(a.ProcessedCode)}}function jt(o,n){if(o&1){let a=L();t(0,"a",16),N("click",function(){g(a);let r=b();return h(r.Retry())}),l(1,"Retry"),i()}}var ot=(()=>{let n=class n{constructor(s,r){this.route=s,this.http=r,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(e=>{this.ID=e.ID,this.Load()})}Retry(){var s={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",s).subscribe(r=>{alert(JSON.stringify(r))})}Load(){var s={ID:this.ID};this.http.post("/api/Orders/GetDetail",s).subscribe(r=>{for(let e of r.hits)this.Number=e._source.log.number,this.MarketTypeString=e._source.log.type,this.ResponseCode=e._source.log.responseCode,this.POSActionTypeString=e._source.message,this.ProcessDuration=0,this.Created=e._source["@timestamp_received"],this.request=X.IsNotEmpty(e._source?.log?.request)?JSON.parse(e._source.log?.request):"",this.response=X.IsNotEmpty(e._source?.log?.response)?JSON.parse(e._source.log?.response):"",this.shopId=e._source.shopId,this.ProcessedCode=e._source.log.processedCode})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M))},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),l(11,"General"),i()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),l(17,"Date"),i(),t(18,"div")(19,"span"),l(20),x(21,"date"),i()()()(),t(22,"div",9)(23,"div",10)(24,"label"),l(25,"Number"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",9)(30,"div",10)(31,"label"),l(32,"Type"),i(),t(33,"div")(34,"span"),l(35),i()()()(),t(36,"div",9)(37,"div",10)(38,"label"),l(39,"Response Code"),i(),t(40,"div")(41,"span"),l(42),i()()()(),t(43,"div",9)(44,"div",10)(45,"label"),l(46,"ShopID"),i(),t(47,"div")(48,"span"),l(49),i()()()(),y(50,Ft,7,1,"div",11),t(51,"div",9)(52,"div",10)(53,"label"),l(54,"Action"),i(),t(55,"div")(56,"span"),l(57),i()()()()()()()()(),t(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),l(63,"Request"),i()(),t(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),l(68),x(69,"json"),i()()(),t(70,"actions",14),y(71,jt,2,0,"a",15),i()()()(),t(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),l(76,"Response"),i()(),t(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),l(81),x(82,"json"),i()()()()()()()()()()),r&2&&(p("headerTitle","Order #"+e.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),u(E(21,14,e.Created,"dd MMM yyyy HH:mm:ss")),m(8),u(e.Number),m(7),u(e.MarketTypeString),m(7),u(e.ResponseCode),m(7),u(e.shopId),m(),p("ngIf",e.ProcessedCode!=null),m(7),u(e.POSActionTypeString),m(11),u(G(69,17,e.request)),m(3),p("ngIf",e.ResponseCode!="200"&&e.ResponseCode!="201"),m(10),u(G(82,19,e.response)))},dependencies:[T,k,R,re,D]});let o=n;return o})();var qt=()=>["/menu/log/exception/detail"],Ht=o=>({ID:o});function zt(o,n){if(o&1&&(t(0,"tr")(1,"td",12),w(2,"img",13),i(),t(3,"td"),l(4),x(5,"date"),i(),t(6,"td")(7,"a",14),l(8),i()(),t(9,"td")(10,"div",15),l(11),i(),t(12,"div"),l(13),i()()()),o&2){let a=n.$implicit;m(2),p("src",a.logo,V),m(2),u(E(5,7,a.date,"dd-MM-yyyy hh:mm:ss")),m(3),p("routerLink",z(10,qt))("queryParams",q(11,Ht,a.id)),m(),P(" ",a.number," "),m(3),u(a.message),m(2),u(a.stackTrace)}}function Gt(o,n){if(o&1){let a=L();F(0),t(1,"mat-paginator",16),N("page",function(r){g(a);let e=b(2);return h(e.onPaginationChange(r))}),i(),j()}if(o&2){let a=b(2);m(),p("length",a.pageTotal)("pageSize",a.pageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ut(o,n){if(o&1&&(F(0),t(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),l(6,"Channel"),i(),t(7,"th",9),l(8,"Date"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Exception"),i()()(),t(13,"tbody"),y(14,zt,14,13,"tr",10),i()(),y(15,Gt,2,3,"ng-container",11),i(),j()),o&2){let a=b();m(14),p("ngForOf",a.exceptions),m(),p("ngIf",(a.exceptions==null?null:a.exceptions.length)>0)}}function Jt(o,n){o&1&&(t(0,"div",17),w(1,"app-empty-state"),i())}var rt=(()=>{let n=class n{constructor(s){this.http=s,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(s=>{this.exceptions=s.hits.map(r=>({id:r._id,logo:X.getChannelLogoByName(r._source.error?.Type),number:r._source.error.number,date:r._source["@timestamp_received"],stackTrace:r._source.error.stackTrace,message:r._source.message,requestJSON:r._source?.error?.requestJSON})),this.pageTotal=s.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(s){this.filter.PageNumber=s.pageIndex+1,this.getData()}};n.\u0275fac=function(r){return new(r||n)(f(M))},n.\u0275cmp=I({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(r,e){if(r&1&&(t(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),y(5,Ut,16,2,"ng-container",5)(6,Jt,2,0,"ng-template",null,0,U),i()()()()()),r&2){let c=H(7);m(5),p("ngIf",e.exceptions.length>0)("ngIfElse",c)}},dependencies:[J,T,k,R,K,Y,D]});let o=n;return o})();var at=(()=>{let n=class n{constructor(s){this.httpService=s}getExceptionDetail(s){return this.httpService.post("/api/Orders/GetDetailException",{ID:s}).pipe(Se(e=>e?.hits[0]?._source))}};n.\u0275fac=function(r){return new(r||n)(he(M))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function Kt(o,n){if(o&1&&(t(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),l(6,"General"),i()(),t(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),l(12,"Date"),i(),t(13,"div")(14,"span"),l(15),x(16,"date"),i()()()(),t(17,"div",9)(18,"div",10)(19,"label"),l(20,"Number"),i(),t(21,"div")(22,"span"),l(23),i()()()(),t(24,"div",9)(25,"div",10)(26,"label"),l(27,"Type"),i(),t(28,"div")(29,"span"),l(30),i()()()(),t(31,"div",9)(32,"div",10)(33,"label"),l(34,"ShopID"),i(),t(35,"div")(36,"span"),l(37),i()()()()()()()()(),t(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),l(43,"Request"),i()(),t(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),l(48),x(49,"json"),i()()()()()(),t(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),l(54,"Exception"),i()(),t(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),l(59),i(),t(60,"pre"),l(61),i()()()()()()()()),o&2){let a=n.ngIf;m(15),u(E(16,7,a["@timestamp"],"dd MMM yyyy HH:mm:ss")),m(8),u(a==null||a.error==null?null:a.error.number),m(7),u(a==null||a.error==null?null:a.error.Type),m(7),u(a==null?null:a.shopId),m(11),u(G(49,10,a==null||a.error==null?null:a.error.requestJSON)),m(11),u(a==null?null:a.message),m(2),u(a==null||a.error==null?null:a.error.stackTrace)}}var lt=(()=>{let n=class n{constructor(s,r){this.activatedRoute=s,this.exceptionService=r,this.invoiceNumber=""}ngOnInit(){let s=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(s?.ID)}getExceptionDetail(s){this.exceptionDetail$=this.exceptionService.getExceptionDetail(s).pipe(xe(r=>{this.invoiceNumber=r?.error?.number}),be(1))}};n.\u0275fac=function(r){return new(r||n)(f(B),f(at))},n.\u0275cmp=I({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(r,e){r&1&&(t(0,"mainpanel",0)(1,"content"),y(2,Kt,62,12,"div",1),x(3,"async"),i()()),r&2&&(p("headerTitle","Order #"+e.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("ngIf",G(3,4,e.exceptionDetail$)))},dependencies:[T,R,Pe,re,D]});let o=n;return o})();var Zt=[{path:"",component:Ue,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Qe,canActivate:[W],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Xe,canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:$e,canActivate:[W],data:{title:"Raw Log"}},{path:"rawlog/detail",component:it,canActivate:[W],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:nt,canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:ot,canActivate:[W],data:{title:"Order Details"}},{path:"exception",component:rt,canActivate:[W],data:{title:"Exception Log"}},{path:"exception/detail",component:lt,canActivate:[W],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-NBSXPQ4I.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-EE7O2AZI.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-QFQILAPS.js").then(o=>o.ChannelLogComponent)},canActivate:[W],data:{title:"Authorization Log"}}]}],st=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,ve.forChild(Zt)]});let o=n;return o})();var gn=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,We,Ve,st,ve,je,tt,ze,Be,He,Z,Fe,Ge]});let o=n;return o})();export{gn as LogsModule};
@@ -1 +1 @@
1
- import{a as zt,b as Qt}from"./chunk-P5VJV3CP.js";import"./chunk-ZRW4OZGG.js";import{b as qt}from"./chunk-5SIWWKAE.js";import{b as Ht}from"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import{a as Xt,b as Jt}from"./chunk-O4N2CCVN.js";import{a as Bt,b as Rt}from"./chunk-4NXO2JYR.js";import{a as mt,b as Gt,c as jt,d as pt,e as st}from"./chunk-6CS4JNMF.js";import"./chunk-PCKZD4LZ.js";import"./chunk-RQCGB4NH.js";import{b as Yt}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as Wt}from"./chunk-XSYSCEVJ.js";import"./chunk-UOT5GPQI.js";import"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{d as R,e as G}from"./chunk-7IIB5DLC.js";import"./chunk-Q6WJB65B.js";import{e as it}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{m as $t,n as Lt}from"./chunk-OI3SQ5ZO.js";import{t as Vt,u as Dt}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as lt,e as ct,h as L,i as X,l as gt,m as Nt,n as J,p as z,q as Ot,r as Q,s as kt,t as wt,u as Mt,x as q,y as et,z as B}from"./chunk-JCKUKK6T.js";import{b as Ut,c as g}from"./chunk-KZ2VDCDO.js";import{$ as N,Bc as T,F as Tt,Fc as F,H as Ft,Ja as p,Jb as f,Kb as rt,Lb as Z,Nb as At,Ob as Et,Pb as Pt,Q as tt,Qb as S,Rb as I,Sb as at,X as P,_a as h,ab as s,ac as v,bc as y,da as u,ga as x,hb as b,ib as w,kb as M,lb as U,mb as m,na as O,nb as c,oa as W,ob as _,pa as Y,pb as V,q as E,qb as D,sb as H,vb as A,xa as ht,xb as l,yc as $,za as k}from"./chunk-QNL3BTRG.js";import"./chunk-GNOSNGXM.js";var K=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(K||{});var nt=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(nt||{});var Ct=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(mt),this.formBuilder=u(q)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(E(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(n=[]){let i,a;return n=n.map(r=>(i=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(C=>C.language=="id"),d.name=a?.value,d)),r.name=i?.value?i?.value:r.name,r)),n}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{if(a=[],r.mandatory&&a.push(ct.required),r?.attribute_info?.format_type==nt.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==K.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new gt(null),value:new gt(null,a)});i.addControl(JSON.stringify(r.attribute_id),d)}else i.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>{switch(r.attribute_info.input_type){case K.MULTI_COMBO_BOX:g.IsNotEmpty(i[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(d=>i[r.attribute_id]?.findIndex(C=>C==d.value_id)!=-1):r.attribute_value_list=[];break;case K.FREE_TEXT_FILED:r.attribute_info.format_type==nt.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(i[r.attribute_id]?.value,i[r.attribute_id]?.unit):g.IsNotEmpty(i[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:i[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==i[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,i){let a=[];return g.IsNotEmpty(n)&&(a=[{value_id:0,original_value_name:JSON.stringify(n),value_unit:i}]),a}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var bt=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(bt||{});var vt=()=>[];function ne(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function oe(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:at(4,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function re(t,o){if(t&1&&_(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ae(t,o){if(t&1&&(m(0,"option",15),f(1),c()),t&2){let e=o.$implicit;s("value",e),p(),rt(e)}}function le(t,o){if(t&1&&(m(0,"div",10),_(1,"input",12),m(2,"select",13)(3,"option",14),f(4,"Unit"),c(),M(5,ae,2,2,"option",15,w),c()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),p(),s("placeholder","Isi "+(e==null?null:e.name)),p(2),s("value",null),p(2),U(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function ce(t,o){if(t&1&&_(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function me(t,o){if(t&1&&h(0,le,7,3,"div",10)(1,ce,1,2,"input",11),t&2){let e=l(2).$implicit,n=l(2);b((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,o){if(t&1&&_(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function se(t,o){if(t&1&&h(0,re,1,2,"input",8)(1,me,2,1)(2,pe,1,1,"datepicker",9),t&2){let e,n=l().$implicit,i=l(2);b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===i.validationType.VALIDATOR_STRING_TYPE?0:e===i.validationType.VALIDATOR_FLOAT_TYPE?1:e===i.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function de(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:at(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function ue(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:at(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function _e(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,ne,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,oe,1,5,"ng-select",6)(6,se,3,1)(7,de,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),c()),t&2){let e,n=o.$implicit,i=l(2);p(2),b(n.mandatory?2:-1),p(2),Z(" ",n==null?null:n.name," "),p(),b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===i.inputType.MULTI_COMBO_BOX?5:e===i.inputType.FREE_TEXT_FILED?6:e===i.inputType.SINGLE_COMBO_BOX?7:8)}}function fe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,_e,9,3,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Zt=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ct),this.attributesChanges=new k,this.inputType=K,this.formatType=nt,this.validationType=bt}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Ct]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,a){i&1&&(h(0,fe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,G,R,B,J,wt,Mt,lt,kt,L,X,z,Q,Ot,Yt,Qt,zt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let t=o;return t})();var yt=(()=>{let o=class o{constructor(){this.httpService=u(it),this.formBuilder=u(q),this.uploadProductService=u(st)}getAttributes(n,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(Tt(r=>this.uploadProductService.selectedProduct$.pipe(E(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(n,i){let a=0;return n.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(i),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(n){let i=!1,a=[];return n.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),i=a.some(r=>r>1),i}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{a=[],r.is_required&&a.push(ct.required),i.addControl(r.id,this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.id)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>(r.is_multiple_selection?r.values=r.values.filter(d=>i[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==i[r.id]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function he(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function ge(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Ce(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function be(t,o){if(t&1&&(m(0,"small",5),f(1),c()),t&2){let e=l().$implicit;p(),Z(" ",e==null?null:e.name," is mandatory ")}}function ve(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,he,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,ge,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,be,2,1,"small",5),c()),t&2){let e=o.$implicit;p(2),b(e.is_required?2:-1),p(2),Z(" ",e==null?null:e.name," "),p(),b(e.is_multiple_selection?5:6),p(2),b(e.is_required?7:-1)}}function ye(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,ve,8,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Kt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(E(n=>n.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(i.values)||i.values?.length==0)))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([yt]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,ye,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,G,R,B,J,L,X,z,Q,et]});let t=o;return t})();var xt=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(pt)}getAttributes(n,i){return this.woocommerceUploadService.getAttributes(n,i).pipe(E(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var te=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(xt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([xt]),O,I],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,a){i&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),c(),m(4,"ng-select",3),v(5,"async"),A("change",function(d){return a.onSelectAttribute(d)}),c()()()),i&2&&(p(4),s("items",y(5,1,a.attributes$)))},dependencies:[F,T,et,G,R,B]});let t=o;return t})();var St=(()=>{let o=class o{constructor(){this.httpService=u(it),this.formBuilder=u(q)}getAttributes(n,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(E(r=>r))}createFormGroup(n){let i=this.formBuilder.group({});return n.forEach(a=>{i.addControl(a.variant,this.formBuilder.control(null))}),i}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function xe(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),f(2),c(),_(3,"ng-select",5),c()),t&2){let e=o.$implicit;p(2),Z(" ",e==null?null:e.variant," "),p(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Se(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,xe,4,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var ee=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(St),this.attributesChanges=new k}ngOnInit(){}ngOnChanges(n){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(P(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{n=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([St]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,Se,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,G,R,B,J,L,X,z,Q]});let t=o;return t})();var It=(()=>{let o=class o{constructor(){this.httpService=u(it),this.formBuilder=u(q)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(P(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(n){let i=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(r=>{i.addControl(r,this.formBuilder.control(null))}),i}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Ie(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),c(),_(6,"input",5),c(),m(7,"div",6)(8,"div",4),f(9," Product Type "),c(),_(10,"input",7),c(),m(11,"div",6)(12,"div",4),f(13," Status "),c(),_(14,"ng-select",8),c()()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(13),s("items",e.Options.StatusOptions)}}var ie=(()=>{let o=class o{constructor(){this.attributesChanges=new k,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(P(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([It]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,a){i&1&&(h(0,Ie,15,2,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,B,J,lt,L,X,z,Q,G,R]});let t=o;return t})();function Te(t,o){if(t&1&&(m(0,"div",6),_(1,"app-product-card",9),c()),t&2){let e=o.$implicit;p(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Fe(t,o){if(t&1){let e=H();V(0),m(1,"mat-checkbox",21),Pt("ngModelChange",function(i){W(e);let a=l().$implicit;return Et(a.selected,i)||(a.selected=i),Y(i)}),A("ngModelChange",function(){let i=W(e).ngIf,a=l(),r=a.$implicit,d=a.$index,C=l();return Y(C.onSelectChannel(r,d,i))}),c(),D()}if(t&2){let e=l().$implicit;p(),At("ngModel",e.selected)}}function Ae(t,o){t&1&&(m(0,"div",18),_(1,"input",22),c())}function Ee(t,o){if(t&1){let e=H();m(0,"app-channel-category-select",23),A("selectedCategory",function(i){W(e);let a=l().$index,r=l();return Y(r.onCategoryChange(a,i))}),c()}if(t&2){let e=l().$implicit,n=l();s("disabled",!e.selected||e.selected&&e.type==n.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Pe(t,o){if(t&1){let e=H();m(0,"shopee-attribute-form",27),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function Ne(t,o){if(t&1){let e=H();m(0,"tiktok-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Oe(t,o){if(t&1){let e=H();m(0,"wooocommerce-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function ke(t,o){if(t&1){let e=H();m(0,"tokopedia-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function we(t,o){if(t&1&&(m(0,"div",20)(1,"div",24),h(2,Pe,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Oe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),c()()),t&2){let e,n=l().$implicit,i=l();p(2),b((e=n.type)===i.channelType.Shopee?2:e===i.channelType.Tiktok?3:e===i.channelType.WooCommerce?4:e===i.channelType.Tokopedia?5:-1)}}function Me(t,o){if(t&1){let e=H();m(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),A("attributesChanges",function(i){W(e);let a=l().$index,r=l();return Y(r.onAttributesChange(a,i))}),c()()()}if(t&2){let e=l().$implicit;p(2),s("channelId",e.id)}}function Ue(t,o){if(t&1&&(m(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Fe,2,1,"ng-container",14),v(7,"async"),c(),m(8,"div"),_(9,"app-channel-logo",15),c(),m(10,"div",16)(11,"span"),f(12),c()()()(),m(13,"div",12)(14,"div",17),h(15,Ae,2,0,"div",18)(16,Ee,1,4,"app-channel-category-select",19),c()()(),h(17,we,6,1,"div",20)(18,Me,3,1,"div",20),c()()),t&2){let e=o.$implicit,n=l();p(6),s("ngIf",y(7,8,n.defaultCategories$)),p(3),s("typeId",e.type)("showChannelName",!1),p(),s("matTooltip",e.name)("matTooltipShowDelay",2500),p(2),rt(e.name),p(3),b(e.type==n.channelType.Shopify?15:16),p(2),b(e.categoryId&&n.channelType.Lazada!=e.type&&e.selected?17:n.channelType.Shopify==e.type&&e.selected?18:-1)}}var io=(()=>{let o=class o{constructor(){this.uploadProductService=u(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ut,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(tt(1))}onCategoryChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.categoryId=i,r.attributes=[]),r)))}onAttributesChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.attributes=i),r)))}onSelectChannel(n,i,a){this.channelProductUploads.update(r=>r.map((d,C)=>{if(C==i&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);d.categoryId=_t?.DefaultCategoryID}return C==i&&!n.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(n,i){return i.find(a=>a.ID===n)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["app-product-upload"]],standalone:!0,features:[S([mt,Gt,jt,pt]),I],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,a){if(i&1&&(m(0,"mainpanel",0)(1,"actions")(2,"button",1),A("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),c()(),m(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),c(),m(9,"div",5),M(10,Te,2,7,"div",6,w),v(12,"async"),c(),m(13,"h3",7),f(14,"Channel To Upload"),c(),M(15,Ue,19,10,"div",8,w),c()()()),i&2){let r;s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),U(y(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[F,$,T,Ht,Lt,$t,Jt,Xt,Rt,Bt,et,L,Nt,Dt,Vt,Zt,Kt,te,ee,ie,Wt,qt],encapsulation:2});let t=o;return t})();export{io as ProductUploadComponent};
1
+ import{a as zt,b as Qt}from"./chunk-P5VJV3CP.js";import"./chunk-ZRW4OZGG.js";import{b as qt}from"./chunk-5SIWWKAE.js";import{b as Ht}from"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import{a as Xt,b as Jt}from"./chunk-O4N2CCVN.js";import{a as Bt,b as Rt}from"./chunk-4NXO2JYR.js";import{a as mt,b as Gt,c as jt,d as pt,e as st}from"./chunk-IVBW553S.js";import"./chunk-PCKZD4LZ.js";import"./chunk-RQCGB4NH.js";import{b as Yt}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as Wt}from"./chunk-XSYSCEVJ.js";import"./chunk-UOT5GPQI.js";import"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{d as R,e as G}from"./chunk-7IIB5DLC.js";import"./chunk-IUOWC7K6.js";import{e as it}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{m as $t,n as Lt}from"./chunk-OI3SQ5ZO.js";import{t as Vt,u as Dt}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as lt,e as ct,h as L,i as X,l as gt,m as Nt,n as J,p as z,q as Ot,r as Q,s as kt,t as wt,u as Mt,x as q,y as et,z as B}from"./chunk-JCKUKK6T.js";import{b as Ut,c as g}from"./chunk-KZ2VDCDO.js";import{$ as N,Bc as T,F as Tt,Fc as F,H as Ft,Ja as p,Jb as f,Kb as rt,Lb as Z,Nb as At,Ob as Et,Pb as Pt,Q as tt,Qb as S,Rb as I,Sb as at,X as P,_a as h,ab as s,ac as v,bc as y,da as u,ga as x,hb as b,ib as w,kb as M,lb as U,mb as m,na as O,nb as c,oa as W,ob as _,pa as Y,pb as V,q as E,qb as D,sb as H,vb as A,xa as ht,xb as l,yc as $,za as k}from"./chunk-QNL3BTRG.js";import"./chunk-GNOSNGXM.js";var K=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(K||{});var nt=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(nt||{});var Ct=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(mt),this.formBuilder=u(q)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(E(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(n=[]){let i,a;return n=n.map(r=>(i=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(C=>C.language=="id"),d.name=a?.value,d)),r.name=i?.value?i?.value:r.name,r)),n}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{if(a=[],r.mandatory&&a.push(ct.required),r?.attribute_info?.format_type==nt.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==K.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new gt(null),value:new gt(null,a)});i.addControl(JSON.stringify(r.attribute_id),d)}else i.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>{switch(r.attribute_info.input_type){case K.MULTI_COMBO_BOX:g.IsNotEmpty(i[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(d=>i[r.attribute_id]?.findIndex(C=>C==d.value_id)!=-1):r.attribute_value_list=[];break;case K.FREE_TEXT_FILED:r.attribute_info.format_type==nt.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(i[r.attribute_id]?.value,i[r.attribute_id]?.unit):g.IsNotEmpty(i[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:i[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==i[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,i){let a=[];return g.IsNotEmpty(n)&&(a=[{value_id:0,original_value_name:JSON.stringify(n),value_unit:i}]),a}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var bt=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(bt||{});var vt=()=>[];function ne(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function oe(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:at(4,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function re(t,o){if(t&1&&_(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ae(t,o){if(t&1&&(m(0,"option",15),f(1),c()),t&2){let e=o.$implicit;s("value",e),p(),rt(e)}}function le(t,o){if(t&1&&(m(0,"div",10),_(1,"input",12),m(2,"select",13)(3,"option",14),f(4,"Unit"),c(),M(5,ae,2,2,"option",15,w),c()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),p(),s("placeholder","Isi "+(e==null?null:e.name)),p(2),s("value",null),p(2),U(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function ce(t,o){if(t&1&&_(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function me(t,o){if(t&1&&h(0,le,7,3,"div",10)(1,ce,1,2,"input",11),t&2){let e=l(2).$implicit,n=l(2);b((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,o){if(t&1&&_(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function se(t,o){if(t&1&&h(0,re,1,2,"input",8)(1,me,2,1)(2,pe,1,1,"datepicker",9),t&2){let e,n=l().$implicit,i=l(2);b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===i.validationType.VALIDATOR_STRING_TYPE?0:e===i.validationType.VALIDATOR_FLOAT_TYPE?1:e===i.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function de(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:at(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function ue(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:at(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function _e(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,ne,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,oe,1,5,"ng-select",6)(6,se,3,1)(7,de,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),c()),t&2){let e,n=o.$implicit,i=l(2);p(2),b(n.mandatory?2:-1),p(2),Z(" ",n==null?null:n.name," "),p(),b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===i.inputType.MULTI_COMBO_BOX?5:e===i.inputType.FREE_TEXT_FILED?6:e===i.inputType.SINGLE_COMBO_BOX?7:8)}}function fe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,_e,9,3,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Zt=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ct),this.attributesChanges=new k,this.inputType=K,this.formatType=nt,this.validationType=bt}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Ct]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,a){i&1&&(h(0,fe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,G,R,B,J,wt,Mt,lt,kt,L,X,z,Q,Ot,Yt,Qt,zt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let t=o;return t})();var yt=(()=>{let o=class o{constructor(){this.httpService=u(it),this.formBuilder=u(q),this.uploadProductService=u(st)}getAttributes(n,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(Tt(r=>this.uploadProductService.selectedProduct$.pipe(E(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(n,i){let a=0;return n.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(i),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(n){let i=!1,a=[];return n.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),i=a.some(r=>r>1),i}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{a=[],r.is_required&&a.push(ct.required),i.addControl(r.id,this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.id)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>(r.is_multiple_selection?r.values=r.values.filter(d=>i[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==i[r.id]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function he(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function ge(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Ce(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function be(t,o){if(t&1&&(m(0,"small",5),f(1),c()),t&2){let e=l().$implicit;p(),Z(" ",e==null?null:e.name," is mandatory ")}}function ve(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,he,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,ge,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,be,2,1,"small",5),c()),t&2){let e=o.$implicit;p(2),b(e.is_required?2:-1),p(2),Z(" ",e==null?null:e.name," "),p(),b(e.is_multiple_selection?5:6),p(2),b(e.is_required?7:-1)}}function ye(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,ve,8,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Kt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(E(n=>n.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(i.values)||i.values?.length==0)))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([yt]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,ye,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,G,R,B,J,L,X,z,Q,et]});let t=o;return t})();var xt=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(pt)}getAttributes(n,i){return this.woocommerceUploadService.getAttributes(n,i).pipe(E(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var te=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(xt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([xt]),O,I],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,a){i&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),c(),m(4,"ng-select",3),v(5,"async"),A("change",function(d){return a.onSelectAttribute(d)}),c()()()),i&2&&(p(4),s("items",y(5,1,a.attributes$)))},dependencies:[F,T,et,G,R,B]});let t=o;return t})();var St=(()=>{let o=class o{constructor(){this.httpService=u(it),this.formBuilder=u(q)}getAttributes(n,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(E(r=>r))}createFormGroup(n){let i=this.formBuilder.group({});return n.forEach(a=>{i.addControl(a.variant,this.formBuilder.control(null))}),i}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function xe(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),f(2),c(),_(3,"ng-select",5),c()),t&2){let e=o.$implicit;p(2),Z(" ",e==null?null:e.variant," "),p(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Se(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,xe,4,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var ee=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(St),this.attributesChanges=new k}ngOnInit(){}ngOnChanges(n){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(P(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{n=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([St]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,Se,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,G,R,B,J,L,X,z,Q]});let t=o;return t})();var It=(()=>{let o=class o{constructor(){this.httpService=u(it),this.formBuilder=u(q)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(P(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(n){let i=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(r=>{i.addControl(r,this.formBuilder.control(null))}),i}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Ie(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),c(),_(6,"input",5),c(),m(7,"div",6)(8,"div",4),f(9," Product Type "),c(),_(10,"input",7),c(),m(11,"div",6)(12,"div",4),f(13," Status "),c(),_(14,"ng-select",8),c()()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(13),s("items",e.Options.StatusOptions)}}var ie=(()=>{let o=class o{constructor(){this.attributesChanges=new k,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(P(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([It]),O,I],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,a){i&1&&(h(0,Ie,15,2,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,T,B,J,lt,L,X,z,Q,G,R]});let t=o;return t})();function Te(t,o){if(t&1&&(m(0,"div",6),_(1,"app-product-card",9),c()),t&2){let e=o.$implicit;p(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Fe(t,o){if(t&1){let e=H();V(0),m(1,"mat-checkbox",21),Pt("ngModelChange",function(i){W(e);let a=l().$implicit;return Et(a.selected,i)||(a.selected=i),Y(i)}),A("ngModelChange",function(){let i=W(e).ngIf,a=l(),r=a.$implicit,d=a.$index,C=l();return Y(C.onSelectChannel(r,d,i))}),c(),D()}if(t&2){let e=l().$implicit;p(),At("ngModel",e.selected)}}function Ae(t,o){t&1&&(m(0,"div",18),_(1,"input",22),c())}function Ee(t,o){if(t&1){let e=H();m(0,"app-channel-category-select",23),A("selectedCategory",function(i){W(e);let a=l().$index,r=l();return Y(r.onCategoryChange(a,i))}),c()}if(t&2){let e=l().$implicit,n=l();s("disabled",!e.selected||e.selected&&e.type==n.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Pe(t,o){if(t&1){let e=H();m(0,"shopee-attribute-form",27),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function Ne(t,o){if(t&1){let e=H();m(0,"tiktok-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Oe(t,o){if(t&1){let e=H();m(0,"wooocommerce-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function ke(t,o){if(t&1){let e=H();m(0,"tokopedia-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function we(t,o){if(t&1&&(m(0,"div",20)(1,"div",24),h(2,Pe,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Oe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),c()()),t&2){let e,n=l().$implicit,i=l();p(2),b((e=n.type)===i.channelType.Shopee?2:e===i.channelType.Tiktok?3:e===i.channelType.WooCommerce?4:e===i.channelType.Tokopedia?5:-1)}}function Me(t,o){if(t&1){let e=H();m(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),A("attributesChanges",function(i){W(e);let a=l().$index,r=l();return Y(r.onAttributesChange(a,i))}),c()()()}if(t&2){let e=l().$implicit;p(2),s("channelId",e.id)}}function Ue(t,o){if(t&1&&(m(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Fe,2,1,"ng-container",14),v(7,"async"),c(),m(8,"div"),_(9,"app-channel-logo",15),c(),m(10,"div",16)(11,"span"),f(12),c()()()(),m(13,"div",12)(14,"div",17),h(15,Ae,2,0,"div",18)(16,Ee,1,4,"app-channel-category-select",19),c()()(),h(17,we,6,1,"div",20)(18,Me,3,1,"div",20),c()()),t&2){let e=o.$implicit,n=l();p(6),s("ngIf",y(7,8,n.defaultCategories$)),p(3),s("typeId",e.type)("showChannelName",!1),p(),s("matTooltip",e.name)("matTooltipShowDelay",2500),p(2),rt(e.name),p(3),b(e.type==n.channelType.Shopify?15:16),p(2),b(e.categoryId&&n.channelType.Lazada!=e.type&&e.selected?17:n.channelType.Shopify==e.type&&e.selected?18:-1)}}var io=(()=>{let o=class o{constructor(){this.uploadProductService=u(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ut,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(tt(1))}onCategoryChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.categoryId=i,r.attributes=[]),r)))}onAttributesChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.attributes=i),r)))}onSelectChannel(n,i,a){this.channelProductUploads.update(r=>r.map((d,C)=>{if(C==i&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);d.categoryId=_t?.DefaultCategoryID}return C==i&&!n.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(n,i){return i.find(a=>a.ID===n)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["app-product-upload"]],standalone:!0,features:[S([mt,Gt,jt,pt]),I],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,a){if(i&1&&(m(0,"mainpanel",0)(1,"actions")(2,"button",1),A("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),c()(),m(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),c(),m(9,"div",5),M(10,Te,2,7,"div",6,w),v(12,"async"),c(),m(13,"h3",7),f(14,"Channel To Upload"),c(),M(15,Ue,19,10,"div",8,w),c()()()),i&2){let r;s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),U(y(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[F,$,T,Ht,Lt,$t,Jt,Xt,Rt,Bt,et,L,Nt,Dt,Vt,Zt,Kt,te,ee,ie,Wt,qt],encapsulation:2});let t=o;return t})();export{io as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as he}from"./chunk-KJ4SL5OX.js";import"./chunk-ZSZQPMV2.js";import{a as ce}from"./chunk-CPTEKJRI.js";import{a as se}from"./chunk-LIPM3QTO.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-EXBAGUW2.js";import"./chunk-BVIRHZTZ.js";import"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import"./chunk-O4N2CCVN.js";import{a as le}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{i as M}from"./chunk-Q6WJB65B.js";import{b as te,e as ne}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-OI3SQ5ZO.js";import"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-JCKUKK6T.js";import{c as D}from"./chunk-KZ2VDCDO.js";import{$ as j,B,Bc as J,Fc as K,Ja as h,Jb as _,Ka as m,Nb as L,Ob as T,Pb as E,Qb as z,Rb as $,Va as w,X as k,_a as I,ab as d,ac as v,bc as y,da as S,ga as A,mb as c,nb as p,oa as b,ob as U,pa as P,pb as G,qb as W,rb as H,sb as N,vb as C,xb as g,yc as Q}from"./chunk-QNL3BTRG.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"600px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
1
+ import{a as he}from"./chunk-KJ4SL5OX.js";import"./chunk-ZSZQPMV2.js";import{a as ce}from"./chunk-7ZG4RVRM.js";import{a as se}from"./chunk-LIPM3QTO.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-EXBAGUW2.js";import"./chunk-BVIRHZTZ.js";import"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import"./chunk-O4N2CCVN.js";import{a as le}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{i as M}from"./chunk-IUOWC7K6.js";import{b as te,e as ne}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-OI3SQ5ZO.js";import"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-JCKUKK6T.js";import{c as D}from"./chunk-KZ2VDCDO.js";import{$ as j,B,Bc as J,Fc as K,Ja as h,Jb as _,Ka as m,Nb as L,Ob as T,Pb as E,Qb as z,Rb as $,Va as w,X as k,_a as I,ab as d,ac as v,bc as y,da as S,ga as A,mb as c,nb as p,oa as b,ob as U,pa as P,pb as G,qb as W,rb as H,sb as N,vb as C,xb as g,yc as Q}from"./chunk-QNL3BTRG.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"600px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};