marketplacepos 5.27.1 → 5.30.1
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-YH6ZV7UM.js → chunk-2QZHXMW7.js} +1 -1
- package/Marketplace/{chunk-QPOKPYKN.js → chunk-6CZNSZHY.js} +1 -1
- package/Marketplace/{chunk-SBRCDNLE.js → chunk-6HCYY3MB.js} +1 -1
- package/Marketplace/{chunk-7MJLGWGO.js → chunk-72DNVSRZ.js} +1 -1
- package/Marketplace/{chunk-W2YE2TMM.js → chunk-C34UZZ2Z.js} +1 -1
- package/Marketplace/{chunk-3Q2URG6A.js → chunk-CQDJKP6M.js} +1 -1
- package/Marketplace/{chunk-PFSBYBSC.js → chunk-GDF2EJQJ.js} +1 -1
- package/Marketplace/{chunk-WG37UJWV.js → chunk-GWLKQHCE.js} +1 -1
- package/Marketplace/{chunk-B5G3NXGZ.js → chunk-H55NKEAI.js} +1 -1
- package/Marketplace/{chunk-VO7GA6OK.js → chunk-IOAFNXIL.js} +1 -1
- package/Marketplace/{chunk-2YMECMSR.js → chunk-KEEQMGZY.js} +1 -1
- package/Marketplace/{chunk-PKLEOUHF.js → chunk-KKOQDUQE.js} +1 -1
- package/Marketplace/{chunk-J73WANXO.js → chunk-KLH4UKSN.js} +1 -1
- package/Marketplace/{chunk-7K2MZBIS.js → chunk-KV5BTGHC.js} +1 -1
- package/Marketplace/{chunk-H34Q3GYZ.js → chunk-LCI6K3VT.js} +1 -1
- package/Marketplace/{chunk-LEUYZTMQ.js → chunk-LVBW3RA4.js} +2 -2
- package/Marketplace/{chunk-BGVNHOVR.js → chunk-NFDUCHYG.js} +1 -1
- package/Marketplace/{chunk-WU6F5N6K.js → chunk-Q5XEFS4T.js} +1 -1
- package/Marketplace/{chunk-CBTOH6MR.js → chunk-QAZOA5GX.js} +1 -1
- package/Marketplace/{chunk-EIVRD47O.js → chunk-QJMMLMRF.js} +1 -1
- package/Marketplace/{chunk-FBBV333P.js → chunk-QOZFJ6NW.js} +1 -1
- package/Marketplace/{chunk-LFO4SCWH.js → chunk-RAU34TVA.js} +1 -1
- package/Marketplace/{chunk-F56CFYMK.js → chunk-RD7TNSQ6.js} +1 -1
- package/Marketplace/{chunk-BH24WP3G.js → chunk-RO462W6B.js} +1 -1
- package/Marketplace/chunk-SXY2JDLQ.js +2 -0
- package/Marketplace/{chunk-KPJODN5E.js → chunk-T3WVEP7H.js} +1 -1
- package/Marketplace/{chunk-5GM7EMCW.js → chunk-URIFQ2VU.js} +1 -1
- package/Marketplace/{chunk-46R7IHUN.js → chunk-URW6TGF7.js} +1 -1
- package/Marketplace/{chunk-5MDJ736Z.js → chunk-XBFHE2UM.js} +1 -1
- package/Marketplace/{chunk-YS4NTLQO.js → chunk-XTWEPS73.js} +1 -1
- package/Marketplace/{chunk-RJQGJK46.js → chunk-YABCFRJB.js} +1 -1
- package/Marketplace/{chunk-WX2SZ2RT.js → chunk-YUNZRPV3.js} +1 -1
- package/Marketplace/{chunk-4A32CGYJ.js → chunk-ZMWENHWA.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-7O2YU7WU.js → main-4V665DCJ.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-W56SA7JQ.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
1
|
+
import{a as B}from"./chunk-H55NKEAI.js";import{a as vt}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-6YZFSP2B.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-CCXKODFV.js";import{j as dt}from"./chunk-URIFQ2VU.js";import{e as pt}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as k,n as ht}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{h as rt,m as lt,y as mt}from"./chunk-BSN7ZAXG.js";import{c as ct}from"./chunk-64G3XLI6.js";import{m as at,p as F,r as R}from"./chunk-OVEJFFL6.js";import{$b as V,Bd as P,Cd as L,Da as N,Ea as E,Eb as u,Gb as p,Gc as s,Hc as _,Ic as S,Jc as it,Sb as r,Tb as o,Ub as D,Vb as g,Wb as h,Yb as G,Z as j,aa as q,bc as f,ca as U,ec as J,f as z,fb as W,gb as H,jb as m,ka as I,kb as v,mc as K,nc as l,oc as d,pc as x,rc as Q,sc as X,sd as nt,ta as y,tc as Y,ua as b,ud as ot,v as C,vd as T,wc as Z,xc as tt,yc as et,yd as w,zd as M}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=ct.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(pt),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,rt,lt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,mt,ht,R,$]});let t=e;return t})();export{se as NotificationModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as u}from"./chunk-
|
|
1
|
+
import{h as u}from"./chunk-URIFQ2VU.js";import{b as h,e as g}from"./chunk-E3NPUJ23.js";import{ja as l,oa as c}from"./chunk-PQDPS2ID.js";var v=(()=>{let a=class a{constructor(r,t){this.toastrService=r,this.http=t}refreshInventory(r){let t=r.map(e=>e.Channel.map(n=>(n.VariantID=e.ID,n))).reduce((e,s)=>(e=e.concat(s),e),[]).map(e=>({ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID,VariantID:e.VariantID,ChannelVariationID:e.ChannelVariationID}));return this.http.post(u.RefreshInventory,t)}showToastrUpdateInventory(r,t,e){let s=t.length>0,n=e.length>0;if(!n&&s&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),n&&s){let o=`<li>${this.generateSuccessMessage(t.length)}</li>`,m=this.generateErrorMessage(r,e),p=`<ol>${o} ${m}</ol>`;this.toastrService.warning(p,"Warning",{enableHtml:!0})}if(n&&!s){let o=`<ol>${this.generateErrorMessage(r,e)}</ol>`;this.toastrService.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(r){return`
|
|
2
2
|
<div>
|
|
3
3
|
<span class="fw-bold">Successfully</span> updated ${r} variants in 1 channels
|
|
4
4
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as qt}from"./chunk-P2A5AQIO.js";import{a as zt,b as Qt}from"./chunk-LJHZMQZD.js";import"./chunk-MY4B7K3R.js";import{b as Ht}from"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import{a as Xt,b as Jt}from"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import{a as Bt,b as Rt}from"./chunk-LB6JFX4H.js";import{a as mt,b as Gt,c as jt,d as pt,e as st}from"./chunk-PKLEOUHF.js";import"./chunk-FGPSBTFS.js";import"./chunk-QCC5ZGGN.js";import{a as Yt}from"./chunk-GCKSYCMI.js";import"./chunk-N32A3EYJ.js";import"./chunk-ADRVUMMW.js";import{a as Wt}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{d as R,e as G}from"./chunk-CCXKODFV.js";import"./chunk-5GM7EMCW.js";import{e as nt}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as $t,n as Lt}from"./chunk-BO4PPSB5.js";import{t as Vt,u as Dt}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as et,e as ct,h as L,i as X,l as gt,m as Nt,n as J,p as z,q as Ot,r as Q,s as kt,t as wt,u as Mt,x as q,y as it,z as B}from"./chunk-BSN7ZAXG.js";import{b as Ut,c as g}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as A,Ca as O,Cd as F,Da as W,Ea as Y,Eb as h,Gb as s,Gc as v,Hc as y,K as It,M as Ft,Ma as ht,Nb as b,Ob as w,Pa as k,Qb as M,Rb as U,Sb as m,Tb as c,Ub as _,Vb as V,Wb as D,Yb as H,Z as tt,bc as l,ea as P,ja as N,jb as p,nc as f,oc as at,pa as u,pc as Z,rc as At,sc as Et,ta as x,tc as Pt,uc as S,v as E,vc as T,vd as $,wc as lt,yd as I}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var K=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(K||{});var ot=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ot||{});var Ct=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(mt),this.formBuilder=u(q)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(E(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(n=[]){let i,a;return n=n.map(r=>(i=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(C=>C.language=="id"),d.name=a?.value,d)),r.name=i?.value?i?.value:r.name,r)),n}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{if(a=[],r.mandatory&&a.push(ct.required),r?.attribute_info?.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==K.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new gt(null),value:new gt(null,a)});i.addControl(JSON.stringify(r.attribute_id),d)}else i.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>{switch(r.attribute_info.input_type){case K.MULTI_COMBO_BOX:g.IsNotEmpty(i[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(d=>i[r.attribute_id]?.findIndex(C=>C==d.value_id)!=-1):r.attribute_value_list=[];break;case K.FREE_TEXT_FILED:r.attribute_info.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(i[r.attribute_id]?.value,i[r.attribute_id]?.unit):g.IsNotEmpty(i[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:i[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==i[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,i){let a=[];return g.IsNotEmpty(n)&&(a=[{value_id:0,original_value_name:JSON.stringify(n),value_unit:i}]),a}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var bt=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(bt||{});var vt=()=>[];function ne(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function oe(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(4,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function re(t,o){if(t&1&&_(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ae(t,o){if(t&1&&(m(0,"option",15),f(1),c()),t&2){let e=o.$implicit;s("value",e),p(),at(e)}}function le(t,o){if(t&1&&(m(0,"div",10),_(1,"input",12),m(2,"select",13)(3,"option",14),f(4,"Unit"),c(),M(5,ae,2,2,"option",15,w),c()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),p(),s("placeholder","Isi "+(e==null?null:e.name)),p(2),s("value",null),p(2),U(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function ce(t,o){if(t&1&&_(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function me(t,o){if(t&1&&h(0,le,7,3,"div",10)(1,ce,1,2,"input",11),t&2){let e=l(2).$implicit,n=l(2);b((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,o){if(t&1&&_(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function se(t,o){if(t&1&&h(0,re,1,2,"input",8)(1,me,2,1)(2,pe,1,1,"datepicker",9),t&2){let e,n=l().$implicit,i=l(2);b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===i.validationType.VALIDATOR_STRING_TYPE?0:e===i.validationType.VALIDATOR_FLOAT_TYPE?1:e===i.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function de(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function ue(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function _e(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,ne,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,oe,1,5,"ng-select",6)(6,se,3,1)(7,de,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),c()),t&2){let e,n=o.$implicit,i=l(2);p(2),b(n.mandatory?2:-1),p(2),Z(" ",n==null?null:n.name," "),p(),b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===i.inputType.MULTI_COMBO_BOX?5:e===i.inputType.FREE_TEXT_FILED?6:e===i.inputType.SINGLE_COMBO_BOX?7:8)}}function fe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,_e,9,3,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Zt=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ct),this.attributesChanges=new k,this.inputType=K,this.formatType=ot,this.validationType=bt}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Ct]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,a){i&1&&(h(0,fe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,wt,Mt,et,kt,L,X,z,Q,Ot,Yt,Qt,zt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let t=o;return t})();var yt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q),this.uploadProductService=u(st)}getAttributes(n,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(It(r=>this.uploadProductService.selectedProduct$.pipe(E(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(n,i){let a=0;return n.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(i),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(n){let i=!1,a=[];return n.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),i=a.some(r=>r>1),i}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{a=[],r.is_required&&a.push(ct.required),i.addControl(r.id,this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.id)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>(g.IsNotEmpty(r.values)?r.is_multiple_selection?r.values=r.values.filter(d=>i[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==i[r.id]):i[r.id]&&(r.values=[{id:null,name:i[r.id]}]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function he(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function ge(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Ce(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function be(t,o){if(t&1&&_(0,"input",8),t&2){let e=l().$implicit;s("formControlName",e.id)("placeholder",e==null?null:e.name)}}function ve(t,o){if(t&1&&(m(0,"small",5),f(1),c()),t&2){let e=l().$implicit;p(),Z(" ",e==null?null:e.name," is mandatory ")}}function ye(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,he,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,ge,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,be,1,2,"input",8)(8,ve,2,1,"small",5),c()),t&2){let e=o.$implicit;p(2),b(e.is_required?2:-1),p(2),Z(" ",e==null?null:e.name," "),p(),b(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),p(3),b(e.is_required?8:-1)}}function xe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,ye,9,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Kt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(E(n=>n.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([yt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,a){i&1&&(h(0,xe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,et,L,X,z,Q,it]});let t=o;return t})();var xt=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(pt)}getAttributes(n,i){return this.woocommerceUploadService.getAttributes(n,i).pipe(E(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var te=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(xt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([xt]),O,T],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,a){i&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),c(),m(4,"ng-select",3),v(5,"async"),A("change",function(d){return a.onSelectAttribute(d)}),c()()()),i&2&&(p(4),s("items",y(5,1,a.attributes$)))},dependencies:[F,I,it,G,R,B]});let t=o;return t})();var St=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(E(r=>r))}createFormGroup(n){let i=this.formBuilder.group({});return n.forEach(a=>{i.addControl(a.variant,this.formBuilder.control(null))}),i}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Se(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),f(2),c(),_(3,"ng-select",5),c()),t&2){let e=o.$implicit;p(2),Z(" ",e==null?null:e.variant," "),p(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Te(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,Se,4,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var ee=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(St),this.attributesChanges=new k}ngOnInit(){}ngOnChanges(n){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(P(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{n=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([St]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,Te,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,L,X,z,Q]});let t=o;return t})();var Tt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(P(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(n){let i=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(r=>{i.addControl(r,this.formBuilder.control(null))}),i}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Ie(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),c(),_(6,"input",5),c(),m(7,"div",6)(8,"div",4),f(9," Product Type "),c(),_(10,"input",7),c(),m(11,"div",6)(12,"div",4),f(13," Status "),c(),_(14,"ng-select",8),c()()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(13),s("items",e.Options.StatusOptions)}}var ie=(()=>{let o=class o{constructor(){this.attributesChanges=new k,this.shopifyFormService=u(Tt)}ngOnChanges(n){n.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(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Tt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,a){i&1&&(h(0,Ie,15,2,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,B,J,et,L,X,z,Q,G,R]});let t=o;return t})();function Fe(t,o){if(t&1&&(m(0,"div",6),_(1,"app-product-card",9),c()),t&2){let e=o.$implicit;p(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ae(t,o){if(t&1){let e=H();V(0),m(1,"mat-checkbox",21),Pt("ngModelChange",function(i){W(e);let a=l().$implicit;return Et(a.selected,i)||(a.selected=i),Y(i)}),A("ngModelChange",function(){let i=W(e).ngIf,a=l(),r=a.$implicit,d=a.$index,C=l();return Y(C.onSelectChannel(r,d,i))}),c(),D()}if(t&2){let e=l().$implicit;p(),At("ngModel",e.selected)}}function Ee(t,o){t&1&&(m(0,"div",18),_(1,"input",22),c())}function Pe(t,o){if(t&1){let e=H();m(0,"app-channel-category-select",23),A("selectedCategory",function(i){W(e);let a=l().$index,r=l();return Y(r.onCategoryChange(a,i))}),c()}if(t&2){let e=l().$implicit,n=l();s("disabled",!e.selected||e.selected&&e.type==n.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ne(t,o){if(t&1){let e=H();m(0,"shopee-attribute-form",27),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function Oe(t,o){if(t&1){let e=H();m(0,"tiktok-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function ke(t,o){if(t&1){let e=H();m(0,"wooocommerce-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function we(t,o){if(t&1){let e=H();m(0,"tokopedia-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Me(t,o){if(t&1&&(m(0,"div",20)(1,"div",24),h(2,Ne,1,3,"shopee-attribute-form",25)(3,Oe,1,2,"tiktok-attribute-form",26)(4,ke,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),c()()),t&2){let e,n=l().$implicit,i=l();p(2),b((e=n.type)===i.channelType.Shopee?2:e===i.channelType.Tiktok?3:e===i.channelType.WooCommerce?4:e===i.channelType.Tokopedia?5:-1)}}function Ue(t,o){if(t&1){let e=H();m(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),A("attributesChanges",function(i){W(e);let a=l().$index,r=l();return Y(r.onAttributesChange(a,i))}),c()()()}if(t&2){let e=l().$implicit;p(2),s("channelId",e.id)}}function Ve(t,o){if(t&1&&(m(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ae,2,1,"ng-container",14),v(7,"async"),c(),m(8,"div"),_(9,"app-channel-logo",15),c(),m(10,"div",16)(11,"span"),f(12),c()()()(),m(13,"div",12)(14,"div",17),h(15,Ee,2,0,"div",18)(16,Pe,1,4,"app-channel-category-select",19),c()()(),h(17,Me,6,1,"div",20)(18,Ue,3,1,"div",20),c()()),t&2){let e=o.$implicit,n=l();p(6),s("ngIf",y(7,8,n.defaultCategories$)),p(3),s("typeId",e.type)("showChannelName",!1),p(),s("matTooltip",e.name)("matTooltipShowDelay",2500),p(2),at(e.name),p(3),b(e.type==n.channelType.Shopify||e.type==n.channelType.Plugo?15:16),p(2),b(e.categoryId&&n.channelType.Lazada!=e.type&&e.selected?17:n.channelType.Shopify==e.type&&e.selected?18:-1)}}var oo=(()=>{let o=class o{constructor(){this.uploadProductService=u(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ut,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(tt(1))}onCategoryChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.categoryId=i,r.attributes=[]),r)))}onAttributesChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.attributes=i),r)))}onSelectChannel(n,i,a){this.channelProductUploads.update(r=>r.map((d,C)=>{if(C==i&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);d.categoryId=_t?.DefaultCategoryID}return C==i&&!n.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(n,i){return i.find(a=>a.ID===n)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["app-product-upload"]],standalone:!0,features:[S([mt,Gt,jt,pt]),T],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,a){if(i&1&&(m(0,"mainpanel",0)(1,"actions")(2,"button",1),A("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),c()(),m(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),c(),m(9,"div",5),M(10,Fe,2,7,"div",6,w),v(12,"async"),c(),m(13,"h3",7),f(14,"Channel To Upload"),c(),M(15,Ve,19,10,"div",8,w),c()()()),i&2){let r;s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),U(y(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[F,$,I,Ht,Lt,$t,Jt,Xt,Rt,Bt,it,L,Nt,Dt,Vt,Zt,Kt,te,ee,ie,Wt,qt],encapsulation:2});let t=o;return t})();export{oo as ProductUploadComponent};
|
|
1
|
+
import{b as qt}from"./chunk-P2A5AQIO.js";import{a as zt,b as Qt}from"./chunk-LJHZMQZD.js";import"./chunk-MY4B7K3R.js";import{b as Ht}from"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import{a as Xt,b as Jt}from"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import{a as Bt,b as Rt}from"./chunk-LB6JFX4H.js";import{a as mt,b as Gt,c as jt,d as pt,e as st}from"./chunk-KKOQDUQE.js";import"./chunk-FGPSBTFS.js";import"./chunk-QCC5ZGGN.js";import{a as Yt}from"./chunk-GCKSYCMI.js";import"./chunk-N32A3EYJ.js";import"./chunk-ADRVUMMW.js";import{a as Wt}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{d as R,e as G}from"./chunk-CCXKODFV.js";import"./chunk-URIFQ2VU.js";import{e as nt}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as $t,n as Lt}from"./chunk-BO4PPSB5.js";import{t as Vt,u as Dt}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as et,e as ct,h as L,i as X,l as gt,m as Nt,n as J,p as z,q as Ot,r as Q,s as kt,t as wt,u as Mt,x as q,y as it,z as B}from"./chunk-BSN7ZAXG.js";import{b as Ut,c as g}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as A,Ca as O,Cd as F,Da as W,Ea as Y,Eb as h,Gb as s,Gc as v,Hc as y,K as It,M as Ft,Ma as ht,Nb as b,Ob as w,Pa as k,Qb as M,Rb as U,Sb as m,Tb as c,Ub as _,Vb as V,Wb as D,Yb as H,Z as tt,bc as l,ea as P,ja as N,jb as p,nc as f,oc as at,pa as u,pc as Z,rc as At,sc as Et,ta as x,tc as Pt,uc as S,v as E,vc as T,vd as $,wc as lt,yd as I}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var K=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(K||{});var ot=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ot||{});var Ct=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(mt),this.formBuilder=u(q)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(E(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(n=[]){let i,a;return n=n.map(r=>(i=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(C=>C.language=="id"),d.name=a?.value,d)),r.name=i?.value?i?.value:r.name,r)),n}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{if(a=[],r.mandatory&&a.push(ct.required),r?.attribute_info?.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==K.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new gt(null),value:new gt(null,a)});i.addControl(JSON.stringify(r.attribute_id),d)}else i.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.attribute_id||C.mandatory)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>{switch(r.attribute_info.input_type){case K.MULTI_COMBO_BOX:g.IsNotEmpty(i[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(d=>i[r.attribute_id]?.findIndex(C=>C==d.value_id)!=-1):r.attribute_value_list=[];break;case K.FREE_TEXT_FILED:r.attribute_info.format_type==ot.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(i[r.attribute_id]?.value,i[r.attribute_id]?.unit):g.IsNotEmpty(i[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:i[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==i[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,i){let a=[];return g.IsNotEmpty(n)&&(a=[{value_id:0,original_value_name:JSON.stringify(n),value_unit:i}]),a}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var bt=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(bt||{});var vt=()=>[];function ne(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function oe(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(4,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function re(t,o){if(t&1&&_(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ae(t,o){if(t&1&&(m(0,"option",15),f(1),c()),t&2){let e=o.$implicit;s("value",e),p(),at(e)}}function le(t,o){if(t&1&&(m(0,"div",10),_(1,"input",12),m(2,"select",13)(3,"option",14),f(4,"Unit"),c(),M(5,ae,2,2,"option",15,w),c()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),p(),s("placeholder","Isi "+(e==null?null:e.name)),p(2),s("value",null),p(2),U(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function ce(t,o){if(t&1&&_(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function me(t,o){if(t&1&&h(0,le,7,3,"div",10)(1,ce,1,2,"input",11),t&2){let e=l(2).$implicit,n=l(2);b((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,o){if(t&1&&_(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function se(t,o){if(t&1&&h(0,re,1,2,"input",8)(1,me,2,1)(2,pe,1,1,"datepicker",9),t&2){let e,n=l().$implicit,i=l(2);b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===i.validationType.VALIDATOR_STRING_TYPE?0:e===i.validationType.VALIDATOR_FLOAT_TYPE?1:e===i.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function de(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function ue(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:lt(3,vt))("placeholder","Pilih "+(e==null?null:e.name))}}function _e(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,ne,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,oe,1,5,"ng-select",6)(6,se,3,1)(7,de,1,4,"ng-select",7)(8,ue,1,4,"ng-select",7),c()),t&2){let e,n=o.$implicit,i=l(2);p(2),b(n.mandatory?2:-1),p(2),Z(" ",n==null?null:n.name," "),p(),b((e=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===i.inputType.MULTI_COMBO_BOX?5:e===i.inputType.FREE_TEXT_FILED?6:e===i.inputType.SINGLE_COMBO_BOX?7:8)}}function fe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,_e,9,3,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Zt=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ct),this.attributesChanges=new k,this.inputType=K,this.formatType=ot,this.validationType=bt}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(P(n=>{this.form=this.formCategoryService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Ct]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,a){i&1&&(h(0,fe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,wt,Mt,et,kt,L,X,z,Q,Ot,Yt,Qt,zt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let t=o;return t})();var yt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q),this.uploadProductService=u(st)}getAttributes(n,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(It(r=>this.uploadProductService.selectedProduct$.pipe(E(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(n,i){let a=0;return n.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(i),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(n){let i=!1,a=[];return n.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),i=a.some(r=>r>1),i}createFormGroup(n){let i=this.formBuilder.group({}),a=[];return n.forEach(r=>{a=[],r.is_required&&a.push(ct.required),i.addControl(r.id,this.formBuilder.control(null,a))}),i}getFilteredAttributes(n,i){let a=JSON.parse(JSON.stringify(n)),r=Object.keys(i),d=a.filter(C=>r.findIndex(ft=>parseInt(ft)==C.id)!=-1);return d=this.filterSelectedAttributes(d,i),d}filterSelectedAttributes(n,i){return n.map(r=>(g.IsNotEmpty(r.values)?r.is_multiple_selection?r.values=r.values.filter(d=>i[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==i[r.id]):i[r.id]&&(r.values=[{id:null,name:i[r.id]}]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function he(t,o){t&1&&(m(0,"span",5),f(1,"*"),c())}function ge(t,o){if(t&1&&_(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Ce(t,o){if(t&1&&_(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function be(t,o){if(t&1&&_(0,"input",8),t&2){let e=l().$implicit;s("formControlName",e.id)("placeholder",e==null?null:e.name)}}function ve(t,o){if(t&1&&(m(0,"small",5),f(1),c()),t&2){let e=l().$implicit;p(),Z(" ",e==null?null:e.name," is mandatory ")}}function ye(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),h(2,he,2,0,"span",5),m(3,"span"),f(4),c()(),h(5,ge,1,4,"ng-select",6)(6,Ce,1,3,"ng-select",7)(7,be,1,2,"input",8)(8,ve,2,1,"small",5),c()),t&2){let e=o.$implicit;p(2),b(e.is_required?2:-1),p(2),Z(" ",e==null?null:e.name," "),p(),b(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),p(3),b(e.is_required?8:-1)}}function xe(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,ye,9,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var Kt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(yt),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(E(n=>n.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),P(n=>{this.form=this.tiktokAttributeFormService.createFormGroup(n),this.listenToFormChange(n)}),tt(1)))}listenToFormChange(n){let i=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{i=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([yt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,a){i&1&&(h(0,xe,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,et,L,X,z,Q,it]});let t=o;return t})();var xt=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(pt)}getAttributes(n,i){return this.woocommerceUploadService.getAttributes(n,i).pipe(E(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();var te=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(xt),this.channelId=ht(),this.categoryId=ht(),this.attributesChanges=new k}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([xt]),O,T],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,a){i&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),c(),m(4,"ng-select",3),v(5,"async"),A("change",function(d){return a.onSelectAttribute(d)}),c()()()),i&2&&(p(4),s("items",y(5,1,a.attributes$)))},dependencies:[F,I,it,G,R,B]});let t=o;return t})();var St=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:i}]).pipe(E(r=>r))}createFormGroup(n){let i=this.formBuilder.group({});return n.forEach(a=>{i.addControl(a.variant,this.formBuilder.control(null))}),i}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Se(t,o){if(t&1&&(m(0,"div",3)(1,"div",4),f(2),c(),_(3,"ng-select",5),c()),t&2){let e=o.$implicit;p(2),Z(" ",e==null?null:e.variant," "),p(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Te(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2),M(3,Se,4,4,"div",3,w),c()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(2),U(e)}}var ee=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(St),this.attributesChanges=new k}ngOnInit(){}ngOnChanges(n){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(P(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{n=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([St]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,a){i&1&&(h(0,Te,5,1,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,G,R,B,J,L,X,z,Q]});let t=o;return t})();var Tt=(()=>{let o=class o{constructor(){this.httpService=u(nt),this.formBuilder=u(q)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(P(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(n){let i=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(r=>{i.addControl(r,this.formBuilder.control(null))}),i}};o.\u0275fac=function(i){return new(i||o)},o.\u0275prov=N({token:o,factory:o.\u0275fac});let t=o;return t})();function Ie(t,o){if(t&1&&(V(0),m(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),c(),_(6,"input",5),c(),m(7,"div",6)(8,"div",4),f(9," Product Type "),c(),_(10,"input",7),c(),m(11,"div",6)(12,"div",4),f(13," Status "),c(),_(14,"ng-select",8),c()()(),D()),t&2){let e=o.ngIf,n=l();p(),s("formGroup",n.form),p(13),s("items",e.Options.StatusOptions)}}var ie=(()=>{let o=class o{constructor(){this.attributesChanges=new k,this.shopifyFormService=u(Tt)}ngOnChanges(n){n.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(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[S([Tt]),O,T],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,a){i&1&&(h(0,Ie,15,2,"ng-container",0),v(1,"async")),i&2&&s("ngIf",y(1,1,a.attributes$))},dependencies:[F,$,I,B,J,et,L,X,z,Q,G,R]});let t=o;return t})();function Fe(t,o){if(t&1&&(m(0,"div",6),_(1,"app-product-card",9),c()),t&2){let e=o.$implicit;p(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ae(t,o){if(t&1){let e=H();V(0),m(1,"mat-checkbox",21),Pt("ngModelChange",function(i){W(e);let a=l().$implicit;return Et(a.selected,i)||(a.selected=i),Y(i)}),A("ngModelChange",function(){let i=W(e).ngIf,a=l(),r=a.$implicit,d=a.$index,C=l();return Y(C.onSelectChannel(r,d,i))}),c(),D()}if(t&2){let e=l().$implicit;p(),At("ngModel",e.selected)}}function Ee(t,o){t&1&&(m(0,"div",18),_(1,"input",22),c())}function Pe(t,o){if(t&1){let e=H();m(0,"app-channel-category-select",23),A("selectedCategory",function(i){W(e);let a=l().$index,r=l();return Y(r.onCategoryChange(a,i))}),c()}if(t&2){let e=l().$implicit,n=l();s("disabled",!e.selected||e.selected&&e.type==n.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ne(t,o){if(t&1){let e=H();m(0,"shopee-attribute-form",27),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function Oe(t,o){if(t&1){let e=H();m(0,"tiktok-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function ke(t,o){if(t&1){let e=H();m(0,"wooocommerce-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function we(t,o){if(t&1){let e=H();m(0,"tokopedia-attribute-form",28),A("attributesChanges",function(i){W(e);let a=l(2).$index,r=l();return Y(r.onAttributesChange(a,i))}),c()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Me(t,o){if(t&1&&(m(0,"div",20)(1,"div",24),h(2,Ne,1,3,"shopee-attribute-form",25)(3,Oe,1,2,"tiktok-attribute-form",26)(4,ke,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),c()()),t&2){let e,n=l().$implicit,i=l();p(2),b((e=n.type)===i.channelType.Shopee?2:e===i.channelType.Tiktok?3:e===i.channelType.WooCommerce?4:e===i.channelType.Tokopedia?5:-1)}}function Ue(t,o){if(t&1){let e=H();m(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),A("attributesChanges",function(i){W(e);let a=l().$index,r=l();return Y(r.onAttributesChange(a,i))}),c()()()}if(t&2){let e=l().$implicit;p(2),s("channelId",e.id)}}function Ve(t,o){if(t&1&&(m(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ae,2,1,"ng-container",14),v(7,"async"),c(),m(8,"div"),_(9,"app-channel-logo",15),c(),m(10,"div",16)(11,"span"),f(12),c()()()(),m(13,"div",12)(14,"div",17),h(15,Ee,2,0,"div",18)(16,Pe,1,4,"app-channel-category-select",19),c()()(),h(17,Me,6,1,"div",20)(18,Ue,3,1,"div",20),c()()),t&2){let e=o.$implicit,n=l();p(6),s("ngIf",y(7,8,n.defaultCategories$)),p(3),s("typeId",e.type)("showChannelName",!1),p(),s("matTooltip",e.name)("matTooltipShowDelay",2500),p(2),at(e.name),p(3),b(e.type==n.channelType.Shopify||e.type==n.channelType.Plugo?15:16),p(2),b(e.categoryId&&n.channelType.Lazada!=e.type&&e.selected?17:n.channelType.Shopify==e.type&&e.selected?18:-1)}}var oo=(()=>{let o=class o{constructor(){this.uploadProductService=u(st),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ut,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(tt(1))}onCategoryChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.categoryId=i,r.attributes=[]),r)))}onAttributesChange(n,i){this.channelProductUploads.update(a=>a.map((r,d)=>(d==n&&(r.attributes=i),r)))}onSelectChannel(n,i,a){this.channelProductUploads.update(r=>r.map((d,C)=>{if(C==i&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);d.categoryId=_t?.DefaultCategoryID}return C==i&&!n.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(n,i){return i.find(a=>a.ID===n)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=x({type:o,selectors:[["app-product-upload"]],standalone:!0,features:[S([mt,Gt,jt,pt]),T],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,a){if(i&1&&(m(0,"mainpanel",0)(1,"actions")(2,"button",1),A("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),c()(),m(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),c(),m(9,"div",5),M(10,Fe,2,7,"div",6,w),v(12,"async"),c(),m(13,"h3",7),f(14,"Channel To Upload"),c(),M(15,Ve,19,10,"div",8,w),c()()()),i&2){let r;s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),U(y(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[F,$,I,Ht,Lt,$t,Jt,Xt,Rt,Bt,it,L,Nt,Dt,Vt,Zt,Kt,te,ee,ie,Wt,qt],encapsulation:2});let t=o;return t})();export{oo as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-NNQLRLNB.js";import"./chunk-O4CRP4WO.js";import{a as ce}from"./chunk-
|
|
1
|
+
import{a as he}from"./chunk-NNQLRLNB.js";import"./chunk-O4CRP4WO.js";import{a as ce}from"./chunk-T3WVEP7H.js";import{a as se}from"./chunk-7LZ5ZSXM.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-DLNXH2FE.js";import"./chunk-BVIRHZTZ.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as le}from"./chunk-N32A3EYJ.js";import"./chunk-ADRVUMMW.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{j as M}from"./chunk-URIFQ2VU.js";import{b as te,e as ne}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-BSN7ZAXG.js";import{c as D}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as C,Cd as K,Da as b,Ea as P,Eb as I,G as B,Gb as d,Gc as v,Hc as y,Sb as c,Tb as p,Ub as U,Vb as G,Wb as W,Xb as H,Yb as N,bc as g,ea as k,ja as j,jb as h,kb as m,nc as _,pa as S,rc as L,sc as T,ta as A,tc as E,uc as z,vc as $,vd as Q,xb as w,yd as J}from"./chunk-PQDPS2ID.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},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(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["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"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["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(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-TQ3TU52C.js";import{a as Ue}from"./chunk-B5G3NXGZ.js";import{a as Ke}from"./chunk-6U6JR5K6.js";import"./chunk-7LZ5ZSXM.js";import{a as E}from"./chunk-BVIRHZTZ.js";import"./chunk-3Q2URG6A.js";import"./chunk-BH24WP3G.js";import{b as Je}from"./chunk-JXTGH22T.js";import{c as Ze}from"./chunk-ADRVUMMW.js";import{b as Ye}from"./chunk-BQ7NR3ET.js";import{c as qe}from"./chunk-UMNGKENU.js";import{a as f}from"./chunk-RJQGJK46.js";import{g as Qe}from"./chunk-HCDKYABV.js";import{a as Be,d as Re,e as $}from"./chunk-CCXKODFV.js";import{a as Pe,c as ze,j as Le}from"./chunk-5GM7EMCW.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{a as Ve,g as He,j as J,n as Ge}from"./chunk-BO4PPSB5.js";import{t as We,u as F}from"./chunk-HUUFOAKH.js";import{F as je,K as Z,u as $e,x as Fe}from"./chunk-E5GGIVK7.js";import{h as Ee,m as De,y as U,z as ke}from"./chunk-BSN7ZAXG.js";import{e as Ne,f as Ae}from"./chunk-64G3XLI6.js";import{n as Te,p as Oe,q as we,r as Y}from"./chunk-OVEJFFL6.js";import{$b as O,Bb as me,Cd as M,Da as I,Ea as T,Eb as h,G as ee,Gb as d,Gc as q,Hb as pe,Hc as Q,Ib as z,Jc as R,Kb as G,M as te,Na as re,Nb as ge,Pa as P,R as ie,Sb as l,Tb as s,Ub as b,Uc as be,Va as le,Vb as N,Wb as A,Yb as he,bc as c,bd as V,ca as ne,f as H,gb as se,gd as Ce,hc as fe,ic as ue,jb as r,jc as _e,ka as u,kb as g,ld as ve,mc as L,nc as p,oc as y,pa as x,pc as w,qb as de,sb as ce,sd as ye,ta as v,ua as _,ud as Me,v as k,va as ae,vc as B,vd as Se,yd as xe,za as oe,zd as Ie}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var j=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[E.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[E.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[E.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[E.channelView]},{Icon:"fas fa-file-alt",Title:"Dev Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${Pe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var rt=0,Xe="mat-badge-content",W=new Set,lt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-component"]],standalone:!0,features:[B],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let t=e;return t})(),et=(()=>{let e=class e{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,m,S){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=m,this._animationMode=S,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=rt++,this._isInitialized=!1,this._interactivityChecker=x(Fe),this._document=x(ve);let C=x(be);if(!W.has(C)){W.add(C);let X=Ce(lt,{environmentInjector:x(oe)});C.onDestroy(()=>{W.delete(C),W.size===0&&X.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(Xe),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Xe}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};e.\u0275fac=function(n){return new(n||e)(g(ce),g(re),g($e),g(de),g(le,8))},e.\u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&z("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",V],disabled:[2,"matBadgeDisabled","disabled",V],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",V]},standalone:!0,features:[me]});let t=e;return t})(),tt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[je,Z,Z]});let t=e;return t})();function dt(t,e){if(t&1&&(N(0),l(1,"p",23),p(2),s(),A()),t&2){let o=c(3).$implicit;r(2),w(" ",o.Title," ")}}function ct(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function mt(t,e){if(t&1&&(l(0,"a",22),b(1,"i"),h(2,dt,3,1,"ng-container",20)(3,ct,2,1,"ng-template",null,1,R),s()),t&2){let o=L(4),i=c(2).$implicit;d("href",i.Url,se),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function pt(t,e){if(t&1&&(N(0),h(1,mt,5,5,"a",21),A()),t&2){let o=c().$implicit;r(),d("ngxPermissionsOnly",o.Roles)}}function gt(t,e){if(t&1&&(l(0,"p",23),p(1),s()),t&2){let o=c(4).$implicit;r(),w(" ",o.Title," ")}}function ht(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(4).$implicit;r(),y(o.Title)}}function ft(t,e){if(t&1&&(N(0),h(1,gt,2,1,"p",23),q(2,"async"),h(3,ht,2,1,"p"),A()),t&2){let o=c(4);r(),ge(Q(2,1,o.notifications$)!=0?1:3)}}function ut(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function _t(t,e){if(t&1&&(l(0,"a",25),b(1,"i"),h(2,ft,4,3,"ng-container",20)(3,ut,2,1,"ng-template",null,2,R),s()),t&2){let o=L(4),i=c(2).$implicit,n=c();d("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function bt(t,e){if(t&1&&h(0,_t,5,6,"a",24),t&2){let o=c().$implicit;d("ngxPermissionsOnly",o.Roles)}}function Ct(t,e){if(t&1&&(l(0,"li",19),h(1,pt,2,1,"ng-container",20)(2,bt,1,1,"ng-template",null,0,R),s()),t&2){let o=e.$implicit,i=L(3);r(),d("ngIf",o.ExternalLink)("ngIfElse",i)}}var it=(()=>{let e=class e{constructor(i,n,a,m){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=m,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new j().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(k(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};e.\u0275fac=function(n){return new(n||e)(g(Ve),g(Ue),g(ze),g(Le))},e.\u0275cmp=v({type:e,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(l(0,"div",3),q(1,"async"),l(2,"div",4)(3,"button",5),O("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),s(),l(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),l(9,"div",10)(10,"div",11),p(11),s(),b(12,"div",12),l(13,"a",13),O("click",function(){return a.onLogout()}),b(14,"i",14),p(15,"\xA0 "),l(16,"span"),p(17," Log Out"),s()()()()(),l(18,"div",15)(19,"ul",16),h(20,Ct,4,2,"li",17),s()()(),l(21,"div",18),b(22,"router-outlet"),s()()),n&2&&(z("nav-open",Q(1,7,a.toggleState$)),r(2),d("ngClass",a.isCollapseSidebar?"collapses":""),r(2),d("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),w(" ",a.storeName," "),r(3),w(" ",a.token==null?null:a.token.LID," "),r(9),d("ngForOf",a.Menu))},dependencies:[ye,Me,Se,Te,Oe,we,We,et,Ne,xe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let t=e;return t})();var vt=[{path:"",component:it,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-OXWBU2ND.js").then(t=>t.DashboardModule),canActivate:[f],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-7K2MZBIS.js").then(t=>t.ProductModule),canActivate:[f],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-F56CFYMK.js").then(t=>t.InventoryRoutingModule),canActivate:[f],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-H34Q3GYZ.js").then(t=>t.PriceRoutingModule),canActivate:[f],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-LEUYZTMQ.js").then(t=>t.OrdersModule),canActivate:[f],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-LFO4SCWH.js").then(t=>t.ReportModule),canActivate:[f],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-VO7GA6OK.js").then(t=>t.LogisticModule),canActivate:[f],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-WX2SZ2RT.js").then(t=>t.ChannelsModule),canActivate:[f],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-4A32CGYJ.js").then(t=>t.LogsModule),canActivate:[f],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-YH6ZV7UM.js").then(t=>t.NotificationModule),canActivate:[f],data:{title:"Push Notification"}}]}],nt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[Y.forChild(vt),Y]});let t=e;return t})();var Mt=["selectId"];function St(t,e){if(t&1&&(l(0,"span",3),p(1),s()),t&2){let o=e.item,i=c();d("title",o[i.bindLabel]),r(),y(o[i.bindLabel])}}var at=(()=>{let e=class e{set items(i){this.ngSelectInfiniteScroll.data=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(i){this._selected=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new K,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(i){i?(this.selectedChange.emit(i[this.bindValue]),this.selectedLabel.emit(i[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(n,a){if(n&1&&fe(Mt,7),n&2){let m;ue(m=_e())&&(a.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[B],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(n,a){if(n&1){let m=he();l(0,"ng-select",1,0),O("clear",function(){return I(m),T(a.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return I(m),T(a.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return I(m),T(a.onOpenSelect())})("change",function(C){return I(m),T(a.onSelectChange(C))}),h(2,St,2,2,"ng-template",2),s()}n&2&&(pe("width",a.width),d("appendTo",a.parent)("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable))},dependencies:[M,$,Re,Be,U,Ee,De]});let t=e;return t})(),K=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new H,this._destroy$=new H,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(te(200),ie(),k(e=>(e&&(e=e.toLowerCase()),this.filterData(e))),ee(e=>e!==void 0),ne(this._destroy$)).subscribe(e=>{this._dataBuffer=e.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(e){let o=-1,i;return this._data.filter(a=>(i=JSON.stringify(a).toLowerCase(),o=i.indexOf(e),o!==-1||e==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(e){this._data=e||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(e,o){if(Ke.IsNotEmpty(e)){let i=this._data.filter(n=>n[o].toString().toLowerCase().indexOf(e)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(e){this._bufferSize=e}onScrollToEnd(){this.fetchMore()}fetchMore(){let e=this._dataBuffer.length,o=this._data.slice(e,this._bufferSize+e);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(o)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var ot=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[M,U,He,qe,Ze,Qe,Ye,Je,F,J,at,$,ke]});let t=e;return t})();var _n=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({providers:[Ie],imports:[M,nt,Ge,F,ot,tt,Ae.forChild()]});let t=e;return t})();export{_n as MenuModule};
|
|
1
|
+
import"./chunk-TQ3TU52C.js";import{a as Ue}from"./chunk-H55NKEAI.js";import{a as Ke}from"./chunk-6U6JR5K6.js";import"./chunk-7LZ5ZSXM.js";import{a as E}from"./chunk-BVIRHZTZ.js";import"./chunk-CQDJKP6M.js";import"./chunk-RO462W6B.js";import{b as Je}from"./chunk-JXTGH22T.js";import{c as Ze}from"./chunk-ADRVUMMW.js";import{b as Ye}from"./chunk-BQ7NR3ET.js";import{c as qe}from"./chunk-UMNGKENU.js";import{a as f}from"./chunk-YABCFRJB.js";import{g as Qe}from"./chunk-HCDKYABV.js";import{a as Be,d as Re,e as $}from"./chunk-CCXKODFV.js";import{a as Pe,c as ze,j as Le}from"./chunk-URIFQ2VU.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{a as Ve,g as He,j as J,n as Ge}from"./chunk-BO4PPSB5.js";import{t as We,u as F}from"./chunk-HUUFOAKH.js";import{F as je,K as Z,u as $e,x as Fe}from"./chunk-E5GGIVK7.js";import{h as Ee,m as De,y as U,z as ke}from"./chunk-BSN7ZAXG.js";import{e as Ne,f as Ae}from"./chunk-64G3XLI6.js";import{n as Te,p as Oe,q as we,r as Y}from"./chunk-OVEJFFL6.js";import{$b as O,Bb as me,Cd as M,Da as I,Ea as T,Eb as h,G as ee,Gb as d,Gc as q,Hb as pe,Hc as Q,Ib as z,Jc as R,Kb as G,M as te,Na as re,Nb as ge,Pa as P,R as ie,Sb as l,Tb as s,Ub as b,Uc as be,Va as le,Vb as N,Wb as A,Yb as he,bc as c,bd as V,ca as ne,f as H,gb as se,gd as Ce,hc as fe,ic as ue,jb as r,jc as _e,ka as u,kb as g,ld as ve,mc as L,nc as p,oc as y,pa as x,pc as w,qb as de,sb as ce,sd as ye,ta as v,ua as _,ud as Me,v as k,va as ae,vc as B,vd as Se,yd as xe,za as oe,zd as Ie}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var j=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[E.dashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/Order",Roles:[E.orderView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[E.orderView]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[E.channelView]},{Icon:"fas fa-file-alt",Title:"Dev Logs",Url:"/menu/log",Roles:[]},{Icon:"fas fa-bell",Title:"Notification",Url:"/menu/notification",Badge:!0,Roles:[]},{Icon:"fa-solid fa-wand-magic-sparkles",Title:"What`s New",Url:`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${Pe.version}`,ExternalLink:!0,CustomColor:"#ff2323",Badge:!0,Roles:[]}]}get getMenu(){return this.menus}};var rt=0,Xe="mat-badge-content",W=new Set,lt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-component"]],standalone:!0,features:[B],decls:0,vars:0,template:function(n,a){},styles:[".mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color);color:var(--mat-badge-text-color);font-family:var(--mat-badge-text-font);font-weight:var(--mat-badge-text-weight);border-radius:var(--mat-badge-container-shape)}.cdk-high-contrast-active .mat-badge-content{outline:solid 1px;border-radius:0}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color);color:var(--mat-badge-disabled-state-text-color)}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, unset);min-height:var(--mat-badge-small-size-container-size, unset);line-height:var(--mat-badge-legacy-small-size-container-size, var(--mat-badge-small-size-container-size));padding:var(--mat-badge-small-size-container-padding);font-size:var(--mat-badge-small-size-text-size);margin:var(--mat-badge-small-size-container-offset)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, unset);min-height:var(--mat-badge-container-size, unset);line-height:var(--mat-badge-legacy-container-size, var(--mat-badge-container-size));padding:var(--mat-badge-container-padding);font-size:var(--mat-badge-text-size);margin:var(--mat-badge-container-offset)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, unset);min-height:var(--mat-badge-large-size-container-size, unset);line-height:var(--mat-badge-legacy-large-size-container-size, var(--mat-badge-large-size-container-size));padding:var(--mat-badge-large-size-container-padding);font-size:var(--mat-badge-large-size-text-size);margin:var(--mat-badge-large-size-container-offset)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset)}"],encapsulation:2,changeDetection:0});let t=e;return t})(),et=(()=>{let e=class e{get color(){return this._color}set color(i){this._setColor(i),this._color=i}get content(){return this._content}set content(i){this._updateRenderedContent(i)}get description(){return this._description}set description(i){this._updateDescription(i)}constructor(i,n,a,m,S){this._ngZone=i,this._elementRef=n,this._ariaDescriber=a,this._renderer=m,this._animationMode=S,this._color="primary",this.overlap=!0,this.position="above after",this.size="medium",this._id=rt++,this._isInitialized=!1,this._interactivityChecker=x(Fe),this._document=x(ve);let C=x(be);if(!W.has(C)){W.add(C);let X=Ce(lt,{environmentInjector:x(oe)});C.onDestroy(()=>{W.delete(C),W.size===0&&X.destroy()})}}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",`mat-badge-content-${this._id}`),i.setAttribute("aria-hidden","true"),i.classList.add(Xe),this._animationMode==="NoopAnimations"&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Xe}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}};e.\u0275fac=function(n){return new(n||e)(g(ce),g(re),g($e),g(de),g(le,8))},e.\u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&z("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",V],disabled:[2,"matBadgeDisabled","disabled",V],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",V]},standalone:!0,features:[me]});let t=e;return t})(),tt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[je,Z,Z]});let t=e;return t})();function dt(t,e){if(t&1&&(N(0),l(1,"p",23),p(2),s(),A()),t&2){let o=c(3).$implicit;r(2),w(" ",o.Title," ")}}function ct(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function mt(t,e){if(t&1&&(l(0,"a",22),b(1,"i"),h(2,dt,3,1,"ng-container",20)(3,ct,2,1,"ng-template",null,1,R),s()),t&2){let o=L(4),i=c(2).$implicit;d("href",i.Url,se),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function pt(t,e){if(t&1&&(N(0),h(1,mt,5,5,"a",21),A()),t&2){let o=c().$implicit;r(),d("ngxPermissionsOnly",o.Roles)}}function gt(t,e){if(t&1&&(l(0,"p",23),p(1),s()),t&2){let o=c(4).$implicit;r(),w(" ",o.Title," ")}}function ht(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(4).$implicit;r(),y(o.Title)}}function ft(t,e){if(t&1&&(N(0),h(1,gt,2,1,"p",23),q(2,"async"),h(3,ht,2,1,"p"),A()),t&2){let o=c(4);r(),ge(Q(2,1,o.notifications$)!=0?1:3)}}function ut(t,e){if(t&1&&(l(0,"p"),p(1),s()),t&2){let o=c(3).$implicit;r(),y(o.Title)}}function _t(t,e){if(t&1&&(l(0,"a",25),b(1,"i"),h(2,ft,4,3,"ng-container",20)(3,ut,2,1,"ng-template",null,2,R),s()),t&2){let o=L(4),i=c(2).$implicit,n=c();d("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),r(),G(i.Icon),r(),d("ngIf",i.Badge)("ngIfElse",o)}}function bt(t,e){if(t&1&&h(0,_t,5,6,"a",24),t&2){let o=c().$implicit;d("ngxPermissionsOnly",o.Roles)}}function Ct(t,e){if(t&1&&(l(0,"li",19),h(1,pt,2,1,"ng-container",20)(2,bt,1,1,"ng-template",null,0,R),s()),t&2){let o=e.$implicit,i=L(3);r(),d("ngIf",o.ExternalLink)("ngIfElse",i)}}var it=(()=>{let e=class e{constructor(i,n,a,m){this.toggleSidebarService=i,this.notificationService=n,this.decodeTokenService=a,this.authService=m,this.Menu={},this.isCollapseSidebar=!1,this.token=a.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new j().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(k(i=>i.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(i){if(i){let n,a=i.split(" ");return a.length==1?n=a[0].substring(0,2):n=a.shift().charAt(0)+a.pop().charAt(0),n}}};e.\u0275fac=function(n){return new(n||e)(g(Ve),g(Ue),g(ze),g(Le))},e.\u0275cmp=v({type:e,selectors:[["app-menu"]],decls:23,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(n,a){n&1&&(l(0,"div",3),q(1,"async"),l(2,"div",4)(3,"button",5),O("click",function(){return a.onCallapseSidebar()}),b(4,"i",6),s(),l(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),l(9,"div",10)(10,"div",11),p(11),s(),b(12,"div",12),l(13,"a",13),O("click",function(){return a.onLogout()}),b(14,"i",14),p(15,"\xA0 "),l(16,"span"),p(17," Log Out"),s()()()()(),l(18,"div",15)(19,"ul",16),h(20,Ct,4,2,"li",17),s()()(),l(21,"div",18),b(22,"router-outlet"),s()()),n&2&&(z("nav-open",Q(1,7,a.toggleState$)),r(2),d("ngClass",a.isCollapseSidebar?"collapses":""),r(2),d("ngClass",a.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),r(4),w(" ",a.storeName," "),r(3),w(" ",a.token==null?null:a.token.LID," "),r(9),d("ngForOf",a.Menu))},dependencies:[ye,Me,Se,Te,Oe,we,We,et,Ne,xe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let t=e;return t})();var vt=[{path:"",component:it,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"dashboard",loadChildren:()=>import("./chunk-OXWBU2ND.js").then(t=>t.DashboardModule),canActivate:[f],data:{title:"Dashboard"}},{path:"products",loadChildren:()=>import("./chunk-KV5BTGHC.js").then(t=>t.ProductModule),canActivate:[f],data:{title:"Products"}},{path:"inventory",loadChildren:()=>import("./chunk-RD7TNSQ6.js").then(t=>t.InventoryRoutingModule),canActivate:[f],data:{title:"Inventory"}},{path:"price",loadChildren:()=>import("./chunk-LCI6K3VT.js").then(t=>t.PriceRoutingModule),canActivate:[f],data:{title:"Price"}},{path:"Order",loadChildren:()=>import("./chunk-LVBW3RA4.js").then(t=>t.OrdersModule),canActivate:[f],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-RAU34TVA.js").then(t=>t.ReportModule),canActivate:[f],data:{title:"Report"}},{path:"Logistic",loadChildren:()=>import("./chunk-IOAFNXIL.js").then(t=>t.LogisticModule),canActivate:[f],data:{title:"Logistic"}},{path:"channel",loadChildren:()=>import("./chunk-YUNZRPV3.js").then(t=>t.ChannelsModule),canActivate:[f],data:{title:"Marketplace"}},{path:"log",loadChildren:()=>import("./chunk-ZMWENHWA.js").then(t=>t.LogsModule),canActivate:[f],data:{title:"Orders"}},{path:"notification",loadChildren:()=>import("./chunk-2QZHXMW7.js").then(t=>t.NotificationModule),canActivate:[f],data:{title:"Push Notification"}}]}],nt=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[Y.forChild(vt),Y]});let t=e;return t})();var Mt=["selectId"];function St(t,e){if(t&1&&(l(0,"span",3),p(1),s()),t&2){let o=e.item,i=c();d("title",o[i.bindLabel]),r(),y(o[i.bindLabel])}}var at=(()=>{let e=class e{set items(i){this.ngSelectInfiniteScroll.data=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(i){this._selected=i,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new K,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(i){i?(this.selectedChange.emit(i[this.bindValue]),this.selectedLabel.emit(i[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(n,a){if(n&1&&fe(Mt,7),n&2){let m;ue(m=_e())&&(a.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[B],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(n,a){if(n&1){let m=he();l(0,"ng-select",1,0),O("clear",function(){return I(m),T(a.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return I(m),T(a.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return I(m),T(a.onOpenSelect())})("change",function(C){return I(m),T(a.onSelectChange(C))}),h(2,St,2,2,"ng-template",2),s()}n&2&&(pe("width",a.width),d("appendTo",a.parent)("disabled",a.disabled)("virtualScroll",!0)("typeahead",a.ngSelectInfiniteScroll.input$)("items",a.ngSelectInfiniteScroll.bufferData)("bindLabel",a.bindLabel)("bindValue",a.bindValue)("placeholder",a.placeholder)("ngModel",a.selected)("clearable",a.clearable))},dependencies:[M,$,Re,Be,U,Ee,De]});let t=e;return t})(),K=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new H,this._destroy$=new H,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(te(200),ie(),k(e=>(e&&(e=e.toLowerCase()),this.filterData(e))),ee(e=>e!==void 0),ne(this._destroy$)).subscribe(e=>{this._dataBuffer=e.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(e){let o=-1,i;return this._data.filter(a=>(i=JSON.stringify(a).toLowerCase(),o=i.indexOf(e),o!==-1||e==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(e){this._data=e||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(e,o){if(Ke.IsNotEmpty(e)){let i=this._data.filter(n=>n[o].toString().toLowerCase().indexOf(e)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(e){this._bufferSize=e}onScrollToEnd(){this.fetchMore()}fetchMore(){let e=this._dataBuffer.length,o=this._data.slice(e,this._bufferSize+e);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(o)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var ot=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({imports:[M,U,He,qe,Ze,Qe,Ye,Je,F,J,at,$,ke]});let t=e;return t})();var _n=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=_({type:e}),e.\u0275inj=u({providers:[Ie],imports:[M,nt,Ge,F,ot,tt,Ae.forChild()]});let t=e;return t})();export{_n as MenuModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ct}from"./chunk-BH24WP3G.js";import{a as Ct}from"./chunk-BQ7NR3ET.js";import{a as ht,b as ft}from"./chunk-UMNGKENU.js";import{f as gt}from"./chunk-HCDKYABV.js";import{b as D,c as E,i as k,j as w}from"./chunk-BO4PPSB5.js";import{t as P}from"./chunk-HUUFOAKH.js";import{X as mt}from"./chunk-E5GGIVK7.js";import{h as st,m as pt}from"./chunk-BSN7ZAXG.js";import{b as m,c as f}from"./chunk-64G3XLI6.js";import{o as dt}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as rt,Da as L,Ea as F,Eb as C,Fb as z,Gb as p,Gc as x,Hc as O,Jc as ot,Nb as G,Ob as et,Qb as nt,Rb as it,Sb as a,Tb as r,Ub as y,Vb as H,Wb as J,Yb as R,Z as X,bc as h,gb as I,jb as l,kb as g,mc as at,nc as s,oc as u,pa as Z,pc as S,rc as V,sc as U,sd as B,ta as T,tc as A,ud as K,v as Q,vd as $,xb as tt,xc as W,yd as lt}from"./chunk-PQDPS2ID.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),F(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),F(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),F(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>(this.selectedChannel.LastSync=e.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null)),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Lt(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Lt,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
|
|
1
|
+
import{a as ct}from"./chunk-RO462W6B.js";import{a as Ct}from"./chunk-BQ7NR3ET.js";import{a as ht,b as ft}from"./chunk-UMNGKENU.js";import{f as gt}from"./chunk-HCDKYABV.js";import{b as D,c as E,i as k,j as w}from"./chunk-BO4PPSB5.js";import{t as P}from"./chunk-HUUFOAKH.js";import{X as mt}from"./chunk-E5GGIVK7.js";import{h as st,m as pt}from"./chunk-BSN7ZAXG.js";import{b as m,c as f}from"./chunk-64G3XLI6.js";import{o as dt}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as rt,Da as L,Ea as F,Eb as C,Fb as z,Gb as p,Gc as x,Hc as O,Jc as ot,Nb as G,Ob as et,Qb as nt,Rb as it,Sb as a,Tb as r,Ub as y,Vb as H,Wb as J,Yb as R,Z as X,bc as h,gb as I,jb as l,kb as g,mc as at,nc as s,oc as u,pa as Z,pc as S,rc as V,sc as U,sd as B,ta as T,tc as A,ud as K,v as Q,vd as $,xb as tt,xc as W,yd as lt}from"./chunk-PQDPS2ID.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),F(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),F(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){L(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),F(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>(this.selectedChannel.LastSync=e.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null)),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Lt(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Lt,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-RENQ3YZH.js";import{b as le}from"./chunk-LB6JFX4H.js";import{a as pe,b as me}from"./chunk-WT6W7RAQ.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-CCXKODFV.js";import{j as Z}from"./chunk-
|
|
1
|
+
import{a as re}from"./chunk-RENQ3YZH.js";import{b as le}from"./chunk-LB6JFX4H.js";import{a as pe,b as me}from"./chunk-WT6W7RAQ.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-CCXKODFV.js";import{j as Z}from"./chunk-URIFQ2VU.js";import{e as Y}from"./chunk-E3NPUJ23.js";import{m as ae,n as oe}from"./chunk-BO4PPSB5.js";import{h as G,m as K,y as Q}from"./chunk-BSN7ZAXG.js";import{c as X}from"./chunk-64G3XLI6.js";import{$b as x,Ad as H,Cd as U,Da as P,Ea as R,Eb as u,Gb as h,Gc as c,Hc as d,Ic as J,Nb as B,Ob as T,Qb as $,Rb as F,Sb as a,Tb as o,Ub as f,Yb as j,Z as D,aa as w,bc as y,g as I,gb as v,ja as E,jb as p,nc as s,oc as C,pa as g,pc as b,rc as O,sc as q,ta as N,tc as z,uc as A,v as M,vc as V,yd as W,zd as k}from"./chunk-PQDPS2ID.js";import{a as S}from"./chunk-GNOSNGXM.js";var L=(()=>{let t=class t{constructor(){this.httpService=g(Y),this._pageination=new I({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(w(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=S(S({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac});let i=t;return i})();function ce(i,t){if(i&1&&(a(0,"span",10),f(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,v)("alt",l.Name),p(),b(" ",l.Name," ")}}function de(i,t){if(i&1&&(a(0,"tr")(1,"td"),f(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td"),s(6),c(7,"json"),o(),a(8,"td"),s(9),c(10,"json"),o(),a(11,"td"),s(12),c(13,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,v),p(2),b(" ",l.ChannelName," "),p(2),C(d(7,5,l.Request)),p(3),C(d(10,7,l.Response)),p(3),C(J(13,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function he(i,t){if(i&1){let l=j();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),$(13,de,14,12,"tr",null,T),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),x("page",function(e){P(l);let r=y();return R(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=y();p(13),F((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function ge(i,t){i&1&&(a(0,"div",9),f(1,"app-empty-state"),o())}var ze=(()=>{let t=class t{constructor(){this.channelLogService=g(L),this.authService=g(Z),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(M(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=X.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=N({type:t,selectors:[["app-channel-log"]],standalone:!0,features:[A([L]),V],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),x("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),z("ngModelChange",function(_){return q(r.channelID,_)||(r.channelID=_),_}),u(7,ce,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,he,21,13,"div",8),c(13,"async"),u(14,ge,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),O("ngModel",r.channelID),p(6),B(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[U,W,H,k,oe,ae,re,me,pe,le,ie,ne,ee,te,Q,G,K]});let i=t;return i})();export{ze as a};
|