marketplacepos 3.11.6 → 3.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{a as xe,b as Oe}from"./chunk-G5LCLRIW.js";import{a as Ee}from"./chunk-5ZUWMFL5.js";import{g as we}from"./chunk-DT3B54LD.js";import{d as ve,e as Me}from"./chunk-AL67KXJV.js";import{f as Ie}from"./chunk-5DJHCNOC.js";import{b as _e,e as ye}from"./chunk-K3G6FMDF.js";import{A as E,q as j,s as x,t as O,z as w}from"./chunk-ZKBLXGXT.js";import{U as De}from"./chunk-6B64VOO7.js";import{b as be,h as B,k as R,u as Te}from"./chunk-SP6QPE3M.js";import{b as p,c as y}from"./chunk-6F6NSBIF.js";import{$ as se,Ab as c,B as oe,Bb as b,Cb as T,Eb as P,Fb as V,Gb as N,H as le,Ha as M,Ia as s,Ja as f,K as re,Kb as me,Rb as $,Sb as Z,T as J,Tb as he,Ub as K,V as H,Wa as u,Xa as X,Xc as Se,Ya as d,Za as pe,aa as de,c as W,ca as q,fb as l,gb as r,ha as S,hb as _,ia as ce,ib as U,ic as fe,jb as F,kc as D,lb as k,lc as A,n as ie,ob as g,pa as I,pc as ge,q as ae,qa as v,qb as h,rc as ue,sc as Ce,za as Q,zb as G}from"./chunk-6DRNAUKE.js";function Le(o,n){if(o&1&&(l(0,"mat-option",9)(1,"div",10),_(2,"img",11),l(3,"span"),c(4),r()()()),o&2){let i=n.$implicit;d("value",i.ID)("disabled",i.disabled),s(),d("matTooltip",i.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",i.Img,M),s(2),b(i.Name)}}function Ue(o,n){if(o&1){let i=k();l(0,"div",12)(1,"label",13),c(2,"Scan Type"),r(),l(3,"mat-radio-group",14),N("ngModelChange",function(e){I(i);let a=h();return V(a.filter.ScanFull,e)||(a.filter.ScanFull=e),v(e)}),l(4,"mat-radio-button",15),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",16),c(7," Active "),r()()()}if(o&2){let i=h();s(3),P("ngModel",i.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Fe(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2),$(3,"date"),r(),l(4,"mat-radio-group",18),N("ngModelChange",function(e){I(i);let a=h();return V(a.filter.UpdatedProduct,e)||(a.filter.UpdatedProduct=e),v(e)}),l(5,"mat-radio-button",19),c(6," Scan All Products "),r(),l(7,"mat-radio-button",20),c(8),r()()()}if(o&2){let i=h();s(2),T(" Last Scan: ",he(3,6,i.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),s(2),P("ngModel",i.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),T(" ",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ae(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",21),N("ngModelChange",function(e){I(i);let a=h();return V(a.filter.Async,e)||(a.filter.Async=e),v(e)}),l(4,"mat-radio-button",22),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",23),c(7," Synchronous (Wait until Complete) "),r()()()}if(o&2){let i=h();s(3),P("ngModel",i.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var rt=(()=>{let n=class n{constructor(t,e,a){this.dialogRef=t,this.data=e,this.router=a,this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:y.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=y.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=y.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&y.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&y.IsNotEmpty(this.selectedChannel?.LastSync)&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(a=>a.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(t){return y.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(e){return new(e||n)(f(x),f(O),f(Se))},n.\u0275cmp=S({type:n,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,a){e&1&&(l(0,"modal-material",0),g("onOk",function(){return a.submit()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(a.filter.ChannelID,C)||(a.filter.ChannelID=C),C}),g("ngModelChange",function(C){return a.onSelectChannel(C)}),u(7,Le,5,5,"mat-option",6),r()(),u(8,Ue,8,3,"div",7)(9,Fe,9,9,"div",8)(10,Ae,8,3,"div",8),r()()()),e&2&&(d("dynamicValidated",a.isNotEmpty(a.filter.ChannelID))("config",a.modalConfig),s(6),d("disabled",a.disabledChannelOption),P("ngModel",a.filter.ChannelID),s(),d("ngForOf",a.channelOptions),s(),d("ngIf",!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)),s(),d("ngIf",a.hasScanUpdate),s(),d("ngIf",!(a.filter!=null&&a.filter.UpdatedProduct)&&!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)))},dependencies:[D,A,B,R,xe,Oe,we,Ee,De,j,E,ge],encapsulation:2});let o=n;return o})();var L=function(o){return o.Tokopedia="https://seller.tokopedia.com",o.Shoope="https://seller.shopee.co.id",o.Tiktok="https://seller-id.tiktok.com",o.WooCommerce="https://woocommerce.dealpos.app",o.Lazada="https://sellercenter.lazada.co.id",o}(L||{});var Be=o=>({"is-disabled":o});function Re(o,n){if(o&1&&(U(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),F()),o&2){let i=h().$implicit;s(3),T(" ",i==null?null:i.Model,""),s(2),T(" ",i==null?null:i.Code,"")}}function je(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;X("rowspan",i.Channel.length),s(),T(" ",i==null?null:i.Model,"")}}function We(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;X("rowspan",i.Channel.length),s(),T(" ",i==null?null:i.Code,"")}}function $e(o,n){if(o&1&&(l(0,"tr"),u(1,je,2,2,"td",14)(2,We,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),$(11,"number"),r(),l(12,"td",19),c(13),$(14,"number"),r(),l(15,"td",19)(16,"a",20),_(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),o&2){let i=n.$implicit,t=n.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",i.Url,M)("title",i.Title),s(),d("src",e.getChannelLogo(i.TypeID),M),s(),d("matTooltip",(i==null||i.Name==null?null:i.Name.length)>55?i==null?null:i.Name:""),s(),T(" ",i.Name," "),s(2),b(Z(11,12,i.Price)),s(3),b(Z(14,14,i.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(i),M)("ngClass",me(16,Be,i.TypeID==e.channelType.KalCare))("matTooltip",i.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function ze(o,n){if(o&1&&u(0,$e,20,18,"tr",9),o&2){let i=h().$implicit;d("ngForOf",i==null?null:i.Channel)}}function He(o,n){if(o&1&&(U(0),u(1,Re,9,2,"ng-container",10)(2,ze,1,1,"ng-template",null,0,K),F()),o&2){let i=n.$implicit,t=G(3);s(),d("ngIf",!i.Channel||i.Channel.length<1)("ngIfElse",t)}}var gt=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return y.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=S({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,a){e&1&&(l(0,"modal-material",1),g("onCancel",function(){return a.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),_(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),_(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),_(19,"th",5),r()(),l(20,"tbody"),u(21,He,4,2,"ng-container",9),r()()()()),e&2&&(d("config",a.modalConfig),s(21),d("ngForOf",a.variants))},dependencies:[fe,D,A,j,E,ue],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let o=n;return o})();var Y=class{constructor(){this._input$=new W,this._destroy$=new W,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(le(200),re(),ae(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),oe(n=>n!==void 0),H(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let i=-1,t;return this._data.filter(a=>(t=JSON.stringify(a).toLowerCase(),i=t.indexOf(n),i!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,i){if(y.IsNotEmpty(n)){let t=this._data.filter(e=>e[i].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,i=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(i)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var Ve=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new Y,this.selectedChange=new Q,this.selectedLabel=new Q}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=S({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"clear","scrollToEnd","change","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo"]],template:function(e,a){e&1&&(l(0,"ng-select",0),g("clear",function(){return a.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return a.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(C){return a.onSelectChange(C)}),r()),e&2&&(pe("width",a.width),d("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable)("appendTo",a.parent))},dependencies:[ve,B,R]});let o=n;return o})(),kt=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=ce({type:n}),n.\u0275inj=de({imports:[Ce,Me,Te]});let o=n;return o})();var Ne=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(J(a=>a!=null?ie(a):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let a={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",a).pipe(J(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};n.\u0275fac=function(e){return new(e||n)(q(Ie),q(ye))},n.\u0275prov=se({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function Ye(o,n){if(o&1){let i=k();U(0),l(1,"ng-select-infinite",16),g("selectedChange",function(e){I(i);let a=h().index,m=h();return v(m.onSelectCategory(e,a))}),r(),F()}if(o&2){let i=h().$implicit;s(),d("items",i.Categories)("clearable",!1)}}function Je(o,n){if(o&1&&(l(0,"div",17),_(1,"input",18),r()),o&2){let i=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==i.TypeID||t.channelType.Shopify==i.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(i.TypeID))}}function qe(o,n){if(o&1){let i=k();U(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let a=I(i).$implicit;return V(a.Selected,e)||(a.Selected=e),v(e)}),g("ngModelChange",function(){I(i);let e=h();return v(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),_(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),u(10,Ye,2,2,"ng-container",15)(11,Je,2,2,"ng-template",null,0,K),r()(),F()}if(o&2){let i=n.$implicit,t=G(12);s(3),P("ngModel",i.Selected),s(3),d("src",i==null?null:i.Img,M)("alt",i.Name),s(2),b(i.Name),s(2),d("ngIf",i.Categories.length>0)("ngIfElse",t)}}var Rt=(()=>{let n=class n{constructor(t,e,a,m){this.data=t,this.channelService=e,this.dialogRef=a,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new W,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(a=>{this.setCategoriesChannelOption(e.channelType,a)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(a=>(a.TypeID==t&&(a.Categories=e),a))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,a,m)=>m.findIndex(C=>e.channelType==C.channelType)==a).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(f(O),f(Ne),f(x),f(_e))},n.\u0275cmp=S({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,a){e&1&&(l(0,"modal-material",1),g("onOk",function(){return a.onSave()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),g("change",function(C){return a.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,qe,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",a.enableBtnOk)("config",a.modalConfig),s(14),d("ngForOf",a.channelOptions))},dependencies:[D,A,be,B,R,j,E,Ve],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
1
+ import{a as xe,b as Oe}from"./chunk-G5LCLRIW.js";import{a as Ee}from"./chunk-5ZUWMFL5.js";import{g as we}from"./chunk-DT3B54LD.js";import{d as ve,e as Me}from"./chunk-AL67KXJV.js";import{f as Ie}from"./chunk-7QECCYLR.js";import{b as _e,e as ye}from"./chunk-K3G6FMDF.js";import{A as E,q as j,s as x,t as O,z as w}from"./chunk-ZKBLXGXT.js";import{U as De}from"./chunk-6B64VOO7.js";import{b as be,h as B,k as R,u as Te}from"./chunk-SP6QPE3M.js";import{b as p,c as y}from"./chunk-6F6NSBIF.js";import{$ as se,Ab as c,B as oe,Bb as b,Cb as T,Eb as P,Fb as V,Gb as N,H as le,Ha as M,Ia as s,Ja as f,K as re,Kb as me,Rb as $,Sb as Z,T as J,Tb as he,Ub as K,V as H,Wa as u,Xa as X,Xc as Se,Ya as d,Za as pe,aa as de,c as W,ca as q,fb as l,gb as r,ha as S,hb as _,ia as ce,ib as U,ic as fe,jb as F,kc as D,lb as k,lc as A,n as ie,ob as g,pa as I,pc as ge,q as ae,qa as v,qb as h,rc as ue,sc as Ce,za as Q,zb as G}from"./chunk-6DRNAUKE.js";function Le(o,n){if(o&1&&(l(0,"mat-option",9)(1,"div",10),_(2,"img",11),l(3,"span"),c(4),r()()()),o&2){let i=n.$implicit;d("value",i.ID)("disabled",i.disabled),s(),d("matTooltip",i.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",i.Img,M),s(2),b(i.Name)}}function Ue(o,n){if(o&1){let i=k();l(0,"div",12)(1,"label",13),c(2,"Scan Type"),r(),l(3,"mat-radio-group",14),N("ngModelChange",function(e){I(i);let a=h();return V(a.filter.ScanFull,e)||(a.filter.ScanFull=e),v(e)}),l(4,"mat-radio-button",15),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",16),c(7," Active "),r()()()}if(o&2){let i=h();s(3),P("ngModel",i.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Fe(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2),$(3,"date"),r(),l(4,"mat-radio-group",18),N("ngModelChange",function(e){I(i);let a=h();return V(a.filter.UpdatedProduct,e)||(a.filter.UpdatedProduct=e),v(e)}),l(5,"mat-radio-button",19),c(6," Scan All Products "),r(),l(7,"mat-radio-button",20),c(8),r()()()}if(o&2){let i=h();s(2),T(" Last Scan: ",he(3,6,i.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),s(2),P("ngModel",i.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),T(" ",i.selectedChannel.TypeID==i.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ae(o,n){if(o&1){let i=k();l(0,"div",17)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",21),N("ngModelChange",function(e){I(i);let a=h();return V(a.filter.Async,e)||(a.filter.Async=e),v(e)}),l(4,"mat-radio-button",22),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",23),c(7," Synchronous (Wait until Complete) "),r()()()}if(o&2){let i=h();s(3),P("ngModel",i.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var rt=(()=>{let n=class n{constructor(t,e,a){this.dialogRef=t,this.data=e,this.router=a,this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:y.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=y.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=y.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&y.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&y.IsNotEmpty(this.selectedChannel?.LastSync)&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(a=>a.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(t){return y.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(e){return new(e||n)(f(x),f(O),f(Se))},n.\u0275cmp=S({type:n,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,a){e&1&&(l(0,"modal-material",0),g("onOk",function(){return a.submit()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(a.filter.ChannelID,C)||(a.filter.ChannelID=C),C}),g("ngModelChange",function(C){return a.onSelectChannel(C)}),u(7,Le,5,5,"mat-option",6),r()(),u(8,Ue,8,3,"div",7)(9,Fe,9,9,"div",8)(10,Ae,8,3,"div",8),r()()()),e&2&&(d("dynamicValidated",a.isNotEmpty(a.filter.ChannelID))("config",a.modalConfig),s(6),d("disabled",a.disabledChannelOption),P("ngModel",a.filter.ChannelID),s(),d("ngForOf",a.channelOptions),s(),d("ngIf",!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)),s(),d("ngIf",a.hasScanUpdate),s(),d("ngIf",!(a.filter!=null&&a.filter.UpdatedProduct)&&!a.isSingleChannel&&a.isNotEmpty(a.filter.ChannelID)))},dependencies:[D,A,B,R,xe,Oe,we,Ee,De,j,E,ge],encapsulation:2});let o=n;return o})();var L=function(o){return o.Tokopedia="https://seller.tokopedia.com",o.Shoope="https://seller.shopee.co.id",o.Tiktok="https://seller-id.tiktok.com",o.WooCommerce="https://woocommerce.dealpos.app",o.Lazada="https://sellercenter.lazada.co.id",o}(L||{});var Be=o=>({"is-disabled":o});function Re(o,n){if(o&1&&(U(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),F()),o&2){let i=h().$implicit;s(3),T(" ",i==null?null:i.Model,""),s(2),T(" ",i==null?null:i.Code,"")}}function je(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;X("rowspan",i.Channel.length),s(),T(" ",i==null?null:i.Model,"")}}function We(o,n){if(o&1&&(l(0,"td",11),c(1),r()),o&2){let i=h(3).$implicit;X("rowspan",i.Channel.length),s(),T(" ",i==null?null:i.Code,"")}}function $e(o,n){if(o&1&&(l(0,"tr"),u(1,je,2,2,"td",14)(2,We,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),$(11,"number"),r(),l(12,"td",19),c(13),$(14,"number"),r(),l(15,"td",19)(16,"a",20),_(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),o&2){let i=n.$implicit,t=n.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",i.Url,M)("title",i.Title),s(),d("src",e.getChannelLogo(i.TypeID),M),s(),d("matTooltip",(i==null||i.Name==null?null:i.Name.length)>55?i==null?null:i.Name:""),s(),T(" ",i.Name," "),s(2),b(Z(11,12,i.Price)),s(3),b(Z(14,14,i.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(i),M)("ngClass",me(16,Be,i.TypeID==e.channelType.KalCare))("matTooltip",i.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function ze(o,n){if(o&1&&u(0,$e,20,18,"tr",9),o&2){let i=h().$implicit;d("ngForOf",i==null?null:i.Channel)}}function He(o,n){if(o&1&&(U(0),u(1,Re,9,2,"ng-container",10)(2,ze,1,1,"ng-template",null,0,K),F()),o&2){let i=n.$implicit,t=G(3);s(),d("ngIf",!i.Channel||i.Channel.length<1)("ngIfElse",t)}}var gt=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return y.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=S({type:n,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,a){e&1&&(l(0,"modal-material",1),g("onCancel",function(){return a.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),_(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),_(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),_(19,"th",5),r()(),l(20,"tbody"),u(21,He,4,2,"ng-container",9),r()()()()),e&2&&(d("config",a.modalConfig),s(21),d("ngForOf",a.variants))},dependencies:[fe,D,A,j,E,ue],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let o=n;return o})();var Y=class{constructor(){this._input$=new W,this._destroy$=new W,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(le(200),re(),ae(n=>(n&&(n=n.toLowerCase()),this.filterData(n))),oe(n=>n!==void 0),H(this._destroy$)).subscribe(n=>{this._dataBuffer=n.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(n){let i=-1,t;return this._data.filter(a=>(t=JSON.stringify(a).toLowerCase(),i=t.indexOf(n),i!==-1||n==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(n){this._data=n||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(n,i){if(y.IsNotEmpty(n)){let t=this._data.filter(e=>e[i].toString().toLowerCase().indexOf(n)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(n){this._bufferSize=n}onScrollToEnd(){this.fetchMore()}fetchMore(){let n=this._dataBuffer.length,i=this._data.slice(n,this._bufferSize+n);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(i)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var Ve=(()=>{let n=class n{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.width="100%",this.clearable=!0,this.disabled=!1,this.ngSelectInfiniteScroll=new Y,this.selectedChange=new Q,this.selectedLabel=new Q}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=S({type:n,selectors:[["ng-select-infinite"]],inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:1,vars:12,consts:[[3,"clear","scrollToEnd","change","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo"]],template:function(e,a){e&1&&(l(0,"ng-select",0),g("clear",function(){return a.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return a.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(C){return a.onSelectChange(C)}),r()),e&2&&(pe("width",a.width),d("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable)("appendTo",a.parent))},dependencies:[ve,B,R]});let o=n;return o})(),kt=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=ce({type:n}),n.\u0275inj=de({imports:[Ce,Me,Te]});let o=n;return o})();var Ne=(()=>{let n=class n{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(J(a=>a!=null?ie(a):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let a={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",a).pipe(J(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};n.\u0275fac=function(e){return new(e||n)(q(Ie),q(ye))},n.\u0275prov=se({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function Ye(o,n){if(o&1){let i=k();U(0),l(1,"ng-select-infinite",16),g("selectedChange",function(e){I(i);let a=h().index,m=h();return v(m.onSelectCategory(e,a))}),r(),F()}if(o&2){let i=h().$implicit;s(),d("items",i.Categories)("clearable",!1)}}function Je(o,n){if(o&1&&(l(0,"div",17),_(1,"input",18),r()),o&2){let i=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==i.TypeID||t.channelType.Shopify==i.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(i.TypeID))}}function qe(o,n){if(o&1){let i=k();U(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let a=I(i).$implicit;return V(a.Selected,e)||(a.Selected=e),v(e)}),g("ngModelChange",function(){I(i);let e=h();return v(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),_(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),u(10,Ye,2,2,"ng-container",15)(11,Je,2,2,"ng-template",null,0,K),r()(),F()}if(o&2){let i=n.$implicit,t=G(12);s(3),P("ngModel",i.Selected),s(3),d("src",i==null?null:i.Img,M)("alt",i.Name),s(2),b(i.Name),s(2),d("ngIf",i.Categories.length>0)("ngIfElse",t)}}var Rt=(()=>{let n=class n{constructor(t,e,a,m){this.data=t,this.channelService=e,this.dialogRef=a,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new W,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(a=>{this.setCategoriesChannelOption(e.channelType,a)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(a=>(a.TypeID==t&&(a.Categories=e),a))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,a,m)=>m.findIndex(C=>e.channelType==C.channelType)==a).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};n.\u0275fac=function(e){return new(e||n)(f(O),f(Ne),f(x),f(_e))},n.\u0275cmp=S({type:n,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,a){e&1&&(l(0,"modal-material",1),g("onOk",function(){return a.onSave()})("onClose",function(){return a.onClose()})("onCancel",function(){return a.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),g("change",function(C){return a.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),u(14,qe,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",a.enableBtnOk)("config",a.modalConfig),s(14),d("ngForOf",a.channelOptions))},dependencies:[D,A,be,B,R,j,E,Ve],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
2
2
  `],encapsulation:2});let o=n;return o})();function Qe(o,n){if(o&1&&(l(0,"tr")(1,"td"),c(2),r(),l(3,"td"),c(4),r()()),o&2){let i=n.$implicit;s(2),b(i==null?null:i.Name),s(2),b(i==null?null:i.ChannelVariationSKU)}}var zt=(()=>{let n=class n{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new w,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}};n.\u0275fac=function(e){return new(e||n)(f(O),f(x))},n.\u0275cmp=S({type:n,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,a){e&1&&(l(0,"modal-material",0),g("onCancel",function(){return a.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),c(6,"Variant"),r(),l(7,"th"),c(8,"SKU"),r()()(),l(9,"tbody"),u(10,Qe,5,2,"tr",4),r()()()()),e&2&&(d("config",a.modalConfig),s(10),d("ngForOf",a.data.variants))},dependencies:[D,E],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let o=n;return o})();export{rt as a,gt as b,kt as c,Rt as d,zt as e};
@@ -1,4 +1,4 @@
1
- import{e as Ne}from"./chunk-K3G6FMDF.js";import{a as Le,b as ue,c as He,d as $e,e as de,f as We,g as he,h as Ue,i as q,j as pe,k as E}from"./chunk-JM3LERUP.js";import{b as le,c as z,d as Ke}from"./chunk-6F6NSBIF.js";import{$ as b,$b as ce,A as Pe,B as De,Ca as H,I as ie,N as xe,Q as se,Qa as $,T as x,U as ae,Vb as Re,Wb as je,X as K,Xc as Fe,aa as F,b as g,ba as y,c as X,ca as h,ea as _e,g as Ee,h as Te,ia as L,k as M,l as N,m as _,n as U,q as P,r as Ce,sc as Oe,tc as Me,uc as Be}from"./chunk-6DRNAUKE.js";import{a as oe,i as I}from"./chunk-GRMIXZTT.js";var ze={production:!0,version:"3.11.6",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v1/content?fetch=children:omni&sort=sortOrder:asc"};var qe=(()=>{let i=class i{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let o=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(o)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var ft="firebase",gt="10.12.1";q(ft,gt,"app");var G=new Re("ANGULARFIRE2_VERSION");var mt=(r,i)=>{let t=i?[i]:Ue(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},V=class{constructor(){return mt(wt)}},wt="app-check";function fe(){}var Y=class{zone;delegate;constructor(i,t=Te){this.zone=i,this.delegate=t}now(){return this.delegate.now()}schedule(i,t,e){let n=this.zone,o=function(s){n.runGuarded(()=>{i.apply(this,[s])})};return this.delegate.schedule(o,t,e)}},ge=class{zone;task=null;constructor(i){this.zone=i}call(i,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",fe,{},fe,fe)),t.pipe(K({next:e,complete:e,error:e})).subscribe(i).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},Ve=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Y(Zone.current)),this.insideAngular=t.run(()=>new Y(Zone.current,Ee)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h($))};static \u0275prov=b({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function At(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
1
+ import{e as Ne}from"./chunk-K3G6FMDF.js";import{a as Le,b as ue,c as He,d as $e,e as de,f as We,g as he,h as Ue,i as q,j as pe,k as E}from"./chunk-JM3LERUP.js";import{b as le,c as z,d as Ke}from"./chunk-6F6NSBIF.js";import{$ as b,$b as ce,A as Pe,B as De,Ca as H,I as ie,N as xe,Q as se,Qa as $,T as x,U as ae,Vb as Re,Wb as je,X as K,Xc as Fe,aa as F,b as g,ba as y,c as X,ca as h,ea as _e,g as Ee,h as Te,ia as L,k as M,l as N,m as _,n as U,q as P,r as Ce,sc as Oe,tc as Me,uc as Be}from"./chunk-6DRNAUKE.js";import{a as oe,i as I}from"./chunk-GRMIXZTT.js";var ze={production:!0,version:"3.11.7",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v1/content?fetch=children:omni&sort=sortOrder:asc"};var qe=(()=>{let i=class i{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let o=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(o)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var ft="firebase",gt="10.12.1";q(ft,gt,"app");var G=new Re("ANGULARFIRE2_VERSION");var mt=(r,i)=>{let t=i?[i]:Ue(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},V=class{constructor(){return mt(wt)}},wt="app-check";function fe(){}var Y=class{zone;delegate;constructor(i,t=Te){this.zone=i,this.delegate=t}now(){return this.delegate.now()}schedule(i,t,e){let n=this.zone,o=function(s){n.runGuarded(()=>{i.apply(this,[s])})};return this.delegate.schedule(o,t,e)}},ge=class{zone;task=null;constructor(i){this.zone=i}call(i,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",fe,{},fe,fe)),t.pipe(K({next:e,complete:e,error:e})).subscribe(i).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},Ve=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Y(Zone.current)),this.insideAngular=t.run(()=>new Y(Zone.current,Ee)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h($))};static \u0275prov=b({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function At(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
2
2
  provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return r}function Ge(r){return kt(At())(r)}function kt(r){return function(t){return t=t.lift(new ge(r.ngZone)),t.pipe(N(r.outsideAngular),M(r.insideAngular))}}var bt="firebase",St="10.12.1";E.registerVersion(bt,St,"app-compat");var It=["ngOnDestroy"],Ze=(r,i,t,e={})=>new Proxy(r,{get:(n,o)=>t.runOutsideAngular(()=>{if(r[o])return e?.spy?.get&&e.spy.get(o,r[o]),r[o];if(It.indexOf(o)>-1)return()=>{};let s=i.toPromise().then(a=>{let c=a?.[o];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(o,l,u),u})})})});var Q=class{constructor(i){return i}},ee=new y("angularfire2.app.options"),te=new y("angularfire2.app.name");function me(r,i,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=E.apps.filter(a=>a&&a.name===n.name)[0]||i.runOutsideAngular(()=>E.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(s.options)){let a=!!module.hot;yt("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new Q(s)}var yt=(r,...i)=>{ce()&&typeof console<"u"&&console[r](...i)},Et={provide:Q,useFactory:me,deps:[ee,$,[new _e,te]]},Rn=(()=>{class r{static initializeApp(t,e){return{ngModule:r,providers:[{provide:ee,useValue:t},{provide:te,useValue:e}]}}constructor(t){E.registerVersion("angularfire",G.full,"core"),E.registerVersion("angularfire",G.full,"app-compat"),E.registerVersion("angular",je.full,t.toString())}static \u0275fac=function(e){return new(e||r)(h(H))};static \u0275mod=L({type:r});static \u0275inj=F({providers:[Et]})}return r})();function Xe(r,i,t,e,n){let[,o,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return Tt(n,s)||(Je("error",`${i} was already initialized on the ${t} Firebase App with different settings.${Ct?" You may need to reload as Firebase is not HMR aware.":""}`),Je("warn",{is:n,was:s})),o;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function Tt(r,i){try{return r.toString()===i.toString()}catch{return r===i}}var Ct=typeof module<"u"&&!!module.hot,Je=(r,...i)=>{ce()&&typeof console<"u"&&console[r](...i)};globalThis.\u0275AngularfireInstanceCache||=[];var Pt=new Map,Dt={activated:!1,tokenObservers:[]},xt={initialized:!1,enabled:!1};function T(r){return Pt.get(r)||Object.assign({},Dt)}function nt(){return xt}var _t="https://content-firebaseappcheck.googleapis.com/v1";var Rt="exchangeDebugToken",Ye={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},zn=24*60*60*1e3;var Ae=class{constructor(i,t,e,n,o){if(this.operation=i,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(i){return I(this,null,function*(){this.stop();try{this.pending=new ue,this.pending.promise.catch(t=>{}),yield jt(this.getNextRun(i)),this.pending.resolve(),yield this.pending.promise,this.pending=new ue,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(i){if(i)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function jt(r){return new Promise(i=>{setTimeout(i,r)})}var Ot={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},R=new $e("appCheck","AppCheck",Ot);function rt(r){if(!T(r).activated)throw R.create("use-before-activation",{appName:r.name})}function ot(e,n){return I(this,arguments,function*({url:r,body:i},t){let o={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(i),headers:o},c;try{c=yield fetch(r,a)}catch(f){throw R.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw R.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw R.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw R.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function it(r,i){let{projectId:t,appId:e,apiKey:n}=r.options;return{url:`${_t}/projects/${t}/apps/${e}:${Rt}?key=${n}`,body:{debug_token:i}}}var Mt="firebase-app-check-database",Bt=1,ke="firebase-app-check-store";var ne=null;function Nt(){return ne||(ne=new Promise((r,i)=>{try{let t=indexedDB.open(Mt,Bt);t.onsuccess=e=>{r(e.target.result)},t.onerror=e=>{var n;i(R.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(ke,{keyPath:"compositeKey"})}}}catch(t){i(R.create("storage-open",{originalErrorMessage:t?.message}))}}),ne)}function Ft(r,i){return Lt(Ht(r),i)}function Lt(r,i){return I(this,null,function*(){let e=(yield Nt()).transaction(ke,"readwrite"),o=e.objectStore(ke).put({compositeKey:r,value:i});return new Promise((s,a)=>{o.onsuccess=c=>{s()},e.onerror=c=>{var l;a(R.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Ht(r){return`${r.options.appId}-${r.name}`}var ve=new We("@firebase/app-check");function we(r,i){return He()?Ft(r,i).catch(t=>{ve.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function st(){return nt().enabled}function at(){return I(this,null,function*(){let r=nt();if(r.enabled&&r.token)return r.token.promise;throw Error(`
3
3
  Can't get debug token in production mode.
4
4
  `)})}var $t={error:"UNKNOWN_ERROR"};function Wt(r){return Le.encodeString(JSON.stringify(r),!1)}function be(r,i=!1){return I(this,null,function*(){let t=r.app;rt(t);let e=T(t),n=e.token,o;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield we(t,void 0))}if(!i&&n&&J(n))return{token:n.token};let s=!1;if(st()){e.exchangeTokenPromise||(e.exchangeTokenPromise=ot(it(t,yield at()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield we(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield T(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ve.warn(c.message):ve.error(c),o=c}let a;return n?o?J(n)?a={token:n.token,internalError:o}:a=et(o):(a={token:n.token},e.token=n,yield we(t,n)):a=et(o),s&&qt(t,a),a})}function Ut(r){return I(this,null,function*(){let i=r.app;rt(i);let{provider:t}=T(i);if(st()){let e=yield at(),{token:n}=yield ot(it(i,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Kt(r,i,t,e){let{app:n}=r,o=T(n),s={next:t,error:e,type:i};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&J(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),Qe(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Qe(r))}function ct(r,i){let t=T(r),e=t.tokenObservers.filter(n=>n.next!==i);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Qe(r){let{app:i}=r,t=T(i),e=t.tokenRefresher;e||(e=zt(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function zt(r){let{app:i}=r;return new Ae(()=>I(this,null,function*(){let t=T(i),e;if(t.token?e=yield be(r,!0):e=yield be(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=T(i);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Ye.RETRIAL_MIN_WAIT,Ye.RETRIAL_MAX_WAIT)}function qt(r,i){let t=T(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&i.error!=null?e.error(i.error):e.next(i)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function et(r){return{token:Wt($t),error:r}}var Se=class{constructor(i,t){this.app=i,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:i}=T(this.app);for(let t of i)ct(this.app,t.next);return Promise.resolve()}};function Vt(r,i){return new Se(r,i)}function Gt(r){return{getToken:i=>be(r,i),getLimitedUseToken:()=>Ut(r),addTokenListener:i=>Kt(r,"INTERNAL",i),removeTokenListener:i=>ct(r.app,i)}}var Jt="@firebase/app-check",Zt="0.8.4";var Xt="app-check",tt="app-check-internal";function Yt(){he(new de(Xt,r=>{let i=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return Vt(i,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,i,t)=>{r.getProvider(tt).initialize()})),he(new de(tt,r=>{let i=r.getProvider("app-check").getImmediate();return Gt(i)},"PUBLIC").setInstantiationMode("EXPLICIT")),q(Jt,Zt)}Yt();var Qt=["localhost","0.0.0.0","127.0.0.1"],rr=typeof window<"u"&&Qt.includes(window.location.hostname);var tn=new y("angularfire2.auth.use-emulator"),nn=new y("angularfire2.auth.settings"),rn=new y("angularfire2.auth.tenant-id"),on=new y("angularfire2.auth.langugage-code"),sn=new y("angularfire2.auth.use-device-language"),an=new y("angularfire.auth.persistence"),cn=(r,i,t,e,n,o,s,a)=>Xe(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=i.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,o&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,o,s,a]),Ie=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,o,s,a,c,l,d,u,p,f){let W=new X,j=U(void 0).pipe(M(s.outsideAngular),x(()=>o.runOutsideAngular(()=>import("./chunk-W3EAYQL3.js"))),P(()=>me(t,o,e)),P(C=>cn(C,o,a,l,d,u,c,p)),se({bufferSize:1,refCount:!1}));if(Be(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=U(null);else{j.pipe(xe()).subscribe();let C=j.pipe(x(w=>w.getRedirectResult().then(D=>D,()=>null)),Ge,se({bufferSize:1,refCount:!1})),Z=j.pipe(x(w=>new g(D=>({unsubscribe:o.runOutsideAngular(()=>w.onAuthStateChanged(O=>D.next(O),O=>D.error(O),()=>D.complete()))})))),re=j.pipe(x(w=>new g(D=>({unsubscribe:o.runOutsideAngular(()=>w.onIdTokenChanged(O=>D.next(O),O=>D.error(O),()=>D.complete()))}))));this.authState=C.pipe(ae(Z),N(s.outsideAngular),M(s.insideAngular)),this.user=C.pipe(ae(re),N(s.outsideAngular),M(s.insideAngular)),this.idToken=this.user.pipe(x(w=>w?_(w.getIdToken()):U(null))),this.idTokenResult=this.user.pipe(x(w=>w?_(w.getIdTokenResult()):U(null))),this.credential=Pe(C,W,this.authState.pipe(De(w=>!w))).pipe(P(w=>w?.user?w:null),N(s.outsideAngular),M(s.insideAngular))}return Ze(this,j,o,{spy:{apply:(C,Z,re)=>{(C.startsWith("signIn")||C.startsWith("createUser"))&&re.then(w=>W.next(w))}}})}static \u0275fac=function(e){return new(e||r)(h(ee),h(te,8),h(H),h($),h(Ve),h(tn,8),h(nn,8),h(rn,8),h(on,8),h(sn,8),h(an,8),h(V,8))};static \u0275prov=b({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),kr=(()=>{class r{constructor(){E.registerVersion("angularfire",G.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=L({type:r});static \u0275inj=F({providers:[Ie]})}return r})();function m(r,i,t,e){return new Promise((n,o)=>{r||o("IndexedDB not available");let s=r.open(i,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{o(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function lt(r,i,t,e,n){if(!r)return;let o=r.open(i,t);o.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,o.transaction)}),a.close()},o.onsuccess=s=>{s.target.result.close()}}function un(r,i,t){if(!r||!i||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=i+1,o=indexedDB.open(r,n);o.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},o.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function dn(r,i){return r.objectStoreNames.contains(i)}function S(r,i,t){r||t("You need to use the openDatabase function to create a database before you query it!"),dn(r,i)||t(`objectStore does not exists: ${i}`)}function k(r,i){let t=r.transaction(i.storeName,i.dbMode);return t.onerror=i.error,t.onabort=i.abort,t}function v(r,i,t,e){return{storeName:i,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var A=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(A||{}),ut=new y(null),ye=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Me(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,lt(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];lt(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=k(s,v(A.readwrite,t,d=>o.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(s=>o.error(s))})}bulkAdd(t,e){let n=new Promise((o,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=k(a,v(A.readwrite,t,o,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let j=W?l.add(u,W):l.add(u);j.onsuccess=C=>{let Z=C.target.result;p(Z)}}));o(Promise.all(d))}).catch(a=>s(a))});return _(n)}bulkDelete(t,e){let n=e.map(o=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=k(c,v(A.readwrite,t,a,s));l.objectStore(t).delete(o),l.oncomplete=()=>{this.getAll(t).pipe(ie(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return _(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let c=k(o,v(A.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(o=>n.error(o))})}bulkGet(t,e){let n=e.map(o=>this.getByKey(t,o));return new g(o=>{Ce(n).subscribe(s=>{o.next(s),o.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(A.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(o=>n.error(o))})}getByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(A.readonly,t,o.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,c=>e.error(c));let a=k(n,v(A.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(A.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>I(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(A.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(ie(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(A.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(o=>n.error(o))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,a=>e.error(a));let o=k(n,v(A.readwrite,t,a=>e.error(a)));o.objectStore(t).clear(),o.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>I(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=o=>t.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(A.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(t,e,n,o=A.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>{s.error(p)});let u=k(a,v(o,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(A.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(A.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(A.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(A.readonly,t,o.error)).objectStore(t).index(e).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}deleteObjectStore(t){return un(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(ut),h(H))},r.\u0275prov=b({token:r,factory:r.\u0275fac}),r})(),Cr=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[ye,{provide:ut,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=L({type:r}),r.\u0275inj=F({imports:[[Oe]]}),r})();var dt=(()=>{let i=class i{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let o=this.getKey(n);return this.db.add(this.DATABASE,e,o).pipe(P(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case le.Lazada:n="Lazada";break;case le.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};i.\u0275fac=function(n){return new(n||i)(h(ye))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var ht=(()=>{let i=class i{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=oe(oe({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return z.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var Si=(()=>{let i=class i{constructor(e,n,o,s,a,c,l){this.httpService=e,this.tokenDecodeService=n,this.afAuth=o,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.channels=[]}login(e){return this.httpService.post("/api/token/Login",e).pipe(K(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(ze.news).pipe(P(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let o=new pe;return o.setCustomParameters({prompt:"select_account"}),_(this.afAuth.signInWithPopup(o)).pipe(P(s=>s.credential),P(s=>s.idToken),x(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),K(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,o){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:o})),localStorage.setItem("channels",JSON.stringify(e.Channels)),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(z.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){let e=JSON.parse(JSON.stringify(this.channels));if(this.channels.length===0){let n=localStorage.getItem("channels");n?(this.channels=JSON.parse(n),e=JSON.parse(JSON.stringify(this.channels))):(this.channels=[],e=[])}return e=this.setChannelLogo(e),e}setChannelLogo(e){return e=e.map(n=>(n.Img=z.getChannelLogoByTypeId(n.TypeID),n)),e}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let o=new Date(e.Token.expiredAt);return n<o?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.channels=[],localStorage.removeItem("channels"),localStorage.removeItem("user"),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};i.\u0275fac=function(n){return new(n||i)(h(Ne),h(qe),h(Ie),h(Ke),h(dt),h(Fe),h(ht))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();export{qe as a,ze as b,Rn as c,kr as d,Cr as e,dt as f,Si as g};
@@ -1,4 +1,4 @@
1
- import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-MSGMWJHN.js";import{b as ie}from"./chunk-PRYDCJG5.js";import{a as ee,b as te}from"./chunk-SRYGE2HW.js";import{a as X}from"./chunk-OKEA4W2I.js";import{g as Q}from"./chunk-5DJHCNOC.js";import{e as W}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as Y,D as Z}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{c as z,h as K,k as q,u as J}from"./chunk-SP6QPE3M.js";import"./chunk-6F6NSBIF.js";import{$ as D,Ab as m,Bb as O,Cb as B,Eb as L,Fb as F,Ga as M,Gb as R,Hb as P,Ia as p,Ja as I,Kb as x,Wa as c,Wc as j,Ya as s,Yc as $,_c as G,aa as T,ca as U,fb as o,gb as r,ha as C,hb as d,ia as N,ib as f,jb as _,kc as w,lb as S,lc as V,mc as A,ob as y,pa as g,qa as h,qb as u,sc as H,za as k,zb as v}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,j,$]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(W))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],M)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new k}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function ke(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function Me(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-MSGMWJHN.js";import{b as ie}from"./chunk-PRYDCJG5.js";import{a as ee,b as te}from"./chunk-SRYGE2HW.js";import{a as X}from"./chunk-T4Y427M7.js";import{g as Q}from"./chunk-7QECCYLR.js";import{e as W}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as Y,D as Z}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{c as z,h as K,k as q,u as J}from"./chunk-SP6QPE3M.js";import"./chunk-6F6NSBIF.js";import{$ as D,Ab as m,Bb as O,Cb as B,Eb as L,Fb as F,Ga as M,Gb as R,Hb as P,Ia as p,Ja as I,Kb as x,Wa as c,Wc as j,Ya as s,Yc as $,_c as G,aa as T,ca as U,fb as o,gb as r,ha as C,hb as d,ia as N,ib as f,jb as _,kc as w,lb as S,lc as V,mc as A,ob as y,pa as g,qa as h,qb as u,sc as H,za as k,zb as v}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,j,$]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(W))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],M)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new k}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function ke(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function Me(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(n){this.stepperState=n.selectedStep.state}onSubmit(n){let i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(l=>{this.downloadResponses=l,this.mappingLinkToProduct(),this.onStepperNext(n)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(n=>(n.Name=n?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${n.ID}" target="_blank">
3
3
  ${n?.Name}
4
4
  </a>`:"-",n))}onNewStepperState(n){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",n.reset(),this.onStepperNext(n)}onStepperNext(n){n.selected.completed=!0,n.next()}};t.\u0275fac=function(i){return new(i||t)(I(E),I(Q))},t.\u0275cmp=C({type:t,selectors:[["app-by-url"]],features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(i,l){if(i&1){let fe=S();o(0,"mainpanel",1)(1,"actions"),c(2,be,4,0,"ng-container",2)(3,Ee,3,0,"ng-container",2)(4,Ie,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),r(),o(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(_e){return g(fe),h(l.onStepperChange(_e))}),o(12,"mat-step",7),c(13,Te,3,0,"ng-template",8)(14,Ue,16,0,"ng-template",9),r(),o(15,"mat-step",10),c(16,Ne,3,0,"ng-template",8)(17,ke,2,2,"ng-template",9),r(),o(18,"mat-step",11),c(19,Me,3,0,"ng-template",8)(20,Oe,2,2,"ng-template",9),r(),c(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Fe,2,0,"ng-template",14),r()()()()()()}i&2&&(s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("ngIf",l.stepperState=="FINISH"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(),s("ngIf",l.stepperState=="GUIDE"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(5),s("selectedIndex",1),p(2),s("editable",l.stepperState!="FINISH")("completed",!0),p(3),s("editable",l.stepperState!="FINISH")("completed",!1))},dependencies:[V,z,K,q,Y,le,oe,pe,re,ae,de],styles:[`.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
@@ -1 +1 @@
1
- import{a as B}from"./chunk-W57W62AZ.js";import{a as vt}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-PZOGC5DT.js";import{a as dt,b as ft,d as ut,e as gt}from"./chunk-AL67KXJV.js";import{g as st}from"./chunk-5DJHCNOC.js";import{e as at}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as k,D as ht}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{h as lt,k as mt,u as ct}from"./chunk-SP6QPE3M.js";import{c as pt}from"./chunk-6F6NSBIF.js";import{Ab as l,Bb as s,Cb as x,Eb as Q,Fb as X,Ga as W,Gb as Y,Ha as H,Ia as m,Ja as v,Jb as Z,Kb as tt,Lb as et,Q as j,Rb as d,Sb as _,T as q,Tb as S,Ub as it,V as U,Vc as rt,Wa as u,Ya as p,Yc as F,_c as R,aa as I,c as z,fb as r,gb as o,ha as y,hb as D,ia as N,ib as g,ic as nt,jb as h,kc as ot,lb as G,lc as T,ob as V,oc as w,pa as b,pc as M,q as C,qa as E,qb as f,rc as P,sc as L,tb as J,zb as K}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),d(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),d(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),s(n.Name),m(3),s(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),s(n.StatusLabel),m(2),s(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),V("total",function(){b(n);let i=f(2);return E(i.getRowCount())})("next",function(){b(n);let i=f(2);return E(i.onNextPage())})("previous",function(){b(n);let i=f(2);return E(i.onPreviousPage())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=pt.getChannelLogoByTypeId(i.TypeID),i)),a}onNextPage(){this.filter.PageNumber+=1,this.getNotifications()}onPreviousPage(){this.filter.PageNumber-=1,this.getNotifications()}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B),v(st))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),d(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),d(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,dt,ft,lt,mt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),s(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),s(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),d(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),d(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),s(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),s(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),s(n.Label),m(11),s(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(rt),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),d(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var de=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,St,gt,ct,ht,R,$]});let t=e;return t})();export{de as NotificationModule};
1
+ import{a as B}from"./chunk-JJ4ZOCSD.js";import{a as vt}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-PZOGC5DT.js";import{a as dt,b as ft,d as ut,e as gt}from"./chunk-AL67KXJV.js";import{g as st}from"./chunk-7QECCYLR.js";import{e as at}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as k,D as ht}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{h as lt,k as mt,u as ct}from"./chunk-SP6QPE3M.js";import{c as pt}from"./chunk-6F6NSBIF.js";import{Ab as l,Bb as s,Cb as x,Eb as Q,Fb as X,Ga as W,Gb as Y,Ha as H,Ia as m,Ja as v,Jb as Z,Kb as tt,Lb as et,Q as j,Rb as d,Sb as _,T as q,Tb as S,Ub as it,V as U,Vc as rt,Wa as u,Ya as p,Yc as F,_c as R,aa as I,c as z,fb as r,gb as o,ha as y,hb as D,ia as N,ib as g,ic as nt,jb as h,kc as ot,lb as G,lc as T,ob as V,oc as w,pa as b,pc as M,q as C,qa as E,qb as f,rc as P,sc as L,tb as J,zb as K}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),d(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),d(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),s(n.Name),m(3),s(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),s(n.StatusLabel),m(2),s(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),V("total",function(){b(n);let i=f(2);return E(i.getRowCount())})("next",function(){b(n);let i=f(2);return E(i.onNextPage())})("previous",function(){b(n);let i=f(2);return E(i.onPreviousPage())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=pt.getChannelLogoByTypeId(i.TypeID),i)),a}onNextPage(){this.filter.PageNumber+=1,this.getNotifications()}onPreviousPage(){this.filter.PageNumber-=1,this.getNotifications()}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B),v(st))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),d(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),d(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,dt,ft,lt,mt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),s(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),s(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),d(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),d(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),s(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),s(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),s(n.Label),m(11),s(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(rt),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),d(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var de=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=N({type:e}),e.\u0275inj=I({imports:[L,St,gt,ct,ht,R,$]});let t=e;return t})();export{de as NotificationModule};