marketplacepos 5.43.7 → 5.43.8
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.
- package/Marketplace/{chunk-GJUPDABG.js → chunk-2WE5VQIB.js} +1 -1
- package/Marketplace/{chunk-TXVG5OHR.js → chunk-4FDSLLEW.js} +1 -1
- package/Marketplace/{chunk-FHQTKJXS.js → chunk-4TCVWLGV.js} +1 -1
- package/Marketplace/{chunk-EBVE2XHU.js → chunk-5J2P4G7C.js} +1 -1
- package/Marketplace/{chunk-3IO4ZF34.js → chunk-5W5H64GB.js} +1 -1
- package/Marketplace/{chunk-O7FDRTJ2.js → chunk-6CRGHPSR.js} +1 -1
- package/Marketplace/{chunk-DO2UECCT.js → chunk-6GSTYF5H.js} +1 -1
- package/Marketplace/{chunk-3BYIWPKX.js → chunk-74NKCY42.js} +1 -1
- package/Marketplace/{chunk-BCH2MADE.js → chunk-AQGYDN3B.js} +1 -1
- package/Marketplace/{chunk-SUJBRB2D.js → chunk-CMLFTAEA.js} +1 -1
- package/Marketplace/{chunk-VJNZ5THR.js → chunk-DJLBMG6O.js} +1 -1
- package/Marketplace/{chunk-EHU3RPGU.js → chunk-EAKQWIS7.js} +1 -1
- package/Marketplace/{chunk-KG47DFP5.js → chunk-EHJ5CYUT.js} +1 -1
- package/Marketplace/{chunk-KMZPNPJF.js → chunk-EIWYK5TA.js} +1 -1
- package/Marketplace/{chunk-FO2QLLKW.js → chunk-EM443W7B.js} +2 -2
- package/Marketplace/{chunk-LZYW24WA.js → chunk-FBDQLWJX.js} +1 -1
- package/Marketplace/{chunk-FWG7M5IP.js → chunk-GVQNFCWT.js} +1 -1
- package/Marketplace/{chunk-6ZVXICIH.js → chunk-H7A64RRL.js} +1 -1
- package/Marketplace/{chunk-UDZIOJVC.js → chunk-HCQDRRUB.js} +1 -1
- package/Marketplace/{chunk-TSPQ2LFF.js → chunk-HIAUMXPO.js} +1 -1
- package/Marketplace/{chunk-ESX7MIMG.js → chunk-I6FCMA5P.js} +1 -1
- package/Marketplace/{chunk-UMA5ZNXQ.js → chunk-IBVAAGUH.js} +1 -1
- package/Marketplace/{chunk-LLDNDJ7P.js → chunk-ICZU6TYQ.js} +1 -1
- package/Marketplace/{chunk-R45ORDIE.js → chunk-JUIKFEYB.js} +1 -1
- package/Marketplace/{chunk-JX6HFP2Y.js → chunk-KXD6CZ7T.js} +1 -1
- package/Marketplace/{chunk-YJHI5U5R.js → chunk-KZ7INCKP.js} +1 -1
- package/Marketplace/{chunk-ZJVWTRCI.js → chunk-NC3Y335Z.js} +1 -1
- package/Marketplace/{chunk-QWJECSZK.js → chunk-NU2AT65H.js} +1 -1
- package/Marketplace/{chunk-JJ6HE6R7.js → chunk-OGX774CC.js} +1 -1
- package/Marketplace/{chunk-KJATJWWX.js → chunk-Q3IZXH7X.js} +1 -1
- package/Marketplace/{chunk-HFBAUQ7H.js → chunk-RC4S5BM5.js} +1 -1
- package/Marketplace/{chunk-6NGH2YZQ.js → chunk-SDRFBNFF.js} +1 -1
- package/Marketplace/{chunk-UYLU3G52.js → chunk-SEN46Y6T.js} +1 -1
- package/Marketplace/{chunk-AOFDSBOE.js → chunk-T6LQ7WTR.js} +1 -1
- package/Marketplace/{chunk-SSAGHA7U.js → chunk-UAYWO75X.js} +1 -1
- package/Marketplace/{chunk-XC7L6C26.js → chunk-VEPPBK2Y.js} +1 -1
- package/Marketplace/{chunk-J6UZFGNY.js → chunk-VWYHEJLH.js} +1 -1
- package/Marketplace/{chunk-5FJUX7W5.js → chunk-WPWN2PNK.js} +2 -2
- package/Marketplace/{chunk-FYBG3KWC.js → chunk-WRRVCTKT.js} +1 -1
- package/Marketplace/{chunk-Q23GGWWT.js → chunk-XT4STZN6.js} +1 -1
- package/Marketplace/{chunk-3NP5TQOW.js → chunk-Y4X2G3D4.js} +1 -1
- package/Marketplace/{chunk-AEJ5I5MW.js → chunk-YFSXR7TL.js} +1 -1
- package/Marketplace/{chunk-RM3KYX7K.js → chunk-ZAJW3O5K.js} +1 -1
- package/Marketplace/{chunk-WUUXAXFO.js → chunk-ZVVPREHB.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-4LOUTBLN.js → main-Y4LW42EY.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Me}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as Ae,b as Pe,c as ke,d as ie,e as oe}from"./chunk-XC7L6C26.js";import{a as we}from"./chunk-YHKEECJR.js";import{a as Ne,b as Ue}from"./chunk-BFU7VKO3.js";import{b as Ee}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-SSAGHA7U.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as Fe,b as Te}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as O,e as B}from"./chunk-5JVEEL2T.js";import{b as be,c as _}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Se,n as Ie}from"./chunk-CLER2MX6.js";import{A as Z,B as D,c as te,e as ge,h as $,i as H,m as ye,n as q,q as z,s as J,z as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ve,s as xe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as V,j as x,n as S}from"./chunk-M2FCTYGU.js";import{$c as g,Gb as b,Gc as u,Hc as fe,Ic as Q,K as de,Ka as w,Kc as he,Lc as _e,M as ue,Mb as h,Mc as Ce,Oa as re,Qc as v,Yb as m,Z as ee,ad as y,dc as E,ea as A,ec as j,gc as R,hc as L,ic as l,ja as P,jc as r,kc as f,lc as N,mc as U,oc as M,pa as d,rb as s,tc as C,uc as a,v as T,xa as k,ya as I,za as F}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ae=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y),this.uploadProductService=d(oe)}getAttributes(e,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(de(o=>this.uploadProductService.selectedProduct$.pipe(T(c=>(o=this.mappingAttributeSalesProperty(o,c),o)))))}mappingAttributeSalesProperty(e,t){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(t),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let t=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),t=n.some(o=>o>1),t}createFormGroup(e){let t=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(ge.required),t.addControl(o.id,this.formBuilder.control(null,n))}),t}getFilteredAttributes(e,t){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(t),c=n.filter(W=>o.findIndex(Be=>parseInt(Be)==W.id)!=-1);return c=this.filterSelectedAttributes(c,t),c}filterSelectedAttributes(e,t){return e.map(o=>(_.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(c=>t[o.id]?.includes(c.id)):o.values=o.values.filter(c=>c.id==t[o.id]):t[o.id]&&(o.values=[{id:null,name:t[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ge(i,p){i&1&&(l(0,"span",5),u(1,"*"),r())}function je(i,p){if(i&1&&f(0,"ng-select",6),i&2){let e=a().$implicit;m("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Re(i,p){if(i&1&&f(0,"ng-select",7),i&2){let e=a().$implicit;m("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Le(i,p){if(i&1&&f(0,"input",8),i&2){let e=a().$implicit;m("formControlName",e.id)("placeholder",e==null?null:e.name)}}function We(i,p){if(i&1&&(l(0,"small",5),u(1),r()),i&2){let e=a().$implicit;s(),Q(" ",e==null?null:e.name," is mandatory ")}}function He(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),h(2,Ge,2,0,"span",5),l(3,"span"),u(4),r()(),h(5,je,1,4,"ng-select",6)(6,Re,1,3,"ng-select",7)(7,Le,1,2,"input",8)(8,We,2,1,"small",5),r()),i&2){let e=p.$implicit;s(2),E(e.is_required?2:-1),s(2),Q(" ",e==null?null:e.name," "),s(),E(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),s(3),E(e.is_required?8:-1)}}function qe(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,He,9,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var Ve=(()=>{class i{constructor(){this.tiktokAttributeFormService=d(ae),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(T(e=>e.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(_.IsEmpty(t.values)||t.values?.length==0)&&t.is_customizable==!1))),A(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let t=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{t=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([ae]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(t,n){t&1&&(h(0,qe,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,te,$,H,z,J,Z],encapsulation:2})}}return i})();var se=(()=>{class i{constructor(){this.woocommerceUploadService=d(ie)}getAttributes(e,t){return this.woocommerceUploadService.getAttributes(e,t).pipe(T(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();var $e=(()=>{class i{constructor(){this.wooAttributeFormService=d(se),this.channelId=re(),this.categoryId=re(),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId())&&_.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[v([se]),k],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),r(),l(4,"ng-select",3),g(5,"async"),C("change",function(c){return n.onSelectAttribute(c)}),r()()()),t&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,x,Z,B,O,D],encapsulation:2})}}return i})();var me=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(T(o=>o))}createFormGroup(e){let t=this.formBuilder.group({});return e.forEach(n=>{t.addControl(n.variant,this.formBuilder.control(null))}),t}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function ze(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),u(2),r(),f(3,"ng-select",5),r()),i&2){let e=p.$implicit;s(2),Q(" ",e==null?null:e.variant," "),s(),m("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Je(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,ze,4,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var De=(()=>{class i{constructor(){this.tokpedAttrFormService=d(me),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(e){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{e=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([me]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,n){t&1&&(h(0,Je,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,$,H,z,J],encapsulation:2})}}return i})();var pe=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let t=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{t.addControl(o,this.formBuilder.control(null))}),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ye(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),u(5," Brand "),r(),f(6,"input",5),r(),l(7,"div",6)(8,"div",4),u(9," Product Type "),r(),f(10,"input",7),r(),l(11,"div",6)(12,"div",4),u(13," Status "),r(),f(14,"ng-select",8),r()()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(13),m("items",e.Options.StatusOptions)}}var Oe=(()=>{class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=d(pe)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(ue(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[v([pe]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,n){t&1&&(h(0,Ye,15,2,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,D,q,te,$,H,z,J,B,O],encapsulation:2})}}return i})();function Ze(i,p){if(i&1&&(l(0,"div",6),f(1,"app-product-card",9),r()),i&2){let e=p.$implicit;s(),m("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ke(i,p){if(i&1){let e=M();N(0),l(1,"mat-checkbox",21),Ce("ngModelChange",function(n){I(e);let o=a().$implicit;return _e(o.selected,n)||(o.selected=n),F(n)}),C("ngModelChange",function(){let n=I(e).ngIf,o=a(),c=o.$implicit,W=o.$index,X=a();return F(X.onSelectChannel(c,W,n))}),r(),U()}if(i&2){let e=a().$implicit;s(),he("ngModel",e.selected)}}function Qe(i,p){if(i&1&&(l(0,"div",18),f(1,"input",22),r()),i&2){let e=a().$implicit,t=a();m("matTooltip",e.type==t.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==t.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Xe(i,p){if(i&1){let e=M();l(0,"app-channel-category-select",23),C("selectedCategory",function(n){I(e);let o=a().$index,c=a();return F(c.onCategoryChange(o,n))}),r()}if(i&2){let e=a().$implicit,t=a();m("disabled",!e.selected||e.selected&&e.type==t.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function et(i,p){if(i&1){let e=M();l(0,"shopee-attribute-form",27),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function tt(i,p){if(i&1){let e=M();l(0,"tiktok-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function it(i,p){if(i&1){let e=M();l(0,"wooocommerce-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function ot(i,p){if(i&1){let e=M();l(0,"tokopedia-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function nt(i,p){if(i&1&&(l(0,"div",20)(1,"div",24),h(2,et,1,3,"shopee-attribute-form",25)(3,tt,1,2,"tiktok-attribute-form",26)(4,it,1,2,"wooocommerce-attribute-form",26)(5,ot,1,2,"tokopedia-attribute-form",26),r()()),i&2){let e,t=a().$implicit,n=a();s(2),E((e=t.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function rt(i,p){if(i&1){let e=M();l(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),C("attributesChanges",function(n){I(e);let o=a().$index,c=a();return F(c.onAttributesChange(o,n))}),r()()()}if(i&2){let e=a().$implicit;s(2),m("channelId",e.id)}}function at(i,p){if(i&1&&(l(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ke,2,1,"ng-container",14),g(7,"async"),r(),l(8,"div"),f(9,"app-channel-logo",15),r(),l(10,"div",16)(11,"span"),u(12),r()()()(),l(13,"div",12)(14,"div",17),h(15,Qe,2,1,"div",18)(16,Xe,1,4,"app-channel-category-select",19),r()()(),h(17,nt,6,1,"div",20)(18,rt,3,1,"div",20),r()()),i&2){let e=p.$implicit,t=a();s(6),m("ngIf",y(7,8,t.defaultCategories$)),s(3),m("typeId",e.type)("showChannelName",!1),s(),m("matTooltip",e.name)("matTooltipShowDelay",2500),s(2),fe(e.name),s(3),E(e.type==t.channelType.Shopify||e.type==t.channelType.Plugo?15:16),s(2),E(e.categoryId&&t.channelType.Lazada!=e.type&&e.selected?17:t.channelType.Shopify==e.type&&e.selected?18:-1)}}var qi=(()=>{class i{constructor(){this.uploadProductService=d(oe),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=be,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.categoryId=t,o.attributes=[]),o)))}onAttributesChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.attributes=t),o)))}onSelectChannel(e,t,n){this.channelProductUploads.update(o=>o.map((c,W)=>{if(W==t&&e.selected){let X=this.findCategoryByChannelId(e.id,n);c.categoryId=X?.DefaultCategoryID}return W==t&&!e.selected&&(c.categoryId=null),c}))}findCategoryByChannelId(e,t){return t.find(n=>n.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-product-upload"]],features:[v([Ae,Pe,ke,ie])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,n){if(t&1&&(l(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return n.onUploadProduct()}),f(3,"i",2),u(4," Upload "),r()(),l(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),r(),l(9,"div",5),R(10,Ze,2,7,"div",6,j),g(12,"async"),r(),l(13,"h3",7),u(14,"Channel To Upload"),r(),R(15,at,19,10,"div",8,j),r()()()),t&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),L(y(12,3,n.selectedProducts$)),s(5),L(n.channelProductUploads())}},dependencies:[S,V,x,Ee,Ie,Se,Ue,Ne,Te,Fe,Z,$,ye,xe,ve,Ve,$e,De,Oe,we,Me],encapsulation:2})}}return i})();export{qi as ProductUploadComponent};
|
|
1
|
+
import{b as Me}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as Ae,b as Pe,c as ke,d as ie,e as oe}from"./chunk-VEPPBK2Y.js";import{a as we}from"./chunk-YHKEECJR.js";import{a as Ne,b as Ue}from"./chunk-BFU7VKO3.js";import{b as Ee}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-UAYWO75X.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as Fe,b as Te}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as O,e as B}from"./chunk-5JVEEL2T.js";import{b as be,c as _}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Se,n as Ie}from"./chunk-CLER2MX6.js";import{A as Z,B as D,c as te,e as ge,h as $,i as H,m as ye,n as q,q as z,s as J,z as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ve,s as xe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as V,j as x,n as S}from"./chunk-M2FCTYGU.js";import{$c as g,Gb as b,Gc as u,Hc as fe,Ic as Q,K as de,Ka as w,Kc as he,Lc as _e,M as ue,Mb as h,Mc as Ce,Oa as re,Qc as v,Yb as m,Z as ee,ad as y,dc as E,ea as A,ec as j,gc as R,hc as L,ic as l,ja as P,jc as r,kc as f,lc as N,mc as U,oc as M,pa as d,rb as s,tc as C,uc as a,v as T,xa as k,ya as I,za as F}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ae=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y),this.uploadProductService=d(oe)}getAttributes(e,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(de(o=>this.uploadProductService.selectedProduct$.pipe(T(c=>(o=this.mappingAttributeSalesProperty(o,c),o)))))}mappingAttributeSalesProperty(e,t){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(t),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let t=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),t=n.some(o=>o>1),t}createFormGroup(e){let t=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(ge.required),t.addControl(o.id,this.formBuilder.control(null,n))}),t}getFilteredAttributes(e,t){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(t),c=n.filter(W=>o.findIndex(Be=>parseInt(Be)==W.id)!=-1);return c=this.filterSelectedAttributes(c,t),c}filterSelectedAttributes(e,t){return e.map(o=>(_.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(c=>t[o.id]?.includes(c.id)):o.values=o.values.filter(c=>c.id==t[o.id]):t[o.id]&&(o.values=[{id:null,name:t[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ge(i,p){i&1&&(l(0,"span",5),u(1,"*"),r())}function je(i,p){if(i&1&&f(0,"ng-select",6),i&2){let e=a().$implicit;m("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Re(i,p){if(i&1&&f(0,"ng-select",7),i&2){let e=a().$implicit;m("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Le(i,p){if(i&1&&f(0,"input",8),i&2){let e=a().$implicit;m("formControlName",e.id)("placeholder",e==null?null:e.name)}}function We(i,p){if(i&1&&(l(0,"small",5),u(1),r()),i&2){let e=a().$implicit;s(),Q(" ",e==null?null:e.name," is mandatory ")}}function He(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),h(2,Ge,2,0,"span",5),l(3,"span"),u(4),r()(),h(5,je,1,4,"ng-select",6)(6,Re,1,3,"ng-select",7)(7,Le,1,2,"input",8)(8,We,2,1,"small",5),r()),i&2){let e=p.$implicit;s(2),E(e.is_required?2:-1),s(2),Q(" ",e==null?null:e.name," "),s(),E(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),s(3),E(e.is_required?8:-1)}}function qe(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,He,9,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var Ve=(()=>{class i{constructor(){this.tiktokAttributeFormService=d(ae),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(T(e=>e.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(_.IsEmpty(t.values)||t.values?.length==0)&&t.is_customizable==!1))),A(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let t=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{t=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([ae]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(t,n){t&1&&(h(0,qe,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,te,$,H,z,J,Z],encapsulation:2})}}return i})();var se=(()=>{class i{constructor(){this.woocommerceUploadService=d(ie)}getAttributes(e,t){return this.woocommerceUploadService.getAttributes(e,t).pipe(T(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();var $e=(()=>{class i{constructor(){this.wooAttributeFormService=d(se),this.channelId=re(),this.categoryId=re(),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId())&&_.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[v([se]),k],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),r(),l(4,"ng-select",3),g(5,"async"),C("change",function(c){return n.onSelectAttribute(c)}),r()()()),t&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,x,Z,B,O,D],encapsulation:2})}}return i})();var me=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(T(o=>o))}createFormGroup(e){let t=this.formBuilder.group({});return e.forEach(n=>{t.addControl(n.variant,this.formBuilder.control(null))}),t}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function ze(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),u(2),r(),f(3,"ng-select",5),r()),i&2){let e=p.$implicit;s(2),Q(" ",e==null?null:e.variant," "),s(),m("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Je(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,ze,4,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var De=(()=>{class i{constructor(){this.tokpedAttrFormService=d(me),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(e){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{e=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([me]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,n){t&1&&(h(0,Je,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,$,H,z,J],encapsulation:2})}}return i})();var pe=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let t=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{t.addControl(o,this.formBuilder.control(null))}),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ye(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),u(5," Brand "),r(),f(6,"input",5),r(),l(7,"div",6)(8,"div",4),u(9," Product Type "),r(),f(10,"input",7),r(),l(11,"div",6)(12,"div",4),u(13," Status "),r(),f(14,"ng-select",8),r()()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(13),m("items",e.Options.StatusOptions)}}var Oe=(()=>{class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=d(pe)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(ue(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[v([pe]),k],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,n){t&1&&(h(0,Ye,15,2,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,D,q,te,$,H,z,J,B,O],encapsulation:2})}}return i})();function Ze(i,p){if(i&1&&(l(0,"div",6),f(1,"app-product-card",9),r()),i&2){let e=p.$implicit;s(),m("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ke(i,p){if(i&1){let e=M();N(0),l(1,"mat-checkbox",21),Ce("ngModelChange",function(n){I(e);let o=a().$implicit;return _e(o.selected,n)||(o.selected=n),F(n)}),C("ngModelChange",function(){let n=I(e).ngIf,o=a(),c=o.$implicit,W=o.$index,X=a();return F(X.onSelectChannel(c,W,n))}),r(),U()}if(i&2){let e=a().$implicit;s(),he("ngModel",e.selected)}}function Qe(i,p){if(i&1&&(l(0,"div",18),f(1,"input",22),r()),i&2){let e=a().$implicit,t=a();m("matTooltip",e.type==t.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==t.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Xe(i,p){if(i&1){let e=M();l(0,"app-channel-category-select",23),C("selectedCategory",function(n){I(e);let o=a().$index,c=a();return F(c.onCategoryChange(o,n))}),r()}if(i&2){let e=a().$implicit,t=a();m("disabled",!e.selected||e.selected&&e.type==t.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function et(i,p){if(i&1){let e=M();l(0,"shopee-attribute-form",27),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function tt(i,p){if(i&1){let e=M();l(0,"tiktok-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function it(i,p){if(i&1){let e=M();l(0,"wooocommerce-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function ot(i,p){if(i&1){let e=M();l(0,"tokopedia-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function nt(i,p){if(i&1&&(l(0,"div",20)(1,"div",24),h(2,et,1,3,"shopee-attribute-form",25)(3,tt,1,2,"tiktok-attribute-form",26)(4,it,1,2,"wooocommerce-attribute-form",26)(5,ot,1,2,"tokopedia-attribute-form",26),r()()),i&2){let e,t=a().$implicit,n=a();s(2),E((e=t.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function rt(i,p){if(i&1){let e=M();l(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),C("attributesChanges",function(n){I(e);let o=a().$index,c=a();return F(c.onAttributesChange(o,n))}),r()()()}if(i&2){let e=a().$implicit;s(2),m("channelId",e.id)}}function at(i,p){if(i&1&&(l(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ke,2,1,"ng-container",14),g(7,"async"),r(),l(8,"div"),f(9,"app-channel-logo",15),r(),l(10,"div",16)(11,"span"),u(12),r()()()(),l(13,"div",12)(14,"div",17),h(15,Qe,2,1,"div",18)(16,Xe,1,4,"app-channel-category-select",19),r()()(),h(17,nt,6,1,"div",20)(18,rt,3,1,"div",20),r()()),i&2){let e=p.$implicit,t=a();s(6),m("ngIf",y(7,8,t.defaultCategories$)),s(3),m("typeId",e.type)("showChannelName",!1),s(),m("matTooltip",e.name)("matTooltipShowDelay",2500),s(2),fe(e.name),s(3),E(e.type==t.channelType.Shopify||e.type==t.channelType.Plugo?15:16),s(2),E(e.categoryId&&t.channelType.Lazada!=e.type&&e.selected?17:t.channelType.Shopify==e.type&&e.selected?18:-1)}}var qi=(()=>{class i{constructor(){this.uploadProductService=d(oe),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=be,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.categoryId=t,o.attributes=[]),o)))}onAttributesChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.attributes=t),o)))}onSelectChannel(e,t,n){this.channelProductUploads.update(o=>o.map((c,W)=>{if(W==t&&e.selected){let X=this.findCategoryByChannelId(e.id,n);c.categoryId=X?.DefaultCategoryID}return W==t&&!e.selected&&(c.categoryId=null),c}))}findCategoryByChannelId(e,t){return t.find(n=>n.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-product-upload"]],features:[v([Ae,Pe,ke,ie])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,n){if(t&1&&(l(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return n.onUploadProduct()}),f(3,"i",2),u(4," Upload "),r()(),l(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),r(),l(9,"div",5),R(10,Ze,2,7,"div",6,j),g(12,"async"),r(),l(13,"h3",7),u(14,"Channel To Upload"),r(),R(15,at,19,10,"div",8,j),r()()()),t&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),L(y(12,3,n.selectedProducts$)),s(5),L(n.channelProductUploads())}},dependencies:[S,V,x,Ee,Ie,Se,Ue,Ne,Te,Fe,Z,$,ye,xe,ve,Ve,$e,De,Oe,we,Me],encapsulation:2})}}return i})();export{qi as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-AJL3CYNX.js";import{a as h}from"./chunk-2EOAYJGX.js";import{a as m}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-AJL3CYNX.js";import{a as h}from"./chunk-2EOAYJGX.js";import{a as m}from"./chunk-VWYHEJLH.js";import"./chunk-PE5AFID4.js";import{c as M}from"./chunk-MHCAI6KP.js";import{b as O}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import{a as P}from"./chunk-YHKEECJR.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import{a}from"./chunk-T6LQ7WTR.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{a as C}from"./chunk-WPW3D4MQ.js";import"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{e as g}from"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{n as f}from"./chunk-CLER2MX6.js";import{A as u}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{s}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as l,J as i,n as r}from"./chunk-M2FCTYGU.js";import{Gb as d,Hb as e,ka as n,kc as c}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=d({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,v){o&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-ZVVPREHB.js").then(t=>t.StatusModule),canActivate:[a,m]},{path:"download",loadChildren:()=>import("./chunk-6CRGHPSR.js").then(t=>t.DownloadModule),canActivate:[a,m]},{path:"upload",loadComponent:()=>import("./chunk-EAKQWIS7.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a,m]}]}],w=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(y)]})}}return t})();var X=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,u,i,w,s,f,g,O,C,M,P,h,b]})}}return t})();export{X as ProductModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-
|
|
1
|
+
import{a as X}from"./chunk-KXD6CZ7T.js";import{a as Q}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{b as K}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{c as Y,d as D}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as J}from"./chunk-UAYWO75X.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as $}from"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as G,e as W}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as H,m as q,n as z}from"./chunk-CLER2MX6.js";import{A as k,c as B,h as O,m as U,o as j}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as R,j as L,m as x,n as A}from"./chunk-M2FCTYGU.js";import{$c as _,G as V,Gb as N,Gc as g,Kc as S,Lc as v,Mb as f,Mc as y,Qc as E,Yb as u,Z as T,ad as C,ea as F,ic as a,jc as p,kc as I,oc as b,pa as M,rb as d,tc as P,uc as o,xb as h,ya as s,za as l}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./chunk-QWHPQWPM.js";import"./chunk-RZU7PSKG.js";import"./chunk-MS4AQ6UA.js";import{a as Ge}from"./chunk-
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=h(te);_elementRef=h(ie);_ariaDescriber=h($e);_renderer=h(oe);_animationMode=h(ne,{optional:!0});_idGenerator=h(Ue);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Re);_document=h(ge);constructor(){let t=h(Le);t.load(ot),t.load(Be)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(Ze),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=re({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&k("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ve,J,J]})}return e})();function lt(e,a){if(e&1&&(z(0),r(1,"p",25),p(2),s(),N()),e&2){let t=m(3).$implicit;l(2),T(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function dt(e,a){if(e&1&&(r(0,"a",24),C(1,"i"),f(2,lt,3,1,"ng-container",22)(3,st,2,1,"ng-template",null,1,L),s()),e&2){let t=A(4),i=m(2).$implicit;c("href",i.Url,ae),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ct(e,a){if(e&1&&(z(0),f(1,dt,5,5,"a",23),N()),e&2){let t=m().$implicit;l(),c("ngxPermissionsOnly",t.Roles)}}function mt(e,a){if(e&1&&(r(0,"p",25),p(1),s()),e&2){let t=m(4).$implicit;l(),T(" ",t.Title," ")}}function pt(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(4).$implicit;l(),M(t.Title)}}function gt(e,a){if(e&1&&(z(0),f(1,mt,2,1,"p",25),H(2,"async"),f(3,pt,2,1,"p"),N()),e&2){let t=m(4);l(),se(W(2,1,t.notifications$)!=0?1:3)}}function ht(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function ft(e,a){if(e&1&&(r(0,"a",27),C(1,"i"),f(2,gt,4,3,"ng-container",22)(3,ht,2,1,"ng-template",null,2,L),s()),e&2){let t=A(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ut(e,a){if(e&1&&f(0,ft,5,6,"a",26),e&2){let t=m().$implicit;c("ngxPermissionsOnly",t.Roles)}}function _t(e,a){if(e&1&&(r(0,"li",21),f(1,ct,2,1,"ng-container",22)(2,ut,1,1,"ng-template",null,0,L),s()),e&2){let t=a.$implicit,i=A(3);l(),c("ngIf",t.ExternalLink)("ngIfElse",i)}}var et=(()=>{class e{constructor(t,i,n,d){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=d,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new $().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(D(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(I(Ne),I(Ae),I(we),I(Pe))}}static{this.\u0275cmp=v({type:e,selectors:[["app-menu"]],standalone:!1,decls:28,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(r(0,"div",3),H(1,"async"),r(2,"div",4)(3,"button",5),w("click",function(){return n.onCallapseSidebar()}),C(4,"i",6),s(),r(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),r(9,"div",10)(10,"div",11),p(11),s(),C(12,"div",12),r(13,"a",13),C(14,"i",14),p(15,"\xA0 "),r(16,"span"),p(17,"My Profile"),s()(),r(18,"a",15),w("click",function(){return n.onLogout()}),C(19,"i",16),p(20,"\xA0 "),r(21,"span"),p(22," Log Out"),s()()()()(),r(23,"div",17)(24,"ul",18),f(25,_t,4,2,"li",19),s()()(),r(26,"div",20),C(27,"router-outlet"),s()()),i&2&&(k("nav-open",W(1,7,n.toggleState$)),l(2),c("ngClass",n.isCollapseSidebar?"collapses":""),l(2),c("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),l(4),T(" ",n.storeName," "),l(3),T(" ",n.token==null?null:n.token.LID," "),l(14),c("ngForOf",n.Menu))},dependencies:[he,fe,ue,Ce,Me,ye,Fe,Ke,Oe,_e],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var u=(e,a)=>F(null,null,function*(){let t=h(Te),i=h(ve),n=e.data?.roles||[],d=e.data?.redirectUrl||"/";return n.length===0||(yield bt(t,n))?!0:(i.navigate([d]),!1)});function bt(e,a){return F(this,null,function*(){let t=a.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ct=[{path:"",component:et,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-DEJVMFIS.js").then(e=>e.routes),canActivate:[g],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-67N4UGA5.js").then(e=>e.DashboardModule),canActivate:[g,u,Ge],data:{title:"Dashboard",roles:[o.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-KG47DFP5.js").then(e=>e.ProductModule),canActivate:[g,u],data:{title:"Products",roles:[o.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-FHQTKJXS.js").then(e=>e.InventoryRoutingModule),canActivate:[g,u],data:{title:"Inventory",roles:[o.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-TSPQ2LFF.js").then(e=>e.PriceRoutingModule),canActivate:[g,u],data:{title:"Price",roles:[o.PriceView],redirectUrl:"/menu/Order"}},{path:"Order",loadChildren:()=>import("./chunk-5FJUX7W5.js").then(e=>e.OrdersModule),canActivate:[g,u],data:{title:"Order",roles:[o.OrderView],redirectUrl:"/menu/sync-log"}},{path:"orderV2",loadChildren:()=>import("./chunk-EBVE2XHU.js").then(e=>e.routes),canActivate:[g],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-UMA5ZNXQ.js").then(e=>e.ReportModule),canActivate:[g,u],data:{title:"Report",roles:[o.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-QWJECSZK.js").then(e=>e.LogisticModule),canActivate:[g,u],data:{title:"Logistic",roles:[o.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-SUJBRB2D.js").then(e=>e.ChannelsModule),canActivate:[g,u],data:{title:"Marketplace",roles:[o.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-RM3KYX7K.js").then(e=>e.LogsModule),canActivate:[g,u],data:{title:"Orders",roles:[o.DevView]}},{path:"users",loadChildren:()=>import("./chunk-MCOWAYNM.js").then(e=>e.userRoutes),canActivate:[g,u],data:{title:"Users",roles:[o.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-R45ORDIE.js").then(e=>e.routes),canActivate:[g],data:{title:"Json API"}}]}],tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[q.forChild(Ct),q]})}}return e})();var Mt=["selectId"];function yt(e,a){if(e&1&&(r(0,"span",3),p(1),s()),e&2){let t=a.item,i=m();c("title",t[i.bindLabel]),l(),M(t[i.bindLabel])}}var it=(()=>{class e{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.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Y,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&ce(Mt,7),i&2){let d;me(d=pe())&&(n.ngSelectElement=d.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let d=de();r(0,"ng-select",1,0),w("clear",function(){return x(d),S(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return x(d),S(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return x(d),S(n.onOpenSelect())})("change",function(at){return x(d),S(n.onSelectChange(at))}),f(2,yt,2,2,"ng-template",2),s()}i&2&&(le("width",n.width),c("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[y,V,ze,ke,R,xe,Se],encapsulation:2})}}return e})(),Y=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new j,this._destroy$=new j,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(K(200),X(),D(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Z(a=>a!==void 0),ee(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(d=>(i=JSON.stringify(d).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(De.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var nt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[y,R,je,qe,Qe,We,Je,Ye,U,Q,it,V,Ie]})}}return e})();var un=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({providers:[be],imports:[y,tt,He,U,nt,Xe,Ee.forChild()]})}}return e})();export{un as MenuModule};
|
|
1
|
+
import"./chunk-QWHPQWPM.js";import"./chunk-RZU7PSKG.js";import"./chunk-MS4AQ6UA.js";import{a as Ge}from"./chunk-VWYHEJLH.js";import"./chunk-PE5AFID4.js";import{c as qe}from"./chunk-MHCAI6KP.js";import{b as Je}from"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-3NMM37H7.js";import{b as Ye}from"./chunk-BFU7VKO3.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{b as Qe}from"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import{a as g}from"./chunk-T6LQ7WTR.js";import"./chunk-3RK6DDJD.js";import{a as We}from"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as o}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as Pe}from"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import{a as De}from"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as ke,d as ze,e as V}from"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import{a as Te,b as Oe,c as Ee}from"./chunk-SWQXSJ7O.js";import{a as Ae}from"./chunk-DRMAONR7.js";import{a as we}from"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{a as Ne,h as je,k as Q,n as He}from"./chunk-CLER2MX6.js";import{A as R,B as Ie,h as xe,m as Se}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Fe,s as U}from"./chunk-YCH6HHU3.js";import{B as $e,M as J,m as Le,n as Be,q as Re,u as Ve,v as Ue}from"./chunk-B73M3AMU.js";import{F as Ce,G as ve,H as Me,I as ye,J as q,a as ge,d as he,f as fe,g as ue,j as _e,k as be,n as y}from"./chunk-M2FCTYGU.js";import{$c as H,Ac as ce,Bc as me,Cc as pe,Fc as A,G as Z,Gb as v,Gc as p,Hb as b,Hc as M,Ib as re,Ic as T,Ka as P,La as te,M as K,Mb as f,Pa as ie,Q as X,Xa as ne,Yb as c,Zb as le,_b as k,ac as G,ad as W,ca as ee,cd as L,dc as se,f as j,ic as r,jc as s,ka as _,kc as C,lc as z,mc as N,oc as de,od as B,pa as h,pb as ae,rb as l,tc as w,uc as m,v as D,wb as oe,xb as I,ya as x,za as S}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{i as F}from"./chunk-66YHNWRR.js";var $=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[o.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[o.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[o.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[o.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/orderV2",Roles:[o.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[o.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[o.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[o.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[o.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[o.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[o.JsonApiView]}]}get getMenu(){return this.menus}};var Ze="mat-badge-content",ot=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=v({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=h(te);_elementRef=h(ie);_ariaDescriber=h($e);_renderer=h(oe);_animationMode=h(ne,{optional:!0});_idGenerator=h(Ue);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=h(Re);_document=h(ge);constructor(){let t=h(Le);t.load(ot),t.load(Be)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(Ze),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=re({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&k("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ve,J,J]})}return e})();function lt(e,a){if(e&1&&(z(0),r(1,"p",25),p(2),s(),N()),e&2){let t=m(3).$implicit;l(2),T(" ",t.Title," ")}}function st(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function dt(e,a){if(e&1&&(r(0,"a",24),C(1,"i"),f(2,lt,3,1,"ng-container",22)(3,st,2,1,"ng-template",null,1,L),s()),e&2){let t=A(4),i=m(2).$implicit;c("href",i.Url,ae),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ct(e,a){if(e&1&&(z(0),f(1,dt,5,5,"a",23),N()),e&2){let t=m().$implicit;l(),c("ngxPermissionsOnly",t.Roles)}}function mt(e,a){if(e&1&&(r(0,"p",25),p(1),s()),e&2){let t=m(4).$implicit;l(),T(" ",t.Title," ")}}function pt(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(4).$implicit;l(),M(t.Title)}}function gt(e,a){if(e&1&&(z(0),f(1,mt,2,1,"p",25),H(2,"async"),f(3,pt,2,1,"p"),N()),e&2){let t=m(4);l(),se(W(2,1,t.notifications$)!=0?1:3)}}function ht(e,a){if(e&1&&(r(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function ft(e,a){if(e&1&&(r(0,"a",27),C(1,"i"),f(2,gt,4,3,"ng-container",22)(3,ht,2,1,"ng-template",null,2,L),s()),e&2){let t=A(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ut(e,a){if(e&1&&f(0,ft,5,6,"a",26),e&2){let t=m().$implicit;c("ngxPermissionsOnly",t.Roles)}}function _t(e,a){if(e&1&&(r(0,"li",21),f(1,ct,2,1,"ng-container",22)(2,ut,1,1,"ng-template",null,0,L),s()),e&2){let t=a.$implicit,i=A(3);l(),c("ngIf",t.ExternalLink)("ngIfElse",i)}}var et=(()=>{class e{constructor(t,i,n,d){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=d,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new $().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(D(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(I(Ne),I(Ae),I(we),I(Pe))}}static{this.\u0275cmp=v({type:e,selectors:[["app-menu"]],standalone:!1,decls:28,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(r(0,"div",3),H(1,"async"),r(2,"div",4)(3,"button",5),w("click",function(){return n.onCallapseSidebar()}),C(4,"i",6),s(),r(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),r(9,"div",10)(10,"div",11),p(11),s(),C(12,"div",12),r(13,"a",13),C(14,"i",14),p(15,"\xA0 "),r(16,"span"),p(17,"My Profile"),s()(),r(18,"a",15),w("click",function(){return n.onLogout()}),C(19,"i",16),p(20,"\xA0 "),r(21,"span"),p(22," Log Out"),s()()()()(),r(23,"div",17)(24,"ul",18),f(25,_t,4,2,"li",19),s()()(),r(26,"div",20),C(27,"router-outlet"),s()()),i&2&&(k("nav-open",W(1,7,n.toggleState$)),l(2),c("ngClass",n.isCollapseSidebar?"collapses":""),l(2),c("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),l(4),T(" ",n.storeName," "),l(3),T(" ",n.token==null?null:n.token.LID," "),l(14),c("ngForOf",n.Menu))},dependencies:[he,fe,ue,Ce,Me,ye,Fe,Ke,Oe,_e],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var u=(e,a)=>F(null,null,function*(){let t=h(Te),i=h(ve),n=e.data?.roles||[],d=e.data?.redirectUrl||"/";return n.length===0||(yield bt(t,n))?!0:(i.navigate([d]),!1)});function bt(e,a){return F(this,null,function*(){let t=a.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ct=[{path:"",component:et,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-DEJVMFIS.js").then(e=>e.routes),canActivate:[g],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-67N4UGA5.js").then(e=>e.DashboardModule),canActivate:[g,u,Ge],data:{title:"Dashboard",roles:[o.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-EHJ5CYUT.js").then(e=>e.ProductModule),canActivate:[g,u],data:{title:"Products",roles:[o.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-4TCVWLGV.js").then(e=>e.InventoryRoutingModule),canActivate:[g,u],data:{title:"Inventory",roles:[o.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-HIAUMXPO.js").then(e=>e.PriceRoutingModule),canActivate:[g,u],data:{title:"Price",roles:[o.PriceView],redirectUrl:"/menu/Order"}},{path:"Order",loadChildren:()=>import("./chunk-WPWN2PNK.js").then(e=>e.OrdersModule),canActivate:[g,u],data:{title:"Order",roles:[o.OrderView],redirectUrl:"/menu/sync-log"}},{path:"orderV2",loadChildren:()=>import("./chunk-5J2P4G7C.js").then(e=>e.routes),canActivate:[g],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-IBVAAGUH.js").then(e=>e.ReportModule),canActivate:[g,u],data:{title:"Report",roles:[o.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-NU2AT65H.js").then(e=>e.LogisticModule),canActivate:[g,u],data:{title:"Logistic",roles:[o.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-CMLFTAEA.js").then(e=>e.ChannelsModule),canActivate:[g,u],data:{title:"Marketplace",roles:[o.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-ZAJW3O5K.js").then(e=>e.LogsModule),canActivate:[g,u],data:{title:"Orders",roles:[o.DevView]}},{path:"users",loadChildren:()=>import("./chunk-MCOWAYNM.js").then(e=>e.userRoutes),canActivate:[g,u],data:{title:"Users",roles:[o.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-JUIKFEYB.js").then(e=>e.routes),canActivate:[g],data:{title:"Json API"}}]}],tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[q.forChild(Ct),q]})}}return e})();var Mt=["selectId"];function yt(e,a){if(e&1&&(r(0,"span",3),p(1),s()),e&2){let t=a.item,i=m();c("title",t[i.bindLabel]),l(),M(t[i.bindLabel])}}var it=(()=>{class e{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.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Y,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&ce(Mt,7),i&2){let d;me(d=pe())&&(n.ngSelectElement=d.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let d=de();r(0,"ng-select",1,0),w("clear",function(){return x(d),S(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return x(d),S(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return x(d),S(n.onOpenSelect())})("change",function(at){return x(d),S(n.onSelectChange(at))}),f(2,yt,2,2,"ng-template",2),s()}i&2&&(le("width",n.width),c("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[y,V,ze,ke,R,xe,Se],encapsulation:2})}}return e})(),Y=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new j,this._destroy$=new j,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(K(200),X(),D(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Z(a=>a!==void 0),ee(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(d=>(i=JSON.stringify(d).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(De.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var nt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[y,R,je,qe,Qe,We,Je,Ye,U,Q,it,V,Ie]})}}return e})();var un=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({providers:[be],imports:[y,tt,He,U,nt,Xe,Ee.forChild()]})}}return e})();export{un as MenuModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ve}from"./chunk-SSAGHA7U.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-AEJ5I5MW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ve}from"./chunk-UAYWO75X.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-
|
|
1
|
+
import{a as ae}from"./chunk-HCQDRRUB.js";import{a as le}from"./chunk-XT4STZN6.js";import{a as oe}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as re}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as te,b as ie}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{a as ne}from"./chunk-WPW3D4MQ.js";import"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as Q}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as $,n as ee}from"./chunk-CLER2MX6.js";import{A as K,c as G,h as U,m as q,o as J}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Y,s as Z}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as z,k as j,m as H,n as R}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as O,Gc as m,Hc as h,Kc as c,Lc as u,Mb as W,Mc as C,Nc as B,Oc as D,Pc as F,Ra as V,Yb as g,Z as T,ad as M,bd as A,dc as I,ec as L,gc as N,hc as k,ic as e,ja as P,jc as t,kc as _,oc as v,pa as y,rb as a,tc as x,uc as S,v as E,ya as p,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var me=(()=>{class r{constructor(){this.httpService=y(Q)}getCancelledOrders(l){return this.httpService.post(X.GetCancelled,l).pipe(E(o=>o.Data))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function pe(r,b){if(r&1&&(e(0,"tr")(1,"td"),m(2),t(),e(3,"td"),_(4,"order-link",26),t(),e(5,"td"),m(6),t(),e(7,"td"),m(8),w(9,"number"),t(),e(10,"td"),m(11),w(12,"date"),t(),e(13,"td"),_(14,"app-channel-logo",27),t()()),r&2){let l=b.$implicit;a(2),h(l.Outlet),a(2),g("order",l),a(2),h(l.Customer),a(2),h(M(9,6,l.Amount)),a(3),h(A(12,8,l.Created,"dd MMM yyyy HH:mm")),a(3),g("typeId",l==null?null:l.TypeID)}}function se(r,b){if(r&1){let l=v();e(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),m(5,"Outlet"),t(),e(6,"th",21),m(7,"Order number"),t(),e(8,"th"),m(9,"Customer"),t(),e(10,"th",22),m(11,"Amount"),t(),e(12,"th",23),m(13," Created On "),t(),e(14,"th",24),m(15,"Channel"),t()()(),e(16,"tbody"),N(17,pe,15,11,"tr",null,L),t()(),e(19,"app-custom-paginator",25),x("next",function(){p(l);let i=S();return s(i.initCancelledOrders())})("previous",function(){p(l);let i=S();return s(i.initCancelledOrders())}),t()()}if(r&2){let l=S(),o=F(0);a(17),k(o),a(2),g("filter",l.filter())("totaldata",o==null?null:o.length)("paginationTotal",o==null?null:o.length)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}function ce(r,b){r&1&&(e(0,"div",16),_(1,"app-empty-state"),t())}var Ae=(()=>{class r{constructor(){this.cancelledService=y(me),this.filter=V({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initCancelledOrders()}initCancelledOrders(){this.cancelledOrders$=this.cancelledService.getCancelledOrders(this.filter()).pipe(T(1))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=O({type:r,selectors:[["app-cancelled"]],decls:34,vars:11,consts:[["headerTitle","Cancelled","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"],[3,"order"],[3,"typeId"]],template:function(o,i){if(o&1){let d=v();B(0),w(1,"async"),e(2,"mainpanel",0),x("onSubmit",function(){return p(d),s(i.initCancelledOrders())}),C("textChange",function(n){return p(d),u(i.filter().Number,n)||(i.filter().Number=n),s(n)}),e(3,"actions")(4,"a",1),_(5,"i",2),e(6,"span"),m(7,"Order Fulfillment Display"),t()()(),e(8,"filters")(9,"div")(10,"label",3),m(11,"From/To"),t(),e(12,"channel-select-options",4),C("ngModelChange",function(n){return p(d),u(i.filter().ListChannelID,n)||(i.filter().ListChannelID=n),s(n)}),t()(),e(13,"div",5)(14,"label",3),m(15,"From/To"),t(),e(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return p(d),u(i.filter().From,n)||(i.filter().From=n),s(n)}),t()(),e(18,"div")(19,"datepicker",8),C("dateChange",function(n){return p(d),u(i.filter().To,n)||(i.filter().To=n),s(n)}),t()()(),e(20,"div",5)(21,"label",9),m(22,"Page Number"),t(),e(23,"input",10),C("ngModelChange",function(n){return p(d),u(i.filter().PageNumber,n)||(i.filter().PageNumber=n),s(n)}),t()(),e(24,"div",5)(25,"label",9),m(26,"Page Size"),t(),e(27,"input",11),C("ngModelChange",function(n){return p(d),u(i.filter().PageSize,n)||(i.filter().PageSize=n),s(n)}),t()()(),e(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),W(32,se,20,5,"div",15)(33,ce,2,0,"div",16),t()()()()()}if(o&2){let d=D(M(1,8,i.cancelledOrders$));a(2),c("text",i.filter().Number),a(10),g("multiple",!0),c("ngModel",i.filter().ListChannelID),a(5),c("date",i.filter().From),a(2),c("date",i.filter().To),a(4),c("ngModel",i.filter().PageNumber),a(4),c("ngModel",i.filter().PageSize),a(5),I((d==null?null:d.length)>0?32:33)}},dependencies:[R,z,H,j,ee,$,re,ne,K,G,J,U,q,oe,le,Z,Y,ae,ie,te],encapsulation:2})}}return r})();export{Ae as CancelledComponent};
|