marketplacepos 6.40.3 → 6.40.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/Marketplace/{chunk-3LOH5KGZ.js → chunk-3QRDWKQV.js} +1 -1
  2. package/Marketplace/chunk-3ZDCWKY2.js +1 -0
  3. package/Marketplace/{chunk-ZP7UHH6K.js → chunk-44KGK2M2.js} +1 -1
  4. package/Marketplace/{chunk-UYKURPIN.js → chunk-4UBAIPWP.js} +1 -1
  5. package/Marketplace/{chunk-B23HXA44.js → chunk-54JFSMYB.js} +1 -1
  6. package/Marketplace/{chunk-HMEYWPET.js → chunk-5JEFCK7E.js} +1 -1
  7. package/Marketplace/{chunk-SIRLG5JS.js → chunk-5QGLAWLG.js} +1 -1
  8. package/Marketplace/{chunk-BHV3WNGU.js → chunk-5QVO5G65.js} +1 -1
  9. package/Marketplace/{chunk-ZDTPTY6Y.js → chunk-5YQPG5GC.js} +1 -1
  10. package/Marketplace/{chunk-OQVRPQNT.js → chunk-6EB35E3V.js} +1 -1
  11. package/Marketplace/{chunk-4B3WJSEV.js → chunk-6OBHYVWL.js} +1 -1
  12. package/Marketplace/{chunk-NVFDCME2.js → chunk-6Z77GYRF.js} +1 -1
  13. package/Marketplace/{chunk-CVLH5ITF.js → chunk-7WHSPXV4.js} +1 -1
  14. package/Marketplace/{chunk-I4DMM2GA.js → chunk-AMOZNCKA.js} +1 -1
  15. package/Marketplace/chunk-ARNZCJO2.js +279 -0
  16. package/Marketplace/{chunk-L4NODYLI.js → chunk-ASAZTN3F.js} +1 -1
  17. package/Marketplace/{chunk-SBU2S3NF.js → chunk-AU5MQHG5.js} +1 -1
  18. package/Marketplace/{chunk-AUUMJDHO.js → chunk-BPSXTEWR.js} +1 -1
  19. package/Marketplace/{chunk-76KUZPVN.js → chunk-BXLTUUZK.js} +1 -1
  20. package/Marketplace/{chunk-CG6RBDBY.js → chunk-CG2TLBGT.js} +1 -1
  21. package/Marketplace/{chunk-EXAKI6AZ.js → chunk-D7ZZBTGD.js} +2 -2
  22. package/Marketplace/{chunk-YSBYFJIN.js → chunk-DF476PQL.js} +1 -1
  23. package/Marketplace/{chunk-7ESO7UQ7.js → chunk-DLGIUDST.js} +1 -1
  24. package/Marketplace/{chunk-DXA7DKSR.js → chunk-EBQYZD7X.js} +1 -1
  25. package/Marketplace/{chunk-S5JU3KZ7.js → chunk-ES3KODDZ.js} +1 -1
  26. package/Marketplace/{chunk-24SW3YEI.js → chunk-F6VRJLCS.js} +1 -1
  27. package/Marketplace/{chunk-2XSHDDPR.js → chunk-FD4MMIXT.js} +1 -1
  28. package/Marketplace/{chunk-PHE4QRUC.js → chunk-FF35P4YU.js} +1 -1
  29. package/Marketplace/chunk-FGAZE5GC.js +1 -0
  30. package/Marketplace/{chunk-4AS2XNXT.js → chunk-FU7FM5WV.js} +1 -1
  31. package/Marketplace/{chunk-WM4MVHSL.js → chunk-FVLOQT2O.js} +1 -1
  32. package/Marketplace/{chunk-WUNWEZOW.js → chunk-G3PKFZ5W.js} +1 -1
  33. package/Marketplace/chunk-GNVJVMMI.js +1 -0
  34. package/Marketplace/{chunk-CRCOWD4O.js → chunk-HDLV53M5.js} +1 -1
  35. package/Marketplace/{chunk-6S6YYCUI.js → chunk-HNDBTZPW.js} +1 -1
  36. package/Marketplace/{chunk-H6KKQB4S.js → chunk-HZALHTCP.js} +1 -1
  37. package/Marketplace/{chunk-RGJY6HFO.js → chunk-ISAGLJYX.js} +1 -1
  38. package/Marketplace/{chunk-KXEHK3MB.js → chunk-K74P4PZC.js} +1 -1
  39. package/Marketplace/{chunk-6O4AIKY4.js → chunk-KKF7UJFK.js} +1 -1
  40. package/Marketplace/{chunk-3PHI6CX3.js → chunk-LBMITZJU.js} +1 -1
  41. package/Marketplace/{chunk-3NDTATAF.js → chunk-LD4YBZ2V.js} +1 -1
  42. package/Marketplace/{chunk-BQO5O3U7.js → chunk-LF2NPU6J.js} +1 -1
  43. package/Marketplace/{chunk-7D3XPYCI.js → chunk-LT73Z4NM.js} +1 -1
  44. package/Marketplace/{chunk-HETRXWY4.js → chunk-LVETDZW5.js} +1 -1
  45. package/Marketplace/{chunk-MGIEBZGR.js → chunk-NYNATWL7.js} +1 -1
  46. package/Marketplace/{chunk-X2N2RZJG.js → chunk-OMD4X7V6.js} +1 -1
  47. package/Marketplace/{chunk-EZ7EVZMN.js → chunk-ONPJ35PU.js} +1 -1
  48. package/Marketplace/{chunk-FECZRA3W.js → chunk-OTKBK673.js} +1 -1
  49. package/Marketplace/{chunk-QNZIV2ZR.js → chunk-OVQATI6V.js} +1 -1
  50. package/Marketplace/{chunk-R7T4RHGT.js → chunk-PBUPTPGZ.js} +1 -1
  51. package/Marketplace/chunk-QA64OO3Q.js +3 -0
  52. package/Marketplace/{chunk-MD4EAOUZ.js → chunk-QPCTJKN6.js} +1 -1
  53. package/Marketplace/{chunk-VPDQWGTE.js → chunk-QSDLQREY.js} +1 -1
  54. package/Marketplace/{chunk-NQWKWVWW.js → chunk-R2IZXW7V.js} +1 -1
  55. package/Marketplace/{chunk-2LAMUGLH.js → chunk-S3AVAVH4.js} +1 -1
  56. package/Marketplace/{chunk-JWHT7LUS.js → chunk-S6QMTTJG.js} +1 -1
  57. package/Marketplace/{chunk-BURCBMNA.js → chunk-S7PB5GHL.js} +1 -1
  58. package/Marketplace/{chunk-KBICIMAX.js → chunk-SM7VIBIA.js} +1 -1
  59. package/Marketplace/{chunk-FUH2CIW6.js → chunk-TQHULGOC.js} +1 -1
  60. package/Marketplace/{chunk-MUY3PTJM.js → chunk-V3I4ENDZ.js} +1 -1
  61. package/Marketplace/{chunk-5GGSP5QE.js → chunk-WUY5JNBR.js} +1 -1
  62. package/Marketplace/{chunk-KUWYSSJD.js → chunk-WV4K6WE3.js} +1 -1
  63. package/Marketplace/{chunk-3IS2DQPU.js → chunk-XLLOA4GZ.js} +1 -1
  64. package/Marketplace/{chunk-47G4FBTY.js → chunk-Z2CCLRPA.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-4J4GR4GU.js → main-3ICXYZDP.js} +2 -2
  67. package/package.json +1 -1
  68. package/Marketplace/chunk-4JPEQFRW.js +0 -1
  69. package/Marketplace/chunk-5YRNWUJB.js +0 -1
  70. package/Marketplace/chunk-LMP2KHLR.js +0 -279
  71. package/Marketplace/chunk-TDZOSERR.js +0 -1
  72. package/Marketplace/chunk-Z7IOWYX7.js +0 -3
@@ -1 +1 @@
1
- import{a as pe}from"./chunk-DJ6VZBCD.js";import{a as se}from"./chunk-RLLQHRSD.js";import{a as de}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as le}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as oe,b as ae,d as re}from"./chunk-474G6BPL.js";import{b as ie}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{b as ne,c as T}from"./chunk-KFJBIBDQ.js";import{b as te}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as K}from"./chunk-SBU2S3NF.js";import"./chunk-SIRLG5JS.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as U,h as J,m as Q,o as X,u as Y,v as Z,z as ee}from"./chunk-7HUEGPJN.js";import{e as H}from"./chunk-ZE4OOGMT.js";import{b as $,e as j}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as G}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as P,Aa as g,Da as E,Ea as O,Eb as w,Fc as F,Hc as A,Ic as l,Jc as b,Kc as v,Wc as L,Xb as h,Xc as V,Y as M,Zb as _,ac as B,bc as I,cc as p,db as R,dc as n,ec as t,ed as k,fc as S,gb as o,gd as z,ha as f,mc as W,md as q,oa as x,pa as N,rc as m,tc as C,yb as D}from"./chunk-5VYDZBNH.js";import{a as c,b as y}from"./chunk-QWWW7GFA.js";var ge=()=>["/menu/log/order/detail-user"],ue=a=>({ID:a});function ce(a,u){if(a&1&&(n(0,"span",22),S(1,"img",23),t(),l(2)),a&2){let e=u.item;o(),p("src",e.Img,R)("alt",e.Name),o(),v(" ",e.Name," ")}}function he(a,u){a&1&&(n(0,"th")(1,"span",29),l(2," Response Body Warning "),t()())}function _e(a,u){a&1&&(n(0,"th")(1,"span",29),l(2," Number Override "),t()())}function Ce(a,u){if(a&1&&(n(0,"td",26)(1,"span",31),l(2),t()()),a&2){let e=C().$implicit;o(),F("bg-warning",e.responseBodyWarning!=null),o(),b(e.responseBodyWarning)}}function fe(a,u){if(a&1&&(n(0,"td"),l(1),t()),a&2){let e=C().$implicit;o(),v(" ",e.ResponseBodyWarningReference," ")}}function be(a,u){if(a&1&&(n(0,"tr")(1,"td")(2,"a",30),l(3),k(4,"date"),t()(),n(5,"td"),l(6),t(),n(7,"td"),l(8),t(),n(9,"td"),l(10),t(),n(11,"td",26)(12,"span",31),l(13),t()(),h(14,Ce,3,3,"td",26),h(15,fe,2,1,"td"),t()),a&2){let e=u.$implicit,d=C(2);o(2),p("routerLink",L(14,ge))("queryParams",V(15,ue,e.ID)),o(),v(" ",z(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),o(3),b(e.ChannelName),o(2),b(e.POSActionTypeString),o(2),b(e.Number),o(2),A(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),o(),v(" ",e.ResponseCode," "),o(),_(d.responseBodyWarningVisible()?14:-1),o(),_(d.responseBodyWarningVisible()?15:-1)}}function ve(a,u){if(a&1){let e=W();n(0,"div",20)(1,"table",24)(2,"thead")(3,"tr",25)(4,"th"),l(5,"Date"),t(),n(6,"th"),l(7,"Channel"),t(),n(8,"th"),l(9,"Actions"),t(),n(10,"th"),l(11,"Number"),t(),n(12,"th",26)(13,"span",27),l(14," Response Code "),t()(),h(15,he,3,0,"th"),h(16,_e,3,0,"th"),t()(),n(17,"tbody"),B(18,be,16,17,"tr",null,P),t()(),n(20,"mat-paginator",28),m("page",function(i){x(e);let r=C();return N(r.changePage(i))}),t()()}if(a&2){let e=C();o(15),_(e.responseBodyWarningVisible()?15:-1),o(),_(e.responseBodyWarningVisible()?16:-1),o(2),I(e.Result()),o(2),p("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function ye(a,u){a&1&&(n(0,"div",21),S(1,"app-empty-state"),t())}var qe=(()=>{class a{constructor(){this.http=f(H),this._RawLogService=f(pe),this.route=f($),this.authService=f(K),this.queryParams=ne(this.route.queryParams,{initialValue:{}}),this.responseCode=q(()=>this.queryParams()?.responseCode),this.Result=g([]),this.filter=g({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""}),this.paginationTotal=g(0),this.paginationPageSize=g(0),this.Number=g(null),this.channelOptions=g(this.authService.getChannels()),this.ActionTypeList=g(null),this.responseBodyWarningVisible=g(!1),this.loader=T({params:()=>this.queryParams(),stream:({params:e})=>this.http.post("/api/OrdersLoader/Get",this.responseCode()!==void 0?e:{})}),this.reloadToken=g(0),this.resource=T({params:()=>this.reloadToken(),stream:()=>{let e=c(c({},this.filter()),this.responseCode()!==void 0?{responseCode:this.responseCode()}:{});return this.http.post("/api/Orders/Get",e).pipe(M(d=>{this._RawLogService.Data=d.hits;let i=[];for(let r of d.hits){r._source.log.responseBodyWarning!=null&&this.responseBodyWarningVisible.set(!0);let s={ID:r._id,Created:r._source["@timestamp_received"],shopId:r._source.shopId,MarketTypeString:r._source.log.type,ChannelName:r._source?.channelId!=null?this.channelOptions().find(me=>me.ID===r._source?.channelId)?.Name:"",POSActionTypeString:r._source.message,Number:r._source.log.number,ResponseCode:r._source.log.responseCode,responseBodyWarning:r._source.log.responseBodyWarning,ResponseBodyWarningReference:r._source.log.ResponseBodyWarningReference};i.push(s)}this.Result.set(i),this.paginationTotal.set(d.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)}))}}),E(()=>{let e=this.loader.value();e&&(this.filter.update(d=>c(c({},d),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),O(()=>this.Get()))})}Get(e){this.filter.update(d=>y(c({},d),{Number:e})),this.reloadToken.update(d=>d+1)}changePage(e){this.filter.update(d=>y(c({},d),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,d){this.filter.update(i=>y(c({},i),{[e]:d}))}static{this.\u0275fac=function(d){return new(d||a)}}static{this.\u0275cmp=D({type:a,selectors:[["app-order"]],decls:42,vars:14,consts:[["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"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],[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"]],template:function(d,i){if(d&1&&(n(0,"mainpanel",0),m("textChange",function(s){return i.Number.set(s)})("onSubmit",function(s){return i.Get(s)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),t(),n(5,"ng-select",2),m("ngModelChange",function(s){return i.updateFilter("ChannelID",s)}),w(6,ce,3,3,"ng-template",3),t()(),n(7,"div",4)(8,"label",1),l(9,"Action"),t(),n(10,"ng-select",5),m("ngModelChange",function(s){return i.updateFilter("ActionType",s)}),t()(),n(11,"div",4)(12,"label",6),l(13,"From/To"),t(),n(14,"div",7)(15,"datepicker",8),m("dateChange",function(s){return i.updateFilter("From",s)}),t()(),n(16,"div")(17,"datepicker",9),m("dateChange",function(s){return i.updateFilter("To",s)}),t()()(),n(18,"div",4)(19,"label",10),l(20,"Response Code"),t(),n(21,"input",11),m("ngModelChange",function(s){return i.updateFilter("StatusCode",s)}),t()(),n(22,"div",4)(23,"label",10),l(24,"Response Body Warning"),t(),n(25,"input",12),m("ngModelChange",function(s){return i.updateFilter("responseBodyWarning",s)}),t(),n(26,"datalist",13),S(27,"option",14),t()(),n(28,"div",4)(29,"label",10),l(30,"Page Number"),t(),n(31,"input",15),m("ngModelChange",function(s){return i.updateFilter("PageNumber",s)}),t()(),n(32,"div",4)(33,"label",10),l(34,"Page Size"),t(),n(35,"input",16),m("ngModelChange",function(s){return i.updateFilter("RowCount",s)}),t()()(),n(36,"content")(37,"div",17)(38,"div",18)(39,"div",19),h(40,ve,21,5,"div",20)(41,ye,2,0,"div",21),t()()()()()),d&2){let r;p("text",i.Number()),o(5),p("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),o(5),p("clearable",!0)("items",i.ActionTypeList())("ngModel",i.filter().ActionType),o(5),p("date",i.filter().From),o(2),p("date",i.filter().To),o(4),p("ngModel",i.filter().StatusCode),o(4),p("ngModel",i.filter().responseBodyWarning),o(6),p("ngModel",i.filter().PageNumber),o(4),p("ngModel",i.filter().RowCount),o(5),_(((r=i.Result())==null?null:r.length)>0?40:41)}},dependencies:[ie,re,ee,Y,Z,U,X,J,Q,oe,ae,de,te,j,se,le,G],encapsulation:2,changeDetection:0})}}return a})();export{qe as OrderComponent};
1
+ import{a as pe}from"./chunk-DJ6VZBCD.js";import{a as se}from"./chunk-RLLQHRSD.js";import{a as de}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as le}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as oe,b as ae,d as re}from"./chunk-474G6BPL.js";import{b as ie}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{b as ne,c as T}from"./chunk-KFJBIBDQ.js";import{b as te}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as K}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as U,h as J,m as Q,o as X,u as Y,v as Z,z as ee}from"./chunk-7HUEGPJN.js";import{e as H}from"./chunk-ZE4OOGMT.js";import{b as $,e as j}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as G}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as P,Aa as g,Da as E,Ea as O,Eb as w,Fc as F,Hc as A,Ic as l,Jc as b,Kc as v,Wc as L,Xb as h,Xc as V,Y as M,Zb as _,ac as B,bc as I,cc as p,db as R,dc as n,ec as t,ed as k,fc as S,gb as o,gd as z,ha as f,mc as W,md as q,oa as x,pa as N,rc as m,tc as C,yb as D}from"./chunk-5VYDZBNH.js";import{a as c,b as y}from"./chunk-QWWW7GFA.js";var ge=()=>["/menu/log/order/detail-user"],ue=a=>({ID:a});function ce(a,u){if(a&1&&(n(0,"span",22),S(1,"img",23),t(),l(2)),a&2){let e=u.item;o(),p("src",e.Img,R)("alt",e.Name),o(),v(" ",e.Name," ")}}function he(a,u){a&1&&(n(0,"th")(1,"span",29),l(2," Response Body Warning "),t()())}function _e(a,u){a&1&&(n(0,"th")(1,"span",29),l(2," Number Override "),t()())}function Ce(a,u){if(a&1&&(n(0,"td",26)(1,"span",31),l(2),t()()),a&2){let e=C().$implicit;o(),F("bg-warning",e.responseBodyWarning!=null),o(),b(e.responseBodyWarning)}}function fe(a,u){if(a&1&&(n(0,"td"),l(1),t()),a&2){let e=C().$implicit;o(),v(" ",e.ResponseBodyWarningReference," ")}}function be(a,u){if(a&1&&(n(0,"tr")(1,"td")(2,"a",30),l(3),k(4,"date"),t()(),n(5,"td"),l(6),t(),n(7,"td"),l(8),t(),n(9,"td"),l(10),t(),n(11,"td",26)(12,"span",31),l(13),t()(),h(14,Ce,3,3,"td",26),h(15,fe,2,1,"td"),t()),a&2){let e=u.$implicit,d=C(2);o(2),p("routerLink",L(14,ge))("queryParams",V(15,ue,e.ID)),o(),v(" ",z(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),o(3),b(e.ChannelName),o(2),b(e.POSActionTypeString),o(2),b(e.Number),o(2),A(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),o(),v(" ",e.ResponseCode," "),o(),_(d.responseBodyWarningVisible()?14:-1),o(),_(d.responseBodyWarningVisible()?15:-1)}}function ve(a,u){if(a&1){let e=W();n(0,"div",20)(1,"table",24)(2,"thead")(3,"tr",25)(4,"th"),l(5,"Date"),t(),n(6,"th"),l(7,"Channel"),t(),n(8,"th"),l(9,"Actions"),t(),n(10,"th"),l(11,"Number"),t(),n(12,"th",26)(13,"span",27),l(14," Response Code "),t()(),h(15,he,3,0,"th"),h(16,_e,3,0,"th"),t()(),n(17,"tbody"),B(18,be,16,17,"tr",null,P),t()(),n(20,"mat-paginator",28),m("page",function(i){x(e);let r=C();return N(r.changePage(i))}),t()()}if(a&2){let e=C();o(15),_(e.responseBodyWarningVisible()?15:-1),o(),_(e.responseBodyWarningVisible()?16:-1),o(2),I(e.Result()),o(2),p("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function ye(a,u){a&1&&(n(0,"div",21),S(1,"app-empty-state"),t())}var qe=(()=>{class a{constructor(){this.http=f(H),this._RawLogService=f(pe),this.route=f($),this.authService=f(K),this.queryParams=ne(this.route.queryParams,{initialValue:{}}),this.responseCode=q(()=>this.queryParams()?.responseCode),this.Result=g([]),this.filter=g({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""}),this.paginationTotal=g(0),this.paginationPageSize=g(0),this.Number=g(null),this.channelOptions=g(this.authService.getChannels()),this.ActionTypeList=g(null),this.responseBodyWarningVisible=g(!1),this.loader=T({params:()=>this.queryParams(),stream:({params:e})=>this.http.post("/api/OrdersLoader/Get",this.responseCode()!==void 0?e:{})}),this.reloadToken=g(0),this.resource=T({params:()=>this.reloadToken(),stream:()=>{let e=c(c({},this.filter()),this.responseCode()!==void 0?{responseCode:this.responseCode()}:{});return this.http.post("/api/Orders/Get",e).pipe(M(d=>{this._RawLogService.Data=d.hits;let i=[];for(let r of d.hits){r._source.log.responseBodyWarning!=null&&this.responseBodyWarningVisible.set(!0);let s={ID:r._id,Created:r._source["@timestamp_received"],shopId:r._source.shopId,MarketTypeString:r._source.log.type,ChannelName:r._source?.channelId!=null?this.channelOptions().find(me=>me.ID===r._source?.channelId)?.Name:"",POSActionTypeString:r._source.message,Number:r._source.log.number,ResponseCode:r._source.log.responseCode,responseBodyWarning:r._source.log.responseBodyWarning,ResponseBodyWarningReference:r._source.log.ResponseBodyWarningReference};i.push(s)}this.Result.set(i),this.paginationTotal.set(d.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)}))}}),E(()=>{let e=this.loader.value();e&&(this.filter.update(d=>c(c({},d),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),O(()=>this.Get()))})}Get(e){this.filter.update(d=>y(c({},d),{Number:e})),this.reloadToken.update(d=>d+1)}changePage(e){this.filter.update(d=>y(c({},d),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,d){this.filter.update(i=>y(c({},i),{[e]:d}))}static{this.\u0275fac=function(d){return new(d||a)}}static{this.\u0275cmp=D({type:a,selectors:[["app-order"]],decls:42,vars:14,consts:[["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"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],[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"]],template:function(d,i){if(d&1&&(n(0,"mainpanel",0),m("textChange",function(s){return i.Number.set(s)})("onSubmit",function(s){return i.Get(s)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),t(),n(5,"ng-select",2),m("ngModelChange",function(s){return i.updateFilter("ChannelID",s)}),w(6,ce,3,3,"ng-template",3),t()(),n(7,"div",4)(8,"label",1),l(9,"Action"),t(),n(10,"ng-select",5),m("ngModelChange",function(s){return i.updateFilter("ActionType",s)}),t()(),n(11,"div",4)(12,"label",6),l(13,"From/To"),t(),n(14,"div",7)(15,"datepicker",8),m("dateChange",function(s){return i.updateFilter("From",s)}),t()(),n(16,"div")(17,"datepicker",9),m("dateChange",function(s){return i.updateFilter("To",s)}),t()()(),n(18,"div",4)(19,"label",10),l(20,"Response Code"),t(),n(21,"input",11),m("ngModelChange",function(s){return i.updateFilter("StatusCode",s)}),t()(),n(22,"div",4)(23,"label",10),l(24,"Response Body Warning"),t(),n(25,"input",12),m("ngModelChange",function(s){return i.updateFilter("responseBodyWarning",s)}),t(),n(26,"datalist",13),S(27,"option",14),t()(),n(28,"div",4)(29,"label",10),l(30,"Page Number"),t(),n(31,"input",15),m("ngModelChange",function(s){return i.updateFilter("PageNumber",s)}),t()(),n(32,"div",4)(33,"label",10),l(34,"Page Size"),t(),n(35,"input",16),m("ngModelChange",function(s){return i.updateFilter("RowCount",s)}),t()()(),n(36,"content")(37,"div",17)(38,"div",18)(39,"div",19),h(40,ve,21,5,"div",20)(41,ye,2,0,"div",21),t()()()()()),d&2){let r;p("text",i.Number()),o(5),p("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),o(5),p("clearable",!0)("items",i.ActionTypeList())("ngModel",i.filter().ActionType),o(5),p("date",i.filter().From),o(2),p("date",i.filter().To),o(4),p("ngModel",i.filter().StatusCode),o(4),p("ngModel",i.filter().responseBodyWarning),o(6),p("ngModel",i.filter().PageNumber),o(4),p("ngModel",i.filter().RowCount),o(5),_(((r=i.Result())==null?null:r.length)>0?40:41)}},dependencies:[ie,re,ee,Y,Z,U,X,J,Q,oe,ae,de,te,j,se,le,G],encapsulation:2,changeDetection:0})}}return a})();export{qe as OrderComponent};
@@ -0,0 +1 @@
1
+ import{a as Ht}from"./chunk-QPCTJKN6.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as Vt}from"./chunk-STIM35MJ.js";import{a as Dt}from"./chunk-7KG3DC5J.js";import{a as Ft}from"./chunk-PGDBJOSL.js";import{c as Et}from"./chunk-NH7UFKXO.js";import{a as Rt}from"./chunk-6YRYXHZS.js";import"./chunk-VYXSV6K4.js";import{a as Nt}from"./chunk-HV46UVNS.js";import"./chunk-REDMZUTI.js";import{a as yt,b as kt}from"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as Tt}from"./chunk-EYHQ2ZKL.js";import{a as It}from"./chunk-6OBHYVWL.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BKR7YPEW.js";import"./chunk-6Z77GYRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as Ot,e as vt}from"./chunk-474G6BPL.js";import{b as wt}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{a as bt,b as Pt,c as Mt,i as xt,j as St}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as R}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as j}from"./chunk-ZSUWHVKX.js";import{f as ht}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as ut}from"./chunk-63X2BBS4.js";import{a as pt,b as dt,c as mt}from"./chunk-MDHMVGYC.js";import{c as P}from"./chunk-NNVT5X6O.js";import{c as gt,h as ft,m as _t,z as Ct}from"./chunk-7HUEGPJN.js";import{b as lt,e as st}from"./chunk-ZE4OOGMT.js";import{b as ct}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{z as at}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as _,C as G,Eb as q,Ec as B,Fc as X,Hc as tt,Ic as p,Jc as W,Kc as A,Mc as N,Nc as I,Oc as D,Pc as K,Qc as et,Rb as H,Rc as V,Wc as nt,Xb as v,Xc as z,Y as $,Zb as y,_b as Y,ac as T,bc as F,cc as C,db as L,dc as o,ec as a,ed as ot,fb as J,fc as M,fd as it,gb as c,ha as b,jc as Z,kc as Q,mc as O,md as rt,oa as d,pa as m,rc as f,tc as h,yb as E}from"./chunk-5VYDZBNH.js";import{a as S,b as w}from"./chunk-QWWW7GFA.js";function At(s,g){if(s&1&&(o(0,"tr",5)(1,"td"),p(2),a(),o(3,"td"),p(4),a()()),s&2){let t=g.$implicit;C("matTooltip",t.duplicateMessage),c(2),W(t==null?null:t.Name),c(),X("bg-gradient-warning",t.isDuplicate),c(),W(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ut=(()=>{class s{constructor(){this.data=b(Pt),this.dialogRef=b(bt),this.config=_(new xt),this.variants=_([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},e=[],i=t.filter(l=>P.IsEmpty(l.ChannelVariationSKU));t.filter(l=>P.IsNotEmpty(l.ChannelVariationSKU)).forEach((l,r,u)=>{n[l.ChannelVariationSKU]=u.filter(x=>x.ChannelVariationSKU===l.ChannelVariationSKU)}),Object.keys(n).forEach(l=>{n[l].length>1&&(n[l]=n[l].map((r,u,x)=>{let k=`SKU ${r.ChannelVariationSKU} is duplicated with variant`;return x.forEach((U,Bt)=>{U.Name!==r.Name&&(k+=` ${x.length>2?U.Name+(Bt!==x.length-1?",":""):U.Name}`)}),r.duplicateMessage=k,r.isDuplicate=!0,r})),e.push(...n[l])}),e.push(...i),this.variants.set(e)}initModalConfig(){this.config.update(t=>Object.assign({},t,{title:this.data?.title,hideOk:!0,hideCancel:!0,bodyScrollable:!0}))}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=E({type:s,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"]],template:function(n,e){n&1&&(o(0,"modal-material",0),f("onCancel",function(){return e.dialogRef.close()}),o(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),p(6,"Variant"),a(),o(7,"th",4),p(8,"SKU"),a()()(),o(9,"tbody"),T(10,At,5,5,"tr",5,Y),a()()()()),n&2&&(C("config",e.config()),c(10),F(e.variants()))},dependencies:[St,R],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"],changeDetection:0})}}return s})();var Lt=s=>[s],Kt=()=>[],zt=(s,g)=>g.value,jt=(s,g)=>g.ID;function Gt(s,g){if(s&1){let t=O();o(0,"button",28),f("click",function(){d(t);let e=h(2);return m(e.onDownloadAllProduct("SELECTED"))}),M(1,"i",29),p(2),a()}if(s&2){let t,n=h(2);c(2),A(" Download (",(t=n.productService.selectedProduct(n.products()))==null?null:t.length,") ")}}function $t(s,g){if(s&1&&(Z(0),v(1,Gt,3,1,"button",27),Q()),s&2){let t=h();c(),y(t.productService.hasSelection(t.products())?1:-1)}}function Jt(s,g){if(s&1){let t=O();o(0,"span",30),f("click",function(e){return d(t),m(e.stopPropagation())}),o(1,"span",31),M(2,"img",32),a(),o(3,"span",33)(4,"span",34),p(5,"How does this filter work?"),a(),o(6,"button",35),f("click",function(e){d(t);let i=h();return m(i.closeNumberFilterComparatorHelp(e))}),M(7,"i",36),a()(),o(8,"p",37),p(9," Choose how your search text matches the selected SKU or product name: exact match ("),o(10,"em"),p(11,"Is"),a(),p(12,"), at the beginning ("),o(13,"em"),p(14,"Starts With"),a(),p(15,"), at the end ("),o(16,"em"),p(17,"Ends With"),a(),p(18,"), or anywhere ("),o(19,"em"),p(20,"Contains"),a(),p(21,"). "),a()()}if(s&2){let t=h();B("top",t.numberFilterComparatorHelpPosition().top,"px")("left",t.numberFilterComparatorHelpPosition().left,"px"),c(2),C("src",t.numberFilterComparatorHelpImageUrl,L)}}function qt(s,g){if(s&1){let t=O();o(0,"span",38),f("click",function(e){return d(t),m(e.stopPropagation())}),o(1,"span",31),M(2,"img",39),a(),o(3,"span",33)(4,"span",34),p(5,"What is Marketplace Status?"),a(),o(6,"button",35),f("click",function(e){d(t);let i=h();return m(i.closeMarketplaceStatusHelp(e))}),M(7,"i",36),a()(),o(8,"span",37),p(9,"Marketplace Status shows whether your product is active or inactive on each connected channel."),a()()}if(s&2){let t=h();B("top",t.marketplaceStatusHelpPosition().top,"px")("left",t.marketplaceStatusHelpPosition().left,"px"),c(2),C("src",t.marketplaceStatusHelpImageUrl,L)}}function Yt(s,g){if(s&1){let t=O();o(0,"button",40),f("click",function(){let e=d(t).$implicit,i=h();return m(i.toggleStatus(e.value))}),p(1),a()}if(s&2){let t=g.$implicit,n=h();tt("status-chip "+(n.isStatusSelected(t.value)?t.badge:"status-chip-off")),H("aria-pressed",n.isStatusSelected(t.value)),c(),A(" ",t.label," ")}}function Zt(s,g){if(s&1){let t=O();o(0,"button",41),f("click",function(){d(t);let e=h();return m(e.clearStatusFilter())}),M(1,"i",42),p(2,"Clear "),a()}}function Qt(s,g){if(s&1){let t=O();o(0,"div",24)(1,"app-product-card",43),f("onCheckBoxChange",function(e){let i=d(t).$index,l=h();return m(l.onSelectProduct(e,i))})("onDescEvent",function(){let e=d(t).$index,i=h();return m(i.onShowVariantDetail(e))})("onDownload",function(){let e=d(t).$implicit,i=h();return m(i.onDownloadProduct(e))})("onScan",function(){let e=d(t).$implicit,i=h();return m(i.onScanChannel(e))}),a()()}if(s&2){let t=g.$implicit,n=h();c(),C("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?z(10,Lt,t==null?null:t.Channel):nt(12,Kt))("showCheckBox",n.hasDownloadRole())("scanButton",!0)}}function Xt(s,g){s&1&&(o(0,"div",25),M(1,"app-empty-state"),a())}function te(s,g){if(s&1){let t=O();o(0,"div",26)(1,"div",44)(2,"app-custom-paginator",45),f("total",function(){d(t);let e=h();return m(e.getRowCount())})("next",function(){d(t);let e=h();return m(e.getProducts())})("previous",function(){d(t);let e=h();return m(e.getProducts())}),a()()()}if(s&2){let t,n=h();c(2),C("filter",n.searchFilter())("totaldata",(t=n.products())==null?null:t.length)("paginationTotal",n.rowCount())("hasClicked",n.hasClickRowCount())}}var ze=(()=>{class s{constructor(){this.http=b(st),this.dialog=b(Mt),this.productService=b(It),this.toastrService=b(lt),this.activateRouter=b(ct),this.authService=b(ht),this.placeholderService=b(Et),this.statusOptions=[{value:0,label:"Active",badge:"bg-success"},{value:1,label:"Draft",badge:"bg-warning text-dark"},{value:2,label:"Pending",badge:"bg-info text-dark"},{value:3,label:"Deleted",badge:"bg-danger"},{value:4,label:"Other",badge:"bg-secondary"},{value:5,label:"Unknown",badge:"bg-secondary"}],this.pageTitle=rt(()=>{let t=this.searchFilter()?.ListStatusID??[];if(t.length===0)return"Not in POS (All Status)";let n=this.statusOptions.filter(i=>t.includes(i.value)).map(i=>i.label);return`Not in POS (${n.length>0?n.join(", "):"All Status"})`}),this.permissionService=b(pt),this.channelOptions=_([]),this.searchFilter=_(new Dt),this.products=_([]),this.hasClickRowCount=_(!1),this.rowCount=_(0),this.scanProductRole=j.ProductScan,this.downloadProductRole=j.ProductDownload,this.hasDownloadRole=_(!0),this.searchPlaceholder=_("Search ..."),this.showMarketplaceStatusHelp=_(!1),this.marketplaceStatusHelpPosition=_({top:0,left:0}),this.marketplaceStatusHelpImageUrl="https://imbe.net/media/general/1790742792590-chrome_guoujwnmly.png",this.showNumberFilterComparatorHelp=_(!1),this.numberFilterComparatorHelpPosition=_({top:0,left:0}),this.numberFilterComparatorHelpImageUrl="https://dealpos-media.b-cdn.net/omni/helper/filter-match.svg",this.channelOptions.set(this.authService.getChannels()),this.permissionService.hasPermission(this.downloadProductRole).then(t=>{this.hasDownloadRole.set(t)})}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(P.GuidEMpty)})}initPageLoader(t){this.loader$=this.productService.loader(t).pipe($(n=>{this.searchFilter.set(n.Filter),this.searchFilter.update(e=>w(S({},e),{PageSize:n.Filter.RowCount,ListStatusID:e.ListStatusID??[]})),this.getProducts(),this.initSearchPlaceholder()}))}initSearchPlaceholder(){let t=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(t.SearchType,t.NumberFilterComparator))}isStatusSelected(t){return this.searchFilter()?.ListStatusID?.includes(t)??!1}toggleStatus(t){this.searchFilter.update(n=>{let e=n.ListStatusID?[...n.ListStatusID]:[],i=e.indexOf(t);return i>-1?e.splice(i,1):e.push(t),w(S({},n),{ListStatusID:e})}),this.hasClickRowCount.set(!1),this.getProducts()}clearStatusFilter(){this.searchFilter.update(t=>w(S({},t),{ListStatusID:[]})),this.hasClickRowCount.set(!1),this.getProducts()}getProducts(){let t=this.searchFilter();this.http.post("/api/product/GetProductChannelNotPOS",t).subscribe(n=>{this.products.set(n.Data),this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t=this.channelOptions(),n=this.products().map(e=>{let i=t.find(l=>l.ID==e.ChannelID);return e.Channel=i?JSON.parse(JSON.stringify(i)):null,e.Channel&&(e.Channel.Url=e.Url,e.Channel.StatusID=e.StatusID,e.Channel.StatusName=e.StatusName||this.getStatusNameById(e.StatusID)),e});this.products.set(n)}getStatusNameById(t){let n=this.statusOptions.find(e=>e.value===t);return n?n.label:"Other"}setSkuProduct(){let t=this.products().map(n=>(n?.Variant?.length==0?n.SKU=P.IsNotEmpty(n?.ChannelItemSKU)?n?.ChannelItemSKU:"SKU not assigned":n.SKU=n?.Variant[0]?.ChannelVariationSKU?n?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",n));this.products.set(t)}onSearch(t){this.searchFilter.update(n=>w(S({},n),{text:t})),this.hasClickRowCount.set(!1),this.getProducts(),this.initSearchPlaceholder()}onClearChannelFilter(){this.searchFilter.update(t=>w(S({},t),{ChannelID:P.GuidEMpty}))}onScanAll(){let t=this.searchFilter(),n=this.productService.findChannelById(t.ChannelID,this.channelOptions());this.productService.scanAll(t.ChannelID,t.ScanFull,t.UpdatedProduct,t.Async).subscribe(e=>{t.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(P.GuidEMpty),this.productService.successToastrScanAllProduct(e,n,!t.UpdatedProduct)),this.searchFilter.update(i=>w(S({},i),{ChannelID:P.GuidEMpty}))})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter()));t.ChannelID=P.GuidEMpty,this.dialog.open(Nt,{data:{filter:t,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(G(e=>P.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.update(i=>w(S({},i),{ChannelID:e.ChannelID,UpdatedProduct:e.UpdatedProduct,ScanFull:e.ScanFull,Async:e.Async})),this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products():n=this.productService.selectedProduct(this.products()),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){let e=this.products().map((i,l)=>l===n?w(S({},i),{selected:t}):i);this.products.set(e)}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(P.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products()[t],e=n.Variant;e.length>0&&this.dialog.open(Ut,{data:{title:n.Name,variants:e},width:"30%"})}getRowCount(){let t=this.searchFilter(),n={ChannelID:t.ChannelID,text:t.text,HaveSku:parseInt(t.HaveSku),SearchType:t.SearchType,NumberFilterComparator:t.NumberFilterComparator,ListStatusID:t.ListStatusID};this.http.post(ut.GetNotInPosRowCount,n).subscribe(e=>{this.hasClickRowCount.set(!0),this.rowCount.set(e.Count)})}openMarketplaceStatusHelp(t){t.stopPropagation();let n=t.currentTarget.closest(".help-anchor"),e=n.getBoundingClientRect();this.showMarketplaceStatusHelp.set(!0),this.showNumberFilterComparatorHelp.set(!1),setTimeout(()=>{let l=n.closest(".dialog-filter")?.querySelector(".marketplace-status-help-card");if(!l)return;let r=l.offsetHeight,u=l.offsetWidth,x=e.top+e.height/2-r/2,k=e.right+12;this.marketplaceStatusHelpPosition.set({top:Math.max(8,Math.min(x,window.innerHeight-r-8)),left:Math.max(8,Math.min(k,window.innerWidth-u-8))})})}closeMarketplaceStatusHelp(t){t.stopPropagation(),this.showMarketplaceStatusHelp.set(!1)}openNumberFilterComparatorHelp(t){t.stopPropagation();let n=t.currentTarget.closest(".help-anchor"),e=n.getBoundingClientRect();this.showNumberFilterComparatorHelp.set(!0),this.showMarketplaceStatusHelp.set(!1),setTimeout(()=>{let l=n.closest(".dialog-filter")?.querySelector(".number-filter-comparator-help-card");if(!l)return;let r=l.offsetHeight,u=l.offsetWidth,x=e.top+e.height/2-r/2,k=e.right+12;this.numberFilterComparatorHelpPosition.set({top:Math.max(8,Math.min(x,window.innerHeight-r-8)),left:Math.max(8,Math.min(k,window.innerWidth-u-8))})})}closeNumberFilterComparatorHelp(t){t.stopPropagation(),this.showNumberFilterComparatorHelp.set(!1)}onDocumentClick(t){if(!this.showMarketplaceStatusHelp()&&!this.showNumberFilterComparatorHelp())return;t.target.closest(".help-anchor")||(this.showMarketplaceStatusHelp.set(!1),this.showNumberFilterComparatorHelp.set(!1))}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=E({type:s,selectors:[["app-not-in-pos"]],hostBindings:function(n,e){n&1&&f("click",function(l){return e.onDocumentClick(l)},J)},decls:56,vars:26,consts:[["textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS","filterDialogWidth","625px",3,"onSubmit","headerTitle","searchBoxPlaceHolder"],[4,"ngxPermissionsOnly"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","ngModel"],[1,"filter-item"],[1,"number-filter-comparator-label"],[1,"help-anchor","ms-1"],["type","button","matTooltip","How does Number Filter Comparator work?","matTooltipPosition","above","aria-label","How does Number Filter Comparator work?",1,"help-trigger",3,"click"],["aria-hidden","true",1,"fa-solid","fa-circle-info"],["role","dialog","aria-label","How does Number Filter Comparator work?",1,"number-filter-comparator-help-card",3,"top","left"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["name","haveSKU",1,"form-control","input-filter","d-flex","align-items-center",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"marketplace-status-label"],["type","button","matTooltip","What is Marketplace Status?","matTooltipPosition","above","aria-label","What is Marketplace Status?",1,"help-trigger",3,"click"],["role","dialog","aria-label","What is Marketplace Status",1,"marketplace-status-help-card",3,"top","left"],[1,"status-filter"],["type","button",3,"class"],["type","button",1,"btn","btn-sm","btn-link","text-decoration-none"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],["role","dialog","aria-label","How does Number Filter Comparator work?",1,"number-filter-comparator-help-card",3,"click"],[1,"help-media"],["alt","Number Filter Comparator examples",3,"src"],[1,"help-head"],[1,"help-title"],["type","button","aria-label","Close help",1,"help-close",3,"click"],["aria-hidden","true",1,"fa-solid","fa-xmark"],[1,"help-caption"],["role","dialog","aria-label","What is Marketplace Status",1,"marketplace-status-help-card",3,"click"],["alt","Marketplace Status example",3,"src"],["type","button",3,"click"],["type","button",1,"btn","btn-sm","btn-link","text-decoration-none",3,"click"],["aria-hidden","true",1,"fa-solid","fa-xmark","me-1"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){if(n&1){let i=O();K(0),ot(1,"async"),o(2,"mainpanel",0),f("onSubmit",function(r){return d(i),m(e.onSearch(r))}),o(3,"actions"),q(4,$t,2,1,"ng-container",1),a(),o(5,"filters"),K(6),o(7,"div",2)(8,"div",3)(9,"h6"),p(10,"Channel"),a(),o(11,"app-channel-options-v2",4),D("ngModelChange",function(r){d(i);let u=V(6);return I(u.ChannelID,r)||(u.ChannelID=r),m(r)}),a()(),o(12,"div",5)(13,"h6",6),p(14," Number Filter Comparator "),o(15,"span",7)(16,"button",8),f("click",function(r){return d(i),m(e.openNumberFilterComparatorHelp(r))}),M(17,"i",9),a(),v(18,Jt,22,5,"span",10),a()(),o(19,"ng-select",11),D("ngModelChange",function(r){d(i);let u=V(6);return I(u.NumberFilterComparator,r)||(u.NumberFilterComparator=r),m(r)}),a()(),o(20,"div",5)(21,"h6"),p(22,"Search Type"),a(),o(23,"radio-options",12),D("ngModelChange",function(r){d(i);let u=V(6);return I(u.SearchType,r)||(u.SearchType=r),m(r)}),a()(),o(24,"div",5)(25,"h6"),p(26,"SKU Assigned"),a(),o(27,"mat-radio-group",13),D("ngModelChange",function(r){d(i);let u=V(6);return I(u.HaveSku,r)||(u.HaveSku=r),m(r)}),o(28,"mat-radio-button",14),p(29," All "),a(),o(30,"mat-radio-button",14),p(31," Yes "),a(),o(32,"mat-radio-button",14),p(33," No "),a()()(),o(34,"div",5)(35,"h6"),p(36,"Item ID"),a(),o(37,"input",15),D("ngModelChange",function(r){d(i);let u=V(6);return I(u.Item_id,r)||(u.Item_id=r),m(r)}),a()(),o(38,"div",5)(39,"h6",16),p(40,"Marketplace Status "),o(41,"span",7)(42,"button",17),f("click",function(r){return d(i),m(e.openMarketplaceStatusHelp(r))}),M(43,"i",9),a(),v(44,qt,10,5,"span",18),a()(),o(45,"div",19),T(46,Yt,2,4,"button",20,zt),v(48,Zt,3,0,"button",21),a()()()(),o(49,"content")(50,"div",22)(51,"div",23),T(52,Qt,2,13,"div",24,jt),v(54,Xt,2,0,"div",25),a(),v(55,te,3,4,"div",26),a()()()}if(n&2){let i,l=it(1,21,e.loader$);c(2),C("headerTitle",e.pageTitle())("searchBoxPlaceHolder",e.searchPlaceholder()),c(2),C("ngxPermissionsOnly",z(24,Lt,e.downloadProductRole)),c(2);let r=et(e.searchFilter());c(5),N("ngModel",r.ChannelID),c(5),H("aria-expanded",e.showNumberFilterComparatorHelp()),c(2),y(e.showNumberFilterComparatorHelp()?18:-1),c(),C("items",l==null||l.Options==null?null:l.Options.SearchComparatorTypeOptions)("clearable",!1),N("ngModel",r.NumberFilterComparator),c(4),C("options",l==null||l.Options==null?null:l.Options.SearchSKUOnlyOrSKUNameOptions),N("ngModel",r.SearchType),c(4),N("ngModel",r.HaveSku),c(),C("value",0),c(2),C("value",1),c(2),C("value",2),c(5),N("ngModel",r.Item_id),c(5),H("aria-expanded",e.showMarketplaceStatusHelp()),c(2),y(e.showMarketplaceStatusHelp()?44:-1),c(2),F(e.statusOptions),c(2),y(r.ListStatusID!=null&&r.ListStatusID.length?48:-1),c(4),F(e.products()),c(2),y(e.products().length==0?54:-1),c(),y(((i=e.products())==null?null:i.length)>0?55:-1)}},dependencies:[wt,mt,dt,Ht,Ct,gt,ft,_t,yt,kt,vt,Ot,Rt,Vt,Tt,Ft,R,at],styles:['.badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] mat-radio-group.form-control.input-filter[_ngcontent-%COMP%]{height:40px;min-height:40px;border-color:#ccc;border-radius:4px;font-size:.875rem;box-shadow:none;background:#fff}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select{box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;--p-select-padding-y: 8px;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select:not(.p-disabled):hover{border-color:#ccc}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-select-label{font-size:.875rem!important}.status-filter[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}.status-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.25rem .7rem;font-size:.75rem;font-weight:500;line-height:1.5;border:1px solid transparent;border-radius:999px;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.status-chip-off[_ngcontent-%COMP%]{background-color:#fff;border-color:#ced4da;color:#6c757d}.status-chip-off[_ngcontent-%COMP%]:hover{border-color:#adb5bd;color:#495057}.marketplace-status-label[_ngcontent-%COMP%], .number-filter-comparator-label[_ngcontent-%COMP%]{display:inline-flex!important;align-items:center;white-space:nowrap}.help-anchor[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center}.help-trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:0 1px;border:0;background:transparent;color:#8a97a8;font-size:13px;cursor:pointer;line-height:1;transition:color .15s ease}.help-trigger[_ngcontent-%COMP%]:hover{color:#0d6efd}.help-trigger[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0d6efd;outline-offset:2px;border-radius:50%}.help-trigger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block}.marketplace-status-help-card[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%]{position:fixed;z-index:1060;display:block;width:300px;padding:12px 12px 14px;background:#fff;border:1px solid #e3e8f0;border-radius:18px;box-shadow:0 18px 50px #1018282e;white-space:normal;text-align:left;cursor:default}.marketplace-status-help-card[_ngcontent-%COMP%]:before, .number-filter-comparator-help-card[_ngcontent-%COMP%]:before{content:"";position:absolute;top:50%;left:-7px;margin-top:-7px;width:14px;height:14px;background:#fff;border-left:1px solid #e3e8f0;border-bottom:1px solid #e3e8f0;transform:rotate(45deg);border-bottom-left-radius:3px}.marketplace-status-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%]{display:block;overflow:hidden;border-radius:12px;background:#fdf1cd}.marketplace-status-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:block;width:100%;height:172px;object-fit:cover;border-radius:12px;background:#fdf1cd}.marketplace-status-help-card[_ngcontent-%COMP%] .help-head[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 4px 4px}.marketplace-status-help-card[_ngcontent-%COMP%] .help-title[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-title[_ngcontent-%COMP%]{display:block;color:#1f2430;font-family:Roboto Slab,serif;font-size:15px;font-weight:700;line-height:1.3}.marketplace-status-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;padding:0;border:0;border-radius:50%;background:transparent;color:#8a97a8;font-size:14px;cursor:pointer;line-height:1;transition:background .15s ease,color .15s ease}.marketplace-status-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:hover, .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:hover{background:#eef1f6;color:#1f2430}.marketplace-status-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:focus-visible, .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0d6efd;outline-offset:2px}.marketplace-status-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block}.marketplace-status-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%]{display:block;margin:0 4px;color:#5b6b7f;font-family:Roboto,sans-serif;font-size:13px;font-weight:400;line-height:1.55}.marketplace-status-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:normal;color:#0d6efd;font-weight:700;padding:0 1px}.number-filter-comparator-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{background:#fff}.number-filter-comparator-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain}@media(max-width:576px){.marketplace-status-help-card[_ngcontent-%COMP%], .number-filter-comparator-help-card[_ngcontent-%COMP%]{width:min(260px,70vw)}}'],changeDetection:0})}}return s})();export{ze as NotInPosComponent};
@@ -1 +1 @@
1
- import{a as ie}from"./chunk-DJ6VZBCD.js";import{a as ne}from"./chunk-RLLQHRSD.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{b as K,c as Q}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as B}from"./chunk-SBU2S3NF.js";import"./chunk-SIRLG5JS.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as j,h as q,m as U,o as $,z as J}from"./chunk-7HUEGPJN.js";import{e as G}from"./chunk-ZE4OOGMT.js";import{e as H}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as V}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as D,Aa as s,Da as y,Ea as R,Eb as L,Ic as l,Jc as f,Kc as b,Wc as k,Xb as x,Xc as A,Y as S,Zb as E,ac as P,bc as F,cc as d,db as M,dc as n,ec as i,ed as O,fc as C,gb as r,gd as z,ha as _,mc as I,oa as T,pa as w,rc as g,tc as v,yb as N}from"./chunk-5VYDZBNH.js";import{a as u,b as h}from"./chunk-QWWW7GFA.js";var ae=()=>["/menu/log/rawlog/detail"],oe=o=>({ID:o});function re(o,c){if(o&1&&(n(0,"span",17),C(1,"img",18),i(),l(2)),o&2){let e=c.item;r(),d("src",e.Img,M)("alt",e.Name),r(),b(" ",e.Name," ")}}function le(o,c){if(o&1&&(n(0,"tr")(1,"td")(2,"a",23),l(3),O(4,"date"),i()(),n(5,"td"),l(6),i(),n(7,"td"),l(8),i(),n(9,"td"),l(10),i()()),o&2){let e=c.$implicit;r(2),d("routerLink",k(9,ae))("queryParams",A(10,oe,e.id)),r(),b(" ",z(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),r(3),f(e.type),r(2),f(e.number),r(2),f(e.message)}}function me(o,c){if(o&1){let e=I();n(0,"div",15)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),l(5,"Date"),i(),n(6,"th"),l(7,"Type"),i(),n(8,"th"),l(9,"Number"),i(),n(10,"th"),l(11,"Message"),i()()(),n(12,"tbody"),P(13,le,11,12,"tr",null,D),i()(),n(15,"mat-paginator",22),g("page",function(t){T(e);let m=v();return w(m.changePage(t))}),i()()}if(o&2){let e=v();r(13),F(e.Result()),r(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,c){o&1&&(n(0,"div",16),C(1,"app-empty-state"),i())}var xe=(()=>{class o{constructor(){this.http=_(G),this._RawLogService=_(ie),this.authService=_(B),this.Result=s([]),this.filter=s({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.ActionTypeList=s(null),this.channelOptions=s(this.authService.getChannels()),this.loader=K(this.http.post("/api/OrdersLoader/Get",{}),{initialValue:null}),this.reloadToken=s(0),this.resource=Q({params:()=>this.reloadToken(),stream:()=>this.http.post("api/Orders/GetRawLog",this.filter()).pipe(S(e=>{this._RawLogService.Data=e.hits;let a=[];for(let t of e.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};a.push(m)}this.Result.set(a),this.paginationTotal.set(e.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)}))}),y(()=>{let e=this.loader();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),R(()=>this.Get()))})}Get(e){this.filter.update(a=>h(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}changePage(e){this.filter.update(a=>h(u({},a),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,a){this.filter.update(t=>h(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-raw-log"]],decls:28,vars:9,consts:[["headerTitle","Channel Push 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"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(a,t){if(a&1&&(n(0,"mainpanel",0),g("textChange",function(p){return t.updateFilter("Number",p)})("onSubmit",function(p){return t.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),g("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),L(6,re,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),g("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),g("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),g("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),g("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),x(26,me,16,3,"div",15)(27,pe,2,0,"div",16),i()()()()()),a&2){let m;d("text",t.filter().Number),r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),E(((m=t.Result())==null?null:m.length)>0?26:27)}},dependencies:[W,Z,J,j,$,q,U,X,Y,te,H,ne,ee,V],encapsulation:2,changeDetection:0})}}return o})();export{xe as RawLogComponent};
1
+ import{a as ie}from"./chunk-DJ6VZBCD.js";import{a as ne}from"./chunk-RLLQHRSD.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-QK2JCSM3.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{b as K,c as Q}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as B}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as j,h as q,m as U,o as $,z as J}from"./chunk-7HUEGPJN.js";import{e as G}from"./chunk-ZE4OOGMT.js";import{e as H}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as V}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as D,Aa as s,Da as y,Ea as R,Eb as L,Ic as l,Jc as f,Kc as b,Wc as k,Xb as x,Xc as A,Y as S,Zb as E,ac as P,bc as F,cc as d,db as M,dc as n,ec as i,ed as O,fc as C,gb as r,gd as z,ha as _,mc as I,oa as T,pa as w,rc as g,tc as v,yb as N}from"./chunk-5VYDZBNH.js";import{a as u,b as h}from"./chunk-QWWW7GFA.js";var ae=()=>["/menu/log/rawlog/detail"],oe=o=>({ID:o});function re(o,c){if(o&1&&(n(0,"span",17),C(1,"img",18),i(),l(2)),o&2){let e=c.item;r(),d("src",e.Img,M)("alt",e.Name),r(),b(" ",e.Name," ")}}function le(o,c){if(o&1&&(n(0,"tr")(1,"td")(2,"a",23),l(3),O(4,"date"),i()(),n(5,"td"),l(6),i(),n(7,"td"),l(8),i(),n(9,"td"),l(10),i()()),o&2){let e=c.$implicit;r(2),d("routerLink",k(9,ae))("queryParams",A(10,oe,e.id)),r(),b(" ",z(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),r(3),f(e.type),r(2),f(e.number),r(2),f(e.message)}}function me(o,c){if(o&1){let e=I();n(0,"div",15)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),l(5,"Date"),i(),n(6,"th"),l(7,"Type"),i(),n(8,"th"),l(9,"Number"),i(),n(10,"th"),l(11,"Message"),i()()(),n(12,"tbody"),P(13,le,11,12,"tr",null,D),i()(),n(15,"mat-paginator",22),g("page",function(t){T(e);let m=v();return w(m.changePage(t))}),i()()}if(o&2){let e=v();r(13),F(e.Result()),r(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,c){o&1&&(n(0,"div",16),C(1,"app-empty-state"),i())}var xe=(()=>{class o{constructor(){this.http=_(G),this._RawLogService=_(ie),this.authService=_(B),this.Result=s([]),this.filter=s({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""}),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.ActionTypeList=s(null),this.channelOptions=s(this.authService.getChannels()),this.loader=K(this.http.post("/api/OrdersLoader/Get",{}),{initialValue:null}),this.reloadToken=s(0),this.resource=Q({params:()=>this.reloadToken(),stream:()=>this.http.post("api/Orders/GetRawLog",this.filter()).pipe(S(e=>{this._RawLogService.Data=e.hits;let a=[];for(let t of e.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};a.push(m)}this.Result.set(a),this.paginationTotal.set(e.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)}))}),y(()=>{let e=this.loader();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),R(()=>this.Get()))})}Get(e){this.filter.update(a=>h(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}changePage(e){this.filter.update(a=>h(u({},a),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,a){this.filter.update(t=>h(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-raw-log"]],decls:28,vars:9,consts:[["headerTitle","Channel Push 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"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(a,t){if(a&1&&(n(0,"mainpanel",0),g("textChange",function(p){return t.updateFilter("Number",p)})("onSubmit",function(p){return t.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),g("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),L(6,re,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),g("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),g("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),g("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),g("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),x(26,me,16,3,"div",15)(27,pe,2,0,"div",16),i()()()()()),a&2){let m;d("text",t.filter().Number),r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),E(((m=t.Result())==null?null:m.length)>0?26:27)}},dependencies:[W,Z,J,j,$,q,U,X,Y,te,H,ne,ee,V],encapsulation:2,changeDetection:0})}}return o})();export{xe as RawLogComponent};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-OQVRPQNT.js";import{a as g}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-SBU2S3NF.js";import"./chunk-SIRLG5JS.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-ZE4OOGMT.js";import{c as m}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as r,cc as c,dc as p,ec as i,fc as o,gb as a,yb as l}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var d=(()=>{class n{constructor(){this.channelTabs=r([{Title:"Channel",Url:"/menu/channel/marketplace"},{Title:"POS",Url:"/menu/channel/pos"}])}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=l({type:n,selectors:[["app-channels"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,C){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),i()()(),o(4,"router-outlet")),t&2&&(a(3),c("Tabs",C.channelTabs()))},dependencies:[g,m],styles:[".form-label-group[_ngcontent-%COMP%]{position:relative;margin-bottom:1rem}.form-label-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.form-label-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{width:auto;position:absolute;top:1.125rem;left:.75rem;display:block;margin-bottom:0;line-height:1.5;color:#ccc;pointer-events:none;cursor:text;border:1px solid transparent;border-radius:.25rem;transition:all .1s ease-in-out;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]{padding:.75rem;color:#343434;resize:both;font-size:.875rem;border-radius:.25rem;border-color:#c8d3df}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{top:.9375rem}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:focus ~ label[_ngcontent-%COMP%]{top:1rem;left:.78125rem}.form-label-group[_ngcontent-%COMP%] > ng-select[_ngcontent-%COMP%] .ng-select-container{min-height:3.625rem;border-color:#c8d3df;box-shadow:none}.form-label-group[_ngcontent-%COMP%] > ng-select[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{display:inline-block;top:-.625rem;background-color:#fff;font-size:.75rem!important;color:#9da2a6;padding:0 .25rem;z-index:1002;left:.5rem}.form-label-group.multiple[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-input{padding-left:.25rem!important}.form-label-group.multiple[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-placeholder{top:18px!important}.form-label-group.radio[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;border-radius:.25rem!important;border:solid 1px #c8d3df}.form-label-group.radio[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:.75rem!important;top:-10px!important;padding:0 .25rem;left:.5rem}.form-label-group.empty[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{display:none}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-webkit-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-moz-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:transparent}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:not(:placeholder-shown) ~ label[_ngcontent-%COMP%], .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:not(:placeholder-shown) ~ label[_ngcontent-%COMP%]{background-color:#fff;font-size:.75rem!important;color:#9da2a6;top:-10px!important;padding:0 .25rem;left:.5rem}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:not(:placeholder-shown):focus ~ label[_ngcontent-%COMP%], .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:not(:placeholder-shown):focus ~ label[_ngcontent-%COMP%]{color:#3f8aec}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-placeholder{padding-left:.25rem;color:#ccc!important;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-has-value .ng-value{padding-left:.25rem;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-value-container{overflow:initial!important}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-input{top:auto!important;padding-left:.875rem!important;font-size:.875rem}"],changeDetection:0})}}return n})();var x=[{path:"",component:d,children:[{path:"",redirectTo:"marketplace",pathMatch:"full"},{path:"marketplace",loadComponent(){return import("./chunk-ZDTPTY6Y.js").then(n=>n.MarketplaceComponent)},canActivate:[e],data:{title:"List"}},{path:"marketplace/form",loadComponent(){return import("./chunk-VPDQWGTE.js").then(n=>n.MarketplaceFormComponent)},canActivate:[e],data:{title:"Add new Channel"}},{path:"marketplace/view",loadComponent(){return import("./chunk-B23HXA44.js").then(n=>n.MarketplaceViewComponent)},canActivate:[e],data:{title:"Marketplace View"}},{path:"marketplace/add",loadComponent(){return import("./chunk-S6BN4V23.js").then(n=>n.MarketplaceAddComponent)},canActivate:[e],data:{title:"Marketplace Add"}},{path:"pos",loadComponent(){return import("./chunk-X2N2RZJG.js").then(n=>n.PosComponent)},canActivate:[e],data:{title:"POS"}},{path:"pos/edit",loadComponent(){return import("./chunk-RACXTNDG.js").then(n=>n.EditComponent)},canActivate:[e],data:{title:"POS Edit"}}]}];export{x as routes};
1
+ import{a as e}from"./chunk-6EB35E3V.js";import{a as g}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-ZE4OOGMT.js";import{c as m}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as r,cc as c,dc as p,ec as i,fc as o,gb as a,yb as l}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var d=(()=>{class n{constructor(){this.channelTabs=r([{Title:"Channel",Url:"/menu/channel/marketplace"},{Title:"POS",Url:"/menu/channel/pos"}])}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=l({type:n,selectors:[["app-channels"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,C){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),i()()(),o(4,"router-outlet")),t&2&&(a(3),c("Tabs",C.channelTabs()))},dependencies:[g,m],styles:[".form-label-group[_ngcontent-%COMP%]{position:relative;margin-bottom:1rem}.form-label-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.form-label-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{width:auto;position:absolute;top:1.125rem;left:.75rem;display:block;margin-bottom:0;line-height:1.5;color:#ccc;pointer-events:none;cursor:text;border:1px solid transparent;border-radius:.25rem;transition:all .1s ease-in-out;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]{padding:.75rem;color:#343434;resize:both;font-size:.875rem;border-radius:.25rem;border-color:#c8d3df}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{top:.9375rem}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:focus ~ label[_ngcontent-%COMP%]{top:1rem;left:.78125rem}.form-label-group[_ngcontent-%COMP%] > ng-select[_ngcontent-%COMP%] .ng-select-container{min-height:3.625rem;border-color:#c8d3df;box-shadow:none}.form-label-group[_ngcontent-%COMP%] > ng-select[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{display:inline-block;top:-.625rem;background-color:#fff;font-size:.75rem!important;color:#9da2a6;padding:0 .25rem;z-index:1002;left:.5rem}.form-label-group.multiple[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-input{padding-left:.25rem!important}.form-label-group.multiple[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-placeholder{top:18px!important}.form-label-group.radio[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;border-radius:.25rem!important;border:solid 1px #c8d3df}.form-label-group.radio[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:.75rem!important;top:-10px!important;padding:0 .25rem;left:.5rem}.form-label-group.empty[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{display:none}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-webkit-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-moz-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:transparent}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:not(:placeholder-shown) ~ label[_ngcontent-%COMP%], .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:not(:placeholder-shown) ~ label[_ngcontent-%COMP%]{background-color:#fff;font-size:.75rem!important;color:#9da2a6;top:-10px!important;padding:0 .25rem;left:.5rem}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:not(:placeholder-shown):focus ~ label[_ngcontent-%COMP%], .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:not(:placeholder-shown):focus ~ label[_ngcontent-%COMP%]{color:#3f8aec}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-placeholder{padding-left:.25rem;color:#ccc!important;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-has-value .ng-value{padding-left:.25rem;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-value-container{overflow:initial!important}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-input{top:auto!important;padding-left:.875rem!important;font-size:.875rem}"],changeDetection:0})}}return n})();var x=[{path:"",component:d,children:[{path:"",redirectTo:"marketplace",pathMatch:"full"},{path:"marketplace",loadComponent(){return import("./chunk-5YQPG5GC.js").then(n=>n.MarketplaceComponent)},canActivate:[e],data:{title:"List"}},{path:"marketplace/form",loadComponent(){return import("./chunk-QSDLQREY.js").then(n=>n.MarketplaceFormComponent)},canActivate:[e],data:{title:"Add new Channel"}},{path:"marketplace/view",loadComponent(){return import("./chunk-54JFSMYB.js").then(n=>n.MarketplaceViewComponent)},canActivate:[e],data:{title:"Marketplace View"}},{path:"marketplace/add",loadComponent(){return import("./chunk-S6BN4V23.js").then(n=>n.MarketplaceAddComponent)},canActivate:[e],data:{title:"Marketplace Add"}},{path:"pos",loadComponent(){return import("./chunk-OMD4X7V6.js").then(n=>n.PosComponent)},canActivate:[e],data:{title:"POS"}},{path:"pos/edit",loadComponent(){return import("./chunk-RACXTNDG.js").then(n=>n.EditComponent)},canActivate:[e],data:{title:"POS Edit"}}]}];export{x as routes};
@@ -1,2 +1,2 @@
1
1
  import{a as oe,b as ae,c as ce}from"./chunk-V2OWWU5Z.js";import{a as ze}from"./chunk-YSASI5AU.js";import{a as Re}from"./chunk-4P7DUX6B.js";import{a as ie}from"./chunk-REDMZUTI.js";import{e as Ne}from"./chunk-474G6BPL.js";import{b as Ae}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{a as Pe,b as Oe,c as Le,g as te,i as pe,j as We}from"./chunk-TFTF5VH3.js";import{a as y}from"./chunk-CBPURQKN.js";import{a as N,c as ne}from"./chunk-KFJBIBDQ.js";import{b as x}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as de}from"./chunk-ZSUWHVKX.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as we,c as ke}from"./chunk-MDHMVGYC.js";import{b as S,c as Se}from"./chunk-NNVT5X6O.js";import"./chunk-7HUEGPJN.js";import{b as ee,e as Te}from"./chunk-ZE4OOGMT.js";import{b as Ee,d as De,e as Ie,g as Me}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as H,D as xe,F as ye}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as J,Aa as z,Dc as B,Eb as K,Fc as D,Hc as be,Ic as a,Jc as p,Kc as I,Rb as ge,Sc as Q,Vc as X,Xb as m,Xc as A,Yc as Ce,Zb as s,ac as F,bc as V,cc as f,db as q,dc as n,ec as i,ed as P,fb as ve,fc as b,fd as Z,gb as l,gc as T,gd as W,ha as g,hc as E,id as j,l as U,mc as O,md as re,oa as M,pa as w,qa as he,r as ue,rc as _,rd as _e,sd as C,tc as c,ua as $,yb as v}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var Xe=(e,d)=>d.ID;function Ze(e,d){e&1&&(n(0,"span",10),a(1,"Yes"),i())}function et(e,d){e&1&&(n(0,"span",11),a(1,"No"),i())}function tt(e,d){if(e&1&&(n(0,"span",12),he(),n(1,"svg",13),b(2,"circle",14)(3,"path",15)(4,"line",16),i()()),e&2){let t=c().$implicit,r=c();f("matTooltip",r.getEffectStatusTooltip(t.Effect_Status))}}function nt(e,d){if(e&1&&(n(0,"tr")(1,"td",8),a(2),i(),n(3,"td",8),a(4),i(),n(5,"td",8),a(6),i(),n(7,"td",9),m(8,Ze,2,0,"span",10)(9,et,2,0,"span",11),i(),n(10,"td",8),a(11),m(12,tt,5,1,"span",12),i()()),e&2){let t=d.$implicit,r=d.$index,o=c();l(2),p(r+1),l(2),p(t.Name),l(2),p(t.ID),l(2),s(t.IsDefault?8:9),l(3),I(" ",t.Effect_Status," "),l(),s(o.getEffectStatusTooltip(t.Effect_Status)?12:-1)}}function it(e,d){e&1&&(n(0,"tr")(1,"td",17),a(2,"No warehouse data available"),i()())}var Fe=(()=>{class e{constructor(){this.data=g(Oe),this.dialogRef=g(Pe),this.modalConfig=z(new pe),this.warehouses=z([]),this.warehouses.set(this.data?.warehouses||[])}ngOnInit(){let t=new pe;t.title=this.data?.channelName?`Warehouse List - ${this.data.channelName}`:"Warehouse List",t.hideFooter=!0,t.bodyScrollable=!0,t.customWidth="700px",t.noPadding=!0,this.modalConfig.set(t)}getEffectStatusTooltip(t){return{ENABLED:"All products in stock are available for sale.",DISABLED:"All products in stock are unavailable for sale.",RESTRICTED:"The warehouse is either on 'holiday mode' or 'order limit mode.' All products in stock are unavailable for sale. Holiday mode: When the seller cannot fulfill an order from a warehouse, the seller can turn on holiday mode for the warehouse in seller center. Order limit mode: When the seller violates TikTok Shop policies, TikTok Shop will limit the order volume that can be fulfilled by a warehouse."}[t?.toUpperCase()]||""}close(){this.dialogRef.close()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-modal-warehouse-list"]],decls:19,vars:2,consts:[[3,"onClose","onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead"],[1,"text-start",2,"width","10%"],[1,"text-start",2,"width","40%"],[1,"text-start",2,"width","20%"],[1,"text-center",2,"width","10%"],[1,"text-start"],[1,"text-center"],[1,"badge","bg-success"],[1,"badge","bg-secondary"],["matTooltipPosition","right",1,"ms-1",2,"cursor","help",3,"matTooltip"],["xmlns","http://www.w3.org/2000/svg","width","8","height","8","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["cx","12","cy","12","r","10"],["d","M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"],["x1","12","y1","17","x2","12.01","y2","17"],["colspan","5",1,"text-center"]],template:function(r,o){r&1&&(n(0,"modal-material",0),_("onClose",function(){return o.close()})("onCancel",function(){return o.close()}),n(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),a(6,"No"),i(),n(7,"th",5),a(8,"Warehouse Name"),i(),n(9,"th",6),a(10,"ID"),i(),n(11,"th",7),a(12,"Default"),i(),n(13,"th",6),a(14,"Status"),i()()(),n(15,"tbody"),F(16,nt,13,6,"tr",null,Xe,!1,it,3,0,"tr"),i()()()()),r&2&&(f("config",o.modalConfig()),l(16),V(o.warehouses()))},dependencies:[ye,te,y,x,We],styles:[".table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;z-index:10;background:#fff!important;vertical-align:middle;padding:.75rem}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}"],changeDetection:0})}}return e})();function ot(e,d){if(e&1&&(n(0,"div",3)(1,"div",10)(2,"label"),a(3,"Order Fulfillment Webhook Handling"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().FulfillmentWebhookHandling==0?"Do Nothing":t.data().FulfillmentWebhookHandling==1?"Create Outbound Logistic":"Reserve for Future")}}function at(e,d){if(e&1&&(n(0,"div",3)(1,"div",11)(2,"label"),a(3,"Size Chart"),i(),n(4,"div",12)(5,"a",13),a(6),i()()()()),e&2){let t=c();l(5),f("href",t.data().SizeChart,q),l(),p(t.data().SizeChart)}}function lt(e,d){if(e&1&&(n(0,"div",3)(1,"div",14)(2,"label"),a(3,"ShippingFee"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().ShippingFee)}}function rt(e,d){if(e&1&&(n(0,"div",3)(1,"div",15)(2,"label"),a(3,"Pricebook"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().PricebookName)}}function dt(e,d){if(e&1&&(n(0,"div",3)(1,"div",16)(2,"label"),a(3,"Unpaid Order"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().UnpaidOrder?"YES":"NO")}}function pt(e,d){if(e&1&&(n(0,"div",3)(1,"div",17)(2,"label"),a(3,"Manage Stock"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().ManageStock?"True":"False")}}var Ve=(()=>{class e{constructor(){this.channelService=g(ie),this.dialog=g(Le),this.data=C(void 0),this.channelType=S}onTestWarehouse(){this.data()?.ID&&this.channelService.getWarehouseList(this.data().ID).subscribe({next:t=>{let r=t?.Data||[];this.dialog.open(Fe,{data:{warehouses:r,channelName:this.data()?.Name||""}})}})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-advanced-config-info"]],inputs:{data:[1,"data"]},decls:47,vars:13,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Register where the transaction is recorded in POS",1,"info-label-group"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip","matTooltip",`Please input SKU Product for add Additional products that will be entered automatically in every transaction from the marketplace, Example : Paperbag
2
- `,1,"info-label-group"],["matTooltipPosition","above","matTooltip","Minimal inventory on channel, if product inventory is below minimum inventory will automatically update to 0 ",1,"info-label-group"],["matTooltipPosition","above","matTooltip","WarehouseID is used to determine the warehouse where the location is stored.",1,"info-label-group","w-100","d-flex","justify-content-between"],[1,"btn","btn-outline-success","ms-2","btn-sm",3,"click"],["matTooltipPosition","above","matTooltip","If this configuration is Strikethrough_Price means the discount is crossed out, and if Discount_Amount means the property discount is as before.",1,"info-label-group"],["matTooltipPosition","above","matTooltip","create outbound logistic when webhook sends",1,"info-label-group"],["matTooltip","Image URL for Tokopedia Product Size Chart","matTooltipPosition","above",1,"info-label-group"],[1,"text-break"],["target","_blank",3,"href"],["matTooltipPosition","above","matTooltip","Please input Product SKU to automatically add additional product to record the amount of the shipping fee in order",1,"info-label-group"],[1,"info-label-group"],["matTooltipPosition","above","matTooltip","When this config is turned off, Order is only Synchronize when it has been paid",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Manage stock availability for WooCommerce",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label"),a(6,"Register"),i(),n(7,"div")(8,"span"),a(9),i()()()(),n(10,"div",3)(11,"div",5)(12,"label"),a(13,"Additional Item"),i(),n(14,"div")(15,"span"),a(16),i()()()(),n(17,"div",3)(18,"div",6)(19,"label"),a(20,"Minimum Inventory"),i(),n(21,"div")(22,"span"),a(23),P(24,"number"),i()()()(),m(25,ot,7,1,"div",3),m(26,at,7,2,"div",3),m(27,lt,7,1,"div",3),n(28,"div",3)(29,"div",7)(30,"label"),a(31,"Warehouse ID"),i(),n(32,"div")(33,"span"),a(34),i()(),n(35,"button",8),_("click",function(){return o.onTestWarehouse()}),a(36," GET "),i()()(),m(37,rt,7,1,"div",3),m(38,dt,7,1,"div",3),m(39,pt,7,1,"div",3),n(40,"div",3)(41,"div",9)(42,"label"),a(43,"Product Discount Sync Mode"),i(),n(44,"div")(45,"span"),a(46),i()()()()()()()),r&2&&(l(9),p(o.data().Register),l(7),p(o.data().Additionalitem),l(7),p(Z(24,11,o.data().MinimumInventory)),l(2),s(o.data().TypeID==o.channelType.Shopify?25:-1),l(),s(o.data().TypeID==o.channelType.Tokopedia||o.data().TypeID==o.channelType.Shopee?26:-1),l(),s(o.data().TypeID==o.channelType.WooCommerce?27:-1),l(7),p(o.data().WarehouseID),l(3),s(o.data().PricebookName?37:-1),l(),s(o.data().TypeID!==o.channelType.Tokopedia?38:-1),l(),s(o.data().TypeID==o.channelType.WooCommerce?39:-1),l(7),p(o.data().ProductDiscountSyncModeIDLabel))},dependencies:[y,x,te,xe],encapsulation:2,changeDetection:0})}}return e})();function ct(e,d){if(e&1){let t=O();n(0,"button",10),_("click",function(){M(t);let o=c();return w(o.onUpdateChannelType(o.channel()))}),a(1," Migrate to ShopifyV2 "),i()}}function mt(e,d){if(e&1){let t=O();n(0,"div",4)(1,"div",11)(2,"label"),a(3,"Shop ID"),i(),n(4,"div")(5,"span"),a(6),i()(),n(7,"button",10),_("click",function(){M(t);let o=c();return w(o.onTestChannel(o.channel()))}),a(8," Test "),i()()()}if(e&2){let t=c();l(6),p(t.channel().ShopID!=0?t.channel().ShopID:t.channel().ShopIDString)}}function st(e,d){if(e&1&&(n(0,"div",4)(1,"div",12)(2,"label"),a(3,"Marketplace URL"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.channel().URL)}}var He=(()=>{class e{constructor(){this.channelService=g(ie),this.channel=C.required(),this.channelType=S}onTestChannel(t){this.channelService.testShopID(t).subscribe()}onUpdateChannelType(t){this.channelService.updateChannelType(t).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-marketplace-config-info"]],inputs:{channel:[1,"channel"]},decls:38,vars:10,consts:[[1,"card"],[1,"card-header"],[1,"card-body","mt-8"],[1,"row"],[1,"col-sm-6"],["matTooltipPosition","above","matTooltip","Your shop name in marketplace channel",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Marketplace / Website where your product is Sold / Distributed",1,"info-label-group","w-100","d-flex","justify-content-between"],[1,"btn","btn-outline-success","ms-2","btn-sm"],["matTooltipPosition","above","matTooltip","Last Sync Product",1,"info-label-group"],[1,"info-label-group"],[1,"btn","btn-outline-success","ms-2","btn-sm",3,"click"],["matTooltipPosition","above","matTooltip","Your shop ID",1,"info-label-group","w-100","d-flex","justify-content-between"],["matTooltipPosition","above","matTooltip","Your Marketplace URL",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),a(3,"Marketplace Setup"),i()(),n(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"label"),a(9,"Name"),i(),n(10,"div")(11,"span"),a(12),i()()()(),n(13,"div",4)(14,"div",6)(15,"label"),a(16,"Type"),i(),n(17,"div")(18,"span"),a(19),i()(),m(20,ct,2,0,"button",7),i()(),m(21,mt,9,1,"div",4),m(22,st,7,1,"div",4),n(23,"div",4)(24,"div",8)(25,"label"),a(26,"Product Sync"),i(),n(27,"div")(28,"span"),a(29),P(30,"date"),i()()()(),n(31,"div",4)(32,"div",9)(33,"label"),a(34,"Multiwarehouse"),i(),n(35,"div")(36,"span"),a(37),i()()()()()()()),r&2&&(l(12),p(o.channel().Name),l(7),p(o.channel().TypeString),l(),s(o.channel().TypeID===o.channelType.Shopify?20:-1),l(),s(o.channel().TypeID!=2?21:-1),l(),s(o.channel().TypeID!=o.channelType.Tiktok?22:-1),l(7),p(o.channel().LastSync?W(30,7,o.channel().LastSync,"dd MMM yyyy HH:mm"):"Never"),l(8),p(o.channel().MultiWarehouse?"YES":"NO"))},dependencies:[y,x,H],encapsulation:2,changeDetection:0})}}return e})();var le=(function(e){return e[e.OFF=0]="OFF",e[e.UNFULFILLED=1]="UNFULFILLED",e[e.ALL=2]="ALL",e})(le||{});var Y=(function(e){return e[e.NEVER=0]="NEVER",e[e.UNPAID=1]="UNPAID",e[e.PAID=2]="PAID",e})(Y||{});function ft(e,d){if(e&1&&(n(0,"div",4)(1,"label"),a(2,"Return Order Sync "),n(3,"a",6),b(4,"i",7),i()(),n(5,"div")(6,"span"),a(7),i()()()),e&2){let t=c();l(7),p(t.AutomaticPOSReturn?"YES":"NO")}}function ut(e,d){if(e&1&&(n(0,"div",2)(1,"div",3)(2,"label"),a(3,"New Order Sync"),i(),n(4,"div")(5,"span"),a(6),i()()(),n(7,"div",3)(8,"label"),a(9,"Cancelled Order Sync"),i(),n(10,"div")(11,"span"),a(12),i()()(),m(13,ft,8,1,"div",4),n(14,"div",5)(15,"label"),a(16,"Inventory"),i(),n(17,"div")(18,"span"),a(19),i()()()()),e&2){let t=d,r=c();l(),f("matTooltip",r.orderSyncTooltip[t.NewOrderSyncTypeID]),l(5),p(t.NewOrderSyncTypeIDString),l(),f("matTooltip",r.cancelOrderTooltip[t.CancelledOrderSyncTypeID]),l(5),p(t.CancelledOrderSyncTypeIDString),l(),s(t.TypeID==r.channelType.Shopee?13:-1),l(6),p(t.SyncInventory?"YES":"NO")}}var Ue=(()=>{class e{constructor(){this.channel=C.required(),this.channelType=S,this.orderSyncTooltip={[Y.PAID]:"Sync only paid orders from the channel and create them as Invoices.",[Y.UNPAID]:"Sync unpaid orders from the channel and create them as Sales Orders.",[Y.NEVER]:"Do not automatically sync orders from the channel to DealPOS."},this.cancelOrderTooltip={[le.UNFULFILLED]:" If the order is already fulfilled, the POS invoice will not be voided.",[le.ALL]:"The POS invoice will always be voided, even if the order is fulfilled."}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-sync-config-info"]],inputs:{channel:[1,"channel"]},decls:5,vars:1,consts:[[1,"card"],[1,"card-header"],[1,"card-body","mt-8"],["matTooltipPosition","above",1,"info-label-group",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Sync return/refund order from Shopee and create a return transaction in POS",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Automatically sync your POS inventory to channel inventory",1,"info-label-group"],["href","https://support.dealpos.com/en/articles/16796008-shopee-automatic-return-flow-in-dealpos-omnichannel","target","_blank","rel","noopener","matTooltip","Learn more about Shopee automatic return flow","matTooltipPosition","above","aria-label","Learn more about Return Order Sync",1,"ms-1"],[1,"fa-solid","fa-circle-info"]],template:function(r,o){if(r&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),a(3,"Synchronize"),i()(),m(4,ut,20,6,"div",2),i()),r&2){let h;l(4),s((h=o.channel())?4:-1,h)}},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();var ht=(e,d)=>({"text-success":e,"text-danger":d});function vt(e,d){if(e&1&&(n(0,"div",2)(1,"div",3)(2,"div",4)(3,"label"),a(4,"Consumer Key"),i(),n(5,"div")(6,"span"),a(7),i()()()(),n(8,"div",5)(9,"div",4)(10,"label"),a(11,"Consumer Secret"),i(),n(12,"div")(13,"span"),a(14),i()()()()()),e&2){let t=c();l(7),p(t.data().ConsumerKey),l(7),p(t.data().ConsumerSecret)}}function gt(e,d){if(e&1&&(n(0,"div",3)(1,"div",6)(2,"label"),a(3,"Authorized"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().Authorized?"YES":"NO")}}function bt(e,d){if(e&1&&(n(0,"div",3)(1,"div",7),P(2,"expiredTime"),n(3,"label"),a(4,"Shop Expiration"),i(),n(5,"div")(6,"span"),a(7),P(8,"date"),i()()()()),e&2){let t=c();l(),D("bg-gradient-danger",Z(2,4,t.data().ExpiredTime)),f("matTooltip","The expiry date for "+t.data().Name+" Open API authorization from your account "+t.data().Name+" to Dealpos"),l(6),p(t.data().ExpiredTime?W(8,6,t.data().ExpiredTime,"dd MMM yyyy HH:mm"):"-")}}function Ct(e,d){if(e&1&&(n(0,"div",3)(1,"div",19)(2,"label"),a(3,"Token Issued"),i(),n(4,"div")(5,"span"),a(6),P(7,"date"),i()()()()),e&2){let t=c(2);l(6),p(W(7,1,t.data().TokenIssued,"dd MMM yyyy HH:mm"))}}function _t(e,d){if(e&1){let t=O();n(0,"div",3)(1,"div",4)(2,"label"),a(3,"Refresh Token"),i(),n(4,"div")(5,"span",8),a(6),i()()()(),n(7,"div",3)(8,"div",9)(9,"label"),a(10,"Access Token"),i(),n(11,"div",10)(12,"span",8),a(13),i(),n(14,"span",11)(15,"button",12),_("click",function(){M(t);let o=c();return w(o.onRefreshToken())}),b(16,"i",13),n(17,"span"),a(18,"Refresh"),i()()()()()(),m(19,Ct,8,4,"div",3),n(20,"div",3)(21,"div",7)(22,"label"),a(23,"Access Token Expired"),i(),n(24,"div",14)(25,"div"),a(26),P(27,"date"),i(),n(28,"div",15)(29,"button",16),_("click",function(){M(t);let o=c();return w(o.onAuthorize())}),b(30,"i",17),n(31,"span"),a(32,"Extend"),i()()()()()(),n(33,"div",3)(34,"div",18)(35,"label"),a(36,"Token Log"),i(),n(37,"div")(38,"span"),a(39),i()()()()}if(e&2){let t=c();l(6),p(t.data().RefreshToken),l(7),p(t.data().AccessToken),l(6),s(t.data().TypeID==t.channelType.Shopee?19:-1),l(2),f("matTooltip",t.tokenExpiryMessage),l(4),be(Ce(13,ht,!t.isAccessTokenExpired,t.isAccessTokenExpired)),l(),I(" ",W(27,10,t.data().TokenExpired,"dd MMM yyyy HH:mm")," "),l(2),f("matTooltip",Q(t.data().TypeID==t.channelType.Shopee?"Extend Shopee Authorization Duration for an additional 1 year":"Update Token Expired date")),l(11),p(t.data().TokenLog?"YES":"NO")}}var Be=(()=>{class e{constructor(){this.toastr=g(ee),this.authorizeService=g(ce),this.destroyRef=g($),this.data=C(void 0),this.isAccessTokenExpired=re(()=>this.authorizeService.isExpiredDate(new Date(this.data()?.TokenExpired))),this.isRefreshTokenExpired=re(()=>this.authorizeService.isExpiredDate(new Date(this.data()?.RefreshTokenExpired))),this.channelType=S,this.onSuccessRefrehToken=_e()}get tokenExpiryMessage(){return this.authorizeService.generateTokenExpiryMessage(this.data()?.TypeID)}onAuthorize(){this.authorizeService.authorizedChannel(this.data()?.TypeID).pipe(N(this.destroyRef)).subscribe()}onRefreshToken(){this.authorizeService.onRefreshToken(this.data()?.ID).pipe(N(this.destroyRef)).subscribe(t=>{this.toastr.success("Token refreshed successfully!","Success").onShown.pipe(N(this.destroyRef)).subscribe(()=>this.onSuccessRefrehToken.emit())})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-authorized-config-info"]],inputs:{data:[1,"data"]},outputs:{onSuccessRefrehToken:"onSuccessRefrehToken"},features:[X([ce])],decls:7,vars:4,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],[1,"info-label-group"],[1,"col-6","pe-8"],["matTooltipPosition","above","matTooltip","Channel has been authorized to be managed by omni.dealpos.app",1,"info-label-group"],["matTooltipPosition","above",1,"info-label-group",3,"matTooltip"],[1,"text-wrap","text-break"],["matTooltipPosition","above","matTooltip","When your Shop Authorization has not expired you can try generate a new Access Token",1,"info-label-group"],[1,"d-flex","align-items-center","justify-content-between","w-100","text-wrap","text-break","py-3"],[1,"ms-4","text-end",2,"min-width","86px"],["type","button","matTooltip","Generate new access token",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-2"],[1,"d-flex","align-items-center","justify-content-between","w-100"],["matTooltipClass","unset-max-width-tooltip",3,"matTooltip"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fas","fa-plus-circle","me-2"],["matTooltipPosition","above","matTooltip","Enable for Record log when new token issued",1,"info-label-group"],["matTooltipPosition","above","matTooltip","When a request is made by omni.dealpos.app to get a new access_token from the Channel",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1),m(2,vt,15,2,"div",2),n(3,"div",2),m(4,gt,7,1,"div",3),m(5,bt,9,9,"div",3),m(6,_t,40,16),i()()()),r&2&&(l(2),s(o.channelType.WooCommerce==o.data().TypeID||o.channelType.ShopifyV2==o.data().TypeID||o.channelType.Shopify==o.data().TypeID||o.channelType.Plugo==o.data().TypeID?2:-1),l(2),s(o.channelType.Tokopedia==o.data().TypeID||o.channelType.Shopee==o.data().TypeID||o.channelType.Tiktok==o.data().TypeID||o.channelType.Lazada==o.data().TypeID?4:-1),l(),s(o.data().TypeID==o.channelType.Shopee?5:-1),l(),s(o.data().TypeID==o.channelType.Tiktok||o.data().TypeID==o.channelType.Lazada||o.data().TypeID==o.channelType.Shopee?6:-1))},dependencies:[y,x,ze,H],encapsulation:2,changeDetection:0})}}return e})();function xt(e,d){if(e&1&&(n(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"label"),a(5,"New Order To"),i(),n(6,"div")(7,"span"),a(8),i()()()(),n(9,"div",3)(10,"div",5)(11,"label"),a(12,"Dispatch Orders From"),i(),n(13,"div")(14,"span"),a(15),i()()()()(),n(16,"div",2)(17,"div",6)(18,"div",7)(19,"label"),a(20,"Product Inventory"),i(),n(21,"div")(22,"span"),a(23),i()()()()()()),e&2){let t=d;l(3),D("bg-gradient-warning",!t.POSOutlet&&!t.MultiWarehouse),f("matTooltip",t.MultiWarehouse?"":"Outlet where the transaction is recorded in POS"),l(5),p(t.POSOutlet),l(2),D("bg-gradient-warning",!t.POSDeliveryOutlet),l(5),p(t.POSDeliveryOutlet),l(8),p(t.POSInventoryOutlet)}}var je=(()=>{class e{constructor(){this.data=C(void 0)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-outlet-config-info"]],inputs:{data:[1,"data"]},decls:2,vars:1,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above",1,"info-label-group",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Outlet where the stock is deducted in POS",1,"info-label-group"],[1,"col-12"],["matTooltipPosition","above","matTooltip","Outlet where the inventory will displayed as inventory in Inventory Comparison Menu",1,"info-label-group"]],template:function(r,o){if(r&1&&(n(0,"div",0),m(1,xt,24,8,"div",1),i()),r&2){let h;l(),s((h=o.data())?1:-1,h)}},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();function yt(e,d){if(e&1&&(n(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"label"),a(5,"Tax"),i(),n(6,"div")(7,"span"),a(8),i()()()(),n(9,"div",3)(10,"div",5)(11,"label"),a(12,"Tag"),i(),n(13,"div")(14,"span"),a(15),i()()()()()()),e&2){let t=d;l(3),D("bg-gradient-warning",!t.POSTax),l(5),p(t.POSTax),l(2),D("bg-gradient-warning",!t.POSSalesOrderType),l(5),p(t.POSSalesOrderType)}}var Ye=(()=>{class e{constructor(){this.data=C(void 0)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-orders-config-info"]],inputs:{data:[1,"data"]},decls:2,vars:1,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Tax Type that will be recorded in POS if there is a transaction from the marketplace",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Tag Type that will be recorded in POS if there is a transaction from the marketplace",1,"info-label-group"]],template:function(r,o){if(r&1&&(n(0,"div",0),m(1,yt,16,6,"div",1),i()),r&2){let h;l(),s((h=o.data())?1:-1,h)}},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();function St(e,d){if(e&1&&(n(0,"div",3)(1,"div",7)(2,"label"),a(3,"Write Off Reason"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().ServiceFeeWriteOffReason)}}var Ge=(()=>{class e{constructor(){this.paymentSyncDisplay={0:"Do Not Sync",1:"Sync Full Amount",2:"Sync Received Amount (Write Off)"},this.data=C(void 0)}get getPaymentSyncStateEnum(){return this.paymentSyncDisplay[this.data().PaymentSyncTypeID]??"Unknown"}getPaymentSyncTooltip(){switch(this.data().PaymentSyncTypeID){case 0:return"Do not sync / record payment invoices from channel to DealPOS";case 1:return"Record full payment amount without deducting admin fees and other charges";case 2:return"Record payment after deducting write-off amounts (admin fees and other deductions)";default:return""}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-invoiceFee-config-info"]],inputs:{data:[1,"data"]},decls:19,vars:7,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row","mb-4"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Payment that will be recorded in POS if there is a transaction from the marketplace",1,"info-label-group","mb-4"],[1,"row"],["matTooltipPosition","above",1,"info-label-group","mb-4",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Choose Reason to Write Off",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label"),a(6,"Payment Method"),i(),n(7,"div")(8,"span"),a(9),i()()()()(),n(10,"div",5)(11,"div",3)(12,"div",6)(13,"label"),a(14,"Marketplace Payment Settlement"),i(),n(15,"div")(16,"span"),a(17),i()()()(),m(18,St,7,1,"div",3),i()()()),r&2&&(l(4),D("bg-gradient-warning",!o.data().POSInvoicePaymentMethod),l(5),p(o.data().POSInvoicePaymentMethod),l(3),f("matTooltip",Q(o.getPaymentSyncTooltip())),l(5),p(o.getPaymentSyncStateEnum),l(),s(o.data().PaymentSyncTypeID==2?18:-1))},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();function Tt(e,d){if(e&1&&(T(0,"tr")(1,"td"),a(2),E(),T(3,"td"),a(4),E(),T(5,"td"),a(6),E()()),e&2){let t=d.$implicit;l(2),p(t.topic),l(2),p(t.addressWithoutHost),l(),D("bg-gradient-warning",!t.enabled),l(),I(" ",t.enabled?"ENABLED":"DISABLED"," ")}}function Et(e,d){e&1&&(T(0,"table",4)(1,"thead",5)(2,"tr")(3,"th",6),a(4,"Event"),E(),T(5,"th",7),a(6,"Url"),E(),T(7,"th",6),a(8,"State"),E()()(),T(9,"tbody"),F(10,Tt,7,5,"tr",null,J),E()()),e&2&&(l(10),V(d))}var $e=(()=>{class e{constructor(){this.shopifyWebhookService=g(oe),this.wooCommerceService=g(ae),this.channel=C(void 0),this.webhooks=ne({params:()=>this.channel(),stream:()=>{let t=this.channel();if(!t)return U([]);switch(t.TypeID){case S.Shopify:return this.shopifyWebhookService.getWebhookWithState(t.ID);case S.ShopifyV2:return this.shopifyWebhookService.getWebhookWithStateV2(t.ID);case S.WooCommerce:return this.wooCommerceService.getWebhookWithState(t.ID);default:return U([])}}})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-webhook-config-info"]],inputs:{channel:[1,"channel"]},decls:6,vars:1,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-12"],[1,"table","mb-6","w-50"],[1,"thead-light"],["scope","col",2,"width","100px"],["scope","col"]],template:function(r,o){if(r&1&&(T(0,"div",0)(1,"div")(2,"div",1)(3,"div",2)(4,"div",3),m(5,Et,12,0,"table",4),E()()()()()),r&2){let h;l(5),s((h=o.webhooks.value())?5:-1,h)}},encapsulation:2,changeDetection:0})}}return e})();function Dt(e,d){if(e&1){let t=O();n(0,"span",10),_("click",function(o){return M(t),w(o.stopPropagation())}),n(1,"span",11),b(2,"img",12),i(),n(3,"span",13)(4,"span",14),a(5,"Customer Default Email"),i(),n(6,"button",15),_("click",function(o){M(t);let h=c();return w(h.closeDefaultEmailHelp(o))}),b(7,"i",16),i()(),n(8,"span",17),a(9,"Change the customer's name from the order in the marketplace according to this email, so the customer recorded in the DealPOS Invoice becomes one."),i()()}if(e&2){let t=c();l(2),f("src",t.defaultEmailHelpImageUrl,q)}}function It(e,d){if(e&1&&(n(0,"div",3)(1,"div",18)(2,"label"),a(3,"Category"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.categoryLabel.value())}}function Mt(e,d){if(e&1&&(n(0,"div",3)(1,"div",19)(2,"label"),a(3,"Brand"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().Brand)}}function wt(e,d){if(e&1&&(n(0,"div",3)(1,"div",20)(2,"label"),a(3,"ScanProductSize"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().ScanProductSize)}}var qe=(()=>{class e{constructor(){this.data=C(void 0),this.categoryService=g(Re),this.channelType=S,this.categoryLabel=ne({params:()=>this.data(),stream:()=>this.data()?this.categoryService.getCategories(this.data().TypeID,this.data().ID).pipe(ue(t=>{let r=this.categoryService.searchByIdWithParentDFS(t,this.data().DefaultCategoryID),o="";return r&&(o=Se.getLabelPathTree(r)),o})):U("")}),this.showDefaultEmailHelp=z(!1),this.defaultEmailHelpImageUrl="https://dealpos-media.b-cdn.net/omni/helper/chrome_gyfptsvzks.png?quality=75&format=webp"}openDefaultEmailHelp(t){t.stopPropagation(),this.showDefaultEmailHelp.set(!0)}closeDefaultEmailHelp(t){t.stopPropagation(),this.showDefaultEmailHelp.set(!1)}onDocumentClick(t){if(!this.showDefaultEmailHelp())return;t.target.closest(".help-anchor")||this.showDefaultEmailHelp.set(!1)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-default-config-info"]],hostBindings:function(r,o){r&1&&_("click",function(k){return o.onDocumentClick(k)},ve)},inputs:{data:[1,"data"]},decls:17,vars:6,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Change the customer's name from the order in the marketplace according this email",1,"info-label-group"],[1,"default-email-label"],[1,"help-anchor","ms-1"],["type","button","matTooltip","What is Customer Email?","matTooltipPosition","above","aria-label","What is Customer Email?",1,"help-trigger",3,"click"],["aria-hidden","true",1,"fa-solid","fa-circle-info"],["role","dialog","aria-label","Customer Default Email help",1,"default-email-help-card"],["role","dialog","aria-label","Customer Default Email help",1,"default-email-help-card",3,"click"],[1,"help-media"],["alt","Customer Default Email example",3,"src"],[1,"help-head"],[1,"help-title"],["type","button","aria-label","Close help",1,"help-close",3,"click"],["aria-hidden","true",1,"fa-solid","fa-xmark"],[1,"help-caption"],["matTooltipPosition","above","matTooltip","Set default category for uploading product to channel",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Brand name for product upload",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Customize Scan Product Size",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label",5),a(6,"Customer Default Email "),n(7,"span",6)(8,"button",7),_("click",function(k){return o.openDefaultEmailHelp(k)}),b(9,"i",8),i(),m(10,Dt,10,1,"span",9),i()(),n(11,"div")(12,"span"),a(13),i()()()(),m(14,It,7,1,"div",3),m(15,Mt,7,1,"div",3),m(16,wt,7,1,"div",3),i()()()),r&2&&(l(8),ge("aria-expanded",o.showDefaultEmailHelp()),l(2),s(o.showDefaultEmailHelp()?10:-1),l(3),p(o.data().CustomerDefaultEmail),l(),s(o.data().TypeID!=o.channelType.Shopify&&o.data().TypeID!=o.channelType.Lazada?14:-1),l(),s(o.data().TypeID==o.channelType.Lazada?15:-1),l(),s(o.data().TypeID==o.channelType.Lazada||o.data().TypeID==o.channelType.WooCommerce||o.data().TypeID==o.channelType.Shopee?16:-1))},dependencies:[y,x],styles:['.default-email-label[_ngcontent-%COMP%]{display:inline-flex!important;align-items:center;white-space:nowrap}.help-anchor[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center}.help-trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:0 1px;border:0;background:transparent;color:#8a97a8;font-size:13px;cursor:pointer;line-height:1;transition:color .15s ease}.help-trigger[_ngcontent-%COMP%]:hover{color:#0d6efd}.help-trigger[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0d6efd;outline-offset:2px;border-radius:50%}.help-trigger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block}.default-email-help-card[_ngcontent-%COMP%]{position:absolute;top:50%;left:calc(100% + 12px);transform:translateY(-50%);z-index:1060;display:block;width:300px;padding:12px 12px 14px;background:#fff;border:1px solid #e3e8f0;border-radius:18px;box-shadow:0 18px 50px #1018282e;white-space:normal;text-align:left;cursor:default}.default-email-help-card[_ngcontent-%COMP%]:before{content:"";position:absolute;top:50%;left:-7px;margin-top:-7px;width:14px;height:14px;background:#fff;border-left:1px solid #e3e8f0;border-bottom:1px solid #e3e8f0;transform:rotate(45deg);border-bottom-left-radius:3px}.default-email-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%]{display:block;overflow:hidden;border-radius:12px;background:#fdf1cd}.default-email-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:block;width:100%;height:172px;object-fit:cover;border-radius:12px;background:#fdf1cd}.default-email-help-card[_ngcontent-%COMP%] .help-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 4px 4px}.default-email-help-card[_ngcontent-%COMP%] .help-title[_ngcontent-%COMP%]{display:block;color:#1f2430;font-size:15px;font-weight:700;line-height:1.3}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;padding:0;border:0;border-radius:50%;background:transparent;color:#8a97a8;font-size:14px;cursor:pointer;line-height:1;transition:background .15s ease,color .15s ease}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:hover{background:#eef1f6;color:#1f2430}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0d6efd;outline-offset:2px}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block}.default-email-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%]{display:block;margin:0 4px;color:#5b6b7f;font-size:13px;line-height:1.55}.default-email-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:normal;color:#0d6efd;font-weight:700;padding:0 1px}@media(max-width:576px){.default-email-help-card[_ngcontent-%COMP%]{width:min(260px,70vw)}}'],changeDetection:0})}}return e})();function kt(e,d){if(e&1&&(T(0,"tr")(1,"td",4),a(2),E(),T(3,"td",4),a(4),E()()),e&2){let t=d.$implicit;l(2),I(" ",t.Name," "),l(2),I(" ",t.ProductInventoryOutlet," ")}}var Ke=(()=>{class e{constructor(){this.warehouseLocations=C([])}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-warehouse-config-info"]],inputs:{warehouseLocations:[1,"warehouseLocations"]},decls:12,vars:0,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"table","table-bordered","mb-12","w-50"],[1,"table-light"],[1,"text-start"]],template:function(r,o){r&1&&(T(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead")(4,"tr",3)(5,"th",4),a(6,"Channel Warehouse"),E(),T(7,"th",4),a(8,"DealPOS Outlet"),E()()(),T(9,"tbody"),F(10,kt,5,2,"tr",null,J),E()()()()),r&2&&(l(10),V(o.warehouseLocations()))},dependencies:[Ne],encapsulation:2,changeDetection:0})}}return e})();var me=e=>[e],Je=e=>({ID:e}),Qe=e=>["/menu/channel/marketplace/form",e];function Pt(e,d){}function Ot(e,d){}function Lt(e,d){if(e&1){let t=O();n(0,"div",7)(1,"a",8),a(2,"Edit"),i(),b(3,"button",9),n(4,"ul",10)(5,"li",11)(6,"a",12),_("click",function(){M(t);let o=c(2);return w(o.onDelete(o.channel()))}),a(7,"Delete"),i()()()()}if(e&2){let t,r=c(2);l(),f("routerLink",A(3,Qe,A(1,Je,(t=r.channel())==null?null:t.ID)))}}function Wt(e,d){if(e&1&&(n(0,"button",8),a(1," Edit "),i()),e&2){let t,r=c(2);f("routerLink",A(3,Qe,A(1,Je,(t=r.channel())==null?null:t.ID)))}}function At(e,d){if(e&1&&K(0,Ot,0,0,"ng-template",5)(1,Lt,8,5,"ng-template",null,2,j)(3,Wt,2,5,"ng-template",null,3,j),e&2){let t=B(2),r=B(4),o=c();f("ngxPermissionsOnly",A(3,me,o.roleChannelDelete))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",r)}}function Nt(e,d){if(e&1){let t=O();n(0,"button",14),_("click",function(){M(t);let o=c(2);return w(o.onDelete(o.channel()))}),a(1," Delete "),i()}}function Rt(e,d){if(e&1&&K(0,Nt,2,0,"ng-template",13),e&2){let t=c();f("ngxPermissionsOnly",A(1,me,t.roleChannelDelete))}}function zt(e,d){e&1&&(n(0,"button",26),a(1," Multi Warehouse "),i())}function Ft(e,d){e&1&&(n(0,"button",28),a(1," Webhook "),i())}function Vt(e,d){if(e&1&&(n(0,"div",40),b(1,"app-webhook-config-info",17),i()),e&2){let t=c(2);l(),f("channel",t.channel())}}function Ht(e,d){if(e&1&&(n(0,"span"),a(1),i()),e&2){let t,r=c(2);l(),I("/",(t=r.channel())==null?null:t.Creator)}}function Ut(e,d){if(e&1&&(n(0,"span"),a(1),i()),e&2){let t,r=c(3);l(),I("/",(t=r.channel())==null?null:t.Creator)}}function Bt(e,d){if(e&1&&(n(0,"div")(1,"span",45),a(2,"Modified:"),i(),a(3),P(4,"date"),m(5,Ut,2,1,"span"),i()),e&2){let t,r,o=c(2);l(3),I(" ",W(4,2,(t=o.channel())==null?null:t.Modified,"dd MMM yyyy HH:mm")," "),l(2),s((r=o.channel())!=null&&r.Creator?5:-1)}}function jt(e,d){if(e&1){let t=O();n(0,"div",6)(1,"div",15)(2,"div",16),b(3,"app-marketplace-config-info",17),i(),n(4,"div",18),b(5,"app-sync-config-info",17),i()(),n(6,"div",15)(7,"div",19)(8,"nav")(9,"div",20)(10,"button",21),a(11," Outlet "),i(),n(12,"button",22),a(13," Orders "),i(),n(14,"button",23),a(15," Platform Fee "),i(),n(16,"button",24),a(17," Advanced "),i(),n(18,"button",25),a(19," Authorization "),i(),m(20,zt,2,0,"button",26),n(21,"button",27),a(22," Default "),i(),m(23,Ft,2,0,"button",28),i()(),n(24,"div",29)(25,"div",30),b(26,"app-outlet-config-info",31),i(),n(27,"div",32),b(28,"app-orders-config-info",31),i(),n(29,"div",33),b(30,"app-invoiceFee-config-info",31),i(),n(31,"div",34),b(32,"app-advanced-config-info",31),i(),n(33,"div",35)(34,"app-authorized-config-info",36),_("onSuccessRefrehToken",function(){M(t);let o=c();return w(o.onGetChannel())}),i()(),n(35,"div",37),b(36,"app-warehouse-config-info",38),i(),n(37,"div",39),b(38,"app-default-config-info",31),i(),m(39,Vt,2,1,"div",40),i()()(),n(40,"div",41)(41,"div",42),b(42,"i",43),n(43,"div",44)(44,"span",45),a(45,"Created:"),i(),a(46),P(47,"date"),m(48,Ht,2,1,"span"),i(),m(49,Bt,6,5,"div"),i()()()}if(e&2){let t,r,o,h,k,se,G,fe,u=c();l(3),f("channel",u.channel()),l(2),f("channel",u.channel()),l(13),D("bg-gradient-danger",!((t=u.channel())!=null&&t.Authorized)),l(2),s(((r=u.channel())==null||r.WarehouseLocations==null?null:r.WarehouseLocations.length)>0&&((r=u.channel())!=null&&r.MultiWarehouse)?20:-1),l(3),s(u.channelType.Shopify==((o=u.channel())==null?null:o.TypeID)||u.channelType.ShopifyV2==((o=u.channel())==null?null:o.TypeID)||u.channelType.WooCommerce==((o=u.channel())==null?null:o.TypeID)?23:-1),l(3),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("warehouseLocations",(h=u.channel())==null?null:h.WarehouseLocations),l(2),f("data",u.channel()),l(),s(u.channelType.Shopify==((k=u.channel())==null?null:k.TypeID)||u.channelType.ShopifyV2==((k=u.channel())==null?null:k.TypeID)||u.channelType.WooCommerce==((k=u.channel())==null?null:k.TypeID)?39:-1),l(7),I(" ",W(47,17,(se=u.channel())==null?null:se.Created,"dd MMM yyyy HH:mm")," "),l(2),s(!((G=u.channel())!=null&&G.Modified)&&((G=u.channel())!=null&&G.Creator)?48:-1),l(),s((fe=u.channel())!=null&&fe.Modified?49:-1)}}var Zi=(()=>{class e{constructor(){this.route=g(Ee),this.http=g(Te),this.router=g(De),this.toastr=g(ee),this.destroyRef=g($),this.channel=z(void 0),this.roleChannelEdit=de.ChannelEdit,this.roleChannelDelete=de.ChannelDelete,this.channelType=S,this.route.queryParams.pipe(N(this.destroyRef)).subscribe(t=>{this.ID=t.ID}),this.ID!=null&&this.onGetChannel()}onGetChannel(){var t={ID:this.ID};this.http.post("/api/ChannelLoader/GetChannelView",t).pipe(N(this.destroyRef)).subscribe(r=>{this.channel.set(r.Model),this.channel().LogMode==1?this.channel.update(o=>(o.LogModeLabel="None",o)):this.channel().LogMode==2?this.channel.update(o=>(o.LogModeLabel="Error",o)):this.channel().LogMode==3&&this.channel.update(o=>(o.LogModeLabel="Full",o))})}onDelete(t){if(confirm("Delete channel "+t.Name+" ?")){var o={ID:t.ID};this.http.post("/api/Channel/DeleteChannel",o).pipe(N(this.destroyRef)).subscribe(h=>{this.toastr.success("Channel "+t.Name+" is deleted!","Success",{closeButton:!0,positionClass:"toast-bottom-right"}),this.router.navigate(["menu/channel"])})}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-marketplace-view"]],features:[X([oe,ae])],decls:9,vars:9,consts:[["CHANNEL_EDIT",""],["CHANNEL_DELETE",""],["ALL_BUTTON",""],["EDIT_ONLY",""],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],[1,"container-fluid","py-5","bg-light-gray"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end","pointer"],[1,"dropdown-item"],["role","button",1,"fs-5",3,"click"],[3,"ngxPermissionsOnly"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"row"],[1,"col-8"],[3,"channel"],[1,"col-4"],[1,"col-12"],["id","nav-tab","role","tablist",1,"nav","nav-tabs"],["id","nav-outlet-config-tab","data-bs-toggle","tab","data-bs-target","#nav-outlet-config","type","button","role","tab","aria-controls","nav-outlet-config","aria-selected","true",1,"nav-link","active"],["id","nav-order-config-tab","data-bs-toggle","tab","data-bs-target","#nav-order-config","type","button","role","tab","aria-controls","nav-order-config","aria-selected","false",1,"nav-link"],["id","nav-service-fee-tab","data-bs-toggle","tab","data-bs-target","#nav-service-fee","type","button","role","tab","aria-controls","nav-service-fee","aria-selected","false",1,"nav-link"],["id","nav-advanced-tab","data-bs-toggle","tab","data-bs-target","#nav-advanced","type","button","role","tab","aria-controls","nav-advanced","aria-selected","false",1,"nav-link"],["id","nav-advanced-tab","data-bs-toggle","tab","data-bs-target","#nav-authorized","type","button","role","tab","aria-controls","nav-authorized","aria-selected","false",1,"nav-link"],["id","nav-warehouse-tab","data-bs-toggle","tab","data-bs-target","#nav-warehouse","type","button","role","tab","aria-controls","nav-warehouse","aria-selected","false",1,"nav-link"],["id","nav-default-tab","data-bs-toggle","tab","data-bs-target","#nav-default","type","button","role","tab","aria-controls","nav-default","aria-selected","false",1,"nav-link"],["id","nav-webhook-tab","data-bs-toggle","tab","data-bs-target","#nav-webhook","type","button","role","tab","aria-controls","nav-webhook","aria-selected","false",1,"nav-link"],["id","nav-tabContent",1,"tab-content"],["id","nav-outlet-config","role","tabpanel","aria-labelledby","nav-outlet-config-tab",1,"tab-pane","fade","show","active"],[3,"data"],["id","nav-order-config","role","tabpanel","aria-labelledby","nav-order-config-tab",1,"tab-pane","fade"],["id","nav-service-fee","role","tabpanel","aria-labelledby","nav-service-fee-tab",1,"tab-pane","fade"],["id","nav-advanced","role","tabpanel","aria-labelledby","nav-advanced-tab",1,"tab-pane","fade"],["id","nav-authorized","role","tabpanel","aria-labelledby","nav-authorized-tab",1,"tab-pane","fade"],[3,"onSuccessRefrehToken","data"],["id","nav-warehouse","role","tabpanel","aria-labelledby","nav-warehouse-tab",1,"tab-pane","fade"],[3,"warehouseLocations"],["id","nav-default","role","tabpanel","aria-labelledby","nav-default-tab",1,"tab-pane","fade"],["id","nav-webhook","role","tabpanel","aria-labelledby","nav-webhook-tab",1,"tab-pane","fade"],[1,"alert","alert-warning","w-100"],[1,"d-flex","align-items-center","justify-content-start","p-4"],["aria-hidden","true",1,"fa-regular","fa-file","me-5"],[1,"me-2"],[1,"fw-bold"]],template:function(r,o){if(r&1&&(n(0,"mainpanel",4)(1,"actions"),K(2,Pt,0,0,"ng-template",5)(3,At,5,5,"ng-template",null,0,j)(5,Rt,1,3,"ng-template",null,1,j),i(),n(7,"content"),m(8,jt,50,20,"div",6),i()()),r&2){let h=B(4),k=B(6);f("headerTitle","Marketplace Configuration View")("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),f("ngxPermissionsOnly",A(7,me,o.roleChannelEdit))("ngxPermissionsOnlyThen",h)("ngxPermissionsOnlyElse",k),l(6),s(o.channel()?8:-1)}},dependencies:[Ve,He,Ue,Be,je,Ye,Ge,qe,$e,Ae,Me,Ie,ke,we,Ke,H],styles:[".tab-pane[_ngcontent-%COMP%]{margin-top:0!important}@media(max-width:991px){.container-fluid[_ngcontent-%COMP%]{padding:0 8px}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}[class*=col-][_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;flex:0 0 100%!important;margin-bottom:20px}.card[_ngcontent-%COMP%]{margin-bottom:20px;min-width:0}.card-title[_ngcontent-%COMP%]{font-size:1.2rem;margin-left:0!important;margin-top:0!important}.table-responsive[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{font-size:13px;min-width:500px}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:6px 4px!important;word-break:break-word}.btn-sm[_ngcontent-%COMP%]{font-size:11px!important;padding:4px 8px!important}.mt-5[_ngcontent-%COMP%], .mt-6[_ngcontent-%COMP%], .my-6[_ngcontent-%COMP%], .ms-10[_ngcontent-%COMP%]{margin-top:12px!important;margin-bottom:12px!important;margin-left:0!important}}@media(max-width:600px){.container-fluid[_ngcontent-%COMP%]{padding:0 2px}.card-title[_ngcontent-%COMP%]{font-size:1rem}.table[_ngcontent-%COMP%]{font-size:12px}.card-body[_ngcontent-%COMP%]{padding:10px!important}.table-responsive[_ngcontent-%COMP%]{min-width:0}.btn-sm[_ngcontent-%COMP%]{min-width:60px;font-size:11px;padding:3px 6px!important}img[_ngcontent-%COMP%]{max-width:90%;height:auto}}"],changeDetection:0})}}return e})();export{Zi as MarketplaceViewComponent};
2
+ `,1,"info-label-group"],["matTooltipPosition","above","matTooltip","Minimal inventory on channel, if product inventory is below minimum inventory will automatically update to 0 ",1,"info-label-group"],["matTooltipPosition","above","matTooltip","WarehouseID is used to determine the warehouse where the location is stored.",1,"info-label-group","w-100","d-flex","justify-content-between"],[1,"btn","btn-outline-success","ms-2","btn-sm",3,"click"],["matTooltipPosition","above","matTooltip","If this configuration is Strikethrough_Price means the discount is crossed out, and if Discount_Amount means the property discount is as before.",1,"info-label-group"],["matTooltipPosition","above","matTooltip","create outbound logistic when webhook sends",1,"info-label-group"],["matTooltip","Image URL for Tokopedia Product Size Chart","matTooltipPosition","above",1,"info-label-group"],[1,"text-break"],["target","_blank",3,"href"],["matTooltipPosition","above","matTooltip","Please input Product SKU to automatically add additional product to record the amount of the shipping fee in order",1,"info-label-group"],[1,"info-label-group"],["matTooltipPosition","above","matTooltip","When this config is turned off, Order is only Synchronize when it has been paid",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Manage stock availability for WooCommerce",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label"),a(6,"Register"),i(),n(7,"div")(8,"span"),a(9),i()()()(),n(10,"div",3)(11,"div",5)(12,"label"),a(13,"Additional Item"),i(),n(14,"div")(15,"span"),a(16),i()()()(),n(17,"div",3)(18,"div",6)(19,"label"),a(20,"Minimum Inventory"),i(),n(21,"div")(22,"span"),a(23),P(24,"number"),i()()()(),m(25,ot,7,1,"div",3),m(26,at,7,2,"div",3),m(27,lt,7,1,"div",3),n(28,"div",3)(29,"div",7)(30,"label"),a(31,"Warehouse ID"),i(),n(32,"div")(33,"span"),a(34),i()(),n(35,"button",8),_("click",function(){return o.onTestWarehouse()}),a(36," GET "),i()()(),m(37,rt,7,1,"div",3),m(38,dt,7,1,"div",3),m(39,pt,7,1,"div",3),n(40,"div",3)(41,"div",9)(42,"label"),a(43,"Product Discount Sync Mode"),i(),n(44,"div")(45,"span"),a(46),i()()()()()()()),r&2&&(l(9),p(o.data().Register),l(7),p(o.data().Additionalitem),l(7),p(Z(24,11,o.data().MinimumInventory)),l(2),s(o.data().TypeID==o.channelType.Shopify?25:-1),l(),s(o.data().TypeID==o.channelType.Tokopedia||o.data().TypeID==o.channelType.Shopee?26:-1),l(),s(o.data().TypeID==o.channelType.WooCommerce?27:-1),l(7),p(o.data().WarehouseID),l(3),s(o.data().PricebookName?37:-1),l(),s(o.data().TypeID!==o.channelType.Tokopedia?38:-1),l(),s(o.data().TypeID==o.channelType.WooCommerce?39:-1),l(7),p(o.data().ProductDiscountSyncModeIDLabel))},dependencies:[y,x,te,xe],encapsulation:2,changeDetection:0})}}return e})();function ct(e,d){if(e&1){let t=O();n(0,"button",10),_("click",function(){M(t);let o=c();return w(o.onUpdateChannelType(o.channel()))}),a(1," Migrate to ShopifyV2 "),i()}}function mt(e,d){if(e&1){let t=O();n(0,"div",4)(1,"div",11)(2,"label"),a(3,"Shop ID"),i(),n(4,"div")(5,"span"),a(6),i()(),n(7,"button",10),_("click",function(){M(t);let o=c();return w(o.onTestChannel(o.channel()))}),a(8," Test "),i()()()}if(e&2){let t=c();l(6),p(t.channel().ShopID!=0?t.channel().ShopID:t.channel().ShopIDString)}}function st(e,d){if(e&1&&(n(0,"div",4)(1,"div",12)(2,"label"),a(3,"Marketplace URL"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.channel().URL)}}var He=(()=>{class e{constructor(){this.channelService=g(ie),this.channel=C.required(),this.channelType=S}onTestChannel(t){this.channelService.testShopID(t).subscribe()}onUpdateChannelType(t){this.channelService.updateChannelType(t).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-marketplace-config-info"]],inputs:{channel:[1,"channel"]},decls:38,vars:10,consts:[[1,"card"],[1,"card-header"],[1,"card-body","mt-8"],[1,"row"],[1,"col-sm-6"],["matTooltipPosition","above","matTooltip","Your shop name in marketplace channel",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Marketplace / Website where your product is Sold / Distributed",1,"info-label-group","w-100","d-flex","justify-content-between"],[1,"btn","btn-outline-success","ms-2","btn-sm"],["matTooltipPosition","above","matTooltip","Last Sync Product",1,"info-label-group"],[1,"info-label-group"],[1,"btn","btn-outline-success","ms-2","btn-sm",3,"click"],["matTooltipPosition","above","matTooltip","Your shop ID",1,"info-label-group","w-100","d-flex","justify-content-between"],["matTooltipPosition","above","matTooltip","Your Marketplace URL",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),a(3,"Marketplace Setup"),i()(),n(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"label"),a(9,"Name"),i(),n(10,"div")(11,"span"),a(12),i()()()(),n(13,"div",4)(14,"div",6)(15,"label"),a(16,"Type"),i(),n(17,"div")(18,"span"),a(19),i()(),m(20,ct,2,0,"button",7),i()(),m(21,mt,9,1,"div",4),m(22,st,7,1,"div",4),n(23,"div",4)(24,"div",8)(25,"label"),a(26,"Product Sync"),i(),n(27,"div")(28,"span"),a(29),P(30,"date"),i()()()(),n(31,"div",4)(32,"div",9)(33,"label"),a(34,"Multiwarehouse"),i(),n(35,"div")(36,"span"),a(37),i()()()()()()()),r&2&&(l(12),p(o.channel().Name),l(7),p(o.channel().TypeString),l(),s(o.channel().TypeID===o.channelType.Shopify?20:-1),l(),s(o.channel().TypeID!=2?21:-1),l(),s(o.channel().TypeID!=o.channelType.Tiktok?22:-1),l(7),p(o.channel().LastSync?W(30,7,o.channel().LastSync,"dd MMM yyyy HH:mm"):"Never"),l(8),p(o.channel().MultiWarehouse?"YES":"NO"))},dependencies:[y,x,H],encapsulation:2,changeDetection:0})}}return e})();var le=(function(e){return e[e.OFF=0]="OFF",e[e.UNFULFILLED=1]="UNFULFILLED",e[e.ALL=2]="ALL",e})(le||{});var Y=(function(e){return e[e.NEVER=0]="NEVER",e[e.UNPAID=1]="UNPAID",e[e.PAID=2]="PAID",e})(Y||{});function ft(e,d){if(e&1&&(n(0,"div",4)(1,"label"),a(2,"Return Order Sync "),n(3,"a",6),b(4,"i",7),i()(),n(5,"div")(6,"span"),a(7),i()()()),e&2){let t=c();l(7),p(t.AutomaticPOSReturn?"YES":"NO")}}function ut(e,d){if(e&1&&(n(0,"div",2)(1,"div",3)(2,"label"),a(3,"New Order Sync"),i(),n(4,"div")(5,"span"),a(6),i()()(),n(7,"div",3)(8,"label"),a(9,"Cancelled Order Sync"),i(),n(10,"div")(11,"span"),a(12),i()()(),m(13,ft,8,1,"div",4),n(14,"div",5)(15,"label"),a(16,"Inventory"),i(),n(17,"div")(18,"span"),a(19),i()()()()),e&2){let t=d,r=c();l(),f("matTooltip",r.orderSyncTooltip[t.NewOrderSyncTypeID]),l(5),p(t.NewOrderSyncTypeIDString),l(),f("matTooltip",r.cancelOrderTooltip[t.CancelledOrderSyncTypeID]),l(5),p(t.CancelledOrderSyncTypeIDString),l(),s(t.TypeID==r.channelType.Shopee?13:-1),l(6),p(t.SyncInventory?"YES":"NO")}}var Ue=(()=>{class e{constructor(){this.channel=C.required(),this.channelType=S,this.orderSyncTooltip={[Y.PAID]:"Sync only paid orders from the channel and create them as Invoices.",[Y.UNPAID]:"Sync unpaid orders from the channel and create them as Sales Orders.",[Y.NEVER]:"Do not automatically sync orders from the channel to DealPOS."},this.cancelOrderTooltip={[le.UNFULFILLED]:" If the order is already fulfilled, the POS invoice will not be voided.",[le.ALL]:"The POS invoice will always be voided, even if the order is fulfilled."}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-sync-config-info"]],inputs:{channel:[1,"channel"]},decls:5,vars:1,consts:[[1,"card"],[1,"card-header"],[1,"card-body","mt-8"],["matTooltipPosition","above",1,"info-label-group",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Sync return/refund order from Shopee and create a return transaction in POS",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Automatically sync your POS inventory to channel inventory",1,"info-label-group"],["href","https://support.dealpos.com/en/articles/16796008-shopee-automatic-return-flow-in-dealpos-omnichannel","target","_blank","rel","noopener","matTooltip","Learn more about Shopee automatic return flow","matTooltipPosition","above","aria-label","Learn more about Return Order Sync",1,"ms-1"],[1,"fa-solid","fa-circle-info"]],template:function(r,o){if(r&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),a(3,"Synchronize"),i()(),m(4,ut,20,6,"div",2),i()),r&2){let h;l(4),s((h=o.channel())?4:-1,h)}},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();var ht=(e,d)=>({"text-success":e,"text-danger":d});function vt(e,d){if(e&1&&(n(0,"div",2)(1,"div",3)(2,"div",4)(3,"label"),a(4,"Consumer Key"),i(),n(5,"div")(6,"span"),a(7),i()()()(),n(8,"div",5)(9,"div",4)(10,"label"),a(11,"Consumer Secret"),i(),n(12,"div")(13,"span"),a(14),i()()()()()),e&2){let t=c();l(7),p(t.data().ConsumerKey),l(7),p(t.data().ConsumerSecret)}}function gt(e,d){if(e&1&&(n(0,"div",3)(1,"div",6)(2,"label"),a(3,"Authorized"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().Authorized?"YES":"NO")}}function bt(e,d){if(e&1&&(n(0,"div",3)(1,"div",7),P(2,"expiredTime"),n(3,"label"),a(4,"Shop Expiration"),i(),n(5,"div")(6,"span"),a(7),P(8,"date"),i()()()()),e&2){let t=c();l(),D("bg-gradient-danger",Z(2,4,t.data().ExpiredTime)),f("matTooltip","The expiry date for "+t.data().Name+" Open API authorization from your account "+t.data().Name+" to Dealpos"),l(6),p(t.data().ExpiredTime?W(8,6,t.data().ExpiredTime,"dd MMM yyyy HH:mm"):"-")}}function Ct(e,d){if(e&1&&(n(0,"div",3)(1,"div",19)(2,"label"),a(3,"Token Issued"),i(),n(4,"div")(5,"span"),a(6),P(7,"date"),i()()()()),e&2){let t=c(2);l(6),p(W(7,1,t.data().TokenIssued,"dd MMM yyyy HH:mm"))}}function _t(e,d){if(e&1){let t=O();n(0,"div",3)(1,"div",4)(2,"label"),a(3,"Refresh Token"),i(),n(4,"div")(5,"span",8),a(6),i()()()(),n(7,"div",3)(8,"div",9)(9,"label"),a(10,"Access Token"),i(),n(11,"div",10)(12,"span",8),a(13),i(),n(14,"span",11)(15,"button",12),_("click",function(){M(t);let o=c();return w(o.onRefreshToken())}),b(16,"i",13),n(17,"span"),a(18,"Refresh"),i()()()()()(),m(19,Ct,8,4,"div",3),n(20,"div",3)(21,"div",7)(22,"label"),a(23,"Access Token Expired"),i(),n(24,"div",14)(25,"div"),a(26),P(27,"date"),i(),n(28,"div",15)(29,"button",16),_("click",function(){M(t);let o=c();return w(o.onAuthorize())}),b(30,"i",17),n(31,"span"),a(32,"Extend"),i()()()()()(),n(33,"div",3)(34,"div",18)(35,"label"),a(36,"Token Log"),i(),n(37,"div")(38,"span"),a(39),i()()()()}if(e&2){let t=c();l(6),p(t.data().RefreshToken),l(7),p(t.data().AccessToken),l(6),s(t.data().TypeID==t.channelType.Shopee?19:-1),l(2),f("matTooltip",t.tokenExpiryMessage),l(4),be(Ce(13,ht,!t.isAccessTokenExpired,t.isAccessTokenExpired)),l(),I(" ",W(27,10,t.data().TokenExpired,"dd MMM yyyy HH:mm")," "),l(2),f("matTooltip",Q(t.data().TypeID==t.channelType.Shopee?"Extend Shopee Authorization Duration for an additional 1 year":"Update Token Expired date")),l(11),p(t.data().TokenLog?"YES":"NO")}}var Be=(()=>{class e{constructor(){this.toastr=g(ee),this.authorizeService=g(ce),this.destroyRef=g($),this.data=C(void 0),this.isAccessTokenExpired=re(()=>this.authorizeService.isExpiredDate(new Date(this.data()?.TokenExpired))),this.isRefreshTokenExpired=re(()=>this.authorizeService.isExpiredDate(new Date(this.data()?.RefreshTokenExpired))),this.channelType=S,this.onSuccessRefrehToken=_e()}get tokenExpiryMessage(){return this.authorizeService.generateTokenExpiryMessage(this.data()?.TypeID)}onAuthorize(){this.authorizeService.authorizedChannel(this.data()?.TypeID).pipe(N(this.destroyRef)).subscribe()}onRefreshToken(){this.authorizeService.onRefreshToken(this.data()?.ID).pipe(N(this.destroyRef)).subscribe(t=>{this.toastr.success("Token refreshed successfully!","Success").onShown.pipe(N(this.destroyRef)).subscribe(()=>this.onSuccessRefrehToken.emit())})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-authorized-config-info"]],inputs:{data:[1,"data"]},outputs:{onSuccessRefrehToken:"onSuccessRefrehToken"},features:[X([ce])],decls:7,vars:4,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],[1,"info-label-group"],[1,"col-6","pe-8"],["matTooltipPosition","above","matTooltip","Channel has been authorized to be managed by omni.dealpos.app",1,"info-label-group"],["matTooltipPosition","above",1,"info-label-group",3,"matTooltip"],[1,"text-wrap","text-break"],["matTooltipPosition","above","matTooltip","When your Shop Authorization has not expired you can try generate a new Access Token",1,"info-label-group"],[1,"d-flex","align-items-center","justify-content-between","w-100","text-wrap","text-break","py-3"],[1,"ms-4","text-end",2,"min-width","86px"],["type","button","matTooltip","Generate new access token",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-2"],[1,"d-flex","align-items-center","justify-content-between","w-100"],["matTooltipClass","unset-max-width-tooltip",3,"matTooltip"],["type","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fas","fa-plus-circle","me-2"],["matTooltipPosition","above","matTooltip","Enable for Record log when new token issued",1,"info-label-group"],["matTooltipPosition","above","matTooltip","When a request is made by omni.dealpos.app to get a new access_token from the Channel",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1),m(2,vt,15,2,"div",2),n(3,"div",2),m(4,gt,7,1,"div",3),m(5,bt,9,9,"div",3),m(6,_t,40,16),i()()()),r&2&&(l(2),s(o.channelType.WooCommerce==o.data().TypeID||o.channelType.ShopifyV2==o.data().TypeID||o.channelType.Shopify==o.data().TypeID||o.channelType.Plugo==o.data().TypeID?2:-1),l(2),s(o.channelType.Tokopedia==o.data().TypeID||o.channelType.Shopee==o.data().TypeID||o.channelType.Tiktok==o.data().TypeID||o.channelType.Lazada==o.data().TypeID?4:-1),l(),s(o.data().TypeID==o.channelType.Shopee?5:-1),l(),s(o.data().TypeID==o.channelType.Tiktok||o.data().TypeID==o.channelType.Lazada||o.data().TypeID==o.channelType.Shopee?6:-1))},dependencies:[y,x,ze,H],encapsulation:2,changeDetection:0})}}return e})();function xt(e,d){if(e&1&&(n(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"label"),a(5,"New Order To"),i(),n(6,"div")(7,"span"),a(8),i()()()(),n(9,"div",3)(10,"div",5)(11,"label"),a(12,"Dispatch Orders From"),i(),n(13,"div")(14,"span"),a(15),i()()()()(),n(16,"div",2)(17,"div",6)(18,"div",7)(19,"label"),a(20,"Product Inventory"),i(),n(21,"div")(22,"span"),a(23),i()()()()()()),e&2){let t=d;l(3),D("bg-gradient-warning",!t.POSOutlet&&!t.MultiWarehouse),f("matTooltip",t.MultiWarehouse?"":"Outlet where the transaction is recorded in POS"),l(5),p(t.POSOutlet),l(2),D("bg-gradient-warning",!t.POSDeliveryOutlet),l(5),p(t.POSDeliveryOutlet),l(8),p(t.POSInventoryOutlet)}}var je=(()=>{class e{constructor(){this.data=C(void 0)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-outlet-config-info"]],inputs:{data:[1,"data"]},decls:2,vars:1,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above",1,"info-label-group",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Outlet where the stock is deducted in POS",1,"info-label-group"],[1,"col-12"],["matTooltipPosition","above","matTooltip","Outlet where the inventory will displayed as inventory in Inventory Comparison Menu",1,"info-label-group"]],template:function(r,o){if(r&1&&(n(0,"div",0),m(1,xt,24,8,"div",1),i()),r&2){let h;l(),s((h=o.data())?1:-1,h)}},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();function yt(e,d){if(e&1&&(n(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"label"),a(5,"Tax"),i(),n(6,"div")(7,"span"),a(8),i()()()(),n(9,"div",3)(10,"div",5)(11,"label"),a(12,"Tag"),i(),n(13,"div")(14,"span"),a(15),i()()()()()()),e&2){let t=d;l(3),D("bg-gradient-warning",!t.POSTax),l(5),p(t.POSTax),l(2),D("bg-gradient-warning",!t.POSSalesOrderType),l(5),p(t.POSSalesOrderType)}}var Ye=(()=>{class e{constructor(){this.data=C(void 0)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-orders-config-info"]],inputs:{data:[1,"data"]},decls:2,vars:1,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Tax Type that will be recorded in POS if there is a transaction from the marketplace",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Tag Type that will be recorded in POS if there is a transaction from the marketplace",1,"info-label-group"]],template:function(r,o){if(r&1&&(n(0,"div",0),m(1,yt,16,6,"div",1),i()),r&2){let h;l(),s((h=o.data())?1:-1,h)}},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();function St(e,d){if(e&1&&(n(0,"div",3)(1,"div",7)(2,"label"),a(3,"Write Off Reason"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().ServiceFeeWriteOffReason)}}var Ge=(()=>{class e{constructor(){this.paymentSyncDisplay={0:"Do Not Sync",1:"Sync Full Amount",2:"Sync Received Amount (Write Off)"},this.data=C(void 0)}get getPaymentSyncStateEnum(){return this.paymentSyncDisplay[this.data().PaymentSyncTypeID]??"Unknown"}getPaymentSyncTooltip(){switch(this.data().PaymentSyncTypeID){case 0:return"Do not sync / record payment invoices from channel to DealPOS";case 1:return"Record full payment amount without deducting admin fees and other charges";case 2:return"Record payment after deducting write-off amounts (admin fees and other deductions)";default:return""}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-invoiceFee-config-info"]],inputs:{data:[1,"data"]},decls:19,vars:7,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row","mb-4"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Payment that will be recorded in POS if there is a transaction from the marketplace",1,"info-label-group","mb-4"],[1,"row"],["matTooltipPosition","above",1,"info-label-group","mb-4",3,"matTooltip"],["matTooltipPosition","above","matTooltip","Choose Reason to Write Off",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label"),a(6,"Payment Method"),i(),n(7,"div")(8,"span"),a(9),i()()()()(),n(10,"div",5)(11,"div",3)(12,"div",6)(13,"label"),a(14,"Marketplace Payment Settlement"),i(),n(15,"div")(16,"span"),a(17),i()()()(),m(18,St,7,1,"div",3),i()()()),r&2&&(l(4),D("bg-gradient-warning",!o.data().POSInvoicePaymentMethod),l(5),p(o.data().POSInvoicePaymentMethod),l(3),f("matTooltip",Q(o.getPaymentSyncTooltip())),l(5),p(o.getPaymentSyncStateEnum),l(),s(o.data().PaymentSyncTypeID==2?18:-1))},dependencies:[y,x],encapsulation:2,changeDetection:0})}}return e})();function Tt(e,d){if(e&1&&(T(0,"tr")(1,"td"),a(2),E(),T(3,"td"),a(4),E(),T(5,"td"),a(6),E()()),e&2){let t=d.$implicit;l(2),p(t.topic),l(2),p(t.addressWithoutHost),l(),D("bg-gradient-warning",!t.enabled),l(),I(" ",t.enabled?"ENABLED":"DISABLED"," ")}}function Et(e,d){e&1&&(T(0,"table",4)(1,"thead",5)(2,"tr")(3,"th",6),a(4,"Event"),E(),T(5,"th",7),a(6,"Url"),E(),T(7,"th",6),a(8,"State"),E()()(),T(9,"tbody"),F(10,Tt,7,5,"tr",null,J),E()()),e&2&&(l(10),V(d))}var $e=(()=>{class e{constructor(){this.shopifyWebhookService=g(oe),this.wooCommerceService=g(ae),this.channel=C(void 0),this.webhooks=ne({params:()=>this.channel(),stream:()=>{let t=this.channel();if(!t)return U([]);switch(t.TypeID){case S.Shopify:return this.shopifyWebhookService.getWebhookWithState(t.ID);case S.ShopifyV2:return this.shopifyWebhookService.getWebhookWithStateV2(t.ID);case S.WooCommerce:return this.wooCommerceService.getWebhookWithState(t.ID);default:return U([])}}})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-webhook-config-info"]],inputs:{channel:[1,"channel"]},decls:6,vars:1,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-12"],[1,"table","mb-6","w-50"],[1,"thead-light"],["scope","col",2,"width","100px"],["scope","col"]],template:function(r,o){if(r&1&&(T(0,"div",0)(1,"div")(2,"div",1)(3,"div",2)(4,"div",3),m(5,Et,12,0,"table",4),E()()()()()),r&2){let h;l(5),s((h=o.webhooks.value())?5:-1,h)}},encapsulation:2,changeDetection:0})}}return e})();function Dt(e,d){if(e&1){let t=O();n(0,"span",10),_("click",function(o){return M(t),w(o.stopPropagation())}),n(1,"span",11),b(2,"img",12),i(),n(3,"span",13)(4,"span",14),a(5,"Customer Default Email"),i(),n(6,"button",15),_("click",function(o){M(t);let h=c();return w(h.closeDefaultEmailHelp(o))}),b(7,"i",16),i()(),n(8,"span",17),a(9,"Change the customer's name from the order in the marketplace according to this email, so the customer recorded in the DealPOS Invoice becomes one."),i()()}if(e&2){let t=c();l(2),f("src",t.defaultEmailHelpImageUrl,q)}}function It(e,d){if(e&1&&(n(0,"div",3)(1,"div",18)(2,"label"),a(3,"Category"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.categoryLabel.value())}}function Mt(e,d){if(e&1&&(n(0,"div",3)(1,"div",19)(2,"label"),a(3,"Brand"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().Brand)}}function wt(e,d){if(e&1&&(n(0,"div",3)(1,"div",20)(2,"label"),a(3,"ScanProductSize"),i(),n(4,"div")(5,"span"),a(6),i()()()()),e&2){let t=c();l(6),p(t.data().ScanProductSize)}}var qe=(()=>{class e{constructor(){this.data=C(void 0),this.categoryService=g(Re),this.channelType=S,this.categoryLabel=ne({params:()=>this.data(),stream:()=>this.data()?this.categoryService.getCategories(this.data().TypeID,this.data().ID).pipe(ue(t=>{let r=this.categoryService.searchByIdWithParentDFS(t,this.data().DefaultCategoryID),o="";return r&&(o=Se.getLabelPathTree(r)),o})):U("")}),this.showDefaultEmailHelp=z(!1),this.defaultEmailHelpImageUrl="https://dealpos-media.b-cdn.net/omni/helper/chrome_gyfptsvzks.png?quality=75&format=webp"}openDefaultEmailHelp(t){t.stopPropagation(),this.showDefaultEmailHelp.set(!0)}closeDefaultEmailHelp(t){t.stopPropagation(),this.showDefaultEmailHelp.set(!1)}onDocumentClick(t){if(!this.showDefaultEmailHelp())return;t.target.closest(".help-anchor")||this.showDefaultEmailHelp.set(!1)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-default-config-info"]],hostBindings:function(r,o){r&1&&_("click",function(k){return o.onDocumentClick(k)},ve)},inputs:{data:[1,"data"]},decls:17,vars:6,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Change the customer's name from the order in the marketplace according this email",1,"info-label-group"],[1,"default-email-label"],[1,"help-anchor","ms-1"],["type","button","matTooltip","What is Customer Email?","matTooltipPosition","above","aria-label","What is Customer Email?",1,"help-trigger",3,"click"],["aria-hidden","true",1,"fa-solid","fa-circle-info"],["role","dialog","aria-label","Customer Default Email help",1,"default-email-help-card"],["role","dialog","aria-label","Customer Default Email help",1,"default-email-help-card",3,"click"],[1,"help-media"],["alt","Customer Default Email example",3,"src"],[1,"help-head"],[1,"help-title"],["type","button","aria-label","Close help",1,"help-close",3,"click"],["aria-hidden","true",1,"fa-solid","fa-xmark"],[1,"help-caption"],["matTooltipPosition","above","matTooltip","Set default category for uploading product to channel",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Brand name for product upload",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Customize Scan Product Size",1,"info-label-group"]],template:function(r,o){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"label",5),a(6,"Customer Default Email "),n(7,"span",6)(8,"button",7),_("click",function(k){return o.openDefaultEmailHelp(k)}),b(9,"i",8),i(),m(10,Dt,10,1,"span",9),i()(),n(11,"div")(12,"span"),a(13),i()()()(),m(14,It,7,1,"div",3),m(15,Mt,7,1,"div",3),m(16,wt,7,1,"div",3),i()()()),r&2&&(l(8),ge("aria-expanded",o.showDefaultEmailHelp()),l(2),s(o.showDefaultEmailHelp()?10:-1),l(3),p(o.data().CustomerDefaultEmail),l(),s(o.data().TypeID!=o.channelType.Shopify&&o.data().TypeID!=o.channelType.Lazada?14:-1),l(),s(o.data().TypeID==o.channelType.Lazada?15:-1),l(),s(o.data().TypeID==o.channelType.Lazada||o.data().TypeID==o.channelType.WooCommerce||o.data().TypeID==o.channelType.Shopee?16:-1))},dependencies:[y,x],styles:['.default-email-label[_ngcontent-%COMP%]{display:inline-flex!important;align-items:center;white-space:nowrap}.help-anchor[_ngcontent-%COMP%]{position:relative;display:inline-flex;align-items:center}.help-trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:0 1px;border:0;background:transparent;color:#8a97a8;font-size:13px;cursor:pointer;line-height:1;transition:color .15s ease}.help-trigger[_ngcontent-%COMP%]:hover{color:#0d6efd}.help-trigger[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0d6efd;outline-offset:2px;border-radius:50%}.help-trigger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block}.default-email-help-card[_ngcontent-%COMP%]{position:absolute;top:50%;left:calc(100% + 12px);transform:translateY(-50%);z-index:1060;display:block;width:300px;padding:12px 12px 14px;background:#fff;border:1px solid #e3e8f0;border-radius:18px;box-shadow:0 18px 50px #1018282e;white-space:normal;text-align:left;cursor:default}.default-email-help-card[_ngcontent-%COMP%]:before{content:"";position:absolute;top:50%;left:-7px;margin-top:-7px;width:14px;height:14px;background:#fff;border-left:1px solid #e3e8f0;border-bottom:1px solid #e3e8f0;transform:rotate(45deg);border-bottom-left-radius:3px}.default-email-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%]{display:block;overflow:hidden;border-radius:12px;background:#fdf1cd}.default-email-help-card[_ngcontent-%COMP%] .help-media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:block;width:100%;height:172px;object-fit:cover;border-radius:12px;background:#fdf1cd}.default-email-help-card[_ngcontent-%COMP%] .help-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 4px 4px}.default-email-help-card[_ngcontent-%COMP%] .help-title[_ngcontent-%COMP%]{display:block;color:#1f2430;font-family:Roboto Slab,serif;font-size:15px;font-weight:700;line-height:1.3}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 auto;padding:0;border:0;border-radius:50%;background:transparent;color:#8a97a8;font-size:14px;cursor:pointer;line-height:1;transition:background .15s ease,color .15s ease}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:hover{background:#eef1f6;color:#1f2430}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0d6efd;outline-offset:2px}.default-email-help-card[_ngcontent-%COMP%] .help-close[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block}.default-email-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%]{display:block;margin:0 4px;color:#5b6b7f;font-family:Roboto,sans-serif;font-size:13px;font-weight:400;line-height:1.55}.default-email-help-card[_ngcontent-%COMP%] .help-caption[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:normal;color:#0d6efd;font-weight:700;padding:0 1px}@media(max-width:576px){.default-email-help-card[_ngcontent-%COMP%]{width:min(260px,70vw)}}'],changeDetection:0})}}return e})();function kt(e,d){if(e&1&&(T(0,"tr")(1,"td",4),a(2),E(),T(3,"td",4),a(4),E()()),e&2){let t=d.$implicit;l(2),I(" ",t.Name," "),l(2),I(" ",t.ProductInventoryOutlet," ")}}var Ke=(()=>{class e{constructor(){this.warehouseLocations=C([])}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-warehouse-config-info"]],inputs:{warehouseLocations:[1,"warehouseLocations"]},decls:12,vars:0,consts:[[1,"card","pt-12","border-top-0","rounded-0","rounded-bottom"],[1,"card-body"],[1,"table","table-bordered","mb-12","w-50"],[1,"table-light"],[1,"text-start"]],template:function(r,o){r&1&&(T(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead")(4,"tr",3)(5,"th",4),a(6,"Channel Warehouse"),E(),T(7,"th",4),a(8,"DealPOS Outlet"),E()()(),T(9,"tbody"),F(10,kt,5,2,"tr",null,J),E()()()()),r&2&&(l(10),V(o.warehouseLocations()))},dependencies:[Ne],encapsulation:2,changeDetection:0})}}return e})();var me=e=>[e],Je=e=>({ID:e}),Qe=e=>["/menu/channel/marketplace/form",e];function Pt(e,d){}function Ot(e,d){}function Lt(e,d){if(e&1){let t=O();n(0,"div",7)(1,"a",8),a(2,"Edit"),i(),b(3,"button",9),n(4,"ul",10)(5,"li",11)(6,"a",12),_("click",function(){M(t);let o=c(2);return w(o.onDelete(o.channel()))}),a(7,"Delete"),i()()()()}if(e&2){let t,r=c(2);l(),f("routerLink",A(3,Qe,A(1,Je,(t=r.channel())==null?null:t.ID)))}}function Wt(e,d){if(e&1&&(n(0,"button",8),a(1," Edit "),i()),e&2){let t,r=c(2);f("routerLink",A(3,Qe,A(1,Je,(t=r.channel())==null?null:t.ID)))}}function At(e,d){if(e&1&&K(0,Ot,0,0,"ng-template",5)(1,Lt,8,5,"ng-template",null,2,j)(3,Wt,2,5,"ng-template",null,3,j),e&2){let t=B(2),r=B(4),o=c();f("ngxPermissionsOnly",A(3,me,o.roleChannelDelete))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",r)}}function Nt(e,d){if(e&1){let t=O();n(0,"button",14),_("click",function(){M(t);let o=c(2);return w(o.onDelete(o.channel()))}),a(1," Delete "),i()}}function Rt(e,d){if(e&1&&K(0,Nt,2,0,"ng-template",13),e&2){let t=c();f("ngxPermissionsOnly",A(1,me,t.roleChannelDelete))}}function zt(e,d){e&1&&(n(0,"button",26),a(1," Multi Warehouse "),i())}function Ft(e,d){e&1&&(n(0,"button",28),a(1," Webhook "),i())}function Vt(e,d){if(e&1&&(n(0,"div",40),b(1,"app-webhook-config-info",17),i()),e&2){let t=c(2);l(),f("channel",t.channel())}}function Ht(e,d){if(e&1&&(n(0,"span"),a(1),i()),e&2){let t,r=c(2);l(),I("/",(t=r.channel())==null?null:t.Creator)}}function Ut(e,d){if(e&1&&(n(0,"span"),a(1),i()),e&2){let t,r=c(3);l(),I("/",(t=r.channel())==null?null:t.Creator)}}function Bt(e,d){if(e&1&&(n(0,"div")(1,"span",45),a(2,"Modified:"),i(),a(3),P(4,"date"),m(5,Ut,2,1,"span"),i()),e&2){let t,r,o=c(2);l(3),I(" ",W(4,2,(t=o.channel())==null?null:t.Modified,"dd MMM yyyy HH:mm")," "),l(2),s((r=o.channel())!=null&&r.Creator?5:-1)}}function jt(e,d){if(e&1){let t=O();n(0,"div",6)(1,"div",15)(2,"div",16),b(3,"app-marketplace-config-info",17),i(),n(4,"div",18),b(5,"app-sync-config-info",17),i()(),n(6,"div",15)(7,"div",19)(8,"nav")(9,"div",20)(10,"button",21),a(11," Outlet "),i(),n(12,"button",22),a(13," Orders "),i(),n(14,"button",23),a(15," Platform Fee "),i(),n(16,"button",24),a(17," Advanced "),i(),n(18,"button",25),a(19," Authorization "),i(),m(20,zt,2,0,"button",26),n(21,"button",27),a(22," Default "),i(),m(23,Ft,2,0,"button",28),i()(),n(24,"div",29)(25,"div",30),b(26,"app-outlet-config-info",31),i(),n(27,"div",32),b(28,"app-orders-config-info",31),i(),n(29,"div",33),b(30,"app-invoiceFee-config-info",31),i(),n(31,"div",34),b(32,"app-advanced-config-info",31),i(),n(33,"div",35)(34,"app-authorized-config-info",36),_("onSuccessRefrehToken",function(){M(t);let o=c();return w(o.onGetChannel())}),i()(),n(35,"div",37),b(36,"app-warehouse-config-info",38),i(),n(37,"div",39),b(38,"app-default-config-info",31),i(),m(39,Vt,2,1,"div",40),i()()(),n(40,"div",41)(41,"div",42),b(42,"i",43),n(43,"div",44)(44,"span",45),a(45,"Created:"),i(),a(46),P(47,"date"),m(48,Ht,2,1,"span"),i(),m(49,Bt,6,5,"div"),i()()()}if(e&2){let t,r,o,h,k,se,G,fe,u=c();l(3),f("channel",u.channel()),l(2),f("channel",u.channel()),l(13),D("bg-gradient-danger",!((t=u.channel())!=null&&t.Authorized)),l(2),s(((r=u.channel())==null||r.WarehouseLocations==null?null:r.WarehouseLocations.length)>0&&((r=u.channel())!=null&&r.MultiWarehouse)?20:-1),l(3),s(u.channelType.Shopify==((o=u.channel())==null?null:o.TypeID)||u.channelType.ShopifyV2==((o=u.channel())==null?null:o.TypeID)||u.channelType.WooCommerce==((o=u.channel())==null?null:o.TypeID)?23:-1),l(3),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("data",u.channel()),l(2),f("warehouseLocations",(h=u.channel())==null?null:h.WarehouseLocations),l(2),f("data",u.channel()),l(),s(u.channelType.Shopify==((k=u.channel())==null?null:k.TypeID)||u.channelType.ShopifyV2==((k=u.channel())==null?null:k.TypeID)||u.channelType.WooCommerce==((k=u.channel())==null?null:k.TypeID)?39:-1),l(7),I(" ",W(47,17,(se=u.channel())==null?null:se.Created,"dd MMM yyyy HH:mm")," "),l(2),s(!((G=u.channel())!=null&&G.Modified)&&((G=u.channel())!=null&&G.Creator)?48:-1),l(),s((fe=u.channel())!=null&&fe.Modified?49:-1)}}var Zi=(()=>{class e{constructor(){this.route=g(Ee),this.http=g(Te),this.router=g(De),this.toastr=g(ee),this.destroyRef=g($),this.channel=z(void 0),this.roleChannelEdit=de.ChannelEdit,this.roleChannelDelete=de.ChannelDelete,this.channelType=S,this.route.queryParams.pipe(N(this.destroyRef)).subscribe(t=>{this.ID=t.ID}),this.ID!=null&&this.onGetChannel()}onGetChannel(){var t={ID:this.ID};this.http.post("/api/ChannelLoader/GetChannelView",t).pipe(N(this.destroyRef)).subscribe(r=>{this.channel.set(r.Model),this.channel().LogMode==1?this.channel.update(o=>(o.LogModeLabel="None",o)):this.channel().LogMode==2?this.channel.update(o=>(o.LogModeLabel="Error",o)):this.channel().LogMode==3&&this.channel.update(o=>(o.LogModeLabel="Full",o))})}onDelete(t){if(confirm("Delete channel "+t.Name+" ?")){var o={ID:t.ID};this.http.post("/api/Channel/DeleteChannel",o).pipe(N(this.destroyRef)).subscribe(h=>{this.toastr.success("Channel "+t.Name+" is deleted!","Success",{closeButton:!0,positionClass:"toast-bottom-right"}),this.router.navigate(["menu/channel"])})}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-marketplace-view"]],features:[X([oe,ae])],decls:9,vars:9,consts:[["CHANNEL_EDIT",""],["CHANNEL_DELETE",""],["ALL_BUTTON",""],["EDIT_ONLY",""],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],[1,"container-fluid","py-5","bg-light-gray"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end","pointer"],[1,"dropdown-item"],["role","button",1,"fs-5",3,"click"],[3,"ngxPermissionsOnly"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"row"],[1,"col-8"],[3,"channel"],[1,"col-4"],[1,"col-12"],["id","nav-tab","role","tablist",1,"nav","nav-tabs"],["id","nav-outlet-config-tab","data-bs-toggle","tab","data-bs-target","#nav-outlet-config","type","button","role","tab","aria-controls","nav-outlet-config","aria-selected","true",1,"nav-link","active"],["id","nav-order-config-tab","data-bs-toggle","tab","data-bs-target","#nav-order-config","type","button","role","tab","aria-controls","nav-order-config","aria-selected","false",1,"nav-link"],["id","nav-service-fee-tab","data-bs-toggle","tab","data-bs-target","#nav-service-fee","type","button","role","tab","aria-controls","nav-service-fee","aria-selected","false",1,"nav-link"],["id","nav-advanced-tab","data-bs-toggle","tab","data-bs-target","#nav-advanced","type","button","role","tab","aria-controls","nav-advanced","aria-selected","false",1,"nav-link"],["id","nav-advanced-tab","data-bs-toggle","tab","data-bs-target","#nav-authorized","type","button","role","tab","aria-controls","nav-authorized","aria-selected","false",1,"nav-link"],["id","nav-warehouse-tab","data-bs-toggle","tab","data-bs-target","#nav-warehouse","type","button","role","tab","aria-controls","nav-warehouse","aria-selected","false",1,"nav-link"],["id","nav-default-tab","data-bs-toggle","tab","data-bs-target","#nav-default","type","button","role","tab","aria-controls","nav-default","aria-selected","false",1,"nav-link"],["id","nav-webhook-tab","data-bs-toggle","tab","data-bs-target","#nav-webhook","type","button","role","tab","aria-controls","nav-webhook","aria-selected","false",1,"nav-link"],["id","nav-tabContent",1,"tab-content"],["id","nav-outlet-config","role","tabpanel","aria-labelledby","nav-outlet-config-tab",1,"tab-pane","fade","show","active"],[3,"data"],["id","nav-order-config","role","tabpanel","aria-labelledby","nav-order-config-tab",1,"tab-pane","fade"],["id","nav-service-fee","role","tabpanel","aria-labelledby","nav-service-fee-tab",1,"tab-pane","fade"],["id","nav-advanced","role","tabpanel","aria-labelledby","nav-advanced-tab",1,"tab-pane","fade"],["id","nav-authorized","role","tabpanel","aria-labelledby","nav-authorized-tab",1,"tab-pane","fade"],[3,"onSuccessRefrehToken","data"],["id","nav-warehouse","role","tabpanel","aria-labelledby","nav-warehouse-tab",1,"tab-pane","fade"],[3,"warehouseLocations"],["id","nav-default","role","tabpanel","aria-labelledby","nav-default-tab",1,"tab-pane","fade"],["id","nav-webhook","role","tabpanel","aria-labelledby","nav-webhook-tab",1,"tab-pane","fade"],[1,"alert","alert-warning","w-100"],[1,"d-flex","align-items-center","justify-content-start","p-4"],["aria-hidden","true",1,"fa-regular","fa-file","me-5"],[1,"me-2"],[1,"fw-bold"]],template:function(r,o){if(r&1&&(n(0,"mainpanel",4)(1,"actions"),K(2,Pt,0,0,"ng-template",5)(3,At,5,5,"ng-template",null,0,j)(5,Rt,1,3,"ng-template",null,1,j),i(),n(7,"content"),m(8,jt,50,20,"div",6),i()()),r&2){let h=B(4),k=B(6);f("headerTitle","Marketplace Configuration View")("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),f("ngxPermissionsOnly",A(7,me,o.roleChannelEdit))("ngxPermissionsOnlyThen",h)("ngxPermissionsOnlyElse",k),l(6),s(o.channel()?8:-1)}},dependencies:[Ve,He,Ue,Be,je,Ye,Ge,qe,$e,Ae,Me,Ie,ke,we,Ke,H],styles:[".tab-pane[_ngcontent-%COMP%]{margin-top:0!important}@media(max-width:991px){.container-fluid[_ngcontent-%COMP%]{padding:0 8px}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}[class*=col-][_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;flex:0 0 100%!important;margin-bottom:20px}.card[_ngcontent-%COMP%]{margin-bottom:20px;min-width:0}.card-title[_ngcontent-%COMP%]{font-size:1.2rem;margin-left:0!important;margin-top:0!important}.table-responsive[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{font-size:13px;min-width:500px}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:6px 4px!important;word-break:break-word}.btn-sm[_ngcontent-%COMP%]{font-size:11px!important;padding:4px 8px!important}.mt-5[_ngcontent-%COMP%], .mt-6[_ngcontent-%COMP%], .my-6[_ngcontent-%COMP%], .ms-10[_ngcontent-%COMP%]{margin-top:12px!important;margin-bottom:12px!important;margin-left:0!important}}@media(max-width:600px){.container-fluid[_ngcontent-%COMP%]{padding:0 2px}.card-title[_ngcontent-%COMP%]{font-size:1rem}.table[_ngcontent-%COMP%]{font-size:12px}.card-body[_ngcontent-%COMP%]{padding:10px!important}.table-responsive[_ngcontent-%COMP%]{min-width:0}.btn-sm[_ngcontent-%COMP%]{min-width:60px;font-size:11px;padding:3px 6px!important}img[_ngcontent-%COMP%]{max-width:90%;height:auto}}"],changeDetection:0})}}return e})();export{Zi as MarketplaceViewComponent};
@@ -1 +1 @@
1
- import{a as ue,b as fe}from"./chunk-JWHT7LUS.js";import{a as _e}from"./chunk-ZZ3M52QJ.js";import{a as x}from"./chunk-ISMIPSYN.js";import{c as Ce,d as V,e as T}from"./chunk-SA4KQTJY.js";import"./chunk-4O2VD4QF.js";import"./chunk-BYK4XSP4.js";import"./chunk-G346YBOK.js";import"./chunk-SJBVLNCR.js";import"./chunk-32F5EUMW.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as me}from"./chunk-NH7UFKXO.js";import{a as ge}from"./chunk-6YRYXHZS.js";import"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as he}from"./chunk-4B3WJSEV.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-NVFDCME2.js";import"./chunk-BGFEVOPZ.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as ce,e as pe}from"./chunk-474G6BPL.js";import{a as se,b as de}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as le}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import{a as O,b as F}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as te}from"./chunk-ZSUWHVKX.js";import{f as w}from"./chunk-SBU2S3NF.js";import"./chunk-SIRLG5JS.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as N}from"./chunk-63X2BBS4.js";import{b as Z,c as ee}from"./chunk-MDHMVGYC.js";import{c as v}from"./chunk-NNVT5X6O.js";import{c as ne,h as ie,m as oe,o as re,z as ae}from"./chunk-7HUEGPJN.js";import{b as X,e as Y}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{z as q}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as P,C as R,Da as B,Eb as H,Ic as C,S as L,Vc as j,Xb as b,Xc as K,Zb as y,ca as U,cc as g,dc as l,ec as d,ed as J,fc as z,fd as Q,gb as m,ha as c,jc as G,kc as $,mc as I,md as W,oa as p,pa as h,rc as u,tc as f,ua as k,yb as A}from"./chunk-5VYDZBNH.js";import{a as _,b as S}from"./chunk-QWWW7GFA.js";var E=(()=>{class a{constructor(){this.authService=c(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],r;return e.forEach(n=>{r=t.find(s=>s.ID==n?.parent?.id),r&&(r=S(_({},r),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(r))}),o.forEach(n=>{r=t.find(s=>s.ID==n.id),r&&i.push(r)}),i}generateFilterLocation(e,o){let t=[],i=[],r=[];return e.length>0?(t=e.map(n=>n.id),i=e.filter(n=>v.IsNotEmpty(n?.parent?.id)).map(n=>n?.parent?.id).filter((n,s,D)=>D.indexOf(n)===s)):(t=[],i=[]),r=o.map(n=>n.id),r=r.concat(i).filter((n,s,D)=>D.indexOf(n)===s),{locationIds:t,channelIds:r}}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275prov=U({token:a,factory:a.\u0275fac})}}return a})();var Pe=a=>[a];function ve(a,M){if(a&1){let e=I();l(0,"button",17),u("click",function(){p(e);let t=f(2),i=f();return h(i.onUpdateItems(t))}),z(1,"i",18),C(2," Update "),d()}}function Me(a,M){if(a&1&&(G(0),b(1,ve,3,0,"button",16),$()),a&2){let e=f(),o=f();m(),y(o.productService.hasSelectionVariant(e)?1:-1)}}function be(a,M){if(a&1&&(l(0,"actions")(1,"div",14),H(2,Me,2,1,"ng-container",15),d()()),a&2){let e=f();m(2),g("ngxPermissionsOnly",K(1,Pe,e.inventoryUpdateRole))}}function ye(a,M){if(a&1){let e=I();l(0,"app-table",19),u("onToggle",function(t){p(e);let i=f();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=f();return h(i.updateStockByVariant(t))}),d()}if(a&2){let e=f();g("data",M)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ct=(()=>{class a{constructor(){this.http=c(Y),this.toastr=c(X),this.dialog=c(le),this.productService=c(he),this.authService=c(w),this.mainPanelService=c(se),this.placeholderService=c(me),this.destroyRef=c(k),this.paginationService=c(V),this.multiChannelService=c(E),this.updateResHandling=c(T),this.hiddenIPOSInventory=W(()=>this.paginationService.hiddenPOSInventory()),this.channelOptions=this.authService.getChannels(),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.searchFilter=P({PageNumber:1,RowCount:100}),this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(L(1)),this.loaderData=F(this.loader$,{initialValue:null}),this.data=F(this.paginationService.data$,{initialValue:[]}),this.selectedLocations=P([]),this.selectedChannels=P([]),this.channels=P([]),this.inventoryUpdateRole=te.InventoryUpdate,this.searchPlaceholder=P("Search ..."),this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,B(()=>{let e=this.loaderData();if(!e)return;let o={PageNumber:e.Filter.PageNumber,filterModel:x.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator};this.searchFilter.set(o),this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(o.SearchType,o.NumberFilterComparator)),this.mainPanelService.openModalFilter()})}onChannelChange(e=[]){let o=e.filter(i=>v.isValidGUID(i.id)==!1),t=e.filter(i=>v.isValidGUID(i.id));this.selectedLocations.set(o),this.selectedChannels.set(t)}onSearch(e){let o=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(o);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.update(i=>S(_({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(s=>{t.push({ChannelItemID:s?.ChannelItemID,ChannelVariationID:s?.ChannelVariationID,Inventory:n.Inventory,LocationID:s?.LocationID})})});let r={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(N.UpdateInventoryChannel,r).pipe(O(this.destroyRef)).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let s=0;s<n?.length;s++)this.handlingUpdateStock(n[s])})}}updateStockByVariant(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(N.UpdateUpdateQuantityByItem,t).pipe(O(this.destroyRef)).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter()),this.handlingUpdateStock(i)})}handlingUpdateStock(e){if(e){let o=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){this.searchFilter.update(o=>S(_({},o),{filterModel:e?x.DIFFERENCE:x.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(r=>r.ID===i.ID));this.dialog.open(ue,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i)),O(this.destroyRef)).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>S(_({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=A({type:a,selectors:[["app-multi-channel-comparison"]],features:[j([V,E,T])],decls:31,vars:20,consts:[["headerTitle","Inventory Comparison","textButton","Search","filterDialogWidth","625px",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","id","PageNumber","placeholder","Page Number","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["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(o,t){if(o&1){let i=I();l(0,"mainpanel",0),u("onSubmit",function(n){return p(i),h(t.onSearch(n))}),b(1,be,3,3,"actions"),l(2,"filters")(3,"div",1)(4,"div",2)(5,"h6"),C(6,"Channel"),d(),l(7,"multiwarehouse-tree-select",3),u("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),l(8,"div",4)(9,"h6"),C(10,"Number Filter Comparator"),d(),l(11,"ng-select",5),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))}),d()(),l(12,"div",4)(13,"h6"),C(14,"Search Type"),d(),l(15,"radio-options",6),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),l(16,"div",4)(17,"h6"),C(18,"Page Number"),d(),l(19,"input",7),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),l(20,"div",4)(21,"h6"),C(22,"Page Size"),d(),l(23,"input",8),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()()(),l(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),b(28,ye,1,4,"app-table",12),l(29,"infinite-paginator",13),J(30,"async"),u("onNextPage",function(){return p(i),h(t.paginationService.onNextPage(t.searchFilter()))})("onLastPage",function(){return p(i),h(t.paginationService.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return p(i),h(t.paginationService.getRowCount(t.searchFilter()))}),d()()()()()()}if(o&2){let i,r;g("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),y((i=t.data())?1:-1,i);let n=t.loaderData();m(6),g("multiple",!0),m(4),g("items",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",t.searchFilter().NumberFilterComparator),m(4),g("options",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",t.searchFilter().SearchType),m(4),g("ngModel",t.searchFilter().PageNumber),m(4),g("ngModel",t.searchFilter().RowCount),m(5),y((r=t.data())?28:-1,r),m(),g("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",Q(30,18,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[de,fe,ae,ne,re,ie,oe,Ce,_e,ee,Z,pe,ce,ge,q],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select{display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-float-label{padding:0;display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect{display:flex;align-items:center;box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;padding:0 .75rem!important;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect:not(.p-disabled).p-focus{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect-label-container{display:flex;align-items:center;flex:1 1 auto;min-height:0;overflow:hidden;padding:0}"],changeDetection:0})}}return a})();export{ct as MultiChannelComparison};
1
+ import{a as ue,b as fe}from"./chunk-S6QMTTJG.js";import{a as _e}from"./chunk-ZZ3M52QJ.js";import{a as x}from"./chunk-ISMIPSYN.js";import{c as Ce,d as V,e as T}from"./chunk-SA4KQTJY.js";import"./chunk-4O2VD4QF.js";import"./chunk-BYK4XSP4.js";import"./chunk-G346YBOK.js";import"./chunk-SJBVLNCR.js";import"./chunk-32F5EUMW.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as me}from"./chunk-NH7UFKXO.js";import{a as ge}from"./chunk-6YRYXHZS.js";import"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as he}from"./chunk-6OBHYVWL.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-6Z77GYRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as ce,e as pe}from"./chunk-474G6BPL.js";import{a as se,b as de}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as le}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import{a as O,b as F}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as te}from"./chunk-ZSUWHVKX.js";import{f as w}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as N}from"./chunk-63X2BBS4.js";import{b as Z,c as ee}from"./chunk-MDHMVGYC.js";import{c as v}from"./chunk-NNVT5X6O.js";import{c as ne,h as ie,m as oe,o as re,z as ae}from"./chunk-7HUEGPJN.js";import{b as X,e as Y}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{z as q}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as P,C as R,Da as B,Eb as H,Ic as C,S as L,Vc as j,Xb as b,Xc as K,Zb as y,ca as U,cc as g,dc as l,ec as d,ed as J,fc as z,fd as Q,gb as m,ha as c,jc as G,kc as $,mc as I,md as W,oa as p,pa as h,rc as u,tc as f,ua as k,yb as A}from"./chunk-5VYDZBNH.js";import{a as _,b as S}from"./chunk-QWWW7GFA.js";var E=(()=>{class a{constructor(){this.authService=c(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],r;return e.forEach(n=>{r=t.find(s=>s.ID==n?.parent?.id),r&&(r=S(_({},r),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(r))}),o.forEach(n=>{r=t.find(s=>s.ID==n.id),r&&i.push(r)}),i}generateFilterLocation(e,o){let t=[],i=[],r=[];return e.length>0?(t=e.map(n=>n.id),i=e.filter(n=>v.IsNotEmpty(n?.parent?.id)).map(n=>n?.parent?.id).filter((n,s,D)=>D.indexOf(n)===s)):(t=[],i=[]),r=o.map(n=>n.id),r=r.concat(i).filter((n,s,D)=>D.indexOf(n)===s),{locationIds:t,channelIds:r}}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275prov=U({token:a,factory:a.\u0275fac})}}return a})();var Pe=a=>[a];function ve(a,M){if(a&1){let e=I();l(0,"button",17),u("click",function(){p(e);let t=f(2),i=f();return h(i.onUpdateItems(t))}),z(1,"i",18),C(2," Update "),d()}}function Me(a,M){if(a&1&&(G(0),b(1,ve,3,0,"button",16),$()),a&2){let e=f(),o=f();m(),y(o.productService.hasSelectionVariant(e)?1:-1)}}function be(a,M){if(a&1&&(l(0,"actions")(1,"div",14),H(2,Me,2,1,"ng-container",15),d()()),a&2){let e=f();m(2),g("ngxPermissionsOnly",K(1,Pe,e.inventoryUpdateRole))}}function ye(a,M){if(a&1){let e=I();l(0,"app-table",19),u("onToggle",function(t){p(e);let i=f();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=f();return h(i.updateStockByVariant(t))}),d()}if(a&2){let e=f();g("data",M)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ct=(()=>{class a{constructor(){this.http=c(Y),this.toastr=c(X),this.dialog=c(le),this.productService=c(he),this.authService=c(w),this.mainPanelService=c(se),this.placeholderService=c(me),this.destroyRef=c(k),this.paginationService=c(V),this.multiChannelService=c(E),this.updateResHandling=c(T),this.hiddenIPOSInventory=W(()=>this.paginationService.hiddenPOSInventory()),this.channelOptions=this.authService.getChannels(),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.searchFilter=P({PageNumber:1,RowCount:100}),this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(L(1)),this.loaderData=F(this.loader$,{initialValue:null}),this.data=F(this.paginationService.data$,{initialValue:[]}),this.selectedLocations=P([]),this.selectedChannels=P([]),this.channels=P([]),this.inventoryUpdateRole=te.InventoryUpdate,this.searchPlaceholder=P("Search ..."),this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,B(()=>{let e=this.loaderData();if(!e)return;let o={PageNumber:e.Filter.PageNumber,filterModel:x.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator};this.searchFilter.set(o),this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(o.SearchType,o.NumberFilterComparator)),this.mainPanelService.openModalFilter()})}onChannelChange(e=[]){let o=e.filter(i=>v.isValidGUID(i.id)==!1),t=e.filter(i=>v.isValidGUID(i.id));this.selectedLocations.set(o),this.selectedChannels.set(t)}onSearch(e){let o=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(o);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.update(i=>S(_({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(s=>{t.push({ChannelItemID:s?.ChannelItemID,ChannelVariationID:s?.ChannelVariationID,Inventory:n.Inventory,LocationID:s?.LocationID})})});let r={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(N.UpdateInventoryChannel,r).pipe(O(this.destroyRef)).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let s=0;s<n?.length;s++)this.handlingUpdateStock(n[s])})}}updateStockByVariant(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(N.UpdateUpdateQuantityByItem,t).pipe(O(this.destroyRef)).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter()),this.handlingUpdateStock(i)})}handlingUpdateStock(e){if(e){let o=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){this.searchFilter.update(o=>S(_({},o),{filterModel:e?x.DIFFERENCE:x.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(r=>r.ID===i.ID));this.dialog.open(ue,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i)),O(this.destroyRef)).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>S(_({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||a)}}static{this.\u0275cmp=A({type:a,selectors:[["app-multi-channel-comparison"]],features:[j([V,E,T])],decls:31,vars:20,consts:[["headerTitle","Inventory Comparison","textButton","Search","filterDialogWidth","625px",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","id","PageNumber","placeholder","Page Number","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["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(o,t){if(o&1){let i=I();l(0,"mainpanel",0),u("onSubmit",function(n){return p(i),h(t.onSearch(n))}),b(1,be,3,3,"actions"),l(2,"filters")(3,"div",1)(4,"div",2)(5,"h6"),C(6,"Channel"),d(),l(7,"multiwarehouse-tree-select",3),u("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),l(8,"div",4)(9,"h6"),C(10,"Number Filter Comparator"),d(),l(11,"ng-select",5),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))}),d()(),l(12,"div",4)(13,"h6"),C(14,"Search Type"),d(),l(15,"radio-options",6),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),l(16,"div",4)(17,"h6"),C(18,"Page Number"),d(),l(19,"input",7),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),l(20,"div",4)(21,"h6"),C(22,"Page Size"),d(),l(23,"input",8),u("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()()(),l(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),b(28,ye,1,4,"app-table",12),l(29,"infinite-paginator",13),J(30,"async"),u("onNextPage",function(){return p(i),h(t.paginationService.onNextPage(t.searchFilter()))})("onLastPage",function(){return p(i),h(t.paginationService.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return p(i),h(t.paginationService.getRowCount(t.searchFilter()))}),d()()()()()()}if(o&2){let i,r;g("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),y((i=t.data())?1:-1,i);let n=t.loaderData();m(6),g("multiple",!0),m(4),g("items",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",t.searchFilter().NumberFilterComparator),m(4),g("options",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",t.searchFilter().SearchType),m(4),g("ngModel",t.searchFilter().PageNumber),m(4),g("ngModel",t.searchFilter().RowCount),m(5),y((r=t.data())?28:-1,r),m(),g("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",Q(30,18,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[de,fe,ae,ne,re,ie,oe,Ce,_e,ee,Z,pe,ce,ge,q],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select{display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-float-label{padding:0;display:block}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect{display:flex;align-items:center;box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;padding:0 .75rem!important;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect:not(.p-disabled).p-focus{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select .p-treeselect-label-container{display:flex;align-items:center;flex:1 1 auto;min-height:0;overflow:hidden;padding:0}"],changeDetection:0})}}return a})();export{ct as MultiChannelComparison};