marketplacepos 5.46.1 → 5.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-YB4KXB2C.js → chunk-3434HH7H.js} +1 -1
- package/Marketplace/{chunk-DZEO4HK4.js → chunk-3GRC47DP.js} +1 -1
- package/Marketplace/chunk-45FZJ4W3.js +1 -0
- package/Marketplace/{chunk-EI65NYTN.js → chunk-4DMKVXM7.js} +1 -1
- package/Marketplace/{chunk-FTWATKXK.js → chunk-4JQLXONG.js} +1 -1
- package/Marketplace/{chunk-6VYFG4AQ.js → chunk-6RMBCW2O.js} +1 -1
- package/Marketplace/{chunk-DB7C3AL2.js → chunk-6VZVNRUE.js} +2 -2
- package/Marketplace/{chunk-V6UNCLNJ.js → chunk-72OHPB5Q.js} +1 -1
- package/Marketplace/{chunk-3VUO4APC.js → chunk-7AZDAPB7.js} +1 -1
- package/Marketplace/{chunk-7DJXZQ7M.js → chunk-7F74QXF6.js} +1 -1
- package/Marketplace/{chunk-26ZM2UD3.js → chunk-7VLMA7MW.js} +1 -1
- package/Marketplace/{chunk-UGG2CIUU.js → chunk-A57T33JT.js} +1 -1
- package/Marketplace/{chunk-FB2AEPXA.js → chunk-AMYZMAYI.js} +1 -1
- package/Marketplace/{chunk-TGQ5CJ3A.js → chunk-B2WOBUES.js} +1 -1
- package/Marketplace/{chunk-4TDVVQ64.js → chunk-BDKGOINV.js} +1 -1
- package/Marketplace/{chunk-ZUYGRGXM.js → chunk-CBAQUD22.js} +1 -1
- package/Marketplace/{chunk-TE5EYKIN.js → chunk-CBJR2A72.js} +1 -1
- package/Marketplace/{chunk-NLPXBGIX.js → chunk-CIPLCKUF.js} +1 -1
- package/Marketplace/{chunk-HHO2NGCF.js → chunk-CWXOXH6M.js} +1 -1
- package/Marketplace/{chunk-4LZODV4E.js → chunk-FNU2TKTQ.js} +1 -1
- package/Marketplace/{chunk-T43QRQH5.js → chunk-FYRDNKYT.js} +1 -1
- package/Marketplace/{chunk-OAG6OVUY.js → chunk-GPX77ZSI.js} +1 -1
- package/Marketplace/{chunk-MJNFY4NT.js → chunk-GRQD4D2I.js} +1 -1
- package/Marketplace/{chunk-2XWZQCUR.js → chunk-HGZ5B6WR.js} +1 -1
- package/Marketplace/{chunk-2SGPD432.js → chunk-II5QZVLR.js} +1 -1
- package/Marketplace/{chunk-CRKCNTXF.js → chunk-LCZ6SUUA.js} +1 -1
- package/Marketplace/{chunk-FIAI5SPR.js → chunk-NDLOPOFD.js} +1 -1
- package/Marketplace/{chunk-JYCBJ7CC.js → chunk-OEAOBG75.js} +1 -1
- package/Marketplace/{chunk-6CIQBRO4.js → chunk-OHSVQSCM.js} +1 -1
- package/Marketplace/{chunk-VIDSOLHF.js → chunk-P5YM6T6I.js} +1 -1
- package/Marketplace/{chunk-KRQHTRFM.js → chunk-PE4SWUEZ.js} +1 -1
- package/Marketplace/{chunk-ORLTYLPA.js → chunk-PL3Q6PGC.js} +1 -1
- package/Marketplace/{chunk-6U4YIJLC.js → chunk-PLHWGG4D.js} +2 -2
- package/Marketplace/{chunk-OJZ7NGRW.js → chunk-Q2B5GUDO.js} +1 -1
- package/Marketplace/{chunk-GKRWJPI3.js → chunk-QSHR75ZI.js} +1 -1
- package/Marketplace/{chunk-ISUN5G42.js → chunk-QVP2CM7Y.js} +1 -1
- package/Marketplace/chunk-TM6DZ3ZF.js +1 -0
- package/Marketplace/{chunk-ZXTHWBJ4.js → chunk-UX3OTI5X.js} +1 -1
- package/Marketplace/{chunk-KCFCXS2F.js → chunk-V6GFM5AQ.js} +1 -1
- package/Marketplace/{chunk-ZVKOEYH7.js → chunk-WAKKUK6E.js} +1 -1
- package/Marketplace/chunk-WEYKQCVQ.js +1 -0
- package/Marketplace/{chunk-FHWKSD5A.js → chunk-WWLC64XZ.js} +1 -1
- package/Marketplace/{chunk-F2533PAC.js → chunk-XPBMYV5W.js} +1 -1
- package/Marketplace/{chunk-GPGD3XQH.js → chunk-XXAV6VNB.js} +1 -1
- package/Marketplace/{chunk-LOU3DIPY.js → chunk-YA3VMYDA.js} +1 -1
- package/Marketplace/{chunk-L7TKCTLD.js → chunk-YXBR6VYQ.js} +1 -1
- package/Marketplace/{chunk-M7LXGXUM.js → chunk-Z3J3CSGS.js} +1 -1
- package/Marketplace/{chunk-DSYYZDXI.js → chunk-Z67623R4.js} +1 -1
- package/Marketplace/{chunk-IWKRZSYG.js → chunk-ZLNAFA4X.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-RRL4BIVO.js → main-FUX6VJVF.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-2Z7CPNRS.js +0 -1
- package/Marketplace/chunk-EFI2CLNP.js +0 -1
- package/Marketplace/chunk-KFOHH7PE.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as Et}from"./chunk-3BALA33G.js";import"./chunk-OXWPLJEW.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-EI65NYTN.js";import"./chunk-WAZXTB4X.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-BAXQ2L7B.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-KRQHTRFM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as _t,b as ve}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as pt,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import{a as st}from"./chunk-RM2OSYMV.js";import"./chunk-6VYFG4AQ.js";import"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import{b as De,c as h}from"./chunk-PW42BQIY.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as s,Z as te,Zb as Oe,ad as I,ca as pe,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as p,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),s("ngIf",!e.hideBtnToday),c(),s("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(pe(this._destroyed)).subscribe(g=>r.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(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,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(i,n){i&1&&(p(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),s("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();s("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,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"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();p(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),p(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),s("disabled",n.disabled)("appearance",n.appearance),c(),s("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),s("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),s("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,pt,mt,_t],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:3px;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}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
|
|
1
|
+
import{b as Et}from"./chunk-3BALA33G.js";import"./chunk-OXWPLJEW.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-4DMKVXM7.js";import"./chunk-WAZXTB4X.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-BAXQ2L7B.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-PE4SWUEZ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as _t,b as ve}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as pt,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import{a as st}from"./chunk-RM2OSYMV.js";import"./chunk-6RMBCW2O.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import{b as De,c as h}from"./chunk-PW42BQIY.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as s,Z as te,Zb as Oe,ad as I,ca as pe,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as p,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),s("ngIf",!e.hideBtnToday),c(),s("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(pe(this._destroyed)).subscribe(g=>r.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(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,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(i,n){i&1&&(p(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),s("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();s("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,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"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();p(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),p(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),s("disabled",n.disabled)("appearance",n.appearance),c(),s("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),s("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),s("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,pt,mt,_t],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:3px;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}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
|
|
2
2
|
`],encapsulation:2})}}return t})(),Nt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve,Ot,It]})}}return t})();var Ve=()=>[];function Kt(t,m){t&1&&(p(0,"span",5),f(1,"*"),a())}function Jt(t,m){if(t&1&&d(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(4,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function qt(t,m){if(t&1&&d(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function zt(t,m){if(t&1&&(p(0,"option",15),f(1),a()),t&2){let e=m.$implicit;s("value",e),c(),ie(e)}}function Qt(t,m){if(t&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),f(4,"Unit"),a(),L(5,zt,2,2,"option",15,B),a()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),c(),s("placeholder","Isi "+(e==null?null:e.name)),c(2),s("value",null),c(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Zt(t,m){if(t&1&&d(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ei(t,m){if(t&1&&_(0,Qt,7,3,"div",10)(1,Zt,1,2,"input",11),t&2){let e=l(2).$implicit,i=l(2);S((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ti(t,m){if(t&1&&d(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function ii(t,m){if(t&1&&_(0,qt,1,2,"input",8)(1,ei,2,1)(2,ti,1,1,"datepicker",9),t&2){let e,i=l().$implicit,n=l(2);S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:e===n.validationType.VALIDATOR_FLOAT_TYPE?1:e===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ni(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function oi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function ri(t,m){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,Kt,2,0,"span",5),p(3,"span"),f(4),a()(),_(5,Jt,1,5,"ng-select",6)(6,ii,3,1)(7,ni,1,4,"ng-select",7)(8,oi,1,4,"ng-select",7),a()),t&2){let e,i=m.$implicit,n=l(2);c(2),S(i.mandatory?2:-1),c(2),Q(" ",i==null?null:i.name," "),c(),S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:e===n.inputType.FREE_TEXT_FILED?6:e===n.inputType.SINGLE_COMBO_BOX?7:8)}}function ai(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2),L(3,ri,9,3,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),s("formGroup",i.form),c(2),R(e)}}var wt=(()=>{class t{constructor(){this.formCategoryService=u(we),this.attributesChanges=new D,this.inputType=z,this.formatType=le,this.validationType=ce}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[F([we]),O],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(i,n){i&1&&(_(0,ai,5,1,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,it,nt,ne,tt,$,W,K,J,et,xt,Nt,Dt],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}"]})}}return t})();var ee=function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t}(ee||{});var Ue=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q),this.uploadProductService=u(Ie)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Ge(o=>this.uploadProductService.selectedProduct$.pipe(V(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(e,i){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(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let i=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(me.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([ee.TIKTOK_SHOP,ee.TOKOPEDIA],[me.required])),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function li(t,m){t&1&&(p(0,"small",6),f(1," Platform is required "),a())}function ci(t,m){t&1&&(p(0,"span",6),f(1,"*"),a())}function si(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function pi(t,m){if(t&1&&d(0,"ng-select",8),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function mi(t,m){if(t&1&&d(0,"input",9),t&2){let e=l().$implicit;s("formControlName",e.id)("placeholder",e==null?null:e.name)}}function di(t,m){if(t&1&&(p(0,"small",6),f(1),a()),t&2){let e=l().$implicit;c(),Q(" ",e==null?null:e.name," is mandatory ")}}function ui(t,m){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,ci,2,0,"span",6),p(3,"span"),f(4),a()(),_(5,si,1,4,"ng-select",7)(6,pi,1,3,"ng-select",8)(7,mi,1,2,"input",9)(8,di,2,1,"small",6),a()),t&2){let e=m.$implicit;c(2),S(e.is_required?2:-1),c(2),Q(" ",e==null?null:e.name," "),c(),S(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),c(3),S(e.is_required?8:-1)}}function fi(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),f(6," Platform Options"),a()(),d(7,"ng-select",5),_(8,li,2,0,"small",6),a(),L(9,ui,9,4,"div",3,B),a()(),w()),t&2){let e,i=m.ngIf,n=l();c(),s("formGroup",n.form),c(6),s("multiple",!0)("items",n.platformOptions)("clearable",!1),c(),S(!(n.form==null||(e=n.form.get("listingPlatform").errors)==null)&&e.required?8:-1),c(),R(i)}}var Vt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Ue),this.platformChange=je({alias:"onPlatformChanges"}),this.formSubscription=new de,this.attributesChanges=new D,this.platformOptions=[{label:"TikTok Shop",value:ee.TIKTOK_SHOP},{label:"Tokopedia",value:ee.TOKOPEDIA}]}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.form.valueChanges.pipe(pe(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ye(this.form.get("listingPlatform").value),pe(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[F([Ue]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[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(i,n){i&1&&(_(0,fi,11,5,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,ne,$,W,K,J,oe],encapsulation:2})}}return t})();var Be=(()=>{class t{constructor(){this.woocommerceUploadService=u(xe)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ut=(()=>{class t{constructor(){this.wooAttributeFormService=u(Be),this.channelId=Me(),this.categoryId=Me(),this.attributesChanges=new D}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[F([Be]),O],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(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),a(),p(4,"ng-select",3),x(5,"async"),y("change",function(r){return n.onSelectAttribute(r)}),a()()()),i&2&&(c(4),s("items",I(5,1,n.attributes$)))},dependencies:[T,k,oe,Y,H,G],encapsulation:2})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(o=>o))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function _i(t,m){if(t&1&&(p(0,"div",3)(1,"div",4),f(2),a(),d(3,"ng-select",5),a()),t&2){let e=m.$implicit;c(2),Q(" ",e==null?null:e.variant," "),c(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function hi(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2),L(3,_i,4,4,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),s("formGroup",i.form),c(2),R(e)}}var Bt=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Le),this.attributesChanges=new D}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Le]),O],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(i,n){i&1&&(_(0,hi,5,1,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,$,W,K,J],encapsulation:2})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function gi(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),a(),d(6,"input",5),a(),p(7,"div",6)(8,"div",4),f(9," Product Type "),a(),d(10,"input",7),a(),p(11,"div",6)(12,"div",4),f(13," Status "),a(),d(14,"ng-select",8),a()()(),w()),t&2){let e=m.ngIf,i=l();c(),s("formGroup",i.form),c(13),s("items",e.Options.StatusOptions)}}var Lt=(()=>{class t{constructor(){this.attributesChanges=new D,this.shopifyFormService=u(Re)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(He(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Re]),O],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(i,n){i&1&&(_(0,gi,15,2,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,G,X,ne,$,W,K,J,Y,H],encapsulation:2})}}return t})();function Ci(t,m){if(t&1&&(p(0,"div",6),d(1,"app-product-card",9),a()),t&2){let e=m.$implicit;c(),s("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 bi(t,m){if(t&1){let e=E();N(0),p(1,"mat-checkbox",21),qe("ngModelChange",function(n){C(e);let o=l().$implicit;return Je(o.selected,n)||(o.selected=n),b(n)}),y("ngModelChange",function(){let n=C(e).ngIf,o=l(),r=o.$implicit,g=o.$index,se=l();return b(se.onSelectChannel(r,g,n))}),a(),w()}if(t&2){let e=l().$implicit;c(),Ke("ngModel",e.selected)}}function yi(t,m){if(t&1&&(p(0,"div",18),d(1,"input",22),a()),t&2){let e=l().$implicit,i=l();s("matTooltip",e.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function vi(t,m){if(t&1){let e=E();p(0,"app-channel-category-select",23),y("selectedCategory",function(n){C(e);let o=l().$index,r=l();return b(r.onCategoryChange(o,n))}),a()}if(t&2){let e=l().$implicit,i=l();s("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ti(t,m){if(t&1){let e=E();p(0,"shopee-attribute-form",27),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function xi(t,m){if(t&1){let e=E();p(0,"tiktok-attribute-form",28),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onPlatformChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Ii(t,m){if(t&1){let e=E();p(0,"wooocommerce-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Si(t,m){if(t&1){let e=E();p(0,"tokopedia-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Fi(t,m){if(t&1&&(p(0,"div",20)(1,"div",24),_(2,Ti,1,3,"shopee-attribute-form",25)(3,xi,1,2,"tiktok-attribute-form",26)(4,Ii,1,2,"wooocommerce-attribute-form",26)(5,Si,1,2,"tokopedia-attribute-form",26),a()()),t&2){let e,i=l().$implicit,n=l();c(2),S((e=i.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function Ai(t,m){if(t&1){let e=E();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),y("attributesChanges",function(n){C(e);let o=l().$index,r=l();return b(r.onAttributesChange(o,n))}),a()()()}if(t&2){let e=l().$implicit;c(2),s("channelId",e.id)}}function ki(t,m){if(t&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,bi,2,1,"ng-container",14),x(7,"async"),a(),p(8,"div"),d(9,"app-channel-logo",15),a(),p(10,"div",16)(11,"span"),f(12),a()()()(),p(13,"div",12)(14,"div",17),_(15,yi,2,1,"div",18)(16,vi,1,4,"app-channel-category-select",19),a()()(),_(17,Fi,6,1,"div",20)(18,Ai,3,1,"div",20),a()()),t&2){let e=m.$implicit,i=l();c(6),s("ngIf",I(7,8,i.defaultCategories$)),c(3),s("typeId",e.type)("showChannelName",!1),c(),s("matTooltip",e.name)("matTooltipShowDelay",2500),c(2),ie(e.name),c(3),S(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo?15:16),c(2),S(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:i.channelType.Shopify==e.type&&e.selected?18:-1)}}var Ar=(()=>{class t{constructor(){this.toastr=u(ot),this.uploadProductService=u(Ie),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=De,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(te(1))}onCategoryChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onAttributesChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.attributes=i),o)))}tiktokPlatformChanges(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onSelectChannel(e,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&e.selected){let se=this.findCategoryByChannelId(e.id,n);r.categoryId=se?.DefaultCategoryID}return g==i&&!e.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(e,i){return i.find(n=>n.ID===e)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(i=>i.type==De.Tiktok&&h.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[F([Te,ht,gt,xe])],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","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return n.onUploadProduct()}),d(3,"i",2),f(4," Upload "),a()(),p(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),a(),p(9,"div",5),L(10,Ci,2,7,"div",6,B),x(12,"async"),a(),p(13,"h3",7),f(14,"Channel To Upload"),a(),L(15,ki,19,10,"div",8,B),a()()()),i&2){let o;s("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),s("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),c(8),R(I(12,3,n.selectedProducts$)),c(5),R(n.channelProductUploads())}},dependencies:[T,A,k,St,ct,lt,At,Ft,st,oe,$,Ze,at,rt,Vt,Ut,Bt,Lt,Ct,Et,wt],encapsulation:2})}}return t})();export{Ar as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-GH5FTODR.js";import{a as h}from"./chunk-CGEIIRYF.js";import{a as m}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-GH5FTODR.js";import{a as h}from"./chunk-CGEIIRYF.js";import{a as m}from"./chunk-CIPLCKUF.js";import"./chunk-PE5AFID4.js";import{c as M}from"./chunk-KSHWHTCH.js";import{b as O}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import{a}from"./chunk-PL3Q6PGC.js";import{a as P}from"./chunk-BAXQ2L7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import{a as C}from"./chunk-LDL3A7NM.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as g}from"./chunk-PYXL7UF7.js";import"./chunk-PW42BQIY.js";import{n as f}from"./chunk-HJXYT6MI.js";import{A as u}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{s}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as l,J as i,n as r}from"./chunk-FXQKRJWU.js";import{Gb as d,Hb as e,ka as n,kc as c}from"./chunk-OJMQBH6T.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-6VZVNRUE.js").then(t=>t.StatusModule),canActivate:[a,m]},{path:"download",loadChildren:()=>import("./chunk-QVP2CM7Y.js").then(t=>t.DownloadModule),canActivate:[a,m]},{path:"upload",loadComponent:()=>import("./chunk-72OHPB5Q.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{c as ht}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-EHUVS2VB.js";import{b as ut}from"./chunk-YTCIQBSO.js";import"./chunk-W3JTS22H.js";import"./chunk-6OMSPZZC.js";import{a as Z}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{i as rt}from"./chunk-
|
|
1
|
+
import{c as ht}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-EHUVS2VB.js";import{b as ut}from"./chunk-YTCIQBSO.js";import"./chunk-W3JTS22H.js";import"./chunk-6OMSPZZC.js";import{a as Z}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{i as rt}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as et,e as it}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as st,b as at,d as lt,e as ct}from"./chunk-PYXL7UF7.js";import{b as h,c as tt}from"./chunk-PW42BQIY.js";import{m as dt,n as gt}from"./chunk-HJXYT6MI.js";import{A as Y,h as Q,m as X}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as nt,c as ot}from"./chunk-ERXVXBTU.js";import{r as mt,s as pt}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as y,f as J,g as G,j as q,n as L}from"./chunk-FXQKRJWU.js";import{$c as C,Fc as P,Gb as V,Gc as a,Hb as S,Hc as u,Ic as W,Kc as w,Lc as D,Mb as g,Mc as R,Nc as $,Oc as A,Pc as H,Sc as z,Yb as l,Z as M,aa as F,ad as x,cd as U,ea as k,ic as o,jc as r,ka as f,kc as j,lc as T,mc as N,oc as O,pb as K,q as B,rb as s,tc as I,uc as c,v,xb as _,ya as b,za as E}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ct=e=>[e];function xt(e,m){if(e&1&&(o(0,"span",15),j(1,"img",16),r(),o(2,"span"),a(3),r()),e&2){let t=m.item;s(),l("src",t.Img,K)("alt",t.Name),s(2),W(" ",t.Name," ")}}function Lt(e,m){if(e&1){let t=O();T(0),$(1),C(2,"async"),o(3,"a",17),I("click",function(){b(t);let n=H(1),p=c();return E(p.submitLogistics(n))}),a(4,"Submit"),r(),N()}if(e&2){let t=c();s(),A(x(2,0,t.logisticServices$))}}function yt(e,m){}function vt(e,m){if(e&1){let t=O();o(0,"ng-select",20),R("ngModelChange",function(n){b(t);let p=c(2).$implicit;return D(p.ProductSKU,n)||(p.ProductSKU=n),E(n)}),r()}if(e&2){let t=c().ngIf,i=c().$implicit;w("ngModel",i.ProductSKU),l("items",t)}}function Mt(e,m){if(e&1&&(o(0,"span"),a(1),r()),e&2){let t=c(2).$implicit;s(),u(t.ProductSKU||"-")}}function bt(e,m){if(e&1&&(T(0),g(1,yt,0,0,"ng-template",19)(2,vt,1,2,"ng-template",null,0,U)(4,Mt,2,1,"ng-template",null,1,U),N()),e&2){let t=P(3),i=P(5),n=c(2);s(),l("ngxPermissionsOnly",z(3,Ct,n.logisticEditRole))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",i)}}function Et(e,m){if(e&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td"),a(4),r(),o(5,"td"),a(6),r(),o(7,"td"),g(8,bt,6,5,"ng-container",18),C(9,"async"),r()()),e&2){let t=m.$implicit,i=c();s(2),u(t.Name),s(2),u(t.Service),s(2),u(t.TypeString),s(2),l("ngIf",x(9,4,i.logisticOptions$))}}var _t=(()=>{class e{constructor(t,i,n){this.http=t,this.toastr=i,this.authService=n,this.filter={ChannelID:""},this.logisticEditRole=Z.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[h.WooCommerce,h.Lazada,h.Shopify,h.Plugo,h.Tokopedia];this.channelOptions=this.channelOptions.map(i=>(t.forEach(n=>{i.TypeID===n&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(v(i=>t.map(n=>(i.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(i=>this.http.post("/api/Logistic/Submit",i))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(t=>t.map(i=>(i.ProductSKU=tt.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i))),k(t=>{let i=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=B(i)}),M(1))}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(i){return new(i||e)(_(it),_(et),_(rt))}}static{this.\u0275cmp=V({type:e,selectors:[["app-logistic"]],standalone:!1,decls:28,vars:9,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[4,"ngIf"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,n){i&1&&(o(0,"mainpanel",2),I("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),a(4,"Select a Channel"),r(),o(5,"ng-select",4),R("ngModelChange",function(d){return D(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),g(6,xt,4,3,"ng-template",5),r()()(),o(7,"actions"),g(8,Lt,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),a(18,"Logistic"),r(),o(19,"th"),a(20,"Service"),r(),o(21,"th"),a(22,"Type"),r(),o(23,"th"),a(24,"Logistic Service"),r()()(),o(25,"tbody"),g(26,Et,10,6,"tr",14),C(27,"async"),r()()()()()()()()),i&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),s(5),l("clearable",!1)("items",n.channelOptions),w("ngModel",n.filter.ChannelID),s(3),l("ngxPermissionsOnly",n.logisticEditRole),s(18),l("ngForOf",x(27,7,n.logisticServices$)))},dependencies:[J,G,Q,X,dt,lt,st,at,mt,nt,q],encapsulation:2})}}return e})();var Tt=[{path:"",component:_t}],St=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y.forChild(Tt)]})}}return e})();var oe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y,St,Y,gt,ct,ut,ht,pt,ot]})}}return e})();export{oe as LogisticModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-PL3Q6PGC.js";import{a as s,b as l}from"./chunk-WRJFUNM3.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as c,J as d}from"./chunk-FXQKRJWU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-Q2B5GUDO.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-4JQLXONG.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-XPBMYV5W.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-6RMBCW2O.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PW42BQIY.js";import{m as k,n as B}from"./chunk-HJXYT6MI.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as P,H as T,J as R,g as D,j as C,k as b,m as y,n as M}from"./chunk-FXQKRJWU.js";import{$c as c,Gb as h,Gc as n,Hc as d,Ic as _,Mb as s,Yb as m,aa as I,ad as E,bd as x,ic as i,jc as t,lc as f,mc as u,rb as o,uc as S,v as g,xb as v}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function N(a,p){if(a&1&&(i(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),n(9),t()()()()()()),a&2){let e=S().ngIf;o(9),d(e.Perflog)}}function L(a,p){if(a&1&&(f(0),i(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),n(5,"StackTrace"),t()(),i(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),n(10),t()()()()()(),u()),a&2){let e=S().ngIf;o(10),d(e==null?null:e.StackTrace)}}function A(a,p){if(a&1&&(f(0),i(1,"mainpanel",1)(2,"actions")(3,"a",2),n(4,"Back"),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),n(12,"General"),t()(),i(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),n(18,"Created Date"),t(),i(19,"div")(20,"span"),n(21),c(22,"date"),t()()()(),i(23,"div",10)(24,"div",11)(25,"label"),n(26,"Status"),t(),i(27,"div")(28,"span"),n(29),t()()()()(),i(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),n(34,"Duration"),t(),i(35,"div")(36,"span"),n(37),c(38,"number"),t()()()(),i(39,"div",10)(40,"div",11)(41,"label"),n(42,"Label"),t(),i(43,"div")(44,"span"),n(45),t()()()()()()()()(),i(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),n(51,"Message"),t()(),i(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),n(56),t()()()()()(),s(57,N,10,1,"div",16)(58,L,11,1,"ng-container",0),t()()()(),u()),a&2){let e=p.ngIf;o(),m("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(x(22,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",x(38,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m("ngIf",e==null?null:e.Perflog),o(),m("ngIf",e==null?null:e.StackTrace)}}var K=(()=>{class a{constructor(e,r){this.activatedRoute=e,this.notificationService=r}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(I(e=>{let r=e.ID;return this.notificationService.getNotificationDetail(r).pipe(g(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(r){return new(r||a)(v(P),v(w))}}static{this.\u0275cmp=h({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(r,l){r&1&&(s(0,A,59,16,"ng-container",0),c(1,"async")),r&2&&m("ngIf",E(1,1,l.notification$))},dependencies:[M,D,C,y,b,B,k,R,T],encapsulation:2})}}return a})();export{K as DetailComponent};
|