marketplacepos 2.7.5 → 2.7.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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e,h={},v={};function r(e){var n=v[e];if(void 0!==n)return n.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=h,e=[],r.O=(n,t,f,c)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,f,c]=e[o],p=!0,i=0;i<t.length;i++)(!1&c||a>=c)&&Object.keys(r.O).every(u=>r.O[u](t[i]))?t.splice(i--,1):(p=!1,c<a&&(a=c));if(p){e.splice(o--,1);var s=f();void 0!==s&&(n=s)}}return n}c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[t,f,c]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var c=Object.create(null);r.r(c);var o={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(p=>o[p]=()=>t[p]);return o.default=()=>t,r.d(c,o),c}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{25:"b70d86f301c02577",61:"868e35095821a091",72:"b0c5b137e38d6dbc",277:"e644e3531765ce65",360:"35d9782330672e00",369:"19d90a301af16090",392:"f4537160149f627a",397:"bd20bd794e4994a8",501:"7645c32a140dd7f8",512:"2796526d3f4c83f5",516:"23780ce40d15b408",545:"4809f373cc63f3b4",587:"69b186b4d297a852",592:"1ae3037cc1f5de4e",616:"b7e1ec6933570169",643:"7de8ebbdb10aeed8",716:"986295839ef23655",717:"26634e93ca9b60ed",739:"a22c3c892afd39b9",833:"552ef7db8cfcde45",859:"b43bda3adda95fa3",863:"67b36200543c45b1",874:"8531eff61a70fef4",877:"460b82caffdbeb26",913:"08c7bf72f6b8e4f8",970:"7c36426f4bcc50cb",993:"f25cf4b5757f3e91",997:"6b3f954f35ff3ac0"}[e]+".js",r.miniCssF=e=>{},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,c,o)=>{if(e[t])e[t].push(f);else{var a,p;if(void 0!==c)for(var i=document.getElementsByTagName("script"),s=0;s<i.length;s++){var d=i[s];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==n+c){a=d;break}}a||(p=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+c),a.src=r.tu(t)),e[t]=[f];var b=(g,u)=>{a.onerror=a.onload=null,clearTimeout(l);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(y=>y(u)),g)return g(u)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=b.bind(null,a.onerror),a.onload=b.bind(null,a.onload),p&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.7.5/Marketplace/",(()=>{var e={666:0};r.f.j=(f,c)=>{var o=r.o(e,f)?e[f]:void 0;if(0!==o)if(o)c.push(o[2]);else if(666!=f){var a=new Promise((d,b)=>o=e[f]=[d,b]);c.push(o[2]=a);var p=r.p+r.u(f),i=new Error;r.l(p,d=>{if(r.o(e,f)&&(0!==(o=e[f])&&(e[f]=void 0),o)){var b=d&&("load"===d.type?"missing":d.type),l=d&&d.target&&d.target.src;i.message="Loading chunk "+f+" failed.\n("+b+": "+l+")",i.name="ChunkLoadError",i.type=b,i.request=l,o[1](i)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,c)=>{var i,s,[o,a,p]=c,d=0;if(o.some(l=>0!==e[l])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(p)var b=p(r)}for(f&&f(c);d<o.length;d++)r.o(e,s=o[d])&&e[s]&&e[s][0](),e[s]=0;return r.O(b)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
1
+ (()=>{"use strict";var e,h={},v={};function r(e){var n=v[e];if(void 0!==n)return n.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=h,e=[],r.O=(n,t,f,c)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,f,c]=e[o],b=!0,i=0;i<t.length;i++)(!1&c||a>=c)&&Object.keys(r.O).every(u=>r.O[u](t[i]))?t.splice(i--,1):(b=!1,c<a&&(a=c));if(b){e.splice(o--,1);var s=f();void 0!==s&&(n=s)}}return n}c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[t,f,c]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var c=Object.create(null);r.r(c);var o={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(b=>o[b]=()=>t[b]);return o.default=()=>t,r.d(c,o),c}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{25:"b70d86f301c02577",61:"868e35095821a091",72:"b0c5b137e38d6dbc",277:"e644e3531765ce65",360:"35d9782330672e00",369:"f3cfdd6bf33e06f5",392:"f4537160149f627a",397:"bd20bd794e4994a8",501:"7645c32a140dd7f8",512:"2796526d3f4c83f5",516:"23780ce40d15b408",545:"4809f373cc63f3b4",587:"69b186b4d297a852",592:"1ae3037cc1f5de4e",616:"b7e1ec6933570169",643:"ee45650084330291",716:"986295839ef23655",717:"26634e93ca9b60ed",739:"a22c3c892afd39b9",833:"552ef7db8cfcde45",859:"b43bda3adda95fa3",863:"67b36200543c45b1",874:"8531eff61a70fef4",877:"460b82caffdbeb26",913:"08c7bf72f6b8e4f8",970:"7c36426f4bcc50cb",993:"f25cf4b5757f3e91",997:"6b3f954f35ff3ac0"}[e]+".js",r.miniCssF=e=>{},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,c,o)=>{if(e[t])e[t].push(f);else{var a,b;if(void 0!==c)for(var i=document.getElementsByTagName("script"),s=0;s<i.length;s++){var d=i[s];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==n+c){a=d;break}}a||(b=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+c),a.src=r.tu(t)),e[t]=[f];var p=(g,u)=>{a.onerror=a.onload=null,clearTimeout(l);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(y=>y(u)),g)return g(u)},l=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),b&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.7.6/Marketplace/",(()=>{var e={666:0};r.f.j=(f,c)=>{var o=r.o(e,f)?e[f]:void 0;if(0!==o)if(o)c.push(o[2]);else if(666!=f){var a=new Promise((d,p)=>o=e[f]=[d,p]);c.push(o[2]=a);var b=r.p+r.u(f),i=new Error;r.l(b,d=>{if(r.o(e,f)&&(0!==(o=e[f])&&(e[f]=void 0),o)){var p=d&&("load"===d.type?"missing":d.type),l=d&&d.target&&d.target.src;i.message="Loading chunk "+f+" failed.\n("+p+": "+l+")",i.name="ChunkLoadError",i.type=p,i.request=l,o[1](i)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,c)=>{var i,s,[o,a,b]=c,d=0;if(o.some(l=>0!==e[l])){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(b)var p=b(r)}for(f&&f(c);d<o.length;d++)r.o(e,s=o[d])&&e[s]&&e[s][0](),e[s]=0;return r.O(p)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"marketplacepos","version":"2.7.5"}
1
+ {"name":"marketplacepos","version":"2.7.6"}
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[643],{8549:(H,R,c)=>{c.r(R),c.d(R,{OrdersModule:()=>N});var u=c(6895),f=c(284),e=c(4650),Y=c(7398);class v{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new"},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship"},{Title:"3 - Shipped",Url:"/menu/Order/Shipped"},{Title:"4 - Completed",Url:"/menu/Order/Delivered"},{Title:"All",Url:"/menu/Order/All"},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled"},{Title:"Download",Url:"/menu/Order/Download"}]}ngOnInit(){}}v.\u0275fac=function(n){return new(n||v)},v.\u0275cmp=e.Xpm({type:v,selectors:[["app-orders"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.ObjectOrderTabs))},dependencies:[Y.e,f.lC]});var _=c(3154),b=c(1318),l=c(7185),s=c(9568),r=c(4006),p=c(7481),d=c(8796),g=c(2594);function A(i,n){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.Number)}}function $(i,n){if(1&i&&(e.TgZ(0,"a",16),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw();e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function B(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,A,2,1,"span",14),e.YNc(5,$,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"date"),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(10,5,t.Created,"dd MMM yyyy HH:mm"))}}class w{constructor(n,t,a){this.http=n,this.toastr=t,this.localDataService=a,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.outlets=n.Options.Outlet,this.Tags=n.Options.Tags,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Order/Sales_Order/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetNewOrder",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets,Tag:null!=this.selectedTags?this.selectedTags:this.Tags}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}UpdateDelivery(){let n=this.getSelected();if(n.length>0){let t=[];n.forEach(a=>t.push(a)),this.http.post("/api/Orders/UpdateStateDelivery",t).subscribe(a=>{this.toastr.success("Successfully updated","Success")})}}getRowCount(){this.http.post("api/orders/GetRowCount",{Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(t=>{this.paginationTotal=t.Total})}onCheckboxStateProduct(n){let t=this.data.filter(a=>a.Number==n);if(t.length>0)for(let a of t)a.selected=a.selected}onCheckboxStateChange(){for(let n of this.data)n.selected=this.checkboxState}getSelected(){let n=[];if(this.data){for(let t of this.data)t.selected&&n.push(t);return n}return[]}hasGuidEmpty(n){return n==_.g.GuidEMpty}hasSelection(){return!!this.data&&this.getSelected().length>0}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function V(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&i){const t=n.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}function j(i,n){if(1&i&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,V,9,7,"tr",16),e.qZA()()()()()),2&i){const t=e.oxw();e.xp6(10),e.hij(" ",t.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,t.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",t.model.Delivery," "),e.xp6(5),e.hij(" ",t.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,t.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",t.model.Customer.Name," "),e.xp6(5),e.hij(" ",t.model.Customer.Email," "),e.xp6(5),e.hij(" ",t.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",t.model.Variants)}}w.\u0275fac=function(n){return new(n||w)(e.Y36(b.O),e.Y36(l._W),e.Y36(s.T))},w.\u0275cmp=e.Xpm({type:w,selectors:[["app-new-order"]],decls:34,vars:10,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"href"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.selectedOutlets=o}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Created On"),e.qZA()()(),e.TgZ(31,"tbody"),e.YNc(32,B,11,8,"tr",12),e.qZA()(),e.TgZ(33,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return t.getRowCount()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",t.selectedOutlets)("items",t.outlets),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(18),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,r.Fj,r.wV,r.JJ,r.On,p.p,d.w9,g.n,u.uU]});const W=function(){return["/menu/Order"]};class x{constructor(n,t){this.http=n,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(t=>{this.model=t})}}x.\u0275fac=function(n){return new(n||x)(e.Y36(b.O),e.Y36(f.gz))},x.\u0275cmp=e.Xpm({type:x,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2),e.YNc(6,j,67,15,"div",3),e.qZA()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,W)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[u.sg,u.O5,p.p,f.rH,u.JJ,u.uU]});var m=c(9694),S=c(5412),E=c(6709);class q{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}q.\u0275fac=function(n){return new(n||q)(e.Y36(S.so))},q.\u0275cmp=e.Xpm({type:q,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],["mat-dialog-title","",1,"text-center","mb-8","fw-bold"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center","mt-6"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"h2",1),e._uU(2,"Cetak label pesanan"),e.qZA(),e.TgZ(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),e._uU(7,"Kamu akan mencetak label yang berisi detail pesanan"),e.qZA(),e.TgZ(8,"div",5)(9,"mat-checkbox",6),e.NdJ("ngModelChange",function(o){return t.tandaiSudahDicetak=o}),e.qZA(),e.TgZ(10,"span",7),e._uU(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),e.qZA()()()()(),e.TgZ(12,"mat-dialog-actions",8)(13,"button",9),e.NdJ("click",function(){return t.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return t.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&n&&(e.xp6(9),e.Q6J("ngModel",t.tandaiSudahDicetak))},dependencies:[r.JJ,r.On,E.oG,S.uh,S.xY,S.H8]});var K=c(9300),X=c(3900);class Z{constructor(n,t,a){this.http=n,this.dialog=t,this.toastr=a}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(q).afterClosed().pipe((0,K.h)(a=>void 0!==a),(0,X.w)(a=>(t.Printed=a,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(a=>{const o=window.open("about:blank","_blank");o.document.write(a),o.document.close()})}printShippingLabelTiktok(n,t){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.data?window.open(o.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(n,t){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{var h=Uint8Array.from(atob(o),rt=>rt.charCodeAt(0)),F=new Blob([h],{type:"octet/stream"});_.g.openDownloadFile(F,`${n}.pdf`)})}printShippingLabelLazada(n,t){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.result.data?window.open(o.result.data.pdf_url,"_blank"):this.toastr.error(o.message,"Cannot Print")})}}Z.\u0275fac=function(n){return new(n||Z)(e.LFG(b.O),e.LFG(S.uw),e.LFG(l._W))},Z.\u0275prov=e.Yz7({token:Z,factory:Z.\u0275fac});class P{constructor(){}set typeId(n){this.channelLogo=_.g.getChannelLogoByTypeId(n),this.initChannelName(n)}initChannelName(n){switch(n){case m.x.Tokopedia:this.channelName="Tokopedia";break;case m.x.Tiktok:this.channelName="Tiktok";break;case m.x.WooCommerce:this.channelName="WooCommerce";break;case m.x.ShopeeV2:this.channelName="Shopee";break;case m.x.Lazada:this.channelName="Lazada";break;case m.x.KalCare:this.channelName="Kalcare"}}}P.\u0275fac=function(n){return new(n||P)},P.\u0275cmp=e.Xpm({type:P,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-2","fw-bold"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&n&&(e.xp6(1),e.Q6J("src",t.channelLogo,e.LSH),e.xp6(2),e.Oqu(t.channelName))}});const ee=function(){return["/menu/Order/detail"]},te=function(i,n){return{Number:i,Outlet:n}};function ne(i,n){if(1&i&&(e.TgZ(0,"a",23),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ee))("queryParams",e.WLB(4,te,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function ae(i,n){if(1&i&&(e.TgZ(0,"a",24),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw();e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ie(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"a",25),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,h=e.oxw();return e.KtG(h.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",26),e.qZA()}}function oe(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"tr")(1,"td")(2,"input",17),e.NdJ("ngModelChange",function(o){const F=e.CHM(t).$implicit;return e.KtG(F.selected=o)})("ngModelChange",function(){const h=e.CHM(t).$implicit,F=e.oxw();return e.KtG(F.onCheckboxStateProduct(h.Number))}),e.qZA()(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,ne,2,7,"a",18),e.YNc(7,ae,2,2,"a",19),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td"),e._uU(14),e.ALo(15,"date"),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",20),e.qZA(),e.TgZ(18,"td",21),e.YNc(19,ie,2,0,"a",22),e.qZA()()}if(2&i){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Q6J("ngModel",t.selected),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(12,9,t.Amount)),e.xp6(3),e.Oqu(e.xi3(15,11,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==a.channelType.ShopeeV2||t.TypeID==a.channelType.Tokopedia||t.TypeID==a.channelType.Tiktok||t.TypeID==a.channelType.Lazada)}}class M{constructor(n,t,a,o,h){this.http=n,this.toastr=t,this.localDataService=a,this.dialog=o,this.orderService=h,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=m.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.outlets=n.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetReadyToShip",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}onPrintShippingLabel(n,t,a){switch(a){case m.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case m.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case m.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case m.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}updateDelivery(){let n=this.getSelected();if(n.length>0){let t=[];n.forEach(a=>t.push(a)),this.http.post("/api/Orders/UpdateStateDelivery",t).subscribe(a=>{this.toastr.success("Successfully updated","Success")})}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(t=>{this.paginationTotal=t.Total})}onCheckboxStateProduct(n){let t=this.data.filter(a=>a.Number==n);if(t.length>0)for(let a of t)a.selected=a.selected}onCheckboxStateChange(){for(let n of this.data)n.selected=this.checkboxState}getSelected(){let n=[];if(this.data){for(let t of this.data)t.selected&&n.push(t);return n}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}M.\u0275fac=function(n){return new(n||M)(e.Y36(b.O),e.Y36(l._W),e.Y36(s.T),e.Y36(S.uw),e.Y36(Z))},M.\u0275cmp=e.Xpm({type:M,selectors:[["app-ready-to-ship"]],decls:44,vars:11,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"hidden","click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.selectedOutlets=o}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(15,"actions")(16,"button",5),e.NdJ("click",function(){return t.updateDelivery()}),e._uU(17," Dispatch "),e.qZA()(),e.TgZ(18,"content")(19,"div",6)(20,"div",7)(21,"div",8)(22,"div",9)(23,"table",10)(24,"thead",11)(25,"tr",12)(26,"th",13)(27,"input",14),e.NdJ("ngModelChange",function(o){return t.checkboxState=o})("ngModelChange",function(){return t.onCheckboxStateChange()}),e.qZA()(),e.TgZ(28,"th"),e._uU(29,"Outlet"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Order number"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Customer"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Amount"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Created On"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Channel Name"),e.qZA(),e._UZ(40,"th"),e.qZA()(),e.TgZ(41,"tbody"),e.YNc(42,oe,20,14,"tr",15),e.qZA()(),e.TgZ(43,"app-mat-paginator-no-count",16),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(6),e.Q6J("multiple",!0)("ngModel",t.selectedOutlets)("items",t.outlets),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(2),e.Q6J("hidden",!t.hasSelection()),e.xp6(11),e.Q6J("ngModel",t.checkboxState),e.xp6(15),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,r.Fj,r.wV,r.Wl,r.JJ,r.On,p.p,f.rH,d.w9,g.n,P,u.JJ,u.uU]});const re=function(){return["/menu/Order/detail"]},le=function(i,n){return{Number:i,Outlet:n}};function se(i,n){if(1&i&&(e.TgZ(0,"a",19),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,re))("queryParams",e.WLB(4,le,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function pe(i,n){if(1&i&&(e.TgZ(0,"a",20),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw();e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function de(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"a",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,h=e.oxw();return e.KtG(h.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",22),e.qZA()}}function ue(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,se,2,7,"a",14),e.YNc(5,pe,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",16),e.qZA(),e.TgZ(16,"td",17),e.YNc(17,de,2,0,"a",18),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==a.channelType.ShopeeV2||t.TypeID==a.channelType.Tokopedia||t.TypeID==a.channelType.Tiktok||t.TypeID==a.channelType.Lazada)}}class I{constructor(n,t,a){this.http=n,this.localDataService=t,this.orderService=a,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.channelType=m.x}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.outlets=n.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(n){return n==_.g.GuidEMpty}Get(n){this.http.post("api/orders/GetShipped",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,a){switch(a){case m.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case m.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case m.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case m.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}I.\u0275fac=function(n){return new(n||I)(e.Y36(b.O),e.Y36(s.T),e.Y36(Z))},I.\u0275cmp=e.Xpm({type:I,selectors:[["app-shipped"]],decls:39,vars:9,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.selectedOutlets=o}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Channel Name"),e.qZA(),e._UZ(35,"th"),e.qZA()(),e.TgZ(36,"tbody"),e.YNc(37,ue,18,13,"tr",12),e.qZA()(),e.TgZ(38,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(6),e.Q6J("multiple",!0)("ngModel",t.selectedOutlets)("items",t.outlets),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,r.Fj,r.wV,r.JJ,r.On,p.p,f.rH,d.w9,g.n,P,u.JJ,u.uU]});var ce=c(501);const he=function(){return["/menu/Order/detail"]},ge=function(i,n){return{Number:i,Outlet:n}};function me(i,n){if(1&i&&(e.TgZ(0,"a",19),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,he))("queryParams",e.WLB(4,ge,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function _e(i,n){if(1&i&&(e.TgZ(0,"a",20),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw();e.Q6J("href",a.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function fe(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"a",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,h=e.oxw();return e.KtG(h.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",22),e.qZA()}}function Te(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,me,2,7,"a",14),e.YNc(5,_e,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",16),e.qZA(),e.TgZ(16,"td",17),e.YNc(17,fe,2,0,"a",18),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==a.channelType.ShopeeV2||t.TypeID==a.channelType.Tokopedia||t.TypeID==a.channelType.Tiktok)}}class U{constructor(n,t,a){this.http=n,this.orderService=t,this.authService=a,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.channelType=m.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.outlets=n.Options.Outlet,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetDelivered ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,a){switch(a){case m.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case m.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case m.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}U.\u0275fac=function(n){return new(n||U)(e.Y36(b.O),e.Y36(Z),e.Y36(ce.e))},U.\u0275cmp=e.Xpm({type:U,selectors:[["app-delivered"]],decls:39,vars:10,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.selectedOutlets=o}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Channel Name"),e.qZA(),e._UZ(35,"th"),e.qZA()(),e.TgZ(36,"tbody"),e.YNc(37,Te,18,13,"tr",12),e.qZA()(),e.TgZ(38,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",t.selectedOutlets)("items",t.outlets),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,r.Fj,r.wV,r.JJ,r.On,p.p,f.rH,d.w9,g.n,P,u.JJ,u.uU]});const be=function(){return["/menu/Order/detail"]},Ze=function(i,n){return{Number:i,Outlet:n}};function Ce(i,n){if(1&i&&(e.TgZ(0,"a",16),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,be))("queryParams",e.WLB(4,Ze,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function ve(i,n){if(1&i&&(e.TgZ(0,"a",17),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw();e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Se(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ce,2,7,"a",14),e.YNc(5,ve,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State)}}class J{constructor(n,t){this.http=n,this.localDataService=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.outlets=n.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetAll ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(n){this.filter=n,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}J.\u0275fac=function(n){return new(n||J)(e.Y36(b.O),e.Y36(s.T))},J.\u0275cmp=e.Xpm({type:J,selectors:[["app-all-order"]],decls:38,vars:9,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.selectedOutlets=o}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Status"),e.qZA()()(),e.TgZ(35,"tbody"),e.YNc(36,Se,16,12,"tr",12),e.qZA()(),e.TgZ(37,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(6),e.Q6J("multiple",!0)("ngModel",t.selectedOutlets)("items",t.outlets),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(22),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,r.Fj,r.wV,r.JJ,r.On,p.p,f.rH,d.w9,g.n,u.JJ,u.uU]});const Pe=function(){return["/menu/Order/detail"]},ye=function(i,n){return{Number:i,Outlet:n}};function De(i,n){if(1&i&&(e.TgZ(0,"a",16),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Pe))("queryParams",e.WLB(4,ye,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Oe(i,n){if(1&i&&(e.TgZ(0,"a",17),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw();e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ne(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,De,2,7,"a",14),e.YNc(5,Oe,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,6,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,8,t.Created,"dd MMM yyyy HH:mm"))}}class k{constructor(n,t){this.http=n,this.localDataService=t,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.outlets=n.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetCancelled ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}k.\u0275fac=function(n){return new(n||k)(e.Y36(b.O),e.Y36(s.T))},k.\u0275cmp=e.Xpm({type:k,selectors:[["app-cancelled"]],decls:36,vars:9,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.selectedOutlets=o}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,Ne,14,11,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(6),e.Q6J("multiple",!0)("ngModel",t.selectedOutlets)("items",t.outlets),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,r.Fj,r.wV,r.JJ,r.On,p.p,f.rH,d.w9,g.n,u.JJ,u.uU]});var Ae=c(2138),y=(()=>{return(i=y||(y={}))[i.DoNothing=0]="DoNothing",i[i.New=1]="New",i[i.Update=2]="Update",y;var i})(),we=c(6082),L=c(9602),G=c(8425),z=c(266);function xe(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){e.CHM(t),e.oxw();const o=e.MAs(11);return e.KtG(o.previous())}),e._uU(1," Back "),e.qZA()}}function qe(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),h=e.MAs(11);return e.KtG(o.onNext(h))}),e._uU(1," Next "),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function Me(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),h=e.MAs(11);return e.KtG(o.onNew(h))}),e._UZ(1,"i",29),e._uU(2," New "),e.qZA()}}function Ie(i,n){1&i&&e._uU(0,"Filter")}function Ue(i,n){if(1&i&&(e.TgZ(0,"ng-option",30),e._UZ(1,"img",31),e._uU(2),e.qZA()),2&i){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function Je(i,n){1&i&&e._uU(0,"Preview")}function ke(i,n){if(1&i&&(e.TgZ(0,"th",49),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function Le(i,n){if(1&i&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function Ge(i,n){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function Qe(i,n){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function Fe(i,n){if(1&i&&(e.TgZ(0,"ul",55),e.YNc(1,Qe,2,1,"li",50),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function Re(i,n){if(1&i&&(e.TgZ(0,"span",56),e._UZ(1,"i",57),e.qZA()),2&i){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const Ye=function(i,n){return{"over-due-today":i,"over-due":n}};function Ee(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,Le,3,4,"td",51),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",52)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,Ge,2,1,"span",51),e.YNc(16,Fe,2,1,"ul",53),e.qZA(),e.TgZ(17,"td"),e.YNc(18,Re,2,2,"span",54),e.qZA()()),2&i){const t=n.$implicit,a=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",o.getTypeID()!=o.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(11,Ye,(null==t?null:t.Action)==o.actionPreviewOrder.Update,(null==t?null:t.Action)==o.actionPreviewOrder.New)),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.hij("",t.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function ze(i,n){if(1&i&&(e.ynx(0),e.YNc(1,Ee,19,14,"tr",50),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function He(i,n){1&i&&(e.TgZ(0,"tr",58)(1,"td",59)(2,"div",60),e._UZ(3,"i",61),e.qZA(),e.TgZ(4,"h4",62),e._uU(5,"There is no order to processed"),e.qZA()()())}function $e(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"div",32)(1,"div",33)(2,"div",34)(3,"ul",35)(4,"li",36)(5,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",36)(8,"button",38),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",36)(11,"button",39),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",36)(14,"button",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",41)(17,"thead",42)(18,"tr"),e._UZ(19,"th",43),e.TgZ(20,"th",44),e._uU(21,"Number"),e.qZA(),e.YNc(22,ke,2,1,"th",45),e.TgZ(23,"th",46),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",46),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",43),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,ze,2,1,"ng-container",47),e.YNc(32,He,6,0,"ng-template",null,48,e.W1O),e.qZA()()()()}if(2&i){const t=e.MAs(33),a=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==a.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",a.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==a.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",a.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==a.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",a.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==a.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",a.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",a.getTypeID()!=a.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",a.displayedPreviewData.length>0)("ngIfElse",t)}}function Be(i,n){1&i&&e._uU(0,"Finish")}const Ve=function(i){return{"over-due":i}};function je(i,n){if(1&i&&(e.TgZ(0,"tr",52)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&i){const t=n.$implicit,a=n.index;e.Q6J("ngClass",e.VKq(5,Ve,t.Exception)),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function We(i,n){if(1&i&&(e.ynx(0),e.YNc(1,je,9,7,"tr",64),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function Ke(i,n){1&i&&(e.TgZ(0,"tr",58)(1,"td",59)(2,"div",60),e._UZ(3,"i",61),e.qZA(),e.TgZ(4,"h4",62),e._uU(5,"There is no order to processed"),e.qZA()()())}function Xe(i,n){if(1&i&&(e.TgZ(0,"div",32)(1,"div",33)(2,"table",41)(3,"thead",42)(4,"tr"),e._UZ(5,"th",43),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,We,2,1,"ng-container",47),e.YNc(14,Ke,6,0,"ng-template",null,63,e.W1O),e.qZA()()()()),2&i){const t=e.MAs(15),a=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==a.downloadData?null:a.downloadData.length)>0)("ngIfElse",t)}}function et(i,n){1&i&&e._UZ(0,"i",65)}function tt(i,n){1&i&&e._UZ(0,"i",66)}function nt(i,n){1&i&&e._UZ(0,"i",67)}var T=(()=>{return(i=T||(T={})).ALL="all",i.SYNC="sync",i.WRONG="wrong",i.UNSYNC="unsync",T;var i})();class Q{constructor(n,t,a,o,h){this.http=n,this.toastr=t,this.datePipe=a,this.url=o,this.productService=h,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=m.x,this.previewStatus=T,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=y}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(n=>{this.channelID=n.ChannelID,this.startDate=new Date(n.Date),this.endDate=new Date(n.Date)})}initPageLoader(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel})}onDownload(n){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(a=>{this.downloadData=a.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(a=>{0!=a.length?(this.previewData=a,this.groupingPreviewData(),this.filterPreviewData(T.ALL),this.initLengthStatusData(),this.onStepperNext(n)):this.toastrEmptyPreview()})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let n=!0;return _.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),n=!1),n}setPageTitle(n){const t=_.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),a=this.datePipe.transform(this.startDate,t),o=this.datePipe.transform(this.endDate,"dd MMM yyyy");this.pageTitle=`\n ${n} (${null==t?"":a+"-"} ${o})\n `}onNew(n){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",n.reset()}groupingPreviewData(){let n=this.filterDataByStatus(T.UNSYNC),t=this.filterDataByStatus(T.WRONG);this.downloadedPreviewData=[...n,...t]}filterDataByStatus(n){let t=[];switch(n){case T.ALL:t=this.previewData;break;case T.SYNC:t=this.previewData.filter(a=>a.Action==y.DoNothing);break;case T.WRONG:t=this.previewData.filter(a=>a.Action==y.Update);break;case T.UNSYNC:t=this.previewData.filter(a=>a.Action==y.New)}return t}filterPreviewData(n){this.pillStatus=n,this.displayedPreviewData=this.filterDataByStatus(n)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(T.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(T.SYNC).length,this.unsyncData=this.filterDataByStatus(T.UNSYNC).length}getTypeID(){var n=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return n??0}onStepperChange(n){this.currentState=n.selectedStep.state}onStepperNext(n){n.selected.completed=!0,n.next()}onNext(n){switch(this.currentState){case"filter":this.onPreview(n);break;case"preview":this.onDownload(n)}}stepChange(n){switch(n?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let n=!_.g.isValidDate(this.startDate)||!_.g.isValidDate(this.endDate),t=_.g.IsEmpty(this.channelID);return n||t}}Q.\u0275fac=function(n){return new(n||Q)(e.Y36(b.O),e.Y36(l._W),e.Y36(u.uU),e.Y36(f.gz),e.Y36(we.M))},Q.\u0275cmp=e.Xpm({type:Q,selectors:[["app-download"]],features:[e._Bn([{provide:Ae.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"ngClass"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(n,t){if(1&n){const a=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,xe,2,0,"button",1),e.YNc(3,qe,2,1,"button",2),e.YNc(4,Me,3,0,"button",1),e.qZA(),e.TgZ(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"mat-stepper",7,8),e.NdJ("selectionChange",function(h){return t.stepChange(h)})("selectionChange",function(h){return t.onStepperChange(h)}),e.TgZ(12,"mat-step",9),e.YNc(13,Ie,1,0,"ng-template",10),e.TgZ(14,"div",11)(15,"div",5)(16,"div",4)(17,"div",12)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",13),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",12)(23,"ng-select",14),e.NdJ("ngModelChange",function(h){return t.channelID=h}),e.YNc(24,Ue,3,3,"ng-option",15),e.qZA()()(),e.TgZ(25,"div",16)(26,"div",12)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",13),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",12)(32,"div",5)(33,"mat-date-range-input",17)(34,"input",18),e.NdJ("ngModelChange",function(h){return t.startDate=h})("click",function(){e.CHM(a);const h=e.MAs(37);return e.KtG(h.open())}),e.qZA(),e.TgZ(35,"input",19),e.NdJ("ngModelChange",function(h){return t.endDate=h})("click",function(){e.CHM(a);const h=e.MAs(37);return e.KtG(h.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,20),e.qZA()()()()()(),e.TgZ(38,"mat-step",21),e.YNc(39,Je,1,0,"ng-template",10),e.YNc(40,$e,34,11,"div",22),e.qZA(),e.TgZ(41,"mat-step",23),e.YNc(42,Be,1,0,"ng-template",10),e.YNc(43,Xe,16,2,"div",22),e.qZA(),e.YNc(44,et,1,0,"ng-template",24),e.YNc(45,tt,1,0,"ng-template",25),e.YNc(46,nt,1,0,"ng-template",26),e.qZA()()()()()()()}if(2&n){const a=e.MAs(11),o=e.MAs(37);e.Q6J("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(1),e.Q6J("ngIf","finish"!=t.currentState),e.xp6(1),e.Q6J("ngIf","finish"==t.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+a.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",t.channelID),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(9),e.Q6J("rangePicker",o),e.xp6(1),e.Q6J("ngModel",t.startDate),e.xp6(1),e.Q6J("ngModel",t.endDate),e.xp6(3),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(3),e.Q6J("ngIf","finish"==t.currentState)}},dependencies:[u.mk,u.sg,u.O5,r.Fj,r.JJ,r.On,p.p,d.w9,d.jq,L.wx,L.zY,L.By,L._g,G.C0,G.VY,G.Vq,G.z9,z.gM,u.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]});var C=c(8063);const at=[{path:"",component:v,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:w,canActivate:[C.a],data:{title:"New Order"}},{path:"detail",component:x,canActivate:[C.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:M,canActivate:[C.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:I,canActivate:[C.a],data:{title:"Shipped"}},{path:"Delivered",component:U,canActivate:[C.a],data:{title:"Delivered"}},{path:"All",component:J,canActivate:[C.a],data:{title:"All Order"}},{path:"Cancelled",component:k,canActivate:[C.a],data:{title:"Cancelled"}},{path:"Download",component:Q,canActivate:[C.a],data:{title:"Download"}}]}];class D{}D.\u0275fac=function(n){return new(n||D)},D.\u0275mod=e.oAB({type:D}),D.\u0275inj=e.cJS({imports:[u.ez,f.Bz.forChild(at)]});var it=c(8739),ot=c(3238);class O{}O.\u0275fac=function(n){return new(n||O)},O.\u0275mod=e.oAB({type:O}),O.\u0275inj=e.cJS({imports:[u.ez]});class N{}N.\u0275fac=function(n){return new(n||N)},N.\u0275mod=e.oAB({type:N}),N.\u0275inj=e.cJS({providers:[Z],imports:[u.ez,r.u5,D,Y.Z,p.R,it.TU,f.Bz,d.A0,L.FA,ot.XK,g.n,G.T5,z.AV,O,E.p9,S.Is]})},6082:(H,R,c)=>{c.d(R,{M:()=>_});var u=c(8505),f=c(3154),e=c(4650),Y=c(1318),v=c(7185);class _{constructor(l,s){this.httpService=l,this.toastrService=s}loader(l=f.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:l})}filterChannelByTypeId(l,s){return l.filter(r=>-1!==s.findIndex(p=>r.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(l){return this.httpService.post("/api/product/TotalProductLive",{ID:l})}clearCacheChannel(l){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:l})}uploadSingleProduct(l,s){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:s,Products:l})}uploadMultipleProduct(l,s){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:s,Products:l})}scanSingle(l,s){return this.httpService.post("/api/product/ScanSingle",{ID:l,SKU:s})}scanNotInChannel(l){return this.httpService.post("/api/product/ScanNotinChannel",{ID:l})}findAllSoldInChannel(l){return this.httpService.post("/api/product/GetSoldInChannel",l)}scanAll(l,s,r,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:l,ScanFull:s,UpdatedProduct:r,Async:p})}scanCompareToPos(l){return this.httpService.post("/api/product/CompareMarketplaceToPOS",l)}getVariantCodesProduct(l){return l.Variants.map(r=>r.Code)}downloadMultipleProduct(l){let s=l.map(r=>({ChannelItemID:r.ChannelItemID,ChannelID:r.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",s).pipe((0,u.b)(r=>{this.toastrService.success(`${r.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(l){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:l.ChannelItemID,ChannelID:l.ChannelID}).pipe((0,u.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(l=[]){let s=[];return l.forEach(r=>{r.Variants.forEach(p=>{s=[...s,p.Code]})}),s}filterUnselectedChannel(l,s){let p,r=[];if(l.forEach(d=>{r=[...r,...d.Channel]}),r&&0!=r.length){let d=[];p=s.filter(g=>(d=r.filter(A=>A.ChannelID==g.ID),d.length!==l.length))}else p=s;return p}findChannelById(l,s){return s.find(r=>r.ID==l)}sortChannel(l=[]){return l.sort((s,r)=>s.TypeID<r.TypeID?1:s.TypeID===r.TypeID?0:-1)}hasSelection(l=[]){return this.selectedProduct(l).length>0}selectedProduct(l=[]){return l.filter(s=>s.selected)}hasSelectionVariant(l){return this.selectedVariantProduct(l).length>0}selectedVariantProduct(l){let s=[];return l.forEach(r=>{s=[...s,...null!=r.Variants?r.Variants.filter(p=>p.selected):""]}),s}getChannelProduct(l){const s=l.Variants;let r=[];for(let p of s)if(null!=p.Channel)for(let d of p.Channel)0==r.filter(g=>g.ChannelID==d.ChannelID).length&&r.push(d);return this.sortChannel(r)}successToastrScanAllProduct(l,s,r){if(r){const p=l?.NotInPOS?.Product?l?.NotInPOS?.Product:0,d=l?.InChannel?.Product?l?.InChannel?.Product:0;this.toastrService.success(`\n ${p+d} found in ${s.Name} </br>\n (${d} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${l.InChannel?l.InChannel.Product:0} product updates in ${s.Name} </br> \n since ${l.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(l,s){let r;return l.map(p=>(p.Channel=this.getChannelProduct(p),r=this.filterUnselectedChannel([p],s),p.hasScan=r.length>0,p))}checkProductHasUploadBtn(l,s){let r;return l.map(p=>(p.Channel=this.getChannelProduct(p),r=this.filterUnselectedChannel([p],s),p.hasUpload=r.length>0,p))}showToastrUploadMultiple(l=[]){let s=[],r=[];if(l.forEach(p=>{"string"==typeof p?.Response?r=[...r,`<li>${p.Response}</li>`]:(p?.Response?.Success.forEach(d=>{s=[...s,`<li>Product ${d} was <b>successfully</b> uploaded to ${p.Name}</li>`]}),p?.Response.Fail.forEach(d=>{r=[...r,`<li>${d}</li>`]}))}),r.length>0&&s.length>0){const p=[...s,...r];this.toastrService.warning(this.concatMessage(p),"Warning!",{enableHtml:!0})}else s.length>0&&0==r.length?this.toastrService.success(this.concatMessage(s),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(r),"Error",{enableHtml:!0})}concatMessage(l=[]){let s="";return l.forEach(r=>{s+=r}),`<ol>${s}</ol>`}showToastrSuccessUploadSingle(l,s){let r=l.filter(g=>0==g.Status),p=l.filter(g=>1==g.Status),d=this.generateToastrMessage(r,p,s);this.toastrService.success(d.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(l,s){let r=l?.error?.Message.filter(g=>0==g.Status),p=l?.error?.Message.filter(g=>1==g.Status),d=this.generateToastrMessage(r,p,s);"WARNING"==d.status?this.toastrService.warning(d.message,"Warning!",{enableHtml:!0}):this.toastrService.error(d.message,`Error - ${l.status}`,{enableHtml:!0})}generateToastrMessage(l,s,r){let d,p="";return 0==l.length&&s.length>0?(d="SUCCESS",p=this.createSuccessResponse(s,r)):l.length>0&&0==s.length?(d="ERROR",p=this.createErrResponse(l,r)):(d="WARNING",p=`${this.createSuccessResponse(s,r)} ${this.createErrResponse(l,r)}`),p=`<ol>${p}</ol>`,{status:d,message:p}}createErrResponse(l,s){let r="";return l.forEach((p,d)=>{r+=`<li><b>${p.Response}</b> for ${s.Name} in ${p.Name}</li>`}),r}createSuccessResponse(l,s){let r="";return l.forEach((p,d)=>{r+=`<li>Product ${s.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}),r}getHostName(){if(f.g.IsEmpty(this.hostName)){const l=localStorage.getItem("Authorization");this.hostName=JSON.parse(l)?.Host}return this.hostName}}_.\u0275fac=function(l){return new(l||_)(e.LFG(Y.O),e.LFG(v._W))},_.\u0275prov=e.Yz7({token:_,factory:_.\u0275fac,providedIn:"root"})}}]);