marketplacepos 6.40.5 → 6.40.6

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 (71) hide show
  1. package/Marketplace/{chunk-SM7VIBIA.js → chunk-3CVNMIRD.js} +1 -1
  2. package/Marketplace/{chunk-K74P4PZC.js → chunk-3LBIBMVD.js} +1 -1
  3. package/Marketplace/{chunk-LBMITZJU.js → chunk-3W2YCIGV.js} +1 -1
  4. package/Marketplace/{chunk-S3AVAVH4.js → chunk-3XUYZJ2Q.js} +1 -1
  5. package/Marketplace/{chunk-7WHSPXV4.js → chunk-433PDIZ6.js} +1 -1
  6. package/Marketplace/{chunk-NYNATWL7.js → chunk-4ECWS63W.js} +1 -1
  7. package/Marketplace/{chunk-LT73Z4NM.js → chunk-4NS4XXH4.js} +1 -1
  8. package/Marketplace/{chunk-V3I4ENDZ.js → chunk-5KJ6FZV3.js} +1 -1
  9. package/Marketplace/{chunk-RLLQHRSD.js → chunk-5PXKFEXJ.js} +1 -1
  10. package/Marketplace/{chunk-S7PB5GHL.js → chunk-5URFJE6S.js} +1 -1
  11. package/Marketplace/{chunk-Z2CCLRPA.js → chunk-5XMVASNC.js} +1 -1
  12. package/Marketplace/{chunk-6EB35E3V.js → chunk-5ZDE4HEX.js} +1 -1
  13. package/Marketplace/{chunk-S6QMTTJG.js → chunk-633LBKK5.js} +1 -1
  14. package/Marketplace/{chunk-3QRDWKQV.js → chunk-6BMQ7WGT.js} +1 -1
  15. package/Marketplace/{chunk-G3PKFZ5W.js → chunk-6DMTC42K.js} +1 -1
  16. package/Marketplace/{chunk-ES3KODDZ.js → chunk-6FKPQJDO.js} +1 -1
  17. package/Marketplace/{chunk-HDLV53M5.js → chunk-7IUXGEIC.js} +1 -1
  18. package/Marketplace/{chunk-FVLOQT2O.js → chunk-7QBOFWD7.js} +1 -1
  19. package/Marketplace/{chunk-ASAZTN3F.js → chunk-7SCJ7SDD.js} +1 -1
  20. package/Marketplace/{chunk-6Z77GYRF.js → chunk-B3VDRD6N.js} +1 -1
  21. package/Marketplace/{chunk-GNVJVMMI.js → chunk-CJ5C35CU.js} +1 -1
  22. package/Marketplace/{chunk-FF35P4YU.js → chunk-CQT7QBOV.js} +1 -1
  23. package/Marketplace/{chunk-6OBHYVWL.js → chunk-D3CJWU7A.js} +1 -1
  24. package/Marketplace/{chunk-F6VRJLCS.js → chunk-EIA6FD7N.js} +1 -1
  25. package/Marketplace/{chunk-AU5MQHG5.js → chunk-EPME7TI3.js} +1 -1
  26. package/Marketplace/{chunk-5QGLAWLG.js → chunk-FC5HQXAY.js} +1 -1
  27. package/Marketplace/{chunk-DF476PQL.js → chunk-FPM73NBG.js} +1 -1
  28. package/Marketplace/{chunk-44KGK2M2.js → chunk-GPRTUSIV.js} +1 -1
  29. package/Marketplace/{chunk-FD4MMIXT.js → chunk-HBKWMXWJ.js} +1 -1
  30. package/Marketplace/{chunk-STIM35MJ.js → chunk-I6GEE3L6.js} +1 -1
  31. package/Marketplace/{chunk-HZALHTCP.js → chunk-IDHAER6G.js} +1 -1
  32. package/Marketplace/{chunk-EBQYZD7X.js → chunk-IGM3US27.js} +1 -1
  33. package/Marketplace/{chunk-DLGIUDST.js → chunk-IIK43TP2.js} +1 -1
  34. package/Marketplace/{chunk-4UBAIPWP.js → chunk-IWXIEY7P.js} +1 -1
  35. package/Marketplace/{chunk-AMOZNCKA.js → chunk-J3YWZRCH.js} +1 -1
  36. package/Marketplace/{chunk-HNDBTZPW.js → chunk-JA6DYXF4.js} +1 -1
  37. package/Marketplace/{chunk-LVETDZW5.js → chunk-JAKIZJK5.js} +1 -1
  38. package/Marketplace/{chunk-KKF7UJFK.js → chunk-JV5HVOCN.js} +1 -1
  39. package/Marketplace/{chunk-FTAI6WPW.js → chunk-K3LDUME4.js} +1 -1
  40. package/Marketplace/{chunk-TQHULGOC.js → chunk-KAOJ27I7.js} +1 -1
  41. package/Marketplace/{chunk-5JEFCK7E.js → chunk-KEUE6LZH.js} +1 -1
  42. package/Marketplace/{chunk-5QVO5G65.js → chunk-LBOHLOBN.js} +1 -1
  43. package/Marketplace/{chunk-ONPJ35PU.js → chunk-MHDJNL5P.js} +1 -1
  44. package/Marketplace/{chunk-R2IZXW7V.js → chunk-NEBZKLLJ.js} +1 -1
  45. package/Marketplace/{chunk-XLLOA4GZ.js → chunk-O52IISRR.js} +1 -1
  46. package/Marketplace/{chunk-D7ZZBTGD.js → chunk-OPC6AXNI.js} +2 -2
  47. package/Marketplace/{chunk-FGAZE5GC.js → chunk-OWGE7K2W.js} +1 -1
  48. package/Marketplace/{chunk-5YQPG5GC.js → chunk-OXVOQ73C.js} +1 -1
  49. package/Marketplace/{chunk-BXLTUUZK.js → chunk-PFTGGM6D.js} +1 -1
  50. package/Marketplace/{chunk-ARNZCJO2.js → chunk-PMVDIUMD.js} +2 -2
  51. package/Marketplace/{chunk-LF2NPU6J.js → chunk-Q6SNHG2C.js} +1 -1
  52. package/Marketplace/{chunk-BPSXTEWR.js → chunk-QVYJU22X.js} +1 -1
  53. package/Marketplace/{chunk-3ZDCWKY2.js → chunk-RNVFW4LX.js} +1 -1
  54. package/Marketplace/{chunk-OVQATI6V.js → chunk-RU64TR7D.js} +1 -1
  55. package/Marketplace/{chunk-LD4YBZ2V.js → chunk-RXEY6OSI.js} +1 -1
  56. package/Marketplace/{chunk-WUY5JNBR.js → chunk-SWNN3DDD.js} +1 -1
  57. package/Marketplace/{chunk-WV4K6WE3.js → chunk-T3KIHO5Z.js} +1 -1
  58. package/Marketplace/{chunk-OTKBK673.js → chunk-U4CZUZIR.js} +1 -1
  59. package/Marketplace/{chunk-FU7FM5WV.js → chunk-UI4JXZZO.js} +1 -1
  60. package/Marketplace/{chunk-CG2TLBGT.js → chunk-UZ45ORUK.js} +1 -1
  61. package/Marketplace/{chunk-PBUPTPGZ.js → chunk-VCB5XCNX.js} +1 -1
  62. package/Marketplace/{chunk-ISAGLJYX.js → chunk-W2VN6BSX.js} +1 -1
  63. package/Marketplace/chunk-WM7WOQJI.js +2 -0
  64. package/Marketplace/chunk-WN24A4VJ.js +1 -0
  65. package/Marketplace/{chunk-QA64OO3Q.js → chunk-WPZ47AUM.js} +1 -1
  66. package/Marketplace/{chunk-QPCTJKN6.js → chunk-XZG5D6MR.js} +1 -1
  67. package/Marketplace/index.html +2 -2
  68. package/Marketplace/{main-3ICXYZDP.js → main-3WFN3TCM.js} +2 -2
  69. package/package.json +1 -1
  70. package/Marketplace/chunk-5WAEN7KH.js +0 -1
  71. package/Marketplace/chunk-QK2JCSM3.js +0 -2
@@ -1 +1 @@
1
- import{a as Y}from"./chunk-QPCTJKN6.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.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-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{e as J}from"./chunk-474G6BPL.js";import{b as G}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as q}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as Q}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import{b as z}from"./chunk-NNVT5X6O.js";import{c as j,h as H,m as $,z as B}from"./chunk-7HUEGPJN.js";import{b as F,e as V}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as D,r as R}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as b,Fc as P,Ic as a,Jc as p,Kc as E,Xb as g,Zb as _,ac as A,bc as T,cc as C,dc as n,ec as i,ed as I,fc as v,fd as N,gb as l,ha as S,mc as w,md as L,oa as M,pa as y,rc as u,tc as m,yb as k}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var K=(t,d)=>d.key;function W(t,d){if(t&1){let e=w();n(0,"button",31),u("click",function(){M(e);let r=m(2);return y(r.searchQuery.set(""))}),v(1,"i",32),i()}}function X(t,d){if(t&1){let e=w();n(0,"div",17),v(1,"i",28),n(2,"input",29),u("ngModelChange",function(r){M(e);let c=m();return y(c.searchQuery.set(r))}),i(),g(3,W,2,0,"button",30),i()}if(t&2){let e=m();l(2),C("ngModel",e.searchQuery()),l(),_(e.searchQuery()?3:-1)}}function Z(t,d){if(t&1&&(n(0,"span",18),a(1),i()),t&2){let e=m();l(),E(" ",e.orderLog()?"Order #"+e.orderNumber():"Response"," ")}}function ee(t,d){t&1&&(n(0,"span",37),a(1,"true"),i())}function te(t,d){t&1&&(n(0,"span",38),a(1,"false"),i())}function ne(t,d){if(t&1&&(n(0,"span",39),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function ie(t,d){t&1&&(n(0,"span",40),a(1,"null"),i())}function oe(t,d){if(t&1&&(n(0,"span",41),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function re(t,d){if(t&1&&(n(0,"tr")(1,"td",36),a(2),i(),n(3,"td"),g(4,ee,2,0,"span",37)(5,te,2,0,"span",38)(6,ne,2,1,"span",39)(7,ie,2,0,"span",40)(8,oe,2,1,"span",41),i()()),t&2){let e,o=d.$implicit;l(2),p(o.key),l(2),_((e=o.type)==="true"?4:e==="false"?5:e==="number"?6:e==="null"?7:8)}}function ae(t,d){if(t&1&&(n(0,"tr")(1,"td",42),a(2),i()()),t&2){let e=m(3);l(2),E(' No matching properties for "',e.searchQuery(),'" ')}}function le(t,d){if(t&1&&(n(0,"div",33)(1,"table",35)(2,"thead")(3,"tr")(4,"th"),a(5,"Field"),i(),n(6,"th"),a(7,"Value"),i()()(),n(8,"tbody"),A(9,re,9,2,"tr",null,K,!1,ae,3,1,"tr"),i()()()),t&2){let e=m(2);l(9),T(e.getFilteredTableRows(e.orderLog()))}}function de(t,d){if(t&1&&(n(0,"pre",34),a(1),I(2,"json"),i()),t&2){let e=m(2);l(),p(N(2,1,e.orderLog()))}}function ce(t,d){if(t&1&&(g(0,le,12,1,"div",33),g(1,de,3,3,"pre",34)),t&2){let e=m();_(e.activeView()==="table"?0:-1),l(),_(e.activeView()==="raw"?1:-1)}}function pe(t,d){t&1&&(n(0,"p",26),a(1," Your data will be shown here once it's available "),i())}function se(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Cancellation status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"cancel_reason"),i(),n(7,"span",52),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"cancel_by"),i(),n(12,"span",52),a(13),i()(),n(14,"div",53)(15,"span",48),a(16,"checkout_shipping_carrier"),i(),n(17,"span",52),a(18),i()()()()),t&2){let e=d;l(8),p(e.cancelReason),l(5),p(e.cancelBy),l(5),p(e.checkoutShippingCarrier)}}function me(t,d){if(t&1&&(n(0,"div",43)(1,"div",45),a(2,"Return status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"return_requested_qty"),i(),n(7,"span",54),a(8),i()(),n(9,"div",53)(10,"span",48),a(11,"returned_qty"),i(),n(12,"span",54),a(13),i()()()()),t&2){let e=d;l(8),p(e.returnRequestedQty),l(5),p(e.returnedQty)}}function ge(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Shipping and Status"),i(),n(3,"div",46)(4,"div",47)(5,"span",48),a(6,"order_status"),i(),n(7,"span",49),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"logistics_status"),i(),n(12,"span",51),a(13),i()(),n(14,"div",50)(15,"span",48),a(16,"shipping_carrier"),i(),n(17,"span",52),a(18),i()(),n(19,"div",50)(20,"span",48),a(21,"package_number"),i(),n(22,"span",51),a(23),i()(),n(24,"div",53)(25,"span",48),a(26,"booking_sn"),i(),n(27,"span",51),a(28),i()()()(),g(29,se,19,3,"div",44),g(30,me,14,2,"div",43)),t&2){let e,o,r=d,c=m(2);l(7),C("ngClass",c.getOrderStatusClass(r.orderStatus)),l(),p(r.orderStatus),l(5),p(r.logisticsStatus),l(5),p(r.shippingCarrier),l(5),p(r.packageNumber),l(5),p(r.bookingSn),l(),_((e=c.getCancellationStatus(c.orderLog()))?29:-1,e),l(),_((o=c.getReturnStatus(c.orderLog()))?30:-1,o)}}function _e(t,d){t&1&&(n(0,"div",43)(1,"div",55),a(2," Highlights will appear after search "),i()())}function ue(t,d){if(t&1&&g(0,ge,31,8)(1,_e,3,0,"div",43),t&2){let e,o=m();_((e=o.getShippingAndStatus(o.orderLog()))?0:1,e)}}var Ie=(()=>{class t{constructor(){this.httpService=S(V),this.toastr=S(F),this.authService=S(q),this.selectedChannel=b(null),this.orderNumber=b(null),this.activeView=b("raw"),this.searchQuery=b(""),this.isShopeeSelected=L(()=>{let e=this.selectedChannel();return e?this.authService.getChannels().find(r=>r.ID===e)?.TypeID===z.Shopee:!1}),this.orderLog=b(null)}getTableRows(e){if(!e)return[];let o=e?.response?.order_list?.[0]??e?.order_list?.[0]??e;if(!o)return[];let r=[],c=(f,x="")=>{for(let h of Object.keys(f)){let O=x?`${x}.${h}`:h,s=f[h];if(s!==null&&typeof s=="object"&&!Array.isArray(s))c(s,O);else if(Array.isArray(s))s.length>0&&typeof s[0]=="object"?c(s[0],`${O}[0]`):r.push({key:O,value:JSON.stringify(s),type:"string"});else{let U=s===null?"null":typeof s=="boolean"?s?"true":"false":typeof s=="number"?"number":"string";r.push({key:O,value:s,type:U})}}};return c(o),r}getFilteredTableRows(e){let o=this.getTableRows(e),r=this.searchQuery().trim().toLowerCase();return r?o.filter(c=>c.key.toLowerCase().includes(r)||String(c.value).toLowerCase().includes(r)):o}getOrder(e){return e?.response?.order_list?.[0]??e?.order_list?.[0]??e}fmt(e){return e==null||e===""?"\u2014":String(e)}getShippingAndStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.package_list?.[0]??{};return{orderStatus:this.fmt(o.order_status),logisticsStatus:this.fmt(r.logistics_status??o.logistics_status),shippingCarrier:this.fmt(r.shipping_carrier??o.shipping_carrier),packageNumber:this.fmt(r.package_number),bookingSn:this.fmt(o.booking_sn)}}getCancellationStatus(e){if(!e)return null;let o=this.getOrder(e);return o?{cancelReason:this.fmt(o.cancel_reason),cancelBy:this.fmt(o.cancel_by),checkoutShippingCarrier:this.fmt(o.checkout_shipping_carrier)}:null}getReturnStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.item_list??[];if(r.length===0)return{returnRequestedQty:o.return_requested_qty??0,returnedQty:o.returned_qty??0};let c=r.reduce((x,h)=>x+(h.return_requested_qty??0),0),f=r.reduce((x,h)=>x+(h.returned_qty??0),0);return{returnRequestedQty:c,returnedQty:f}}getOrderStatusClass(e){let o=(e??"").toUpperCase();return["COMPLETED","DELIVERED","SHIPPED","LOGISTICS_DELIVERY_DONE"].includes(o)?"oapi-badge--success":["CANCELLED","CANCEL","FAILED","LOGISTICS_DELIVERY_FAILED"].includes(o)?"oapi-badge--danger":["TO_SHIP","SHIPPING","IN_TRANSIT","RETRY_SHIP","UNPAID"].includes(o)?"oapi-badge--warn":"oapi-badge--info"}formatRupiah(e){return new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(e)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.httpService.post(Q.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).subscribe({next:e=>{this.orderLog.set(e),this.searchQuery.set("")},error:e=>{this.toastr.error("Failed to fetch order log","Error"),console.error(e)}})}copyToClipboard(e){if(!e)return;let o=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(o),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-order-api"]],decls:46,vars:12,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-8","pe-3"],[1,"card","oapi-card","h-100"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"oapi-search-wrap"],[1,"text-muted","oapi-field-count"],[1,"d-flex","align-items-center","gap-2"],[1,"oapi-view-toggle"],[1,"oapi-vtab",3,"click"],[1,"fa","fa-table"],[1,"fa","fa-code"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body","p-0"],[1,"text-center","my-12","text-muted"],[1,"col-4","ps-2"],[1,"fa","fa-search","oapi-search-icon"],["type","text","placeholder","Search property...",1,"form-control","oapi-search-input",3,"ngModelChange","ngModel"],["type","button",1,"oapi-search-clear"],["type","button",1,"oapi-search-clear",3,"click"],[1,"fa","fa-times"],[1,"oapi-table-wrap"],[1,"oapi-raw"],[1,"table","table-sm","oapi-table","mb-0"],[1,"oapi-key-col"],[1,"oapi-val","oapi-val--true"],[1,"oapi-val","oapi-val--false"],[1,"oapi-val","oapi-val--num"],[1,"oapi-val","oapi-val--null"],[1,"oapi-val"],["colspan","2",1,"text-center","text-muted","py-3",2,"font-size","12px"],[1,"card","oapi-card","oapi-highlight-card"],[1,"card","oapi-card","oapi-highlight-card","mb-3"],[1,"card-header","oapi-card-header-sm"],[1,"card-body","py-2","px-3"],[1,"oapi-hl-row","oapi-hl-row--highlight"],[1,"oapi-hl-key"],[1,"badge","oapi-badge",3,"ngClass"],[1,"oapi-hl-row"],[1,"oapi-hl-val","oapi-hl-val--mono"],[1,"oapi-hl-val"],[1,"oapi-hl-row","oapi-hl-row--last"],[1,"oapi-hl-val","oapi-hl-val--num"],[1,"card-body","text-center","text-muted","py-4",2,"font-size","13px"]],template:function(o,r){o&1&&(n(0,"mainpanel",0)(1,"actions")(2,"button",1),u("click",function(){return r.fetchLog()}),v(3,"i",2),a(4," Search "),i()(),n(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),a(12,"Channel"),i(),n(13,"p",8),a(14," View logs related to Order API activities. "),i()(),n(15,"div",9)(16,"app-channel-options-v2",10),u("ngModelChange",function(f){return r.selectedChannel.set(f)}),i()()(),n(17,"div",11)(18,"div",7)(19,"h6"),a(20,"Order Number"),i(),n(21,"p",8),a(22," Order or Invoice number from Channel. "),i()(),n(23,"div",9)(24,"input",12),u("ngModelChange",function(f){return r.orderNumber.set(f)}),i()()()()(),n(25,"div",13)(26,"div",14)(27,"div",15)(28,"div",16),g(29,X,4,2,"div",17)(30,Z,2,1,"span",18),n(31,"div",19)(32,"div",20)(33,"button",21),u("click",function(){return r.activeView.set("table")}),v(34,"i",22),a(35," Table "),i(),n(36,"button",21),u("click",function(){return r.activeView.set("raw")}),v(37,"i",23),a(38," Raw JSON "),i()(),n(39,"button",24),u("click",function(){return r.copyToClipboard(r.orderLog())}),a(40," Copy "),i()()(),n(41,"div",25),g(42,ce,2,2)(43,pe,2,0,"p",26),i()()(),n(44,"div",27),g(45,ue,2,1),i()()()()()),o&2&&(C("hideSearchBox",!0)("hideSearchDropdown",!0),l(16),C("ngModel",r.selectedChannel()),l(8),C("ngModel",r.orderNumber()),l(5),_(r.activeView()==="table"&&r.orderLog()?29:30),l(4),P("active",r.activeView()==="table"),l(3),P("active",r.activeView()==="raw"),l(3),C("disabled",!r.orderLog()),l(3),_(r.orderLog()?42:43),l(3),_(r.isShopeeSelected()?45:-1))},dependencies:[G,J,B,j,H,$,Y,R,D],styles:[".oapi-card[_ngcontent-%COMP%]{border:1px solid #e9ecef;border-radius:10px;overflow:hidden}.oapi-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:10px 14px;min-height:unset}.oapi-field-count[_ngcontent-%COMP%]{font-size:13px}.oapi-search-wrap[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;width:260px;max-width:40%}.oapi-search-icon[_ngcontent-%COMP%]{position:absolute;left:9px;font-size:11px;color:#adb5bd;pointer-events:none}.oapi-search-input[_ngcontent-%COMP%]{height:28px!important;font-size:12px!important;padding:4px 28px 4px 26px!important;border-radius:6px!important;border:1px solid #dee2e6!important;background:#fff!important;line-height:1.4}.oapi-search-input[_ngcontent-%COMP%]::placeholder{color:#adb5bd}.oapi-search-input[_ngcontent-%COMP%]:focus{border-color:#adb5bd!important;box-shadow:none!important}.oapi-search-clear[_ngcontent-%COMP%]{position:absolute;right:6px;border:none;background:#f1f3f5;color:#868e96;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;cursor:pointer;padding:0}.oapi-search-clear[_ngcontent-%COMP%]:hover{background:#e9ecef;color:#495057}.oapi-view-toggle[_ngcontent-%COMP%]{display:inline-flex;background:#f1f3f5;border:1px solid #dee2e6;border-radius:6px;padding:2px;gap:2px}.oapi-vtab[_ngcontent-%COMP%]{font-size:12px;border:none;background:transparent;color:#6c757d;padding:4px 10px;border-radius:4px;cursor:pointer;line-height:1.4;transition:background .15s,color .15s}.oapi-vtab[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:4px}.oapi-vtab.active[_ngcontent-%COMP%]{background:#fff;color:#212529;font-weight:500;border:1px solid #dee2e6}.oapi-vtab[_ngcontent-%COMP%]:hover:not(.active){background:#e9ecef;color:#495057}.oapi-table-wrap[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto}.oapi-table[_ngcontent-%COMP%]{font-size:13px;margin-top:5px;margin-bottom:0}.oapi-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;background:#f8f9fa;font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;padding:8px 14px;border-bottom:1px solid #dee2e6;z-index:1}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td[_ngcontent-%COMP%]{background-color:#f8f9fa}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px 14px;border-bottom:1px solid #f1f3f5;vertical-align:top;color:#212529}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.oapi-key-col[_ngcontent-%COMP%]{color:#6c757d!important;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px!important;width:46%}.oapi-val[_ngcontent-%COMP%]{font-size:13px;color:#212529}.oapi-val--true[_ngcontent-%COMP%]{color:#2f9e44;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--false[_ngcontent-%COMP%]{color:#868e96;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--num[_ngcontent-%COMP%]{color:#1971c2;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--null[_ngcontent-%COMP%]{color:#adb5bd;font-style:italic;font-size:12px}.oapi-raw[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;line-height:1.8;padding:14px;margin:0;max-height:600px;overflow-y:auto;overflow-x:auto;color:#212529;background:transparent;white-space:pre}.oapi-highlight-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{padding:8px 12px}.oapi-card-header-sm[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:8px 12px}.oapi-hl-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #f1f3f5}.oapi-hl-row--last[_ngcontent-%COMP%]{border-bottom:none;padding-bottom:0}.oapi-hl-row--highlight[_ngcontent-%COMP%]{background:#f8f9fa;margin:0 -12px;padding:8px 12px;border-bottom:1px solid #e9ecef}.oapi-hl-key[_ngcontent-%COMP%]{font-size:12px;color:#6c757d}.oapi-hl-val[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#212529}.oapi-hl-val--mono[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;font-weight:400}.oapi-hl-val--num[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,monospace;color:#1971c2;font-size:12px}.oapi-badge[_ngcontent-%COMP%]{font-size:11px;font-weight:500;padding:2px 8px;border-radius:999px}.oapi-badge--yes[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e}.oapi-badge--no[_ngcontent-%COMP%]{background-color:#f1f3f5;color:#868e96;border:1px solid #dee2e6}.oapi-badge--info[_ngcontent-%COMP%]{background-color:#dbe4ff;color:#364fc7}.oapi-badge--success[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e;border:1px solid #b2f2bb}.oapi-badge--danger[_ngcontent-%COMP%]{background-color:#ffe3e3;color:#c92a2a;border:1px solid #ffc9c9}.oapi-badge--warn[_ngcontent-%COMP%]{background-color:#fff3bf;color:#e67700;border:1px solid #ffec99}.oapi-fee-big[_ngcontent-%COMP%]{font-size:20px;font-weight:600;font-family:SFMono-Regular,Consolas,monospace;color:#212529}.oapi-fee-sub[_ngcontent-%COMP%]{font-size:11px;color:#adb5bd;margin-top:2px}@media(max-width:767.98px){.container-fluid[_ngcontent-%COMP%]{padding-left:1rem!important;padding-right:1rem!important}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}.col-7[_ngcontent-%COMP%], .col-8[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%], .col-12[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;padding-left:0!important;padding-right:0!important}.d-flex[_ngcontent-%COMP%]{flex-direction:column!important;align-items:stretch!important;gap:1rem}.w-75[_ngcontent-%COMP%], .w-100[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important}.oapi-highlight-card[_ngcontent-%COMP%]{margin-top:1rem}.oapi-table-wrap[_ngcontent-%COMP%], .oapi-raw[_ngcontent-%COMP%]{max-height:400px}}@media(max-width:400px){.card-header[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-size:1rem}.oapi-raw[_ngcontent-%COMP%]{font-size:.85rem}}"],changeDetection:0})}}return t})();export{Ie as OrderApiComponent};
1
+ import{a as Y}from"./chunk-XZG5D6MR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.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-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{e as J}from"./chunk-474G6BPL.js";import{b as G}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as q}from"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as Q}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import{b as z}from"./chunk-NNVT5X6O.js";import{c as j,h as H,m as $,z as B}from"./chunk-7HUEGPJN.js";import{b as F,e as V}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as D,r as R}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as b,Fc as P,Ic as a,Jc as p,Kc as E,Xb as g,Zb as _,ac as A,bc as T,cc as C,dc as n,ec as i,ed as I,fc as v,fd as N,gb as l,ha as S,mc as w,md as L,oa as M,pa as y,rc as u,tc as m,yb as k}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var K=(t,d)=>d.key;function W(t,d){if(t&1){let e=w();n(0,"button",31),u("click",function(){M(e);let r=m(2);return y(r.searchQuery.set(""))}),v(1,"i",32),i()}}function X(t,d){if(t&1){let e=w();n(0,"div",17),v(1,"i",28),n(2,"input",29),u("ngModelChange",function(r){M(e);let c=m();return y(c.searchQuery.set(r))}),i(),g(3,W,2,0,"button",30),i()}if(t&2){let e=m();l(2),C("ngModel",e.searchQuery()),l(),_(e.searchQuery()?3:-1)}}function Z(t,d){if(t&1&&(n(0,"span",18),a(1),i()),t&2){let e=m();l(),E(" ",e.orderLog()?"Order #"+e.orderNumber():"Response"," ")}}function ee(t,d){t&1&&(n(0,"span",37),a(1,"true"),i())}function te(t,d){t&1&&(n(0,"span",38),a(1,"false"),i())}function ne(t,d){if(t&1&&(n(0,"span",39),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function ie(t,d){t&1&&(n(0,"span",40),a(1,"null"),i())}function oe(t,d){if(t&1&&(n(0,"span",41),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function re(t,d){if(t&1&&(n(0,"tr")(1,"td",36),a(2),i(),n(3,"td"),g(4,ee,2,0,"span",37)(5,te,2,0,"span",38)(6,ne,2,1,"span",39)(7,ie,2,0,"span",40)(8,oe,2,1,"span",41),i()()),t&2){let e,o=d.$implicit;l(2),p(o.key),l(2),_((e=o.type)==="true"?4:e==="false"?5:e==="number"?6:e==="null"?7:8)}}function ae(t,d){if(t&1&&(n(0,"tr")(1,"td",42),a(2),i()()),t&2){let e=m(3);l(2),E(' No matching properties for "',e.searchQuery(),'" ')}}function le(t,d){if(t&1&&(n(0,"div",33)(1,"table",35)(2,"thead")(3,"tr")(4,"th"),a(5,"Field"),i(),n(6,"th"),a(7,"Value"),i()()(),n(8,"tbody"),A(9,re,9,2,"tr",null,K,!1,ae,3,1,"tr"),i()()()),t&2){let e=m(2);l(9),T(e.getFilteredTableRows(e.orderLog()))}}function de(t,d){if(t&1&&(n(0,"pre",34),a(1),I(2,"json"),i()),t&2){let e=m(2);l(),p(N(2,1,e.orderLog()))}}function ce(t,d){if(t&1&&(g(0,le,12,1,"div",33),g(1,de,3,3,"pre",34)),t&2){let e=m();_(e.activeView()==="table"?0:-1),l(),_(e.activeView()==="raw"?1:-1)}}function pe(t,d){t&1&&(n(0,"p",26),a(1," Your data will be shown here once it's available "),i())}function se(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Cancellation status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"cancel_reason"),i(),n(7,"span",52),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"cancel_by"),i(),n(12,"span",52),a(13),i()(),n(14,"div",53)(15,"span",48),a(16,"checkout_shipping_carrier"),i(),n(17,"span",52),a(18),i()()()()),t&2){let e=d;l(8),p(e.cancelReason),l(5),p(e.cancelBy),l(5),p(e.checkoutShippingCarrier)}}function me(t,d){if(t&1&&(n(0,"div",43)(1,"div",45),a(2,"Return status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"return_requested_qty"),i(),n(7,"span",54),a(8),i()(),n(9,"div",53)(10,"span",48),a(11,"returned_qty"),i(),n(12,"span",54),a(13),i()()()()),t&2){let e=d;l(8),p(e.returnRequestedQty),l(5),p(e.returnedQty)}}function ge(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Shipping and Status"),i(),n(3,"div",46)(4,"div",47)(5,"span",48),a(6,"order_status"),i(),n(7,"span",49),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"logistics_status"),i(),n(12,"span",51),a(13),i()(),n(14,"div",50)(15,"span",48),a(16,"shipping_carrier"),i(),n(17,"span",52),a(18),i()(),n(19,"div",50)(20,"span",48),a(21,"package_number"),i(),n(22,"span",51),a(23),i()(),n(24,"div",53)(25,"span",48),a(26,"booking_sn"),i(),n(27,"span",51),a(28),i()()()(),g(29,se,19,3,"div",44),g(30,me,14,2,"div",43)),t&2){let e,o,r=d,c=m(2);l(7),C("ngClass",c.getOrderStatusClass(r.orderStatus)),l(),p(r.orderStatus),l(5),p(r.logisticsStatus),l(5),p(r.shippingCarrier),l(5),p(r.packageNumber),l(5),p(r.bookingSn),l(),_((e=c.getCancellationStatus(c.orderLog()))?29:-1,e),l(),_((o=c.getReturnStatus(c.orderLog()))?30:-1,o)}}function _e(t,d){t&1&&(n(0,"div",43)(1,"div",55),a(2," Highlights will appear after search "),i()())}function ue(t,d){if(t&1&&g(0,ge,31,8)(1,_e,3,0,"div",43),t&2){let e,o=m();_((e=o.getShippingAndStatus(o.orderLog()))?0:1,e)}}var Ie=(()=>{class t{constructor(){this.httpService=S(V),this.toastr=S(F),this.authService=S(q),this.selectedChannel=b(null),this.orderNumber=b(null),this.activeView=b("raw"),this.searchQuery=b(""),this.isShopeeSelected=L(()=>{let e=this.selectedChannel();return e?this.authService.getChannels().find(r=>r.ID===e)?.TypeID===z.Shopee:!1}),this.orderLog=b(null)}getTableRows(e){if(!e)return[];let o=e?.response?.order_list?.[0]??e?.order_list?.[0]??e;if(!o)return[];let r=[],c=(f,x="")=>{for(let h of Object.keys(f)){let O=x?`${x}.${h}`:h,s=f[h];if(s!==null&&typeof s=="object"&&!Array.isArray(s))c(s,O);else if(Array.isArray(s))s.length>0&&typeof s[0]=="object"?c(s[0],`${O}[0]`):r.push({key:O,value:JSON.stringify(s),type:"string"});else{let U=s===null?"null":typeof s=="boolean"?s?"true":"false":typeof s=="number"?"number":"string";r.push({key:O,value:s,type:U})}}};return c(o),r}getFilteredTableRows(e){let o=this.getTableRows(e),r=this.searchQuery().trim().toLowerCase();return r?o.filter(c=>c.key.toLowerCase().includes(r)||String(c.value).toLowerCase().includes(r)):o}getOrder(e){return e?.response?.order_list?.[0]??e?.order_list?.[0]??e}fmt(e){return e==null||e===""?"\u2014":String(e)}getShippingAndStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.package_list?.[0]??{};return{orderStatus:this.fmt(o.order_status),logisticsStatus:this.fmt(r.logistics_status??o.logistics_status),shippingCarrier:this.fmt(r.shipping_carrier??o.shipping_carrier),packageNumber:this.fmt(r.package_number),bookingSn:this.fmt(o.booking_sn)}}getCancellationStatus(e){if(!e)return null;let o=this.getOrder(e);return o?{cancelReason:this.fmt(o.cancel_reason),cancelBy:this.fmt(o.cancel_by),checkoutShippingCarrier:this.fmt(o.checkout_shipping_carrier)}:null}getReturnStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.item_list??[];if(r.length===0)return{returnRequestedQty:o.return_requested_qty??0,returnedQty:o.returned_qty??0};let c=r.reduce((x,h)=>x+(h.return_requested_qty??0),0),f=r.reduce((x,h)=>x+(h.returned_qty??0),0);return{returnRequestedQty:c,returnedQty:f}}getOrderStatusClass(e){let o=(e??"").toUpperCase();return["COMPLETED","DELIVERED","SHIPPED","LOGISTICS_DELIVERY_DONE"].includes(o)?"oapi-badge--success":["CANCELLED","CANCEL","FAILED","LOGISTICS_DELIVERY_FAILED"].includes(o)?"oapi-badge--danger":["TO_SHIP","SHIPPING","IN_TRANSIT","RETRY_SHIP","UNPAID"].includes(o)?"oapi-badge--warn":"oapi-badge--info"}formatRupiah(e){return new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(e)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.httpService.post(Q.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).subscribe({next:e=>{this.orderLog.set(e),this.searchQuery.set("")},error:e=>{this.toastr.error("Failed to fetch order log","Error"),console.error(e)}})}copyToClipboard(e){if(!e)return;let o=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(o),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-order-api"]],decls:46,vars:12,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-8","pe-3"],[1,"card","oapi-card","h-100"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"oapi-search-wrap"],[1,"text-muted","oapi-field-count"],[1,"d-flex","align-items-center","gap-2"],[1,"oapi-view-toggle"],[1,"oapi-vtab",3,"click"],[1,"fa","fa-table"],[1,"fa","fa-code"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body","p-0"],[1,"text-center","my-12","text-muted"],[1,"col-4","ps-2"],[1,"fa","fa-search","oapi-search-icon"],["type","text","placeholder","Search property...",1,"form-control","oapi-search-input",3,"ngModelChange","ngModel"],["type","button",1,"oapi-search-clear"],["type","button",1,"oapi-search-clear",3,"click"],[1,"fa","fa-times"],[1,"oapi-table-wrap"],[1,"oapi-raw"],[1,"table","table-sm","oapi-table","mb-0"],[1,"oapi-key-col"],[1,"oapi-val","oapi-val--true"],[1,"oapi-val","oapi-val--false"],[1,"oapi-val","oapi-val--num"],[1,"oapi-val","oapi-val--null"],[1,"oapi-val"],["colspan","2",1,"text-center","text-muted","py-3",2,"font-size","12px"],[1,"card","oapi-card","oapi-highlight-card"],[1,"card","oapi-card","oapi-highlight-card","mb-3"],[1,"card-header","oapi-card-header-sm"],[1,"card-body","py-2","px-3"],[1,"oapi-hl-row","oapi-hl-row--highlight"],[1,"oapi-hl-key"],[1,"badge","oapi-badge",3,"ngClass"],[1,"oapi-hl-row"],[1,"oapi-hl-val","oapi-hl-val--mono"],[1,"oapi-hl-val"],[1,"oapi-hl-row","oapi-hl-row--last"],[1,"oapi-hl-val","oapi-hl-val--num"],[1,"card-body","text-center","text-muted","py-4",2,"font-size","13px"]],template:function(o,r){o&1&&(n(0,"mainpanel",0)(1,"actions")(2,"button",1),u("click",function(){return r.fetchLog()}),v(3,"i",2),a(4," Search "),i()(),n(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),a(12,"Channel"),i(),n(13,"p",8),a(14," View logs related to Order API activities. "),i()(),n(15,"div",9)(16,"app-channel-options-v2",10),u("ngModelChange",function(f){return r.selectedChannel.set(f)}),i()()(),n(17,"div",11)(18,"div",7)(19,"h6"),a(20,"Order Number"),i(),n(21,"p",8),a(22," Order or Invoice number from Channel. "),i()(),n(23,"div",9)(24,"input",12),u("ngModelChange",function(f){return r.orderNumber.set(f)}),i()()()()(),n(25,"div",13)(26,"div",14)(27,"div",15)(28,"div",16),g(29,X,4,2,"div",17)(30,Z,2,1,"span",18),n(31,"div",19)(32,"div",20)(33,"button",21),u("click",function(){return r.activeView.set("table")}),v(34,"i",22),a(35," Table "),i(),n(36,"button",21),u("click",function(){return r.activeView.set("raw")}),v(37,"i",23),a(38," Raw JSON "),i()(),n(39,"button",24),u("click",function(){return r.copyToClipboard(r.orderLog())}),a(40," Copy "),i()()(),n(41,"div",25),g(42,ce,2,2)(43,pe,2,0,"p",26),i()()(),n(44,"div",27),g(45,ue,2,1),i()()()()()),o&2&&(C("hideSearchBox",!0)("hideSearchDropdown",!0),l(16),C("ngModel",r.selectedChannel()),l(8),C("ngModel",r.orderNumber()),l(5),_(r.activeView()==="table"&&r.orderLog()?29:30),l(4),P("active",r.activeView()==="table"),l(3),P("active",r.activeView()==="raw"),l(3),C("disabled",!r.orderLog()),l(3),_(r.orderLog()?42:43),l(3),_(r.isShopeeSelected()?45:-1))},dependencies:[G,J,B,j,H,$,Y,R,D],styles:[".oapi-card[_ngcontent-%COMP%]{border:1px solid #e9ecef;border-radius:10px;overflow:hidden}.oapi-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:10px 14px;min-height:unset}.oapi-field-count[_ngcontent-%COMP%]{font-size:13px}.oapi-search-wrap[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;width:260px;max-width:40%}.oapi-search-icon[_ngcontent-%COMP%]{position:absolute;left:9px;font-size:11px;color:#adb5bd;pointer-events:none}.oapi-search-input[_ngcontent-%COMP%]{height:28px!important;font-size:12px!important;padding:4px 28px 4px 26px!important;border-radius:6px!important;border:1px solid #dee2e6!important;background:#fff!important;line-height:1.4}.oapi-search-input[_ngcontent-%COMP%]::placeholder{color:#adb5bd}.oapi-search-input[_ngcontent-%COMP%]:focus{border-color:#adb5bd!important;box-shadow:none!important}.oapi-search-clear[_ngcontent-%COMP%]{position:absolute;right:6px;border:none;background:#f1f3f5;color:#868e96;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;cursor:pointer;padding:0}.oapi-search-clear[_ngcontent-%COMP%]:hover{background:#e9ecef;color:#495057}.oapi-view-toggle[_ngcontent-%COMP%]{display:inline-flex;background:#f1f3f5;border:1px solid #dee2e6;border-radius:6px;padding:2px;gap:2px}.oapi-vtab[_ngcontent-%COMP%]{font-size:12px;border:none;background:transparent;color:#6c757d;padding:4px 10px;border-radius:4px;cursor:pointer;line-height:1.4;transition:background .15s,color .15s}.oapi-vtab[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:4px}.oapi-vtab.active[_ngcontent-%COMP%]{background:#fff;color:#212529;font-weight:500;border:1px solid #dee2e6}.oapi-vtab[_ngcontent-%COMP%]:hover:not(.active){background:#e9ecef;color:#495057}.oapi-table-wrap[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto}.oapi-table[_ngcontent-%COMP%]{font-size:13px;margin-top:5px;margin-bottom:0}.oapi-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;background:#f8f9fa;font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;padding:8px 14px;border-bottom:1px solid #dee2e6;z-index:1}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td[_ngcontent-%COMP%]{background-color:#f8f9fa}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px 14px;border-bottom:1px solid #f1f3f5;vertical-align:top;color:#212529}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.oapi-key-col[_ngcontent-%COMP%]{color:#6c757d!important;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px!important;width:46%}.oapi-val[_ngcontent-%COMP%]{font-size:13px;color:#212529}.oapi-val--true[_ngcontent-%COMP%]{color:#2f9e44;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--false[_ngcontent-%COMP%]{color:#868e96;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--num[_ngcontent-%COMP%]{color:#1971c2;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--null[_ngcontent-%COMP%]{color:#adb5bd;font-style:italic;font-size:12px}.oapi-raw[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;line-height:1.8;padding:14px;margin:0;max-height:600px;overflow-y:auto;overflow-x:auto;color:#212529;background:transparent;white-space:pre}.oapi-highlight-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{padding:8px 12px}.oapi-card-header-sm[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:8px 12px}.oapi-hl-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #f1f3f5}.oapi-hl-row--last[_ngcontent-%COMP%]{border-bottom:none;padding-bottom:0}.oapi-hl-row--highlight[_ngcontent-%COMP%]{background:#f8f9fa;margin:0 -12px;padding:8px 12px;border-bottom:1px solid #e9ecef}.oapi-hl-key[_ngcontent-%COMP%]{font-size:12px;color:#6c757d}.oapi-hl-val[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#212529}.oapi-hl-val--mono[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;font-weight:400}.oapi-hl-val--num[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,monospace;color:#1971c2;font-size:12px}.oapi-badge[_ngcontent-%COMP%]{font-size:11px;font-weight:500;padding:2px 8px;border-radius:999px}.oapi-badge--yes[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e}.oapi-badge--no[_ngcontent-%COMP%]{background-color:#f1f3f5;color:#868e96;border:1px solid #dee2e6}.oapi-badge--info[_ngcontent-%COMP%]{background-color:#dbe4ff;color:#364fc7}.oapi-badge--success[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e;border:1px solid #b2f2bb}.oapi-badge--danger[_ngcontent-%COMP%]{background-color:#ffe3e3;color:#c92a2a;border:1px solid #ffc9c9}.oapi-badge--warn[_ngcontent-%COMP%]{background-color:#fff3bf;color:#e67700;border:1px solid #ffec99}.oapi-fee-big[_ngcontent-%COMP%]{font-size:20px;font-weight:600;font-family:SFMono-Regular,Consolas,monospace;color:#212529}.oapi-fee-sub[_ngcontent-%COMP%]{font-size:11px;color:#adb5bd;margin-top:2px}@media(max-width:767.98px){.container-fluid[_ngcontent-%COMP%]{padding-left:1rem!important;padding-right:1rem!important}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}.col-7[_ngcontent-%COMP%], .col-8[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%], .col-12[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;padding-left:0!important;padding-right:0!important}.d-flex[_ngcontent-%COMP%]{flex-direction:column!important;align-items:stretch!important;gap:1rem}.w-75[_ngcontent-%COMP%], .w-100[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important}.oapi-highlight-card[_ngcontent-%COMP%]{margin-top:1rem}.oapi-table-wrap[_ngcontent-%COMP%], .oapi-raw[_ngcontent-%COMP%]{max-height:400px}}@media(max-width:400px){.card-header[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-size:1rem}.oapi-raw[_ngcontent-%COMP%]{font-size:.85rem}}"],changeDetection:0})}}return t})();export{Ie as OrderApiComponent};
@@ -1 +1 @@
1
- import{a as le,b as ae,c as me}from"./chunk-DSBGQ5B7.js";import{a as pe}from"./chunk-DF476PQL.js";import{a as T}from"./chunk-CLX6T6AB.js";import{a as de}from"./chunk-ZLMUYIKY.js";import{a as oe}from"./chunk-QPCTJKN6.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as re}from"./chunk-PGDBJOSL.js";import"./chunk-VYXSV6K4.js";import{a as ne}from"./chunk-EYHQ2ZKL.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-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as ie}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import{a as te}from"./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-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as ee}from"./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{c as Q,h as X,m as Y,o as Z,z as $}from"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as J,D as K,z as G}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as D,Hc as z,Ic as a,Jc as S,Kc as w,Mc as g,Nc as _,Oc as f,Pc as A,Qc as R,Rc as H,S as N,Vc as j,Xb as y,Xc as U,Zb as b,_b as I,ac as B,bc as k,cc as u,db as F,dc as t,ec as i,ed as x,fc as c,fd as V,gb as l,gd as q,ha as O,mc as E,oa as p,pa as s,rc as M,tc as C,yb as W}from"./chunk-5VYDZBNH.js";import{a as P,b as L}from"./chunk-QWWW7GFA.js";var se=r=>({"td-cell-hover":r});function ce(r,h){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=C().$implicit;u("variants",e==null?null:e.Variants)}}function ue(r,h){if(r&1&&c(0,"variant-with-image",32),r&2){let e=C().$implicit;u("variant",e==null?null:e.Variants[0])}}function Ce(r,h){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=C().$implicit;l(),w("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function ge(r,h){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),a(7),i(),t(8,"small",27)(9,"span"),a(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),c(14,"order-link",29),i(),t(15,"small"),a(16),x(17,"date"),i(),c(18,"br"),t(19,"small"),c(20,"i",30),a(21),i()()(),t(22,"td"),y(23,ce,1,1,"variants-dropdown",31)(24,ue,1,1,"variant-with-image",32),i(),t(25,"td",33),a(26),x(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),a(32),i(),y(33,Ce,2,1,"span"),i(),t(34,"small"),a(35),i()()()()),r&2){let e=h.$implicit;l(3),u("src",V(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),S(e.Outlet),l(3),S(e.ChannelName),l(4),u("order",e),l(2),w(" ",q(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(5),w(" ",e.Customer," "),l(),z(U(21,se,(e.Variants==null?null:e.Variants.length)>1)),l(),b((e.Variants==null?null:e.Variants.length)>1?23:24),l(3),S(V(27,19,e.Amount)),l(6),S(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),l(2),w(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function _e(r,h){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),i(),t(6,"th",20),a(7,"Number"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",22),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,ge,36,23,"tr",null,I),i()(),t(17,"app-custom-paginator",23),M("next",function(){p(e);let n=C();return s(n.initCompletedOrders())})("previous",function(){p(e);let n=C();return s(n.initCompletedOrders())}),i()()}if(r&2){let e=C(),m=H(0);l(15),k(m),l(2),u("filter",e.filter())("totaldata",m==null?null:m.length)}}function fe(r,h){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var ze=(()=>{class r{constructor(){this.orderService=O(T),this.filter=D({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(m=>L(P({},m),{From:e})),this.initCompletedOrders()}initCompletedOrders(){this.completedOrders$=this.orderService.getCompletedOrders(this.filter()).pipe(N(1))}static{this.\u0275fac=function(m){return new(m||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-completed"]],features:[j([T])],decls:34,vars:11,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",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,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/completedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(m,n){if(m&1){let d=E();A(0),x(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return p(d),s(n.initCompletedOrders())}),f("textChange",function(o){return p(d),_(n.filter().Number,o)||(n.filter().Number=o),s(o)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(o){return p(d),_(n.filter().ListChannelID,o)||(n.filter().ListChannelID=o),s(o)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(o){return p(d),_(n.filter().From,o)||(n.filter().From=o),s(o)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(o){return p(d),_(n.filter().To,o)||(n.filter().To=o),s(o)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(o){return p(d),_(n.filter().PageNumber,o)||(n.filter().PageNumber=o),s(o)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(o){return p(d),_(n.filter().PageSize,o)||(n.filter().PageSize=o),s(o)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,_e,18,2,"div",15)(33,fe,2,0,"div",16),i()()()()()}if(m&2){let d=R(V(1,8,n.completedOrders$));l(2),g("text",n.filter().Number),l(10),u("multiple",!0),g("ngModel",n.filter().ListChannelID),l(5),g("date",n.filter().From),l(2),g("date",n.filter().To),l(4),g("ngModel",n.filter().PageNumber),l(4),g("ngModel",n.filter().PageSize),l(5),b((d==null?null:d.length)>0?32:33)}},dependencies:[ie,ne,re,$,Q,Z,X,Y,ae,me,de,te,ee,pe,oe,le,G,J,K],encapsulation:2,changeDetection:0})}}return r})();export{ze as CompletedComponent};
1
+ import{a as le,b as ae,c as me}from"./chunk-DSBGQ5B7.js";import{a as pe}from"./chunk-FPM73NBG.js";import{a as T}from"./chunk-CLX6T6AB.js";import{a as de}from"./chunk-ZLMUYIKY.js";import{a as oe}from"./chunk-XZG5D6MR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as re}from"./chunk-PGDBJOSL.js";import"./chunk-VYXSV6K4.js";import{a as ne}from"./chunk-EYHQ2ZKL.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-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as ie}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import{a as te}from"./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-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as ee}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as Q,h as X,m as Y,o as Z,z as $}from"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as J,D as K,z as G}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as D,Hc as z,Ic as a,Jc as S,Kc as w,Mc as g,Nc as _,Oc as f,Pc as A,Qc as R,Rc as H,S as N,Vc as j,Xb as y,Xc as U,Zb as b,_b as I,ac as B,bc as k,cc as u,db as F,dc as t,ec as i,ed as x,fc as c,fd as V,gb as l,gd as q,ha as O,mc as E,oa as p,pa as s,rc as M,tc as C,yb as W}from"./chunk-5VYDZBNH.js";import{a as P,b as L}from"./chunk-QWWW7GFA.js";var se=r=>({"td-cell-hover":r});function ce(r,h){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=C().$implicit;u("variants",e==null?null:e.Variants)}}function ue(r,h){if(r&1&&c(0,"variant-with-image",32),r&2){let e=C().$implicit;u("variant",e==null?null:e.Variants[0])}}function Ce(r,h){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=C().$implicit;l(),w("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function ge(r,h){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),a(7),i(),t(8,"small",27)(9,"span"),a(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),c(14,"order-link",29),i(),t(15,"small"),a(16),x(17,"date"),i(),c(18,"br"),t(19,"small"),c(20,"i",30),a(21),i()()(),t(22,"td"),y(23,ce,1,1,"variants-dropdown",31)(24,ue,1,1,"variant-with-image",32),i(),t(25,"td",33),a(26),x(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),a(32),i(),y(33,Ce,2,1,"span"),i(),t(34,"small"),a(35),i()()()()),r&2){let e=h.$implicit;l(3),u("src",V(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),S(e.Outlet),l(3),S(e.ChannelName),l(4),u("order",e),l(2),w(" ",q(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(5),w(" ",e.Customer," "),l(),z(U(21,se,(e.Variants==null?null:e.Variants.length)>1)),l(),b((e.Variants==null?null:e.Variants.length)>1?23:24),l(3),S(V(27,19,e.Amount)),l(6),S(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),l(2),w(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function _e(r,h){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),i(),t(6,"th",20),a(7,"Number"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",22),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,ge,36,23,"tr",null,I),i()(),t(17,"app-custom-paginator",23),M("next",function(){p(e);let n=C();return s(n.initCompletedOrders())})("previous",function(){p(e);let n=C();return s(n.initCompletedOrders())}),i()()}if(r&2){let e=C(),m=H(0);l(15),k(m),l(2),u("filter",e.filter())("totaldata",m==null?null:m.length)}}function fe(r,h){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var ze=(()=>{class r{constructor(){this.orderService=O(T),this.filter=D({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(m=>L(P({},m),{From:e})),this.initCompletedOrders()}initCompletedOrders(){this.completedOrders$=this.orderService.getCompletedOrders(this.filter()).pipe(N(1))}static{this.\u0275fac=function(m){return new(m||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-completed"]],features:[j([T])],decls:34,vars:11,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",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,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/completedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(m,n){if(m&1){let d=E();A(0),x(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return p(d),s(n.initCompletedOrders())}),f("textChange",function(o){return p(d),_(n.filter().Number,o)||(n.filter().Number=o),s(o)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(o){return p(d),_(n.filter().ListChannelID,o)||(n.filter().ListChannelID=o),s(o)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(o){return p(d),_(n.filter().From,o)||(n.filter().From=o),s(o)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(o){return p(d),_(n.filter().To,o)||(n.filter().To=o),s(o)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(o){return p(d),_(n.filter().PageNumber,o)||(n.filter().PageNumber=o),s(o)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(o){return p(d),_(n.filter().PageSize,o)||(n.filter().PageSize=o),s(o)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,_e,18,2,"div",15)(33,fe,2,0,"div",16),i()()()()()}if(m&2){let d=R(V(1,8,n.completedOrders$));l(2),g("text",n.filter().Number),l(10),u("multiple",!0),g("ngModel",n.filter().ListChannelID),l(5),g("date",n.filter().From),l(2),g("date",n.filter().To),l(4),g("ngModel",n.filter().PageNumber),l(4),g("ngModel",n.filter().PageSize),l(5),b((d==null?null:d.length)>0?32:33)}},dependencies:[ie,ne,re,$,Q,Z,X,Y,ae,me,de,te,ee,pe,oe,le,G,J,K],encapsulation:2,changeDetection:0})}}return r})();export{ze as CompletedComponent};
@@ -1 +1 @@
1
- import{a as y}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 h,e as w}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as m,Aa as d,Ic as f,Kc as v,Xc as b,ac as s,bc as c,cc as l,dc as t,ec as n,fc as i,gb as r,yb as u}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var M=e=>[e];function S(e,C){if(e&1&&(t(0,"a",8),f(1),n()),e&2){let o=C.$implicit;l("routerLink",b(2,M,o.url)),r(),v(" ",o.title," ")}}var D=(()=>{class e{constructor(){this.tabs=d([{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}]),this.moreMenu=d([{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}])}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=u({type:e,selectors:[["app-download"]],decls:13,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[1,"dropdown-item",3,"routerLink"]],template:function(a,p){a&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),n()(),t(4,"div")(5,"div",3)(6,"a",4),i(7,"i",5),n(),t(8,"div",6)(9,"div",7),s(10,S,2,4,"a",8,m),n()()()()(),i(12,"router-outlet")),a&2&&(r(3),l("Tabs",p.tabs()),r(7),c(p.moreMenu()))},dependencies:[g,w,h],encapsulation:2,changeDetection:0})}}return e})();var N=[{path:"",component:D,children:[{path:"by-url",loadComponent(){return import("./chunk-S7PB5GHL.js").then(e=>e.ByUrlComponent)},data:{title:"Download Product By Url"},canActivate:[y]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];export{N as routes};
1
+ import{a as y}from"./chunk-5ZDE4HEX.js";import{a as g}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.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 h,e as w}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as m,Aa as d,Ic as f,Kc as v,Xc as b,ac as s,bc as c,cc as l,dc as t,ec as n,fc as i,gb as r,yb as u}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var M=e=>[e];function S(e,C){if(e&1&&(t(0,"a",8),f(1),n()),e&2){let o=C.$implicit;l("routerLink",b(2,M,o.url)),r(),v(" ",o.title," ")}}var D=(()=>{class e{constructor(){this.tabs=d([{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}]),this.moreMenu=d([{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}])}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=u({type:e,selectors:[["app-download"]],decls:13,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[1,"dropdown-item",3,"routerLink"]],template:function(a,p){a&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),n()(),t(4,"div")(5,"div",3)(6,"a",4),i(7,"i",5),n(),t(8,"div",6)(9,"div",7),s(10,S,2,4,"a",8,m),n()()()()(),i(12,"router-outlet")),a&2&&(r(3),l("Tabs",p.tabs()),r(7),c(p.moreMenu()))},dependencies:[g,w,h],encapsulation:2,changeDetection:0})}}return e})();var N=[{path:"",component:D,children:[{path:"by-url",loadComponent(){return import("./chunk-5URFJE6S.js").then(e=>e.ByUrlComponent)},data:{title:"Download Product By Url"},canActivate:[y]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];export{N as routes};
@@ -1 +1 @@
1
- import{b as P}from"./chunk-6Z77GYRF.js";import"./chunk-BGFEVOPZ.js";import{b as R}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-KFJBIBDQ.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-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import{b as I,e as M,g as T}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as g,D as y,z as b}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Ic as n,Jc as d,Kc as _,V as h,Xb as c,Zb as m,cc as D,dc as i,ec as t,ed as p,fd as E,gb as o,gd as f,ha as s,r as x,tc as u,yb as C}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function w(a,v){if(a&1&&(i(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e.Perflog)}}function k(a,v){if(a&1&&(i(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"StackTrace"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e==null?null:e.StackTrace)}}function B(a,v){if(a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),n(3,"Back"),t()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),n(11,"General"),t()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),n(17,"Created Date"),t(),i(18,"div")(19,"span"),n(20),p(21,"date"),t()()()(),i(22,"div",9)(23,"div",10)(24,"label"),n(25,"Status"),t(),i(26,"div")(27,"span"),n(28),t()()()()(),i(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),n(33,"Duration"),t(),i(34,"div")(35,"span"),n(36),p(37,"number"),t()()()(),i(38,"div",9)(39,"div",10)(40,"label"),n(41,"Label"),t(),i(42,"div")(43,"span"),n(44),t()()()()()()()()(),i(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),n(50,"Message"),t()(),i(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),n(55),t()()()()()(),c(56,w,10,1,"div",9),c(57,k,10,1,"div",15),t()()()()),a&2){let e=v;D("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(f(21,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",f(37,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m(e!=null&&e.Perflog?56:-1),o(),m(e!=null&&e.StackTrace?57:-1)}}var J=(()=>{class a{constructor(){this.activatedRoute=s(I),this.notificationService=s(P)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(h(e=>{let l=e.ID;return this.notificationService.getNotificationDetail(l).pipe(x(r=>(r.DurationInSecond=parseInt(r.Duration)/1e3,r)))}))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275cmp=C({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(l,r){if(l&1&&(c(0,B,58,16,"mainpanel",0),p(1,"async")),l&2){let S;m((S=E(1,1,r.notification$))?0:-1,S)}},dependencies:[R,T,M,b,g,y],encapsulation:2,changeDetection:0})}}return a})();export{J as DetailComponent};
1
+ import{b as P}from"./chunk-B3VDRD6N.js";import"./chunk-BGFEVOPZ.js";import{b as R}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import{b as I,e as M,g as T}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as g,D as y,z as b}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Ic as n,Jc as d,Kc as _,V as h,Xb as c,Zb as m,cc as D,dc as i,ec as t,ed as p,fd as E,gb as o,gd as f,ha as s,r as x,tc as u,yb as C}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function w(a,v){if(a&1&&(i(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e.Perflog)}}function k(a,v){if(a&1&&(i(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"StackTrace"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e==null?null:e.StackTrace)}}function B(a,v){if(a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),n(3,"Back"),t()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),n(11,"General"),t()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),n(17,"Created Date"),t(),i(18,"div")(19,"span"),n(20),p(21,"date"),t()()()(),i(22,"div",9)(23,"div",10)(24,"label"),n(25,"Status"),t(),i(26,"div")(27,"span"),n(28),t()()()()(),i(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),n(33,"Duration"),t(),i(34,"div")(35,"span"),n(36),p(37,"number"),t()()()(),i(38,"div",9)(39,"div",10)(40,"label"),n(41,"Label"),t(),i(42,"div")(43,"span"),n(44),t()()()()()()()()(),i(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),n(50,"Message"),t()(),i(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),n(55),t()()()()()(),c(56,w,10,1,"div",9),c(57,k,10,1,"div",15),t()()()()),a&2){let e=v;D("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(f(21,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",f(37,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m(e!=null&&e.Perflog?56:-1),o(),m(e!=null&&e.StackTrace?57:-1)}}var J=(()=>{class a{constructor(){this.activatedRoute=s(I),this.notificationService=s(P)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(h(e=>{let l=e.ID;return this.notificationService.getNotificationDetail(l).pipe(x(r=>(r.DurationInSecond=parseInt(r.Duration)/1e3,r)))}))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275cmp=C({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(l,r){if(l&1&&(c(0,B,58,16,"mainpanel",0),p(1,"async")),l&2){let S;m((S=E(1,1,r.notification$))?0:-1,S)}},dependencies:[R,T,M,b,g,y],encapsulation:2,changeDetection:0})}}return a})();export{J as DetailComponent};
@@ -1 +1 @@
1
- import{a as E}from"./chunk-QNSVLW6H.js";import{a as F}from"./chunk-6OBHYVWL.js";import{f as T}from"./chunk-AU5MQHG5.js";import{a as w}from"./chunk-63X2BBS4.js";import{b as i,c as m}from"./chunk-NNVT5X6O.js";import{b as j,e as s}from"./chunk-ZE4OOGMT.js";import{d as D}from"./chunk-56N77BXA.js";import{Aa as C,C as I,F as u,ca as c,e as b,ha as a,l as d,r as A,x as U}from"./chunk-5VYDZBNH.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({name:e.name,options:e.options}))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/ShopifyV2/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Mt=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(F),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(z),this.tokopediaUploadService=a(V),this.wooUploadService=a(R),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(D),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Lazada:o=this.lazadaUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,z as c,R as d,Mt as e};
1
+ import{a as E}from"./chunk-QNSVLW6H.js";import{a as F}from"./chunk-D3CJWU7A.js";import{f as T}from"./chunk-EPME7TI3.js";import{a as w}from"./chunk-63X2BBS4.js";import{b as i,c as m}from"./chunk-NNVT5X6O.js";import{b as j,e as s}from"./chunk-ZE4OOGMT.js";import{d as D}from"./chunk-56N77BXA.js";import{Aa as C,C as I,F as u,ca as c,e as b,ha as a,l as d,r as A,x as U}from"./chunk-5VYDZBNH.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({name:e.name,options:e.options}))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/ShopifyV2/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Mt=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(F),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(z),this.tokopediaUploadService=a(V),this.wooUploadService=a(R),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(D),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Lazada:o=this.lazadaUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,z as c,R as d,Mt as e};
@@ -1 +1 @@
1
- import{a as q}from"./chunk-A46ZW26C.js";import{a as z}from"./chunk-QPCTJKN6.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as j}from"./chunk-PGDBJOSL.js";import{a as Z}from"./chunk-VYXSV6K4.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-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as H}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.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{a as y}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{h as W,m as $,z as G}from"./chunk-7HUEGPJN.js";import{e as R}from"./chunk-ZE4OOGMT.js";import{e as F,g as O}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as N,z as A}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as V,Ic as a,Jc as g,Mc as K,Nc as T,Oc as P,Pc as B,S as D,Xb as k,Zb as U,_b as I,ac as E,bc as L,cc as d,db as b,dc as e,ec as t,ed as w,fc as c,fd as v,gb as l,ha as f,mc as x,oa as m,pa as u,rc as S,tc as _,yb as M}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function J(o,h){if(o&1){let i=x();e(0,"img",21),S("click",function(r){m(i);let n=_().$implicit,s=_();return u(s.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=_().$implicit;d("src",i==null?null:i.ThumbnailUrl,b)}}function Q(o,h){o&1&&c(0,"img",17)}function X(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,J,1,1,"img",16)(4,Q,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),d("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var he=(()=>{class o{constructor(){this.httpService=f(R),this.biggerPictureService=f(Z),this.filter=V({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(D(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=M({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),S("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),P("ngModelChange",function(C){return m(n),T(r.filter().ListChannelID,C)||(r.filter().ListChannelID=C),u(C)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,X,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),S("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),d("hideSearchBox",!0),l(10),d("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),d("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[H,j,O,F,q,z,G,W,$,A,N],encapsulation:2,changeDetection:0})}}return o})();export{he as DuplicateSkuV2Component};
1
+ import{a as q}from"./chunk-A46ZW26C.js";import{a as z}from"./chunk-XZG5D6MR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as j}from"./chunk-PGDBJOSL.js";import{a as Z}from"./chunk-VYXSV6K4.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-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as H}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as y}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{h as W,m as $,z as G}from"./chunk-7HUEGPJN.js";import{e as R}from"./chunk-ZE4OOGMT.js";import{e as F,g as O}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as N,z as A}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as V,Ic as a,Jc as g,Mc as K,Nc as T,Oc as P,Pc as B,S as D,Xb as k,Zb as U,_b as I,ac as E,bc as L,cc as d,db as b,dc as e,ec as t,ed as w,fc as c,fd as v,gb as l,ha as f,mc as x,oa as m,pa as u,rc as S,tc as _,yb as M}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function J(o,h){if(o&1){let i=x();e(0,"img",21),S("click",function(r){m(i);let n=_().$implicit,s=_();return u(s.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=_().$implicit;d("src",i==null?null:i.ThumbnailUrl,b)}}function Q(o,h){o&1&&c(0,"img",17)}function X(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,J,1,1,"img",16)(4,Q,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),d("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var he=(()=>{class o{constructor(){this.httpService=f(R),this.biggerPictureService=f(Z),this.filter=V({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(D(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=M({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),S("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),P("ngModelChange",function(C){return m(n),T(r.filter().ListChannelID,C)||(r.filter().ListChannelID=C),u(C)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,X,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),S("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),d("hideSearchBox",!0),l(10),d("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),d("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[H,j,O,F,q,z,G,W,$,A,N],encapsulation:2,changeDetection:0})}}return o})();export{he as DuplicateSkuV2Component};
@@ -1 +1 @@
1
- import{a as Te}from"./chunk-3C3TLWKJ.js";import{a as I}from"./chunk-ISMIPSYN.js";import{a as ye,b as Fe,c as Ve,d as L,e as B}from"./chunk-SA4KQTJY.js";import{a as we}from"./chunk-CMZFAK2O.js";import{a as be,b as Me}from"./chunk-32F5EUMW.js";import{a as Se}from"./chunk-QPCTJKN6.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as Pe}from"./chunk-NH7UFKXO.js";import{a as ve}from"./chunk-6YRYXHZS.js";import{a as xe}from"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as fe}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-6Z77GYRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as he,e as ue}from"./chunk-474G6BPL.js";import{a as ge,b as Ce}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as me}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.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-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import{f as re}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as ie,c as oe}from"./chunk-MDHMVGYC.js";import{c as ee}from"./chunk-NNVT5X6O.js";import{b as le,c as ce,h as se,m as de,o as pe,z as _e}from"./chunk-7HUEGPJN.js";import{b as te,e as ne}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as T,K as Y,z as X}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as x,C as G,Eb as F,Fc as O,Ic as m,Jc as k,Kc as w,Mc as R,Nc as $,Oc as U,S as K,Sc as J,Vc as Z,Xb as h,Xc as V,Y as q,Zb as u,_b as D,ac as E,bc as N,cc as g,db as y,dc as r,ec as l,ed as b,fc as v,fd as M,gb as c,gd as Q,ha as f,mc as P,oa as d,pa as p,rc as C,tc as a,yb as j}from"./chunk-5VYDZBNH.js";import{a as H,b as W}from"./chunk-QWWW7GFA.js";var A=o=>[o];function De(o,s){if(o&1){let e=P();r(0,"button",15),C("click",function(){d(e);let t=a(),n=a(2);return p(n.updateStock(t))}),v(1,"i",16),m(2," Update "),l()}}function Ee(o,s){if(o&1){let e=P();r(0,"div",10),h(1,De,3,0,"button",12),r(2,"button",13),C("click",function(){d(e);let t=a(2);return p(t.openExportDialog())}),v(3,"i",14),r(4,"span"),m(5,"Export"),l()()()}if(o&2){let e=a(2);c(),u(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=P();r(0,"th")(1,"input",31),C("change",function(t){d(e);let n=a(),_=a(2);return p(_.onSelectAllSKU(t.target.checked,n))}),l()()}}function Oe(o,s){if(o&1){let e=P();r(0,"input",48),U("ngModelChange",function(t){d(e);let n=a(4).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){d(e);let t=a(4).$implicit,n=a(3);return p(n.onCheckboxStateProduct(t))}),l()}if(o&2){let e=a(4).$implicit;R("ngModel",e.selected)}}function ke(o,s){if(o&1&&F(0,Oe,1,1,"ng-template",25),o&2){let e=a(6);g("ngxPermissionsOnly",V(1,A,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=P();r(0,"img",49),C("click",function(t){d(e);let n=a(3).$implicit,_=a(3);return p(_.onZoomImage(t,n==null?null:n.ImageUrl))}),l()}if(o&2){let e=a(3).$implicit;g("src",J(e.ThumbnailUrl),y)}}function $e(o,s){o&1&&v(0,"img",44)}function Ue(o,s){if(o&1&&(r(0,"small",47),m(1),l()),o&2){let e=a(3).$implicit;c(),w("(",e.Category,")")}}function Le(o,s){if(o&1&&(r(0,"td",42)(1,"div",34),h(2,ke,1,3,null,25),r(3,"div"),h(4,Re,1,2,"img",43)(5,$e,1,0,"img",44),l()()(),r(6,"td",45)(7,"span",46),m(8),l(),h(9,Ue,2,1,"small",47),l()),o&2){let e=a(2).$implicit;g("rowSpan",e.Variants.length),c(2),u((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),u(e.ThumbnailUrl?4:5),c(2),g("rowSpan",e.Variants.length),c(2),k(e.Name),c(),u(e.Category?9:-1)}}function Be(o,s){if(o&1){let e=P();r(0,"input",52),U("ngModelChange",function(t){d(e);let n=a(2).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),l()}if(o&2){let e=a(2).$implicit;R("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(r(0,"td",50),h(1,Be,1,1,"input",51),l()),o&2){let e=a().$implicit;c(),u(e.UnitPrice>=0?1:-1)}}function ze(o,s){o&1&&(r(0,"div",35),m(1," Not Found "),l())}function He(o,s){if(o&1&&(r(0,"div"),m(1),b(2,"number"),l()),o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.UnitPrice)," ")}}function We(o,s){if(o&1&&(r(0,"div",36)(1,"a",38),v(2,"i",53),l()()),o&2){let e=a().$implicit,i=a(4);c(),g("href",i.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),y)}}function Ge(o,s){if(o&1){let e=P();r(0,"div",54),C("click",function(){d(e);let t=a().$implicit,n=a().$implicit,_=a(2),S=a();return p(S.openTableDialog(t,n,_))}),m(1),b(2,"number"),l()}if(o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ke(o,s){if(o&1){let e=P();r(0,"tr",32),h(1,Le,10,6),r(2,"td",23),m(3),l(),r(4,"td",26)(5,"span",33),m(6),l()(),F(7,Ae,2,1,"ng-template",25),r(8,"td",26)(9,"div",34),h(10,ze,2,0,"div",35),h(11,He,3,3,"div"),h(12,We,3,1,"div",36),l()(),r(13,"td",26)(14,"div",34),h(15,Ge,3,3,"div",37),r(16,"div",36)(17,"a",38),v(18,"i",39),l()(),r(19,"div",36)(20,"div",40),C("click",function(){let t=d(e).$implicit,n=a(4);return p(n.refreshPrice(t))}),v(21,"i",41),l()()()()()}if(o&2){let e=s.$implicit,i=s.$index,t=a(4);c(),u(i==0?1:-1),c(2),k(e.Model),c(2),O("text-decoration-line-through",e.Discontinued),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),c(),w(" ",e.Code," "),c(),g("ngxPermissionsOnly",V(14,A,t.rolePriceEdit)),c(3),u((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),O("bg-gradient-warning",e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price)),c(2),u(e.Channel.length>0?15:-1),c(2),g("href",e.Channel[0]==null?null:e.Channel[0].Url,y)}}function qe(o,s){if(o&1&&E(0,Ke,22,16,"tr",32,D),o&2){let e=s.$implicit;N(e.Variants)}}function je(o,s){if(o&1){let e=P();r(0,"div",11)(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),m(6," Product "),r(7,"div")(8,"mat-slide-toggle",21),C("ngModelChange",function(t){d(e);let n=a(2);return p(n.toggleDifferentInventory.set(t))})("toggleChange",function(){d(e);let t=a(2);return p(t.onToggleDifferentInventory())}),r(9,"small",22),m(10,"FILTER DIFFERENT PRICE"),l()()()(),r(11,"th",23),m(12,"Variant"),l(),r(13,"th",24),m(14,"SKU"),l(),F(15,Ne,2,0,"ng-template",25),r(16,"th",26),m(17,"POS"),l(),r(18,"th",26)(19,"div",27),C("click",function(){d(e);let t=a(2);return p(t.openModalFilter())}),v(20,"img",28),r(21,"span",29),m(22),b(23,"stringLimit"),l()()()()(),r(24,"tbody"),E(25,qe,2,0,null,null,D),l()(),r(27,"infinite-paginator",30),b(28,"async"),C("onNextPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){d(e);let t=a(2);return p(t.infinitePagination.getRowCount(t.searchFilter()))}),l()()()}if(o&2){let e,i,t,n=a(2);c(8),g("ngModel",n.toggleDifferentInventory()),c(7),g("ngxPermissionsOnly",V(16,A,n.rolePriceEdit)),c(4),g("matTooltip",((e=n.selectedChannel())==null||e.Name==null?null:e.Name.length)>=20?(e=n.selectedChannel())==null?null:e.Name:""),c(),g("src",(i=n.selectedChannel())==null?null:i.Img,y),c(2),w(" ",Q(23,11,(t=n.selectedChannel())==null?null:t.Name,20)," "),c(3),N(s),c(2),g("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",M(28,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=P();r(0,"mainpanel",1),C("textChange",function(t){d(e);let n=a();return p(n.updateFilter("text",t))})("onSubmit",function(){d(e);let t=a();return p(t.onSearch())}),r(1,"filters")(2,"div",2)(3,"div",3)(4,"h6"),m(5,"Channel"),l(),r(6,"app-channel-options-v2",4),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("ChannelID",t))}),l()(),r(7,"div",5)(8,"h6"),m(9,"Number Filter Comparator"),l(),r(10,"ng-select",6),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("NumberFilterComparator",t))}),l()(),r(11,"div",5)(12,"h6"),m(13,"Search Type"),l(),r(14,"radio-options",7),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("SearchType",t))}),l()(),r(15,"div",5)(16,"h6"),m(17,"Page Number"),l(),r(18,"input",8),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("PageNumber",t))}),l()(),r(19,"div",5)(20,"h6"),m(21,"Page Size"),l(),r(22,"input",9),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("RowCount",t))}),l()()()(),r(23,"actions"),h(24,Ee,6,1,"div",10),b(25,"async"),l(),r(26,"content"),h(27,je,29,18,"div",11),b(28,"async"),l()()}if(o&2){let e,i,t=s,n=a();g("headerTitle",n.pageTitle())("text",n.searchFilter().text)("searchBoxPlaceHolder",n.searchPlaceholder()),c(6),g("ngModel",n.searchFilter().ChannelID),c(4),g("items",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",n.searchFilter().NumberFilterComparator),c(4),g("options",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",n.searchFilter().SearchType),c(4),g("ngModel",n.searchFilter().PageNumber),c(4),g("ngModel",n.searchFilter().RowCount),c(2),u((e=M(25,13,n.data$))?24:-1,e),c(3),u((i=M(28,15,n.data$))?27:-1,i)}}var Et=(()=>{class o{constructor(){this.http=f(ne),this.toastr=f(te),this.dialog=f(me),this.productService=f(fe),this.biggerPictureService=f(xe),this.authService=f(re),this.mainPanelService=f(ge),this.decimalPipe=f(T),this.placeholderService=f(Pe),this.infinitePagination=f(L),this.updateResHandling=f(B),this.pageTitle=x("Price Single Channel Comparison"),this.toggleDifferentInventory=x(!1),this.loaderEndpoint=x("PriceLoader/Load"),this.dataEndpoint=x("Price/GetSingleChannelComparison"),this.rowCountApi=x("Inventory/GetInventoryByChannelRowCount"),this.searchFilter=x({}),this.hostName=x(""),this.rolePriceEdit=ae.PriceUpdate,this.channelOptions=x([]),this.selectedChannel=x(null),this.discontinuedVariantMsg=x("This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel."),this.searchPlaceholder=x("Search ...");let e=this.authService;this.hostName.set(this.authService.getDomain()),this.data$=this.infinitePagination.data$.pipe(K(1)),this.channelOptions.set(e.getChannels())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint(),this.infinitePagination.fethRowCountEndpoint=this.rowCountApi(),this.loader$=this.http.post(`/API/${this.loaderEndpoint()}`).pipe(q(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(i=>(i.filterModel=I.ALL,i)),this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory()?this.searchFilter.update(e=>(e.filterModel=I.ALL,e)):this.searchFilter.update(e=>(e.filterModel=I.DIFFERENCE,e)),this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(i=>(i.selected=e.selected,i))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),n={ListChannelID:[this.searchFilter().ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",n).subscribe(_=>{this.onSearch(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let i=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,i,"Price");let n=(t||[]).map(_=>this.buildPlugoTruncationHtml(_?.Message)).filter(_=>!!_);n.length>0&&this.toastr.warning(n.join("<br>"),(i||[]).length===0?"Success with Warning":"Warning",{enableHtml:!0})}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let i={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",i).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,i,t){let n=JSON.parse(JSON.stringify(e));this.dialog.open(ye,{data:{Name:i.Name,Variant:n,ChannelID:n?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:n?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(G(S=>ee.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,e)})}updateItemAfterDialog(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe({next:n=>{let _=this.productService.findChannelById(t.ID,this.channelOptions()),S=this.extractSuccessNote(n),z=this.buildPlugoTruncationHtml(S);if(z)this.toastr.warning(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} \u2014 ${z}`,"Success with Warning",{enableHtml:!0});else{let Ie=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} to ${Ie}`,"Success"),S&&S!=="Success"&&this.toastr.warning(S,"Warning")}this.infinitePagination.reloadPagination(this.searchFilter())},error:n=>{let _=n?.error?.Message||n?.error?.message||n?.error?.Response?.failure_list?.[0]?.Message||n?.message||"Failed to update price";this.toastr.error(_,"Error")}})}extractSuccessNote(e){return e?.Response?.success_list?.[0]?.Message??e?.response?.success_list?.[0]?.Message??e?.Response?.success_list?.[0]?.message??e?.success_list?.[0]?.Message}buildPlugoTruncationHtml(e){if(!e||e==="Success"||!e.includes("Plugo does not support decimal"))return null;let i=e.match(/Original price ([\d.,]+) was truncated to ([\d.,]+)/i);if(i){let t=this.decimalPipe.transform(parseFloat(i[1].replace(/,/g,"")))??i[1],n=this.decimalPipe.transform(parseFloat(i[2].replace(/,/g,"")))??i[2];return`${t} was rounded down to <b>${n}</b> \u2014 Plugo accepts whole numbers only.`}return e.replace(/^Success\s*-\s*Note:\s*/i,"")||e}initSelectedChannel(){this.selectedChannel.set(this.channelOptions().find(e=>e.ID==this.searchFilter().ChannelID))}onSelectAllSKU(e,i){i=i.map(t=>(t.Variants=t.Variants.map(n=>(n.selected=e,n)),t))}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}openExportDialog(){this.dialog.open(we,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountApi(),exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}updateFilter(e,i){this.searchFilter.update(t=>W(H({},t),{[e]:i}))}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=j({type:o,selectors:[["app-price-single-channel"]],features:[Z([L,Te,Y("https://resc.cloudinary.com/"),T,B])],decls:2,vars:3,consts:[["filterDialogWidth","625px",1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],["filterDialogWidth","625px",1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","ngModel"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","placeholder","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","placeholder","Page Size",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(i,t){if(i&1&&(h(0,Je,29,17,"mainpanel",0),b(1,"async")),i&2){let n;u((n=M(1,1,t.loader$))?0:-1,n)}},dependencies:[Ce,_e,ce,pe,le,se,de,Ve,oe,ie,Me,be,Se,ue,he,ve,Fe,X,T],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}.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%] 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}"],changeDetection:0})}}return o})();export{Et as PriceSingleChannelComponent};
1
+ import{a as Te}from"./chunk-3C3TLWKJ.js";import{a as I}from"./chunk-ISMIPSYN.js";import{a as ye,b as Fe,c as Ve,d as L,e as B}from"./chunk-SA4KQTJY.js";import{a as we}from"./chunk-CMZFAK2O.js";import{a as be,b as Me}from"./chunk-32F5EUMW.js";import{a as Se}from"./chunk-XZG5D6MR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{c as Pe}from"./chunk-NH7UFKXO.js";import{a as ve}from"./chunk-6YRYXHZS.js";import{a as xe}from"./chunk-VYXSV6K4.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as fe}from"./chunk-D3CJWU7A.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-B3VDRD6N.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{d as he,e as ue}from"./chunk-474G6BPL.js";import{a as ge,b as Ce}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import{c as me}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.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-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import{f as re}from"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as ie,c as oe}from"./chunk-MDHMVGYC.js";import{c as ee}from"./chunk-NNVT5X6O.js";import{b as le,c as ce,h as se,m as de,o as pe,z as _e}from"./chunk-7HUEGPJN.js";import{b as te,e as ne}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as T,K as Y,z as X}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as x,C as G,Eb as F,Fc as O,Ic as m,Jc as k,Kc as w,Mc as R,Nc as $,Oc as U,S as K,Sc as J,Vc as Z,Xb as h,Xc as V,Y as q,Zb as u,_b as D,ac as E,bc as N,cc as g,db as y,dc as r,ec as l,ed as b,fc as v,fd as M,gb as c,gd as Q,ha as f,mc as P,oa as d,pa as p,rc as C,tc as a,yb as j}from"./chunk-5VYDZBNH.js";import{a as H,b as W}from"./chunk-QWWW7GFA.js";var A=o=>[o];function De(o,s){if(o&1){let e=P();r(0,"button",15),C("click",function(){d(e);let t=a(),n=a(2);return p(n.updateStock(t))}),v(1,"i",16),m(2," Update "),l()}}function Ee(o,s){if(o&1){let e=P();r(0,"div",10),h(1,De,3,0,"button",12),r(2,"button",13),C("click",function(){d(e);let t=a(2);return p(t.openExportDialog())}),v(3,"i",14),r(4,"span"),m(5,"Export"),l()()()}if(o&2){let e=a(2);c(),u(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=P();r(0,"th")(1,"input",31),C("change",function(t){d(e);let n=a(),_=a(2);return p(_.onSelectAllSKU(t.target.checked,n))}),l()()}}function Oe(o,s){if(o&1){let e=P();r(0,"input",48),U("ngModelChange",function(t){d(e);let n=a(4).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){d(e);let t=a(4).$implicit,n=a(3);return p(n.onCheckboxStateProduct(t))}),l()}if(o&2){let e=a(4).$implicit;R("ngModel",e.selected)}}function ke(o,s){if(o&1&&F(0,Oe,1,1,"ng-template",25),o&2){let e=a(6);g("ngxPermissionsOnly",V(1,A,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=P();r(0,"img",49),C("click",function(t){d(e);let n=a(3).$implicit,_=a(3);return p(_.onZoomImage(t,n==null?null:n.ImageUrl))}),l()}if(o&2){let e=a(3).$implicit;g("src",J(e.ThumbnailUrl),y)}}function $e(o,s){o&1&&v(0,"img",44)}function Ue(o,s){if(o&1&&(r(0,"small",47),m(1),l()),o&2){let e=a(3).$implicit;c(),w("(",e.Category,")")}}function Le(o,s){if(o&1&&(r(0,"td",42)(1,"div",34),h(2,ke,1,3,null,25),r(3,"div"),h(4,Re,1,2,"img",43)(5,$e,1,0,"img",44),l()()(),r(6,"td",45)(7,"span",46),m(8),l(),h(9,Ue,2,1,"small",47),l()),o&2){let e=a(2).$implicit;g("rowSpan",e.Variants.length),c(2),u((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),u(e.ThumbnailUrl?4:5),c(2),g("rowSpan",e.Variants.length),c(2),k(e.Name),c(),u(e.Category?9:-1)}}function Be(o,s){if(o&1){let e=P();r(0,"input",52),U("ngModelChange",function(t){d(e);let n=a(2).$implicit;return $(n.selected,t)||(n.selected=t),p(t)}),l()}if(o&2){let e=a(2).$implicit;R("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(r(0,"td",50),h(1,Be,1,1,"input",51),l()),o&2){let e=a().$implicit;c(),u(e.UnitPrice>=0?1:-1)}}function ze(o,s){o&1&&(r(0,"div",35),m(1," Not Found "),l())}function He(o,s){if(o&1&&(r(0,"div"),m(1),b(2,"number"),l()),o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.UnitPrice)," ")}}function We(o,s){if(o&1&&(r(0,"div",36)(1,"a",38),v(2,"i",53),l()()),o&2){let e=a().$implicit,i=a(4);c(),g("href",i.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),y)}}function Ge(o,s){if(o&1){let e=P();r(0,"div",54),C("click",function(){d(e);let t=a().$implicit,n=a().$implicit,_=a(2),S=a();return p(S.openTableDialog(t,n,_))}),m(1),b(2,"number"),l()}if(o&2){let e=a().$implicit;c(),w(" ",M(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ke(o,s){if(o&1){let e=P();r(0,"tr",32),h(1,Le,10,6),r(2,"td",23),m(3),l(),r(4,"td",26)(5,"span",33),m(6),l()(),F(7,Ae,2,1,"ng-template",25),r(8,"td",26)(9,"div",34),h(10,ze,2,0,"div",35),h(11,He,3,3,"div"),h(12,We,3,1,"div",36),l()(),r(13,"td",26)(14,"div",34),h(15,Ge,3,3,"div",37),r(16,"div",36)(17,"a",38),v(18,"i",39),l()(),r(19,"div",36)(20,"div",40),C("click",function(){let t=d(e).$implicit,n=a(4);return p(n.refreshPrice(t))}),v(21,"i",41),l()()()()()}if(o&2){let e=s.$implicit,i=s.$index,t=a(4);c(),u(i==0?1:-1),c(2),k(e.Model),c(2),O("text-decoration-line-through",e.Discontinued),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),c(),w(" ",e.Code," "),c(),g("ngxPermissionsOnly",V(14,A,t.rolePriceEdit)),c(3),u((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),u((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),O("bg-gradient-warning",e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price)),c(2),u(e.Channel.length>0?15:-1),c(2),g("href",e.Channel[0]==null?null:e.Channel[0].Url,y)}}function qe(o,s){if(o&1&&E(0,Ke,22,16,"tr",32,D),o&2){let e=s.$implicit;N(e.Variants)}}function je(o,s){if(o&1){let e=P();r(0,"div",11)(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),m(6," Product "),r(7,"div")(8,"mat-slide-toggle",21),C("ngModelChange",function(t){d(e);let n=a(2);return p(n.toggleDifferentInventory.set(t))})("toggleChange",function(){d(e);let t=a(2);return p(t.onToggleDifferentInventory())}),r(9,"small",22),m(10,"FILTER DIFFERENT PRICE"),l()()()(),r(11,"th",23),m(12,"Variant"),l(),r(13,"th",24),m(14,"SKU"),l(),F(15,Ne,2,0,"ng-template",25),r(16,"th",26),m(17,"POS"),l(),r(18,"th",26)(19,"div",27),C("click",function(){d(e);let t=a(2);return p(t.openModalFilter())}),v(20,"img",28),r(21,"span",29),m(22),b(23,"stringLimit"),l()()()()(),r(24,"tbody"),E(25,qe,2,0,null,null,D),l()(),r(27,"infinite-paginator",30),b(28,"async"),C("onNextPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){d(e);let t=a(2);return p(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){d(e);let t=a(2);return p(t.infinitePagination.getRowCount(t.searchFilter()))}),l()()()}if(o&2){let e,i,t,n=a(2);c(8),g("ngModel",n.toggleDifferentInventory()),c(7),g("ngxPermissionsOnly",V(16,A,n.rolePriceEdit)),c(4),g("matTooltip",((e=n.selectedChannel())==null||e.Name==null?null:e.Name.length)>=20?(e=n.selectedChannel())==null?null:e.Name:""),c(),g("src",(i=n.selectedChannel())==null?null:i.Img,y),c(2),w(" ",Q(23,11,(t=n.selectedChannel())==null?null:t.Name,20)," "),c(3),N(s),c(2),g("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",M(28,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=P();r(0,"mainpanel",1),C("textChange",function(t){d(e);let n=a();return p(n.updateFilter("text",t))})("onSubmit",function(){d(e);let t=a();return p(t.onSearch())}),r(1,"filters")(2,"div",2)(3,"div",3)(4,"h6"),m(5,"Channel"),l(),r(6,"app-channel-options-v2",4),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("ChannelID",t))}),l()(),r(7,"div",5)(8,"h6"),m(9,"Number Filter Comparator"),l(),r(10,"ng-select",6),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("NumberFilterComparator",t))}),l()(),r(11,"div",5)(12,"h6"),m(13,"Search Type"),l(),r(14,"radio-options",7),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("SearchType",t))}),l()(),r(15,"div",5)(16,"h6"),m(17,"Page Number"),l(),r(18,"input",8),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("PageNumber",t))}),l()(),r(19,"div",5)(20,"h6"),m(21,"Page Size"),l(),r(22,"input",9),C("ngModelChange",function(t){d(e);let n=a();return p(n.updateFilter("RowCount",t))}),l()()()(),r(23,"actions"),h(24,Ee,6,1,"div",10),b(25,"async"),l(),r(26,"content"),h(27,je,29,18,"div",11),b(28,"async"),l()()}if(o&2){let e,i,t=s,n=a();g("headerTitle",n.pageTitle())("text",n.searchFilter().text)("searchBoxPlaceHolder",n.searchPlaceholder()),c(6),g("ngModel",n.searchFilter().ChannelID),c(4),g("items",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions)("clearable",!1)("ngModel",n.searchFilter().NumberFilterComparator),c(4),g("options",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions)("ngModel",n.searchFilter().SearchType),c(4),g("ngModel",n.searchFilter().PageNumber),c(4),g("ngModel",n.searchFilter().RowCount),c(2),u((e=M(25,13,n.data$))?24:-1,e),c(3),u((i=M(28,15,n.data$))?27:-1,i)}}var Et=(()=>{class o{constructor(){this.http=f(ne),this.toastr=f(te),this.dialog=f(me),this.productService=f(fe),this.biggerPictureService=f(xe),this.authService=f(re),this.mainPanelService=f(ge),this.decimalPipe=f(T),this.placeholderService=f(Pe),this.infinitePagination=f(L),this.updateResHandling=f(B),this.pageTitle=x("Price Single Channel Comparison"),this.toggleDifferentInventory=x(!1),this.loaderEndpoint=x("PriceLoader/Load"),this.dataEndpoint=x("Price/GetSingleChannelComparison"),this.rowCountApi=x("Inventory/GetInventoryByChannelRowCount"),this.searchFilter=x({}),this.hostName=x(""),this.rolePriceEdit=ae.PriceUpdate,this.channelOptions=x([]),this.selectedChannel=x(null),this.discontinuedVariantMsg=x("This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel."),this.searchPlaceholder=x("Search ...");let e=this.authService;this.hostName.set(this.authService.getDomain()),this.data$=this.infinitePagination.data$.pipe(K(1)),this.channelOptions.set(e.getChannels())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint(),this.infinitePagination.fethRowCountEndpoint=this.rowCountApi(),this.loader$=this.http.post(`/API/${this.loaderEndpoint()}`).pipe(q(e=>{this.searchFilter.set(e.Filter),this.searchFilter.update(i=>(i.filterModel=I.ALL,i)),this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory()?this.searchFilter.update(e=>(e.filterModel=I.ALL,e)):this.searchFilter.update(e=>(e.filterModel=I.DIFFERENCE,e)),this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(i=>(i.selected=e.selected,i))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),n={ListChannelID:[this.searchFilter().ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",n).subscribe(_=>{this.onSearch(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let i=e.failure_list,t=e.success_list;this.updateResHandling.responseHandling(t,i,"Price");let n=(t||[]).map(_=>this.buildPlugoTruncationHtml(_?.Message)).filter(_=>!!_);n.length>0&&this.toastr.warning(n.join("<br>"),(i||[]).length===0?"Success with Warning":"Warning",{enableHtml:!0})}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let i={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",i).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter()),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,i,t){let n=JSON.parse(JSON.stringify(e));this.dialog.open(ye,{data:{Name:i.Name,Variant:n,ChannelID:n?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:n?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(G(S=>ee.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,e)})}updateItemAfterDialog(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe({next:n=>{let _=this.productService.findChannelById(t.ID,this.channelOptions()),S=this.extractSuccessNote(n),z=this.buildPlugoTruncationHtml(S);if(z)this.toastr.warning(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} \u2014 ${z}`,"Success with Warning",{enableHtml:!0});else{let Ie=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${_.Name} to ${Ie}`,"Success"),S&&S!=="Success"&&this.toastr.warning(S,"Warning")}this.infinitePagination.reloadPagination(this.searchFilter())},error:n=>{let _=n?.error?.Message||n?.error?.message||n?.error?.Response?.failure_list?.[0]?.Message||n?.message||"Failed to update price";this.toastr.error(_,"Error")}})}extractSuccessNote(e){return e?.Response?.success_list?.[0]?.Message??e?.response?.success_list?.[0]?.Message??e?.Response?.success_list?.[0]?.message??e?.success_list?.[0]?.Message}buildPlugoTruncationHtml(e){if(!e||e==="Success"||!e.includes("Plugo does not support decimal"))return null;let i=e.match(/Original price ([\d.,]+) was truncated to ([\d.,]+)/i);if(i){let t=this.decimalPipe.transform(parseFloat(i[1].replace(/,/g,"")))??i[1],n=this.decimalPipe.transform(parseFloat(i[2].replace(/,/g,"")))??i[2];return`${t} was rounded down to <b>${n}</b> \u2014 Plugo accepts whole numbers only.`}return e.replace(/^Success\s*-\s*Note:\s*/i,"")||e}initSelectedChannel(){this.selectedChannel.set(this.channelOptions().find(e=>e.ID==this.searchFilter().ChannelID))}onSelectAllSKU(e,i){i=i.map(t=>(t.Variants=t.Variants.map(n=>(n.selected=e,n)),t))}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}openExportDialog(){this.dialog.open(we,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountApi(),exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}updateFilter(e,i){this.searchFilter.update(t=>W(H({},t),{[e]:i}))}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=j({type:o,selectors:[["app-price-single-channel"]],features:[Z([L,Te,Y("https://resc.cloudinary.com/"),T,B])],decls:2,vars:3,consts:[["filterDialogWidth","625px",1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],["filterDialogWidth","625px",1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","ngModel"],[1,"filter-item"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","clearable","ngModel"],[3,"ngModelChange","options","ngModel"],["type","number","placeholder","Page Number",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","placeholder","Page Size",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(i,t){if(i&1&&(h(0,Je,29,17,"mainpanel",0),b(1,"async")),i&2){let n;u((n=M(1,1,t.loader$))?0:-1,n)}},dependencies:[Ce,_e,ce,pe,le,se,de,Ve,oe,ie,Me,be,Se,ue,he,ve,Fe,X,T],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}.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%] 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}"],changeDetection:0})}}return o})();export{Et as PriceSingleChannelComponent};
@@ -1,4 +1,4 @@
1
- import{a as fe,b as be,c as Ce,d as ve,e as we,f as Le,g as Re,h as Ne,j as Ve}from"./chunk-LLMHCE7Y.js";import"./chunk-DCGQK4V6.js";import{a as De,b as Pe}from"./chunk-DEBF436Y.js";import"./chunk-RZM45AEI.js";import{b as ze}from"./chunk-H276HPOG.js";import{a as Te}from"./chunk-SJBVLNCR.js";import{a as Ee}from"./chunk-QNSVLW6H.js";import{a as Me}from"./chunk-QPCTJKN6.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import{a as ke}from"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import{a as Se}from"./chunk-2KBEFXEF.js";import{c as xe,g as Ie}from"./chunk-O476ULLD.js";import{d as ye}from"./chunk-HBAHB3P5.js";import{a as _e}from"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import{f as ge}from"./chunk-KRIYDIQQ.js";import{b as me}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import{ra as G,sa as W}from"./chunk-7LEHDN2Q.js";import{a as Q,c as ue}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as de}from"./chunk-ZSUWHVKX.js";import{f as se}from"./chunk-AU5MQHG5.js";import"./chunk-5QGLAWLG.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as re,c as ae}from"./chunk-MDHMVGYC.js";import{c as U}from"./chunk-NNVT5X6O.js";import{b as ce,h as pe,m as he,z as R}from"./chunk-7HUEGPJN.js";import{b as oe,e as le}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as ie,F as ne}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as S,Eb as T,Fc as C,Ic as d,Jc as te,Kc as g,Mc as O,Nc as H,Oc as K,Vc as A,Wc as L,Xb as D,Xc as k,Y as V,Zb as P,_b as Z,ac as Y,bc as ee,ca as F,cc as h,da as j,db as z,dc as o,ec as l,ed as w,fc as _,fd as x,gb as a,ha as v,id as M,jc as I,kc as E,mc as y,oa as u,pa as m,r as q,rc as b,tc as s,ua as J,yb as B,zb as X}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var Be=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=X({type:i});static \u0275inj=j({imports:[ne,Le,Ie,xe,fe,be,Ce,we,ve,ze,_e,ye,Te,ke,W,R,ge,W]})}return i})();var $=(()=>{class i{constructor(){this.httpSerivice=v(le),this.toastrHandlingService=v(Ee),this.toastr=v(oe)}getChannelSummary$(e=[]){return this.httpSerivice.post("api/inventory/InventorySummary",{ListChannelID:e}).pipe(q(n=>n.Data.map((t,r)=>(t.id=r,t.Img=U.getChannelLogoByTypeId(t.Type),t.Groups=this.groupingProductByOutlet(t.Products),t.LocationNames=this.groupingLocationName(t.Groups),t))))}groupingProductByOutlet(e){let n=null;return U.IsNotEmpty(e[0].Outlet)&&(n=e.reduce((t,r)=>{let p=r.Outlet;return t[p]||(t[p]=[]),t[p].push(r),t},{})),n}groupingLocationName(e){let n=[];return e&&(n=Object.keys(e).map(t=>t)),n}refreshInventory(e,n){let t={ChannelItemID:e.ChannelItemID,ChannelVariationID:e.ChannelVariationID,ChannelID:n,VariantID:e.POSVariantID};return this.httpSerivice.post("/api/Inventory/RefreshInventoryChannel",t).pipe(V(()=>{this.toastr.success("Inventory refreshed successfully","Success")}))}updateChannelInventory(e){let n=this.mappingPayloadUpdateInventory(e);return this.httpSerivice.post("/api/Inventory/UpdateChannel",n).pipe(V(t=>{this.toastrHandlingService.showToastrUploadMultiple(t,this.customizeToastrMessage)}))}customizeToastrMessage(e,n){return`
1
+ import{a as fe,b as be,c as Ce,d as ve,e as we,f as Le,g as Re,h as Ne,j as Ve}from"./chunk-LLMHCE7Y.js";import"./chunk-DCGQK4V6.js";import{a as De,b as Pe}from"./chunk-DEBF436Y.js";import"./chunk-RZM45AEI.js";import{b as ze}from"./chunk-H276HPOG.js";import{a as Te}from"./chunk-SJBVLNCR.js";import{a as Ee}from"./chunk-QNSVLW6H.js";import{a as Me}from"./chunk-XZG5D6MR.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import{a as ke}from"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import{a as Se}from"./chunk-2KBEFXEF.js";import{c as xe,g as Ie}from"./chunk-O476ULLD.js";import{d as ye}from"./chunk-HBAHB3P5.js";import{a as _e}from"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import{f as ge}from"./chunk-KRIYDIQQ.js";import{b as me}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import{ra as G,sa as W}from"./chunk-7LEHDN2Q.js";import{a as Q,c as ue}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as de}from"./chunk-ZSUWHVKX.js";import{f as se}from"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as re,c as ae}from"./chunk-MDHMVGYC.js";import{c as U}from"./chunk-NNVT5X6O.js";import{b as ce,h as pe,m as he,z as R}from"./chunk-7HUEGPJN.js";import{b as oe,e as le}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as ie,F as ne}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as S,Eb as T,Fc as C,Ic as d,Jc as te,Kc as g,Mc as O,Nc as H,Oc as K,Vc as A,Wc as L,Xb as D,Xc as k,Y as V,Zb as P,_b as Z,ac as Y,bc as ee,ca as F,cc as h,da as j,db as z,dc as o,ec as l,ed as w,fc as _,fd as x,gb as a,ha as v,id as M,jc as I,kc as E,mc as y,oa as u,pa as m,r as q,rc as b,tc as s,ua as J,yb as B,zb as X}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var Be=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=X({type:i});static \u0275inj=j({imports:[ne,Le,Ie,xe,fe,be,Ce,we,ve,ze,_e,ye,Te,ke,W,R,ge,W]})}return i})();var $=(()=>{class i{constructor(){this.httpSerivice=v(le),this.toastrHandlingService=v(Ee),this.toastr=v(oe)}getChannelSummary$(e=[]){return this.httpSerivice.post("api/inventory/InventorySummary",{ListChannelID:e}).pipe(q(n=>n.Data.map((t,r)=>(t.id=r,t.Img=U.getChannelLogoByTypeId(t.Type),t.Groups=this.groupingProductByOutlet(t.Products),t.LocationNames=this.groupingLocationName(t.Groups),t))))}groupingProductByOutlet(e){let n=null;return U.IsNotEmpty(e[0].Outlet)&&(n=e.reduce((t,r)=>{let p=r.Outlet;return t[p]||(t[p]=[]),t[p].push(r),t},{})),n}groupingLocationName(e){let n=[];return e&&(n=Object.keys(e).map(t=>t)),n}refreshInventory(e,n){let t={ChannelItemID:e.ChannelItemID,ChannelVariationID:e.ChannelVariationID,ChannelID:n,VariantID:e.POSVariantID};return this.httpSerivice.post("/api/Inventory/RefreshInventoryChannel",t).pipe(V(()=>{this.toastr.success("Inventory refreshed successfully","Success")}))}updateChannelInventory(e){let n=this.mappingPayloadUpdateInventory(e);return this.httpSerivice.post("/api/Inventory/UpdateChannel",n).pipe(V(t=>{this.toastrHandlingService.showToastrUploadMultiple(t,this.customizeToastrMessage)}))}customizeToastrMessage(e,n){return`
2
2
  <div>
3
3
  Product ${e.Name} was <div class="d-inline fw-bold">successfully</div> updated to ${n}
4
4
  </div>
@@ -1,2 +1,2 @@
1
- import{a as J,b as K}from"./chunk-QK2JCSM3.js";import{a as Z}from"./chunk-CBPURQKN.js";import{a as Q,c as W}from"./chunk-W55ZHKHY.js";import{c as q}from"./chunk-DXXROE3I.js";import{f as U}from"./chunk-IRNBEBQA.js";import{b as H}from"./chunk-KMY7VNWE.js";import{v as $}from"./chunk-NMXGNJWD.js";import{$b as A,Dc as R,Dd as I,Ed as z,Ic as x,Jc as j,Kc as y,Qb as E,Rb as m,Xb as c,Zb as u,ac as V,bc as N,ca as M,cc as l,d as T,da as O,dc as n,ec as r,f as D,fa as w,fc as v,gb as o,ha as h,mc as P,oa as _,pa as b,qa as f,ra as k,rc as d,tc as p,wa as L,yb as B,yd as G,zb as F}from"./chunk-5VYDZBNH.js";function X(i,g){if(i&1&&(n(0,"mat-option",17),x(1),r()),i&2){let t=g.$implicit;l("value",t),o(),y(" ",t," ")}}function Y(i,g){if(i&1){let t=P();n(0,"mat-form-field",14)(1,"mat-select",16,0),d("selectionChange",function(e){_(t);let s=p(2);return b(s._changePageSize(e.value))}),V(3,X,2,2,"mat-option",17,A),r(),n(5,"div",18),d("click",function(){_(t);let e=R(2);return b(e.open())}),r()()}if(i&2){let t=p(2);l("appearance",t._formFieldAppearance)("color",t.color),o(),l("value",t.pageSize)("disabled",t.disabled),E("aria-labelledby",t._pageSizeLabelId),l("panelClass",t.selectConfig.panelClass||"")("disableOptionCentering",t.selectConfig.disableOptionCentering),o(2),N(t._displayedPageSizeOptions)}}function tt(i,g){if(i&1&&(n(0,"div",15),x(1),r()),i&2){let t=p(2);o(),j(t.pageSize)}}function et(i,g){if(i&1&&(n(0,"div",3)(1,"div",13),x(2),r(),c(3,Y,6,7,"mat-form-field",14),c(4,tt,2,1,"div",15),r()),i&2){let t=p();o(),m("id",t._pageSizeLabelId),o(),y(" ",t._intl.itemsPerPageLabel," "),o(),u(t._displayedPageSizeOptions.length>1?3:-1),o(),u(t._displayedPageSizeOptions.length<=1?4:-1)}}function it(i,g){if(i&1){let t=P();n(0,"button",19),d("click",function(){_(t);let e=p();return b(e._buttonClicked(0,e._previousButtonsDisabled()))}),f(),n(1,"svg",8),v(2,"path",20),r()()}if(i&2){let t=p();l("matTooltip",t._intl.firstPageLabel)("matTooltipDisabled",t._previousButtonsDisabled())("disabled",t._previousButtonsDisabled())("tabindex",t._previousButtonsDisabled()?-1:null),m("aria-label",t._intl.firstPageLabel)}}function at(i,g){if(i&1){let t=P();n(0,"button",21),d("click",function(){_(t);let e=p();return b(e._buttonClicked(e.getNumberOfPages()-1,e._nextButtonsDisabled()))}),f(),n(1,"svg",8),v(2,"path",22),r()()}if(i&2){let t=p();l("matTooltip",t._intl.lastPageLabel)("matTooltipDisabled",t._nextButtonsDisabled())("disabled",t._nextButtonsDisabled())("tabindex",t._nextButtonsDisabled()?-1:null),m("aria-label",t._intl.lastPageLabel)}}var nt=(()=>{class i{changes=new T;itemsPerPageLabel="Items per page:";nextPageLabel="Next page";previousPageLabel="Previous page";firstPageLabel="First page";lastPageLabel="Last page";getRangeLabel=(t,a,e)=>{if(e==0||a==0)return`0 of ${e}`;e=Math.max(e,0);let s=t*a,S=s<e?Math.min(s+a,e):s+a;return`${s+1} \u2013 ${S} of ${e}`};static \u0275fac=function(a){return new(a||i)};static \u0275prov=M({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),ot=50;var rt=new w("MAT_PAGINATOR_DEFAULT_OPTIONS"),st=(()=>{class i{_intl=h(nt);_changeDetectorRef=h(G);_formFieldAppearance;_pageSizeLabelId=h($).getId("mat-paginator-page-size-label-");_intlChanges;_isInitialized=!1;_initializedStream=new D(1);color;get pageIndex(){return this._pageIndex}set pageIndex(t){this._pageIndex=Math.max(t||0,0),this._changeDetectorRef.markForCheck()}_pageIndex=0;get length(){return this._length}set length(t){this._length=t||0,this._changeDetectorRef.markForCheck()}_length=0;get pageSize(){return this._pageSize}set pageSize(t){this._pageSize=Math.max(t||0,0),this._updateDisplayedPageSizeOptions()}_pageSize;get pageSizeOptions(){return this._pageSizeOptions}set pageSizeOptions(t){this._pageSizeOptions=(t||[]).map(a=>z(a,0)),this._updateDisplayedPageSizeOptions()}_pageSizeOptions=[];hidePageSize=!1;showFirstLastButtons=!1;selectConfig={};disabled=!1;page=new L;_displayedPageSizeOptions;initialized=this._initializedStream;constructor(){let t=this._intl,a=h(rt,{optional:!0});if(this._intlChanges=t.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),a){let{pageSize:e,pageSizeOptions:s,hidePageSize:S,showFirstLastButtons:C}=a;e!=null&&(this._pageSize=e),s!=null&&(this._pageSizeOptions=s),S!=null&&(this.hidePageSize=S),C!=null&&(this.showFirstLastButtons=C)}this._formFieldAppearance=a?.formFieldAppearance||"outline"}ngOnInit(){this._isInitialized=!0,this._updateDisplayedPageSizeOptions(),this._initializedStream.next()}ngOnDestroy(){this._initializedStream.complete(),this._intlChanges.unsubscribe()}nextPage(){this.hasNextPage()&&this._navigate(this.pageIndex+1)}previousPage(){this.hasPreviousPage()&&this._navigate(this.pageIndex-1)}firstPage(){this.hasPreviousPage()&&this._navigate(0)}lastPage(){this.hasNextPage()&&this._navigate(this.getNumberOfPages()-1)}hasPreviousPage(){return this.pageIndex>=1&&this.pageSize!=0}hasNextPage(){let t=this.getNumberOfPages()-1;return this.pageIndex<t&&this.pageSize!=0}getNumberOfPages(){return this.pageSize?Math.ceil(this.length/this.pageSize):0}_changePageSize(t){let a=this.pageIndex*this.pageSize,e=this.pageIndex;this.pageIndex=Math.floor(a/t)||0,this.pageSize=t,this._emitPageEvent(e)}_nextButtonsDisabled(){return this.disabled||!this.hasNextPage()}_previousButtonsDisabled(){return this.disabled||!this.hasPreviousPage()}_updateDisplayedPageSizeOptions(){this._isInitialized&&(this.pageSize||(this._pageSize=this.pageSizeOptions.length!=0?this.pageSizeOptions[0]:ot),this._displayedPageSizeOptions=this.pageSizeOptions.slice(),this._displayedPageSizeOptions.indexOf(this.pageSize)===-1&&this._displayedPageSizeOptions.push(this.pageSize),this._displayedPageSizeOptions.sort((t,a)=>t-a),this._changeDetectorRef.markForCheck())}_emitPageEvent(t){this.page.emit({previousPageIndex:t,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})}_navigate(t){let a=this.pageIndex;t!==a&&(this.pageIndex=t,this._emitPageEvent(a))}_buttonClicked(t,a){a||this._navigate(t)}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=B({type:i,selectors:[["mat-paginator"]],hostAttrs:["role","group",1,"mat-mdc-paginator"],inputs:{color:"color",pageIndex:[2,"pageIndex","pageIndex",z],length:[2,"length","length",z],pageSize:[2,"pageSize","pageSize",z],pageSizeOptions:"pageSizeOptions",hidePageSize:[2,"hidePageSize","hidePageSize",I],showFirstLastButtons:[2,"showFirstLastButtons","showFirstLastButtons",I],selectConfig:"selectConfig",disabled:[2,"disabled","disabled",I]},outputs:{page:"page"},exportAs:["matPaginator"],decls:14,vars:14,consts:[["selectRef",""],[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],[1,"mat-mdc-paginator-page-size"],[1,"mat-mdc-paginator-range-actions"],["aria-atomic","true","aria-live","polite","role","status",1,"mat-mdc-paginator-range-label"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-previous",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true",1,"mat-mdc-paginator-icon"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-next",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["aria-hidden","true",1,"mat-mdc-paginator-page-size-label"],[1,"mat-mdc-paginator-page-size-select",3,"appearance","color"],[1,"mat-mdc-paginator-page-size-value"],["hideSingleSelectionIndicator","",3,"selectionChange","value","disabled","aria-labelledby","panelClass","disableOptionCentering"],[3,"value"],[1,"mat-mdc-paginator-touch-target",3,"click"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"]],template:function(a,e){a&1&&(n(0,"div",1)(1,"div",2),c(2,et,5,4,"div",3),n(3,"div",4)(4,"div",5),x(5),r(),c(6,it,3,5,"button",6),n(7,"button",7),d("click",function(){return e._buttonClicked(e.pageIndex-1,e._previousButtonsDisabled())}),f(),n(8,"svg",8),v(9,"path",9),r()(),k(),n(10,"button",10),d("click",function(){return e._buttonClicked(e.pageIndex+1,e._nextButtonsDisabled())}),f(),n(11,"svg",8),v(12,"path",11),r()(),c(13,at,3,5,"button",12),r()()()),a&2&&(o(2),u(e.hidePageSize?-1:2),o(3),y(" ",e._intl.getRangeLabel(e.pageIndex,e.pageSize,e.length)," "),o(),u(e.showFirstLastButtons?6:-1),o(),l("matTooltip",e._intl.previousPageLabel)("matTooltipDisabled",e._previousButtonsDisabled())("disabled",e._previousButtonsDisabled())("tabindex",e._previousButtonsDisabled()?-1:null),m("aria-label",e._intl.previousPageLabel),o(3),l("matTooltip",e._intl.nextPageLabel)("matTooltipDisabled",e._nextButtonsDisabled())("disabled",e._nextButtonsDisabled())("tabindex",e._nextButtonsDisabled()?-1:null),m("aria-label",e._intl.nextPageLabel),o(3),u(e.showFirstLastButtons?13:-1))},dependencies:[U,J,q,Q,H],styles:[`.mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height: var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding: var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:var(--mat-paginator-page-size-select-width, 84px)}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:var(--mat-paginator-page-size-select-width, 84px);height:var(--mat-paginator-page-size-select-touch-target-height, 48px);background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer}
1
+ import{a as J,c as K}from"./chunk-WM7WOQJI.js";import{a as Z}from"./chunk-CBPURQKN.js";import{a as Q,c as W}from"./chunk-W55ZHKHY.js";import{c as q}from"./chunk-DXXROE3I.js";import{f as U}from"./chunk-IRNBEBQA.js";import{b as H}from"./chunk-KMY7VNWE.js";import{v as $}from"./chunk-NMXGNJWD.js";import{$b as A,Dc as R,Dd as I,Ed as z,Ic as x,Jc as j,Kc as y,Qb as E,Rb as m,Xb as c,Zb as u,ac as V,bc as N,ca as M,cc as l,d as T,da as O,dc as n,ec as r,f as D,fa as w,fc as v,gb as o,ha as h,mc as P,oa as _,pa as b,qa as f,ra as k,rc as d,tc as p,wa as L,yb as B,yd as G,zb as F}from"./chunk-5VYDZBNH.js";function X(i,g){if(i&1&&(n(0,"mat-option",17),x(1),r()),i&2){let t=g.$implicit;l("value",t),o(),y(" ",t," ")}}function Y(i,g){if(i&1){let t=P();n(0,"mat-form-field",14)(1,"mat-select",16,0),d("selectionChange",function(e){_(t);let s=p(2);return b(s._changePageSize(e.value))}),V(3,X,2,2,"mat-option",17,A),r(),n(5,"div",18),d("click",function(){_(t);let e=R(2);return b(e.open())}),r()()}if(i&2){let t=p(2);l("appearance",t._formFieldAppearance)("color",t.color),o(),l("value",t.pageSize)("disabled",t.disabled),E("aria-labelledby",t._pageSizeLabelId),l("panelClass",t.selectConfig.panelClass||"")("disableOptionCentering",t.selectConfig.disableOptionCentering),o(2),N(t._displayedPageSizeOptions)}}function tt(i,g){if(i&1&&(n(0,"div",15),x(1),r()),i&2){let t=p(2);o(),j(t.pageSize)}}function et(i,g){if(i&1&&(n(0,"div",3)(1,"div",13),x(2),r(),c(3,Y,6,7,"mat-form-field",14),c(4,tt,2,1,"div",15),r()),i&2){let t=p();o(),m("id",t._pageSizeLabelId),o(),y(" ",t._intl.itemsPerPageLabel," "),o(),u(t._displayedPageSizeOptions.length>1?3:-1),o(),u(t._displayedPageSizeOptions.length<=1?4:-1)}}function it(i,g){if(i&1){let t=P();n(0,"button",19),d("click",function(){_(t);let e=p();return b(e._buttonClicked(0,e._previousButtonsDisabled()))}),f(),n(1,"svg",8),v(2,"path",20),r()()}if(i&2){let t=p();l("matTooltip",t._intl.firstPageLabel)("matTooltipDisabled",t._previousButtonsDisabled())("disabled",t._previousButtonsDisabled())("tabindex",t._previousButtonsDisabled()?-1:null),m("aria-label",t._intl.firstPageLabel)}}function at(i,g){if(i&1){let t=P();n(0,"button",21),d("click",function(){_(t);let e=p();return b(e._buttonClicked(e.getNumberOfPages()-1,e._nextButtonsDisabled()))}),f(),n(1,"svg",8),v(2,"path",22),r()()}if(i&2){let t=p();l("matTooltip",t._intl.lastPageLabel)("matTooltipDisabled",t._nextButtonsDisabled())("disabled",t._nextButtonsDisabled())("tabindex",t._nextButtonsDisabled()?-1:null),m("aria-label",t._intl.lastPageLabel)}}var nt=(()=>{class i{changes=new T;itemsPerPageLabel="Items per page:";nextPageLabel="Next page";previousPageLabel="Previous page";firstPageLabel="First page";lastPageLabel="Last page";getRangeLabel=(t,a,e)=>{if(e==0||a==0)return`0 of ${e}`;e=Math.max(e,0);let s=t*a,S=s<e?Math.min(s+a,e):s+a;return`${s+1} \u2013 ${S} of ${e}`};static \u0275fac=function(a){return new(a||i)};static \u0275prov=M({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),ot=50;var rt=new w("MAT_PAGINATOR_DEFAULT_OPTIONS"),st=(()=>{class i{_intl=h(nt);_changeDetectorRef=h(G);_formFieldAppearance;_pageSizeLabelId=h($).getId("mat-paginator-page-size-label-");_intlChanges;_isInitialized=!1;_initializedStream=new D(1);color;get pageIndex(){return this._pageIndex}set pageIndex(t){this._pageIndex=Math.max(t||0,0),this._changeDetectorRef.markForCheck()}_pageIndex=0;get length(){return this._length}set length(t){this._length=t||0,this._changeDetectorRef.markForCheck()}_length=0;get pageSize(){return this._pageSize}set pageSize(t){this._pageSize=Math.max(t||0,0),this._updateDisplayedPageSizeOptions()}_pageSize;get pageSizeOptions(){return this._pageSizeOptions}set pageSizeOptions(t){this._pageSizeOptions=(t||[]).map(a=>z(a,0)),this._updateDisplayedPageSizeOptions()}_pageSizeOptions=[];hidePageSize=!1;showFirstLastButtons=!1;selectConfig={};disabled=!1;page=new L;_displayedPageSizeOptions;initialized=this._initializedStream;constructor(){let t=this._intl,a=h(rt,{optional:!0});if(this._intlChanges=t.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),a){let{pageSize:e,pageSizeOptions:s,hidePageSize:S,showFirstLastButtons:C}=a;e!=null&&(this._pageSize=e),s!=null&&(this._pageSizeOptions=s),S!=null&&(this.hidePageSize=S),C!=null&&(this.showFirstLastButtons=C)}this._formFieldAppearance=a?.formFieldAppearance||"outline"}ngOnInit(){this._isInitialized=!0,this._updateDisplayedPageSizeOptions(),this._initializedStream.next()}ngOnDestroy(){this._initializedStream.complete(),this._intlChanges.unsubscribe()}nextPage(){this.hasNextPage()&&this._navigate(this.pageIndex+1)}previousPage(){this.hasPreviousPage()&&this._navigate(this.pageIndex-1)}firstPage(){this.hasPreviousPage()&&this._navigate(0)}lastPage(){this.hasNextPage()&&this._navigate(this.getNumberOfPages()-1)}hasPreviousPage(){return this.pageIndex>=1&&this.pageSize!=0}hasNextPage(){let t=this.getNumberOfPages()-1;return this.pageIndex<t&&this.pageSize!=0}getNumberOfPages(){return this.pageSize?Math.ceil(this.length/this.pageSize):0}_changePageSize(t){let a=this.pageIndex*this.pageSize,e=this.pageIndex;this.pageIndex=Math.floor(a/t)||0,this.pageSize=t,this._emitPageEvent(e)}_nextButtonsDisabled(){return this.disabled||!this.hasNextPage()}_previousButtonsDisabled(){return this.disabled||!this.hasPreviousPage()}_updateDisplayedPageSizeOptions(){this._isInitialized&&(this.pageSize||(this._pageSize=this.pageSizeOptions.length!=0?this.pageSizeOptions[0]:ot),this._displayedPageSizeOptions=this.pageSizeOptions.slice(),this._displayedPageSizeOptions.indexOf(this.pageSize)===-1&&this._displayedPageSizeOptions.push(this.pageSize),this._displayedPageSizeOptions.sort((t,a)=>t-a),this._changeDetectorRef.markForCheck())}_emitPageEvent(t){this.page.emit({previousPageIndex:t,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})}_navigate(t){let a=this.pageIndex;t!==a&&(this.pageIndex=t,this._emitPageEvent(a))}_buttonClicked(t,a){a||this._navigate(t)}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=B({type:i,selectors:[["mat-paginator"]],hostAttrs:["role","group",1,"mat-mdc-paginator"],inputs:{color:"color",pageIndex:[2,"pageIndex","pageIndex",z],length:[2,"length","length",z],pageSize:[2,"pageSize","pageSize",z],pageSizeOptions:"pageSizeOptions",hidePageSize:[2,"hidePageSize","hidePageSize",I],showFirstLastButtons:[2,"showFirstLastButtons","showFirstLastButtons",I],selectConfig:"selectConfig",disabled:[2,"disabled","disabled",I]},outputs:{page:"page"},exportAs:["matPaginator"],decls:14,vars:14,consts:[["selectRef",""],[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],[1,"mat-mdc-paginator-page-size"],[1,"mat-mdc-paginator-range-actions"],["aria-atomic","true","aria-live","polite","role","status",1,"mat-mdc-paginator-range-label"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-previous",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true",1,"mat-mdc-paginator-icon"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-next",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["aria-hidden","true",1,"mat-mdc-paginator-page-size-label"],[1,"mat-mdc-paginator-page-size-select",3,"appearance","color"],[1,"mat-mdc-paginator-page-size-value"],["hideSingleSelectionIndicator","",3,"selectionChange","value","disabled","aria-labelledby","panelClass","disableOptionCentering"],[3,"value"],[1,"mat-mdc-paginator-touch-target",3,"click"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"],["matIconButton","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"]],template:function(a,e){a&1&&(n(0,"div",1)(1,"div",2),c(2,et,5,4,"div",3),n(3,"div",4)(4,"div",5),x(5),r(),c(6,it,3,5,"button",6),n(7,"button",7),d("click",function(){return e._buttonClicked(e.pageIndex-1,e._previousButtonsDisabled())}),f(),n(8,"svg",8),v(9,"path",9),r()(),k(),n(10,"button",10),d("click",function(){return e._buttonClicked(e.pageIndex+1,e._nextButtonsDisabled())}),f(),n(11,"svg",8),v(12,"path",11),r()(),c(13,at,3,5,"button",12),r()()()),a&2&&(o(2),u(e.hidePageSize?-1:2),o(3),y(" ",e._intl.getRangeLabel(e.pageIndex,e.pageSize,e.length)," "),o(),u(e.showFirstLastButtons?6:-1),o(),l("matTooltip",e._intl.previousPageLabel)("matTooltipDisabled",e._previousButtonsDisabled())("disabled",e._previousButtonsDisabled())("tabindex",e._previousButtonsDisabled()?-1:null),m("aria-label",e._intl.previousPageLabel),o(3),l("matTooltip",e._intl.nextPageLabel)("matTooltipDisabled",e._nextButtonsDisabled())("disabled",e._nextButtonsDisabled())("tabindex",e._nextButtonsDisabled()?-1:null),m("aria-label",e._intl.nextPageLabel),o(3),u(e.showFirstLastButtons?13:-1))},dependencies:[U,J,q,Q,H],styles:[`.mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height: var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding: var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:var(--mat-paginator-page-size-select-width, 84px)}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:var(--mat-paginator-page-size-select-width, 84px);height:var(--mat-paginator-page-size-select-touch-target-height, 48px);background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer}
2
2
  `],encapsulation:2,changeDetection:0})}return i})(),Ct=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=F({type:i});static \u0275inj=O({imports:[W,K,Z,st]})}return i})();export{st as a,Ct as b};
@@ -1,3 +1,3 @@
1
- import{a as z,b as q,c as J,d as K,e as Q,f as X}from"./chunk-UASBQJZD.js";import{b as G}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-GAI4CMX3.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as F}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 H,h as $,m as W,z as j}from"./chunk-7HUEGPJN.js";import{e as A}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as E,Aa as g,Dc as w,Eb as x,Ec as P,Ic as l,Jc as R,Vc as V,Xb as y,Zb as v,ac as N,bc as T,ca as I,cb as B,cc as m,dc as o,ec as r,fc as h,gb as p,gc as C,ha as b,hc as S,ic as M,mc as _,nc as L,oa as d,pa as u,rc as f,rd as O,sd as U,tc as c,yb as D}from"./chunk-5VYDZBNH.js";import{a as k}from"./chunk-QWWW7GFA.js";var Z=(()=>{class e{constructor(){this.httpService=b(A)}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ne(e,s){if(e&1&&(C(0,"th"),l(1),S()),e&2){let t=s.$implicit;p(),R(t.column)}}function ie(e,s){if(e&1&&(C(0,"td"),M(1,"span",4),S()),e&2){let t=s.$implicit,n=c().$implicit;p(),L("innerHTML",n[t.prop],B)}}function oe(e,s){if(e&1&&(C(0,"tr"),N(1,ie,2,1,"td",null,E),S()),e&2){let t=s.$implicit,n=c();P("background-color",t.Status>200?"#F4D6D5":"#DEE9C9"),p(),T(n.configs())}}var ee=(()=>{class e{constructor(){this.configs=U([]),this.data=U([]),this.status=U(void 0),this.eventClose=O({alias:"onClose"})}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=D({type:e,selectors:[["app-response-api-list"]],inputs:{configs:[1,"configs"],data:[1,"data"],status:[1,"status"]},outputs:{eventClose:"onClose"},decls:9,vars:0,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[3,"background-color"],[3,"innerHTML"]],template:function(n,i){n&1&&(C(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),N(4,ne,2,1,"th",null,E),S()(),C(6,"tbody"),N(7,oe,3,2,"tr",3,E),S()()()),n&2&&(p(4),T(i.configs()),p(3),T(i.data()))},encapsulation:2,changeDetection:0})}}return e})();function re(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onNewStepperState(a))}),h(1,"i",18),l(2," New "),r()}}function ae(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t),c();let i=w(11);return u(i.previous())}),l(1," Back "),r()}}function le(e,s){if(e&1){let t=_();o(0,"button",19),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onStepperNext(a))}),l(1," Next "),r()}}function se(e,s){if(e&1){let t=_();o(0,"button",20),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onSubmit(a))}),l(1," Download "),r()}if(e&2){let t=c();m("disabled",!t.urls)}}function pe(e,s){e&1&&(h(0,"i",21),o(1,"span"),l(2,"Instruction"),r())}function ce(e,s){e&1&&(o(0,"div",22)(1,"div",23)(2,"div",24)(3,"h4",25),l(4,"Note"),r()(),o(5,"div",26)(6,"ol",27)(7,"li"),l(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),l(10," Copy Product URL from "),o(11,"a",28),l(12,"https://seller.tokopedia.com/ "),r(),l(13," and paste in this form "),r(),o(14,"li"),l(15," Use New Line when you want to input several product URLs "),r()()()()())}function me(e,s){e&1&&(h(0,"i",29),o(1,"span"),l(2,"Download"),r())}function de(e,s){if(e&1){let t=_();o(0,"div",22)(1,"textarea",30),f("ngModelChange",function(i){d(t);let a=c();return u(a.urls.set(i))}),r()()}if(e&2){let t=c();p(),m("placeholder",t.urlPlaceholder())("ngModel",t.urls())}}function ue(e,s){e&1&&(h(0,"i",31),o(1,"span"),l(2,"Finish"),r())}function _e(e,s){if(e&1&&(o(0,"div",22),h(1,"app-response-api-list",32),r()),e&2){let t=c();p(),m("data",t.downloadResponses())("configs",t.configs)}}function fe(e,s){e&1&&(o(0,"h6"),l(1,"1"),r())}function ge(e,s){e&1&&(o(0,"h6"),l(1,"2"),r())}function he(e,s){e&1&&(o(0,"h6"),l(1,"3"),r())}var Fe=(()=>{class e{constructor(){this.downloadService=b(Z),this.authService=b(F),this.urls=g(null),this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=g([]),this.stepperState=g("DOWNLOAD"),this.urlPlaceholder=g(`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as z,b as q,c as J,d as K,e as Q,f as X}from"./chunk-UASBQJZD.js";import{b as G}from"./chunk-XV36IYPC.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-GAI4CMX3.js";import"./chunk-NCZ46DU6.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as F}from"./chunk-EPME7TI3.js";import"./chunk-FC5HQXAY.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as H,h as $,m as W,z as j}from"./chunk-7HUEGPJN.js";import{e as A}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as E,Aa as g,Dc as w,Eb as x,Ec as P,Ic as l,Jc as R,Vc as V,Xb as y,Zb as v,ac as N,bc as T,ca as I,cb as B,cc as m,dc as o,ec as r,fc as h,gb as p,gc as C,ha as b,hc as S,ic as M,mc as _,nc as L,oa as d,pa as u,rc as f,rd as O,sd as U,tc as c,yb as D}from"./chunk-5VYDZBNH.js";import{a as k}from"./chunk-QWWW7GFA.js";var Z=(()=>{class e{constructor(){this.httpService=b(A)}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ne(e,s){if(e&1&&(C(0,"th"),l(1),S()),e&2){let t=s.$implicit;p(),R(t.column)}}function ie(e,s){if(e&1&&(C(0,"td"),M(1,"span",4),S()),e&2){let t=s.$implicit,n=c().$implicit;p(),L("innerHTML",n[t.prop],B)}}function oe(e,s){if(e&1&&(C(0,"tr"),N(1,ie,2,1,"td",null,E),S()),e&2){let t=s.$implicit,n=c();P("background-color",t.Status>200?"#F4D6D5":"#DEE9C9"),p(),T(n.configs())}}var ee=(()=>{class e{constructor(){this.configs=U([]),this.data=U([]),this.status=U(void 0),this.eventClose=O({alias:"onClose"})}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=D({type:e,selectors:[["app-response-api-list"]],inputs:{configs:[1,"configs"],data:[1,"data"],status:[1,"status"]},outputs:{eventClose:"onClose"},decls:9,vars:0,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[3,"background-color"],[3,"innerHTML"]],template:function(n,i){n&1&&(C(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),N(4,ne,2,1,"th",null,E),S()(),C(6,"tbody"),N(7,oe,3,2,"tr",3,E),S()()()),n&2&&(p(4),T(i.configs()),p(3),T(i.data()))},encapsulation:2,changeDetection:0})}}return e})();function re(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onNewStepperState(a))}),h(1,"i",18),l(2," New "),r()}}function ae(e,s){if(e&1){let t=_();o(0,"button",17),f("click",function(){d(t),c();let i=w(11);return u(i.previous())}),l(1," Back "),r()}}function le(e,s){if(e&1){let t=_();o(0,"button",19),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onStepperNext(a))}),l(1," Next "),r()}}function se(e,s){if(e&1){let t=_();o(0,"button",20),f("click",function(){d(t);let i=c(),a=w(11);return u(i.onSubmit(a))}),l(1," Download "),r()}if(e&2){let t=c();m("disabled",!t.urls)}}function pe(e,s){e&1&&(h(0,"i",21),o(1,"span"),l(2,"Instruction"),r())}function ce(e,s){e&1&&(o(0,"div",22)(1,"div",23)(2,"div",24)(3,"h4",25),l(4,"Note"),r()(),o(5,"div",26)(6,"ol",27)(7,"li"),l(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),l(10," Copy Product URL from "),o(11,"a",28),l(12,"https://seller.tokopedia.com/ "),r(),l(13," and paste in this form "),r(),o(14,"li"),l(15," Use New Line when you want to input several product URLs "),r()()()()())}function me(e,s){e&1&&(h(0,"i",29),o(1,"span"),l(2,"Download"),r())}function de(e,s){if(e&1){let t=_();o(0,"div",22)(1,"textarea",30),f("ngModelChange",function(i){d(t);let a=c();return u(a.urls.set(i))}),r()()}if(e&2){let t=c();p(),m("placeholder",t.urlPlaceholder())("ngModel",t.urls())}}function ue(e,s){e&1&&(h(0,"i",31),o(1,"span"),l(2,"Finish"),r())}function _e(e,s){if(e&1&&(o(0,"div",22),h(1,"app-response-api-list",32),r()),e&2){let t=c();p(),m("data",t.downloadResponses())("configs",t.configs)}}function fe(e,s){e&1&&(o(0,"h6"),l(1,"1"),r())}function ge(e,s){e&1&&(o(0,"h6"),l(1,"2"),r())}function he(e,s){e&1&&(o(0,"h6"),l(1,"3"),r())}var Fe=(()=>{class e{constructor(){this.downloadService=b(Z),this.authService=b(F),this.urls=g(null),this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=g([]),this.stepperState=g("DOWNLOAD"),this.urlPlaceholder=g(`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`),this.currentDomain=g(this.authService.getDomain())}onStepperChange(t){this.stepperState.set(t.selectedStep.state)}onSubmit(t){let i=(this.urls()??"").split(/\r?\n/).filter(a=>a.trim());this.downloadService.download(i).subscribe(a=>{this.downloadResponses.set(a),this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){let t=this.currentDomain(),n=this.downloadResponses().map(i=>{let a=k({},i);return a.Name=a?.Name?`<a href="${t}/menu/Products/Catalog/Products/Info?ID=${a.ID}" target="_blank">${a?.Name}</a>`:"-",a});this.downloadResponses.set(n)}onNewStepperState(t){this.downloadResponses.set([]),this.urls.set(null),this.stepperState.set("DOWNLOAD"),t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=D({type:e,selectors:[["app-by-url"]],features:[V([{provide:z,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(n,i){if(n&1){let a=_();o(0,"mainpanel",1)(1,"actions"),y(2,re,3,0,"button",2),y(3,ae,2,0,"button",2),y(4,le,2,0,"button",3),y(5,se,2,1,"button",4),r(),o(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,0),f("selectionChange",function(te){return d(a),u(i.onStepperChange(te))}),o(12,"mat-step",9),x(13,pe,3,0,"ng-template",10)(14,ce,16,0,"ng-template",11),r(),o(15,"mat-step",12),x(16,me,3,0,"ng-template",10)(17,de,2,2,"ng-template",11),r(),o(18,"mat-step",13),x(19,ue,3,0,"ng-template",10)(20,_e,2,2,"ng-template",11),r(),x(21,fe,2,0,"ng-template",14)(22,ge,2,0,"ng-template",15)(23,he,2,0,"ng-template",16),r()()()()()()}n&2&&(m("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),v(i.stepperState()=="FINISH"?2:-1),p(),v(i.stepperState()=="DOWNLOAD"?3:-1),p(),v(i.stepperState()=="GUIDE"?4:-1),p(),v(i.stepperState()=="DOWNLOAD"?5:-1),p(5),m("selectedIndex",1),p(2),m("editable",i.stepperState()!="FINISH")("completed",!0),p(3),m("editable",i.stepperState()!="FINISH")("completed",!1))},dependencies:[G,X,Q,q,K,j,H,$,W,ee,J],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
3
3
  `],encapsulation:2,changeDetection:0})}}return e})();export{Fe as ByUrlComponent};