marketplacepos 2.3.8 → 2.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[327],{7398:(L,O,c)=>{c.d(O,{Z:()=>y,e:()=>t});var u=c(6895),g=c(8252),m=c(4650);function l(P,p){if(1&P&&(m.TgZ(0,"li",2)(1,"a",3),m._uU(2),m.qZA()()),2&P){const s=p.$implicit;m.xp6(1),m.s9C("routerLink",s.Url),m.xp6(1),m.hij(" ",s.Title," ")}}let t=(()=>{class P{}return P.\u0275fac=function(s){return new(s||P)},P.\u0275cmp=m.Xpm({type:P,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs"},decls:2,vars:1,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink"]],template:function(s,_){1&s&&(m.TgZ(0,"ul",0),m.YNc(1,l,3,2,"li",1),m.qZA()),2&s&&(m.xp6(1),m.Q6J("ngForOf",_.Tabs))},dependencies:[u.sg,g.yS,g.Od]}),P})(),y=(()=>{class P{}return P.\u0275fac=function(s){return new(s||P)},P.\u0275mod=m.oAB({type:P}),P.\u0275inj=m.cJS({imports:[u.ez,g.Bz]}),P})()},5327:(L,O,c)=>{c.r(O),c.d(O,{ProductModule:()=>Xt});var u=c(6895),g=c(7398),m=c(4006),l=c(8252),t=c(4650);let y=(()=>{class o{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/sold-in-channel"},{Title:"Not in Channel",Url:"/menu/products/not-in-channel"},{Title:"Not in POS",Url:"/menu/products/not-in-pos"},{Title:"In POS",Url:"/menu/products/in-pos"},{Title:"Duplicate SKU",Url:"/menu/products/duplicate-sku"}]}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-products"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,e){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()()(),t._UZ(4,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",e.productTabs))},dependencies:[g.e,l.lC],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}"]}),o})();class P{}var p=c(5241),s=c(5412),_=c(3841);let S=(()=>{class o{constructor(n){this.LocalData=n}GetCategories(n,e,a){return new Promise(r=>{this.LocalData.getListByKey(n).then(d=>{null!=d?r(d):this.getCategoriesByTypeID(n,e,a).then(b=>{r(b)})})})}getCategoriesByTypeID(n,e,a){return new Promise(r=>{a.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:e}).subscribe(b=>{this.LocalData.saveList(b,n),r(b)})})}}return o.\u0275fac=function(n){return new(n||o)(t.LFG(_.F))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Z=c(1318),J=c(8966);function B(o,i){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"h5",4),t._uU(2,"Category"),t.qZA(),t.TgZ(3,"app-select-search",10),t.NdJ("onSelect",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onSelectCategory(a))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.Q6J("appearance","outline")("batchSize",30)("data",n.options)("bindLabel","Value")("bindValue","Key")("placeholder","Select Category")}}let x=(()=>{class o{constructor(n,e,a,r){this.data=n,this.channelCategoriesService=e,this.http=a,this.dialogRef=r,this.item=n.item,this.selectItemMissingChannel=n.selectedItemMissingChannel,this.options=[],this.optionVisible=!1}onSelectItem(n){this.selectedChannelID=n;let e=this.selectItemMissingChannel.find(a=>a.ID==n);!e||1!==e.TypeID&&6!==e.TypeID&&7!==e.TypeID?this.optionVisible=!1:this.channelCategoriesService.GetCategories(e.TypeID,e.ID,this.http).then(a=>{this.options=a,this.optionVisible=!0}).catch(a=>{console.error(a)})}onSelectCategory(n){this.selectedCategoryID=n}onClose(){this.dialogRef.close()}onSave(){this.selectedChannelID&&(this.selectedCategoryID||!this.optionVisible)&&this.dialogRef.close({channelID:this.selectedChannelID,categoryID:this.selectedCategoryID})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI),t.Y36(S),t.Y36(Z.O),t.Y36(s.so))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-uploadProductDialog"]],decls:16,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"row"],[1,"col-12"],[1,"mb-3","fw-normal"],[3,"appearance","data","bindLabel","bindValue","placeholder","onSelect"],[4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"appearance","batchSize","data","bindLabel","bindValue","placeholder","onSelect"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"div",2)(4,"div",3)(5,"h5",4),t._uU(6,"Channel :"),t.qZA(),t.TgZ(7,"app-select-search",5),t.NdJ("onSelect",function(r){return e.onSelectItem(r)}),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",3),t.YNc(10,B,4,6,"ng-container",6),t.qZA()()(),t.TgZ(11,"mat-dialog-actions",7)(12,"button",8),t.NdJ("click",function(){return e.onClose()}),t._uU(13,"Cancel"),t.qZA(),t.TgZ(14,"button",9),t.NdJ("click",function(){return e.onSave()}),t._uU(15,"Upload"),t.qZA()()),2&n&&(t.xp6(1),t.hij("Upload ",null==e.item?null:e.item.Name,""),t.xp6(6),t.Q6J("appearance","outline")("data",e.selectItemMissingChannel)("bindLabel","Name")("bindValue","ID")("placeholder","Choose "),t.xp6(3),t.Q6J("ngIf",e.optionVisible))},dependencies:[u.O5,s.uh,s.xY,s.H8,J.h],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();function N(o,i){if(1&o&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",9),t._uU(3),t.qZA(),t.TgZ(4,"td",9),t._uU(5),t.qZA(),t.TgZ(6,"td",10)(7,"p",11),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&o){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function f(o,i){if(1&o&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function h(o,i){if(1&o&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function D(o,i){1&o&&t._UZ(0,"img",18)}function U(o,i){1&o&&t._UZ(0,"img",19)}function Y(o,i){1&o&&t._UZ(0,"img",20)}function T(o,i){1&o&&t._UZ(0,"img",21)}function A(o,i){if(1&o&&(t.TgZ(0,"tr")(1,"td",9),t._uU(2),t.qZA(),t.YNc(3,f,2,2,"td",12),t.YNc(4,h,2,2,"td",12),t.TgZ(5,"td",9),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",9),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",9)(12,"a",13),t.YNc(13,D,1,0,"img",14),t.YNc(14,U,1,0,"img",15),t.YNc(15,Y,1,0,"img",16),t.YNc(16,T,1,0,"img",17),t.qZA()()()),2&o){const n=i.$implicit,e=i.index;t.xp6(2),t.Oqu(n.Name),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(2),t.Oqu(t.lcZ(7,11,n.Price)),t.xp6(3),t.Oqu(t.lcZ(10,13,n.Inventory)),t.xp6(3),t.s9C("href",n.Url,t.LSH),t.s9C("title",n.Title),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}function C(o,i){if(1&o&&t.YNc(0,A,17,15,"tr",6),2&o){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function I(o,i){if(1&o&&(t.ynx(0),t.YNc(1,N,9,2,"ng-container",7),t.YNc(2,C,1,1,"ng-template",null,8,t.W1O),t.BQk()),2&o){const n=i.$implicit,e=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",e)}}let k=(()=>{class o{constructor(n){this.data=n,this.variants=n.variants,this.title=n.title}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variant"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"sticky-top"],[1,"text-center","sticky-top"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-center"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-center",4,"ngIf"],["target","_blank",3,"href","title"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr",4)(7,"th",5),t._uU(8,"PRODUCT"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"VARIANT"),t.qZA(),t.TgZ(11,"th",5),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",5),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",5),t._uU(16,"INVENTORY"),t.qZA(),t.TgZ(17,"th",5),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,I,4,2,"ng-container",6),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(e.title),t.xp6(19),t.Q6J("ngForOf",e.variants))},dependencies:[u.sg,u.O5,s.uh,s.xY,u.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important}"]}),o})();var v=(()=>{return(o=v||(v={})).SHOOPE="//res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",o.WOOCOMMERCE="//res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",o.TOKOPEDIA="//res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",o.TIKTOK="//res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",o.LAZADA="//res.cloudinary.com/pos/image/upload/w_30/v1641528003/icons/marketplace_icons/lazada.png",v;var o})(),w=c(9300),F=c(7185),M=c(7481),E=c(266);function H(o,i){if(1&o&&(t.ynx(0),t._UZ(1,"img",18),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("src",n.productImage,t.LSH)}}function j(o,i){1&o&&t._UZ(0,"img",19)}function W(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",20),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onEventDesc())}),t._UZ(1,"i",21),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.code)}}function z(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",20),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onEventDesc())}),t._UZ(1,"i",22),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.description)}}function X(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",23)(1,"input",24),t.NdJ("change",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onCheck(a.target.checked))}),t.qZA()()}}function tt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",25),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownload())}),t._UZ(1,"i",26),t._uU(2," Download "),t.qZA()}}function nt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",25),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUpload())}),t._UZ(1,"i",27),t._uU(2," Upload "),t.qZA()}}function et(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",28),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScan())}),t._UZ(1,"i",29),t._uU(2," Scan "),t.qZA()}}const ot=function(o){return{"me-3":o}};function at(o,i){if(1&o&&(t.ynx(0),t.TgZ(1,"a",31),t._UZ(2,"img",32),t.qZA(),t.BQk()),2&o){const n=i.$implicit,e=i.index,a=t.oxw(2);t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("ngClass",t.VKq(4,ot,e!=a.channels.length-1))("src",a.getChannelLogo(n),t.LSH)("matTooltip",n.Title?n.Title:n.Name)}}function it(o,i){if(1&o&&(t.ynx(0),t.YNc(1,at,3,6,"ng-container",30),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.channels)}}const lt=function(o){return{"border-bottom pb-2":o}};function rt(o,i){if(1&o&&(t.TgZ(0,"li")(1,"div",36)(2,"div",37)(3,"a",31),t._UZ(4,"img",38),t.TgZ(5,"span",39),t._uU(6),t.qZA()()()()()),2&o){const n=i.$implicit,e=i.index,a=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,lt,e!=a.channels.length-1)),t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("src",a.getChannelLogo(n),t.LSH),t.xp6(2),t.Oqu(n.Title)}}function ct(o,i){if(1&o&&(t.TgZ(0,"div",33)(1,"button",34),t._uU(2),t.qZA(),t.TgZ(3,"ul",35),t.YNc(4,rt,7,6,"li",30),t.qZA()()),2&o){const n=t.oxw();t.xp6(2),t.hij(" ",n.channels.length," CHANNELS "),t.xp6(2),t.Q6J("ngForOf",n.channels)}}let R=(()=>{class o{constructor(){this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.onUploadEvent=new t.vpe,this.onScanEvent=new t.vpe,this.checkBoxChange=new t.vpe,this.onDescEvent=new t.vpe,this.onDownloadEvent=new t.vpe}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(n){this.checkBoxChange.emit(n)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}getChannelLogo(n){let e;switch(n.TypeID){case 0:case 5:e=v.SHOOPE;break;case 1:e=v.TOKOPEDIA;break;case 2:e=v.WOOCOMMERCE;break;case 6:e=v.TIKTOK}return e}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-product-card"]],inputs:{uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",productImage:"productImage",title:"title",code:"code",description:"description",channels:"channels",check:"check"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload"},decls:26,vars:11,consts:[[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"image_temporary","productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],["alt","",1,"rounded","imgUpload","float-left",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-barcode","me-2"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,e){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,H,2,1,"ng-container",6),t.YNc(7,j,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t.NdJ("click",function(){return e.onEventDesc()}),t._uU(11),t.qZA(),t.YNc(12,W,4,1,"div",10),t.YNc(13,z,4,1,"div",10),t.qZA(),t.TgZ(14,"div",11)(15,"div",12),t.YNc(16,X,2,0,"div",13),t.qZA()()()(),t.TgZ(17,"div",14)(18,"div"),t.YNc(19,tt,3,0,"button",15),t.YNc(20,nt,3,0,"button",15),t.YNc(21,et,3,0,"button",16),t.qZA(),t.TgZ(22,"div"),t.YNc(23,it,2,1,"ng-container",6),t.YNc(24,ct,5,2,"ng-template",null,17,t.W1O),t.qZA()()()),2&n){const a=t.MAs(8),r=t.MAs(25);t.xp6(6),t.Q6J("ngIf",e.productImage)("ngIfElse",a),t.xp6(5),t.hij(" ",e.title," "),t.xp6(1),t.Q6J("ngIf",e.code),t.xp6(1),t.Q6J("ngIf",e.description),t.xp6(3),t.Q6J("ngIf",e.showCheckBox),t.xp6(3),t.Q6J("ngIf",e.downloadButton),t.xp6(1),t.Q6J("ngIf",e.uploadButton),t.xp6(1),t.Q6J("ngIf",e.scanButton),t.xp6(2),t.Q6J("ngIf",e.channels.length<4)("ngIfElse",r)}},dependencies:[u.mk,u.sg,u.O5,E.gM],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.product-img[_ngcontent-%COMP%]{width:100%;height:110px;max-width:100%}.image_temporary[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;background:#fff;border-radius:6px;cursor:auto}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:95px;height:95px}.imgUpload[_ngcontent-%COMP%]{position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;object-fit:scale-down}"]}),o})();function st(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"span",10),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getTotal())}),t.TgZ(1,"i",11),t._uU(2,"?"),t.qZA()()}}function dt(o,i){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=t.oxw();t.xp6(1),t.Oqu(t.lcZ(2,1,n.paginationTotal))}}let K=(()=>{class o{constructor(){this.get=new t.vpe,this.change=new t.vpe,this.next=new t.vpe,this.previous=new t.vpe,this.total=new t.vpe,this.hasClicked=!1}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-custom-paginator"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},decls:16,vars:11,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-left"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(n,e){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.ALo(4,"number"),t.ALo(5,"number"),t.YNc(6,st,3,0,"span",3),t.YNc(7,dt,3,3,"span",4),t._uU(8),t.qZA()(),t.TgZ(9,"div",5)(10,"a",6),t.NdJ("click",function(){return e.PreviousPage()}),t._UZ(11,"i",7),t._uU(12," Prev"),t.qZA(),t.TgZ(13,"a",8),t.NdJ("click",function(){return e.NextPage()}),t._UZ(14,"i",9),t._uU(15," Next"),t.qZA()()()),2&n&&(t.xp6(3),t.AsE(" Showing ",t.lcZ(4,7,e.filter.PageSize*(e.filter.PageNumber-1)+1)," - ",t.lcZ(5,9,e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata)," of "),t.xp6(3),t.Q6J("ngIf",!e.hasClicked),t.xp6(1),t.Q6J("ngIf",e.hasClicked),t.xp6(1),t.hij(" records ~ ",e.filter.PageNumber," Page "),t.xp6(2),t.Q6J("hidden",1==e.filter.PageNumber),t.xp6(3),t.Q6J("hidden",e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata==e.paginationTotal||e.totaldata<e.filter.PageSize))},dependencies:[u.O5,u.JJ]}),o})();function pt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",11)(1,"app-product-card",12),t.NdJ("onUpload",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.openUploadModal(r))})("onDescEvent",function(){const r=t.CHM(n).index,d=t.oxw();return t.KtG(d.DialogVariant(r))})("onScan",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanProduct(r))})("onCheckBoxChange",function(a){const d=t.CHM(n).index,b=t.oxw();return t.KtG(b.onSelectProduct(d,a))}),t.qZA()()}if(2&o){const n=i.$implicit,e=t.oxw();t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.ImageUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",e.sortVariant(null==n?null:n.Variants))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<e.Channel.length)("scanButton",!1)("uploadButton",!0)}}let ut=(()=>{class o{constructor(n,e,a){this.http=n,this.toastr=e,this.dialog=a,this.filterScanChannel=new P,this.total=0,this.loading=!1,this.syncupdatefull=!1,this.OptionVisible=!1,this.channelLogo=v,this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filterScanChannel.PageNumber=n.Filter.PageNumber,this.filterScanChannel.RowCount=n.Filter.RowCount,this.filterScanChannel.ChannelID=null,this.filterScanChannel.sync=!0,this.filterScanChannel.PageSize=100,this.TokopediaCategory=n.Options.Tokopedia,this.ShopeeCategory=n.Options.Shopee,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.filterScanChannel.PageNumber,RowCount:this.filterScanChannel.RowCount}).subscribe(e=>{this.data=e.Data,this.total=e.Total,this.paginationTotal=null==e.Total?this.filterScanChannel.RowCount:e.Total.toString(),this.paginationPageSize=this.filterScanChannel.RowCount>this.paginationTotal?this.paginationTotal:this.filterScanChannel.RowCount})}SyncFast(){null!=this.filterScanChannel.ChannelID?this.http.post("/api/product/ScanOptimized",{ID:this.filterScanChannel.ChannelID,ScanFull:this.filterScanChannel.ScanFull}).subscribe(e=>{this.GetProducts();let a=e.NotInPOS?e.NotInPOS.Product:0,r=e.InChannel?e.InChannel.Product:0;this.toastr.success(a+r+" found in "+this.getChannelName(this.filterScanChannel.ChannelID)+"</br> ( "+r+" In POS + "+a+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):this.toastr.error("Please Select Channel","Error")}SyncProductMap(){null!=this.filterScanChannel.ChannelID?this.http.post("/api/product/SyncUpdateMap",{ID:this.filterScanChannel.ChannelID}).subscribe(e=>{this.data=e.Data}).add(()=>{this.GetProducts()}):this.toastr.error("Please Select Channel","Error")}DialogVariant(n){this.dialogName=this.data[n].Name,this.variant=this.data[n].Variants,this.dialog.open(k,{data:{title:this.data[n].Name,variants:this.data[n].Variants},width:"40%"})}onNextPage(){this.filterScanChannel.PageNumber=this.filterScanChannel.PageNumber+1,this.GetProducts()}onPrevPage(){this.filterScanChannel.PageNumber=this.filterScanChannel.PageNumber-1,this.GetProducts()}SearchProduct(n){this.http.post("/api/product/GetInPOS",{Text:n}).subscribe(a=>{this.data=a.Data})}openUploadModal(n){let e;this.selectedItem=n,e=0==n.Channel.length?this.Channel:this.Channel.filter(a=>!n.Channel.some(r=>a.ID==r.ChannelID)),this.dialog.open(x,{width:"600px",data:{item:n,selectedItemMissingChannel:e}}).afterClosed().subscribe(a=>{if(a){let r=a.channelID,d=a.categoryID,b=[];b.push(this.selectedItem.ID),this.uploadProduct(r,b,d)}})}openUploadBulkModal(){this.dialog.open(x,{width:"350px",data:{item:null,selectedItemMissingChannel:this.Channel}}).afterClosed().subscribe(n=>{if(n){let r=n.channelID,d=n.categoryID;var e=this.getSelected();if(e.length>0){var a=[];e.forEach(b=>a.push(b.ID)),this.uploadProduct(r,a,d)}}})}uploadProduct(n,e,a){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:e,CategoryID:a||0}).subscribe(d=>{this.GetProducts();let b=this.Channel.find(tn=>tn.ID==n);this.toastr.success(e.length>1?"Successfully uploaded "+e.length+" Product to channel "+b.Name:this.selectedItem.Name+" Successfully Created","Success")})}sortVariant(n){var e=[];for(let a of n)if(null!=a.Channel)for(let r of a.Channel)0==e.filter(d=>d.ChannelID==r.ChannelID).length&&e.push(r);return this.sortChannel(e)}sortChannel(n){return n.sort((e,a)=>e.TypeID<a.TypeID?1:e.TypeID===a.TypeID?0:-1)}openScanDialog(){this.dialog.open(p.j,{data:{filter:this.filterScanChannel,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filterScanChannel=e.filter,this.filterScanChannel.sync?this.SyncFast():this.filterScanChannel.sync||this.SyncFast())})}openScanSingleDialog(){this.dialog.open(p.j,{data:{filter:this.filterScanChannel,Channel:this.Channel.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:this.hasSelection()},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filterScanChannel=e.filter,this.ScanSingle())})}ScanSingle(){if(null!=this.filterScanChannel.ChannelID){var n=[],e=this.getSelected();if(e.length>0)for(const a of e)for(let r of a.Variants)n.push(r.Code);this.scanSingleChannel(n)}else this.toastr.error("Please Select Channel","Error")}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}onScanProduct(n){this.dialog.open(p.j,{data:{filter:this.filterScanChannel,Channel:this.Channel.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(e=>e)).subscribe(e=>{this.filterScanChannel=e.filter;const a=n?.Variants.map(r=>r.Code);this.scanSingleChannel(a)})}scanSingleChannel(n){this.http.post("/api/product/ScanSingle",{ID:this.filterScanChannel.ChannelID,SKU:n}).subscribe(a=>{this.GetProducts(),a?this.toastr.success("Successfully Scan ","Success"):this.toastr.error("This product is not existed in Tokopedia ","Error")})}onSelectProduct(n,e){this.data[n].selected=e}getChannelName(n){return this.Channel.find(a=>a.ID==n).Name}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(F._W),t.Y36(s.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-in-pos"]],decls:15,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false",3,"headerTitle","onSubmit"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"hidden","click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","description","channels","code","showCheckBox","scanButton","uploadButton","onUpload","onDescEvent","onScan","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.SearchProduct(r)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return e.openScanSingleDialog()}),t._UZ(3,"i",2),t._uU(4),t.qZA(),t.TgZ(5,"button",3),t.NdJ("click",function(){return e.openUploadBulkModal()}),t._UZ(6,"i",4),t._uU(7," Upload Bulk "),t.qZA()(),t.TgZ(8,"content")(9,"div",5)(10,"div",6),t.YNc(11,pt,2,8,"div",7),t.qZA(),t.TgZ(12,"div",8)(13,"div",9)(14,"app-custom-paginator",10),t.NdJ("next",function(){return e.onNextPage()})("previous",function(){return e.onPrevPage()}),t.qZA()()()()()()),2&n&&(t.Q6J("headerTitle","In POS ("+e.total+")"),t.xp6(2),t.Q6J("hidden",!e.hasSelection()),t.xp6(2),t.hij(" Scan Selected Product (",e.getSelected().length,") "),t.xp6(1),t.Q6J("hidden",!e.hasSelection()),t.xp6(6),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("filter",e.filterScanChannel)("totaldata",null==e.data?null:e.data.length)("paginationTotal",e.paginationTotal)("hasClicked",!0))},dependencies:[u.sg,M.p,R,K],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]}),o})();var Q=c(9694),G=c(1889),$=c(6082),V=c(8796);function ht(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function gt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanProductSelected())}),t._UZ(1,"i",15),t._uU(2),t.qZA()}if(2&o){const n=t.oxw();t.xp6(2),t.hij(" Scan Selected Product (",n.productService.selectedProduct(n.products).length,") ")}}function mt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",17)(1,"app-product-card",18),t.NdJ("onUpload",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onUploadProduct(r))})("onDescEvent",function(){const r=t.CHM(n).index,d=t.oxw();return t.KtG(d.onOpenVariantDetail(r))})("onScan",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanSingleProduct(r))})("onCheckBoxChange",function(a){const d=t.CHM(n).$implicit;return t.KtG(d.selected=a)}),t.qZA()()}if(2&o){const n=i.$implicit,e=t.oxw();t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.ImageUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",e.getChannelProduct(n))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",null==n?null:n.hasScan)("uploadButton",null==n?null:n.hasUpload)}}let _t=(()=>{class o{constructor(n,e,a,r){this.http=n,this.dialog=e,this.toastr=a,this.productService=r,this.searchFilter=new P,this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=G.g.GuidEMpty,this.onLoad()}onLoad(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.ChannelID=n.Filter.ChannelID,this.searchFilter.sync=!1,this.searchFilter.mode=1,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel(this.searchFilter).subscribe(n=>{this.products=n.Data,this.checkProductHasUploadBtn(),this.checkProductHasScanButton()})}checkProductHasUploadBtn(){let n;this.products=this.products.map(e=>(e.Channel=this.getChannelProduct(e),n=this.productService.filterUnselectedChannel(e,this.channelOptions),e.hasUpload=n.length>0,e))}checkProductHasScanButton(){let n,e;this.products=this.products.map(a=>(a.Channel=this.getChannelProduct(a),n=this.productService.filterUnselectedChannel(a,this.channelOptions),e=this.productService.filterChannel(n,[Q.x.Tiktok,Q.x.Tokopedia]),a.hasScan=e.length>0,a))}searchProduct(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}syncProduct(){null!==this.searchFilter.ChannelID&&null!=this.searchFilter.mode?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct).subscribe(n=>{if(this.searchFilter.ScanFull){let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);const a=n?.NotInPos?.Product?n?.NotInPos?.Product:0;this.toastr.success(`\n ${a+(n?.InChannel?.Product?n?.InChannel?.Product:0)} found in ${e.Name} </br>\n (${n?.NotInChannel?.Product?n?.NotInChannel?.Product:0} In POS + ${a} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastr.success(`${n.InChannel?n.InChannel.Product:0} product updates since ${n.LastUpdate}`);this.searchFilter.ChannelID=this.guidEmpty}).add(()=>{this.getProducts()}):alert("Please select channel")}onOpenVariantDetail(n){this.dialog.open(k,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"40%"})}getChannelProduct(n){const e=n.Variants;var a=[];for(let r of e)if(null!=r.Channel)for(let d of r.Channel)0==a.filter(b=>b.ChannelID==d.ChannelID).length&&a.push(d);return this.productService.sortChannel(a)}openScanDialog(){this.dialog.open(p.j,{data:{filter:this.searchFilter,Channel:this.channelOptions},width:"40%"}).afterClosed().subscribe(e=>{null!=e&&(this.searchFilter=e.filter,this.scanFullProduct())})}scanFullProduct(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct).subscribe(e=>{if(e){const a=e?.NotInPos?.Product?e?.NotInPos?.Product:0,r=e?.InChannel?.Product?e?.InChannel?.Product:0,d=e?.NotInChannel?.Product?e?.NotInChannel?.Product:0;this.searchFilter.UpdatedProduct?this.toastr.success(`${e.InChannel?e.InChannel.Product:0} product updates in ${this.getChannelName(this.searchFilter.ChannelID)} since ${e.LastUpdate}`,"Scan Complete!"):this.toastr.success(`\n ${a+r} found in ${n.Name} </br>\n (${d} In POS + ${a} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}this.onLoad()})}onScanSingleProduct(n){n.Channel=this.getChannelProduct(n);let e=this.productService.filterUnselectedChannel(n,this.channelOptions),a=this.productService.filterChannel(e,[Q.x.Tiktok,Q.x.Tokopedia]);this.dialog.open(p.j,{data:{filter:Object.assign({},this.searchFilter),Channel:a,showScanUpdateType:!1,showScanType:!1,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,w.h)(r=>r)).subscribe(r=>{this.searchFilter=r.filter;const d=this.productService.getVariantCodesProduct(n);this.scanSingleChannel(d)})}onUploadProduct(n){n.Channel=this.getChannelProduct(n);const e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(x,{width:"600px",data:{item:n,selectedItemMissingChannel:e}}).afterClosed().pipe((0,w.h)(a=>a)).subscribe(a=>{this.uploadProduct(n,a.channelID,a.categoryID)})}onScanProductSelected(){this.dialog.open(p.j,{data:{filter:this.searchFilter,Channel:this.channelOptions.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(e=>e)).subscribe(e=>{if(null!=e){this.searchFilter=e.filter;let a=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(a);this.scanSingleChannel(r)}})}uploadProduct(n,e,a){this.productService.uploadSingleProduct(n,e,a).subscribe(r=>{this.getProducts()})}scanSingleChannel(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${a?.Name} `,"Error")}this.searchFilter.ChannelID=this.guidEmpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=this.guidEmpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=this.guidEmpty}onUploadBulk(){this.dialog.open(x,{width:"350px",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadListProduct(n.channelID,n.categoryID)})}uploadListProduct(n,e){const a=this.productService.selectedProduct(this.products);this.productService.uploadProducts(a,n,e).subscribe(r=>{this.getProducts();const d=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(a.length>1?"Successfully uploaded "+a.length+" Product to channel "+d?.Name:d?.Name+" Successfully Created","Success")})}getChannelName(n){return this.channelOptions.find(a=>a.ID==n).Name}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ChannelID:this.searchFilter.ChannelID}).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(s.uw),t.Y36(F._W),t.Y36($.M))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sold-in-channel"]],decls:21,vars:11,consts:[["headerTitle","Sold in Channel",3,"onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","description","channels","code","showCheckBox","scanButton","uploadButton","onUpload","onDescEvent","onScan","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.searchProduct(r)}),t.TgZ(1,"actions"),t.YNc(2,ht,3,0,"button",1),t.YNc(3,gt,3,1,"button",2),t.TgZ(4,"button",3),t.NdJ("click",function(){return e.onUploadBulk()}),t._UZ(5,"i",4),t._uU(6," Upload Bulk "),t.qZA()(),t.TgZ(7,"filters")(8,"div",5)(9,"div",6)(10,"div")(11,"h6"),t._uU(12,"Channel"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(r){return e.searchFilter.ChannelID=r})("clear",function(){return e.onClearFilterChannel()}),t.qZA()()()()(),t.TgZ(14,"content")(15,"div",8)(16,"div",9),t.YNc(17,mt,2,8,"div",10),t.qZA(),t.TgZ(18,"div",11)(19,"div",12)(20,"app-custom-paginator",13),t.NdJ("total",function(){return e.getRowCount()})("next",function(){return e.onNextPage()})("previous",function(){return e.onPreviousPage()}),t.qZA()()()()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("hidden",!e.productService.hasSelection(e.products)),t.xp6(9),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID==e.guidEmpty?null:e.searchFilter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(3),t.Q6J("filter",e.searchFilter)("totaldata",null==e.products?null:e.products.length)("paginationTotal",e.rowCount)("hasClicked",e.hasClickRowCount))},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,R,K],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}"]}),o})();var Ct=c(8505),ft=c(7287);function Pt(o,i){if(1&o&&t._UZ(0,"img",29),2&o){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ImageUrl,t.LSH)}}function bt(o,i){1&o&&t._UZ(0,"img",30)}function xt(o,i){if(1&o&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&o){const n=i.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Model)}}function It(o,i){if(1&o&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&o){const n=i.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Title)}}function St(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"tbody")(1,"tr")(2,"td",22),t.YNc(3,Pt,1,1,"img",23),t.YNc(4,bt,1,0,"ng-template",null,24,t.W1O),t.TgZ(6,"h4",25),t._uU(7),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td")(11,"ul",26),t.YNc(12,xt,2,1,"li",13),t.qZA()(),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.TgZ(15,"td")(16,"ul",26),t.YNc(17,It,2,1,"li",13),t.qZA()(),t.TgZ(18,"td")(19,"button",27),t.NdJ("click",function(){const r=t.CHM(n).$implicit,d=t.oxw().ngIf,b=t.oxw();return t.KtG(b.openUploadModal(r,d))}),t._UZ(20,"i",28),t._uU(21," Upload "),t.qZA()()()()}if(2&o){const n=i.$implicit,e=t.MAs(5);t.xp6(3),t.Q6J("ngIf",null==n?null:n.ImageUrl)("ngIfElse",e),t.xp6(4),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.Category),t.xp6(3),t.Q6J("ngForOf",n.Variants),t.xp6(2),t.Oqu(null==n?null:n.Code),t.xp6(3),t.Q6J("ngForOf",n.Channel)}}function Tt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"span",31),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.getRowCount())}),t.TgZ(1,"i",32),t._uU(2,"?"),t.qZA()()}}function vt(o,i){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=i.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,n))}}function yt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"a",33),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.onNextPage())}),t._UZ(1,"i",34),t._uU(2," Next"),t.qZA()}}function Mt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"a",35),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.onLastPage())}),t._UZ(1,"i",36),t._uU(2," Last"),t.qZA()}}function Ot(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.searchProduct(a))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const r=t.CHM(n).ngIf,d=t.oxw();return t.KtG(d.openScanDialog(r))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onFilterMissingChannel(a))})("clear",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onClearFilterChannel())}),t.qZA()()()()(),t.TgZ(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"table",10)(17,"thead",11)(18,"tr")(19,"th",12),t._uU(20,"Product"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Category"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Variant"),t.qZA(),t.TgZ(25,"th"),t._uU(26,"SKU"),t.qZA(),t.TgZ(27,"th"),t._uU(28,"Missing Channel"),t.qZA(),t.TgZ(29,"th"),t._uU(30,"Actions"),t.qZA()()(),t.YNc(31,St,22,7,"tbody",13),t.ALo(32,"async"),t.qZA()()(),t.TgZ(33,"div",14)(34,"div",15)(35,"div",16),t._uU(36),t.ALo(37,"number"),t.ALo(38,"async"),t.YNc(39,Tt,3,0,"span",17),t.YNc(40,vt,3,3,"span",18),t.ALo(41,"async"),t._uU(42),t.qZA()(),t.TgZ(43,"div",19),t.YNc(44,yt,3,0,"a",20),t.YNc(45,Mt,3,0,"a",21),t.qZA()()()()()}if(2&o){const n=i.ngIf,e=t.oxw();let a;t.xp6(11),t.Q6J("clearable",!0)("items",n.Options.Channel)("ngModel",e.filterSearch.ChannelID==e.guidEmpty?null:e.filterSearch.ChannelID),t.xp6(20),t.Q6J("ngForOf",t.lcZ(32,10,e.getData$())),t.xp6(5),t.hij(" Showing 1 - ",t.lcZ(37,12,null==(a=t.lcZ(38,14,e.paginationService.data$))?null:a.length)," of "),t.xp6(3),t.Q6J("ngIf",e.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",t.lcZ(41,16,!e.paginationService.hideCount&&e.rowCount$)),t.xp6(2),t.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}let Zt=(()=>{class o{constructor(n,e,a,r,d){this.http=n,this.dialog=e,this.toastr=a,this.productService=r,this.paginationService=d,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannel",this.guidEmpty=G.g.GuidEMpty,this.initLoader()}initLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,Ct.b)(n=>{this.filterSearch=n.Filter,this.paginationService.resetToFirstPage(n.Filter)}))}getData$(){return this.paginationService.data$}searchProduct(n){this.filterSearch.text=n,this.paginationService.resetToFirstPage(this.filterSearch)}syncProduct(n){let e=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanNotInChannel(n.Filter.ChannelID).subscribe(a=>{let r=a.NotInChannel?a.NotInChannel.Product:0,d=a.InChannel?a.InChannel.Product:0;this.toastr.success(r+d+" found in "+e.Name+"</br> ( "+d+" In POS + "+r+" Not In Channel )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}).add(()=>{this.paginationService.resetToFirstPage(this.filterSearch)})}openScanDialog(n){this.dialog.open(p.j,{data:{filter:this.filterSearch,Channel:n.Options.Channel,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(a=>a)).subscribe(a=>{this.filterSearch=a.filter,this.syncProduct(n)})}openUploadModal(n,e){let a,r=e.Options.Channel.filter(d=>(a=n.Channel.findIndex(b=>b.ChannelID==d.ID),a>-1));this.dialog.open(x,{width:"350px",data:{item:n,selectedItemMissingChannel:r}}).afterClosed().subscribe(d=>{d&&this.uploadProduct(n,d.channelID,d.CategoryID,e)})}onFilterMissingChannel(n){this.filterSearch.ChannelID=n}onClearFilterChannel(){this.filterSearch.ChannelID=this.guidEmpty}uploadProduct(n,e,a,r){let d=this.productService.findChannelById(e,r.Options.Channel);this.productService.uploadSingleProduct(n,e,a).subscribe(b=>{this.paginationService.resetToFirstPage(r.Filter),this.toastr.success("Successfully uploaded "+n.Name+" to "+d.Name,"Success")})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n)}})}ngOnDestroy(){this.paginationService.destroy()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(s.uw),t.Y36(F._W),t.Y36($.M),t.Y36(ft.b))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel",3,"onSubmit",4,"ngIf"],["headerTitle","Not in Channel",3,"onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"ms-5"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"text-start"],["class","border rounded","style","width: 40px",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"ms-5","d-inline","fw-normal"],[2,"padding-left","0px"],[1,"btn","btn-link","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"border","rounded",2,"width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){1&n&&(t.YNc(0,Ot,46,18,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,e.loader$))},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,u.Ov,u.JJ],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}thead[_ngcontent-%COMP%]{position:sticky;top:0}"]}),o})();function Dt(o,i){1&o&&(t.TgZ(0,"a",6)(1,"b"),t._uU(2,"seller.shopee.co.id "),t.qZA(),t._UZ(3,"i",7),t.qZA())}function wt(o,i){1&o&&(t.TgZ(0,"a",8)(1,"b"),t._uU(2,"seller.tokopedia.com "),t.qZA(),t._UZ(3,"i",7),t.qZA())}let Nt=(()=>{class o{constructor(n){this.data=n,this.dialogName=n.name,this.type=n.type}ngOnInit(){}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-instruction"]],decls:24,vars:3,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0"],[1,"me-5","mt-5","text-larger"],[1,"mb-5"],["href","http://seller.shopee.co.id","target","_blank",4,"ngIf"],["href","http://seller.tokopedia.com","target","_blank",4,"ngIf"],["href","http://seller.shopee.co.id","target","_blank"],[1,"fas","fa-sm","fa-external-link-alt"],["href","http://seller.tokopedia.com","target","_blank"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1,"Download Products to POS"),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"ol",2)(5,"li",3),t._uU(6," Go to Seller Marketplace account"),t._UZ(7,"br"),t.YNc(8,Dt,4,0,"a",4),t.YNc(9,wt,4,0,"a",5),t.qZA(),t.TgZ(10,"li",3),t._uU(11," Input SKU (Stock Keeping Unit) for "),t._UZ(12,"br"),t.TgZ(13,"b"),t._uU(14),t.qZA()(),t.TgZ(15,"li",3),t._uU(16,"Press "),t.TgZ(17,"b"),t._uU(18,'"Scan"'),t.qZA(),t._uU(19," channel again"),t.qZA(),t.TgZ(20,"li",3)(21,"b"),t._uU(22,'"Download"'),t.qZA(),t._uU(23," button will now be available"),t.qZA()()()),2&n&&(t.xp6(8),t.Q6J("ngIf",0==e.type),t.xp6(1),t.Q6J("ngIf",1==e.type),t.xp6(5),t.Oqu(e.dialogName))},dependencies:[u.O5,s.uh,s.xY],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.text-larger[_ngcontent-%COMP%]{font-size:larger}"]}),o})();function Ut(o,i){if(1&o&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&o){const n=i.$implicit;t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU),t.xp6(2),t.Oqu(null==n?null:n.Name)}}let kt=(()=>{class o{constructor(n){this.data=n}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variants"]],decls:13,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0","pt-2","px-10","d-flex","justify-content-center"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr")(7,"th"),t._uU(8,"Variation"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"SKU"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,Ut,5,2,"tr",4),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(null==e.data?null:e.data.title),t.xp6(11),t.Q6J("ngForOf",e.data.variants))},dependencies:[u.sg],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();function At(o,i){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",12),t._uU(3),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.hij(" Selected Download Product (",n.getSelected().length,") ")}}function Ft(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("ALL"))}),t._UZ(1,"i",12),t._uU(2," Download "),t.qZA()}}const Et=function(o){return[o]},Jt=function(){return[]};function Lt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",13)(1,"app-product-card",14),t.NdJ("onCheckBoxChange",function(a){const d=t.CHM(n).index,b=t.oxw();return t.KtG(b.onSelectProduct(a,d))})("onDescEvent",function(){const r=t.CHM(n).index,d=t.oxw();return t.KtG(d.showVariantDetail(r))})("onDownload",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onDownloadProduct(r))}),t.qZA()()}if(2&o){const n=i.$implicit;t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.Image)("code",0==(null==n||null==n.Variant?null:n.Variant.length)?null==n?null:n.ChannelItemSKU:null)("description",(null==n||null==n.Variant?null:n.Variant.length)>0?(null==n||null==n.Variant?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=n&&n.Channel?t.VKq(7,Et,null==n?null:n.Channel):t.DdM(9,Jt))("showCheckBox",null==n?null:n.upload)}}let Bt=(()=>{class o{constructor(n,e,a){this.http=n,this.toastr=e,this.dialog=a,this.filter=new P,this.loading=!1,this.syncupdatefull=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter=n.Filter,this.filter.ChannelID=null,this.filter.sync=!0,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetProductChannelNotPOS",{ID:this.filter.ChannelID}).subscribe(e=>{this.data=e.Data,this.uploadStatus(),this.mapChannelToProduct(),this.originalData=this.data})}mapChannelToProduct(){this.data=this.data.map(n=>(n.Channel=this.Channel.find(e=>e.ID==n.ChannelID),n))}uploadStatus(){for(let n of this.data)n.fullTitle=!1,n.upload=n.Variant.length>0?null==n.Variant.find(a=>null==a.ChannelVariationSKU):null!=n.ChannelItemSKU}SearchProduct(n){var e=this.originalData;null!=this.filter.ChannelID&&(e=e.filter(a=>a.ChannelID==this.filter.ChannelID)),null!=n&&""!=n&&(e=e.filter(a=>null!==a.Name&&a.Name.toLowerCase().includes(n.toLowerCase()))).length<1&&(e=this.originalData.filter(a=>null!==a.ChannelItemSKU&&a.ChannelItemSKU.includes(n))),this.data=e}GetProductChannel(n){return this.ch=this.Channel.find(e=>e.Name==n.Channel),!!this.ch}Refresh(){null!==this.filter.ChannelID&&null!=this.filter.mode?this.http.post("/api/product/ScanOptimized",{ID:this.filter.ChannelID,mode:this.filter.mode,ScanFull:this.filter.ScanFull}).subscribe(e=>{this.GetProducts();let a=e.NotInPOS?e.NotInPOS.Product:0;this.toastr.success(a+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+a+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):alert("Please select channel")}openScanDialog(){this.dialog.open(p.j,{data:{filter:this.filter,Channel:this.Channel,showScanUpdateType:!1},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filter=e.filter,this.Refresh())})}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}onDownloadAllProduct(n){let e;if(e="ALL"==n?this.data:this.getSelected(),e.length>0){let a=[];e.forEach(r=>a.push(r)),this.http.post("/api/product/DownloadMultipleProductFromChannel",a).subscribe(r=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}}onSelectProduct(n,e){this.data[e].selected=n}onDownloadProduct(n){confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel?.Name} to POS?`)&&this.http.post("/api/product/DownloadProductFromChannel",{ChannelItemID:n.ChannelItemID,ChannelID:n.ChannelID}).subscribe(a=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}getChannelName(n){return this.Channel.find(a=>a.ID==n).Name}openInstruction(n){this.dialogName=n.Name,this.GetProductChannel(n),this.dialogType=this.ch.TypeID,this.dialog.open(Nt,{data:{type:this.dialogType,name:this.dialogName},width:"30%"})}showFullTitle(n){n.fullTitle=!n.fullTitle}showVariantDetail(n){this.dialogName=this.data[n].Name;let e=this.data[n].Variant;e.length>0&&this.dialog.open(kt,{data:{title:this.data[n].Name,variants:e},width:"30%"})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(F._W),t.Y36(s.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-pos"]],decls:19,vars:7,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[4,"ngIf","ngIfElse"],["DOWNLOAD_ALL",""],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","code","description","downloadButton","channels","showCheckBox","onCheckBoxChange","onDescEvent","onDownload"]],template:function(n,e){if(1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.SearchProduct(r)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return e.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA(),t.YNc(5,At,4,1,"ng-container",3),t.YNc(6,Ft,3,0,"ng-template",null,4,t.W1O),t.qZA(),t.TgZ(8,"filters")(9,"div",5)(10,"div",6)(11,"div")(12,"h6"),t._uU(13,"Channel"),t.qZA(),t.TgZ(14,"ng-select",7),t.NdJ("ngModelChange",function(r){return e.filter.ChannelID=r}),t.qZA()()()()(),t.TgZ(15,"content")(16,"div",8)(17,"div",9),t.YNc(18,Lt,2,10,"div",10),t.qZA()()()()),2&n){const a=t.MAs(7);t.Q6J("headerTitle","Not in POS ("+(e.originalData?e.originalData.length:"0")+")"),t.xp6(5),t.Q6J("ngIf",e.hasSelection())("ngIfElse",a),t.xp6(9),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.data)}},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,R],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),o})();function Vt(o,i){1&o&&t._UZ(0,"img",17)}function qt(o,i){1&o&&t._UZ(0,"img",18)}function Qt(o,i){if(1&o&&(t.TgZ(0,"div",19)(1,"table",20)(2,"tr")(3,"td",21),t._UZ(4,"img",22),t.qZA(),t.TgZ(5,"td",23)(6,"a",24),t._uU(7),t.qZA(),t.TgZ(8,"div"),t._uU(9),t.ALo(10,"number"),t.qZA()()()()()),2&o){const n=i.$implicit;t.xp6(4),t.s9C("src",n.ImageURL,t.LSH),t.xp6(2),t.s9C("href",n.URL,t.LSH),t.xp6(1),t.Oqu(n.Name),t.xp6(2),t.hij("Rp. ",t.lcZ(10,4,n.Price),"")}}function Yt(o,i){if(1&o&&(t.ynx(0),t.TgZ(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",4)(5,"div",10),t.YNc(6,Vt,1,0,"img",11),t.YNc(7,qt,1,0,"img",12),t.qZA(),t.TgZ(8,"div",13)(9,"h4"),t._uU(10),t.qZA()()()(),t.TgZ(11,"div",14)(12,"div",15),t.YNc(13,Qt,11,6,"div",16),t.qZA()()()(),t.BQk()),2&o){const n=t.oxw().$implicit;t.xp6(6),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID),t.xp6(3),t.AsE("",null==n?null:n.SKU," (",null==n||null==n.Child?null:n.Child.length," Alies)"),t.xp6(3),t.Q6J("ngForOf",n.Child)}}function Rt(o,i){if(1&o&&(t.ynx(0),t.YNc(1,Yt,14,5,"ng-container",6),t.BQk()),2&o){const n=i.$implicit;t.xp6(1),t.Q6J("ngIf",(null==n||null==n.Child?null:n.Child.length)>0)}}let Kt=(()=>{class o{constructor(n){this.http=n,this.filter={ChannelID:""},this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.filter.ChannelID=null,this.Channel=n.Options.Channel,this.Get()})}Get(){this.http.post("/api/product/GetDuplicateSkuInChannel",this.filter).subscribe(n=>{this.data=n.Data})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-duplicate-sku"]],decls:12,vars:5,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"col-md-4"],[1,"card"],[1,"card-header","border-bottom"],[1,"col-md-1","pb-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"col-10","text-center"],[1,"card-body"],[1,"row","g-0","p-5"],["class","col-md-12",4,"ngFor","ngForOf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],[1,"col-md-12"],[1,"table"],[2,"width","100px"],[1,"img-thumbnail",3,"src"],[1,"text-start"],["target","_blank",3,"href"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return e.Get()}),t._UZ(1,"actions"),t.TgZ(2,"filters")(3,"div",1)(4,"div")(5,"h6"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"ng-select",2),t.NdJ("ngModelChange",function(r){return e.filter.ChannelID=r}),t.qZA()()()(),t.TgZ(8,"content")(9,"div",3)(10,"div",4),t.YNc(11,Rt,2,1,"ng-container",5),t.qZA()()()()),2&n&&(t.Q6J("headerTitle","Duplicate Sku ("+(e.data?e.data.length:"0")+")"),t.xp6(7),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.data))},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,u.JJ]}),o})();var q=c(8063);const Gt=[{path:"",component:y,children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ut,canActivate:[q.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:_t,canActivate:[q.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Zt,canActivate:[q.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Bt,canActivate:[q.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Kt,canActivate:[q.a],data:{title:"Duplicate Sku in Channel"}}]}];let $t=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,l.Bz.forChild(Gt)]}),o})();var Ht=c(8739),jt=c(2594);let Wt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,m.u5,E.AV]}),o})(),zt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez]}),o})(),Xt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,g.Z,m.u5,l.Bz,$t,E.AV,M.R,V.A0,Ht.TU,jt.K,Wt,zt]}),o})()},5241:(L,O,c)=>{c.d(O,{j:()=>B});var u=c(5412),g=c(1889),m=c(9694),l=c(4650),t=c(6895),y=c(4006),P=c(1948),p=c(9549),s=c(4385),_=c(3238);function S(x,N){if(1&x&&(l.TgZ(0,"mat-option",11),l._UZ(1,"img",12),l._uU(2),l.qZA()),2&x){const f=N.$implicit;l.Q6J("value",f.ID),l.xp6(1),l.Q6J("src",f.Img,l.LSH),l.xp6(1),l.hij(" ",f.Name," ")}}function Z(x,N){if(1&x){const f=l.EpF();l.TgZ(0,"div")(1,"h5",2),l._uU(2,"Scan Type"),l.qZA(),l.TgZ(3,"mat-radio-group",13),l.NdJ("ngModelChange",function(D){l.CHM(f);const U=l.oxw();return l.KtG(U.data.filter.ScanFull=D)}),l.TgZ(4,"mat-radio-button",14),l._uU(5," Full (Include Inactive Products) "),l.qZA(),l.TgZ(6,"mat-radio-button",15),l._uU(7," Active "),l.qZA()()()}if(2&x){const f=l.oxw();l.xp6(3),l.Q6J("ngModel",f.data.filter.ScanFull),l.xp6(1),l.Q6J("value",!0),l.xp6(2),l.Q6J("value",!1)}}function J(x,N){if(1&x){const f=l.EpF();l.TgZ(0,"div",16)(1,"h5",2),l._uU(2),l.ALo(3,"date"),l.qZA(),l.TgZ(4,"mat-radio-group",17),l.NdJ("ngModelChange",function(D){l.CHM(f);const U=l.oxw();return l.KtG(U.data.filter.UpdatedProduct=D)}),l.TgZ(5,"mat-radio-button",18),l._uU(6," Scan All Products "),l.qZA(),l.TgZ(7,"mat-radio-button",19),l._uU(8," Scan Updated Products "),l.qZA()()()}if(2&x){const f=l.oxw();l.xp6(2),l.hij(" Last Scan: ",l.xi3(3,5,f.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),l.xp6(2),l.Q6J("ngModel",f.data.filter.UpdatedProduct)("disabled",f.isTokopedia),l.xp6(1),l.Q6J("value",!1),l.xp6(2),l.Q6J("value",!0)}}let B=(()=>{class x{constructor(f,h){this.dialogRef=f,this.data=h,this.channelType=m.x,this.showScanType=void 0===h.showScanType||h.showScanType,this.showScanUpdateType=void 0===h.showScanUpdateType||h.showScanUpdateType}ngOnInit(){this.data.filter.mode=0,this.data.filter.sync=!0,this.data.filter.ScanFull=!0,this.isSingleChannel=void 0!==this.data.isSingleChannel&&this.data.isSingleChannel,this.selectedChannel=this.filterChannelById(this.data?.filter?.ChannelID),this.data.Channel.length<2&&(this.data.filter.ChannelID=this.data.Channel[0].ID)}onSelectChannel(f){let h=this.filterChannelById(f);this.selectedChannel=h,h&&h.TypeID==m.x.Tokopedia?(this.data.filter.ScanFull=!0,this.isTokopedia=!0):(this.data.filter.ScanFull=!1,this.isTokopedia=!1),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.data.filter.UpdatedProduct=!1,(this.selectedChannel.TypeID==m.x.ShopeeV2||this.selectedChannel.TypeID==m.x.Tiktok)&&(this.data.filter.UpdatedProduct=!0)}filterChannelById(f){let h;return this.data.Channel&&(h=this.data.Channel.find(D=>D.ID==f)),h}submit(){this.dialogRef.close(this.data)}isNotEmpty(f){return g.g.IsNotEmpty(f)}close(){this.dialogRef.close()}}return x.\u0275fac=function(f){return new(f||x)(l.Y36(u.so),l.Y36(u.WI))},x.\u0275cmp=l.Xpm({type:x,selectors:[["app-scan-dialog"]],decls:16,vars:4,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],["name","scanType",1,"form-control","h-100","pt-5","round",3,"ngModel","ngModelChange"],["data-toggle","tooltip","title","Full Scan Product",1,"me-5",3,"value"],["data-toggle","tooltip","title","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","pt-5","round",3,"ngModel","disabled","ngModelChange"],["data-toggle","tooltip","title","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["data-toggle","tooltip","title","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"]],template:function(f,h){1&f&&(l.TgZ(0,"h1",0),l._uU(1,"Scan Marketplace"),l.qZA(),l.TgZ(2,"mat-dialog-content",1)(3,"div")(4,"h5",2),l._uU(5,"Select a Channel"),l.qZA(),l.TgZ(6,"mat-form-field",3)(7,"mat-select",4),l.NdJ("ngModelChange",function(U){return h.data.filter.ChannelID=U})("ngModelChange",function(U){return h.onSelectChannel(U)}),l.YNc(8,S,3,3,"mat-option",5),l.qZA()()(),l.YNc(9,Z,8,3,"div",6),l.YNc(10,J,9,8,"div",7),l.qZA(),l.TgZ(11,"mat-dialog-actions",8)(12,"button",9),l.NdJ("click",function(){return h.close()}),l._uU(13," Cancel "),l.qZA(),l.TgZ(14,"button",10),l.NdJ("click",function(){return h.submit()}),l._uU(15," Scan "),l.qZA()()),2&f&&(l.xp6(7),l.Q6J("ngModel",h.data.filter.ChannelID),l.xp6(1),l.Q6J("ngForOf",h.data.Channel),l.xp6(1),l.Q6J("ngIf",(h.showScanType||!h.isSingleChannel)&&!h.isTokopedia&&h.isNotEmpty(h.data.filter.ChannelID)),l.xp6(1),l.Q6J("ngIf",((null==h.selectedChannel?null:h.selectedChannel.TypeID)==h.channelType.ShopeeV2||(null==h.selectedChannel?null:h.selectedChannel.TypeID)==h.channelType.Tiktok)&&(null==h.selectedChannel?null:h.selectedChannel.LastSync)&&h.showScanUpdateType))},dependencies:[t.sg,t.O5,y.JJ,y.On,u.uh,u.xY,u.H8,P.VQ,P.U0,p.KE,s.gD,_.ey,t.uU],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:60px}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),x})()},1889:(L,O,c)=>{c.d(O,{g:()=>u});let u=(()=>{class g{static IsNotEmpty(l){return""!=l&&l!=g.GuidEMpty&&null!=l&&null!=l}static IsEmpty(l){return""==l||null==l||null==l||l==g.GuidEMpty}}return g.GuidEMpty="00000000-0000-0000-0000-000000000000",g})()},9694:(L,O,c)=>{c.d(O,{x:()=>u});var u=(()=>{return(g=u||(u={}))[g.Shopee=0]="Shopee",g[g.Tokopedia=1]="Tokopedia",g[g.WooCommerce=2]="WooCommerce",g[g.None=3]="None",g[g.KalCare=4]="KalCare",g[g.ShopeeV2=5]="ShopeeV2",g[g.Tiktok=6]="Tiktok",g[g.Lazada=7]="Lazada",u;var g})()},7287:(L,O,c)=>{c.d(O,{b:()=>Y});var u=c(4482),g=c(5403),m=c(8421),l=c(4671),t=c(5032),y=c(3269),p=c(4707),s=c(3099),S=c(1135),Z=c(7579),J=c(2722),B=c(9300),x=c(4351),N=c(4004),f=c(5026),h=c(8505),D=c(4650),U=c(1318);let Y=(()=>{class T{constructor(C){this.http=C,this.pagination$=new S.X(null),this.destroy$=new Z.x,this.data$=this.paginationFunction()}onNextPage(C){C.PageNumber+=1,this.pagination$.next(C)}setPageNumberFooter(C){this.footerPageNumber=C.PageNumber}setPaginationButtonState(C,I){this.disableNextButton=0==I||!(I<C.RowCount*C.PageNumber)}resetToFirstPage(C){C.PageNumber=1,this.pagination$.next(C),this.hideCount=!0,this.goToLastPage=!1}getAllData(C,I){C.RowCount=I,this.pagination$.next(C),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new S.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,J.R)(this.destroy$),(0,B.h)(C=>null!=C),(0,x.b)(C=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(C)).pipe((0,N.U)(I=>I.Data))),function P(...T){const A=(0,y.jO)(T);return(0,u.e)((C,I)=>{const k=T.length,v=new Array(k);let w=T.map(()=>!1),F=!1;for(let M=0;M<k;M++)(0,m.Xf)(T[M]).subscribe((0,g.x)(I,E=>{v[M]=E,!F&&!w[M]&&(w[M]=!0,(F=w.every(l.y))&&(w=null))},t.Z));C.subscribe((0,g.x)(I,M=>{if(F){const E=[M,...v];I.next(A?A(...E):E)}}))})}(this.pagination$),(0,f.R)((C,I)=>{const[k,v]=C,[w]=I;return 1==v.PageNumber?[w,v]:[k.concat(w),v]}),(0,h.b)(([C,I])=>{this.setPageNumberFooter(I),this.setPaginationButtonState(I,C.length)}),(0,N.U)(([C])=>C),function _(T,A,C){let I,k=!1;return T&&"object"==typeof T?({bufferSize:I=1/0,windowTime:A=1/0,refCount:k=!1,scheduler:C}=T):I=T??1/0,(0,s.B)({connector:()=>new p.t(I,A,C),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:k})}())}}return T.\u0275fac=function(C){return new(C||T)(D.LFG(U.O))},T.\u0275prov=D.Yz7({token:T,factory:T.\u0275fac,providedIn:"root"}),T})()},6082:(L,O,c)=>{c.d(O,{M:()=>t});var u=c(8505),g=c(4650),m=c(1318),l=c(7185);let t=(()=>{class y{constructor(p,s){this.httpService=p,this.toastrService=s}filterChannel(p,s){return p.filter(_=>-1!==s.findIndex(S=>_.TypeID==S))}uploadSingleProduct(p,s,_){return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:s,Products:[p.ID],CategoryID:_||0}).pipe((0,u.b)(()=>{this.toastrService.success(p.Name+" Successfully Created","Success")}))}uploadProducts(p,s,_){const S=p.map(J=>J.ID);return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:s,Products:S,CategoryID:_||0})}scanSingle(p,s){return this.httpService.post("/api/product/ScanSingle",{ID:p,SKU:s})}scanNotInChannel(p){return this.httpService.post("/api/product/ScanNotinChannel",{ID:p})}findAllSoldInChannel(p){return this.httpService.post("/api/product/GetSoldInChannel",p)}scanAll(p,s,_){return this.httpService.post("/api/product/ScanOptimized",{ID:p,ScanFull:s,UpdatedProduct:_})}getVariantCodesProduct(p){return p.Variants.map(_=>_.Code)}getVariantCodesProducts(p=[]){let s=[];return p.forEach(_=>{_.Variants.forEach(S=>{s=[...s,S.Code]})}),s}filterUnselectedChannel(p,s){let _;return _=p.Channel&&0!=p.Channel.length?s.filter(S=>-1===p.Channel.findIndex(Z=>Z.ChannelID==S.ID)):s,_}findChannelById(p,s){return s.find(_=>_.ID==p)}sortChannel(p){return p.sort((s,_)=>s.TypeID<_.TypeID?1:s.TypeID===_.TypeID?0:-1)}hasSelection(p=[]){return this.selectedProduct(p).length>0}selectedProduct(p=[]){return p.filter(s=>s.selected)}hasSelectionVariant(p){return this.selectedVariantProduct(p).length>0}selectedVariantProduct(p){let s=[];return p.forEach(_=>{s=[...s,..._.Variants.filter(S=>S.selected)]}),s}}return y.\u0275fac=function(p){return new(p||y)(g.LFG(m.O),g.LFG(l._W))},y.\u0275prov=g.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),y})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[458],{5458:(I,h,r)=>{r.r(h),r.d(h,{LoginModule:()=>L});var u=r(6895),l=r(4006),t=r(4650),c=r(8252),g=r(1318);let _=(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code})}addChannelLazada(){this.http.post("/api/ChannelAdd/AddLazada",{Code:this.code}).subscribe(n=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(c.gz),t.Y36(g.O),t.Y36(c.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[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"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){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 n.addChannelLazada()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.code))}}),o})();var b=r(7185),C=r(4810),v=r(8002);const x=["domainAutoFocus"],w=["passAutoFocus"];function y(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Domain is required "),t.qZA())}function Z(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Please enter a valid dealpos domain "),t.qZA())}function T(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,y,2,0,"p",39),t.YNc(2,Z,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(18);t.xp6(1),t.Q6J("ngIf",e.errors.required),t.xp6(1),t.Q6J("ngIf",e.errors.pattern)}}function M(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function P(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,M,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(24);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}const O=function(o,s){return{"fa-eye":o,"fa-eye-slash":s}};function A(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"i",40),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.hideShowPassword())}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("ngClass",t.WLB(1,O,"eye-off"==e.passwordIcon,"eye"==e.passwordIcon))}}function k(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function U(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,k,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(31);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}function S(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",41),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.redirectForgetPass())}),t._uU(1,"Forgot Password?"),t.qZA()}}const q=[{path:"",component:(()=>{class o{constructor(e,n,i,a,d,m){this.http=e,this._router=n,this.elementRef=i,this.toastr=a,this.checkBrowser=d,this.konversi=m,this.login={Host:"",Username:"",Password:""},this.passwordType="password",this.passwordIcon="eye-off",this.getCookies();var p=JSON.parse(window.localStorage.getItem("user"));let f=new Date;null!=p&&(null!=p.expiredAt?window.localStorage.removeItem("user"):new Date(p.Token.expiredAt)>f&&this._router.navigate(["menu"]))}ngOnInit(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}getCookies(){let e=localStorage.getItem("Authorization");if(null!=e){let n=JSON.parse(e);this.login.Host=n.Host,this.login.Username=n.Username}}setAutoFocusDomain(){this.domainElementRef.nativeElement.focus()}setAutoFocusPass(){this.passElementRef.nativeElement.focus()}DoLogin(){this.http.post("/api/token/Login",this.login).subscribe(e=>{if(null!=e.Token.access_token){window.localStorage.removeItem("user"),window.localStorage.setItem("user",JSON.stringify(e));let n="This user is lack of these following roles :",i=!0,a=!0,d=!0,m=!0,p=this.konversi.GetNamePOS();"True"!=p.Sell&&(i=!1,n=`${n} <br/> Sell Create`),"True"!=p.SellEditor&&(a=!1,n=`${n} <br/> Sell Editor`),"True"!=p.DelC&&(d=!1,n=`${n} <br/> Delivery Create`),"True"!=p.PayC&&(m=!1,n=`${n} <br/> Payment Create`),(!i||!a||!d||!m)&&this.toastr.warning(n,"Warning!",{enableHtml:!0}),window.localStorage.removeItem("Intercom"),window.localStorage.setItem("Intercom",JSON.stringify(e.IntercomWidget)),window.localStorage.removeItem("Authorization"),window.localStorage.setItem("Authorization",JSON.stringify({Host:this.login.Host,Username:this.login.Username})),this._router.navigate(e.Channel.length<1?["menu/channel"]:["menu"])}})}redirectForgetPass(){window.open(this.makeForgotPassLink(),"_blank")}makeForgotPassLink(){var e=this.login.Host;return"/"==e[e.length-1]&&(e=e.slice(0,-1)),e.includes("https://")||(e="https://"+e),e+"/ForgotPassword"}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g.O),t.Y36(c.F0),t.Y36(t.SBq),t.Y36(b._W),t.Y36(C.T),t.Y36(v.e))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-login"]],viewQuery:function(e,n){if(1&e&&(t.Gf(x,5),t.Gf(w,5)),2&e){let i;t.iGM(i=t.CRH())&&(n.domainElementRef=i.first),t.iGM(i=t.CRH())&&(n.passElementRef=i.first)}},decls:60,vars:9,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"],["src","https://res.cloudinary.com/pos/image/upload/v1657855612/Apps/Login/Omnichannel.png","alt","integration-image",1,"img-fluid"],[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"],[1,"card"],[1,"card-body"],[1,"card-title"],[1,"ms-2","fw-normal","font-xl","robotoslab"],[1,"mt-10"],[1,"form-label-group"],["type","text","required","","name","Host","id","inputHost","placeholder","POS Domain (xyz.dealpos.com)","pattern","(https:\\/\\/)?\\w+.dealpos(.com|.net|.co.id)(\\/)?",1,"form-control","text-start",3,"ngModel","ngModelChange"],["domainAutoFocus","","domain","ngModel"],["for","inputHost",1,"text-start"],["class","text-danger",4,"ngIf"],["type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["username","ngModel"],["for","inputUsername",1,"text-start"],[1,"form-label-group","mb-5","mb-sm-2"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passAutoFocus","","password","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","col-lg-auto","order-first","order-lg-last"],["href","",3,"click",4,"ngIf"],[1,"col-12","col-lg-5","order-last","order-lg-last","text-end"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-1rem","me-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],["target","_blank","href","https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete",1,"pt-1rem","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"],["href","",3,"click"]],template:function(e,n){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 X Marketplace"),t.qZA(),t.TgZ(9,"div",7)(10,"div",8)(11,"div",9)(12,"h2",10),t._uU(13,"Sign in"),t.qZA()(),t.TgZ(14,"form",11)(15,"div",12)(16,"input",13,14),t.NdJ("ngModelChange",function(a){return n.login.Host=a}),t.qZA(),t.TgZ(19,"label",15),t._uU(20,"POS Domain (xyz.dealpos.com)"),t.qZA()(),t.YNc(21,T,3,2,"div",16),t.TgZ(22,"div",12)(23,"input",17,18),t.NdJ("ngModelChange",function(a){return n.login.Username=a}),t.qZA(),t.TgZ(25,"label",19),t._uU(26,"Username"),t.qZA()(),t.YNc(27,P,2,1,"div",16),t.TgZ(28,"div",20)(29,"input",21,22),t.NdJ("ngModelChange",function(a){return n.login.Password=a}),t.qZA(),t.TgZ(32,"label",23),t._uU(33,"Password"),t.qZA(),t.YNc(34,A,1,4,"i",24),t.qZA(),t.YNc(35,U,2,1,"div",16),t.TgZ(36,"div",25)(37,"div",26),t.YNc(38,S,2,0,"a",27),t.qZA(),t.TgZ(39,"div",28)(40,"button",29),t.NdJ("click",function(){return n.DoLogin()}),t._uU(41,"Log in"),t.qZA()()()()()()(),t.TgZ(42,"div",30)(43,"p",31),t._uU(44,"Powered by : "),t.qZA(),t.TgZ(45,"a",32),t._UZ(46,"img",33),t.qZA(),t._UZ(47,"br"),t.TgZ(48,"a",34),t._uU(49,"Version 2.3.8"),t.qZA()()()(),t.TgZ(50,"footer",35)(51,"div",25)(52,"div",36)(53,"p",31),t._uU(54,"Powered by : "),t.qZA(),t.TgZ(55,"a",32),t._UZ(56,"img",33),t.qZA()(),t.TgZ(57,"div",37)(58,"a",34),t._uU(59,"Version 2.3.8"),t.qZA()()()()),2&e){const i=t.MAs(18),a=t.MAs(24),d=t.MAs(31);t.xp6(16),t.Q6J("ngModel",n.login.Host),t.xp6(5),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("ngModel",n.login.Username),t.xp6(4),t.Q6J("ngIf",a.invalid&&(a.dirty||a.touched)),t.xp6(2),t.Q6J("type",n.passwordType)("ngModel",n.login.Password),t.xp6(5),t.Q6J("ngIf",""!=n.login.Password&&"edge"!=n.browser),t.xp6(1),t.Q6J("ngIf",d.invalid&&(d.dirty||d.touched)),t.xp6(3),t.Q6J("ngIf",i.valid)}},dependencies:[u.mk,u.O5,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.c5,l.On,l.F],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.5rem;right:.5rem;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}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.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}"]}),o})(),data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,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"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(c.gz),t.Y36(g.O),t.Y36(c.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[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"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){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 n.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.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.5rem;right:.5rem;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}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.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}.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}"]}),o})(),data:{title:"Success"}},{path:"tiktok",component:(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,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(n=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(c.gz),t.Y36(g.O),t.Y36(c.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[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"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){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 n.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.code),t.xp6(4),t.Oqu(n.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.5rem;right:.5rem;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}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.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}.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}"]}),o})(),data:{title:"Success"}},{path:"lazada",component:_,data:{title:"Success"}}];let z=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.Bz.forChild(q),c.Bz]}),o})(),L=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,l.u5,z]}),o})()}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[458],{5458:(I,h,r)=>{r.r(h),r.d(h,{LoginModule:()=>L});var u=r(6895),l=r(4006),t=r(4650),c=r(8252),g=r(1318);let _=(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code})}addChannelLazada(){this.http.post("/api/ChannelAdd/AddLazada",{Code:this.code}).subscribe(n=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(c.gz),t.Y36(g.O),t.Y36(c.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[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"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){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 n.addChannelLazada()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.code))}}),o})();var b=r(7185),C=r(4810),v=r(8002);const x=["domainAutoFocus"],w=["passAutoFocus"];function y(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Domain is required "),t.qZA())}function Z(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Please enter a valid dealpos domain "),t.qZA())}function T(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,y,2,0,"p",39),t.YNc(2,Z,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(18);t.xp6(1),t.Q6J("ngIf",e.errors.required),t.xp6(1),t.Q6J("ngIf",e.errors.pattern)}}function M(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function P(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,M,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(24);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}const O=function(o,s){return{"fa-eye":o,"fa-eye-slash":s}};function A(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"i",40),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.hideShowPassword())}),t.qZA()}if(2&o){const e=t.oxw();t.Q6J("ngClass",t.WLB(1,O,"eye-off"==e.passwordIcon,"eye"==e.passwordIcon))}}function k(o,s){1&o&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function U(o,s){if(1&o&&(t.TgZ(0,"div",38),t.YNc(1,k,2,0,"p",39),t.qZA()),2&o){t.oxw();const e=t.MAs(31);t.xp6(1),t.Q6J("ngIf",e.errors.required)}}function S(o,s){if(1&o){const e=t.EpF();t.TgZ(0,"a",41),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.redirectForgetPass())}),t._uU(1,"Forgot Password?"),t.qZA()}}const q=[{path:"",component:(()=>{class o{constructor(e,n,i,a,d,m){this.http=e,this._router=n,this.elementRef=i,this.toastr=a,this.checkBrowser=d,this.konversi=m,this.login={Host:"",Username:"",Password:""},this.passwordType="password",this.passwordIcon="eye-off",this.getCookies();var p=JSON.parse(window.localStorage.getItem("user"));let f=new Date;null!=p&&(null!=p.expiredAt?window.localStorage.removeItem("user"):new Date(p.Token.expiredAt)>f&&this._router.navigate(["menu"]))}ngOnInit(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}getCookies(){let e=localStorage.getItem("Authorization");if(null!=e){let n=JSON.parse(e);this.login.Host=n.Host,this.login.Username=n.Username}}setAutoFocusDomain(){this.domainElementRef.nativeElement.focus()}setAutoFocusPass(){this.passElementRef.nativeElement.focus()}DoLogin(){this.http.post("/api/token/Login",this.login).subscribe(e=>{if(null!=e.Token.access_token){window.localStorage.removeItem("user"),window.localStorage.setItem("user",JSON.stringify(e));let n="This user is lack of these following roles :",i=!0,a=!0,d=!0,m=!0,p=this.konversi.GetNamePOS();"True"!=p.Sell&&(i=!1,n=`${n} <br/> Sell Create`),"True"!=p.SellEditor&&(a=!1,n=`${n} <br/> Sell Editor`),"True"!=p.DelC&&(d=!1,n=`${n} <br/> Delivery Create`),"True"!=p.PayC&&(m=!1,n=`${n} <br/> Payment Create`),(!i||!a||!d||!m)&&this.toastr.warning(n,"Warning!",{enableHtml:!0}),window.localStorage.removeItem("Intercom"),window.localStorage.setItem("Intercom",JSON.stringify(e.IntercomWidget)),window.localStorage.removeItem("Authorization"),window.localStorage.setItem("Authorization",JSON.stringify({Host:this.login.Host,Username:this.login.Username})),this._router.navigate(e.Channel.length<1?["menu/channel"]:["menu"])}})}redirectForgetPass(){window.open(this.makeForgotPassLink(),"_blank")}makeForgotPassLink(){var e=this.login.Host;return"/"==e[e.length-1]&&(e=e.slice(0,-1)),e.includes("https://")||(e="https://"+e),e+"/ForgotPassword"}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g.O),t.Y36(c.F0),t.Y36(t.SBq),t.Y36(b._W),t.Y36(C.T),t.Y36(v.e))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-login"]],viewQuery:function(e,n){if(1&e&&(t.Gf(x,5),t.Gf(w,5)),2&e){let i;t.iGM(i=t.CRH())&&(n.domainElementRef=i.first),t.iGM(i=t.CRH())&&(n.passElementRef=i.first)}},decls:60,vars:9,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"],["src","https://res.cloudinary.com/pos/image/upload/v1657855612/Apps/Login/Omnichannel.png","alt","integration-image",1,"img-fluid"],[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"],[1,"card"],[1,"card-body"],[1,"card-title"],[1,"ms-2","fw-normal","font-xl","robotoslab"],[1,"mt-10"],[1,"form-label-group"],["type","text","required","","name","Host","id","inputHost","placeholder","POS Domain (xyz.dealpos.com)","pattern","(https:\\/\\/)?\\w+.dealpos(.com|.net|.co.id)(\\/)?",1,"form-control","text-start",3,"ngModel","ngModelChange"],["domainAutoFocus","","domain","ngModel"],["for","inputHost",1,"text-start"],["class","text-danger",4,"ngIf"],["type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["username","ngModel"],["for","inputUsername",1,"text-start"],[1,"form-label-group","mb-5","mb-sm-2"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passAutoFocus","","password","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"row","justify-content-between","align-items-center"],[1,"col-12","col-lg-auto","order-first","order-lg-last"],["href","",3,"click",4,"ngIf"],[1,"col-12","col-lg-5","order-last","order-lg-last","text-end"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-1rem","me-3"],["target","_blank","href","https://www.dealpos.com"],["src","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid"],["target","_blank","href","https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete",1,"pt-1rem","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"],["href","",3,"click"]],template:function(e,n){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 X Marketplace"),t.qZA(),t.TgZ(9,"div",7)(10,"div",8)(11,"div",9)(12,"h2",10),t._uU(13,"Sign in"),t.qZA()(),t.TgZ(14,"form",11)(15,"div",12)(16,"input",13,14),t.NdJ("ngModelChange",function(a){return n.login.Host=a}),t.qZA(),t.TgZ(19,"label",15),t._uU(20,"POS Domain (xyz.dealpos.com)"),t.qZA()(),t.YNc(21,T,3,2,"div",16),t.TgZ(22,"div",12)(23,"input",17,18),t.NdJ("ngModelChange",function(a){return n.login.Username=a}),t.qZA(),t.TgZ(25,"label",19),t._uU(26,"Username"),t.qZA()(),t.YNc(27,P,2,1,"div",16),t.TgZ(28,"div",20)(29,"input",21,22),t.NdJ("ngModelChange",function(a){return n.login.Password=a}),t.qZA(),t.TgZ(32,"label",23),t._uU(33,"Password"),t.qZA(),t.YNc(34,A,1,4,"i",24),t.qZA(),t.YNc(35,U,2,1,"div",16),t.TgZ(36,"div",25)(37,"div",26),t.YNc(38,S,2,0,"a",27),t.qZA(),t.TgZ(39,"div",28)(40,"button",29),t.NdJ("click",function(){return n.DoLogin()}),t._uU(41,"Log in"),t.qZA()()()()()()(),t.TgZ(42,"div",30)(43,"p",31),t._uU(44,"Powered by : "),t.qZA(),t.TgZ(45,"a",32),t._UZ(46,"img",33),t.qZA(),t._UZ(47,"br"),t.TgZ(48,"a",34),t._uU(49,"Version 2.3.9"),t.qZA()()()(),t.TgZ(50,"footer",35)(51,"div",25)(52,"div",36)(53,"p",31),t._uU(54,"Powered by : "),t.qZA(),t.TgZ(55,"a",32),t._UZ(56,"img",33),t.qZA()(),t.TgZ(57,"div",37)(58,"a",34),t._uU(59,"Version 2.3.9"),t.qZA()()()()),2&e){const i=t.MAs(18),a=t.MAs(24),d=t.MAs(31);t.xp6(16),t.Q6J("ngModel",n.login.Host),t.xp6(5),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("ngModel",n.login.Username),t.xp6(4),t.Q6J("ngIf",a.invalid&&(a.dirty||a.touched)),t.xp6(2),t.Q6J("type",n.passwordType)("ngModel",n.login.Password),t.xp6(5),t.Q6J("ngIf",""!=n.login.Password&&"edge"!=n.browser),t.xp6(1),t.Q6J("ngIf",d.invalid&&(d.dirty||d.touched)),t.xp6(3),t.Q6J("ngIf",i.valid)}},dependencies:[u.mk,u.O5,l._Y,l.Fj,l.JJ,l.JL,l.Q7,l.c5,l.On,l.F],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.5rem;right:.5rem;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}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.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}"]}),o})(),data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,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"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(c.gz),t.Y36(g.O),t.Y36(c.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[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"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){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 n.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.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.5rem;right:.5rem;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}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.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}.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}"]}),o})(),data:{title:"Success"}},{path:"tiktok",component:(()=>{class o{constructor(e,n,i){this.route=e,this.http=n,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(n=>{this.service.navigate(["/menu/channel"])})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(c.gz),t.Y36(g.O),t.Y36(c.F0))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container"],[1,"row","d-flex","justify-content-center"],[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"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-5",3,"click"],[1,"fas","fa-undo"]],template:function(e,n){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 n.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(n.code),t.xp6(4),t.Oqu(n.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.5rem;right:.5rem;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}}html[_ngcontent-%COMP%], body[_ngcontent-%COMP%]{height:100%}body[_ngcontent-%COMP%]{display:flex;align-items:center;padding-top:40px;padding-bottom:40px}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.pt-1rem[_ngcontent-%COMP%]{padding-top:1rem}.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}.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}"]}),o})(),data:{title:"Success"}},{path:"lazada",component:_,data:{title:"Success"}}];let z=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.Bz.forChild(q),c.Bz]}),o})(),L=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,l.u5,z]}),o})()}}]);
@@ -14,9 +14,9 @@
14
14
  <script>
15
15
  (function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/xv1oomgl'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
16
16
  </script>
17
- <style>@charset "UTF-8";:root{--bs-blue:#337ab7;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#c9302c;--bs-orange:#f6a828;--bs-yellow:#ffc107;--bs-green:#89b03e;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#ffffff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#337ab7;--bs-success:#89b03e;--bs-secondary:#cccccc;--bs-dark:#4d4d4d;--bs-light:#dddddd;--bs-light-gray:rgba(203, 203, 210, .15);--bs-light-blue:#dfeffc;--bs-danger:#c9302c;--bs-warning:#f6a828;--bs-primary-rgb:51, 122, 183;--bs-success-rgb:137, 176, 62;--bs-secondary-rgb:204, 204, 204;--bs-dark-rgb:77, 77, 77;--bs-light-rgb:221, 221, 221;--bs-light-gray-rgb:203, 203, 210;--bs-light-blue-rgb:223, 239, 252;--bs-danger-rgb:201, 48, 44;--bs-warning-rgb:246, 168, 40;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:51, 51, 51;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family:Roboto, sans-serif;--bs-body-font-size:.75rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#333333;--bs-body-bg:#ffffff}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media (max-width: 991px){body{position:relative}}html,body{height:100%}@media print{html,body{height:auto}body{color:#000!important}}@charset "UTF-8";:root{--bs-blue:#337ab7;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#c9302c;--bs-orange:#f6a828;--bs-yellow:#ffc107;--bs-green:#89b03e;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#ffffff;--bs-gray:#cccccc;--bs-gray-dark:#343a40;--bs-gray-100:#dddddd;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#cccccc;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#4d4d4d;--bs-primary:#337ab7;--bs-success:#89b03e;--bs-secondary:#cccccc;--bs-dark:#4d4d4d;--bs-light:#dddddd;--bs-light-gray:rgba(203, 203, 210, .15);--bs-light-blue:#dfeffc;--bs-danger:#c9302c;--bs-warning:#f6a828;--bs-primary-rgb:51, 122, 183;--bs-secondary-rgb:204, 204, 204;--bs-success-rgb:137, 176, 62;--bs-info-rgb:23, 162, 184;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:201, 48, 44;--bs-light-rgb:221, 221, 221;--bs-dark-rgb:77, 77, 77;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:51, 51, 51;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family:Roboto, sans-serif;--bs-body-font-size:.75rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#333333;--bs-body-bg:#ffffff}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media (max-width: 991px){body{position:relative}}html,body{height:100%}@media print{html,body{height:auto}body{color:#000!important}}</style><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.8/Marketplace/styles.84477c613818f650.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.8/Marketplace/styles.84477c613818f650.css"></noscript></head>
17
+ <style>@charset "UTF-8";:root{--bs-blue:#337ab7;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#c9302c;--bs-orange:#f6a828;--bs-yellow:#ffc107;--bs-green:#89b03e;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#ffffff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#337ab7;--bs-success:#89b03e;--bs-secondary:#cccccc;--bs-dark:#4d4d4d;--bs-light:#dddddd;--bs-light-gray:rgba(203, 203, 210, .15);--bs-light-blue:#dfeffc;--bs-danger:#c9302c;--bs-warning:#f6a828;--bs-primary-rgb:51, 122, 183;--bs-success-rgb:137, 176, 62;--bs-secondary-rgb:204, 204, 204;--bs-dark-rgb:77, 77, 77;--bs-light-rgb:221, 221, 221;--bs-light-gray-rgb:203, 203, 210;--bs-light-blue-rgb:223, 239, 252;--bs-danger-rgb:201, 48, 44;--bs-warning-rgb:246, 168, 40;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:51, 51, 51;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family:Roboto, sans-serif;--bs-body-font-size:.75rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#333333;--bs-body-bg:#ffffff}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media (max-width: 991px){body{position:relative}}html,body{height:100%}@media print{html,body{height:auto}body{color:#000!important}}@charset "UTF-8";:root{--bs-blue:#337ab7;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#c9302c;--bs-orange:#f6a828;--bs-yellow:#ffc107;--bs-green:#89b03e;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-white:#ffffff;--bs-gray:#cccccc;--bs-gray-dark:#343a40;--bs-gray-100:#dddddd;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#cccccc;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#4d4d4d;--bs-primary:#337ab7;--bs-success:#89b03e;--bs-secondary:#cccccc;--bs-dark:#4d4d4d;--bs-light:#dddddd;--bs-light-gray:rgba(203, 203, 210, .15);--bs-light-blue:#dfeffc;--bs-danger:#c9302c;--bs-warning:#f6a828;--bs-primary-rgb:51, 122, 183;--bs-secondary-rgb:204, 204, 204;--bs-success-rgb:137, 176, 62;--bs-info-rgb:23, 162, 184;--bs-warning-rgb:255, 193, 7;--bs-danger-rgb:201, 48, 44;--bs-light-rgb:221, 221, 221;--bs-dark-rgb:77, 77, 77;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:51, 51, 51;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family:Roboto, sans-serif;--bs-body-font-size:.75rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#333333;--bs-body-bg:#ffffff}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media (max-width: 991px){body{position:relative}}html,body{height:100%}@media print{html,body{height:auto}body{color:#000!important}}</style><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.9/Marketplace/styles.84477c613818f650.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.9/Marketplace/styles.84477c613818f650.css"></noscript></head>
18
18
  <body>
19
19
  <app-root></app-root>
20
- <script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.8/Marketplace/runtime.60ce88a49d8b2bf5.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.8/Marketplace/polyfills.8d85b0533e3f867a.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.8/Marketplace/scripts.512baec01df5d79f.js" defer></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.8/Marketplace/main.7b5711d2efb046b5.js" type="module"></script>
20
+ <script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.9/Marketplace/runtime.f862b830cb517086.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.9/Marketplace/polyfills.8d85b0533e3f867a.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.9/Marketplace/scripts.512baec01df5d79f.js" defer></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.3.9/Marketplace/main.7b5711d2efb046b5.js" type="module"></script>
21
21
 
22
22
  </body></html>
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e,v={},_={};function r(e){var f=_[e];if(void 0!==f)return f.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(f,t,n,i)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,n,i]=e[o],s=!0,c=0;c<t.length;c++)(!1&i||a>=i)&&Object.keys(r.O).every(u=>r.O[u](t[c]))?t.splice(c--,1):(s=!1,i<a&&(a=i));if(s){e.splice(o--,1);var l=n();void 0!==l&&(f=l)}}return f}i=i||0;for(var o=e.length;o>0&&e[o-1][2]>i;o--)e[o]=e[o-1];e[o]=[t,n,i]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},(()=>{var f,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,n){if(1&n&&(t=this(t)),8&n||"object"==typeof t&&t&&(4&n&&t.__esModule||16&n&&"function"==typeof t.then))return t;var i=Object.create(null);r.r(i);var o={};f=f||[null,e({}),e([]),e(e)];for(var a=2&n&&t;"object"==typeof a&&!~f.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(s=>o[s]=()=>t[s]);return o.default=()=>t,r.d(i,o),i}})(),r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>(592===e?"common":e)+"."+{6:"fc79ecc0c0a33462",61:"6bf2570c9c03e65d",146:"e83dc5a5498a6408",285:"1f547ef81e91fc15",288:"9b236c96f7411cc2",327:"62d10da8ca907775",402:"76aaae9b8dfdc4fd",458:"5bb953c5cb8bf856",466:"02b13502d80588a2",472:"2a25cc631023dd9d",512:"84e77b4b4a7a1db7",585:"c93552ac67f4550c",592:"f2cd628914f2fae7",616:"507588c0a5d7b9e1",717:"5259a4803cce95ab",739:"82b92600f9519019",767:"297995f3aba0da57",796:"3be8ad424aad7864",970:"3f4eb2182e0ed6ff"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="pos-marketplace:";r.l=(t,n,i,o)=>{if(e[t])e[t].push(n);else{var a,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var d=c[l];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==f+i){a=d;break}}a||(s=!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",f+i),a.src=r.tu(t)),e[t]=[n];var p=(g,u)=>{a.onerror=a.onload=null,clearTimeout(b);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(u)),g)return g(u)},b=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),s&&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:f=>f},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.3.9/Marketplace/",(()=>{var e={666:0};r.f.j=(n,i)=>{var o=r.o(e,n)?e[n]:void 0;if(0!==o)if(o)i.push(o[2]);else if(666!=n){var a=new Promise((d,p)=>o=e[n]=[d,p]);i.push(o[2]=a);var s=r.p+r.u(n),c=new Error;r.l(s,d=>{if(r.o(e,n)&&(0!==(o=e[n])&&(e[n]=void 0),o)){var p=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;c.message="Loading chunk "+n+" failed.\n("+p+": "+b+")",c.name="ChunkLoadError",c.type=p,c.request=b,o[1](c)}},"chunk-"+n,n)}else e[n]=0},r.O.j=n=>0===e[n];var f=(n,i)=>{var c,l,[o,a,s]=i,d=0;if(o.some(b=>0!==e[b])){for(c in a)r.o(a,c)&&(r.m[c]=a[c]);if(s)var p=s(r)}for(n&&n(i);d<o.length;d++)r.o(e,l=o[d])&&e[l]&&e[l][0](),e[l]=0;return r.O(p)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marketplacepos",
3
- "version": "2.3.8",
3
+ "version": "2.3.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[327],{7398:(L,O,c)=>{c.d(O,{Z:()=>y,e:()=>t});var u=c(6895),g=c(8252),m=c(4650);function l(P,p){if(1&P&&(m.TgZ(0,"li",2)(1,"a",3),m._uU(2),m.qZA()()),2&P){const s=p.$implicit;m.xp6(1),m.s9C("routerLink",s.Url),m.xp6(1),m.hij(" ",s.Title," ")}}let t=(()=>{class P{}return P.\u0275fac=function(s){return new(s||P)},P.\u0275cmp=m.Xpm({type:P,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs"},decls:2,vars:1,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink"]],template:function(s,_){1&s&&(m.TgZ(0,"ul",0),m.YNc(1,l,3,2,"li",1),m.qZA()),2&s&&(m.xp6(1),m.Q6J("ngForOf",_.Tabs))},dependencies:[u.sg,g.yS,g.Od]}),P})(),y=(()=>{class P{}return P.\u0275fac=function(s){return new(s||P)},P.\u0275mod=m.oAB({type:P}),P.\u0275inj=m.cJS({imports:[u.ez,g.Bz]}),P})()},5327:(L,O,c)=>{c.r(O),c.d(O,{ProductModule:()=>Xt});var u=c(6895),g=c(7398),m=c(4006),l=c(8252),t=c(4650);let y=(()=>{class o{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/sold-in-channel"},{Title:"Not in Channel",Url:"/menu/products/not-in-channel"},{Title:"Not in POS",Url:"/menu/products/not-in-pos"},{Title:"In POS",Url:"/menu/products/in-pos"},{Title:"Duplicate SKU",Url:"/menu/products/duplicate-sku"}]}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-products"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,e){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()()(),t._UZ(4,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",e.productTabs))},dependencies:[g.e,l.lC],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}"]}),o})();class P{}var p=c(5241),s=c(5412),_=c(3841);let I=(()=>{class o{constructor(n){this.LocalData=n}GetCategories(n,e,a){return new Promise(r=>{this.LocalData.getListByKey(n).then(d=>{null!=d?r(d):this.getCategoriesByTypeID(n,e,a).then(b=>{r(b)})})})}getCategoriesByTypeID(n,e,a){return new Promise(r=>{a.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:e}).subscribe(b=>{this.LocalData.saveList(b,n),r(b)})})}}return o.\u0275fac=function(n){return new(n||o)(t.LFG(_.F))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var Z=c(1318),J=c(8966);function B(o,i){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"h5",4),t._uU(2,"Category"),t.qZA(),t.TgZ(3,"app-select-search",10),t.NdJ("onSelect",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onSelectCategory(a))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.Q6J("appearance","outline")("batchSize",30)("data",n.options)("bindLabel","Value")("bindValue","Key")("placeholder","Select Category")}}let x=(()=>{class o{constructor(n,e,a,r){this.data=n,this.channelCategoriesService=e,this.http=a,this.dialogRef=r,this.item=n.item,this.selectItemMissingChannel=n.selectedItemMissingChannel,this.options=[],this.optionVisible=!1}onSelectItem(n){this.selectedChannelID=n;let e=this.selectItemMissingChannel.find(a=>a.ID==n);!e||1!==e.TypeID&&6!==e.TypeID&&7!==e.TypeID?this.optionVisible=!1:this.channelCategoriesService.GetCategories(e.TypeID,e.ID,this.http).then(a=>{this.options=a,this.optionVisible=!0}).catch(a=>{console.error(a)})}onSelectCategory(n){this.selectedCategoryID=n}onClose(){this.dialogRef.close()}onSave(){this.selectedChannelID&&(this.selectedCategoryID||!this.optionVisible)&&this.dialogRef.close({channelID:this.selectedChannelID,categoryID:this.selectedCategoryID})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI),t.Y36(I),t.Y36(Z.O),t.Y36(s.so))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-uploadProductDialog"]],decls:16,vars:7,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"row"],[1,"col-12"],[1,"mb-3","fw-normal"],[3,"appearance","data","bindLabel","bindValue","placeholder","onSelect"],[4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"appearance","batchSize","data","bindLabel","bindValue","placeholder","onSelect"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t.TgZ(2,"mat-dialog-content",1)(3,"div",2)(4,"div",3)(5,"h5",4),t._uU(6,"Channel :"),t.qZA(),t.TgZ(7,"app-select-search",5),t.NdJ("onSelect",function(r){return e.onSelectItem(r)}),t.qZA()()(),t.TgZ(8,"div",2)(9,"div",3),t.YNc(10,B,4,6,"ng-container",6),t.qZA()()(),t.TgZ(11,"mat-dialog-actions",7)(12,"button",8),t.NdJ("click",function(){return e.onClose()}),t._uU(13,"Cancel"),t.qZA(),t.TgZ(14,"button",9),t.NdJ("click",function(){return e.onSave()}),t._uU(15,"Upload"),t.qZA()()),2&n&&(t.xp6(1),t.hij("Upload ",null==e.item?null:e.item.Name,""),t.xp6(6),t.Q6J("appearance","outline")("data",e.selectItemMissingChannel)("bindLabel","Name")("bindValue","ID")("placeholder","Choose "),t.xp6(3),t.Q6J("ngIf",e.optionVisible))},dependencies:[u.O5,s.uh,s.xY,s.H8,J.h],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();function N(o,i){if(1&o&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",9),t._uU(3),t.qZA(),t.TgZ(4,"td",9),t._uU(5),t.qZA(),t.TgZ(6,"td",10)(7,"p",11),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&o){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function f(o,i){if(1&o&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function h(o,i){if(1&o&&(t.TgZ(0,"td",9),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}function D(o,i){1&o&&t._UZ(0,"img",18)}function U(o,i){1&o&&t._UZ(0,"img",19)}function Y(o,i){1&o&&t._UZ(0,"img",20)}function T(o,i){1&o&&t._UZ(0,"img",21)}function A(o,i){if(1&o&&(t.TgZ(0,"tr")(1,"td",9),t._uU(2),t.qZA(),t.YNc(3,f,2,2,"td",12),t.YNc(4,h,2,2,"td",12),t.TgZ(5,"td",9),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",9),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",9)(12,"a",13),t.YNc(13,D,1,0,"img",14),t.YNc(14,U,1,0,"img",15),t.YNc(15,Y,1,0,"img",16),t.YNc(16,T,1,0,"img",17),t.qZA()()()),2&o){const n=i.$implicit,e=i.index;t.xp6(2),t.Oqu(n.Name),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(2),t.Oqu(t.lcZ(7,11,n.Price)),t.xp6(3),t.Oqu(t.lcZ(10,13,n.Inventory)),t.xp6(3),t.s9C("href",n.Url,t.LSH),t.s9C("title",n.Title),t.xp6(1),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID||5==n.TypeID),t.xp6(1),t.Q6J("ngIf",2==n.TypeID),t.xp6(1),t.Q6J("ngIf",6==n.TypeID)}}function C(o,i){if(1&o&&t.YNc(0,A,17,15,"tr",6),2&o){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function S(o,i){if(1&o&&(t.ynx(0),t.YNc(1,N,9,2,"ng-container",7),t.YNc(2,C,1,1,"ng-template",null,8,t.W1O),t.BQk()),2&o){const n=i.$implicit,e=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",e)}}let k=(()=>{class o{constructor(n){this.data=n,this.variants=n.variants,this.title=n.title}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variant"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"sticky-top"],[1,"text-center","sticky-top"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-center"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-center",4,"ngIf"],["target","_blank",3,"href","title"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],["src","https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp"],["src","https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr",4)(7,"th",5),t._uU(8,"PRODUCT"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"VARIANT"),t.qZA(),t.TgZ(11,"th",5),t._uU(12,"SKU"),t.qZA(),t.TgZ(13,"th",5),t._uU(14,"PRICE"),t.qZA(),t.TgZ(15,"th",5),t._uU(16,"INVENTORY"),t.qZA(),t.TgZ(17,"th",5),t._uU(18,"CHANNEL"),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,S,4,2,"ng-container",6),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(e.title),t.xp6(19),t.Q6J("ngForOf",e.variants))},dependencies:[u.sg,u.O5,s.uh,s.xY,u.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important}"]}),o})();var v=(()=>{return(o=v||(v={})).SHOOPE="//res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",o.WOOCOMMERCE="//res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",o.TOKOPEDIA="//res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",o.TIKTOK="//res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",o.LAZADA="//res.cloudinary.com/pos/image/upload/w_30/v1641528003/icons/marketplace_icons/lazada.png",v;var o})(),w=c(9300),F=c(7185),M=c(7481),E=c(266);function H(o,i){if(1&o&&(t.ynx(0),t._UZ(1,"img",18),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("src",n.productImage,t.LSH)}}function j(o,i){1&o&&t._UZ(0,"img",19)}function W(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",20),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onEventDesc())}),t._UZ(1,"i",21),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.code)}}function z(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",20),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onEventDesc())}),t._UZ(1,"i",22),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.description)}}function X(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",23)(1,"input",24),t.NdJ("change",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onCheck(a.target.checked))}),t.qZA()()}}function tt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",25),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownload())}),t._UZ(1,"i",26),t._uU(2," Download "),t.qZA()}}function nt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",25),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUpload())}),t._UZ(1,"i",27),t._uU(2," Upload "),t.qZA()}}function et(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",28),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScan())}),t._UZ(1,"i",29),t._uU(2," Scan "),t.qZA()}}const ot=function(o){return{"me-3":o}};function at(o,i){if(1&o&&(t.ynx(0),t.TgZ(1,"a",31),t._UZ(2,"img",32),t.qZA(),t.BQk()),2&o){const n=i.$implicit,e=i.index,a=t.oxw(2);t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("ngClass",t.VKq(4,ot,e!=a.channels.length-1))("src",a.getChannelLogo(n),t.LSH)("matTooltip",n.Title?n.Title:n.Name)}}function it(o,i){if(1&o&&(t.ynx(0),t.YNc(1,at,3,6,"ng-container",30),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.channels)}}const lt=function(o){return{"border-bottom pb-2":o}};function rt(o,i){if(1&o&&(t.TgZ(0,"li")(1,"div",36)(2,"div",37)(3,"a",31),t._UZ(4,"img",38),t.TgZ(5,"span",39),t._uU(6),t.qZA()()()()()),2&o){const n=i.$implicit,e=i.index,a=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,lt,e!=a.channels.length-1)),t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("src",a.getChannelLogo(n),t.LSH),t.xp6(2),t.Oqu(n.Title)}}function ct(o,i){if(1&o&&(t.TgZ(0,"div",33)(1,"button",34),t._uU(2),t.qZA(),t.TgZ(3,"ul",35),t.YNc(4,rt,7,6,"li",30),t.qZA()()),2&o){const n=t.oxw();t.xp6(2),t.hij(" ",n.channels.length," CHANNELS "),t.xp6(2),t.Q6J("ngForOf",n.channels)}}let R=(()=>{class o{constructor(){this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.onUploadEvent=new t.vpe,this.onScanEvent=new t.vpe,this.checkBoxChange=new t.vpe,this.onDescEvent=new t.vpe,this.onDownloadEvent=new t.vpe}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(n){this.checkBoxChange.emit(n)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}getChannelLogo(n){let e;switch(n.TypeID){case 0:case 5:e=v.SHOOPE;break;case 1:e=v.TOKOPEDIA;break;case 2:e=v.WOOCOMMERCE;break;case 6:e=v.TIKTOK}return e}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-product-card"]],inputs:{uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",productImage:"productImage",title:"title",code:"code",description:"description",channels:"channels",check:"check"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload"},decls:26,vars:11,consts:[[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"image_temporary","productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],["alt","",1,"rounded","imgUpload","float-left",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-barcode","me-2"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,e){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,H,2,1,"ng-container",6),t.YNc(7,j,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t.NdJ("click",function(){return e.onEventDesc()}),t._uU(11),t.qZA(),t.YNc(12,W,4,1,"div",10),t.YNc(13,z,4,1,"div",10),t.qZA(),t.TgZ(14,"div",11)(15,"div",12),t.YNc(16,X,2,0,"div",13),t.qZA()()()(),t.TgZ(17,"div",14)(18,"div"),t.YNc(19,tt,3,0,"button",15),t.YNc(20,nt,3,0,"button",15),t.YNc(21,et,3,0,"button",16),t.qZA(),t.TgZ(22,"div"),t.YNc(23,it,2,1,"ng-container",6),t.YNc(24,ct,5,2,"ng-template",null,17,t.W1O),t.qZA()()()),2&n){const a=t.MAs(8),r=t.MAs(25);t.xp6(6),t.Q6J("ngIf",e.productImage)("ngIfElse",a),t.xp6(5),t.hij(" ",e.title," "),t.xp6(1),t.Q6J("ngIf",e.code),t.xp6(1),t.Q6J("ngIf",e.description),t.xp6(3),t.Q6J("ngIf",e.showCheckBox),t.xp6(3),t.Q6J("ngIf",e.downloadButton),t.xp6(1),t.Q6J("ngIf",e.uploadButton),t.xp6(1),t.Q6J("ngIf",e.scanButton),t.xp6(2),t.Q6J("ngIf",e.channels.length<4)("ngIfElse",r)}},dependencies:[u.mk,u.sg,u.O5,E.gM],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.product-img[_ngcontent-%COMP%]{width:100%;height:110px;max-width:100%}.image_temporary[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;background:#fff;border-radius:6px;cursor:auto}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:95px;height:95px}.imgUpload[_ngcontent-%COMP%]{position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;object-fit:scale-down}"]}),o})();function st(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"span",10),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getTotal())}),t.TgZ(1,"i",11),t._uU(2,"?"),t.qZA()()}}function dt(o,i){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=t.oxw();t.xp6(1),t.Oqu(t.lcZ(2,1,n.paginationTotal))}}let K=(()=>{class o{constructor(){this.get=new t.vpe,this.change=new t.vpe,this.next=new t.vpe,this.previous=new t.vpe,this.total=new t.vpe,this.hasClicked=!1}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-custom-paginator"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},decls:16,vars:11,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-left"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"hidden","click"],[1,"fas","fa-arrow-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(n,e){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3),t.ALo(4,"number"),t.ALo(5,"number"),t.YNc(6,st,3,0,"span",3),t.YNc(7,dt,3,3,"span",4),t._uU(8),t.qZA()(),t.TgZ(9,"div",5)(10,"a",6),t.NdJ("click",function(){return e.PreviousPage()}),t._UZ(11,"i",7),t._uU(12," Prev"),t.qZA(),t.TgZ(13,"a",8),t.NdJ("click",function(){return e.NextPage()}),t._UZ(14,"i",9),t._uU(15," Next"),t.qZA()()()),2&n&&(t.xp6(3),t.AsE(" Showing ",t.lcZ(4,7,e.filter.PageSize*(e.filter.PageNumber-1)+1)," - ",t.lcZ(5,9,e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata)," of "),t.xp6(3),t.Q6J("ngIf",!e.hasClicked),t.xp6(1),t.Q6J("ngIf",e.hasClicked),t.xp6(1),t.hij(" records ~ ",e.filter.PageNumber," Page "),t.xp6(2),t.Q6J("hidden",1==e.filter.PageNumber),t.xp6(3),t.Q6J("hidden",e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata==e.paginationTotal||e.totaldata<e.filter.PageSize))},dependencies:[u.O5,u.JJ]}),o})();function pt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",11)(1,"app-product-card",12),t.NdJ("onUpload",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.openUploadModal(r))})("onDescEvent",function(){const r=t.CHM(n).index,d=t.oxw();return t.KtG(d.DialogVariant(r))})("onScan",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanProduct(r))})("onCheckBoxChange",function(a){const d=t.CHM(n).index,b=t.oxw();return t.KtG(b.onSelectProduct(d,a))}),t.qZA()()}if(2&o){const n=i.$implicit,e=t.oxw();t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.ImageUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",e.sortVariant(null==n?null:n.Variants))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<e.Channel.length)("scanButton",!1)("uploadButton",!0)}}let ut=(()=>{class o{constructor(n,e,a){this.http=n,this.toastr=e,this.dialog=a,this.filterScanChannel=new P,this.total=0,this.loading=!1,this.syncupdatefull=!1,this.OptionVisible=!1,this.channelLogo=v,this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filterScanChannel.PageNumber=n.Filter.PageNumber,this.filterScanChannel.RowCount=n.Filter.RowCount,this.filterScanChannel.ChannelID=null,this.filterScanChannel.sync=!0,this.filterScanChannel.PageSize=100,this.TokopediaCategory=n.Options.Tokopedia,this.ShopeeCategory=n.Options.Shopee,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.filterScanChannel.PageNumber,RowCount:this.filterScanChannel.RowCount}).subscribe(e=>{this.data=e.Data,this.total=e.Total,this.paginationTotal=null==e.Total?this.filterScanChannel.RowCount:e.Total.toString(),this.paginationPageSize=this.filterScanChannel.RowCount>this.paginationTotal?this.paginationTotal:this.filterScanChannel.RowCount})}SyncFast(){null!=this.filterScanChannel.ChannelID?this.http.post("/api/product/ScanOptimized",{ID:this.filterScanChannel.ChannelID,ScanFull:this.filterScanChannel.ScanFull}).subscribe(e=>{this.GetProducts();let a=e.NotInPOS?e.NotInPOS.Product:0,r=e.InChannel?e.InChannel.Product:0;this.toastr.success(a+r+" found in "+this.getChannelName(this.filterScanChannel.ChannelID)+"</br> ( "+r+" In POS + "+a+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):this.toastr.error("Please Select Channel","Error")}SyncProductMap(){null!=this.filterScanChannel.ChannelID?this.http.post("/api/product/SyncUpdateMap",{ID:this.filterScanChannel.ChannelID}).subscribe(e=>{this.data=e.Data}).add(()=>{this.GetProducts()}):this.toastr.error("Please Select Channel","Error")}DialogVariant(n){this.dialogName=this.data[n].Name,this.variant=this.data[n].Variants,this.dialog.open(k,{data:{title:this.data[n].Name,variants:this.data[n].Variants},width:"40%"})}onNextPage(){this.filterScanChannel.PageNumber=this.filterScanChannel.PageNumber+1,this.GetProducts()}onPrevPage(){this.filterScanChannel.PageNumber=this.filterScanChannel.PageNumber-1,this.GetProducts()}SearchProduct(n){this.http.post("/api/product/GetInPOS",{Text:n}).subscribe(a=>{this.data=a.Data})}openUploadModal(n){let e;this.selectedItem=n,e=0==n.Channel.length?this.Channel:this.Channel.filter(a=>!n.Channel.some(r=>a.ID==r.ChannelID)),this.dialog.open(x,{width:"600px",data:{item:n,selectedItemMissingChannel:e}}).afterClosed().subscribe(a=>{if(a){let r=a.channelID,d=a.categoryID,b=[];b.push(this.selectedItem.ID),this.uploadProduct(r,b,d)}})}openUploadBulkModal(){this.dialog.open(x,{width:"350px",data:{item:null,selectedItemMissingChannel:this.Channel}}).afterClosed().subscribe(n=>{if(n){let r=n.channelID,d=n.categoryID;var e=this.getSelected();if(e.length>0){var a=[];e.forEach(b=>a.push(b.ID)),this.uploadProduct(r,a,d)}}})}uploadProduct(n,e,a){this.http.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:e,CategoryID:a||0}).subscribe(d=>{this.GetProducts();let b=this.Channel.find(tn=>tn.ID==n);this.toastr.success(e.length>1?"Successfully uploaded "+e.length+" Product to channel "+b.Name:this.selectedItem.Name+" Successfully Created","Success")})}sortVariant(n){var e=[];for(let a of n)if(null!=a.Channel)for(let r of a.Channel)0==e.filter(d=>d.ChannelID==r.ChannelID).length&&e.push(r);return this.sortChannel(e)}sortChannel(n){return n.sort((e,a)=>e.TypeID<a.TypeID?1:e.TypeID===a.TypeID?0:-1)}openScanDialog(){this.dialog.open(p.j,{data:{filter:this.filterScanChannel,Channel:this.Channel},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filterScanChannel=e.filter,this.filterScanChannel.sync?this.SyncFast():this.filterScanChannel.sync||this.SyncFast())})}openScanSingleDialog(){this.dialog.open(p.j,{data:{filter:this.filterScanChannel,Channel:this.Channel.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:this.hasSelection()},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filterScanChannel=e.filter,this.ScanSingle())})}ScanSingle(){if(null!=this.filterScanChannel.ChannelID){var n=[],e=this.getSelected();if(e.length>0)for(const a of e)for(let r of a.Variants)n.push(r.Code);this.scanSingleChannel(n)}else this.toastr.error("Please Select Channel","Error")}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}onScanProduct(n){this.dialog.open(p.j,{data:{filter:this.filterScanChannel,Channel:this.Channel.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(e=>e)).subscribe(e=>{this.filterScanChannel=e.filter;const a=n?.Variants.map(r=>r.Code);this.scanSingleChannel(a)})}scanSingleChannel(n){this.http.post("/api/product/ScanSingle",{ID:this.filterScanChannel.ChannelID,SKU:n}).subscribe(a=>{this.GetProducts(),a?this.toastr.success("Successfully Scan ","Success"):this.toastr.error("This product is not existed in Tokopedia ","Error")})}onSelectProduct(n,e){this.data[n].selected=e}getChannelName(n){return this.Channel.find(a=>a.ID==n).Name}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(F._W),t.Y36(s.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-in-pos"]],decls:15,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false",3,"headerTitle","onSubmit"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"hidden","click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","description","channels","code","showCheckBox","scanButton","uploadButton","onUpload","onDescEvent","onScan","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.SearchProduct(r)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return e.openScanSingleDialog()}),t._UZ(3,"i",2),t._uU(4),t.qZA(),t.TgZ(5,"button",3),t.NdJ("click",function(){return e.openUploadBulkModal()}),t._UZ(6,"i",4),t._uU(7," Upload Bulk "),t.qZA()(),t.TgZ(8,"content")(9,"div",5)(10,"div",6),t.YNc(11,pt,2,8,"div",7),t.qZA(),t.TgZ(12,"div",8)(13,"div",9)(14,"app-custom-paginator",10),t.NdJ("next",function(){return e.onNextPage()})("previous",function(){return e.onPrevPage()}),t.qZA()()()()()()),2&n&&(t.Q6J("headerTitle","In POS ("+e.total+")"),t.xp6(2),t.Q6J("hidden",!e.hasSelection()),t.xp6(2),t.hij(" Scan Selected Product (",e.getSelected().length,") "),t.xp6(1),t.Q6J("hidden",!e.hasSelection()),t.xp6(6),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("filter",e.filterScanChannel)("totaldata",null==e.data?null:e.data.length)("paginationTotal",e.paginationTotal)("hasClicked",!0))},dependencies:[u.sg,M.p,R,K],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]}),o})();var Q=c(9694),G=c(1889),$=c(6082),V=c(8796);function ht(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function gt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanProductSelected())}),t._UZ(1,"i",15),t._uU(2),t.qZA()}if(2&o){const n=t.oxw();t.xp6(2),t.hij(" Scan Selected Product (",n.productService.selectedProduct(n.products).length,") ")}}function mt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",17)(1,"app-product-card",18),t.NdJ("onUpload",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onUploadProduct(r))})("onDescEvent",function(){const r=t.CHM(n).index,d=t.oxw();return t.KtG(d.onOpenVariantDetail(r))})("onScan",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onScanSingleProduct(r))})("onCheckBoxChange",function(a){const d=t.CHM(n).$implicit;return t.KtG(d.selected=a)}),t.qZA()()}if(2&o){const n=i.$implicit,e=t.oxw();t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.ImageUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",e.getChannelProduct(n))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",null==n?null:n.hasScan)("uploadButton",null==n?null:n.hasUpload)}}let _t=(()=>{class o{constructor(n,e,a,r){this.http=n,this.dialog=e,this.toastr=a,this.productService=r,this.searchFilter=new P,this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=G.g.GuidEMpty,this.onLoad()}onLoad(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.ChannelID=n.Filter.ChannelID,this.searchFilter.sync=!1,this.searchFilter.mode=1,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel(this.searchFilter).subscribe(n=>{this.products=n.Data,this.checkProductHasUploadBtn(),this.checkProductHasScanButton()})}checkProductHasUploadBtn(){let n;this.products=this.products.map(e=>(e.Channel=this.getChannelProduct(e),n=this.productService.filterUnselectedChannel(e,this.channelOptions),e.hasUpload=n.length>0,e))}checkProductHasScanButton(){let n,e;this.products=this.products.map(a=>(a.Channel=this.getChannelProduct(a),n=this.productService.filterUnselectedChannel(a,this.channelOptions),e=this.productService.filterChannel(n,[Q.x.Tiktok,Q.x.Tokopedia]),a.hasScan=e.length>0,a))}searchProduct(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}syncProduct(){null!==this.searchFilter.ChannelID&&null!=this.searchFilter.mode?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct).subscribe(n=>{this.toastr.success(`${n.InChannel?n.InChannel.Product:0} product updates since ${n.LastUpdate}`),this.searchFilter.ChannelID=this.guidEmpty}).add(()=>{this.getProducts()}):alert("Please select channel")}onOpenVariantDetail(n){this.dialog.open(k,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"40%"})}getChannelProduct(n){const e=n.Variants;var a=[];for(let r of e)if(null!=r.Channel)for(let d of r.Channel)0==a.filter(b=>b.ChannelID==d.ChannelID).length&&a.push(d);return this.productService.sortChannel(a)}openScanDialog(){this.dialog.open(p.j,{data:{filter:this.searchFilter,Channel:this.channelOptions},width:"40%"}).afterClosed().subscribe(e=>{null!=e&&(this.searchFilter=e.filter,this.scanFullProduct())})}scanFullProduct(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct).subscribe(e=>{if(e){const a=e?.NotInPos?.Product?e?.NotInPos?.Product:0,r=e?.InChannel?.Product?e?.InChannel?.Product:0,d=e?.NotInChannel?.Product?e?.NotInChannel?.Product:0;this.searchFilter.UpdatedProduct?this.toastr.success(`${e.InChannel?e.InChannel.Product:0} product updates in ${this.getChannelName(this.searchFilter.ChannelID)} since ${e.LastUpdate}`,"Scan Complete!"):this.toastr.success(`\n ${a+r} found in ${n.Name} </br>\n (${d} In POS + ${a} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}this.onLoad()})}onScanSingleProduct(n){n.Channel=this.getChannelProduct(n);let e=this.productService.filterUnselectedChannel(n,this.channelOptions),a=this.productService.filterChannel(e,[Q.x.Tiktok,Q.x.Tokopedia]);this.dialog.open(p.j,{data:{filter:Object.assign({},this.searchFilter),Channel:a,showScanUpdateType:!1,showScanType:!1,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,w.h)(r=>r)).subscribe(r=>{this.searchFilter=r.filter;const d=this.productService.getVariantCodesProduct(n);this.scanSingleChannel(d)})}onUploadProduct(n){n.Channel=this.getChannelProduct(n);const e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(x,{width:"600px",data:{item:n,selectedItemMissingChannel:e}}).afterClosed().pipe((0,w.h)(a=>a)).subscribe(a=>{this.uploadProduct(n,a.channelID,a.categoryID)})}onScanProductSelected(){this.dialog.open(p.j,{data:{filter:this.searchFilter,Channel:this.channelOptions.filter(e=>1==e.TypeID||6==e.TypeID),isSingleChannel:!0,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(e=>e)).subscribe(e=>{if(null!=e){this.searchFilter=e.filter;let a=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(a);this.scanSingleChannel(r)}})}uploadProduct(n,e,a){this.productService.uploadSingleProduct(n,e,a).subscribe(r=>{this.getProducts()})}scanSingleChannel(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${a?.Name} `,"Error")}this.searchFilter.ChannelID=this.guidEmpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=this.guidEmpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=this.guidEmpty}onUploadBulk(){this.dialog.open(x,{width:"350px",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadListProduct(n.channelID,n.categoryID)})}uploadListProduct(n,e){const a=this.productService.selectedProduct(this.products);this.productService.uploadProducts(a,n,e).subscribe(r=>{this.getProducts();const d=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(a.length>1?"Successfully uploaded "+a.length+" Product to channel "+d?.Name:d?.Name+" Successfully Created","Success")})}getChannelName(n){return this.channelOptions.find(a=>a.ID==n).Name}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ChannelID:this.searchFilter.ChannelID}).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(s.uw),t.Y36(F._W),t.Y36($.M))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sold-in-channel"]],decls:21,vars:11,consts:[["headerTitle","Sold in Channel",3,"onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"hidden","click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","description","channels","code","showCheckBox","scanButton","uploadButton","onUpload","onDescEvent","onScan","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.searchProduct(r)}),t.TgZ(1,"actions"),t.YNc(2,ht,3,0,"button",1),t.YNc(3,gt,3,1,"button",2),t.TgZ(4,"button",3),t.NdJ("click",function(){return e.onUploadBulk()}),t._UZ(5,"i",4),t._uU(6," Upload Bulk "),t.qZA()(),t.TgZ(7,"filters")(8,"div",5)(9,"div",6)(10,"div")(11,"h6"),t._uU(12,"Channel"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(r){return e.searchFilter.ChannelID=r})("clear",function(){return e.onClearFilterChannel()}),t.qZA()()()()(),t.TgZ(14,"content")(15,"div",8)(16,"div",9),t.YNc(17,mt,2,8,"div",10),t.qZA(),t.TgZ(18,"div",11)(19,"div",12)(20,"app-custom-paginator",13),t.NdJ("total",function(){return e.getRowCount()})("next",function(){return e.onNextPage()})("previous",function(){return e.onPreviousPage()}),t.qZA()()()()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("hidden",!e.productService.hasSelection(e.products)),t.xp6(9),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID==e.guidEmpty?null:e.searchFilter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(3),t.Q6J("filter",e.searchFilter)("totaldata",null==e.products?null:e.products.length)("paginationTotal",e.rowCount)("hasClicked",e.hasClickRowCount))},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,R,K],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}"]}),o})();var Ct=c(8505),ft=c(7287);function Pt(o,i){if(1&o&&t._UZ(0,"img",29),2&o){const n=t.oxw().$implicit;t.s9C("src",null==n?null:n.ImageUrl,t.LSH)}}function bt(o,i){1&o&&t._UZ(0,"img",30)}function xt(o,i){if(1&o&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&o){const n=i.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Model)}}function St(o,i){if(1&o&&(t.TgZ(0,"li"),t._uU(1),t.qZA()),2&o){const n=i.$implicit;t.xp6(1),t.Oqu(null==n?null:n.Title)}}function It(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"tbody")(1,"tr")(2,"td",22),t.YNc(3,Pt,1,1,"img",23),t.YNc(4,bt,1,0,"ng-template",null,24,t.W1O),t.TgZ(6,"h4",25),t._uU(7),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td")(11,"ul",26),t.YNc(12,xt,2,1,"li",13),t.qZA()(),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.TgZ(15,"td")(16,"ul",26),t.YNc(17,St,2,1,"li",13),t.qZA()(),t.TgZ(18,"td")(19,"button",27),t.NdJ("click",function(){const r=t.CHM(n).$implicit,d=t.oxw().ngIf,b=t.oxw();return t.KtG(b.openUploadModal(r,d))}),t._UZ(20,"i",28),t._uU(21," Upload "),t.qZA()()()()}if(2&o){const n=i.$implicit,e=t.MAs(5);t.xp6(3),t.Q6J("ngIf",null==n?null:n.ImageUrl)("ngIfElse",e),t.xp6(4),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.Category),t.xp6(3),t.Q6J("ngForOf",n.Variants),t.xp6(2),t.Oqu(null==n?null:n.Code),t.xp6(3),t.Q6J("ngForOf",n.Channel)}}function Tt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"span",31),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.getRowCount())}),t.TgZ(1,"i",32),t._uU(2,"?"),t.qZA()()}}function vt(o,i){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=i.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,n))}}function yt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"a",33),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.onNextPage())}),t._UZ(1,"i",34),t._uU(2," Next"),t.qZA()}}function Mt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"a",35),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.onLastPage())}),t._UZ(1,"i",36),t._uU(2," Last"),t.qZA()}}function Ot(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.searchProduct(a))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const r=t.CHM(n).ngIf,d=t.oxw();return t.KtG(d.openScanDialog(r))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){t.CHM(n);const r=t.oxw();return t.KtG(r.onFilterMissingChannel(a))})("clear",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onClearFilterChannel())}),t.qZA()()()()(),t.TgZ(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"table",10)(17,"thead",11)(18,"tr")(19,"th",12),t._uU(20,"Product"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Category"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Variant"),t.qZA(),t.TgZ(25,"th"),t._uU(26,"SKU"),t.qZA(),t.TgZ(27,"th"),t._uU(28,"Missing Channel"),t.qZA(),t.TgZ(29,"th"),t._uU(30,"Actions"),t.qZA()()(),t.YNc(31,It,22,7,"tbody",13),t.ALo(32,"async"),t.qZA()()(),t.TgZ(33,"div",14)(34,"div",15)(35,"div",16),t._uU(36),t.ALo(37,"number"),t.ALo(38,"async"),t.YNc(39,Tt,3,0,"span",17),t.YNc(40,vt,3,3,"span",18),t.ALo(41,"async"),t._uU(42),t.qZA()(),t.TgZ(43,"div",19),t.YNc(44,yt,3,0,"a",20),t.YNc(45,Mt,3,0,"a",21),t.qZA()()()()()}if(2&o){const n=i.ngIf,e=t.oxw();let a;t.xp6(11),t.Q6J("clearable",!0)("items",n.Options.Channel)("ngModel",e.filterSearch.ChannelID==e.guidEmpty?null:e.filterSearch.ChannelID),t.xp6(20),t.Q6J("ngForOf",t.lcZ(32,10,e.getData$())),t.xp6(5),t.hij(" Showing 1 - ",t.lcZ(37,12,null==(a=t.lcZ(38,14,e.paginationService.data$))?null:a.length)," of "),t.xp6(3),t.Q6J("ngIf",e.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",t.lcZ(41,16,!e.paginationService.hideCount&&e.rowCount$)),t.xp6(2),t.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}let Zt=(()=>{class o{constructor(n,e,a,r,d){this.http=n,this.dialog=e,this.toastr=a,this.productService=r,this.paginationService=d,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannel",this.guidEmpty=G.g.GuidEMpty,this.initLoader()}initLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,Ct.b)(n=>{this.filterSearch=n.Filter,this.paginationService.resetToFirstPage(n.Filter)}))}getData$(){return this.paginationService.data$}searchProduct(n){this.filterSearch.text=n,this.paginationService.resetToFirstPage(this.filterSearch)}syncProduct(n){let e=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanNotInChannel(n.Filter.ChannelID).subscribe(a=>{let r=a.NotInChannel?a.NotInChannel.Product:0,d=a.InChannel?a.InChannel.Product:0;this.toastr.success(r+d+" found in "+e.Name+"</br> ( "+d+" In POS + "+r+" Not In Channel )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}).add(()=>{this.paginationService.resetToFirstPage(this.filterSearch)})}openScanDialog(n){this.dialog.open(p.j,{data:{filter:this.filterSearch,Channel:n.Options.Channel,showScanUpdateType:!1,showScanType:!1},width:"30%"}).afterClosed().pipe((0,w.h)(a=>a)).subscribe(a=>{this.filterSearch=a.filter,this.syncProduct(n)})}openUploadModal(n,e){let a,r=e.Options.Channel.filter(d=>(a=n.Channel.findIndex(b=>b.ChannelID==d.ID),a>-1));this.dialog.open(x,{width:"350px",data:{item:n,selectedItemMissingChannel:r}}).afterClosed().subscribe(d=>{d&&this.uploadProduct(n,d.channelID,d.CategoryID,e)})}onFilterMissingChannel(n){this.filterSearch.ChannelID=n}onClearFilterChannel(){this.filterSearch.ChannelID=this.guidEmpty}uploadProduct(n,e,a,r){let d=this.productService.findChannelById(e,r.Options.Channel);this.productService.uploadSingleProduct(n,e,a).subscribe(b=>{this.paginationService.resetToFirstPage(r.Filter),this.toastr.success("Successfully uploaded "+n.Name+" to "+d.Name,"Success")})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n)}})}ngOnDestroy(){this.paginationService.destroy()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(s.uw),t.Y36(F._W),t.Y36($.M),t.Y36(ft.b))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel",3,"onSubmit",4,"ngIf"],["headerTitle","Not in Channel",3,"onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"ms-5"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"text-start"],["class","border rounded","style","width: 40px",3,"src",4,"ngIf","ngIfElse"],["elsePic",""],[1,"ms-5","d-inline","fw-normal"],[2,"padding-left","0px"],[1,"btn","btn-link","btn-sm",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"border","rounded",2,"width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){1&n&&(t.YNc(0,Ot,46,18,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,e.loader$))},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,u.Ov,u.JJ],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}thead[_ngcontent-%COMP%]{position:sticky;top:0}"]}),o})();function Dt(o,i){1&o&&(t.TgZ(0,"a",6)(1,"b"),t._uU(2,"seller.shopee.co.id "),t.qZA(),t._UZ(3,"i",7),t.qZA())}function wt(o,i){1&o&&(t.TgZ(0,"a",8)(1,"b"),t._uU(2,"seller.tokopedia.com "),t.qZA(),t._UZ(3,"i",7),t.qZA())}let Nt=(()=>{class o{constructor(n){this.data=n,this.dialogName=n.name,this.type=n.type}ngOnInit(){}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-instruction"]],decls:24,vars:3,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0"],[1,"me-5","mt-5","text-larger"],[1,"mb-5"],["href","http://seller.shopee.co.id","target","_blank",4,"ngIf"],["href","http://seller.tokopedia.com","target","_blank",4,"ngIf"],["href","http://seller.shopee.co.id","target","_blank"],[1,"fas","fa-sm","fa-external-link-alt"],["href","http://seller.tokopedia.com","target","_blank"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1,"Download Products to POS"),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"ol",2)(5,"li",3),t._uU(6," Go to Seller Marketplace account"),t._UZ(7,"br"),t.YNc(8,Dt,4,0,"a",4),t.YNc(9,wt,4,0,"a",5),t.qZA(),t.TgZ(10,"li",3),t._uU(11," Input SKU (Stock Keeping Unit) for "),t._UZ(12,"br"),t.TgZ(13,"b"),t._uU(14),t.qZA()(),t.TgZ(15,"li",3),t._uU(16,"Press "),t.TgZ(17,"b"),t._uU(18,'"Scan"'),t.qZA(),t._uU(19," channel again"),t.qZA(),t.TgZ(20,"li",3)(21,"b"),t._uU(22,'"Download"'),t.qZA(),t._uU(23," button will now be available"),t.qZA()()()),2&n&&(t.xp6(8),t.Q6J("ngIf",0==e.type),t.xp6(1),t.Q6J("ngIf",1==e.type),t.xp6(5),t.Oqu(e.dialogName))},dependencies:[u.O5,s.uh,s.xY],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.text-larger[_ngcontent-%COMP%]{font-size:larger}"]}),o})();function Ut(o,i){if(1&o&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&o){const n=i.$implicit;t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU),t.xp6(2),t.Oqu(null==n?null:n.Name)}}let kt=(()=>{class o{constructor(n){this.data=n}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(s.WI))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variants"]],decls:13,vars:2,consts:[["mat-dialog-title","",1,"pt-2","pb-3","text-center"],[1,"pb-5","mx-0","pt-2","px-10","d-flex","justify-content-center"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,e){1&n&&(t.TgZ(0,"h1",0),t._uU(1),t.qZA(),t._UZ(2,"hr"),t.TgZ(3,"mat-dialog-content",1)(4,"table",2)(5,"thead",3)(6,"tr")(7,"th"),t._uU(8,"Variation"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"SKU"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,Ut,5,2,"tr",4),t.qZA()()()),2&n&&(t.xp6(1),t.Oqu(null==e.data?null:e.data.title),t.xp6(11),t.Q6J("ngForOf",e.data.variants))},dependencies:[u.sg],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();function At(o,i){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",12),t._uU(3),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.hij(" Selected Download Product (",n.getSelected().length,") ")}}function Ft(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"button",11),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("ALL"))}),t._UZ(1,"i",12),t._uU(2," Download "),t.qZA()}}const Et=function(o){return[o]},Jt=function(){return[]};function Lt(o,i){if(1&o){const n=t.EpF();t.TgZ(0,"div",13)(1,"app-product-card",14),t.NdJ("onCheckBoxChange",function(a){const d=t.CHM(n).index,b=t.oxw();return t.KtG(b.onSelectProduct(a,d))})("onDescEvent",function(){const r=t.CHM(n).index,d=t.oxw();return t.KtG(d.showVariantDetail(r))})("onDownload",function(){const r=t.CHM(n).$implicit,d=t.oxw();return t.KtG(d.onDownloadProduct(r))}),t.qZA()()}if(2&o){const n=i.$implicit;t.xp6(1),t.Q6J("title",null==n?null:n.Name)("productImage",null==n?null:n.Image)("code",0==(null==n||null==n.Variant?null:n.Variant.length)?null==n?null:n.ChannelItemSKU:null)("description",(null==n||null==n.Variant?null:n.Variant.length)>0?(null==n||null==n.Variant?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=n&&n.Channel?t.VKq(7,Et,null==n?null:n.Channel):t.DdM(9,Jt))("showCheckBox",null==n?null:n.upload)}}let Bt=(()=>{class o{constructor(n,e,a){this.http=n,this.toastr=e,this.dialog=a,this.filter=new P,this.loading=!1,this.syncupdatefull=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.Channel=n.Options.Channel,this.filter=n.Filter,this.filter.ChannelID=null,this.filter.sync=!0,this.GetProducts()})}GetProducts(){this.http.post("/api/product/GetProductChannelNotPOS",{ID:this.filter.ChannelID}).subscribe(e=>{this.data=e.Data,this.uploadStatus(),this.mapChannelToProduct(),this.originalData=this.data})}mapChannelToProduct(){this.data=this.data.map(n=>(n.Channel=this.Channel.find(e=>e.ID==n.ChannelID),n))}uploadStatus(){for(let n of this.data)n.fullTitle=!1,n.upload=n.Variant.length>0?null==n.Variant.find(a=>null==a.ChannelVariationSKU):null!=n.ChannelItemSKU}SearchProduct(n){var e=this.originalData;null!=this.filter.ChannelID&&(e=e.filter(a=>a.ChannelID==this.filter.ChannelID)),null!=n&&""!=n&&(e=e.filter(a=>null!==a.Name&&a.Name.toLowerCase().includes(n.toLowerCase()))).length<1&&(e=this.originalData.filter(a=>null!==a.ChannelItemSKU&&a.ChannelItemSKU.includes(n))),this.data=e}GetProductChannel(n){return this.ch=this.Channel.find(e=>e.Name==n.Channel),!!this.ch}Refresh(){null!==this.filter.ChannelID&&null!=this.filter.mode?this.http.post("/api/product/ScanOptimized",{ID:this.filter.ChannelID,mode:this.filter.mode,ScanFull:this.filter.ScanFull}).subscribe(e=>{this.GetProducts();let a=e.NotInPOS?e.NotInPOS.Product:0;this.toastr.success(a+" found in "+this.getChannelName(this.filter.ChannelID)+"</br> ( "+a+" Not In POS )","Scan Complete!",{timeOut:5e3,enableHtml:!0})}):alert("Please select channel")}openScanDialog(){this.dialog.open(p.j,{data:{filter:this.filter,Channel:this.Channel,showScanUpdateType:!1},width:"30%"}).afterClosed().subscribe(e=>{null!=e&&(this.filter=e.filter,this.Refresh())})}getSelected(){return this.data?this.data.filter(n=>n.selected):[]}hasSelection(){return!!this.data&&this.getSelected().length>0}onDownloadAllProduct(n){let e;if(e="ALL"==n?this.data:this.getSelected(),e.length>0){let a=[];e.forEach(r=>a.push(r)),this.http.post("/api/product/DownloadMultipleProductFromChannel",a).subscribe(r=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}}onSelectProduct(n,e){this.data[e].selected=n}onDownloadProduct(n){confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel?.Name} to POS?`)&&this.http.post("/api/product/DownloadProductFromChannel",{ChannelItemID:n.ChannelItemID,ChannelID:n.ChannelID}).subscribe(a=>{this.GetProducts(),this.toastr.success("Retrieved Product successfully!","Success")})}getChannelName(n){return this.Channel.find(a=>a.ID==n).Name}openInstruction(n){this.dialogName=n.Name,this.GetProductChannel(n),this.dialogType=this.ch.TypeID,this.dialog.open(Nt,{data:{type:this.dialogType,name:this.dialogName},width:"30%"})}showFullTitle(n){n.fullTitle=!n.fullTitle}showVariantDetail(n){this.dialogName=this.data[n].Name;let e=this.data[n].Variant;e.length>0&&this.dialog.open(kt,{data:{title:this.data[n].Name,variants:e},width:"30%"})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O),t.Y36(F._W),t.Y36(s.uw))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-pos"]],decls:19,vars:7,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[4,"ngIf","ngIfElse"],["DOWNLOAD_ALL",""],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"title","productImage","code","description","downloadButton","channels","showCheckBox","onCheckBoxChange","onDescEvent","onDownload"]],template:function(n,e){if(1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(r){return e.SearchProduct(r)}),t.TgZ(1,"actions")(2,"button",1),t.NdJ("click",function(){return e.openScanDialog()}),t._UZ(3,"i",2),t._uU(4," Scan Channel "),t.qZA(),t.YNc(5,At,4,1,"ng-container",3),t.YNc(6,Ft,3,0,"ng-template",null,4,t.W1O),t.qZA(),t.TgZ(8,"filters")(9,"div",5)(10,"div",6)(11,"div")(12,"h6"),t._uU(13,"Channel"),t.qZA(),t.TgZ(14,"ng-select",7),t.NdJ("ngModelChange",function(r){return e.filter.ChannelID=r}),t.qZA()()()()(),t.TgZ(15,"content")(16,"div",8)(17,"div",9),t.YNc(18,Lt,2,10,"div",10),t.qZA()()()()),2&n){const a=t.MAs(7);t.Q6J("headerTitle","Not in POS ("+(e.originalData?e.originalData.length:"0")+")"),t.xp6(5),t.Q6J("ngIf",e.hasSelection())("ngIfElse",a),t.xp6(9),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.data)}},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,R],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),o})();function Vt(o,i){1&o&&t._UZ(0,"img",17)}function qt(o,i){1&o&&t._UZ(0,"img",18)}function Qt(o,i){if(1&o&&(t.TgZ(0,"div",19)(1,"table",20)(2,"tr")(3,"td",21),t._UZ(4,"img",22),t.qZA(),t.TgZ(5,"td",23)(6,"a",24),t._uU(7),t.qZA(),t.TgZ(8,"div"),t._uU(9),t.ALo(10,"number"),t.qZA()()()()()),2&o){const n=i.$implicit;t.xp6(4),t.s9C("src",n.ImageURL,t.LSH),t.xp6(2),t.s9C("href",n.URL,t.LSH),t.xp6(1),t.Oqu(n.Name),t.xp6(2),t.hij("Rp. ",t.lcZ(10,4,n.Price),"")}}function Yt(o,i){if(1&o&&(t.ynx(0),t.TgZ(1,"div",7)(2,"div",8)(3,"div",9)(4,"div",4)(5,"div",10),t.YNc(6,Vt,1,0,"img",11),t.YNc(7,qt,1,0,"img",12),t.qZA(),t.TgZ(8,"div",13)(9,"h4"),t._uU(10),t.qZA()()()(),t.TgZ(11,"div",14)(12,"div",15),t.YNc(13,Qt,11,6,"div",16),t.qZA()()()(),t.BQk()),2&o){const n=t.oxw().$implicit;t.xp6(6),t.Q6J("ngIf",1==n.TypeID),t.xp6(1),t.Q6J("ngIf",0==n.TypeID),t.xp6(3),t.AsE("",null==n?null:n.SKU," (",null==n||null==n.Child?null:n.Child.length," Alies)"),t.xp6(3),t.Q6J("ngForOf",n.Child)}}function Rt(o,i){if(1&o&&(t.ynx(0),t.YNc(1,Yt,14,5,"ng-container",6),t.BQk()),2&o){const n=i.$implicit;t.xp6(1),t.Q6J("ngIf",(null==n||null==n.Child?null:n.Child.length)>0)}}let Kt=(()=>{class o{constructor(n){this.http=n,this.filter={ChannelID:""},this.Load()}Load(){this.http.post("/api/product/Load",{}).subscribe(n=>{this.filter.ChannelID=null,this.Channel=n.Options.Channel,this.Get()})}Get(){this.http.post("/api/product/GetDuplicateSkuInChannel",this.filter).subscribe(n=>{this.data=n.Data})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.O))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-duplicate-sku"]],decls:12,vars:5,consts:[["textButton"," Search",3,"headerTitle","onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"col-md-4"],[1,"card"],[1,"card-header","border-bottom"],[1,"col-md-1","pb-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],[1,"col-10","text-center"],[1,"card-body"],[1,"row","g-0","p-5"],["class","col-md-12",4,"ngFor","ngForOf"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png"],[1,"col-md-12"],[1,"table"],[2,"width","100px"],[1,"img-thumbnail",3,"src"],[1,"text-start"],["target","_blank",3,"href"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return e.Get()}),t._UZ(1,"actions"),t.TgZ(2,"filters")(3,"div",1)(4,"div")(5,"h6"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"ng-select",2),t.NdJ("ngModelChange",function(r){return e.filter.ChannelID=r}),t.qZA()()()(),t.TgZ(8,"content")(9,"div",3)(10,"div",4),t.YNc(11,Rt,2,1,"ng-container",5),t.qZA()()()()),2&n&&(t.Q6J("headerTitle","Duplicate Sku ("+(e.data?e.data.length:"0")+")"),t.xp6(7),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(4),t.Q6J("ngForOf",e.data))},dependencies:[u.sg,u.O5,m.JJ,m.On,M.p,V.w9,u.JJ]}),o})();var q=c(8063);const Gt=[{path:"",component:y,children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ut,canActivate:[q.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:_t,canActivate:[q.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Zt,canActivate:[q.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Bt,canActivate:[q.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Kt,canActivate:[q.a],data:{title:"Duplicate Sku in Channel"}}]}];let $t=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,l.Bz.forChild(Gt)]}),o})();var Ht=c(8739),jt=c(2594);let Wt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,m.u5,E.AV]}),o})(),zt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez]}),o})(),Xt=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[u.ez,g.Z,m.u5,l.Bz,$t,E.AV,M.R,V.A0,Ht.TU,jt.K,Wt,zt]}),o})()},5241:(L,O,c)=>{c.d(O,{j:()=>B});var u=c(5412),g=c(1889),m=c(9694),l=c(4650),t=c(6895),y=c(4006),P=c(1948),p=c(9549),s=c(4385),_=c(3238);function I(x,N){if(1&x&&(l.TgZ(0,"mat-option",11),l._UZ(1,"img",12),l._uU(2),l.qZA()),2&x){const f=N.$implicit;l.Q6J("value",f.ID),l.xp6(1),l.Q6J("src",f.Img,l.LSH),l.xp6(1),l.hij(" ",f.Name," ")}}function Z(x,N){if(1&x){const f=l.EpF();l.TgZ(0,"div")(1,"h5",2),l._uU(2,"Scan Type"),l.qZA(),l.TgZ(3,"mat-radio-group",13),l.NdJ("ngModelChange",function(D){l.CHM(f);const U=l.oxw();return l.KtG(U.data.filter.ScanFull=D)}),l.TgZ(4,"mat-radio-button",14),l._uU(5," Full (Include Inactive Products) "),l.qZA(),l.TgZ(6,"mat-radio-button",15),l._uU(7," Active "),l.qZA()()()}if(2&x){const f=l.oxw();l.xp6(3),l.Q6J("ngModel",f.data.filter.ScanFull),l.xp6(1),l.Q6J("value",!0),l.xp6(2),l.Q6J("value",!1)}}function J(x,N){if(1&x){const f=l.EpF();l.TgZ(0,"div",16)(1,"h5",2),l._uU(2),l.ALo(3,"date"),l.qZA(),l.TgZ(4,"mat-radio-group",17),l.NdJ("ngModelChange",function(D){l.CHM(f);const U=l.oxw();return l.KtG(U.data.filter.UpdatedProduct=D)}),l.TgZ(5,"mat-radio-button",18),l._uU(6," Scan All Products "),l.qZA(),l.TgZ(7,"mat-radio-button",19),l._uU(8," Scan Updated Products "),l.qZA()()()}if(2&x){const f=l.oxw();l.xp6(2),l.hij(" Last Scan: ",l.xi3(3,5,f.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),l.xp6(2),l.Q6J("ngModel",f.data.filter.UpdatedProduct)("disabled",f.isTokopedia),l.xp6(1),l.Q6J("value",!1),l.xp6(2),l.Q6J("value",!0)}}let B=(()=>{class x{constructor(f,h){this.dialogRef=f,this.data=h,this.channelType=m.x,this.showScanType=void 0===h.showScanType||h.showScanType,this.showScanUpdateType=void 0===h.showScanUpdateType||h.showScanUpdateType}ngOnInit(){this.data.filter.mode=0,this.data.filter.sync=!0,this.data.filter.ScanFull=!0,this.isSingleChannel=void 0!==this.data.isSingleChannel&&this.data.isSingleChannel,this.selectedChannel=this.filterChannelById(this.data?.filter?.ChannelID),this.data.Channel.length<2&&(this.data.filter.ChannelID=this.data.Channel[0].ID)}onSelectChannel(f){let h=this.filterChannelById(f);this.selectedChannel=h,h&&h.TypeID==m.x.Tokopedia?(this.data.filter.ScanFull=!0,this.isTokopedia=!0):(this.data.filter.ScanFull=!1,this.isTokopedia=!1),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.data.filter.UpdatedProduct=!1,(this.selectedChannel.TypeID==m.x.ShopeeV2||this.selectedChannel.TypeID==m.x.Tiktok)&&(this.data.filter.UpdatedProduct=!0)}filterChannelById(f){let h;return this.data.Channel&&(h=this.data.Channel.find(D=>D.ID==f)),h}submit(){this.dialogRef.close(this.data)}isNotEmpty(f){return g.g.IsNotEmpty(f)}close(){this.dialogRef.close()}}return x.\u0275fac=function(f){return new(f||x)(l.Y36(u.so),l.Y36(u.WI))},x.\u0275cmp=l.Xpm({type:x,selectors:[["app-scan-dialog"]],decls:16,vars:4,consts:[["mat-dialog-title","",1,"pt-2","pb-3"],[1,"py-5","mt-4","mx-0","border-top","border-bottom"],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"justify-content-end","mx-4"],["mat-button","",1,"btn","btn-light","mx-3",3,"click"],["mat-button","","data-cy","scan",1,"btn","btn-success","mx-3",3,"click"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],["name","scanType",1,"form-control","h-100","pt-5","round",3,"ngModel","ngModelChange"],["data-toggle","tooltip","title","Full Scan Product",1,"me-5",3,"value"],["data-toggle","tooltip","title","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","pt-5","round",3,"ngModel","disabled","ngModelChange"],["data-toggle","tooltip","title","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["data-toggle","tooltip","title","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"]],template:function(f,h){1&f&&(l.TgZ(0,"h1",0),l._uU(1,"Scan Marketplace"),l.qZA(),l.TgZ(2,"mat-dialog-content",1)(3,"div")(4,"h5",2),l._uU(5,"Select a Channel"),l.qZA(),l.TgZ(6,"mat-form-field",3)(7,"mat-select",4),l.NdJ("ngModelChange",function(U){return h.data.filter.ChannelID=U})("ngModelChange",function(U){return h.onSelectChannel(U)}),l.YNc(8,I,3,3,"mat-option",5),l.qZA()()(),l.YNc(9,Z,8,3,"div",6),l.YNc(10,J,9,8,"div",7),l.qZA(),l.TgZ(11,"mat-dialog-actions",8)(12,"button",9),l.NdJ("click",function(){return h.close()}),l._uU(13," Cancel "),l.qZA(),l.TgZ(14,"button",10),l.NdJ("click",function(){return h.submit()}),l._uU(15," Scan "),l.qZA()()),2&f&&(l.xp6(7),l.Q6J("ngModel",h.data.filter.ChannelID),l.xp6(1),l.Q6J("ngForOf",h.data.Channel),l.xp6(1),l.Q6J("ngIf",(h.showScanType||!h.isSingleChannel)&&!h.isTokopedia&&h.isNotEmpty(h.data.filter.ChannelID)),l.xp6(1),l.Q6J("ngIf",((null==h.selectedChannel?null:h.selectedChannel.TypeID)==h.channelType.ShopeeV2||(null==h.selectedChannel?null:h.selectedChannel.TypeID)==h.channelType.Tiktok)&&(null==h.selectedChannel?null:h.selectedChannel.LastSync)&&h.showScanUpdateType))},dependencies:[t.sg,t.O5,y.JJ,y.On,u.uh,u.xY,u.H8,P.VQ,P.U0,p.KE,s.gD,_.ey,t.uU],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:60px}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),x})()},1889:(L,O,c)=>{c.d(O,{g:()=>u});let u=(()=>{class g{static IsNotEmpty(l){return""!=l&&l!=g.GuidEMpty&&null!=l&&null!=l}static IsEmpty(l){return""==l||null==l||null==l||l==g.GuidEMpty}}return g.GuidEMpty="00000000-0000-0000-0000-000000000000",g})()},9694:(L,O,c)=>{c.d(O,{x:()=>u});var u=(()=>{return(g=u||(u={}))[g.Shopee=0]="Shopee",g[g.Tokopedia=1]="Tokopedia",g[g.WooCommerce=2]="WooCommerce",g[g.None=3]="None",g[g.KalCare=4]="KalCare",g[g.ShopeeV2=5]="ShopeeV2",g[g.Tiktok=6]="Tiktok",g[g.Lazada=7]="Lazada",u;var g})()},7287:(L,O,c)=>{c.d(O,{b:()=>Y});var u=c(4482),g=c(5403),m=c(8421),l=c(4671),t=c(5032),y=c(3269),p=c(4707),s=c(3099),I=c(1135),Z=c(7579),J=c(2722),B=c(9300),x=c(4351),N=c(4004),f=c(5026),h=c(8505),D=c(4650),U=c(1318);let Y=(()=>{class T{constructor(C){this.http=C,this.pagination$=new I.X(null),this.destroy$=new Z.x,this.data$=this.paginationFunction()}onNextPage(C){C.PageNumber+=1,this.pagination$.next(C)}setPageNumberFooter(C){this.footerPageNumber=C.PageNumber}setPaginationButtonState(C,S){this.disableNextButton=0==S||!(S<C.RowCount*C.PageNumber)}resetToFirstPage(C){C.PageNumber=1,this.pagination$.next(C),this.hideCount=!0,this.goToLastPage=!1}getAllData(C,S){C.RowCount=S,this.pagination$.next(C),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new I.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,J.R)(this.destroy$),(0,B.h)(C=>null!=C),(0,x.b)(C=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(C)).pipe((0,N.U)(S=>S.Data))),function P(...T){const A=(0,y.jO)(T);return(0,u.e)((C,S)=>{const k=T.length,v=new Array(k);let w=T.map(()=>!1),F=!1;for(let M=0;M<k;M++)(0,m.Xf)(T[M]).subscribe((0,g.x)(S,E=>{v[M]=E,!F&&!w[M]&&(w[M]=!0,(F=w.every(l.y))&&(w=null))},t.Z));C.subscribe((0,g.x)(S,M=>{if(F){const E=[M,...v];S.next(A?A(...E):E)}}))})}(this.pagination$),(0,f.R)((C,S)=>{const[k,v]=C,[w]=S;return 1==v.PageNumber?[w,v]:[k.concat(w),v]}),(0,h.b)(([C,S])=>{this.setPageNumberFooter(S),this.setPaginationButtonState(S,C.length)}),(0,N.U)(([C])=>C),function _(T,A,C){let S,k=!1;return T&&"object"==typeof T?({bufferSize:S=1/0,windowTime:A=1/0,refCount:k=!1,scheduler:C}=T):S=T??1/0,(0,s.B)({connector:()=>new p.t(S,A,C),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:k})}())}}return T.\u0275fac=function(C){return new(C||T)(D.LFG(U.O))},T.\u0275prov=D.Yz7({token:T,factory:T.\u0275fac,providedIn:"root"}),T})()},6082:(L,O,c)=>{c.d(O,{M:()=>t});var u=c(8505),g=c(4650),m=c(1318),l=c(7185);let t=(()=>{class y{constructor(p,s){this.httpService=p,this.toastrService=s}filterChannel(p,s){return p.filter(_=>-1!==s.findIndex(I=>_.TypeID==I))}uploadSingleProduct(p,s,_){return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:s,Products:[p.ID],CategoryID:_||0}).pipe((0,u.b)(()=>{this.toastrService.success(p.Name+" Successfully Created","Success")}))}uploadProducts(p,s,_){const I=p.map(J=>J.ID);return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:s,Products:I,CategoryID:_||0})}scanSingle(p,s){return this.httpService.post("/api/product/ScanSingle",{ID:p,SKU:s})}scanNotInChannel(p){return this.httpService.post("/api/product/ScanNotinChannel",{ID:p})}findAllSoldInChannel(p){return this.httpService.post("/api/product/GetSoldInChannel",p)}scanAll(p,s,_){return this.httpService.post("/api/product/ScanOptimized",{ID:p,ScanFull:s,UpdatedProduct:_})}getVariantCodesProduct(p){return p.Variants.map(_=>_.Code)}getVariantCodesProducts(p=[]){let s=[];return p.forEach(_=>{_.Variants.forEach(I=>{s=[...s,I.Code]})}),s}filterUnselectedChannel(p,s){let _;return _=p.Channel&&0!=p.Channel.length?s.filter(I=>-1===p.Channel.findIndex(Z=>Z.ChannelID==I.ID)):s,_}findChannelById(p,s){return s.find(_=>_.ID==p)}sortChannel(p){return p.sort((s,_)=>s.TypeID<_.TypeID?1:s.TypeID===_.TypeID?0:-1)}hasSelection(p=[]){return this.selectedProduct(p).length>0}selectedProduct(p=[]){return p.filter(s=>s.selected)}hasSelectionVariant(p){return this.selectedVariantProduct(p).length>0}selectedVariantProduct(p){let s=[];return p.forEach(_=>{s=[...s,..._.Variants.filter(I=>I.selected)]}),s}}return y.\u0275fac=function(p){return new(p||y)(g.LFG(m.O),g.LFG(l._W))},y.\u0275prov=g.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"}),y})()}}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e,v={},_={};function r(e){var n=_[e];if(void 0!==n)return n.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(n,t,f,i)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,f,i]=e[o],s=!0,c=0;c<t.length;c++)(!1&i||a>=i)&&Object.keys(r.O).every(u=>r.O[u](t[c]))?t.splice(c--,1):(s=!1,i<a&&(a=i));if(s){e.splice(o--,1);var l=f();void 0!==l&&(n=l)}}return n}i=i||0;for(var o=e.length;o>0&&e[o-1][2]>i;o--)e[o]=e[o-1];e[o]=[t,f,i]},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 i=Object.create(null);r.r(i);var o={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(s=>o[s]=()=>t[s]);return o.default=()=>t,r.d(i,o),i}})(),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)+"."+{6:"fc79ecc0c0a33462",61:"6bf2570c9c03e65d",146:"e83dc5a5498a6408",285:"1f547ef81e91fc15",288:"9b236c96f7411cc2",327:"36b24b9d7be528d8",402:"76aaae9b8dfdc4fd",458:"455af1a928a7caa9",466:"02b13502d80588a2",472:"2a25cc631023dd9d",512:"84e77b4b4a7a1db7",585:"c93552ac67f4550c",592:"f2cd628914f2fae7",616:"507588c0a5d7b9e1",717:"5259a4803cce95ab",739:"82b92600f9519019",767:"297995f3aba0da57",796:"3be8ad424aad7864",970:"3f4eb2182e0ed6ff"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,i,o)=>{if(e[t])e[t].push(f);else{var a,s;if(void 0!==i)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var d=c[l];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==n+i){a=d;break}}a||(s=!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+i),a.src=r.tu(t)),e[t]=[f];var p=(g,u)=>{a.onerror=a.onload=null,clearTimeout(b);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(u)),g)return g(u)},b=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),s&&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.3.8/Marketplace/",(()=>{var e={666:0};r.f.j=(f,i)=>{var o=r.o(e,f)?e[f]:void 0;if(0!==o)if(o)i.push(o[2]);else if(666!=f){var a=new Promise((d,p)=>o=e[f]=[d,p]);i.push(o[2]=a);var s=r.p+r.u(f),c=new Error;r.l(s,d=>{if(r.o(e,f)&&(0!==(o=e[f])&&(e[f]=void 0),o)){var p=d&&("load"===d.type?"missing":d.type),b=d&&d.target&&d.target.src;c.message="Loading chunk "+f+" failed.\n("+p+": "+b+")",c.name="ChunkLoadError",c.type=p,c.request=b,o[1](c)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,i)=>{var c,l,[o,a,s]=i,d=0;if(o.some(b=>0!==e[b])){for(c in a)r.o(a,c)&&(r.m[c]=a[c]);if(s)var p=s(r)}for(f&&f(i);d<o.length;d++)r.o(e,l=o[d])&&e[l]&&e[l][0](),e[l]=0;return r.O(p)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();