marketplacepos 6.15.2 → 6.17.0
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-L67B5QHG.js → chunk-3IFI3DA7.js} +1 -1
- package/Marketplace/{chunk-LNL76CCI.js → chunk-4DL2VMP3.js} +1 -1
- package/Marketplace/{chunk-EAWEMKYY.js → chunk-4L4F4YDJ.js} +1 -1
- package/Marketplace/{chunk-ND3E3JXY.js → chunk-57YAHKSG.js} +1 -1
- package/Marketplace/{chunk-5AMI5FKZ.js → chunk-65RTUXHR.js} +1 -1
- package/Marketplace/{chunk-4XHNA5C2.js → chunk-6AT43CWE.js} +1 -1
- package/Marketplace/{chunk-BG2TEGIZ.js → chunk-6DLMY2CE.js} +1 -1
- package/Marketplace/chunk-6N43GVXM.js +1 -0
- package/Marketplace/{chunk-27E3Z5GH.js → chunk-7FNQ2GQS.js} +1 -1
- package/Marketplace/chunk-7OD22M3E.js +5 -0
- package/Marketplace/{chunk-B6ZMX4IH.js → chunk-AKBZT5IA.js} +1 -1
- package/Marketplace/{chunk-EOGHANPX.js → chunk-B67MU32B.js} +1 -1
- package/Marketplace/{chunk-ITWEKB4F.js → chunk-BEILTIPT.js} +1 -1
- package/Marketplace/{chunk-ISADM5C7.js → chunk-CPZTM7IY.js} +1 -1
- package/Marketplace/{chunk-LOGLFY77.js → chunk-CRUK4B3B.js} +1 -1
- package/Marketplace/{chunk-BBL5IDM4.js → chunk-CSKWOS5O.js} +1 -1
- package/Marketplace/chunk-CUHQVRXW.js +2 -0
- package/Marketplace/{chunk-3656TXPU.js → chunk-CZWCG4XL.js} +1 -1
- package/Marketplace/{chunk-JDSWLUNI.js → chunk-DFUNNDYJ.js} +1 -1
- package/Marketplace/{chunk-I3YXIZDJ.js → chunk-DGUHZAEF.js} +1 -1
- package/Marketplace/{chunk-JZTTGV4L.js → chunk-G74QFY62.js} +1 -1
- package/Marketplace/{chunk-2423HFPY.js → chunk-GFWH2QRZ.js} +1 -1
- package/Marketplace/{chunk-XFYJD2DA.js → chunk-GIK2G4XA.js} +1 -1
- package/Marketplace/{chunk-TD2ZCT65.js → chunk-GUUW43WS.js} +1 -1
- package/Marketplace/{chunk-6PSPJHVG.js → chunk-H55PZBCT.js} +1 -1
- package/Marketplace/{chunk-BDMSORVY.js → chunk-HGW7I5IX.js} +1 -1
- package/Marketplace/{chunk-MS5FB7FV.js → chunk-HIZ6BMXD.js} +1 -1
- package/Marketplace/{chunk-FXZT2H5P.js → chunk-IBG7FC22.js} +1 -1
- package/Marketplace/{chunk-TLWYHUUO.js → chunk-JDVIHJTE.js} +2 -2
- package/Marketplace/{chunk-VVGTZ46O.js → chunk-JFD33K4G.js} +1 -1
- package/Marketplace/{chunk-5IG5BJ54.js → chunk-K5BJGBUJ.js} +1 -1
- package/Marketplace/{chunk-PKX4YRZ4.js → chunk-KOGQHIDC.js} +1 -1
- package/Marketplace/{chunk-BOGEXKW5.js → chunk-KUDGADGS.js} +1 -1
- package/Marketplace/{chunk-D36S23WF.js → chunk-L77Z3QKG.js} +1 -1
- package/Marketplace/{chunk-ONRCXNH7.js → chunk-LAWTMIGQ.js} +1 -1
- package/Marketplace/{chunk-2DJZCCOV.js → chunk-LDWSSQUQ.js} +1 -1
- package/Marketplace/{chunk-TYKTMYLX.js → chunk-ORMNHQPL.js} +1 -1
- package/Marketplace/chunk-OUK3PRAJ.js +1 -0
- package/Marketplace/{chunk-RZ6GLNUY.js → chunk-P76E2LDH.js} +1 -1
- package/Marketplace/{chunk-YRXAFHY5.js → chunk-PFT7FFT2.js} +1 -1
- package/Marketplace/{chunk-VUNIQEWB.js → chunk-PV6PZQ5L.js} +1 -1
- package/Marketplace/{chunk-VRXDV32Q.js → chunk-QQTGBJTB.js} +1 -1
- package/Marketplace/{chunk-VZHQPWY7.js → chunk-QVQK7ZHE.js} +1 -1
- package/Marketplace/{chunk-P3OEO26J.js → chunk-RSZD2W7L.js} +1 -1
- package/Marketplace/{chunk-AAXLJBQR.js → chunk-RZVVHDQ5.js} +1 -1
- package/Marketplace/{chunk-4MNXTOKF.js → chunk-SQBMRR3H.js} +1 -1
- package/Marketplace/{chunk-IOSNHFSC.js → chunk-T2662ZTD.js} +1 -1
- package/Marketplace/{chunk-MSLFPEIM.js → chunk-TAPLTW2W.js} +1 -1
- package/Marketplace/{chunk-SHIOTMJP.js → chunk-TEROB6SI.js} +1 -1
- package/Marketplace/{chunk-3UPK5AOH.js → chunk-TWMDEAOZ.js} +1 -1
- package/Marketplace/{chunk-G6KTKEOU.js → chunk-TZUM4ZLW.js} +1 -1
- package/Marketplace/{chunk-AMXD7YRS.js → chunk-UD7O7OMH.js} +1 -1
- package/Marketplace/{chunk-MOBWKV55.js → chunk-UZBNAFOW.js} +1 -1
- package/Marketplace/{chunk-TMRQFTQQ.js → chunk-V3HBIN5L.js} +1 -1
- package/Marketplace/{chunk-UWXXJN47.js → chunk-VNHCKVBS.js} +1 -1
- package/Marketplace/{chunk-YTGA7YY7.js → chunk-VZSU7T3T.js} +1 -1
- package/Marketplace/{chunk-5NS3HMYX.js → chunk-WFZFCP74.js} +1 -1
- package/Marketplace/{chunk-NJVJP7SN.js → chunk-WUN3TOT7.js} +1 -1
- package/Marketplace/{chunk-UXUOTQHD.js → chunk-XTA2FHBE.js} +1 -1
- package/Marketplace/{chunk-5MNZXL7V.js → chunk-XYJFKYWS.js} +1 -1
- package/Marketplace/{chunk-XRA2GQ7O.js → chunk-YQLGG4VE.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-IPQOTDK6.js +13 -0
- package/package.json +1 -1
- package/Marketplace/chunk-AZAZ7BJH.js +0 -1
- package/Marketplace/chunk-HSFW6BCX.js +0 -5
- package/Marketplace/chunk-ITOV7TL4.js +0 -2
- package/Marketplace/chunk-VITCXEPW.js +0 -1
- package/Marketplace/main-GVW5UY6D.js +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Kt}from"./chunk-Y7LL5UP5.js";import"./chunk-THQBY3F5.js";import{a as Wt,b as Yt}from"./chunk-XA2GD2PT.js";import{b as jt}from"./chunk-TI7Z2DZM.js";import"./chunk-XQP3JKDZ.js";import{a as Bt}from"./chunk-AIEBXZIK.js";import"./chunk-Q2SYKVKJ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import{a as Rt}from"./chunk-6M6TTQHG.js";import{a as Gt}from"./chunk-7HJRODVG.js";import{a as lt,b as Lt,c as $t,d as ct,e as st}from"./chunk-UWXXJN47.js";import"./chunk-VUYPSK3A.js";import"./chunk-O25VE5LE.js";import"./chunk-5MNZXL7V.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-EOGHANPX.js";import"./chunk-ACIMXBIC.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{d as L,e as $}from"./chunk-5TH35CMP.js";import{b as wt}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import{a as Ut}from"./chunk-3ZLKAFXU.js";import{b as Ht,c as Xt}from"./chunk-6TX26J3J.js";import"./chunk-JU6FJIOF.js";import"./chunk-DHKYJUQU.js";import"./chunk-TF3XKSU7.js";import"./chunk-YJQOSNK6.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-7X3SWRGG.js";import"./chunk-D5XV3F5J.js";import"./chunk-GVNUAV72.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-LTASTRU4.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-NGMSEBXY.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import{b as Vt}from"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import"./chunk-ZSUWHVKX.js";import"./chunk-G6KTKEOU.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import{b as _t,c as f}from"./chunk-C63EIRLC.js";import{A as Z,B as w,c as z,e as ot,h as U,i as G,l as at,m as Et,n as j,q as kt,r as W,s as Y,t as Ot,u as Dt,v as Mt,z as H}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{b as Nt,e as Q}from"./chunk-UB4NDUUT.js";import"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{x as S}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as h,Eb as T,I as xt,K as St,Ma as O,Mc as _,Nc as nt,Oc as K,Qc as At,Rc as Ft,Sc as Pt,V as q,X as It,Zc as x,_ as ut,_c as rt,aa as P,bc as C,cc as D,d as Tt,ec as M,fc as V,gc as p,hc as s,hd as y,ia as N,ic as l,id as v,jc as u,mb as m,na as d,qc as B,sd as A,t as F,td as g,ua as E,va as k,vc as I,xc as a}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var X=(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})(X||{});var tt=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(tt||{});var et=(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})(et||{});var ft=class extends at{setValue(c,t){if(c instanceof Date){let i=Math.floor(c.getTime()/1e3);super.setValue(i,t)}else super.setValue(c,t)}},ht=(()=>{class e{constructor(){this.shopeeUploadService=d(lt),this.formBuilder=d(H)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.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(b=>b.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(ot.required),o?.attribute_info?.format_type==tt.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==X.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new at(null),value:new at(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==X.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==et.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new ft(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(b=>o.findIndex(dt=>parseInt(dt)==b.attribute_id||b.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case X.MULTI_COMBO_BOX:f.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(b=>b==r.value_id)!=-1):o.attribute_value_list=[];break;case X.FREE_TEXT_FILED:o.attribute_info.format_type==tt.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==et.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(t,i){let n=[];if(f.IsNotEmpty(t)){let o={value_id:0,original_value_name:JSON.stringify(t)};f.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(t){let i=[];return f.IsNotEmpty(t)&&(i=[{value_id:0,original_value_name:JSON.stringify(t)}]),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();var Ct=()=>[];function te(e,c){e&1&&(s(0,"span",4),_(1,"*"),l())}function ee(e,c){if(e&1&&u(0,"ng-select",5),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:rt(4,Ct))("placeholder","Pilih "+(t==null?null:t.name))}}function ie(e,c){if(e&1&&u(0,"input",7),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&(s(0,"option",14),_(1),l()),e&2){let t=c.$implicit;p("value",t),m(),nt(t)}}function ne(e,c){if(e&1&&(s(0,"div",9),u(1,"input",11),s(2,"select",12)(3,"option",13),_(4,"Unit"),l(),M(5,oe,2,2,"option",14,D),l()()),e&2){let t=a(3).$implicit;p("formGroupName",t.attribute_id),m(),p("placeholder","Isi "+(t==null?null:t.name)),m(2),p("value",null),m(2),V(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function re(e,c){if(e&1&&u(0,"input",10),e&2){let t=a(3).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ae(e,c){if(e&1&&h(0,ne,7,3,"div",9)(1,re,1,2,"input",10),e&2){let t=a(2).$implicit,i=a(2);C((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function le(e,c){if(e&1&&u(0,"datepicker",8),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)}}function ce(e,c){if(e&1&&h(0,ie,1,2,"input",7)(1,ae,2,1)(2,le,1,1,"datepicker",8),e&2){let t,i=a().$implicit,n=a(2);C((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function se(e,c){if(e&1&&u(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:rt(3,Ct))("placeholder","Pilih "+(t==null?null:t.name))}}function me(e,c){if(e&1&&u(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:rt(3,Ct))("placeholder","Pilih "+(t==null?null:t.name))}}function pe(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),h(2,te,2,0,"span",4),s(3,"span"),_(4),l()(),h(5,ee,1,5,"ng-select",5)(6,ce,3,1)(7,se,1,4,"ng-select",6)(8,me,1,4,"ng-select",6),l()),e&2){let t,i=c.$implicit,n=a(2);m(2),C(i.mandatory?2:-1),m(2),K(" ",i==null?null:i.name," "),m(),C((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),M(2,pe,9,3,"div",2,D),l()()),e&2){let t=a();p("formGroup",t.form),m(2),V(c)}}var Jt=(()=>{class e{constructor(){this.formCategoryService=d(ht),this.channelType=g(void 0),this.categoryId=g(void 0),this.channelId=g(void 0),this.channelProductUpload=g(void 0),this.attributesChanges=A(),this.inputType=X,this.formatType=tt,this.validationType=et}ngOnChanges(){let t=this.categoryId(),i=this.channelId();f.IsNotEmpty(t)&&f.IsNotEmpty(i)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:t,channelId:i,channelType:this.channelType()}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),q(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),O],decls:2,vars:3,consts:[[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){if(i&1&&(h(0,de,4,1,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[$,L,w,j,Dt,Mt,z,Ot,U,G,Y,W,kt,Gt,Xt,Ht,S],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{--mat-icon-button-state-layer-size: 36px}"],changeDetection:0})}}return e})();var J=(function(e){return e.TIKTOK_SHOP="TIKTOK_SHOP",e.TOKOPEDIA="TOKOPEDIA",e})(J||{});var gt=(()=>{class e{constructor(){this.httpService=d(Q),this.formBuilder=d(H),this.uploadProductService=d(st)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(xt(o=>this.uploadProductService.selectedProduct$.pipe(F(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.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(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(ot.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([J.TIKTOK_SHOP,J.TOKOPEDIA],[ot.required])),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(b=>o.findIndex(dt=>parseInt(dt)==b.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>(f.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||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();function ue(e,c){e&1&&(s(0,"small",5),_(1," Platform is required "),l())}function _e(e,c){e&1&&(s(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&u(0,"ng-select",6),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&u(0,"ng-select",7),e&2){let t=a().$implicit;p("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&u(0,"input",8),e&2){let t=a().$implicit;p("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(s(0,"small",5),_(1),l()),e&2){let t=a().$implicit;m(),K(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),h(2,_e,2,0,"span",5),s(3,"span"),_(4),l()(),h(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8),h(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;m(2),C(t.is_required?2:-1),m(2),K(" ",t==null?null:t.name," "),m(),C(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),m(3),C(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),_(5," Platform Options"),l()(),u(6,"ng-select",4),h(7,ue,2,0,"small",5),l(),M(8,be,9,4,"div",2,D),l()()),e&2){let t,i=a();p("formGroup",i.form),m(6),p("multiple",!0)("items",i.platformOptions)("clearable",!1),m(),C(!(i.form==null||(t=i.form.get("listingPlatform").errors)==null)&&t.required?7:-1),m(),V(c)}}var qt=(()=>{class e{constructor(){this.tiktokAttributeFormService=d(gt),this.channelId=g(void 0),this.categoryId=g(void 0),this.platformChange=A({alias:"onPlatformChanges"}),this.formSubscription=new Tt,this.attributesChanges=A(),this.platformOptions=[{label:"TikTok Shop",value:J.TIKTOK_SHOP},{label:"Tokopedia",value:J.TOKOPEDIA}]}ngOnChanges(){let t=this.categoryId(),i=this.channelId();f.IsNotEmpty(t)&&f.IsNotEmpty(i)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(i,t).pipe(F(n=>n.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(f.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),q(1)))}listenToFormChange(t){let i=[];this.form.valueChanges.pipe(ut(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(It(this.form.get("listingPlatform").value),ut(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[x([gt]),O],decls:2,vars:3,consts:[[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){if(i&1&&(h(0,ye,10,5,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[$,L,w,j,z,U,G,Y,W,Z,S],encapsulation:2,changeDetection:0})}}return e})();var bt=(()=>{class e{constructor(){this.woocommerceUploadService=d(ct)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();var Qt=(()=>{class e{constructor(){this.wooAttributeFormService=d(bt),this.channelId=g(),this.categoryId=g(),this.attributesChanges=A()}ngOnChanges(){f.IsNotEmpty(this.categoryId())&&f.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),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&&(s(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),s(4,"ng-select",3),y(5,"async"),I("change",function(r){return n.onSelectAttribute(r)}),l()()()),i&2&&(m(4),p("items",v(5,1,n.attributes$)))},dependencies:[Z,$,L,w,S],encapsulation:2,changeDetection:0})}}return e})();var yt=(()=>{class e{constructor(){this.httpService=d(Q),this.formBuilder=d(H)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),_(2),l(),u(3,"ng-select",4),l()),e&2){let t=c.$implicit;m(2),K(" ",t==null?null:t.variant," "),m(),p("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function Te(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),M(2,ve,4,4,"div",2,D),l()()),e&2){let t=a();p("formGroup",t.form),m(2),V(c)}}var zt=(()=>{class e{constructor(){this.tokpedAttrFormService=d(yt),this.channelId=g(void 0),this.categoryId=g(void 0),this.attributesChanges=A()}ngOnChanges(t){let i=this.categoryId(),n=this.channelId();f.IsNotEmpty(i)&&f.IsNotEmpty(n)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(n,i).pipe(P(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),O],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){if(i&1&&(h(0,Te,4,1,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[$,L,w,j,U,G,Y,W,S],encapsulation:2,changeDetection:0})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=d(Q),this.formBuilder=d(H)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(P(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();function xe(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),_(4," Brand "),l(),u(5,"input",4),l(),s(6,"div",5)(7,"div",3),_(8," Product Type "),l(),u(9,"input",6),l(),s(10,"div",5)(11,"div",3),_(12," Status "),l(),u(13,"ng-select",7),l()()()),e&2){let t=a();p("formGroup",t.form),m(13),p("items",c.Options.StatusOptions)}}var Zt=(()=>{class e{constructor(){this.channelId=g(void 0),this.attributesChanges=A(),this.shopifyFormService=d(vt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(P(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),O],decls:2,vars:3,consts:[[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){if(i&1&&(h(0,xe,14,2,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[w,j,z,U,G,Y,W,$,L,S],encapsulation:2,changeDetection:0})}}return e})();function Se(e,c){if(e&1&&(s(0,"div",6),u(1,"app-product-card",9),l()),e&2){let t=c.$implicit;m(),p("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=B();s(0,"mat-checkbox",21),Pt("ngModelChange",function(n){E(t);let o=a().$implicit;return Ft(o.selected,n)||(o.selected=n),k(n)}),I("ngModelChange",function(){let n=E(t),o=a(),r=o.$implicit,b=o.$index,it=a();return k(it.onSelectChannel(r,b,n))}),l()}if(e&2){let t=a().$implicit;At("ngModel",t.selected)}}function Ae(e,c){if(e&1&&(s(0,"div",18),u(1,"input",22),l()),e&2){let t=a().$implicit,i=a();p("matTooltip",t.type==i.channelType.Shopify||t.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Fe(e,c){if(e&1){let t=B();s(0,"app-channel-category-select",23),I("selectedCategory",function(n){E(t);let o=a().$index,r=a();return k(r.onCategoryChange(o,n))}),l()}if(e&2){let t=a().$implicit,i=a();p("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Pe(e,c){if(e&1){let t=B();s(0,"shopee-attribute-form",27),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=B();s(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onPlatformChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Ee(e,c){if(e&1){let t=B();s(0,"wooocommerce-attribute-form",29),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=B();s(0,"tokopedia-attribute-form",29),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(s(0,"div",20)(1,"div",24),h(2,Pe,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Ee,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=a().$implicit,n=a();m(2),C((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function De(e,c){if(e&1){let t=B();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),I("attributesChanges",function(n){E(t);let o=a().$index,r=a();return k(r.onAttributesChange(o,n))}),l()()()}if(e&2){let t=a().$implicit;m(2),p("channelId",t.id)}}function Me(e,c){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ie,1,1,"mat-checkbox",14),y(7,"async"),l(),s(8,"div"),u(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),_(12),l()()()(),s(13,"div",12)(14,"div",17),h(15,Ae,2,1,"div",18)(16,Fe,1,4,"app-channel-category-select",19),l()()(),h(17,Oe,6,1,"div",20)(18,De,3,1,"div",20),l()()),e&2){let t,i=c.$implicit,n=a();m(6),C((t=v(7,8,n.defaultCategories$))?6:-1,t),m(3),p("typeId",i.type)("showChannelName",!1),m(),p("matTooltip",i.name)("matTooltipShowDelay",2500),m(2),nt(i.name),m(3),C(i.type==n.channelType.Shopify||i.type==n.channelType.Plugo||i.type==n.channelType.ShopifyV2?15:16),m(2),C(i.categoryId&&n.channelType.Lazada!=i.type&&i.selected?17:(n.channelType.Shopify==i.type||i.type==n.channelType.ShopifyV2)&&i.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.toastr=d(Nt),this.uploadProductService=d(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=_t,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(q(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.attributes=i),o)))}tiktokPlatformChanges(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((r,b)=>{if(b==i&&t.selected){let it=this.findCategoryByChannelId(t.id,n);r.categoryId=it?.DefaultCategoryID}return b==i&&!t.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}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==_t.Tiktok&&f.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["app-product-upload"]],features:[x([lt,Lt,$t,ct])],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"],["color","primary",1,"example-margin",3,"ngModel"],[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&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),u(3,"i",2),_(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),s(9,"div",5),M(10,Se,2,7,"div",6,D),y(12,"async"),l(),s(13,"h3",7),_(14,"Channel To Upload"),l(),M(15,Me,19,10,"div",8,D),l()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),m(8),V(v(12,3,n.selectedProducts$)),m(5),V(n.channelProductUploads())}},dependencies:[jt,wt,Yt,Wt,Bt,Z,U,Et,Ut,Vt,qt,Qt,zt,Zt,Rt,Kt,Jt,S],encapsulation:2,changeDetection:0})}}return e})();export{zo as ProductUploadComponent};
|
|
1
|
+
import{a as Kt}from"./chunk-Y7LL5UP5.js";import"./chunk-THQBY3F5.js";import{a as Wt,b as Yt}from"./chunk-XA2GD2PT.js";import{b as jt}from"./chunk-TI7Z2DZM.js";import"./chunk-XQP3JKDZ.js";import{a as Bt}from"./chunk-AIEBXZIK.js";import"./chunk-Q2SYKVKJ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import{a as Rt}from"./chunk-6M6TTQHG.js";import{a as Gt}from"./chunk-7HJRODVG.js";import{a as lt,b as Lt,c as $t,d as ct,e as st}from"./chunk-VNHCKVBS.js";import"./chunk-VUYPSK3A.js";import"./chunk-O25VE5LE.js";import"./chunk-XYJFKYWS.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-B67MU32B.js";import"./chunk-ACIMXBIC.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{d as L,e as $}from"./chunk-5TH35CMP.js";import{b as wt}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import{a as Ut}from"./chunk-3ZLKAFXU.js";import{b as Ht,c as Xt}from"./chunk-6TX26J3J.js";import"./chunk-JU6FJIOF.js";import"./chunk-DHKYJUQU.js";import"./chunk-TF3XKSU7.js";import"./chunk-YJQOSNK6.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-7X3SWRGG.js";import"./chunk-D5XV3F5J.js";import"./chunk-GVNUAV72.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-LTASTRU4.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-NGMSEBXY.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import{b as Vt}from"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import"./chunk-ZSUWHVKX.js";import"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import{b as _t,c as f}from"./chunk-C63EIRLC.js";import{A as Z,B as w,c as z,e as ot,h as U,i as G,l as at,m as Et,n as j,q as kt,r as W,s as Y,t as Ot,u as Dt,v as Mt,z as H}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{b as Nt,e as Q}from"./chunk-UB4NDUUT.js";import"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{x as S}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as h,Eb as T,I as xt,K as St,Ma as O,Mc as _,Nc as nt,Oc as K,Qc as At,Rc as Ft,Sc as Pt,V as q,X as It,Zc as x,_ as ut,_c as rt,aa as P,bc as C,cc as D,d as Tt,ec as M,fc as V,gc as p,hc as s,hd as y,ia as N,ic as l,id as v,jc as u,mb as m,na as d,qc as B,sd as A,t as F,td as g,ua as E,va as k,vc as I,xc as a}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var X=(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})(X||{});var tt=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(tt||{});var et=(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})(et||{});var ft=class extends at{setValue(c,t){if(c instanceof Date){let i=Math.floor(c.getTime()/1e3);super.setValue(i,t)}else super.setValue(c,t)}},ht=(()=>{class e{constructor(){this.shopeeUploadService=d(lt),this.formBuilder=d(H)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.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(b=>b.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(ot.required),o?.attribute_info?.format_type==tt.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==X.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new at(null),value:new at(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==X.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==et.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new ft(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(b=>o.findIndex(dt=>parseInt(dt)==b.attribute_id||b.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case X.MULTI_COMBO_BOX:f.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(b=>b==r.value_id)!=-1):o.attribute_value_list=[];break;case X.FREE_TEXT_FILED:o.attribute_info.format_type==tt.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==et.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(t,i){let n=[];if(f.IsNotEmpty(t)){let o={value_id:0,original_value_name:JSON.stringify(t)};f.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(t){let i=[];return f.IsNotEmpty(t)&&(i=[{value_id:0,original_value_name:JSON.stringify(t)}]),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();var Ct=()=>[];function te(e,c){e&1&&(s(0,"span",4),_(1,"*"),l())}function ee(e,c){if(e&1&&u(0,"ng-select",5),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:rt(4,Ct))("placeholder","Pilih "+(t==null?null:t.name))}}function ie(e,c){if(e&1&&u(0,"input",7),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&(s(0,"option",14),_(1),l()),e&2){let t=c.$implicit;p("value",t),m(),nt(t)}}function ne(e,c){if(e&1&&(s(0,"div",9),u(1,"input",11),s(2,"select",12)(3,"option",13),_(4,"Unit"),l(),M(5,oe,2,2,"option",14,D),l()()),e&2){let t=a(3).$implicit;p("formGroupName",t.attribute_id),m(),p("placeholder","Isi "+(t==null?null:t.name)),m(2),p("value",null),m(2),V(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function re(e,c){if(e&1&&u(0,"input",10),e&2){let t=a(3).$implicit;p("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ae(e,c){if(e&1&&h(0,ne,7,3,"div",9)(1,re,1,2,"input",10),e&2){let t=a(2).$implicit,i=a(2);C((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function le(e,c){if(e&1&&u(0,"datepicker",8),e&2){let t=a(2).$implicit;p("formControlName",t.attribute_id)}}function ce(e,c){if(e&1&&h(0,ie,1,2,"input",7)(1,ae,2,1)(2,le,1,1,"datepicker",8),e&2){let t,i=a().$implicit,n=a(2);C((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function se(e,c){if(e&1&&u(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:rt(3,Ct))("placeholder","Pilih "+(t==null?null:t.name))}}function me(e,c){if(e&1&&u(0,"ng-select",6),e&2){let t=a().$implicit;p("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:rt(3,Ct))("placeholder","Pilih "+(t==null?null:t.name))}}function pe(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),h(2,te,2,0,"span",4),s(3,"span"),_(4),l()(),h(5,ee,1,5,"ng-select",5)(6,ce,3,1)(7,se,1,4,"ng-select",6)(8,me,1,4,"ng-select",6),l()),e&2){let t,i=c.$implicit,n=a(2);m(2),C(i.mandatory?2:-1),m(2),K(" ",i==null?null:i.name," "),m(),C((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),M(2,pe,9,3,"div",2,D),l()()),e&2){let t=a();p("formGroup",t.form),m(2),V(c)}}var Jt=(()=>{class e{constructor(){this.formCategoryService=d(ht),this.channelType=g(void 0),this.categoryId=g(void 0),this.channelId=g(void 0),this.channelProductUpload=g(void 0),this.attributesChanges=A(),this.inputType=X,this.formatType=tt,this.validationType=et}ngOnChanges(){let t=this.categoryId(),i=this.channelId();f.IsNotEmpty(t)&&f.IsNotEmpty(i)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:t,channelId:i,channelType:this.channelType()}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),q(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),O],decls:2,vars:3,consts:[[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){if(i&1&&(h(0,de,4,1,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[$,L,w,j,Dt,Mt,z,Ot,U,G,Y,W,kt,Gt,Xt,Ht,S],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{--mat-icon-button-state-layer-size: 36px}"],changeDetection:0})}}return e})();var J=(function(e){return e.TIKTOK_SHOP="TIKTOK_SHOP",e.TOKOPEDIA="TOKOPEDIA",e})(J||{});var gt=(()=>{class e{constructor(){this.httpService=d(Q),this.formBuilder=d(H),this.uploadProductService=d(st)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(xt(o=>this.uploadProductService.selectedProduct$.pipe(F(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.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(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(ot.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([J.TIKTOK_SHOP,J.TOKOPEDIA],[ot.required])),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),r=n.filter(b=>o.findIndex(dt=>parseInt(dt)==b.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(t,i){return t.map(o=>(f.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||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();function ue(e,c){e&1&&(s(0,"small",5),_(1," Platform is required "),l())}function _e(e,c){e&1&&(s(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&u(0,"ng-select",6),e&2){let t=a().$implicit;p("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&u(0,"ng-select",7),e&2){let t=a().$implicit;p("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&u(0,"input",8),e&2){let t=a().$implicit;p("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(s(0,"small",5),_(1),l()),e&2){let t=a().$implicit;m(),K(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),h(2,_e,2,0,"span",5),s(3,"span"),_(4),l()(),h(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8),h(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;m(2),C(t.is_required?2:-1),m(2),K(" ",t==null?null:t.name," "),m(),C(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),m(3),C(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),_(5," Platform Options"),l()(),u(6,"ng-select",4),h(7,ue,2,0,"small",5),l(),M(8,be,9,4,"div",2,D),l()()),e&2){let t,i=a();p("formGroup",i.form),m(6),p("multiple",!0)("items",i.platformOptions)("clearable",!1),m(),C(!(i.form==null||(t=i.form.get("listingPlatform").errors)==null)&&t.required?7:-1),m(),V(c)}}var qt=(()=>{class e{constructor(){this.tiktokAttributeFormService=d(gt),this.channelId=g(void 0),this.categoryId=g(void 0),this.platformChange=A({alias:"onPlatformChanges"}),this.formSubscription=new Tt,this.attributesChanges=A(),this.platformOptions=[{label:"TikTok Shop",value:J.TIKTOK_SHOP},{label:"Tokopedia",value:J.TOKOPEDIA}]}ngOnChanges(){let t=this.categoryId(),i=this.channelId();f.IsNotEmpty(t)&&f.IsNotEmpty(i)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(i,t).pipe(F(n=>n.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(f.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),q(1)))}listenToFormChange(t){let i=[];this.form.valueChanges.pipe(ut(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(It(this.form.get("listingPlatform").value),ut(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[x([gt]),O],decls:2,vars:3,consts:[[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){if(i&1&&(h(0,ye,10,5,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[$,L,w,j,z,U,G,Y,W,Z,S],encapsulation:2,changeDetection:0})}}return e})();var bt=(()=>{class e{constructor(){this.woocommerceUploadService=d(ct)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();var Qt=(()=>{class e{constructor(){this.wooAttributeFormService=d(bt),this.channelId=g(),this.categoryId=g(),this.attributesChanges=A()}ngOnChanges(){f.IsNotEmpty(this.categoryId())&&f.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),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&&(s(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),s(4,"ng-select",3),y(5,"async"),I("change",function(r){return n.onSelectAttribute(r)}),l()()()),i&2&&(m(4),p("items",v(5,1,n.attributes$)))},dependencies:[Z,$,L,w,S],encapsulation:2,changeDetection:0})}}return e})();var yt=(()=>{class e{constructor(){this.httpService=d(Q),this.formBuilder=d(H)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(s(0,"div",2)(1,"div",3),_(2),l(),u(3,"ng-select",4),l()),e&2){let t=c.$implicit;m(2),K(" ",t==null?null:t.variant," "),m(),p("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function Te(e,c){if(e&1&&(s(0,"form",0)(1,"div",1),M(2,ve,4,4,"div",2,D),l()()),e&2){let t=a();p("formGroup",t.form),m(2),V(c)}}var zt=(()=>{class e{constructor(){this.tokpedAttrFormService=d(yt),this.channelId=g(void 0),this.categoryId=g(void 0),this.attributesChanges=A()}ngOnChanges(t){let i=this.categoryId(),n=this.channelId();f.IsNotEmpty(i)&&f.IsNotEmpty(n)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(n,i).pipe(P(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),O],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){if(i&1&&(h(0,Te,4,1,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[$,L,w,j,U,G,Y,W,S],encapsulation:2,changeDetection:0})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=d(Q),this.formBuilder=d(H)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(P(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac})}}return e})();function xe(e,c){if(e&1&&(s(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),_(4," Brand "),l(),u(5,"input",4),l(),s(6,"div",5)(7,"div",3),_(8," Product Type "),l(),u(9,"input",6),l(),s(10,"div",5)(11,"div",3),_(12," Status "),l(),u(13,"ng-select",7),l()()()),e&2){let t=a();p("formGroup",t.form),m(13),p("items",c.Options.StatusOptions)}}var Zt=(()=>{class e{constructor(){this.channelId=g(void 0),this.attributesChanges=A(),this.shopifyFormService=d(vt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(P(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),O],decls:2,vars:3,consts:[[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){if(i&1&&(h(0,xe,14,2,"form",0),y(1,"async")),i&2){let o;C((o=v(1,1,n.attributes$))?0:-1,o)}},dependencies:[w,j,z,U,G,Y,W,$,L,S],encapsulation:2,changeDetection:0})}}return e})();function Se(e,c){if(e&1&&(s(0,"div",6),u(1,"app-product-card",9),l()),e&2){let t=c.$implicit;m(),p("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=B();s(0,"mat-checkbox",21),Pt("ngModelChange",function(n){E(t);let o=a().$implicit;return Ft(o.selected,n)||(o.selected=n),k(n)}),I("ngModelChange",function(){let n=E(t),o=a(),r=o.$implicit,b=o.$index,it=a();return k(it.onSelectChannel(r,b,n))}),l()}if(e&2){let t=a().$implicit;At("ngModel",t.selected)}}function Ae(e,c){if(e&1&&(s(0,"div",18),u(1,"input",22),l()),e&2){let t=a().$implicit,i=a();p("matTooltip",t.type==i.channelType.Shopify||t.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Fe(e,c){if(e&1){let t=B();s(0,"app-channel-category-select",23),I("selectedCategory",function(n){E(t);let o=a().$index,r=a();return k(r.onCategoryChange(o,n))}),l()}if(e&2){let t=a().$implicit,i=a();p("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Pe(e,c){if(e&1){let t=B();s(0,"shopee-attribute-form",27),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=B();s(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onPlatformChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Ee(e,c){if(e&1){let t=B();s(0,"wooocommerce-attribute-form",29),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=B();s(0,"tokopedia-attribute-form",29),I("attributesChanges",function(n){E(t);let o=a(2).$index,r=a();return k(r.onAttributesChange(o,n))}),l()}if(e&2){let t=a(2).$implicit;p("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(s(0,"div",20)(1,"div",24),h(2,Pe,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Ee,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=a().$implicit,n=a();m(2),C((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function De(e,c){if(e&1){let t=B();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),I("attributesChanges",function(n){E(t);let o=a().$index,r=a();return k(r.onAttributesChange(o,n))}),l()()()}if(e&2){let t=a().$implicit;m(2),p("channelId",t.id)}}function Me(e,c){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ie,1,1,"mat-checkbox",14),y(7,"async"),l(),s(8,"div"),u(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),_(12),l()()()(),s(13,"div",12)(14,"div",17),h(15,Ae,2,1,"div",18)(16,Fe,1,4,"app-channel-category-select",19),l()()(),h(17,Oe,6,1,"div",20)(18,De,3,1,"div",20),l()()),e&2){let t,i=c.$implicit,n=a();m(6),C((t=v(7,8,n.defaultCategories$))?6:-1,t),m(3),p("typeId",i.type)("showChannelName",!1),m(),p("matTooltip",i.name)("matTooltipShowDelay",2500),m(2),nt(i.name),m(3),C(i.type==n.channelType.Shopify||i.type==n.channelType.Plugo||i.type==n.channelType.ShopifyV2?15:16),m(2),C(i.categoryId&&n.channelType.Lazada!=i.type&&i.selected?17:(n.channelType.Shopify==i.type||i.type==n.channelType.ShopifyV2)&&i.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.toastr=d(Nt),this.uploadProductService=d(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=_t,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(q(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.attributes=i),o)))}tiktokPlatformChanges(t,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==t&&(o.listing_platforms=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((r,b)=>{if(b==i&&t.selected){let it=this.findCategoryByChannelId(t.id,n);r.categoryId=it?.DefaultCategoryID}return b==i&&!t.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}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==_t.Tiktok&&f.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=T({type:e,selectors:[["app-product-upload"]],features:[x([lt,Lt,$t,ct])],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"],["color","primary",1,"example-margin",3,"ngModel"],[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&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),u(3,"i",2),_(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),s(9,"div",5),M(10,Se,2,7,"div",6,D),y(12,"async"),l(),s(13,"h3",7),_(14,"Channel To Upload"),l(),M(15,Me,19,10,"div",8,D),l()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),m(8),V(v(12,3,n.selectedProducts$)),m(5),V(n.channelProductUploads())}},dependencies:[jt,wt,Yt,Wt,Bt,Z,U,Et,Ut,Vt,qt,Qt,zt,Zt,Rt,Kt,Jt,S],encapsulation:2,changeDetection:0})}}return e})();export{zo as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as te,b as ne}from"./chunk-BPC3UE7K.js";import{a as ee}from"./chunk-6PB45QZ6.js";import{a as $}from"./chunk-
|
|
1
|
+
import{a as te,b as ne}from"./chunk-BPC3UE7K.js";import{a as ee}from"./chunk-6PB45QZ6.js";import{a as $}from"./chunk-L77Z3QKG.js";import"./chunk-OENELFWU.js";import"./chunk-Q2SYKVKJ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import"./chunk-7W2KUJR5.js";import"./chunk-KHG2CM5S.js";import{a as Z}from"./chunk-TEPGHGSB.js";import"./chunk-42BVLTJ4.js";import"./chunk-LU4HPRNF.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-ACIMXBIC.js";import"./chunk-AKXKYRV4.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{b as Y}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import"./chunk-JU6FJIOF.js";import"./chunk-TF3XKSU7.js";import"./chunk-YJQOSNK6.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-7X3SWRGG.js";import"./chunk-D5XV3F5J.js";import"./chunk-GVNUAV72.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-LTASTRU4.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-NGMSEBXY.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import{h as q}from"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import{c as H}from"./chunk-C63EIRLC.js";import{A as X,c as G,h as J,m as K,o as Q}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{e as U}from"./chunk-UB4NDUUT.js";import{e as W,g as j}from"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{B as A,z as V}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as x,$c as k,Eb as M,Ga as _,Mc as r,Nc as u,Oc as S,Qc as N,Rc as I,Sc as F,bc as E,dc as L,ec as T,fc as P,gc as p,hc as t,hd as v,ic as n,id as z,jc as f,jd as B,kb as y,mb as o,na as C,pd as h,qc as R,ua as D,va as O,vc as s,xc as w}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import{a as g,b}from"./chunk-66YHNWRR.js";var ie=l=>({ID:l});function oe(l,c){if(l&1&&(t(0,"tr")(1,"td"),r(2),n(),t(3,"td"),f(4,"img",23),n(),t(5,"td"),r(6),n(),t(7,"td",24)(8,"a",25),r(9),v(10,"number"),n()(),t(11,"td"),r(12),n(),t(13,"td"),r(14),v(15,"date"),n()()),l&2){let e=c.$implicit;o(2),u(e._source.ChannelName),o(2),p("src",e.logo,y),o(2),u(e._source.DateRange),o(2),p("queryParams",k(12,ie,e._source.ID)),o(),S(" ",z(10,7,e._source.CountOrder)," "),o(3),u(e._source.UserLogin),o(2),S(" ",B(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function re(l,c){if(l&1){let e=R();t(0,"div",14)(1,"table",16)(2,"thead")(3,"tr",17)(4,"th",18),r(5,"Channel"),n(),t(6,"th",19),r(7,"Type"),n(),t(8,"th",20),r(9,"Download Date Range"),n(),t(10,"th",21),r(11,"Count"),n(),t(12,"th"),r(13,"User Login"),n(),t(14,"th"),r(15,"Created"),n()()(),t(16,"tbody"),T(17,oe,16,14,"tr",null,L),n()(),t(19,"mat-paginator",22),s("page",function(a){D(e);let m=w();return O(m.onPaginationChange(a))}),n()()}if(l&2){let e,i=w();o(17),P(i.downloadOrders()),o(2),p("length",i.paginationTotal())("pageSize",i.paginationPageSize())("pageIndex",((e=i.filter())==null?null:e.PageNumber)==0?0:((e=i.filter())==null?null:e.PageNumber)-1)}}function ae(l,c){l&1&&(t(0,"div",15),f(1,"app-empty-state"),n())}var Me=(()=>{class l{constructor(){this.http=C(U),this.authService=C(q),this.downloadOrdersResponse=_(null),this.downloadOrders=h(()=>{let e=this.downloadOrdersResponse();return e?e.hits.map(i=>(i.logo=H.getChannelLogoByTypeId(i._source.TypeID),i)):[]}),this.filter=_({PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""}),this.paginationTotal=h(()=>this.downloadOrdersResponse()?.total.value??0),this.paginationPageSize=h(()=>{let e=this.paginationTotal();return this.filter().RowCount>e?e:this.filter().RowCount}),this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter.set(e.Filter),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter()).subscribe(e=>{this.downloadOrdersResponse.set(e)})}onPaginationChange(e){this.filter.update(i=>b(g({},i),{PageNumber:e.pageIndex+1})),this.getDownloadOrders()}onFilterChange(e){this.filter.update(i=>g(g({},i),e))}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=M({type:l,selectors:[["app-download-order-log"]],decls:27,vars:7,consts:[["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/order/log/detail",3,"queryParams"]],template:function(i,a){if(i&1&&(t(0,"mainpanel",0),s("onSubmit",function(){return a.getDownloadOrders()}),t(1,"filters")(2,"div")(3,"label",1),r(4,"Channel"),n(),t(5,"app-channel-options-v2",2),s("ngModelChange",function(d){return a.onFilterChange({ChannelID:d})}),n()(),t(6,"div",3)(7,"label",4),r(8,"From/To"),n(),t(9,"div",5)(10,"datepicker",6),s("dateChange",function(d){return a.onFilterChange({From:d})}),n()(),t(11,"div")(12,"datepicker",7),s("dateChange",function(d){return a.onFilterChange({To:d})}),n()()(),t(13,"div",3)(14,"label",8),r(15,"Page Number"),n(),t(16,"input",9),s("ngModelChange",function(d){return a.onFilterChange({PageNumber:+d})}),n()(),t(17,"div",3)(18,"label",8),r(19,"Page Size"),n(),t(20,"input",10),F("ngModelChange",function(d){return I(a.filter().RowCount,d)||(a.filter().RowCount=d),d}),n()()(),t(21,"content")(22,"div",11)(23,"div",12)(24,"div",13),x(25,re,20,3,"div",14)(26,ae,2,0,"div",15),n()()()()()),i&2){let m;p("hideSearchBox",!0),o(5),p("ngModel",a.filter().ChannelID),o(5),p("date",a.filter().From),o(2),p("date",a.filter().To),o(4),p("ngModel",a.filter().PageNumber),o(4),N("ngModel",a.filter().RowCount),o(5),E(((m=a.downloadOrders())==null?null:m.length)>0?25:26)}},dependencies:[ne,te,Y,X,G,Q,J,K,ee,j,W,Z,$,V,A],encapsulation:2,changeDetection:0})}}return l})();export{Me as DownloadOrderLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-CSKWOS5O.js";import{a as y}from"./chunk-2SOE3U6K.js";import"./chunk-3ZLKAFXU.js";import"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import"./chunk-C63EIRLC.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import"./chunk-UB4NDUUT.js";import{c as b,e as h}from"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$c as v,Eb as p,Mc as s,Oc as f,dc as u,ec as m,fc as c,gc as l,hc as t,ic as n,jc as i,mb as r}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var g=e=>[e];function S(e,D){if(e&1&&(t(0,"a",8),s(1),n()),e&2){let o=D.$implicit;l("routerLink",v(2,g,o.url)),r(),f(" ",o.title)}}var C=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(a){return new(a||e)}}static{this.\u0275cmp=p({type:e,selectors:[["app-download"]],decls:13,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[1,"dropdown-item",3,"routerLink"]],template:function(a,d){a&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),n()(),t(4,"div")(5,"div",3)(6,"a",4),i(7,"i",5),n(),t(8,"div",6)(9,"div",7),m(10,S,2,4,"a",8,u),n()()()()(),i(12,"router-outlet")),a&2&&(r(3),l("Tabs",d.tabs),r(7),c(d.moreMenu))},dependencies:[y,h,b],encapsulation:2,changeDetection:0})}}return e})();var _=[{path:"",component:C,children:[{path:"by-url",loadComponent(){return import("./chunk-V3HBIN5L.js").then(e=>e.ByUrlComponent)},data:{title:"Download Product By Url"},canActivate:[w]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];export{_ as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he,b as de}from"./chunk-PKX4YRZ4.js";import"./chunk-XA2GD2PT.js";import{a as ue}from"./chunk-Z2DNU7GV.js";import"./chunk-CHIKNMH5.js";import{a as N}from"./chunk-ISMIPSYN.js";import{c as me,d as O,e as E}from"./chunk-2HJPRGPE.js";import"./chunk-TI7Z2DZM.js";import"./chunk-XQP3JKDZ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import"./chunk-42F2XHMN.js";import"./chunk-7HJRODVG.js";import{c as ce,d as pe}from"./chunk-NTWBF7FL.js";import"./chunk-GOGRK2G4.js";import"./chunk-O25VE5LE.js";import"./chunk-67HYWVMS.js";import"./chunk-KHG2CM5S.js";import{a as se}from"./chunk-5MNZXL7V.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-EOGHANPX.js";import"./chunk-ACIMXBIC.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{e as le}from"./chunk-5TH35CMP.js";import{a as ae,b as re}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import{c as oe}from"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-NGMSEBXY.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import{a as Y}from"./chunk-ZSUWHVKX.js";import{h as D}from"./chunk-G6KTKEOU.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import{a as V}from"./chunk-NSH3XZXC.js";import{b as W,c as X}from"./chunk-SH7PSBLU.js";import{c as v}from"./chunk-C63EIRLC.js";import{A as ie,c as Z,h as ee,m as te,o as ne}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{b as Q,e as J}from"./chunk-UB4NDUUT.js";import"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{x as K}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as w,$c as z,E as R,Eb as B,Ga as _,Kb as k,Mc as y,Tc as $,Zc as j,aa as x,bc as F,gc as u,hc as s,hd as I,ia as U,ic as d,id as b,jc as A,mb as m,na as c,nc as H,oc as G,pd as q,qc as M,ua as p,va as h,vc as C,xc as g}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import{a as S,b as f}from"./chunk-66YHNWRR.js";var L=(()=>{class r{constructor(){this.authService=c(D),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],a;return e.forEach(n=>{a=t.find(l=>l.ID==n?.parent?.id),a&&(a=f(S({},a),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(a))}),o.forEach(n=>{a=t.find(l=>l.ID==n.id),a&&i.push(a)}),i}generateFilterLocation(e,o){let t=[],i=[],a=[];return e.length>0?(t=e.map(n=>n.id),i=e.filter(n=>v.IsNotEmpty(n?.parent?.id)).map(n=>n?.parent?.id).filter((n,l,T)=>T.indexOf(n)===l)):(t=[],i=[]),a=o.map(n=>n.id),a=a.concat(i).filter((n,l,T)=>T.indexOf(n)===l),{locationIds:t,channelIds:a}}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=U({token:r,factory:r.\u0275fac})}}return r})();var ge=r=>[r];function Se(r,P){if(r&1){let e=M();s(0,"button",17),C("click",function(){p(e);let t=g(2),i=g();return h(i.onUpdateItems(t))}),A(1,"i",18),y(2," Update "),d()}}function fe(r,P){if(r&1&&(H(0),w(1,Se,3,0,"button",16),G()),r&2){let e=g(),o=g();m(),F(o.productService.hasSelectionVariant(e)?1:-1)}}function _e(r,P){if(r&1&&(s(0,"actions")(1,"div",14),k(2,fe,2,1,"ng-container",15),d()()),r&2){let e=g();m(2),u("ngxPermissionsOnly",z(1,ge,e.inventoryUpdateRole))}}function ve(r,P){if(r&1){let e=M();s(0,"app-table",19),C("onToggle",function(t){p(e);let i=g();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=g();return h(i.updateStockByVariant(t))}),d()}if(r&2){let e=g();u("data",P)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ot=(()=>{class r{constructor(){this.http=c(J),this.toastr=c(Q),this.dialog=c(oe),this.productService=c(se),this.authService=c(D),this.mainPanelService=c(ae),this.placeholderService=c(ce),this.paginationService=c(O),this.multiChannelService=c(L),this.updateResHandling=c(E),this.hiddenIPOSInventory=q(()=>this.paginationService.hiddenPOSInventory()),this.searchFilter=_({PageNumber:1,RowCount:100}),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=_([]),this.selectedChannels=_([]),this.channels=_([]),this.inventoryUpdateRole=Y.InventoryUpdate,this.searchPlaceholder=_("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(x(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:N.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator},this.searchFilter.set(e.Filter),this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}onChannelChange(e=[]){let o=e.filter(i=>v.isValidGUID(i.id)==!1),t=e.filter(i=>v.isValidGUID(i.id));this.selectedLocations.set(o),this.selectedChannels.set(t)}onSearch(e){let o=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(o);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.update(i=>f(S({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(l=>{t.push({ChannelItemID:l?.ChannelItemID,ChannelVariationID:l?.ChannelVariationID,Inventory:n.Inventory,LocationID:l?.LocationID})})});let a={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(V.UpdateInventoryChannel,a).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let l=0;l<n?.length;l++)this.handlingUpdateStock(n[l])})}}updateStockByVariant(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(V.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter()),this.handlingUpdateStock(i)})}handlingUpdateStock(e){if(e){let o=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){this.searchFilter.update(o=>f(S({},o),{filterModel:e?N.DIFFERENCE:N.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(a=>a.ID===i.ID));this.dialog.open(he,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i))).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>f(S({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=B({type:r,selectors:[["app-multi-channel-comparison"]],features:[j([O,L,E])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(o,t){if(o&1){let i=M();s(0,"mainpanel",0),C("onSubmit",function(n){return p(i),h(t.onSearch(n))}),w(1,_e,3,3,"actions"),I(2,"async"),s(3,"filters"),$(4),I(5,"async"),s(6,"div",1)(7,"label",2),y(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),s(10,"div",1)(11,"filter-query-type",4),C("numberFilterComparatorChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))})("searchTypeChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),s(12,"div",1)(13,"label",5),y(14,"PageNumber"),d(),s(15,"input",6),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),s(16,"div")(17,"label",7),y(18,"Page Size"),d(),s(19,"input",8),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),w(24,ve,1,4,"app-table",12),I(25,"async"),s(26,"infinite-paginator",13),I(27,"async"),C("onNextPage",function(){return p(i),h(t.paginationService.onNextPage(t.searchFilter()))})("onLastPage",function(){return p(i),h(t.paginationService.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return p(i),h(t.paginationService.getRowCount(t.searchFilter()))}),d()()()()()()}if(o&2){let i,a;u("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),F((i=b(2,17,t.paginationService.data$))?1:-1,i);let n=b(5,19,t.loader$);m(8),u("multiple",!0),m(2),u("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("numberFilterComparator",t.searchFilter().NumberFilterComparator)("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",t.searchFilter().SearchType),m(4),u("ngModel",t.searchFilter().PageNumber),m(4),u("ngModel",t.searchFilter().RowCount),m(5),F((a=b(25,21,t.paginationService.data$))?24:-1,a),m(2),u("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",b(27,23,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[re,de,ie,Z,ne,ee,te,me,ue,X,W,le,pe,K],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"],changeDetection:0})}}return r})();export{ot as MultiChannelComparison};
|
|
1
|
+
import{a as he,b as de}from"./chunk-KOGQHIDC.js";import"./chunk-XA2GD2PT.js";import{a as ue}from"./chunk-Z2DNU7GV.js";import"./chunk-CHIKNMH5.js";import{a as N}from"./chunk-ISMIPSYN.js";import{c as me,d as O,e as E}from"./chunk-2HJPRGPE.js";import"./chunk-TI7Z2DZM.js";import"./chunk-XQP3JKDZ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import"./chunk-42F2XHMN.js";import"./chunk-7HJRODVG.js";import{c as ce,d as pe}from"./chunk-NTWBF7FL.js";import"./chunk-GOGRK2G4.js";import"./chunk-O25VE5LE.js";import"./chunk-67HYWVMS.js";import"./chunk-KHG2CM5S.js";import{a as se}from"./chunk-XYJFKYWS.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-B67MU32B.js";import"./chunk-ACIMXBIC.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{e as le}from"./chunk-5TH35CMP.js";import{a as ae,b as re}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import{c as oe}from"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-NGMSEBXY.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import{a as Y}from"./chunk-ZSUWHVKX.js";import{h as D}from"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import{a as V}from"./chunk-NSH3XZXC.js";import{b as W,c as X}from"./chunk-SH7PSBLU.js";import{c as v}from"./chunk-C63EIRLC.js";import{A as ie,c as Z,h as ee,m as te,o as ne}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{b as Q,e as J}from"./chunk-UB4NDUUT.js";import"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{x as K}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as w,$c as z,E as R,Eb as B,Ga as _,Kb as k,Mc as y,Tc as $,Zc as j,aa as x,bc as F,gc as u,hc as s,hd as I,ia as U,ic as d,id as b,jc as A,mb as m,na as c,nc as H,oc as G,pd as q,qc as M,ua as p,va as h,vc as C,xc as g}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import{a as S,b as f}from"./chunk-66YHNWRR.js";var L=(()=>{class r{constructor(){this.authService=c(D),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(e,o){let t=Object.assign([],this.channelOptions),i=[],a;return e.forEach(n=>{a=t.find(l=>l.ID==n?.parent?.id),a&&(a=f(S({},a),{Name:`${n?.parent?.label} - ${n?.label}`,LocationID:n?.id}),i.push(a))}),o.forEach(n=>{a=t.find(l=>l.ID==n.id),a&&i.push(a)}),i}generateFilterLocation(e,o){let t=[],i=[],a=[];return e.length>0?(t=e.map(n=>n.id),i=e.filter(n=>v.IsNotEmpty(n?.parent?.id)).map(n=>n?.parent?.id).filter((n,l,T)=>T.indexOf(n)===l)):(t=[],i=[]),a=o.map(n=>n.id),a=a.concat(i).filter((n,l,T)=>T.indexOf(n)===l),{locationIds:t,channelIds:a}}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=U({token:r,factory:r.\u0275fac})}}return r})();var ge=r=>[r];function Se(r,P){if(r&1){let e=M();s(0,"button",17),C("click",function(){p(e);let t=g(2),i=g();return h(i.onUpdateItems(t))}),A(1,"i",18),y(2," Update "),d()}}function fe(r,P){if(r&1&&(H(0),w(1,Se,3,0,"button",16),G()),r&2){let e=g(),o=g();m(),F(o.productService.hasSelectionVariant(e)?1:-1)}}function _e(r,P){if(r&1&&(s(0,"actions")(1,"div",14),k(2,fe,2,1,"ng-container",15),d()()),r&2){let e=g();m(2),u("ngxPermissionsOnly",z(1,ge,e.inventoryUpdateRole))}}function ve(r,P){if(r&1){let e=M();s(0,"app-table",19),C("onToggle",function(t){p(e);let i=g();return h(i.onShowDifferenceStock(t))})("onSubmit",function(t){p(e);let i=g();return h(i.updateStockByVariant(t))}),d()}if(r&2){let e=g();u("data",P)("channel",e.channels())("showProductToggle",!0)("hiddenIPOSInventory",e.hiddenIPOSInventory())}}var ot=(()=>{class r{constructor(){this.http=c(J),this.toastr=c(Q),this.dialog=c(oe),this.productService=c(se),this.authService=c(D),this.mainPanelService=c(ae),this.placeholderService=c(ce),this.paginationService=c(O),this.multiChannelService=c(L),this.updateResHandling=c(E),this.hiddenIPOSInventory=q(()=>this.paginationService.hiddenPOSInventory()),this.searchFilter=_({PageNumber:1,RowCount:100}),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=_([]),this.selectedChannels=_([]),this.channels=_([]),this.inventoryUpdateRole=Y.InventoryUpdate,this.searchPlaceholder=_("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(x(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:N.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory,SearchType:e.Filter.SearchType,NumberFilterComparator:e.Filter.NumberFilterComparator},this.searchFilter.set(e.Filter),this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){let e=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(e.SearchType,e.NumberFilterComparator))}onChannelChange(e=[]){let o=e.filter(i=>v.isValidGUID(i.id)==!1),t=e.filter(i=>v.isValidGUID(i.id));this.selectedLocations.set(o),this.selectedChannels.set(t)}onSearch(e){let o=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(o);let t=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.update(i=>f(S({},i),{ListChannelID:t.channelIds,ListLocationID:t.locationIds,text:e})),this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter())}updateStock(e,o){if(e.length>0){let t=[];e.forEach(n=>{n.Channel?.forEach(l=>{t.push({ChannelItemID:l?.ChannelItemID,ChannelVariationID:l?.ChannelVariationID,Inventory:n.Inventory,LocationID:l?.LocationID})})});let a={ListChannelID:o.filter(n=>n.selected).map(n=>n.ID),List:t};this.http.post(V.UpdateInventoryChannel,a).subscribe(n=>{this.paginationService.reloadPagination(this.searchFilter());for(let l=0;l<n?.length;l++)this.handlingUpdateStock(n[l])})}}updateStockByVariant(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(V.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter()),this.handlingUpdateStock(i)})}handlingUpdateStock(e){if(e){let o=e?.Response?.Fail_list,t=e?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e?.Exception,"Error")}onShowDifferenceStock(e){this.searchFilter.update(o=>f(S({},o),{filterModel:e?N.DIFFERENCE:N.ALL})),this.paginationService.reloadPagination(this.searchFilter())}onUpdateItems(e){let o=this.productService.selectedVariantProduct(e),t=this.channelOptions.filter(i=>this.channels()?.find(a=>a.ID===i.ID));this.dialog.open(he,{data:{selectedItems:o,channels:JSON.parse(JSON.stringify(t))},width:"400px"}).afterClosed().pipe(R(i=>v.IsNotEmpty(i))).subscribe(i=>{this.updateStock(o,i)})}updateSearchFilter(e,o){this.searchFilter.update(t=>f(S({},t),{[e]:o}))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=B({type:r,selectors:[["app-multi-channel-comparison"]],features:[j([O,L,E])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(o,t){if(o&1){let i=M();s(0,"mainpanel",0),C("onSubmit",function(n){return p(i),h(t.onSearch(n))}),w(1,_e,3,3,"actions"),I(2,"async"),s(3,"filters"),$(4),I(5,"async"),s(6,"div",1)(7,"label",2),y(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(n){return p(i),h(t.onChannelChange(n))}),d()(),s(10,"div",1)(11,"filter-query-type",4),C("numberFilterComparatorChange",function(n){return p(i),h(t.updateSearchFilter("NumberFilterComparator",n))})("searchTypeChange",function(n){return p(i),h(t.updateSearchFilter("SearchType",n))}),d()(),s(12,"div",1)(13,"label",5),y(14,"PageNumber"),d(),s(15,"input",6),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("PageNumber",+n))}),d()(),s(16,"div")(17,"label",7),y(18,"Page Size"),d(),s(19,"input",8),C("ngModelChange",function(n){return p(i),h(t.updateSearchFilter("RowCount",+n))}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),w(24,ve,1,4,"app-table",12),I(25,"async"),s(26,"infinite-paginator",13),I(27,"async"),C("onNextPage",function(){return p(i),h(t.paginationService.onNextPage(t.searchFilter()))})("onLastPage",function(){return p(i),h(t.paginationService.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return p(i),h(t.paginationService.getRowCount(t.searchFilter()))}),d()()()()()()}if(o&2){let i,a;u("hideSearchBox",!1)("searchBoxPlaceHolder",t.searchPlaceholder()),m(),F((i=b(2,17,t.paginationService.data$))?1:-1,i);let n=b(5,19,t.loader$);m(8),u("multiple",!0),m(2),u("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions)("numberFilterComparator",t.searchFilter().NumberFilterComparator)("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",t.searchFilter().SearchType),m(4),u("ngModel",t.searchFilter().PageNumber),m(4),u("ngModel",t.searchFilter().RowCount),m(5),F((a=b(25,21,t.paginationService.data$))?24:-1,a),m(2),u("totalData",t.paginationService.totalData())("hideCount",t.paginationService.hideCount())("rowCount",b(27,23,t.paginationService.totalRowCount$))("pageNumber",t.paginationService.pageNumber())("disableNextButton",t.paginationService.disableNextButton())("goToLastPage",t.paginationService.isLastPage())}},dependencies:[re,de,ie,Z,ne,ee,te,me,ue,X,W,le,pe,K],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"],changeDetection:0})}}return r})();export{ot as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-PXMRNUFQ.js";import{a as le,b as pe}from"./chunk-XC7OQBOZ.js";import{a as me}from"./chunk-
|
|
1
|
+
import{a as oe}from"./chunk-PXMRNUFQ.js";import{a as le,b as pe}from"./chunk-XC7OQBOZ.js";import{a as me}from"./chunk-6DLMY2CE.js";import{a as T}from"./chunk-VMJQJV6R.js";import{a as de}from"./chunk-6PB45QZ6.js";import{a as ae}from"./chunk-L77Z3QKG.js";import"./chunk-OENELFWU.js";import"./chunk-Q2SYKVKJ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import{a as re}from"./chunk-VHZANZHX.js";import"./chunk-O25VE5LE.js";import{a as ne}from"./chunk-TEPGHGSB.js";import"./chunk-42BVLTJ4.js";import"./chunk-LU4HPRNF.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-ACIMXBIC.js";import"./chunk-AKXKYRV4.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{b as ie}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import{a as te}from"./chunk-3ZLKAFXU.js";import"./chunk-JU6FJIOF.js";import"./chunk-TF3XKSU7.js";import"./chunk-YJQOSNK6.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-7X3SWRGG.js";import"./chunk-D5XV3F5J.js";import"./chunk-GVNUAV72.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-LTASTRU4.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-NGMSEBXY.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import{b as ee}from"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import"./chunk-C63EIRLC.js";import{A as $,c as Q,h as X,m as Y,o as Z}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import"./chunk-UB4NDUUT.js";import"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{B as K,x as G,z as J}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as y,$c as U,Eb as W,Ga as O,Lc as k,Mc as l,Nc as v,Oc as w,Qc as h,Rc as g,Sc as f,Tc as z,Uc as A,Vc as R,Zc as H,_c as j,bc as b,cc as D,ec as I,fc as B,gc as u,hc as t,hd as x,ic as i,id as V,jc as c,jd as q,kb as F,mb as o,na as N,qc as E,ua as d,va as m,vc as M,xc as _}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var se=()=>[],ce=r=>({"td-cell-hover":r});function ue(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=_().$implicit;u("variants",e==null?null:e.Variants)}}function _e(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=_().$implicit;u("variant",e==null?null:e.Variants[0])}}function he(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=_().$implicit;o(),w("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function ge(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),c(14,"order-link",29),i(),t(15,"small"),l(16),x(17,"date"),i(),c(18,"br"),t(19,"small"),c(20,"i",30),l(21),i()()(),t(22,"td"),y(23,ue,1,1,"variants-dropdown",31)(24,_e,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),x(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),y(33,he,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),r&2){let e=S.$implicit;o(3),u("src",V(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(4),u("order",e),o(2),w(" ",q(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(5),w(" ",e.Customer," "),o(),k(U(21,ce,(e.Variants==null?null:e.Variants.length)>1)),o(),b((e.Variants==null?null:e.Variants.length)>1?23:24),o(3),v(V(27,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),o(2),w(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function fe(r,S){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th"),l(9,"Items"),i(),t(10,"th",21),l(11,"Amount"),i(),t(12,"th",22),l(13,"Shipping"),i()()(),t(14,"tbody"),I(15,ge,36,23,"tr",null,D),i()(),t(17,"app-custom-paginator",23),M("next",function(){d(e);let n=_();return m(n.initShippedOrders())})("previous",function(){d(e);let n=_();return m(n.initShippedOrders())}),i()()}if(r&2){let e=_(),p=R(0);o(15),B(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function Se(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var ke=(()=>{class r{constructor(){this.orderService=N(T),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,n){if(p&1){let s=E();z(0),x(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return d(s),m(n.initShippedOrders())}),f("textChange",function(a){return d(s),g(n.filter().Number,a)||(n.filter().Number=a),m(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return d(s),g(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),m(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return d(s),g(n.filter().From,a)||(n.filter().From=a),m(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return d(s),g(n.filter().To,a)||(n.filter().To=a),m(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return d(s),g(n.filter().PageNumber,a)||(n.filter().PageNumber=a),m(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return d(s),g(n.filter().PageSize,a)||(n.filter().PageSize=a),m(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,fe,18,2,"div",15)(33,Se,2,0,"div",16),i()()()()()}if(p&2){let s=A(V(1,8,n.shippedOrders$)||j(11,se));o(2),h("text",n.filter().Number),o(10),u("multiple",!0),h("ngModel",n.filter().ListChannelID),o(5),h("date",n.filter().From),o(2),h("date",n.filter().To),o(4),h("ngModel",n.filter().PageNumber),o(4),h("ngModel",n.filter().PageSize),o(5),b(s.length>0?32:33)}},dependencies:[ie,ne,re,$,Q,Z,X,Y,le,pe,de,te,ee,me,ae,oe,G,J,K],encapsulation:2})}}return r})();export{ke as ShippedComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-JQCO6BLN.js";import{a as ie}from"./chunk-BPC3UE7K.js";import{a as ne}from"./chunk-6PB45QZ6.js";import"./chunk-7W2KUJR5.js";import"./chunk-KHG2CM5S.js";import{a as te}from"./chunk-TEPGHGSB.js";import"./chunk-ACIMXBIC.js";import{a as Y,b as Z,d as ee}from"./chunk-5TH35CMP.js";import{b as X}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import"./chunk-JU6FJIOF.js";import"./chunk-TF3XKSU7.js";import"./chunk-YJQOSNK6.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-7X3SWRGG.js";import"./chunk-D5XV3F5J.js";import"./chunk-GVNUAV72.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-LTASTRU4.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import{b as Q}from"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import{h as G}from"./chunk-
|
|
1
|
+
import{a as oe}from"./chunk-JQCO6BLN.js";import{a as ie}from"./chunk-BPC3UE7K.js";import{a as ne}from"./chunk-6PB45QZ6.js";import"./chunk-7W2KUJR5.js";import"./chunk-KHG2CM5S.js";import{a as te}from"./chunk-TEPGHGSB.js";import"./chunk-ACIMXBIC.js";import{a as Y,b as Z,d as ee}from"./chunk-5TH35CMP.js";import{b as X}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import"./chunk-JU6FJIOF.js";import"./chunk-TF3XKSU7.js";import"./chunk-YJQOSNK6.js";import"./chunk-3LRU75PM.js";import"./chunk-V66GUTDK.js";import"./chunk-7X3SWRGG.js";import"./chunk-D5XV3F5J.js";import"./chunk-GVNUAV72.js";import"./chunk-FWUEMMUS.js";import"./chunk-AYV5TW7O.js";import"./chunk-SW3PJVJ6.js";import"./chunk-2QSN46Q7.js";import"./chunk-LTASTRU4.js";import"./chunk-POKR5NDC.js";import"./chunk-LR2HY6YC.js";import"./chunk-JFGCW6ML.js";import"./chunk-L63YO3M7.js";import{b as Q}from"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import{h as G}from"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import"./chunk-C63EIRLC.js";import{A as J,c as H,h as q,m as $,o as j,u as K,v as U}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{e as V}from"./chunk-UB4NDUUT.js";import{b as k,e as z}from"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{z as L}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as _,$c as W,Eb as N,Ga as c,Jc as I,Kb as E,Lc as B,Mc as l,Nc as b,Oc as v,_c as P,bc as h,dc as O,ec as R,fc as w,gc as s,hc as n,hd as F,ic as t,jc as S,jd as A,kb as x,mb as o,na as f,qc as D,ua as M,va as T,vc as m,xc as C}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import{a as u,b as y}from"./chunk-66YHNWRR.js";var re=()=>["/menu/log/order/detail-user"],le=a=>({ID:a});function de(a,g){if(a&1&&(n(0,"span",22),S(1,"img",23),t(),l(2)),a&2){let e=g.item;o(),s("src",e.Img,x)("alt",e.Name),o(),v(" ",e.Name," ")}}function pe(a,g){a&1&&(n(0,"th")(1,"span",29),l(2," Response Body Warning "),t()())}function se(a,g){a&1&&(n(0,"th")(1,"span",29),l(2," Number Override "),t()())}function me(a,g){if(a&1&&(n(0,"td",26)(1,"span",31),l(2),t()()),a&2){let e=C().$implicit;o(),I("bg-warning",e.responseBodyWarning!=null),o(),b(e.responseBodyWarning)}}function ge(a,g){if(a&1&&(n(0,"td"),l(1),t()),a&2){let e=C().$implicit;o(),v(" ",e.ResponseBodyWarningReference," ")}}function ce(a,g){if(a&1&&(n(0,"tr")(1,"td")(2,"a",30),l(3),F(4,"date"),t()(),n(5,"td"),l(6),t(),n(7,"td"),l(8),t(),n(9,"td"),l(10),t(),n(11,"td",26)(12,"span",31),l(13),t()(),_(14,me,3,3,"td",26),_(15,ge,2,1,"td"),t()),a&2){let e=g.$implicit,d=C(2);o(2),s("routerLink",P(14,re))("queryParams",W(15,le,e.ID)),o(),v(" ",A(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),o(3),b(e.ChannelName),o(2),b(e.POSActionTypeString),o(2),b(e.Number),o(2),B(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),o(),v(" ",e.ResponseCode," "),o(),h(d.responseBodyWarningVisible()?14:-1),o(),h(d.responseBodyWarningVisible()?15:-1)}}function ue(a,g){if(a&1){let e=D();n(0,"div",20)(1,"table",24)(2,"thead")(3,"tr",25)(4,"th"),l(5,"Date"),t(),n(6,"th"),l(7,"Channel"),t(),n(8,"th"),l(9,"Actions"),t(),n(10,"th"),l(11,"Number"),t(),n(12,"th",26)(13,"span",27),l(14," Response Code "),t()(),_(15,pe,3,0,"th"),_(16,se,3,0,"th"),t()(),n(17,"tbody"),R(18,ce,16,17,"tr",null,O),t()(),n(20,"mat-paginator",28),m("page",function(i){M(e);let r=C();return T(r.changePage(i))}),t()()}if(a&2){let e=C();o(15),h(e.responseBodyWarningVisible()?15:-1),o(),h(e.responseBodyWarningVisible()?16:-1),o(2),w(e.Result()),o(2),s("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function _e(a,g){a&1&&(n(0,"div",21),S(1,"app-empty-state"),t())}var Pe=(()=>{class a{constructor(){this.http=f(V),this._RawLogService=f(oe),this.route=f(k),this.authService=f(G),this.Result=c([]),this.filter=c({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""}),this.paginationTotal=c(0),this.paginationPageSize=c(0),this.Number=c(null),this.channelOptions=c(this.authService.getChannels()),this.ActionTypeList=c(null),this.responseBodyWarningVisible=c(!1)}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(d=>{this.filter.update(i=>u(u({},i),d.Filter)),this.ActionTypeList.set(d.Options.ActionTypeList),this.Get()})}Get(e){this.filter.update(d=>y(u({},d),{Number:e})),this.http.post("/api/Orders/Get",this.filter()).subscribe(d=>{this._RawLogService.Data=d.hits;let i=[];for(let r of d.hits){r._source.log.responseBodyWarning!=null&&this.responseBodyWarningVisible.set(!0);let p={ID:r._id,Created:r._source["@timestamp_received"],shopId:r._source.shopId,MarketTypeString:r._source.log.type,ChannelName:r._source?.channelId!=null?this.channelOptions().find(ae=>ae.ID===r._source?.channelId)?.Name:"",POSActionTypeString:r._source.message,Number:r._source.log.number,ResponseCode:r._source.log.responseCode,responseBodyWarning:r._source.log.responseBodyWarning,ResponseBodyWarningReference:r._source.log.ResponseBodyWarningReference};i.push(p)}this.Result.set(i),this.paginationTotal.set(d.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)})}changePage(e){this.filter.update(d=>y(u({},d),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,d){this.filter.update(i=>y(u({},i),{[e]:d}))}static{this.\u0275fac=function(d){return new(d||a)}}static{this.\u0275cmp=N({type:a,selectors:[["app-order"]],decls:42,vars:14,consts:[["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[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,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"]],template:function(d,i){if(d&1&&(n(0,"mainpanel",0),m("textChange",function(p){return i.Number.set(p)})("onSubmit",function(p){return i.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),t(),n(5,"ng-select",2),m("ngModelChange",function(p){return i.updateFilter("ChannelID",p)}),E(6,de,3,3,"ng-template",3),t()(),n(7,"div",4)(8,"label",1),l(9,"Action"),t(),n(10,"ng-select",5),m("ngModelChange",function(p){return i.updateFilter("ActionType",p)}),t()(),n(11,"div",4)(12,"label",6),l(13,"From/To"),t(),n(14,"div",7)(15,"datepicker",8),m("dateChange",function(p){return i.updateFilter("From",p)}),t()(),n(16,"div")(17,"datepicker",9),m("dateChange",function(p){return i.updateFilter("To",p)}),t()()(),n(18,"div",4)(19,"label",10),l(20,"Response Code"),t(),n(21,"input",11),m("ngModelChange",function(p){return i.updateFilter("StatusCode",p)}),t()(),n(22,"div",4)(23,"label",10),l(24,"Response Body Warning"),t(),n(25,"input",12),m("ngModelChange",function(p){return i.updateFilter("responseBodyWarning",p)}),t(),n(26,"datalist",13),S(27,"option",14),t()(),n(28,"div",4)(29,"label",10),l(30,"Page Number"),t(),n(31,"input",15),m("ngModelChange",function(p){return i.updateFilter("PageNumber",p)}),t()(),n(32,"div",4)(33,"label",10),l(34,"Page Size"),t(),n(35,"input",16),m("ngModelChange",function(p){return i.updateFilter("RowCount",p)}),t()()(),n(36,"content")(37,"div",17)(38,"div",18)(39,"div",19),_(40,ue,21,5,"div",20)(41,_e,2,0,"div",21),t()()()()()),d&2){let r;s("text",i.Number()),o(5),s("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),o(5),s("clearable",!0)("items",i.ActionTypeList())("ngModel",i.filter().ActionType),o(5),s("date",i.filter().From),o(2),s("date",i.filter().To),o(4),s("ngModel",i.filter().StatusCode),o(4),s("ngModel",i.filter().responseBodyWarning),o(6),s("ngModel",i.filter().PageNumber),o(4),s("ngModel",i.filter().RowCount),o(5),h(((r=i.Result())==null?null:r.length)>0?40:41)}},dependencies:[X,ee,J,K,U,H,j,q,$,Y,Z,ne,Q,z,ie,te,L],encapsulation:2,changeDetection:0})}}return a})();export{Pe as OrderComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as x}from"./chunk-
|
|
1
|
+
import{f as x}from"./chunk-TZUM4ZLW.js";import{c as o}from"./chunk-C63EIRLC.js";import{e as k,g as C}from"./chunk-JLWI4DHM.js";import{$b as b,Eb as v,Mc as u,Oc as p,ad as I,bc as D,gc as s,hc as c,ia as h,ic as m,kb as g,mb as l,na as i,pd as f,td as _,xc as d}from"./chunk-32SEKQJM.js";var y=(()=>{class e{constructor(){this.localDataService=i(x),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(r){let t="";return o.IsNotEmpty(r.ID)?t=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${r.ID}`:t="/menu/Order/detail",t}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var L=(e,a)=>({Number:e,Outlet:a});function N(e,a){if(e&1&&(c(0,"a",0),u(1),m()),e&2){let r,t=d();s("href",t.baseUrl(),g),l(),p(" ",(r=t.order())==null?null:r.Number," ")}}function S(e,a){if(e&1&&(c(0,"a",1),u(1),m()),e&2){let r,t,n=d();s("routerLink",n.baseUrl())("queryParams",I(3,L,(r=n.order())==null?null:r.Number,(r=n.order())==null?null:r.Outlet)),l(),p(" ",(t=n.order())==null?null:t.Number," ")}}var z=(()=>{class e{constructor(){this.order=_(),this.generateLinkService=i(y),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>o.IsNotEmpty(this.order()?.ID))}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(t,n){t&1&&b(0,N,2,2,"a",0)(1,S,2,6,"a",1),t&2&&D(n.hasOrderID()?0:1)},dependencies:[C,k],encapsulation:2,changeDetection:0})}}return e})();export{z as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as z,b as A,c as u}from"./chunk-UD7O7OMH.js";import"./chunk-4VNQYYVV.js";import{b as W}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import{b as V}from"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import{a as J}from"./chunk-ZSUWHVKX.js";import"./chunk-NSH3XZXC.js";import{b as Y,c as j}from"./chunk-SH7PSBLU.js";import"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import{b as H}from"./chunk-UB4NDUUT.js";import{e as U}from"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{B as $}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as f,$c as M,Eb as L,Ga as D,Kb as N,Mc as n,Nc as a,Oc as R,_c as w,bc as b,dc as _,ec as S,fc as h,gc as p,hc as e,hd as B,ic as t,id as G,jc as F,mb as r,na as v,vc as x,xc as d}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var q=i=>[i],K=()=>["/menu/channel/pos/edit"];function Q(i,s){i&1&&(e(0,"a",16),F(1,"i",17),n(2," Edit"),t()),i&2&&p("routerLink",w(1,K))}function X(i,s){if(i&1&&(e(0,"span",18),n(1),t()),i&2){let l=d().$implicit;p("matTooltip",l.desc),r(),a(l.label)}}function Z(i,s){if(i&1&&f(0,X,2,2,"span",18),i&2){let l,m=s.$implicit,o=d();b(((l=o.form())==null?null:l.POSInventoryLog)==m.value?0:-1)}}function ee(i,s){if(i&1&&(e(0,"span",18),n(1),t()),i&2){let l=d().$implicit;p("matTooltip",l.desc),r(),a(l.label)}}function te(i,s){if(i&1&&f(0,ee,2,2,"span",18),i&2){let l,m=s.$implicit,o=d();b(((l=o.form())==null?null:l.ChannelInventoryLog)==m.value?0:-1)}}var he=(()=>{class i{constructor(){this.toastr=v(H),this.posService=v(z),this.form=D(new A),this.roleSetupEdit=J.ChannelEdit,this.inventoryLogTypeOptions=[{value:u.NONE,label:"None",desc:"Not record any log from transaction"},{value:u.ERROR,label:"Error",desc:"Only record error log from transaction"},{value:u.FULL,label:"Full",desc:"Record all log from transaction"}],this.initPageLoader()}initPageLoader(){this.posService.getLoader().subscribe(l=>{this.form.set(l.Form)})}onRefreshToken(){this.posService.refreshToken(this.form()).subscribe(l=>{this.toastr.success("Token has been refreshed!","Success",{closeButton:!0,positionClass:"toast-bottom-right"})})}onTestChannel(){this.posService.testChannel(this.form()).subscribe(l=>{this.toastr.success("Test was successful!","Success",{closeButton:!0,positionClass:"toast-bottom-right"})})}static{this.\u0275fac=function(m){return new(m||i)}}static{this.\u0275cmp=L({type:i,selectors:[["app-pos"]],decls:97,vars:17,consts:[["headerTitle","POS",3,"hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-outline-success","btn-lg","text-success","me-2",3,"click"],[3,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row","mt-5"],[1,"col-md-6"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8"],["matTooltipPosition","above",1,"info-label-group","w-100"],["matTooltipPosition","above",1,"info-label-group","w-100","d-flex","justify-content-between"],[1,"btn","btn-outline-success","ms-2","btn-sm",3,"click"],[1,"info-label-group"],["matTooltipPosition","above","matTooltip","Omni Inventory Webhook group by JOB ID",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Omni Inventory Webhook group by Channel ID",1,"info-label-group"],["matTooltipPosition","above","matTooltip","Number of days to look back for orders",1,"info-label-group"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"routerLink"],[1,"fas","fa-edit",2,"font-size","20px"],["matTooltipPosition","above",3,"matTooltip"]],template:function(m,o){if(m&1&&(e(0,"mainpanel",0)(1,"actions")(2,"a",1),x("click",function(){return o.onRefreshToken()}),n(3,"Refresh Token"),t(),N(4,Q,3,2,"ng-template",2),t(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h4"),n(12,"Credentials"),t()(),e(13,"div",8)(14,"div",9)(15,"label"),n(16,"Host"),t(),e(17,"div")(18,"span"),n(19),t()()(),e(20,"div",9)(21,"label"),n(22,"Username "),e(23,"small"),n(24,"(deprecated)"),t()(),e(25,"div")(26,"span"),n(27),t()()(),e(28,"div",9)(29,"label"),n(30,"Client ID Guid "),t(),e(31,"div")(32,"span"),n(33),t()()(),e(34,"div",10)(35,"label"),n(36,"Client Secret Guid"),t(),e(37,"div")(38,"span"),n(39),t()(),e(40,"button",11),x("click",function(){return o.onTestChannel()}),n(41," Validate "),t()(),e(42,"div",9)(43,"label"),n(44,"Notification Email"),t(),e(45,"div")(46,"span"),n(47),t()()()()()(),e(48,"div",5)(49,"div",6)(50,"div",7)(51,"h4"),n(52,"Configuration"),t()(),e(53,"div",8)(54,"div",12)(55,"label"),n(56,"Composite Inventory"),t(),e(57,"div")(58,"span"),n(59),t()()(),e(60,"div",12)(61,"label"),n(62,"Include Parent"),t(),e(63,"div")(64,"span"),n(65),t()()(),e(66,"div",12)(67,"label"),n(68,"Include Child"),t(),e(69,"div")(70,"span"),n(71),t()()(),e(72,"div",12)(73,"label"),n(74,"Identify Order Channel by"),t(),e(75,"div")(76,"span"),n(77),t()()(),e(78,"div",13)(79,"label"),n(80,"Order Inventory Log (Job ID) Mode"),t(),e(81,"div"),S(82,Z,1,1,null,null,_),t()(),e(84,"div",14)(85,"label"),n(86,"Channel Inventory Log Mode"),t(),e(87,"div"),S(88,te,1,1,null,null,_),t()(),e(90,"div",15)(91,"label"),n(92,"Order From Default Days"),t(),e(93,"div")(94,"span"),n(95),B(96,"number"),t()()()()()()()()()()),m&2){let c,y,C,g,E,T,I,P,O,k;p("hideSearchBox",!0)("hideSearchDropdown",!0),r(4),p("ngxPermissionsOnly",M(15,q,o.roleSetupEdit)),r(15),a((c=o.form())==null?null:c.Host),r(8),a((y=o.form())==null?null:y.Username),r(6),a((C=o.form())==null?null:C.ClientIDGuid),r(6),a((g=o.form())==null?null:g.ClientSecretGuid),r(8),a((E=o.form())==null?null:E.NotificationEmail),r(12),a((T=o.form())!=null&&T.CompositeVisible?"Yes":"No"),r(6),a((I=o.form())!=null&&I.IncludeChildrenInventory?"Yes":"No"),r(6),a((P=o.form())!=null&&P.IncludeParentInventory?"Yes":"No"),r(6),R(" ",((O=o.form())==null?null:O.InvoiceType)==0?"Outlet":"Tag"),r(5),h(o.inventoryLogTypeOptions),r(6),h(o.inventoryLogTypeOptions),r(7),a(G(96,13,(k=o.form())==null?null:k.OrderFromDefaultDays))}},dependencies:[W,j,Y,U,V,$],encapsulation:2,changeDetection:0})}}return i})();export{he as PosComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-L77Z3QKG.js";import"./chunk-OENELFWU.js";import"./chunk-Q2SYKVKJ.js";import"./chunk-VFDR5NPN.js";import"./chunk-24WQV4GR.js";import"./chunk-42BVLTJ4.js";import"./chunk-LU4HPRNF.js";import"./chunk-F5Z5UY7J.js";import"./chunk-EGTLH4SZ.js";import"./chunk-ISJ4LKGT.js";import"./chunk-CO4RYE2Z.js";import"./chunk-R4E2KUA4.js";import"./chunk-TCEDNSUD.js";import"./chunk-ZF5KQSJ4.js";import"./chunk-IRD67CHJ.js";import"./chunk-ACIMXBIC.js";import"./chunk-AKXKYRV4.js";import"./chunk-JE2WUBFR.js";import"./chunk-U5MTAUWW.js";import{e as j}from"./chunk-5TH35CMP.js";import{b as O}from"./chunk-G5DPFGUC.js";import"./chunk-OKMFQVL4.js";import"./chunk-TZKJPNYV.js";import"./chunk-3ZLKAFXU.js";import"./chunk-NGMSEBXY.js";import"./chunk-A2ISS3K6.js";import"./chunk-2JS4LVCG.js";import"./chunk-TZUM4ZLW.js";import"./chunk-4NJQ2IME.js";import"./chunk-QXRG5XYP.js";import{a as I}from"./chunk-NSH3XZXC.js";import"./chunk-SH7PSBLU.js";import"./chunk-C63EIRLC.js";import{A as B,c as P,h as R,m as $}from"./chunk-IOSMSIMJ.js";import"./chunk-MMOZES77.js";import"./chunk-34FX4M3J.js";import{b as V,e as D}from"./chunk-UB4NDUUT.js";import"./chunk-JLWI4DHM.js";import"./chunk-ZTKWKQRJ.js";import{A as L,x as A}from"./chunk-BI4K5Y2V.js";import"./chunk-ASFPLYOZ.js";import{$b as _,Eb as C,Ga as f,Mc as i,Nc as M,Tc as E,Uc as N,V as k,Vc as b,bc as x,gc as m,hc as e,hd as v,ic as t,id as S,jc as T,mb as c,na as h,qc as y,ua as d,va as s,vc as g,xc as w}from"./chunk-32SEKQJM.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function J(n,H){if(n&1&&(e(0,"pre",21),i(1),v(2,"json"),t()),n&2){w();let r=b(25);c(),M(S(2,1,r))}}function G(n,H){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ae=(()=>{class n{constructor(){this.httpService=h(D),this.toastr=h(V),this.selectedShopId=f(null),this.trackingNumber=f(null)}fetchLog(){if(!this.selectedShopId()||!this.trackingNumber()){this.toastr.warning("Please select a channel and enter a tracking number","Warning");return}this.trackingLog$=this.httpService.get(`${I.GetTrackingNumber}?ChannelID=${this.selectedShopId()}&Number=${this.trackingNumber()}`).pipe(k(1))}copyToClipboard(r){if(!r)return;let l=typeof r=="string"?r:JSON.stringify(r,null,2);navigator.clipboard.writeText(l),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(l){return new(l||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-tracking-api"]],decls:40,vars:9,consts:[["headerTitle","Tracking API",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Enter tracking number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","trackingLogText"],[1,"text-center","my-12","text-muted"]],template:function(l,o){if(l&1){let a=y();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return d(a),s(o.fetchLog())}),T(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," Select Shopee channel for tracking number lookup. "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),g("ngModelChange",function(p){return d(a),s(o.selectedShopId.set(p))}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Tracking Number"),t(),e(21,"p",8),i(22," Enter the tracking number to search. "),t()(),e(23,"div",9)(24,"input",12),g("ngModelChange",function(p){return d(a),s(o.trackingNumber.set(p))}),t()()()()(),E(25),v(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),g("click",function(){d(a);let p=b(25);return s(o.copyToClipboard(p))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),_(38,J,3,3,"pre",21)(39,G,2,0,"p",22),t()()()()()()()()()}if(l&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),c(16),m("ngModel",o.selectedShopId()),c(8),m("ngModel",o.trackingNumber()),c();let a=N(S(26,6,o.trackingLog$));c(8),m("disabled",!a),c(5),x(a?38:39)}},dependencies:[O,j,B,P,R,$,F,A,L],encapsulation:2,changeDetection:0})}}return n})();export{ae as TrackingApiComponent};
|