marketplacepos 2.9.0 → 2.9.2

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.
@@ -0,0 +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(d=0;d<e.length;d++){for(var[t,f,c]=e[d],p=!0,o=0;o<t.length;o++)(!1&c||a>=c)&&Object.keys(r.O).every(u=>r.O[u](t[o]))?t.splice(o--,1):(p=!1,c<a&&(a=c));if(p){e.splice(d--,1);var s=f();void 0!==s&&(n=s)}}return n}c=c||0;for(var d=e.length;d>0&&e[d-1][2]>c;d--)e[d]=e[d-1];e[d]=[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 d={};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=>d[p]=()=>t[p]);return d.default=()=>t,r.d(c,d),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)+"."+{46:"40ebac81bd0fb91b",53:"8cb269bb04087434",72:"d59410fd71caf119",213:"cb4351cfb44ca3bf",277:"e644e3531765ce65",360:"8279e3b4ceab63e1",369:"be88af4326c1a287",379:"611029ed9b632dca",392:"f4537160149f627a",397:"482996341e2502bf",408:"c94b4441303091c4",425:"03f8f97da7452806",455:"c9dd08adf08a1b65",481:"64ffd74d20798f93",501:"7645c32a140dd7f8",512:"52dc49022c04fa43",533:"cc5ab7f3ce13770c",545:"4809f373cc63f3b4",592:"7ce512ca9d1674b7",655:"c3fe092dbd4ce86c",717:"5d253da5bb63552f",739:"0de1f18deac0ed90",767:"aef1dd980b626ef7",859:"3a4d26983bbb5254",874:"5b06431d2b5a1e8f",913:"ec8155bc121fb0a6",993:"5c22ca4b00b8c459",997:"1e5281aa64540dee"}[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,d)=>{if(e[t])e[t].push(f);else{var a,p;if(void 0!==c)for(var o=document.getElementsByTagName("script"),s=0;s<o.length;s++){var i=o[s];if(i.getAttribute("src")==t||i.getAttribute("data-webpack")==n+c){a=i;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.9.2/Marketplace/",(()=>{var e={666:0};r.f.j=(f,c)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)c.push(d[2]);else if(666!=f){var a=new Promise((i,b)=>d=e[f]=[i,b]);c.push(d[2]=a);var p=r.p+r.u(f),o=new Error;r.l(p,i=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var b=i&&("load"===i.type?"missing":i.type),l=i&&i.target&&i.target.src;o.message="Loading chunk "+f+" failed.\n("+b+": "+l+")",o.name="ChunkLoadError",o.type=b,o.request=l,d[1](o)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,c)=>{var o,s,[d,a,p]=c,i=0;if(d.some(l=>0!==e[l])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(p)var b=p(r)}for(f&&f(c);i<d.length;i++)r.o(e,s=d[i])&&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))})()})();
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"marketplacepos","version":"2.9.0"}
1
+ {"name":"marketplacepos","version":"2.9.2"}
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[3],{9003:(we,S,l)=>{l.r(S),l.d(S,{LogsModule:()=>y});var r=l(6895),e=l(4650),p=l(284),D=l(2937);class b{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Sync Inventory",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Download Order ",Url:"/menu/log/order-log"}]}ngOnInit(){}}b.\u0275fac=function(n){return new(n||b)},b.\u0275cmp=e.Xpm({type:b,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(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.ObjectlogTabs))},dependencies:[p.lC,D.e]});var c=l(8063),f=l(1889),m=l(1318);class g{constructor(){}get Data(){return this._Data}set Data(n){this._Data=n}Fill(n){return this._Data.find(t=>t._id==n)}}g.\u0275fac=function(n){return new(n||g)},g.\u0275prov=e.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"});var s=l(4006),u=l(7481),T=l(8739),h=l(8796),A=l(5585),Z=l(9640);function R(o,n){if(1&o&&(e.TgZ(0,"span",16),e._UZ(1,"img",17),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function P(o,n){1&o&&(e.TgZ(0,"th",21),e._uU(1,"Process Code"),e.qZA())}const J=function(o,n){return{"bg-warning":o,"bg-success":n}};function k(o,n){if(1&o&&(e.TgZ(0,"td",21)(1,"span",26),e._uU(2),e.qZA()()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngClass",e.WLB(2,J,null!=t.ProcessedCode&&200!==t.ProcessedCode,null!=t.ProcessedCode&&200===t.ProcessedCode)),e.xp6(1),e.Oqu(t.ProcessedCode)}}const Q=function(){return["/menu/log/order/detail"]},F=function(o){return{ID:o}};function Y(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",25),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td",21)(12,"span",26),e._uU(13),e.qZA()(),e.YNc(14,k,3,5,"td",22),e.qZA()),2&o){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(12,Q))("queryParams",e.VKq(13,F,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,9,t.Created,"dd MMM yyyy HH:mm:ss")," "),e.xp6(3),e.Oqu(t.MarketTypeString),e.xp6(2),e.Oqu(t.POSActionTypeString),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Q6J("ngClass",e.WLB(15,J,200!==t.ResponseCode,200===t.ResponseCode)),e.xp6(1),e.Oqu(t.ResponseCode),e.xp6(1),e.Q6J("ngIf",i.processedCodeVisible)}}function E(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",18)(2,"table",19)(3,"thead")(4,"tr",20)(5,"th"),e._uU(6,"Date"),e.qZA(),e.TgZ(7,"th"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Actions"),e.qZA(),e.TgZ(11,"th"),e._uU(12,"Number"),e.qZA(),e.TgZ(13,"th",21),e._uU(14,"Response Code"),e.qZA(),e.YNc(15,P,2,0,"th",22),e.qZA()(),e.TgZ(16,"tbody"),e.YNc(17,Y,15,18,"tr",23),e.qZA()(),e.TgZ(18,"mat-paginator",24),e.NdJ("page",function(a){e.CHM(t);const d=e.oxw();return e.KtG(d.changePage(a))}),e.qZA()(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(15),e.Q6J("ngIf",t.processedCodeVisible),e.xp6(2),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}function H(o,n){1&o&&(e.TgZ(0,"div",27),e._UZ(1,"app-empty-state"),e.qZA())}class q{constructor(n,t,i){this.http=n,this._RawLogService=t,this.route=i,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",ProcessedCode:""},this.processedCodeVisible=!1}ngOnInit(){this.route.queryParams.subscribe(n=>{this.responseCode=n.responseCode,null!=this.responseCode?this.Load(n):this.Load()})}Load(n={}){this.http.post("/api/OrdersLoader/Get",n).subscribe(t=>{this.filter=t.Filter,this.Channel=f.g.assignChannelLogo(t.Options.Channel),this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(n){this.filter.Number=n,this.http.post("/api/Orders/Get",this.filter).subscribe(t=>{this._RawLogService.Data=t.hits,this.Result=Array();for(let i of t.hits)i._source.log.processedCode&&(this.processedCodeVisible=!0),this.Result.push({ID:i._id,Created:i._source["@timestamp_received"],shopId:i._source.shopId,MarketTypeString:i._source.log.type,POSActionTypeString:i._source.message,Number:i._source.log.number,ResponseCode:i._source.log.responseCode,ProcessedCode:i._source.log.processedCode});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}}function z(o,n){if(1&o&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}q.\u0275fac=function(n){return new(n||q)(e.Y36(m.O),e.Y36(g),e.Y36(p.gz))},q.\u0275cmp=e.Xpm({type:q,selectors:[["app-order"]],decls:40,vars:15,consts:[["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","StatusCode",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["class","text-center",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-1","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return t.Number=a})("onSubmit",function(a){return t.Get(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return t.filter.ChannelID=a}),e.YNc(7,R,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Action"),e.qZA(),e.TgZ(11,"ng-select",4),e.NdJ("ngModelChange",function(a){return t.filter.ActionType=a}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"From/To"),e.qZA(),e.TgZ(15,"datepicker",5),e.NdJ("dateChange",function(a){return t.filter.From=a}),e.qZA(),e.TgZ(16,"datepicker",6),e.NdJ("dateChange",function(a){return t.filter.To=a}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Response Code"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(a){return t.filter.StatusCode=a}),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Processed Code"),e.qZA(),e.TgZ(24,"input",8),e.NdJ("ngModelChange",function(a){return t.filter.ProcessedCode=a}),e.qZA()(),e.TgZ(25,"div")(26,"h6"),e._uU(27,"Page Number"),e.qZA(),e.TgZ(28,"input",9),e.NdJ("ngModelChange",function(a){return t.filter.PageNumber=a}),e.qZA()(),e.TgZ(29,"div")(30,"h6"),e._uU(31,"Page Size"),e.qZA(),e.TgZ(32,"input",10),e.NdJ("ngModelChange",function(a){return t.filter.RowCount=a}),e.qZA()()()(),e.TgZ(33,"content")(34,"div",11)(35,"div",12)(36,"div",13),e.YNc(37,E,19,5,"ng-container",14),e.YNc(38,H,2,0,"ng-template",null,15,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(39);e.Q6J("text",t.Number),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),e.Q6J("clearable",!0)("items",t.ActionTypeList)("ngModel",t.filter.ActionType),e.xp6(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.StatusCode),e.xp6(4),e.Q6J("ngModel",t.filter.ProcessedCode),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(5),e.Q6J("ngIf",(null==t.Result?null:t.Result.length)>0)("ngIfElse",i)}},dependencies:[r.mk,r.sg,r.O5,s.Fj,s.wV,s.JJ,s.On,p.rH,u.p,T.NW,h.w9,h.ir,A.Q,Z.s,r.uU]});const G=function(){return["/menu/log/inventory/detail"]},B=function(o){return{ID:o}};function j(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",20),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(10,G))("queryParams",e.VKq(11,B,t.ID)),e.xp6(1),e.hij(" ",e.xi3(4,7,t.Created,"dd MMM yyyy HH:mm")," "),e.xp6(3),e.Oqu(t.channelName),e.xp6(2),e.Oqu(t.Sku),e.xp6(2),e.Oqu(t.Stock),e.xp6(2),e.Oqu(t.ResponseCode)}}function V(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16)(3,"thead")(4,"tr",17)(5,"th"),e._uU(6,"Created"),e.qZA(),e.TgZ(7,"th"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"SKU"),e.qZA(),e.TgZ(11,"th"),e._uU(12,"Stock"),e.qZA(),e.TgZ(13,"th"),e._uU(14,"Response code"),e.qZA()()(),e.TgZ(15,"tbody"),e.YNc(16,j,13,13,"tr",18),e.qZA()(),e.TgZ(17,"mat-paginator",19),e.NdJ("page",function(a){e.CHM(t);const d=e.oxw();return e.KtG(d.changePage(a))}),e.qZA()(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(16),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}function K(o,n){1&o&&(e.TgZ(0,"div",21),e._UZ(1,"app-empty-state"),e.qZA())}class x{constructor(n,t){this.http=n,this._RawLogService=t,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load()}ngOnInit(){}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(n=>{this.filter=n.Filter,this.Channel=f.g.assignChannelLogo(n.Options.Channel),this.ActionTypeList=n.Options.ActionTypeList,this.Get()})}Get(n){null!=n&&(this.filter.Sku=n),this.http.post("api/Inventory/GetLog",this.filter).subscribe(t=>{this._RawLogService.Data=t.hits,this.Result=Array();for(let i of t.hits)this.Result.push({ID:i._source.log.id,Created:i._source["@timestamp_received"],channelName:i._source.log.channelName,Sku:i._source.log.sku,Stock:i._source.log.stock,ResponseCode:i._source.log.responseCode});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount,this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}}function W(o,n){if(1&o&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}x.\u0275fac=function(n){return new(n||x)(e.Y36(m.O),e.Y36(g))},x.\u0275cmp=e.Xpm({type:x,selectors:[["app-inventory-log"]],decls:28,vars:10,consts:[["headerTitle","Inventory Log","searchBoxPlaceHolder","Enter SKU...",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt=3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return t.filter.Sku=a})("onSubmit",function(a){return t.Get(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return t.filter.ChannelID=a}),e.YNc(7,z,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"From/To"),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(a){return t.filter.From=a}),e.qZA(),e.TgZ(12,"datepicker",5),e.NdJ("dateChange",function(a){return t.filter.To=a}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Number"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(a){return t.filter.PageNumber=a}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Page Size"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(a){return t.filter.RowCount=a}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,V,18,4,"ng-container",11),e.YNc(26,K,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(27);e.Q6J("text",t.filter.Sku),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(5),e.Q6J("ngIf",(null==t.Result?null:t.Result.length)>0)("ngIfElse",i)}},dependencies:[r.sg,r.O5,s.Fj,s.wV,s.JJ,s.On,p.rH,u.p,T.NW,h.w9,h.ir,A.Q,Z.s,r.uU]});const X=function(){return["/menu/log/order/detail"]},$=function(o){return{ID:o}};function ee(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td")(2,"a",21),e._uU(3),e.ALo(4,"date"),e.qZA()(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(9,X))("queryParams",e.VKq(10,$,t.id)),e.xp6(1),e.hij(" ",e.xi3(4,6,t.Created,"dd MMM yyyy HH:mm:ss")," "),e.xp6(3),e.Oqu(t.type),e.xp6(2),e.Oqu(t.number),e.xp6(2),e.Oqu(t.message)}}function te(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),e._uU(6,"Date"),e.qZA(),e.TgZ(7,"th"),e._uU(8,"Type"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Number"),e.qZA(),e.TgZ(11,"th"),e._uU(12,"Message"),e.qZA()()(),e.TgZ(13,"tbody"),e.YNc(14,ee,11,12,"tr",19),e.qZA()(),e.TgZ(15,"mat-paginator",20),e.NdJ("page",function(a){e.CHM(t);const d=e.oxw();return e.KtG(d.changePage(a))}),e.qZA()(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(14),e.Q6J("ngForOf",t.Result),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}function ne(o,n){1&o&&(e.TgZ(0,"div",22),e._UZ(1,"app-empty-state"),e.qZA())}class O{constructor(n,t){this.http=n,this._RawLogService=t,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}]}ngOnInit(){this.Load()}Load(n={}){this.http.post("/api/OrdersLoader/Get",n).subscribe(t=>{this.filter=t.Filter,this.Channel=f.g.assignChannelLogo(t.Options.Channel),this.ActionTypeList=t.Options.ActionTypeList,this.Get()})}Get(n){this.filter.Number=n,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(t=>{this._RawLogService.Data=t.hits,this.Result=Array();for(let i of t.hits)this.Result.push({id:i._id,message:i._source.message,responseCode:i._source.log.responseCode,processTypeString:i._source.log.processType,type:i._source.log.type,number:i._source.log.number,Created:i._source["@timestamp_received"]});this.paginationTotal=t.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}}O.\u0275fac=function(n){return new(n||O)(e.Y36(m.O),e.Y36(g))},O.\u0275cmp=e.Xpm({type:O,selectors:[["app-raw-log"]],decls:28,vars:10,consts:[["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"text","textChange","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("textChange",function(a){return t.filter.Number=a})("onSubmit",function(a){return t.Get(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return t.filter.ChannelID=a}),e.YNc(7,W,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"From/To"),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(a){return t.filter.From=a}),e.qZA(),e.TgZ(12,"datepicker",5),e.NdJ("dateChange",function(a){return t.filter.To=a}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Number"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(a){return t.filter.PageNumber=a}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Page Size"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(a){return t.filter.RowCount=a}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,te,16,4,"ng-container",11),e.YNc(26,ne,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(27);e.Q6J("text",t.filter.Number),e.xp6(6),e.Q6J("clearable",!0)("items",t.Channel)("ngModel",t.filter.ChannelID),e.xp6(5),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(5),e.Q6J("ngIf",(null==t.Result?null:t.Result.length)>0)("ngIfElse",i)}},dependencies:[r.sg,r.O5,s.Fj,s.wV,s.JJ,s.On,p.rH,u.p,T.NW,h.w9,h.ir,A.Q,Z.s,r.uU]});class oe{constructor(n,t){this._document=t;const i=this._textarea=this._document.createElement("textarea"),a=i.style;a.position="fixed",a.top=a.opacity="0",a.left="-999em",i.setAttribute("aria-hidden","true"),i.value=n,i.readOnly=!0,this._document.body.appendChild(i)}copy(){const n=this._textarea;let t=!1;try{if(n){const i=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),t=this._document.execCommand("copy"),i&&i.focus()}}catch{}return t}destroy(){const n=this._textarea;n&&(n.remove(),this._textarea=void 0)}}let ie=(()=>{class o{constructor(t){this._document=t}copy(t){const i=this.beginCopy(t),a=i.copy();return i.destroy(),a}beginCopy(t){return new oe(t,this._document)}}return o.\u0275fac=function(t){return new(t||o)(e.LFG(r.K0))},o.\u0275prov=e.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();const ae=new e.OlP("CDK_COPY_TO_CLIPBOARD_CONFIG");let re=(()=>{class o{constructor(t,i,a){this._clipboard=t,this._ngZone=i,this.text="",this.attempts=1,this.copied=new e.vpe,this._pending=new Set,a&&null!=a.attempts&&(this.attempts=a.attempts)}copy(t=this.attempts){if(t>1){let i=t;const a=this._clipboard.beginCopy(this.text);this._pending.add(a);const d=()=>{const _=a.copy();_||!--i||this._destroyed?(this._currentTimeout=null,this._pending.delete(a),a.destroy(),this.copied.emit(_)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(d,1))};d()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(t=>t.destroy()),this._pending.clear(),this._destroyed=!0}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(ie),e.Y36(e.R0b),e.Y36(ae,8))},o.\u0275dir=e.lG2({type:o,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(t,i){1&t&&e.NdJ("click",function(){return i.copy()})},inputs:{text:["cdkCopyToClipboard","text"],attempts:["cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}}),o})(),le=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({}),o})();function se(o,n){1&o&&e._UZ(0,"img",21)}function de(o,n){1&o&&e._UZ(0,"img",22)}function pe(o,n){if(1&o&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),e._uU(4,"General"),e.qZA()(),e.TgZ(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"div")(12,"span"),e._uU(13),e.ALo(14,"date"),e.qZA()()()(),e.TgZ(15,"div",10)(16,"div",9)(17,"label"),e._uU(18,"Market Place Type"),e.qZA(),e.YNc(19,se,1,0,"img",11),e.YNc(20,de,1,0,"img",12),e.TgZ(21,"a",13)(22,"span",14),e._uU(23),e.qZA(),e._UZ(24,"br"),e.TgZ(25,"small",15),e._uU(26),e.qZA()()()(),e.TgZ(27,"div",10)(28,"div",9)(29,"label"),e._uU(30,"Number"),e.qZA(),e.TgZ(31,"div")(32,"span"),e._uU(33),e.qZA()()()(),e.TgZ(34,"div",8)(35,"div",9)(36,"label"),e._uU(37,"Process Type"),e.qZA(),e.TgZ(38,"div")(39,"span"),e._uU(40),e.qZA()()()(),e.TgZ(41,"div",4)(42,"div",9)(43,"label"),e._uU(44,"Authorization Header"),e.qZA(),e.TgZ(45,"div")(46,"span"),e._uU(47),e.qZA()()()(),e.TgZ(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),e._uU(53,"Request"),e.qZA()(),e.TgZ(54,"div",19)(55,"button",20),e._uU(56,"Copy to clipboard"),e.qZA()()(),e.TgZ(57,"div",7),e._uU(58),e.qZA()()()()()()()),2&o){const t=e.oxw();e.xp6(13),e.Oqu(e.xi3(14,11,t.data.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(6),e.Q6J("ngIf",1==t.data.TypeID),e.xp6(1),e.Q6J("ngIf",0==t.data.TypeID),e.xp6(1),e.s9C("href",t.data.ShopLink,e.LSH),e.xp6(2),e.Oqu(t.data.ShopName),e.xp6(3),e.Oqu(t.data.ShopLink),e.xp6(7),e.Oqu(t.data._source.log.number),e.xp6(7),e.Oqu(t.data._source.log.processType),e.xp6(7),e.Oqu(t.data._source.log.authorizationHeader),e.xp6(8),e.Q6J("cdkCopyToClipboard",t.data._source.log.request),e.xp6(3),e.hij(" ",t.data._source.log.request," ")}}class L{constructor(n,t,i){this.route=n,this.http=t,this._RawLogService=i,this.route.queryParams.subscribe(a=>{let d=JSON.parse(localStorage.getItem("channel"));if(this.ID=a.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],d.length>0){const _=d.find(Ue=>Ue.ShopID==this.data._source.shopId);_?(this.data.TypeID=_.TypeID,this.data.ShopName=_.Name,this.data.ShopLink=_.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}}function ge(o,n){if(1&o&&(e.TgZ(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),e._uU(4,"General"),e.qZA()(),e.TgZ(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"div")(12,"span"),e._uU(13),e.ALo(14,"date"),e.qZA()()()(),e.TgZ(15,"div",6)(16,"div",12)(17,"label"),e._uU(18,"SKU"),e.qZA(),e.TgZ(19,"div")(20,"span"),e._uU(21),e.qZA()()()(),e.TgZ(22,"div",6)(23,"div",12)(24,"label"),e._uU(25,"Channel"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",6)(30,"div",12)(31,"label"),e._uU(32,"Response Code"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()()()()()()),2&o){const t=e.oxw();e.xp6(13),e.Oqu(e.xi3(14,4,t.data.Created,"dd MMM yyyy")),e.xp6(8),e.Oqu(t.data.Sku),e.xp6(7),e.Oqu(t.data.ChannelName),e.xp6(7),e.Oqu(t.data.ResponseCode)}}L.\u0275fac=function(n){return new(n||L)(e.Y36(p.gz),e.Y36(m.O),e.Y36(g))},L.\u0275cmp=e.Xpm({type:L,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),e.YNc(4,pe,59,14,"div",3),e.qZA()()()()),2&n&&(e.Q6J("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(4),e.Q6J("ngIf",t.data))},dependencies:[r.O5,u.p,re,r.uU]});class U{constructor(n,t,i){this.route=n,this.http=t,this._RawLogService=i,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(a=>{this.ID=a.ID,this.Load()})}ngOnInit(){}Load(){this.http.post("/api/Inventory/GetInventoryLogDeatil",{ID:this.ID}).subscribe(t=>{this.data.Created=t.hits[0]._source["@timestamp_received"],this.data.Sku=t.hits[0]._source.log.sku,this.data.ChannelName=t.hits[0]._source.log.channelName,this.data.ResponseCode=t.hits[0]._source.log.responseCode,this.request=JSON.parse(t.hits[0]._source.log.request),this.response=t.hits[0]._source.log.response})}}function ue(o,n){if(1&o&&(e.TgZ(0,"div",9)(1,"div",10)(2,"label"),e._uU(3,"Process Code"),e.qZA(),e.TgZ(4,"div")(5,"span"),e._uU(6),e.qZA()()()()),2&o){const t=e.oxw();e.xp6(6),e.Oqu(t.ProcessedCode)}}function ce(o,n){if(1&o){const t=e.EpF();e.TgZ(0,"a",16),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.Retry())}),e._uU(1,"Retry"),e.qZA()}}U.\u0275fac=function(n){return new(n||U)(e.Y36(p.gz),e.Y36(m.O),e.Y36(g))},U.\u0275cmp=e.Xpm({type:U,selectors:[["app-inventory-detail"]],decls:30,vars:9,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(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)(6,"div",3),e.YNc(7,ge,36,7,"div",4),e.qZA(),e.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),e._uU(13,"Request"),e.qZA()(),e.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),e._uU(18),e.ALo(19,"json"),e.qZA()()()()()(),e.TgZ(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),e._uU(24,"Response"),e.qZA()(),e.TgZ(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),e._uU(29),e.qZA()()()()()()()()()()),2&n&&(e.Q6J("headerTitle","Inventory Detail")("pageData","Inventory Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(7),e.Q6J("ngIf",t.data),e.xp6(11),e.Oqu(e.lcZ(19,7,t.request)),e.xp6(11),e.Oqu(t.response))},dependencies:[r.O5,p.rH,u.p,r.Ts,r.uU]});class w{constructor(n,t){this.route=n,this.http=t,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(i=>{this.ID=i.ID,this.Load()})}ngOnInit(){}Retry(){this.http.post("/api/Orders/Retry",{Number:this.Number,ShopID:this.shopId}).subscribe(t=>{alert(JSON.stringify(t))})}Load(){this.http.post("/api/Orders/GetDetail",{ID:this.ID}).subscribe(t=>{for(let i of t.hits)this.Number=i._source.log.number,this.MarketTypeString=i._source.log.type,this.ResponseCode=i._source.log.responseCode,this.POSActionTypeString=i._source.message,this.ProcessDuration=0,this.Created=i._source["@timestamp_received"],this.request=JSON.parse(i._source.log.request),this.response=JSON.parse(i._source.log.response),this.shopId=i._source.shopId,this.ProcessedCode=i._source.log.processedCode})}}w.\u0275fac=function(n){return new(n||w)(e.Y36(p.gz),e.Y36(m.O))},w.\u0275cmp=e.Xpm({type:w,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(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)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),e._uU(11,"General"),e.qZA()(),e.TgZ(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),e._uU(17,"Date"),e.qZA(),e.TgZ(18,"div")(19,"span"),e._uU(20),e.ALo(21,"date"),e.qZA()()()(),e.TgZ(22,"div",9)(23,"div",10)(24,"label"),e._uU(25,"Number"),e.qZA(),e.TgZ(26,"div")(27,"span"),e._uU(28),e.qZA()()()(),e.TgZ(29,"div",9)(30,"div",10)(31,"label"),e._uU(32,"Type"),e.qZA(),e.TgZ(33,"div")(34,"span"),e._uU(35),e.qZA()()()(),e.TgZ(36,"div",9)(37,"div",10)(38,"label"),e._uU(39,"Response Code"),e.qZA(),e.TgZ(40,"div")(41,"span"),e._uU(42),e.qZA()()()(),e.TgZ(43,"div",9)(44,"div",10)(45,"label"),e._uU(46,"ShopID"),e.qZA(),e.TgZ(47,"div")(48,"span"),e._uU(49),e.qZA()()()(),e.YNc(50,ue,7,1,"div",11),e.TgZ(51,"div",9)(52,"div",10)(53,"label"),e._uU(54,"Action"),e.qZA(),e.TgZ(55,"div")(56,"span"),e._uU(57),e.qZA()()()()()()()()(),e.TgZ(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),e._uU(63,"Request"),e.qZA()(),e.TgZ(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),e._uU(68),e.ALo(69,"json"),e.qZA()()(),e.TgZ(70,"actions",14),e.YNc(71,ce,2,0,"a",15),e.qZA()()()(),e.TgZ(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),e._uU(76,"Response"),e.qZA()(),e.TgZ(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),e._uU(81),e.ALo(82,"json"),e.qZA()()()()()()()()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(20),e.Oqu(e.xi3(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),e.xp6(8),e.Oqu(t.Number),e.xp6(7),e.Oqu(t.MarketTypeString),e.xp6(7),e.Oqu(t.ResponseCode),e.xp6(7),e.Oqu(t.shopId),e.xp6(1),e.Q6J("ngIf",null!=t.ProcessedCode),e.xp6(7),e.Oqu(t.POSActionTypeString),e.xp6(11),e.Oqu(e.lcZ(69,17,t.request)),e.xp6(3),e.Q6J("ngIf","200"!=t.ResponseCode&&"201"!=t.ResponseCode),e.xp6(10),e.Oqu(e.lcZ(82,19,t.response)))},dependencies:[r.O5,p.rH,u.p,r.Ts,r.uU]});const me=function(){return["/menu/log/exception/detail"]},he=function(o){return{ID:o}};function _e(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td",12),e._UZ(2,"img",13),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"date"),e.qZA(),e.TgZ(6,"td")(7,"a",14),e._uU(8),e.qZA()(),e.TgZ(9,"td")(10,"div",15),e._uU(11),e.qZA(),e.TgZ(12,"div"),e._uU(13),e.qZA()()()),2&o){const t=n.$implicit;e.xp6(2),e.Q6J("src",t.logo,e.LSH),e.xp6(2),e.Oqu(e.xi3(5,7,t.date,"dd-MM-yyyy hh:mm:ss")),e.xp6(3),e.Q6J("routerLink",e.DdM(10,me))("queryParams",e.VKq(11,he,t.id)),e.xp6(1),e.hij(" ",t.number," "),e.xp6(3),e.Oqu(t.message),e.xp6(2),e.Oqu(t.stackTrace)}}function fe(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"mat-paginator",16),e.NdJ("page",function(a){e.CHM(t);const d=e.oxw(2);return e.KtG(d.onPaginationChange(a))}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("length",t.pageTotal)("pageSize",t.pageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}function Te(o,n){if(1&o&&(e.ynx(0),e.TgZ(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),e._uU(6,"Channel"),e.qZA(),e.TgZ(7,"th",9),e._uU(8,"Date"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Number"),e.qZA(),e.TgZ(11,"th"),e._uU(12,"Exception"),e.qZA()()(),e.TgZ(13,"tbody"),e.YNc(14,_e,14,13,"tr",10),e.qZA()(),e.YNc(15,fe,2,3,"ng-container",11),e.qZA(),e.BQk()),2&o){const t=e.oxw();e.xp6(14),e.Q6J("ngForOf",t.exceptions),e.xp6(1),e.Q6J("ngIf",(null==t.exceptions?null:t.exceptions.length)>0)}}function Ze(o,n){1&o&&(e.TgZ(0,"div",17),e._UZ(1,"app-empty-state"),e.qZA())}class M{constructor(n){this.http=n,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(n=>{this.exceptions=n.hits.map(t=>({id:t._id,logo:f.g.getChannelLogoByName(t._source.error?.Type),number:t._source.error.number,date:t._source["@timestamp_received"],stackTrace:t._source.error.stackTrace,message:t._source.message,requestJSON:t._source?.error?.requestJSON})),this.pageTotal=n.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(n){this.filter.PageNumber=n.pageIndex+1,this.getData()}}function Ce(o,n){if(1&o&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&o){const t=n.item;e.xp6(1),e.Q6J("src",t.logo,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function ve(o,n){if(1&o&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._UZ(4,"img",24),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.ALo(7,"date"),e.ALo(8,"date"),e.qZA(),e.TgZ(9,"td",25),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td"),e._uU(13),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.ALo(16,"date"),e.qZA()()),2&o){const t=n.$implicit;e.xp6(2),e.Oqu(t.ChannelName),e.xp6(2),e.Q6J("src",t.logo,e.LSH),e.xp6(2),e.AsE("",e.xi3(7,7,t.Daterange_from,"dd MMM yyyy")," - ",e.xi3(8,10,t.Daterange_to,"dd MMM yyyy"),""),e.xp6(4),e.Oqu(e.lcZ(11,13,t.ResponseCountOrder)),e.xp6(3),e.Oqu(t.UserLogin),e.xp6(2),e.hij("",e.xi3(16,15,t.Created,"dd MMM yyyy")," ")}}function ye(o,n){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16)(3,"thead")(4,"tr",17)(5,"th",18),e._uU(6,"Channel"),e.qZA(),e.TgZ(7,"th",19),e._uU(8,"Type"),e.qZA(),e.TgZ(9,"th",20),e._uU(10,"Download Date Range"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Count Order"),e.qZA(),e.TgZ(13,"th"),e._uU(14,"User Login"),e.qZA(),e.TgZ(15,"th"),e._uU(16,"Created"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,ve,17,18,"tr",22),e.qZA()(),e.TgZ(19,"mat-paginator",23),e.NdJ("page",function(a){e.CHM(t);const d=e.oxw();return e.KtG(d.onPaginationChange(a))}),e.qZA()(),e.BQk()}if(2&o){const t=e.oxw();e.xp6(18),e.Q6J("ngForOf",t.downloadOrders),e.xp6(1),e.Q6J("length",t.paginationTotal)("pageSize",t.paginationPageSize)("pageIndex",0==(null==t.filter?null:t.filter.PageNumber)?0:(null==t.filter?null:t.filter.PageNumber)-1)}}function be(o,n){1&o&&(e.TgZ(0,"div",26),e._UZ(1,"app-empty-state"),e.qZA())}M.\u0275fac=function(n){return new(n||M)(e.Y36(m.O))},M.\u0275cmp=e.Xpm({type:M,selectors:[["app-exception-log"]],decls:8,vars:2,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"length","pageSize","pageIndex","page"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),e.YNc(5,Te,16,2,"ng-container",4),e.YNc(6,Ze,2,0,"ng-template",null,5,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(7);e.xp6(5),e.Q6J("ngIf",t.exceptions.length>0)("ngIfElse",i)}},dependencies:[r.sg,r.O5,p.rH,u.p,T.NW,Z.s,r.uU]});class N{constructor(n){this.http=n,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(n=>{this.filter=n.Filter,this.channels=f.g.assignChannelLogo(n.Options.Channel),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(n=>{this.downloadOrders=n.Data,this.setChannelLogo(),this.paginationTotal=n.Total,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(n=>(n.logo=f.g.getChannelLogoByTypeId(n.TypeID),n))}onPaginationChange(n){this.filter.PageNumber=n.pageIndex+1,this.getDownloadOrders()}}N.\u0275fac=function(n){return new(n||N)(e.Y36(m.O))},N.\u0275cmp=e.Xpm({type:N,selectors:[["app-manual-order-log"]],decls:28,vars:10,consts:[["headerTitle","Download Order Log",3,"hideSearchBox","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[2,"width","25px",3,"src"],[1,"text-end"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return t.getDownloadOrders()}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(a){return t.filter.ChannelID=a}),e.YNc(7,Ce,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"From/To"),e.qZA(),e.TgZ(11,"datepicker",4),e.NdJ("dateChange",function(a){return t.filter.From=a}),e.qZA(),e.TgZ(12,"datepicker",5),e.NdJ("dateChange",function(a){return t.filter.To=a}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Number"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(a){return t.filter.PageNumber=a}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Page Size"),e.qZA(),e.TgZ(20,"input",7),e.NdJ("ngModelChange",function(a){return t.filter.RowCount=a}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,ye,20,4,"ng-container",11),e.YNc(26,be,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(27);e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("items",t.channels)("ngModel",t.filter.ChannelID),e.xp6(5),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.RowCount),e.xp6(5),e.Q6J("ngIf",(null==t.downloadOrders?null:t.downloadOrders.length)>0)("ngIfElse",i)}},dependencies:[r.sg,r.O5,s.Fj,s.wV,s.JJ,s.On,u.p,T.NW,h.w9,h.ir,A.Q,Z.s,r.JJ,r.uU]});var Ae=l(8505),qe=l(4782),xe=l(4004);class C{constructor(n){this.httpService=n}getExceptionDetail(n){return this.httpService.post("/api/Orders/GetDetailException",{ID:n}).pipe((0,xe.U)(i=>i?.hits[0]?._source))}}function Oe(o,n){if(1&o&&(e.TgZ(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),e._uU(6,"General"),e.qZA()(),e.TgZ(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),e._uU(12,"Date"),e.qZA(),e.TgZ(13,"div")(14,"span"),e._uU(15),e.ALo(16,"date"),e.qZA()()()(),e.TgZ(17,"div",9)(18,"div",10)(19,"label"),e._uU(20,"Number"),e.qZA(),e.TgZ(21,"div")(22,"span"),e._uU(23),e.qZA()()()(),e.TgZ(24,"div",9)(25,"div",10)(26,"label"),e._uU(27,"Type"),e.qZA(),e.TgZ(28,"div")(29,"span"),e._uU(30),e.qZA()()()(),e.TgZ(31,"div",9)(32,"div",10)(33,"label"),e._uU(34,"ShopID"),e.qZA(),e.TgZ(35,"div")(36,"span"),e._uU(37),e.qZA()()()()()()()()(),e.TgZ(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),e._uU(43,"Request"),e.qZA()(),e.TgZ(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),e._uU(48),e.ALo(49,"json"),e.qZA()()()()()(),e.TgZ(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),e._uU(54,"Exception"),e.qZA()(),e.TgZ(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),e._uU(59),e.qZA(),e.TgZ(60,"pre"),e._uU(61),e.qZA()()()()()()()()),2&o){const t=n.ngIf;e.xp6(15),e.Oqu(e.xi3(16,7,t["@timestamp"],"dd MMM yyyy HH:mm:ss")),e.xp6(8),e.Oqu(null==t||null==t.error?null:t.error.number),e.xp6(7),e.Oqu(null==t||null==t.error?null:t.error.Type),e.xp6(7),e.Oqu(null==t?null:t.shopId),e.xp6(11),e.Oqu(e.lcZ(49,10,null==t||null==t.error?null:t.error.requestJSON)),e.xp6(11),e.Oqu(null==t?null:t.message),e.xp6(2),e.Oqu(null==t||null==t.error?null:t.error.stackTrace)}}C.\u0275fac=function(n){return new(n||C)(e.LFG(m.O))},C.\u0275prov=e.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"});class I{constructor(n,t){this.activatedRoute=n,this.exceptionService=t,this.invoiceNumber=""}ngOnInit(){this.getExceptionDetail(this.activatedRoute.snapshot.queryParams?.ID)}getExceptionDetail(n){this.exceptionDetail$=this.exceptionService.getExceptionDetail(n).pipe((0,Ae.b)(t=>{this.invoiceNumber=t?.error?.number}),(0,qe.d)(1))}}I.\u0275fac=function(n){return new(n||I)(e.Y36(p.gz),e.Y36(C))},I.\u0275cmp=e.Xpm({type:I,selectors:[["app-exception-detail"]],decls:4,vars:4,consts:[["hideSearchBox","true","hideSearchDropdown","true",3,"headerTitle"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"content"),e.YNc(2,Oe,62,12,"div",1),e.ALo(3,"async"),e.qZA()()),2&n&&(e.Q6J("headerTitle","Order #"+t.invoiceNumber),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,2,t.exceptionDetail$)))},dependencies:[r.O5,u.p,r.Ov,r.Ts,r.uU]});const Le=[{path:"",component:b,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:q,canActivate:[c.a],data:{title:"Order Log"}},{path:"inventory",component:x,canActivate:[c.a],data:{title:"Inventory Log"}},{path:"rawlog",component:O,canActivate:[c.a],data:{title:"Raw Log"}},{path:"rawlog/detail",component:L,canActivate:[c.a],data:{title:"Raw Log Detail"}},{path:"inventory/detail",component:U,canActivate:[c.a],data:{title:"Inventory Details"}},{path:"order/detail",component:w,canActivate:[c.a],data:{title:"Order Details"}},{path:"exception",component:M,canActivate:[c.a],data:{title:"Exception Log"}},{path:"exception/detail",component:I,canActivate:[c.a],data:{title:"Exception Log Detail"}},{path:"order-log",component:N,canActivate:[c.a],data:{title:"order Log"}}]}];class v{}v.\u0275fac=function(n){return new(n||v)},v.\u0275mod=e.oAB({type:v}),v.\u0275inj=e.cJS({imports:[r.ez,p.Bz.forChild(Le)]});class y{}y.\u0275fac=function(n){return new(n||y)},y.\u0275mod=e.oAB({type:y}),y.\u0275inj=e.cJS({imports:[r.ez,s.u5,s.UX,v,p.Bz,u.R,le,T.TU,h.A0,D.Z,A.Q,Z.s]})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[369],{9369:(Y,x,a)=>{a.r(x),a.d(x,{LoginModule:()=>p});var _=a(6895),s=a(4006),t=a(4650),c=a(284),b=a(1318);class m{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code})}addChannelLazada(){this.http.post("/api/ChannelAdd/AddLazada",{Code:this.code}).subscribe(o=>{this.service.navigate(["/menu/channel"])})}}m.\u0275fac=function(e){return new(e||m)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Lazada"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return o.addChannelLazada()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.code))}});var v=a(1889),w=a(8703),Z=a(7185);class l{constructor(){}getBrowserName(){const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1||e.indexOf("edg")>-1:return"edge";case e.indexOf("opr")>-1:return"opera";case e.indexOf("chrome")>-1:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}}l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=t.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"});var M=a(501),C=a(4954);const O=["subdomainEl"];function y(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",18)(2,"div",19)(3,"form")(4,"div",20)(5,"h2",21),t._uU(6,"Sign in"),t.qZA(),t.TgZ(7,"div",22)(8,"div",23)(9,"div",24)(10,"span",25),t._UZ(11,"i",26),t.qZA(),t.TgZ(12,"input",27,28),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.subdomain=r)}),t.qZA()()(),t.TgZ(14,"select",29),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.domain=r)}),t.TgZ(15,"option",30),t._uU(16,".dealpos.co.id"),t.qZA(),t.TgZ(17,"option",31),t._uU(18,".dealpos.net"),t.qZA(),t.TgZ(19,"option",32),t._uU(20,".dealpos.com"),t.qZA()()()(),t.TgZ(21,"div",33)(22,"button",34),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onNextState())}),t._uU(23," Next "),t.qZA()()()()(),t.BQk()}if(2&n){const o=t.oxw();t.xp6(12),t.Q6J("ngModel",o.subdomain),t.xp6(2),t.Q6J("ngModel",o.domain)}}function A(n,e){1&n&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function T(n,e){if(1&n&&(t.TgZ(0,"div",58),t.YNc(1,A,2,0,"p",59),t.qZA()),2&n){t.oxw();const o=t.MAs(13);t.xp6(1),t.Q6J("ngIf",o.errors.required)}}const P=function(n,e){return{"fa-eye":n,"fa-eye-slash":e}};function k(n,e){if(1&n){const o=t.EpF();t.TgZ(0,"i",60),t.NdJ("click",function(){t.CHM(o);const r=t.oxw(2);return t.KtG(r.hideShowPassword())}),t.qZA()}if(2&n){const o=t.oxw(2);t.Q6J("ngClass",t.WLB(1,P,"eye-off"==o.passwordIcon,"eye"==o.passwordIcon))}}function U(n,e){1&n&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function S(n,e){if(1&n&&(t.TgZ(0,"div",58),t.YNc(1,U,2,0,"p",59),t.qZA()),2&n){t.oxw();const o=t.MAs(19);t.xp6(1),t.Q6J("ngIf",o.errors.required)}}function q(n,e){if(1&n){const o=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",35)(3,"h2",21),t._uU(4,"Sign in"),t.qZA(),t.TgZ(5,"div",36),t._uU(6," to "),t.TgZ(7,"h6",37),t._uU(8),t.qZA(),t.TgZ(9,"i",38),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onEditDomain())}),t.qZA()()(),t.TgZ(10,"form",39)(11,"div",40)(12,"input",41,42),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.username=r)}),t.qZA(),t.TgZ(14,"label",43),t._uU(15,"Username"),t.qZA(),t.YNc(16,T,2,1,"div",44),t.qZA(),t.TgZ(17,"div",45)(18,"input",46,47),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.password=r)}),t.qZA(),t.TgZ(20,"label",48),t._uU(21,"Password"),t.qZA(),t.YNc(22,k,1,4,"i",49),t.YNc(23,S,2,1,"div",44),t.qZA(),t.TgZ(24,"div",50)(25,"a",51),t._uU(26,"Forgot Password?"),t.qZA()(),t.TgZ(27,"div",52)(28,"button",53),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onLogin())}),t._uU(29," Log in "),t.qZA()(),t.TgZ(30,"div",54),t._UZ(31,"hr"),t.TgZ(32,"span",55),t._uU(33,"or"),t.qZA(),t._UZ(34,"hr"),t.qZA(),t.TgZ(35,"div")(36,"button",56),t.NdJ("click",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.onLoginByGoogle(r))}),t._UZ(37,"i",57),t._uU(38," Sign In with Google "),t.qZA()()()()()}if(2&n){const o=t.MAs(13),i=t.MAs(19),r=t.oxw();t.xp6(8),t.AsE(" (",r.subdomain,"",r.domain,") "),t.xp6(4),t.Q6J("ngModel",r.username),t.xp6(4),t.Q6J("ngIf",o.invalid&&(o.dirty||o.touched)),t.xp6(2),t.Q6J("type",r.passwordType)("ngModel",r.password),t.xp6(4),t.Q6J("ngIf",""!=r.password&&"edge"!=r.browser),t.xp6(1),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("href","https://"+r.subdomain+r.domain+"/ForgotPassword",t.LSH)}}class u{constructor(e,o,i,r,d,I){this._router=e,this.elementRef=o,this.toastr=i,this.checkBrowser=r,this.authService=d,this.ngxPermission=I,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="eye-off"}ngOnInit(){this.initLogin(),this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){const e=JSON.parse(localStorage.getItem("Authorization"));this.username=e?.username,this.subdomain=e?.Host?.split(".dealpos")[0];const o=e?.Host?.split(".dealpos")[1];this.domain=".co.id"==o?".dealpos.co.id":".net"==o?".dealpos.net":".dealpos.com",this.authService.isActiveToken()&&this._router.navigate(["menu"])}onNextState(){v.g.IsEmpty(this.subdomain)?this.toastr.warning("Account Domain is required","Warning"):(this.parseSubdomain(),this.loginState="FORM_AUTH")}parseSubdomain(){let e=this.subdomain.indexOf(".dealpos");-1!=e&&(this.subdomain=this.subdomain.substring(0,e))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){this.authService.login({Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password}).subscribe(o=>{this.onSuccessLogin(o)})}onLoginByGoogle(e){this.authService.loginWithGoogle(e,`${this.subdomain}${this.domain}`).subscribe(i=>{this.onSuccessLogin(i)})}onSuccessLogin(e){this.ngxPermission.hasPermission([w.G.dashboardView]).then(o=>{this._router.navigate(o?["menu/dashboard"]:e.Channel.length<1?["menu/channel"]:["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}}u.\u0275fac=function(e){return new(e||u)(t.Y36(c.F0),t.Y36(t.SBq),t.Y36(Z._W),t.Y36(l),t.Y36(M.e),t.Y36(C.YI))},u.\u0275cmp=t.Xpm({type:u,selectors:[["app-login"]],viewQuery:function(e,o){if(1&e&&t.Gf(O,5),2&e){let i;t.iGM(i=t.CRH())&&(o.subdomainEl=i.first)}},decls:30,vars:8,consts:[[1,"container"],[1,"row","mt-md-0","align-self-center"],[1,"col-12","col-md-7","text-center"],[1,"big-display","robotoslab","d-none","d-sm-block"],["ngSrc","https://res.cloudinary.com/pos/image/upload/v1657855612/Apps/Login/Omnichannel.png","alt","integration-image",1,"img-fluid",3,"width","height"],[1,"col-12","col-md-5","order-first","order-md-last","mt-12"],[1,"big-display","text-center","my-5","py-5","robotoslab","d-block","d-sm-none"],[4,"ngIf","ngIfElse"],["USR_PASS",""],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-8","me-3"],["target","_blank","href","https://www.dealpos.com"],["ngSrc","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid",3,"width","height"],["target","_blank","href","https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete",1,"pt-8","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"card"],[1,"card-body","p-8"],[1,"card-title"],[1,"fw-normal","font-xl","robotoslab"],[1,"d-flex","align-items-center","mt-6"],[1,"mt-7","w-75","rounded-end-0"],[1,"input-group","mb-3"],["id","basic-addon1",1,"input-group-text","border-end-0","rounded-start"],[1,"fa-solid","fa-cloud"],["type","text","required","","name","subdomain","id","inputHost","placeholder","Store Address",1,"form-control","text-start","subdomain-input","border-start-0",2,"padding-left","0px",3,"ngModel","ngModelChange"],["subdomainEl",""],["name","domainOption",1,"form-select","form-control","border-start-0","mt-4","rounded-end","rounded-start-0","domain-option",3,"ngModel","ngModelChange"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],[1,"w-100","mt-10"],["name","next","data-cy","next","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"card-title","d-flex","align-items-center"],[1,"pt-2","ms-2"],[1,"fw-bold","me-2","robotoslab","d-inline-block","text-primary"],[1,"fa-solid","fa-edit","link-primary","fs-5","pointer",3,"click"],[1,"mt-10"],[1,"form-label-group"],["autofocus","","type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["usernameCtrl","ngModel"],["for","inputUsername",1,"text-start"],["class","text-danger",4,"ngIf"],[1,"form-label-group","mb-5","mb-sm-1"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passwordCtrl","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"text-end","mt-3"],[3,"href"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-primary","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4," DealPOS Omnichannel "),t.qZA(),t._UZ(5,"img",4),t.qZA(),t.TgZ(6,"div",5)(7,"h1",6),t._uU(8," DealPOS Omnichannel "),t.qZA(),t.YNc(9,y,24,2,"ng-container",7),t.YNc(10,q,39,9,"ng-template",null,8,t.W1O),t.qZA(),t.TgZ(12,"div",9)(13,"p",10),t._uU(14,"Powered by :"),t.qZA(),t.TgZ(15,"a",11),t._UZ(16,"img",12),t.qZA(),t._UZ(17,"br"),t.TgZ(18,"a",13),t._uU(19,"Version 2.9.0"),t.qZA()()()(),t.TgZ(20,"footer",14)(21,"div",15)(22,"div",16)(23,"p",10),t._uU(24,"Powered by :"),t.qZA(),t.TgZ(25,"a",11),t._UZ(26,"img",12),t.qZA()(),t.TgZ(27,"div",17)(28,"a",13),t._uU(29,"Version 2.9.0"),t.qZA()()()()),2&e){const i=t.MAs(11);t.xp6(5),t.Q6J("width",500)("height",273),t.xp6(4),t.Q6J("ngIf","FORM_DOMAIN"==o.loginState)("ngIfElse",i),t.xp6(7),t.Q6J("width",130)("height",73),t.xp6(10),t.Q6J("width",130)("height",73)}},dependencies:[_.mk,_.O5,s._Y,s.YN,s.Kr,s.Fj,s.EJ,s.JJ,s.JL,s.Q7,s.On,s.F,_.Zd],styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}"]});class h{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.shopID=e.shop_id,this.code=e.code})}addShopee(){let e={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",e).subscribe(i=>{this.service.navigate(["/menu/channel"])})}}h.\u0275fac=function(e){return new(e||h)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},h.\u0275cmp=t.Xpm({type:h,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-t",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Shopee"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your shopID is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return o.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.shopID))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});class f{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code,this.state=e.state})}addChannelTiktok(){this.http.post("/api/ChannelAdd/AddTiktok",{Code:this.code}).subscribe(o=>{this.service.navigate(["/menu/channel"])})}}f.\u0275fac=function(e){return new(e||f)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Tiktok"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"div"),t._uU(18," Your State is "),t.TgZ(19,"span",8),t._uU(20),t.qZA()(),t.TgZ(21,"button",9),t.NdJ("click",function(){return o.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.code),t.xp6(4),t.Oqu(o.state))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});const L=[{path:"",component:u,data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:h,data:{title:"Success"}},{path:"tiktok",component:f,data:{title:"Success"}},{path:"lazada",component:m,data:{title:"Success"}}];class g{}g.\u0275fac=function(e){return new(e||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[c.Bz.forChild(L),c.Bz]});var z=a(8796);class p{}p.\u0275fac=function(e){return new(e||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({imports:[_.ez,s.u5,g,z.A0,C.VI]})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[379],{2379:(te,B,d)=>{d.r(B),d.d(B,{OrdersModule:()=>U});var u=d(6895),f=d(284),k=d(8703),e=d(4650),j=d(2937);class C{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[k.G.downloadOrder]}]}ngOnInit(){}}C.\u0275fac=function(n){return new(n||C)},C.\u0275cmp=e.Xpm({type:C,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],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)("usePermissions",!0))},dependencies:[j.e,f.lC]});var _=d(1889),l=d(4782),s=d(8505),r=d(9694),p=d(9568),h=d(2428),m=d(5412),g=d(4006),W=d(6709);class J{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}J.\u0275fac=function(n){return new(n||J)(e.Y36(m.so))},J.\u0275cmp=e.Xpm({type:J,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:[g.JJ,g.On,W.oG,m.uh,m.xY,m.H8]});var X=d(4004),ne=d(9300),ae=d(3900),S=d(1318),V=d(7185);class I{constructor(){}convertToCSV(n,t){let i;if("string"==typeof n)i=n;else{var o="object"==typeof n?n:JSON.parse(n);i=this.transformToCSVStringFormat(o)}this.downloadCSV(i,t)}transformToCSVStringFormat(n){if(!n||!n.length)return;const i=Object.keys(n[0]);return n.map(c=>i.map(x=>{let b=null==c[x]?"":c[x];return b=b instanceof Date?b.toLocaleString():b.toString().replace(/"/g,'""'),b.search(/("|,|\n)/g)>=0&&(b=`"${b}"`),b}).join(",")).join("\n")}downloadCSV(n,t){var i=new Blob([n],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(i)),o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}}I.\u0275fac=function(n){return new(n||I)},I.\u0275prov=e.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"});class Z{constructor(n,t,i,o){this.http=n,this.dialog=t,this.toastr=i,this.exportService=o}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(n){return this.http.post("/api/orders/GetNewOrder",n).pipe((0,X.U)(t=>t.Data))}getTotalNewOrders(n){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:n}).pipe((0,X.U)(i=>i.Count))}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(J).afterClosed().pipe((0,ne.h)(i=>void 0!==i),(0,ae.w)(i=>(t.Printed=i,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(i=>{const o=window.open("about:blank","_blank");o.document.write(i),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 c=Uint8Array.from(atob(o),b=>b.charCodeAt(0)),x=new Blob([c],{type:"octet/stream"});_.g.openDownloadFile(x,`${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")})}exportOrders(n,t){return this.http.post("api/Orders/ExportOrder",n).pipe((0,s.b)(i=>{this.exportService.convertToCSV(i,t)}))}}Z.\u0275fac=function(n){return new(n||Z)(e.LFG(S.O),e.LFG(m.uw),e.LFG(V._W),e.LFG(I))},Z.\u0275prov=e.Yz7({token:Z,factory:Z.\u0275fac});class y{constructor(n,t){this.http=n,this.toastr=t}acceptTokopediaOrders(n){return this.http.post("/api/Orders/AcceptOrderTokopedia",n).pipe((0,s.b)(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(n){const t=n.filter(o=>0==o.Status),i=n.filter(o=>1==o.Status);if(0==t.length&&i.length>0){let o=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(o,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let o=`<ol>\n ${this.generateSuccessMessage(i)}\n ${this.generateErrorMessage(t)}\n </ol>`;this.toastr.warning(o,"Warning",{enableHtml:!0})}else{let o=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> ${i.Message}</li>`}),t}}y.\u0275fac=function(n){return new(n||y)(e.LFG(S.O),e.LFG(V._W))},y.\u0275prov=e.Yz7({token:y,factory:y.\u0275fac});var D=d(7481),N=d(2594);class v{constructor(){}set typeId(n){this.channelLogo=_.g.getChannelLogoByTypeId(n),this.initChannelName(n)}initChannelName(n){switch(n){case r.x.Tokopedia:this.channelName="Tokopedia";break;case r.x.Tiktok:this.channelName="Tiktok";break;case r.x.WooCommerce:this.channelName="WooCommerce";break;case r.x.ShopeeV2:this.channelName="Shopee";break;case r.x.Lazada:this.channelName="Lazada";break;case r.x.KalCare:this.channelName="Kalcare"}}}v.\u0275fac=function(n){return new(n||v)},v.\u0275cmp=e.Xpm({type:v,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-3","fw-normal"]],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))}});var q=d(9549),A=d(4385),P=d(3238);function ie(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",20),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,c=e.oxw();return e.KtG(c.onAcceptOrder(o))}),e._UZ(2,"i",21),e._uU(3," Accept "),e.qZA(),e.BQk()}}function oe(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ie,4,0,"ng-container",1),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.isTokopediaAvailable&&t.isTokopediaSelected)}}function re(a,n){if(1&a&&(e.TgZ(0,"mat-option",22),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",23),e._UZ(2,"img",24),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}function le(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"th",25)(2,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.isCheckAll=o)})("ngModelChange",function(){const c=e.CHM(t).ngIf,x=e.oxw();return e.KtG(x.onSelectAllOrderData(c))}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.isCheckAll)}}function se(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw(2).$implicit;return e.KtG(c.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2).ngForOf,c=e.oxw();return e.KtG(c.onSelectOrderData(o))}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}function pe(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,se,2,1,"ng-container",1),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.xp6(2),e.Q6J("ngIf",t.Type==i.tokopediaType)}}function ce(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.Number)}}function de(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ue(a,n){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,pe,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,ce,3,1,"ng-container",27),e.YNc(6,de,2,2,"ng-template",null,28,e.W1O),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td"),e._UZ(14,"app-channel-logo",29),e.qZA()()),2&a){const t=n.$implicit,i=e.MAs(7),o=e.oxw();e.xp6(1),e.Q6J("ngIf",o.isTokopediaAvailable),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",t.ID==o.guidEmpty)("ngIfElse",i),e.xp6(4),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.Type)}}class L{constructor(n,t,i,o,c){this.localDataService=n,this.channelService=t,this.orderService=i,this.toastr=o,this.acceptOrderService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=_.g.GuidEMpty,this.tokopediaType=r.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.newOrdersData$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).pipe((0,l.d)(),(0,s.b)(t=>{t.filter(o=>o.Type==r.x.Tokopedia)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID).pipe((0,l.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(n){this.isTokopediaSelected=!1,n.filter(i=>i.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(n){n=n.map(t=>(t.Type==r.x.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(n)}onAcceptOrder(n){let t=this.getSelectedTokopediaOrders(n);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(i=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(n){return n.filter(i=>i.selected).map(i=>i.Number)}}function he(a,n){if(1&a&&(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&a){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 ge(a,n){if(1&a&&(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,he,9,7,"tr",16),e.qZA()()()()()),2&a){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)}}L.\u0275fac=function(n){return new(n||L)(e.Y36(p.T),e.Y36(h.T),e.Y36(Z),e.Y36(V._W),e.Y36(y))},L.\u0275cmp=e.Xpm({type:L,selectors:[["app-new-order"]],decls:46,vars:21,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["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"],[2,"width","120px"],[2,"width","220px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngIf","ngIfElse"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return t.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,oe,2,1,"ng-container",1),e.ALo(3,"async"),e.qZA(),e.TgZ(4,"filters")(5,"div",2)(6,"div")(7,"h6"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"mat-form-field",3)(10,"mat-select",4),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(11,re,5,5,"mat-option",5),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",7),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",8)(22,"div",9)(23,"div",10)(24,"div",11)(25,"table",12)(26,"thead",13)(27,"tr",14),e.YNc(28,le,3,1,"ng-container",1),e.ALo(29,"async"),e.TgZ(30,"th",15),e._uU(31,"Outlet"),e.qZA(),e.TgZ(32,"th",16),e._uU(33,"Order number"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Customer"),e.qZA(),e.TgZ(36,"th",17),e._uU(37,"Created On"),e.qZA(),e.TgZ(38,"th",17),e._uU(39,"Channel"),e.qZA()()(),e.TgZ(40,"tbody"),e.YNc(41,ue,15,10,"tr",18),e.ALo(42,"async"),e.qZA()(),e.TgZ(43,"app-mat-paginator-no-count",19),e.NdJ("total",function(){return t.getPaginatonTotal()})("next",function(){return t.onNextPage()})("previous",function(){return t.onPreviousPage()}),e.ALo(44,"async"),e.ALo(45,"async"),e.qZA()()()()()()()),2&n){let i;e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,11,t.newOrdersData$)),e.xp6(8),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(9),e.Q6J("ngIf",t.isTokopediaAvailable&&e.lcZ(29,13,t.newOrdersData$)),e.xp6(13),e.Q6J("ngForOf",e.lcZ(42,15,t.newOrdersData$)),e.xp6(2),e.Q6J("filter",t.filter)("totaldata",null==(i=e.lcZ(44,17,t.newOrdersData$))?null:i.length)("paginationTotal",e.lcZ(45,19,t.paginationTotal$))}},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.Wl,g.JJ,g.On,D.p,N.n,v,q.KE,A.gD,P.ey,u.Ov,u.uU]});const me=function(){return["/menu/Order"]};class Q{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})}}function _e(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}Q.\u0275fac=function(n){return new(n||Q)(e.Y36(S.O),e.Y36(f.gz))},Q.\u0275cmp=e.Xpm({type:Q,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,ge,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,me)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[u.sg,u.O5,D.p,f.rH,u.JJ,u.uU]});const fe=function(){return["/menu/Order/detail"]},Te=function(a,n){return{Number:a,Outlet:n}};function Ce(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,fe))("queryParams",e.WLB(4,Te,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ze(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ve(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw();return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function be(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ce,2,7,"a",24),e.YNc(5,Ze,2,2,"a",25),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",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,ve,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.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==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}class F{constructor(n,t,i,o,c){this.http=n,this.localDataService=t,this.dialog=i,this.orderService=o,this.channelService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}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.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID}).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()}}function Se(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}F.\u0275fac=function(n){return new(n||F)(e.Y36(S.O),e.Y36(p.T),e.Y36(m.uw),e.Y36(Z),e.Y36(h.T))},F.\u0275cmp=e.Xpm({type:F,selectors:[["app-ready-to-ship"]],decls:41,vars:8,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["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"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[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,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,_e,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA(),e._UZ(37,"th",18),e.qZA()(),e.TgZ(38,"tbody"),e.YNc(39,be,18,13,"tr",19),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),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,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});const De=function(){return["/menu/Order/detail"]},xe=function(a,n){return{Number:a,Outlet:n}};function we(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,De))("queryParams",e.WLB(4,xe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function ye(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ne(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw();return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ae(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,we,2,7,"a",24),e.YNc(5,ye,2,2,"a",25),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",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Ne,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.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==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}class Y{constructor(n,t,i,o){this.http=n,this.localDataService=t,this.orderService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.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",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.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()}}Y.\u0275fac=function(n){return new(n||Y)(e.Y36(S.O),e.Y36(p.T),e.Y36(Z),e.Y36(h.T))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-shipped"]],decls:41,vars:8,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["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"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[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,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Se,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA(),e._UZ(37,"th",18),e.qZA()(),e.TgZ(38,"tbody"),e.YNc(39,Ae,18,13,"tr",19),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),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,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});var Pe=d(501);function Oe(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}const Ie=function(){return["/menu/Order/detail"]},qe=function(a,n){return{Number:a,Outlet:n}};function Me(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Ie))("queryParams",e.WLB(4,qe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ue(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ke(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw();return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Je(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Me,2,7,"a",24),e.YNc(5,Ue,2,2,"a",25),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",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,ke,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.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==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok)}}class E{constructor(n,t,i,o){this.http=n,this.orderService=t,this.authService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.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",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.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()}}function Le(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}E.\u0275fac=function(n){return new(n||E)(e.Y36(S.O),e.Y36(Z),e.Y36(Pe.e),e.Y36(h.T))},E.\u0275cmp=e.Xpm({type:E,selectors:[["app-delivered"]],decls:41,vars:9,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["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"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[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,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Oe,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA(),e._UZ(37,"th",18),e.qZA()(),e.TgZ(38,"tbody"),e.YNc(39,Je,18,13,"tr",19),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",20),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(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),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,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});const Qe=function(){return["/menu/Order/detail"]},Fe=function(a,n){return{Number:a,Outlet:n}};function Ye(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Qe))("queryParams",e.WLB(4,Fe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ee(a,n){if(1&a&&(e.TgZ(0,"a",28),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ge(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ye,2,7,"a",24),e.YNc(5,Ee,2,2,"a",25),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(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",26),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.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.Oqu(t.State),e.xp6(2),e.Q6J("typeId",t.TypeID)}}class G{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},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.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter=n,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID}).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()}}function Re(a,n){if(1&a&&(e.TgZ(0,"mat-option",20),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",21),e._UZ(2,"img",22),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}G.\u0275fac=function(n){return new(n||G)(e.Y36(S.O),e.Y36(p.T),e.Y36(h.T))},G.\u0275cmp=e.Xpm({type:G,selectors:[["app-all-order"]],decls:42,vars:8,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["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"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","135px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[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,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Le,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",18),e._uU(36,"Status"),e.qZA(),e.TgZ(37,"th",17),e._uU(38,"Channel"),e.qZA()()(),e.TgZ(39,"tbody"),e.YNc(40,Ge,18,13,"tr",19),e.qZA()(),e.TgZ(41,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(24),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});const $e=function(){return["/menu/Order/detail"]},ze=function(a,n){return{Number:a,Outlet:n}};function He(a,n){if(1&a&&(e.TgZ(0,"a",26),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,$e))("queryParams",e.WLB(4,ze,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Be(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function je(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,He,2,7,"a",23),e.YNc(5,Be,2,2,"a",24),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",25),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.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.Q6J("typeId",t.TypeID)}}class R{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},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.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.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,ListChannelID:this.filter.ListChannelID}).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()}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}}R.\u0275fac=function(n){return new(n||R)(e.Y36(S.O),e.Y36(p.T),e.Y36(h.T))},R.\u0275cmp=e.Xpm({type:R,selectors:[["app-cancelled"]],decls:40,vars:8,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["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"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[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,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Re,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA()()(),e.TgZ(37,"tbody"),e.YNc(38,je,16,12,"tr",18),e.qZA()(),e.TgZ(39,"app-mat-paginator-no-count",19),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),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,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});var Ve=d(2138),O=(()=>{return(a=O||(O={}))[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",O;var a})(),Ke=d(6082),K=d(8796),$=d(9602),z=d(8425),ee=d(266);function We(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(t),e.oxw();const o=e.MAs(11);return e.KtG(o.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(5," Next "),e.qZA(),e.TgZ(6,"button",31),e._UZ(7,"b",32),e.qZA(),e.TgZ(8,"ul",33)(9,"li",34)(10,"a",35),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(4),e.Q6J("disabled",t.checkDisabledNextFilter())}}function Xe(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(1," Next "),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function et(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNew(c))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function tt(a,n){1&a&&e._uU(0,"Filter")}function nt(a,n){if(1&a&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&a){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 at(a,n){1&a&&e._uU(0,"Preview")}function it(a,n){if(1&a&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function ot(a,n){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function rt(a,n){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function lt(a,n){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function st(a,n){if(1&a&&(e.TgZ(0,"ul",63),e.YNc(1,lt,2,1,"li",59),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function pt(a,n){if(1&a&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const ct=function(a,n){return{"over-due-today":a,"over-due":n}};function dt(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,ot,3,4,"td",1),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",60)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,rt,2,1,"span",1),e.YNc(16,st,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,pt,2,2,"span",62),e.qZA()()),2&a){const t=n.$implicit,i=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(i+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(12,ct,(null==t?null:t.Action)==o.actionPreviewOrder.Update,(null==t?null:t.Action)==o.actionPreviewOrder.New))("matTooltip",91==t.POSStatus||"Conflict"==t.POSStatusDescription?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),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 ut(a,n){if(1&a&&(e.ynx(0),e.YNc(1,dt,19,15,"tr",59),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function ht(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function gt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),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",45)(8,"button",47),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",45)(11,"button",48),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",45)(14,"button",49),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",50)(17,"thead",51)(18,"tr"),e._UZ(19,"th",52),e.TgZ(20,"th",53),e._uU(21,"Number"),e.qZA(),e.YNc(22,it,2,1,"th",54),e.TgZ(23,"th",55),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",55),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",52),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,ut,2,1,"ng-container",56),e.YNc(32,ht,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&a){const t=e.MAs(33),i=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==i.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",i.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==i.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",i.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==i.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",i.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==i.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",i.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",i.displayedPreviewData.length>0)("ngIfElse",t)}}function mt(a,n){1&a&&e._uU(0,"Finish")}const _t=function(a){return{"over-due":a}};function ft(a,n){if(1&a&&(e.TgZ(0,"tr",73)(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&a){const t=n.$implicit,i=n.index;e.Q6J("ngClass",e.VKq(5,_t,t.Exception)),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function Tt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ft,9,7,"tr",72),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function Ct(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Zt(a,n){if(1&a&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),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,Tt,2,1,"ng-container",56),e.YNc(14,Ct,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&a){const t=e.MAs(15),i=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==i.downloadData?null:i.downloadData.length)>0)("ngIfElse",t)}}function vt(a,n){1&a&&e._UZ(0,"i",74)}function bt(a,n){1&a&&e._UZ(0,"i",75)}function St(a,n){1&a&&e._UZ(0,"i",76)}var T=(()=>{return(a=T||(T={})).ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",T;var a})();class H{constructor(n,t,i,o,c,x){this.http=n,this.toastr=t,this.datePipe=i,this.url=o,this.productService=c,this.orderService=x,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=r.x,this.previewStatus=T,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=O}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(i=>{this.downloadData=i.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(i=>{0!=i.length?(this.previewData=i,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){this.pageTitle=`\n ${n} (${this.getDateTitle()})\n `}getDateTitle(){const n=_.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,n);return`${null==n?"":t+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}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(i=>i.Action==O.DoNothing);break;case T.WRONG:t=this.previewData.filter(i=>i.Action==O.Update);break;case T.UNSYNC:t=this.previewData.filter(i=>i.Action==O.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}exportOrders(){let n={ID:this.channelID,From:this.startDate,To:this.endDate};const t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(n,t).subscribe()}}H.\u0275fac=function(n){return new(n||H)(e.Y36(S.O),e.Y36(V._W),e.Y36(u.uU),e.Y36(f.gz),e.Y36(Ke.M),e.Y36(Z))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-download"]],features:[e._Bn([{provide:Ve.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"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-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"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"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["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"],[3,"ngClass"],[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 i=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,We,12,1,"ng-container",1),e.YNc(3,Xe,2,1,"button",2),e.YNc(4,et,3,0,"button",3),e.qZA(),e.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),e.NdJ("selectionChange",function(c){return t.stepChange(c)})("selectionChange",function(c){return t.onStepperChange(c)}),e.TgZ(12,"mat-step",10),e.YNc(13,tt,1,0,"ng-template",11),e.TgZ(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",14),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",13)(23,"ng-select",15),e.NdJ("ngModelChange",function(c){return t.channelID=c}),e.YNc(24,nt,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(c){return t.startDate=c})("click",function(){e.CHM(i);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(c){return t.endDate=c})("click",function(){e.CHM(i);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,at,1,0,"ng-template",11),e.YNc(40,gt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,mt,1,0,"ng-template",11),e.YNc(43,Zt,16,2,"div",23),e.qZA(),e.YNc(44,vt,1,0,"ng-template",25),e.YNc(45,bt,1,0,"ng-template",26),e.YNc(46,St,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&n){const i=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","filter"==t.currentState),e.xp6(1),e.Q6J("ngIf","finish"==t.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+i.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,g.Fj,g.JJ,g.On,D.p,K.w9,K.jq,$.wx,$.zY,$.By,$._g,z.C0,z.VY,z.Vq,z.z9,ee.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 w=d(8063);const Dt=[{path:"",component:C,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:L,canActivate:[w.a],data:{title:"New Order"}},{path:"detail",component:Q,canActivate:[w.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:F,canActivate:[w.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:Y,canActivate:[w.a],data:{title:"Shipped"}},{path:"Delivered",component:E,canActivate:[w.a],data:{title:"Delivered"}},{path:"All",component:G,canActivate:[w.a],data:{title:"All Order"}},{path:"Cancelled",component:R,canActivate:[w.a],data:{title:"Cancelled"}},{path:"Download",component:H,canActivate:[w.a],data:{title:"Download"}}]}];class M{}M.\u0275fac=function(n){return new(n||M)},M.\u0275mod=e.oAB({type:M}),M.\u0275inj=e.cJS({imports:[u.ez,f.Bz.forChild(Dt)]});var xt=d(8739),wt=d(1108);class U{}U.\u0275fac=function(n){return new(n||U)},U.\u0275mod=e.oAB({type:U}),U.\u0275inj=e.cJS({providers:[Z,y],imports:[u.ez,g.u5,M,j.Z,D.R,xt.TU,f.Bz,K.A0,$.FA,P.XK,N.n,z.T5,ee.AV,wt.f,W.p9,m.Is,A.LD]})},6082:(te,B,d)=>{d.d(B,{M:()=>C});var u=d(8505),f=d(1889),k=d(4650),e=d(1318),j=d(7185);class C{constructor(l,s){this.httpService=l,this.toastrService=s}loader(l=f.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:l})}LoadInPOS(l=f.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{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(h=>{r=[...r,...h.Channel]}),r&&0!=r.length){let h=[];p=s.filter(m=>(h=r.filter(g=>g.ChannelID==m.ID),h.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 h of p.Channel)0==r.filter(m=>m.ChannelID==h.ChannelID).length&&r.push(h);return this.sortChannel(r)}successToastrScanAllProduct(l,s,r){if(r){const p=l?.NotInPOS?.Product?l?.NotInPOS?.Product:0,h=l?.InChannel?.Product?l?.InChannel?.Product:0;this.toastrService.success(`\n ${p+h} found in ${s.Name} </br>\n (${h} 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(h=>{s=[...s,`<li>Product ${h} was <b>successfully</b> uploaded to ${p.Name}</li>`]}),p?.Response.Fail.forEach(h=>{r=[...r,`<li>${h}</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(m=>0==m.Status),p=l.filter(m=>1==m.Status),h=this.generateToastrMessage(r,p,s);this.toastrService.success(h.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(l,s){let r=l?.error?.Message.filter(m=>0==m.Status),p=l?.error?.Message.filter(m=>1==m.Status),h=this.generateToastrMessage(r,p,s);"WARNING"==h.status?this.toastrService.warning(h.message,"Warning!",{enableHtml:!0}):this.toastrService.error(h.message,`Error - ${l.status}`,{enableHtml:!0})}generateToastrMessage(l,s,r){let h,p="";return 0==l.length&&s.length>0?(h="SUCCESS",p=this.createSuccessResponse(s,r)):l.length>0&&0==s.length?(h="ERROR",p=this.createErrResponse(l,r)):(h="WARNING",p=`${this.createSuccessResponse(s,r)} ${this.createErrResponse(l,r)}`),p=`<ol>${p}</ol>`,{status:h,message:p}}createErrResponse(l,s){let r="";return l.forEach((p,h)=>{r+=`<li><b>${p.Response}</b> for ${s.Name} in ${p.Name}</li>`}),r}createSuccessResponse(l,s){let r="";return l.forEach((p,h)=>{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}}C.\u0275fac=function(l){return new(l||C)(k.LFG(e.O),k.LFG(j._W))},C.\u0275prov=k.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"})}}]);