marketplacepos 3.20.4 → 3.20.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-EBAZER63.js → chunk-3CZEM6ET.js} +1 -1
- package/Marketplace/{chunk-BQOBABN6.js → chunk-43IEC5QK.js} +1 -1
- package/Marketplace/{chunk-QT3OJWVR.js → chunk-5E3UEBK4.js} +1 -1
- package/Marketplace/{chunk-OO5N62Q3.js → chunk-5KL4F7HS.js} +1 -1
- package/Marketplace/{chunk-PO2VZWM6.js → chunk-6SKHSR2X.js} +1 -1
- package/Marketplace/{chunk-MZDRIAOG.js → chunk-A7JXR4HQ.js} +1 -1
- package/Marketplace/{chunk-P5TJRZVH.js → chunk-CDQ6EQHB.js} +1 -1
- package/Marketplace/{chunk-2JCMZXWL.js → chunk-CU6NK6JI.js} +1 -1
- package/Marketplace/{chunk-34GTZZQO.js → chunk-DPKLBQVH.js} +1 -1
- package/Marketplace/{chunk-JSNPJ3MM.js → chunk-EYSFFDPA.js} +1 -1
- package/Marketplace/{chunk-2UOP4Q66.js → chunk-FGAYWPRX.js} +1 -1
- package/Marketplace/{chunk-ACQIVAGX.js → chunk-FZHHIISR.js} +1 -1
- package/Marketplace/{chunk-ZVHEEQMP.js → chunk-G7OHABN6.js} +1 -1
- package/Marketplace/{chunk-PCIN2PEO.js → chunk-I7FLAWCU.js} +1 -1
- package/Marketplace/{chunk-4UP4R76L.js → chunk-KIQU6QLP.js} +1 -1
- package/Marketplace/{chunk-ITQ6LYLN.js → chunk-LXL5OGMB.js} +1 -1
- package/Marketplace/{chunk-AZPLV5HA.js → chunk-M2JMF4Q2.js} +1 -1
- package/Marketplace/{chunk-H7UZRHOQ.js → chunk-MVZIK2UR.js} +1 -1
- package/Marketplace/{chunk-OIJTOBKY.js → chunk-N7LA3PAK.js} +1 -1
- package/Marketplace/{chunk-C4NWPL4V.js → chunk-O636C3DS.js} +1 -1
- package/Marketplace/{chunk-FQ44ODSE.js → chunk-QOITECN4.js} +1 -1
- package/Marketplace/{chunk-HEOC5SSC.js → chunk-R5PDV676.js} +1 -1
- package/Marketplace/{chunk-V3GS7OX4.js → chunk-SHR75DME.js} +1 -1
- package/Marketplace/{chunk-2THQTK3B.js → chunk-SKNEISMT.js} +1 -1
- package/Marketplace/{chunk-TG2ZFMOG.js → chunk-VOIT7VXD.js} +1 -1
- package/Marketplace/{chunk-XJSMU6IK.js → chunk-XRVQ2WEG.js} +1 -1
- package/Marketplace/{chunk-EEMDWQRP.js → chunk-ZCD2PCBL.js} +1 -1
- package/Marketplace/{chunk-CXK5ZSMG.js → chunk-ZPGUQ2BI.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-VDWTMQFP.js → main-KYZAMEYA.js} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as At}from"./chunk-OTR5MBON.js";import{a as Ft}from"./chunk-CJILX5R7.js";import{b as It}from"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as St,b as Tt}from"./chunk-C6QIBOCB.js";import{a as ct,b as pt}from"./chunk-47PEHCOU.js";import{a as he,b as ut,c as ft,d as ge,e as Ce}from"./chunk-PCIN2PEO.js";import{a as Ct,b as bt,c as ve,d as yt,e as vt,j as ae}from"./chunk-KZ6AD6KW.js";import"./chunk-BZPMSXEO.js";import{b as xt}from"./chunk-7VKIP3Z6.js";import{b as gt,c as ye}from"./chunk-DYLT6RRK.js";import{a as _t}from"./chunk-D6L7HUOY.js";import{b as ht,c as be}from"./chunk-BTY6PS53.js";import"./chunk-D76K4RZ7.js";import{a as mt,b as st,f as dt,g as _e}from"./chunk-EIBGI6U2.js";import{d as H,e as W}from"./chunk-PYD2YWAN.js";import"./chunk-FQ44ODSE.js";import{e as re}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as at,n as lt}from"./chunk-4CEFDQPI.js";import{t as ot,u as rt}from"./chunk-2SC3HO66.js";import{M as it,N as ue,O as nt,P as fe}from"./chunk-DQIP7MCZ.js";import{a as Je,c as se,e as de,h as j,i as z,l as Me,m as Qe,n as J,p as Q,q as qe,r as q,s as Ze,t as Ke,u as et,x as Z,y as oe,z as Y}from"./chunk-2E5AKA74.js";import{b as tt,c as g}from"./chunk-FTHTFVHH.js";import{$ as N,$a as je,Ab as Ye,Bc as E,F as $e,Fc as I,H as Re,Ib as ke,Ja as p,Jb as h,Ka as X,Kb as ne,Lb as K,Nb as He,Ob as We,Pb as Xe,Q as ie,Qb as F,Rb as U,Sb as me,V as Ge,X as L,_a as _,aa as ce,ab as m,ac as S,bb as Ee,bc as T,c as Be,d as Le,da as u,ga as x,ha as pe,hb as k,ib as $,kb as R,lb as G,lc as ze,mb as s,na as w,nb as l,oa as C,ob as f,pa as b,pb as D,q as B,qb as V,sb as M,vb as y,xa as Ae,xb as c,yc as A,za as O}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var ee=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Pe=(()=>{let i=class i{constructor(){this.shopeeUploadService=u(he),this.formBuilder=u(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,a;return o=o.map(r=>(t=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(v=>v.language=="id"),d.name=a?.value,d)),r.name=t?.value?t?.value:r.name,r)),o}createFormGroup(o){let t=this.formBuilder.group({}),a=[];return o.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new Me(null),value:new Me(null,a)});t.addControl(JSON.stringify(r.attribute_id),d)}else t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(o,t){let a=JSON.parse(JSON.stringify(o)),r=Object.keys(t),d=a.filter(v=>r.findIndex(Fe=>parseInt(Fe)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(r=>{switch(r.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(r.attribute_value_list)?r.attribute_value_list=r.attribute_value_list.filter(d=>t[r.attribute_id]==d.value_id):r.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:r.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):g.IsNotEmpty(t[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:t[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let a=[];return g.IsNotEmpty(o)&&(a=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),a}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var xe=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Lt=["class","component ts"];function $t(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),f(1,"i",4),l()}}function Rt(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),f(1,"i",6),l()}}function Gt(e,i){if(e&1&&(D(0),_(1,$t,2,0,"button",1)(2,Rt,2,0,"button",2),V()),e&2){let n=i.ngIf;p(),m("ngIf",!n.hideBtnToday),p(),m("ngIf",!n.hideBtnClear)}}var kt=(()=>{let i=class i{constructor(o,t,a,r,d){this._datePicker=o,this._calendar=t,this._dateAdapter=a,this.calendarService=r,this._destroyed=new Be,t.stateChanges.pipe(Ge(this._destroyed)).subscribe(v=>d.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ve),X(bt),X(ue),X(xe),X(ze))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[w],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){t&1&&(s(0,"mat-calendar-header"),_(1,Gt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(p(),m("ngIf",T(2,1,a.calendarConfig$)))},dependencies:[A,ht,Ct,E],encapsulation:2});let e=i;return e})(),Mt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=pe({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,be,fe,ae,_e,ye]});let e=i;return e})();function jt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();m("show",n.placeholder),p(2),ne(n.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new O,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(xe))},i.\u0275cmp=x({type:i,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[F([{provide:ue,useClass:Ft,deps:[it]},{provide:nt,useValue:Yt},{provide:Je,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,a){if(t&1){let r=M();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(r),b(a.change(v.value))})("click",function(){C(r);let v=ke(5);return b(v.open())}),l(),f(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(r),b(a.onOpenDatepicker())})("closed",function(){return C(r),b(a.onCloseDatepicker())}),l()()}if(t&2){let r=ke(5);Ee("width",a.width||100,"%"),m("disabled",a.disabled)("appearance",a.appearance),p(),m("ngIf",a.isFloatingLabel&&a.placeholder),p(),Ye("placeholder",a.placeholder||""),m("matDatepicker",r)("min",a.minDateValidation)("max",a.maxDateValidation)("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly),je("data-cy",a.data_cy),p(),Ee("display",a.displayToggle?"unset":"none"),m("for",r),p(),m("calendarHeaderComponent",a.headerComponent)}},dependencies:[A,ve,yt,vt,dt,mt,st,gt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
1
|
+
import{b as At}from"./chunk-OTR5MBON.js";import{a as Ft}from"./chunk-CJILX5R7.js";import{b as It}from"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as St,b as Tt}from"./chunk-C6QIBOCB.js";import{a as ct,b as pt}from"./chunk-47PEHCOU.js";import{a as he,b as ut,c as ft,d as ge,e as Ce}from"./chunk-I7FLAWCU.js";import{a as Ct,b as bt,c as ve,d as yt,e as vt,j as ae}from"./chunk-KZ6AD6KW.js";import"./chunk-BZPMSXEO.js";import{b as xt}from"./chunk-7VKIP3Z6.js";import{b as gt,c as ye}from"./chunk-DYLT6RRK.js";import{a as _t}from"./chunk-D6L7HUOY.js";import{b as ht,c as be}from"./chunk-BTY6PS53.js";import"./chunk-D76K4RZ7.js";import{a as mt,b as st,f as dt,g as _e}from"./chunk-EIBGI6U2.js";import{d as H,e as W}from"./chunk-PYD2YWAN.js";import"./chunk-QOITECN4.js";import{e as re}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as at,n as lt}from"./chunk-4CEFDQPI.js";import{t as ot,u as rt}from"./chunk-2SC3HO66.js";import{M as it,N as ue,O as nt,P as fe}from"./chunk-DQIP7MCZ.js";import{a as Je,c as se,e as de,h as j,i as z,l as Me,m as Qe,n as J,p as Q,q as qe,r as q,s as Ze,t as Ke,u as et,x as Z,y as oe,z as Y}from"./chunk-2E5AKA74.js";import{b as tt,c as g}from"./chunk-FTHTFVHH.js";import{$ as N,$a as je,Ab as Ye,Bc as E,F as $e,Fc as I,H as Re,Ib as ke,Ja as p,Jb as h,Ka as X,Kb as ne,Lb as K,Nb as He,Ob as We,Pb as Xe,Q as ie,Qb as F,Rb as U,Sb as me,V as Ge,X as L,_a as _,aa as ce,ab as m,ac as S,bb as Ee,bc as T,c as Be,d as Le,da as u,ga as x,ha as pe,hb as k,ib as $,kb as R,lb as G,lc as ze,mb as s,na as w,nb as l,oa as C,ob as f,pa as b,pb as D,q as B,qb as V,sb as M,vb as y,xa as Ae,xb as c,yc as A,za as O}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var ee=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Pe=(()=>{let i=class i{constructor(){this.shopeeUploadService=u(he),this.formBuilder=u(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,a;return o=o.map(r=>(t=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(v=>v.language=="id"),d.name=a?.value,d)),r.name=t?.value?t?.value:r.name,r)),o}createFormGroup(o){let t=this.formBuilder.group({}),a=[];return o.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new Me(null),value:new Me(null,a)});t.addControl(JSON.stringify(r.attribute_id),d)}else t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(o,t){let a=JSON.parse(JSON.stringify(o)),r=Object.keys(t),d=a.filter(v=>r.findIndex(Fe=>parseInt(Fe)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(r=>{switch(r.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(r.attribute_value_list)?r.attribute_value_list=r.attribute_value_list.filter(d=>t[r.attribute_id]==d.value_id):r.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:r.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):g.IsNotEmpty(t[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:t[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let a=[];return g.IsNotEmpty(o)&&(a=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),a}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var xe=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Lt=["class","component ts"];function $t(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),f(1,"i",4),l()}}function Rt(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),f(1,"i",6),l()}}function Gt(e,i){if(e&1&&(D(0),_(1,$t,2,0,"button",1)(2,Rt,2,0,"button",2),V()),e&2){let n=i.ngIf;p(),m("ngIf",!n.hideBtnToday),p(),m("ngIf",!n.hideBtnClear)}}var kt=(()=>{let i=class i{constructor(o,t,a,r,d){this._datePicker=o,this._calendar=t,this._dateAdapter=a,this.calendarService=r,this._destroyed=new Be,t.stateChanges.pipe(Ge(this._destroyed)).subscribe(v=>d.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ve),X(bt),X(ue),X(xe),X(ze))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[w],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){t&1&&(s(0,"mat-calendar-header"),_(1,Gt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(p(),m("ngIf",T(2,1,a.calendarConfig$)))},dependencies:[A,ht,Ct,E],encapsulation:2});let e=i;return e})(),Mt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=pe({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,be,fe,ae,_e,ye]});let e=i;return e})();function jt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();m("show",n.placeholder),p(2),ne(n.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new O,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(xe))},i.\u0275cmp=x({type:i,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[F([{provide:ue,useClass:Ft,deps:[it]},{provide:nt,useValue:Yt},{provide:Je,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,a){if(t&1){let r=M();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(r),b(a.change(v.value))})("click",function(){C(r);let v=ke(5);return b(v.open())}),l(),f(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(r),b(a.onOpenDatepicker())})("closed",function(){return C(r),b(a.onCloseDatepicker())}),l()()}if(t&2){let r=ke(5);Ee("width",a.width||100,"%"),m("disabled",a.disabled)("appearance",a.appearance),p(),m("ngIf",a.isFloatingLabel&&a.placeholder),p(),Ye("placeholder",a.placeholder||""),m("matDatepicker",r)("min",a.minDateValidation)("max",a.maxDateValidation)("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly),je("data-cy",a.data_cy),p(),Ee("display",a.displayToggle?"unset":"none"),m("for",r),p(),m("calendarHeaderComponent",a.headerComponent)}},dependencies:[A,ve,yt,vt,dt,mt,st,gt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
2
|
`],encapsulation:2});let e=i;return e})(),Nt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=pe({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,be,fe,ae,_e,ye,Mt]});let e=i;return e})();var Ne=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ne||{});var we=()=>[];function Wt(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function Xt(e,i){if(e&1&&f(0,"ng-select",6),e&2){let n=c().$implicit;m("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:me(4,we))("placeholder","Pilih "+(n==null?null:n.name))}}function zt(e,i){if(e&1&&f(0,"input",8),e&2){let n=c(2).$implicit;m("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function Jt(e,i){if(e&1&&(s(0,"option",15),h(1),l()),e&2){let n=i.$implicit;m("value",n),p(),ne(n)}}function Qt(e,i){if(e&1&&(s(0,"div",10),f(1,"input",12),s(2,"select",13)(3,"option",14),h(4,"Unit"),l(),R(5,Jt,2,2,"option",15,$),l()()),e&2){let n=c(3).$implicit;m("formGroupName",n.attribute_id),p(),m("placeholder","Isi "+(n==null?null:n.name)),p(2),m("value",null),p(2),G(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function qt(e,i){if(e&1&&f(0,"input",11),e&2){let n=c(3).$implicit;m("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function Zt(e,i){if(e&1&&_(0,Qt,7,3,"div",10)(1,qt,1,2,"input",11),e&2){let n=c(2).$implicit,o=c(2);k((n==null||n.attribute_info==null?null:n.attribute_info.format_type)==o.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function Kt(e,i){if(e&1&&f(0,"datepicker",9),e&2){let n=c(2).$implicit;m("formControlName",n.attribute_id)}}function ei(e,i){if(e&1&&_(0,zt,1,2,"input",8)(1,Zt,2,1)(2,Kt,1,1,"datepicker",9),e&2){let n,o=c().$implicit,t=c(2);k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_validation_type)===t.validationType.VALIDATOR_STRING_TYPE?0:n===t.validationType.VALIDATOR_FLOAT_TYPE?1:n===t.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ti(e,i){if(e&1&&f(0,"ng-select",7),e&2){let n=c().$implicit;m("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:me(3,we))("placeholder","Pilih "+(n==null?null:n.name))}}function ii(e,i){if(e&1&&f(0,"ng-select",7),e&2){let n=c().$implicit;m("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:me(3,we))("placeholder","Pilih "+(n==null?null:n.name))}}function ni(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,Wt,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,Xt,1,5,"ng-select",6)(6,ei,3,1)(7,ti,1,4,"ng-select",7)(8,ii,1,4,"ng-select",7),l()),e&2){let n,o=i.$implicit,t=c(2);p(2),k(o.mandatory?2:-1),p(2),K(" ",o==null?null:o.name," "),p(),k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_type)===t.inputType.MULTI_COMBO_BOX?5:n===t.inputType.FREE_TEXT_FILED?6:n===t.inputType.SINGLE_COMBO_BOX?7:8)}}function oi(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ni,9,3,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(2),G(n)}}var wt=(()=>{let i=class i{constructor(){this.formCategoryService=u(Pe),this.attributesChanges=new O,this.inputType=ee,this.formatType=le,this.validationType=Ne}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(L(o=>{this.form=this.formCategoryService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{t=this.formCategoryService.getFilteredAttributes(o,a),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Pe]),w,U],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","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(t,a){t&1&&(_(0,oi,5,1,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,W,H,Y,J,Ke,et,se,Ze,j,z,Q,q,qe,xt,Nt,Pt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let e=i;return e})();var Oe=(()=>{let i=class i{constructor(){this.httpService=u(re),this.formBuilder=u(Z),this.uploadProductService=u(Ce)}getAttributes(o,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe($e(r=>this.uploadProductService.selectedProduct$.pipe(B(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(o,t){let a=0;return o.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(t),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(o){let t=!1,a=[];return o.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),t=a.some(r=>r>1),t}createFormGroup(o){let t=this.formBuilder.group({}),a=[];return o.forEach(r=>{a=[],r.is_required&&a.push(de.required),t.addControl(r.id,this.formBuilder.control(null,a))}),t}getFilteredAttributes(o,t){let a=JSON.parse(JSON.stringify(o)),r=Object.keys(t),d=a.filter(v=>r.findIndex(Fe=>parseInt(Fe)==v.id)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(r=>(r.is_multiple_selection?r.values=r.values.filter(d=>t[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==t[r.id]),r)).filter(r=>r?.values?.length>0)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function ri(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function ai(e,i){if(e&1&&f(0,"ng-select",6),e&2){let n=c().$implicit;m("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,i){if(e&1&&f(0,"ng-select",7),e&2){let n=c().$implicit;m("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ci(e,i){if(e&1&&(s(0,"small",5),h(1),l()),e&2){let n=c().$implicit;p(),K(" ",n==null?null:n.name," is mandatory ")}}function pi(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,ri,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,ai,1,4,"ng-select",6)(6,li,1,3,"ng-select",7)(7,ci,2,1,"small",5),l()),e&2){let n=i.$implicit;p(2),k(n.is_required?2:-1),p(2),K(" ",n==null?null:n.name," "),p(),k(n.is_multiple_selection?5:6),p(2),k(n.is_required?7:-1)}}function mi(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,pi,8,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(2),G(n)}}var Ot=(()=>{let i=class i{constructor(){this.tiktokAttributeFormService=u(Oe),this.attributesChanges=new O}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(B(o=>o.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(t.values)||t.values?.length==0)))),L(o=>{this.form=this.tiktokAttributeFormService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{t=this.tiktokAttributeFormService.getFilteredAttributes(o,a),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Oe]),w,U],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"]],template:function(t,a){t&1&&(_(0,mi,5,1,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q,oe]});let e=i;return e})();var De=(()=>{let i=class i{constructor(){this.woocommerceUploadService=u(ge)}getAttributes(o,t){return this.woocommerceUploadService.getAttributes(o,t).pipe(B(a=>a.map(r=>({key:r.name,label:r.name}))))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var Dt=(()=>{let i=class i{constructor(){this.wooAttributeFormService=u(De),this.channelId=Ae(),this.categoryId=Ae(),this.attributesChanges=new O}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(o){this.attributesChanges.emit([o.key])}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([De]),w,U],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,a){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),h(3,"Atribut"),l(),s(4,"ng-select",3),S(5,"async"),y("change",function(d){return a.onSelectAttribute(d)}),l()()()),t&2&&(p(4),m("items",T(5,1,a.attributes$)))},dependencies:[I,E,oe,W,H,Y]});let e=i;return e})();var Ve=(()=>{let i=class i{constructor(){this.httpService=u(re),this.formBuilder=u(Z)}getAttributes(o,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(r=>r))}createFormGroup(o){let t=this.formBuilder.group({});return o.forEach(a=>{t.addControl(a.variant,this.formBuilder.control(null))}),t}convertAttributes(o={}){return Object.values(o).filter(a=>a!==null).map(a=>JSON.stringify(a))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function si(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),h(2),l(),f(3,"ng-select",5),l()),e&2){let n=i.$implicit;p(2),K(" ",n==null?null:n.variant," "),p(),m("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function di(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,si,4,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(2),G(n)}}var Vt=(()=>{let i=class i{constructor(){this.tokpedAttrFormService=u(Ve),this.attributesChanges=new O}ngOnInit(){}ngOnChanges(o){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(L(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let o=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{o=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(o)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Ve]),w,U],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,a){t&1&&(_(0,di,5,1,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q]});let e=i;return e})();var Ue=(()=>{let i=class i{constructor(){this.httpService=u(re),this.formBuilder=u(Z)}getAttributes(o){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:o}]).pipe(L(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(o){let t=this.formBuilder.group({});return Object.keys(o.Attribute).forEach(r=>{t.addControl(r,this.formBuilder.control(null))}),t}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function ui(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),h(5," Brand "),l(),f(6,"input",5),l(),s(7,"div",6)(8,"div",4),h(9," Product Type "),l(),f(10,"input",7),l(),s(11,"div",6)(12,"div",4),h(13," Status "),l(),f(14,"ng-select",8),l()()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(13),m("items",n.Options.StatusOptions)}}var Ut=(()=>{let i=class i{constructor(){this.attributesChanges=new O,this.shopifyFormService=u(Ue)}ngOnChanges(o){o.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(L(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Re(500)).subscribe(o=>{this.attributesChanges.emit([o])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Ue]),w,U],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,a){t&1&&(_(0,ui,15,2,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,Y,J,se,j,z,Q,q,W,H]});let e=i;return e})();function fi(e,i){if(e&1&&(s(0,"div",6),f(1,"app-product-card",9),l()),e&2){let n=i.$implicit;p(),m("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("imageForZoom",n==null?null:n.ImageUrl)("code",n==null||n.Variants[0]==null?null:n.Variants[0].Code)("showFooter",!1)}}function _i(e,i){if(e&1){let n=M();D(0),s(1,"mat-checkbox",21),Xe("ngModelChange",function(t){C(n);let a=c().$implicit;return We(a.selected,t)||(a.selected=t),b(t)}),y("ngModelChange",function(){let t=C(n).ngIf,a=c(),r=a.$implicit,d=a.$index,v=c();return b(v.onSelectChannel(r,d,t))}),l(),V()}if(e&2){let n=c().$implicit;p(),He("ngModel",n.selected)}}function hi(e,i){e&1&&(s(0,"div",18),f(1,"input",22),l())}function gi(e,i){if(e&1){let n=M();s(0,"app-channel-category-select",23),y("selectedCategory",function(t){C(n);let a=c().$index,r=c();return b(r.onCategoryChange(a,t))}),l()}if(e&2){let n=c().$implicit,o=c();m("disabled",!n.selected||n.selected&&n.type==o.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function Ci(e,i){if(e&1){let n=M();s(0,"shopee-attribute-form",27),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function bi(e,i){if(e&1){let n=M();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,i){if(e&1){let n=M();s(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,i){if(e&1){let n=M();s(0,"tokopedia-attribute-form",28),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)}}function xi(e,i){if(e&1&&(s(0,"div",20)(1,"div",24),_(2,Ci,1,3,"shopee-attribute-form",25)(3,bi,1,2,"tiktok-attribute-form",26)(4,yi,1,2,"wooocommerce-attribute-form",26)(5,vi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,o=c().$implicit,t=c();p(2),k((n=o.type)===t.channelType.Shopee?2:n===t.channelType.Tiktok?3:n===t.channelType.WooCommerce?4:n===t.channelType.Tokopedia?5:-1)}}function Ii(e,i){if(e&1){let n=M();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),y("attributesChanges",function(t){C(n);let a=c().$index,r=c();return b(r.onAttributesChange(a,t))}),l()()()}if(e&2){let n=c().$implicit;p(2),m("channelId",n.id)}}function Si(e,i){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,_i,2,1,"ng-container",14),S(7,"async"),l(),s(8,"div"),f(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),h(12),l()()()(),s(13,"div",12)(14,"div",17),_(15,hi,2,0,"div",18)(16,gi,1,4,"app-channel-category-select",19),l()()(),_(17,xi,6,1,"div",20)(18,Ii,3,1,"div",20),l()()),e&2){let n=i.$implicit,o=c();p(6),m("ngIf",T(7,8,o.defaultCategories$)),p(3),m("typeId",n.type)("showChannelName",!1),p(),m("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),ne(n.name),p(3),k(n.type==o.channelType.Shopify?15:16),p(2),k(n.categoryId&&o.channelType.Lazada!=n.type&&n.selected?17:o.channelType.Shopify==n.type&&n.selected?18:-1)}}var xr=(()=>{let i=class i{constructor(){this.uploadProductService=u(Ce),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=tt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ie(1))}onCategoryChange(o,t){this.channelProductUploads.update(a=>a.map((r,d)=>(d==o&&(r.categoryId=t,r.attributes=[]),r)))}onAttributesChange(o,t){this.channelProductUploads.update(a=>a.map((r,d)=>(d==o&&(r.attributes=t),r)))}onSelectChannel(o,t,a){this.channelProductUploads.update(r=>r.map((d,v)=>{if(v==t&&o.selected){let Te=this.findCategoryByChannelId(o.id,a);d.categoryId=Te?.DefaultCategoryID}return v==t&&!o.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(o,t){return t.find(a=>a.ID===o)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["app-product-upload"]],standalone:!0,features:[F([he,ut,ft,ge]),U],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"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[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,a){if(t&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return a.onUploadProduct()}),f(3,"i",2),h(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),h(8,"Product To Upload"),l(),s(9,"div",5),R(10,fi,2,7,"div",6,$),S(12,"async"),l(),s(13,"h3",7),h(14,"Channel To Upload"),l(),R(15,Si,19,10,"div",8,$),l()()()),t&2){let r;m("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),m("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),G(T(12,3,a.selectedProducts$)),p(5),G(a.channelProductUploads())}},dependencies:[I,A,E,It,lt,at,Tt,St,pt,ct,oe,j,Qe,rt,ot,wt,Ot,Dt,Vt,Ut,_t,At],encapsulation:2});let e=i;return e})();export{xr as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"./chunk-7YWHTN3X.js";import{a as f}from"./chunk-
|
|
1
|
+
import{b as u}from"./chunk-7YWHTN3X.js";import{a as f}from"./chunk-XRVQ2WEG.js";import"./chunk-QOITECN4.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{n as l}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{y as d}from"./chunk-2E5AKA74.js";import"./chunk-FTHTFVHH.js";import{$c as m,Fc as n,Xc as c,aa as r,ga as s,ha as i,ob as a}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var M=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s({type:t,selectors:[["app-report"]],decls:1,vars:0,template:function(e,O){e&1&&a(0,"router-outlet")},dependencies:[c],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});let o=t;return o})();var y=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-5KL4F7HS.js").then(o=>o.OrderModule),canActivate:[f]}]}],C=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,m.forChild(y)]});let o=t;return o})();var b=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,u,C,d,l,m]});let o=t;return o})();export{b as ReportModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as c}from"./chunk-
|
|
1
|
+
import{g as c}from"./chunk-QOITECN4.js";import{b as a}from"./chunk-JHYIHRQH.js";import{$ as s,ca as o}from"./chunk-ZIZWZZ4E.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-HCJ6C5OR.js";import"./chunk-XUSY2QT2.js";import{a as L}from"./chunk-QYY5XVLP.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-ULELZXI5.js";import{a as Ee}from"./chunk-E5BOLHDG.js";import{a as Te,b as Fe}from"./chunk-A37OKNC2.js";import"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as be}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{e as ge}from"./chunk-PYD2YWAN.js";import{g as Ce}from"./chunk-FQ44ODSE.js";import{b as de,e as ue}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-4CEFDQPI.js";import{t as fe,u as xe}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-2E5AKA74.js";import{c as v,f as he}from"./chunk-FTHTFVHH.js";import{Ab as q,B as Y,Bc as ie,Cc as oe,Ec as ae,Fc as le,Ha as P,Ib as Q,Ja as s,Jb as c,Ka as w,Kb as k,Lb as M,Nb as b,Ob as T,Pb as F,Q as A,Qb as X,Rb as J,Tb as R,Va as O,X as W,_a as u,ab as m,ac as h,bc as x,cc as N,da as K,dc as z,ga as Z,hb as I,ib as U,kb as $,lb as j,mb as a,nb as r,oa as _,ob as S,pa as d,pb as D,qb as V,sb as y,vb as f,vc as ee,xb as l,xc as te,yc as ne}from"./chunk-ZIZWZZ4E.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=v.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=v.GuidEMpty,this.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as Ve}from"./chunk-HCJ6C5OR.js";import"./chunk-XUSY2QT2.js";import{a as L}from"./chunk-QYY5XVLP.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-ULELZXI5.js";import{a as Ee}from"./chunk-E5BOLHDG.js";import{a as Te,b as Fe}from"./chunk-A37OKNC2.js";import"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as be}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{e as ge}from"./chunk-PYD2YWAN.js";import{g as Ce}from"./chunk-QOITECN4.js";import{b as de,e as ue}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-4CEFDQPI.js";import{t as fe,u as xe}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-2E5AKA74.js";import{c as v,f as he}from"./chunk-FTHTFVHH.js";import{Ab as q,B as Y,Bc as ie,Cc as oe,Ec as ae,Fc as le,Ha as P,Ib as Q,Ja as s,Jb as c,Ka as w,Kb as k,Lb as M,Nb as b,Ob as T,Pb as F,Q as A,Qb as X,Rb as J,Tb as R,Va as O,X as W,_a as u,ab as m,ac as h,bc as x,cc as N,da as K,dc as z,ga as Z,hb as I,ib as U,kb as $,lb as j,mb as a,nb as r,oa as _,ob as S,pa as d,pb as D,qb as V,sb as y,vb as f,vc as ee,xb as l,xc as te,yc as ne}from"./chunk-ZIZWZZ4E.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=v.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=v.GuidEMpty,this.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(n){this.searchFilter.text=n,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=this.searchFilter.LocationID,C=t.map(E=>B({ID:E.ID,Code:E.Code,Inventory:E.Inventory},v.IsNotEmpty(i)&&{LocationID:i})),g={ListChannelID:[this.searchFilter.ChannelID],List:C};this.http.post("/api/Inventory/UpdateChannel",g).subscribe(E=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(E)})}}handlingUpdateStock(n){if(n[0]?.Response){let t=n[0]?.Response?.Fail_list,i=n[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",i,t)}else this.toastr.error(n[0]?.Exception,"Error")}refreshInventory(n,t,i,C){let g={ChannelItemID:n,ChannelVariationID:t,ChannelID:i,VariantID:C};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(E=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.Inventory>=0&&(t.selected=n.selected),t))}onCheckboxStateChange(n){n=n.map(t=>(t.Variants=t.Variants.map(i=>(i.selected=this.checkboxState,i)),t))}openTableDialog(n,t,i){this.dialog.open(Pe,{data:{Name:n.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:n.ChannelItemID}}).afterClosed().pipe(Y(g=>v.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g)})}updateItemAfterDialog(n){let t=this.searchFilter.LocationID,i=B({ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:parseFloat(n.Inventory),VariantID:n.ID,SKU:n.Sku},v.IsNotEmpty(t)&&{LocationID:t});this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(C=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([C])})}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=H.DIFFERENCE:this.searchFilter.filterModel=H.ALL,this.initReloadData()}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}};p.\u0275fac=function(t){return new(t||p)(w(ue),w(de),w(Se),w(we),w(Ce),w(be),w(L),w(ye))},p.\u0275cmp=Z({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([G,L]),J],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["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"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,i){t&1&&(u(0,mt,61,32,"mainpanel",2),h(1,"async")),t&2&&m("ngIf",x(1,1,i.loader$))},dependencies:[le,ee,te,ne,ie,ae,oe,Ie,ve,ge,_e,se,me,re,pe,ce,Ee,De,he,Fe,Te,xe,fe,Ve],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let o=p;return o})();export{Kt as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-BGWVHGAY.js";import{b as le}from"./chunk-47PEHCOU.js";import{a as pe,b as me}from"./chunk-MKJON4UM.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-PYD2YWAN.js";import{g as Z}from"./chunk-
|
|
1
|
+
import{a as re}from"./chunk-BGWVHGAY.js";import{b as le}from"./chunk-47PEHCOU.js";import{a as pe,b as me}from"./chunk-MKJON4UM.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-PYD2YWAN.js";import{g as Z}from"./chunk-QOITECN4.js";import{e as Y}from"./chunk-JHYIHRQH.js";import{m as ae,n as oe}from"./chunk-4CEFDQPI.js";import{h as G,m as K,y as Q}from"./chunk-2E5AKA74.js";import{c as X}from"./chunk-FTHTFVHH.js";import{$ as E,Bc as W,Cc as k,Dc as H,Fc as U,Ha as v,Ja as p,Jb as s,Kb as C,Lb as b,Nb as O,Ob as q,Pb as z,Q as D,Qb as A,Rb as V,T as w,_a as u,ab as h,ac as c,bc as d,cc as J,d as I,da as g,ga as N,hb as B,ib as T,kb as $,lb as F,mb as a,nb as o,oa as P,ob as f,pa as R,q as M,sb as j,vb as x,xb as y}from"./chunk-ZIZWZZ4E.js";import{a as S}from"./chunk-GNOSNGXM.js";var L=(()=>{let t=class t{constructor(){this.httpService=g(Y),this._pageination=new I({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(w(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=S(S({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac});let i=t;return i})();function ce(i,t){if(i&1&&(a(0,"span",10),f(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,v)("alt",l.Name),p(),b(" ",l.Name," ")}}function de(i,t){if(i&1&&(a(0,"tr")(1,"td"),f(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td"),s(6),c(7,"json"),o(),a(8,"td"),s(9),c(10,"json"),o(),a(11,"td"),s(12),c(13,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,v),p(2),b(" ",l.ChannelName," "),p(2),C(d(7,5,l.Request)),p(3),C(d(10,7,l.Response)),p(3),C(J(13,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function he(i,t){if(i&1){let l=j();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),$(13,de,14,12,"tr",null,T),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),x("page",function(e){P(l);let r=y();return R(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=y();p(13),F((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function ge(i,t){i&1&&(a(0,"div",9),f(1,"app-empty-state"),o())}var ze=(()=>{let t=class t{constructor(){this.channelLogService=g(L),this.authService=g(Z),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(M(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=X.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=N({type:t,selectors:[["app-channel-log"]],standalone:!0,features:[A([L]),V],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),x("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),z("ngModelChange",function(_){return q(r.channelID,_)||(r.channelID=_),_}),u(7,ce,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,he,21,13,"div",8),c(13,"async"),u(14,ge,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),O("ngModel",r.channelID),p(6),B(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[U,W,H,k,oe,ae,re,me,pe,le,ie,ne,ee,te,Q,G,K]});let i=t;return i})();export{ze as a};
|